@redocly/reference-docs 2.31.0 → 2.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli/commands/redocly-docs-cli.min.js +3 -3
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
- package/dist/console.redocly-reference-docs.min.js +57 -57
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +38 -38
- package/lib/components/console/OAuth2Flow.d.ts +1 -1
- package/lib/components/console/OpenIDConnect.js +1 -1
- package/lib/redoc-lib/src/services/models/Schema.js +1 -1
- package/lib/services/OpenIDConnect.d.ts +1 -1
- package/lib-esm/components/console/OAuth2Flow.d.ts +1 -1
- package/lib-esm/components/console/OpenIDConnect.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/Schema.js +1 -1
- package/lib-esm/services/OpenIDConnect.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ var xr=Math.pow;/*!
|
|
|
2
2
|
* Redocly Reference Docs
|
|
3
3
|
* (c) Copyright 2018 Redocly LLC, all rights reserved.
|
|
4
4
|
* -------------------------------------------------------------
|
|
5
|
-
* Version: "2.31.
|
|
5
|
+
* Version: "2.31.1"
|
|
6
6
|
*/(this.webpackChunkRedoclyReferenceDocs=this.webpackChunkRedoclyReferenceDocs||[]).push([[290],{66419:(h,I,o)=>{h.exports=o(27698)},77766:(h,I,o)=>{h.exports=o(8065)},72119:(h,I,o)=>{h.exports=o(57448)},20116:(h,I,o)=>{h.exports=o(11955)},94473:(h,I,o)=>{h.exports=o(61577)},78580:(h,I,o)=>{h.exports=o(33778)},2991:(h,I,o)=>{h.exports=o(61798)},3649:(h,I,o)=>{h.exports=o(82073)},92762:(h,I,o)=>{h.exports=o(2348)},59340:(h,I,o)=>{h.exports=o(8933)},51942:(h,I,o)=>{h.exports=o(63383)},26295:(h,I,o)=>{h.exports=o(86209)},86902:(h,I,o)=>{h.exports=o(23059)},93476:(h,I,o)=>{h.exports=o(27460)},52424:(h,I,o)=>{h.exports=o(72010)},53592:(h,I,o)=>{h.exports=o(27385)},78363:(h,I,o)=>{h.exports=o(81522)},19996:(h,I,o)=>{h.exports=o(32209)},30699:(h,I,o)=>{h.exports=o(44442)},28834:(h,I,o)=>{h.exports=o(57152)},95683:(h,I,o)=>{h.exports=o(69447)},95238:(h,I,o)=>{h.exports=o(81493)},189:(h,I,o)=>{h.exports=o(76094)},32752:(h,I,o)=>{h.exports=o(70573)},44341:(h,I,o)=>{h.exports=o(73685)},58377:(h,I,o)=>{h.exports=o(27533)},13038:(h,I,o)=>{h.exports=o(39057)},63263:(h,I,o)=>{h.exports=o(84710)},24889:(h,I,o)=>{h.exports=o(74303)},89356:(h,I,o)=>{h.exports=o(93799)},79542:(h,I,o)=>{h.exports=o(55122)},69798:(h,I,o)=>{h.exports=o(29531)},13535:(h,I,o)=>{h.exports=o(10856)},83863:(h,I,o)=>{h.exports=o(31524)},51446:(h,I,o)=>{h.exports=o(86600)},23882:(h,I,o)=>{h.exports=o(9759)},63109:(h,I,o)=>{h.exports=o(35666)},79742:(h,I)=>{"use strict";I.byteLength=g,I.toByteArray=D,I.fromByteArray=q;for(var o=[],c=[],v=typeof Uint8Array!="undefined"?Uint8Array:Array,x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,b=x.length;d<b;++d)o[d]=x[d],c[x.charCodeAt(d)]=d;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;function S(W){var M=W.length;if(M%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var X=W.indexOf("=");X===-1&&(X=M);var R=X===M?0:4-X%4;return[X,R]}function g(W){var M=S(W),X=M[0],R=M[1];return(X+R)*3/4-R}function L(W,M,X){return(M+X)*3/4-X}function D(W){var M,X=S(W),R=X[0],C=X[1],V=new v(L(W,R,C)),J=0,_=C>0?R-4:R,Q;for(Q=0;Q<_;Q+=4)M=c[W.charCodeAt(Q)]<<18|c[W.charCodeAt(Q+1)]<<12|c[W.charCodeAt(Q+2)]<<6|c[W.charCodeAt(Q+3)],V[J++]=M>>16&255,V[J++]=M>>8&255,V[J++]=M&255;return C===2&&(M=c[W.charCodeAt(Q)]<<2|c[W.charCodeAt(Q+1)]>>4,V[J++]=M&255),C===1&&(M=c[W.charCodeAt(Q)]<<10|c[W.charCodeAt(Q+1)]<<4|c[W.charCodeAt(Q+2)]>>2,V[J++]=M>>8&255,V[J++]=M&255),V}function B(W){return o[W>>18&63]+o[W>>12&63]+o[W>>6&63]+o[W&63]}function j(W,M,X){for(var R,C=[],V=M;V<X;V+=3)R=(W[V]<<16&16711680)+(W[V+1]<<8&65280)+(W[V+2]&255),C.push(B(R));return C.join("")}function q(W){for(var M,X=W.length,R=X%3,C=[],V=16383,J=0,_=X-R;J<_;J+=V)C.push(j(W,J,J+V>_?_:J+V));return R===1?(M=W[X-1],C.push(o[M>>2]+o[M<<4&63]+"==")):R===2&&(M=(W[X-2]<<8)+W[X-1],C.push(o[M>>10]+o[M>>4&63]+o[M<<2&63]+"=")),C.join("")}},50706:(h,I,o)=>{var c=o(48764).Buffer;(function(){"use strict";function v(x){var d;return x instanceof c?d=x:d=c.from(x.toString(),"binary"),d.toString("base64")}h.exports=v})()},48764:(h,I,o)=>{"use strict";/*!
|
|
7
7
|
* The buffer module from node.js, for the browser.
|
|
8
8
|
*
|
|
@@ -18,27 +18,27 @@ var xr=Math.pow;/*!
|
|
|
18
18
|
`),ae=ce+he.length,Fe=he[he.length-1].length;return{from:v(ae,Fe),to:v(ae+fe.length-1,fe.length==1?Fe+fe[0].length:fe[fe.length-1].length),match:we}}}}var j,q;String.prototype.normalize?(j=function(C){return C.normalize("NFD").toLowerCase()},q=function(C){return C.normalize("NFD")}):(j=function(C){return C.toLowerCase()},q=function(C){return C});function W(C,V,J,_){if(C.length==V.length)return J;for(var Q=0,Y=J+Math.max(0,C.length-V.length);;){if(Q==Y)return Q;var ce=Q+Y>>1,ee=_(C.slice(0,ce)).length;if(ee==J)return ce;ee>J?Y=ce:Q=ce+1}}function M(C,V,J,_){if(!V.length)return null;var Q=_?j:q,Y=Q(V).split(/\r|\n\r?/);e:for(var ce=J.line,ee=J.ch,ie=C.lastLine()+1-Y.length;ce<=ie;ce++,ee=0){var xe=C.getLine(ce).slice(ee),we=Q(xe);if(Y.length==1){var he=we.indexOf(Y[0]);if(he==-1)continue e;var J=W(xe,we,he,Q)+ee;return{from:v(ce,W(xe,we,he,Q)+ee),to:v(ce,W(xe,we,he+Y[0].length,Q)+ee)}}else{var fe=we.length-Y[0].length;if(we.slice(fe)!=Y[0])continue e;for(var ae=1;ae<Y.length-1;ae++)if(Q(C.getLine(ce+ae))!=Y[ae])continue e;var Fe=C.getLine(ce+Y.length-1),Le=Q(Fe),Me=Y[Y.length-1];if(Le.slice(0,Me.length)!=Me)continue e;return{from:v(ce,W(xe,we,fe,Q)+ee),to:v(ce+Y.length-1,W(Fe,Le,Me.length,Q))}}}}function X(C,V,J,_){if(!V.length)return null;var Q=_?j:q,Y=Q(V).split(/\r|\n\r?/);e:for(var ce=J.line,ee=J.ch,ie=C.firstLine()-1+Y.length;ce>=ie;ce--,ee=-1){var xe=C.getLine(ce);ee>-1&&(xe=xe.slice(0,ee));var we=Q(xe);if(Y.length==1){var he=we.lastIndexOf(Y[0]);if(he==-1)continue e;return{from:v(ce,W(xe,we,he,Q)),to:v(ce,W(xe,we,he+Y[0].length,Q))}}else{var fe=Y[Y.length-1];if(we.slice(0,fe.length)!=fe)continue e;for(var ae=1,J=ce-Y.length+1;ae<Y.length-1;ae++)if(Q(C.getLine(J+ae))!=Y[ae])continue e;var Fe=C.getLine(ce+1-Y.length),Le=Q(Fe);if(Le.slice(Le.length-Y[0].length)!=Y[0])continue e;return{from:v(ce+1-Y.length,W(Fe,Le,Fe.length-Y[0].length,Q)),to:v(ce,W(xe,we,fe.length,Q))}}}}function R(C,V,J,_){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=C,J=J?C.clipPos(J):v(0,0),this.pos={from:J,to:J};var Q;typeof _=="object"?Q=_.caseFold:(Q=_,_=null),typeof V=="string"?(Q==null&&(Q=!1),this.matches=function(Y,ce){return(Y?X:M)(C,V,ce,Q)}):(V=d(V,"gm"),!_||_.multiline!==!1?this.matches=function(Y,ce){return(Y?B:g)(C,V,ce)}:this.matches=function(Y,ce){return(Y?D:S)(C,V,ce)})}R.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(C){var V=this.doc.clipPos(C?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(V=v(V.line,V.ch),C?(V.ch--,V.ch<0&&(V.line--,V.ch=(this.doc.getLine(V.line)||"").length)):(V.ch++,V.ch>(this.doc.getLine(V.line)||"").length&&(V.ch=0,V.line++)),c.cmpPos(V,this.doc.clipPos(V))!=0))return this.atOccurrence=!1;var J=this.matches(C,V);if(this.afterEmptyMatch=J&&c.cmpPos(J.from,J.to)==0,J)return this.pos=J,this.atOccurrence=!0,this.pos.match||!0;var _=v(C?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:_,to:_},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(C,V){if(!!this.atOccurrence){var J=c.splitLines(C);this.doc.replaceRange(J,this.pos.from,this.pos.to,V),this.pos.to=v(this.pos.from.line+J.length-1,J[J.length-1].length+(J.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(C,V,J){return new R(this.doc,C,V,J)}),c.defineDocExtension("getSearchCursor",function(C,V,J){return new R(this,C,V,J)}),c.defineExtension("selectMatches",function(C,V){for(var J=[],_=this.getSearchCursor(C,this.getCursor("from"),V);_.findNext()&&!(c.cmpPos(_.to(),this.getCursor("to"))>0);)J.push({anchor:_.from(),head:_.to()});J.length&&this.setSelections(J,0)})})},4631:function(h){(function(I,o){h.exports=o()})(this,function(){"use strict";var I=navigator.userAgent,o=navigator.platform,c=/gecko\/\d/i.test(I),v=/MSIE \d/.test(I),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),d=/Edge\/(\d+)/.exec(I),b=v||x||d,S=b&&(v?document.documentMode||6:+(d||x)[1]),g=!d&&/WebKit\//.test(I),L=g&&/Qt\/\d+\.\d+/.test(I),D=!d&&/Chrome\//.test(I),B=/Opera\//.test(I),j=/Apple Computer/.test(navigator.vendor),q=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),W=/PhantomJS/.test(I),M=j&&(/Mobile\/\w+/.test(I)||navigator.maxTouchPoints>2),X=/Android/.test(I),R=M||X||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),C=M||/Mac/.test(o),V=/\bCrOS\b/.test(I),J=/win/i.test(o),_=B&&I.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(B=!1,g=!0);var Q=C&&(L||B&&(_==null||_<12.11)),Y=c||b&&S>=9;function ce(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ee=function(e,n){var u=e.className,l=ce(n).exec(u);if(l){var f=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(f?l[1]+f:"")}};function ie(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function xe(e,n){return ie(e).appendChild(n)}function we(e,n,u,l){var f=document.createElement(e);if(u&&(f.className=u),l&&(f.style.cssText=l),typeof n=="string")f.appendChild(document.createTextNode(n));else if(n)for(var m=0;m<n.length;++m)f.appendChild(n[m]);return f}function he(e,n,u,l){var f=we(e,n,u,l);return f.setAttribute("role","presentation"),f}var fe;document.createRange?fe=function(e,n,u,l){var f=document.createRange();return f.setEnd(l||e,u),f.setStart(e,n),f}:fe=function(e,n,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(f){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",n),l};function ae(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function Fe(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Le(e,n){var u=e.className;ce(n).test(u)||(e.className+=(u?" ":"")+n)}function Me(e,n){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!ce(u[l]).test(n)&&(n+=" "+u[l]);return n}var Te=function(e){e.select()};M?Te=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(Te=function(e){try{e.select()}catch(n){}});function rt(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function Ze(e,n,u){n||(n={});for(var l in e)e.hasOwnProperty(l)&&(u!==!1||!n.hasOwnProperty(l))&&(n[l]=e[l]);return n}function Xe(e,n,u,l,f){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var m=l||0,F=f||0;;){var U=e.indexOf(" ",m);if(U<0||U>=n)return F+(n-m);F+=U-m,F+=u-F%u,m=U+1}}var ft=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ft.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ft.prototype.set=function(e,n){this.f=n;var u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function ht(e,n){for(var u=0;u<e.length;++u)if(e[u]==n)return u;return-1}var bt=50,nt={toString:function(){return"CodeMirror.Pass"}},ut={scroll:!1},yt={origin:"*mouse"},mt={origin:"+move"};function pt(e,n,u){for(var l=0,f=0;;){var m=e.indexOf(" ",l);m==-1&&(m=e.length);var F=m-l;if(m==e.length||f+F>=n)return l+Math.min(F,n-f);if(f+=m-l,f+=u-f%u,l=m+1,f>=n)return l}}var Mt=[""];function kt(e){for(;Mt.length<=e;)Mt.push(Ct(Mt)+" ");return Mt[e]}function Ct(e){return e[e.length-1]}function Wt(e,n){for(var u=[],l=0;l<e.length;l++)u[l]=n(e[l],l);return u}function jt(e,n,u){for(var l=0,f=u(n);l<e.length&&u(e[l])<=f;)l++;e.splice(l,0,n)}function Vt(){}function St(e,n){var u;return Object.create?u=Object.create(e):(Vt.prototype=e,u=new Vt),n&&Ze(n,u),u}var Dt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ve(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Dt.test(e))}function z(e,n){return n?n.source.indexOf("\\w")>-1&&ve(e)?!0:n.test(e):ve(e)}function $(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var Se=/[\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 Ie(e){return e.charCodeAt(0)>=768&&Se.test(e)}function $e(e,n,u){for(;(u<0?n>0:n<e.length)&&Ie(e.charAt(n));)n+=u;return n}function Ke(e,n,u){for(var l=n>u?-1:1;;){if(n==u)return n;var f=(n+u)/2,m=l<0?Math.ceil(f):Math.floor(f);if(m==n)return e(m)?n:u;e(m)?u=m:n=m+l}}function P(e,n,u,l){if(!e)return l(n,u,"ltr",0);for(var f=!1,m=0;m<e.length;++m){var F=e[m];(F.from<u&&F.to>n||n==u&&F.to==n)&&(l(Math.max(F.from,n),Math.min(F.to,u),F.level==1?"rtl":"ltr",m),f=!0)}f||l(n,u,"ltr")}var Re=null;function K(e,n,u){var l;Re=null;for(var f=0;f<e.length;++f){var m=e[f];if(m.from<n&&m.to>n)return f;m.to==n&&(m.from!=m.to&&u=="before"?l=f:Re=f),m.from==n&&(m.from!=m.to&&u!="before"?l=f:Re=f)}return l!=null?l:Re}var T=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(Z){return Z<=247?e.charAt(Z):1424<=Z&&Z<=1524?"R":1536<=Z&&Z<=1785?n.charAt(Z-1536):1774<=Z&&Z<=2220?"r":8192<=Z&&Z<=8203?"w":Z==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,m=/[LRr]/,F=/[Lb1n]/,U=/[1n]/;function H(Z,be,Ce){this.level=Z,this.from=be,this.to=Ce}return function(Z,be){var Ce=be=="ltr"?"L":"R";if(Z.length==0||be=="ltr"&&!l.test(Z))return!1;for(var De=Z.length,ke=[],Ye=0;Ye<De;++Ye)ke.push(u(Z.charCodeAt(Ye)));for(var tt=0,at=Ce;tt<De;++tt){var ct=ke[tt];ct=="m"?ke[tt]=at:at=ct}for(var gt=0,dt=Ce;gt<De;++gt){var xt=ke[gt];xt=="1"&&dt=="r"?ke[gt]="n":m.test(xt)&&(dt=xt,xt=="r"&&(ke[gt]="R"))}for(var Ft=1,It=ke[0];Ft<De-1;++Ft){var it=ke[Ft];it=="+"&&It=="1"&&ke[Ft+1]=="1"?ke[Ft]="1":it==","&&It==ke[Ft+1]&&(It=="1"||It=="n")&&(ke[Ft]=It),It=it}for(var Gt=0;Gt<De;++Gt){var hr=ke[Gt];if(hr==",")ke[Gt]="N";else if(hr=="%"){var vr=void 0;for(vr=Gt+1;vr<De&&ke[vr]=="%";++vr);for(var bn=Gt&&ke[Gt-1]=="!"||vr<De&&ke[vr]=="1"?"1":"N",fn=Gt;fn<vr;++fn)ke[fn]=bn;Gt=vr-1}}for(var Ar=0,cn=Ce;Ar<De;++Ar){var Kr=ke[Ar];cn=="L"&&Kr=="1"?ke[Ar]="L":m.test(Kr)&&(cn=Kr)}for(var Fr=0;Fr<De;++Fr)if(f.test(ke[Fr])){var gr=void 0;for(gr=Fr+1;gr<De&&f.test(ke[gr]);++gr);for(var yr=(Fr?ke[Fr-1]:Ce)=="L",nn=(gr<De?ke[gr]:Ce)=="L",no=yr==nn?yr?"L":"R":Ce,Mi=Fr;Mi<gr;++Mi)ke[Mi]=no;Fr=gr-1}for(var Qr=[],$n,Vr=0;Vr<De;)if(F.test(ke[Vr])){var io=Vr;for(++Vr;Vr<De&&F.test(ke[Vr]);++Vr);Qr.push(new H(0,io,Vr))}else{var Er=Vr,Eo=Qr.length,Kn=be=="rtl"?1:0;for(++Vr;Vr<De&&ke[Vr]!="L";++Vr);for(var on=Er;on<Vr;)if(U.test(ke[on])){Er<on&&(Qr.splice(Eo,0,new H(1,Er,on)),Eo+=Kn);var ua=on;for(++on;on<Vr&&U.test(ke[on]);++on);Qr.splice(Eo,0,new H(2,ua,on)),Eo+=Kn,Er=on}else++on;Er<Vr&&Qr.splice(Eo,0,new H(1,Er,Vr))}return be=="ltr"&&(Qr[0].level==1&&($n=Z.match(/^\s+/))&&(Qr[0].from=$n[0].length,Qr.unshift(new H(0,0,$n[0].length))),Ct(Qr).level==1&&($n=Z.match(/\s+$/))&&(Ct(Qr).to-=$n[0].length,Qr.push(new H(0,De-$n[0].length,De)))),be=="rtl"?Qr.reverse():Qr}}();function O(e,n){var u=e.order;return u==null&&(u=e.order=T(e.text,n)),u}var le=[],N=function(e,n,u){if(e.addEventListener)e.addEventListener(n,u,!1);else if(e.attachEvent)e.attachEvent("on"+n,u);else{var l=e._handlers||(e._handlers={});l[n]=(l[n]||le).concat(u)}};function te(e,n){return e._handlers&&e._handlers[n]||le}function de(e,n,u){if(e.removeEventListener)e.removeEventListener(n,u,!1);else if(e.detachEvent)e.detachEvent("on"+n,u);else{var l=e._handlers,f=l&&l[n];if(f){var m=ht(f,u);m>-1&&(l[n]=f.slice(0,m).concat(f.slice(m+1)))}}}function oe(e,n){var u=te(e,n);if(!!u.length)for(var l=Array.prototype.slice.call(arguments,2),f=0;f<u.length;++f)u[f].apply(null,l)}function pe(e,n,u){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),oe(e,u||n.type,e,n),Et(n)||n.codemirrorIgnore}function Ae(e){var n=e._handlers&&e._handlers.cursorActivity;if(!!n)for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<n.length;++l)ht(u,n[l])==-1&&u.push(n[l])}function Be(e,n){return te(e,n).length>0}function Ue(e){e.prototype.on=function(n,u){N(this,n,u)},e.prototype.off=function(n,u){de(this,n,u)}}function Qe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function vt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Et(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Bt(e){Qe(e),vt(e)}function Pt(e){return e.target||e.srcElement}function pn(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),C&&e.ctrlKey&&n==1&&(n=3),n}var Nr=function(){if(b&&S<9)return!1;var e=we("div");return"draggable"in e||"dragDrop"in e}(),Or;function mi(e){if(Or==null){var n=we("span","\u200B");xe(e,we("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=n.offsetWidth<=1&&n.offsetHeight>2&&!(b&&S<8))}var u=Or?we("span","\u200B"):we("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var zr;function Bi(e){if(zr!=null)return zr;var n=xe(e,document.createTextNode("A\u062EA")),u=fe(n,0,1).getBoundingClientRect(),l=fe(n,1,2).getBoundingClientRect();return ie(e),!u||u.left==u.right?!1:zr=l.right-u.right<3}var Bn=`
|
|
19
19
|
|
|
20
20
|
b`.split(/\n/).length!=3?function(e){for(var n=0,u=[],l=e.length;n<=l;){var f=e.indexOf(`
|
|
21
|
-
`,n);f==-1&&(f=e.length);var m=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),F=m.indexOf("\r");F!=-1?(u.push(m.slice(0,F)),n+=F+1):(u.push(m),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},hn=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(u){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},Tn=function(){var e=we("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Gr=null;function xi(e){if(Gr!=null)return Gr;var n=xe(e,we("span","x")),u=n.getBoundingClientRect(),l=fe(n,0,1).getBoundingClientRect();return Gr=Math.abs(u.left-l.left)>1}var bi={},qr={};function vn(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),bi[e]=n}function Un(e,n){qr[e]=n}function jn(e){if(typeof e=="string"&&qr.hasOwnProperty(e))e=qr[e];else if(e&&typeof e.name=="string"&&qr.hasOwnProperty(e.name)){var n=qr[e.name];typeof n=="string"&&(n={name:n}),e=St(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return jn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return jn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gn(e,n){n=jn(n);var u=bi[n.name];if(!u)return gn(e,"text/plain");var l=u(e,n);if(Xn.hasOwnProperty(n.name)){var f=Xn[n.name];for(var m in f)!f.hasOwnProperty(m)||(l.hasOwnProperty(m)&&(l["_"+m]=l[m]),l[m]=f[m])}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var F in n.modeProps)l[F]=n.modeProps[F];return l}var Xn={};function wi(e,n){var u=Xn.hasOwnProperty(e)?Xn[e]:Xn[e]={};Ze(n,u)}function Br(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var u={};for(var l in n){var f=n[l];f instanceof Array&&(f=f.concat([])),u[l]=f}return u}function $r(e,n){for(var u;e.innerMode&&(u=e.innerMode(n),!(!u||u.mode==e));)n=u.state,e=u.mode;return u||{mode:e,state:n}}function Qn(e,n,u){return e.startState?e.startState(n,u):!0}var ur=function(e,n,u){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};ur.prototype.eol=function(){return this.pos>=this.string.length},ur.prototype.sol=function(){return this.pos==this.lineStart},ur.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ur.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ur.prototype.eat=function(e){var n=this.string.charAt(this.pos),u;if(typeof e=="string"?u=n==e:u=n&&(e.test?e.test(n):e(n)),u)return++this.pos,n},ur.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},ur.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ur.prototype.skipToEnd=function(){this.pos=this.string.length},ur.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},ur.prototype.backUp=function(e){this.pos-=e},ur.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},ur.prototype.indentation=function(){return Xe(this.string,null,this.tabSize)-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},ur.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(F){return u?F.toLowerCase():F},f=this.string.substr(this.pos,e.length);if(l(f)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var m=this.string.slice(this.pos).match(e);return m&&m.index>0?null:(m&&n!==!1&&(this.pos+=m[0].length),m)}},ur.prototype.current=function(){return this.string.slice(this.start,this.pos)},ur.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},ur.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},ur.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Tt(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var u=e;!u.lines;)for(var l=0;;++l){var f=u.children[l],m=f.chunkSize();if(n<m){u=f;break}n-=m}return u.lines[n]}function ii(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(m){var F=m.text;f==u.line&&(F=F.slice(0,u.ch)),f==n.line&&(F=F.slice(n.ch)),l.push(F),++f}),l}function Si(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function An(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function Zt(e){if(e.parent==null)return null;for(var n=e.parent,u=ht(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var f=0;l.children[f]!=n;++f)u+=l.children[f].chunkSize();return u+n.first}function Vn(e,n){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var f=e.children[l],m=f.height;if(n<m){e=f;continue e}n-=m,u+=f.chunkSize()}return u}while(!e.lines);for(var F=0;F<e.lines.length;++F){var U=e.lines[F],H=U.height;if(n<H)break;n-=H}return u+F}function Zn(e,n){return n>=e.first&&n<e.first+e.size}function lo(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function ot(e,n,u){if(u===void 0&&(u=null),!(this instanceof ot))return new ot(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Lt(e,n){return e.line-n.line||e.ch-n.ch}function oi(e,n){return e.sticky==n.sticky&&Lt(e,n)==0}function ue(e){return ot(e.line,e.ch)}function Oe(e,n){return Lt(e,n)<0?n:e}function qe(e,n){return Lt(e,n)<0?e:n}function st(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function lt(e,n){if(n.line<e.first)return ot(e.first,0);var u=e.first+e.size-1;return n.line>u?ot(u,Tt(e,u).text.length):Kt(n,Tt(e,n.line).text.length)}function Kt(e,n){var u=e.ch;return u==null||u>n?ot(e.line,n):u<0?ot(e.line,0):e}function Xt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=lt(e,n[l]);return u}var Tr=function(e,n){this.state=e,this.lookAhead=n},Pr=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Pr.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Pr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Pr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Pr.fromSaved=function(e,n,u){return n instanceof Tr?new Pr(e,Br(e.mode,n.state),u,n.lookAhead):new Pr(e,Br(e.mode,n),u)},Pr.prototype.save=function(e){var n=e!==!1?Br(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Tr(n,this.maxLookAhead):n};function _t(e,n,u,l){var f=[e.state.modeGen],m={};zl(e,n.text,e.doc.mode,u,function(Z,be){return f.push(Z,be)},m,l);for(var F=u.state,U=function(Z){u.baseTokens=f;var be=e.state.overlays[Z],Ce=1,De=0;u.state=!0,zl(e,n.text,be.mode,u,function(ke,Ye){for(var tt=Ce;De<ke;){var at=f[Ce];at>ke&&f.splice(Ce,1,ke,f[Ce+1],at),Ce+=2,De=Math.min(ke,at)}if(!!Ye)if(be.opaque)f.splice(tt,Ce-tt,ke,"overlay "+Ye),Ce=tt+2;else for(;tt<Ce;tt+=2){var ct=f[tt+1];f[tt+1]=(ct?ct+" ":"")+"overlay "+Ye}},m),u.state=F,u.baseTokens=null,u.baseTokenPos=1},H=0;H<e.state.overlays.length;++H)U(H);return{styles:f,classes:m.bgClass||m.textClass?m:null}}function Wl(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=en(e,Zt(n)),f=n.text.length>e.options.maxHighlightLength&&Br(e.doc.mode,l.state),m=_t(e,n,l);f&&(l.state=f),n.stateAfter=l.save(!f),n.styles=m.styles,m.classes?n.styleClasses=m.classes:n.styleClasses&&(n.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function en(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Pr(l,!0,n);var m=Lf(e,n,u),F=m>l.first&&Tt(l,m-1).stateAfter,U=F?Pr.fromSaved(l,F,m):new Pr(l,Qn(l.mode),m);return l.iter(m,n,function(H){vs(e,H.text,U);var Z=U.line;H.stateAfter=Z==n-1||Z%5==0||Z>=f.viewFrom&&Z<f.viewTo?U.save():null,U.nextLine()}),u&&(l.modeFrontier=U.line),U}function vs(e,n,u,l){var f=e.doc.mode,m=new ur(n,e.options.tabSize,u);for(m.start=m.pos=l||0,n==""&&ya(f,u.state);!m.eol();)gs(f,m,u.state),m.start=m.pos}function ya(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=$r(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function gs(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=$r(e,u).mode);var m=e.token(n,u);if(n.pos>n.start)return m}throw new Error("Mode "+e.name+" failed to advance stream.")}var ys=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function ms(e,n,u,l){var f=e.doc,m=f.mode,F;n=lt(f,n);var U=Tt(f,n.line),H=en(e,n.line,u),Z=new ur(U.text,e.options.tabSize,H),be;for(l&&(be=[]);(l||Z.pos<n.ch)&&!Z.eol();)Z.start=Z.pos,F=gs(m,Z,H.state),l&&be.push(new ys(Z,F,Br(f.mode,H.state)));return l?be:new ys(Z,F,H.state)}function Hl(e,n){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";n[l]==null?n[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+u[2])}return e}function zl(e,n,u,l,f,m,F){var U=u.flattenSpans;U==null&&(U=e.options.flattenSpans);var H=0,Z=null,be=new ur(n,e.options.tabSize,l),Ce,De=e.options.addModeClass&&[null];for(n==""&&Hl(ya(u,l.state),m);!be.eol();){if(be.pos>e.options.maxHighlightLength?(U=!1,F&&vs(e,n,l,be.pos),be.pos=n.length,Ce=null):Ce=Hl(gs(u,be,l.state,De),m),De){var ke=De[0].name;ke&&(Ce="m-"+(Ce?ke+" "+Ce:ke))}if(!U||Z!=Ce){for(;H<be.start;)H=Math.min(be.start,H+5e3),f(H,Z);Z=Ce}be.start=be.pos}for(;H<be.pos;){var Ye=Math.min(be.pos,H+5e3);f(Ye,Z),H=Ye}}function Lf(e,n,u){for(var l,f,m=e.doc,F=u?-1:n-(e.doc.mode.innerMode?1e3:100),U=n;U>F;--U){if(U<=m.first)return m.first;var H=Tt(m,U-1),Z=H.stateAfter;if(Z&&(!u||U+(Z instanceof Tr?Z.lookAhead:0)<=m.modeFrontier))return U;var be=Xe(H.text,null,e.options.tabSize);(f==null||l>be)&&(f=U-1,l=be)}return f}function Df(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),!(e.highlightFrontier<n-10)){for(var u=e.first,l=n-1;l>u;l--){var f=Tt(e,l).stateAfter;if(f&&(!(f instanceof Tr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var Nf=!1,Ai=!1;function Bf(){Nf=!0}function Uf(){Ai=!0}function ma(e,n,u){this.marker=e,this.from=n,this.to=u}function Po(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function jf(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function Id(e,n,u){var l=u&&window.WeakSet&&(u.markedSpans||(u.markedSpans=new WeakSet));l&&l.has(e.markedSpans)?e.markedSpans.push(n):(e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],l&&l.add(e.markedSpans)),n.marker.attachLine(e)}function Fd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);if(U||m.from==n&&F.type=="bookmark"&&(!u||!m.marker.insertLeft)){var H=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);(l||(l=[])).push(new ma(F,m.from,H?null:m.to))}}return l}function kd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);if(U||m.from==n&&F.type=="bookmark"&&(!u||m.marker.insertLeft)){var H=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);(l||(l=[])).push(new ma(F,H?null:m.from-n,m.to==null?null:m.to-n))}}return l}function Gl(e,n){if(n.full)return null;var u=Zn(e,n.from.line)&&Tt(e,n.from.line).markedSpans,l=Zn(e,n.to.line)&&Tt(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,m=n.to.ch,F=Lt(n.from,n.to)==0,U=Fd(u,f,F),H=kd(l,m,F),Z=n.text.length==1,be=Ct(n.text).length+(Z?f:0);if(U)for(var Ce=0;Ce<U.length;++Ce){var De=U[Ce];if(De.to==null){var ke=Po(H,De.marker);ke?Z&&(De.to=ke.to==null?null:ke.to+be):De.to=f}}if(H)for(var Ye=0;Ye<H.length;++Ye){var tt=H[Ye];if(tt.to!=null&&(tt.to+=be),tt.from==null){var at=Po(U,tt.marker);at||(tt.from=be,Z&&(U||(U=[])).push(tt))}else tt.from+=be,Z&&(U||(U=[])).push(tt)}U&&(U=$l(U)),H&&H!=U&&(H=$l(H));var ct=[U];if(!Z){var gt=n.text.length-2,dt;if(gt>0&&U)for(var xt=0;xt<U.length;++xt)U[xt].to==null&&(dt||(dt=[])).push(new ma(U[xt].marker,null,null));for(var Ft=0;Ft<gt;++Ft)ct.push(dt);ct.push(H)}return ct}function $l(e){for(var n=0;n<e.length;++n){var u=e[n];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Kl(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(ke){if(ke.markedSpans)for(var Ye=0;Ye<ke.markedSpans.length;++Ye){var tt=ke.markedSpans[Ye].marker;tt.readOnly&&(!l||ht(l,tt)==-1)&&(l||(l=[])).push(tt)}}),!l)return null;for(var f=[{from:n,to:u}],m=0;m<l.length;++m)for(var F=l[m],U=F.find(0),H=0;H<f.length;++H){var Z=f[H];if(!(Lt(Z.to,U.from)<0||Lt(Z.from,U.to)>0)){var be=[H,1],Ce=Lt(Z.from,U.from),De=Lt(Z.to,U.to);(Ce<0||!F.inclusiveLeft&&!Ce)&&be.push({from:Z.from,to:U.from}),(De>0||!F.inclusiveRight&&!De)&&be.push({from:U.to,to:Z.to}),f.splice.apply(f,be),H+=be.length-3}}return f}function Yl(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function Vf(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function xs(e){return e.inclusiveLeft?-1:0}function bs(e){return e.inclusiveRight?1:0}function Jl(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),m=Lt(l.from,f.from)||xs(e)-xs(n);if(m)return-m;var F=Lt(l.to,f.to)||bs(e)-bs(n);return F||n.id-e.id}function Io(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=void 0,m=0;m<u.length;++m)f=u[m],f.marker.collapsed&&(n?f.from:f.to)==null&&(!l||Jl(l,f.marker)<0)&&(l=f.marker);return l}function ws(e){return Io(e,!0)}function Ui(e){return Io(e,!1)}function Wf(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=0;f<u.length;++f){var m=u[f];m.marker.collapsed&&(m.from==null||m.from<n)&&(m.to==null||m.to>n)&&(!l||Jl(l,m.marker)<0)&&(l=m.marker)}return l}function xa(e,n,u,l,f){var m=Tt(e,n),F=Ai&&m.markedSpans;if(F)for(var U=0;U<F.length;++U){var H=F[U];if(!!H.marker.collapsed){var Z=H.marker.find(0),be=Lt(Z.from,u)||xs(H.marker)-xs(f),Ce=Lt(Z.to,l)||bs(H.marker)-bs(f);if(!(be>=0&&Ce<=0||be<=0&&Ce>=0)&&(be<=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.to,u)>=0:Lt(Z.to,u)>0)||be>=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.from,l)<=0:Lt(Z.from,l)<0)))return!0}}}function Wn(e){for(var n;n=ws(e);)e=n.find(-1,!0).line;return e}function Xl(e){for(var n;n=Ui(e);)e=n.find(1,!0).line;return e}function Hf(e){for(var n,u;n=Ui(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function Fo(e,n){var u=Tt(e,n),l=Wn(u);return u==l?n:Zt(l)}function Ss(e,n){if(n>e.lastLine())return n;var u=Tt(e,n),l;if(!ai(e,u))return n;for(;l=Ui(u);)u=l.find(1,!0).line;return Zt(u)+1}function ai(e,n){var u=Ai&&n.markedSpans;if(u){for(var l=void 0,f=0;f<u.length;++f)if(l=u[f],!!l.marker.collapsed){if(l.from==null)return!0;if(!l.marker.widgetNode&&l.from==0&&l.marker.inclusiveLeft&&fr(e,n,l))return!0}}}function fr(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return fr(e,l.line,Po(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==n.text.length)return!0;for(var f=void 0,m=0;m<n.markedSpans.length;++m)if(f=n.markedSpans[m],f.marker.collapsed&&!f.marker.widgetNode&&f.from==u.to&&(f.to==null||f.to!=u.from)&&(f.marker.inclusiveLeft||u.marker.inclusiveRight)&&fr(e,n,f))return!0}function si(e){e=Wn(e);for(var n=0,u=e.parent,l=0;l<u.lines.length;++l){var f=u.lines[l];if(f==e)break;n+=f.height}for(var m=u.parent;m;u=m,m=u.parent)for(var F=0;F<m.children.length;++F){var U=m.children[F];if(U==u)break;n+=U.height}return n}function ji(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=ws(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Ui(l);){var m=u.find(0,!0);n-=l.text.length-m.from.ch,l=m.to.line,n+=l.text.length-m.to.ch}return n}function As(e){var n=e.display,u=e.doc;n.maxLine=Tt(u,u.first),n.maxLineLength=ji(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=ji(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var Vi=function(e,n,u){this.text=e,Vf(this,n),this.height=u?u(this):1};Vi.prototype.lineNo=function(){return Zt(this)},Ue(Vi);function Ei(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Yl(e),Vf(e,u);var f=l?l(e):1;f!=e.height&&An(e,f)}function Wi(e){e.parent=null,Yl(e)}var Es={},Cs={};function Ql(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?Cs:Es;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function Os(e,n){var u=he("span",null,null,g?"padding-right: .1px":null),l={pre:he("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var f=0;f<=(n.rest?n.rest.length:0);f++){var m=f?n.rest[f-1]:n.line,F=void 0;l.pos=0,l.addToken=Ps,Bi(e.display.measure)&&(F=O(m,e.doc.direction))&&(l.addToken=zf(l.addToken,F)),l.map=[];var U=n!=e.display.externalMeasured&&Zt(m);Gf(m,l,Wl(e,m,U)),m.styleClasses&&(m.styleClasses.bgClass&&(l.bgClass=Me(m.styleClasses.bgClass,l.bgClass||"")),m.styleClasses.textClass&&(l.textClass=Me(m.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(mi(e.display.measure))),f==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(g){var H=l.content.lastChild;(/\bcm-tab\b/.test(H.className)||H.querySelector&&H.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return oe(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Me(l.pre.className,l.textClass||"")),l}function Ts(e){var n=we("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Ps(e,n,u,l,f,m,F){if(!!n){var U=e.splitSpaces?Hi(n,e.trailingSpace):n,H=e.cm.state.specialChars,Z=!1,be;if(!H.test(n))e.col+=n.length,be=document.createTextNode(U),e.map.push(e.pos,e.pos+n.length,be),b&&S<9&&(Z=!0),e.pos+=n.length;else{be=document.createDocumentFragment();for(var Ce=0;;){H.lastIndex=Ce;var De=H.exec(n),ke=De?De.index-Ce:n.length-Ce;if(ke){var Ye=document.createTextNode(U.slice(Ce,Ce+ke));b&&S<9?be.appendChild(we("span",[Ye])):be.appendChild(Ye),e.map.push(e.pos,e.pos+ke,Ye),e.col+=ke,e.pos+=ke}if(!De)break;Ce+=ke+1;var tt=void 0;if(De[0]==" "){var at=e.cm.options.tabSize,ct=at-e.col%at;tt=be.appendChild(we("span",kt(ct),"cm-tab")),tt.setAttribute("role","presentation"),tt.setAttribute("cm-text"," "),e.col+=ct}else De[0]=="\r"||De[0]==`
|
|
22
|
-
`?(tt=be.appendChild(we("span",De[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),tt.setAttribute("cm-text",De[0]),e.col+=1):(tt=e.cm.options.specialCharPlaceholder(De[0]),tt.setAttribute("cm-text",De[0]),b&&S<9?be.appendChild(we("span",[tt])):be.appendChild(tt),e.col+=1);e.map.push(e.pos,e.pos+1,tt),e.pos++}}if(e.trailingSpace=U.charCodeAt(n.length-1)==32,u||l||f||Z||m||F){var gt=u||"";l&&(gt+=l),f&&(gt+=f);var dt=we("span",[be],gt,m);if(F)for(var xt in F)F.hasOwnProperty(xt)&&xt!="style"&&xt!="class"&&dt.setAttribute(xt,F[xt]);return e.content.appendChild(dt)}e.content.appendChild(be)}}function Hi(e,n){if(e.length>1&&!/ /.test(e))return e;for(var u=n,l="",f=0;f<e.length;f++){var m=e.charAt(f);m==" "&&u&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(m="\xA0"),l+=m,u=m==" "}return l}function zf(e,n){return function(u,l,f,m,F,U,H){f=f?f+" cm-force-border":"cm-force-border";for(var Z=u.pos,be=Z+l.length;;){for(var Ce=void 0,De=0;De<n.length&&(Ce=n[De],!(Ce.to>Z&&Ce.from<=Z));De++);if(Ce.to>=be)return e(u,l,f,m,F,U,H);e(u,l.slice(0,Ce.to-Z),f,m,null,U,H),m=null,l=l.slice(Ce.to-Z),Z=Ce.to}}}function nr(e,n,u,l){var f=!l&&u.widgetNode;f&&e.map.push(e.pos,e.pos+n,f),!l&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",u.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=n,e.trailingSpace=!1}function Gf(e,n,u){var l=e.markedSpans,f=e.text,m=0;if(!l){for(var F=1;F<u.length;F+=2)n.addToken(n,f.slice(m,m=u[F]),Ql(u[F+1],n.cm.options));return}for(var U=f.length,H=0,Z=1,be="",Ce,De,ke=0,Ye,tt,at,ct,gt;;){if(ke==H){Ye=tt=at=De="",gt=null,ct=null,ke=1/0;for(var dt=[],xt=void 0,Ft=0;Ft<l.length;++Ft){var It=l[Ft],it=It.marker;if(it.type=="bookmark"&&It.from==H&&it.widgetNode)dt.push(it);else if(It.from<=H&&(It.to==null||It.to>H||it.collapsed&&It.to==H&&It.from==H)){if(It.to!=null&&It.to!=H&&ke>It.to&&(ke=It.to,tt=""),it.className&&(Ye+=" "+it.className),it.css&&(De=(De?De+";":"")+it.css),it.startStyle&&It.from==H&&(at+=" "+it.startStyle),it.endStyle&&It.to==ke&&(xt||(xt=[])).push(it.endStyle,It.to),it.title&&((gt||(gt={})).title=it.title),it.attributes)for(var Gt in it.attributes)(gt||(gt={}))[Gt]=it.attributes[Gt];it.collapsed&&(!ct||Jl(ct.marker,it)<0)&&(ct=It)}else It.from>H&&ke>It.from&&(ke=It.from)}if(xt)for(var hr=0;hr<xt.length;hr+=2)xt[hr+1]==ke&&(tt+=" "+xt[hr]);if(!ct||ct.from==H)for(var vr=0;vr<dt.length;++vr)nr(n,0,dt[vr]);if(ct&&(ct.from||0)==H){if(nr(n,(ct.to==null?U+1:ct.to)-H,ct.marker,ct.from==null),ct.to==null)return;ct.to==H&&(ct=!1)}}if(H>=U)break;for(var bn=Math.min(U,ke);;){if(be){var fn=H+be.length;if(!ct){var Ar=fn>bn?be.slice(0,bn-H):be;n.addToken(n,Ar,Ce?Ce+Ye:Ye,at,H+Ar.length==ke?tt:"",De,gt)}if(fn>=bn){be=be.slice(bn-H),H=bn;break}H=fn,at=""}be=f.slice(m,m=u[Z++]),Ce=Ql(u[Z++],n.cm.options)}}}function Zl(e,n,u){this.line=n,this.rest=Hf(n),this.size=this.rest?Zt(Ct(this.rest))-u+1:1,this.node=this.text=null,this.hidden=ai(e,n)}function ba(e,n,u){for(var l=[],f,m=n;m<u;m=f){var F=new Zl(e.doc,Tt(e.doc,m),m);f=m+F.size,l.push(F)}return l}var tn=null;function _l(e){tn?tn.ops.push(e):e.ownsGroup=tn={ops:[e],delayedCallbacks:[]}}function ql(e){var n=e.delayedCallbacks,u=0;do{for(;u<n.length;u++)n[u].call(null);for(var l=0;l<e.ops.length;l++){var f=e.ops[l];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(u<n.length)}function Is(e,n){var u=e.ownsGroup;if(!!u)try{ql(u)}finally{tn=null,n(u)}}var ko=null;function ir(e,n){var u=te(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;tn?f=tn.delayedCallbacks:ko?f=ko:(f=ko=[],setTimeout($f,0));for(var m=function(U){f.push(function(){return u[U].apply(null,l)})},F=0;F<u.length;++F)m(F)}}function $f(){var e=ko;ko=null;for(var n=0;n<e.length;++n)e[n]()}function wa(e,n,u,l){for(var f=0;f<n.changes.length;f++){var m=n.changes[f];m=="text"?Kf(e,n):m=="gutter"?Ro(e,n,u,l):m=="class"?Fs(e,n):m=="widget"&&Yf(e,n,l)}n.changes=null}function Mo(e){return e.node==e.text&&(e.node=we("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&S<8&&(e.node.style.zIndex=2)),e.node}function eu(e,n){var u=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),n.background)u?n.background.className=u:(n.background.parentNode.removeChild(n.background),n.background=null);else if(u){var l=Mo(n);n.background=l.insertBefore(we("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function tu(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):Os(e,n)}function Kf(e,n){var u=n.text.className,l=tu(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,Fs(e,n)):u&&(n.text.className=u)}function Fs(e,n){eu(e,n),n.line.wrapClass?Mo(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var u=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=u||""}function Ro(e,n,u,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var f=Mo(n);n.gutterBackground=we("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),f.insertBefore(n.gutterBackground,n.text)}var m=n.line.gutterMarkers;if(e.options.lineNumbers||m){var F=Mo(n),U=n.gutter=we("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(U.setAttribute("aria-hidden","true"),e.display.input.setUneditable(U),F.insertBefore(U,n.text),n.line.gutterClass&&(U.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!m||!m["CodeMirror-linenumbers"])&&(n.lineNumber=U.appendChild(we("div",lo(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),m)for(var H=0;H<e.display.gutterSpecs.length;++H){var Z=e.display.gutterSpecs[H].className,be=m.hasOwnProperty(Z)&&m[Z];be&&U.appendChild(we("div",[be],"CodeMirror-gutter-elt","left: "+l.gutterLeft[Z]+"px; width: "+l.gutterWidth[Z]+"px"))}}}function Yf(e,n,u){n.alignable&&(n.alignable=null);for(var l=ce("CodeMirror-linewidget"),f=n.node.firstChild,m=void 0;f;f=m)m=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);ru(e,n,u)}function qt(e,n,u,l){var f=tu(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Fs(e,n),Ro(e,n,u,l),ru(e,n,l),n.node}function ru(e,n,u){if(Qt(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Qt(e,n.rest[l],n,u,!1)}function Qt(e,n,u,l,f){if(!!n.widgets)for(var m=Mo(u),F=0,U=n.widgets;F<U.length;++F){var H=U[F],Z=we("div",[H.node],"CodeMirror-linewidget"+(H.className?" "+H.className:""));H.handleMouseEvents||Z.setAttribute("cm-ignore-events","true"),Jf(H,Z,u,l),e.display.input.setUneditable(Z),f&&H.above?m.insertBefore(Z,u.gutter||u.text):m.appendChild(Z),ir(H,"redraw")}}function Jf(e,n,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(n);var f=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(f-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=f+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Ot(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!ae(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+n.display.wrapper.clientWidth+"px;"),xe(n.display.measure,we("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function li(e,n){for(var u=Pt(n);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function Lo(e){return e.lineSpace.offsetTop}function ks(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ln(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=xe(e.measure,we("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function ui(e){return bt-e.display.nativeBarWidth}function zi(e){return e.display.scroller.clientWidth-ui(e)-e.display.barWidth}function Do(e){return e.display.scroller.clientHeight-ui(e)-e.display.barHeight}function Xf(e,n,u){var l=e.options.lineWrapping,f=l&&zi(e);if(!n.measure.heights||l&&n.measure.width!=f){var m=n.measure.heights=[];if(l){n.measure.width=f;for(var F=n.text.firstChild.getClientRects(),U=0;U<F.length-1;U++){var H=F[U],Z=F[U+1];Math.abs(H.bottom-Z.bottom)>2&&m.push((H.bottom+Z.top)/2-u.top)}}m.push(u.bottom-u.top)}}function Ms(e,n,u){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var f=0;f<e.rest.length;f++)if(Zt(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function Qf(e,n){n=Wn(n);var u=Zt(n),l=e.display.externalMeasured=new Zl(e.doc,n,u);l.lineN=u;var f=l.built=Os(e,l);return l.text=f.pre,xe(e.display.lineMeasure,f.pre),l}function Sa(e,n,u,l){return Hn(e,_n(e,n),u,l)}function Rs(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[Yi(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function _n(e,n){var u=Zt(n),l=Rs(e,u);l&&!l.text?l=null:l&&l.changes&&(wa(e,l,u,Vs(e)),e.curOp.forceUpdate=!0),l||(l=Qf(e,n));var f=Ms(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function Hn(e,n,u,l,f){n.before&&(u=-1);var m=u+(l||""),F;return n.cache.hasOwnProperty(m)?F=n.cache[m]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Xf(e,n.view,n.rect),n.hasHeights=!0),F=nu(e,n,u,l),F.bogus||(n.cache[m]=F)),{left:F.left,right:F.right,top:f?F.rtop:F.top,bottom:f?F.rbottom:F.bottom}}var Aa={left:0,right:0,top:0,bottom:0};function Ls(e,n,u){for(var l,f,m,F,U,H,Z=0;Z<e.length;Z+=3)if(U=e[Z],H=e[Z+1],n<U?(f=0,m=1,F="left"):n<H?(f=n-U,m=f+1):(Z==e.length-3||n==H&&e[Z+3]>n)&&(m=H-U,f=m-1,n>=H&&(F="right")),f!=null){if(l=e[Z+2],U==H&&u==(l.insertLeft?"left":"right")&&(F=u),u=="left"&&f==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)l=e[(Z-=3)+2],F="left";if(u=="right"&&f==H-U)for(;Z<e.length-3&&e[Z+3]==e[Z+4]&&!e[Z+5].insertLeft;)l=e[(Z+=3)+2],F="right";break}return{node:l,start:f,end:m,collapse:F,coverStart:U,coverEnd:H}}function Ds(e,n){var u=Aa;if(n=="left")for(var l=0;l<e.length&&(u=e[l]).left==u.right;l++);else for(var f=e.length-1;f>=0&&(u=e[f]).left==u.right;f--);return u}function nu(e,n,u,l){var f=Ls(n.map,u,l),m=f.node,F=f.start,U=f.end,H=f.collapse,Z;if(m.nodeType==3){for(var be=0;be<4;be++){for(;F&&Ie(n.line.text.charAt(f.coverStart+F));)--F;for(;f.coverStart+U<f.coverEnd&&Ie(n.line.text.charAt(f.coverStart+U));)++U;if(b&&S<9&&F==0&&U==f.coverEnd-f.coverStart?Z=m.parentNode.getBoundingClientRect():Z=Ds(fe(m,F,U).getClientRects(),l),Z.left||Z.right||F==0)break;U=F,F=F-1,H="right"}b&&S<11&&(Z=iu(e.display.measure,Z))}else{F>0&&(H=l="right");var Ce;e.options.lineWrapping&&(Ce=m.getClientRects()).length>1?Z=Ce[l=="right"?Ce.length-1:0]:Z=m.getBoundingClientRect()}if(b&&S<9&&!F&&(!Z||!Z.left&&!Z.right)){var De=m.parentNode.getClientRects()[0];De?Z={left:De.left,right:De.left+Pn(e.display),top:De.top,bottom:De.bottom}:Z=Aa}for(var ke=Z.top-n.rect.top,Ye=Z.bottom-n.rect.top,tt=(ke+Ye)/2,at=n.view.measure.heights,ct=0;ct<at.length-1&&!(tt<at[ct]);ct++);var gt=ct?at[ct-1]:0,dt=at[ct],xt={left:(H=="right"?Z.right:Z.left)-n.rect.left,right:(H=="left"?Z.left:Z.right)-n.rect.left,top:gt,bottom:dt};return!Z.left&&!Z.right&&(xt.bogus=!0),e.options.singleCursorHeightPerLine||(xt.rtop=ke,xt.rbottom=Ye),xt}function iu(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!xi(e))return n;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*u,right:n.right*u,top:n.top*l,bottom:n.bottom*l}}function Ns(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function Gi(e){e.display.externalMeasure=null,ie(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)Ns(e.display.view[n])}function No(e){Gi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Bo(){return D&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ou(){return D&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Uo(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=Ot(e.widgets[u]));return n}function Ea(e,n,u,l,f){if(!f){var m=Uo(n);u.top+=m,u.bottom+=m}if(l=="line")return u;l||(l="local");var F=si(n);if(l=="local"?F+=Lo(e.display):F-=e.display.viewOffset,l=="page"||l=="window"){var U=e.display.lineSpace.getBoundingClientRect();F+=U.top+(l=="window"?0:ou());var H=U.left+(l=="window"?0:Bo());u.left+=H,u.right+=H}return u.top+=F,u.bottom+=F,u}function jo(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Bo(),f-=ou();else if(u=="local"||!u){var m=e.display.sizer.getBoundingClientRect();l+=m.left,f+=m.top}var F=e.display.lineSpace.getBoundingClientRect();return{left:l-F.left,top:f-F.top}}function Ca(e,n,u,l,f){return l||(l=Tt(e.doc,n.line)),Ea(e,l,Sa(e,l,n.ch,f),u)}function zn(e,n,u,l,f,m){l=l||Tt(e.doc,n.line),f||(f=_n(e,l));function F(Ye,tt){var at=Hn(e,f,Ye,tt?"right":"left",m);return tt?at.left=at.right:at.right=at.left,Ea(e,l,at,u)}var U=O(l,e.doc.direction),H=n.ch,Z=n.sticky;if(H>=l.text.length?(H=l.text.length,Z="before"):H<=0&&(H=0,Z="after"),!U)return F(Z=="before"?H-1:H,Z=="before");function be(Ye,tt,at){var ct=U[tt],gt=ct.level==1;return F(at?Ye-1:Ye,gt!=at)}var Ce=K(U,H,Z),De=Re,ke=be(H,Ce,Z=="before");return De!=null&&(ke.other=be(H,De,Z!="before")),ke}function au(e,n){var u=0;n=lt(e.doc,n),e.options.lineWrapping||(u=Pn(e.display)*n.ch);var l=Tt(e.doc,n.line),f=si(l)+Lo(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function Bs(e,n,u,l,f){var m=ot(e,n,u);return m.xRel=f,l&&(m.outside=l),m}function Us(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Bs(l.first,0,null,-1,-1);var f=Vn(l,u),m=l.first+l.size-1;if(f>m)return Bs(l.first+l.size-1,Tt(l,m).text.length,null,1,1);n<0&&(n=0);for(var F=Tt(l,f);;){var U=Zf(e,F,f,n,u),H=Wf(F,U.ch+(U.xRel>0||U.outside>0?1:0));if(!H)return U;var Z=H.find(1);if(Z.line==f)return Z;F=Tt(l,f=Z.line)}}function su(e,n,u,l){l-=Uo(n);var f=n.text.length,m=Ke(function(F){return Hn(e,u,F-1).bottom<=l},f,0);return f=Ke(function(F){return Hn(e,u,F).top>l},m,f),{begin:m,end:f}}function lu(e,n,u,l){u||(u=_n(e,n));var f=Ea(e,n,Hn(e,u,l),"line").top;return su(e,n,u,f)}function js(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function Zf(e,n,u,l,f){f-=si(n);var m=_n(e,n),F=Uo(n),U=0,H=n.text.length,Z=!0,be=O(n,e.doc.direction);if(be){var Ce=(e.options.lineWrapping?qf:_f)(e,n,u,m,be,l,f);Z=Ce.level!=1,U=Z?Ce.from:Ce.to-1,H=Z?Ce.to:Ce.from-1}var De=null,ke=null,Ye=Ke(function(Ft){var It=Hn(e,m,Ft);return It.top+=F,It.bottom+=F,js(It,l,f,!1)?(It.top<=f&&It.left<=l&&(De=Ft,ke=It),!0):!1},U,H),tt,at,ct=!1;if(ke){var gt=l-ke.left<ke.right-l,dt=gt==Z;Ye=De+(dt?0:1),at=dt?"after":"before",tt=gt?ke.left:ke.right}else{!Z&&(Ye==H||Ye==U)&&Ye++,at=Ye==0?"after":Ye==n.text.length?"before":Hn(e,m,Ye-(Z?1:0)).bottom+F<=f==Z?"after":"before";var xt=zn(e,ot(u,Ye,at),"line",n,m);tt=xt.left,ct=f<xt.top?-1:f>=xt.bottom?1:0}return Ye=$e(n.text,Ye,1),Bs(u,Ye,at,ct,l-tt)}function _f(e,n,u,l,f,m,F){var U=Ke(function(Ce){var De=f[Ce],ke=De.level!=1;return js(zn(e,ot(u,ke?De.to:De.from,ke?"before":"after"),"line",n,l),m,F,!0)},0,f.length-1),H=f[U];if(U>0){var Z=H.level!=1,be=zn(e,ot(u,Z?H.from:H.to,Z?"after":"before"),"line",n,l);js(be,m,F,!0)&&be.top>F&&(H=f[U-1])}return H}function qf(e,n,u,l,f,m,F){var U=su(e,n,l,F),H=U.begin,Z=U.end;/\s/.test(n.text.charAt(Z-1))&&Z--;for(var be=null,Ce=null,De=0;De<f.length;De++){var ke=f[De];if(!(ke.from>=Z||ke.to<=H)){var Ye=ke.level!=1,tt=Hn(e,l,Ye?Math.min(Z,ke.to)-1:Math.max(H,ke.from)).right,at=tt<m?m-tt+1e9:tt-m;(!be||Ce>at)&&(be=ke,Ce=at)}}return be||(be=f[f.length-1]),be.from<H&&(be={from:H,to:be.to,level:be.level}),be.to>Z&&(be={from:be.from,to:Z,level:be.level}),be}var $i;function uo(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if($i==null){$i=we("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)$i.appendChild(document.createTextNode("x")),$i.appendChild(we("br"));$i.appendChild(document.createTextNode("x"))}xe(e.measure,$i);var u=$i.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ie(e.measure),u||1}function Pn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=we("span","xxxxxxxxxx"),u=we("pre",[n],"CodeMirror-line-like");xe(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Vs(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,m=n.gutters.firstChild,F=0;m;m=m.nextSibling,++F){var U=e.display.gutterSpecs[F].className;u[U]=m.offsetLeft+m.clientLeft+f,l[U]=m.clientWidth}return{fixedPos:In(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function In(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function uu(e){var n=uo(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Pn(e.display)-3);return function(f){if(ai(e.doc,f))return 0;var m=0;if(f.widgets)for(var F=0;F<f.widgets.length;F++)f.widgets[F].height&&(m+=f.widgets[F].height);return u?m+(Math.ceil(f.text.length/l)||1)*n:m+n}}function Ws(e){var n=e.doc,u=uu(e);n.iter(function(l){var f=u(l);f!=l.height&&An(l,f)})}function Ki(e,n,u,l){var f=e.display;if(!u&&Pt(n).getAttribute("cm-not-content")=="true")return null;var m,F,U=f.lineSpace.getBoundingClientRect();try{m=n.clientX-U.left,F=n.clientY-U.top}catch(Ce){return null}var H=Us(e,m,F),Z;if(l&&H.xRel>0&&(Z=Tt(e.doc,H.line).text).length==H.ch){var be=Xe(Z,Z.length,e.options.tabSize)-Z.length;H=ot(H.line,Math.max(0,Math.round((m-ln(e.display).left)/Pn(e.display))-be))}return H}function Yi(e,n){if(n>=e.display.viewTo||(n-=e.display.viewFrom,n<0))return null;for(var u=e.display.view,l=0;l<u.length;l++)if(n-=u[l].size,n<0)return l}function Rr(e,n,u,l){n==null&&(n=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var f=e.display;if(l&&u<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>n)&&(f.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=f.viewTo)Ai&&Fo(e.doc,n)<f.viewTo&&Ci(e);else if(u<=f.viewFrom)Ai&&Ss(e.doc,u+l)>f.viewFrom?Ci(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)Ci(e);else if(n<=f.viewFrom){var m=Oa(e,u,u+l,1);m?(f.view=f.view.slice(m.index),f.viewFrom=m.lineN,f.viewTo+=l):Ci(e)}else if(u>=f.viewTo){var F=Oa(e,n,n,-1);F?(f.view=f.view.slice(0,F.index),f.viewTo=F.lineN):Ci(e)}else{var U=Oa(e,n,n,-1),H=Oa(e,u,u+l,1);U&&H?(f.view=f.view.slice(0,U.index).concat(ba(e,U.lineN,H.lineN)).concat(f.view.slice(H.index)),f.viewTo+=l):Ci(e)}var Z=f.externalMeasured;Z&&(u<Z.lineN?Z.lineN+=l:n<Z.lineN+Z.size&&(f.externalMeasured=null))}function qn(e,n,u){e.curOp.viewChanged=!0;var l=e.display,f=e.display.externalMeasured;if(f&&n>=f.lineN&&n<f.lineN+f.size&&(l.externalMeasured=null),!(n<l.viewFrom||n>=l.viewTo)){var m=l.view[Yi(e,n)];if(m.node!=null){var F=m.changes||(m.changes=[]);ht(F,u)==-1&&F.push(u)}}}function Ci(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Oa(e,n,u,l){var f=Yi(e,n),m,F=e.display.view;if(!Ai||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var U=e.display.viewFrom,H=0;H<f;H++)U+=F[H].size;if(U!=n){if(l>0){if(f==F.length-1)return null;m=U+F[f].size-n,f++}else m=U-n;n+=m,u+=m}for(;Fo(e.doc,u)!=u;){if(f==(l<0?0:F.length-1))return null;u+=l*F[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function ec(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=ba(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=ba(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(Yi(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat(ba(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,Yi(e,u)))),l.viewTo=u}function Ta(e){for(var n=e.display.view,u=0,l=0;l<n.length;l++){var f=n[l];!f.hidden&&(!f.node||f.changes)&&++u}return u}function Oi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Pa(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),m=l.selection=document.createDocumentFragment(),F=e.options.$customCursor;F&&(n=!0);for(var U=0;U<u.sel.ranges.length;U++)if(!(!n&&U==u.sel.primIndex)){var H=u.sel.ranges[U];if(!(H.from().line>=e.display.viewTo||H.to().line<e.display.viewFrom)){var Z=H.empty();if(F){var be=F(e,H);be&&Hs(e,be,f)}else(Z||e.options.showCursorWhenSelecting)&&Hs(e,H.head,f);Z||fu(e,H,m)}}return l}function Hs(e,n,u){var l=zn(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(we("div","\xA0","CodeMirror-cursor"));if(f.style.left=l.left+"px",f.style.top=l.top+"px",f.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var m=Ca(e,n,"div",null,null),F=m.right-m.left;f.style.width=(F>0?F:e.defaultCharWidth())+"px"}if(l.other){var U=u.appendChild(we("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));U.style.display="",U.style.left=l.other.left+"px",U.style.top=l.other.top+"px",U.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Ia(e,n){return e.top-n.top||e.left-n.left}function fu(e,n,u){var l=e.display,f=e.doc,m=document.createDocumentFragment(),F=ln(e.display),U=F.left,H=Math.max(l.sizerWidth,zi(e)-l.sizer.offsetLeft)-F.right,Z=f.direction=="ltr";function be(dt,xt,Ft,It){xt<0&&(xt=0),xt=Math.round(xt),It=Math.round(It),m.appendChild(we("div",null,"CodeMirror-selected","position: absolute; left: "+dt+`px;
|
|
21
|
+
`,n);f==-1&&(f=e.length);var m=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),F=m.indexOf("\r");F!=-1?(u.push(m.slice(0,F)),n+=F+1):(u.push(m),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},hn=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(u){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},Tn=function(){var e=we("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Gr=null;function xi(e){if(Gr!=null)return Gr;var n=xe(e,we("span","x")),u=n.getBoundingClientRect(),l=fe(n,0,1).getBoundingClientRect();return Gr=Math.abs(u.left-l.left)>1}var bi={},qr={};function vn(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),bi[e]=n}function Un(e,n){qr[e]=n}function jn(e){if(typeof e=="string"&&qr.hasOwnProperty(e))e=qr[e];else if(e&&typeof e.name=="string"&&qr.hasOwnProperty(e.name)){var n=qr[e.name];typeof n=="string"&&(n={name:n}),e=St(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return jn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return jn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gn(e,n){n=jn(n);var u=bi[n.name];if(!u)return gn(e,"text/plain");var l=u(e,n);if(Xn.hasOwnProperty(n.name)){var f=Xn[n.name];for(var m in f)!f.hasOwnProperty(m)||(l.hasOwnProperty(m)&&(l["_"+m]=l[m]),l[m]=f[m])}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var F in n.modeProps)l[F]=n.modeProps[F];return l}var Xn={};function wi(e,n){var u=Xn.hasOwnProperty(e)?Xn[e]:Xn[e]={};Ze(n,u)}function Br(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var u={};for(var l in n){var f=n[l];f instanceof Array&&(f=f.concat([])),u[l]=f}return u}function $r(e,n){for(var u;e.innerMode&&(u=e.innerMode(n),!(!u||u.mode==e));)n=u.state,e=u.mode;return u||{mode:e,state:n}}function Qn(e,n,u){return e.startState?e.startState(n,u):!0}var ur=function(e,n,u){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};ur.prototype.eol=function(){return this.pos>=this.string.length},ur.prototype.sol=function(){return this.pos==this.lineStart},ur.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ur.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ur.prototype.eat=function(e){var n=this.string.charAt(this.pos),u;if(typeof e=="string"?u=n==e:u=n&&(e.test?e.test(n):e(n)),u)return++this.pos,n},ur.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},ur.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ur.prototype.skipToEnd=function(){this.pos=this.string.length},ur.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},ur.prototype.backUp=function(e){this.pos-=e},ur.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},ur.prototype.indentation=function(){return Xe(this.string,null,this.tabSize)-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},ur.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(F){return u?F.toLowerCase():F},f=this.string.substr(this.pos,e.length);if(l(f)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var m=this.string.slice(this.pos).match(e);return m&&m.index>0?null:(m&&n!==!1&&(this.pos+=m[0].length),m)}},ur.prototype.current=function(){return this.string.slice(this.start,this.pos)},ur.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},ur.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},ur.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Tt(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var u=e;!u.lines;)for(var l=0;;++l){var f=u.children[l],m=f.chunkSize();if(n<m){u=f;break}n-=m}return u.lines[n]}function ii(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(m){var F=m.text;f==u.line&&(F=F.slice(0,u.ch)),f==n.line&&(F=F.slice(n.ch)),l.push(F),++f}),l}function Si(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function An(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function Zt(e){if(e.parent==null)return null;for(var n=e.parent,u=ht(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var f=0;l.children[f]!=n;++f)u+=l.children[f].chunkSize();return u+n.first}function Vn(e,n){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var f=e.children[l],m=f.height;if(n<m){e=f;continue e}n-=m,u+=f.chunkSize()}return u}while(!e.lines);for(var F=0;F<e.lines.length;++F){var U=e.lines[F],H=U.height;if(n<H)break;n-=H}return u+F}function Zn(e,n){return n>=e.first&&n<e.first+e.size}function lo(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function ot(e,n,u){if(u===void 0&&(u=null),!(this instanceof ot))return new ot(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Lt(e,n){return e.line-n.line||e.ch-n.ch}function oi(e,n){return e.sticky==n.sticky&&Lt(e,n)==0}function ue(e){return ot(e.line,e.ch)}function Oe(e,n){return Lt(e,n)<0?n:e}function qe(e,n){return Lt(e,n)<0?e:n}function st(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function lt(e,n){if(n.line<e.first)return ot(e.first,0);var u=e.first+e.size-1;return n.line>u?ot(u,Tt(e,u).text.length):Kt(n,Tt(e,n.line).text.length)}function Kt(e,n){var u=e.ch;return u==null||u>n?ot(e.line,n):u<0?ot(e.line,0):e}function Xt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=lt(e,n[l]);return u}var Tr=function(e,n){this.state=e,this.lookAhead=n},Pr=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Pr.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Pr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Pr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Pr.fromSaved=function(e,n,u){return n instanceof Tr?new Pr(e,Br(e.mode,n.state),u,n.lookAhead):new Pr(e,Br(e.mode,n),u)},Pr.prototype.save=function(e){var n=e!==!1?Br(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Tr(n,this.maxLookAhead):n};function _t(e,n,u,l){var f=[e.state.modeGen],m={};Gl(e,n.text,e.doc.mode,u,function(Z,be){return f.push(Z,be)},m,l);for(var F=u.state,U=function(Z){u.baseTokens=f;var be=e.state.overlays[Z],Ce=1,De=0;u.state=!0,Gl(e,n.text,be.mode,u,function(ke,Ye){for(var tt=Ce;De<ke;){var at=f[Ce];at>ke&&f.splice(Ce,1,ke,f[Ce+1],at),Ce+=2,De=Math.min(ke,at)}if(!!Ye)if(be.opaque)f.splice(tt,Ce-tt,ke,"overlay "+Ye),Ce=tt+2;else for(;tt<Ce;tt+=2){var ct=f[tt+1];f[tt+1]=(ct?ct+" ":"")+"overlay "+Ye}},m),u.state=F,u.baseTokens=null,u.baseTokenPos=1},H=0;H<e.state.overlays.length;++H)U(H);return{styles:f,classes:m.bgClass||m.textClass?m:null}}function Hl(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=en(e,Zt(n)),f=n.text.length>e.options.maxHighlightLength&&Br(e.doc.mode,l.state),m=_t(e,n,l);f&&(l.state=f),n.stateAfter=l.save(!f),n.styles=m.styles,m.classes?n.styleClasses=m.classes:n.styleClasses&&(n.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function en(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Pr(l,!0,n);var m=Lf(e,n,u),F=m>l.first&&Tt(l,m-1).stateAfter,U=F?Pr.fromSaved(l,F,m):new Pr(l,Qn(l.mode),m);return l.iter(m,n,function(H){vs(e,H.text,U);var Z=U.line;H.stateAfter=Z==n-1||Z%5==0||Z>=f.viewFrom&&Z<f.viewTo?U.save():null,U.nextLine()}),u&&(l.modeFrontier=U.line),U}function vs(e,n,u,l){var f=e.doc.mode,m=new ur(n,e.options.tabSize,u);for(m.start=m.pos=l||0,n==""&&ya(f,u.state);!m.eol();)gs(f,m,u.state),m.start=m.pos}function ya(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=$r(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function gs(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=$r(e,u).mode);var m=e.token(n,u);if(n.pos>n.start)return m}throw new Error("Mode "+e.name+" failed to advance stream.")}var ys=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function ms(e,n,u,l){var f=e.doc,m=f.mode,F;n=lt(f,n);var U=Tt(f,n.line),H=en(e,n.line,u),Z=new ur(U.text,e.options.tabSize,H),be;for(l&&(be=[]);(l||Z.pos<n.ch)&&!Z.eol();)Z.start=Z.pos,F=gs(m,Z,H.state),l&&be.push(new ys(Z,F,Br(f.mode,H.state)));return l?be:new ys(Z,F,H.state)}function zl(e,n){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";n[l]==null?n[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+u[2])}return e}function Gl(e,n,u,l,f,m,F){var U=u.flattenSpans;U==null&&(U=e.options.flattenSpans);var H=0,Z=null,be=new ur(n,e.options.tabSize,l),Ce,De=e.options.addModeClass&&[null];for(n==""&&zl(ya(u,l.state),m);!be.eol();){if(be.pos>e.options.maxHighlightLength?(U=!1,F&&vs(e,n,l,be.pos),be.pos=n.length,Ce=null):Ce=zl(gs(u,be,l.state,De),m),De){var ke=De[0].name;ke&&(Ce="m-"+(Ce?ke+" "+Ce:ke))}if(!U||Z!=Ce){for(;H<be.start;)H=Math.min(be.start,H+5e3),f(H,Z);Z=Ce}be.start=be.pos}for(;H<be.pos;){var Ye=Math.min(be.pos,H+5e3);f(Ye,Z),H=Ye}}function Lf(e,n,u){for(var l,f,m=e.doc,F=u?-1:n-(e.doc.mode.innerMode?1e3:100),U=n;U>F;--U){if(U<=m.first)return m.first;var H=Tt(m,U-1),Z=H.stateAfter;if(Z&&(!u||U+(Z instanceof Tr?Z.lookAhead:0)<=m.modeFrontier))return U;var be=Xe(H.text,null,e.options.tabSize);(f==null||l>be)&&(f=U-1,l=be)}return f}function Df(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),!(e.highlightFrontier<n-10)){for(var u=e.first,l=n-1;l>u;l--){var f=Tt(e,l).stateAfter;if(f&&(!(f instanceof Tr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var Nf=!1,Ai=!1;function Bf(){Nf=!0}function Uf(){Ai=!0}function ma(e,n,u){this.marker=e,this.from=n,this.to=u}function Po(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function jf(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function Id(e,n,u){var l=u&&window.WeakSet&&(u.markedSpans||(u.markedSpans=new WeakSet));l&&l.has(e.markedSpans)?e.markedSpans.push(n):(e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],l&&l.add(e.markedSpans)),n.marker.attachLine(e)}function Fd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);if(U||m.from==n&&F.type=="bookmark"&&(!u||!m.marker.insertLeft)){var H=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);(l||(l=[])).push(new ma(F,m.from,H?null:m.to))}}return l}function kd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);if(U||m.from==n&&F.type=="bookmark"&&(!u||m.marker.insertLeft)){var H=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);(l||(l=[])).push(new ma(F,H?null:m.from-n,m.to==null?null:m.to-n))}}return l}function $l(e,n){if(n.full)return null;var u=Zn(e,n.from.line)&&Tt(e,n.from.line).markedSpans,l=Zn(e,n.to.line)&&Tt(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,m=n.to.ch,F=Lt(n.from,n.to)==0,U=Fd(u,f,F),H=kd(l,m,F),Z=n.text.length==1,be=Ct(n.text).length+(Z?f:0);if(U)for(var Ce=0;Ce<U.length;++Ce){var De=U[Ce];if(De.to==null){var ke=Po(H,De.marker);ke?Z&&(De.to=ke.to==null?null:ke.to+be):De.to=f}}if(H)for(var Ye=0;Ye<H.length;++Ye){var tt=H[Ye];if(tt.to!=null&&(tt.to+=be),tt.from==null){var at=Po(U,tt.marker);at||(tt.from=be,Z&&(U||(U=[])).push(tt))}else tt.from+=be,Z&&(U||(U=[])).push(tt)}U&&(U=Kl(U)),H&&H!=U&&(H=Kl(H));var ct=[U];if(!Z){var gt=n.text.length-2,dt;if(gt>0&&U)for(var xt=0;xt<U.length;++xt)U[xt].to==null&&(dt||(dt=[])).push(new ma(U[xt].marker,null,null));for(var Ft=0;Ft<gt;++Ft)ct.push(dt);ct.push(H)}return ct}function Kl(e){for(var n=0;n<e.length;++n){var u=e[n];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Yl(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(ke){if(ke.markedSpans)for(var Ye=0;Ye<ke.markedSpans.length;++Ye){var tt=ke.markedSpans[Ye].marker;tt.readOnly&&(!l||ht(l,tt)==-1)&&(l||(l=[])).push(tt)}}),!l)return null;for(var f=[{from:n,to:u}],m=0;m<l.length;++m)for(var F=l[m],U=F.find(0),H=0;H<f.length;++H){var Z=f[H];if(!(Lt(Z.to,U.from)<0||Lt(Z.from,U.to)>0)){var be=[H,1],Ce=Lt(Z.from,U.from),De=Lt(Z.to,U.to);(Ce<0||!F.inclusiveLeft&&!Ce)&&be.push({from:Z.from,to:U.from}),(De>0||!F.inclusiveRight&&!De)&&be.push({from:U.to,to:Z.to}),f.splice.apply(f,be),H+=be.length-3}}return f}function Jl(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function Vf(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function xs(e){return e.inclusiveLeft?-1:0}function bs(e){return e.inclusiveRight?1:0}function Xl(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),m=Lt(l.from,f.from)||xs(e)-xs(n);if(m)return-m;var F=Lt(l.to,f.to)||bs(e)-bs(n);return F||n.id-e.id}function Io(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=void 0,m=0;m<u.length;++m)f=u[m],f.marker.collapsed&&(n?f.from:f.to)==null&&(!l||Xl(l,f.marker)<0)&&(l=f.marker);return l}function ws(e){return Io(e,!0)}function Ui(e){return Io(e,!1)}function Wf(e,n){var u=Ai&&e.markedSpans,l;if(u)for(var f=0;f<u.length;++f){var m=u[f];m.marker.collapsed&&(m.from==null||m.from<n)&&(m.to==null||m.to>n)&&(!l||Xl(l,m.marker)<0)&&(l=m.marker)}return l}function xa(e,n,u,l,f){var m=Tt(e,n),F=Ai&&m.markedSpans;if(F)for(var U=0;U<F.length;++U){var H=F[U];if(!!H.marker.collapsed){var Z=H.marker.find(0),be=Lt(Z.from,u)||xs(H.marker)-xs(f),Ce=Lt(Z.to,l)||bs(H.marker)-bs(f);if(!(be>=0&&Ce<=0||be<=0&&Ce>=0)&&(be<=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.to,u)>=0:Lt(Z.to,u)>0)||be>=0&&(H.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.from,l)<=0:Lt(Z.from,l)<0)))return!0}}}function Wn(e){for(var n;n=ws(e);)e=n.find(-1,!0).line;return e}function Ql(e){for(var n;n=Ui(e);)e=n.find(1,!0).line;return e}function Hf(e){for(var n,u;n=Ui(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function Fo(e,n){var u=Tt(e,n),l=Wn(u);return u==l?n:Zt(l)}function Ss(e,n){if(n>e.lastLine())return n;var u=Tt(e,n),l;if(!ai(e,u))return n;for(;l=Ui(u);)u=l.find(1,!0).line;return Zt(u)+1}function ai(e,n){var u=Ai&&n.markedSpans;if(u){for(var l=void 0,f=0;f<u.length;++f)if(l=u[f],!!l.marker.collapsed){if(l.from==null)return!0;if(!l.marker.widgetNode&&l.from==0&&l.marker.inclusiveLeft&&fr(e,n,l))return!0}}}function fr(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return fr(e,l.line,Po(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==n.text.length)return!0;for(var f=void 0,m=0;m<n.markedSpans.length;++m)if(f=n.markedSpans[m],f.marker.collapsed&&!f.marker.widgetNode&&f.from==u.to&&(f.to==null||f.to!=u.from)&&(f.marker.inclusiveLeft||u.marker.inclusiveRight)&&fr(e,n,f))return!0}function si(e){e=Wn(e);for(var n=0,u=e.parent,l=0;l<u.lines.length;++l){var f=u.lines[l];if(f==e)break;n+=f.height}for(var m=u.parent;m;u=m,m=u.parent)for(var F=0;F<m.children.length;++F){var U=m.children[F];if(U==u)break;n+=U.height}return n}function ji(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=ws(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Ui(l);){var m=u.find(0,!0);n-=l.text.length-m.from.ch,l=m.to.line,n+=l.text.length-m.to.ch}return n}function As(e){var n=e.display,u=e.doc;n.maxLine=Tt(u,u.first),n.maxLineLength=ji(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=ji(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var Vi=function(e,n,u){this.text=e,Vf(this,n),this.height=u?u(this):1};Vi.prototype.lineNo=function(){return Zt(this)},Ue(Vi);function Ei(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Jl(e),Vf(e,u);var f=l?l(e):1;f!=e.height&&An(e,f)}function Wi(e){e.parent=null,Jl(e)}var Es={},Cs={};function Zl(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?Cs:Es;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function Os(e,n){var u=he("span",null,null,g?"padding-right: .1px":null),l={pre:he("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var f=0;f<=(n.rest?n.rest.length:0);f++){var m=f?n.rest[f-1]:n.line,F=void 0;l.pos=0,l.addToken=Ps,Bi(e.display.measure)&&(F=O(m,e.doc.direction))&&(l.addToken=zf(l.addToken,F)),l.map=[];var U=n!=e.display.externalMeasured&&Zt(m);Gf(m,l,Hl(e,m,U)),m.styleClasses&&(m.styleClasses.bgClass&&(l.bgClass=Me(m.styleClasses.bgClass,l.bgClass||"")),m.styleClasses.textClass&&(l.textClass=Me(m.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(mi(e.display.measure))),f==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(g){var H=l.content.lastChild;(/\bcm-tab\b/.test(H.className)||H.querySelector&&H.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return oe(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Me(l.pre.className,l.textClass||"")),l}function Ts(e){var n=we("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Ps(e,n,u,l,f,m,F){if(!!n){var U=e.splitSpaces?Hi(n,e.trailingSpace):n,H=e.cm.state.specialChars,Z=!1,be;if(!H.test(n))e.col+=n.length,be=document.createTextNode(U),e.map.push(e.pos,e.pos+n.length,be),b&&S<9&&(Z=!0),e.pos+=n.length;else{be=document.createDocumentFragment();for(var Ce=0;;){H.lastIndex=Ce;var De=H.exec(n),ke=De?De.index-Ce:n.length-Ce;if(ke){var Ye=document.createTextNode(U.slice(Ce,Ce+ke));b&&S<9?be.appendChild(we("span",[Ye])):be.appendChild(Ye),e.map.push(e.pos,e.pos+ke,Ye),e.col+=ke,e.pos+=ke}if(!De)break;Ce+=ke+1;var tt=void 0;if(De[0]==" "){var at=e.cm.options.tabSize,ct=at-e.col%at;tt=be.appendChild(we("span",kt(ct),"cm-tab")),tt.setAttribute("role","presentation"),tt.setAttribute("cm-text"," "),e.col+=ct}else De[0]=="\r"||De[0]==`
|
|
22
|
+
`?(tt=be.appendChild(we("span",De[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),tt.setAttribute("cm-text",De[0]),e.col+=1):(tt=e.cm.options.specialCharPlaceholder(De[0]),tt.setAttribute("cm-text",De[0]),b&&S<9?be.appendChild(we("span",[tt])):be.appendChild(tt),e.col+=1);e.map.push(e.pos,e.pos+1,tt),e.pos++}}if(e.trailingSpace=U.charCodeAt(n.length-1)==32,u||l||f||Z||m||F){var gt=u||"";l&&(gt+=l),f&&(gt+=f);var dt=we("span",[be],gt,m);if(F)for(var xt in F)F.hasOwnProperty(xt)&&xt!="style"&&xt!="class"&&dt.setAttribute(xt,F[xt]);return e.content.appendChild(dt)}e.content.appendChild(be)}}function Hi(e,n){if(e.length>1&&!/ /.test(e))return e;for(var u=n,l="",f=0;f<e.length;f++){var m=e.charAt(f);m==" "&&u&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(m="\xA0"),l+=m,u=m==" "}return l}function zf(e,n){return function(u,l,f,m,F,U,H){f=f?f+" cm-force-border":"cm-force-border";for(var Z=u.pos,be=Z+l.length;;){for(var Ce=void 0,De=0;De<n.length&&(Ce=n[De],!(Ce.to>Z&&Ce.from<=Z));De++);if(Ce.to>=be)return e(u,l,f,m,F,U,H);e(u,l.slice(0,Ce.to-Z),f,m,null,U,H),m=null,l=l.slice(Ce.to-Z),Z=Ce.to}}}function nr(e,n,u,l){var f=!l&&u.widgetNode;f&&e.map.push(e.pos,e.pos+n,f),!l&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",u.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=n,e.trailingSpace=!1}function Gf(e,n,u){var l=e.markedSpans,f=e.text,m=0;if(!l){for(var F=1;F<u.length;F+=2)n.addToken(n,f.slice(m,m=u[F]),Zl(u[F+1],n.cm.options));return}for(var U=f.length,H=0,Z=1,be="",Ce,De,ke=0,Ye,tt,at,ct,gt;;){if(ke==H){Ye=tt=at=De="",gt=null,ct=null,ke=1/0;for(var dt=[],xt=void 0,Ft=0;Ft<l.length;++Ft){var It=l[Ft],it=It.marker;if(it.type=="bookmark"&&It.from==H&&it.widgetNode)dt.push(it);else if(It.from<=H&&(It.to==null||It.to>H||it.collapsed&&It.to==H&&It.from==H)){if(It.to!=null&&It.to!=H&&ke>It.to&&(ke=It.to,tt=""),it.className&&(Ye+=" "+it.className),it.css&&(De=(De?De+";":"")+it.css),it.startStyle&&It.from==H&&(at+=" "+it.startStyle),it.endStyle&&It.to==ke&&(xt||(xt=[])).push(it.endStyle,It.to),it.title&&((gt||(gt={})).title=it.title),it.attributes)for(var Gt in it.attributes)(gt||(gt={}))[Gt]=it.attributes[Gt];it.collapsed&&(!ct||Xl(ct.marker,it)<0)&&(ct=It)}else It.from>H&&ke>It.from&&(ke=It.from)}if(xt)for(var hr=0;hr<xt.length;hr+=2)xt[hr+1]==ke&&(tt+=" "+xt[hr]);if(!ct||ct.from==H)for(var vr=0;vr<dt.length;++vr)nr(n,0,dt[vr]);if(ct&&(ct.from||0)==H){if(nr(n,(ct.to==null?U+1:ct.to)-H,ct.marker,ct.from==null),ct.to==null)return;ct.to==H&&(ct=!1)}}if(H>=U)break;for(var bn=Math.min(U,ke);;){if(be){var fn=H+be.length;if(!ct){var Ar=fn>bn?be.slice(0,bn-H):be;n.addToken(n,Ar,Ce?Ce+Ye:Ye,at,H+Ar.length==ke?tt:"",De,gt)}if(fn>=bn){be=be.slice(bn-H),H=bn;break}H=fn,at=""}be=f.slice(m,m=u[Z++]),Ce=Zl(u[Z++],n.cm.options)}}}function _l(e,n,u){this.line=n,this.rest=Hf(n),this.size=this.rest?Zt(Ct(this.rest))-u+1:1,this.node=this.text=null,this.hidden=ai(e,n)}function ba(e,n,u){for(var l=[],f,m=n;m<u;m=f){var F=new _l(e.doc,Tt(e.doc,m),m);f=m+F.size,l.push(F)}return l}var tn=null;function ql(e){tn?tn.ops.push(e):e.ownsGroup=tn={ops:[e],delayedCallbacks:[]}}function eu(e){var n=e.delayedCallbacks,u=0;do{for(;u<n.length;u++)n[u].call(null);for(var l=0;l<e.ops.length;l++){var f=e.ops[l];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(u<n.length)}function Is(e,n){var u=e.ownsGroup;if(!!u)try{eu(u)}finally{tn=null,n(u)}}var ko=null;function ir(e,n){var u=te(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;tn?f=tn.delayedCallbacks:ko?f=ko:(f=ko=[],setTimeout($f,0));for(var m=function(U){f.push(function(){return u[U].apply(null,l)})},F=0;F<u.length;++F)m(F)}}function $f(){var e=ko;ko=null;for(var n=0;n<e.length;++n)e[n]()}function wa(e,n,u,l){for(var f=0;f<n.changes.length;f++){var m=n.changes[f];m=="text"?Kf(e,n):m=="gutter"?Ro(e,n,u,l):m=="class"?Fs(e,n):m=="widget"&&Yf(e,n,l)}n.changes=null}function Mo(e){return e.node==e.text&&(e.node=we("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&S<8&&(e.node.style.zIndex=2)),e.node}function tu(e,n){var u=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),n.background)u?n.background.className=u:(n.background.parentNode.removeChild(n.background),n.background=null);else if(u){var l=Mo(n);n.background=l.insertBefore(we("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function ru(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):Os(e,n)}function Kf(e,n){var u=n.text.className,l=ru(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,Fs(e,n)):u&&(n.text.className=u)}function Fs(e,n){tu(e,n),n.line.wrapClass?Mo(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var u=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=u||""}function Ro(e,n,u,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var f=Mo(n);n.gutterBackground=we("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),f.insertBefore(n.gutterBackground,n.text)}var m=n.line.gutterMarkers;if(e.options.lineNumbers||m){var F=Mo(n),U=n.gutter=we("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(U.setAttribute("aria-hidden","true"),e.display.input.setUneditable(U),F.insertBefore(U,n.text),n.line.gutterClass&&(U.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!m||!m["CodeMirror-linenumbers"])&&(n.lineNumber=U.appendChild(we("div",lo(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),m)for(var H=0;H<e.display.gutterSpecs.length;++H){var Z=e.display.gutterSpecs[H].className,be=m.hasOwnProperty(Z)&&m[Z];be&&U.appendChild(we("div",[be],"CodeMirror-gutter-elt","left: "+l.gutterLeft[Z]+"px; width: "+l.gutterWidth[Z]+"px"))}}}function Yf(e,n,u){n.alignable&&(n.alignable=null);for(var l=ce("CodeMirror-linewidget"),f=n.node.firstChild,m=void 0;f;f=m)m=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);nu(e,n,u)}function qt(e,n,u,l){var f=ru(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Fs(e,n),Ro(e,n,u,l),nu(e,n,l),n.node}function nu(e,n,u){if(Qt(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Qt(e,n.rest[l],n,u,!1)}function Qt(e,n,u,l,f){if(!!n.widgets)for(var m=Mo(u),F=0,U=n.widgets;F<U.length;++F){var H=U[F],Z=we("div",[H.node],"CodeMirror-linewidget"+(H.className?" "+H.className:""));H.handleMouseEvents||Z.setAttribute("cm-ignore-events","true"),Jf(H,Z,u,l),e.display.input.setUneditable(Z),f&&H.above?m.insertBefore(Z,u.gutter||u.text):m.appendChild(Z),ir(H,"redraw")}}function Jf(e,n,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(n);var f=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(f-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=f+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Ot(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!ae(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+n.display.wrapper.clientWidth+"px;"),xe(n.display.measure,we("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function li(e,n){for(var u=Pt(n);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function Lo(e){return e.lineSpace.offsetTop}function ks(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ln(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=xe(e.measure,we("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function ui(e){return bt-e.display.nativeBarWidth}function zi(e){return e.display.scroller.clientWidth-ui(e)-e.display.barWidth}function Do(e){return e.display.scroller.clientHeight-ui(e)-e.display.barHeight}function Xf(e,n,u){var l=e.options.lineWrapping,f=l&&zi(e);if(!n.measure.heights||l&&n.measure.width!=f){var m=n.measure.heights=[];if(l){n.measure.width=f;for(var F=n.text.firstChild.getClientRects(),U=0;U<F.length-1;U++){var H=F[U],Z=F[U+1];Math.abs(H.bottom-Z.bottom)>2&&m.push((H.bottom+Z.top)/2-u.top)}}m.push(u.bottom-u.top)}}function Ms(e,n,u){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var f=0;f<e.rest.length;f++)if(Zt(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function Qf(e,n){n=Wn(n);var u=Zt(n),l=e.display.externalMeasured=new _l(e.doc,n,u);l.lineN=u;var f=l.built=Os(e,l);return l.text=f.pre,xe(e.display.lineMeasure,f.pre),l}function Sa(e,n,u,l){return Hn(e,_n(e,n),u,l)}function Rs(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[Yi(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function _n(e,n){var u=Zt(n),l=Rs(e,u);l&&!l.text?l=null:l&&l.changes&&(wa(e,l,u,Vs(e)),e.curOp.forceUpdate=!0),l||(l=Qf(e,n));var f=Ms(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function Hn(e,n,u,l,f){n.before&&(u=-1);var m=u+(l||""),F;return n.cache.hasOwnProperty(m)?F=n.cache[m]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Xf(e,n.view,n.rect),n.hasHeights=!0),F=iu(e,n,u,l),F.bogus||(n.cache[m]=F)),{left:F.left,right:F.right,top:f?F.rtop:F.top,bottom:f?F.rbottom:F.bottom}}var Aa={left:0,right:0,top:0,bottom:0};function Ls(e,n,u){for(var l,f,m,F,U,H,Z=0;Z<e.length;Z+=3)if(U=e[Z],H=e[Z+1],n<U?(f=0,m=1,F="left"):n<H?(f=n-U,m=f+1):(Z==e.length-3||n==H&&e[Z+3]>n)&&(m=H-U,f=m-1,n>=H&&(F="right")),f!=null){if(l=e[Z+2],U==H&&u==(l.insertLeft?"left":"right")&&(F=u),u=="left"&&f==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)l=e[(Z-=3)+2],F="left";if(u=="right"&&f==H-U)for(;Z<e.length-3&&e[Z+3]==e[Z+4]&&!e[Z+5].insertLeft;)l=e[(Z+=3)+2],F="right";break}return{node:l,start:f,end:m,collapse:F,coverStart:U,coverEnd:H}}function Ds(e,n){var u=Aa;if(n=="left")for(var l=0;l<e.length&&(u=e[l]).left==u.right;l++);else for(var f=e.length-1;f>=0&&(u=e[f]).left==u.right;f--);return u}function iu(e,n,u,l){var f=Ls(n.map,u,l),m=f.node,F=f.start,U=f.end,H=f.collapse,Z;if(m.nodeType==3){for(var be=0;be<4;be++){for(;F&&Ie(n.line.text.charAt(f.coverStart+F));)--F;for(;f.coverStart+U<f.coverEnd&&Ie(n.line.text.charAt(f.coverStart+U));)++U;if(b&&S<9&&F==0&&U==f.coverEnd-f.coverStart?Z=m.parentNode.getBoundingClientRect():Z=Ds(fe(m,F,U).getClientRects(),l),Z.left||Z.right||F==0)break;U=F,F=F-1,H="right"}b&&S<11&&(Z=ou(e.display.measure,Z))}else{F>0&&(H=l="right");var Ce;e.options.lineWrapping&&(Ce=m.getClientRects()).length>1?Z=Ce[l=="right"?Ce.length-1:0]:Z=m.getBoundingClientRect()}if(b&&S<9&&!F&&(!Z||!Z.left&&!Z.right)){var De=m.parentNode.getClientRects()[0];De?Z={left:De.left,right:De.left+Pn(e.display),top:De.top,bottom:De.bottom}:Z=Aa}for(var ke=Z.top-n.rect.top,Ye=Z.bottom-n.rect.top,tt=(ke+Ye)/2,at=n.view.measure.heights,ct=0;ct<at.length-1&&!(tt<at[ct]);ct++);var gt=ct?at[ct-1]:0,dt=at[ct],xt={left:(H=="right"?Z.right:Z.left)-n.rect.left,right:(H=="left"?Z.left:Z.right)-n.rect.left,top:gt,bottom:dt};return!Z.left&&!Z.right&&(xt.bogus=!0),e.options.singleCursorHeightPerLine||(xt.rtop=ke,xt.rbottom=Ye),xt}function ou(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!xi(e))return n;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*u,right:n.right*u,top:n.top*l,bottom:n.bottom*l}}function Ns(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function Gi(e){e.display.externalMeasure=null,ie(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)Ns(e.display.view[n])}function No(e){Gi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Bo(){return D&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function au(){return D&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Uo(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=Ot(e.widgets[u]));return n}function Ea(e,n,u,l,f){if(!f){var m=Uo(n);u.top+=m,u.bottom+=m}if(l=="line")return u;l||(l="local");var F=si(n);if(l=="local"?F+=Lo(e.display):F-=e.display.viewOffset,l=="page"||l=="window"){var U=e.display.lineSpace.getBoundingClientRect();F+=U.top+(l=="window"?0:au());var H=U.left+(l=="window"?0:Bo());u.left+=H,u.right+=H}return u.top+=F,u.bottom+=F,u}function jo(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Bo(),f-=au();else if(u=="local"||!u){var m=e.display.sizer.getBoundingClientRect();l+=m.left,f+=m.top}var F=e.display.lineSpace.getBoundingClientRect();return{left:l-F.left,top:f-F.top}}function Ca(e,n,u,l,f){return l||(l=Tt(e.doc,n.line)),Ea(e,l,Sa(e,l,n.ch,f),u)}function zn(e,n,u,l,f,m){l=l||Tt(e.doc,n.line),f||(f=_n(e,l));function F(Ye,tt){var at=Hn(e,f,Ye,tt?"right":"left",m);return tt?at.left=at.right:at.right=at.left,Ea(e,l,at,u)}var U=O(l,e.doc.direction),H=n.ch,Z=n.sticky;if(H>=l.text.length?(H=l.text.length,Z="before"):H<=0&&(H=0,Z="after"),!U)return F(Z=="before"?H-1:H,Z=="before");function be(Ye,tt,at){var ct=U[tt],gt=ct.level==1;return F(at?Ye-1:Ye,gt!=at)}var Ce=K(U,H,Z),De=Re,ke=be(H,Ce,Z=="before");return De!=null&&(ke.other=be(H,De,Z!="before")),ke}function su(e,n){var u=0;n=lt(e.doc,n),e.options.lineWrapping||(u=Pn(e.display)*n.ch);var l=Tt(e.doc,n.line),f=si(l)+Lo(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function Bs(e,n,u,l,f){var m=ot(e,n,u);return m.xRel=f,l&&(m.outside=l),m}function Us(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Bs(l.first,0,null,-1,-1);var f=Vn(l,u),m=l.first+l.size-1;if(f>m)return Bs(l.first+l.size-1,Tt(l,m).text.length,null,1,1);n<0&&(n=0);for(var F=Tt(l,f);;){var U=Zf(e,F,f,n,u),H=Wf(F,U.ch+(U.xRel>0||U.outside>0?1:0));if(!H)return U;var Z=H.find(1);if(Z.line==f)return Z;F=Tt(l,f=Z.line)}}function lu(e,n,u,l){l-=Uo(n);var f=n.text.length,m=Ke(function(F){return Hn(e,u,F-1).bottom<=l},f,0);return f=Ke(function(F){return Hn(e,u,F).top>l},m,f),{begin:m,end:f}}function uu(e,n,u,l){u||(u=_n(e,n));var f=Ea(e,n,Hn(e,u,l),"line").top;return lu(e,n,u,f)}function js(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function Zf(e,n,u,l,f){f-=si(n);var m=_n(e,n),F=Uo(n),U=0,H=n.text.length,Z=!0,be=O(n,e.doc.direction);if(be){var Ce=(e.options.lineWrapping?qf:_f)(e,n,u,m,be,l,f);Z=Ce.level!=1,U=Z?Ce.from:Ce.to-1,H=Z?Ce.to:Ce.from-1}var De=null,ke=null,Ye=Ke(function(Ft){var It=Hn(e,m,Ft);return It.top+=F,It.bottom+=F,js(It,l,f,!1)?(It.top<=f&&It.left<=l&&(De=Ft,ke=It),!0):!1},U,H),tt,at,ct=!1;if(ke){var gt=l-ke.left<ke.right-l,dt=gt==Z;Ye=De+(dt?0:1),at=dt?"after":"before",tt=gt?ke.left:ke.right}else{!Z&&(Ye==H||Ye==U)&&Ye++,at=Ye==0?"after":Ye==n.text.length?"before":Hn(e,m,Ye-(Z?1:0)).bottom+F<=f==Z?"after":"before";var xt=zn(e,ot(u,Ye,at),"line",n,m);tt=xt.left,ct=f<xt.top?-1:f>=xt.bottom?1:0}return Ye=$e(n.text,Ye,1),Bs(u,Ye,at,ct,l-tt)}function _f(e,n,u,l,f,m,F){var U=Ke(function(Ce){var De=f[Ce],ke=De.level!=1;return js(zn(e,ot(u,ke?De.to:De.from,ke?"before":"after"),"line",n,l),m,F,!0)},0,f.length-1),H=f[U];if(U>0){var Z=H.level!=1,be=zn(e,ot(u,Z?H.from:H.to,Z?"after":"before"),"line",n,l);js(be,m,F,!0)&&be.top>F&&(H=f[U-1])}return H}function qf(e,n,u,l,f,m,F){var U=lu(e,n,l,F),H=U.begin,Z=U.end;/\s/.test(n.text.charAt(Z-1))&&Z--;for(var be=null,Ce=null,De=0;De<f.length;De++){var ke=f[De];if(!(ke.from>=Z||ke.to<=H)){var Ye=ke.level!=1,tt=Hn(e,l,Ye?Math.min(Z,ke.to)-1:Math.max(H,ke.from)).right,at=tt<m?m-tt+1e9:tt-m;(!be||Ce>at)&&(be=ke,Ce=at)}}return be||(be=f[f.length-1]),be.from<H&&(be={from:H,to:be.to,level:be.level}),be.to>Z&&(be={from:be.from,to:Z,level:be.level}),be}var $i;function uo(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if($i==null){$i=we("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)$i.appendChild(document.createTextNode("x")),$i.appendChild(we("br"));$i.appendChild(document.createTextNode("x"))}xe(e.measure,$i);var u=$i.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ie(e.measure),u||1}function Pn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=we("span","xxxxxxxxxx"),u=we("pre",[n],"CodeMirror-line-like");xe(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Vs(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,m=n.gutters.firstChild,F=0;m;m=m.nextSibling,++F){var U=e.display.gutterSpecs[F].className;u[U]=m.offsetLeft+m.clientLeft+f,l[U]=m.clientWidth}return{fixedPos:In(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function In(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fu(e){var n=uo(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Pn(e.display)-3);return function(f){if(ai(e.doc,f))return 0;var m=0;if(f.widgets)for(var F=0;F<f.widgets.length;F++)f.widgets[F].height&&(m+=f.widgets[F].height);return u?m+(Math.ceil(f.text.length/l)||1)*n:m+n}}function Ws(e){var n=e.doc,u=fu(e);n.iter(function(l){var f=u(l);f!=l.height&&An(l,f)})}function Ki(e,n,u,l){var f=e.display;if(!u&&Pt(n).getAttribute("cm-not-content")=="true")return null;var m,F,U=f.lineSpace.getBoundingClientRect();try{m=n.clientX-U.left,F=n.clientY-U.top}catch(Ce){return null}var H=Us(e,m,F),Z;if(l&&H.xRel>0&&(Z=Tt(e.doc,H.line).text).length==H.ch){var be=Xe(Z,Z.length,e.options.tabSize)-Z.length;H=ot(H.line,Math.max(0,Math.round((m-ln(e.display).left)/Pn(e.display))-be))}return H}function Yi(e,n){if(n>=e.display.viewTo||(n-=e.display.viewFrom,n<0))return null;for(var u=e.display.view,l=0;l<u.length;l++)if(n-=u[l].size,n<0)return l}function Rr(e,n,u,l){n==null&&(n=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var f=e.display;if(l&&u<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>n)&&(f.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=f.viewTo)Ai&&Fo(e.doc,n)<f.viewTo&&Ci(e);else if(u<=f.viewFrom)Ai&&Ss(e.doc,u+l)>f.viewFrom?Ci(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)Ci(e);else if(n<=f.viewFrom){var m=Oa(e,u,u+l,1);m?(f.view=f.view.slice(m.index),f.viewFrom=m.lineN,f.viewTo+=l):Ci(e)}else if(u>=f.viewTo){var F=Oa(e,n,n,-1);F?(f.view=f.view.slice(0,F.index),f.viewTo=F.lineN):Ci(e)}else{var U=Oa(e,n,n,-1),H=Oa(e,u,u+l,1);U&&H?(f.view=f.view.slice(0,U.index).concat(ba(e,U.lineN,H.lineN)).concat(f.view.slice(H.index)),f.viewTo+=l):Ci(e)}var Z=f.externalMeasured;Z&&(u<Z.lineN?Z.lineN+=l:n<Z.lineN+Z.size&&(f.externalMeasured=null))}function qn(e,n,u){e.curOp.viewChanged=!0;var l=e.display,f=e.display.externalMeasured;if(f&&n>=f.lineN&&n<f.lineN+f.size&&(l.externalMeasured=null),!(n<l.viewFrom||n>=l.viewTo)){var m=l.view[Yi(e,n)];if(m.node!=null){var F=m.changes||(m.changes=[]);ht(F,u)==-1&&F.push(u)}}}function Ci(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Oa(e,n,u,l){var f=Yi(e,n),m,F=e.display.view;if(!Ai||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var U=e.display.viewFrom,H=0;H<f;H++)U+=F[H].size;if(U!=n){if(l>0){if(f==F.length-1)return null;m=U+F[f].size-n,f++}else m=U-n;n+=m,u+=m}for(;Fo(e.doc,u)!=u;){if(f==(l<0?0:F.length-1))return null;u+=l*F[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function ec(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=ba(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=ba(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(Yi(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat(ba(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,Yi(e,u)))),l.viewTo=u}function Ta(e){for(var n=e.display.view,u=0,l=0;l<n.length;l++){var f=n[l];!f.hidden&&(!f.node||f.changes)&&++u}return u}function Oi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Pa(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),m=l.selection=document.createDocumentFragment(),F=e.options.$customCursor;F&&(n=!0);for(var U=0;U<u.sel.ranges.length;U++)if(!(!n&&U==u.sel.primIndex)){var H=u.sel.ranges[U];if(!(H.from().line>=e.display.viewTo||H.to().line<e.display.viewFrom)){var Z=H.empty();if(F){var be=F(e,H);be&&Hs(e,be,f)}else(Z||e.options.showCursorWhenSelecting)&&Hs(e,H.head,f);Z||cu(e,H,m)}}return l}function Hs(e,n,u){var l=zn(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(we("div","\xA0","CodeMirror-cursor"));if(f.style.left=l.left+"px",f.style.top=l.top+"px",f.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var m=Ca(e,n,"div",null,null),F=m.right-m.left;f.style.width=(F>0?F:e.defaultCharWidth())+"px"}if(l.other){var U=u.appendChild(we("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));U.style.display="",U.style.left=l.other.left+"px",U.style.top=l.other.top+"px",U.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Ia(e,n){return e.top-n.top||e.left-n.left}function cu(e,n,u){var l=e.display,f=e.doc,m=document.createDocumentFragment(),F=ln(e.display),U=F.left,H=Math.max(l.sizerWidth,zi(e)-l.sizer.offsetLeft)-F.right,Z=f.direction=="ltr";function be(dt,xt,Ft,It){xt<0&&(xt=0),xt=Math.round(xt),It=Math.round(It),m.appendChild(we("div",null,"CodeMirror-selected","position: absolute; left: "+dt+`px;
|
|
23
23
|
top: `+xt+"px; width: "+(Ft==null?H-dt:Ft)+`px;
|
|
24
|
-
height: `+(It-xt)+"px"))}function Ce(dt,xt,Ft){var It=Tt(f,dt),it=It.text.length,Gt,hr;function vr(Ar,cn){return Ca(e,ot(dt,Ar),"div",It,cn)}function bn(Ar,cn,Kr){var Fr=
|
|
24
|
+
height: `+(It-xt)+"px"))}function Ce(dt,xt,Ft){var It=Tt(f,dt),it=It.text.length,Gt,hr;function vr(Ar,cn){return Ca(e,ot(dt,Ar),"div",It,cn)}function bn(Ar,cn,Kr){var Fr=uu(e,It,null,Ar),gr=cn=="ltr"==(Kr=="after")?"left":"right",yr=Kr=="after"?Fr.begin:Fr.end-(/\s/.test(It.text.charAt(Fr.end-1))?2:1);return vr(yr,gr)[gr]}var fn=O(It,f.direction);return P(fn,xt||0,Ft==null?it:Ft,function(Ar,cn,Kr,Fr){var gr=Kr=="ltr",yr=vr(Ar,gr?"left":"right"),nn=vr(cn-1,gr?"right":"left"),no=xt==null&&Ar==0,Mi=Ft==null&&cn==it,Qr=Fr==0,$n=!fn||Fr==fn.length-1;if(nn.top-yr.top<=3){var Vr=(Z?no:Mi)&&Qr,io=(Z?Mi:no)&&$n,Er=Vr?U:(gr?yr:nn).left,Eo=io?H:(gr?nn:yr).right;be(Er,yr.top,Eo-Er,yr.bottom)}else{var Kn,on,ua,ff;gr?(Kn=Z&&no&&Qr?U:yr.left,on=Z?H:bn(Ar,Kr,"before"),ua=Z?U:bn(cn,Kr,"after"),ff=Z&&Mi&&$n?H:nn.right):(Kn=Z?bn(Ar,Kr,"before"):U,on=!Z&&no&&Qr?H:yr.right,ua=!Z&&Mi&&$n?U:nn.left,ff=Z?bn(cn,Kr,"after"):H),be(Kn,yr.top,on-Kn,yr.bottom),yr.bottom<nn.top&&be(U,yr.bottom,null,nn.top),be(ua,nn.top,ff-ua,nn.bottom)}(!Gt||Ia(yr,Gt)<0)&&(Gt=yr),Ia(nn,Gt)<0&&(Gt=nn),(!hr||Ia(yr,hr)<0)&&(hr=yr),Ia(nn,hr)<0&&(hr=nn)}),{start:Gt,end:hr}}var De=n.from(),ke=n.to();if(De.line==ke.line)Ce(De.line,De.ch,ke.ch);else{var Ye=Tt(f,De.line),tt=Tt(f,ke.line),at=Wn(Ye)==Wn(tt),ct=Ce(De.line,De.ch,at?Ye.text.length+1:null).end,gt=Ce(ke.line,at?0:null,ke.ch).start;at&&(ct.top<gt.top-2?(be(ct.right,ct.top,null,ct.bottom),be(U,gt.top,gt.left,gt.bottom)):be(ct.right,ct.top,gt.left-ct.right,ct.bottom)),ct.bottom<gt.top&&be(U,ct.bottom,null,gt.top)}u.appendChild(m)}function zs(e){if(!!e.state.focused){var n=e.display;clearInterval(n.blinker);var u=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||fo(e),n.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}}function Gs(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Fa(e))}function Vo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&fo(e))},100)}function Fa(e,n){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(oe(e,"focus",e,n),e.state.focused=!0,Le(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),zs(e))}function fo(e,n){e.state.delayingBlurEvent||(e.state.focused&&(oe(e,"blur",e,n),e.state.focused=!1,ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ka(e){for(var n=e.display,u=n.lineDiv.offsetTop,l=Math.max(0,n.scroller.getBoundingClientRect().top),f=n.lineDiv.getBoundingClientRect().top,m=0,F=0;F<n.view.length;F++){var U=n.view[F],H=e.options.lineWrapping,Z=void 0,be=0;if(!U.hidden){if(f+=U.line.height,b&&S<8){var Ce=U.node.offsetTop+U.node.offsetHeight;Z=Ce-u,u=Ce}else{var De=U.node.getBoundingClientRect();Z=De.bottom-De.top,!H&&U.text.firstChild&&(be=U.text.firstChild.getBoundingClientRect().right-De.left-1)}var ke=U.line.height-Z;if((ke>.005||ke<-.005)&&(f<l&&(m-=ke),An(U.line,Z),$s(U.line),U.rest))for(var Ye=0;Ye<U.rest.length;Ye++)$s(U.rest[Ye]);if(be>e.display.sizerWidth){var tt=Math.ceil(be/Pn(e.display));tt>e.display.maxLineLength&&(e.display.maxLineLength=tt,e.display.maxLine=U.line,e.display.maxLineChanged=!0)}}}Math.abs(m)>2&&(n.scroller.scrollTop+=m)}function $s(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var u=e.widgets[n],l=u.node.parentNode;l&&(u.height=l.offsetHeight)}}function Wo(e,n,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-Lo(e));var f=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,m=Vn(n,l),F=Vn(n,f);if(u&&u.ensure){var U=u.ensure.from.line,H=u.ensure.to.line;U<m?(m=U,F=Vn(n,si(Tt(n,U))+e.wrapper.clientHeight)):Math.min(H,n.lastLine())>=F&&(m=Vn(n,si(Tt(n,H))-e.wrapper.clientHeight),F=H)}return{from:m,to:Math.max(F,m+1)}}function tc(e,n){if(!pe(e,"scrollCursorIntoView")){var u=e.display,l=u.sizer.getBoundingClientRect(),f=null;if(n.top+l.top<0?f=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!W){var m=we("div","\u200B",null,`position: absolute;
|
|
25
25
|
top: `+(n.top-u.viewOffset-Lo(e.display))+`px;
|
|
26
26
|
height: `+(n.bottom-n.top+ui(e)+u.barHeight)+`px;
|
|
27
|
-
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(m),m.scrollIntoView(f),e.display.lineSpace.removeChild(m)}}}function cu(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?ot(n.line,n.ch+1,"before"):n,n=n.ch?ot(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var m=0;m<5;m++){var F=!1,U=zn(e,n),H=!u||u==n?U:zn(e,u);f={left:Math.min(U.left,H.left),top:Math.min(U.top,H.top)-l,right:Math.max(U.left,H.left),bottom:Math.max(U.bottom,H.bottom)+l};var Z=Ks(e,f),be=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(Z.scrollTop!=null&&(zo(e,Z.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&(F=!0)),Z.scrollLeft!=null&&(Xi(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(F=!0)),!F)break}return f}function du(e,n){var u=Ks(e,n);u.scrollTop!=null&&zo(e,u.scrollTop),u.scrollLeft!=null&&Xi(e,u.scrollLeft)}function Ks(e,n){var u=e.display,l=uo(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,m=Do(e),F={};n.bottom-n.top>m&&(n.bottom=n.top+m);var U=e.doc.height+ks(u),H=n.top<l,Z=n.bottom>U-l;if(n.top<f)F.scrollTop=H?0:n.top;else if(n.bottom>f+m){var be=Math.min(n.top,(Z?U:n.bottom)-m);be!=f&&(F.scrollTop=be)}var Ce=e.options.fixedGutter?0:u.gutters.offsetWidth,De=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Ce,ke=zi(e)-u.gutters.offsetWidth,Ye=n.right-n.left>ke;return Ye&&(n.right=n.left+ke),n.left<10?F.scrollLeft=0:n.left<De?F.scrollLeft=Math.max(0,n.left+Ce-(Ye?0:10)):n.right>ke+De-3&&(F.scrollLeft=n.right+(Ye?0:10)-ke),F}function Ys(e,n){n!=null&&(Ma(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function rn(e){Ma(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function Ho(e,n,u){(n!=null||u!=null)&&Ma(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function Ji(e,n){Ma(e),e.curOp.scrollToPos=n}function Ma(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=au(e,n.from),l=au(e,n.to);pu(e,u,l,n.margin)}}function pu(e,n,u,l){var f=Ks(e,{left:Math.min(n.left,u.left),top:Math.min(n.top,u.top)-l,right:Math.max(n.right,u.right),bottom:Math.max(n.bottom,u.bottom)+l});Ho(e,f.scrollLeft,f.scrollTop)}function zo(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||Zs(e,{top:n}),hu(e,n,!0),c&&Zs(e),Gn(e,100))}function hu(e,n,u){n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),!(e.display.scroller.scrollTop==n&&!u)&&(e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n))}function Xi(e,n,u,l){n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((u?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)&&(e.doc.scrollLeft=n,xu(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function co(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+ks(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?u:0,docHeight:l,scrollHeight:l+ui(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var Qi=function(e,n,u){this.cm=u;var l=this.vert=we("div",[we("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=we("div",[we("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=f.tabIndex=-1,e(l),e(f),N(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),N(f,"scroll",function(){f.clientWidth&&n(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&S<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Qi.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var f=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var m=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+m)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:n?l:0}},Qi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Qi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Qi.prototype.zeroWidthHack=function(){var e=C&&!q?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ft,this.disableVert=new ft},Qi.prototype.enableZeroWidthBar=function(e,n,u){e.style.pointerEvents="auto";function l(){var f=e.getBoundingClientRect(),m=u=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);m!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},Qi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Go=function(){};Go.prototype.update=function(){return{bottom:0,right:0}},Go.prototype.setScrollLeft=function(){},Go.prototype.setScrollTop=function(){},Go.prototype.clear=function(){};function fi(e,n){n||(n=co(e));var u=e.display.barWidth,l=e.display.barHeight;Ra(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&ka(e),Ra(e,co(e)),u=e.display.barWidth,l=e.display.barHeight}function Ra(e,n){var u=e.display,l=u.scrollbars.update(n);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=n.gutterWidth+"px"):u.gutterFiller.style.display=""}var yn={native:Qi,null:Go};function La(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new yn[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),N(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,u){u=="horizontal"?Xi(e,n):zo(e,n)},e),e.display.scrollbars.addClass&&Le(e.display.wrapper,e.display.scrollbars.addClass)}var ci=0;function Ti(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:++ci,markArrays:null},_l(e.curOp)}function Pi(e){var n=e.curOp;n&&Is(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;Md(u)})}function Md(e){for(var n=e.ops,u=0;u<n.length;u++)Js(n[u]);for(var l=0;l<n.length;l++)vu(n[l]);for(var f=0;f<n.length;f++)gu(n[f]);for(var m=0;m<n.length;m++)Ir(n[m]);for(var F=0;F<n.length;F++)rc(n[F])}function Js(e){var n=e.cm,u=n.display;yu(n),e.updateMaxLine&&As(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new Zi(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function vu(e){e.updatedDisplay=e.mustUpdate&&Qs(e.cm,e.update)}function gu(e){var n=e.cm,u=n.display;e.updatedDisplay&&ka(n),e.barMeasure=co(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Sa(n,u.maxLine,u.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+ui(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-zi(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function Ir(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Xi(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==Fe();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&fi(n,e.barMeasure),e.updatedDisplay&&qs(n,e.barMeasure),e.selectionChanged&&zs(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&Gs(e.cm)}function rc(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&mu(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&hu(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Xi(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=cu(n,lt(l,e.scrollToPos.from),lt(l,e.scrollToPos.to),e.scrollToPos.margin);tc(n,f)}var m=e.maybeHiddenMarkers,F=e.maybeUnhiddenMarkers;if(m)for(var U=0;U<m.length;++U)m[U].lines.length||oe(m[U],"hide");if(F)for(var H=0;H<F.length;++H)F[H].lines.length&&oe(F[H],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&oe(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Ur(e,n){if(e.curOp)return n();Ti(e);try{return n()}finally{Pi(e)}}function jr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Ti(e);try{return n.apply(e,arguments)}finally{Pi(e)}}}function Lr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ti(this);try{return e.apply(this,arguments)}finally{Pi(this)}}}function cr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Ti(n);try{return e.apply(this,arguments)}finally{Pi(n)}}}function Gn(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,rt(nc,e))}function nc(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=en(e,n.highlightFrontier),f=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(m){if(l.line>=e.display.viewFrom){var F=m.styles,U=m.text.length>e.options.maxHighlightLength?Br(n.mode,l.state):null,H=_t(e,m,l,!0);U&&(l.state=U),m.styles=H.styles;var Z=m.styleClasses,be=H.classes;be?m.styleClasses=be:Z&&(m.styleClasses=null);for(var Ce=!F||F.length!=m.styles.length||Z!=be&&(!Z||!be||Z.bgClass!=be.bgClass||Z.textClass!=be.textClass),De=0;!Ce&&De<F.length;++De)Ce=F[De]!=m.styles[De];Ce&&f.push(l.line),m.stateAfter=l.save(),l.nextLine()}else m.text.length<=e.options.maxHighlightLength&&vs(e,m.text,l),m.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return Gn(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&Ur(e,function(){for(var m=0;m<f.length;m++)qn(e,f[m],"text")})}}var Zi=function(e,n,u){var l=e.display;this.viewport=n,this.visible=Wo(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=zi(e),this.force=u,this.dims=Vs(e),this.events=[]};Zi.prototype.signal=function(e,n){Be(e,n)&&this.events.push(arguments)},Zi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)oe.apply(null,this.events[e])};function yu(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=ui(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=ui(e)+"px",n.scrollbarsClipped=!0)}function $o(e){if(e.hasFocus())return null;var n=Fe();if(!n||!ae(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&ae(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function Xs(e){if(!(!e||!e.activeElt||e.activeElt==Fe())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ae(document.body,e.anchorNode)&&ae(document.body,e.focusNode))){var n=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),n.removeAllRanges(),n.addRange(u),n.extend(e.focusNode,e.focusOffset)}}function Qs(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return Ci(e),!1;if(!n.force&&n.visible.from>=u.viewFrom&&n.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&Ta(e)==0)return!1;Da(e)&&(Ci(e),n.dims=Vs(e));var f=l.first+l.size,m=Math.max(n.visible.from-e.options.viewportMargin,l.first),F=Math.min(f,n.visible.to+e.options.viewportMargin);u.viewFrom<m&&m-u.viewFrom<20&&(m=Math.max(l.first,u.viewFrom)),u.viewTo>F&&u.viewTo-F<20&&(F=Math.min(f,u.viewTo)),Ai&&(m=Fo(e.doc,m),F=Ss(e.doc,F));var U=m!=u.viewFrom||F!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;ec(e,m,F),u.viewOffset=si(Tt(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var H=Ta(e);if(!U&&H==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var Z=$o(e);return H>4&&(u.lineDiv.style.display="none"),ic(e,u.updateLineNumbers,n.dims),H>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,Xs(Z),ie(u.cursorDiv),ie(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,U&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,Gn(e,400)),u.updateLineNumbers=null,!0}function mu(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==zi(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+ks(e.display)-Do(e),u.top)}),n.visible=Wo(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Wo(e.display,e.doc,u));if(!Qs(e,n))break;ka(e);var f=co(e);Oi(e),fi(e,f),qs(e,f),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Zs(e,n){var u=new Zi(e,n);if(Qs(e,u)){ka(e),mu(e,u);var l=co(e);Oi(e),fi(e,l),qs(e,l),u.finish()}}function ic(e,n,u){var l=e.display,f=e.options.lineNumbers,m=l.lineDiv,F=m.firstChild;function U(Ye){var tt=Ye.nextSibling;return g&&C&&e.display.currentWheelTarget==Ye?Ye.style.display="none":Ye.parentNode.removeChild(Ye),tt}for(var H=l.view,Z=l.viewFrom,be=0;be<H.length;be++){var Ce=H[be];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=m){var De=qt(e,Ce,Z,u);m.insertBefore(De,F)}else{for(;F!=Ce.node;)F=U(F);var ke=f&&n!=null&&n<=Z&&Ce.lineNumber;Ce.changes&&(ht(Ce.changes,"gutter")>-1&&(ke=!1),wa(e,Ce,Z,u)),ke&&(ie(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(lo(e.options,Z)))),F=Ce.node.nextSibling}Z+=Ce.size}for(;F;)F=U(F)}function _s(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",ir(e,"gutterChanged",e)}function qs(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+ui(e)+"px"}function xu(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=In(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,m=l+"px",F=0;F<u.length;F++)if(!u[F].hidden){e.options.fixedGutter&&(u[F].gutter&&(u[F].gutter.style.left=m),u[F].gutterBackground&&(u[F].gutterBackground.style.left=m));var U=u[F].alignable;if(U)for(var H=0;H<U.length;H++)U[H].style.left=m}e.options.fixedGutter&&(n.gutters.style.left=l+f+"px")}}function Da(e){if(!e.options.lineNumbers)return!1;var n=e.doc,u=lo(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(we("div",[we("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),m=f.firstChild.offsetWidth,F=f.offsetWidth-m;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(m,l.lineGutter.offsetWidth-F)+1,l.lineNumWidth=l.lineNumInnerWidth+F,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",_s(e.display),!0}return!1}function Ko(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var m=e[f],F=null;if(typeof m!="string"&&(F=m.style,m=m.className),m=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:m,style:F})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function bu(e){var n=e.gutters,u=e.gutterSpecs;ie(n),e.lineGutter=null;for(var l=0;l<u.length;++l){var f=u[l],m=f.className,F=f.style,U=n.appendChild(we("div",null,"CodeMirror-gutter "+m));F&&(U.style.cssText=F),m=="CodeMirror-linenumbers"&&(e.lineGutter=U,U.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",_s(e)}function Na(e){bu(e.display),Rr(e),xu(e)}function oc(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=we("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=we("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=he("div",null,"CodeMirror-code"),f.selectionDiv=we("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=we("div",null,"CodeMirror-cursors"),f.measure=we("div",null,"CodeMirror-measure"),f.lineMeasure=we("div",null,"CodeMirror-measure"),f.lineSpace=he("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var m=he("div",[f.lineSpace],"CodeMirror-lines");f.mover=we("div",[m],null,"position: relative"),f.sizer=we("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=we("div",null,null,"position: absolute; height: "+bt+"px; width: 1px;"),f.gutters=we("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=we("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=we("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&S<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!g&&!(c&&R)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=n.first,f.reportedViewFrom=f.reportedViewTo=n.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=Ko(l.gutters,l.lineNumbers),bu(f),u.init(f)}var Ba=0,di=null;b?di=-.53:c?di=15:D?di=-.7:j&&(di=-1/3);function wu(e){var n=e.wheelDeltaX,u=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:n,y:u}}function rr(e){var n=wu(e);return n.x*=di,n.y*=di,n}function Su(e,n){var u=wu(n),l=u.x,f=u.y,m=di;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,m=1);var F=e.display,U=F.scroller,H=U.scrollWidth>U.clientWidth,Z=U.scrollHeight>U.clientHeight;if(!!(l&&H||f&&Z)){if(f&&C&&g){e:for(var be=n.target,Ce=F.view;be!=U;be=be.parentNode)for(var De=0;De<Ce.length;De++)if(Ce[De].node==be){e.display.currentWheelTarget=be;break e}}if(l&&!c&&!B&&m!=null){f&&Z&&zo(e,Math.max(0,U.scrollTop+f*m)),Xi(e,Math.max(0,U.scrollLeft+l*m)),(!f||f&&Z)&&Qe(n),F.wheelStartX=null;return}if(f&&m!=null){var ke=f*m,Ye=e.doc.scrollTop,tt=Ye+F.wrapper.clientHeight;ke<0?Ye=Math.max(0,Ye+ke-50):tt=Math.min(e.doc.height,tt+ke+50),Zs(e,{top:Ye,bottom:tt})}Ba<20&&n.deltaMode!==0&&(F.wheelStartX==null?(F.wheelStartX=U.scrollLeft,F.wheelStartY=U.scrollTop,F.wheelDX=l,F.wheelDY=f,setTimeout(function(){if(F.wheelStartX!=null){var at=U.scrollLeft-F.wheelStartX,ct=U.scrollTop-F.wheelStartY,gt=ct&&F.wheelDY&&ct/F.wheelDY||at&&F.wheelDX&&at/F.wheelDX;F.wheelStartX=F.wheelStartY=null,!!gt&&(di=(di*Ba+gt)/(Ba+1),++Ba)}},200)):(F.wheelDX+=l,F.wheelDY+=f))}}var mn=function(e,n){this.ranges=e,this.primIndex=n};mn.prototype.primary=function(){return this.ranges[this.primIndex]},mn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var u=this.ranges[n],l=e.ranges[n];if(!oi(u.anchor,l.anchor)||!oi(u.head,l.head))return!1}return!0},mn.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new er(ue(this.ranges[n].anchor),ue(this.ranges[n].head));return new mn(e,this.primIndex)},mn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},mn.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Lt(n,l.from())>=0&&Lt(e,l.to())<=0)return u}return-1};var er=function(e,n){this.anchor=e,this.head=n};er.prototype.from=function(){return qe(this.anchor,this.head)},er.prototype.to=function(){return Oe(this.anchor,this.head)},er.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function En(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(De,ke){return Lt(De.from(),ke.from())}),u=ht(n,f);for(var m=1;m<n.length;m++){var F=n[m],U=n[m-1],H=Lt(U.to(),F.from());if(l&&!F.empty()?H>0:H>=0){var Z=qe(U.from(),F.from()),be=Oe(U.to(),F.to()),Ce=U.empty()?F.from()==F.head:U.from()==U.head;m<=u&&--u,n.splice(--m,2,new er(Ce?be:Z,Ce?Z:be))}}return new mn(n,u)}function Ii(e,n){return new mn([new er(e,n||e)],0)}function Fi(e){return e.text?ot(e.from.line+e.text.length-1,Ct(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Au(e,n){if(Lt(e,n.from)<0)return e;if(Lt(e,n.to)<=0)return Fi(n);var u=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=Fi(n).ch-n.to.ch),ot(u,l)}function el(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new er(Au(f.anchor,n),Au(f.head,n)))}return En(e.cm,u,e.sel.primIndex)}function Eu(e,n,u){return e.line==n.line?ot(u.line,e.ch-n.ch+u.ch):ot(u.line+(e.line-n.line),e.ch)}function ac(e,n,u){for(var l=[],f=ot(e.first,0),m=f,F=0;F<n.length;F++){var U=n[F],H=Eu(U.from,f,m),Z=Eu(Fi(U),f,m);if(f=U.to,m=Z,u=="around"){var be=e.sel.ranges[F],Ce=Lt(be.head,be.anchor)<0;l[F]=new er(Ce?Z:H,Ce?H:Z)}else l[F]=new er(H,H)}return new mn(l,e.sel.primIndex)}function Ua(e){e.doc.mode=gn(e.options,e.doc.modeOption),_i(e)}function _i(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Gn(e,100),e.state.modeGen++,e.curOp&&Rr(e)}function ja(e,n){return n.from.ch==0&&n.to.ch==0&&Ct(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function tl(e,n,u,l){function f(gt){return u?u[gt]:null}function m(gt,dt,xt){Ei(gt,dt,xt,l),ir(gt,"change",gt,n)}function F(gt,dt){for(var xt=[],Ft=gt;Ft<dt;++Ft)xt.push(new Vi(Z[Ft],f(Ft),l));return xt}var U=n.from,H=n.to,Z=n.text,be=Tt(e,U.line),Ce=Tt(e,H.line),De=Ct(Z),ke=f(Z.length-1),Ye=H.line-U.line;if(n.full)e.insert(0,F(0,Z.length)),e.remove(Z.length,e.size-Z.length);else if(ja(e,n)){var tt=F(0,Z.length-1);m(Ce,Ce.text,ke),Ye&&e.remove(U.line,Ye),tt.length&&e.insert(U.line,tt)}else if(be==Ce)if(Z.length==1)m(be,be.text.slice(0,U.ch)+De+be.text.slice(H.ch),ke);else{var at=F(1,Z.length-1);at.push(new Vi(De+be.text.slice(H.ch),ke,l)),m(be,be.text.slice(0,U.ch)+Z[0],f(0)),e.insert(U.line+1,at)}else if(Z.length==1)m(be,be.text.slice(0,U.ch)+Z[0]+Ce.text.slice(H.ch),f(0)),e.remove(U.line+1,Ye);else{m(be,be.text.slice(0,U.ch)+Z[0],f(0)),m(Ce,De+Ce.text.slice(H.ch),ke);var ct=F(1,Z.length-1);Ye>1&&e.remove(U.line+1,Ye-1),e.insert(U.line+1,ct)}ir(e,"change",e,n)}function ki(e,n,u){function l(f,m,F){if(f.linked)for(var U=0;U<f.linked.length;++U){var H=f.linked[U];if(H.doc!=m){var Z=F&&H.sharedHist;u&&!Z||(n(H.doc,Z),l(H.doc,f,Z))}}}l(e,null,!0)}function Cu(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Ws(e),Ua(e),rl(e),e.options.direction=n.direction,e.options.lineWrapping||As(e),e.options.mode=n.modeOption,Rr(e)}function rl(e){(e.doc.direction=="rtl"?Le:ee)(e.display.lineDiv,"CodeMirror-rtl")}function Yo(e){Ur(e,function(){rl(e),Rr(e)})}function Jo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ei(e,n){var u={from:ue(n.from),to:Fi(n),text:ii(e,n.from,n.to)};return Qo(e,u,n.from.line,n.to.line+1),ki(e,function(l){return Qo(l,u,n.from.line,n.to.line+1)},!0),u}function Ou(e){for(;e.length;){var n=Ct(e);if(n.ranges)e.pop();else break}}function Tu(e,n){if(n)return Ou(e.done),Ct(e.done);if(e.done.length&&!Ct(e.done).ranges)return Ct(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ct(e.done)}function Pu(e,n,u,l){var f=e.history;f.undone.length=0;var m=+new Date,F,U;if((f.lastOp==l||f.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&f.lastModTime>m-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(F=Tu(f,f.lastOp==l)))U=Ct(F.changes),Lt(n.from,n.to)==0&&Lt(n.from,U.to)==0?U.to=Fi(n):F.changes.push(ei(e,n));else{var H=Ct(f.done);for((!H||!H.ranges)&&Xo(e.sel,f.done),F={changes:[ei(e,n)],generation:f.generation},f.done.push(F);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(u),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=m,f.lastOp=f.lastSelOp=l,f.lastOrigin=f.lastSelOrigin=n.origin,U||oe(e,"historyAdded")}function Iu(e,n,u,l){var f=n.charAt(0);return f=="*"||f=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function sc(e,n,u,l){var f=e.history,m=l&&l.origin;u==f.lastSelOp||m&&f.lastSelOrigin==m&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==m||Iu(e,m,Ct(f.done),n))?f.done[f.done.length-1]=n:Xo(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=m,f.lastSelOp=u,l&&l.clearRedo!==!1&&Ou(f.undone)}function Xo(e,n){var u=Ct(n);u&&u.ranges&&u.equals(e)||n.push(e)}function Qo(e,n,u,l){var f=n["spans_"+e.id],m=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(F){F.markedSpans&&((f||(f=n["spans_"+e.id]={}))[m]=F.markedSpans),++m})}function lc(e){if(!e)return null;for(var n,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?n||(n=e.slice(0,u)):n&&n.push(e[u]);return n?n.length?n:null:e}function Va(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push(lc(u[f]));return l}function Wa(e,n){var u=Va(e,n),l=Gl(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var m=u[f],F=l[f];if(m&&F){e:for(var U=0;U<F.length;++U){for(var H=F[U],Z=0;Z<m.length;++Z)if(m[Z].marker==H.marker)continue e;m.push(H)}}else F&&(u[f]=F)}return u}function po(e,n,u){for(var l=[],f=0;f<e.length;++f){var m=e[f];if(m.ranges){l.push(u?mn.prototype.deepCopy.call(m):m);continue}var F=m.changes,U=[];l.push({changes:U});for(var H=0;H<F.length;++H){var Z=F[H],be=void 0;if(U.push({from:Z.from,to:Z.to,text:Z.text}),n)for(var Ce in Z)(be=Ce.match(/^spans_(\d+)$/))&&ht(n,Number(be[1]))>-1&&(Ct(U)[Ce]=Z[Ce],delete Z[Ce])}}return l}function nl(e,n,u,l){if(l){var f=e.anchor;if(u){var m=Lt(n,f)<0;m!=Lt(u,f)<0?(f=n,n=u):m!=Lt(n,u)<0&&(n=u)}return new er(f,n)}else return new er(u||n,n)}function Ha(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Xr(e,new mn([nl(e.sel.primary(),n,u,f)],0),l)}function Fu(e,n,u){for(var l=[],f=e.cm&&(e.cm.display.shift||e.extend),m=0;m<e.sel.ranges.length;m++)l[m]=nl(e.sel.ranges[m],n[m],null,f);var F=En(e.cm,l,e.sel.primIndex);Xr(e,F,u)}function za(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,Xr(e,En(e.cm,f,e.sel.primIndex),l)}function il(e,n,u,l){Xr(e,Ii(n,u),l)}function uc(e,n,u){var l={ranges:n.ranges,update:function(f){this.ranges=[];for(var m=0;m<f.length;m++)this.ranges[m]=new er(lt(e,f[m].anchor),lt(e,f[m].head))},origin:u&&u.origin};return oe(e,"beforeSelectionChange",e,l),e.cm&&oe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?En(e.cm,l.ranges,l.ranges.length-1):n}function ku(e,n,u){var l=e.history.done,f=Ct(l);f&&f.ranges?(l[l.length-1]=n,Ga(e,n,u)):Xr(e,n,u)}function Xr(e,n,u){Ga(e,n,u),sc(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function Ga(e,n,u){(Be(e,"beforeSelectionChange")||e.cm&&Be(e.cm,"beforeSelectionChange"))&&(n=uc(e,n,u));var l=u&&u.bias||(Lt(n.primary().head,e.sel.primary().head)<0?-1:1);Mu(e,Lu(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&rn(e.cm)}function Mu(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ae(e.cm)),ir(e,"cursorActivity",e))}function Ru(e){Mu(e,Lu(e,e.sel,null,!1))}function Lu(e,n,u,l){for(var f,m=0;m<n.ranges.length;m++){var F=n.ranges[m],U=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[m],H=Zo(e,F.anchor,U&&U.anchor,u,l),Z=Zo(e,F.head,U&&U.head,u,l);(f||H!=F.anchor||Z!=F.head)&&(f||(f=n.ranges.slice(0,m)),f[m]=new er(H,Z))}return f?En(e.cm,f,n.primIndex):n}function ho(e,n,u,l,f){var m=Tt(e,n.line);if(m.markedSpans)for(var F=0;F<m.markedSpans.length;++F){var U=m.markedSpans[F],H=U.marker,Z="selectLeft"in H?!H.selectLeft:H.inclusiveLeft,be="selectRight"in H?!H.selectRight:H.inclusiveRight;if((U.from==null||(Z?U.from<=n.ch:U.from<n.ch))&&(U.to==null||(be?U.to>=n.ch:U.to>n.ch))){if(f&&(oe(H,"beforeCursorEnter"),H.explicitlyCleared))if(m.markedSpans){--F;continue}else break;if(!H.atomic)continue;if(u){var Ce=H.find(l<0?1:-1),De=void 0;if((l<0?be:Z)&&(Ce=Du(e,Ce,-l,Ce&&Ce.line==n.line?m:null)),Ce&&Ce.line==n.line&&(De=Lt(Ce,u))&&(l<0?De<0:De>0))return ho(e,Ce,n,l,f)}var ke=H.find(l<0?-1:1);return(l<0?Z:be)&&(ke=Du(e,ke,l,ke.line==n.line?m:null)),ke?ho(e,ke,n,l,f):null}}return n}function Zo(e,n,u,l,f){var m=l||1,F=ho(e,n,u,m,f)||!f&&ho(e,n,u,m,!0)||ho(e,n,u,-m,f)||!f&&ho(e,n,u,-m,!0);return F||(e.cantEdit=!0,ot(e.first,0))}function Du(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?lt(e,ot(n.line-1)):null:u>0&&n.ch==(l||Tt(e,n.line)).text.length?n.line<e.first+e.size-1?ot(n.line+1,0):null:new ot(n.line,n.ch+u)}function $a(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),ut)}function ol(e,n,u){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(f,m,F,U){f&&(l.from=lt(e,f)),m&&(l.to=lt(e,m)),F&&(l.text=F),U!==void 0&&(l.origin=U)}),oe(e,"beforeChange",e,l),e.cm&&oe(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function vo(e,n,u){if(e.cm){if(!e.cm.curOp)return jr(e.cm,vo)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Be(e,"beforeChange")||e.cm&&Be(e.cm,"beforeChange"))&&(n=ol(e,n,!0),!n))){var l=Nf&&!u&&Kl(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)qi(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else qi(e,n)}}function qi(e,n){if(!(n.text.length==1&&n.text[0]==""&&Lt(n.from,n.to)==0)){var u=el(e,n);Pu(e,n,u,e.cm?e.cm.curOp.id:NaN),_o(e,n,u,Gl(e,n));var l=[];ki(e,function(f,m){!m&&ht(l,f.history)==-1&&(ll(f.history,n),l.push(f.history)),_o(f,n,null,Gl(f,n))})}}function Fn(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,m,F=e.sel,U=n=="undo"?f.done:f.undone,H=n=="undo"?f.undone:f.done,Z=0;Z<U.length&&(m=U[Z],!(u?m.ranges&&!m.equals(e.sel):!m.ranges));Z++);if(Z!=U.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(m=U.pop(),m.ranges){if(Xo(m,H),u&&!m.equals(e.sel)){Xr(e,m,{clearRedo:!1});return}F=m}else if(l){U.push(m);return}else break;var be=[];Xo(F,H),H.push({changes:be,generation:f.generation}),f.generation=m.generation||++f.maxGeneration;for(var Ce=Be(e,"beforeChange")||e.cm&&Be(e.cm,"beforeChange"),De=function(tt){var at=m.changes[tt];if(at.origin=n,Ce&&!ol(e,at,!1))return U.length=0,{};be.push(ei(e,at));var ct=tt?el(e,at):Ct(U);_o(e,at,ct,Wa(e,at)),!tt&&e.cm&&e.cm.scrollIntoView({from:at.from,to:Fi(at)});var gt=[];ki(e,function(dt,xt){!xt&&ht(gt,dt.history)==-1&&(ll(dt.history,at),gt.push(dt.history)),_o(dt,at,null,Wa(dt,at))})},ke=m.changes.length-1;ke>=0;--ke){var Ye=De(ke);if(Ye)return Ye.v}}}}function al(e,n){if(n!=0&&(e.first+=n,e.sel=new mn(Wt(e.sel.ranges,function(f){return new er(ot(f.anchor.line+n,f.anchor.ch),ot(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){Rr(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)qn(e.cm,l,"gutter")}}function _o(e,n,u,l){if(e.cm&&!e.cm.curOp)return jr(e.cm,_o)(e,n,u,l);if(n.to.line<e.first){al(e,n.text.length-1-(n.to.line-n.from.line));return}if(!(n.from.line>e.lastLine())){if(n.from.line<e.first){var f=n.text.length-1-(e.first-n.from.line);al(e,f),n={from:ot(e.first,0),to:ot(n.to.line+f,n.to.ch),text:[Ct(n.text)],origin:n.origin}}var m=e.lastLine();n.to.line>m&&(n={from:n.from,to:ot(m,Tt(e,m).text.length),text:[n.text[0]],origin:n.origin}),n.removed=ii(e,n.from,n.to),u||(u=el(e,n)),e.cm?fc(e.cm,n,l):tl(e,n,l),Ga(e,u,ut),e.cantEdit&&Zo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function fc(e,n,u){var l=e.doc,f=e.display,m=n.from,F=n.to,U=!1,H=m.line;e.options.lineWrapping||(H=Zt(Wn(Tt(l,m.line))),l.iter(H,F.line+1,function(ke){if(ke==f.maxLine)return U=!0,!0})),l.sel.contains(n.from,n.to)>-1&&Ae(e),tl(l,n,u,uu(e)),e.options.lineWrapping||(l.iter(H,m.line+n.text.length,function(ke){var Ye=ji(ke);Ye>f.maxLineLength&&(f.maxLine=ke,f.maxLineLength=Ye,f.maxLineChanged=!0,U=!1)}),U&&(e.curOp.updateMaxLine=!0)),Df(l,m.line),Gn(e,400);var Z=n.text.length-(F.line-m.line)-1;n.full?Rr(e):m.line==F.line&&n.text.length==1&&!ja(e.doc,n)?qn(e,m.line,"text"):Rr(e,m.line,F.line+1,Z);var be=Be(e,"changes"),Ce=Be(e,"change");if(Ce||be){var De={from:m,to:F,text:n.text,removed:n.removed,origin:n.origin};Ce&&ir(e,"change",e,De),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(De)}e.display.selForContextMenu=null}function go(e,n,u,l,f){var m;l||(l=u),Lt(l,u)<0&&(m=[l,u],u=m[0],l=m[1]),typeof n=="string"&&(n=e.splitLines(n)),vo(e,{from:u,to:l,text:n,origin:f})}function sl(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function Nu(e,n,u,l){for(var f=0;f<e.length;++f){var m=e[f],F=!0;if(m.ranges){m.copied||(m=e[f]=m.deepCopy(),m.copied=!0);for(var U=0;U<m.ranges.length;U++)sl(m.ranges[U].anchor,n,u,l),sl(m.ranges[U].head,n,u,l);continue}for(var H=0;H<m.changes.length;++H){var Z=m.changes[H];if(u<Z.from.line)Z.from=ot(Z.from.line+l,Z.from.ch),Z.to=ot(Z.to.line+l,Z.to.ch);else if(n<=Z.to.line){F=!1;break}}F||(e.splice(0,f+1),f=0)}}function ll(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;Nu(e.done,u,l,f),Nu(e.undone,u,l,f)}function eo(e,n,u,l){var f=n,m=n;return typeof n=="number"?m=Tt(e,st(e,n)):f=Zt(n),f==null?null:(l(m,f)&&e.cm&&qn(e.cm,f,u),m)}function yo(e){this.lines=e,this.parent=null;for(var n=0,u=0;u<e.length;++u)e[u].parent=this,n+=e[u].height;this.height=n}yo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var u=e,l=e+n;u<l;++u){var f=this.lines[u];this.height-=f.height,Wi(f),ir(f,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,u){for(var l=e+n;e<l;++e)if(u(this.lines[e]))return!0}};function mo(e){this.children=e;for(var n=0,u=0,l=0;l<e.length;++l){var f=e[l];n+=f.chunkSize(),u+=f.height,f.parent=this}this.size=n,this.height=u,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var u=0;u<this.children.length;++u){var l=this.children[u],f=l.chunkSize();if(e<f){var m=Math.min(n,f-e),F=l.height;if(l.removeInner(e,m),this.height-=F-l.height,f==m&&(this.children.splice(u--,1),l.parent=null),(n-=m)==0)break;e=0}else e-=f}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof yo))){var U=[];this.collapse(U),this.children=[new yo(U)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,u){this.size+=n.length,this.height+=u;for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<=m){if(f.insertInner(e,n,u),f.lines&&f.lines.length>50){for(var F=f.lines.length%25+25,U=F;U<f.lines.length;){var H=new yo(f.lines.slice(U,U+=25));f.height-=H.height,this.children.splice(++l,0,H),H.parent=this}f.lines=f.lines.slice(0,F),this.maybeSpill()}break}e-=m}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var n=e.children.splice(e.children.length-5,5),u=new mo(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=ht(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new mo(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,n,u){for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<m){var F=Math.min(n,m-e);if(f.iterN(e,F,u))return!0;if((n-=F)==0)break;e=0}else e-=m}}};var qo=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};qo.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=Zt(u);if(!(l==null||!n)){for(var f=0;f<n.length;++f)n[f]==this&&n.splice(f--,1);n.length||(u.widgets=null);var m=Ot(this);An(u,Math.max(0,u.height-m)),e&&(Ur(e,function(){ul(e,u,-m),qn(e,l,"widget")}),ir(e,"lineWidgetCleared",e,this,l))}},qo.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=Ot(this)-n;!f||(ai(this.doc,l)||An(l,l.height+f),u&&Ur(u,function(){u.curOp.forceUpdate=!0,ul(u,l,f),ir(u,"lineWidgetChanged",u,e,Zt(l))}))},Ue(qo);function ul(e,n,u){si(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ys(e,u)}function cc(e,n,u,l){var f=new qo(e,u,l),m=e.cm;return m&&f.noHScroll&&(m.display.alignWidgets=!0),eo(e,n,"widget",function(F){var U=F.widgets||(F.widgets=[]);if(f.insertAt==null?U.push(f):U.splice(Math.min(U.length,Math.max(0,f.insertAt)),0,f),f.line=F,m&&!ai(e,F)){var H=si(F)<e.scrollTop;An(F,F.height+Ot(f)),H&&Ys(m,f.height),m.curOp.forceUpdate=!0}return!0}),m&&ir(m,"lineWidgetAdded",m,f,typeof n=="number"?n:Zt(n)),f}var Ka=0,ti=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Ka};ti.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Ti(e),Be(this,"clear")){var u=this.find();u&&ir(this,"clear",u.from,u.to)}for(var l=null,f=null,m=0;m<this.lines.length;++m){var F=this.lines[m],U=Po(F.markedSpans,this);e&&!this.collapsed?qn(e,Zt(F),"text"):e&&(U.to!=null&&(f=Zt(F)),U.from!=null&&(l=Zt(F))),F.markedSpans=jf(F.markedSpans,U),U.from==null&&this.collapsed&&!ai(this.doc,F)&&e&&An(F,uo(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var H=0;H<this.lines.length;++H){var Z=Wn(this.lines[H]),be=ji(Z);be>e.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Rr(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ru(e.doc)),e&&ir(e,"markerCleared",e,this,l,f),n&&Pi(e),this.parent&&this.parent.clear()}},ti.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,f=0;f<this.lines.length;++f){var m=this.lines[f],F=Po(m.markedSpans,this);if(F.from!=null&&(u=ot(n?m:Zt(m),F.from),e==-1))return u;if(F.to!=null&&(l=ot(n?m:Zt(m),F.to),e==1))return l}return u&&{from:u,to:l}},ti.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||Ur(l,function(){var f=n.line,m=Zt(n.line),F=Rs(l,m);if(F&&(Ns(F),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!ai(u.doc,f)&&u.height!=null){var U=u.height;u.height=null;var H=Ot(u)-U;H&&An(f,f.height+H)}ir(l,"markerChanged",l,e)})},ti.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ht(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ti.prototype.detachLine=function(e){if(this.lines.splice(ht(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Ue(ti);function to(e,n,u,l,f){if(l&&l.shared)return dc(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return jr(e.cm,to)(e,n,u,l,f);var m=new ti(e,f),F=Lt(n,u);if(l&&Ze(l,m,!1),F>0||F==0&&m.clearWhenEmpty!==!1)return m;if(m.replacedWith&&(m.collapsed=!0,m.widgetNode=he("span",[m.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||m.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(m.widgetNode.insertLeft=!0)),m.collapsed){if(xa(e,n.line,n,u,m)||n.line!=u.line&&xa(e,u.line,n,u,m))throw new Error("Inserting collapsed marker partially overlapping an existing one");Uf()}m.addToHistory&&Pu(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var U=n.line,H=e.cm,Z;if(e.iter(U,u.line+1,function(Ce){H&&m.collapsed&&!H.options.lineWrapping&&Wn(Ce)==H.display.maxLine&&(Z=!0),m.collapsed&&U!=n.line&&An(Ce,0),Id(Ce,new ma(m,U==n.line?n.ch:null,U==u.line?u.ch:null),e.cm&&e.cm.curOp),++U}),m.collapsed&&e.iter(n.line,u.line+1,function(Ce){ai(e,Ce)&&An(Ce,0)}),m.clearOnEnter&&N(m,"beforeCursorEnter",function(){return m.clear()}),m.readOnly&&(Bf(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),m.collapsed&&(m.id=++Ka,m.atomic=!0),H){if(Z&&(H.curOp.updateMaxLine=!0),m.collapsed)Rr(H,n.line,u.line+1);else if(m.className||m.startStyle||m.endStyle||m.css||m.attributes||m.title)for(var be=n.line;be<=u.line;be++)qn(H,be,"text");m.atomic&&Ru(H.doc),ir(H,"markerAdded",H,m)}return m}var xo=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};xo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ir(this,"clear")}},xo.prototype.find=function(e,n){return this.primary.find(e,n)},Ue(xo);function dc(e,n,u,l,f){l=Ze(l),l.shared=!1;var m=[to(e,n,u,l,f)],F=m[0],U=l.widgetNode;return ki(e,function(H){U&&(l.widgetNode=U.cloneNode(!0)),m.push(to(H,lt(H,n),lt(H,u),l,f));for(var Z=0;Z<H.linked.length;++Z)if(H.linked[Z].isParent)return;F=Ct(m)}),new xo(m,F)}function Bu(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),function(n){return n.parent})}function fl(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),m=e.clipPos(f.from),F=e.clipPos(f.to);if(Lt(m,F)){var U=to(e,m,F,l.primary,l.primary.type);l.markers.push(U),U.parent=l}}}function pc(e){for(var n=function(l){var f=e[l],m=[f.primary.doc];ki(f.primary.doc,function(H){return m.push(H)});for(var F=0;F<f.markers.length;F++){var U=f.markers[F];ht(m,U.doc)==-1&&(U.parent=null,f.markers.splice(F--,1))}},u=0;u<e.length;u++)n(u)}var hc=0,un=function(e,n,u,l,f){if(!(this instanceof un))return new un(e,n,u,l,f);u==null&&(u=0),mo.call(this,[new yo([new Vi("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var m=ot(u,0);this.sel=Ii(m),this.history=new Jo(null),this.id=++hc,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),tl(this,{from:m,to:m,text:e}),Xr(this,Ii(m),ut)};un.prototype=St(mo.prototype,{constructor:un,iter:function(e,n,u){u?this.iterN(e-this.first,n-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var u=0,l=0;l<n.length;++l)u+=n[l].height;this.insertInner(e-this.first,n,u)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Si(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:cr(function(e){var n=ot(this.first,0),u=this.first+this.size-1;vo(this,{from:n,to:ot(u,Tt(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ho(this.cm,0,0),Xr(this,Ii(n),ut)}),replaceRange:function(e,n,u,l){n=lt(this,n),u=u?lt(this,u):n,go(this,e,n,u,l)},getRange:function(e,n,u){var l=ii(this,lt(this,e),lt(this,n));return u===!1?l:u===""?l.join(""):l.join(u||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Zn(this,e))return Tt(this,e)},getLineNumber:function(e){return Zt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Tt(this,e)),Wn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(this,e)},getCursor:function(e){var n=this.sel.primary(),u;return e==null||e=="head"?u=n.head:e=="anchor"?u=n.anchor:e=="end"||e=="to"||e===!1?u=n.to():u=n.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cr(function(e,n,u){il(this,lt(this,typeof e=="number"?ot(e,n||0):e),null,u)}),setSelection:cr(function(e,n,u){il(this,lt(this,e),lt(this,n||e),u)}),extendSelection:cr(function(e,n,u){Ha(this,lt(this,e),n&<(this,n),u)}),extendSelections:cr(function(e,n){Fu(this,Xt(this,e),n)}),extendSelectionsBy:cr(function(e,n){var u=Wt(this.sel.ranges,e);Fu(this,Xt(this,u),n)}),setSelections:cr(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new er(lt(this,e[f].anchor),lt(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),Xr(this,En(this.cm,l,n),u)}}),addSelection:cr(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new er(lt(this,e),lt(this,n||e))),Xr(this,En(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var n=this.sel.ranges,u,l=0;l<n.length;l++){var f=ii(this,n[l].from(),n[l].to());u=u?u.concat(f):f}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],u=this.sel.ranges,l=0;l<u.length;l++){var f=ii(this,u[l].from(),u[l].to());e!==!1&&(f=f.join(e||this.lineSeparator())),n[l]=f}return n},replaceSelection:function(e,n,u){for(var l=[],f=0;f<this.sel.ranges.length;f++)l[f]=e;this.replaceSelections(l,n,u||"+input")},replaceSelections:cr(function(e,n,u){for(var l=[],f=this.sel,m=0;m<f.ranges.length;m++){var F=f.ranges[m];l[m]={from:F.from(),to:F.to(),text:this.splitLines(e[m]),origin:u}}for(var U=n&&n!="end"&&ac(this,l,n),H=l.length-1;H>=0;H--)vo(this,l[H]);U?ku(this,U):this.cm&&rn(this.cm)}),undo:cr(function(){Fn(this,"undo")}),redo:cr(function(){Fn(this,"redo")}),undoSelection:cr(function(){Fn(this,"undo",!0)}),redoSelection:cr(function(){Fn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++u;return{undo:n,redo:u}},clearHistory:function(){var e=this;this.history=new Jo(this.history),ki(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:po(this.history.done),undone:po(this.history.undone)}},setHistory:function(e){var n=this.history=new Jo(this.history);n.done=po(e.done.slice(0),null,!0),n.undone=po(e.undone.slice(0),null,!0)},setGutterMarker:cr(function(e,n,u){return eo(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&$(f)&&(l.gutterMarkers=null),!0})}),clearGutter:cr(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&eo(n,u,"gutter",function(){return u.gutterMarkers[e]=null,$(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Zn(this,e)||(n=e,e=Tt(this,e),!e))return null}else if(n=Zt(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:cr(function(e,n,u){return eo(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[f])l[f]=u;else{if(ce(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:cr(function(e,n,u){return eo(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",m=l[f];if(m)if(u==null)l[f]=null;else{var F=m.match(ce(u));if(!F)return!1;var U=F.index+F[0].length;l[f]=m.slice(0,F.index)+(!F.index||U==m.length?"":" ")+m.slice(U)||null}else return!1;return!0})}),addLineWidget:cr(function(e,n,u){return cc(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return to(this,lt(this,e),lt(this,n),u,u&&u.type||"range")},setBookmark:function(e,n){var u={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=lt(this,e),to(this,e,e,u,"bookmark")},findMarksAt:function(e){e=lt(this,e);var n=[],u=Tt(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var f=u[l];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&n.push(f.marker.parent||f.marker)}return n},findMarks:function(e,n,u){e=lt(this,e),n=lt(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(m){var F=m.markedSpans;if(F)for(var U=0;U<F.length;U++){var H=F[U];!(H.to!=null&&f==e.line&&e.ch>=H.to||H.from==null&&f!=e.line||H.from!=null&&f==n.line&&H.from>=n.ch)&&(!u||u(H.marker))&&l.push(H.marker.parent||H.marker)}++f}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var u=n.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var n,u=this.first,l=this.lineSeparator().length;return this.iter(function(f){var m=f.text.length+l;if(m>e)return n=e,!0;e-=m,++u}),lt(this,ot(u,n))},indexFromPos:function(e){e=lt(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+u}),n},copy:function(e){var n=new un(Si(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,u=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new un(Si(this,n,u),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],fl(l,Bu(this)),l},unlinkDoc:function(e){if(e instanceof dr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var u=this.linked[n];if(u.doc==e){this.linked.splice(n,1),e.unlinkDoc(this),pc(Bu(this));break}}if(e.history==this.history){var l=[e.id];ki(e,function(f){return l.push(f.id)},!0),e.history=new Jo(null),e.history.done=po(this.history.done,l),e.history.undone=po(this.history.undone,l)}},iterLinkedDocs:function(e){ki(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Bn(e)},lineSeparator:function(){return this.lineSep||`
|
|
28
|
-
`},setDirection:cr(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&Yo(this.cm))})}),un.prototype.eachLine=un.prototype.iter;var Uu=0;function vc(e){var n=this;if(ju(n),!(pe(n,e)||li(n.display,e))){Qe(e),b&&(Uu=+new Date);var u=Ki(n,e,!0),l=e.dataTransfer.files;if(!(!u||n.isReadOnly()))if(l&&l.length&&window.FileReader&&window.File)for(var f=l.length,m=Array(f),F=0,U=function(){++F==f&&jr(n,function(){u=lt(n.doc,u);var ke={from:u,to:u,text:n.doc.splitLines(m.filter(function(Ye){return Ye!=null}).join(n.doc.lineSeparator())),origin:"paste"};vo(n.doc,ke),ku(n.doc,Ii(lt(n.doc,u),lt(n.doc,Fi(ke))))})()},H=function(ke,Ye){if(n.options.allowDropFileTypes&&ht(n.options.allowDropFileTypes,ke.type)==-1){U();return}var tt=new FileReader;tt.onerror=function(){return U()},tt.onload=function(){var at=tt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){U();return}m[Ye]=at,U()},tt.readAsText(ke)},Z=0;Z<l.length;Z++)H(l[Z],Z);else{if(n.state.draggingText&&n.doc.sel.contains(u)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var Ce;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ce=n.listSelections()),Ga(n.doc,Ii(u,u)),Ce)for(var De=0;De<Ce.length;++De)go(n.doc,"",Ce[De].anchor,Ce[De].head,"drag");n.replaceSelection(be,"around","paste"),n.display.input.focus()}}catch(ke){}}}}function gc(e,n){if(b&&(!e.state.draggingText||+new Date-Uu<100)){Bt(n);return}if(!(pe(e,n)||li(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!j)){var u=we("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),B&&u.parentNode.removeChild(u)}}function yc(e,n){var u=Ki(e,n);if(!!u){var l=document.createDocumentFragment();Hs(e,u,l),e.display.dragCursor||(e.display.dragCursor=we("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),xe(e.display.dragCursor,l)}}function ju(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ya(e){if(!!document.getElementsByClassName){for(var n=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<n.length;l++){var f=n[l].CodeMirror;f&&u.push(f)}u.length&&u[0].operation(function(){for(var m=0;m<u.length;m++)e(u[m])})}}var ea=!1;function Vu(){ea||(mc(),ea=!0)}function mc(){var e;N(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ya(xc)},100))}),N(window,"blur",function(){return Ya(fo)})}function xc(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var xn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ta=0;ta<10;ta++)xn[ta+48]=xn[ta+96]=String(ta);for(var ra=65;ra<=90;ra++)xn[ra]=String.fromCharCode(ra);for(var bo=1;bo<=12;bo++)xn[bo+111]=xn[bo+63235]="F"+bo;var ri={};ri.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"},ri.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"},ri.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"},ri.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"]},ri.default=C?ri.macDefault:ri.pcDefault;function Wu(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,m,F=0;F<n.length-1;F++){var U=n[F];if(/^(cmd|meta|m)$/i.test(U))m=!0;else if(/^a(lt)?$/i.test(U))u=!0;else if(/^(c|ctrl|control)$/i.test(U))l=!0;else if(/^s(hift)?$/i.test(U))f=!0;else throw new Error("Unrecognized modifier name: "+U)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),m&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function Rd(e){var n={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var f=Wt(u.split(" "),Wu),m=0;m<f.length;m++){var F=void 0,U=void 0;m==f.length-1?(U=f.join(" "),F=l):(U=f.slice(0,m+1).join(" "),F="...");var H=n[U];if(!H)n[U]=F;else if(H!=F)throw new Error("Inconsistent bindings for "+U)}delete e[u]}for(var Z in n)e[Z]=n[Z];return e}function pi(e,n,u,l){n=Ja(n);var f=n.call?n.call(e,l):n[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&u(f))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return pi(e,n.fallthrough,u,l);for(var m=0;m<n.fallthrough.length;m++){var F=pi(e,n.fallthrough[m],u,l);if(F)return F}}}function Hu(e){var n=typeof e=="string"?e:xn[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function cl(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(Q?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(Q?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function zu(e,n){if(B&&e.keyCode==34&&e.char)return!1;var u=xn[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),cl(u,e,n))}function Ja(e){return typeof e=="string"?ri[e]:e}function ro(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var m=n(u[f]);l.length&&Lt(m.from,Ct(l).to)<=0;){var F=l.pop();if(Lt(F.from,m.from)<0){m.from=F.from;break}}l.push(m)}Ur(e,function(){for(var U=l.length-1;U>=0;U--)go(e.doc,"",l[U].from,l[U].to,"+delete");rn(e)})}function Xa(e,n,u){var l=$e(e.text,n+u,u);return l<0||l>e.text.length?null:l}function Qa(e,n,u){var l=Xa(e,n.ch,u);return l==null?null:new ot(n.line,l,u<0?"after":"before")}function dl(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var m=O(u,n.doc.direction);if(m){var F=f<0?Ct(m):m[0],U=f<0==(F.level==1),H=U?"after":"before",Z;if(F.level>0||n.doc.direction=="rtl"){var be=_n(n,u);Z=f<0?u.text.length-1:0;var Ce=Hn(n,be,Z).top;Z=Ke(function(De){return Hn(n,be,De).top==Ce},f<0==(F.level==1)?F.from:F.to-1,Z),H=="before"&&(Z=Xa(u,Z,1))}else Z=f<0?F.to:F.from;return new ot(l,Z,H)}}return new ot(l,f<0?u.text.length:0,f<0?"before":"after")}function Gu(e,n,u,l){var f=O(n,e.doc.direction);if(!f)return Qa(n,u,l);u.ch>=n.text.length?(u.ch=n.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var m=K(f,u.ch,u.sticky),F=f[m];if(e.doc.direction=="ltr"&&F.level%2==0&&(l>0?F.to>u.ch:F.from<u.ch))return Qa(n,u,l);var U=function(ct,gt){return Xa(n,ct instanceof ot?ct.ch:ct,gt)},H,Z=function(ct){return e.options.lineWrapping?(H=H||_n(e,n),lu(e,n,H,ct)):{begin:0,end:n.text.length}},be=Z(u.sticky=="before"?U(u,-1):u.ch);if(e.doc.direction=="rtl"||F.level==1){var Ce=F.level==1==l<0,De=U(u,Ce?1:-1);if(De!=null&&(Ce?De<=F.to&&De<=be.end:De>=F.from&&De>=be.begin)){var ke=Ce?"before":"after";return new ot(u.line,De,ke)}}var Ye=function(ct,gt,dt){for(var xt=function(Gt,hr){return hr?new ot(u.line,U(Gt,1),"before"):new ot(u.line,Gt,"after")};ct>=0&&ct<f.length;ct+=gt){var Ft=f[ct],It=gt>0==(Ft.level!=1),it=It?dt.begin:U(dt.end,-1);if(Ft.from<=it&&it<Ft.to||(it=It?Ft.from:U(Ft.to,-1),dt.begin<=it&&it<dt.end))return xt(it,It)}},tt=Ye(m+l,l,be);if(tt)return tt;var at=l>0?be.end:U(be.begin,-1);return at!=null&&!(l>0&&at==n.text.length)&&(tt=Ye(l>0?0:f.length-1,l,Z(at)),tt)?tt:null}var na={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ut)},killLine:function(e){return ro(e,function(n){if(n.empty()){var u=Tt(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:ot(n.head.line+1,0)}:{from:n.head,to:ot(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ro(e,function(n){return{from:ot(n.from().line,0),to:lt(e.doc,ot(n.to().line+1,0))}})},delLineLeft:function(e){return ro(e,function(n){return{from:ot(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ro(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return ro(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return wo(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Za(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return bc(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},mt)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},mt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Za(e,n.head):l},mt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],u=e.listSelections(),l=e.options.tabSize,f=0;f<u.length;f++){var m=u[f].from(),F=Xe(e.getLine(m.line),m.ch,l);n.push(kt(l-F%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ur(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,m=Tt(e.doc,f.line).text;if(m){if(f.ch==m.length&&(f=new ot(f.line,f.ch-1)),f.ch>0)f=new ot(f.line,f.ch+1),e.replaceRange(m.charAt(f.ch-1)+m.charAt(f.ch-2),ot(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var F=Tt(e.doc,f.line-1).text;F&&(f=new ot(f.line,1),e.replaceRange(m.charAt(0)+e.doc.lineSeparator()+F.charAt(F.length-1),ot(f.line-1,F.length-1),f,"+transpose"))}}u.push(new er(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return Ur(e,function(){for(var n=e.listSelections(),u=n.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),n[u].anchor,n[u].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);rn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
29
|
-
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function wo(e,n){var u=Tt(e.doc,n),l=Wn(u);return l!=u&&(n=Zt(l)),dl(!0,e,l,n,1)}function bc(e,n){var u=Tt(e.doc,n),l=Xl(u);return l!=u&&(n=Zt(l)),dl(!0,e,u,n,-1)}function Za(e,n){var u=wo(e,n.line),l=Tt(e.doc,u.line),f=O(l,e.doc.direction);if(!f||f[0].level==0){var m=Math.max(u.ch,l.text.search(/\S/)),F=n.line==u.line&&n.ch<=m&&n.ch;return ot(u.line,F?0:m,u.sticky)}return u}function _a(e,n,u){if(typeof n=="string"&&(n=na[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),f=n(e)!=nt}finally{e.display.shift=l,e.state.suppressEdits=!1}return f}function wc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=pi(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&pi(n,e.options.extraKeys,u,e)||pi(n,e.options.keyMap,u,e)}var qa=new ft;function ia(e,n,u,l){var f=e.state.keySeq;if(f){if(Hu(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:qa.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),Sc(e,f+" "+n,u,l))return!0}return Sc(e,n,u,l)}function Sc(e,n,u,l){var f=wc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&ir(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(Qe(u),zs(e)),!!f}function $u(e,n){var u=zu(n,!0);return u?n.shiftKey&&!e.state.keySeq?ia(e,"Shift-"+u,n,function(l){return _a(e,l,!0)})||ia(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return _a(e,l)}):ia(e,u,n,function(l){return _a(e,l)}):!1}function Ac(e,n,u){return ia(e,"'"+u+"'",n,function(l){return _a(e,l,!0)})}var es=null;function Ku(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=Fe(),!pe(n,e))){b&&S<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=$u(n,e);B&&(es=l?u:null,!l&&u==88&&!Tn&&(C?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!C&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Ec(n)}}function Ec(e){var n=e.display.lineDiv;Le(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(ee(n,"CodeMirror-crosshair"),de(document,"keyup",u),de(document,"mouseover",u))}N(document,"keyup",u),N(document,"mouseover",u)}function Yu(e){e.keyCode==16&&(this.doc.sel.shift=!1),pe(this,e)}function pl(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(li(n.display,e)||pe(n,e)||e.ctrlKey&&!e.altKey||C&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(B&&u==es){es=null,Qe(e);return}if(!(B&&(!e.which||e.which<10)&&$u(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(Ac(n,e,f)||n.display.input.onKeyPress(e))}}}var Cc=400,hl=function(e,n,u){this.time=e,this.pos=n,this.button=u};hl.prototype.compare=function(e,n,u){return this.time+Cc>e&&Lt(n,this.pos)==0&&u==this.button};var oa,aa;function Oc(e,n){var u=+new Date;return aa&&aa.compare(u,e,n)?(oa=aa=null,"triple"):oa&&oa.compare(u,e,n)?(aa=new hl(u,e,n),oa=null,"double"):(oa=new hl(u,e,n),aa=null,"single")}function Ju(e){var n=this,u=n.display;if(!(pe(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,li(u,e)){g||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!vl(n,e)){var l=Ki(n,e),f=pn(e),m=l?Oc(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&Tc(n,f,l,m,e))&&(f==1?l?Ic(n,l,m,e):Pt(e)==u.scroller&&Qe(e):f==2?(l&&Ha(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(Y?n.display.input.onContextMenu(e):Vo(n)))}}}function Tc(e,n,u,l,f){var m="Click";return l=="double"?m="Double"+m:l=="triple"&&(m="Triple"+m),m=(n==1?"Left":n==2?"Middle":"Right")+m,ia(e,cl(m,f),f,function(F){if(typeof F=="string"&&(F=na[F]),!F)return!1;var U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),U=F(e,u)!=nt}finally{e.state.suppressEdits=!1}return U})}function Pc(e,n,u){var l=e.getOption("configureMouse"),f=l?l(e,n,u):{};if(f.unit==null){var m=V?u.shiftKey&&u.metaKey:u.altKey;f.unit=m?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||u.shiftKey),f.addNew==null&&(f.addNew=C?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(C?u.altKey:u.ctrlKey)),f}function Ic(e,n,u,l){b?setTimeout(rt(Gs,e),0):e.curOp.focus=Fe();var f=Pc(e,u,l),m=e.doc.sel,F;e.options.dragDrop&&Nr&&!e.isReadOnly()&&u=="single"&&(F=m.contains(n))>-1&&(Lt((F=m.ranges[F]).from(),n)<0||n.xRel>0)&&(Lt(F.to(),n)>0||n.xRel<0)?ts(e,l,n,f):Fc(e,l,n,f)}function ts(e,n,u,l){var f=e.display,m=!1,F=jr(e,function(Z){g&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Vo(e)),de(f.wrapper.ownerDocument,"mouseup",F),de(f.wrapper.ownerDocument,"mousemove",U),de(f.scroller,"dragstart",H),de(f.scroller,"drop",F),m||(Qe(Z),l.addNew||Ha(e.doc,u,null,null,l.extend),g&&!j||b&&S==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),U=function(Z){m=m||Math.abs(n.clientX-Z.clientX)+Math.abs(n.clientY-Z.clientY)>=10},H=function(){return m=!0};g&&(f.scroller.draggable=!0),e.state.draggingText=F,F.copy=!l.moveOnDrag,N(f.wrapper.ownerDocument,"mouseup",F),N(f.wrapper.ownerDocument,"mousemove",U),N(f.scroller,"dragstart",H),N(f.scroller,"drop",F),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function Xu(e,n,u){if(u=="char")return new er(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new er(ot(n.line,0),lt(e.doc,ot(n.line+1,0)));var l=u(e,n);return new er(l.from,l.to)}function Fc(e,n,u,l){b&&Vo(e);var f=e.display,m=e.doc;Qe(n);var F,U,H=m.sel,Z=H.ranges;if(l.addNew&&!l.extend?(U=m.sel.contains(u),U>-1?F=Z[U]:F=new er(u,u)):(F=m.sel.primary(),U=m.sel.primIndex),l.unit=="rectangle")l.addNew||(F=new er(u,u)),u=Ki(e,n,!0,!0),U=-1;else{var be=Xu(e,u,l.unit);l.extend?F=nl(F,be.anchor,be.head,l.extend):F=be}l.addNew?U==-1?(U=Z.length,Xr(m,En(e,Z.concat([F]),U),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[U].empty()&&l.unit=="char"&&!l.extend?(Xr(m,En(e,Z.slice(0,U).concat(Z.slice(U+1)),0),{scroll:!1,origin:"*mouse"}),H=m.sel):za(m,U,F,yt):(U=0,Xr(m,new mn([F],0),yt),H=m.sel);var Ce=u;function De(dt){if(Lt(Ce,dt)!=0)if(Ce=dt,l.unit=="rectangle"){for(var xt=[],Ft=e.options.tabSize,It=Xe(Tt(m,u.line).text,u.ch,Ft),it=Xe(Tt(m,dt.line).text,dt.ch,Ft),Gt=Math.min(It,it),hr=Math.max(It,it),vr=Math.min(u.line,dt.line),bn=Math.min(e.lastLine(),Math.max(u.line,dt.line));vr<=bn;vr++){var fn=Tt(m,vr).text,Ar=pt(fn,Gt,Ft);Gt==hr?xt.push(new er(ot(vr,Ar),ot(vr,Ar))):fn.length>Ar&&xt.push(new er(ot(vr,Ar),ot(vr,pt(fn,hr,Ft))))}xt.length||xt.push(new er(u,u)),Xr(m,En(e,H.ranges.slice(0,U).concat(xt),U),{origin:"*mouse",scroll:!1}),e.scrollIntoView(dt)}else{var cn=F,Kr=Xu(e,dt,l.unit),Fr=cn.anchor,gr;Lt(Kr.anchor,Fr)>0?(gr=Kr.head,Fr=qe(cn.from(),Kr.anchor)):(gr=Kr.anchor,Fr=Oe(cn.to(),Kr.head));var yr=H.ranges.slice(0);yr[U]=kc(e,new er(lt(m,Fr),gr)),Xr(m,En(e,yr,U),yt)}}var ke=f.wrapper.getBoundingClientRect(),Ye=0;function tt(dt){var xt=++Ye,Ft=Ki(e,dt,!0,l.unit=="rectangle");if(!!Ft)if(Lt(Ft,Ce)!=0){e.curOp.focus=Fe(),De(Ft);var It=Wo(f,m);(Ft.line>=It.to||Ft.line<It.from)&&setTimeout(jr(e,function(){Ye==xt&&tt(dt)}),150)}else{var it=dt.clientY<ke.top?-20:dt.clientY>ke.bottom?20:0;it&&setTimeout(jr(e,function(){Ye==xt&&(f.scroller.scrollTop+=it,tt(dt))}),50)}}function at(dt){e.state.selectingText=!1,Ye=1/0,dt&&(Qe(dt),f.input.focus()),de(f.wrapper.ownerDocument,"mousemove",ct),de(f.wrapper.ownerDocument,"mouseup",gt),m.history.lastSelOrigin=null}var ct=jr(e,function(dt){dt.buttons===0||!pn(dt)?at(dt):tt(dt)}),gt=jr(e,at);e.state.selectingText=gt,N(f.wrapper.ownerDocument,"mousemove",ct),N(f.wrapper.ownerDocument,"mouseup",gt)}function kc(e,n){var u=n.anchor,l=n.head,f=Tt(e.doc,u.line);if(Lt(u,l)==0&&u.sticky==l.sticky)return n;var m=O(f);if(!m)return n;var F=K(m,u.ch,u.sticky),U=m[F];if(U.from!=u.ch&&U.to!=u.ch)return n;var H=F+(U.from==u.ch==(U.level!=1)?0:1);if(H==0||H==m.length)return n;var Z;if(l.line!=u.line)Z=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=K(m,l.ch,l.sticky),Ce=be-F||(l.ch-u.ch)*(U.level==1?-1:1);be==H-1||be==H?Z=Ce<0:Z=Ce>0}var De=m[H+(Z?-1:0)],ke=Z==(De.level==1),Ye=ke?De.from:De.to,tt=ke?"after":"before";return u.ch==Ye&&u.sticky==tt?n:new er(new ot(u.line,Ye,tt),l)}function Qu(e,n,u,l){var f,m;if(n.touches)f=n.touches[0].clientX,m=n.touches[0].clientY;else try{f=n.clientX,m=n.clientY}catch(De){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&Qe(n);var F=e.display,U=F.lineDiv.getBoundingClientRect();if(m>U.bottom||!Be(e,u))return Et(n);m-=U.top-F.viewOffset;for(var H=0;H<e.display.gutterSpecs.length;++H){var Z=F.gutters.childNodes[H];if(Z&&Z.getBoundingClientRect().right>=f){var be=Vn(e.doc,m),Ce=e.display.gutterSpecs[H];return oe(e,u,e,be,Ce.className,n),Et(n)}}}function vl(e,n){return Qu(e,n,"gutterClick",!0)}function Zu(e,n){li(e.display,n)||_u(e,n)||pe(e,n,"contextmenu")||Y||e.display.input.onContextMenu(n)}function _u(e,n){return Be(e,"gutterContextMenu")?Qu(e,n,"gutterContextMenu",!1):!1}function qu(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),No(e)}var So={toString:function(){return"CodeMirror.Init"}},ef={},rs={};function tf(e){var n=e.optionHandlers;function u(l,f,m,F){e.defaults[l]=f,m&&(n[l]=F?function(U,H,Z){Z!=So&&m(U,H,Z)}:m)}e.defineOption=u,e.Init=So,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,Ua(l)},!0),u("indentUnit",2,Ua,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){_i(l),No(l),Rr(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var m=[],F=l.doc.first;l.doc.iter(function(H){for(var Z=0;;){var be=H.text.indexOf(f,Z);if(be==-1)break;Z=be+f.length,m.push(ot(F,be))}F++});for(var U=m.length-1;U>=0;U--)go(l.doc,f,m[U],ot(m[U].line,m[U].ch+f.length))}}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,f,m){l.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),m!=So&&l.refresh()}),u("specialCharPlaceholder",Ts,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",R?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,f){return l.getInputField().spellcheck=f},!0),u("autocorrect",!1,function(l,f){return l.getInputField().autocorrect=f},!0),u("autocapitalize",!1,function(l,f){return l.getInputField().autocapitalize=f},!0),u("rtlMoveVisually",!J),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){qu(l),Na(l)},!0),u("keyMap","default",function(l,f,m){var F=Ja(f),U=m!=So&&Ja(m);U&&U.detach&&U.detach(l,F),F.attach&&F.attach(l,U||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Rc,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=Ko(f,l.options.lineNumbers),Na(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?In(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return fi(l)},!0),u("scrollbarStyle","native",function(l){La(l),fi(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,f){l.display.gutterSpecs=Ko(l.options.gutters,f),Na(l)},!0),u("firstLineNumber",1,Na,!0),u("lineNumberFormatter",function(l){return l},Na,!0),u("showCursorWhenSelecting",!1,Oi,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(fo(l),l.display.input.blur()),l.display.input.readOnlyChanged(f)}),u("screenReaderLabel",null,function(l,f){f=f===""?null:f,l.display.input.screenReaderLabelChanged(f)}),u("disableInput",!1,function(l,f){f||l.display.input.reset()},!0),u("dragDrop",!0,Mc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Oi,!0),u("singleCursorHeightPerLine",!0,Oi,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,_i,!0),u("addModeClass",!1,_i,!0),u("pollInterval",100),u("undoDepth",200,function(l,f){return l.doc.history.undoDepth=f}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,_i,!0),u("moveInputWithCursor",!0,function(l,f){f||l.display.input.resetPosition()}),u("tabindex",null,function(l,f){return l.display.input.getField().tabIndex=f||""}),u("autofocus",null),u("direction","ltr",function(l,f){return l.doc.setDirection(f)},!0),u("phrases",null)}function Mc(e,n,u){var l=u&&u!=So;if(!n!=!l){var f=e.display.dragFunctions,m=n?N:de;m(e.display.scroller,"dragstart",f.start),m(e.display.scroller,"dragenter",f.enter),m(e.display.scroller,"dragover",f.over),m(e.display.scroller,"dragleave",f.leave),m(e.display.scroller,"drop",f.drop)}}function Rc(e){e.options.lineWrapping?(Le(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ee(e.display.wrapper,"CodeMirror-wrap"),As(e)),Ws(e),Rr(e),No(e),setTimeout(function(){return fi(e)},100)}function dr(e,n){var u=this;if(!(this instanceof dr))return new dr(e,n);this.options=n=n?Ze(n):{},Ze(ef,n,!1);var l=n.value;typeof l=="string"?l=new un(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new dr.inputStyles[n.inputStyle](this),m=this.display=new oc(e,l,f,n);m.wrapper.CodeMirror=this,qu(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),La(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 ft,keySeq:null,specialChars:null},n.autofocus&&!R&&m.input.focus(),b&&S<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Lc(this),Vu(),Ti(this),this.curOp.forceUpdate=!0,Cu(this,l),n.autofocus&&!R||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Fa(u)},20):fo(this);for(var F in rs)rs.hasOwnProperty(F)&&rs[F](this,n[F],So);Da(this),n.finishInit&&n.finishInit(this);for(var U=0;U<gl.length;++U)gl[U](this);Pi(this),g&&n.lineWrapping&&getComputedStyle(m.lineDiv).textRendering=="optimizelegibility"&&(m.lineDiv.style.textRendering="auto")}dr.defaults=ef,dr.optionHandlers=rs;function Lc(e){var n=e.display;N(n.scroller,"mousedown",jr(e,Ju)),b&&S<11?N(n.scroller,"dblclick",jr(e,function(H){if(!pe(e,H)){var Z=Ki(e,H);if(!(!Z||vl(e,H)||li(e.display,H))){Qe(H);var be=e.findWordAt(Z);Ha(e.doc,be.anchor,be.head)}}})):N(n.scroller,"dblclick",function(H){return pe(e,H)||Qe(H)}),N(n.scroller,"contextmenu",function(H){return Zu(e,H)}),N(n.input.getField(),"contextmenu",function(H){n.scroller.contains(H.target)||Zu(e,H)});var u,l={end:0};function f(){n.activeTouch&&(u=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function m(H){if(H.touches.length!=1)return!1;var Z=H.touches[0];return Z.radiusX<=1&&Z.radiusY<=1}function F(H,Z){if(Z.left==null)return!0;var be=Z.left-H.left,Ce=Z.top-H.top;return be*be+Ce*Ce>20*20}N(n.scroller,"touchstart",function(H){if(!pe(e,H)&&!m(H)&&!vl(e,H)){n.input.ensurePolled(),clearTimeout(u);var Z=+new Date;n.activeTouch={start:Z,moved:!1,prev:Z-l.end<=300?l:null},H.touches.length==1&&(n.activeTouch.left=H.touches[0].pageX,n.activeTouch.top=H.touches[0].pageY)}}),N(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),N(n.scroller,"touchend",function(H){var Z=n.activeTouch;if(Z&&!li(n,H)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var be=e.coordsChar(n.activeTouch,"page"),Ce;!Z.prev||F(Z,Z.prev)?Ce=new er(be,be):!Z.prev.prev||F(Z,Z.prev.prev)?Ce=e.findWordAt(be):Ce=new er(ot(be.line,0),lt(e.doc,ot(be.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),Qe(H)}f()}),N(n.scroller,"touchcancel",f),N(n.scroller,"scroll",function(){n.scroller.clientHeight&&(zo(e,n.scroller.scrollTop),Xi(e,n.scroller.scrollLeft,!0),oe(e,"scroll",e))}),N(n.scroller,"mousewheel",function(H){return Su(e,H)}),N(n.scroller,"DOMMouseScroll",function(H){return Su(e,H)}),N(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(H){pe(e,H)||Bt(H)},over:function(H){pe(e,H)||(yc(e,H),Bt(H))},start:function(H){return gc(e,H)},drop:jr(e,vc),leave:function(H){pe(e,H)||ju(e)}};var U=n.input.getField();N(U,"keyup",function(H){return Yu.call(e,H)}),N(U,"keydown",jr(e,Ku)),N(U,"keypress",jr(e,pl)),N(U,"focus",function(H){return Fa(e,H)}),N(U,"blur",function(H){return fo(e,H)})}var gl=[];dr.defineInitHook=function(e){return gl.push(e)};function Ao(e,n,u,l){var f=e.doc,m;u==null&&(u="add"),u=="smart"&&(f.mode.indent?m=en(e,n).state:u="prev");var F=e.options.tabSize,U=Tt(f,n),H=Xe(U.text,null,F);U.stateAfter&&(U.stateAfter=null);var Z=U.text.match(/^\s*/)[0],be;if(!l&&!/\S/.test(U.text))be=0,u="not";else if(u=="smart"&&(be=f.mode.indent(m,U.text.slice(Z.length),U.text),be==nt||be>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?be=Xe(Tt(f,n-1).text,null,F):be=0:u=="add"?be=H+e.options.indentUnit:u=="subtract"?be=H-e.options.indentUnit:typeof u=="number"&&(be=H+u),be=Math.max(0,be);var Ce="",De=0;if(e.options.indentWithTabs)for(var ke=Math.floor(be/F);ke;--ke)De+=F,Ce+=" ";if(De<be&&(Ce+=kt(be-De)),Ce!=Z)return go(f,Ce,ot(n,0),ot(n,Z.length),"+input"),U.stateAfter=null,!0;for(var Ye=0;Ye<f.sel.ranges.length;Ye++){var tt=f.sel.ranges[Ye];if(tt.head.line==n&&tt.head.ch<Z.length){var at=ot(n,Z.length);za(f,Ye,new er(at,at));break}}}var Cn=null;function sa(e){Cn=e}function yl(e,n,u,l,f){var m=e.doc;e.display.shift=!1,l||(l=m.sel);var F=+new Date-200,U=f=="paste"||e.state.pasteIncoming>F,H=Bn(n),Z=null;if(U&&l.ranges.length>1)if(Cn&&Cn.text.join(`
|
|
27
|
+
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(m),m.scrollIntoView(f),e.display.lineSpace.removeChild(m)}}}function du(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?ot(n.line,n.ch+1,"before"):n,n=n.ch?ot(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var m=0;m<5;m++){var F=!1,U=zn(e,n),H=!u||u==n?U:zn(e,u);f={left:Math.min(U.left,H.left),top:Math.min(U.top,H.top)-l,right:Math.max(U.left,H.left),bottom:Math.max(U.bottom,H.bottom)+l};var Z=Ks(e,f),be=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(Z.scrollTop!=null&&(zo(e,Z.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&(F=!0)),Z.scrollLeft!=null&&(Xi(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(F=!0)),!F)break}return f}function pu(e,n){var u=Ks(e,n);u.scrollTop!=null&&zo(e,u.scrollTop),u.scrollLeft!=null&&Xi(e,u.scrollLeft)}function Ks(e,n){var u=e.display,l=uo(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,m=Do(e),F={};n.bottom-n.top>m&&(n.bottom=n.top+m);var U=e.doc.height+ks(u),H=n.top<l,Z=n.bottom>U-l;if(n.top<f)F.scrollTop=H?0:n.top;else if(n.bottom>f+m){var be=Math.min(n.top,(Z?U:n.bottom)-m);be!=f&&(F.scrollTop=be)}var Ce=e.options.fixedGutter?0:u.gutters.offsetWidth,De=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Ce,ke=zi(e)-u.gutters.offsetWidth,Ye=n.right-n.left>ke;return Ye&&(n.right=n.left+ke),n.left<10?F.scrollLeft=0:n.left<De?F.scrollLeft=Math.max(0,n.left+Ce-(Ye?0:10)):n.right>ke+De-3&&(F.scrollLeft=n.right+(Ye?0:10)-ke),F}function Ys(e,n){n!=null&&(Ma(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function rn(e){Ma(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function Ho(e,n,u){(n!=null||u!=null)&&Ma(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function Ji(e,n){Ma(e),e.curOp.scrollToPos=n}function Ma(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=su(e,n.from),l=su(e,n.to);hu(e,u,l,n.margin)}}function hu(e,n,u,l){var f=Ks(e,{left:Math.min(n.left,u.left),top:Math.min(n.top,u.top)-l,right:Math.max(n.right,u.right),bottom:Math.max(n.bottom,u.bottom)+l});Ho(e,f.scrollLeft,f.scrollTop)}function zo(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||Zs(e,{top:n}),vu(e,n,!0),c&&Zs(e),Gn(e,100))}function vu(e,n,u){n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),!(e.display.scroller.scrollTop==n&&!u)&&(e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n))}function Xi(e,n,u,l){n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((u?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)&&(e.doc.scrollLeft=n,bu(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function co(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+ks(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?u:0,docHeight:l,scrollHeight:l+ui(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var Qi=function(e,n,u){this.cm=u;var l=this.vert=we("div",[we("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=we("div",[we("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=f.tabIndex=-1,e(l),e(f),N(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),N(f,"scroll",function(){f.clientWidth&&n(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&S<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Qi.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var f=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var m=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+m)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:n?l:0}},Qi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Qi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Qi.prototype.zeroWidthHack=function(){var e=C&&!q?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ft,this.disableVert=new ft},Qi.prototype.enableZeroWidthBar=function(e,n,u){e.style.pointerEvents="auto";function l(){var f=e.getBoundingClientRect(),m=u=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);m!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},Qi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Go=function(){};Go.prototype.update=function(){return{bottom:0,right:0}},Go.prototype.setScrollLeft=function(){},Go.prototype.setScrollTop=function(){},Go.prototype.clear=function(){};function fi(e,n){n||(n=co(e));var u=e.display.barWidth,l=e.display.barHeight;Ra(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&ka(e),Ra(e,co(e)),u=e.display.barWidth,l=e.display.barHeight}function Ra(e,n){var u=e.display,l=u.scrollbars.update(n);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=n.gutterWidth+"px"):u.gutterFiller.style.display=""}var yn={native:Qi,null:Go};function La(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new yn[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),N(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,u){u=="horizontal"?Xi(e,n):zo(e,n)},e),e.display.scrollbars.addClass&&Le(e.display.wrapper,e.display.scrollbars.addClass)}var ci=0;function Ti(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:++ci,markArrays:null},ql(e.curOp)}function Pi(e){var n=e.curOp;n&&Is(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;Md(u)})}function Md(e){for(var n=e.ops,u=0;u<n.length;u++)Js(n[u]);for(var l=0;l<n.length;l++)gu(n[l]);for(var f=0;f<n.length;f++)yu(n[f]);for(var m=0;m<n.length;m++)Ir(n[m]);for(var F=0;F<n.length;F++)rc(n[F])}function Js(e){var n=e.cm,u=n.display;mu(n),e.updateMaxLine&&As(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new Zi(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function gu(e){e.updatedDisplay=e.mustUpdate&&Qs(e.cm,e.update)}function yu(e){var n=e.cm,u=n.display;e.updatedDisplay&&ka(n),e.barMeasure=co(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Sa(n,u.maxLine,u.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+ui(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-zi(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function Ir(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Xi(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==Fe();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&fi(n,e.barMeasure),e.updatedDisplay&&qs(n,e.barMeasure),e.selectionChanged&&zs(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&Gs(e.cm)}function rc(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&xu(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&vu(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Xi(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=du(n,lt(l,e.scrollToPos.from),lt(l,e.scrollToPos.to),e.scrollToPos.margin);tc(n,f)}var m=e.maybeHiddenMarkers,F=e.maybeUnhiddenMarkers;if(m)for(var U=0;U<m.length;++U)m[U].lines.length||oe(m[U],"hide");if(F)for(var H=0;H<F.length;++H)F[H].lines.length&&oe(F[H],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&oe(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Ur(e,n){if(e.curOp)return n();Ti(e);try{return n()}finally{Pi(e)}}function jr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Ti(e);try{return n.apply(e,arguments)}finally{Pi(e)}}}function Lr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ti(this);try{return e.apply(this,arguments)}finally{Pi(this)}}}function cr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Ti(n);try{return e.apply(this,arguments)}finally{Pi(n)}}}function Gn(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,rt(nc,e))}function nc(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=en(e,n.highlightFrontier),f=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(m){if(l.line>=e.display.viewFrom){var F=m.styles,U=m.text.length>e.options.maxHighlightLength?Br(n.mode,l.state):null,H=_t(e,m,l,!0);U&&(l.state=U),m.styles=H.styles;var Z=m.styleClasses,be=H.classes;be?m.styleClasses=be:Z&&(m.styleClasses=null);for(var Ce=!F||F.length!=m.styles.length||Z!=be&&(!Z||!be||Z.bgClass!=be.bgClass||Z.textClass!=be.textClass),De=0;!Ce&&De<F.length;++De)Ce=F[De]!=m.styles[De];Ce&&f.push(l.line),m.stateAfter=l.save(),l.nextLine()}else m.text.length<=e.options.maxHighlightLength&&vs(e,m.text,l),m.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return Gn(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&Ur(e,function(){for(var m=0;m<f.length;m++)qn(e,f[m],"text")})}}var Zi=function(e,n,u){var l=e.display;this.viewport=n,this.visible=Wo(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=zi(e),this.force=u,this.dims=Vs(e),this.events=[]};Zi.prototype.signal=function(e,n){Be(e,n)&&this.events.push(arguments)},Zi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)oe.apply(null,this.events[e])};function mu(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=ui(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=ui(e)+"px",n.scrollbarsClipped=!0)}function $o(e){if(e.hasFocus())return null;var n=Fe();if(!n||!ae(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&ae(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function Xs(e){if(!(!e||!e.activeElt||e.activeElt==Fe())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ae(document.body,e.anchorNode)&&ae(document.body,e.focusNode))){var n=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),n.removeAllRanges(),n.addRange(u),n.extend(e.focusNode,e.focusOffset)}}function Qs(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return Ci(e),!1;if(!n.force&&n.visible.from>=u.viewFrom&&n.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&Ta(e)==0)return!1;Da(e)&&(Ci(e),n.dims=Vs(e));var f=l.first+l.size,m=Math.max(n.visible.from-e.options.viewportMargin,l.first),F=Math.min(f,n.visible.to+e.options.viewportMargin);u.viewFrom<m&&m-u.viewFrom<20&&(m=Math.max(l.first,u.viewFrom)),u.viewTo>F&&u.viewTo-F<20&&(F=Math.min(f,u.viewTo)),Ai&&(m=Fo(e.doc,m),F=Ss(e.doc,F));var U=m!=u.viewFrom||F!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;ec(e,m,F),u.viewOffset=si(Tt(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var H=Ta(e);if(!U&&H==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var Z=$o(e);return H>4&&(u.lineDiv.style.display="none"),ic(e,u.updateLineNumbers,n.dims),H>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,Xs(Z),ie(u.cursorDiv),ie(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,U&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,Gn(e,400)),u.updateLineNumbers=null,!0}function xu(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==zi(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+ks(e.display)-Do(e),u.top)}),n.visible=Wo(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Wo(e.display,e.doc,u));if(!Qs(e,n))break;ka(e);var f=co(e);Oi(e),fi(e,f),qs(e,f),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Zs(e,n){var u=new Zi(e,n);if(Qs(e,u)){ka(e),xu(e,u);var l=co(e);Oi(e),fi(e,l),qs(e,l),u.finish()}}function ic(e,n,u){var l=e.display,f=e.options.lineNumbers,m=l.lineDiv,F=m.firstChild;function U(Ye){var tt=Ye.nextSibling;return g&&C&&e.display.currentWheelTarget==Ye?Ye.style.display="none":Ye.parentNode.removeChild(Ye),tt}for(var H=l.view,Z=l.viewFrom,be=0;be<H.length;be++){var Ce=H[be];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=m){var De=qt(e,Ce,Z,u);m.insertBefore(De,F)}else{for(;F!=Ce.node;)F=U(F);var ke=f&&n!=null&&n<=Z&&Ce.lineNumber;Ce.changes&&(ht(Ce.changes,"gutter")>-1&&(ke=!1),wa(e,Ce,Z,u)),ke&&(ie(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(lo(e.options,Z)))),F=Ce.node.nextSibling}Z+=Ce.size}for(;F;)F=U(F)}function _s(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",ir(e,"gutterChanged",e)}function qs(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+ui(e)+"px"}function bu(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=In(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,m=l+"px",F=0;F<u.length;F++)if(!u[F].hidden){e.options.fixedGutter&&(u[F].gutter&&(u[F].gutter.style.left=m),u[F].gutterBackground&&(u[F].gutterBackground.style.left=m));var U=u[F].alignable;if(U)for(var H=0;H<U.length;H++)U[H].style.left=m}e.options.fixedGutter&&(n.gutters.style.left=l+f+"px")}}function Da(e){if(!e.options.lineNumbers)return!1;var n=e.doc,u=lo(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(we("div",[we("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),m=f.firstChild.offsetWidth,F=f.offsetWidth-m;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(m,l.lineGutter.offsetWidth-F)+1,l.lineNumWidth=l.lineNumInnerWidth+F,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",_s(e.display),!0}return!1}function Ko(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var m=e[f],F=null;if(typeof m!="string"&&(F=m.style,m=m.className),m=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:m,style:F})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function wu(e){var n=e.gutters,u=e.gutterSpecs;ie(n),e.lineGutter=null;for(var l=0;l<u.length;++l){var f=u[l],m=f.className,F=f.style,U=n.appendChild(we("div",null,"CodeMirror-gutter "+m));F&&(U.style.cssText=F),m=="CodeMirror-linenumbers"&&(e.lineGutter=U,U.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",_s(e)}function Na(e){wu(e.display),Rr(e),bu(e)}function oc(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=we("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=we("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=he("div",null,"CodeMirror-code"),f.selectionDiv=we("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=we("div",null,"CodeMirror-cursors"),f.measure=we("div",null,"CodeMirror-measure"),f.lineMeasure=we("div",null,"CodeMirror-measure"),f.lineSpace=he("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var m=he("div",[f.lineSpace],"CodeMirror-lines");f.mover=we("div",[m],null,"position: relative"),f.sizer=we("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=we("div",null,null,"position: absolute; height: "+bt+"px; width: 1px;"),f.gutters=we("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=we("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=we("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&S<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!g&&!(c&&R)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=n.first,f.reportedViewFrom=f.reportedViewTo=n.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=Ko(l.gutters,l.lineNumbers),wu(f),u.init(f)}var Ba=0,di=null;b?di=-.53:c?di=15:D?di=-.7:j&&(di=-1/3);function Su(e){var n=e.wheelDeltaX,u=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:n,y:u}}function rr(e){var n=Su(e);return n.x*=di,n.y*=di,n}function Au(e,n){var u=Su(n),l=u.x,f=u.y,m=di;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,m=1);var F=e.display,U=F.scroller,H=U.scrollWidth>U.clientWidth,Z=U.scrollHeight>U.clientHeight;if(!!(l&&H||f&&Z)){if(f&&C&&g){e:for(var be=n.target,Ce=F.view;be!=U;be=be.parentNode)for(var De=0;De<Ce.length;De++)if(Ce[De].node==be){e.display.currentWheelTarget=be;break e}}if(l&&!c&&!B&&m!=null){f&&Z&&zo(e,Math.max(0,U.scrollTop+f*m)),Xi(e,Math.max(0,U.scrollLeft+l*m)),(!f||f&&Z)&&Qe(n),F.wheelStartX=null;return}if(f&&m!=null){var ke=f*m,Ye=e.doc.scrollTop,tt=Ye+F.wrapper.clientHeight;ke<0?Ye=Math.max(0,Ye+ke-50):tt=Math.min(e.doc.height,tt+ke+50),Zs(e,{top:Ye,bottom:tt})}Ba<20&&n.deltaMode!==0&&(F.wheelStartX==null?(F.wheelStartX=U.scrollLeft,F.wheelStartY=U.scrollTop,F.wheelDX=l,F.wheelDY=f,setTimeout(function(){if(F.wheelStartX!=null){var at=U.scrollLeft-F.wheelStartX,ct=U.scrollTop-F.wheelStartY,gt=ct&&F.wheelDY&&ct/F.wheelDY||at&&F.wheelDX&&at/F.wheelDX;F.wheelStartX=F.wheelStartY=null,!!gt&&(di=(di*Ba+gt)/(Ba+1),++Ba)}},200)):(F.wheelDX+=l,F.wheelDY+=f))}}var mn=function(e,n){this.ranges=e,this.primIndex=n};mn.prototype.primary=function(){return this.ranges[this.primIndex]},mn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var u=this.ranges[n],l=e.ranges[n];if(!oi(u.anchor,l.anchor)||!oi(u.head,l.head))return!1}return!0},mn.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new er(ue(this.ranges[n].anchor),ue(this.ranges[n].head));return new mn(e,this.primIndex)},mn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},mn.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Lt(n,l.from())>=0&&Lt(e,l.to())<=0)return u}return-1};var er=function(e,n){this.anchor=e,this.head=n};er.prototype.from=function(){return qe(this.anchor,this.head)},er.prototype.to=function(){return Oe(this.anchor,this.head)},er.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function En(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(De,ke){return Lt(De.from(),ke.from())}),u=ht(n,f);for(var m=1;m<n.length;m++){var F=n[m],U=n[m-1],H=Lt(U.to(),F.from());if(l&&!F.empty()?H>0:H>=0){var Z=qe(U.from(),F.from()),be=Oe(U.to(),F.to()),Ce=U.empty()?F.from()==F.head:U.from()==U.head;m<=u&&--u,n.splice(--m,2,new er(Ce?be:Z,Ce?Z:be))}}return new mn(n,u)}function Ii(e,n){return new mn([new er(e,n||e)],0)}function Fi(e){return e.text?ot(e.from.line+e.text.length-1,Ct(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Eu(e,n){if(Lt(e,n.from)<0)return e;if(Lt(e,n.to)<=0)return Fi(n);var u=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=Fi(n).ch-n.to.ch),ot(u,l)}function el(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new er(Eu(f.anchor,n),Eu(f.head,n)))}return En(e.cm,u,e.sel.primIndex)}function Cu(e,n,u){return e.line==n.line?ot(u.line,e.ch-n.ch+u.ch):ot(u.line+(e.line-n.line),e.ch)}function ac(e,n,u){for(var l=[],f=ot(e.first,0),m=f,F=0;F<n.length;F++){var U=n[F],H=Cu(U.from,f,m),Z=Cu(Fi(U),f,m);if(f=U.to,m=Z,u=="around"){var be=e.sel.ranges[F],Ce=Lt(be.head,be.anchor)<0;l[F]=new er(Ce?Z:H,Ce?H:Z)}else l[F]=new er(H,H)}return new mn(l,e.sel.primIndex)}function Ua(e){e.doc.mode=gn(e.options,e.doc.modeOption),_i(e)}function _i(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Gn(e,100),e.state.modeGen++,e.curOp&&Rr(e)}function ja(e,n){return n.from.ch==0&&n.to.ch==0&&Ct(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function tl(e,n,u,l){function f(gt){return u?u[gt]:null}function m(gt,dt,xt){Ei(gt,dt,xt,l),ir(gt,"change",gt,n)}function F(gt,dt){for(var xt=[],Ft=gt;Ft<dt;++Ft)xt.push(new Vi(Z[Ft],f(Ft),l));return xt}var U=n.from,H=n.to,Z=n.text,be=Tt(e,U.line),Ce=Tt(e,H.line),De=Ct(Z),ke=f(Z.length-1),Ye=H.line-U.line;if(n.full)e.insert(0,F(0,Z.length)),e.remove(Z.length,e.size-Z.length);else if(ja(e,n)){var tt=F(0,Z.length-1);m(Ce,Ce.text,ke),Ye&&e.remove(U.line,Ye),tt.length&&e.insert(U.line,tt)}else if(be==Ce)if(Z.length==1)m(be,be.text.slice(0,U.ch)+De+be.text.slice(H.ch),ke);else{var at=F(1,Z.length-1);at.push(new Vi(De+be.text.slice(H.ch),ke,l)),m(be,be.text.slice(0,U.ch)+Z[0],f(0)),e.insert(U.line+1,at)}else if(Z.length==1)m(be,be.text.slice(0,U.ch)+Z[0]+Ce.text.slice(H.ch),f(0)),e.remove(U.line+1,Ye);else{m(be,be.text.slice(0,U.ch)+Z[0],f(0)),m(Ce,De+Ce.text.slice(H.ch),ke);var ct=F(1,Z.length-1);Ye>1&&e.remove(U.line+1,Ye-1),e.insert(U.line+1,ct)}ir(e,"change",e,n)}function ki(e,n,u){function l(f,m,F){if(f.linked)for(var U=0;U<f.linked.length;++U){var H=f.linked[U];if(H.doc!=m){var Z=F&&H.sharedHist;u&&!Z||(n(H.doc,Z),l(H.doc,f,Z))}}}l(e,null,!0)}function Ou(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Ws(e),Ua(e),rl(e),e.options.direction=n.direction,e.options.lineWrapping||As(e),e.options.mode=n.modeOption,Rr(e)}function rl(e){(e.doc.direction=="rtl"?Le:ee)(e.display.lineDiv,"CodeMirror-rtl")}function Yo(e){Ur(e,function(){rl(e),Rr(e)})}function Jo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ei(e,n){var u={from:ue(n.from),to:Fi(n),text:ii(e,n.from,n.to)};return Qo(e,u,n.from.line,n.to.line+1),ki(e,function(l){return Qo(l,u,n.from.line,n.to.line+1)},!0),u}function Tu(e){for(;e.length;){var n=Ct(e);if(n.ranges)e.pop();else break}}function Pu(e,n){if(n)return Tu(e.done),Ct(e.done);if(e.done.length&&!Ct(e.done).ranges)return Ct(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ct(e.done)}function Iu(e,n,u,l){var f=e.history;f.undone.length=0;var m=+new Date,F,U;if((f.lastOp==l||f.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&f.lastModTime>m-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(F=Pu(f,f.lastOp==l)))U=Ct(F.changes),Lt(n.from,n.to)==0&&Lt(n.from,U.to)==0?U.to=Fi(n):F.changes.push(ei(e,n));else{var H=Ct(f.done);for((!H||!H.ranges)&&Xo(e.sel,f.done),F={changes:[ei(e,n)],generation:f.generation},f.done.push(F);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(u),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=m,f.lastOp=f.lastSelOp=l,f.lastOrigin=f.lastSelOrigin=n.origin,U||oe(e,"historyAdded")}function Fu(e,n,u,l){var f=n.charAt(0);return f=="*"||f=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function sc(e,n,u,l){var f=e.history,m=l&&l.origin;u==f.lastSelOp||m&&f.lastSelOrigin==m&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==m||Fu(e,m,Ct(f.done),n))?f.done[f.done.length-1]=n:Xo(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=m,f.lastSelOp=u,l&&l.clearRedo!==!1&&Tu(f.undone)}function Xo(e,n){var u=Ct(n);u&&u.ranges&&u.equals(e)||n.push(e)}function Qo(e,n,u,l){var f=n["spans_"+e.id],m=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(F){F.markedSpans&&((f||(f=n["spans_"+e.id]={}))[m]=F.markedSpans),++m})}function lc(e){if(!e)return null;for(var n,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?n||(n=e.slice(0,u)):n&&n.push(e[u]);return n?n.length?n:null:e}function Va(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push(lc(u[f]));return l}function Wa(e,n){var u=Va(e,n),l=$l(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var m=u[f],F=l[f];if(m&&F){e:for(var U=0;U<F.length;++U){for(var H=F[U],Z=0;Z<m.length;++Z)if(m[Z].marker==H.marker)continue e;m.push(H)}}else F&&(u[f]=F)}return u}function po(e,n,u){for(var l=[],f=0;f<e.length;++f){var m=e[f];if(m.ranges){l.push(u?mn.prototype.deepCopy.call(m):m);continue}var F=m.changes,U=[];l.push({changes:U});for(var H=0;H<F.length;++H){var Z=F[H],be=void 0;if(U.push({from:Z.from,to:Z.to,text:Z.text}),n)for(var Ce in Z)(be=Ce.match(/^spans_(\d+)$/))&&ht(n,Number(be[1]))>-1&&(Ct(U)[Ce]=Z[Ce],delete Z[Ce])}}return l}function nl(e,n,u,l){if(l){var f=e.anchor;if(u){var m=Lt(n,f)<0;m!=Lt(u,f)<0?(f=n,n=u):m!=Lt(n,u)<0&&(n=u)}return new er(f,n)}else return new er(u||n,n)}function Ha(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Xr(e,new mn([nl(e.sel.primary(),n,u,f)],0),l)}function ku(e,n,u){for(var l=[],f=e.cm&&(e.cm.display.shift||e.extend),m=0;m<e.sel.ranges.length;m++)l[m]=nl(e.sel.ranges[m],n[m],null,f);var F=En(e.cm,l,e.sel.primIndex);Xr(e,F,u)}function za(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,Xr(e,En(e.cm,f,e.sel.primIndex),l)}function il(e,n,u,l){Xr(e,Ii(n,u),l)}function uc(e,n,u){var l={ranges:n.ranges,update:function(f){this.ranges=[];for(var m=0;m<f.length;m++)this.ranges[m]=new er(lt(e,f[m].anchor),lt(e,f[m].head))},origin:u&&u.origin};return oe(e,"beforeSelectionChange",e,l),e.cm&&oe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?En(e.cm,l.ranges,l.ranges.length-1):n}function Mu(e,n,u){var l=e.history.done,f=Ct(l);f&&f.ranges?(l[l.length-1]=n,Ga(e,n,u)):Xr(e,n,u)}function Xr(e,n,u){Ga(e,n,u),sc(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function Ga(e,n,u){(Be(e,"beforeSelectionChange")||e.cm&&Be(e.cm,"beforeSelectionChange"))&&(n=uc(e,n,u));var l=u&&u.bias||(Lt(n.primary().head,e.sel.primary().head)<0?-1:1);Ru(e,Du(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&rn(e.cm)}function Ru(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ae(e.cm)),ir(e,"cursorActivity",e))}function Lu(e){Ru(e,Du(e,e.sel,null,!1))}function Du(e,n,u,l){for(var f,m=0;m<n.ranges.length;m++){var F=n.ranges[m],U=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[m],H=Zo(e,F.anchor,U&&U.anchor,u,l),Z=Zo(e,F.head,U&&U.head,u,l);(f||H!=F.anchor||Z!=F.head)&&(f||(f=n.ranges.slice(0,m)),f[m]=new er(H,Z))}return f?En(e.cm,f,n.primIndex):n}function ho(e,n,u,l,f){var m=Tt(e,n.line);if(m.markedSpans)for(var F=0;F<m.markedSpans.length;++F){var U=m.markedSpans[F],H=U.marker,Z="selectLeft"in H?!H.selectLeft:H.inclusiveLeft,be="selectRight"in H?!H.selectRight:H.inclusiveRight;if((U.from==null||(Z?U.from<=n.ch:U.from<n.ch))&&(U.to==null||(be?U.to>=n.ch:U.to>n.ch))){if(f&&(oe(H,"beforeCursorEnter"),H.explicitlyCleared))if(m.markedSpans){--F;continue}else break;if(!H.atomic)continue;if(u){var Ce=H.find(l<0?1:-1),De=void 0;if((l<0?be:Z)&&(Ce=Nu(e,Ce,-l,Ce&&Ce.line==n.line?m:null)),Ce&&Ce.line==n.line&&(De=Lt(Ce,u))&&(l<0?De<0:De>0))return ho(e,Ce,n,l,f)}var ke=H.find(l<0?-1:1);return(l<0?Z:be)&&(ke=Nu(e,ke,l,ke.line==n.line?m:null)),ke?ho(e,ke,n,l,f):null}}return n}function Zo(e,n,u,l,f){var m=l||1,F=ho(e,n,u,m,f)||!f&&ho(e,n,u,m,!0)||ho(e,n,u,-m,f)||!f&&ho(e,n,u,-m,!0);return F||(e.cantEdit=!0,ot(e.first,0))}function Nu(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?lt(e,ot(n.line-1)):null:u>0&&n.ch==(l||Tt(e,n.line)).text.length?n.line<e.first+e.size-1?ot(n.line+1,0):null:new ot(n.line,n.ch+u)}function $a(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),ut)}function ol(e,n,u){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(f,m,F,U){f&&(l.from=lt(e,f)),m&&(l.to=lt(e,m)),F&&(l.text=F),U!==void 0&&(l.origin=U)}),oe(e,"beforeChange",e,l),e.cm&&oe(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function vo(e,n,u){if(e.cm){if(!e.cm.curOp)return jr(e.cm,vo)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Be(e,"beforeChange")||e.cm&&Be(e.cm,"beforeChange"))&&(n=ol(e,n,!0),!n))){var l=Nf&&!u&&Yl(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)qi(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else qi(e,n)}}function qi(e,n){if(!(n.text.length==1&&n.text[0]==""&&Lt(n.from,n.to)==0)){var u=el(e,n);Iu(e,n,u,e.cm?e.cm.curOp.id:NaN),_o(e,n,u,$l(e,n));var l=[];ki(e,function(f,m){!m&&ht(l,f.history)==-1&&(ll(f.history,n),l.push(f.history)),_o(f,n,null,$l(f,n))})}}function Fn(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,m,F=e.sel,U=n=="undo"?f.done:f.undone,H=n=="undo"?f.undone:f.done,Z=0;Z<U.length&&(m=U[Z],!(u?m.ranges&&!m.equals(e.sel):!m.ranges));Z++);if(Z!=U.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(m=U.pop(),m.ranges){if(Xo(m,H),u&&!m.equals(e.sel)){Xr(e,m,{clearRedo:!1});return}F=m}else if(l){U.push(m);return}else break;var be=[];Xo(F,H),H.push({changes:be,generation:f.generation}),f.generation=m.generation||++f.maxGeneration;for(var Ce=Be(e,"beforeChange")||e.cm&&Be(e.cm,"beforeChange"),De=function(tt){var at=m.changes[tt];if(at.origin=n,Ce&&!ol(e,at,!1))return U.length=0,{};be.push(ei(e,at));var ct=tt?el(e,at):Ct(U);_o(e,at,ct,Wa(e,at)),!tt&&e.cm&&e.cm.scrollIntoView({from:at.from,to:Fi(at)});var gt=[];ki(e,function(dt,xt){!xt&&ht(gt,dt.history)==-1&&(ll(dt.history,at),gt.push(dt.history)),_o(dt,at,null,Wa(dt,at))})},ke=m.changes.length-1;ke>=0;--ke){var Ye=De(ke);if(Ye)return Ye.v}}}}function al(e,n){if(n!=0&&(e.first+=n,e.sel=new mn(Wt(e.sel.ranges,function(f){return new er(ot(f.anchor.line+n,f.anchor.ch),ot(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){Rr(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)qn(e.cm,l,"gutter")}}function _o(e,n,u,l){if(e.cm&&!e.cm.curOp)return jr(e.cm,_o)(e,n,u,l);if(n.to.line<e.first){al(e,n.text.length-1-(n.to.line-n.from.line));return}if(!(n.from.line>e.lastLine())){if(n.from.line<e.first){var f=n.text.length-1-(e.first-n.from.line);al(e,f),n={from:ot(e.first,0),to:ot(n.to.line+f,n.to.ch),text:[Ct(n.text)],origin:n.origin}}var m=e.lastLine();n.to.line>m&&(n={from:n.from,to:ot(m,Tt(e,m).text.length),text:[n.text[0]],origin:n.origin}),n.removed=ii(e,n.from,n.to),u||(u=el(e,n)),e.cm?fc(e.cm,n,l):tl(e,n,l),Ga(e,u,ut),e.cantEdit&&Zo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function fc(e,n,u){var l=e.doc,f=e.display,m=n.from,F=n.to,U=!1,H=m.line;e.options.lineWrapping||(H=Zt(Wn(Tt(l,m.line))),l.iter(H,F.line+1,function(ke){if(ke==f.maxLine)return U=!0,!0})),l.sel.contains(n.from,n.to)>-1&&Ae(e),tl(l,n,u,fu(e)),e.options.lineWrapping||(l.iter(H,m.line+n.text.length,function(ke){var Ye=ji(ke);Ye>f.maxLineLength&&(f.maxLine=ke,f.maxLineLength=Ye,f.maxLineChanged=!0,U=!1)}),U&&(e.curOp.updateMaxLine=!0)),Df(l,m.line),Gn(e,400);var Z=n.text.length-(F.line-m.line)-1;n.full?Rr(e):m.line==F.line&&n.text.length==1&&!ja(e.doc,n)?qn(e,m.line,"text"):Rr(e,m.line,F.line+1,Z);var be=Be(e,"changes"),Ce=Be(e,"change");if(Ce||be){var De={from:m,to:F,text:n.text,removed:n.removed,origin:n.origin};Ce&&ir(e,"change",e,De),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(De)}e.display.selForContextMenu=null}function go(e,n,u,l,f){var m;l||(l=u),Lt(l,u)<0&&(m=[l,u],u=m[0],l=m[1]),typeof n=="string"&&(n=e.splitLines(n)),vo(e,{from:u,to:l,text:n,origin:f})}function sl(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function Bu(e,n,u,l){for(var f=0;f<e.length;++f){var m=e[f],F=!0;if(m.ranges){m.copied||(m=e[f]=m.deepCopy(),m.copied=!0);for(var U=0;U<m.ranges.length;U++)sl(m.ranges[U].anchor,n,u,l),sl(m.ranges[U].head,n,u,l);continue}for(var H=0;H<m.changes.length;++H){var Z=m.changes[H];if(u<Z.from.line)Z.from=ot(Z.from.line+l,Z.from.ch),Z.to=ot(Z.to.line+l,Z.to.ch);else if(n<=Z.to.line){F=!1;break}}F||(e.splice(0,f+1),f=0)}}function ll(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;Bu(e.done,u,l,f),Bu(e.undone,u,l,f)}function eo(e,n,u,l){var f=n,m=n;return typeof n=="number"?m=Tt(e,st(e,n)):f=Zt(n),f==null?null:(l(m,f)&&e.cm&&qn(e.cm,f,u),m)}function yo(e){this.lines=e,this.parent=null;for(var n=0,u=0;u<e.length;++u)e[u].parent=this,n+=e[u].height;this.height=n}yo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var u=e,l=e+n;u<l;++u){var f=this.lines[u];this.height-=f.height,Wi(f),ir(f,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,u){for(var l=e+n;e<l;++e)if(u(this.lines[e]))return!0}};function mo(e){this.children=e;for(var n=0,u=0,l=0;l<e.length;++l){var f=e[l];n+=f.chunkSize(),u+=f.height,f.parent=this}this.size=n,this.height=u,this.parent=null}mo.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var u=0;u<this.children.length;++u){var l=this.children[u],f=l.chunkSize();if(e<f){var m=Math.min(n,f-e),F=l.height;if(l.removeInner(e,m),this.height-=F-l.height,f==m&&(this.children.splice(u--,1),l.parent=null),(n-=m)==0)break;e=0}else e-=f}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof yo))){var U=[];this.collapse(U),this.children=[new yo(U)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,u){this.size+=n.length,this.height+=u;for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<=m){if(f.insertInner(e,n,u),f.lines&&f.lines.length>50){for(var F=f.lines.length%25+25,U=F;U<f.lines.length;){var H=new yo(f.lines.slice(U,U+=25));f.height-=H.height,this.children.splice(++l,0,H),H.parent=this}f.lines=f.lines.slice(0,F),this.maybeSpill()}break}e-=m}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var n=e.children.splice(e.children.length-5,5),u=new mo(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=ht(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new mo(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,n,u){for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<m){var F=Math.min(n,m-e);if(f.iterN(e,F,u))return!0;if((n-=F)==0)break;e=0}else e-=m}}};var qo=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};qo.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=Zt(u);if(!(l==null||!n)){for(var f=0;f<n.length;++f)n[f]==this&&n.splice(f--,1);n.length||(u.widgets=null);var m=Ot(this);An(u,Math.max(0,u.height-m)),e&&(Ur(e,function(){ul(e,u,-m),qn(e,l,"widget")}),ir(e,"lineWidgetCleared",e,this,l))}},qo.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=Ot(this)-n;!f||(ai(this.doc,l)||An(l,l.height+f),u&&Ur(u,function(){u.curOp.forceUpdate=!0,ul(u,l,f),ir(u,"lineWidgetChanged",u,e,Zt(l))}))},Ue(qo);function ul(e,n,u){si(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ys(e,u)}function cc(e,n,u,l){var f=new qo(e,u,l),m=e.cm;return m&&f.noHScroll&&(m.display.alignWidgets=!0),eo(e,n,"widget",function(F){var U=F.widgets||(F.widgets=[]);if(f.insertAt==null?U.push(f):U.splice(Math.min(U.length,Math.max(0,f.insertAt)),0,f),f.line=F,m&&!ai(e,F)){var H=si(F)<e.scrollTop;An(F,F.height+Ot(f)),H&&Ys(m,f.height),m.curOp.forceUpdate=!0}return!0}),m&&ir(m,"lineWidgetAdded",m,f,typeof n=="number"?n:Zt(n)),f}var Ka=0,ti=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Ka};ti.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Ti(e),Be(this,"clear")){var u=this.find();u&&ir(this,"clear",u.from,u.to)}for(var l=null,f=null,m=0;m<this.lines.length;++m){var F=this.lines[m],U=Po(F.markedSpans,this);e&&!this.collapsed?qn(e,Zt(F),"text"):e&&(U.to!=null&&(f=Zt(F)),U.from!=null&&(l=Zt(F))),F.markedSpans=jf(F.markedSpans,U),U.from==null&&this.collapsed&&!ai(this.doc,F)&&e&&An(F,uo(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var H=0;H<this.lines.length;++H){var Z=Wn(this.lines[H]),be=ji(Z);be>e.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Rr(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Lu(e.doc)),e&&ir(e,"markerCleared",e,this,l,f),n&&Pi(e),this.parent&&this.parent.clear()}},ti.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,f=0;f<this.lines.length;++f){var m=this.lines[f],F=Po(m.markedSpans,this);if(F.from!=null&&(u=ot(n?m:Zt(m),F.from),e==-1))return u;if(F.to!=null&&(l=ot(n?m:Zt(m),F.to),e==1))return l}return u&&{from:u,to:l}},ti.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||Ur(l,function(){var f=n.line,m=Zt(n.line),F=Rs(l,m);if(F&&(Ns(F),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!ai(u.doc,f)&&u.height!=null){var U=u.height;u.height=null;var H=Ot(u)-U;H&&An(f,f.height+H)}ir(l,"markerChanged",l,e)})},ti.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ht(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ti.prototype.detachLine=function(e){if(this.lines.splice(ht(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Ue(ti);function to(e,n,u,l,f){if(l&&l.shared)return dc(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return jr(e.cm,to)(e,n,u,l,f);var m=new ti(e,f),F=Lt(n,u);if(l&&Ze(l,m,!1),F>0||F==0&&m.clearWhenEmpty!==!1)return m;if(m.replacedWith&&(m.collapsed=!0,m.widgetNode=he("span",[m.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||m.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(m.widgetNode.insertLeft=!0)),m.collapsed){if(xa(e,n.line,n,u,m)||n.line!=u.line&&xa(e,u.line,n,u,m))throw new Error("Inserting collapsed marker partially overlapping an existing one");Uf()}m.addToHistory&&Iu(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var U=n.line,H=e.cm,Z;if(e.iter(U,u.line+1,function(Ce){H&&m.collapsed&&!H.options.lineWrapping&&Wn(Ce)==H.display.maxLine&&(Z=!0),m.collapsed&&U!=n.line&&An(Ce,0),Id(Ce,new ma(m,U==n.line?n.ch:null,U==u.line?u.ch:null),e.cm&&e.cm.curOp),++U}),m.collapsed&&e.iter(n.line,u.line+1,function(Ce){ai(e,Ce)&&An(Ce,0)}),m.clearOnEnter&&N(m,"beforeCursorEnter",function(){return m.clear()}),m.readOnly&&(Bf(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),m.collapsed&&(m.id=++Ka,m.atomic=!0),H){if(Z&&(H.curOp.updateMaxLine=!0),m.collapsed)Rr(H,n.line,u.line+1);else if(m.className||m.startStyle||m.endStyle||m.css||m.attributes||m.title)for(var be=n.line;be<=u.line;be++)qn(H,be,"text");m.atomic&&Lu(H.doc),ir(H,"markerAdded",H,m)}return m}var xo=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};xo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ir(this,"clear")}},xo.prototype.find=function(e,n){return this.primary.find(e,n)},Ue(xo);function dc(e,n,u,l,f){l=Ze(l),l.shared=!1;var m=[to(e,n,u,l,f)],F=m[0],U=l.widgetNode;return ki(e,function(H){U&&(l.widgetNode=U.cloneNode(!0)),m.push(to(H,lt(H,n),lt(H,u),l,f));for(var Z=0;Z<H.linked.length;++Z)if(H.linked[Z].isParent)return;F=Ct(m)}),new xo(m,F)}function Uu(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),function(n){return n.parent})}function fl(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),m=e.clipPos(f.from),F=e.clipPos(f.to);if(Lt(m,F)){var U=to(e,m,F,l.primary,l.primary.type);l.markers.push(U),U.parent=l}}}function pc(e){for(var n=function(l){var f=e[l],m=[f.primary.doc];ki(f.primary.doc,function(H){return m.push(H)});for(var F=0;F<f.markers.length;F++){var U=f.markers[F];ht(m,U.doc)==-1&&(U.parent=null,f.markers.splice(F--,1))}},u=0;u<e.length;u++)n(u)}var hc=0,un=function(e,n,u,l,f){if(!(this instanceof un))return new un(e,n,u,l,f);u==null&&(u=0),mo.call(this,[new yo([new Vi("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var m=ot(u,0);this.sel=Ii(m),this.history=new Jo(null),this.id=++hc,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),tl(this,{from:m,to:m,text:e}),Xr(this,Ii(m),ut)};un.prototype=St(mo.prototype,{constructor:un,iter:function(e,n,u){u?this.iterN(e-this.first,n-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var u=0,l=0;l<n.length;++l)u+=n[l].height;this.insertInner(e-this.first,n,u)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Si(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:cr(function(e){var n=ot(this.first,0),u=this.first+this.size-1;vo(this,{from:n,to:ot(u,Tt(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ho(this.cm,0,0),Xr(this,Ii(n),ut)}),replaceRange:function(e,n,u,l){n=lt(this,n),u=u?lt(this,u):n,go(this,e,n,u,l)},getRange:function(e,n,u){var l=ii(this,lt(this,e),lt(this,n));return u===!1?l:u===""?l.join(""):l.join(u||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Zn(this,e))return Tt(this,e)},getLineNumber:function(e){return Zt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Tt(this,e)),Wn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return lt(this,e)},getCursor:function(e){var n=this.sel.primary(),u;return e==null||e=="head"?u=n.head:e=="anchor"?u=n.anchor:e=="end"||e=="to"||e===!1?u=n.to():u=n.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cr(function(e,n,u){il(this,lt(this,typeof e=="number"?ot(e,n||0):e),null,u)}),setSelection:cr(function(e,n,u){il(this,lt(this,e),lt(this,n||e),u)}),extendSelection:cr(function(e,n,u){Ha(this,lt(this,e),n&<(this,n),u)}),extendSelections:cr(function(e,n){ku(this,Xt(this,e),n)}),extendSelectionsBy:cr(function(e,n){var u=Wt(this.sel.ranges,e);ku(this,Xt(this,u),n)}),setSelections:cr(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new er(lt(this,e[f].anchor),lt(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),Xr(this,En(this.cm,l,n),u)}}),addSelection:cr(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new er(lt(this,e),lt(this,n||e))),Xr(this,En(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var n=this.sel.ranges,u,l=0;l<n.length;l++){var f=ii(this,n[l].from(),n[l].to());u=u?u.concat(f):f}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],u=this.sel.ranges,l=0;l<u.length;l++){var f=ii(this,u[l].from(),u[l].to());e!==!1&&(f=f.join(e||this.lineSeparator())),n[l]=f}return n},replaceSelection:function(e,n,u){for(var l=[],f=0;f<this.sel.ranges.length;f++)l[f]=e;this.replaceSelections(l,n,u||"+input")},replaceSelections:cr(function(e,n,u){for(var l=[],f=this.sel,m=0;m<f.ranges.length;m++){var F=f.ranges[m];l[m]={from:F.from(),to:F.to(),text:this.splitLines(e[m]),origin:u}}for(var U=n&&n!="end"&&ac(this,l,n),H=l.length-1;H>=0;H--)vo(this,l[H]);U?Mu(this,U):this.cm&&rn(this.cm)}),undo:cr(function(){Fn(this,"undo")}),redo:cr(function(){Fn(this,"redo")}),undoSelection:cr(function(){Fn(this,"undo",!0)}),redoSelection:cr(function(){Fn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++u;return{undo:n,redo:u}},clearHistory:function(){var e=this;this.history=new Jo(this.history),ki(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:po(this.history.done),undone:po(this.history.undone)}},setHistory:function(e){var n=this.history=new Jo(this.history);n.done=po(e.done.slice(0),null,!0),n.undone=po(e.undone.slice(0),null,!0)},setGutterMarker:cr(function(e,n,u){return eo(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&$(f)&&(l.gutterMarkers=null),!0})}),clearGutter:cr(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&eo(n,u,"gutter",function(){return u.gutterMarkers[e]=null,$(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Zn(this,e)||(n=e,e=Tt(this,e),!e))return null}else if(n=Zt(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:cr(function(e,n,u){return eo(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[f])l[f]=u;else{if(ce(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:cr(function(e,n,u){return eo(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",m=l[f];if(m)if(u==null)l[f]=null;else{var F=m.match(ce(u));if(!F)return!1;var U=F.index+F[0].length;l[f]=m.slice(0,F.index)+(!F.index||U==m.length?"":" ")+m.slice(U)||null}else return!1;return!0})}),addLineWidget:cr(function(e,n,u){return cc(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return to(this,lt(this,e),lt(this,n),u,u&&u.type||"range")},setBookmark:function(e,n){var u={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=lt(this,e),to(this,e,e,u,"bookmark")},findMarksAt:function(e){e=lt(this,e);var n=[],u=Tt(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var f=u[l];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&n.push(f.marker.parent||f.marker)}return n},findMarks:function(e,n,u){e=lt(this,e),n=lt(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(m){var F=m.markedSpans;if(F)for(var U=0;U<F.length;U++){var H=F[U];!(H.to!=null&&f==e.line&&e.ch>=H.to||H.from==null&&f!=e.line||H.from!=null&&f==n.line&&H.from>=n.ch)&&(!u||u(H.marker))&&l.push(H.marker.parent||H.marker)}++f}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var u=n.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var n,u=this.first,l=this.lineSeparator().length;return this.iter(function(f){var m=f.text.length+l;if(m>e)return n=e,!0;e-=m,++u}),lt(this,ot(u,n))},indexFromPos:function(e){e=lt(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+u}),n},copy:function(e){var n=new un(Si(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,u=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new un(Si(this,n,u),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],fl(l,Uu(this)),l},unlinkDoc:function(e){if(e instanceof dr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var u=this.linked[n];if(u.doc==e){this.linked.splice(n,1),e.unlinkDoc(this),pc(Uu(this));break}}if(e.history==this.history){var l=[e.id];ki(e,function(f){return l.push(f.id)},!0),e.history=new Jo(null),e.history.done=po(this.history.done,l),e.history.undone=po(this.history.undone,l)}},iterLinkedDocs:function(e){ki(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Bn(e)},lineSeparator:function(){return this.lineSep||`
|
|
28
|
+
`},setDirection:cr(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&Yo(this.cm))})}),un.prototype.eachLine=un.prototype.iter;var ju=0;function vc(e){var n=this;if(Vu(n),!(pe(n,e)||li(n.display,e))){Qe(e),b&&(ju=+new Date);var u=Ki(n,e,!0),l=e.dataTransfer.files;if(!(!u||n.isReadOnly()))if(l&&l.length&&window.FileReader&&window.File)for(var f=l.length,m=Array(f),F=0,U=function(){++F==f&&jr(n,function(){u=lt(n.doc,u);var ke={from:u,to:u,text:n.doc.splitLines(m.filter(function(Ye){return Ye!=null}).join(n.doc.lineSeparator())),origin:"paste"};vo(n.doc,ke),Mu(n.doc,Ii(lt(n.doc,u),lt(n.doc,Fi(ke))))})()},H=function(ke,Ye){if(n.options.allowDropFileTypes&&ht(n.options.allowDropFileTypes,ke.type)==-1){U();return}var tt=new FileReader;tt.onerror=function(){return U()},tt.onload=function(){var at=tt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){U();return}m[Ye]=at,U()},tt.readAsText(ke)},Z=0;Z<l.length;Z++)H(l[Z],Z);else{if(n.state.draggingText&&n.doc.sel.contains(u)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var Ce;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ce=n.listSelections()),Ga(n.doc,Ii(u,u)),Ce)for(var De=0;De<Ce.length;++De)go(n.doc,"",Ce[De].anchor,Ce[De].head,"drag");n.replaceSelection(be,"around","paste"),n.display.input.focus()}}catch(ke){}}}}function gc(e,n){if(b&&(!e.state.draggingText||+new Date-ju<100)){Bt(n);return}if(!(pe(e,n)||li(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!j)){var u=we("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),B&&u.parentNode.removeChild(u)}}function yc(e,n){var u=Ki(e,n);if(!!u){var l=document.createDocumentFragment();Hs(e,u,l),e.display.dragCursor||(e.display.dragCursor=we("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),xe(e.display.dragCursor,l)}}function Vu(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ya(e){if(!!document.getElementsByClassName){for(var n=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<n.length;l++){var f=n[l].CodeMirror;f&&u.push(f)}u.length&&u[0].operation(function(){for(var m=0;m<u.length;m++)e(u[m])})}}var ea=!1;function Wu(){ea||(mc(),ea=!0)}function mc(){var e;N(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ya(xc)},100))}),N(window,"blur",function(){return Ya(fo)})}function xc(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var xn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ta=0;ta<10;ta++)xn[ta+48]=xn[ta+96]=String(ta);for(var ra=65;ra<=90;ra++)xn[ra]=String.fromCharCode(ra);for(var bo=1;bo<=12;bo++)xn[bo+111]=xn[bo+63235]="F"+bo;var ri={};ri.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"},ri.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"},ri.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"},ri.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"]},ri.default=C?ri.macDefault:ri.pcDefault;function Hu(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,m,F=0;F<n.length-1;F++){var U=n[F];if(/^(cmd|meta|m)$/i.test(U))m=!0;else if(/^a(lt)?$/i.test(U))u=!0;else if(/^(c|ctrl|control)$/i.test(U))l=!0;else if(/^s(hift)?$/i.test(U))f=!0;else throw new Error("Unrecognized modifier name: "+U)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),m&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function Rd(e){var n={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var f=Wt(u.split(" "),Hu),m=0;m<f.length;m++){var F=void 0,U=void 0;m==f.length-1?(U=f.join(" "),F=l):(U=f.slice(0,m+1).join(" "),F="...");var H=n[U];if(!H)n[U]=F;else if(H!=F)throw new Error("Inconsistent bindings for "+U)}delete e[u]}for(var Z in n)e[Z]=n[Z];return e}function pi(e,n,u,l){n=Ja(n);var f=n.call?n.call(e,l):n[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&u(f))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return pi(e,n.fallthrough,u,l);for(var m=0;m<n.fallthrough.length;m++){var F=pi(e,n.fallthrough[m],u,l);if(F)return F}}}function zu(e){var n=typeof e=="string"?e:xn[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function cl(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(Q?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(Q?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Gu(e,n){if(B&&e.keyCode==34&&e.char)return!1;var u=xn[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),cl(u,e,n))}function Ja(e){return typeof e=="string"?ri[e]:e}function ro(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var m=n(u[f]);l.length&&Lt(m.from,Ct(l).to)<=0;){var F=l.pop();if(Lt(F.from,m.from)<0){m.from=F.from;break}}l.push(m)}Ur(e,function(){for(var U=l.length-1;U>=0;U--)go(e.doc,"",l[U].from,l[U].to,"+delete");rn(e)})}function Xa(e,n,u){var l=$e(e.text,n+u,u);return l<0||l>e.text.length?null:l}function Qa(e,n,u){var l=Xa(e,n.ch,u);return l==null?null:new ot(n.line,l,u<0?"after":"before")}function dl(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var m=O(u,n.doc.direction);if(m){var F=f<0?Ct(m):m[0],U=f<0==(F.level==1),H=U?"after":"before",Z;if(F.level>0||n.doc.direction=="rtl"){var be=_n(n,u);Z=f<0?u.text.length-1:0;var Ce=Hn(n,be,Z).top;Z=Ke(function(De){return Hn(n,be,De).top==Ce},f<0==(F.level==1)?F.from:F.to-1,Z),H=="before"&&(Z=Xa(u,Z,1))}else Z=f<0?F.to:F.from;return new ot(l,Z,H)}}return new ot(l,f<0?u.text.length:0,f<0?"before":"after")}function $u(e,n,u,l){var f=O(n,e.doc.direction);if(!f)return Qa(n,u,l);u.ch>=n.text.length?(u.ch=n.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var m=K(f,u.ch,u.sticky),F=f[m];if(e.doc.direction=="ltr"&&F.level%2==0&&(l>0?F.to>u.ch:F.from<u.ch))return Qa(n,u,l);var U=function(ct,gt){return Xa(n,ct instanceof ot?ct.ch:ct,gt)},H,Z=function(ct){return e.options.lineWrapping?(H=H||_n(e,n),uu(e,n,H,ct)):{begin:0,end:n.text.length}},be=Z(u.sticky=="before"?U(u,-1):u.ch);if(e.doc.direction=="rtl"||F.level==1){var Ce=F.level==1==l<0,De=U(u,Ce?1:-1);if(De!=null&&(Ce?De<=F.to&&De<=be.end:De>=F.from&&De>=be.begin)){var ke=Ce?"before":"after";return new ot(u.line,De,ke)}}var Ye=function(ct,gt,dt){for(var xt=function(Gt,hr){return hr?new ot(u.line,U(Gt,1),"before"):new ot(u.line,Gt,"after")};ct>=0&&ct<f.length;ct+=gt){var Ft=f[ct],It=gt>0==(Ft.level!=1),it=It?dt.begin:U(dt.end,-1);if(Ft.from<=it&&it<Ft.to||(it=It?Ft.from:U(Ft.to,-1),dt.begin<=it&&it<dt.end))return xt(it,It)}},tt=Ye(m+l,l,be);if(tt)return tt;var at=l>0?be.end:U(be.begin,-1);return at!=null&&!(l>0&&at==n.text.length)&&(tt=Ye(l>0?0:f.length-1,l,Z(at)),tt)?tt:null}var na={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ut)},killLine:function(e){return ro(e,function(n){if(n.empty()){var u=Tt(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:ot(n.head.line+1,0)}:{from:n.head,to:ot(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ro(e,function(n){return{from:ot(n.from().line,0),to:lt(e.doc,ot(n.to().line+1,0))}})},delLineLeft:function(e){return ro(e,function(n){return{from:ot(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ro(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return ro(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return wo(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Za(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return bc(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},mt)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},mt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Za(e,n.head):l},mt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],u=e.listSelections(),l=e.options.tabSize,f=0;f<u.length;f++){var m=u[f].from(),F=Xe(e.getLine(m.line),m.ch,l);n.push(kt(l-F%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ur(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,m=Tt(e.doc,f.line).text;if(m){if(f.ch==m.length&&(f=new ot(f.line,f.ch-1)),f.ch>0)f=new ot(f.line,f.ch+1),e.replaceRange(m.charAt(f.ch-1)+m.charAt(f.ch-2),ot(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var F=Tt(e.doc,f.line-1).text;F&&(f=new ot(f.line,1),e.replaceRange(m.charAt(0)+e.doc.lineSeparator()+F.charAt(F.length-1),ot(f.line-1,F.length-1),f,"+transpose"))}}u.push(new er(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return Ur(e,function(){for(var n=e.listSelections(),u=n.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),n[u].anchor,n[u].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);rn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
29
|
+
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function wo(e,n){var u=Tt(e.doc,n),l=Wn(u);return l!=u&&(n=Zt(l)),dl(!0,e,l,n,1)}function bc(e,n){var u=Tt(e.doc,n),l=Ql(u);return l!=u&&(n=Zt(l)),dl(!0,e,u,n,-1)}function Za(e,n){var u=wo(e,n.line),l=Tt(e.doc,u.line),f=O(l,e.doc.direction);if(!f||f[0].level==0){var m=Math.max(u.ch,l.text.search(/\S/)),F=n.line==u.line&&n.ch<=m&&n.ch;return ot(u.line,F?0:m,u.sticky)}return u}function _a(e,n,u){if(typeof n=="string"&&(n=na[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),f=n(e)!=nt}finally{e.display.shift=l,e.state.suppressEdits=!1}return f}function wc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=pi(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&pi(n,e.options.extraKeys,u,e)||pi(n,e.options.keyMap,u,e)}var qa=new ft;function ia(e,n,u,l){var f=e.state.keySeq;if(f){if(zu(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:qa.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),Sc(e,f+" "+n,u,l))return!0}return Sc(e,n,u,l)}function Sc(e,n,u,l){var f=wc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&ir(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(Qe(u),zs(e)),!!f}function Ku(e,n){var u=Gu(n,!0);return u?n.shiftKey&&!e.state.keySeq?ia(e,"Shift-"+u,n,function(l){return _a(e,l,!0)})||ia(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return _a(e,l)}):ia(e,u,n,function(l){return _a(e,l)}):!1}function Ac(e,n,u){return ia(e,"'"+u+"'",n,function(l){return _a(e,l,!0)})}var es=null;function Yu(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=Fe(),!pe(n,e))){b&&S<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=Ku(n,e);B&&(es=l?u:null,!l&&u==88&&!Tn&&(C?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!C&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Ec(n)}}function Ec(e){var n=e.display.lineDiv;Le(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(ee(n,"CodeMirror-crosshair"),de(document,"keyup",u),de(document,"mouseover",u))}N(document,"keyup",u),N(document,"mouseover",u)}function Ju(e){e.keyCode==16&&(this.doc.sel.shift=!1),pe(this,e)}function pl(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(li(n.display,e)||pe(n,e)||e.ctrlKey&&!e.altKey||C&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(B&&u==es){es=null,Qe(e);return}if(!(B&&(!e.which||e.which<10)&&Ku(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(Ac(n,e,f)||n.display.input.onKeyPress(e))}}}var Cc=400,hl=function(e,n,u){this.time=e,this.pos=n,this.button=u};hl.prototype.compare=function(e,n,u){return this.time+Cc>e&&Lt(n,this.pos)==0&&u==this.button};var oa,aa;function Oc(e,n){var u=+new Date;return aa&&aa.compare(u,e,n)?(oa=aa=null,"triple"):oa&&oa.compare(u,e,n)?(aa=new hl(u,e,n),oa=null,"double"):(oa=new hl(u,e,n),aa=null,"single")}function Xu(e){var n=this,u=n.display;if(!(pe(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,li(u,e)){g||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!vl(n,e)){var l=Ki(n,e),f=pn(e),m=l?Oc(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&Tc(n,f,l,m,e))&&(f==1?l?Ic(n,l,m,e):Pt(e)==u.scroller&&Qe(e):f==2?(l&&Ha(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(Y?n.display.input.onContextMenu(e):Vo(n)))}}}function Tc(e,n,u,l,f){var m="Click";return l=="double"?m="Double"+m:l=="triple"&&(m="Triple"+m),m=(n==1?"Left":n==2?"Middle":"Right")+m,ia(e,cl(m,f),f,function(F){if(typeof F=="string"&&(F=na[F]),!F)return!1;var U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),U=F(e,u)!=nt}finally{e.state.suppressEdits=!1}return U})}function Pc(e,n,u){var l=e.getOption("configureMouse"),f=l?l(e,n,u):{};if(f.unit==null){var m=V?u.shiftKey&&u.metaKey:u.altKey;f.unit=m?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||u.shiftKey),f.addNew==null&&(f.addNew=C?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(C?u.altKey:u.ctrlKey)),f}function Ic(e,n,u,l){b?setTimeout(rt(Gs,e),0):e.curOp.focus=Fe();var f=Pc(e,u,l),m=e.doc.sel,F;e.options.dragDrop&&Nr&&!e.isReadOnly()&&u=="single"&&(F=m.contains(n))>-1&&(Lt((F=m.ranges[F]).from(),n)<0||n.xRel>0)&&(Lt(F.to(),n)>0||n.xRel<0)?ts(e,l,n,f):Fc(e,l,n,f)}function ts(e,n,u,l){var f=e.display,m=!1,F=jr(e,function(Z){g&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Vo(e)),de(f.wrapper.ownerDocument,"mouseup",F),de(f.wrapper.ownerDocument,"mousemove",U),de(f.scroller,"dragstart",H),de(f.scroller,"drop",F),m||(Qe(Z),l.addNew||Ha(e.doc,u,null,null,l.extend),g&&!j||b&&S==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),U=function(Z){m=m||Math.abs(n.clientX-Z.clientX)+Math.abs(n.clientY-Z.clientY)>=10},H=function(){return m=!0};g&&(f.scroller.draggable=!0),e.state.draggingText=F,F.copy=!l.moveOnDrag,N(f.wrapper.ownerDocument,"mouseup",F),N(f.wrapper.ownerDocument,"mousemove",U),N(f.scroller,"dragstart",H),N(f.scroller,"drop",F),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function Qu(e,n,u){if(u=="char")return new er(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new er(ot(n.line,0),lt(e.doc,ot(n.line+1,0)));var l=u(e,n);return new er(l.from,l.to)}function Fc(e,n,u,l){b&&Vo(e);var f=e.display,m=e.doc;Qe(n);var F,U,H=m.sel,Z=H.ranges;if(l.addNew&&!l.extend?(U=m.sel.contains(u),U>-1?F=Z[U]:F=new er(u,u)):(F=m.sel.primary(),U=m.sel.primIndex),l.unit=="rectangle")l.addNew||(F=new er(u,u)),u=Ki(e,n,!0,!0),U=-1;else{var be=Qu(e,u,l.unit);l.extend?F=nl(F,be.anchor,be.head,l.extend):F=be}l.addNew?U==-1?(U=Z.length,Xr(m,En(e,Z.concat([F]),U),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[U].empty()&&l.unit=="char"&&!l.extend?(Xr(m,En(e,Z.slice(0,U).concat(Z.slice(U+1)),0),{scroll:!1,origin:"*mouse"}),H=m.sel):za(m,U,F,yt):(U=0,Xr(m,new mn([F],0),yt),H=m.sel);var Ce=u;function De(dt){if(Lt(Ce,dt)!=0)if(Ce=dt,l.unit=="rectangle"){for(var xt=[],Ft=e.options.tabSize,It=Xe(Tt(m,u.line).text,u.ch,Ft),it=Xe(Tt(m,dt.line).text,dt.ch,Ft),Gt=Math.min(It,it),hr=Math.max(It,it),vr=Math.min(u.line,dt.line),bn=Math.min(e.lastLine(),Math.max(u.line,dt.line));vr<=bn;vr++){var fn=Tt(m,vr).text,Ar=pt(fn,Gt,Ft);Gt==hr?xt.push(new er(ot(vr,Ar),ot(vr,Ar))):fn.length>Ar&&xt.push(new er(ot(vr,Ar),ot(vr,pt(fn,hr,Ft))))}xt.length||xt.push(new er(u,u)),Xr(m,En(e,H.ranges.slice(0,U).concat(xt),U),{origin:"*mouse",scroll:!1}),e.scrollIntoView(dt)}else{var cn=F,Kr=Qu(e,dt,l.unit),Fr=cn.anchor,gr;Lt(Kr.anchor,Fr)>0?(gr=Kr.head,Fr=qe(cn.from(),Kr.anchor)):(gr=Kr.anchor,Fr=Oe(cn.to(),Kr.head));var yr=H.ranges.slice(0);yr[U]=kc(e,new er(lt(m,Fr),gr)),Xr(m,En(e,yr,U),yt)}}var ke=f.wrapper.getBoundingClientRect(),Ye=0;function tt(dt){var xt=++Ye,Ft=Ki(e,dt,!0,l.unit=="rectangle");if(!!Ft)if(Lt(Ft,Ce)!=0){e.curOp.focus=Fe(),De(Ft);var It=Wo(f,m);(Ft.line>=It.to||Ft.line<It.from)&&setTimeout(jr(e,function(){Ye==xt&&tt(dt)}),150)}else{var it=dt.clientY<ke.top?-20:dt.clientY>ke.bottom?20:0;it&&setTimeout(jr(e,function(){Ye==xt&&(f.scroller.scrollTop+=it,tt(dt))}),50)}}function at(dt){e.state.selectingText=!1,Ye=1/0,dt&&(Qe(dt),f.input.focus()),de(f.wrapper.ownerDocument,"mousemove",ct),de(f.wrapper.ownerDocument,"mouseup",gt),m.history.lastSelOrigin=null}var ct=jr(e,function(dt){dt.buttons===0||!pn(dt)?at(dt):tt(dt)}),gt=jr(e,at);e.state.selectingText=gt,N(f.wrapper.ownerDocument,"mousemove",ct),N(f.wrapper.ownerDocument,"mouseup",gt)}function kc(e,n){var u=n.anchor,l=n.head,f=Tt(e.doc,u.line);if(Lt(u,l)==0&&u.sticky==l.sticky)return n;var m=O(f);if(!m)return n;var F=K(m,u.ch,u.sticky),U=m[F];if(U.from!=u.ch&&U.to!=u.ch)return n;var H=F+(U.from==u.ch==(U.level!=1)?0:1);if(H==0||H==m.length)return n;var Z;if(l.line!=u.line)Z=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=K(m,l.ch,l.sticky),Ce=be-F||(l.ch-u.ch)*(U.level==1?-1:1);be==H-1||be==H?Z=Ce<0:Z=Ce>0}var De=m[H+(Z?-1:0)],ke=Z==(De.level==1),Ye=ke?De.from:De.to,tt=ke?"after":"before";return u.ch==Ye&&u.sticky==tt?n:new er(new ot(u.line,Ye,tt),l)}function Zu(e,n,u,l){var f,m;if(n.touches)f=n.touches[0].clientX,m=n.touches[0].clientY;else try{f=n.clientX,m=n.clientY}catch(De){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&Qe(n);var F=e.display,U=F.lineDiv.getBoundingClientRect();if(m>U.bottom||!Be(e,u))return Et(n);m-=U.top-F.viewOffset;for(var H=0;H<e.display.gutterSpecs.length;++H){var Z=F.gutters.childNodes[H];if(Z&&Z.getBoundingClientRect().right>=f){var be=Vn(e.doc,m),Ce=e.display.gutterSpecs[H];return oe(e,u,e,be,Ce.className,n),Et(n)}}}function vl(e,n){return Zu(e,n,"gutterClick",!0)}function _u(e,n){li(e.display,n)||qu(e,n)||pe(e,n,"contextmenu")||Y||e.display.input.onContextMenu(n)}function qu(e,n){return Be(e,"gutterContextMenu")?Zu(e,n,"gutterContextMenu",!1):!1}function ef(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),No(e)}var So={toString:function(){return"CodeMirror.Init"}},tf={},rs={};function rf(e){var n=e.optionHandlers;function u(l,f,m,F){e.defaults[l]=f,m&&(n[l]=F?function(U,H,Z){Z!=So&&m(U,H,Z)}:m)}e.defineOption=u,e.Init=So,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,Ua(l)},!0),u("indentUnit",2,Ua,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){_i(l),No(l),Rr(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var m=[],F=l.doc.first;l.doc.iter(function(H){for(var Z=0;;){var be=H.text.indexOf(f,Z);if(be==-1)break;Z=be+f.length,m.push(ot(F,be))}F++});for(var U=m.length-1;U>=0;U--)go(l.doc,f,m[U],ot(m[U].line,m[U].ch+f.length))}}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,f,m){l.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),m!=So&&l.refresh()}),u("specialCharPlaceholder",Ts,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",R?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,f){return l.getInputField().spellcheck=f},!0),u("autocorrect",!1,function(l,f){return l.getInputField().autocorrect=f},!0),u("autocapitalize",!1,function(l,f){return l.getInputField().autocapitalize=f},!0),u("rtlMoveVisually",!J),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){ef(l),Na(l)},!0),u("keyMap","default",function(l,f,m){var F=Ja(f),U=m!=So&&Ja(m);U&&U.detach&&U.detach(l,F),F.attach&&F.attach(l,U||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Rc,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=Ko(f,l.options.lineNumbers),Na(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?In(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return fi(l)},!0),u("scrollbarStyle","native",function(l){La(l),fi(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,f){l.display.gutterSpecs=Ko(l.options.gutters,f),Na(l)},!0),u("firstLineNumber",1,Na,!0),u("lineNumberFormatter",function(l){return l},Na,!0),u("showCursorWhenSelecting",!1,Oi,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(fo(l),l.display.input.blur()),l.display.input.readOnlyChanged(f)}),u("screenReaderLabel",null,function(l,f){f=f===""?null:f,l.display.input.screenReaderLabelChanged(f)}),u("disableInput",!1,function(l,f){f||l.display.input.reset()},!0),u("dragDrop",!0,Mc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Oi,!0),u("singleCursorHeightPerLine",!0,Oi,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,_i,!0),u("addModeClass",!1,_i,!0),u("pollInterval",100),u("undoDepth",200,function(l,f){return l.doc.history.undoDepth=f}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,_i,!0),u("moveInputWithCursor",!0,function(l,f){f||l.display.input.resetPosition()}),u("tabindex",null,function(l,f){return l.display.input.getField().tabIndex=f||""}),u("autofocus",null),u("direction","ltr",function(l,f){return l.doc.setDirection(f)},!0),u("phrases",null)}function Mc(e,n,u){var l=u&&u!=So;if(!n!=!l){var f=e.display.dragFunctions,m=n?N:de;m(e.display.scroller,"dragstart",f.start),m(e.display.scroller,"dragenter",f.enter),m(e.display.scroller,"dragover",f.over),m(e.display.scroller,"dragleave",f.leave),m(e.display.scroller,"drop",f.drop)}}function Rc(e){e.options.lineWrapping?(Le(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ee(e.display.wrapper,"CodeMirror-wrap"),As(e)),Ws(e),Rr(e),No(e),setTimeout(function(){return fi(e)},100)}function dr(e,n){var u=this;if(!(this instanceof dr))return new dr(e,n);this.options=n=n?Ze(n):{},Ze(tf,n,!1);var l=n.value;typeof l=="string"?l=new un(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new dr.inputStyles[n.inputStyle](this),m=this.display=new oc(e,l,f,n);m.wrapper.CodeMirror=this,ef(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),La(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 ft,keySeq:null,specialChars:null},n.autofocus&&!R&&m.input.focus(),b&&S<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Lc(this),Wu(),Ti(this),this.curOp.forceUpdate=!0,Ou(this,l),n.autofocus&&!R||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Fa(u)},20):fo(this);for(var F in rs)rs.hasOwnProperty(F)&&rs[F](this,n[F],So);Da(this),n.finishInit&&n.finishInit(this);for(var U=0;U<gl.length;++U)gl[U](this);Pi(this),g&&n.lineWrapping&&getComputedStyle(m.lineDiv).textRendering=="optimizelegibility"&&(m.lineDiv.style.textRendering="auto")}dr.defaults=tf,dr.optionHandlers=rs;function Lc(e){var n=e.display;N(n.scroller,"mousedown",jr(e,Xu)),b&&S<11?N(n.scroller,"dblclick",jr(e,function(H){if(!pe(e,H)){var Z=Ki(e,H);if(!(!Z||vl(e,H)||li(e.display,H))){Qe(H);var be=e.findWordAt(Z);Ha(e.doc,be.anchor,be.head)}}})):N(n.scroller,"dblclick",function(H){return pe(e,H)||Qe(H)}),N(n.scroller,"contextmenu",function(H){return _u(e,H)}),N(n.input.getField(),"contextmenu",function(H){n.scroller.contains(H.target)||_u(e,H)});var u,l={end:0};function f(){n.activeTouch&&(u=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function m(H){if(H.touches.length!=1)return!1;var Z=H.touches[0];return Z.radiusX<=1&&Z.radiusY<=1}function F(H,Z){if(Z.left==null)return!0;var be=Z.left-H.left,Ce=Z.top-H.top;return be*be+Ce*Ce>20*20}N(n.scroller,"touchstart",function(H){if(!pe(e,H)&&!m(H)&&!vl(e,H)){n.input.ensurePolled(),clearTimeout(u);var Z=+new Date;n.activeTouch={start:Z,moved:!1,prev:Z-l.end<=300?l:null},H.touches.length==1&&(n.activeTouch.left=H.touches[0].pageX,n.activeTouch.top=H.touches[0].pageY)}}),N(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),N(n.scroller,"touchend",function(H){var Z=n.activeTouch;if(Z&&!li(n,H)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var be=e.coordsChar(n.activeTouch,"page"),Ce;!Z.prev||F(Z,Z.prev)?Ce=new er(be,be):!Z.prev.prev||F(Z,Z.prev.prev)?Ce=e.findWordAt(be):Ce=new er(ot(be.line,0),lt(e.doc,ot(be.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),Qe(H)}f()}),N(n.scroller,"touchcancel",f),N(n.scroller,"scroll",function(){n.scroller.clientHeight&&(zo(e,n.scroller.scrollTop),Xi(e,n.scroller.scrollLeft,!0),oe(e,"scroll",e))}),N(n.scroller,"mousewheel",function(H){return Au(e,H)}),N(n.scroller,"DOMMouseScroll",function(H){return Au(e,H)}),N(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(H){pe(e,H)||Bt(H)},over:function(H){pe(e,H)||(yc(e,H),Bt(H))},start:function(H){return gc(e,H)},drop:jr(e,vc),leave:function(H){pe(e,H)||Vu(e)}};var U=n.input.getField();N(U,"keyup",function(H){return Ju.call(e,H)}),N(U,"keydown",jr(e,Yu)),N(U,"keypress",jr(e,pl)),N(U,"focus",function(H){return Fa(e,H)}),N(U,"blur",function(H){return fo(e,H)})}var gl=[];dr.defineInitHook=function(e){return gl.push(e)};function Ao(e,n,u,l){var f=e.doc,m;u==null&&(u="add"),u=="smart"&&(f.mode.indent?m=en(e,n).state:u="prev");var F=e.options.tabSize,U=Tt(f,n),H=Xe(U.text,null,F);U.stateAfter&&(U.stateAfter=null);var Z=U.text.match(/^\s*/)[0],be;if(!l&&!/\S/.test(U.text))be=0,u="not";else if(u=="smart"&&(be=f.mode.indent(m,U.text.slice(Z.length),U.text),be==nt||be>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?be=Xe(Tt(f,n-1).text,null,F):be=0:u=="add"?be=H+e.options.indentUnit:u=="subtract"?be=H-e.options.indentUnit:typeof u=="number"&&(be=H+u),be=Math.max(0,be);var Ce="",De=0;if(e.options.indentWithTabs)for(var ke=Math.floor(be/F);ke;--ke)De+=F,Ce+=" ";if(De<be&&(Ce+=kt(be-De)),Ce!=Z)return go(f,Ce,ot(n,0),ot(n,Z.length),"+input"),U.stateAfter=null,!0;for(var Ye=0;Ye<f.sel.ranges.length;Ye++){var tt=f.sel.ranges[Ye];if(tt.head.line==n&&tt.head.ch<Z.length){var at=ot(n,Z.length);za(f,Ye,new er(at,at));break}}}var Cn=null;function sa(e){Cn=e}function yl(e,n,u,l,f){var m=e.doc;e.display.shift=!1,l||(l=m.sel);var F=+new Date-200,U=f=="paste"||e.state.pasteIncoming>F,H=Bn(n),Z=null;if(U&&l.ranges.length>1)if(Cn&&Cn.text.join(`
|
|
30
30
|
`)==n){if(l.ranges.length%Cn.text.length==0){Z=[];for(var be=0;be<Cn.text.length;be++)Z.push(m.splitLines(Cn.text[be]))}}else H.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(Z=Wt(H,function(ct){return[ct]}));for(var Ce=e.curOp.updateInput,De=l.ranges.length-1;De>=0;De--){var ke=l.ranges[De],Ye=ke.from(),tt=ke.to();ke.empty()&&(u&&u>0?Ye=ot(Ye.line,Ye.ch-u):e.state.overwrite&&!U?tt=ot(tt.line,Math.min(Tt(m,tt.line).text.length,tt.ch+Ct(H).length)):U&&Cn&&Cn.lineWise&&Cn.text.join(`
|
|
31
31
|
`)==H.join(`
|
|
32
|
-
`)&&(Ye=tt=ot(Ye.line,0)));var at={from:Ye,to:tt,text:Z?Z[De%Z.length]:H,origin:f||(U?"paste":e.state.cutIncoming>F?"cut":"+input")};vo(e.doc,at),ir(e,"inputRead",e,at)}n&&!U&&nf(e,n),rn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function rf(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Ur(n,function(){return yl(n,u,0,null,"paste")}),!0}function nf(e,n){if(!(!e.options.electricChars||!e.options.smartIndent))for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var f=u.ranges[l];if(!(f.head.ch>100||l&&u.ranges[l-1].head.line==f.head.line)){var m=e.getModeAt(f.head),F=!1;if(m.electricChars){for(var U=0;U<m.electricChars.length;U++)if(n.indexOf(m.electricChars.charAt(U))>-1){F=Ao(e,f.head.line,"smart");break}}else m.electricInput&&m.electricInput.test(Tt(e.doc,f.head.line).text.slice(0,f.head.ch))&&(F=Ao(e,f.head.line,"smart"));F&&ir(e,"electricInput",e,f.head.line)}}}function of(e){for(var n=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var f=e.doc.sel.ranges[l].head.line,m={anchor:ot(f,0),head:ot(f+1,0)};u.push(m),n.push(e.getRange(m.anchor,m.head))}return{text:n,ranges:u}}function br(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function Dc(){var e=we("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=we("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),M&&(e.style.border="1px solid black"),br(e),n}function Nc(e){var n=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,f){var m=this.options,F=m[l];m[l]==f&&l!="mode"||(m[l]=f,n.hasOwnProperty(l)&&jr(this,n[l])(this,f,F),oe(this,"optionChange",this,l))},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,f){this.state.keyMaps[f?"push":"unshift"](Ja(l))},removeKeyMap:function(l){for(var f=this.state.keyMaps,m=0;m<f.length;++m)if(f[m]==l||f[m].name==l)return f.splice(m,1),!0},addOverlay:Lr(function(l,f){var m=l.token?l:e.getMode(this.options,l);if(m.startState)throw new Error("Overlays may not be stateful.");jt(this.state.overlays,{mode:m,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(F){return F.priority}),this.state.modeGen++,Rr(this)}),removeOverlay:Lr(function(l){for(var f=this.state.overlays,m=0;m<f.length;++m){var F=f[m].modeSpec;if(F==l||typeof l=="string"&&F.name==l){f.splice(m,1),this.state.modeGen++,Rr(this);return}}}),indentLine:Lr(function(l,f,m){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Zn(this.doc,l)&&Ao(this,l,f,m)}),indentSelection:Lr(function(l){for(var f=this.doc.sel.ranges,m=-1,F=0;F<f.length;F++){var U=f[F];if(U.empty())U.head.line>m&&(Ao(this,U.head.line,l,!0),m=U.head.line,F==this.doc.sel.primIndex&&rn(this));else{var H=U.from(),Z=U.to(),be=Math.max(m,H.line);m=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var Ce=be;Ce<m;++Ce)Ao(this,Ce,l);var De=this.doc.sel.ranges;H.ch==0&&f.length==De.length&&De[F].from().ch>0&&za(this.doc,F,new er(H,De[F].to()),ut)}}}),getTokenAt:function(l,f){return ms(this,l,f)},getLineTokens:function(l,f){return ms(this,ot(l),f,!0)},getTokenTypeAt:function(l){l=lt(this.doc,l);var f=Wl(this,Tt(this.doc,l.line)),m=0,F=(f.length-1)/2,U=l.ch,H;if(U==0)H=f[2];else for(;;){var Z=m+F>>1;if((Z?f[Z*2-1]:0)>=U)F=Z;else if(f[Z*2+1]<U)m=Z+1;else{H=f[Z*2+2];break}}var be=H?H.indexOf("overlay "):-1;return be<0?H:be==0?null:H.slice(0,be-1)},getModeAt:function(l){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(l).state).mode:f},getHelper:function(l,f){return this.getHelpers(l,f)[0]},getHelpers:function(l,f){var m=[];if(!u.hasOwnProperty(f))return m;var F=u[f],U=this.getModeAt(l);if(typeof U[f]=="string")F[U[f]]&&m.push(F[U[f]]);else if(U[f])for(var H=0;H<U[f].length;H++){var Z=F[U[f][H]];Z&&m.push(Z)}else U.helperType&&F[U.helperType]?m.push(F[U.helperType]):F[U.name]&&m.push(F[U.name]);for(var be=0;be<F._global.length;be++){var Ce=F._global[be];Ce.pred(U,this)&&ht(m,Ce.val)==-1&&m.push(Ce.val)}return m},getStateAfter:function(l,f){var m=this.doc;return l=st(m,l==null?m.first+m.size-1:l),en(this,l+1,f).state},cursorCoords:function(l,f){var m,F=this.doc.sel.primary();return l==null?m=F.head:typeof l=="object"?m=lt(this.doc,l):m=l?F.from():F.to(),zn(this,m,f||"page")},charCoords:function(l,f){return Ca(this,lt(this.doc,l),f||"page")},coordsChar:function(l,f){return l=jo(this,l,f||"page"),Us(this,l.left,l.top)},lineAtHeight:function(l,f){return l=jo(this,{top:l,left:0},f||"page").top,Vn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,m){var F=!1,U;if(typeof l=="number"){var H=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>H&&(l=H,F=!0),U=Tt(this.doc,l)}else U=l;return Ea(this,U,{top:0,left:0},f||"page",m||F).top+(F?this.doc.height-si(U):0)},defaultTextHeight:function(){return uo(this.display)},defaultCharWidth:function(){return Pn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,m,F,U){var H=this.display;l=zn(this,lt(this.doc,l));var Z=l.bottom,be=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),H.sizer.appendChild(f),F=="over")Z=l.top;else if(F=="above"||F=="near"){var Ce=Math.max(H.wrapper.clientHeight,this.doc.height),De=Math.max(H.sizer.clientWidth,H.lineSpace.clientWidth);(F=="above"||l.bottom+f.offsetHeight>Ce)&&l.top>f.offsetHeight?Z=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Ce&&(Z=l.bottom),be+f.offsetWidth>De&&(be=De-f.offsetWidth)}f.style.top=Z+"px",f.style.left=f.style.right="",U=="right"?(be=H.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(U=="left"?be=0:U=="middle"&&(be=(H.sizer.clientWidth-f.offsetWidth)/2),f.style.left=be+"px"),m&&du(this,{left:be,top:Z,right:be+f.offsetWidth,bottom:Z+f.offsetHeight})},triggerOnKeyDown:Lr(Ku),triggerOnKeyPress:Lr(pl),triggerOnKeyUp:Yu,triggerOnMouseDown:Lr(Ju),execCommand:function(l){if(na.hasOwnProperty(l))return na[l].call(null,this)},triggerElectric:Lr(function(l){nf(this,l)}),findPosH:function(l,f,m,F){var U=1;f<0&&(U=-1,f=-f);for(var H=lt(this.doc,l),Z=0;Z<f&&(H=zt(this.doc,H,U,m,F),!H.hitSide);++Z);return H},moveH:Lr(function(l,f){var m=this;this.extendSelectionsBy(function(F){return m.display.shift||m.doc.extend||F.empty()?zt(m.doc,F.head,l,f,m.options.rtlMoveVisually):l<0?F.from():F.to()},mt)}),deleteH:Lr(function(l,f){var m=this.doc.sel,F=this.doc;m.somethingSelected()?F.replaceSelection("",null,"+delete"):ro(this,function(U){var H=zt(F,U.head,l,f,!1);return l<0?{from:H,to:U.head}:{from:U.head,to:H}})}),findPosV:function(l,f,m,F){var U=1,H=F;f<0&&(U=-1,f=-f);for(var Z=lt(this.doc,l),be=0;be<f;++be){var Ce=zn(this,Z,"div");if(H==null?H=Ce.left:Ce.left=H,Z=ml(this,Ce,U,m),Z.hitSide)break}return Z},moveV:Lr(function(l,f){var m=this,F=this.doc,U=[],H=!this.display.shift&&!F.extend&&F.sel.somethingSelected();if(F.extendSelectionsBy(function(be){if(H)return l<0?be.from():be.to();var Ce=zn(m,be.head,"div");be.goalColumn!=null&&(Ce.left=be.goalColumn),U.push(Ce.left);var De=ml(m,Ce,l,f);return f=="page"&&be==F.sel.primary()&&Ys(m,Ca(m,De,"div").top-Ce.top),De},mt),U.length)for(var Z=0;Z<F.sel.ranges.length;Z++)F.sel.ranges[Z].goalColumn=U[Z]}),findWordAt:function(l){var f=this.doc,m=Tt(f,l.line).text,F=l.ch,U=l.ch;if(m){var H=this.getHelper(l,"wordChars");(l.sticky=="before"||U==m.length)&&F?--F:++U;for(var Z=m.charAt(F),be=z(Z,H)?function(Ce){return z(Ce,H)}:/\s/.test(Z)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!z(Ce)};F>0&&be(m.charAt(F-1));)--F;for(;U<m.length&&be(m.charAt(U));)++U}return new er(ot(l.line,F),ot(l.line,U))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Le(this.display.cursorDiv,"CodeMirror-overwrite"):ee(this.display.cursorDiv,"CodeMirror-overwrite"),oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Fe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Lr(function(l,f){Ho(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-ui(this)-this.display.barHeight,width:l.scrollWidth-ui(this)-this.display.barWidth,clientHeight:Do(this),clientWidth:zi(this)}},scrollIntoView:Lr(function(l,f){l==null?(l={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof l=="number"?l={from:ot(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=f||0,l.from.line!=null?Ji(this,l):pu(this,l.from,l.to,l.margin)}),setSize:Lr(function(l,f){var m=this,F=function(H){return typeof H=="number"||/^\d+$/.test(String(H))?H+"px":H};l!=null&&(this.display.wrapper.style.width=F(l)),f!=null&&(this.display.wrapper.style.height=F(f)),this.options.lineWrapping&&Gi(this);var U=this.display.viewFrom;this.doc.iter(U,this.display.viewTo,function(H){if(H.widgets){for(var Z=0;Z<H.widgets.length;Z++)if(H.widgets[Z].noHScroll){qn(m,U,"widget");break}}++U}),this.curOp.forceUpdate=!0,oe(this,"refresh",this)}),operation:function(l){return Ur(this,l)},startOperation:function(){return Ti(this)},endOperation:function(){return Pi(this)},refresh:Lr(function(){var l=this.display.cachedTextHeight;Rr(this),this.curOp.forceUpdate=!0,No(this),Ho(this,this.doc.scrollLeft,this.doc.scrollTop),_s(this.display),(l==null||Math.abs(l-uo(this.display))>.5||this.options.lineWrapping)&&Ws(this),oe(this,"refresh",this)}),swapDoc:Lr(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Cu(this,l),No(this),this.display.input.reset(),Ho(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,ir(this,"swapDoc",this,f),f}),phrase:function(l){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,l)?f[l]:l},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}},Ue(e),e.registerHelper=function(l,f,m){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][f]=m},e.registerGlobalHelper=function(l,f,m,F){e.registerHelper(l,f,F),u[l]._global.push({pred:m,val:F})}}function zt(e,n,u,l,f){var m=n,F=u,U=Tt(e,n.line),H=f&&e.direction=="rtl"?-u:u;function Z(){var gt=n.line+H;return gt<e.first||gt>=e.first+e.size?!1:(n=new ot(gt,n.ch,n.sticky),U=Tt(e,gt))}function be(gt){var dt;if(l=="codepoint"){var xt=U.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(xt))dt=null;else{var Ft=u>0?xt>=55296&&xt<56320:xt>=56320&&xt<57343;dt=new ot(n.line,Math.max(0,Math.min(U.text.length,n.ch+u*(Ft?2:1))),-u)}}else f?dt=Gu(e.cm,U,n,u):dt=Qa(U,n,u);if(dt==null)if(!gt&&Z())n=dl(f,e.cm,U,n.line,H);else return!1;else n=dt;return!0}if(l=="char"||l=="codepoint")be();else if(l=="column")be(!0);else if(l=="word"||l=="group")for(var Ce=null,De=l=="group",ke=e.cm&&e.cm.getHelper(n,"wordChars"),Ye=!0;!(u<0&&!be(!Ye));Ye=!1){var tt=U.text.charAt(n.ch)||`
|
|
32
|
+
`)&&(Ye=tt=ot(Ye.line,0)));var at={from:Ye,to:tt,text:Z?Z[De%Z.length]:H,origin:f||(U?"paste":e.state.cutIncoming>F?"cut":"+input")};vo(e.doc,at),ir(e,"inputRead",e,at)}n&&!U&&of(e,n),rn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function nf(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Ur(n,function(){return yl(n,u,0,null,"paste")}),!0}function of(e,n){if(!(!e.options.electricChars||!e.options.smartIndent))for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var f=u.ranges[l];if(!(f.head.ch>100||l&&u.ranges[l-1].head.line==f.head.line)){var m=e.getModeAt(f.head),F=!1;if(m.electricChars){for(var U=0;U<m.electricChars.length;U++)if(n.indexOf(m.electricChars.charAt(U))>-1){F=Ao(e,f.head.line,"smart");break}}else m.electricInput&&m.electricInput.test(Tt(e.doc,f.head.line).text.slice(0,f.head.ch))&&(F=Ao(e,f.head.line,"smart"));F&&ir(e,"electricInput",e,f.head.line)}}}function af(e){for(var n=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var f=e.doc.sel.ranges[l].head.line,m={anchor:ot(f,0),head:ot(f+1,0)};u.push(m),n.push(e.getRange(m.anchor,m.head))}return{text:n,ranges:u}}function br(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function Dc(){var e=we("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=we("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),M&&(e.style.border="1px solid black"),br(e),n}function Nc(e){var n=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,f){var m=this.options,F=m[l];m[l]==f&&l!="mode"||(m[l]=f,n.hasOwnProperty(l)&&jr(this,n[l])(this,f,F),oe(this,"optionChange",this,l))},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,f){this.state.keyMaps[f?"push":"unshift"](Ja(l))},removeKeyMap:function(l){for(var f=this.state.keyMaps,m=0;m<f.length;++m)if(f[m]==l||f[m].name==l)return f.splice(m,1),!0},addOverlay:Lr(function(l,f){var m=l.token?l:e.getMode(this.options,l);if(m.startState)throw new Error("Overlays may not be stateful.");jt(this.state.overlays,{mode:m,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(F){return F.priority}),this.state.modeGen++,Rr(this)}),removeOverlay:Lr(function(l){for(var f=this.state.overlays,m=0;m<f.length;++m){var F=f[m].modeSpec;if(F==l||typeof l=="string"&&F.name==l){f.splice(m,1),this.state.modeGen++,Rr(this);return}}}),indentLine:Lr(function(l,f,m){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Zn(this.doc,l)&&Ao(this,l,f,m)}),indentSelection:Lr(function(l){for(var f=this.doc.sel.ranges,m=-1,F=0;F<f.length;F++){var U=f[F];if(U.empty())U.head.line>m&&(Ao(this,U.head.line,l,!0),m=U.head.line,F==this.doc.sel.primIndex&&rn(this));else{var H=U.from(),Z=U.to(),be=Math.max(m,H.line);m=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var Ce=be;Ce<m;++Ce)Ao(this,Ce,l);var De=this.doc.sel.ranges;H.ch==0&&f.length==De.length&&De[F].from().ch>0&&za(this.doc,F,new er(H,De[F].to()),ut)}}}),getTokenAt:function(l,f){return ms(this,l,f)},getLineTokens:function(l,f){return ms(this,ot(l),f,!0)},getTokenTypeAt:function(l){l=lt(this.doc,l);var f=Hl(this,Tt(this.doc,l.line)),m=0,F=(f.length-1)/2,U=l.ch,H;if(U==0)H=f[2];else for(;;){var Z=m+F>>1;if((Z?f[Z*2-1]:0)>=U)F=Z;else if(f[Z*2+1]<U)m=Z+1;else{H=f[Z*2+2];break}}var be=H?H.indexOf("overlay "):-1;return be<0?H:be==0?null:H.slice(0,be-1)},getModeAt:function(l){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(l).state).mode:f},getHelper:function(l,f){return this.getHelpers(l,f)[0]},getHelpers:function(l,f){var m=[];if(!u.hasOwnProperty(f))return m;var F=u[f],U=this.getModeAt(l);if(typeof U[f]=="string")F[U[f]]&&m.push(F[U[f]]);else if(U[f])for(var H=0;H<U[f].length;H++){var Z=F[U[f][H]];Z&&m.push(Z)}else U.helperType&&F[U.helperType]?m.push(F[U.helperType]):F[U.name]&&m.push(F[U.name]);for(var be=0;be<F._global.length;be++){var Ce=F._global[be];Ce.pred(U,this)&&ht(m,Ce.val)==-1&&m.push(Ce.val)}return m},getStateAfter:function(l,f){var m=this.doc;return l=st(m,l==null?m.first+m.size-1:l),en(this,l+1,f).state},cursorCoords:function(l,f){var m,F=this.doc.sel.primary();return l==null?m=F.head:typeof l=="object"?m=lt(this.doc,l):m=l?F.from():F.to(),zn(this,m,f||"page")},charCoords:function(l,f){return Ca(this,lt(this.doc,l),f||"page")},coordsChar:function(l,f){return l=jo(this,l,f||"page"),Us(this,l.left,l.top)},lineAtHeight:function(l,f){return l=jo(this,{top:l,left:0},f||"page").top,Vn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,m){var F=!1,U;if(typeof l=="number"){var H=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>H&&(l=H,F=!0),U=Tt(this.doc,l)}else U=l;return Ea(this,U,{top:0,left:0},f||"page",m||F).top+(F?this.doc.height-si(U):0)},defaultTextHeight:function(){return uo(this.display)},defaultCharWidth:function(){return Pn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,m,F,U){var H=this.display;l=zn(this,lt(this.doc,l));var Z=l.bottom,be=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),H.sizer.appendChild(f),F=="over")Z=l.top;else if(F=="above"||F=="near"){var Ce=Math.max(H.wrapper.clientHeight,this.doc.height),De=Math.max(H.sizer.clientWidth,H.lineSpace.clientWidth);(F=="above"||l.bottom+f.offsetHeight>Ce)&&l.top>f.offsetHeight?Z=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Ce&&(Z=l.bottom),be+f.offsetWidth>De&&(be=De-f.offsetWidth)}f.style.top=Z+"px",f.style.left=f.style.right="",U=="right"?(be=H.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(U=="left"?be=0:U=="middle"&&(be=(H.sizer.clientWidth-f.offsetWidth)/2),f.style.left=be+"px"),m&&pu(this,{left:be,top:Z,right:be+f.offsetWidth,bottom:Z+f.offsetHeight})},triggerOnKeyDown:Lr(Yu),triggerOnKeyPress:Lr(pl),triggerOnKeyUp:Ju,triggerOnMouseDown:Lr(Xu),execCommand:function(l){if(na.hasOwnProperty(l))return na[l].call(null,this)},triggerElectric:Lr(function(l){of(this,l)}),findPosH:function(l,f,m,F){var U=1;f<0&&(U=-1,f=-f);for(var H=lt(this.doc,l),Z=0;Z<f&&(H=zt(this.doc,H,U,m,F),!H.hitSide);++Z);return H},moveH:Lr(function(l,f){var m=this;this.extendSelectionsBy(function(F){return m.display.shift||m.doc.extend||F.empty()?zt(m.doc,F.head,l,f,m.options.rtlMoveVisually):l<0?F.from():F.to()},mt)}),deleteH:Lr(function(l,f){var m=this.doc.sel,F=this.doc;m.somethingSelected()?F.replaceSelection("",null,"+delete"):ro(this,function(U){var H=zt(F,U.head,l,f,!1);return l<0?{from:H,to:U.head}:{from:U.head,to:H}})}),findPosV:function(l,f,m,F){var U=1,H=F;f<0&&(U=-1,f=-f);for(var Z=lt(this.doc,l),be=0;be<f;++be){var Ce=zn(this,Z,"div");if(H==null?H=Ce.left:Ce.left=H,Z=ml(this,Ce,U,m),Z.hitSide)break}return Z},moveV:Lr(function(l,f){var m=this,F=this.doc,U=[],H=!this.display.shift&&!F.extend&&F.sel.somethingSelected();if(F.extendSelectionsBy(function(be){if(H)return l<0?be.from():be.to();var Ce=zn(m,be.head,"div");be.goalColumn!=null&&(Ce.left=be.goalColumn),U.push(Ce.left);var De=ml(m,Ce,l,f);return f=="page"&&be==F.sel.primary()&&Ys(m,Ca(m,De,"div").top-Ce.top),De},mt),U.length)for(var Z=0;Z<F.sel.ranges.length;Z++)F.sel.ranges[Z].goalColumn=U[Z]}),findWordAt:function(l){var f=this.doc,m=Tt(f,l.line).text,F=l.ch,U=l.ch;if(m){var H=this.getHelper(l,"wordChars");(l.sticky=="before"||U==m.length)&&F?--F:++U;for(var Z=m.charAt(F),be=z(Z,H)?function(Ce){return z(Ce,H)}:/\s/.test(Z)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!z(Ce)};F>0&&be(m.charAt(F-1));)--F;for(;U<m.length&&be(m.charAt(U));)++U}return new er(ot(l.line,F),ot(l.line,U))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Le(this.display.cursorDiv,"CodeMirror-overwrite"):ee(this.display.cursorDiv,"CodeMirror-overwrite"),oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Fe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Lr(function(l,f){Ho(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-ui(this)-this.display.barHeight,width:l.scrollWidth-ui(this)-this.display.barWidth,clientHeight:Do(this),clientWidth:zi(this)}},scrollIntoView:Lr(function(l,f){l==null?(l={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof l=="number"?l={from:ot(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=f||0,l.from.line!=null?Ji(this,l):hu(this,l.from,l.to,l.margin)}),setSize:Lr(function(l,f){var m=this,F=function(H){return typeof H=="number"||/^\d+$/.test(String(H))?H+"px":H};l!=null&&(this.display.wrapper.style.width=F(l)),f!=null&&(this.display.wrapper.style.height=F(f)),this.options.lineWrapping&&Gi(this);var U=this.display.viewFrom;this.doc.iter(U,this.display.viewTo,function(H){if(H.widgets){for(var Z=0;Z<H.widgets.length;Z++)if(H.widgets[Z].noHScroll){qn(m,U,"widget");break}}++U}),this.curOp.forceUpdate=!0,oe(this,"refresh",this)}),operation:function(l){return Ur(this,l)},startOperation:function(){return Ti(this)},endOperation:function(){return Pi(this)},refresh:Lr(function(){var l=this.display.cachedTextHeight;Rr(this),this.curOp.forceUpdate=!0,No(this),Ho(this,this.doc.scrollLeft,this.doc.scrollTop),_s(this.display),(l==null||Math.abs(l-uo(this.display))>.5||this.options.lineWrapping)&&Ws(this),oe(this,"refresh",this)}),swapDoc:Lr(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Ou(this,l),No(this),this.display.input.reset(),Ho(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,ir(this,"swapDoc",this,f),f}),phrase:function(l){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,l)?f[l]:l},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}},Ue(e),e.registerHelper=function(l,f,m){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][f]=m},e.registerGlobalHelper=function(l,f,m,F){e.registerHelper(l,f,F),u[l]._global.push({pred:m,val:F})}}function zt(e,n,u,l,f){var m=n,F=u,U=Tt(e,n.line),H=f&&e.direction=="rtl"?-u:u;function Z(){var gt=n.line+H;return gt<e.first||gt>=e.first+e.size?!1:(n=new ot(gt,n.ch,n.sticky),U=Tt(e,gt))}function be(gt){var dt;if(l=="codepoint"){var xt=U.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(xt))dt=null;else{var Ft=u>0?xt>=55296&&xt<56320:xt>=56320&&xt<57343;dt=new ot(n.line,Math.max(0,Math.min(U.text.length,n.ch+u*(Ft?2:1))),-u)}}else f?dt=$u(e.cm,U,n,u):dt=Qa(U,n,u);if(dt==null)if(!gt&&Z())n=dl(f,e.cm,U,n.line,H);else return!1;else n=dt;return!0}if(l=="char"||l=="codepoint")be();else if(l=="column")be(!0);else if(l=="word"||l=="group")for(var Ce=null,De=l=="group",ke=e.cm&&e.cm.getHelper(n,"wordChars"),Ye=!0;!(u<0&&!be(!Ye));Ye=!1){var tt=U.text.charAt(n.ch)||`
|
|
33
33
|
`,at=z(tt,ke)?"w":De&&tt==`
|
|
34
|
-
`?"n":!De||/\s/.test(tt)?null:"p";if(De&&!Ye&&!at&&(at="s"),Ce&&Ce!=at){u<0&&(u=1,be(),n.sticky="after");break}if(at&&(Ce=at),u>0&&!be(!Ye))break}var ct=Zo(e,n,m,F,!0);return oi(m,ct)&&(ct.hitSide=!0),ct}function ml(e,n,u,l){var f=e.doc,m=n.left,F;if(l=="page"){var U=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),H=Math.max(U-.5*uo(e.display),3);F=(u>0?n.bottom:n.top)+u*H}else l=="line"&&(F=u>0?n.bottom+3:n.top-3);for(var Z;Z=Us(e,m,F),!!Z.outside;){if(u<0?F<=0:F>=f.height){Z.hitSide=!0;break}F+=u*5}return Z}var wt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ft,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};wt.prototype.init=function(e){var n=this,u=this,l=u.cm,f=u.div=e.lineDiv;f.contentEditable=!0,br(f,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function m(U){for(var H=U.target;H;H=H.parentNode){if(H==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(H.className))break}return!1}N(f,"paste",function(U){!m(U)||pe(l,U)||
|
|
34
|
+
`?"n":!De||/\s/.test(tt)?null:"p";if(De&&!Ye&&!at&&(at="s"),Ce&&Ce!=at){u<0&&(u=1,be(),n.sticky="after");break}if(at&&(Ce=at),u>0&&!be(!Ye))break}var ct=Zo(e,n,m,F,!0);return oi(m,ct)&&(ct.hitSide=!0),ct}function ml(e,n,u,l){var f=e.doc,m=n.left,F;if(l=="page"){var U=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),H=Math.max(U-.5*uo(e.display),3);F=(u>0?n.bottom:n.top)+u*H}else l=="line"&&(F=u>0?n.bottom+3:n.top-3);for(var Z;Z=Us(e,m,F),!!Z.outside;){if(u<0?F<=0:F>=f.height){Z.hitSide=!0;break}F+=u*5}return Z}var wt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ft,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};wt.prototype.init=function(e){var n=this,u=this,l=u.cm,f=u.div=e.lineDiv;f.contentEditable=!0,br(f,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function m(U){for(var H=U.target;H;H=H.parentNode){if(H==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(H.className))break}return!1}N(f,"paste",function(U){!m(U)||pe(l,U)||nf(U,l)||S<=11&&setTimeout(jr(l,function(){return n.updateFromDOM()}),20)}),N(f,"compositionstart",function(U){n.composing={data:U.data,done:!1}}),N(f,"compositionupdate",function(U){n.composing||(n.composing={data:U.data,done:!1})}),N(f,"compositionend",function(U){n.composing&&(U.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),N(f,"touchstart",function(){return u.forceCompositionEnd()}),N(f,"input",function(){n.composing||n.readFromDOMSoon()});function F(U){if(!(!m(U)||pe(l,U))){if(l.somethingSelected())sa({lineWise:!1,text:l.getSelections()}),U.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var H=af(l);sa({lineWise:!0,text:H.text}),U.type=="cut"&&l.operation(function(){l.setSelections(H.ranges,0,ut),l.replaceSelection("",null,"cut")})}else return;if(U.clipboardData){U.clipboardData.clearData();var Z=Cn.text.join(`
|
|
35
35
|
`);if(U.clipboardData.setData("Text",Z),U.clipboardData.getData("Text")==Z){U.preventDefault();return}}var be=Dc(),Ce=be.firstChild;l.display.lineSpace.insertBefore(be,l.display.lineSpace.firstChild),Ce.value=Cn.text.join(`
|
|
36
|
-
`);var De=Fe();Te(Ce),setTimeout(function(){l.display.lineSpace.removeChild(be),De.focus(),De==f&&u.showPrimarySelection()},50)}}N(f,"copy",F),N(f,"cut",F)},wt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},wt.prototype.prepareSelection=function(){var e=Pa(this.cm,!1);return e.focus=Fe()==this.div,e},wt.prototype.showSelection=function(e,n){!e||!this.cm.display.view.length||((e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e))},wt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},wt.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,u=n.doc.sel.primary(),l=u.from(),f=u.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||f.line<n.display.viewFrom){e.removeAllRanges();return}var m=kn(n,e.anchorNode,e.anchorOffset),F=kn(n,e.focusNode,e.focusOffset);if(!(m&&!m.bad&&F&&!F.bad&&Lt(qe(m,F),l)==0&&Lt(Oe(m,F),f)==0)){var U=n.display.view,H=l.line>=n.display.viewFrom&&
|
|
36
|
+
`);var De=Fe();Te(Ce),setTimeout(function(){l.display.lineSpace.removeChild(be),De.focus(),De==f&&u.showPrimarySelection()},50)}}N(f,"copy",F),N(f,"cut",F)},wt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},wt.prototype.prepareSelection=function(){var e=Pa(this.cm,!1);return e.focus=Fe()==this.div,e},wt.prototype.showSelection=function(e,n){!e||!this.cm.display.view.length||((e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e))},wt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},wt.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,u=n.doc.sel.primary(),l=u.from(),f=u.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||f.line<n.display.viewFrom){e.removeAllRanges();return}var m=kn(n,e.anchorNode,e.anchorOffset),F=kn(n,e.focusNode,e.focusOffset);if(!(m&&!m.bad&&F&&!F.bad&&Lt(qe(m,F),l)==0&&Lt(Oe(m,F),f)==0)){var U=n.display.view,H=l.line>=n.display.viewFrom&&sf(n,l)||{node:U[0].measure.map[2],offset:0},Z=f.line<n.display.viewTo&&sf(n,f);if(!Z){var be=U[U.length-1].measure,Ce=be.maps?be.maps[be.maps.length-1]:be.map;Z={node:Ce[Ce.length-1],offset:Ce[Ce.length-2]-Ce[Ce.length-3]}}if(!H||!Z){e.removeAllRanges();return}var De=e.rangeCount&&e.getRangeAt(0),ke;try{ke=fe(H.node,H.offset,Z.offset,Z.node)}catch(Ye){}ke&&(!c&&n.state.focused?(e.collapse(H.node,H.offset),ke.collapsed||(e.removeAllRanges(),e.addRange(ke))):(e.removeAllRanges(),e.addRange(ke)),De&&e.anchorNode==null?e.addRange(De):c&&this.startGracePeriod()),this.rememberSelection()}},wt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},wt.prototype.showMultipleSelections=function(e){xe(this.cm.display.cursorDiv,e.cursors),xe(this.cm.display.selectionDiv,e.selection)},wt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},wt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return ae(this.div,n)},wt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||Fe()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},wt.prototype.blur=function(){this.div.blur()},wt.prototype.getField=function(){return this.div},wt.prototype.supportsTouch=function(){return!0},wt.prototype.receivedFocus=function(){var e=this,n=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Ur(this.cm,function(){return n.cm.curOp.selectionChanged=!0});function u(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,u))}this.polling.set(this.cm.options.pollInterval,u)},wt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},wt.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),n=this.cm;if(X&&D&&this.cm.display.gutterSpecs.length&&la(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var u=kn(n,e.anchorNode,e.anchorOffset),l=kn(n,e.focusNode,e.focusOffset);u&&l&&Ur(n,function(){Xr(n.doc,Ii(u,l),ut),(u.bad||l.bad)&&(n.curOp.selectionChanged=!0)})}}},wt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,u=e.doc.sel.primary(),l=u.from(),f=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=ot(l.line-1,Tt(e.doc,l.line-1).length)),f.ch==Tt(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=ot(f.line+1,0)),l.line<n.viewFrom||f.line>n.viewTo-1)return!1;var m,F,U;l.line==n.viewFrom||(m=Yi(e,l.line))==0?(F=Zt(n.view[0].line),U=n.view[0].node):(F=Zt(n.view[m].line),U=n.view[m-1].node.nextSibling);var H=Yi(e,f.line),Z,be;if(H==n.view.length-1?(Z=n.viewTo-1,be=n.lineDiv.lastChild):(Z=Zt(n.view[H+1].line)-1,be=n.view[H+1].node.previousSibling),!U)return!1;for(var Ce=e.doc.splitLines(lf(e,U,be,F,Z)),De=ii(e.doc,ot(F,0),ot(Z,Tt(e.doc,Z).text.length));Ce.length>1&&De.length>1;)if(Ct(Ce)==Ct(De))Ce.pop(),De.pop(),Z--;else if(Ce[0]==De[0])Ce.shift(),De.shift(),F++;else break;for(var ke=0,Ye=0,tt=Ce[0],at=De[0],ct=Math.min(tt.length,at.length);ke<ct&&tt.charCodeAt(ke)==at.charCodeAt(ke);)++ke;for(var gt=Ct(Ce),dt=Ct(De),xt=Math.min(gt.length-(Ce.length==1?ke:0),dt.length-(De.length==1?ke:0));Ye<xt&>.charCodeAt(gt.length-Ye-1)==dt.charCodeAt(dt.length-Ye-1);)++Ye;if(Ce.length==1&&De.length==1&&F==l.line)for(;ke&&ke>l.ch&>.charCodeAt(gt.length-Ye-1)==dt.charCodeAt(dt.length-Ye-1);)ke--,Ye++;Ce[Ce.length-1]=gt.slice(0,gt.length-Ye).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(ke).replace(/\u200b+$/,"");var Ft=ot(F,ke),It=ot(Z,De.length?Ct(De).length-Ye:0);if(Ce.length>1||Ce[0]||Lt(Ft,It))return go(e.doc,Ce,Ft,It,"+input"),!0},wt.prototype.ensurePolled=function(){this.forceCompositionEnd()},wt.prototype.reset=function(){this.forceCompositionEnd()},wt.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},wt.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},wt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ur(this.cm,function(){return Rr(e.cm)})},wt.prototype.setUneditable=function(e){e.contentEditable="false"},wt.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||jr(this.cm,yl)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},wt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},wt.prototype.onContextMenu=function(){},wt.prototype.resetPosition=function(){},wt.prototype.needsContentAttribute=!0;function sf(e,n){var u=Rs(e,n.line);if(!u||u.hidden)return null;var l=Tt(e.doc,n.line),f=Ms(u,l,n.line),m=O(l,e.doc.direction),F="left";if(m){var U=K(m,n.ch);F=U%2?"right":"left"}var H=Ls(f.map,n.ch,F);return H.offset=H.collapse=="right"?H.end:H.start,H}function la(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function On(e,n){return n&&(e.bad=!0),e}function lf(e,n,u,l,f){var m="",F=!1,U=e.doc.lineSeparator(),H=!1;function Z(ke){return function(Ye){return Ye.id==ke}}function be(){F&&(m+=U,H&&(m+=U),F=H=!1)}function Ce(ke){ke&&(be(),m+=ke)}function De(ke){if(ke.nodeType==1){var Ye=ke.getAttribute("cm-text");if(Ye){Ce(Ye);return}var tt=ke.getAttribute("cm-marker"),at;if(tt){var ct=e.findMarks(ot(l,0),ot(f+1,0),Z(+tt));ct.length&&(at=ct[0].find(0))&&Ce(ii(e.doc,at.from,at.to).join(U));return}if(ke.getAttribute("contenteditable")=="false")return;var gt=/^(pre|div|p|li|table|br)$/i.test(ke.nodeName);if(!/^br$/i.test(ke.nodeName)&&ke.textContent.length==0)return;gt&&be();for(var dt=0;dt<ke.childNodes.length;dt++)De(ke.childNodes[dt]);/^(pre|p)$/i.test(ke.nodeName)&&(H=!0),gt&&(F=!0)}else ke.nodeType==3&&Ce(ke.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;De(n),n!=u;)n=n.nextSibling,H=!1;return m}function kn(e,n,u){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return On(e.clipPos(ot(e.display.viewTo-1)),!0);n=null,u=0}else for(l=n;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var f=0;f<e.display.view.length;f++){var m=e.display.view[f];if(m.node==l)return Bc(m,n,u)}}function Bc(e,n,u){var l=e.text.firstChild,f=!1;if(!n||!ae(l,n))return On(ot(Zt(e.line),0),!0);if(n==l&&(f=!0,n=l.childNodes[u],u=0,!n)){var m=e.rest?Ct(e.rest):e.line;return On(ot(Zt(m),m.text.length),f)}var F=n.nodeType==3?n:null,U=n;for(!F&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(F=n.firstChild,u&&(u=F.nodeValue.length));U.parentNode!=l;)U=U.parentNode;var H=e.measure,Z=H.maps;function be(at,ct,gt){for(var dt=-1;dt<(Z?Z.length:0);dt++)for(var xt=dt<0?H.map:Z[dt],Ft=0;Ft<xt.length;Ft+=3){var It=xt[Ft+2];if(It==at||It==ct){var it=Zt(dt<0?e.line:e.rest[dt]),Gt=xt[Ft]+gt;return(gt<0||It!=at)&&(Gt=xt[Ft+(gt?1:0)]),ot(it,Gt)}}}var Ce=be(F,U,u);if(Ce)return On(Ce,f);for(var De=U.nextSibling,ke=F?F.nodeValue.length-u:0;De;De=De.nextSibling){if(Ce=be(De,De.firstChild,0),Ce)return On(ot(Ce.line,Ce.ch-ke),f);ke+=De.textContent.length}for(var Ye=U.previousSibling,tt=u;Ye;Ye=Ye.previousSibling){if(Ce=be(Ye,Ye.firstChild,-1),Ce)return On(ot(Ce.line,Ce.ch+tt),f);tt+=Ye.textContent.length}}var Sr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ft,this.hasSelection=!1,this.composing=null};Sr.prototype.init=function(e){var n=this,u=this,l=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),M&&(f.style.width="0px"),N(f,"input",function(){b&&S>=9&&n.hasSelection&&(n.hasSelection=null),u.poll()}),N(f,"paste",function(F){pe(l,F)||nf(F,l)||(l.state.pasteIncoming=+new Date,u.fastPoll())});function m(F){if(!pe(l,F)){if(l.somethingSelected())sa({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var U=af(l);sa({lineWise:!0,text:U.text}),F.type=="cut"?l.setSelections(U.ranges,null,ut):(u.prevInput="",f.value=U.text.join(`
|
|
37
37
|
`),Te(f))}else return;F.type=="cut"&&(l.state.cutIncoming=+new Date)}}N(f,"cut",m),N(f,"copy",m),N(e.scroller,"paste",function(F){if(!(li(e,F)||pe(l,F))){if(!f.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var U=new Event("paste");U.clipboardData=F.clipboardData,f.dispatchEvent(U)}}),N(e.lineSpace,"selectstart",function(F){li(e,F)||Qe(F)}),N(f,"compositionstart",function(){var F=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:F,range:l.markText(F,l.getCursor("to"),{className:"CodeMirror-composing"})}}),N(f,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Sr.prototype.createField=function(e){this.wrapper=Dc(),this.textarea=this.wrapper.firstChild},Sr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=this.cm,n=e.display,u=e.doc,l=Pa(e);if(e.options.moveInputWithCursor){var f=zn(e,u.sel.primary().head,"div"),m=n.wrapper.getBoundingClientRect(),F=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,f.top+F.top-m.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,f.left+F.left-m.left))}return l},Sr.prototype.showSelection=function(e){var n=this.cm,u=n.display;xe(u.cursorDiv,e.cursors),xe(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Sr.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var n=this.cm;if(n.somethingSelected()){this.prevInput="";var u=n.getSelection();this.textarea.value=u,n.state.focused&&Te(this.textarea),b&&S>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",b&&S>=9&&(this.hasSelection=null))}},Sr.prototype.getField=function(){return this.textarea},Sr.prototype.supportsTouch=function(){return!1},Sr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!R||Fe()!=this.textarea))try{this.textarea.focus()}catch(e){}},Sr.prototype.blur=function(){this.textarea.blur()},Sr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Sr.prototype.receivedFocus=function(){this.slowPoll()},Sr.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Sr.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function u(){var l=n.poll();!l&&!e?(e=!0,n.polling.set(60,u)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,u)},Sr.prototype.poll=function(){var e=this,n=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||hn(u)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var f=u.value;if(f==l&&!n.somethingSelected())return!1;if(b&&S>=9&&this.hasSelection===f||C&&/[\uf700-\uf7ff]/.test(f))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var m=f.charCodeAt(0);if(m==8203&&!l&&(l="\u200B"),m==8666)return this.reset(),this.cm.execCommand("undo")}for(var F=0,U=Math.min(l.length,f.length);F<U&&l.charCodeAt(F)==f.charCodeAt(F);)++F;return Ur(n,function(){yl(n,f.slice(F),l.length-F,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
|
|
38
38
|
`)>-1?u.value=e.prevInput="":e.prevInput=f,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Sr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Sr.prototype.onKeyPress=function(){b&&S>=9&&(this.hasSelection=null),this.fastPoll()},Sr.prototype.onContextMenu=function(e){var n=this,u=n.cm,l=u.display,f=n.textarea;n.contextMenuPending&&n.contextMenuPending();var m=Ki(u,e),F=l.scroller.scrollTop;if(!m||B)return;var U=u.options.resetSelectionOnContextMenu;U&&u.doc.sel.contains(m)==-1&&jr(u,Xr)(u.doc,Ii(m),ut);var H=f.style.cssText,Z=n.wrapper.style.cssText,be=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
39
39
|
top: `+(e.clientY-be.top-5)+"px; left: "+(e.clientX-be.left-5)+`px;
|
|
40
40
|
z-index: 1000; background: `+(b?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
41
|
-
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;g&&(Ce=window.scrollY),l.input.focus(),g&&window.scrollTo(null,Ce),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=ke,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function De(){if(f.selectionStart!=null){var tt=u.somethingSelected(),at="\u200B"+(tt?f.value:"");f.value="\u21DA",f.value=at,n.prevInput=tt?"":"\u200B",f.selectionStart=1,f.selectionEnd=at.length,l.selForContextMenu=u.doc.sel}}function ke(){if(n.contextMenuPending==ke&&(n.contextMenuPending=!1,n.wrapper.style.cssText=Z,f.style.cssText=H,b&&S<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=F),f.selectionStart!=null)){(!b||b&&S<9)&&De();var tt=0,at=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?jr(u,$a)(u):tt++<10?l.detectingSelectAll=setTimeout(at,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(at,200)}}if(b&&S>=9&&De(),Y){Bt(e);var Ye=function(){de(window,"mouseup",Ye),setTimeout(ke,20)};N(window,"mouseup",Ye)}else setTimeout(ke,50)},Sr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Sr.prototype.setUneditable=function(){},Sr.prototype.needsContentAttribute=!1;function Uc(e,n){if(n=n?Ze(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var u=Fe();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=U.getValue()}var f;if(e.form&&(N(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var m=e.form;f=m.submit;try{var F=m.submit=function(){l(),m.submit=f,m.submit(),m.submit=F}}catch(H){}}n.finishInit=function(H){H.save=l,H.getTextArea=function(){return e},H.toTextArea=function(){H.toTextArea=isNaN,l(),e.parentNode.removeChild(H.getWrapperElement()),e.style.display="",e.form&&(de(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var U=dr(function(H){return e.parentNode.insertBefore(H,e.nextSibling)},n);return U}function lf(e){e.off=de,e.on=N,e.wheelEventPixels=rr,e.Doc=un,e.splitLines=Bn,e.countColumn=Xe,e.findColumn=pt,e.isWordChar=ve,e.Pass=nt,e.signal=oe,e.Line=Vi,e.changeEnd=Fi,e.scrollbarModel=yn,e.Pos=ot,e.cmpPos=Lt,e.modes=bi,e.mimeModes=qr,e.resolveMode=jn,e.getMode=gn,e.modeExtensions=Xn,e.extendMode=wi,e.copyState=Br,e.startState=Qn,e.innerMode=$r,e.commands=na,e.keyMap=ri,e.keyName=zu,e.isModifierKey=Hu,e.lookupKey=pi,e.normalizeKeyMap=Rd,e.StringStream=ur,e.SharedTextMarker=xo,e.TextMarker=ti,e.LineWidget=qo,e.e_preventDefault=Qe,e.e_stopPropagation=vt,e.e_stop=Bt,e.addClass=Le,e.contains=ae,e.rmClass=ee,e.keyNames=xn}tf(dr),Nc(dr);var jc="iter insert remove copy getEditor constructor".split(" ");for(var ns in un.prototype)un.prototype.hasOwnProperty(ns)&&ht(jc,ns)<0&&(dr.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(un.prototype[ns]));return Ue(un),dr.inputStyles={textarea:Sr,contenteditable:wt},dr.defineMode=function(e){!dr.defaults.mode&&e!="null"&&(dr.defaults.mode=e),vn.apply(this,arguments)},dr.defineMIME=Un,dr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),dr.defineMIME("text/plain","null"),dr.defineExtension=function(e,n){dr.prototype[e]=n},dr.defineDocExtension=function(e,n){un.prototype[e]=n},dr.fromTextArea=Uc,lf(dr),dr.version="5.65.0",dr})},96876:(h,I,o)=>{(function(c){c(o(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,x){var d=v.indentUnit,b=x.statementIndent,S=x.jsonld,g=x.json||S,L=x.trackScope!==!1,D=x.typescript,B=x.wordCharacters||/[\w$\xa1-\uffff]/,j=function(){function ue(Tr){return{type:Tr,style:"keyword"}}var Oe=ue("keyword a"),qe=ue("keyword b"),st=ue("keyword c"),lt=ue("keyword d"),Kt=ue("operator"),Xt={type:"atom",style:"atom"};return{if:ue("if"),while:Oe,with:Oe,else:qe,do:qe,try:qe,finally:qe,return:lt,break:lt,continue:lt,new:ue("new"),delete:st,void:st,throw:st,debugger:ue("debugger"),var:ue("var"),const:ue("var"),let:ue("var"),function:ue("function"),catch:ue("catch"),for:ue("for"),switch:ue("switch"),case:ue("case"),default:ue("default"),in:Kt,typeof:Kt,instanceof:Kt,true:Xt,false:Xt,null:Xt,undefined:Xt,NaN:Xt,Infinity:Xt,this:ue("this"),class:ue("class"),super:ue("atom"),yield:st,export:ue("export"),import:ue("import"),extends:st,await:st}}(),q=/[+\-*&%=<>!?|~^@]/,W=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function M(ue){for(var Oe=!1,qe,st=!1;(qe=ue.next())!=null;){if(!Oe){if(qe=="/"&&!st)return;qe=="["?st=!0:st&&qe=="]"&&(st=!1)}Oe=!Oe&&qe=="\\"}}var X,R;function C(ue,Oe,qe){return X=ue,R=qe,Oe}function V(ue,Oe){var qe=ue.next();if(qe=='"'||qe=="'")return Oe.tokenize=J(qe),Oe.tokenize(ue,Oe);if(qe=="."&&ue.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return C("number","number");if(qe=="."&&ue.match(".."))return C("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(qe))return C(qe);if(qe=="="&&ue.eat(">"))return C("=>","operator");if(qe=="0"&&ue.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return C("number","number");if(/\d/.test(qe))return ue.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),C("number","number");if(qe=="/")return ue.eat("*")?(Oe.tokenize=_,_(ue,Oe)):ue.eat("/")?(ue.skipToEnd(),C("comment","comment")):oi(ue,Oe,1)?(M(ue),ue.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),C("regexp","string-2")):(ue.eat("="),C("operator","operator",ue.current()));if(qe=="`")return Oe.tokenize=Q,Q(ue,Oe);if(qe=="#"&&ue.peek()=="!")return ue.skipToEnd(),C("meta","meta");if(qe=="#"&&ue.eatWhile(B))return C("variable","property");if(qe=="<"&&ue.match("!--")||qe=="-"&&ue.match("->")&&!/\S/.test(ue.string.slice(0,ue.start)))return ue.skipToEnd(),C("comment","comment");if(q.test(qe))return(qe!=">"||!Oe.lexical||Oe.lexical.type!=">")&&(ue.eat("=")?(qe=="!"||qe=="=")&&ue.eat("="):/[<>*+\-|&?]/.test(qe)&&(ue.eat(qe),qe==">"&&ue.eat(qe))),qe=="?"&&ue.eat(".")?C("."):C("operator","operator",ue.current());if(B.test(qe)){ue.eatWhile(B);var st=ue.current();if(Oe.lastType!="."){if(j.propertyIsEnumerable(st)){var lt=j[st];return C(lt.type,lt.style,st)}if(st=="async"&&ue.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return C("async","keyword",st)}return C("variable","variable",st)}}function J(ue){return function(Oe,qe){var st=!1,lt;if(S&&Oe.peek()=="@"&&Oe.match(W))return qe.tokenize=V,C("jsonld-keyword","meta");for(;(lt=Oe.next())!=null&&!(lt==ue&&!st);)st=!st&<=="\\";return st||(qe.tokenize=V),C("string","string")}}function _(ue,Oe){for(var qe=!1,st;st=ue.next();){if(st=="/"&&qe){Oe.tokenize=V;break}qe=st=="*"}return C("comment","comment")}function Q(ue,Oe){for(var qe=!1,st;(st=ue.next())!=null;){if(!qe&&(st=="`"||st=="$"&&ue.eat("{"))){Oe.tokenize=V;break}qe=!qe&&st=="\\"}return C("quasi","string-2",ue.current())}var Y="([{}])";function ce(ue,Oe){Oe.fatArrowAt&&(Oe.fatArrowAt=null);var qe=ue.string.indexOf("=>",ue.start);if(!(qe<0)){if(D){var st=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ue.string.slice(ue.start,qe));st&&(qe=st.index)}for(var lt=0,Kt=!1,Xt=qe-1;Xt>=0;--Xt){var Tr=ue.string.charAt(Xt),Pr=Y.indexOf(Tr);if(Pr>=0&&Pr<3){if(!lt){++Xt;break}if(--lt==0){Tr=="("&&(Kt=!0);break}}else if(Pr>=3&&Pr<6)++lt;else if(B.test(Tr))Kt=!0;else if(/["'\/`]/.test(Tr))for(;;--Xt){if(Xt==0)return;var _t=ue.string.charAt(Xt-1);if(_t==Tr&&ue.string.charAt(Xt-2)!="\\"){Xt--;break}}else if(Kt&&!lt){++Xt;break}}Kt&&!lt&&(Oe.fatArrowAt=Xt)}}var ee={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ie(ue,Oe,qe,st,lt,Kt){this.indented=ue,this.column=Oe,this.type=qe,this.prev=lt,this.info=Kt,st!=null&&(this.align=st)}function xe(ue,Oe){if(!L)return!1;for(var qe=ue.localVars;qe;qe=qe.next)if(qe.name==Oe)return!0;for(var st=ue.context;st;st=st.prev)for(var qe=st.vars;qe;qe=qe.next)if(qe.name==Oe)return!0}function we(ue,Oe,qe,st,lt){var Kt=ue.cc;for(he.state=ue,he.stream=lt,he.marked=null,he.cc=Kt,he.style=Oe,ue.lexical.hasOwnProperty("align")||(ue.lexical.align=!0);;){var Xt=Kt.length?Kt.pop():g?Mt:mt;if(Xt(qe,st)){for(;Kt.length&&Kt[Kt.length-1].lex;)Kt.pop()();return he.marked?he.marked:qe=="variable"&&xe(ue,st)?"variable-2":Oe}}}var he={state:null,column:null,marked:null,cc:null};function fe(){for(var ue=arguments.length-1;ue>=0;ue--)he.cc.push(arguments[ue])}function ae(){return fe.apply(null,arguments),!0}function Fe(ue,Oe){for(var qe=Oe;qe;qe=qe.next)if(qe.name==ue)return!0;return!1}function Le(ue){var Oe=he.state;if(he.marked="def",!!L){if(Oe.context){if(Oe.lexical.info=="var"&&Oe.context&&Oe.context.block){var qe=Me(ue,Oe.context);if(qe!=null){Oe.context=qe;return}}else if(!Fe(ue,Oe.localVars)){Oe.localVars=new Ze(ue,Oe.localVars);return}}x.globalVars&&!Fe(ue,Oe.globalVars)&&(Oe.globalVars=new Ze(ue,Oe.globalVars))}}function Me(ue,Oe){if(Oe)if(Oe.block){var qe=Me(ue,Oe.prev);return qe?qe==Oe.prev?Oe:new rt(qe,Oe.vars,!0):null}else return Fe(ue,Oe.vars)?Oe:new rt(Oe.prev,new Ze(ue,Oe.vars),!1);else return null}function Te(ue){return ue=="public"||ue=="private"||ue=="protected"||ue=="abstract"||ue=="readonly"}function rt(ue,Oe,qe){this.prev=ue,this.vars=Oe,this.block=qe}function Ze(ue,Oe){this.name=ue,this.next=Oe}var Xe=new Ze("this",new Ze("arguments",null));function ft(){he.state.context=new rt(he.state.context,he.state.localVars,!1),he.state.localVars=Xe}function ht(){he.state.context=new rt(he.state.context,he.state.localVars,!0),he.state.localVars=null}function bt(){he.state.localVars=he.state.context.vars,he.state.context=he.state.context.prev}bt.lex=!0;function nt(ue,Oe){var qe=function(){var st=he.state,lt=st.indented;if(st.lexical.type=="stat")lt=st.lexical.indented;else for(var Kt=st.lexical;Kt&&Kt.type==")"&&Kt.align;Kt=Kt.prev)lt=Kt.indented;st.lexical=new ie(lt,he.stream.column(),ue,null,st.lexical,Oe)};return qe.lex=!0,qe}function ut(){var ue=he.state;ue.lexical.prev&&(ue.lexical.type==")"&&(ue.indented=ue.lexical.indented),ue.lexical=ue.lexical.prev)}ut.lex=!0;function yt(ue){function Oe(qe){return qe==ue?ae():ue==";"||qe=="}"||qe==")"||qe=="]"?fe():ae(Oe)}return Oe}function mt(ue,Oe){return ue=="var"?ae(nt("vardef",Oe),mi,yt(";"),ut):ue=="keyword a"?ae(nt("form"),Ct,mt,ut):ue=="keyword b"?ae(nt("form"),mt,ut):ue=="keyword d"?he.stream.match(/^\s*$/,!1)?ae():ae(nt("stat"),jt,yt(";"),ut):ue=="debugger"?ae(yt(";")):ue=="{"?ae(nt("}"),ht,N,ut,bt):ue==";"?ae():ue=="if"?(he.state.lexical.info=="else"&&he.state.cc[he.state.cc.length-1]==ut&&he.state.cc.pop()(),ae(nt("form"),Ct,mt,ut,Gr)):ue=="function"?ae(vn):ue=="for"?ae(nt("form"),ht,xi,mt,bt,ut):ue=="class"||D&&Oe=="interface"?(he.marked="keyword",ae(nt("form",ue=="class"?ue:Oe),wi,ut)):ue=="variable"?D&&Oe=="declare"?(he.marked="keyword",ae(mt)):D&&(Oe=="module"||Oe=="enum"||Oe=="type")&&he.stream.match(/^\s*\w/,!1)?(he.marked="keyword",Oe=="enum"?ae(lo):Oe=="type"?ae(jn,yt("operator"),Ae,yt(";")):ae(nt("form"),zr,yt("{"),nt("}"),N,ut,ut)):D&&Oe=="namespace"?(he.marked="keyword",ae(nt("form"),Mt,mt,ut)):D&&Oe=="abstract"?(he.marked="keyword",ae(mt)):ae(nt("stat"),Ke):ue=="switch"?ae(nt("form"),Ct,yt("{"),nt("}","switch"),ht,N,ut,ut,bt):ue=="case"?ae(Mt,yt(":")):ue=="default"?ae(yt(":")):ue=="catch"?ae(nt("form"),ft,pt,mt,ut,bt):ue=="export"?ae(nt("stat"),ur,ut):ue=="import"?ae(nt("stat"),ii,ut):ue=="async"?ae(mt):Oe=="@"?ae(Mt,mt):fe(nt("stat"),Mt,yt(";"),ut)}function pt(ue){if(ue=="(")return ae(gn,yt(")"))}function Mt(ue,Oe){return Wt(ue,Oe,!1)}function kt(ue,Oe){return Wt(ue,Oe,!0)}function Ct(ue){return ue!="("?fe():ae(nt(")"),jt,yt(")"),ut)}function Wt(ue,Oe,qe){if(he.state.fatArrowAt==he.stream.start){var st=qe?$:z;if(ue=="(")return ae(ft,nt(")"),O(gn,")"),ut,yt("=>"),st,bt);if(ue=="variable")return fe(ft,zr,yt("=>"),st,bt)}var lt=qe?St:Vt;return ee.hasOwnProperty(ue)?ae(lt):ue=="function"?ae(vn,lt):ue=="class"||D&&Oe=="interface"?(he.marked="keyword",ae(nt("form"),Xn,ut)):ue=="keyword c"||ue=="async"?ae(qe?kt:Mt):ue=="("?ae(nt(")"),jt,yt(")"),ut,lt):ue=="operator"||ue=="spread"?ae(qe?kt:Mt):ue=="["?ae(nt("]"),Zn,ut,lt):ue=="{"?le(Re,"}",null,lt):ue=="quasi"?fe(Dt,lt):ue=="new"?ae(Se(qe)):ae()}function jt(ue){return ue.match(/[;\}\)\],]/)?fe():fe(Mt)}function Vt(ue,Oe){return ue==","?ae(jt):St(ue,Oe,!1)}function St(ue,Oe,qe){var st=qe==!1?Vt:St,lt=qe==!1?Mt:kt;if(ue=="=>")return ae(ft,qe?$:z,bt);if(ue=="operator")return/\+\+|--/.test(Oe)||D&&Oe=="!"?ae(st):D&&Oe=="<"&&he.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?ae(nt(">"),O(Ae,">"),ut,st):Oe=="?"?ae(Mt,yt(":"),lt):ae(lt);if(ue=="quasi")return fe(Dt,st);if(ue!=";"){if(ue=="(")return le(kt,")","call",st);if(ue==".")return ae(P,st);if(ue=="[")return ae(nt("]"),jt,yt("]"),ut,st);if(D&&Oe=="as")return he.marked="keyword",ae(Ae,st);if(ue=="regexp")return he.state.lastType=he.marked="operator",he.stream.backUp(he.stream.pos-he.stream.start-1),ae(lt)}}function Dt(ue,Oe){return ue!="quasi"?fe():Oe.slice(Oe.length-2)!="${"?ae(Dt):ae(jt,ve)}function ve(ue){if(ue=="}")return he.marked="string-2",he.state.tokenize=Q,ae(Dt)}function z(ue){return ce(he.stream,he.state),fe(ue=="{"?mt:Mt)}function $(ue){return ce(he.stream,he.state),fe(ue=="{"?mt:kt)}function Se(ue){return function(Oe){return Oe=="."?ae(ue?$e:Ie):Oe=="variable"&&D?ae(pn,ue?St:Vt):fe(ue?kt:Mt)}}function Ie(ue,Oe){if(Oe=="target")return he.marked="keyword",ae(Vt)}function $e(ue,Oe){if(Oe=="target")return he.marked="keyword",ae(St)}function Ke(ue){return ue==":"?ae(ut,mt):fe(Vt,yt(";"),ut)}function P(ue){if(ue=="variable")return he.marked="property",ae()}function Re(ue,Oe){if(ue=="async")return he.marked="property",ae(Re);if(ue=="variable"||he.style=="keyword"){if(he.marked="property",Oe=="get"||Oe=="set")return ae(K);var qe;return D&&he.state.fatArrowAt==he.stream.start&&(qe=he.stream.match(/^\s*:\s*/,!1))&&(he.state.fatArrowAt=he.stream.pos+qe[0].length),ae(T)}else{if(ue=="number"||ue=="string")return he.marked=S?"property":he.style+" property",ae(T);if(ue=="jsonld-keyword")return ae(T);if(D&&Te(Oe))return he.marked="keyword",ae(Re);if(ue=="[")return ae(Mt,te,yt("]"),T);if(ue=="spread")return ae(kt,T);if(Oe=="*")return he.marked="keyword",ae(Re);if(ue==":")return fe(T)}}function K(ue){return ue!="variable"?fe(T):(he.marked="property",ae(vn))}function T(ue){if(ue==":")return ae(kt);if(ue=="(")return fe(vn)}function O(ue,Oe,qe){function st(lt,Kt){if(qe?qe.indexOf(lt)>-1:lt==","){var Xt=he.state.lexical;return Xt.info=="call"&&(Xt.pos=(Xt.pos||0)+1),ae(function(Tr,Pr){return Tr==Oe||Pr==Oe?fe():fe(ue)},st)}return lt==Oe||Kt==Oe?ae():qe&&qe.indexOf(";")>-1?fe(ue):ae(yt(Oe))}return function(lt,Kt){return lt==Oe||Kt==Oe?ae():fe(ue,st)}}function le(ue,Oe,qe){for(var st=3;st<arguments.length;st++)he.cc.push(arguments[st]);return ae(nt(Oe,qe),O(ue,Oe),ut)}function N(ue){return ue=="}"?ae():fe(mt,N)}function te(ue,Oe){if(D){if(ue==":")return ae(Ae);if(Oe=="?")return ae(te)}}function de(ue,Oe){if(D&&(ue==":"||Oe=="in"))return ae(Ae)}function oe(ue){if(D&&ue==":")return he.stream.match(/^\s*\w+\s+is\b/,!1)?ae(Mt,pe,Ae):ae(Ae)}function pe(ue,Oe){if(Oe=="is")return he.marked="keyword",ae()}function Ae(ue,Oe){if(Oe=="keyof"||Oe=="typeof"||Oe=="infer"||Oe=="readonly")return he.marked="keyword",ae(Oe=="typeof"?kt:Ae);if(ue=="variable"||Oe=="void")return he.marked="type",ae(Pt);if(Oe=="|"||Oe=="&")return ae(Ae);if(ue=="string"||ue=="number"||ue=="atom")return ae(Pt);if(ue=="[")return ae(nt("]"),O(Ae,"]",","),ut,Pt);if(ue=="{")return ae(nt("}"),Ue,ut,Pt);if(ue=="(")return ae(O(Bt,")"),Be,Pt);if(ue=="<")return ae(O(Ae,">"),Ae);if(ue=="quasi")return fe(vt,Pt)}function Be(ue){if(ue=="=>")return ae(Ae)}function Ue(ue){return ue.match(/[\}\)\]]/)?ae():ue==","||ue==";"?ae(Ue):fe(Qe,Ue)}function Qe(ue,Oe){if(ue=="variable"||he.style=="keyword")return he.marked="property",ae(Qe);if(Oe=="?"||ue=="number"||ue=="string")return ae(Qe);if(ue==":")return ae(Ae);if(ue=="[")return ae(yt("variable"),de,yt("]"),Qe);if(ue=="(")return fe(Un,Qe);if(!ue.match(/[;\}\)\],]/))return ae()}function vt(ue,Oe){return ue!="quasi"?fe():Oe.slice(Oe.length-2)!="${"?ae(vt):ae(Ae,Et)}function Et(ue){if(ue=="}")return he.marked="string-2",he.state.tokenize=Q,ae(vt)}function Bt(ue,Oe){return ue=="variable"&&he.stream.match(/^\s*[?:]/,!1)||Oe=="?"?ae(Bt):ue==":"?ae(Ae):ue=="spread"?ae(Bt):fe(Ae)}function Pt(ue,Oe){if(Oe=="<")return ae(nt(">"),O(Ae,">"),ut,Pt);if(Oe=="|"||ue=="."||Oe=="&")return ae(Ae);if(ue=="[")return ae(Ae,yt("]"),Pt);if(Oe=="extends"||Oe=="implements")return he.marked="keyword",ae(Ae);if(Oe=="?")return ae(Ae,yt(":"),Ae)}function pn(ue,Oe){if(Oe=="<")return ae(nt(">"),O(Ae,">"),ut,Pt)}function Nr(){return fe(Ae,Or)}function Or(ue,Oe){if(Oe=="=")return ae(Ae)}function mi(ue,Oe){return Oe=="enum"?(he.marked="keyword",ae(lo)):fe(zr,te,hn,Tn)}function zr(ue,Oe){if(D&&Te(Oe))return he.marked="keyword",ae(zr);if(ue=="variable")return Le(Oe),ae();if(ue=="spread")return ae(zr);if(ue=="[")return le(Bn,"]");if(ue=="{")return le(Bi,"}")}function Bi(ue,Oe){return ue=="variable"&&!he.stream.match(/^\s*:/,!1)?(Le(Oe),ae(hn)):(ue=="variable"&&(he.marked="property"),ue=="spread"?ae(zr):ue=="}"?fe():ue=="["?ae(Mt,yt("]"),yt(":"),Bi):ae(yt(":"),zr,hn))}function Bn(){return fe(zr,hn)}function hn(ue,Oe){if(Oe=="=")return ae(kt)}function Tn(ue){if(ue==",")return ae(mi)}function Gr(ue,Oe){if(ue=="keyword b"&&Oe=="else")return ae(nt("form","else"),mt,ut)}function xi(ue,Oe){if(Oe=="await")return ae(xi);if(ue=="(")return ae(nt(")"),bi,ut)}function bi(ue){return ue=="var"?ae(mi,qr):ue=="variable"?ae(qr):fe(qr)}function qr(ue,Oe){return ue==")"?ae():ue==";"?ae(qr):Oe=="in"||Oe=="of"?(he.marked="keyword",ae(Mt,qr)):fe(Mt,qr)}function vn(ue,Oe){if(Oe=="*")return he.marked="keyword",ae(vn);if(ue=="variable")return Le(Oe),ae(vn);if(ue=="(")return ae(ft,nt(")"),O(gn,")"),ut,oe,mt,bt);if(D&&Oe=="<")return ae(nt(">"),O(Nr,">"),ut,vn)}function Un(ue,Oe){if(Oe=="*")return he.marked="keyword",ae(Un);if(ue=="variable")return Le(Oe),ae(Un);if(ue=="(")return ae(ft,nt(")"),O(gn,")"),ut,oe,bt);if(D&&Oe=="<")return ae(nt(">"),O(Nr,">"),ut,Un)}function jn(ue,Oe){if(ue=="keyword"||ue=="variable")return he.marked="type",ae(jn);if(Oe=="<")return ae(nt(">"),O(Nr,">"),ut)}function gn(ue,Oe){return Oe=="@"&&ae(Mt,gn),ue=="spread"?ae(gn):D&&Te(Oe)?(he.marked="keyword",ae(gn)):D&&ue=="this"?ae(te,hn):fe(zr,te,hn)}function Xn(ue,Oe){return ue=="variable"?wi(ue,Oe):Br(ue,Oe)}function wi(ue,Oe){if(ue=="variable")return Le(Oe),ae(Br)}function Br(ue,Oe){if(Oe=="<")return ae(nt(">"),O(Nr,">"),ut,Br);if(Oe=="extends"||Oe=="implements"||D&&ue==",")return Oe=="implements"&&(he.marked="keyword"),ae(D?Ae:Mt,Br);if(ue=="{")return ae(nt("}"),$r,ut)}function $r(ue,Oe){if(ue=="async"||ue=="variable"&&(Oe=="static"||Oe=="get"||Oe=="set"||D&&Te(Oe))&&he.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return he.marked="keyword",ae($r);if(ue=="variable"||he.style=="keyword")return he.marked="property",ae(Qn,$r);if(ue=="number"||ue=="string")return ae(Qn,$r);if(ue=="[")return ae(Mt,te,yt("]"),Qn,$r);if(Oe=="*")return he.marked="keyword",ae($r);if(D&&ue=="(")return fe(Un,$r);if(ue==";"||ue==",")return ae($r);if(ue=="}")return ae();if(Oe=="@")return ae(Mt,$r)}function Qn(ue,Oe){if(Oe=="!"||Oe=="?")return ae(Qn);if(ue==":")return ae(Ae,hn);if(Oe=="=")return ae(kt);var qe=he.state.lexical.prev,st=qe&&qe.info=="interface";return fe(st?Un:vn)}function ur(ue,Oe){return Oe=="*"?(he.marked="keyword",ae(Vn,yt(";"))):Oe=="default"?(he.marked="keyword",ae(Mt,yt(";"))):ue=="{"?ae(O(Tt,"}"),Vn,yt(";")):fe(mt)}function Tt(ue,Oe){if(Oe=="as")return he.marked="keyword",ae(yt("variable"));if(ue=="variable")return fe(kt,Tt)}function ii(ue){return ue=="string"?ae():ue=="("?fe(Mt):ue=="."?fe(Vt):fe(Si,An,Vn)}function Si(ue,Oe){return ue=="{"?le(Si,"}"):(ue=="variable"&&Le(Oe),Oe=="*"&&(he.marked="keyword"),ae(Zt))}function An(ue){if(ue==",")return ae(Si,An)}function Zt(ue,Oe){if(Oe=="as")return he.marked="keyword",ae(Si)}function Vn(ue,Oe){if(Oe=="from")return he.marked="keyword",ae(Mt)}function Zn(ue){return ue=="]"?ae():fe(O(kt,"]"))}function lo(){return fe(nt("form"),zr,yt("{"),nt("}"),O(ot,"}"),ut,ut)}function ot(){return fe(zr,hn)}function Lt(ue,Oe){return ue.lastType=="operator"||ue.lastType==","||q.test(Oe.charAt(0))||/[,.]/.test(Oe.charAt(0))}function oi(ue,Oe,qe){return Oe.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Oe.lastType)||Oe.lastType=="quasi"&&/\{\s*$/.test(ue.string.slice(0,ue.pos-(qe||0)))}return{startState:function(ue){var Oe={tokenize:V,lastType:"sof",cc:[],lexical:new ie((ue||0)-d,0,"block",!1),localVars:x.localVars,context:x.localVars&&new rt(null,null,!1),indented:ue||0};return x.globalVars&&typeof x.globalVars=="object"&&(Oe.globalVars=x.globalVars),Oe},token:function(ue,Oe){if(ue.sol()&&(Oe.lexical.hasOwnProperty("align")||(Oe.lexical.align=!1),Oe.indented=ue.indentation(),ce(ue,Oe)),Oe.tokenize!=_&&ue.eatSpace())return null;var qe=Oe.tokenize(ue,Oe);return X=="comment"?qe:(Oe.lastType=X=="operator"&&(R=="++"||R=="--")?"incdec":X,we(Oe,qe,X,R,ue))},indent:function(ue,Oe){if(ue.tokenize==_||ue.tokenize==Q)return c.Pass;if(ue.tokenize!=V)return 0;var qe=Oe&&Oe.charAt(0),st=ue.lexical,lt;if(!/^\s*else\b/.test(Oe))for(var Kt=ue.cc.length-1;Kt>=0;--Kt){var Xt=ue.cc[Kt];if(Xt==ut)st=st.prev;else if(Xt!=Gr&&Xt!=bt)break}for(;(st.type=="stat"||st.type=="form")&&(qe=="}"||(lt=ue.cc[ue.cc.length-1])&&(lt==Vt||lt==St)&&!/^[,\.=+\-*:?[\(]/.test(Oe));)st=st.prev;b&&st.type==")"&&st.prev.type=="stat"&&(st=st.prev);var Tr=st.type,Pr=qe==Tr;return Tr=="vardef"?st.indented+(ue.lastType=="operator"||ue.lastType==","?st.info.length+1:0):Tr=="form"&&qe=="{"?st.indented:Tr=="form"?st.indented+d:Tr=="stat"?st.indented+(Lt(ue,Oe)?b||d:0):st.info=="switch"&&!Pr&&x.doubleIndentSwitch!=!1?st.indented+(/^(?:case|default)\b/.test(Oe)?d:2*d):st.align?st.column+(Pr?0:1):st.indented+(Pr?0:d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:S,jsonMode:g,expressionAllowed:oi,skipExpression:function(ue){we(ue,"atom","atom","true",new c.StringStream("",2,null))}}}),c.registerHelper("wordChars","javascript",/[\w$]/),c.defineMIME("text/javascript","javascript"),c.defineMIME("text/ecmascript","javascript"),c.defineMIME("application/javascript","javascript"),c.defineMIME("application/x-javascript","javascript"),c.defineMIME("application/ecmascript","javascript"),c.defineMIME("application/json",{name:"javascript",json:!0}),c.defineMIME("application/x-json",{name:"javascript",json:!0}),c.defineMIME("application/manifest+json",{name:"javascript",json:!0}),c.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),c.defineMIME("text/typescript",{name:"javascript",typescript:!0}),c.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},76489:(h,I)=>{"use strict";/*!
|
|
41
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;g&&(Ce=window.scrollY),l.input.focus(),g&&window.scrollTo(null,Ce),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=ke,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function De(){if(f.selectionStart!=null){var tt=u.somethingSelected(),at="\u200B"+(tt?f.value:"");f.value="\u21DA",f.value=at,n.prevInput=tt?"":"\u200B",f.selectionStart=1,f.selectionEnd=at.length,l.selForContextMenu=u.doc.sel}}function ke(){if(n.contextMenuPending==ke&&(n.contextMenuPending=!1,n.wrapper.style.cssText=Z,f.style.cssText=H,b&&S<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=F),f.selectionStart!=null)){(!b||b&&S<9)&&De();var tt=0,at=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?jr(u,$a)(u):tt++<10?l.detectingSelectAll=setTimeout(at,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(at,200)}}if(b&&S>=9&&De(),Y){Bt(e);var Ye=function(){de(window,"mouseup",Ye),setTimeout(ke,20)};N(window,"mouseup",Ye)}else setTimeout(ke,50)},Sr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Sr.prototype.setUneditable=function(){},Sr.prototype.needsContentAttribute=!1;function Uc(e,n){if(n=n?Ze(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var u=Fe();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=U.getValue()}var f;if(e.form&&(N(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var m=e.form;f=m.submit;try{var F=m.submit=function(){l(),m.submit=f,m.submit(),m.submit=F}}catch(H){}}n.finishInit=function(H){H.save=l,H.getTextArea=function(){return e},H.toTextArea=function(){H.toTextArea=isNaN,l(),e.parentNode.removeChild(H.getWrapperElement()),e.style.display="",e.form&&(de(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var U=dr(function(H){return e.parentNode.insertBefore(H,e.nextSibling)},n);return U}function uf(e){e.off=de,e.on=N,e.wheelEventPixels=rr,e.Doc=un,e.splitLines=Bn,e.countColumn=Xe,e.findColumn=pt,e.isWordChar=ve,e.Pass=nt,e.signal=oe,e.Line=Vi,e.changeEnd=Fi,e.scrollbarModel=yn,e.Pos=ot,e.cmpPos=Lt,e.modes=bi,e.mimeModes=qr,e.resolveMode=jn,e.getMode=gn,e.modeExtensions=Xn,e.extendMode=wi,e.copyState=Br,e.startState=Qn,e.innerMode=$r,e.commands=na,e.keyMap=ri,e.keyName=Gu,e.isModifierKey=zu,e.lookupKey=pi,e.normalizeKeyMap=Rd,e.StringStream=ur,e.SharedTextMarker=xo,e.TextMarker=ti,e.LineWidget=qo,e.e_preventDefault=Qe,e.e_stopPropagation=vt,e.e_stop=Bt,e.addClass=Le,e.contains=ae,e.rmClass=ee,e.keyNames=xn}rf(dr),Nc(dr);var jc="iter insert remove copy getEditor constructor".split(" ");for(var ns in un.prototype)un.prototype.hasOwnProperty(ns)&&ht(jc,ns)<0&&(dr.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(un.prototype[ns]));return Ue(un),dr.inputStyles={textarea:Sr,contenteditable:wt},dr.defineMode=function(e){!dr.defaults.mode&&e!="null"&&(dr.defaults.mode=e),vn.apply(this,arguments)},dr.defineMIME=Un,dr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),dr.defineMIME("text/plain","null"),dr.defineExtension=function(e,n){dr.prototype[e]=n},dr.defineDocExtension=function(e,n){un.prototype[e]=n},dr.fromTextArea=Uc,uf(dr),dr.version="5.65.0",dr})},96876:(h,I,o)=>{(function(c){c(o(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,x){var d=v.indentUnit,b=x.statementIndent,S=x.jsonld,g=x.json||S,L=x.trackScope!==!1,D=x.typescript,B=x.wordCharacters||/[\w$\xa1-\uffff]/,j=function(){function ue(Tr){return{type:Tr,style:"keyword"}}var Oe=ue("keyword a"),qe=ue("keyword b"),st=ue("keyword c"),lt=ue("keyword d"),Kt=ue("operator"),Xt={type:"atom",style:"atom"};return{if:ue("if"),while:Oe,with:Oe,else:qe,do:qe,try:qe,finally:qe,return:lt,break:lt,continue:lt,new:ue("new"),delete:st,void:st,throw:st,debugger:ue("debugger"),var:ue("var"),const:ue("var"),let:ue("var"),function:ue("function"),catch:ue("catch"),for:ue("for"),switch:ue("switch"),case:ue("case"),default:ue("default"),in:Kt,typeof:Kt,instanceof:Kt,true:Xt,false:Xt,null:Xt,undefined:Xt,NaN:Xt,Infinity:Xt,this:ue("this"),class:ue("class"),super:ue("atom"),yield:st,export:ue("export"),import:ue("import"),extends:st,await:st}}(),q=/[+\-*&%=<>!?|~^@]/,W=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function M(ue){for(var Oe=!1,qe,st=!1;(qe=ue.next())!=null;){if(!Oe){if(qe=="/"&&!st)return;qe=="["?st=!0:st&&qe=="]"&&(st=!1)}Oe=!Oe&&qe=="\\"}}var X,R;function C(ue,Oe,qe){return X=ue,R=qe,Oe}function V(ue,Oe){var qe=ue.next();if(qe=='"'||qe=="'")return Oe.tokenize=J(qe),Oe.tokenize(ue,Oe);if(qe=="."&&ue.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return C("number","number");if(qe=="."&&ue.match(".."))return C("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(qe))return C(qe);if(qe=="="&&ue.eat(">"))return C("=>","operator");if(qe=="0"&&ue.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return C("number","number");if(/\d/.test(qe))return ue.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),C("number","number");if(qe=="/")return ue.eat("*")?(Oe.tokenize=_,_(ue,Oe)):ue.eat("/")?(ue.skipToEnd(),C("comment","comment")):oi(ue,Oe,1)?(M(ue),ue.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),C("regexp","string-2")):(ue.eat("="),C("operator","operator",ue.current()));if(qe=="`")return Oe.tokenize=Q,Q(ue,Oe);if(qe=="#"&&ue.peek()=="!")return ue.skipToEnd(),C("meta","meta");if(qe=="#"&&ue.eatWhile(B))return C("variable","property");if(qe=="<"&&ue.match("!--")||qe=="-"&&ue.match("->")&&!/\S/.test(ue.string.slice(0,ue.start)))return ue.skipToEnd(),C("comment","comment");if(q.test(qe))return(qe!=">"||!Oe.lexical||Oe.lexical.type!=">")&&(ue.eat("=")?(qe=="!"||qe=="=")&&ue.eat("="):/[<>*+\-|&?]/.test(qe)&&(ue.eat(qe),qe==">"&&ue.eat(qe))),qe=="?"&&ue.eat(".")?C("."):C("operator","operator",ue.current());if(B.test(qe)){ue.eatWhile(B);var st=ue.current();if(Oe.lastType!="."){if(j.propertyIsEnumerable(st)){var lt=j[st];return C(lt.type,lt.style,st)}if(st=="async"&&ue.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return C("async","keyword",st)}return C("variable","variable",st)}}function J(ue){return function(Oe,qe){var st=!1,lt;if(S&&Oe.peek()=="@"&&Oe.match(W))return qe.tokenize=V,C("jsonld-keyword","meta");for(;(lt=Oe.next())!=null&&!(lt==ue&&!st);)st=!st&<=="\\";return st||(qe.tokenize=V),C("string","string")}}function _(ue,Oe){for(var qe=!1,st;st=ue.next();){if(st=="/"&&qe){Oe.tokenize=V;break}qe=st=="*"}return C("comment","comment")}function Q(ue,Oe){for(var qe=!1,st;(st=ue.next())!=null;){if(!qe&&(st=="`"||st=="$"&&ue.eat("{"))){Oe.tokenize=V;break}qe=!qe&&st=="\\"}return C("quasi","string-2",ue.current())}var Y="([{}])";function ce(ue,Oe){Oe.fatArrowAt&&(Oe.fatArrowAt=null);var qe=ue.string.indexOf("=>",ue.start);if(!(qe<0)){if(D){var st=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ue.string.slice(ue.start,qe));st&&(qe=st.index)}for(var lt=0,Kt=!1,Xt=qe-1;Xt>=0;--Xt){var Tr=ue.string.charAt(Xt),Pr=Y.indexOf(Tr);if(Pr>=0&&Pr<3){if(!lt){++Xt;break}if(--lt==0){Tr=="("&&(Kt=!0);break}}else if(Pr>=3&&Pr<6)++lt;else if(B.test(Tr))Kt=!0;else if(/["'\/`]/.test(Tr))for(;;--Xt){if(Xt==0)return;var _t=ue.string.charAt(Xt-1);if(_t==Tr&&ue.string.charAt(Xt-2)!="\\"){Xt--;break}}else if(Kt&&!lt){++Xt;break}}Kt&&!lt&&(Oe.fatArrowAt=Xt)}}var ee={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ie(ue,Oe,qe,st,lt,Kt){this.indented=ue,this.column=Oe,this.type=qe,this.prev=lt,this.info=Kt,st!=null&&(this.align=st)}function xe(ue,Oe){if(!L)return!1;for(var qe=ue.localVars;qe;qe=qe.next)if(qe.name==Oe)return!0;for(var st=ue.context;st;st=st.prev)for(var qe=st.vars;qe;qe=qe.next)if(qe.name==Oe)return!0}function we(ue,Oe,qe,st,lt){var Kt=ue.cc;for(he.state=ue,he.stream=lt,he.marked=null,he.cc=Kt,he.style=Oe,ue.lexical.hasOwnProperty("align")||(ue.lexical.align=!0);;){var Xt=Kt.length?Kt.pop():g?Mt:mt;if(Xt(qe,st)){for(;Kt.length&&Kt[Kt.length-1].lex;)Kt.pop()();return he.marked?he.marked:qe=="variable"&&xe(ue,st)?"variable-2":Oe}}}var he={state:null,column:null,marked:null,cc:null};function fe(){for(var ue=arguments.length-1;ue>=0;ue--)he.cc.push(arguments[ue])}function ae(){return fe.apply(null,arguments),!0}function Fe(ue,Oe){for(var qe=Oe;qe;qe=qe.next)if(qe.name==ue)return!0;return!1}function Le(ue){var Oe=he.state;if(he.marked="def",!!L){if(Oe.context){if(Oe.lexical.info=="var"&&Oe.context&&Oe.context.block){var qe=Me(ue,Oe.context);if(qe!=null){Oe.context=qe;return}}else if(!Fe(ue,Oe.localVars)){Oe.localVars=new Ze(ue,Oe.localVars);return}}x.globalVars&&!Fe(ue,Oe.globalVars)&&(Oe.globalVars=new Ze(ue,Oe.globalVars))}}function Me(ue,Oe){if(Oe)if(Oe.block){var qe=Me(ue,Oe.prev);return qe?qe==Oe.prev?Oe:new rt(qe,Oe.vars,!0):null}else return Fe(ue,Oe.vars)?Oe:new rt(Oe.prev,new Ze(ue,Oe.vars),!1);else return null}function Te(ue){return ue=="public"||ue=="private"||ue=="protected"||ue=="abstract"||ue=="readonly"}function rt(ue,Oe,qe){this.prev=ue,this.vars=Oe,this.block=qe}function Ze(ue,Oe){this.name=ue,this.next=Oe}var Xe=new Ze("this",new Ze("arguments",null));function ft(){he.state.context=new rt(he.state.context,he.state.localVars,!1),he.state.localVars=Xe}function ht(){he.state.context=new rt(he.state.context,he.state.localVars,!0),he.state.localVars=null}function bt(){he.state.localVars=he.state.context.vars,he.state.context=he.state.context.prev}bt.lex=!0;function nt(ue,Oe){var qe=function(){var st=he.state,lt=st.indented;if(st.lexical.type=="stat")lt=st.lexical.indented;else for(var Kt=st.lexical;Kt&&Kt.type==")"&&Kt.align;Kt=Kt.prev)lt=Kt.indented;st.lexical=new ie(lt,he.stream.column(),ue,null,st.lexical,Oe)};return qe.lex=!0,qe}function ut(){var ue=he.state;ue.lexical.prev&&(ue.lexical.type==")"&&(ue.indented=ue.lexical.indented),ue.lexical=ue.lexical.prev)}ut.lex=!0;function yt(ue){function Oe(qe){return qe==ue?ae():ue==";"||qe=="}"||qe==")"||qe=="]"?fe():ae(Oe)}return Oe}function mt(ue,Oe){return ue=="var"?ae(nt("vardef",Oe),mi,yt(";"),ut):ue=="keyword a"?ae(nt("form"),Ct,mt,ut):ue=="keyword b"?ae(nt("form"),mt,ut):ue=="keyword d"?he.stream.match(/^\s*$/,!1)?ae():ae(nt("stat"),jt,yt(";"),ut):ue=="debugger"?ae(yt(";")):ue=="{"?ae(nt("}"),ht,N,ut,bt):ue==";"?ae():ue=="if"?(he.state.lexical.info=="else"&&he.state.cc[he.state.cc.length-1]==ut&&he.state.cc.pop()(),ae(nt("form"),Ct,mt,ut,Gr)):ue=="function"?ae(vn):ue=="for"?ae(nt("form"),ht,xi,mt,bt,ut):ue=="class"||D&&Oe=="interface"?(he.marked="keyword",ae(nt("form",ue=="class"?ue:Oe),wi,ut)):ue=="variable"?D&&Oe=="declare"?(he.marked="keyword",ae(mt)):D&&(Oe=="module"||Oe=="enum"||Oe=="type")&&he.stream.match(/^\s*\w/,!1)?(he.marked="keyword",Oe=="enum"?ae(lo):Oe=="type"?ae(jn,yt("operator"),Ae,yt(";")):ae(nt("form"),zr,yt("{"),nt("}"),N,ut,ut)):D&&Oe=="namespace"?(he.marked="keyword",ae(nt("form"),Mt,mt,ut)):D&&Oe=="abstract"?(he.marked="keyword",ae(mt)):ae(nt("stat"),Ke):ue=="switch"?ae(nt("form"),Ct,yt("{"),nt("}","switch"),ht,N,ut,ut,bt):ue=="case"?ae(Mt,yt(":")):ue=="default"?ae(yt(":")):ue=="catch"?ae(nt("form"),ft,pt,mt,ut,bt):ue=="export"?ae(nt("stat"),ur,ut):ue=="import"?ae(nt("stat"),ii,ut):ue=="async"?ae(mt):Oe=="@"?ae(Mt,mt):fe(nt("stat"),Mt,yt(";"),ut)}function pt(ue){if(ue=="(")return ae(gn,yt(")"))}function Mt(ue,Oe){return Wt(ue,Oe,!1)}function kt(ue,Oe){return Wt(ue,Oe,!0)}function Ct(ue){return ue!="("?fe():ae(nt(")"),jt,yt(")"),ut)}function Wt(ue,Oe,qe){if(he.state.fatArrowAt==he.stream.start){var st=qe?$:z;if(ue=="(")return ae(ft,nt(")"),O(gn,")"),ut,yt("=>"),st,bt);if(ue=="variable")return fe(ft,zr,yt("=>"),st,bt)}var lt=qe?St:Vt;return ee.hasOwnProperty(ue)?ae(lt):ue=="function"?ae(vn,lt):ue=="class"||D&&Oe=="interface"?(he.marked="keyword",ae(nt("form"),Xn,ut)):ue=="keyword c"||ue=="async"?ae(qe?kt:Mt):ue=="("?ae(nt(")"),jt,yt(")"),ut,lt):ue=="operator"||ue=="spread"?ae(qe?kt:Mt):ue=="["?ae(nt("]"),Zn,ut,lt):ue=="{"?le(Re,"}",null,lt):ue=="quasi"?fe(Dt,lt):ue=="new"?ae(Se(qe)):ae()}function jt(ue){return ue.match(/[;\}\)\],]/)?fe():fe(Mt)}function Vt(ue,Oe){return ue==","?ae(jt):St(ue,Oe,!1)}function St(ue,Oe,qe){var st=qe==!1?Vt:St,lt=qe==!1?Mt:kt;if(ue=="=>")return ae(ft,qe?$:z,bt);if(ue=="operator")return/\+\+|--/.test(Oe)||D&&Oe=="!"?ae(st):D&&Oe=="<"&&he.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?ae(nt(">"),O(Ae,">"),ut,st):Oe=="?"?ae(Mt,yt(":"),lt):ae(lt);if(ue=="quasi")return fe(Dt,st);if(ue!=";"){if(ue=="(")return le(kt,")","call",st);if(ue==".")return ae(P,st);if(ue=="[")return ae(nt("]"),jt,yt("]"),ut,st);if(D&&Oe=="as")return he.marked="keyword",ae(Ae,st);if(ue=="regexp")return he.state.lastType=he.marked="operator",he.stream.backUp(he.stream.pos-he.stream.start-1),ae(lt)}}function Dt(ue,Oe){return ue!="quasi"?fe():Oe.slice(Oe.length-2)!="${"?ae(Dt):ae(jt,ve)}function ve(ue){if(ue=="}")return he.marked="string-2",he.state.tokenize=Q,ae(Dt)}function z(ue){return ce(he.stream,he.state),fe(ue=="{"?mt:Mt)}function $(ue){return ce(he.stream,he.state),fe(ue=="{"?mt:kt)}function Se(ue){return function(Oe){return Oe=="."?ae(ue?$e:Ie):Oe=="variable"&&D?ae(pn,ue?St:Vt):fe(ue?kt:Mt)}}function Ie(ue,Oe){if(Oe=="target")return he.marked="keyword",ae(Vt)}function $e(ue,Oe){if(Oe=="target")return he.marked="keyword",ae(St)}function Ke(ue){return ue==":"?ae(ut,mt):fe(Vt,yt(";"),ut)}function P(ue){if(ue=="variable")return he.marked="property",ae()}function Re(ue,Oe){if(ue=="async")return he.marked="property",ae(Re);if(ue=="variable"||he.style=="keyword"){if(he.marked="property",Oe=="get"||Oe=="set")return ae(K);var qe;return D&&he.state.fatArrowAt==he.stream.start&&(qe=he.stream.match(/^\s*:\s*/,!1))&&(he.state.fatArrowAt=he.stream.pos+qe[0].length),ae(T)}else{if(ue=="number"||ue=="string")return he.marked=S?"property":he.style+" property",ae(T);if(ue=="jsonld-keyword")return ae(T);if(D&&Te(Oe))return he.marked="keyword",ae(Re);if(ue=="[")return ae(Mt,te,yt("]"),T);if(ue=="spread")return ae(kt,T);if(Oe=="*")return he.marked="keyword",ae(Re);if(ue==":")return fe(T)}}function K(ue){return ue!="variable"?fe(T):(he.marked="property",ae(vn))}function T(ue){if(ue==":")return ae(kt);if(ue=="(")return fe(vn)}function O(ue,Oe,qe){function st(lt,Kt){if(qe?qe.indexOf(lt)>-1:lt==","){var Xt=he.state.lexical;return Xt.info=="call"&&(Xt.pos=(Xt.pos||0)+1),ae(function(Tr,Pr){return Tr==Oe||Pr==Oe?fe():fe(ue)},st)}return lt==Oe||Kt==Oe?ae():qe&&qe.indexOf(";")>-1?fe(ue):ae(yt(Oe))}return function(lt,Kt){return lt==Oe||Kt==Oe?ae():fe(ue,st)}}function le(ue,Oe,qe){for(var st=3;st<arguments.length;st++)he.cc.push(arguments[st]);return ae(nt(Oe,qe),O(ue,Oe),ut)}function N(ue){return ue=="}"?ae():fe(mt,N)}function te(ue,Oe){if(D){if(ue==":")return ae(Ae);if(Oe=="?")return ae(te)}}function de(ue,Oe){if(D&&(ue==":"||Oe=="in"))return ae(Ae)}function oe(ue){if(D&&ue==":")return he.stream.match(/^\s*\w+\s+is\b/,!1)?ae(Mt,pe,Ae):ae(Ae)}function pe(ue,Oe){if(Oe=="is")return he.marked="keyword",ae()}function Ae(ue,Oe){if(Oe=="keyof"||Oe=="typeof"||Oe=="infer"||Oe=="readonly")return he.marked="keyword",ae(Oe=="typeof"?kt:Ae);if(ue=="variable"||Oe=="void")return he.marked="type",ae(Pt);if(Oe=="|"||Oe=="&")return ae(Ae);if(ue=="string"||ue=="number"||ue=="atom")return ae(Pt);if(ue=="[")return ae(nt("]"),O(Ae,"]",","),ut,Pt);if(ue=="{")return ae(nt("}"),Ue,ut,Pt);if(ue=="(")return ae(O(Bt,")"),Be,Pt);if(ue=="<")return ae(O(Ae,">"),Ae);if(ue=="quasi")return fe(vt,Pt)}function Be(ue){if(ue=="=>")return ae(Ae)}function Ue(ue){return ue.match(/[\}\)\]]/)?ae():ue==","||ue==";"?ae(Ue):fe(Qe,Ue)}function Qe(ue,Oe){if(ue=="variable"||he.style=="keyword")return he.marked="property",ae(Qe);if(Oe=="?"||ue=="number"||ue=="string")return ae(Qe);if(ue==":")return ae(Ae);if(ue=="[")return ae(yt("variable"),de,yt("]"),Qe);if(ue=="(")return fe(Un,Qe);if(!ue.match(/[;\}\)\],]/))return ae()}function vt(ue,Oe){return ue!="quasi"?fe():Oe.slice(Oe.length-2)!="${"?ae(vt):ae(Ae,Et)}function Et(ue){if(ue=="}")return he.marked="string-2",he.state.tokenize=Q,ae(vt)}function Bt(ue,Oe){return ue=="variable"&&he.stream.match(/^\s*[?:]/,!1)||Oe=="?"?ae(Bt):ue==":"?ae(Ae):ue=="spread"?ae(Bt):fe(Ae)}function Pt(ue,Oe){if(Oe=="<")return ae(nt(">"),O(Ae,">"),ut,Pt);if(Oe=="|"||ue=="."||Oe=="&")return ae(Ae);if(ue=="[")return ae(Ae,yt("]"),Pt);if(Oe=="extends"||Oe=="implements")return he.marked="keyword",ae(Ae);if(Oe=="?")return ae(Ae,yt(":"),Ae)}function pn(ue,Oe){if(Oe=="<")return ae(nt(">"),O(Ae,">"),ut,Pt)}function Nr(){return fe(Ae,Or)}function Or(ue,Oe){if(Oe=="=")return ae(Ae)}function mi(ue,Oe){return Oe=="enum"?(he.marked="keyword",ae(lo)):fe(zr,te,hn,Tn)}function zr(ue,Oe){if(D&&Te(Oe))return he.marked="keyword",ae(zr);if(ue=="variable")return Le(Oe),ae();if(ue=="spread")return ae(zr);if(ue=="[")return le(Bn,"]");if(ue=="{")return le(Bi,"}")}function Bi(ue,Oe){return ue=="variable"&&!he.stream.match(/^\s*:/,!1)?(Le(Oe),ae(hn)):(ue=="variable"&&(he.marked="property"),ue=="spread"?ae(zr):ue=="}"?fe():ue=="["?ae(Mt,yt("]"),yt(":"),Bi):ae(yt(":"),zr,hn))}function Bn(){return fe(zr,hn)}function hn(ue,Oe){if(Oe=="=")return ae(kt)}function Tn(ue){if(ue==",")return ae(mi)}function Gr(ue,Oe){if(ue=="keyword b"&&Oe=="else")return ae(nt("form","else"),mt,ut)}function xi(ue,Oe){if(Oe=="await")return ae(xi);if(ue=="(")return ae(nt(")"),bi,ut)}function bi(ue){return ue=="var"?ae(mi,qr):ue=="variable"?ae(qr):fe(qr)}function qr(ue,Oe){return ue==")"?ae():ue==";"?ae(qr):Oe=="in"||Oe=="of"?(he.marked="keyword",ae(Mt,qr)):fe(Mt,qr)}function vn(ue,Oe){if(Oe=="*")return he.marked="keyword",ae(vn);if(ue=="variable")return Le(Oe),ae(vn);if(ue=="(")return ae(ft,nt(")"),O(gn,")"),ut,oe,mt,bt);if(D&&Oe=="<")return ae(nt(">"),O(Nr,">"),ut,vn)}function Un(ue,Oe){if(Oe=="*")return he.marked="keyword",ae(Un);if(ue=="variable")return Le(Oe),ae(Un);if(ue=="(")return ae(ft,nt(")"),O(gn,")"),ut,oe,bt);if(D&&Oe=="<")return ae(nt(">"),O(Nr,">"),ut,Un)}function jn(ue,Oe){if(ue=="keyword"||ue=="variable")return he.marked="type",ae(jn);if(Oe=="<")return ae(nt(">"),O(Nr,">"),ut)}function gn(ue,Oe){return Oe=="@"&&ae(Mt,gn),ue=="spread"?ae(gn):D&&Te(Oe)?(he.marked="keyword",ae(gn)):D&&ue=="this"?ae(te,hn):fe(zr,te,hn)}function Xn(ue,Oe){return ue=="variable"?wi(ue,Oe):Br(ue,Oe)}function wi(ue,Oe){if(ue=="variable")return Le(Oe),ae(Br)}function Br(ue,Oe){if(Oe=="<")return ae(nt(">"),O(Nr,">"),ut,Br);if(Oe=="extends"||Oe=="implements"||D&&ue==",")return Oe=="implements"&&(he.marked="keyword"),ae(D?Ae:Mt,Br);if(ue=="{")return ae(nt("}"),$r,ut)}function $r(ue,Oe){if(ue=="async"||ue=="variable"&&(Oe=="static"||Oe=="get"||Oe=="set"||D&&Te(Oe))&&he.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return he.marked="keyword",ae($r);if(ue=="variable"||he.style=="keyword")return he.marked="property",ae(Qn,$r);if(ue=="number"||ue=="string")return ae(Qn,$r);if(ue=="[")return ae(Mt,te,yt("]"),Qn,$r);if(Oe=="*")return he.marked="keyword",ae($r);if(D&&ue=="(")return fe(Un,$r);if(ue==";"||ue==",")return ae($r);if(ue=="}")return ae();if(Oe=="@")return ae(Mt,$r)}function Qn(ue,Oe){if(Oe=="!"||Oe=="?")return ae(Qn);if(ue==":")return ae(Ae,hn);if(Oe=="=")return ae(kt);var qe=he.state.lexical.prev,st=qe&&qe.info=="interface";return fe(st?Un:vn)}function ur(ue,Oe){return Oe=="*"?(he.marked="keyword",ae(Vn,yt(";"))):Oe=="default"?(he.marked="keyword",ae(Mt,yt(";"))):ue=="{"?ae(O(Tt,"}"),Vn,yt(";")):fe(mt)}function Tt(ue,Oe){if(Oe=="as")return he.marked="keyword",ae(yt("variable"));if(ue=="variable")return fe(kt,Tt)}function ii(ue){return ue=="string"?ae():ue=="("?fe(Mt):ue=="."?fe(Vt):fe(Si,An,Vn)}function Si(ue,Oe){return ue=="{"?le(Si,"}"):(ue=="variable"&&Le(Oe),Oe=="*"&&(he.marked="keyword"),ae(Zt))}function An(ue){if(ue==",")return ae(Si,An)}function Zt(ue,Oe){if(Oe=="as")return he.marked="keyword",ae(Si)}function Vn(ue,Oe){if(Oe=="from")return he.marked="keyword",ae(Mt)}function Zn(ue){return ue=="]"?ae():fe(O(kt,"]"))}function lo(){return fe(nt("form"),zr,yt("{"),nt("}"),O(ot,"}"),ut,ut)}function ot(){return fe(zr,hn)}function Lt(ue,Oe){return ue.lastType=="operator"||ue.lastType==","||q.test(Oe.charAt(0))||/[,.]/.test(Oe.charAt(0))}function oi(ue,Oe,qe){return Oe.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Oe.lastType)||Oe.lastType=="quasi"&&/\{\s*$/.test(ue.string.slice(0,ue.pos-(qe||0)))}return{startState:function(ue){var Oe={tokenize:V,lastType:"sof",cc:[],lexical:new ie((ue||0)-d,0,"block",!1),localVars:x.localVars,context:x.localVars&&new rt(null,null,!1),indented:ue||0};return x.globalVars&&typeof x.globalVars=="object"&&(Oe.globalVars=x.globalVars),Oe},token:function(ue,Oe){if(ue.sol()&&(Oe.lexical.hasOwnProperty("align")||(Oe.lexical.align=!1),Oe.indented=ue.indentation(),ce(ue,Oe)),Oe.tokenize!=_&&ue.eatSpace())return null;var qe=Oe.tokenize(ue,Oe);return X=="comment"?qe:(Oe.lastType=X=="operator"&&(R=="++"||R=="--")?"incdec":X,we(Oe,qe,X,R,ue))},indent:function(ue,Oe){if(ue.tokenize==_||ue.tokenize==Q)return c.Pass;if(ue.tokenize!=V)return 0;var qe=Oe&&Oe.charAt(0),st=ue.lexical,lt;if(!/^\s*else\b/.test(Oe))for(var Kt=ue.cc.length-1;Kt>=0;--Kt){var Xt=ue.cc[Kt];if(Xt==ut)st=st.prev;else if(Xt!=Gr&&Xt!=bt)break}for(;(st.type=="stat"||st.type=="form")&&(qe=="}"||(lt=ue.cc[ue.cc.length-1])&&(lt==Vt||lt==St)&&!/^[,\.=+\-*:?[\(]/.test(Oe));)st=st.prev;b&&st.type==")"&&st.prev.type=="stat"&&(st=st.prev);var Tr=st.type,Pr=qe==Tr;return Tr=="vardef"?st.indented+(ue.lastType=="operator"||ue.lastType==","?st.info.length+1:0):Tr=="form"&&qe=="{"?st.indented:Tr=="form"?st.indented+d:Tr=="stat"?st.indented+(Lt(ue,Oe)?b||d:0):st.info=="switch"&&!Pr&&x.doubleIndentSwitch!=!1?st.indented+(/^(?:case|default)\b/.test(Oe)?d:2*d):st.align?st.column+(Pr?0:1):st.indented+(Pr?0:d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:S,jsonMode:g,expressionAllowed:oi,skipExpression:function(ue){we(ue,"atom","atom","true",new c.StringStream("",2,null))}}}),c.registerHelper("wordChars","javascript",/[\w$]/),c.defineMIME("text/javascript","javascript"),c.defineMIME("text/ecmascript","javascript"),c.defineMIME("application/javascript","javascript"),c.defineMIME("application/x-javascript","javascript"),c.defineMIME("application/ecmascript","javascript"),c.defineMIME("application/json",{name:"javascript",json:!0}),c.defineMIME("application/x-json",{name:"javascript",json:!0}),c.defineMIME("application/manifest+json",{name:"javascript",json:!0}),c.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),c.defineMIME("text/typescript",{name:"javascript",typescript:!0}),c.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},76489:(h,I)=>{"use strict";/*!
|
|
42
42
|
* cookie
|
|
43
43
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
44
44
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
@@ -72,24 +72,24 @@ b`.split(/\n/).length!=3?function(e){for(var n=0,u=[],l=e.length;n<=l;){var f=e.
|
|
|
72
72
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
73
73
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
74
74
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
75
|
-
*/function v(g){return g instanceof c||g instanceof Date||g instanceof RegExp}function x(g){if(g instanceof c){var L=c.alloc?c.alloc(g.length):new c(g.length);return g.copy(L),L}else{if(g instanceof Date)return new Date(g.getTime());if(g instanceof RegExp)return new RegExp(g);throw new Error("Unexpected situation")}}function d(g){var L=[];return g.forEach(function(D,B){typeof D=="object"&&D!==null?Array.isArray(D)?L[B]=d(D):v(D)?L[B]=x(D):L[B]=S({},D):L[B]=D}),L}function b(g,L){return L==="__proto__"?void 0:g[L]}var S=h.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var g=arguments[0],L=Array.prototype.slice.call(arguments,1),D,B,j;return L.forEach(function(q){typeof q!="object"||q===null||Array.isArray(q)||Object.keys(q).forEach(function(W){if(B=b(g,W),D=b(q,W),D!==g)if(typeof D!="object"||D===null){g[W]=D;return}else if(Array.isArray(D)){g[W]=d(D);return}else if(v(D)){g[W]=x(D);return}else if(typeof B!="object"||B===null||Array.isArray(B)){g[W]=S({},D);return}else{g[W]=S(B,D);return}})}),g}},42409:(h,I,o)=>{"use strict";o.r(I),o.d(I,{Console:()=>pd});var c={};o.r(c),o.d(c,{JsonPatchError:()=>Ir,_areEquals:()=>$o,applyOperation:()=>cr,applyPatch:()=>Gn,applyReducer:()=>nc,deepClone:()=>rc,getValueByPointer:()=>Lr,validate:()=>
|
|
75
|
+
*/function v(g){return g instanceof c||g instanceof Date||g instanceof RegExp}function x(g){if(g instanceof c){var L=c.alloc?c.alloc(g.length):new c(g.length);return g.copy(L),L}else{if(g instanceof Date)return new Date(g.getTime());if(g instanceof RegExp)return new RegExp(g);throw new Error("Unexpected situation")}}function d(g){var L=[];return g.forEach(function(D,B){typeof D=="object"&&D!==null?Array.isArray(D)?L[B]=d(D):v(D)?L[B]=x(D):L[B]=S({},D):L[B]=D}),L}function b(g,L){return L==="__proto__"?void 0:g[L]}var S=h.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var g=arguments[0],L=Array.prototype.slice.call(arguments,1),D,B,j;return L.forEach(function(q){typeof q!="object"||q===null||Array.isArray(q)||Object.keys(q).forEach(function(W){if(B=b(g,W),D=b(q,W),D!==g)if(typeof D!="object"||D===null){g[W]=D;return}else if(Array.isArray(D)){g[W]=d(D);return}else if(v(D)){g[W]=x(D);return}else if(typeof B!="object"||B===null||Array.isArray(B)){g[W]=S({},D);return}else{g[W]=S(B,D);return}})}),g}},42409:(h,I,o)=>{"use strict";o.r(I),o.d(I,{Console:()=>pd});var c={};o.r(c),o.d(c,{JsonPatchError:()=>Ir,_areEquals:()=>$o,applyOperation:()=>cr,applyPatch:()=>Gn,applyReducer:()=>nc,deepClone:()=>rc,getValueByPointer:()=>Lr,validate:()=>mu,validator:()=>Zi});var v={};o.r(v),o.d(v,{compare:()=>wu,generate:()=>Da,observe:()=>bu,unobserve:()=>qs});var x={};o.r(x),o.d(x,{cookie:()=>vl,header:()=>Zu,path:()=>Qu,query:()=>Fc});var d=o(67294);function b(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function S(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function g(t,r,i){return r&&S(t.prototype,r),i&&S(t,i),t}function L(t,r,i){return r in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function D(){return D=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},D.apply(this,arguments)}function B(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),i.push.apply(i,a)}return i}function j(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};r%2?B(Object(i),!0).forEach(function(a){L(t,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(i,a))})}return t}function q(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&M(t,r)}function W(t){return W=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},W(t)}function M(t,r){return M=Object.setPrototypeOf||function(a,s){return a.__proto__=s,a},M(t,r)}function X(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function R(t,r){if(t==null)return{};var i={},a=Object.keys(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(r.indexOf(s)>=0)&&(i[s]=t[s]);return i}function C(t,r){if(t==null)return{};var i=R(t,r),a,s;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(t);for(s=0;s<p.length;s++)a=p[s],!(r.indexOf(a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}function V(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function J(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:V(t)}function _(t){var r=X();return function(){var a=W(t),s;if(r){var p=W(this).constructor;s=Reflect.construct(a,arguments,p)}else s=a.apply(this,arguments);return J(this,s)}}function Q(t,r){return ee(t)||xe(t,r)||we(t,r)||ae()}function Y(t){return ce(t)||ie(t)||we(t)||fe()}function ce(t){if(Array.isArray(t))return he(t)}function ee(t){if(Array.isArray(t))return t}function ie(t){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(t))return Array.from(t)}function xe(t,r){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var i=[],a=!0,s=!1,p=void 0;try{for(var y=t[Symbol.iterator](),E;!(a=(E=y.next()).done)&&(i.push(E.value),!(r&&i.length===r));a=!0);}catch(w){s=!0,p=w}finally{try{!a&&y.return!=null&&y.return()}finally{if(s)throw p}}return i}}function we(t,r){if(!!t){if(typeof t=="string")return he(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return he(t,r)}}function he(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=t[i];return a}function fe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
76
76
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
77
77
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fe(t,r){var i;if(typeof Symbol=="undefined"||t[Symbol.iterator]==null){if(Array.isArray(t)||(i=we(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(w){throw w},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
78
78
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,y=!1,E;return{s:function(){i=t[Symbol.iterator]()},n:function(){var w=i.next();return p=w.done,w},e:function(w){y=!0,E=w},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(y)throw E}}}}function Le(t,r){return r={exports:{}},t(r,r.exports),r.exports}var Me=Le(function(t){function r(k,G){for(var ne=0,re=0;re<k.length;re++)ne=(ne<<5)-ne+k.charCodeAt(re),ne|=0;return G[Math.abs(ne)%G.length]}function i(k,G){var ne=G.namespace;if(G.useColors){var re=G.color,se="[3"+(re<8?re:"8;5;"+re),ye=" ".concat(se,";1m").concat(ne," [0m");k[0]=ye+k[0].split(`
|
|
79
79
|
`).join(`
|
|
80
|
-
`+ye)}else k[0]=ne+" "+k[0]}function a(k,G){if(k[0]=(G.useColors?"%c":"")+G.namespace,!!G.useColors){var ne="color: "+G.color,re=0,se=0;k[0].replace(/%[a-zA-Z%]/g,function(ye){ye!=="%%"&&(re++,ye==="%c"&&(se=re))}),k.splice(se,0,ne)}}var s=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p(){var k;try{k=localStorage.getItem("debug")}catch(G){}return!k&&typeof process!="undefined"&&"env"in process&&(k={}.DEBUG),{namespaces:k||"",colors:s,useColors:!0,formatArgs:a}}function y(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function E(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,G=arguments.length>1?arguments[1]:void 0;return function(){for(var ne=arguments.length,re=new Array(ne),se=0;se<ne;se++)re[se]=arguments[se];k&&re.unshift(k);var ye=G.namespaces.split(",").map(function(Pe){return Pe[Pe.length-1]==="*"?new RegExp("^"+Pe.slice(0,Pe.length-1)+".*$"):new RegExp("^"+Pe+"$")}),ge=ye.some(function(Pe){return Pe.test(k)}),Ee={color:r(k,G.colors),namespace:k,useColors:G.useColors};if(!1)var me}}function w(k){return E(k,y())}function A(k){return E(k,p())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=A:t.exports=w}),Te=Me("informed:ObjMap "),rt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},Ze=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(p,y){return p!=null?p[y]:p},r);return s===void 0||s===r?a:s},Xe=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ft=function(r){return r.replace(Xe(r),"").replace(/\./,"")},ht=function(r,i){var a=Xe(i),s=ft(i),p=a?Ze(r,a):r;return!!(p&&Object.hasOwnProperty.call(p,s.replace(/\[(.*)\]/,"$1")))},bt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,E){return y===E.length-1?(s[p]=a,s[p]):s[p]===void 0?(Number.isInteger(+E[y+1])?s[p]=[]:s[p]={},s[p]):(Number.isInteger(+E[y+1])&&!Array.isArray(s[p])&&(s[p]=[]),s[p])},r)},nt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,E){return s===void 0?s:(y===E.length-1&&(delete s[p],a=!0),s[p])},r),a},ut=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,E){return s===void 0?s:(y===E.length-1&&Array.isArray(s)&&(a=s.splice(p,1)),s[p])},r),a},yt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(a){return r[a]})},mt=function(r){var i=rt(r);return Number.isInteger(+i[i.length-1])},pt=function(){function t(){b(this,t)}return g(t,null,[{key:"empty",value:function(i){return yt(i).length===0}},{key:"get",value:function(i,a){var s=Ze(i,a);return s}},{key:"has",value:function(i,a){return ht(i,a)}},{key:"set",value:function(i,a,s){if(s!==void 0)Te("SETTING",a,s),bt(i,a,s);else if(mt(a)&&t.get(i,a)!==void 0){Te("Special case SETTING",a,"to undefined"),bt(i,a,void 0);var p=rt(a);p=p.slice(0,p.length-1),Mt(i,p)}else!mt(a)&&t.get(i,a)!==void 0&&(Te("Special case REMOVING",a,"from object completley"),t.delete(i,a))}},{key:"delete",value:function(i,a){Te("DELETE",a),mt(a)?(Te("ARRAY",a),this.pullOut(i,a)):nt(i,a);var s=rt(a);s=s.slice(0,s.length-1),Mt(i,s)}},{key:"pullOut",value:function(i,a){var s=rt(a),p=s[s.length-1];s=s.slice(0,s.length-1),Te("Pulling out:",s,"index",p);var y=Ze(i,s);Te("Array",y),Array.isArray(y)&&ut(y,p),Mt(i,s)}}]),t}();function Mt(t,r){if(r.length!==0){var i=Ze(t,r);(Array.isArray(i)?i.every(function(a){return a==null}):JSON.stringify(i)==="{}")&&nt(t,r),Mt(t,r.slice(0,r.length-1))}}var kt=d.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),Ct=d.createContext({}),Wt=d.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),jt=d.createContext(),Vt=d.createContext(),St=d.createContext(),Dt=d.createContext(),ve=d.createContext(),z=d.createContext(),$=d.createContext(),Se=d.createContext();function Ie(){var t=(0,d.useContext)(Wt);return t}function $e(t){var r=(0,d.useRef)(),i=(0,d.useRef)(!0),a=(0,d.useState)(t),s=Q(a,2),p=s[0],y=s[1];r.current=p;var E=function(k){r.current=k,i.current&&y(k)},w=function(){return r.current};return(0,d.useEffect)(function(){return function(){i.current=!1}},[]),[p,E,w]}var Ke=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},P=function(r){var i={};if(r.inner){if(r.inner.length===0){pt.set(i,r.path,r.message);return}var a=Fe(r.inner),s;try{for(a.s();!(s=a.n()).done;){var p=s.value;pt.get(i,p.path)||pt.set(i,p.path,p.message)}}catch(y){a.e(y)}finally{a.f()}}return i},Re=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var a=P(s);return a}},K=function(r){if(r.inner){if(r.inner.length===0)return;var i=r.inner[0];return i.message}},T=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(a){return K(a)}},O=function(r,i){r(i);var a={};return r.errors&&r.errors.forEach(function(s){var p=s.message,y=s.dataPath,E=s.keyword,w=s.params,A=y;E==="required"&&(A="".concat(A,".").concat(w.missingProperty)),A=A.replace(".",""),pt.set(a,A,p)}),a},le=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,a=r=="x"?i:i&3|8;return a.toString(16)})},N=function(r,i){var a;return function(){for(var p=arguments.length,y=new Array(p),E=0;E<p;E++)y[E]=arguments[E];var w=function(){clearTimeout(a),r.apply(void 0,y)};clearTimeout(a),a=setTimeout(w,i)}},te=function(r,i,a){var s=i["ui:control"],p=i["informed:props"],y=i["input:props"],E=i["ui:before"],w=i["ui:after"],A=i.oneOf,k=i.items,G=i.enum,ne=i.title,re=i.minimum,se=i.maximum,ye=i.minLength,ge=i.maxLength,Ee=i.pattern,me=i.type,Pe=i.properties,Ge=le();y&&y.id&&(Ge=y.id);var je={componentType:s,field:a?"".concat(a,".").concat(r):r,type:me,uiBefore:E,uiAfter:w,properties:me==="object"?Pe:void 0,items:me==="array"?k:void 0,props:j(j({label:ne,id:Ge,min:re,max:se,minLength:ye,maxLength:ge,pattern:Ee},p),y)};if(A){var He=i.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});je.props.options=He}if(G){var Ne=i.enum.map(function(We){return{value:We,label:We}});je.props.options=Ne}if(k&&k.oneOf){var Ve=k.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});je.props.options=Ve}return je},de=function(r,i,a){if(!r||i)return[];var s=r.properties,p=s===void 0?{}:s,y=r.allOf,E=r.propertyOrder,w=E===void 0?[]:E;if(Object.keys(p).length>0){var A=Object.keys(p).sort(function(k,G){var ne=w.indexOf(k),re=w.indexOf(G);return(ne>-1?ne:w.length+1)-(re>-1?re:w.length+1)}).map(function(k){var G=p[k],ne=te(k,G,a);return ne});return y&&A.push({componentType:"conditionals",allOf:y}),A}return[]},oe=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},pe=function(r,i){if(typeof r=="string")return r.split("").map(function(a){return a==="#"?/\d/:a==="*"?/[\w]/:a});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},Ae=function(r,i){for(var a=0,s=-1,p=!0;p&&a<r.length;)r[a]==i[a]?s=a:p=!1,a=a+1;return s},Be=function(r,i){if(!r)return{val:r,offset:0};var a="".concat(r),s=pe(i,a),p=s.findIndex(function(ge){return typeof ge!="string"}),y=s.length-Y(s).reverse().findIndex(function(ge){return typeof ge!="string"}),E=[],w=a.split(""),A=0,k=0,G=Ae(s.slice(0,p),w.slice(0,p));G>-1&&(A=G+1,E=E.concat(s.slice(0,G+1)),k=G+1),G<0&&(E=E.concat(s.slice(0,p)),k=p);for(var ne=k;ne<s.length;ne++){var re=s[ne];if(A!=w.length){var se=w[A];if(typeof re=="function")E.push(re(se)),A=A+1;else{var ye=typeof re=="string"?re===se:re.test(se);ye&&typeof re=="string"?(E.push(re),A=A+1):!ye&&typeof re=="string"?A!=w.length&&E.push(re):ye&&typeof re!="string"?(E.push(se),A=A+1):!ye&&typeof re!="string"&&(A=A+1,ne=ne-1)}}else if(typeof re=="string"&&ne>=y)E.push(re);else break}return{value:E.join(""),offset:a?E.length-a.length:0}},Ue=function(r,i){var a,s,p=new Intl.NumberFormat(r,i),y=new Intl.NumberFormat(r),E=(a=(s=y.formatToParts(.1).find(function(ge){var Ee=ge.type;return Ee==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:".";function w(ge,Ee){return ge instanceof RegExp&&Ee instanceof RegExp&&ge.source===Ee.source&&ge.global===Ee.global&&ge.ignoreCase===Ee.ignoreCase&&ge.multiline===Ee.multiline}function A(ge,Ee){for(var me=ge.length;me--;)if(Ee(ge[me]))return me;return-1}function k(ge,Ee,me){var Pe=Y(ge);return Array.isArray(me)?Pe.splice.apply(Pe,[Ee,0].concat(Y(me))):Pe.splice(Ee,0,me),Pe}function G(ge){return"".concat(ge).replace(/\D/g,"")}function ne(ge){return"".concat(ge).split(E).map(function(Ee){return G(Ee)}).join(".")}function re(ge){if(typeof ge=="number")return ge;var Ee=parseFloat(ne(ge));return Number.isNaN(Ee)?void 0:Ee}function se(ge){var Ee=ne(ge),me="".concat(Ee).split(".")[1],Pe=p.formatToParts(Number(Ee));me==="0"&&Pe.push({type:"decimal",value:E},{type:"fraction",value:me});var Ge=Pe.reduce(function(Ne,Ve){var We=Ve.type,Je=Ve.value;return["decimal","fraction"].includes(We)&&me==null?Ne:["integer","fraction"].includes(We)?[].concat(Y(Ne),Y(Je.split("").filter(function(ze,et){return We==="fraction"?et<me.length:!0}).map(function(){return/\d/}))):We==="currency"?[].concat(Y(Ne),Y(Je.split(""))):[].concat(Y(Ne),[Je])},[]),je=A(Ge,function(Ne){return w(Ne,/\d/)});Ge.indexOf(E)===-1&&"".concat(ge).indexOf(E)!==-1&&(Ge=k(Ge,je+1,[E,"[]"]),je+=2);var He=Ge.slice(je+1).join("");return Ge=[].concat(Y(Ge.slice(0,je+1)),[He]),Ge}var ye=function(Ee){if(Ee!=null)return re(Ee)};return{formatter:se,parser:ye}},Qe=Object.freeze({__proto__:null,getChildDisplayName:Ke,yupToFormErrors:P,validateYupSchema:Re,yupToFormError:K,validateYupField:T,validateAjvSchema:O,uuidv4:le,debounce:N,computeFieldFromProperty:te,computeFieldsFromSchema:de,getSchemaPathFromJsonPath:oe,informedFormat:Be,createIntlNumberFormatter:Ue}),vt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?d.useLayoutEffect:d.useEffect,Et=function(r){var i=r.value,a=r.inputRef,s=r.maintainCursor,p=s===void 0?!0:s,y=$e(0),E=Q(y,3),w=E[0],A=E[1],k=E[2],G=$e(0),ne=Q(G,3),re=ne[0],se=ne[1],ye=ne[2];return vt(function(){if(a.current!=null&&k()){var ge=k()+ye();ye()!=0&&p?a.current.setSelectionRange(ge+1,ge+1):p&&a.current.setSelectionRange(ge,ge)}},[i]),{setCursorOffset:se,setCursor:A,cursor:w,getCursor:k,cursorOffset:re}},Bt=function(r,i){var a=(0,d.useRef)(!0),s=a.current;(0,d.useEffect)(function(){if(s)a.current=!1;else return r()},i)},Pt=Me("informed:useField "),pn=function(r,i,a,s,p){if(r!=null){if(p)return p(r);if(i)return i(r);if(a&&!s){var y=Be(r,a);return y.value}return r}},Nr=function(r,i,a,s){if(i&&a)return i(r);if(s){var p=Be(r,s);return p.value}return r},Or=function(r,i,a){var s=a.required;if(r||i)return function(p,y){if(i)return T(i,p);if(r)return r(p,y)};if(s)return function(p){return hn(p,s)}},mi=function(r){var i=r.fieldType,a=r.setValue,s=r.onChange,p=r.multiple,y=r.ref,E=function(A){return a(A)};return(i==="text"||i==="textArea"||i==="number")&&(E=function(A){return a(A.target.value,A)}),i==="select"&&(E=function(){var A=Array.from(y.current).filter(function(k){return k.selected}).map(function(k){return k.value});a(p?A:A[0]||"")}),i==="checkbox"&&(E=function(A){a(A.target.checked),s&&s(A)}),function(w){E(w)}},zr=function(r){var i=r.setTouched,a=r.onBlur;return function(s){i(!0),a&&a(s)}},Bi=function(r){var i=r.fieldType,a=r.maskedValue,s=r.multiple,p=r.value;switch(i){case"text":case"number":return!a&&a!==0?"":a;case"textArea":return a||"";case"select":return p||(s?[]:"");case"checkbox":return!!p;default:return p}},Bn=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},hn=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function Tn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,a=t.validate,s=t.asyncValidate,p=t.validationSchema,y=t.mask,E=t.maskWithCursorOffset,w=t.format,A=t.parse,k=t.formatter,G=t.parser,ne=t.initialValue,re=t.validateOnChange,se=t.validateOnBlur,ye=t.validateOnMount,ge=t.asyncValidateOnBlur,Ee=t.maskOnBlur,me=t.allowEmptyString,Pe=t.onValueChange,Ge=t.notify,je=t.keepState,He=t.maintainCursor,Ne=t.debug,Ve=t.shadow,We=t.step,Je=t.fieldType,ze=t.multiple,et=t.onChange,At=t.onBlur,Nt=t.formController,Ht=t.relevant,or=t.required,Mr=t.keepStateIfRelevant,Cr=t.initialize,Jr=t.formatterDependencies,wr=Jr===void 0?[]:Jr,Dr=C(t,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),Sn=(0,d.useState)(le()),Yt=Q(Sn,1),Rt=Yt[0],Ut=(0,d.useContext)(kt),ar=(0,d.useContext)(Se),an=ar||Mr,mr=Ie(),hs=(0,d.useRef)(),Ll=(0,d.useRef)(!0),ha=(0,d.useRef)(),Di=(0,d.useRef)(!1),Dl=function(){return!Di.current},Ff=function(){return Di.current};Nt&&(Ut=Nt.updater,mr=Nt.getFormApi());var yi=Or(a,p,{required:or}),Nl=(0,d.useState)(function(){return Ut.getInitialValue(i)}),sm=Q(Nl,1),lm=sm[0],kf=Ut.getSavedValue(i),Mf,Oh;(je||an)&&kf?(Pt("Setting field ".concat(Pd,"'s kept state"),kf),Mf=kf.value,Oh=kf.touched,mr.removeSavedState(Pd)):ne!=null?Mf=ne:Mf=lm;var um=$e(pn(Mf,y,k,G,Cr)),hd=Q(um,3),Bl=hd[0],vd=hd[1],fm=hd[2],cm=$e(ye?yi(Bl):void 0),gd=Q(cm,3),Th=gd[0],Ph=gd[1],dm=gd[2],pm=$e(Oh),yd=Q(pm,3),Ih=yd[0],hm=yd[1],Fh=yd[2],vm=(0,d.useState)(function(){return Nr(Bl,w,A,k)}),kh=Q(vm,2),md=kh[0],xd=kh[1],Mh=(0,d.useRef)();Mh.current=md;var Rh=(0,d.useRef)(ne),va=(0,d.useRef)(i),Lh=(0,d.useRef)();Rh.current=ne,va.current=i;var gm=(0,d.useRef)(null),Ni=d.useMemo(function(){return r||gm},[]),bd=Et({value:Bl,inputRef:Ni,maintainCursor:!!He}),wd=bd.getCursor,ym=bd.setCursor,Sd=bd.setCursorOffset,mm=function(){return!0},Ad=function(sr){var sn=Ht||mm,Dn=mr.getFullField(va.current)||va.current,Jt={path:Dn,parentPath:Dn.replace(/(.*)[.[].*/,"$1"),get:function(Nn,Vl){return pt.get(Nn,Vl)}};return ar&&ar.relevant?sn(sr,Jt)&&ar.relevant(sr,Jt):sn(sr,Jt)},xm=$e(Ad(mr.getValues())),Ed=Q(xm,3),Rf=Ed[0],bm=Ed[1],Dh=Ed[2],wm=function(sr){return ar&&ar.relevant?ar.relevant(sr):!0},Sm=function(){var sr=Ad(mr.getValues()),sn=Dh();return sr!=sn&&bm(sr),sr};(0,d.useEffect)(function(){!Rf&&!je&&hs.current.reset()},[Rf]);var ni=function(){return Ve?mr.getDerrivedValue(i):fm()},Ul=function(sr){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Dn=sn.preventUpdate;We&&mr.getStep()<We?(Pt("Setting ".concat(i,"'s error to undefined as we are not at that step")),Ph(void 0),Ut.setError(Rt,void 0,!Dn)):(Pt("Setting ".concat(i,"'s error to ").concat(sr)),Ph(sr),Ut.setError(Rt,sr,!Dn))},Cd=function(sr,sn){var Dn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=sr;Di.current=!0,Pt("Setting ".concat(i," to ").concat(Jt)),Cr&&(Jt=Cr(Jt));var ga=mr.getOptions(),Nn=Jt;if(Jt===""&&!me&&!Dn.allowEmptyString&&!ga.allowEmptyStrings&&(Jt=void 0),(t.type==="number"||Je==="number")&&Jt!==void 0&&(Jt=+Jt),sn&&sn.target&&sn.target.selectionStart&&ym(sn.target.selectionStart),y&&!Ee&&(Nn=y(Jt,wd()),Jt=y(Jt,wd())),E&&!Ee){var Vl=E(Jt,wd());Nn=Vl.value,Jt=Vl.value,Sd(Vl.offset)}if(w&&A&&(Jt=A(Jt),Nn=w(Jt)),k){var Nh=Be(Jt,k);Sd(Nh.offset),Nn=Nh.value,Jt=Nn}G&&(Jt=Jt!=null?G(Jt):Jt),yi&&re&&!Dn.initial&&(Pt("Validating after change ".concat(i," ").concat(Jt)),Ul(yi(Jt,mr.getValues()))),vd(Jt),xd(Nn),Pe&&Pe(Jt),Ut.setValue(Rt,Jt,!Dn.preventUpdate)};Bt(function(){hs.current.setValue(Mh.current)},Y(wr));var Od=function(sr,sn){var Dn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=Dn.preventUpdate;if(Pt("Field ".concat(i," has been touched")),yi&&se&&!sn&&sr&&(Pt("Validating after blur ".concat(i," ").concat(ni())),Ul(yi(ni(),mr.getValues()))),s&&ge&&!sn&&sr&&(Pt("Validating async after blur ".concat(i," ").concat(ni())),s(ni(),mr.getValues())),y&&Ee){var ga=y(ni());vd(ga),xd(ga),Pe&&Pe(ga),Ut.setValue(Rt,ga,!Jt)}if(E&&Ee){var Nn=E(ni());Sd(Nn.offset),vd(Nn.value),xd(Nn.value),Pe&&Pe(Nn.value),Ut.setValue(Rt,Nn.value,!Jt)}hm(sr),Ut.setTouched(Rt,sr,!Jt)},Am=function(){var sr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},sn=sr.preventUpdate,Dn=pn(Rh.current||Ut.getInitialValue(va.current),y,k,G,Cr);Cd(Dn,null,{initial:!0,preventUpdate:sn}),Ul(ye?yi(Dn):void 0,{preventUpdate:sn}),Od(void 0,!0,{preventUpdate:sn}),Di.current=!1},Em=function(sr){yi&&(Pt("Field validating ".concat(i," ").concat(ni())),Ul(yi(ni(),sr||mr.getValues())))},Cm=function(sr){s&&(Pt("Field async validating ".concat(i," ").concat(ni())),s(ni(),sr||mr.getValues()))},Td={setValue:Cd,setTouched:Od,setError:Ul,reset:Am,validate:Em,asyncValidate:Cm,getValue:ni,getTouched:Fh,getError:dm,getIsRelevant:Dh,getDirty:Ff,getPristine:Dl,getFieldState:function(){return{value:ni(),touched:Fh(),dirty:Ff(),pristine:Dl()}},relevant:Ad,multistepRelevant:wm,checkRelevant:Sm};hs.current=Td;var jl={value:Bl,error:Th,touched:Ih,maskedValue:md,isRelevant:Rf,dirty:Di.current,pristine:!Di.current};Ve&&(jl={error:Th,touched:Ih}),Pt("Render",mr.getFullField(i),jl),vt(function(){var _r=mr.getFullField(va.current);return Pt("Register",Rt,va.current),ha.current={field:_r,fieldId:Rt,fieldApi:Td,fieldState:jl,notify:Ge,keepState:je,inMultistep:an,shadow:Ve},Ut.register(Rt,ha.current),function(){var sr=mr.getFullField(va.current);Pt("Deregister",Rt,sr),Ut.deregister(Rt)}},[]),(0,d.useEffect)(function(){var _r=mr.getFullField(i);return Ll.current?Ll.current=!1:(Pt("Update",i,an),ha.current.field=_r,Ut.update(Rt,ha.current,Lh.current)),function(){Lh.current=_r}},[i]),vt(function(){Ne&&Ni&&(Ni.current.style.border="5px solid orange",setTimeout(function(){Ni.current.style.borderWidth="2px",Ni.current.style.borderStyle="inset",Ni.current.style.borderColor="initial",Ni.current.style.borderImage="initial"},500))});var Om=[].concat(Y(Object.values(jl)),Y(Object.values(t)),Y(Object.values(Dr))),Tm=function(sr){return(0,d.useMemo)(function(){return Rf?sr:null},Y(Om))},Pd=i,Pm=mi({fieldType:Je,setValue:Cd,onChange:et,multiple:ze,ref:Ni}),Im=zr({setTouched:Od,onBlur:At}),Fm=Bi({fieldType:Je,maskedValue:md,multiple:ze,value:Bl}),km=Bn(Je);return{fieldState:jl,fieldApi:Td,render:Tm,ref:Ni,userProps:j(j({},Dr),{},{multiple:ze,onChange:et,onBlur:At,id:Dr.id||Rt}),informed:j({name:Pd,multiple:ze,onChange:Pm,onBlur:Im,value:Fm,ref:Ni,type:km,id:Dr.id||Rt},Dr)}}var Gr=function(r){var i=d.forwardRef(function(a,s){var p=Tn(a,s),y=p.fieldState,E=p.fieldApi,w=p.render,A=p.ref,k=p.userProps;return w(d.createElement(r,D({fieldApi:E,fieldState:y,field:a.field,forwardedRef:A,debug:a.debug,type:a.type},k)))});return i.displayName="asField(".concat(Ke(r),")"),i},xi=Me("informed:Text "),bi=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,E=i.setTouched,w=s.onChange,A=s.onBlur,k=s.field,G=s.initialValue,ne=s.forwardedRef,re=s.debug,se=s.label,ye=s.title,ge=s.id,Ee=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return xi("Render",k),vt(function(){re&&ne&&(ne.current.style.background="red",setTimeout(function(){ne.current.style.background="white"},500))}),d.createElement(d.Fragment,null,se?d.createElement("label",{htmlFor:ge}," ",se," "):null,d.createElement("input",D({},Ee,{id:ge,name:k,ref:ne,value:!p&&p!==0?"":p,onChange:function(Pe){y(Pe.target.value,Pe),w&&w(Pe)},onBlur:function(Pe){E(!0),A&&A(Pe)}})))},qr=Gr(bi),vn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,E=i.setTouched,w=s.onChange,A=s.onBlur,k=s.field,G=s.initialValue,ne=s.forwardedRef,re=s.debug,se=s.label,ye=s.id,ge=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return vt(function(){re&&ne&&(ne.current.style.background="red",setTimeout(function(){ne.current.style.background="white"},500))}),d.createElement(d.Fragment,null,se?d.createElement("label",{htmlFor:ye}," ",se," "):null,d.createElement("textarea",D({},ge,{id:ye,name:k,ref:ne,value:p||"",onChange:function(me){y(me.target.value,me),w&&w(me)},onBlur:function(me){E(!0),A&&A(me)}})))},Un=Gr(vn),jn=Me("informed:Select "),gn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setTouched,E=s.onChange,w=s.onBlur,A=s.field,k=s.initialValue,G=s.options,ne=s.children,re=s.forwardedRef,se=s.debug,ye=s.multiple,ge=s.label,Ee=s.id,me=C(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),Pe=(0,d.useRef)(),Ge=function(He){var Ne=Array.from((re||Pe).current).filter(function(Ve){return Ve.selected}).map(function(Ve){return Ve.value});i.setValue(ye?Ne:Ne[0]||""),E&&He&&E(He)};return vt(function(){se&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),jn("Render",A,p),d.createElement(d.Fragment,null,ge?d.createElement("label",{htmlFor:Ee}," ",ge," "):null,d.createElement("select",D({},me,{id:Ee,multiple:ye,name:A,ref:re||Pe,value:p||(ye?[]:""),onChange:Ge,onBlur:function(He){y(!0),w&&w(He)}}),G?G.map(function(je){return d.createElement("option",{key:je.value,value:je.value,disabled:je.disabled},je.label)}):ne))},Xn=Gr(gn),wi=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setValue,E=i.setTouched,w=s.onChange,A=s.onBlur,k=s.field,G=s.initialValue,ne=s.debug,re=s.forwardedRef,se=s.id,ye=s.label,ge=C(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return d.createElement(d.Fragment,null,ye?d.createElement("label",{htmlFor:se}," ",ye," "):null,d.createElement("input",D({},ge,{id:se,name:k,ref:re,checked:!!p,onChange:function(me){y(me.target.checked),w&&w(me)},onBlur:function(me){E(!0),A&&A(me)},type:"checkbox"})))},Br=Gr(wi),$r=function(r){return d.forwardRef(function(i,a){return d.createElement(jt.Consumer,null,function(s){var p=s.radioGroupApi,y=s.radioGroupState;return d.createElement(r,D({radioGroupApi:p,radioGroupState:y,ref:a},i))})})},Qn=function(r){var i=r.radioGroupApi,a=r.radioGroupState,s=C(r,["radioGroupApi","radioGroupState"]),p=a.value,y=i.setValue,E=i.setTouched,w=i.onChange,A=i.onBlur,k=s.value,G=s.onChange,ne=s.onBlur,re=s.field,se=s.initialValue,ye=s.forwardedRef,ge=C(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return d.createElement("input",D({},ge,{name:re,ref:ye,value:k,checked:p===k,onChange:function(me){!me.target.checked||(y(k),G&&G(me),w&&w(me))},onBlur:function(me){E(!0),ne&&ne(me),A&&A(me)},type:"radio"}))},ur=$r(Qn),Tt=function(t){q(i,t);var r=_(i);function i(){return b(this,i),r.apply(this,arguments)}return g(i,[{key:"render",value:function(){var s=this.props,p=s.options,y=s.children;return d.createElement(jt.Provider,{value:this.groupContext},p?p.map(function(E){return d.createElement("label",{key:E.value},E.label," ",d.createElement(ur,{value:E.value}))}):y)}},{key:"groupContext",get:function(){return{radioGroupApi:j(j({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(d.Component),ii=Gr(Tt);function Si(){return(0,d.useContext)(St)}var An=function(){var r=Si(),i=r.add;return d.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function Zt(){return(0,d.useContext)(Dt)}var Vn=function(){var r=Zt(),i=r.remove;return d.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},Zn=Me("informed:useArrayField "),lo=function(r){var i=r.field,a=r.initialValue,s=r.validate,p=r.arrayFieldApiRef,y=C(r,["field","initialValue","validate","arrayFieldApiRef"]),E=Ie(),w=(0,d.useState)(new Map),A=Q(w,1),k=A[0],G=(0,d.useContext)(kt),ne=E.getFullField(i),re=G.getInitialValue(i)||a||[],se=E.getSavedValue(ne)&&E.getSavedValue(ne).value,ye=$e(se||re),ge=Q(ye,3),Ee=ge[0],me=ge[1],Pe=ge[2],Ge=Ee?Ee.map(function(){return le()}):[],je=$e(Ge),He=Q(je,3),Ne=He[0],Ve=He[1],We=He[2],Je=(0,d.useMemo)(function(){return function(Yt,Rt){var Ut=We()==null?0:We().length;return s?s(Yt,Ut,Rt):void 0}}),ze=Tn(j({field:i,validate:s?Je:void 0,shadow:!0},y)),et=ze.fieldApi;vt(function(){var Yt=function(Ut){Ut!==ne&&(Zn("".concat(ne," changed")),RegExp("".concat(ne,"\\[[0-9]+\\]")).test(Ut)&&et.validate())};return E.emitter.on("value",Yt),function(){E.emitter.removeListener("value",Yt)}},[i]);var At=function(Rt){Zn("EXPECTING REMOVAL OF","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Ne.length-1,"]")),G.expectRemoval("".concat(i,"[").concat(Rt,"]")),G.expectRemoval("".concat(i,"[").concat(Ne.length-1,"]"));var Ut=Ne.slice(0,Rt).concat(Ne.slice(Rt+1,Ne.length));Ve(Ut);var ar=Pe(),an=ar.slice(0,Rt).concat(ar.slice(Rt+1,ar.length));me(an)},Nt=function(Rt,Ut){Zn("Swapping","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Ut,"]"));var ar=Y(Ne);Ne[Rt]&&Ne[Ut]?(ar[Rt]=Ne[Ut],ar[Ut]=Ne[Rt]):console.warn("Attempted to swap ".concat(Rt," with ").concat(Ut," but one of them does not exist :(")),Ve(ar)},Ht=function(){Ne.push(le()),Ve(Y(Ne))},or=function(Rt){Ne.push(le()),Ve(Y(Ne));var Ut=Y(Pe());Ut[Ne.length-1]=Rt,me(Ut)},Mr=function(){var Rt=G.getInitialValue(i)||a||[];me(Rt);var Ut=Rt?Rt.map(function(){return le()}):[];Ve(Ut)},Cr=Ne.map(function(Yt,Rt){var Ut={remove:function(){return At(Rt)}},ar={initialValue:Ee&&Ee[Rt],key:Yt,field:"".concat(i,"[").concat(Rt,"]"),index:Rt};return j(j({arrayFieldItemApi:Ut,arrayFieldItemState:ar},Ut),ar)}),Jr={add:Ht,swap:Nt,addWithInitialValue:or,reset:Mr};p&&(p.current=Jr);var wr={fields:Cr,field:i},Dr=j(j({},G),{},{register:function(Rt,Ut){k.set(Rt,Ut);for(var ar=arguments.length,an=new Array(ar>2?ar-2:0),mr=2;mr<ar;mr++)an[mr-2]=arguments[mr];G.register.apply(G,[Rt,Ut].concat(an))},deregister:function(Rt){k.delete(Rt);for(var Ut=arguments.length,ar=new Array(Ut>1?Ut-1:0),an=1;an<Ut;an++)ar[an-1]=arguments[an];G.deregister.apply(G,[Rt].concat(ar))},getInitialValue:function(Rt){if(RegExp("".concat(ne,"\\[[0-9]+\\]")).test(Rt)){var Ut=Rt.replace(i,""),ar=pt.get(Pe(),Ut);return Zn("Resetting ".concat(Ut," to ").concat(ar)),ar}return G.getInitialValue(Rt)}}),Sn=function(Rt){return d.createElement(kt.Provider,{value:Dr},d.createElement(St.Provider,{value:Jr},d.createElement(Vt.Provider,{value:wr},Rt)))};return{render:Sn,add:Ht,swap:Nt,addWithInitialValue:or,fields:Cr,arrayFieldState:wr,arrayFieldApi:Jr,field:i}},ot=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getSavedValue:function(s){return i.getSavedValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})};function Lt(t){var r=Ie(),i=(0,d.useMemo)(function(){return ot(t,r)},[t]);return i}function oi(){var t=(0,d.useContext)(Ct);return t}var ue=function(r){var i=r.when,a=r.children,s=oi(),p=i(s);return p?a:null},Oe=function(r){var i=r.relevant,a=r.field,s=C(r,["relevant","field"]),p=Ie();if(i){var y=p.getFullField(a),E={path:y,parentPath:y.replace(/(.*)[.[].*/,"$1"),get:function(k,G){return pt.get(k,G)}},w=function(k){var G=k.values;return i(G,E)};return d.createElement(ue,{when:w},d.createElement(qe,D({field:a},s)))}else return d.createElement(qe,D({field:a},s))},qe=function(r){var i=r.children,a=C(r,["children"]),s=lo(a),p=s.render,y=s.arrayFieldState,E=s.arrayFieldApi,w=s.field;return p(typeof i=="function"?i(j(j({field:w,arrayFieldApi:E,arrayFieldState:y},E),y)):i)},st=function(r){var i=r.arrayFieldItemState,a=r.arrayFieldItemApi,s=r.children,p=(0,d.useContext)(kt),y=Ie(),E=(0,d.useState)(0),w=Q(E,2),A=w[0],k=w[1],G=(0,d.useState)(new Map),ne=Q(G,1),re=ne[0],se=i.field,ye=Lt(se),ge=function(){var Ne=y.getState(),Ve=Ne.values,We=Ne.errors,Je=Ne.touched,ze={values:pt.get(Ve,se),errors:pt.get(We,se),touched:pt.get(Je,se)};return ze};(0,d.useEffect)(function(){var He=function(Ve){var We=Ve.slice(0,Ve.lastIndexOf("[")!=-1?Ve.lastIndexOf("]")+1:Ve.length);We===se&&k(Math.random())};return y.emitter.on("value",He),function(){y.emitter.removeListener("value",He)}},[se]);var Ee=function(){re.forEach(function(Ne){Ne.fieldApi.reset()})},me=ge(),Pe=j(j({},p),{},{register:function(Ne,Ve,We){re.set(Ne,Ve),p.register(Ne,Ve,We)},deregister:function(Ne){re.delete(Ne);for(var Ve=arguments.length,We=new Array(Ve>1?Ve-1:0),Je=1;Je<Ve;Je++)We[Je-1]=arguments[Je];p.deregister.apply(p,[Ne].concat(We))}}),Ge=j(j(j({},a),ye),{},{reset:Ee}),je=j(j({},i),me);return typeof s=="function"?d.createElement(kt.Provider,{value:Pe},d.createElement(Dt.Provider,{value:Ge},d.createElement(ve.Provider,{value:je},s(j(j({arrayFieldItemApi:Ge,arrayFieldItemState:je},Ge),je))))):d.createElement(kt.Provider,{value:Pe},d.createElement(Dt.Provider,{value:Ge},d.createElement(ve.Provider,{value:je},s)))};Oe.Items=function(t){var r=t.children,i=(0,d.useContext)(Vt),a=i.fields;return a.map(function(s){var p=s.arrayFieldItemState,y=s.arrayFieldItemApi,E=p.key;return d.createElement(st,{key:E,arrayFieldItemApi:y,arrayFieldItemState:p},r)})};var lt=function(r){var i=r.components,a=(0,d.useContext)(kt),s=a.fieldMap;return i?i.map(function(p,y){var E=p["ui:control"],w=s[E];return d.createElement(w,{key:"ui-comp-".concat(y)})}):null},Kt=Me("informed:FormFields "),Xt=function t(r){var i=r.schema,a=r.prefix,s=r.onlyValidateSchema,p=(0,d.useContext)(kt),y=p.fieldMap,E=(0,d.useMemo)(function(){var w=de(i,s,a),A=w.map(function(k,G){var ne=k.field,re=k.props,se=k.type,ye=k.properties,ge=k.items,Ee=k.componentType,me=k.uiBefore,Pe=k.uiAfter,Ge=k.allOf,je=y[Ee];return Kt("Rendering Field",ne,k),!je&&se==="object"&&ye?d.createElement(t,{schema:k,prefix:ne,key:"ScheamField-".concat(G)}):!je&&se==="array"&&ge?d.createElement(Tr,D({key:"ScheamField-".concat(G),field:ne,items:ge,uiBefore:me,uiAfter:Pe},re)):je&&Ee==="array"&&ge&&se==="array"?d.createElement(je,D({key:"ScheamField-".concat(G),field:ne,items:ge,uiBefore:me,uiAfter:Pe},re)):Ee==="conditionals"?Ge.map(function(He){var Ne=He.then,Ve=He.if.properties,We=function(ze){var et=ze.values;return Object.keys(Ve).every(function(At){var Nt=Ve[At];return et[At]===Nt.const})};return d.createElement(ue,{key:"ScheamField-".concat(G),when:We},d.createElement(t,{schema:Ne}))}):je?d.createElement(je,D({key:"ScheamField-".concat(G),field:ne},re)):null});return A},[i,a]);return E},Tr=function(r){var i=r.field,a=r.items,s=r.uiBefore,p=r.uiAfter,y=C(r,["field","items","uiBefore","uiAfter"]);return d.createElement(Oe,D({field:i},y),d.createElement(lt,{components:s}),d.createElement(Oe.Items,null,function(E){var w=E.field;return d.createElement(d.Fragment,null,d.createElement(lt,{components:a["ui:before"]}),d.createElement(Xt,{schema:a,prefix:w}),d.createElement(lt,{components:a["ui:after"]}))}),d.createElement(lt,{components:p}))},Pr={select:Xn,input:qr,textarea:Un,checkbox:Br,radio:ii,add:An,remove:Vn,array:Tr},_t=Me("informed:Controller "),Wl=function(r,i){var a=Object.keys(i).find(function(p){return r.includes(p)});if(!!a){var s=r.slice(0,a.length);return s===a}},en=function(){},vs=function(){function t(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b(this,t),this.options=i,this.subscriptions=new Map;var a=i.ajv,s=i.schema,p=i.fieldMap;this.ajv=a?new a({allErrors:!0}):null,this.ajvValidate=a?this.ajv.compile(s):null,this.fieldMap=p||Pr,this.fieldsById=new Map,this.fieldsByName={get:function(E){var w;return r.fieldsById.forEach(function(A){A&&A.field===E&&(w=A)}),w}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:en,setTouched:en,setError:en,reset:en,validate:en,getValue:en,getTouched:en,getError:en,getFieldState:en,checkRelevant:en,getPristine:en,getDirty:en}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(E,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(E);k.shadow||pt.set(r.state.values,k.field,k.fieldApi.getValue()),k.fieldApi.relevant(r.state.values)||pt.delete(r.state.values,k.field),r.fieldsById.forEach(function(G){var ne=G.fieldApi.checkRelevant();(!G.fieldApi.multistepRelevant(r.state.values)||!ne&&!G.keepState)&&(pt.delete(r.state.values,G.field),pt.delete(r.state.touched,G.field),pt.delete(r.state.errors,G.field))}),A&&(r.emit("change"),r.emit("field",k.field),r.emit("value",k.field,w))},setTouched:function(E,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(E);!k.shadow&&k.fieldApi.getIsRelevant()&&pt.set(r.state.touched,k.field,k.fieldApi.getTouched()),k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)&&pt.set(r.state.touched,k.field,k.fieldApi.getTouched()),A&&(r.emit("change"),r.emit("field",k.field))},setError:function(E,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(E);!k.shadow&&k.fieldApi.getIsRelevant()&&pt.set(r.state.errors,k.field,k.fieldApi.getError());var G=pt.get(r.state.errors,k.field);(k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)||k.shadow&&k.fieldApi.getError()===void 0&&k.fieldApi.relevant(r.state.values)&&typeof G=="string")&&pt.set(r.state.errors,k.field,k.fieldApi.getError()),A&&(r.emit("change"),r.emit("field",k.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",function(y){delete r.state.error,r.notify(y)})}return g(t,[{key:"emit",value:function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),p=1;p<a;p++)s[p-1]=arguments[p];var y=this.subscriptions.get(i);y&&y.forEach(function(E){return E.apply(void 0,s)})}},{key:"on",value:function(i,a){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(a)}},{key:"removeListener",value:function(i,a){var s=this.subscriptions.get(i);s.delete(a)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,a,s){this.getField(i).fieldApi.setValue(a,null,j({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,a){this.getField(i).fieldApi.setTouched(a)}},{key:"setError",value:function(i,a){this.getField(i).fieldApi.setError(a)}},{key:"setFormError",value:function(i){this.state.error=i,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(i,a){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,a),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(_t("Submit",this.state),this.emit("submit")):(_t("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(i){this.state.step=i,this.emit("change")}},{key:"setCurrent",value:function(i){this.state.Current=i,this.emit("change")}},{key:"back",value:function(i){this.state.step=this.state.step-1,this.state.Current=i,this.emit("change")}},{key:"next",value:function(i){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=i),this.emit("change")}},{key:"setInitialValue",value:function(i,a){pt.set(this.options.initialValues,i,a)}},{key:"getFormState",value:function(){return _t("Returning form state"),j(j({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var a=this.getValues();return pt.get(a,i)}},{key:"getValue",value:function(i){var a=this.getField(i).fieldApi.getValue();return _t("Getting value for",i,a),a}},{key:"getTouched",value:function(i){var a=this.getField(i).fieldApi.getTouched();return _t("Getting touched for",i,a),a}},{key:"getError",value:function(i){var a=this.getField(i).fieldApi.getError();return _t("Getting error for",i,a),a}},{key:"getDirty",value:function(i){var a=this.getField(i).fieldApi.getDirty();return _t("Getting dirty for",i,a),a}},{key:"getPristine",value:function(i){var a=this.getField(i).fieldApi.getPristine();return _t("Getting pristine for",i,a),a}},{key:"getValues",value:function(){return _t("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return _t("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return _t("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?pt.get(this.savedValues,"shadow-".concat(i)):pt.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?pt.delete(this.savedValues,"shadow-".concat(i)):pt.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return pt.get(this.options.initialValues,i)}},{key:"getField",value:function(i){_t("Getting Field",i);var a=this.fieldsByName.get(i);return a||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var a=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(p){var y=".".concat(i),E="".concat(y.replace(/(.*)[.[].*/,"$1"),".").concat(p).slice(1),w=a.getField(E);w&&(_t("Notifying",w.field),w.fieldApi.validate(),w.fieldApi.checkRelevant())})}},{key:"validateField",value:function(i){this.getField(i).fieldApi.validate()}},{key:"resetField",value:function(i){this.getField(i).fieldApi.reset()}},{key:"fieldExists",value:function(i){return this.fieldsByName.get(i)!=null}},{key:"valid",value:function(){var i=this.getErrors();return!!(pt.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(a){var s=Q(a,2),p=s[1];return p.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!pt.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(a){a.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){_t("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){_t("Setting values"),this.fieldsById.forEach(function(a){var s=pt.get(i,a.field);s!==void 0&&a.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;_t("Validating all fields");var a=this.getValues();if(this.options.validationSchema){var s=Re(this.options.validationSchema,a);this.fieldsById.forEach(function(w){if(pt.has(s,w.field)){var A=pt.get(s,w.field);i.setError(w.field,A)}else i.setError(w.field,void 0)})}if(this.options.schema&&this.options.ajv){var p=O(this.ajvValidate,a);this.fieldsById.forEach(function(w){if(pt.has(p,w.field)){var A=pt.get(p,w.field);i.setError(w.field,A)}else i.setError(w.field,void 0)})}if(this.fieldsById.forEach(function(w){w.fieldApi.validate(a),w.fieldApi.setTouched(!0,!0)}),this.options.validate){var y=this.options.validate(a);this.setFormError(y)}if(this.options.validateFields){var E=this.options.validateFields(a);this.fieldsById.forEach(function(w){if(pt.has(E,w.field)){var A=pt.get(E,w.field);i.setError(w.field,A)}})}}},{key:"asyncValidate",value:function(){_t("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(a){a.fieldApi.asyncValidate(i)})}},{key:"keyDown",value:function(i){if(i.keyCode==13&&this.options.preventEnter)return i.preventDefault(i),!1}},{key:"submitForm",value:function(i){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&i&&i.preventDefault(i),this.validate(),this.emit("change"),this.asyncValidate(),!(this.state.validating>0)&&(this.valid()?(_t("Submit",this.state),this.emit("submit")):(_t("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(a){i.emit("field",a.field)})}},{key:"register",value:function(i,a,s){var p=a.field,y=a.state;_t("Register ID:",i,"Name:",p,y,"Initial",s);var E=p.slice(0,p.lastIndexOf("[")!=-1?p.lastIndexOf("]")+1:p.length),w;this.fieldsById.forEach(function(A,k){A&&A.field===p&&(w=k)}),w&&(a.keepState||a.inMultistep)?(_t("Already Registered",p),this.fieldsById.delete(w)):w&&(!a.keepState||!a.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",p),_t("Fields Registered",this.fieldsById.size),this.onScreen[i]=a,this.fieldsById.set(i,a),_t("clearing expected removal",E),delete this.expectedRemovals[E],delete this.pulledOut[E],!a.shadow&&(this.updater.setValue(i,a.fieldApi.getValue(),!1),this.updater.setError(i,a.fieldApi.getError(),!1),this.updater.setTouched(i,a.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",p))}},{key:"deregister",value:function(i){var a=this.fieldsById.get(i),s=a.field;_t("Deregister",i,s),delete this.onScreen[i];var p=Wl(s,this.expectedRemovals),y=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(a.keepState||a.inMultistep)&&!p&&(_t("Saving field ".concat(s,"'s value"),a.fieldApi.getFieldState()),a.shadow?pt.set(this.savedValues,"shadow-".concat(s),a.fieldApi.getFieldState()):pt.set(this.savedValues,s,a.fieldApi.getFieldState())),(p||!a.keepState&&!a.inMultistep||!a.fieldApi.getIsRelevant()&&!a.keepState)&&(_t("Removing field",s),this.fieldsById.delete(i),p||(pt.delete(this.state.values,s),pt.delete(this.state.touched,s),pt.delete(this.state.errors,s),a.shadow?pt.delete(this.savedValues,"shadow-".concat(s)):pt.delete(this.savedValues,s)),p&&this.pulledOut[y]&&(_t("Pulling out",s,"with magic value",y),pt.pullOut(this.state.values,y),pt.pullOut(this.state.touched,y),pt.pullOut(this.state.errors,y),pt.pullOut(this.savedValues,y),delete this.pulledOut[y])),this.emit("change")}},{key:"expectRemoval",value:function(i){_t("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,a,s){_t("Update",i,a.field,s,a.fieldState.value);var p=a.fieldApi.getValue(),y=a.fieldApi.getError(),E=a.fieldApi.getTouched(),w=this.fieldsByName.get(s);s&&!w&&(pt.set(this.state.values,s),pt.set(this.state.errors,s),pt.set(this.state.touched,s)),pt.set(this.state.values,a.field,p),pt.set(this.state.errors,a.field,y),pt.set(this.state.touched,a.field,E),this.emit("change")}}]),t}(),ya=Me("informed:FormProvider "),gs=function(r){var i=r.children,a=r.formApi,s=r.formController,p=r.formState,y=C(r,["children","formApi","formController","formState"]);if(ya("Render FormProvider"),a)return ya("Render FormProvider with given values"),d.createElement(kt.Provider,{value:s.updater},d.createElement(Wt.Provider,{value:a},d.createElement(Ct.Provider,{value:p},i)));ya("Render FormProvider with generated values");var E=ms(y);return d.createElement(kt.Provider,{value:E.formController.updater},d.createElement(Wt.Provider,{value:E.formApi},d.createElement(Ct.Provider,{value:E.formState},i)))},ys=Me("informed:useForm "),ms=function(r){var i=r.dontPreventDefault,a=r.initialValues,s=r.validate,p=r.validateFields,y=r.allowEmptyStrings,E=r.preventEnter,w=r.getApi,A=r.apiRef,k=r.onChange,G=r.onReset,ne=r.onSubmit,re=r.onValueChange,se=r.onSubmitFailure,ye=r.validationSchema,ge=r.schema,Ee=r.ajv,me=r.fieldMap,Pe=r.onlyValidateSchema,Ge=C(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);ys("Render useForm");var je=(0,d.useMemo)(function(){return{dontPreventDefault:i,initialValues:a,validate:s,validateFields:p,allowEmptyStrings:y,preventEnter:E,validationSchema:ye,schema:ge,ajv:Ee,fieldMap:me}},[i,a,s,p,y,E,ye,ge,Ee,me]),He=(0,d.useState)(function(){return new vs(je)}),Ne=Q(He,1),Ve=Ne[0];(0,d.useEffect)(function(){Ve.setOptions(je)},[je]),vt(function(){Ve.mount()},[]);var We=(0,d.useState)(function(){return Ve.getFormState()}),Je=Q(We,2),ze=Je[0],et=Je[1];vt(function(){var Mr=function(){return k&&k(Ve.getFormState())},Cr=function(){return G&&G()},Jr=function(){return ne&&ne(Ve.getFormState().values)},wr=function(){return re&&re(Ve.getFormState().values)},Dr=function(){return se&&se(Ve.getFormState().errors)};return Ve.on("change",Mr),Ve.on("reset",Cr),Ve.on("submit",Jr),Ve.on("value",wr),Ve.on("failure",Dr),function(){Ve.removeListener("change",Mr),Ve.removeListener("reset",Cr),Ve.removeListener("submit",Jr),Ve.removeListener("value",wr),Ve.removeListener("failure",Dr)}},[k,G,ne,re,se]),(0,d.useState)(function(){var Mr=function(){ys("Setting form state"),et(Ve.getFormState())};Ve.on("change",Mr),w&&w(Ve.getFormApi()),A&&(A.current=Ve.getFormApi())});var At=(0,d.useState)(function(){return Ve.getFormApi()}),Nt=Q(At,1),Ht=Nt[0],or=function(Cr){return d.createElement(gs,{formApi:Ht,formState:ze,formController:Ve},d.createElement(d.Fragment,null,Cr||d.createElement(Xt,{schema:ge,onlyValidateSchema:Pe})))};return{formApi:Ht,formState:ze,formController:Ve,render:or,userProps:Ge}},Hl=Me("informed:Form "),zl=function(r){var i=r.children,a=r.render,s=r.component,p=C(r,["children","render","component"]);Hl("Render FORM");var y=ms(p),E=y.formApi,w=y.formController,A=y.formState,k=y.render,G=y.userProps,ne=function(){var se={formState:A,formApi:E};return s?d.createElement(s,se,i):a?a(se):typeof i=="function"?i(se):i};return k(d.createElement("form",D({},G,{onReset:w.reset,onSubmit:w.submitForm,onKeyDown:w.keyDown}),ne()))},Lf=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},Df=function(r,i){var a=i.register,s=i.deregister,p=i.setValue,y=i.setTouched,E=i.setError,w=i.update,A=i.getField,k=i.expectRemoval,G=i.getInitialValue,ne=i.fieldMap,re=i.getSavedValue;return{register:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return a.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},deregister:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return s.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},update:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return w.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},setValue:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return p.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},setTouched:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return y.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},setError:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return E.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},getField:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return A.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},expectRemoval:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return k.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},getInitialValue:function(ye){return G("".concat(r,".").concat(ye))},getSavedValue:function(ye){return re("".concat(r,".").concat(ye))},fieldMap:ne}},Nf=function(r){var i=r.scope,a=r.children,s=useContext(kt),p=Ie(),y=oi(),E=useMemo(function(){return Lf(i,p)},[i]),w=useMemo(function(){return Df(i,s)},[i]);return React.createElement(kt.Provider,{value:w},React.createElement(Wt.Provider,{value:E},React.createElement(Ct.Provider,{value:y},a)))},Ai=function(r){var i=oi(),a={};Object.keys(r).length>0?Object.keys(r).forEach(function(re){a[re]=i[re]}):a=i;var s=a,p=s.pristine,y=s.dirty,E=s.invalid,w=s.values,A=s.errors,k=s.touched,G=s.validating,ne=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:p,dirty:y,invalid:E,values:w,errors:A,touched:k,validating:G,submitting:ne},null,2)))},Bf=function(r){var i=r.initialStep,a=r.multistepApiRef,s=Ie(),p=s.getValues,y=s.validate,E=s.screenValid,w=(0,d.useState)(new Map),A=Q(w,1),k=A[0],G=(0,d.useRef)(0),ne=$e({current:i,steps:[],goal:null}),re=Q(ne,3),se=re[0],ye=re[1],ge=re[2],Ee=(0,d.useState)(function(){var je=function(){var Ve=ge(),We=Ve.current,Je=k.get(We);return Je},He={getState:function(){return ge()},getCurrentStep:je,getStep:function(Ve){return k.get(Ve)},getNumberOfSteps:function(){return k.size},next:function(){if(y(),E()){var Ve=je(),We=Ve.getNext,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ye(function(et){return j(j({},et),{},{current:ze})})}},back:function(){var Ve=je(),We=Ve.getPrevious,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ye(function(et){return j(j({},et),{},{current:ze})})},setCurrent:function(Ve){if(Ve){var We=k.get(Ve).index;We<je().index?ye(function(Je){return j(j({},Je),{},{current:Ve,goal:null})}):ye(function(Je){return j(j({},Je),{},{goal:Ve})})}},register:function(Ve,We,Je){Je?(G.current=G.current+1,k.set(Ve,j(j({},We),{},{index:G.current}))):ye(function(ze){return j(j({},ze),{},{steps:Array.from(k.keys())})})},deregister:function(Ve){k.delete(Ve),G.current=G.current-1,ye(function(We){return j(j({},We),{},{steps:Array.from(k.keys())})})}};return a&&(a.current=He),He}),me=Q(Ee,1),Pe=me[0],Ge=function(He){return d.createElement($.Provider,{value:Pe},d.createElement(z.Provider,{value:se},He))};return j(j(j({},Pe),se),{},{render:Ge})};function Uf(){return(0,d.useContext)(z)}function ma(){return(0,d.useContext)($)}var Po=function(r){var i=r.step,a=r.next,s=r.previous,p=r.relevant,y=oi(),E=y.values,w=Uf(),A=w.current,k=w.goal,G=ma(),ne=G.register,re=G.deregister,se=G.next,ye=i===A,ge=p?p(E):!0,Ee=(0,d.useRef)(a),me=(0,d.useRef)(s),Pe=(0,d.useRef)();Ee.current=a,me.current=s,Pe.current=p,(0,d.useState)(function(){ne(i,{name:i,getNext:function(){return Ee.current},getPrevious:function(){return me.current}},!0)}),(0,d.useEffect)(function(){return ne(i,{name:i,getNext:function(){return Ee.current},getPrevious:function(){return me.current}}),function(){re(i)}},[i]),(0,d.useEffect)(function(){k&&ye&&k!==i&&se()},[k,ye]);var Ge=function(He){return d.createElement(Se.Provider,{value:{relevant:function(Ve){return Pe.current?Pe.current(Ve):!0},multistep:!0}},ye&&ge?He:null)};return{isCurrent:ye,isRelevant:ge,step:i,render:Ge}};function jf(t){var r=t.children,i=C(t,["children"]),a=Bf(i),s=a.render,p=C(a,["render"]);return s(typeof r=="function"?r(p):r)}jf.Step=function(r){var i=r.children,a=C(r,["children"]),s=Po(a),p=s.render;return p(i)};var Id=function(r){var i=r.field,a=useContext(kt),s=a.fieldMap,p=Ie(),y=p.getFullField,E=p.getOptions,w=y(i),A=E(),k=A.schema,G=oe(w),ne=pt.get(k,G);if(!ne)return null;var re=te(i,ne),se=re.props,ye=re.componentType,ge=s[ye];return React.createElement(ge,D({field:i},se))},Fd=function(){var r=Ie(),i=r.getOptions,a=i(),s=a.schema;return React.createElement(Xt,{schema:s})},kd=function(r){return React.forwardRef(function(i,a){return React.createElement(Wt.Consumer,null,function(s){return React.createElement(r,D({formApi:s,ref:a},i))})})},Gl=function(r){return React.forwardRef(function(i,a){return React.createElement(Ct.Consumer,null,function(s){return React.createElement(r,D({formState:s,ref:a},i))})})},$l=function(r,i){return{getValue:function(){return r.getValue(i)},setValue:function(s){return r.setValue(i,s)},getTouched:function(){return r.getTouched(i)},setTouched:function(s){return r.setTouched(i,s)},getError:function(){return r.getError(i)},setError:function(s){return r.setError(i,s)},reset:function(){return r.resetField(i)},validate:function(){return r.validateField(i)},exists:function(){return r.fieldExists(i)},getDirty:function(){return r.getDirty(i)},getPristine:function(){return r.getPristine(i)},getFieldState:function(){return r.getField(i).fieldApi.getFieldState()}}};function Kl(t){var r=Ie(),i=useMemo(function(){return $l(r,t)},[t]);return i}function Yl(t){var r=Kl(t),i=Ie(),a=React.useState(),s=Q(a,2),p=s[1],y=React.useCallback(function(){return p({})},[]);return vt(function(){var E=function(A){A===t&&y()};return i.emitter.on("field",E),function(){i.emitter.removeListener("field",E)}},[]),vt(function(){y()},[]),r.getFieldState()||{}}var Vf=function(r){return function(i){return function(a){var s=Yl(r);return React.createElement(i,D({fieldState:s},a))}}},xs=function(r){return function(i){return function(a){var s=Kl(r);return React.createElement(i,D({fieldApi:s},a))}}},bs=function(r){var i=r.value,a=r.forwardedRef,s=r.children,p=C(r,["value","forwardedRef","children"]);return React.createElement("option",D({ref:a,value:i,key:i},p),s)},Jl=null,Io=o(80150),ws=o(89356),Ui=o(63263),Wf=o(30699),xa=o(58377),Wn=o(28834),Xl=o(13038),Hf=o(32752),Fo=o(44341);function Ss(t,r,i){return r in t?Fo(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function ai(t,r){var i=ws(t);if(Ui){var a=Ui(t);r&&(a=Wf(a).call(a,function(s){return xa(t,s).enumerable})),i.push.apply(i,a)}return i}function fr(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){var a;Wn(a=ai(Object(i),!0)).call(a,function(p){Ss(t,p,i[p])})}else if(Xl)Hf(t,Xl(i));else{var s;Wn(s=ai(Object(i))).call(s,function(p){Fo(t,p,xa(i,p))})}}return t}var si=o(28583),ji=o.n(si),As=o(10240),Vi=o.n(As),Ei=o(8575),Wi=o(51446),Es=o(19996),Cs=o(78363),Ql=o(95238),Os=o(53592);function Ts(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=t[i];return a}function Ps(t,r){var i;if(!!t){if(typeof t=="string")return Ts(t,r);var a=Ql(i=Object.prototype.toString.call(t)).call(i,8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Os(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ts(t,r)}}function Hi(t,r){var i=typeof Wi!="undefined"&&Es(t)||t["@@iterator"];if(!i){if(Cs(t)||(i=Ps(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(A){throw A},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
81
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,y=!1,E;return{s:function(){i=i.call(t)},n:function(){var A=i.next();return p=A.done,A},e:function(A){y=!0,E=A},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(y)throw E}}}}var zf=o(23882);function nr(t){return typeof Wi=="function"&&typeof zf=="symbol"?nr=function(i){return typeof i}:nr=function(i){return i&&typeof Wi=="function"&&i.constructor===Wi&&i!==Wi.prototype?"symbol":typeof i},nr(t)}function Gf(t){if(Cs(t))return t}function
|
|
82
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tn(t,r){return Gf(t)||
|
|
83
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pn(t){return qf(t)||$i(t)||Ps(t)||uo()}var Vs=o(3649),In=o.n(Vs),
|
|
80
|
+
`+ye)}else k[0]=ne+" "+k[0]}function a(k,G){if(k[0]=(G.useColors?"%c":"")+G.namespace,!!G.useColors){var ne="color: "+G.color,re=0,se=0;k[0].replace(/%[a-zA-Z%]/g,function(ye){ye!=="%%"&&(re++,ye==="%c"&&(se=re))}),k.splice(se,0,ne)}}var s=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p(){var k;try{k=localStorage.getItem("debug")}catch(G){}return!k&&typeof process!="undefined"&&"env"in process&&(k={}.DEBUG),{namespaces:k||"",colors:s,useColors:!0,formatArgs:a}}function y(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function E(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,G=arguments.length>1?arguments[1]:void 0;return function(){for(var ne=arguments.length,re=new Array(ne),se=0;se<ne;se++)re[se]=arguments[se];k&&re.unshift(k);var ye=G.namespaces.split(",").map(function(Pe){return Pe[Pe.length-1]==="*"?new RegExp("^"+Pe.slice(0,Pe.length-1)+".*$"):new RegExp("^"+Pe+"$")}),ge=ye.some(function(Pe){return Pe.test(k)}),Ee={color:r(k,G.colors),namespace:k,useColors:G.useColors};if(!1)var me}}function w(k){return E(k,y())}function A(k){return E(k,p())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=A:t.exports=w}),Te=Me("informed:ObjMap "),rt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},Ze=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(p,y){return p!=null?p[y]:p},r);return s===void 0||s===r?a:s},Xe=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ft=function(r){return r.replace(Xe(r),"").replace(/\./,"")},ht=function(r,i){var a=Xe(i),s=ft(i),p=a?Ze(r,a):r;return!!(p&&Object.hasOwnProperty.call(p,s.replace(/\[(.*)\]/,"$1")))},bt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,E){return y===E.length-1?(s[p]=a,s[p]):s[p]===void 0?(Number.isInteger(+E[y+1])?s[p]=[]:s[p]={},s[p]):(Number.isInteger(+E[y+1])&&!Array.isArray(s[p])&&(s[p]=[]),s[p])},r)},nt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,E){return s===void 0?s:(y===E.length-1&&(delete s[p],a=!0),s[p])},r),a},ut=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,E){return s===void 0?s:(y===E.length-1&&Array.isArray(s)&&(a=s.splice(p,1)),s[p])},r),a},yt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(a){return r[a]})},mt=function(r){var i=rt(r);return Number.isInteger(+i[i.length-1])},pt=function(){function t(){b(this,t)}return g(t,null,[{key:"empty",value:function(i){return yt(i).length===0}},{key:"get",value:function(i,a){var s=Ze(i,a);return s}},{key:"has",value:function(i,a){return ht(i,a)}},{key:"set",value:function(i,a,s){if(s!==void 0)Te("SETTING",a,s),bt(i,a,s);else if(mt(a)&&t.get(i,a)!==void 0){Te("Special case SETTING",a,"to undefined"),bt(i,a,void 0);var p=rt(a);p=p.slice(0,p.length-1),Mt(i,p)}else!mt(a)&&t.get(i,a)!==void 0&&(Te("Special case REMOVING",a,"from object completley"),t.delete(i,a))}},{key:"delete",value:function(i,a){Te("DELETE",a),mt(a)?(Te("ARRAY",a),this.pullOut(i,a)):nt(i,a);var s=rt(a);s=s.slice(0,s.length-1),Mt(i,s)}},{key:"pullOut",value:function(i,a){var s=rt(a),p=s[s.length-1];s=s.slice(0,s.length-1),Te("Pulling out:",s,"index",p);var y=Ze(i,s);Te("Array",y),Array.isArray(y)&&ut(y,p),Mt(i,s)}}]),t}();function Mt(t,r){if(r.length!==0){var i=Ze(t,r);(Array.isArray(i)?i.every(function(a){return a==null}):JSON.stringify(i)==="{}")&&nt(t,r),Mt(t,r.slice(0,r.length-1))}}var kt=d.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),Ct=d.createContext({}),Wt=d.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),jt=d.createContext(),Vt=d.createContext(),St=d.createContext(),Dt=d.createContext(),ve=d.createContext(),z=d.createContext(),$=d.createContext(),Se=d.createContext();function Ie(){var t=(0,d.useContext)(Wt);return t}function $e(t){var r=(0,d.useRef)(),i=(0,d.useRef)(!0),a=(0,d.useState)(t),s=Q(a,2),p=s[0],y=s[1];r.current=p;var E=function(k){r.current=k,i.current&&y(k)},w=function(){return r.current};return(0,d.useEffect)(function(){return function(){i.current=!1}},[]),[p,E,w]}var Ke=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},P=function(r){var i={};if(r.inner){if(r.inner.length===0){pt.set(i,r.path,r.message);return}var a=Fe(r.inner),s;try{for(a.s();!(s=a.n()).done;){var p=s.value;pt.get(i,p.path)||pt.set(i,p.path,p.message)}}catch(y){a.e(y)}finally{a.f()}}return i},Re=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var a=P(s);return a}},K=function(r){if(r.inner){if(r.inner.length===0)return;var i=r.inner[0];return i.message}},T=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(a){return K(a)}},O=function(r,i){r(i);var a={};return r.errors&&r.errors.forEach(function(s){var p=s.message,y=s.dataPath,E=s.keyword,w=s.params,A=y;E==="required"&&(A="".concat(A,".").concat(w.missingProperty)),A=A.replace(".",""),pt.set(a,A,p)}),a},le=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,a=r=="x"?i:i&3|8;return a.toString(16)})},N=function(r,i){var a;return function(){for(var p=arguments.length,y=new Array(p),E=0;E<p;E++)y[E]=arguments[E];var w=function(){clearTimeout(a),r.apply(void 0,y)};clearTimeout(a),a=setTimeout(w,i)}},te=function(r,i,a){var s=i["ui:control"],p=i["informed:props"],y=i["input:props"],E=i["ui:before"],w=i["ui:after"],A=i.oneOf,k=i.items,G=i.enum,ne=i.title,re=i.minimum,se=i.maximum,ye=i.minLength,ge=i.maxLength,Ee=i.pattern,me=i.type,Pe=i.properties,Ge=le();y&&y.id&&(Ge=y.id);var je={componentType:s,field:a?"".concat(a,".").concat(r):r,type:me,uiBefore:E,uiAfter:w,properties:me==="object"?Pe:void 0,items:me==="array"?k:void 0,props:j(j({label:ne,id:Ge,min:re,max:se,minLength:ye,maxLength:ge,pattern:Ee},p),y)};if(A){var He=i.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});je.props.options=He}if(G){var Ne=i.enum.map(function(We){return{value:We,label:We}});je.props.options=Ne}if(k&&k.oneOf){var Ve=k.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});je.props.options=Ve}return je},de=function(r,i,a){if(!r||i)return[];var s=r.properties,p=s===void 0?{}:s,y=r.allOf,E=r.propertyOrder,w=E===void 0?[]:E;if(Object.keys(p).length>0){var A=Object.keys(p).sort(function(k,G){var ne=w.indexOf(k),re=w.indexOf(G);return(ne>-1?ne:w.length+1)-(re>-1?re:w.length+1)}).map(function(k){var G=p[k],ne=te(k,G,a);return ne});return y&&A.push({componentType:"conditionals",allOf:y}),A}return[]},oe=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},pe=function(r,i){if(typeof r=="string")return r.split("").map(function(a){return a==="#"?/\d/:a==="*"?/[\w]/:a});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},Ae=function(r,i){for(var a=0,s=-1,p=!0;p&&a<r.length;)r[a]==i[a]?s=a:p=!1,a=a+1;return s},Be=function(r,i){if(!r)return{val:r,offset:0};var a="".concat(r),s=pe(i,a),p=s.findIndex(function(ge){return typeof ge!="string"}),y=s.length-Y(s).reverse().findIndex(function(ge){return typeof ge!="string"}),E=[],w=a.split(""),A=0,k=0,G=Ae(s.slice(0,p),w.slice(0,p));G>-1&&(A=G+1,E=E.concat(s.slice(0,G+1)),k=G+1),G<0&&(E=E.concat(s.slice(0,p)),k=p);for(var ne=k;ne<s.length;ne++){var re=s[ne];if(A!=w.length){var se=w[A];if(typeof re=="function")E.push(re(se)),A=A+1;else{var ye=typeof re=="string"?re===se:re.test(se);ye&&typeof re=="string"?(E.push(re),A=A+1):!ye&&typeof re=="string"?A!=w.length&&E.push(re):ye&&typeof re!="string"?(E.push(se),A=A+1):!ye&&typeof re!="string"&&(A=A+1,ne=ne-1)}}else if(typeof re=="string"&&ne>=y)E.push(re);else break}return{value:E.join(""),offset:a?E.length-a.length:0}},Ue=function(r,i){var a,s,p=new Intl.NumberFormat(r,i),y=new Intl.NumberFormat(r),E=(a=(s=y.formatToParts(.1).find(function(ge){var Ee=ge.type;return Ee==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:".";function w(ge,Ee){return ge instanceof RegExp&&Ee instanceof RegExp&&ge.source===Ee.source&&ge.global===Ee.global&&ge.ignoreCase===Ee.ignoreCase&&ge.multiline===Ee.multiline}function A(ge,Ee){for(var me=ge.length;me--;)if(Ee(ge[me]))return me;return-1}function k(ge,Ee,me){var Pe=Y(ge);return Array.isArray(me)?Pe.splice.apply(Pe,[Ee,0].concat(Y(me))):Pe.splice(Ee,0,me),Pe}function G(ge){return"".concat(ge).replace(/\D/g,"")}function ne(ge){return"".concat(ge).split(E).map(function(Ee){return G(Ee)}).join(".")}function re(ge){if(typeof ge=="number")return ge;var Ee=parseFloat(ne(ge));return Number.isNaN(Ee)?void 0:Ee}function se(ge){var Ee=ne(ge),me="".concat(Ee).split(".")[1],Pe=p.formatToParts(Number(Ee));me==="0"&&Pe.push({type:"decimal",value:E},{type:"fraction",value:me});var Ge=Pe.reduce(function(Ne,Ve){var We=Ve.type,Je=Ve.value;return["decimal","fraction"].includes(We)&&me==null?Ne:["integer","fraction"].includes(We)?[].concat(Y(Ne),Y(Je.split("").filter(function(ze,et){return We==="fraction"?et<me.length:!0}).map(function(){return/\d/}))):We==="currency"?[].concat(Y(Ne),Y(Je.split(""))):[].concat(Y(Ne),[Je])},[]),je=A(Ge,function(Ne){return w(Ne,/\d/)});Ge.indexOf(E)===-1&&"".concat(ge).indexOf(E)!==-1&&(Ge=k(Ge,je+1,[E,"[]"]),je+=2);var He=Ge.slice(je+1).join("");return Ge=[].concat(Y(Ge.slice(0,je+1)),[He]),Ge}var ye=function(Ee){if(Ee!=null)return re(Ee)};return{formatter:se,parser:ye}},Qe=Object.freeze({__proto__:null,getChildDisplayName:Ke,yupToFormErrors:P,validateYupSchema:Re,yupToFormError:K,validateYupField:T,validateAjvSchema:O,uuidv4:le,debounce:N,computeFieldFromProperty:te,computeFieldsFromSchema:de,getSchemaPathFromJsonPath:oe,informedFormat:Be,createIntlNumberFormatter:Ue}),vt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?d.useLayoutEffect:d.useEffect,Et=function(r){var i=r.value,a=r.inputRef,s=r.maintainCursor,p=s===void 0?!0:s,y=$e(0),E=Q(y,3),w=E[0],A=E[1],k=E[2],G=$e(0),ne=Q(G,3),re=ne[0],se=ne[1],ye=ne[2];return vt(function(){if(a.current!=null&&k()){var ge=k()+ye();ye()!=0&&p?a.current.setSelectionRange(ge+1,ge+1):p&&a.current.setSelectionRange(ge,ge)}},[i]),{setCursorOffset:se,setCursor:A,cursor:w,getCursor:k,cursorOffset:re}},Bt=function(r,i){var a=(0,d.useRef)(!0),s=a.current;(0,d.useEffect)(function(){if(s)a.current=!1;else return r()},i)},Pt=Me("informed:useField "),pn=function(r,i,a,s,p){if(r!=null){if(p)return p(r);if(i)return i(r);if(a&&!s){var y=Be(r,a);return y.value}return r}},Nr=function(r,i,a,s){if(i&&a)return i(r);if(s){var p=Be(r,s);return p.value}return r},Or=function(r,i,a){var s=a.required;if(r||i)return function(p,y){if(i)return T(i,p);if(r)return r(p,y)};if(s)return function(p){return hn(p,s)}},mi=function(r){var i=r.fieldType,a=r.setValue,s=r.onChange,p=r.multiple,y=r.ref,E=function(A){return a(A)};return(i==="text"||i==="textArea"||i==="number")&&(E=function(A){return a(A.target.value,A)}),i==="select"&&(E=function(){var A=Array.from(y.current).filter(function(k){return k.selected}).map(function(k){return k.value});a(p?A:A[0]||"")}),i==="checkbox"&&(E=function(A){a(A.target.checked),s&&s(A)}),function(w){E(w)}},zr=function(r){var i=r.setTouched,a=r.onBlur;return function(s){i(!0),a&&a(s)}},Bi=function(r){var i=r.fieldType,a=r.maskedValue,s=r.multiple,p=r.value;switch(i){case"text":case"number":return!a&&a!==0?"":a;case"textArea":return a||"";case"select":return p||(s?[]:"");case"checkbox":return!!p;default:return p}},Bn=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},hn=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function Tn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,a=t.validate,s=t.asyncValidate,p=t.validationSchema,y=t.mask,E=t.maskWithCursorOffset,w=t.format,A=t.parse,k=t.formatter,G=t.parser,ne=t.initialValue,re=t.validateOnChange,se=t.validateOnBlur,ye=t.validateOnMount,ge=t.asyncValidateOnBlur,Ee=t.maskOnBlur,me=t.allowEmptyString,Pe=t.onValueChange,Ge=t.notify,je=t.keepState,He=t.maintainCursor,Ne=t.debug,Ve=t.shadow,We=t.step,Je=t.fieldType,ze=t.multiple,et=t.onChange,At=t.onBlur,Nt=t.formController,Ht=t.relevant,or=t.required,Mr=t.keepStateIfRelevant,Cr=t.initialize,Jr=t.formatterDependencies,wr=Jr===void 0?[]:Jr,Dr=C(t,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),Sn=(0,d.useState)(le()),Yt=Q(Sn,1),Rt=Yt[0],Ut=(0,d.useContext)(kt),ar=(0,d.useContext)(Se),an=ar||Mr,mr=Ie(),hs=(0,d.useRef)(),Dl=(0,d.useRef)(!0),ha=(0,d.useRef)(),Di=(0,d.useRef)(!1),Nl=function(){return!Di.current},Ff=function(){return Di.current};Nt&&(Ut=Nt.updater,mr=Nt.getFormApi());var yi=Or(a,p,{required:or}),Bl=(0,d.useState)(function(){return Ut.getInitialValue(i)}),sm=Q(Bl,1),lm=sm[0],kf=Ut.getSavedValue(i),Mf,Th;(je||an)&&kf?(Pt("Setting field ".concat(Pd,"'s kept state"),kf),Mf=kf.value,Th=kf.touched,mr.removeSavedState(Pd)):ne!=null?Mf=ne:Mf=lm;var um=$e(pn(Mf,y,k,G,Cr)),hd=Q(um,3),Ul=hd[0],vd=hd[1],fm=hd[2],cm=$e(ye?yi(Ul):void 0),gd=Q(cm,3),Ph=gd[0],Ih=gd[1],dm=gd[2],pm=$e(Th),yd=Q(pm,3),Fh=yd[0],hm=yd[1],kh=yd[2],vm=(0,d.useState)(function(){return Nr(Ul,w,A,k)}),Mh=Q(vm,2),md=Mh[0],xd=Mh[1],Rh=(0,d.useRef)();Rh.current=md;var Lh=(0,d.useRef)(ne),va=(0,d.useRef)(i),Dh=(0,d.useRef)();Lh.current=ne,va.current=i;var gm=(0,d.useRef)(null),Ni=d.useMemo(function(){return r||gm},[]),bd=Et({value:Ul,inputRef:Ni,maintainCursor:!!He}),wd=bd.getCursor,ym=bd.setCursor,Sd=bd.setCursorOffset,mm=function(){return!0},Ad=function(sr){var sn=Ht||mm,Dn=mr.getFullField(va.current)||va.current,Jt={path:Dn,parentPath:Dn.replace(/(.*)[.[].*/,"$1"),get:function(Nn,Wl){return pt.get(Nn,Wl)}};return ar&&ar.relevant?sn(sr,Jt)&&ar.relevant(sr,Jt):sn(sr,Jt)},xm=$e(Ad(mr.getValues())),Ed=Q(xm,3),Rf=Ed[0],bm=Ed[1],Nh=Ed[2],wm=function(sr){return ar&&ar.relevant?ar.relevant(sr):!0},Sm=function(){var sr=Ad(mr.getValues()),sn=Nh();return sr!=sn&&bm(sr),sr};(0,d.useEffect)(function(){!Rf&&!je&&hs.current.reset()},[Rf]);var ni=function(){return Ve?mr.getDerrivedValue(i):fm()},jl=function(sr){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Dn=sn.preventUpdate;We&&mr.getStep()<We?(Pt("Setting ".concat(i,"'s error to undefined as we are not at that step")),Ih(void 0),Ut.setError(Rt,void 0,!Dn)):(Pt("Setting ".concat(i,"'s error to ").concat(sr)),Ih(sr),Ut.setError(Rt,sr,!Dn))},Cd=function(sr,sn){var Dn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=sr;Di.current=!0,Pt("Setting ".concat(i," to ").concat(Jt)),Cr&&(Jt=Cr(Jt));var ga=mr.getOptions(),Nn=Jt;if(Jt===""&&!me&&!Dn.allowEmptyString&&!ga.allowEmptyStrings&&(Jt=void 0),(t.type==="number"||Je==="number")&&Jt!==void 0&&(Jt=+Jt),sn&&sn.target&&sn.target.selectionStart&&ym(sn.target.selectionStart),y&&!Ee&&(Nn=y(Jt,wd()),Jt=y(Jt,wd())),E&&!Ee){var Wl=E(Jt,wd());Nn=Wl.value,Jt=Wl.value,Sd(Wl.offset)}if(w&&A&&(Jt=A(Jt),Nn=w(Jt)),k){var Bh=Be(Jt,k);Sd(Bh.offset),Nn=Bh.value,Jt=Nn}G&&(Jt=Jt!=null?G(Jt):Jt),yi&&re&&!Dn.initial&&(Pt("Validating after change ".concat(i," ").concat(Jt)),jl(yi(Jt,mr.getValues()))),vd(Jt),xd(Nn),Pe&&Pe(Jt),Ut.setValue(Rt,Jt,!Dn.preventUpdate)};Bt(function(){hs.current.setValue(Rh.current)},Y(wr));var Od=function(sr,sn){var Dn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Jt=Dn.preventUpdate;if(Pt("Field ".concat(i," has been touched")),yi&&se&&!sn&&sr&&(Pt("Validating after blur ".concat(i," ").concat(ni())),jl(yi(ni(),mr.getValues()))),s&&ge&&!sn&&sr&&(Pt("Validating async after blur ".concat(i," ").concat(ni())),s(ni(),mr.getValues())),y&&Ee){var ga=y(ni());vd(ga),xd(ga),Pe&&Pe(ga),Ut.setValue(Rt,ga,!Jt)}if(E&&Ee){var Nn=E(ni());Sd(Nn.offset),vd(Nn.value),xd(Nn.value),Pe&&Pe(Nn.value),Ut.setValue(Rt,Nn.value,!Jt)}hm(sr),Ut.setTouched(Rt,sr,!Jt)},Am=function(){var sr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},sn=sr.preventUpdate,Dn=pn(Lh.current||Ut.getInitialValue(va.current),y,k,G,Cr);Cd(Dn,null,{initial:!0,preventUpdate:sn}),jl(ye?yi(Dn):void 0,{preventUpdate:sn}),Od(void 0,!0,{preventUpdate:sn}),Di.current=!1},Em=function(sr){yi&&(Pt("Field validating ".concat(i," ").concat(ni())),jl(yi(ni(),sr||mr.getValues())))},Cm=function(sr){s&&(Pt("Field async validating ".concat(i," ").concat(ni())),s(ni(),sr||mr.getValues()))},Td={setValue:Cd,setTouched:Od,setError:jl,reset:Am,validate:Em,asyncValidate:Cm,getValue:ni,getTouched:kh,getError:dm,getIsRelevant:Nh,getDirty:Ff,getPristine:Nl,getFieldState:function(){return{value:ni(),touched:kh(),dirty:Ff(),pristine:Nl()}},relevant:Ad,multistepRelevant:wm,checkRelevant:Sm};hs.current=Td;var Vl={value:Ul,error:Ph,touched:Fh,maskedValue:md,isRelevant:Rf,dirty:Di.current,pristine:!Di.current};Ve&&(Vl={error:Ph,touched:Fh}),Pt("Render",mr.getFullField(i),Vl),vt(function(){var _r=mr.getFullField(va.current);return Pt("Register",Rt,va.current),ha.current={field:_r,fieldId:Rt,fieldApi:Td,fieldState:Vl,notify:Ge,keepState:je,inMultistep:an,shadow:Ve},Ut.register(Rt,ha.current),function(){var sr=mr.getFullField(va.current);Pt("Deregister",Rt,sr),Ut.deregister(Rt)}},[]),(0,d.useEffect)(function(){var _r=mr.getFullField(i);return Dl.current?Dl.current=!1:(Pt("Update",i,an),ha.current.field=_r,Ut.update(Rt,ha.current,Dh.current)),function(){Dh.current=_r}},[i]),vt(function(){Ne&&Ni&&(Ni.current.style.border="5px solid orange",setTimeout(function(){Ni.current.style.borderWidth="2px",Ni.current.style.borderStyle="inset",Ni.current.style.borderColor="initial",Ni.current.style.borderImage="initial"},500))});var Om=[].concat(Y(Object.values(Vl)),Y(Object.values(t)),Y(Object.values(Dr))),Tm=function(sr){return(0,d.useMemo)(function(){return Rf?sr:null},Y(Om))},Pd=i,Pm=mi({fieldType:Je,setValue:Cd,onChange:et,multiple:ze,ref:Ni}),Im=zr({setTouched:Od,onBlur:At}),Fm=Bi({fieldType:Je,maskedValue:md,multiple:ze,value:Ul}),km=Bn(Je);return{fieldState:Vl,fieldApi:Td,render:Tm,ref:Ni,userProps:j(j({},Dr),{},{multiple:ze,onChange:et,onBlur:At,id:Dr.id||Rt}),informed:j({name:Pd,multiple:ze,onChange:Pm,onBlur:Im,value:Fm,ref:Ni,type:km,id:Dr.id||Rt},Dr)}}var Gr=function(r){var i=d.forwardRef(function(a,s){var p=Tn(a,s),y=p.fieldState,E=p.fieldApi,w=p.render,A=p.ref,k=p.userProps;return w(d.createElement(r,D({fieldApi:E,fieldState:y,field:a.field,forwardedRef:A,debug:a.debug,type:a.type},k)))});return i.displayName="asField(".concat(Ke(r),")"),i},xi=Me("informed:Text "),bi=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,E=i.setTouched,w=s.onChange,A=s.onBlur,k=s.field,G=s.initialValue,ne=s.forwardedRef,re=s.debug,se=s.label,ye=s.title,ge=s.id,Ee=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return xi("Render",k),vt(function(){re&&ne&&(ne.current.style.background="red",setTimeout(function(){ne.current.style.background="white"},500))}),d.createElement(d.Fragment,null,se?d.createElement("label",{htmlFor:ge}," ",se," "):null,d.createElement("input",D({},Ee,{id:ge,name:k,ref:ne,value:!p&&p!==0?"":p,onChange:function(Pe){y(Pe.target.value,Pe),w&&w(Pe)},onBlur:function(Pe){E(!0),A&&A(Pe)}})))},qr=Gr(bi),vn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,E=i.setTouched,w=s.onChange,A=s.onBlur,k=s.field,G=s.initialValue,ne=s.forwardedRef,re=s.debug,se=s.label,ye=s.id,ge=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return vt(function(){re&&ne&&(ne.current.style.background="red",setTimeout(function(){ne.current.style.background="white"},500))}),d.createElement(d.Fragment,null,se?d.createElement("label",{htmlFor:ye}," ",se," "):null,d.createElement("textarea",D({},ge,{id:ye,name:k,ref:ne,value:p||"",onChange:function(me){y(me.target.value,me),w&&w(me)},onBlur:function(me){E(!0),A&&A(me)}})))},Un=Gr(vn),jn=Me("informed:Select "),gn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setTouched,E=s.onChange,w=s.onBlur,A=s.field,k=s.initialValue,G=s.options,ne=s.children,re=s.forwardedRef,se=s.debug,ye=s.multiple,ge=s.label,Ee=s.id,me=C(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),Pe=(0,d.useRef)(),Ge=function(He){var Ne=Array.from((re||Pe).current).filter(function(Ve){return Ve.selected}).map(function(Ve){return Ve.value});i.setValue(ye?Ne:Ne[0]||""),E&&He&&E(He)};return vt(function(){se&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),jn("Render",A,p),d.createElement(d.Fragment,null,ge?d.createElement("label",{htmlFor:Ee}," ",ge," "):null,d.createElement("select",D({},me,{id:Ee,multiple:ye,name:A,ref:re||Pe,value:p||(ye?[]:""),onChange:Ge,onBlur:function(He){y(!0),w&&w(He)}}),G?G.map(function(je){return d.createElement("option",{key:je.value,value:je.value,disabled:je.disabled},je.label)}):ne))},Xn=Gr(gn),wi=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setValue,E=i.setTouched,w=s.onChange,A=s.onBlur,k=s.field,G=s.initialValue,ne=s.debug,re=s.forwardedRef,se=s.id,ye=s.label,ge=C(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return d.createElement(d.Fragment,null,ye?d.createElement("label",{htmlFor:se}," ",ye," "):null,d.createElement("input",D({},ge,{id:se,name:k,ref:re,checked:!!p,onChange:function(me){y(me.target.checked),w&&w(me)},onBlur:function(me){E(!0),A&&A(me)},type:"checkbox"})))},Br=Gr(wi),$r=function(r){return d.forwardRef(function(i,a){return d.createElement(jt.Consumer,null,function(s){var p=s.radioGroupApi,y=s.radioGroupState;return d.createElement(r,D({radioGroupApi:p,radioGroupState:y,ref:a},i))})})},Qn=function(r){var i=r.radioGroupApi,a=r.radioGroupState,s=C(r,["radioGroupApi","radioGroupState"]),p=a.value,y=i.setValue,E=i.setTouched,w=i.onChange,A=i.onBlur,k=s.value,G=s.onChange,ne=s.onBlur,re=s.field,se=s.initialValue,ye=s.forwardedRef,ge=C(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return d.createElement("input",D({},ge,{name:re,ref:ye,value:k,checked:p===k,onChange:function(me){!me.target.checked||(y(k),G&&G(me),w&&w(me))},onBlur:function(me){E(!0),ne&&ne(me),A&&A(me)},type:"radio"}))},ur=$r(Qn),Tt=function(t){q(i,t);var r=_(i);function i(){return b(this,i),r.apply(this,arguments)}return g(i,[{key:"render",value:function(){var s=this.props,p=s.options,y=s.children;return d.createElement(jt.Provider,{value:this.groupContext},p?p.map(function(E){return d.createElement("label",{key:E.value},E.label," ",d.createElement(ur,{value:E.value}))}):y)}},{key:"groupContext",get:function(){return{radioGroupApi:j(j({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(d.Component),ii=Gr(Tt);function Si(){return(0,d.useContext)(St)}var An=function(){var r=Si(),i=r.add;return d.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function Zt(){return(0,d.useContext)(Dt)}var Vn=function(){var r=Zt(),i=r.remove;return d.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},Zn=Me("informed:useArrayField "),lo=function(r){var i=r.field,a=r.initialValue,s=r.validate,p=r.arrayFieldApiRef,y=C(r,["field","initialValue","validate","arrayFieldApiRef"]),E=Ie(),w=(0,d.useState)(new Map),A=Q(w,1),k=A[0],G=(0,d.useContext)(kt),ne=E.getFullField(i),re=G.getInitialValue(i)||a||[],se=E.getSavedValue(ne)&&E.getSavedValue(ne).value,ye=$e(se||re),ge=Q(ye,3),Ee=ge[0],me=ge[1],Pe=ge[2],Ge=Ee?Ee.map(function(){return le()}):[],je=$e(Ge),He=Q(je,3),Ne=He[0],Ve=He[1],We=He[2],Je=(0,d.useMemo)(function(){return function(Yt,Rt){var Ut=We()==null?0:We().length;return s?s(Yt,Ut,Rt):void 0}}),ze=Tn(j({field:i,validate:s?Je:void 0,shadow:!0},y)),et=ze.fieldApi;vt(function(){var Yt=function(Ut){Ut!==ne&&(Zn("".concat(ne," changed")),RegExp("".concat(ne,"\\[[0-9]+\\]")).test(Ut)&&et.validate())};return E.emitter.on("value",Yt),function(){E.emitter.removeListener("value",Yt)}},[i]);var At=function(Rt){Zn("EXPECTING REMOVAL OF","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Ne.length-1,"]")),G.expectRemoval("".concat(i,"[").concat(Rt,"]")),G.expectRemoval("".concat(i,"[").concat(Ne.length-1,"]"));var Ut=Ne.slice(0,Rt).concat(Ne.slice(Rt+1,Ne.length));Ve(Ut);var ar=Pe(),an=ar.slice(0,Rt).concat(ar.slice(Rt+1,ar.length));me(an)},Nt=function(Rt,Ut){Zn("Swapping","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Ut,"]"));var ar=Y(Ne);Ne[Rt]&&Ne[Ut]?(ar[Rt]=Ne[Ut],ar[Ut]=Ne[Rt]):console.warn("Attempted to swap ".concat(Rt," with ").concat(Ut," but one of them does not exist :(")),Ve(ar)},Ht=function(){Ne.push(le()),Ve(Y(Ne))},or=function(Rt){Ne.push(le()),Ve(Y(Ne));var Ut=Y(Pe());Ut[Ne.length-1]=Rt,me(Ut)},Mr=function(){var Rt=G.getInitialValue(i)||a||[];me(Rt);var Ut=Rt?Rt.map(function(){return le()}):[];Ve(Ut)},Cr=Ne.map(function(Yt,Rt){var Ut={remove:function(){return At(Rt)}},ar={initialValue:Ee&&Ee[Rt],key:Yt,field:"".concat(i,"[").concat(Rt,"]"),index:Rt};return j(j({arrayFieldItemApi:Ut,arrayFieldItemState:ar},Ut),ar)}),Jr={add:Ht,swap:Nt,addWithInitialValue:or,reset:Mr};p&&(p.current=Jr);var wr={fields:Cr,field:i},Dr=j(j({},G),{},{register:function(Rt,Ut){k.set(Rt,Ut);for(var ar=arguments.length,an=new Array(ar>2?ar-2:0),mr=2;mr<ar;mr++)an[mr-2]=arguments[mr];G.register.apply(G,[Rt,Ut].concat(an))},deregister:function(Rt){k.delete(Rt);for(var Ut=arguments.length,ar=new Array(Ut>1?Ut-1:0),an=1;an<Ut;an++)ar[an-1]=arguments[an];G.deregister.apply(G,[Rt].concat(ar))},getInitialValue:function(Rt){if(RegExp("".concat(ne,"\\[[0-9]+\\]")).test(Rt)){var Ut=Rt.replace(i,""),ar=pt.get(Pe(),Ut);return Zn("Resetting ".concat(Ut," to ").concat(ar)),ar}return G.getInitialValue(Rt)}}),Sn=function(Rt){return d.createElement(kt.Provider,{value:Dr},d.createElement(St.Provider,{value:Jr},d.createElement(Vt.Provider,{value:wr},Rt)))};return{render:Sn,add:Ht,swap:Nt,addWithInitialValue:or,fields:Cr,arrayFieldState:wr,arrayFieldApi:Jr,field:i}},ot=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getSavedValue:function(s){return i.getSavedValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})};function Lt(t){var r=Ie(),i=(0,d.useMemo)(function(){return ot(t,r)},[t]);return i}function oi(){var t=(0,d.useContext)(Ct);return t}var ue=function(r){var i=r.when,a=r.children,s=oi(),p=i(s);return p?a:null},Oe=function(r){var i=r.relevant,a=r.field,s=C(r,["relevant","field"]),p=Ie();if(i){var y=p.getFullField(a),E={path:y,parentPath:y.replace(/(.*)[.[].*/,"$1"),get:function(k,G){return pt.get(k,G)}},w=function(k){var G=k.values;return i(G,E)};return d.createElement(ue,{when:w},d.createElement(qe,D({field:a},s)))}else return d.createElement(qe,D({field:a},s))},qe=function(r){var i=r.children,a=C(r,["children"]),s=lo(a),p=s.render,y=s.arrayFieldState,E=s.arrayFieldApi,w=s.field;return p(typeof i=="function"?i(j(j({field:w,arrayFieldApi:E,arrayFieldState:y},E),y)):i)},st=function(r){var i=r.arrayFieldItemState,a=r.arrayFieldItemApi,s=r.children,p=(0,d.useContext)(kt),y=Ie(),E=(0,d.useState)(0),w=Q(E,2),A=w[0],k=w[1],G=(0,d.useState)(new Map),ne=Q(G,1),re=ne[0],se=i.field,ye=Lt(se),ge=function(){var Ne=y.getState(),Ve=Ne.values,We=Ne.errors,Je=Ne.touched,ze={values:pt.get(Ve,se),errors:pt.get(We,se),touched:pt.get(Je,se)};return ze};(0,d.useEffect)(function(){var He=function(Ve){var We=Ve.slice(0,Ve.lastIndexOf("[")!=-1?Ve.lastIndexOf("]")+1:Ve.length);We===se&&k(Math.random())};return y.emitter.on("value",He),function(){y.emitter.removeListener("value",He)}},[se]);var Ee=function(){re.forEach(function(Ne){Ne.fieldApi.reset()})},me=ge(),Pe=j(j({},p),{},{register:function(Ne,Ve,We){re.set(Ne,Ve),p.register(Ne,Ve,We)},deregister:function(Ne){re.delete(Ne);for(var Ve=arguments.length,We=new Array(Ve>1?Ve-1:0),Je=1;Je<Ve;Je++)We[Je-1]=arguments[Je];p.deregister.apply(p,[Ne].concat(We))}}),Ge=j(j(j({},a),ye),{},{reset:Ee}),je=j(j({},i),me);return typeof s=="function"?d.createElement(kt.Provider,{value:Pe},d.createElement(Dt.Provider,{value:Ge},d.createElement(ve.Provider,{value:je},s(j(j({arrayFieldItemApi:Ge,arrayFieldItemState:je},Ge),je))))):d.createElement(kt.Provider,{value:Pe},d.createElement(Dt.Provider,{value:Ge},d.createElement(ve.Provider,{value:je},s)))};Oe.Items=function(t){var r=t.children,i=(0,d.useContext)(Vt),a=i.fields;return a.map(function(s){var p=s.arrayFieldItemState,y=s.arrayFieldItemApi,E=p.key;return d.createElement(st,{key:E,arrayFieldItemApi:y,arrayFieldItemState:p},r)})};var lt=function(r){var i=r.components,a=(0,d.useContext)(kt),s=a.fieldMap;return i?i.map(function(p,y){var E=p["ui:control"],w=s[E];return d.createElement(w,{key:"ui-comp-".concat(y)})}):null},Kt=Me("informed:FormFields "),Xt=function t(r){var i=r.schema,a=r.prefix,s=r.onlyValidateSchema,p=(0,d.useContext)(kt),y=p.fieldMap,E=(0,d.useMemo)(function(){var w=de(i,s,a),A=w.map(function(k,G){var ne=k.field,re=k.props,se=k.type,ye=k.properties,ge=k.items,Ee=k.componentType,me=k.uiBefore,Pe=k.uiAfter,Ge=k.allOf,je=y[Ee];return Kt("Rendering Field",ne,k),!je&&se==="object"&&ye?d.createElement(t,{schema:k,prefix:ne,key:"ScheamField-".concat(G)}):!je&&se==="array"&&ge?d.createElement(Tr,D({key:"ScheamField-".concat(G),field:ne,items:ge,uiBefore:me,uiAfter:Pe},re)):je&&Ee==="array"&&ge&&se==="array"?d.createElement(je,D({key:"ScheamField-".concat(G),field:ne,items:ge,uiBefore:me,uiAfter:Pe},re)):Ee==="conditionals"?Ge.map(function(He){var Ne=He.then,Ve=He.if.properties,We=function(ze){var et=ze.values;return Object.keys(Ve).every(function(At){var Nt=Ve[At];return et[At]===Nt.const})};return d.createElement(ue,{key:"ScheamField-".concat(G),when:We},d.createElement(t,{schema:Ne}))}):je?d.createElement(je,D({key:"ScheamField-".concat(G),field:ne},re)):null});return A},[i,a]);return E},Tr=function(r){var i=r.field,a=r.items,s=r.uiBefore,p=r.uiAfter,y=C(r,["field","items","uiBefore","uiAfter"]);return d.createElement(Oe,D({field:i},y),d.createElement(lt,{components:s}),d.createElement(Oe.Items,null,function(E){var w=E.field;return d.createElement(d.Fragment,null,d.createElement(lt,{components:a["ui:before"]}),d.createElement(Xt,{schema:a,prefix:w}),d.createElement(lt,{components:a["ui:after"]}))}),d.createElement(lt,{components:p}))},Pr={select:Xn,input:qr,textarea:Un,checkbox:Br,radio:ii,add:An,remove:Vn,array:Tr},_t=Me("informed:Controller "),Hl=function(r,i){var a=Object.keys(i).find(function(p){return r.includes(p)});if(!!a){var s=r.slice(0,a.length);return s===a}},en=function(){},vs=function(){function t(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b(this,t),this.options=i,this.subscriptions=new Map;var a=i.ajv,s=i.schema,p=i.fieldMap;this.ajv=a?new a({allErrors:!0}):null,this.ajvValidate=a?this.ajv.compile(s):null,this.fieldMap=p||Pr,this.fieldsById=new Map,this.fieldsByName={get:function(E){var w;return r.fieldsById.forEach(function(A){A&&A.field===E&&(w=A)}),w}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:en,setTouched:en,setError:en,reset:en,validate:en,getValue:en,getTouched:en,getError:en,getFieldState:en,checkRelevant:en,getPristine:en,getDirty:en}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(E,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(E);k.shadow||pt.set(r.state.values,k.field,k.fieldApi.getValue()),k.fieldApi.relevant(r.state.values)||pt.delete(r.state.values,k.field),r.fieldsById.forEach(function(G){var ne=G.fieldApi.checkRelevant();(!G.fieldApi.multistepRelevant(r.state.values)||!ne&&!G.keepState)&&(pt.delete(r.state.values,G.field),pt.delete(r.state.touched,G.field),pt.delete(r.state.errors,G.field))}),A&&(r.emit("change"),r.emit("field",k.field),r.emit("value",k.field,w))},setTouched:function(E,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(E);!k.shadow&&k.fieldApi.getIsRelevant()&&pt.set(r.state.touched,k.field,k.fieldApi.getTouched()),k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)&&pt.set(r.state.touched,k.field,k.fieldApi.getTouched()),A&&(r.emit("change"),r.emit("field",k.field))},setError:function(E,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(E);!k.shadow&&k.fieldApi.getIsRelevant()&&pt.set(r.state.errors,k.field,k.fieldApi.getError());var G=pt.get(r.state.errors,k.field);(k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)||k.shadow&&k.fieldApi.getError()===void 0&&k.fieldApi.relevant(r.state.values)&&typeof G=="string")&&pt.set(r.state.errors,k.field,k.fieldApi.getError()),A&&(r.emit("change"),r.emit("field",k.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",function(y){delete r.state.error,r.notify(y)})}return g(t,[{key:"emit",value:function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),p=1;p<a;p++)s[p-1]=arguments[p];var y=this.subscriptions.get(i);y&&y.forEach(function(E){return E.apply(void 0,s)})}},{key:"on",value:function(i,a){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(a)}},{key:"removeListener",value:function(i,a){var s=this.subscriptions.get(i);s.delete(a)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,a,s){this.getField(i).fieldApi.setValue(a,null,j({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,a){this.getField(i).fieldApi.setTouched(a)}},{key:"setError",value:function(i,a){this.getField(i).fieldApi.setError(a)}},{key:"setFormError",value:function(i){this.state.error=i,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(i,a){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,a),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(_t("Submit",this.state),this.emit("submit")):(_t("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(i){this.state.step=i,this.emit("change")}},{key:"setCurrent",value:function(i){this.state.Current=i,this.emit("change")}},{key:"back",value:function(i){this.state.step=this.state.step-1,this.state.Current=i,this.emit("change")}},{key:"next",value:function(i){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=i),this.emit("change")}},{key:"setInitialValue",value:function(i,a){pt.set(this.options.initialValues,i,a)}},{key:"getFormState",value:function(){return _t("Returning form state"),j(j({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var a=this.getValues();return pt.get(a,i)}},{key:"getValue",value:function(i){var a=this.getField(i).fieldApi.getValue();return _t("Getting value for",i,a),a}},{key:"getTouched",value:function(i){var a=this.getField(i).fieldApi.getTouched();return _t("Getting touched for",i,a),a}},{key:"getError",value:function(i){var a=this.getField(i).fieldApi.getError();return _t("Getting error for",i,a),a}},{key:"getDirty",value:function(i){var a=this.getField(i).fieldApi.getDirty();return _t("Getting dirty for",i,a),a}},{key:"getPristine",value:function(i){var a=this.getField(i).fieldApi.getPristine();return _t("Getting pristine for",i,a),a}},{key:"getValues",value:function(){return _t("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return _t("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return _t("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?pt.get(this.savedValues,"shadow-".concat(i)):pt.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?pt.delete(this.savedValues,"shadow-".concat(i)):pt.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return pt.get(this.options.initialValues,i)}},{key:"getField",value:function(i){_t("Getting Field",i);var a=this.fieldsByName.get(i);return a||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var a=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(p){var y=".".concat(i),E="".concat(y.replace(/(.*)[.[].*/,"$1"),".").concat(p).slice(1),w=a.getField(E);w&&(_t("Notifying",w.field),w.fieldApi.validate(),w.fieldApi.checkRelevant())})}},{key:"validateField",value:function(i){this.getField(i).fieldApi.validate()}},{key:"resetField",value:function(i){this.getField(i).fieldApi.reset()}},{key:"fieldExists",value:function(i){return this.fieldsByName.get(i)!=null}},{key:"valid",value:function(){var i=this.getErrors();return!!(pt.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(a){var s=Q(a,2),p=s[1];return p.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!pt.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(a){a.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){_t("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){_t("Setting values"),this.fieldsById.forEach(function(a){var s=pt.get(i,a.field);s!==void 0&&a.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;_t("Validating all fields");var a=this.getValues();if(this.options.validationSchema){var s=Re(this.options.validationSchema,a);this.fieldsById.forEach(function(w){if(pt.has(s,w.field)){var A=pt.get(s,w.field);i.setError(w.field,A)}else i.setError(w.field,void 0)})}if(this.options.schema&&this.options.ajv){var p=O(this.ajvValidate,a);this.fieldsById.forEach(function(w){if(pt.has(p,w.field)){var A=pt.get(p,w.field);i.setError(w.field,A)}else i.setError(w.field,void 0)})}if(this.fieldsById.forEach(function(w){w.fieldApi.validate(a),w.fieldApi.setTouched(!0,!0)}),this.options.validate){var y=this.options.validate(a);this.setFormError(y)}if(this.options.validateFields){var E=this.options.validateFields(a);this.fieldsById.forEach(function(w){if(pt.has(E,w.field)){var A=pt.get(E,w.field);i.setError(w.field,A)}})}}},{key:"asyncValidate",value:function(){_t("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(a){a.fieldApi.asyncValidate(i)})}},{key:"keyDown",value:function(i){if(i.keyCode==13&&this.options.preventEnter)return i.preventDefault(i),!1}},{key:"submitForm",value:function(i){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&i&&i.preventDefault(i),this.validate(),this.emit("change"),this.asyncValidate(),!(this.state.validating>0)&&(this.valid()?(_t("Submit",this.state),this.emit("submit")):(_t("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(a){i.emit("field",a.field)})}},{key:"register",value:function(i,a,s){var p=a.field,y=a.state;_t("Register ID:",i,"Name:",p,y,"Initial",s);var E=p.slice(0,p.lastIndexOf("[")!=-1?p.lastIndexOf("]")+1:p.length),w;this.fieldsById.forEach(function(A,k){A&&A.field===p&&(w=k)}),w&&(a.keepState||a.inMultistep)?(_t("Already Registered",p),this.fieldsById.delete(w)):w&&(!a.keepState||!a.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",p),_t("Fields Registered",this.fieldsById.size),this.onScreen[i]=a,this.fieldsById.set(i,a),_t("clearing expected removal",E),delete this.expectedRemovals[E],delete this.pulledOut[E],!a.shadow&&(this.updater.setValue(i,a.fieldApi.getValue(),!1),this.updater.setError(i,a.fieldApi.getError(),!1),this.updater.setTouched(i,a.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",p))}},{key:"deregister",value:function(i){var a=this.fieldsById.get(i),s=a.field;_t("Deregister",i,s),delete this.onScreen[i];var p=Hl(s,this.expectedRemovals),y=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(a.keepState||a.inMultistep)&&!p&&(_t("Saving field ".concat(s,"'s value"),a.fieldApi.getFieldState()),a.shadow?pt.set(this.savedValues,"shadow-".concat(s),a.fieldApi.getFieldState()):pt.set(this.savedValues,s,a.fieldApi.getFieldState())),(p||!a.keepState&&!a.inMultistep||!a.fieldApi.getIsRelevant()&&!a.keepState)&&(_t("Removing field",s),this.fieldsById.delete(i),p||(pt.delete(this.state.values,s),pt.delete(this.state.touched,s),pt.delete(this.state.errors,s),a.shadow?pt.delete(this.savedValues,"shadow-".concat(s)):pt.delete(this.savedValues,s)),p&&this.pulledOut[y]&&(_t("Pulling out",s,"with magic value",y),pt.pullOut(this.state.values,y),pt.pullOut(this.state.touched,y),pt.pullOut(this.state.errors,y),pt.pullOut(this.savedValues,y),delete this.pulledOut[y])),this.emit("change")}},{key:"expectRemoval",value:function(i){_t("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,a,s){_t("Update",i,a.field,s,a.fieldState.value);var p=a.fieldApi.getValue(),y=a.fieldApi.getError(),E=a.fieldApi.getTouched(),w=this.fieldsByName.get(s);s&&!w&&(pt.set(this.state.values,s),pt.set(this.state.errors,s),pt.set(this.state.touched,s)),pt.set(this.state.values,a.field,p),pt.set(this.state.errors,a.field,y),pt.set(this.state.touched,a.field,E),this.emit("change")}}]),t}(),ya=Me("informed:FormProvider "),gs=function(r){var i=r.children,a=r.formApi,s=r.formController,p=r.formState,y=C(r,["children","formApi","formController","formState"]);if(ya("Render FormProvider"),a)return ya("Render FormProvider with given values"),d.createElement(kt.Provider,{value:s.updater},d.createElement(Wt.Provider,{value:a},d.createElement(Ct.Provider,{value:p},i)));ya("Render FormProvider with generated values");var E=ms(y);return d.createElement(kt.Provider,{value:E.formController.updater},d.createElement(Wt.Provider,{value:E.formApi},d.createElement(Ct.Provider,{value:E.formState},i)))},ys=Me("informed:useForm "),ms=function(r){var i=r.dontPreventDefault,a=r.initialValues,s=r.validate,p=r.validateFields,y=r.allowEmptyStrings,E=r.preventEnter,w=r.getApi,A=r.apiRef,k=r.onChange,G=r.onReset,ne=r.onSubmit,re=r.onValueChange,se=r.onSubmitFailure,ye=r.validationSchema,ge=r.schema,Ee=r.ajv,me=r.fieldMap,Pe=r.onlyValidateSchema,Ge=C(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);ys("Render useForm");var je=(0,d.useMemo)(function(){return{dontPreventDefault:i,initialValues:a,validate:s,validateFields:p,allowEmptyStrings:y,preventEnter:E,validationSchema:ye,schema:ge,ajv:Ee,fieldMap:me}},[i,a,s,p,y,E,ye,ge,Ee,me]),He=(0,d.useState)(function(){return new vs(je)}),Ne=Q(He,1),Ve=Ne[0];(0,d.useEffect)(function(){Ve.setOptions(je)},[je]),vt(function(){Ve.mount()},[]);var We=(0,d.useState)(function(){return Ve.getFormState()}),Je=Q(We,2),ze=Je[0],et=Je[1];vt(function(){var Mr=function(){return k&&k(Ve.getFormState())},Cr=function(){return G&&G()},Jr=function(){return ne&&ne(Ve.getFormState().values)},wr=function(){return re&&re(Ve.getFormState().values)},Dr=function(){return se&&se(Ve.getFormState().errors)};return Ve.on("change",Mr),Ve.on("reset",Cr),Ve.on("submit",Jr),Ve.on("value",wr),Ve.on("failure",Dr),function(){Ve.removeListener("change",Mr),Ve.removeListener("reset",Cr),Ve.removeListener("submit",Jr),Ve.removeListener("value",wr),Ve.removeListener("failure",Dr)}},[k,G,ne,re,se]),(0,d.useState)(function(){var Mr=function(){ys("Setting form state"),et(Ve.getFormState())};Ve.on("change",Mr),w&&w(Ve.getFormApi()),A&&(A.current=Ve.getFormApi())});var At=(0,d.useState)(function(){return Ve.getFormApi()}),Nt=Q(At,1),Ht=Nt[0],or=function(Cr){return d.createElement(gs,{formApi:Ht,formState:ze,formController:Ve},d.createElement(d.Fragment,null,Cr||d.createElement(Xt,{schema:ge,onlyValidateSchema:Pe})))};return{formApi:Ht,formState:ze,formController:Ve,render:or,userProps:Ge}},zl=Me("informed:Form "),Gl=function(r){var i=r.children,a=r.render,s=r.component,p=C(r,["children","render","component"]);zl("Render FORM");var y=ms(p),E=y.formApi,w=y.formController,A=y.formState,k=y.render,G=y.userProps,ne=function(){var se={formState:A,formApi:E};return s?d.createElement(s,se,i):a?a(se):typeof i=="function"?i(se):i};return k(d.createElement("form",D({},G,{onReset:w.reset,onSubmit:w.submitForm,onKeyDown:w.keyDown}),ne()))},Lf=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},Df=function(r,i){var a=i.register,s=i.deregister,p=i.setValue,y=i.setTouched,E=i.setError,w=i.update,A=i.getField,k=i.expectRemoval,G=i.getInitialValue,ne=i.fieldMap,re=i.getSavedValue;return{register:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return a.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},deregister:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return s.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},update:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return w.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},setValue:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return p.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},setTouched:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return y.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},setError:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return E.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},getField:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return A.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},expectRemoval:function(ye){for(var ge=arguments.length,Ee=new Array(ge>1?ge-1:0),me=1;me<ge;me++)Ee[me-1]=arguments[me];return k.apply(void 0,["".concat(r,".").concat(ye)].concat(Ee))},getInitialValue:function(ye){return G("".concat(r,".").concat(ye))},getSavedValue:function(ye){return re("".concat(r,".").concat(ye))},fieldMap:ne}},Nf=function(r){var i=r.scope,a=r.children,s=useContext(kt),p=Ie(),y=oi(),E=useMemo(function(){return Lf(i,p)},[i]),w=useMemo(function(){return Df(i,s)},[i]);return React.createElement(kt.Provider,{value:w},React.createElement(Wt.Provider,{value:E},React.createElement(Ct.Provider,{value:y},a)))},Ai=function(r){var i=oi(),a={};Object.keys(r).length>0?Object.keys(r).forEach(function(re){a[re]=i[re]}):a=i;var s=a,p=s.pristine,y=s.dirty,E=s.invalid,w=s.values,A=s.errors,k=s.touched,G=s.validating,ne=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:p,dirty:y,invalid:E,values:w,errors:A,touched:k,validating:G,submitting:ne},null,2)))},Bf=function(r){var i=r.initialStep,a=r.multistepApiRef,s=Ie(),p=s.getValues,y=s.validate,E=s.screenValid,w=(0,d.useState)(new Map),A=Q(w,1),k=A[0],G=(0,d.useRef)(0),ne=$e({current:i,steps:[],goal:null}),re=Q(ne,3),se=re[0],ye=re[1],ge=re[2],Ee=(0,d.useState)(function(){var je=function(){var Ve=ge(),We=Ve.current,Je=k.get(We);return Je},He={getState:function(){return ge()},getCurrentStep:je,getStep:function(Ve){return k.get(Ve)},getNumberOfSteps:function(){return k.size},next:function(){if(y(),E()){var Ve=je(),We=Ve.getNext,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ye(function(et){return j(j({},et),{},{current:ze})})}},back:function(){var Ve=je(),We=Ve.getPrevious,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ye(function(et){return j(j({},et),{},{current:ze})})},setCurrent:function(Ve){if(Ve){var We=k.get(Ve).index;We<je().index?ye(function(Je){return j(j({},Je),{},{current:Ve,goal:null})}):ye(function(Je){return j(j({},Je),{},{goal:Ve})})}},register:function(Ve,We,Je){Je?(G.current=G.current+1,k.set(Ve,j(j({},We),{},{index:G.current}))):ye(function(ze){return j(j({},ze),{},{steps:Array.from(k.keys())})})},deregister:function(Ve){k.delete(Ve),G.current=G.current-1,ye(function(We){return j(j({},We),{},{steps:Array.from(k.keys())})})}};return a&&(a.current=He),He}),me=Q(Ee,1),Pe=me[0],Ge=function(He){return d.createElement($.Provider,{value:Pe},d.createElement(z.Provider,{value:se},He))};return j(j(j({},Pe),se),{},{render:Ge})};function Uf(){return(0,d.useContext)(z)}function ma(){return(0,d.useContext)($)}var Po=function(r){var i=r.step,a=r.next,s=r.previous,p=r.relevant,y=oi(),E=y.values,w=Uf(),A=w.current,k=w.goal,G=ma(),ne=G.register,re=G.deregister,se=G.next,ye=i===A,ge=p?p(E):!0,Ee=(0,d.useRef)(a),me=(0,d.useRef)(s),Pe=(0,d.useRef)();Ee.current=a,me.current=s,Pe.current=p,(0,d.useState)(function(){ne(i,{name:i,getNext:function(){return Ee.current},getPrevious:function(){return me.current}},!0)}),(0,d.useEffect)(function(){return ne(i,{name:i,getNext:function(){return Ee.current},getPrevious:function(){return me.current}}),function(){re(i)}},[i]),(0,d.useEffect)(function(){k&&ye&&k!==i&&se()},[k,ye]);var Ge=function(He){return d.createElement(Se.Provider,{value:{relevant:function(Ve){return Pe.current?Pe.current(Ve):!0},multistep:!0}},ye&&ge?He:null)};return{isCurrent:ye,isRelevant:ge,step:i,render:Ge}};function jf(t){var r=t.children,i=C(t,["children"]),a=Bf(i),s=a.render,p=C(a,["render"]);return s(typeof r=="function"?r(p):r)}jf.Step=function(r){var i=r.children,a=C(r,["children"]),s=Po(a),p=s.render;return p(i)};var Id=function(r){var i=r.field,a=useContext(kt),s=a.fieldMap,p=Ie(),y=p.getFullField,E=p.getOptions,w=y(i),A=E(),k=A.schema,G=oe(w),ne=pt.get(k,G);if(!ne)return null;var re=te(i,ne),se=re.props,ye=re.componentType,ge=s[ye];return React.createElement(ge,D({field:i},se))},Fd=function(){var r=Ie(),i=r.getOptions,a=i(),s=a.schema;return React.createElement(Xt,{schema:s})},kd=function(r){return React.forwardRef(function(i,a){return React.createElement(Wt.Consumer,null,function(s){return React.createElement(r,D({formApi:s,ref:a},i))})})},$l=function(r){return React.forwardRef(function(i,a){return React.createElement(Ct.Consumer,null,function(s){return React.createElement(r,D({formState:s,ref:a},i))})})},Kl=function(r,i){return{getValue:function(){return r.getValue(i)},setValue:function(s){return r.setValue(i,s)},getTouched:function(){return r.getTouched(i)},setTouched:function(s){return r.setTouched(i,s)},getError:function(){return r.getError(i)},setError:function(s){return r.setError(i,s)},reset:function(){return r.resetField(i)},validate:function(){return r.validateField(i)},exists:function(){return r.fieldExists(i)},getDirty:function(){return r.getDirty(i)},getPristine:function(){return r.getPristine(i)},getFieldState:function(){return r.getField(i).fieldApi.getFieldState()}}};function Yl(t){var r=Ie(),i=useMemo(function(){return Kl(r,t)},[t]);return i}function Jl(t){var r=Yl(t),i=Ie(),a=React.useState(),s=Q(a,2),p=s[1],y=React.useCallback(function(){return p({})},[]);return vt(function(){var E=function(A){A===t&&y()};return i.emitter.on("field",E),function(){i.emitter.removeListener("field",E)}},[]),vt(function(){y()},[]),r.getFieldState()||{}}var Vf=function(r){return function(i){return function(a){var s=Jl(r);return React.createElement(i,D({fieldState:s},a))}}},xs=function(r){return function(i){return function(a){var s=Yl(r);return React.createElement(i,D({fieldApi:s},a))}}},bs=function(r){var i=r.value,a=r.forwardedRef,s=r.children,p=C(r,["value","forwardedRef","children"]);return React.createElement("option",D({ref:a,value:i,key:i},p),s)},Xl=null,Io=o(80150),ws=o(89356),Ui=o(63263),Wf=o(30699),xa=o(58377),Wn=o(28834),Ql=o(13038),Hf=o(32752),Fo=o(44341);function Ss(t,r,i){return r in t?Fo(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function ai(t,r){var i=ws(t);if(Ui){var a=Ui(t);r&&(a=Wf(a).call(a,function(s){return xa(t,s).enumerable})),i.push.apply(i,a)}return i}function fr(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){var a;Wn(a=ai(Object(i),!0)).call(a,function(p){Ss(t,p,i[p])})}else if(Ql)Hf(t,Ql(i));else{var s;Wn(s=ai(Object(i))).call(s,function(p){Fo(t,p,xa(i,p))})}}return t}var si=o(28583),ji=o.n(si),As=o(10240),Vi=o.n(As),Ei=o(8575),Wi=o(51446),Es=o(19996),Cs=o(78363),Zl=o(95238),Os=o(53592);function Ts(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=t[i];return a}function Ps(t,r){var i;if(!!t){if(typeof t=="string")return Ts(t,r);var a=Zl(i=Object.prototype.toString.call(t)).call(i,8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Os(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ts(t,r)}}function Hi(t,r){var i=typeof Wi!="undefined"&&Es(t)||t["@@iterator"];if(!i){if(Cs(t)||(i=Ps(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(A){throw A},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
81
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,y=!1,E;return{s:function(){i=i.call(t)},n:function(){var A=i.next();return p=A.done,A},e:function(A){y=!0,E=A},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(y)throw E}}}}var zf=o(23882);function nr(t){return typeof Wi=="function"&&typeof zf=="symbol"?nr=function(i){return typeof i}:nr=function(i){return i&&typeof Wi=="function"&&i.constructor===Wi&&i!==Wi.prototype?"symbol":typeof i},nr(t)}function Gf(t){if(Cs(t))return t}function _l(t,r){var i=t&&(typeof Wi!="undefined"&&Es(t)||t["@@iterator"]);if(i!=null){var a=[],s=!0,p=!1,y,E;try{for(i=i.call(t);!(s=(y=i.next()).done)&&(a.push(y.value),!(r&&a.length===r));s=!0);}catch(w){p=!0,E=w}finally{try{!s&&i.return!=null&&i.return()}finally{if(p)throw E}}return a}}function ba(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
82
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tn(t,r){return Gf(t)||_l(t,r)||Ps(t,r)||ba()}var ql=o(69798);function eu(t,r,i,a,s,p,y){try{var E=t[p](y),w=E.value}catch(A){i(A);return}E.done?r(w):ql.resolve(w).then(a,s)}function Is(t){return function(){var r=this,i=arguments;return new ql(function(a,s){var p=t.apply(r,i);function y(w){eu(p,a,s,y,E,"next",w)}function E(w){eu(p,a,s,y,E,"throw",w)}y(void 0)})}}var ko=o(63109),ir=o.n(ko),$f=o(78580),wa=o.n($f),Mo=o(72119),tu=o.n(Mo),ru=o(66419),Kf=o.n(ru),Fs=o(59340),Ro=o.n(Fs),Yf=o(2991),qt=o.n(Yf),nu=o(86902),Qt=o.n(nu),Jf=o(77766),Ot=o.n(Jf),li=o(26295),Lo=o.n(li),ks=o(20116),ln=o.n(ks),ui=o(31905),zi=o(92495),Do=o.n(zi),Xf=o(93320),Ms=o.n(Xf),Qf=o(78718),Sa=o.n(Qf),Rs=o(23560),_n=o.n(Rs),Hn=o(88996);function Aa(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Ls(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Fo(t,a.key,a)}}function Ds(t,r,i){return r&&Ls(t.prototype,r),i&&Ls(t,i),t}var iu=o(83863),ou=o(79542),Ns=o(24889);function Gi(t){return Gi=ou?Ns:function(i){return i.__proto__||Ns(i)},Gi(t)}function No(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&(t=Gi(t),t!==null););return t}function Bo(t,r,i){return typeof Reflect!="undefined"&&iu?Bo=iu:Bo=function(s,p,y){var E=No(s,p);if(!!E){var w=xa(E,p);return w.get?w.get.call(y):w.value}},Bo(t,r,i||t)}var au=o(189);function Uo(t,r){return Uo=ou||function(a,s){return a.__proto__=s,a},Uo(t,r)}function Ea(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=au(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&Uo(t,r)}var jo=o(13535);function Ca(){if(typeof Reflect=="undefined"||!jo||jo.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(jo(Boolean,[],function(){})),!0}catch(t){return!1}}function zn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function su(t,r){return r&&(nr(r)==="object"||typeof r=="function")?r:zn(t)}function Bs(t){var r=Ca();return function(){var a=Gi(t),s;if(r){var p=Gi(this).constructor;s=jo(a,arguments,p)}else s=a.apply(this,arguments);return su(this,s)}}var Us=o(94473),lu=o.n(Us),uu=o(57514),js=o.n(uu),Zf=function(r){var i=function(p,y){return{name:p,value:y}};if(_n()(r.prototype.set)||_n()(r.prototype.get)||_n()(r.prototype.getAll)||_n()(r.prototype.has))return r;var a=function(s){Ea(y,s);var p=Bs(y);function y(E){var w;return Aa(this,y),w=p.call(this,E),w.entryList=[],w}return Ds(y,[{key:"append",value:function(w,A,k){return this.entryList.push(i(w,A)),Bo(Gi(y.prototype),"append",this).call(this,w,A,k)}},{key:"set",value:function(w,A){var k,G=i(w,A);this.entryList=ln()(k=this.entryList).call(k,function(ne){return ne.name!==w}),this.entryList.push(G)}},{key:"get",value:function(w){var A,k=lu()(A=this.entryList).call(A,function(G){return G.name===w});return k===void 0?null:k}},{key:"getAll",value:function(w){var A,k;return qt()(A=ln()(k=this.entryList).call(k,function(G){return G.name===w})).call(A,function(G){return G.value})}},{key:"has",value:function(w){return this.entryList.some(function(A){return A.name===w})}}]),y}(r);return a};const _f=Zf(js());function qf(t){if(Cs(t))return Ts(t)}function $i(t){if(typeof Wi!="undefined"&&Es(t)!=null||t["@@iterator"]!=null)return Os(t)}function uo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
83
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pn(t){return qf(t)||$i(t)||Ps(t)||uo()}var Vs=o(3649),In=o.n(Vs),fu=o(88996),Ws=fu.Buffer,Ki=function(r){return":/?#[]@!$&'()*+,;=".indexOf(r)>-1},Yi=function(r){return/^[a-z0-9\-._~]+$/i.test(r)};function Rr(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.escape,s=arguments.length>2?arguments[2]:void 0;return typeof t=="number"&&(t=t.toString()),typeof t!="string"||!t.length||!a?t:s?JSON.parse(t):qt()(r=Pn(t)).call(r,function(p){var y,E;if(Yi(p)||Ki(p)&&a==="unsafe")return p;var w=qt()(y=qt()(E=Ws.from(p).toJSON().data||[]).call(E,function(A){var k;return In()(k="0".concat(A.toString(16).toUpperCase())).call(k,-2)})).call(y,function(A){return"%".concat(A)}).join("");return w}).join("")}function qn(t){var r=t.value;return Array.isArray(r)?Ci(t):nr(r)==="object"?Oa(t):ec(t)}function Ci(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,y=function(G){return Rr(G,{escape:p})};if(a==="simple")return qt()(i).call(i,function(k){return y(k)}).join(",");if(a==="label")return".".concat(qt()(i).call(i,function(k){return y(k)}).join("."));if(a==="matrix")return qt()(i).call(i,function(k){return y(k)}).reduce(function(k,G){var ne;if(!k||s){var re,se;return Ot()(re=Ot()(se="".concat(k||"",";")).call(se,r,"=")).call(re,G)}return Ot()(ne="".concat(k,",")).call(ne,G)},"");if(a==="form"){var E=s?"&".concat(r,"="):",";return qt()(i).call(i,function(k){return y(k)}).join(E)}if(a==="spaceDelimited"){var w=s?"".concat(r,"="):"";return qt()(i).call(i,function(k){return y(k)}).join(" ".concat(w))}if(a==="pipeDelimited"){var A=s?"".concat(r,"="):"";return qt()(i).call(i,function(k){return y(k)}).join("|".concat(A))}}function Oa(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,y=function(A){return Rr(A,{escape:p})},E=Qt()(i);if(a==="simple")return E.reduce(function(w,A){var k,G,ne,re=y(i[A]),se=s?"=":",",ye=w?"".concat(w,","):"";return Ot()(k=Ot()(G=Ot()(ne="".concat(ye)).call(ne,A)).call(G,se)).call(k,re)},"");if(a==="label")return E.reduce(function(w,A){var k,G,ne,re=y(i[A]),se=s?"=":".",ye=w?"".concat(w,"."):".";return Ot()(k=Ot()(G=Ot()(ne="".concat(ye)).call(ne,A)).call(G,se)).call(k,re)},"");if(a==="matrix"&&s)return E.reduce(function(w,A){var k,G,ne=y(i[A]),re=w?"".concat(w,";"):";";return Ot()(k=Ot()(G="".concat(re)).call(G,A,"=")).call(k,ne)},"");if(a==="matrix")return E.reduce(function(w,A){var k,G,ne=y(i[A]),re=w?"".concat(w,","):";".concat(r,"=");return Ot()(k=Ot()(G="".concat(re)).call(G,A,",")).call(k,ne)},"");if(a==="form")return E.reduce(function(w,A){var k,G,ne,re,se=y(i[A]),ye=w?Ot()(k="".concat(w)).call(k,s?"&":","):"",ge=s?"=":",";return Ot()(G=Ot()(ne=Ot()(re="".concat(ye)).call(re,A)).call(ne,ge)).call(G,se)},"")}function ec(t){var r=t.key,i=t.value,a=t.style,s=t.escape,p=function(w){return Rr(w,{escape:s})};if(a==="simple")return p(i);if(a==="label")return".".concat(p(i));if(a==="matrix"){var y;return Ot()(y=";".concat(r,"=")).call(y,p(i))}if(a==="form")return p(i);if(a==="deepObject")return p(i,{},!0)}var Ta={serializeRes:cu,mergeInQueryOrForm:pu};function Oi(t){return Pa.apply(this,arguments)}function Pa(){return Pa=Is(ir().mark(function t(r){var i,a,s,p,y,E=arguments;return ir().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(i=E.length>1&&E[1]!==void 0?E[1]:{},nr(r)==="object"&&(i=r,r=i.url),i.headers=i.headers||{},Ta.mergeInQueryOrForm(i),i.headers&&Qt()(i.headers).forEach(function(k){var G=i.headers[k];typeof G=="string"&&(i.headers[k]=G.replace(/\n+/g," "))}),!i.requestInterceptor){A.next=12;break}return A.next=8,i.requestInterceptor(i);case 8:if(A.t0=A.sent,A.t0){A.next=11;break}A.t0=i;case 11:i=A.t0;case 12:return a=i.headers["content-type"]||i.headers["Content-Type"],/multipart\/form-data/i.test(a)&&(delete i.headers["content-type"],delete i.headers["Content-Type"]),A.prev=14,A.next=17,(i.userFetch||fetch)(i.url,i);case 17:return s=A.sent,A.next=20,Ta.serializeRes(s,r,i);case 20:if(s=A.sent,!i.responseInterceptor){A.next=28;break}return A.next=24,i.responseInterceptor(s);case 24:if(A.t1=A.sent,A.t1){A.next=27;break}A.t1=s;case 27:s=A.t1;case 28:A.next=39;break;case 30:if(A.prev=30,A.t2=A.catch(14),s){A.next=34;break}throw A.t2;case 34:throw p=new Error(s.statusText),p.status=s.status,p.statusCode=s.status,p.responseError=A.t2,p;case 39:if(s.ok){A.next=45;break}throw y=new Error(s.statusText),y.status=s.status,y.statusCode=s.status,y.response=s,y;case 45:return A.abrupt("return",s);case 46:case"end":return A.stop()}},t,null,[[14,30]])})),Pa.apply(this,arguments)}var Hs=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(r)};function Ia(t,r){return r&&(r.indexOf("application/json")===0||r.indexOf("+json")>0)?JSON.parse(t):Ms().safeLoad(t)}function cu(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.loadSpec,s=a===void 0?!1:a,p={ok:t.ok,url:t.url||r,status:t.status,statusText:t.statusText,headers:Gs(t.headers)},y=p.headers["content-type"],E=s||Hs(y),w=E?t.text:t.blob||t.buffer;return w.call(t).then(function(A){if(p.text=A,p.data=A,E)try{var k=Ia(A,y);p.body=k,p.obj=k}catch(G){p.parseError=G}return p})}function zs(t){var r=wa()(t).call(t,", ");return r?t.split(", "):t}function Gs(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return _n()(tu()(t))?Kf()(tu()(t).call(t)).reduce(function(r,i){var a=tn(i,2),s=a[0],p=a[1];return r[s]=zs(p),r},{}):{}}function Vo(t,r){return!r&&typeof navigator!="undefined"&&(r=navigator),r&&r.product==="ReactNative"?!!(t&&nr(t)==="object"&&typeof t.uri=="string"):typeof File!="undefined"&&t instanceof File||typeof Blob!="undefined"&&t instanceof Blob||typeof Hn.Buffer!="undefined"&&t instanceof Hn.Buffer?!0:t!==null&&nr(t)==="object"&&typeof t.pipe=="function"}function Fa(t,r){return Array.isArray(t)&&t.some(function(i){return Vo(i,r)})}var fo={form:",",spaceDelimited:"%20",pipeDelimited:"|"},ka={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function $s(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=r.collectionFormat,s=r.allowEmptyValue,p=r.serializationOption,y=r.encoding,E=nr(r)==="object"&&!Array.isArray(r)?r.value:r,w=i?function(G){return G.toString()}:function(G){return encodeURIComponent(G)},A=w(t);if(typeof E=="undefined"&&s)return[[A,""]];if(Vo(E)||Fa(E))return[[A,E]];if(p)return Wo(t,E,i,p);if(y){if([nr(y.style),nr(y.explode),nr(y.allowReserved)].some(function(G){return G!=="undefined"}))return Wo(t,E,i,Sa()(y,["style","explode","allowReserved"]));if(y.contentType){if(y.contentType==="application/json"){var k=typeof E=="string"?E:Ro()(E);return[[A,w(k)]]}return[[A,w(E.toString())]]}return nr(E)!=="object"?[[A,w(E)]]:Array.isArray(E)&&E.every(function(G){return nr(G)!=="object"})?[[A,qt()(E).call(E,w).join(",")]]:[[A,w(Ro()(E))]]}return nr(E)!=="object"?[[A,w(E)]]:Array.isArray(E)?a==="multi"?[[A,qt()(E).call(E,w)]]:[[A,qt()(E).call(E,w).join(ka[a||"csv"])]]:[[A,""]]}function Wo(t,r,i,a){var s,p=a.style||"form",y=typeof a.explode=="undefined"?p==="form":a.explode,E=i?!1:a&&a.allowReserved?"unsafe":"reserved",w=function(re){return Rr(re,{escape:E})},A=i?function(ne){return ne}:function(ne){return Rr(ne,{escape:E})};if(nr(r)!=="object")return[[A(t),w(r)]];if(Array.isArray(r))return y?[[A(t),qt()(r).call(r,w)]]:[[A(t),qt()(r).call(r,w).join(fo[p])]];if(p==="deepObject"){var k;return qt()(k=Qt()(r)).call(k,function(ne){var re;return[A(Ot()(re="".concat(t,"[")).call(re,ne,"]")),w(r[ne])]})}if(y){var G;return qt()(G=Qt()(r)).call(G,function(ne){return[A(ne),w(r[ne])]})}return[[A(t),qt()(s=Qt()(r)).call(s,function(ne){var re;return[Ot()(re="".concat(A(ne),",")).call(re,w(r[ne]))]}).join(",")]]}function tc(t){return Lo()(t).reduce(function(r,i){var a=tn(i,2),s=a[0],p=a[1],y=Hi($s(s,p,!0)),E;try{for(y.s();!(E=y.n()).done;){var w=tn(E.value,2),A=w[0],k=w[1];if(Array.isArray(k)){var G=Hi(k),ne;try{for(G.s();!(ne=G.n()).done;){var re=ne.value;r.append(A,re)}}catch(se){G.e(se)}finally{G.f()}}else r.append(A,k)}}catch(se){y.e(se)}finally{y.f()}return r},new _f)}function du(t){var r=Qt()(t).reduce(function(i,a){var s=Hi($s(a,t[a])),p;try{for(s.s();!(p=s.n()).done;){var y=tn(p.value,2),E=y[0],w=y[1];i[E]=w}}catch(A){s.e(A)}finally{s.f()}return i},{});return Do().stringify(r,{encode:!1,indices:!1})||""}function pu(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.url,i=r===void 0?"":r,a=t.query,s=t.form,p=function(){for(var Ee=arguments.length,me=new Array(Ee),Pe=0;Pe<Ee;Pe++)me[Pe]=arguments[Pe];var Ge=ln()(me).call(me,function(je){return je}).join("&");return Ge?"?".concat(Ge):""};if(s){var y=Qt()(s).some(function(ge){var Ee=s[ge].value;return Vo(Ee)||Fa(Ee)}),E=t.headers["content-type"]||t.headers["Content-Type"];y||/multipart\/form-data/i.test(E)?t.body=tc(t.form):t.body=du(s),delete t.form}if(a){var w=i.split("?"),A=tn(w,2),k=A[0],G=A[1],ne="";if(G){var re=Do().parse(G),se=Qt()(a);se.forEach(function(ge){return delete re[ge]}),ne=Do().stringify(re,{encode:!0})}var ye=p(ne,du(a));t.url=k+ye,delete t.query}return t}function Ks(t,r,i){return i=i||function(a){return a},r=r||function(a){return a},function(a){return typeof a=="string"&&(a={url:a}),Ta.mergeInQueryOrForm(a),a=r(a),i(t(a))}}var Ys=o(51942),rn=o.n(Ys),Ho=o(93476),Ji=o.n(Ho),Ma=o(92762),hu=o.n(Ma),zo=o(13311),vu=o.n(zo),Xi=o(50308),co=o.n(Xi);/*!
|
|
84
84
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
85
85
|
* (c) 2017 Joachim Wester
|
|
86
86
|
* MIT license
|
|
87
|
-
*/var Qi=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),Go=Object.prototype.hasOwnProperty;function fi(t,r){return Go.call(t,r)}function Ra(t){if(Array.isArray(t)){for(var i=new Array(t.length),r=0;r<i.length;r++)i[r]=""+r;return i}if(Object.keys)return Object.keys(t);var i=[];for(var a in t)fi(t,a)&&i.push(a);return i}function yn(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function La(t){for(var r=0,i=t.length,a;r<i;){if(a=t.charCodeAt(r),a>=48&&a<=57){r++;continue}return!1}return!0}function ci(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Ti(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function Pi(t,r){var i;for(var a in t)if(fi(t,a)){if(t[a]===r)return ci(a)+"/";if(typeof t[a]=="object"&&(i=Pi(t[a],r),i!=""))return ci(a)+"/"+i}return""}function Md(t,r){if(t===r)return"/";var i=Pi(t,r);if(i==="")throw new Error("Object not found in root");return"/"+i}function Js(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)if(Js(t[r]))return!0}else if(typeof t=="object"){for(var a=Ra(t),s=a.length,r=0;r<s;r++)if(Js(t[a[r]]))return!0}}return!1}function
|
|
88
|
-
`)}var
|
|
87
|
+
*/var Qi=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),Go=Object.prototype.hasOwnProperty;function fi(t,r){return Go.call(t,r)}function Ra(t){if(Array.isArray(t)){for(var i=new Array(t.length),r=0;r<i.length;r++)i[r]=""+r;return i}if(Object.keys)return Object.keys(t);var i=[];for(var a in t)fi(t,a)&&i.push(a);return i}function yn(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function La(t){for(var r=0,i=t.length,a;r<i;){if(a=t.charCodeAt(r),a>=48&&a<=57){r++;continue}return!1}return!0}function ci(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Ti(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function Pi(t,r){var i;for(var a in t)if(fi(t,a)){if(t[a]===r)return ci(a)+"/";if(typeof t[a]=="object"&&(i=Pi(t[a],r),i!=""))return ci(a)+"/"+i}return""}function Md(t,r){if(t===r)return"/";var i=Pi(t,r);if(i==="")throw new Error("Object not found in root");return"/"+i}function Js(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)if(Js(t[r]))return!0}else if(typeof t=="object"){for(var a=Ra(t),s=a.length,r=0;r<s;r++)if(Js(t[a[r]]))return!0}}return!1}function gu(t,r){var i=[t];for(var a in r){var s=typeof r[a]=="object"?JSON.stringify(r[a],null,2):r[a];typeof s!="undefined"&&i.push(a+": "+s)}return i.join(`
|
|
88
|
+
`)}var yu=function(t){Qi(r,t);function r(i,a,s,p,y){var E=this.constructor,w=t.call(this,gu(i,{name:a,index:s,operation:p,tree:y}))||this;return w.name=a,w.index=s,w.operation=p,w.tree=y,Object.setPrototypeOf(w,E.prototype),w.message=gu(i,{name:a,index:s,operation:p,tree:y}),w}return r}(Error),Ir=yu,rc=yn,Ur={add:function(t,r,i){return t[r]=this.value,{newDocument:i}},remove:function(t,r,i){var a=t[r];return delete t[r],{newDocument:i,removed:a}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:function(t,r,i){var a=Lr(i,this.path);a&&(a=yn(a));var s=cr(i,{op:"remove",path:this.from}).removed;return cr(i,{op:"add",path:this.path,value:s}),{newDocument:i,removed:a}},copy:function(t,r,i){var a=Lr(i,this.from);return cr(i,{op:"add",path:this.path,value:yn(a)}),{newDocument:i}},test:function(t,r,i){return{newDocument:i,test:$o(t[r],this.value)}},_get:function(t,r,i){return this.value=t[r],{newDocument:i}}},jr={add:function(t,r,i){return La(r)?t.splice(r,0,this.value):t[r]=this.value,{newDocument:i,index:r}},remove:function(t,r,i){var a=t.splice(r,1);return{newDocument:i,removed:a[0]}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:Ur.move,copy:Ur.copy,test:Ur.test,_get:Ur._get};function Lr(t,r){if(r=="")return t;var i={op:"_get",path:r};return cr(t,i),i.value}function cr(t,r,i,a,s,p){if(i===void 0&&(i=!1),a===void 0&&(a=!0),s===void 0&&(s=!0),p===void 0&&(p=0),i&&(typeof i=="function"?i(r,0,t,r.path):Zi(r,0)),r.path===""){var y={newDocument:t};if(r.op==="add")return y.newDocument=r.value,y;if(r.op==="replace")return y.newDocument=r.value,y.removed=t,y;if(r.op==="move"||r.op==="copy")return y.newDocument=Lr(t,r.from),r.op==="move"&&(y.removed=t),y;if(r.op==="test"){if(y.test=$o(t,r.value),y.test===!1)throw new Ir("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y.newDocument=t,y}else{if(r.op==="remove")return y.removed=t,y.newDocument=null,y;if(r.op==="_get")return r.value=t,y;if(i)throw new Ir("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,r,t);return y}}else{a||(t=yn(t));var E=r.path||"",w=E.split("/"),A=t,k=1,G=w.length,ne=void 0,re=void 0,se=void 0;for(typeof i=="function"?se=i:se=Zi;;){if(re=w[k],s&&re=="__proto__")throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(i&&ne===void 0&&(A[re]===void 0?ne=w.slice(0,k).join("/"):k==G-1&&(ne=r.path),ne!==void 0&&se(r,0,t,ne)),k++,Array.isArray(A)){if(re==="-")re=A.length;else{if(i&&!La(re))throw new Ir("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",p,r,t);La(re)&&(re=~~re)}if(k>=G){if(i&&r.op==="add"&&re>A.length)throw new Ir("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",p,r,t);var y=jr[r.op].call(r,A,re,t);if(y.test===!1)throw new Ir("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y}}else if(re&&re.indexOf("~")!=-1&&(re=Ti(re)),k>=G){var y=Ur[r.op].call(r,A,re,t);if(y.test===!1)throw new Ir("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y}A=A[re]}}}function Gn(t,r,i,a,s){if(a===void 0&&(a=!0),s===void 0&&(s=!0),i&&!Array.isArray(r))throw new Ir("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");a||(t=yn(t));for(var p=new Array(r.length),y=0,E=r.length;y<E;y++)p[y]=cr(t,r[y],i,!0,s,y),t=p[y].newDocument;return p.newDocument=t,p}function nc(t,r,i){var a=cr(t,r);if(a.test===!1)throw new Ir("Test operation failed","TEST_OPERATION_FAILED",i,r,t);return a.newDocument}function Zi(t,r,i,a){if(typeof t!="object"||t===null||Array.isArray(t))throw new Ir("Operation is not an object","OPERATION_NOT_AN_OBJECT",r,t,i);if(Ur[t.op]){if(typeof t.path!="string")throw new Ir("Operation `path` property is not a string","OPERATION_PATH_INVALID",r,t,i);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new Ir('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",r,t,i);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Ir("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Ir("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Js(t.value))throw new Ir("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",r,t,i);if(i){if(t.op=="add"){var s=t.path.split("/").length,p=a.split("/").length;if(s!==p+1&&s!==p)throw new Ir("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",r,t,i)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==a)throw new Ir("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",r,t,i)}else if(t.op==="move"||t.op==="copy"){var y={op:"_get",path:t.from,value:void 0},E=mu([y],i);if(E&&E.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ir("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",r,t,i)}}}else throw new Ir("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",r,t,i)}function mu(t,r,i){try{if(!Array.isArray(t))throw new Ir("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(r)Gn(yn(r),yn(t),i||!0);else{i=i||Zi;for(var a=0;a<t.length;a++)i(t[a],a,r,void 0)}}catch(s){if(s instanceof Ir)return s;throw s}}function $o(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){var i=Array.isArray(t),a=Array.isArray(r),s,p,y;if(i&&a){if(p=t.length,p!=r.length)return!1;for(s=p;s--!=0;)if(!$o(t[s],r[s]))return!1;return!0}if(i!=a)return!1;var E=Object.keys(t);if(p=E.length,p!==Object.keys(r).length)return!1;for(s=p;s--!=0;)if(!r.hasOwnProperty(E[s]))return!1;for(s=p;s--!=0;)if(y=E[s],!$o(t[y],r[y]))return!1;return!0}return t!==t&&r!==r}/*!
|
|
89
89
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
90
90
|
* (c) 2017 Joachim Wester
|
|
91
91
|
* MIT license
|
|
92
|
-
*/var Xs=new WeakMap,Qs=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),mu=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function Zs(t){return Xs.get(t)}function ic(t,r){return t.observers.get(r)}function _s(t,r){t.observers.delete(r.callback)}function qs(t,r){r.unobserve()}function xu(t,r){var i=[],a,s=Zs(t);if(!s)s=new Qs(t),Xs.set(t,s);else{var p=ic(s,r);a=p&&p.observer}if(a)return a;if(a={},s.value=yn(t),r){a.callback=r,a.next=null;var y=function(){Da(a)},E=function(){clearTimeout(a.next),a.next=setTimeout(y)};typeof window!="undefined"&&(window.addEventListener("mouseup",E),window.addEventListener("keyup",E),window.addEventListener("mousedown",E),window.addEventListener("keydown",E),window.addEventListener("change",E))}return a.patches=i,a.object=t,a.unobserve=function(){Da(a),clearTimeout(a.next),_s(s,a),typeof window!="undefined"&&(window.removeEventListener("mouseup",E),window.removeEventListener("keyup",E),window.removeEventListener("mousedown",E),window.removeEventListener("keydown",E),window.removeEventListener("change",E))},s.observers.set(r,new mu(r,a)),a}function Da(t,r){r===void 0&&(r=!1);var i=Xs.get(t.object);Ko(i.value,t.object,t.patches,"",r),t.patches.length&&Gn(i.value,t.patches);var a=t.patches;return a.length>0&&(t.patches=[],t.callback&&t.callback(a)),a}function Ko(t,r,i,a,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var p=Ra(r),y=Ra(t),E=!1,w=!1,A=y.length-1;A>=0;A--){var k=y[A],G=t[k];if(fi(r,k)&&!(r[k]===void 0&&G!==void 0&&Array.isArray(r)===!1)){var ne=r[k];typeof G=="object"&&G!=null&&typeof ne=="object"&&ne!=null?Ko(G,ne,i,a+"/"+ci(k),s):G!==ne&&(E=!0,s&&i.push({op:"test",path:a+"/"+ci(k),value:yn(G)}),i.push({op:"replace",path:a+"/"+ci(k),value:yn(ne)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:a+"/"+ci(k),value:yn(G)}),i.push({op:"remove",path:a+"/"+ci(k)}),w=!0):(s&&i.push({op:"test",path:a,value:t}),i.push({op:"replace",path:a,value:r}),E=!0)}if(!(!w&&p.length==y.length))for(var A=0;A<p.length;A++){var k=p[A];!fi(t,k)&&r[k]!==void 0&&i.push({op:"add",path:a+"/"+ci(k),value:yn(r[k])})}}}function bu(t,r,i){i===void 0&&(i=!1);var a=[];return Ko(t,r,a,"",i),a}const Na=Object.assign({},c,v,{JsonPatchError:gu,deepClone:yn,escapePathComponent:ci,unescapePathComponent:Ti});var oc=o(31312),Ba=o.n(oc),di=o(50361),wu=o.n(di);const rr={add:er,replace:En,remove:Ii,merge:Fi,mergeDeep:Au,context:el,getIn:ki,applyPatch:Su,parentPathMatch:tl,flatten:Yo,fullyNormalizeArray:Cu,normalizeArray:rl,isPromise:Ou,forEachNew:Eu,forEachNewPrimitive:ac,isJsonPatch:Iu,isContextPatch:lc,isPatch:Va,isMutation:Xo,isAdditiveMutation:Qo,isGenerator:sc,isFunction:Tu,isObject:ei,isError:Pu};function Su(t,r,i){if(i=i||{},r=fr(fr({},r),{},{path:r.path&&mn(r.path)}),r.op==="merge"){var a=Wa(t,r.path);rn()(a,r.value),Gn(t,[En(r.path,a)])}else if(r.op==="mergeDeep"){var s=Wa(t,r.path);for(var p in r.value){var y=r.value[p],E=Array.isArray(y);if(E){var w=s[p]||[];s[p]=Ot()(w).call(w,y)}else if(ei(y)&&!E){var A=fr({},s[p]);for(var k in y)if(Object.prototype.hasOwnProperty.call(A,k)){A=Ba()(wu()(A),y);break}else rn()(A,Ss({},k,y[k]));s[p]=A}else s[p]=y}}else if(r.op==="add"&&r.path===""&&ei(r.value)){var G=Qt()(r.value).reduce(function(ge,Ee){return ge.push({op:"add",path:"/".concat(mn(Ee)),value:r.value[Ee]}),ge},[]);Gn(t,G)}else if(r.op==="replace"&&r.path===""){var ne=r,re=ne.value;i.allowMetaPatches&&r.meta&&Qo(r)&&(Array.isArray(r.value)||ei(r.value))&&(re=fr(fr({},re),r.meta)),t=re}else if(Gn(t,[r]),i.allowMetaPatches&&r.meta&&Qo(r)&&(Array.isArray(r.value)||ei(r.value))){var se=Wa(t,r.path),ye=fr(fr({},se),r.meta);Gn(t,[En(r.path,ye)])}return t}function mn(t){return Array.isArray(t)?t.length<1?"":"/".concat(qt()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function er(t,r){return{op:"add",path:t,value:r}}function En(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function Ii(t){return{op:"remove",path:t}}function Fi(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function Au(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function el(t,r){return{type:"context",path:t,value:r}}function Eu(t,r){try{return Ua(t,ja,r)}catch(i){return i}}function ac(t,r){try{return Ua(t,_i,r)}catch(i){return i}}function Ua(t,r,i){var a,s=qt()(a=ln()(t).call(t,Qo)).call(a,function(E){return r(E.value,i,E.path)})||[],p=Yo(s),y=Jo(p);return y}function _i(t,r,i){if(i=i||[],Array.isArray(t))return qt()(t).call(t,function(s,p){return _i(s,r,Ot()(i).call(i,p))});if(ei(t)){var a;return qt()(a=Qt()(t)).call(a,function(s){return _i(t[s],r,Ot()(i).call(i,s))})}return r(t,i[i.length-1],i)}function ja(t,r,i){i=i||[];var a=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(a=Ot()(a).call(a,s))}if(Array.isArray(t)){var p=qt()(t).call(t,function(w,A){return ja(w,r,Ot()(i).call(i,A))});p&&(a=Ot()(a).call(a,p))}else if(ei(t)){var y,E=qt()(y=Qt()(t)).call(y,function(w){return ja(t[w],r,Ot()(i).call(i,w))});E&&(a=Ot()(a).call(a,E))}return a=Yo(a),a}function tl(t,r){if(!Array.isArray(r))return!1;for(var i=0,a=r.length;i<a;i+=1)if(r[i]!==t[i])return!1;return!0}function ki(t,r){return r.reduce(function(i,a){return typeof a!="undefined"&&i?i[a]:i},t)}function Cu(t){return Jo(Yo(rl(t)))}function rl(t){return Array.isArray(t)?t:[t]}function Yo(t){var r;return Ot()(r=[]).apply(r,Pn(qt()(t).call(t,function(i){return Array.isArray(i)?Yo(i):i})))}function Jo(t){return ln()(t).call(t,function(r){return typeof r!="undefined"})}function ei(t){return t&&nr(t)==="object"}function Ou(t){return ei(t)&&Tu(t.then)}function Tu(t){return t&&typeof t=="function"}function Pu(t){return t instanceof Error}function Iu(t){if(Va(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function sc(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function Xo(t){return Iu(t)||Va(t)&&t.type==="mutation"}function Qo(t){return Xo(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function lc(t){return Va(t)&&t.type==="context"}function Va(t){return t&&nr(t)==="object"}function Wa(t,r){try{return Lr(t,r)}catch(i){return console.error(i),{}}}var po=o(52424),nl=o.n(po),Ha=o(54098),Fu=o(9779),za=o.n(Fu);function il(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var a=arguments.length,s=new Array(a),p=0;p<a;p++)s[p]=arguments[p];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var uc=o(13692),ku=o.n(uc),Xr=o(47037),Ga=o.n(Xr),Mu=["properties"],Ru=["properties"],Lu=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],ho=["schema/example","items/example"];function Zo(t){var r=t[t.length-1],i=t[t.length-2],a=t.join("/");return Mu.indexOf(r)>-1&&Ru.indexOf(i)===-1||Lu.indexOf(a)>-1||ho.some(function(s){return a.indexOf(s)>-1})}function Du(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.specmap,s=i.getBaseUrlForNodePath,p=s===void 0?function(A){var k;return a.getContext(Ot()(k=[]).call(k,Pn(r),Pn(A))).baseDoc}:s,y=i.targetKeys,E=y===void 0?["$ref","$$ref"]:y,w=[];return ku()(t).forEach(function(){if(wa()(E).call(E,this.key)&&Ga()(this.node)){var k=this.path,G=Ot()(r).call(r,this.path),ne=$a(this.node,p(k));w.push(a.replace(G,ne))}}),w}function $a(t,r){var i,a=t.split("#"),s=tn(a,2),p=s[0],y=s[1],E=Ei.resolve(p||"",r||"");return y?Ot()(i="".concat(E,"#")).call(i,y):E}var ol="application/json, application/yaml",vo=new RegExp("^([a-z]+://|//)","i"),qi=il("JSONRefError",function(r,i,a){this.originalError=a,rn()(this,i||{})}),Fn={},al=new(nl()),_o=[function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="examples"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="examples"&&t[6]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="examples"&&t[7]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[4]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"}],fc=function(r){return _o.some(function(i){return i(r)})},go={key:"$ref",plugin:function(r,i,a,s){var p=s.getInstance(),y=In()(a).call(a,0,-1);if(!(Zo(y)||fc(y))){var E=s.getContext(a),w=E.baseDoc;if(typeof r!="string")return new qi("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:w,fullPath:a});var A=yo(r),k=A[0],G=A[1]||"",ne;try{ne=w||k?ll(k,w):null}catch(me){return eo(me,{pointer:G,$ref:r,basePath:ne,fullPath:a})}var re,se;if(pc(G,ne,y,s)&&!p.useCircularStructures){var ye=$a(r,ne);return r===ye?null:rr.replace(a,ye)}if(ne==null?(se=ti(G),re=s.get(se),typeof re=="undefined"&&(re=new qi("Could not resolve reference: ".concat(r),{pointer:G,$ref:r,baseDoc:w,fullPath:a}))):(re=mo(ne,G),re.__value!=null?re=re.__value:re=re.catch(function(me){throw eo(me,{pointer:G,$ref:r,baseDoc:w,fullPath:a})})),re instanceof Error)return[rr.remove(a),re];var ge=$a(r,ne),Ee=rr.replace(y,re,{$$ref:ge});if(ne&&ne!==w)return[Ee,rr.context(y,{baseDoc:ne})];try{if(!hc(s.state,Ee)||p.useCircularStructures)return Ee}catch(me){return null}}}},sl=rn()(go,{docCache:Fn,absoluteify:ll,clearCache:qo,JSONRefError:qi,wrapError:eo,getDoc:ul,split:yo,extractFromDoc:mo,fetchJSON:cc,extract:Ka,jsonPointerToArray:ti,unescapeJsonPointerToken:to});const Nu=sl;function ll(t,r){if(!vo.test(t)){if(!r){var i;throw new qi(Ot()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Ei.resolve(r,t)}return t}function eo(t,r){var i;if(t&&t.response&&t.response.body){var a;i=Ot()(a="".concat(t.response.body.code," ")).call(a,t.response.body.message)}else i=t.message;return new qi("Could not resolve reference: ".concat(i),r,t)}function yo(t){return(t+"").split("#")}function mo(t,r){var i=Fn[t];if(i&&!rr.isPromise(i))try{var a=Ka(r,i);return rn()(Ji().resolve(a),{__value:a})}catch(s){return Ji().reject(s)}return ul(t).then(function(s){return Ka(r,s)})}function qo(t){typeof t!="undefined"?delete Fn[t]:Qt()(Fn).forEach(function(r){delete Fn[r]})}function ul(t){var r=Fn[t];return r?rr.isPromise(r)?r:Ji().resolve(r):(Fn[t]=sl.fetchJSON(t).then(function(i){return Fn[t]=i,i}),Fn[t])}function cc(t){return(0,Ha.fetch)(t,{headers:{Accept:ol},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return Ms().safeLoad(r)})}function Ka(t,r){var i=ti(t);if(i.length<1)return r;var a=rr.getIn(r,i);if(typeof a=="undefined")throw new qi("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return a}function ti(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(nr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:qt()(r=t.split("/")).call(r,to)}function to(t){return typeof t!="string"?t:za().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function xo(t){return za().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function dc(t){return t.length===0?"":"/".concat(qt()(t).call(t,xo).join("/"))}var Bu=function(r){return!r||r==="/"||r==="#"};function fl(t,r){if(Bu(r))return!0;var i=t.charAt(r.length),a=In()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&a!=="#"}function pc(t,r,i,a){var s,p,y=al.get(a);y||(y={},al.set(a,y));var E=dc(i),w=Ot()(s="".concat(r||"<specmap-base>","#")).call(s,t),A=E.replace(/allOf\/\d+\/?/g,""),k=a.contextTree.get([]).baseDoc;if(r==k&&fl(A,t))return!0;var G="",ne=i.some(function(re){var se;return G=Ot()(se="".concat(G,"/")).call(se,xo(re)),y[G]&&y[G].some(function(ye){return fl(ye,w)||fl(w,ye)})});if(ne)return!0;y[A]=Ot()(p=y[A]||[]).call(p,w)}function hc(t,r){var i=[t];return r.path.reduce(function(s,p){return i.push(s[p]),s[p]},t),a(r.value);function a(s){return rr.isObject(s)&&(i.indexOf(s)>=0||Qt()(s).some(function(p){return a(s[p])}))}}var un=o(41609),Uu=o.n(un);const vc={key:"allOf",plugin:function(r,i,a,s,p){if(!(p.meta&&p.meta.$$ref)){var y=In()(a).call(a,0,-1);if(!Zo(y)){if(!Array.isArray(r)){var E=new TypeError("allOf must be an array");return E.fullPath=a,E}var w=!1,A=p.value;if(y.forEach(function(ne){!A||(A=A[ne])}),A=fr({},A),!Uu()(A)){delete A.allOf;var k=[];if(k.push(s.replace(y,{})),r.forEach(function(ne,re){if(!s.isObject(ne)){if(w)return null;w=!0;var se=new TypeError("Elements in allOf must be objects");return se.fullPath=a,k.push(se)}k.push(s.mergeDeep(y,ne));var ye=In()(a).call(a,0,-1),ge=Du(ne,ye,{getBaseUrlForNodePath:function(me){var Pe;return s.getContext(Ot()(Pe=[]).call(Pe,Pn(a),[re],Pn(me))).baseDoc},specmap:s});k.push.apply(k,Pn(ge))}),k.push(s.mergeDeep(y,A)),!A.$$ref){var G;k.push(s.remove(Ot()(G=[]).call(G,y,"$$ref")))}return k}}}}},gc={key:"parameters",plugin:function(r,i,a,s){if(Array.isArray(r)&&r.length){var p=rn()([],r),y=In()(a).call(a,0,-1),E=fr({},rr.getIn(s.spec,y));return r.forEach(function(w,A){try{p[A].default=s.parameterMacro(E,w)}catch(G){var k=new Error(G);return k.fullPath=a,k}}),rr.replace(a,p)}return rr.replace(a,r)}},yc={key:"properties",plugin:function(r,i,a,s){var p=fr({},r);for(var y in r)try{p[y].default=s.modelPropertyMacro(p[y])}catch(A){var E=new Error(A);return E.fullPath=a,E}var w=rr.replace(a,p);return w}};var ju=function(){function t(r){Aa(this,t),this.root=Ya(r||{})}return Ds(t,[{key:"set",value:function(i,a){var s=this.getParent(i,!0);if(!s){ea(this.root,a,null);return}var p=i[i.length-1],y=s.children;if(y[p]){ea(y[p],a,s);return}y[p]=Ya(a,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var a=this.root,s,p,y=0;y<i.length&&(p=i[y],s=a.children,!!s[p]);y+=1)a=s[p];return a&&a.protoValue}},{key:"getParent",value:function(i,a){return!i||i.length<1?null:i.length<2?this.root:In()(i).call(i,0,-1).reduce(function(s,p){if(!s)return s;var y=s.children;return!y[p]&&a&&(y[p]=Ya(null,s)),y[p]},this.root)}}]),t}();function Ya(t,r){return ea({children:{}},t,r)}function ea(t,r,i){return t.value=r||{},t.protoValue=i?fr(fr({},i.protoValue),t.value):t.value,Qt()(t.children).forEach(function(a){var s=t.children[a];t.children[a]=ea(s,s.value,t)}),t}var Vu=100,mc=function(){function t(r){var i=this,a,s;Aa(this,t),rn()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new ju,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:rn()(Object.create(this),rr,{getInstance:function(){return i}}),allowMetaPatches:!1},r),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=ln()(a=qt()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(a,rr.isFunction),this.patches.push(rr.add([],this.spec)),this.patches.push(rr.context([],this.context)),this.updatePatches(this.patches)}return Ds(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var a,s=arguments.length,p=new Array(s>1?s-1:0),y=1;y<s;y++)p[y-1]=arguments[y];(a=console).log.apply(a,p)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var a,s,p=arguments.length,y=new Array(p>1?p-1:0),E=1;E<p;E++)y[E-1]=arguments[E];(a=console).log.apply(a,Ot()(s=["[".concat(i,"] ")]).call(s,y))}}},{key:"wrapPlugin",value:function(i,a){var s=this.pathDiscriminator,p=null,y;return i[this.pluginProp]?(p=i,y=i[this.pluginProp]):rr.isFunction(i)?y=i:rr.isObject(i)&&(y=E(i)),rn()(y.bind(p),{pluginName:i.name||a,isGenerator:rr.isGenerator(y)});function E(w){var A=function(G,ne){return Array.isArray(G)?G.every(function(re,se){return re===ne[se]}):!0};return ir().mark(function k(G,ne){var re,se,ye,ge,Ee,me;return ir().wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:me=function(He,Ne,Ve){var We,Je,ze,et,At,Nt,Ht,or,Mr,Cr,Jr,wr,Dr;return ir().wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(rr.isObject(He)){Yt.next=6;break}if(w.key!==Ne[Ne.length-1]){Yt.next=4;break}return Yt.next=4,w.plugin(He,w.key,Ne,ne);case 4:Yt.next=30;break;case 6:We=Ne.length-1,Je=Ne[We],ze=Ne.indexOf("properties"),et=Je==="properties"&&We===ze,At=ne.allowMetaPatches&&se[He.$$ref],Nt=0,Ht=Qt()(He);case 12:if(!(Nt<Ht.length)){Yt.next=30;break}if(or=Ht[Nt],Mr=He[or],Cr=Ot()(Ne).call(Ne,or),Jr=rr.isObject(Mr),wr=He.$$ref,At){Yt.next=22;break}if(!Jr){Yt.next=22;break}return ne.allowMetaPatches&&wr&&(se[wr]=!0),Yt.delegateYield(me(Mr,Cr,Ve),"t0",22);case 22:if(!(!et&&or===w.key)){Yt.next=27;break}if(Dr=A(s,Ne),!(!s||Dr)){Yt.next=27;break}return Yt.next=27,w.plugin(Mr,or,Cr,ne,Ve);case 27:Nt++,Yt.next=12;break;case 30:case"end":return Yt.stop()}},re)},re=ir().mark(me),se={},ye=Hi(ln()(G).call(G,rr.isAdditiveMutation)),Ge.prev=4,ye.s();case 6:if((ge=ye.n()).done){Ge.next=11;break}return Ee=ge.value,Ge.delegateYield(me(Ee.value,Ee.path,Ee),"t0",9);case 9:Ge.next=6;break;case 11:Ge.next=16;break;case 13:Ge.prev=13,Ge.t1=Ge.catch(4),ye.e(Ge.t1);case 16:return Ge.prev=16,ye.f(),Ge.finish(16);case 19:case"end":return Ge.stop()}},k,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return hu()(this.wrappedPlugins,function(a){var s=i.getMutationsForPlugin(a);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return Ji().race(qt()(i=this.promisedPatches).call(i,function(a){return a.value}))}}},{key:"getPluginHistory",value:function(i){var a=this.constructor.getPluginName(i);return this.pluginHistory[a]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var a=this.getPluginHistory(i),s=a&&a[a.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var a=this.getPluginHistoryTip(i).mutationIndex;return typeof a!="number"?-1:a}},{key:"updatePluginHistory",value:function(i,a){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(a)}},{key:"updatePatches",value:function(i){var a=this;rr.normalizeArray(i).forEach(function(s){if(s instanceof Error){a.errors.push(s);return}try{if(!rr.isObject(s)){a.debug("updatePatches","Got a non-object patch",s);return}if(a.showDebug&&a.allPatches.push(s),rr.isPromise(s.value)){a.promisedPatches.push(s),a.promisedPatchThen(s);return}if(rr.isContextPatch(s)){a.setContext(s.path,s.value);return}if(rr.isMutation(s)){a.updateMutations(s);return}}catch(p){console.error(p),a.errors.push(p)}})}},{key:"updateMutations",value:function(i){nr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=fr({},i.value));var a=rr.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});a&&(this.mutations.push(i),this.state=a)}},{key:"removePromisedPatch",value:function(i){var a,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}pu()(a=this.promisedPatches).call(a,s,1)}},{key:"promisedPatchThen",value:function(i){var a=this;return i.value=i.value.then(function(s){var p=fr(fr({},i),{},{value:s});a.removePromisedPatch(i),a.updatePatches(p)}).catch(function(s){a.removePromisedPatch(i),a.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,a){var s;return i=i||0,typeof a!="number"&&(a=this.mutations.length),In()(s=this.mutations).call(s,i,a)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var a=this.getPluginMutationIndex(i);return this.getMutations(a+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return rr.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,a){return this.contextTree.set(i,a)}},{key:"_hasRun",value:function(i){var a=this.getPluginRunCount(this.getCurrentPlugin());return a>(i||0)}},{key:"dispatch",value:function(){var i=this,a=this,s=this.nextPlugin();if(!s){var p=this.nextPromisedPatch();if(p)return p.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var y={spec:this.state,errors:this.errors};return this.showDebug&&(y.patches=this.allPatches),Ji().resolve(y)}if(a.pluginCount=a.pluginCount||{},a.pluginCount[s]=(a.pluginCount[s]||0)+1,a.pluginCount[s]>Vu){var E;return Ji().resolve({spec:a.state,errors:Ot()(E=a.errors).call(E,new Error("We've reached a hard limit of ".concat(Vu," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var w,A=qt()(w=this.promisedPatches).call(w,function(ne){return ne.value});return Ji().all(qt()(A).call(A,function(ne){return ne.then(co(),co())})).then(function(){return i.dispatch()})}return k();function k(){a.currentPlugin=s;var ne=a.getCurrentMutations(),re=a.mutations.length-1;try{if(s.isGenerator){var se=Hi(s(ne,a.getLib())),ye;try{for(se.s();!(ye=se.n()).done;){var ge=ye.value;G(ge)}}catch(me){se.e(me)}finally{se.f()}}else{var Ee=s(ne,a.getLib());G(Ee)}}catch(me){console.error(me),G([rn()(Object.create(me),{plugin:s})])}finally{a.updatePluginHistory(s,{mutationIndex:re})}return a.dispatch()}function G(ne){ne&&(ne=rr.fullyNormalizeArray(ne),a.updatePatches(ne,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,a){return ln()(i).call(i,a)}}]),t}();function xc(t){return new mc(t).dispatch()}var xn={refs:Nu,allOf:vc,parameters:gc,properties:yc},ta=o(13218),ra=o.n(ta),bo=function(r){return String.prototype.toLowerCase.call(r)},ri=function(r){return r.replace(/[^\w]/gi,"_")};function Wu(t){var r=t.openapi;return r?Vi()(r,"3"):!1}function Rd(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function pi(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=a.v2OperationIdCompatibilityMode;if(!t||nr(t)!=="object")return null;var p=(t.operationId||"").replace(/\s/g,"");return p.length?ri(t.operationId):Hu(r,i,{v2OperationIdCompatibilityMode:s})}function Hu(t,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=a.v2OperationIdCompatibilityMode;if(s){var p,y,E=Ot()(p="".concat(r.toLowerCase(),"_")).call(p,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return E=E||Ot()(y="".concat(t.substring(1),"_")).call(y,r),E.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return Ot()(i="".concat(bo(r))).call(i,ri(t))}function cl(t,r){var i;return Ot()(i="".concat(bo(r),"-")).call(i,t)}function zu(t,r){return!t||!t.paths?null:Ja(t,function(i){var a=i.pathName,s=i.method,p=i.operation;if(!p||nr(p)!=="object")return!1;var y=p.operationId,E=pi(p,a,s),w=cl(a,s);return[E,w,y].some(function(A){return A&&A===r})})}function Ja(t,r){return ro(t,r,!0)||null}function ro(t,r,i){if(!t||nr(t)!=="object"||!t.paths||nr(t.paths)!=="object")return null;var a=t.paths;for(var s in a)for(var p in a[s])if(p.toUpperCase()!=="PARAMETERS"){var y=a[s][p];if(!(!y||nr(y)!=="object")){var E={spec:t,pathName:s,method:p.toUpperCase(),operation:y},w=r(E);if(i&&w)return E}}}function Xa(t){var r=t.spec,i=r.paths,a={};if(!i||r.$$normalized)return t;for(var s in i){var p=i[s];if(!!ra()(p)){var y=p.parameters,E=function(G){var ne=p[G];if(!ra()(ne))return"continue";var re=pi(ne,s,G);if(re){a[re]?a[re].push(ne):a[re]=[ne];var se=a[re];if(se.length>1)se.forEach(function(Je,ze){var et;Je.__originalOperationId=Je.__originalOperationId||Je.operationId,Je.operationId=Ot()(et="".concat(re)).call(et,ze+1)});else if(typeof ne.operationId!="undefined"){var ye=se[0];ye.__originalOperationId=ye.__originalOperationId||ne.operationId,ye.operationId=re}}if(G!=="parameters"){var ge=[],Ee={};for(var me in r)(me==="produces"||me==="consumes"||me==="security")&&(Ee[me]=r[me],ge.push(Ee));if(y&&(Ee.parameters=y,ge.push(Ee)),ge.length){var Pe=Hi(ge),Ge;try{for(Pe.s();!(Ge=Pe.n()).done;){var je=Ge.value;for(var He in je)if(!ne[He])ne[He]=je[He];else if(He==="parameters"){var Ne=Hi(je[He]),Ve;try{var We=function(){var ze=Ve.value,et=ne[He].some(function(At){return At.name&&At.name===ze.name||At.$ref&&At.$ref===ze.$ref||At.$$ref&&At.$$ref===ze.$$ref||At===ze});et||ne[He].push(ze)};for(Ne.s();!(Ve=Ne.n()).done;)We()}catch(Je){Ne.e(Je)}finally{Ne.f()}}}}catch(Je){Pe.e(Je)}finally{Pe.f()}}}};for(var w in p)var A=E(w)}}return r.$$normalized=!0,t}function Qa(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,a=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(p){return t({url:p,loadSpec:!0,requestInterceptor:i,responseInterceptor:a,headers:{Accept:ol},credentials:s}).then(function(y){return y.body})}}function dl(){xn.refs.clearCache()}function Gu(t){var r=t.fetch,i=t.spec,a=t.url,s=t.mode,p=t.allowMetaPatches,y=p===void 0?!0:p,E=t.pathDiscriminator,w=t.modelPropertyMacro,A=t.parameterMacro,k=t.requestInterceptor,G=t.responseInterceptor,ne=t.skipNormalization,re=t.useCircularStructures,se=t.http,ye=t.baseDoc;if(ye=ye||a,se=r||se||Oi,!i)return Qa(se,{requestInterceptor:k,responseInterceptor:G})(ye).then(ge);return ge(i);function ge(Ee){ye&&(xn.refs.docCache[ye]=Ee),xn.refs.fetchJSON=Qa(se,{requestInterceptor:k,responseInterceptor:G});var me=[xn.refs];return typeof A=="function"&&me.push(xn.parameters),typeof w=="function"&&me.push(xn.properties),s!=="strict"&&me.push(xn.allOf),xc({spec:Ee,context:{baseDoc:ye},plugins:me,allowMetaPatches:y,pathDiscriminator:E,parameterMacro:A,modelPropertyMacro:w,useCircularStructures:re}).then(ne?function(){var Pe=Is(ir().mark(function Ge(je){return ir().wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return Ne.abrupt("return",je);case 1:case"end":return Ne.stop()}},Ge)}));return function(Ge){return Pe.apply(this,arguments)}}():Xa)}}var na=o(27361),wo=o.n(na);function bc(t,r){return Za.apply(this,arguments)}function Za(){return Za=Is(ir().mark(function t(r,i){var a,s,p,y,E,w,A,k,G,ne,re,se,ye=arguments;return ir().wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return a=ye.length>2&&ye[2]!==void 0?ye[2]:{},s=a.returnEntireTree,p=a.baseDoc,y=a.requestInterceptor,E=a.responseInterceptor,w=a.parameterMacro,A=a.modelPropertyMacro,k=a.useCircularStructures,G={pathDiscriminator:i,baseDoc:p,requestInterceptor:y,responseInterceptor:E,parameterMacro:w,modelPropertyMacro:A,useCircularStructures:k},ne=Xa({spec:r}),re=ne.spec,Ee.next=6,Gu(fr(fr({},G),{},{spec:re,allowMetaPatches:!0,skipNormalization:!0}));case 6:return se=Ee.sent,!s&&Array.isArray(i)&&i.length&&(se.spec=wo()(se.spec,i)||null),Ee.abrupt("return",se);case 9:case"end":return Ee.stop()}},t)})),Za.apply(this,arguments)}var _a=function(){return null},wc=function(r){return Array.isArray(r)?r:[r]},qa={mapTagOperations:Ac,makeExecute:ia};function ia(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,a=r.method,s=r.operationId;return function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(fr(fr({spec:t.spec},Sa()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:a,parameters:p,operationId:s},y))}}}function Sc(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=qa.makeExecute(t),i=qa.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),a={};for(var s in i){a[s]={operations:{}};for(var p in i[s])a[s].operations[p]={execute:i[s][p]}}return{apis:a}}function $u(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=qa.makeExecute(t);return{apis:qa.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Ac(t){var r=t.spec,i=t.cb,a=i===void 0?_a:i,s=t.defaultTag,p=s===void 0?"default":s,y=t.v2OperationIdCompatibilityMode,E={},w={};return ro(r,function(A){var k=A.pathName,G=A.method,ne=A.operation,re=ne.tags?wc(ne.tags):[p];re.forEach(function(se){if(typeof se=="string"){w[se]=w[se]||{};var ye=w[se],ge=pi(ne,k,G,{v2OperationIdCompatibilityMode:y}),Ee=a({spec:r,pathName:k,method:G,operation:ne,operationId:ge});if(E[ge]){var me;E[ge]+=1,ye[Ot()(me="".concat(ge)).call(me,E[ge])]=Ee}else if(typeof ye[ge]!="undefined"){var Pe,Ge,je=E[ge]||1;E[ge]=je+1,ye[Ot()(Pe="".concat(ge)).call(Pe,E[ge])]=Ee;var He=ye[ge];delete ye[ge],ye[Ot()(Ge="".concat(ge)).call(Ge,je)]=He}else ye[ge]=Ee}})}),w}var es=o(95683);function Ku(t,r){if(t==null)return{};var i={},a=ws(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(es(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function Ec(t,r){if(t==null)return{};var i=Ku(t,r),a,s;if(Ui){var p=Ui(t);for(s=0;s<p.length;s++)a=p[s],!(es(r).call(r,a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}var Yu=o(68630),pl=o.n(Yu),Cc=o(1469),hl=o.n(Cc),oa=o(76489);const aa={body:Oc,header:Tc,query:Ic,path:Pc,formData:Ju};function Oc(t){var r=t.req,i=t.value;r.body=i}function Ju(t){var r=t.req,i=t.value,a=t.parameter;(i||a.allowEmptyValue)&&(r.form=r.form||{},r.form[a.name]={value:i,allowEmptyValue:a.allowEmptyValue,collectionFormat:a.collectionFormat})}function Tc(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{},typeof a!="undefined"&&(r.headers[i.name]=a)}function Pc(t){var r=t.req,i=t.value,a=t.parameter;r.url=r.url.split("{".concat(a.name,"}")).join(encodeURIComponent(i))}function Ic(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},i===!1&&a.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(a.type)>-1&&(i="0"),i)r.query[a.name]={collectionFormat:a.collectionFormat,value:i};else if(a.allowEmptyValue&&i!==void 0){var s=a.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function ts(t,r){return wa()(r).call(r,"application/json")?typeof t=="string"?t:Ro()(t):t.toString()}function Xu(t){var r=t.req,i=t.value,a=t.parameter,s=a.name,p=a.style,y=a.explode,E=a.content;if(E){var w=Qt()(E)[0];r.url=r.url.split("{".concat(s,"}")).join(Rr(ts(i,w),{escape:!0}));return}var A=qn({key:a.name,value:i,style:p||"simple",explode:y||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(A)}function Fc(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},a.content){var s=Qt()(a.content)[0];r.query[a.name]=ts(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[a.name]={value:i,serializationOption:Sa()(a,["style","explode","allowReserved"])};else if(a.allowEmptyValue&&i!==void 0){var p=a.name;r.query[p]=r.query[p]||{},r.query[p].allowEmptyValue=!0}}var kc=["accept","authorization","content-type"];function Qu(t){var r=t.req,i=t.parameter,a=t.value;if(r.headers=r.headers||{},!(kc.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=Qt()(i.content)[0];r.headers[i.name]=ts(a,s);return}typeof a!="undefined"&&(r.headers[i.name]=qn({key:i.name,value:a,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function vl(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{};var s=nr(a);if(i.content){var p,y=Qt()(i.content)[0];r.headers.Cookie=Ot()(p="".concat(i.name,"=")).call(p,ts(a,y));return}if(s!=="undefined"){var E=s==="object"&&!Array.isArray(a)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=E+qn({key:i.name,value:a,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var Zu=o(50706),_u=o.n(Zu);function qu(t,r){var i=t.operation,a=t.requestBody,s=t.securities,p=t.spec,y=t.attachContentTypeForEmptyPayload,E=t.requestContentType;r=So({request:r,securities:s,operation:i,spec:p});var w=i.requestBody||{},A=Qt()(w.content||{}),k=E&&A.indexOf(E)>-1;if(a||y){if(E&&k)r.headers["Content-Type"]=E;else if(!E){var G=A[0];G&&(r.headers["Content-Type"]=G,E=G)}}else E&&k&&(r.headers["Content-Type"]=E);if(!t.responseContentType&&i.responses){var ne,re=ln()(ne=Lo()(i.responses)).call(ne,function(ye){var ge=tn(ye,2),Ee=ge[0],me=ge[1],Pe=parseInt(Ee,10);return Pe>=200&&Pe<300&&pl()(me.content)}).reduce(function(ye,ge){var Ee=tn(ge,2),me=Ee[1];return Ot()(ye).call(ye,Qt()(me.content))},[]);re.length>0&&(r.headers.accept=re.join(", "))}if(a)if(E){if(A.indexOf(E)>-1)if(E==="application/x-www-form-urlencoded"||E==="multipart/form-data")if(nr(a)==="object"){var se=(w.content[E]||{}).encoding||{};r.form={},Qt()(a).forEach(function(ye){r.form[ye]={value:a[ye],encoding:se[ye]||{}}})}else r.form=a;else r.body=a}else r.body=a;return r}function So(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,E=ji()({},r),w=a.authorized,A=w===void 0?{}:w,k=p.security||y.security||[],G=A&&!!Qt()(A).length,ne=wo()(y,["components","securitySchemes"])||{};return E.headers=E.headers||{},E.query=E.query||{},!Qt()(a).length||!G||!k||Array.isArray(p.security)&&!p.security.length?r:(k.forEach(function(re){Qt()(re).forEach(function(se){var ye=A[se],ge=ne[se];if(!!ye){var Ee=ye.value||ye,me=ge.type;if(ye){if(me==="apiKey")ge.in==="query"&&(E.query[ge.name]=Ee),ge.in==="header"&&(E.headers[ge.name]=Ee),ge.in==="cookie"&&(E.cookies[ge.name]=Ee);else if(me==="http"){if(/^basic$/i.test(ge.scheme)){var Pe,Ge=Ee.username||"",je=Ee.password||"",He=_u()(Ot()(Pe="".concat(Ge,":")).call(Pe,je));E.headers.Authorization="Basic ".concat(He)}/^bearer$/i.test(ge.scheme)&&(E.headers.Authorization="Bearer ".concat(Ee))}else if(me==="oauth2"||me==="openIdConnect"){var Ne,Ve=ye.token||{},We=ge["x-tokenName"]||"access_token",Je=Ve[We],ze=Ve.token_type;(!ze||ze.toLowerCase()==="bearer")&&(ze="Bearer"),E.headers.Authorization=Ot()(Ne="".concat(ze," ")).call(Ne,Je)}}}})}),E)}function ef(t,r){var i=t.spec,a=t.operation,s=t.securities,p=t.requestContentType,y=t.responseContentType,E=t.attachContentTypeForEmptyPayload;if(r=rs({request:r,securities:s,operation:a,spec:i}),r.body||r.form||E){var w,A;if(p)r.headers["Content-Type"]=p;else if(Array.isArray(a.consumes)){var k=tn(a.consumes,1);r.headers["Content-Type"]=k[0]}else if(Array.isArray(i.consumes)){var G=tn(i.consumes,1);r.headers["Content-Type"]=G[0]}else a.parameters&&ln()(w=a.parameters).call(w,function(ge){return ge.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":a.parameters&&ln()(A=a.parameters).call(A,function(ge){return ge.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(p){var ne,re,se=a.parameters&&ln()(ne=a.parameters).call(ne,function(ge){return ge.in==="body"}).length>0,ye=a.parameters&&ln()(re=a.parameters).call(re,function(ge){return ge.in==="formData"}).length>0;(se||ye)&&(r.headers["Content-Type"]=p)}return!y&&Array.isArray(a.produces)&&a.produces.length>0&&(r.headers.accept=a.produces.join(", ")),r}function rs(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,E=ji()({},r),w=a.authorized,A=w===void 0?{}:w,k=a.specSecurity,G=k===void 0?[]:k,ne=p.security||G,re=A&&!!Qt()(A).length,se=y.securityDefinitions;return E.headers=E.headers||{},E.query=E.query||{},!Qt()(a).length||!re||!ne||Array.isArray(p.security)&&!p.security.length?r:(ne.forEach(function(ye){Qt()(ye).forEach(function(ge){var Ee=A[ge];if(!!Ee){var me=Ee.token,Pe=Ee.value||Ee,Ge=se[ge],je=Ge.type,He=Ge["x-tokenName"]||"access_token",Ne=me&&me[He],Ve=me&&me.token_type;if(Ee){if(je==="apiKey"){var We=Ge.in==="query"?"query":"headers";E[We]=E[We]||{},E[We][Ge.name]=Pe}else if(je==="basic")if(Pe.header)E.headers.authorization=Pe.header;else{var Je,ze=Pe.username||"",et=Pe.password||"";Pe.base64=_u()(Ot()(Je="".concat(ze,":")).call(Je,et)),E.headers.authorization="Basic ".concat(Pe.base64)}else if(je==="oauth2"&&Ne){var At;Ve=!Ve||Ve.toLowerCase()==="bearer"?"Bearer":Ve,E.headers.authorization=Ot()(At="".concat(Ve," ")).call(At,Ne)}}}})}),E)}var tf=function(r){return Array.isArray(r)?r:[]},Mc=il("OperationNotFoundError",function(r,i,a){this.originalError=a,rn()(this,i||{})}),Rc=function(r,i){return ln()(i).call(i,function(a){return a.name===r})},dr=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var a=[];return Qt()(i).forEach(function(s){Qt()(i[s]).forEach(function(p){a.push(i[s][p])})}),a},Lc={buildRequest:Ao};function gl(t){var r=t.http,i=t.fetch,a=t.spec,s=t.operationId,p=t.pathName,y=t.method,E=t.parameters,w=t.securities,A=Ec(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),k=r||i||Oi;p&&y&&!s&&(s=cl(p,y));var G=Lc.buildRequest(fr({spec:a,operationId:s,parameters:E,securities:w,http:k},A));return G.body&&(pl()(G.body)||hl()(G.body))&&(G.body=Ro()(G.body)),k(G)}function Ao(t){var r,i,a=t.spec,s=t.operationId,p=t.responseContentType,y=t.scheme,E=t.requestInterceptor,w=t.responseInterceptor,A=t.contextUrl,k=t.userFetch,G=t.server,ne=t.serverVariables,re=t.http,se=t.parameters,ye=t.parameterBuilders,ge=Wu(a);ye||(ge?ye=x:ye=aa);var Ee=re&&re.withCredentials?"include":"same-origin",me={url:"",credentials:Ee,headers:{},cookies:{}};E&&(me.requestInterceptor=E),w&&(me.responseInterceptor=w),k&&(me.userFetch=k);var Pe=zu(a,s);if(!Pe)throw new Mc("Operation ".concat(s," not found"));var Ge=Pe.operation,je=Ge===void 0?{}:Ge,He=Pe.method,Ne=Pe.pathName;if(me.url+=sa({spec:a,scheme:y,contextUrl:A,server:G,serverVariables:ne,pathName:Ne,method:He}),!s)return delete me.cookies,me;me.url+=Ne,me.method="".concat(He).toUpperCase(),se=se||{};var Ve=a.paths[Ne]||{};p&&(me.headers.accept=p);var We=dr(Ot()(r=Ot()(i=[]).call(i,tf(je.parameters))).call(r,tf(Ve.parameters)));We.forEach(function(et){var At=ye[et.in],Nt;if(et.in==="body"&&et.schema&&et.schema.properties&&(Nt=se),Nt=et&&et.name&&se[et.name],typeof Nt=="undefined"){var Ht;Nt=et&&et.name&&se[Ot()(Ht="".concat(et.in,".")).call(Ht,et.name)]}else if(Rc(et.name,We).length>1){var or;console.warn(Ot()(or="Parameter '".concat(et.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(or,et.name,"' and the passed-in parameter values did not define an 'in' value."))}if(Nt!==null){if(typeof et.default!="undefined"&&typeof Nt=="undefined"&&(Nt=et.default),typeof Nt=="undefined"&&et.required&&!et.allowEmptyValue)throw new Error("Required parameter ".concat(et.name," is not provided"));if(ge&&et.schema&&et.schema.type==="object"&&typeof Nt=="string")try{Nt=JSON.parse(Nt)}catch(Mr){throw new Error("Could not parse object parameter value string as JSON")}At&&At({req:me,parameter:et,value:Nt,operation:je,spec:a})}});var Je=fr(fr({},t),{},{operation:je});if(ge?me=qu(Je,me):me=ef(Je,me),me.cookies&&Qt()(me.cookies).length){var ze=Qt()(me.cookies).reduce(function(et,At){var Nt=me.cookies[At],Ht=et?"&":"",or=oa.serialize(At,Nt);return et+Ht+or},"");me.headers.Cookie=ze}return me.cookies&&delete me.cookies,du(me),me}var Cn=function(r){return r?r.replace(/\W/g,""):null};function sa(t){var r=Wu(t.spec);return r?yl(t):of(t)}function yl(t){var r=t.spec,i=t.pathName,a=t.method,s=t.server,p=t.contextUrl,y=t.serverVariables,E=y===void 0?{}:y,w=wo()(r,["paths",i,(a||"").toLowerCase(),"servers"])||wo()(r,["paths",i,"servers"])||wo()(r,["servers"]),A="",k=null;if(s&&w&&w.length){var G=qt()(w).call(w,function(se){return se.url});G.indexOf(s)>-1&&(A=s,k=w[G.indexOf(s)])}if(!A&&w&&w.length){A=w[0].url;var ne=tn(w,1);k=ne[0]}if(A.indexOf("{")>-1){var re=nf(A);re.forEach(function(se){if(k.variables&&k.variables[se]){var ye=k.variables[se],ge=E[se]||ye.default,Ee=new RegExp("{".concat(se,"}"),"g");A=A.replace(Ee,ge)}})}return rf(A,p)}function rf(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Ei.parse(Ei.resolve(r,t)):Ei.parse(t),a=Ei.parse(r),s=Cn(i.protocol)||Cn(a.protocol)||"",p=i.host||a.host,y=i.pathname||"",E;if(s&&p){var w;E=Ot()(w="".concat(s,"://")).call(w,p+y)}else E=y;return E[E.length-1]==="/"?In()(E).call(E,0,-1):E}function nf(t){for(var r=[],i=/{([^}]+)}/g,a;a=i.exec(t);)r.push(a[1]);return r}function of(t){var r=t.spec,i=t.scheme,a=t.contextUrl,s=a===void 0?"":a,p=Ei.parse(s),y=Array.isArray(r.schemes)?r.schemes[0]:null,E=i||y||Cn(p.protocol)||"http",w=r.host||p.host||"",A=r.basePath||"",k;if(E&&w){var G;k=Ot()(G="".concat(E,"://")).call(G,w+A)}else k=A;return k[k.length-1]==="/"?In()(k).call(k,0,-1):k}br.http=Oi,br.makeHttp=Ks.bind(null,br.http),br.resolve=Gu,br.resolveSubtree=bc,br.execute=gl,br.serializeRes=fu,br.serializeHeaders=Gs,br.clearCache=dl,br.makeApisTagOperation=$u,br.buildRequest=Ao,br.helpers={opId:pi},br.getBaseUrl=sa;function br(t){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"?i.url=t:i=t,!(this instanceof br))return new br(i);ji()(this,i);var a=this.resolve().then(function(){return r.disableInterfaces||ji()(r,br.makeApisTagOperation(r)),r});return a.client=this,a}br.prototype={http:Oi,execute:function(r){return this.applyDefaults(),br.execute(fr({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:typeof this.url=="string"?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},r))},resolve:function(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return br.resolve(fr({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},i)).then(function(a){return r.originalSpec=r.spec,r.spec=a.spec,r.errors=a.errors,r})}},br.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Vi()(i,"http")){var a=Ei.parse(i);r.host||(r.host=a.host),r.schemes||(r.schemes=[a.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var Dc=br.helpers;const Nc=br;var zt=o(25446),ml=o(11429),wt=o(76671),af=o(7930),la=o(51027),On=o(78722),sf=o(17673),kn=o(64776),Bc=Object.defineProperty,Sr=Object.defineProperties,Uc=Object.getOwnPropertyDescriptors,lf=Object.getOwnPropertySymbols,jc=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,e=(t,r,i)=>r in t?Bc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,n=(t,r)=>{for(var i in r||(r={}))jc.call(r,i)&&e(t,i,r[i]);if(lf)for(var i of lf(r))ns.call(r,i)&&e(t,i,r[i]);return t},u=(t,r)=>Sr(t,Uc(r)),l=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});const f="/oauth2-redirect.html";class m{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:a,extraParams:s={},routingBasePath:p,redirectUri:y,successCallback:E,errorCallback:w}){const A=(0,kn.p8)({date:new Date().toString()}),k=new URL(r),G=p==="/"?"":p,ne=`${window.location.origin}${G}${f}`;k.searchParams.set("client_id",i),k.searchParams.set("redirect_uri",y||ne),k.searchParams.set("response_type","token"),k.searchParams.set("state",A),Array.isArray(a)&&k.searchParams.set("scope",a.join(" "));for(const re in s)k.searchParams.set(re,s[re]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:a},state:A,successCallback:re=>{E(re),m.clearRedirectData("implicit")},errorCallback:re=>{w(re),m.clearRedirectData("implicit")}},window.open(k.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:a,clientSecret:s,codeVerifier:p,codeChallenge:y,scopes:E,extraParams:w={},extraHeaders:A={},routingBasePath:k,redirectUri:G,successCallback:ne,errorCallback:re}){const se=new URL(r),ye=k==="/"?"":k,ge=`${window.location.origin}${ye}${f}`,Ee=(0,kn.p8)({date:new Date().toString()});se.searchParams.set("client_id",a),se.searchParams.set("redirect_uri",G||ge),se.searchParams.set("response_type","code"),se.searchParams.set("state",Ee),Array.isArray(E)&&se.searchParams.set("scope",E.join(" ")),y&&(se.searchParams.set("code_challenge",y),se.searchParams.set("code_challenge_method","S256"));for(const me in w)se.searchParams.set(me,w[me]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:a,scopes:E},state:Ee,successCallback:me=>l(this,[me],function*({auth_code:Pe}){try{const Ge=yield fetch(i,{method:"POST",headers:n({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},A),body:sf.stringify(n(u(n({client_id:a,client_secret:s},p&&{code_verifier:p}),{code:Pe,grant_type:"authorization_code",redirect_uri:G||ge}),w))});yield U(Ge,ne,re)}catch(Ge){re(Ge)}m.clearRedirectData("authorizationCode")}),errorCallback:me=>{re(me),m.clearRedirectData("authorizationCode")}},window.open(se.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return l(this,arguments,function*({tokenUrl:i,clientId:a,clientSecret:s,scopes:p=[],extraParams:y={},extraHeaders:E={},successCallback:w,errorCallback:A}){try{const k=yield fetch(i,{method:"POST",headers:n({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},E),body:sf.stringify(n({client_id:a,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(p)?p.join(" "):void 0},y))});yield U(k,w,A)}catch(k){A(k)}})}}const F=new m;function U(t,r,i){return l(this,null,function*(){if(t.ok){const a=yield t.json();r(a)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function H(t){return l(this,null,function*(){return(0,kn.rS)(yield(0,kn.JQ)(t))})}var Z=o(68929),be;(function(t){t.STRING="string",t.ARRAY="array",t.OBJECT="object"})(be||(be={}));var Ce;(function(t){t.BYTE="byte",t.BASE64="base64",t.BINARY="binary"})(Ce||(Ce={}));var De=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});const ke=Object.values(Ce),Ye=["application/octet-stream","application/pdf","application/gzip","application/zip"],tt=["image/","audio/","video/"];function at(t){if(tt.some(r=>t.startsWith(r)))return t}function ct(t){return Ye.includes(t)?!0:tt.some(r=>t.startsWith(r))}function gt(t){const r=t.type==="array"?t.items:t;if(!r||!r.type||(r==null?void 0:r.type)==="any")return!0;const i=r.contentMediaType||"",a=r.format||r.contentEncoding||(ct(i)?"binary":"");return r.type===be.STRING&&ke.includes(a)}function dt(t,r){if(!t||!t.type||t.type==="any")return ct(r);const i=t.format||t.contentEncoding||"";return t.type===be.STRING&&ke.includes(i)}function xt(t){return new Promise((r,i)=>{const a=new FileReader;a.onload=()=>{const p=a.result.replace(/data:.*\/.*;base64,/g,"");r(p)},a.onerror=()=>i(a.error),a.readAsDataURL(t)})}function Ft({format:t,contentEncoding:r,contentMediaType:i}){return[t,r,i].includes(Ce.BASE64)}function It(t,r){return De(this,null,function*(){const i=Object.values(t);let a=i.length===1?i[0]:i;return r.type===be.STRING&&Ft(r)?a=yield xt(i[0]):r.type===be.ARRAY&&r.items&&(Ft(r.items)?a=yield Promise.all(i.map(p=>De(this,null,function*(){return yield xt(p)}))):a=i),a})}var it=o(39713),Gt=o(23485),hr=o(21096),vr=Object.defineProperty,bn=Object.defineProperties,fn=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,Fr=(t,r,i)=>r in t?vr(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,gr=(t,r)=>{for(var i in r||(r={}))cn.call(r,i)&&Fr(t,i,r[i]);if(Ar)for(var i of Ar(r))Kr.call(r,i)&&Fr(t,i,r[i]);return t},yr=(t,r)=>bn(t,fn(r));const nn=Gt.iv`
|
|
92
|
+
*/var Xs=new WeakMap,Qs=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),xu=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function Zs(t){return Xs.get(t)}function ic(t,r){return t.observers.get(r)}function _s(t,r){t.observers.delete(r.callback)}function qs(t,r){r.unobserve()}function bu(t,r){var i=[],a,s=Zs(t);if(!s)s=new Qs(t),Xs.set(t,s);else{var p=ic(s,r);a=p&&p.observer}if(a)return a;if(a={},s.value=yn(t),r){a.callback=r,a.next=null;var y=function(){Da(a)},E=function(){clearTimeout(a.next),a.next=setTimeout(y)};typeof window!="undefined"&&(window.addEventListener("mouseup",E),window.addEventListener("keyup",E),window.addEventListener("mousedown",E),window.addEventListener("keydown",E),window.addEventListener("change",E))}return a.patches=i,a.object=t,a.unobserve=function(){Da(a),clearTimeout(a.next),_s(s,a),typeof window!="undefined"&&(window.removeEventListener("mouseup",E),window.removeEventListener("keyup",E),window.removeEventListener("mousedown",E),window.removeEventListener("keydown",E),window.removeEventListener("change",E))},s.observers.set(r,new xu(r,a)),a}function Da(t,r){r===void 0&&(r=!1);var i=Xs.get(t.object);Ko(i.value,t.object,t.patches,"",r),t.patches.length&&Gn(i.value,t.patches);var a=t.patches;return a.length>0&&(t.patches=[],t.callback&&t.callback(a)),a}function Ko(t,r,i,a,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var p=Ra(r),y=Ra(t),E=!1,w=!1,A=y.length-1;A>=0;A--){var k=y[A],G=t[k];if(fi(r,k)&&!(r[k]===void 0&&G!==void 0&&Array.isArray(r)===!1)){var ne=r[k];typeof G=="object"&&G!=null&&typeof ne=="object"&&ne!=null?Ko(G,ne,i,a+"/"+ci(k),s):G!==ne&&(E=!0,s&&i.push({op:"test",path:a+"/"+ci(k),value:yn(G)}),i.push({op:"replace",path:a+"/"+ci(k),value:yn(ne)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:a+"/"+ci(k),value:yn(G)}),i.push({op:"remove",path:a+"/"+ci(k)}),w=!0):(s&&i.push({op:"test",path:a,value:t}),i.push({op:"replace",path:a,value:r}),E=!0)}if(!(!w&&p.length==y.length))for(var A=0;A<p.length;A++){var k=p[A];!fi(t,k)&&r[k]!==void 0&&i.push({op:"add",path:a+"/"+ci(k),value:yn(r[k])})}}}function wu(t,r,i){i===void 0&&(i=!1);var a=[];return Ko(t,r,a,"",i),a}const Na=Object.assign({},c,v,{JsonPatchError:yu,deepClone:yn,escapePathComponent:ci,unescapePathComponent:Ti});var oc=o(31312),Ba=o.n(oc),di=o(50361),Su=o.n(di);const rr={add:er,replace:En,remove:Ii,merge:Fi,mergeDeep:Eu,context:el,getIn:ki,applyPatch:Au,parentPathMatch:tl,flatten:Yo,fullyNormalizeArray:Ou,normalizeArray:rl,isPromise:Tu,forEachNew:Cu,forEachNewPrimitive:ac,isJsonPatch:Fu,isContextPatch:lc,isPatch:Va,isMutation:Xo,isAdditiveMutation:Qo,isGenerator:sc,isFunction:Pu,isObject:ei,isError:Iu};function Au(t,r,i){if(i=i||{},r=fr(fr({},r),{},{path:r.path&&mn(r.path)}),r.op==="merge"){var a=Wa(t,r.path);rn()(a,r.value),Gn(t,[En(r.path,a)])}else if(r.op==="mergeDeep"){var s=Wa(t,r.path);for(var p in r.value){var y=r.value[p],E=Array.isArray(y);if(E){var w=s[p]||[];s[p]=Ot()(w).call(w,y)}else if(ei(y)&&!E){var A=fr({},s[p]);for(var k in y)if(Object.prototype.hasOwnProperty.call(A,k)){A=Ba()(Su()(A),y);break}else rn()(A,Ss({},k,y[k]));s[p]=A}else s[p]=y}}else if(r.op==="add"&&r.path===""&&ei(r.value)){var G=Qt()(r.value).reduce(function(ge,Ee){return ge.push({op:"add",path:"/".concat(mn(Ee)),value:r.value[Ee]}),ge},[]);Gn(t,G)}else if(r.op==="replace"&&r.path===""){var ne=r,re=ne.value;i.allowMetaPatches&&r.meta&&Qo(r)&&(Array.isArray(r.value)||ei(r.value))&&(re=fr(fr({},re),r.meta)),t=re}else if(Gn(t,[r]),i.allowMetaPatches&&r.meta&&Qo(r)&&(Array.isArray(r.value)||ei(r.value))){var se=Wa(t,r.path),ye=fr(fr({},se),r.meta);Gn(t,[En(r.path,ye)])}return t}function mn(t){return Array.isArray(t)?t.length<1?"":"/".concat(qt()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function er(t,r){return{op:"add",path:t,value:r}}function En(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function Ii(t){return{op:"remove",path:t}}function Fi(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function Eu(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function el(t,r){return{type:"context",path:t,value:r}}function Cu(t,r){try{return Ua(t,ja,r)}catch(i){return i}}function ac(t,r){try{return Ua(t,_i,r)}catch(i){return i}}function Ua(t,r,i){var a,s=qt()(a=ln()(t).call(t,Qo)).call(a,function(E){return r(E.value,i,E.path)})||[],p=Yo(s),y=Jo(p);return y}function _i(t,r,i){if(i=i||[],Array.isArray(t))return qt()(t).call(t,function(s,p){return _i(s,r,Ot()(i).call(i,p))});if(ei(t)){var a;return qt()(a=Qt()(t)).call(a,function(s){return _i(t[s],r,Ot()(i).call(i,s))})}return r(t,i[i.length-1],i)}function ja(t,r,i){i=i||[];var a=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(a=Ot()(a).call(a,s))}if(Array.isArray(t)){var p=qt()(t).call(t,function(w,A){return ja(w,r,Ot()(i).call(i,A))});p&&(a=Ot()(a).call(a,p))}else if(ei(t)){var y,E=qt()(y=Qt()(t)).call(y,function(w){return ja(t[w],r,Ot()(i).call(i,w))});E&&(a=Ot()(a).call(a,E))}return a=Yo(a),a}function tl(t,r){if(!Array.isArray(r))return!1;for(var i=0,a=r.length;i<a;i+=1)if(r[i]!==t[i])return!1;return!0}function ki(t,r){return r.reduce(function(i,a){return typeof a!="undefined"&&i?i[a]:i},t)}function Ou(t){return Jo(Yo(rl(t)))}function rl(t){return Array.isArray(t)?t:[t]}function Yo(t){var r;return Ot()(r=[]).apply(r,Pn(qt()(t).call(t,function(i){return Array.isArray(i)?Yo(i):i})))}function Jo(t){return ln()(t).call(t,function(r){return typeof r!="undefined"})}function ei(t){return t&&nr(t)==="object"}function Tu(t){return ei(t)&&Pu(t.then)}function Pu(t){return t&&typeof t=="function"}function Iu(t){return t instanceof Error}function Fu(t){if(Va(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function sc(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function Xo(t){return Fu(t)||Va(t)&&t.type==="mutation"}function Qo(t){return Xo(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function lc(t){return Va(t)&&t.type==="context"}function Va(t){return t&&nr(t)==="object"}function Wa(t,r){try{return Lr(t,r)}catch(i){return console.error(i),{}}}var po=o(52424),nl=o.n(po),Ha=o(54098),ku=o(9779),za=o.n(ku);function il(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var a=arguments.length,s=new Array(a),p=0;p<a;p++)s[p]=arguments[p];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var uc=o(13692),Mu=o.n(uc),Xr=o(47037),Ga=o.n(Xr),Ru=["properties"],Lu=["properties"],Du=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],ho=["schema/example","items/example"];function Zo(t){var r=t[t.length-1],i=t[t.length-2],a=t.join("/");return Ru.indexOf(r)>-1&&Lu.indexOf(i)===-1||Du.indexOf(a)>-1||ho.some(function(s){return a.indexOf(s)>-1})}function Nu(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.specmap,s=i.getBaseUrlForNodePath,p=s===void 0?function(A){var k;return a.getContext(Ot()(k=[]).call(k,Pn(r),Pn(A))).baseDoc}:s,y=i.targetKeys,E=y===void 0?["$ref","$$ref"]:y,w=[];return Mu()(t).forEach(function(){if(wa()(E).call(E,this.key)&&Ga()(this.node)){var k=this.path,G=Ot()(r).call(r,this.path),ne=$a(this.node,p(k));w.push(a.replace(G,ne))}}),w}function $a(t,r){var i,a=t.split("#"),s=tn(a,2),p=s[0],y=s[1],E=Ei.resolve(p||"",r||"");return y?Ot()(i="".concat(E,"#")).call(i,y):E}var ol="application/json, application/yaml",vo=new RegExp("^([a-z]+://|//)","i"),qi=il("JSONRefError",function(r,i,a){this.originalError=a,rn()(this,i||{})}),Fn={},al=new(nl()),_o=[function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="examples"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="examples"&&t[6]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="examples"&&t[7]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[4]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"}],fc=function(r){return _o.some(function(i){return i(r)})},go={key:"$ref",plugin:function(r,i,a,s){var p=s.getInstance(),y=In()(a).call(a,0,-1);if(!(Zo(y)||fc(y))){var E=s.getContext(a),w=E.baseDoc;if(typeof r!="string")return new qi("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:w,fullPath:a});var A=yo(r),k=A[0],G=A[1]||"",ne;try{ne=w||k?ll(k,w):null}catch(me){return eo(me,{pointer:G,$ref:r,basePath:ne,fullPath:a})}var re,se;if(pc(G,ne,y,s)&&!p.useCircularStructures){var ye=$a(r,ne);return r===ye?null:rr.replace(a,ye)}if(ne==null?(se=ti(G),re=s.get(se),typeof re=="undefined"&&(re=new qi("Could not resolve reference: ".concat(r),{pointer:G,$ref:r,baseDoc:w,fullPath:a}))):(re=mo(ne,G),re.__value!=null?re=re.__value:re=re.catch(function(me){throw eo(me,{pointer:G,$ref:r,baseDoc:w,fullPath:a})})),re instanceof Error)return[rr.remove(a),re];var ge=$a(r,ne),Ee=rr.replace(y,re,{$$ref:ge});if(ne&&ne!==w)return[Ee,rr.context(y,{baseDoc:ne})];try{if(!hc(s.state,Ee)||p.useCircularStructures)return Ee}catch(me){return null}}}},sl=rn()(go,{docCache:Fn,absoluteify:ll,clearCache:qo,JSONRefError:qi,wrapError:eo,getDoc:ul,split:yo,extractFromDoc:mo,fetchJSON:cc,extract:Ka,jsonPointerToArray:ti,unescapeJsonPointerToken:to});const Bu=sl;function ll(t,r){if(!vo.test(t)){if(!r){var i;throw new qi(Ot()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Ei.resolve(r,t)}return t}function eo(t,r){var i;if(t&&t.response&&t.response.body){var a;i=Ot()(a="".concat(t.response.body.code," ")).call(a,t.response.body.message)}else i=t.message;return new qi("Could not resolve reference: ".concat(i),r,t)}function yo(t){return(t+"").split("#")}function mo(t,r){var i=Fn[t];if(i&&!rr.isPromise(i))try{var a=Ka(r,i);return rn()(Ji().resolve(a),{__value:a})}catch(s){return Ji().reject(s)}return ul(t).then(function(s){return Ka(r,s)})}function qo(t){typeof t!="undefined"?delete Fn[t]:Qt()(Fn).forEach(function(r){delete Fn[r]})}function ul(t){var r=Fn[t];return r?rr.isPromise(r)?r:Ji().resolve(r):(Fn[t]=sl.fetchJSON(t).then(function(i){return Fn[t]=i,i}),Fn[t])}function cc(t){return(0,Ha.fetch)(t,{headers:{Accept:ol},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return Ms().safeLoad(r)})}function Ka(t,r){var i=ti(t);if(i.length<1)return r;var a=rr.getIn(r,i);if(typeof a=="undefined")throw new qi("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return a}function ti(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(nr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:qt()(r=t.split("/")).call(r,to)}function to(t){return typeof t!="string"?t:za().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function xo(t){return za().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function dc(t){return t.length===0?"":"/".concat(qt()(t).call(t,xo).join("/"))}var Uu=function(r){return!r||r==="/"||r==="#"};function fl(t,r){if(Uu(r))return!0;var i=t.charAt(r.length),a=In()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&a!=="#"}function pc(t,r,i,a){var s,p,y=al.get(a);y||(y={},al.set(a,y));var E=dc(i),w=Ot()(s="".concat(r||"<specmap-base>","#")).call(s,t),A=E.replace(/allOf\/\d+\/?/g,""),k=a.contextTree.get([]).baseDoc;if(r==k&&fl(A,t))return!0;var G="",ne=i.some(function(re){var se;return G=Ot()(se="".concat(G,"/")).call(se,xo(re)),y[G]&&y[G].some(function(ye){return fl(ye,w)||fl(w,ye)})});if(ne)return!0;y[A]=Ot()(p=y[A]||[]).call(p,w)}function hc(t,r){var i=[t];return r.path.reduce(function(s,p){return i.push(s[p]),s[p]},t),a(r.value);function a(s){return rr.isObject(s)&&(i.indexOf(s)>=0||Qt()(s).some(function(p){return a(s[p])}))}}var un=o(41609),ju=o.n(un);const vc={key:"allOf",plugin:function(r,i,a,s,p){if(!(p.meta&&p.meta.$$ref)){var y=In()(a).call(a,0,-1);if(!Zo(y)){if(!Array.isArray(r)){var E=new TypeError("allOf must be an array");return E.fullPath=a,E}var w=!1,A=p.value;if(y.forEach(function(ne){!A||(A=A[ne])}),A=fr({},A),!ju()(A)){delete A.allOf;var k=[];if(k.push(s.replace(y,{})),r.forEach(function(ne,re){if(!s.isObject(ne)){if(w)return null;w=!0;var se=new TypeError("Elements in allOf must be objects");return se.fullPath=a,k.push(se)}k.push(s.mergeDeep(y,ne));var ye=In()(a).call(a,0,-1),ge=Nu(ne,ye,{getBaseUrlForNodePath:function(me){var Pe;return s.getContext(Ot()(Pe=[]).call(Pe,Pn(a),[re],Pn(me))).baseDoc},specmap:s});k.push.apply(k,Pn(ge))}),k.push(s.mergeDeep(y,A)),!A.$$ref){var G;k.push(s.remove(Ot()(G=[]).call(G,y,"$$ref")))}return k}}}}},gc={key:"parameters",plugin:function(r,i,a,s){if(Array.isArray(r)&&r.length){var p=rn()([],r),y=In()(a).call(a,0,-1),E=fr({},rr.getIn(s.spec,y));return r.forEach(function(w,A){try{p[A].default=s.parameterMacro(E,w)}catch(G){var k=new Error(G);return k.fullPath=a,k}}),rr.replace(a,p)}return rr.replace(a,r)}},yc={key:"properties",plugin:function(r,i,a,s){var p=fr({},r);for(var y in r)try{p[y].default=s.modelPropertyMacro(p[y])}catch(A){var E=new Error(A);return E.fullPath=a,E}var w=rr.replace(a,p);return w}};var Vu=function(){function t(r){Aa(this,t),this.root=Ya(r||{})}return Ds(t,[{key:"set",value:function(i,a){var s=this.getParent(i,!0);if(!s){ea(this.root,a,null);return}var p=i[i.length-1],y=s.children;if(y[p]){ea(y[p],a,s);return}y[p]=Ya(a,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var a=this.root,s,p,y=0;y<i.length&&(p=i[y],s=a.children,!!s[p]);y+=1)a=s[p];return a&&a.protoValue}},{key:"getParent",value:function(i,a){return!i||i.length<1?null:i.length<2?this.root:In()(i).call(i,0,-1).reduce(function(s,p){if(!s)return s;var y=s.children;return!y[p]&&a&&(y[p]=Ya(null,s)),y[p]},this.root)}}]),t}();function Ya(t,r){return ea({children:{}},t,r)}function ea(t,r,i){return t.value=r||{},t.protoValue=i?fr(fr({},i.protoValue),t.value):t.value,Qt()(t.children).forEach(function(a){var s=t.children[a];t.children[a]=ea(s,s.value,t)}),t}var Wu=100,mc=function(){function t(r){var i=this,a,s;Aa(this,t),rn()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new Vu,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:rn()(Object.create(this),rr,{getInstance:function(){return i}}),allowMetaPatches:!1},r),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=ln()(a=qt()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(a,rr.isFunction),this.patches.push(rr.add([],this.spec)),this.patches.push(rr.context([],this.context)),this.updatePatches(this.patches)}return Ds(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var a,s=arguments.length,p=new Array(s>1?s-1:0),y=1;y<s;y++)p[y-1]=arguments[y];(a=console).log.apply(a,p)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var a,s,p=arguments.length,y=new Array(p>1?p-1:0),E=1;E<p;E++)y[E-1]=arguments[E];(a=console).log.apply(a,Ot()(s=["[".concat(i,"] ")]).call(s,y))}}},{key:"wrapPlugin",value:function(i,a){var s=this.pathDiscriminator,p=null,y;return i[this.pluginProp]?(p=i,y=i[this.pluginProp]):rr.isFunction(i)?y=i:rr.isObject(i)&&(y=E(i)),rn()(y.bind(p),{pluginName:i.name||a,isGenerator:rr.isGenerator(y)});function E(w){var A=function(G,ne){return Array.isArray(G)?G.every(function(re,se){return re===ne[se]}):!0};return ir().mark(function k(G,ne){var re,se,ye,ge,Ee,me;return ir().wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:me=function(He,Ne,Ve){var We,Je,ze,et,At,Nt,Ht,or,Mr,Cr,Jr,wr,Dr;return ir().wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(rr.isObject(He)){Yt.next=6;break}if(w.key!==Ne[Ne.length-1]){Yt.next=4;break}return Yt.next=4,w.plugin(He,w.key,Ne,ne);case 4:Yt.next=30;break;case 6:We=Ne.length-1,Je=Ne[We],ze=Ne.indexOf("properties"),et=Je==="properties"&&We===ze,At=ne.allowMetaPatches&&se[He.$$ref],Nt=0,Ht=Qt()(He);case 12:if(!(Nt<Ht.length)){Yt.next=30;break}if(or=Ht[Nt],Mr=He[or],Cr=Ot()(Ne).call(Ne,or),Jr=rr.isObject(Mr),wr=He.$$ref,At){Yt.next=22;break}if(!Jr){Yt.next=22;break}return ne.allowMetaPatches&&wr&&(se[wr]=!0),Yt.delegateYield(me(Mr,Cr,Ve),"t0",22);case 22:if(!(!et&&or===w.key)){Yt.next=27;break}if(Dr=A(s,Ne),!(!s||Dr)){Yt.next=27;break}return Yt.next=27,w.plugin(Mr,or,Cr,ne,Ve);case 27:Nt++,Yt.next=12;break;case 30:case"end":return Yt.stop()}},re)},re=ir().mark(me),se={},ye=Hi(ln()(G).call(G,rr.isAdditiveMutation)),Ge.prev=4,ye.s();case 6:if((ge=ye.n()).done){Ge.next=11;break}return Ee=ge.value,Ge.delegateYield(me(Ee.value,Ee.path,Ee),"t0",9);case 9:Ge.next=6;break;case 11:Ge.next=16;break;case 13:Ge.prev=13,Ge.t1=Ge.catch(4),ye.e(Ge.t1);case 16:return Ge.prev=16,ye.f(),Ge.finish(16);case 19:case"end":return Ge.stop()}},k,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return vu()(this.wrappedPlugins,function(a){var s=i.getMutationsForPlugin(a);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return Ji().race(qt()(i=this.promisedPatches).call(i,function(a){return a.value}))}}},{key:"getPluginHistory",value:function(i){var a=this.constructor.getPluginName(i);return this.pluginHistory[a]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var a=this.getPluginHistory(i),s=a&&a[a.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var a=this.getPluginHistoryTip(i).mutationIndex;return typeof a!="number"?-1:a}},{key:"updatePluginHistory",value:function(i,a){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(a)}},{key:"updatePatches",value:function(i){var a=this;rr.normalizeArray(i).forEach(function(s){if(s instanceof Error){a.errors.push(s);return}try{if(!rr.isObject(s)){a.debug("updatePatches","Got a non-object patch",s);return}if(a.showDebug&&a.allPatches.push(s),rr.isPromise(s.value)){a.promisedPatches.push(s),a.promisedPatchThen(s);return}if(rr.isContextPatch(s)){a.setContext(s.path,s.value);return}if(rr.isMutation(s)){a.updateMutations(s);return}}catch(p){console.error(p),a.errors.push(p)}})}},{key:"updateMutations",value:function(i){nr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=fr({},i.value));var a=rr.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});a&&(this.mutations.push(i),this.state=a)}},{key:"removePromisedPatch",value:function(i){var a,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}hu()(a=this.promisedPatches).call(a,s,1)}},{key:"promisedPatchThen",value:function(i){var a=this;return i.value=i.value.then(function(s){var p=fr(fr({},i),{},{value:s});a.removePromisedPatch(i),a.updatePatches(p)}).catch(function(s){a.removePromisedPatch(i),a.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,a){var s;return i=i||0,typeof a!="number"&&(a=this.mutations.length),In()(s=this.mutations).call(s,i,a)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var a=this.getPluginMutationIndex(i);return this.getMutations(a+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return rr.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,a){return this.contextTree.set(i,a)}},{key:"_hasRun",value:function(i){var a=this.getPluginRunCount(this.getCurrentPlugin());return a>(i||0)}},{key:"dispatch",value:function(){var i=this,a=this,s=this.nextPlugin();if(!s){var p=this.nextPromisedPatch();if(p)return p.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var y={spec:this.state,errors:this.errors};return this.showDebug&&(y.patches=this.allPatches),Ji().resolve(y)}if(a.pluginCount=a.pluginCount||{},a.pluginCount[s]=(a.pluginCount[s]||0)+1,a.pluginCount[s]>Wu){var E;return Ji().resolve({spec:a.state,errors:Ot()(E=a.errors).call(E,new Error("We've reached a hard limit of ".concat(Wu," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var w,A=qt()(w=this.promisedPatches).call(w,function(ne){return ne.value});return Ji().all(qt()(A).call(A,function(ne){return ne.then(co(),co())})).then(function(){return i.dispatch()})}return k();function k(){a.currentPlugin=s;var ne=a.getCurrentMutations(),re=a.mutations.length-1;try{if(s.isGenerator){var se=Hi(s(ne,a.getLib())),ye;try{for(se.s();!(ye=se.n()).done;){var ge=ye.value;G(ge)}}catch(me){se.e(me)}finally{se.f()}}else{var Ee=s(ne,a.getLib());G(Ee)}}catch(me){console.error(me),G([rn()(Object.create(me),{plugin:s})])}finally{a.updatePluginHistory(s,{mutationIndex:re})}return a.dispatch()}function G(ne){ne&&(ne=rr.fullyNormalizeArray(ne),a.updatePatches(ne,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,a){return ln()(i).call(i,a)}}]),t}();function xc(t){return new mc(t).dispatch()}var xn={refs:Bu,allOf:vc,parameters:gc,properties:yc},ta=o(13218),ra=o.n(ta),bo=function(r){return String.prototype.toLowerCase.call(r)},ri=function(r){return r.replace(/[^\w]/gi,"_")};function Hu(t){var r=t.openapi;return r?Vi()(r,"3"):!1}function Rd(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function pi(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=a.v2OperationIdCompatibilityMode;if(!t||nr(t)!=="object")return null;var p=(t.operationId||"").replace(/\s/g,"");return p.length?ri(t.operationId):zu(r,i,{v2OperationIdCompatibilityMode:s})}function zu(t,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=a.v2OperationIdCompatibilityMode;if(s){var p,y,E=Ot()(p="".concat(r.toLowerCase(),"_")).call(p,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return E=E||Ot()(y="".concat(t.substring(1),"_")).call(y,r),E.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return Ot()(i="".concat(bo(r))).call(i,ri(t))}function cl(t,r){var i;return Ot()(i="".concat(bo(r),"-")).call(i,t)}function Gu(t,r){return!t||!t.paths?null:Ja(t,function(i){var a=i.pathName,s=i.method,p=i.operation;if(!p||nr(p)!=="object")return!1;var y=p.operationId,E=pi(p,a,s),w=cl(a,s);return[E,w,y].some(function(A){return A&&A===r})})}function Ja(t,r){return ro(t,r,!0)||null}function ro(t,r,i){if(!t||nr(t)!=="object"||!t.paths||nr(t.paths)!=="object")return null;var a=t.paths;for(var s in a)for(var p in a[s])if(p.toUpperCase()!=="PARAMETERS"){var y=a[s][p];if(!(!y||nr(y)!=="object")){var E={spec:t,pathName:s,method:p.toUpperCase(),operation:y},w=r(E);if(i&&w)return E}}}function Xa(t){var r=t.spec,i=r.paths,a={};if(!i||r.$$normalized)return t;for(var s in i){var p=i[s];if(!!ra()(p)){var y=p.parameters,E=function(G){var ne=p[G];if(!ra()(ne))return"continue";var re=pi(ne,s,G);if(re){a[re]?a[re].push(ne):a[re]=[ne];var se=a[re];if(se.length>1)se.forEach(function(Je,ze){var et;Je.__originalOperationId=Je.__originalOperationId||Je.operationId,Je.operationId=Ot()(et="".concat(re)).call(et,ze+1)});else if(typeof ne.operationId!="undefined"){var ye=se[0];ye.__originalOperationId=ye.__originalOperationId||ne.operationId,ye.operationId=re}}if(G!=="parameters"){var ge=[],Ee={};for(var me in r)(me==="produces"||me==="consumes"||me==="security")&&(Ee[me]=r[me],ge.push(Ee));if(y&&(Ee.parameters=y,ge.push(Ee)),ge.length){var Pe=Hi(ge),Ge;try{for(Pe.s();!(Ge=Pe.n()).done;){var je=Ge.value;for(var He in je)if(!ne[He])ne[He]=je[He];else if(He==="parameters"){var Ne=Hi(je[He]),Ve;try{var We=function(){var ze=Ve.value,et=ne[He].some(function(At){return At.name&&At.name===ze.name||At.$ref&&At.$ref===ze.$ref||At.$$ref&&At.$$ref===ze.$$ref||At===ze});et||ne[He].push(ze)};for(Ne.s();!(Ve=Ne.n()).done;)We()}catch(Je){Ne.e(Je)}finally{Ne.f()}}}}catch(Je){Pe.e(Je)}finally{Pe.f()}}}};for(var w in p)var A=E(w)}}return r.$$normalized=!0,t}function Qa(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,a=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(p){return t({url:p,loadSpec:!0,requestInterceptor:i,responseInterceptor:a,headers:{Accept:ol},credentials:s}).then(function(y){return y.body})}}function dl(){xn.refs.clearCache()}function $u(t){var r=t.fetch,i=t.spec,a=t.url,s=t.mode,p=t.allowMetaPatches,y=p===void 0?!0:p,E=t.pathDiscriminator,w=t.modelPropertyMacro,A=t.parameterMacro,k=t.requestInterceptor,G=t.responseInterceptor,ne=t.skipNormalization,re=t.useCircularStructures,se=t.http,ye=t.baseDoc;if(ye=ye||a,se=r||se||Oi,!i)return Qa(se,{requestInterceptor:k,responseInterceptor:G})(ye).then(ge);return ge(i);function ge(Ee){ye&&(xn.refs.docCache[ye]=Ee),xn.refs.fetchJSON=Qa(se,{requestInterceptor:k,responseInterceptor:G});var me=[xn.refs];return typeof A=="function"&&me.push(xn.parameters),typeof w=="function"&&me.push(xn.properties),s!=="strict"&&me.push(xn.allOf),xc({spec:Ee,context:{baseDoc:ye},plugins:me,allowMetaPatches:y,pathDiscriminator:E,parameterMacro:A,modelPropertyMacro:w,useCircularStructures:re}).then(ne?function(){var Pe=Is(ir().mark(function Ge(je){return ir().wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return Ne.abrupt("return",je);case 1:case"end":return Ne.stop()}},Ge)}));return function(Ge){return Pe.apply(this,arguments)}}():Xa)}}var na=o(27361),wo=o.n(na);function bc(t,r){return Za.apply(this,arguments)}function Za(){return Za=Is(ir().mark(function t(r,i){var a,s,p,y,E,w,A,k,G,ne,re,se,ye=arguments;return ir().wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return a=ye.length>2&&ye[2]!==void 0?ye[2]:{},s=a.returnEntireTree,p=a.baseDoc,y=a.requestInterceptor,E=a.responseInterceptor,w=a.parameterMacro,A=a.modelPropertyMacro,k=a.useCircularStructures,G={pathDiscriminator:i,baseDoc:p,requestInterceptor:y,responseInterceptor:E,parameterMacro:w,modelPropertyMacro:A,useCircularStructures:k},ne=Xa({spec:r}),re=ne.spec,Ee.next=6,$u(fr(fr({},G),{},{spec:re,allowMetaPatches:!0,skipNormalization:!0}));case 6:return se=Ee.sent,!s&&Array.isArray(i)&&i.length&&(se.spec=wo()(se.spec,i)||null),Ee.abrupt("return",se);case 9:case"end":return Ee.stop()}},t)})),Za.apply(this,arguments)}var _a=function(){return null},wc=function(r){return Array.isArray(r)?r:[r]},qa={mapTagOperations:Ac,makeExecute:ia};function ia(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,a=r.method,s=r.operationId;return function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(fr(fr({spec:t.spec},Sa()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:a,parameters:p,operationId:s},y))}}}function Sc(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=qa.makeExecute(t),i=qa.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),a={};for(var s in i){a[s]={operations:{}};for(var p in i[s])a[s].operations[p]={execute:i[s][p]}}return{apis:a}}function Ku(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=qa.makeExecute(t);return{apis:qa.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Ac(t){var r=t.spec,i=t.cb,a=i===void 0?_a:i,s=t.defaultTag,p=s===void 0?"default":s,y=t.v2OperationIdCompatibilityMode,E={},w={};return ro(r,function(A){var k=A.pathName,G=A.method,ne=A.operation,re=ne.tags?wc(ne.tags):[p];re.forEach(function(se){if(typeof se=="string"){w[se]=w[se]||{};var ye=w[se],ge=pi(ne,k,G,{v2OperationIdCompatibilityMode:y}),Ee=a({spec:r,pathName:k,method:G,operation:ne,operationId:ge});if(E[ge]){var me;E[ge]+=1,ye[Ot()(me="".concat(ge)).call(me,E[ge])]=Ee}else if(typeof ye[ge]!="undefined"){var Pe,Ge,je=E[ge]||1;E[ge]=je+1,ye[Ot()(Pe="".concat(ge)).call(Pe,E[ge])]=Ee;var He=ye[ge];delete ye[ge],ye[Ot()(Ge="".concat(ge)).call(Ge,je)]=He}else ye[ge]=Ee}})}),w}var es=o(95683);function Yu(t,r){if(t==null)return{};var i={},a=ws(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(es(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function Ec(t,r){if(t==null)return{};var i=Yu(t,r),a,s;if(Ui){var p=Ui(t);for(s=0;s<p.length;s++)a=p[s],!(es(r).call(r,a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}var Ju=o(68630),pl=o.n(Ju),Cc=o(1469),hl=o.n(Cc),oa=o(76489);const aa={body:Oc,header:Tc,query:Ic,path:Pc,formData:Xu};function Oc(t){var r=t.req,i=t.value;r.body=i}function Xu(t){var r=t.req,i=t.value,a=t.parameter;(i||a.allowEmptyValue)&&(r.form=r.form||{},r.form[a.name]={value:i,allowEmptyValue:a.allowEmptyValue,collectionFormat:a.collectionFormat})}function Tc(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{},typeof a!="undefined"&&(r.headers[i.name]=a)}function Pc(t){var r=t.req,i=t.value,a=t.parameter;r.url=r.url.split("{".concat(a.name,"}")).join(encodeURIComponent(i))}function Ic(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},i===!1&&a.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(a.type)>-1&&(i="0"),i)r.query[a.name]={collectionFormat:a.collectionFormat,value:i};else if(a.allowEmptyValue&&i!==void 0){var s=a.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function ts(t,r){return wa()(r).call(r,"application/json")?typeof t=="string"?t:Ro()(t):t.toString()}function Qu(t){var r=t.req,i=t.value,a=t.parameter,s=a.name,p=a.style,y=a.explode,E=a.content;if(E){var w=Qt()(E)[0];r.url=r.url.split("{".concat(s,"}")).join(Rr(ts(i,w),{escape:!0}));return}var A=qn({key:a.name,value:i,style:p||"simple",explode:y||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(A)}function Fc(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},a.content){var s=Qt()(a.content)[0];r.query[a.name]=ts(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[a.name]={value:i,serializationOption:Sa()(a,["style","explode","allowReserved"])};else if(a.allowEmptyValue&&i!==void 0){var p=a.name;r.query[p]=r.query[p]||{},r.query[p].allowEmptyValue=!0}}var kc=["accept","authorization","content-type"];function Zu(t){var r=t.req,i=t.parameter,a=t.value;if(r.headers=r.headers||{},!(kc.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=Qt()(i.content)[0];r.headers[i.name]=ts(a,s);return}typeof a!="undefined"&&(r.headers[i.name]=qn({key:i.name,value:a,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function vl(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{};var s=nr(a);if(i.content){var p,y=Qt()(i.content)[0];r.headers.Cookie=Ot()(p="".concat(i.name,"=")).call(p,ts(a,y));return}if(s!=="undefined"){var E=s==="object"&&!Array.isArray(a)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=E+qn({key:i.name,value:a,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var _u=o(50706),qu=o.n(_u);function ef(t,r){var i=t.operation,a=t.requestBody,s=t.securities,p=t.spec,y=t.attachContentTypeForEmptyPayload,E=t.requestContentType;r=So({request:r,securities:s,operation:i,spec:p});var w=i.requestBody||{},A=Qt()(w.content||{}),k=E&&A.indexOf(E)>-1;if(a||y){if(E&&k)r.headers["Content-Type"]=E;else if(!E){var G=A[0];G&&(r.headers["Content-Type"]=G,E=G)}}else E&&k&&(r.headers["Content-Type"]=E);if(!t.responseContentType&&i.responses){var ne,re=ln()(ne=Lo()(i.responses)).call(ne,function(ye){var ge=tn(ye,2),Ee=ge[0],me=ge[1],Pe=parseInt(Ee,10);return Pe>=200&&Pe<300&&pl()(me.content)}).reduce(function(ye,ge){var Ee=tn(ge,2),me=Ee[1];return Ot()(ye).call(ye,Qt()(me.content))},[]);re.length>0&&(r.headers.accept=re.join(", "))}if(a)if(E){if(A.indexOf(E)>-1)if(E==="application/x-www-form-urlencoded"||E==="multipart/form-data")if(nr(a)==="object"){var se=(w.content[E]||{}).encoding||{};r.form={},Qt()(a).forEach(function(ye){r.form[ye]={value:a[ye],encoding:se[ye]||{}}})}else r.form=a;else r.body=a}else r.body=a;return r}function So(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,E=ji()({},r),w=a.authorized,A=w===void 0?{}:w,k=p.security||y.security||[],G=A&&!!Qt()(A).length,ne=wo()(y,["components","securitySchemes"])||{};return E.headers=E.headers||{},E.query=E.query||{},!Qt()(a).length||!G||!k||Array.isArray(p.security)&&!p.security.length?r:(k.forEach(function(re){Qt()(re).forEach(function(se){var ye=A[se],ge=ne[se];if(!!ye){var Ee=ye.value||ye,me=ge.type;if(ye){if(me==="apiKey")ge.in==="query"&&(E.query[ge.name]=Ee),ge.in==="header"&&(E.headers[ge.name]=Ee),ge.in==="cookie"&&(E.cookies[ge.name]=Ee);else if(me==="http"){if(/^basic$/i.test(ge.scheme)){var Pe,Ge=Ee.username||"",je=Ee.password||"",He=qu()(Ot()(Pe="".concat(Ge,":")).call(Pe,je));E.headers.Authorization="Basic ".concat(He)}/^bearer$/i.test(ge.scheme)&&(E.headers.Authorization="Bearer ".concat(Ee))}else if(me==="oauth2"||me==="openIdConnect"){var Ne,Ve=ye.token||{},We=ge["x-tokenName"]||"access_token",Je=Ve[We],ze=Ve.token_type;(!ze||ze.toLowerCase()==="bearer")&&(ze="Bearer"),E.headers.Authorization=Ot()(Ne="".concat(ze," ")).call(Ne,Je)}}}})}),E)}function tf(t,r){var i=t.spec,a=t.operation,s=t.securities,p=t.requestContentType,y=t.responseContentType,E=t.attachContentTypeForEmptyPayload;if(r=rs({request:r,securities:s,operation:a,spec:i}),r.body||r.form||E){var w,A;if(p)r.headers["Content-Type"]=p;else if(Array.isArray(a.consumes)){var k=tn(a.consumes,1);r.headers["Content-Type"]=k[0]}else if(Array.isArray(i.consumes)){var G=tn(i.consumes,1);r.headers["Content-Type"]=G[0]}else a.parameters&&ln()(w=a.parameters).call(w,function(ge){return ge.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":a.parameters&&ln()(A=a.parameters).call(A,function(ge){return ge.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(p){var ne,re,se=a.parameters&&ln()(ne=a.parameters).call(ne,function(ge){return ge.in==="body"}).length>0,ye=a.parameters&&ln()(re=a.parameters).call(re,function(ge){return ge.in==="formData"}).length>0;(se||ye)&&(r.headers["Content-Type"]=p)}return!y&&Array.isArray(a.produces)&&a.produces.length>0&&(r.headers.accept=a.produces.join(", ")),r}function rs(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,E=ji()({},r),w=a.authorized,A=w===void 0?{}:w,k=a.specSecurity,G=k===void 0?[]:k,ne=p.security||G,re=A&&!!Qt()(A).length,se=y.securityDefinitions;return E.headers=E.headers||{},E.query=E.query||{},!Qt()(a).length||!re||!ne||Array.isArray(p.security)&&!p.security.length?r:(ne.forEach(function(ye){Qt()(ye).forEach(function(ge){var Ee=A[ge];if(!!Ee){var me=Ee.token,Pe=Ee.value||Ee,Ge=se[ge],je=Ge.type,He=Ge["x-tokenName"]||"access_token",Ne=me&&me[He],Ve=me&&me.token_type;if(Ee){if(je==="apiKey"){var We=Ge.in==="query"?"query":"headers";E[We]=E[We]||{},E[We][Ge.name]=Pe}else if(je==="basic")if(Pe.header)E.headers.authorization=Pe.header;else{var Je,ze=Pe.username||"",et=Pe.password||"";Pe.base64=qu()(Ot()(Je="".concat(ze,":")).call(Je,et)),E.headers.authorization="Basic ".concat(Pe.base64)}else if(je==="oauth2"&&Ne){var At;Ve=!Ve||Ve.toLowerCase()==="bearer"?"Bearer":Ve,E.headers.authorization=Ot()(At="".concat(Ve," ")).call(At,Ne)}}}})}),E)}var rf=function(r){return Array.isArray(r)?r:[]},Mc=il("OperationNotFoundError",function(r,i,a){this.originalError=a,rn()(this,i||{})}),Rc=function(r,i){return ln()(i).call(i,function(a){return a.name===r})},dr=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var a=[];return Qt()(i).forEach(function(s){Qt()(i[s]).forEach(function(p){a.push(i[s][p])})}),a},Lc={buildRequest:Ao};function gl(t){var r=t.http,i=t.fetch,a=t.spec,s=t.operationId,p=t.pathName,y=t.method,E=t.parameters,w=t.securities,A=Ec(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),k=r||i||Oi;p&&y&&!s&&(s=cl(p,y));var G=Lc.buildRequest(fr({spec:a,operationId:s,parameters:E,securities:w,http:k},A));return G.body&&(pl()(G.body)||hl()(G.body))&&(G.body=Ro()(G.body)),k(G)}function Ao(t){var r,i,a=t.spec,s=t.operationId,p=t.responseContentType,y=t.scheme,E=t.requestInterceptor,w=t.responseInterceptor,A=t.contextUrl,k=t.userFetch,G=t.server,ne=t.serverVariables,re=t.http,se=t.parameters,ye=t.parameterBuilders,ge=Hu(a);ye||(ge?ye=x:ye=aa);var Ee=re&&re.withCredentials?"include":"same-origin",me={url:"",credentials:Ee,headers:{},cookies:{}};E&&(me.requestInterceptor=E),w&&(me.responseInterceptor=w),k&&(me.userFetch=k);var Pe=Gu(a,s);if(!Pe)throw new Mc("Operation ".concat(s," not found"));var Ge=Pe.operation,je=Ge===void 0?{}:Ge,He=Pe.method,Ne=Pe.pathName;if(me.url+=sa({spec:a,scheme:y,contextUrl:A,server:G,serverVariables:ne,pathName:Ne,method:He}),!s)return delete me.cookies,me;me.url+=Ne,me.method="".concat(He).toUpperCase(),se=se||{};var Ve=a.paths[Ne]||{};p&&(me.headers.accept=p);var We=dr(Ot()(r=Ot()(i=[]).call(i,rf(je.parameters))).call(r,rf(Ve.parameters)));We.forEach(function(et){var At=ye[et.in],Nt;if(et.in==="body"&&et.schema&&et.schema.properties&&(Nt=se),Nt=et&&et.name&&se[et.name],typeof Nt=="undefined"){var Ht;Nt=et&&et.name&&se[Ot()(Ht="".concat(et.in,".")).call(Ht,et.name)]}else if(Rc(et.name,We).length>1){var or;console.warn(Ot()(or="Parameter '".concat(et.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(or,et.name,"' and the passed-in parameter values did not define an 'in' value."))}if(Nt!==null){if(typeof et.default!="undefined"&&typeof Nt=="undefined"&&(Nt=et.default),typeof Nt=="undefined"&&et.required&&!et.allowEmptyValue)throw new Error("Required parameter ".concat(et.name," is not provided"));if(ge&&et.schema&&et.schema.type==="object"&&typeof Nt=="string")try{Nt=JSON.parse(Nt)}catch(Mr){throw new Error("Could not parse object parameter value string as JSON")}At&&At({req:me,parameter:et,value:Nt,operation:je,spec:a})}});var Je=fr(fr({},t),{},{operation:je});if(ge?me=ef(Je,me):me=tf(Je,me),me.cookies&&Qt()(me.cookies).length){var ze=Qt()(me.cookies).reduce(function(et,At){var Nt=me.cookies[At],Ht=et?"&":"",or=oa.serialize(At,Nt);return et+Ht+or},"");me.headers.Cookie=ze}return me.cookies&&delete me.cookies,pu(me),me}var Cn=function(r){return r?r.replace(/\W/g,""):null};function sa(t){var r=Hu(t.spec);return r?yl(t):af(t)}function yl(t){var r=t.spec,i=t.pathName,a=t.method,s=t.server,p=t.contextUrl,y=t.serverVariables,E=y===void 0?{}:y,w=wo()(r,["paths",i,(a||"").toLowerCase(),"servers"])||wo()(r,["paths",i,"servers"])||wo()(r,["servers"]),A="",k=null;if(s&&w&&w.length){var G=qt()(w).call(w,function(se){return se.url});G.indexOf(s)>-1&&(A=s,k=w[G.indexOf(s)])}if(!A&&w&&w.length){A=w[0].url;var ne=tn(w,1);k=ne[0]}if(A.indexOf("{")>-1){var re=of(A);re.forEach(function(se){if(k.variables&&k.variables[se]){var ye=k.variables[se],ge=E[se]||ye.default,Ee=new RegExp("{".concat(se,"}"),"g");A=A.replace(Ee,ge)}})}return nf(A,p)}function nf(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Ei.parse(Ei.resolve(r,t)):Ei.parse(t),a=Ei.parse(r),s=Cn(i.protocol)||Cn(a.protocol)||"",p=i.host||a.host,y=i.pathname||"",E;if(s&&p){var w;E=Ot()(w="".concat(s,"://")).call(w,p+y)}else E=y;return E[E.length-1]==="/"?In()(E).call(E,0,-1):E}function of(t){for(var r=[],i=/{([^}]+)}/g,a;a=i.exec(t);)r.push(a[1]);return r}function af(t){var r=t.spec,i=t.scheme,a=t.contextUrl,s=a===void 0?"":a,p=Ei.parse(s),y=Array.isArray(r.schemes)?r.schemes[0]:null,E=i||y||Cn(p.protocol)||"http",w=r.host||p.host||"",A=r.basePath||"",k;if(E&&w){var G;k=Ot()(G="".concat(E,"://")).call(G,w+A)}else k=A;return k[k.length-1]==="/"?In()(k).call(k,0,-1):k}br.http=Oi,br.makeHttp=Ks.bind(null,br.http),br.resolve=$u,br.resolveSubtree=bc,br.execute=gl,br.serializeRes=cu,br.serializeHeaders=Gs,br.clearCache=dl,br.makeApisTagOperation=Ku,br.buildRequest=Ao,br.helpers={opId:pi},br.getBaseUrl=sa;function br(t){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"?i.url=t:i=t,!(this instanceof br))return new br(i);ji()(this,i);var a=this.resolve().then(function(){return r.disableInterfaces||ji()(r,br.makeApisTagOperation(r)),r});return a.client=this,a}br.prototype={http:Oi,execute:function(r){return this.applyDefaults(),br.execute(fr({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:typeof this.url=="string"?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},r))},resolve:function(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return br.resolve(fr({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},i)).then(function(a){return r.originalSpec=r.spec,r.spec=a.spec,r.errors=a.errors,r})}},br.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Vi()(i,"http")){var a=Ei.parse(i);r.host||(r.host=a.host),r.schemes||(r.schemes=[a.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var Dc=br.helpers;const Nc=br;var zt=o(25446),ml=o(11429),wt=o(76671),sf=o(7930),la=o(51027),On=o(78722),lf=o(17673),kn=o(64776),Bc=Object.defineProperty,Sr=Object.defineProperties,Uc=Object.getOwnPropertyDescriptors,uf=Object.getOwnPropertySymbols,jc=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,e=(t,r,i)=>r in t?Bc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,n=(t,r)=>{for(var i in r||(r={}))jc.call(r,i)&&e(t,i,r[i]);if(uf)for(var i of uf(r))ns.call(r,i)&&e(t,i,r[i]);return t},u=(t,r)=>Sr(t,Uc(r)),l=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});const f="/oauth2-redirect.html";class m{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:a,extraParams:s={},routingBasePath:p,redirectUri:y,successCallback:E,errorCallback:w}){const A=(0,kn.p8)({date:new Date().toString()}),k=new URL(r),G=p==="/"?"":p,ne=`${window.location.origin}${G}${f}`;k.searchParams.set("client_id",i),k.searchParams.set("redirect_uri",y||ne),k.searchParams.set("response_type","token"),k.searchParams.set("state",A),Array.isArray(a)&&k.searchParams.set("scope",a.join(" "));for(const re in s)k.searchParams.set(re,s[re]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:a},state:A,successCallback:re=>{E(re),m.clearRedirectData("implicit")},errorCallback:re=>{w(re),m.clearRedirectData("implicit")}},window.open(k.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:a,clientSecret:s,codeVerifier:p,codeChallenge:y,scopes:E,extraParams:w={},extraHeaders:A={},routingBasePath:k,redirectUri:G,successCallback:ne,errorCallback:re}){const se=new URL(r),ye=k==="/"?"":k,ge=`${window.location.origin}${ye}${f}`,Ee=(0,kn.p8)({date:new Date().toString()});se.searchParams.set("client_id",a),se.searchParams.set("redirect_uri",G||ge),se.searchParams.set("response_type","code"),se.searchParams.set("state",Ee),Array.isArray(E)&&se.searchParams.set("scope",E.join(" ")),y&&(se.searchParams.set("code_challenge",y),se.searchParams.set("code_challenge_method","S256"));for(const me in w)se.searchParams.set(me,w[me]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:a,scopes:E},state:Ee,successCallback:me=>l(this,[me],function*({auth_code:Pe}){try{const Ge=yield fetch(i,{method:"POST",headers:n({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},A),body:lf.stringify(n(u(n({client_id:a,client_secret:s},p&&{code_verifier:p}),{code:Pe,grant_type:"authorization_code",redirect_uri:G||ge}),w))});yield U(Ge,ne,re)}catch(Ge){re(Ge)}m.clearRedirectData("authorizationCode")}),errorCallback:me=>{re(me),m.clearRedirectData("authorizationCode")}},window.open(se.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return l(this,arguments,function*({tokenUrl:i,clientId:a,clientSecret:s,scopes:p=[],extraParams:y={},extraHeaders:E={},successCallback:w,errorCallback:A}){try{const k=yield fetch(i,{method:"POST",headers:n({"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},E),body:lf.stringify(n({client_id:a,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(p)?p.join(" "):void 0},y))});yield U(k,w,A)}catch(k){A(k)}})}}const F=new m;function U(t,r,i){return l(this,null,function*(){if(t.ok){const a=yield t.json();r(a)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function H(t){return l(this,null,function*(){return(0,kn.rS)(yield(0,kn.JQ)(t))})}var Z=o(68929),be;(function(t){t.STRING="string",t.ARRAY="array",t.OBJECT="object"})(be||(be={}));var Ce;(function(t){t.BYTE="byte",t.BASE64="base64",t.BINARY="binary"})(Ce||(Ce={}));var De=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});const ke=Object.values(Ce),Ye=["application/octet-stream","application/pdf","application/gzip","application/zip"],tt=["image/","audio/","video/"];function at(t){if(tt.some(r=>t.startsWith(r)))return t}function ct(t){return Ye.includes(t)?!0:tt.some(r=>t.startsWith(r))}function gt(t){const r=t.type==="array"?t.items:t;if(!r||!r.type||(r==null?void 0:r.type)==="any")return!0;const i=r.contentMediaType||"",a=r.format||r.contentEncoding||(ct(i)?"binary":"");return r.type===be.STRING&&ke.includes(a)}function dt(t,r){if(!t||!t.type||t.type==="any")return ct(r);const i=t.format||t.contentEncoding||"";return t.type===be.STRING&&ke.includes(i)}function xt(t){return new Promise((r,i)=>{const a=new FileReader;a.onload=()=>{const p=a.result.replace(/data:.*\/.*;base64,/g,"");r(p)},a.onerror=()=>i(a.error),a.readAsDataURL(t)})}function Ft({format:t,contentEncoding:r,contentMediaType:i}){return[t,r,i].includes(Ce.BASE64)}function It(t,r){return De(this,null,function*(){const i=Object.values(t);let a=i.length===1?i[0]:i;return r.type===be.STRING&&Ft(r)?a=yield xt(i[0]):r.type===be.ARRAY&&r.items&&(Ft(r.items)?a=yield Promise.all(i.map(p=>De(this,null,function*(){return yield xt(p)}))):a=i),a})}var it=o(39713),Gt=o(23485),hr=o(21096),vr=Object.defineProperty,bn=Object.defineProperties,fn=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,Fr=(t,r,i)=>r in t?vr(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,gr=(t,r)=>{for(var i in r||(r={}))cn.call(r,i)&&Fr(t,i,r[i]);if(Ar)for(var i of Ar(r))Kr.call(r,i)&&Fr(t,i,r[i]);return t},yr=(t,r)=>bn(t,fn(r));const nn=Gt.iv`
|
|
93
93
|
border: none;
|
|
94
94
|
outline: none;
|
|
95
95
|
padding: 8px;
|
|
@@ -124,7 +124,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
124
124
|
cursor: pointer;
|
|
125
125
|
text-align: center;
|
|
126
126
|
${({theme:t})=>(0,Gt.QG)({color:t.rightPanel.textColor})}
|
|
127
|
-
`;function Vr(t,r){const{fullWidth:i,errorMessage:a,type:s}=t,[p,y]=d.useState(s==="password"),E=d.useCallback(()=>{y(!p)},[p]);return d.createElement(no,{fullWidth:i,type:s},d.createElement(Mi,null,d.createElement(Qr,yr(gr({},t),{type:p?"password":"text",inputType:s,ref:r})),t.inputActionButton?d.createElement($n,{onClick:t.inputActionButton.onClick},t.inputActionButton.label):s==="password"?d.createElement($n,{onClick:E},p?"show":"hide"):null),a?d.createElement(it.Xq,null,a):null)}const io=d.forwardRef(Vr);function Er(t){const r=Tn(gr({fieldType:"text"},t)),{userProps:i,render:a,fieldState:s}=r,p=r.informed;return a(d.createElement(io,yr(gr(gr({},i),p),{errorMessage:s.error})))}const Kn=Gr(({initValue:t,options:r,fieldApi:i,fieldState:a})=>{const s=r.map((A,k)=>({value:A.title||A.value,idx:k,origValue:A.value})),p=s.find(A=>A.origValue===t),[y,E]=d.useState(p==null?void 0:p.value);d.useEffect(()=>{t&&i.setValue(t)},[]);const w=d.useCallback(A=>{i.setValue(s[A.idx].origValue),E(s[A.idx].value)},[s]);return d.createElement(no,{fullWidth:!0},d.createElement(hr.Dropdown,{fullWidth:!0,variant:"dark",value:y,options:s,onChange:w}),a.error?d.createElement(it.Xq,null,a.error):null)}),on=t=>{(0,d.useEffect)(()=>{t()},[])},ua=t=>{useEffect(()=>()=>{t()},[])},
|
|
127
|
+
`;function Vr(t,r){const{fullWidth:i,errorMessage:a,type:s}=t,[p,y]=d.useState(s==="password"),E=d.useCallback(()=>{y(!p)},[p]);return d.createElement(no,{fullWidth:i,type:s},d.createElement(Mi,null,d.createElement(Qr,yr(gr({},t),{type:p?"password":"text",inputType:s,ref:r})),t.inputActionButton?d.createElement($n,{onClick:t.inputActionButton.onClick},t.inputActionButton.label):s==="password"?d.createElement($n,{onClick:E},p?"show":"hide"):null),a?d.createElement(it.Xq,null,a):null)}const io=d.forwardRef(Vr);function Er(t){const r=Tn(gr({fieldType:"text"},t)),{userProps:i,render:a,fieldState:s}=r,p=r.informed;return a(d.createElement(io,yr(gr(gr({},i),p),{errorMessage:s.error})))}const Kn=Gr(({initValue:t,options:r,fieldApi:i,fieldState:a})=>{const s=r.map((A,k)=>({value:A.title||A.value,idx:k,origValue:A.value})),p=s.find(A=>A.origValue===t),[y,E]=d.useState(p==null?void 0:p.value);d.useEffect(()=>{t&&i.setValue(t)},[]);const w=d.useCallback(A=>{i.setValue(s[A.idx].origValue),E(s[A.idx].value)},[s]);return d.createElement(no,{fullWidth:!0},d.createElement(hr.Dropdown,{fullWidth:!0,variant:"dark",value:y,options:s,onChange:w}),a.error?d.createElement(it.Xq,null,a.error):null)}),on=t=>{(0,d.useEffect)(()=>{t()},[])},ua=t=>{useEffect(()=>()=>{t()},[])},Uh=Gr(({initValue:t,paramEnum:r,fieldApi:i})=>{const[a,s]=d.useState(),p=r.map((w,A)=>({idx:A,value:w})),y=w=>{i.setValue(w.value),s(w.value)};on(()=>{if(!!t)if(Array.isArray(t)){const w=t.length?t[0]:"";s(w),i.setValue(w)}else s(t),i.setValue(t)});const E=()=>{i.setValue(""),s("")};return d.createElement(hr.Dropdown,{clearable:!0,fullWidth:!0,variant:"dark",value:a,options:p,handleClear:E,onChange:y})});var Ld=o(29163);const jh=({name:t,param:r,place:i,renderParameter:a})=>{var s,p,y,E,w;const[A,k]=d.useState([]),G=()=>{k([...A,A.length?A[A.length-1]+1:0])},ne=se=>{k(A.filter(ye=>ye!==se))},re=((s=r.schema.items)==null?void 0:s.fields)?(p=r.schema.items)==null?void 0:p.fields:[{schema:((y=r.schema.items)==null?void 0:y.schema)||r.schema.items,name:"",required:r.required,description:(E=r.schema.items)==null?void 0:E.description,externalDocs:(w=r.schema.items)==null?void 0:w.externalDocs,deprecated:!1,toggle:()=>null,expanded:!1}];return d.createElement(d.Fragment,null,d.createElement(Dd,null,d.createElement(it.lX,{required:r.required},t,"(",A.length," items)"),d.createElement("span",{onClick:G},"Add item +")),A==null?void 0:A.map((se,ye)=>d.createElement(Dd,{key:se},d.createElement(Vh,{onClick:()=>ne(se)},"delete"),re.map(ge=>a(ge,i,`${t}.[${se}]`,`[${ye}]${ge.name&&"."+ge.name}`)))))},Dd=Ld.default.div`
|
|
128
128
|
display: flex;
|
|
129
129
|
width: 100%;
|
|
130
130
|
align-items: center;
|
|
@@ -145,12 +145,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
145
145
|
color: #fff;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
`,
|
|
148
|
+
`,Vh=Ld.default.span`
|
|
149
149
|
background: transparent;
|
|
150
150
|
border: none;
|
|
151
151
|
cursor: pointer;
|
|
152
152
|
position: relative;
|
|
153
|
-
`;var is;(function(t){t.ARRAY="array",t.OBJECT="object"})(is||(is={}));function
|
|
153
|
+
`;var is;(function(t){t.ARRAY="array",t.OBJECT="object"})(is||(is={}));function Wh({schema:t,example:r}){return`(${t.type})`+(r?` ${r}`:"")}function Hh(t){const r={};return t.forEach(i=>{i.in&&(r[i.in]||(r[i.in]=[]),r[i.in].push(i))}),r}function zh({schema:t,required:r}){return i=>{if(r&&!i)return"Field is required";if(r&&t.type===is.ARRAY&&Array.isArray(i)){if(i.length>(t.rawSchema&&t.rawSchema.maxItems||1/0))return`Too many items selected, maximum ${t.rawSchema.maxItems}`;if(i.length<(t.rawSchema&&t.rawSchema.minItems||0)){const a=t.rawSchema.minItems;return`You should select at least ${a===1?`${a} item`:`${a} items`}`}}}}function Gh(t){if(t.type===is.ARRAY){const r=t.default||t.example;if(!r&&typeof t.rawSchema.items!="boolean"&&Array.isArray(t.rawSchema.items)){if(t.rawSchema.items[0].default)return[t.rawSchema.items[0].default];if(t.rawSchema.items[0].example)return[t.rawSchema.items[0].example]}if(!r&&typeof t.rawSchema.items!="boolean"&&!Array.isArray(t.rawSchema.items)&&(0,wt.isObject)(t.rawSchema.items)){if(t.rawSchema.items.default)return[t.rawSchema.items.default];if(t.rawSchema.items.example)return[t.rawSchema.items.example]}return r||[]}else return(Number.isInteger(t.default)?t.default.toString():t.default)||t.example}function $h({oneOfType:t}){return t}const Kh=["path","query","cookie","header"];function Yh({id:t,param:r,values:i}){const a=(0,d.useMemo)(()=>zh(r),[r]),s=Array.isArray(r.schema.enum)&&r.schema.enum.length?r.schema.enum:void 0,p=Gh(r.schema),y=t.split(".").map(E=>(0,zt.dw)(E));return s?d.createElement(it.NI,null,d.createElement(Uh,{initValue:p,paramEnum:s,field:t})):d.createElement(Er,{fullWidth:!0,"data-cy":"parameter-input",id:t,field:t,placeholder:Wh(r),validate:a,initialValue:p||(0,zt.U2)(i,y),validateOnBlur:!0,validateOnChange:!0})}function Jh({values:t,operation:r}){const i=(0,d.useMemo)(()=>Hh(r.parameters||[]),[r]),a=(p,y,E,w)=>{var A;const k=E?(0,zt.s1)(E,p.name):p.name,G=$h(p.schema),ne=E?[y,E]:[p.in],re=(0,zt.s1)(...ne,(0,zt.A8)(p.name));return G&&console.warn(`Unsupported parameter definition: "${G}"`),p.schema.type===is.ARRAY?d.createElement(jh,{key:re,name:k,param:p,place:y,renderParameter:a}):p.schema.type===is.OBJECT?(A=p.schema.fields)==null?void 0:A.map(se=>a(se,y,k)):d.createElement(it.NI,{key:re},d.createElement(it.lX,{required:p.required},w||k,":"),G?d.createElement(it.GE,null,"Unsupported field schema definition"):d.createElement(Yh,{id:re,param:p,values:t}))},s=p=>{const y=i[p];return!y||!y.length?null:d.createElement(d.Fragment,{key:p},d.createElement(it.NI,null,d.createElement(it.iG,null," # ",p," parameters "),d.createElement("span",null,"\xA0")),y.map(E=>a(E,p)))};return d.createElement(it.iA,null,Kh.map(s))}var kr=o(7241),Xh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});function Qh(t){return Xh(this,null,function*(){return(yield fetch(t)).json()})}const Zh=wt.styled.div`
|
|
154
154
|
position: relative;
|
|
155
155
|
height: 4px;
|
|
156
156
|
display: block;
|
|
@@ -252,7 +252,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
252
252
|
right: -8%;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
`,Nd=()=>d.createElement(
|
|
255
|
+
`,Nd=()=>d.createElement(Zh,null,d.createElement("div",{className:"indeterminate"}));var _h=Object.defineProperty,qh=Object.defineProperties,ev=Object.getOwnPropertyDescriptors,Bd=Object.getOwnPropertySymbols,tv=Object.prototype.hasOwnProperty,rv=Object.prototype.propertyIsEnumerable,Ud=(t,r,i)=>r in t?_h(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,nv=(t,r)=>{for(var i in r||(r={}))tv.call(r,i)&&Ud(t,i,r[i]);if(Bd)for(var i of Bd(r))rv.call(r,i)&&Ud(t,i,r[i]);return t},iv=(t,r)=>qh(t,ev(r));const ov=Gt.ZP.input`
|
|
256
256
|
cursor: pointer;
|
|
257
257
|
margin-left: 0;
|
|
258
258
|
margin-right: 5px;
|
|
@@ -261,7 +261,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
261
261
|
align-self: baseline;
|
|
262
262
|
margin-top: 0;
|
|
263
263
|
margin-bottom: 0;
|
|
264
|
-
`,
|
|
264
|
+
`,av=Gt.ZP.label`
|
|
265
265
|
display: inline-block;
|
|
266
266
|
cursor: pointer;
|
|
267
267
|
vertical-align: middle;
|
|
@@ -271,7 +271,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
271
271
|
|
|
272
272
|
overflow-wrap: break-word;
|
|
273
273
|
line-height: 20px;
|
|
274
|
-
`,
|
|
274
|
+
`,sv=Gt.ZP.div`
|
|
275
275
|
width: ${({fullWidth:t})=>t?"100%":"50%"};
|
|
276
276
|
display: inline-flex;
|
|
277
277
|
align-items: center;
|
|
@@ -285,33 +285,33 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
285
285
|
margin-top: 5px;
|
|
286
286
|
}
|
|
287
287
|
`}
|
|
288
|
-
`;function
|
|
288
|
+
`;function lv(t,r){const{fullWidth:i,id:a,label:s,nowrap:p}=t;return d.createElement(sv,{fullWidth:i,nowrap:p},d.createElement(ov,iv(nv({},t),{type:"checkbox",ref:r})),d.createElement(av,{htmlFor:a},s))}const jd=d.forwardRef(lv);var fa=o(24177),xl=o(43398),uv=Object.defineProperty,fv=(t,r,i)=>r in t?uv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,cv=(t,r,i)=>(fv(t,typeof r!="symbol"?r+"":r,i),i);const dv=11;class pv extends d.Component{constructor(){super(...arguments);cv(this,"state",{collapsed:!0})}onCheckBoxClick(r){const i=r.target.value,a=r.target.checked;this.props.fieldApi.setTouched(!0);const s=this.props.fieldApi.getValue()||[];let p;if(a)p=[...s,i];else{const y=s.indexOf(i);p=[...s.slice(0,y),...s.slice(y+1)]}this.props.fieldApi.setValue(p)}isFieldChecked(r){return this.props.fieldApi.getValue().includes(r)}toggle(){this.setState({collapsed:!this.state.collapsed})}selectAll(){this.props.fieldApi.setValue(this.props.items)}clearAll(){this.props.fieldApi.setValue([])}render(){const{items:r,fieldApi:i,validateOnChange:a,maxDisplayedItems:s,showControls:p,trimItemsLength:y}=this.props,{collapsed:E}=this.state,w=i.getError(),A=s||dv,k=y&&this.state.collapsed?r.slice(0,A):r;return d.createElement("div",null,p?d.createElement(vv,null,d.createElement(xl.J4,{onClick:()=>{this.selectAll()}},"Select all"),d.createElement(xl.J4,{onClick:()=>{this.clearAll()}},"Clear")):null,d.createElement("div",null,k.map(G=>d.createElement(jd,{fullWidth:!0,id:G,value:G,checked:this.isFieldChecked(G),label:G,key:G,onChange:ne=>{this.onCheckBoxClick(ne),a&&i.validate()}})),r.length>A&&y?d.createElement(gv,{onClick:()=>{this.toggle()}},E?"Show all":"Collapse"):null),w?d.createElement(it.Xq,null,w):"")}}const hv=Gr(pv),vv=(0,wt.styled)(xl.xp)`
|
|
289
289
|
opacity: 1;
|
|
290
290
|
text-align: left;
|
|
291
|
-
`,
|
|
291
|
+
`,gv=(0,wt.styled)(xl.J4)`
|
|
292
292
|
float: right;
|
|
293
|
-
`;function Vd(t){const{scopes:r,id:i}=t;let a=[];try{a=JSON.parse((0,zt.YQ)(`auth.${i}.scopes`))}catch(s){}return!r||!r.length?d.createElement(d.Fragment,null):d.createElement(it.NI,null,d.createElement(it.lX,null," Scopes: "),d.createElement(
|
|
293
|
+
`;function Vd(t){const{scopes:r,id:i}=t;let a=[];try{a=JSON.parse((0,zt.YQ)(`auth.${i}.scopes`))}catch(s){}return!r||!r.length?d.createElement(d.Fragment,null):d.createElement(it.NI,null,d.createElement(it.lX,null," Scopes: "),d.createElement(hv,{field:`auth.${i}.scopes`,initialValue:a,items:r,showControls:!0,trimItemsLength:!0}))}var yv=Object.defineProperty,mv=Object.defineProperties,xv=Object.getOwnPropertyDescriptors,Wd=Object.getOwnPropertySymbols,bv=Object.prototype.hasOwnProperty,wv=Object.prototype.propertyIsEnumerable,Vc=(t,r,i)=>r in t?yv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,cf=(t,r)=>{for(var i in r||(r={}))bv.call(r,i)&&Vc(t,i,r[i]);if(Wd)for(var i of Wd(r))wv.call(r,i)&&Vc(t,i,r[i]);return t},Wc=(t,r)=>mv(t,xv(r)),bl=(t,r,i)=>(Vc(t,typeof r!="symbol"?r+"":r,i),i),Sv=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});function Av(t){if(!t)return"Field is required"}class wl extends d.Component{constructor(){super(...arguments);bl(this,"state",{error:null,loading:!1,showPkceOptions:!1}),bl(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,"")}),bl(this,"togglePkceOptions",()=>{this.setState(({showPkceOptions:r})=>({showPkceOptions:!r}))}),bl(this,"handleCodeVerifierChange",r=>Sv(this,[r],function*({target:{value:i}}){const a=yield H(i);this.setState({codeVerifier:i,validCodeChallenge:a})}))}get values(){var r,i;return((i=(r=this.props.form.values)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get pkceInputActionButtonProps(){if(this.state.codeVerifier!==void 0&&this.state.codeChallenge!==this.state.validCodeChallenge)return{label:"sync",onClick:()=>{this.state.codeVerifier&&this.setState({codeChallenge:this.state.validCodeChallenge})}}}componentDidMount(){if(this.props.usePkce){const r=(0,kn.CY)(43);H(r).then(i=>{this.setState({codeVerifier:r,codeChallenge:i,validCodeChallenge:i})})}}handleAuthorize(r){if(!r)return;this.props.formApi.validate();const{flow:i,usePkce:a,id:s,tokenUrl:p,authCorsProxyUrl:y,tokenEndpointAuthMethod:E}=this.props;if(!(0,kn.Qr)(this.errors))return;this.setState({loading:!0,error:null});const w=y?y+(0,kr.jg)(r):r,A=y&&p?y+(0,kr.jg)(p):p,k=this.props.formApi.getValue(`auth.${s}.scopes`),G={authorizationUrl:w.startsWith("http")?w:this.props.server+w,clientId:this.values.client_id,scopes:k,redirectUri:this.context.oAuth2RedirectURI,routingBasePath:this.context.routingBasePath,successCallback:ne=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,ne),this.setState({loading:!1,error:null})},errorCallback:ne=>{this.setState({loading:!1,error:(ne==null?void 0:ne.message)||"Failed to retrieve the access token"})}};if(i==="implicit"&&m.authorizeImplicit(G),!(0,kr.xl)(E)){console.log(`Unsupported token endpoint auth method: ${E}`);return}i==="authorizationCode"&&m.authorizeAuthorizationCode(cf(Wc(cf({},G),{tokenUrl:(A==null?void 0:A.startsWith("http"))?A:this.props.server+A,clientSecret:this.values.client_secret,extraHeaders:(0,kr.Or)({authMethod:E,clientId:this.values.client_id,clientSecret:this.values.client_secret})}),a&&{codeVerifier:this.state.codeVerifier,codeChallenge:this.state.codeChallenge}))}handleLogout(){this.clearToken(),this.setState({error:null})}handleCancel(){this.setState({loading:!1,error:null}),m.clearRedirectData(this.props.flow)}render(){const{error:r,loading:i}=this.state,{id:a,scopes:s,authorizationUrl:p,flow:y,usePkce:E,defaultValues:w}=this.props;if(!p)return d.createElement(it.Xq,null,"No flow info");let A=(0,zt.YQ)(`auth.${a}.token`)||JSON.stringify(w==null?void 0:w.token);A=A?JSON.parse(A):"";const k=(0,zt.Al)(a,"client_id"),G={field:`auth.${a}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),initValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),placeholder:"Your OAuth2 app Client ID",validate:Av,validateOnBlur:!0,validateOnChange:!0};return d.createElement("div",null,d.createElement(it.n5,null,d.createElement(it.NI,null,d.createElement(it.lX,null," Client ID: "),k?d.createElement(Kn,Wc(cf({},G),{options:k})):d.createElement(Er,Wc(cf({},G),{"data-cy":"client-id-input"}))),y==="authorizationCode"&&d.createElement(d.Fragment,null,(!(E==null?void 0:E.hideClientSecretInput)||!E)&&d.createElement(it.NI,null,d.createElement(it.lX,null,"Client Secret:"),d.createElement(Er,{type:"password",fullWidth:!0,field:`auth.${a}.client_secret`,initialValue:(0,zt.YQ)(`auth.${a}.client_secret`)||(w==null?void 0:w.client_secret),validateOnBlur:!0,validateOnChange:!0,"data-cy":"client-secret-input"})),E&&!E.disableManualConfiguration&&d.createElement(Ov,null,d.createElement(jd,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:this.state.showPkceOptions,onChange:this.togglePkceOptions,"data-cy":"pkce-options-toggle"}),this.state.showPkceOptions&&d.createElement(Tv,null,d.createElement(it.NI,null,d.createElement(it.lX,null,"Code Verifier"),d.createElement(io,{fullWidth:!0,value:this.state.codeVerifier,onChange:this.handleCodeVerifierChange,"data-cy":"code-verifier-input"})),d.createElement(it.NI,null,d.createElement(it.lX,null,"Code Challenge"),d.createElement(io,{fullWidth:!0,value:this.state.codeChallenge,onChange:({target:{value:ne}})=>{this.setState({codeChallenge:ne})},inputActionButton:this.pkceInputActionButtonProps,"data-cy":"code-challenge-input"}))))),d.createElement(Er,{fullWidth:!0,field:`auth.${a}.token`,type:"hidden",initialValue:A}),d.createElement(Vd,{id:a,scopes:s}),this.values.token&&this.values.token.access_token?d.createElement(it.NI,null,d.createElement(it.lX,null," Access Token: "),d.createElement(io,{disabled:!0,type:"password",fullWidth:!0,value:this.values.token.access_token})):null),d.createElement(Cv,null,this.values.token&&this.values.token.access_token?d.createElement(fa.zx,{fullWidth:!0,onClick:()=>{this.handleLogout()}},"Log out"):i?d.createElement(d.Fragment,null,d.createElement(fa.zx,{fullWidth:!0,onClick:()=>{this.handleCancel()}},"Cancel"),d.createElement(Nd,null)):d.createElement(fa.zx,{fullWidth:!0,disabled:!(0,kn.Qr)(this.errors),onClick:()=>{this.handleAuthorize(p)}},"Authorize")),i||r||!this.values.token||!this.values.token.access_token&&d.createElement(it.n5,null,d.createElement(it.NI,null,i?d.createElement(it.GE,null,"Please, finish your authorization flow or cancel authorization."):r?d.createElement(d.Fragment,null,d.createElement(Ev,null,d.createElement(it.Xq,null,r))):!this.values.token||!this.values.token.access_token?d.createElement(it.GE,null," No Access Token. Please, Authorize. "):null)))}}bl(wl,"contextType",wt.OptionsContext);const Ev=wt.styled.div`
|
|
294
294
|
font-family: monospace;
|
|
295
295
|
margin-top: 10px;
|
|
296
296
|
line-height: 1;
|
|
297
297
|
padding-left: 10px;
|
|
298
298
|
border-left: 1px solid gray;
|
|
299
|
-
`,Ev=wt.styled.div`
|
|
300
|
-
margin-bottom: 15px;
|
|
301
299
|
`,Cv=wt.styled.div`
|
|
302
|
-
|
|
300
|
+
margin-bottom: 15px;
|
|
303
301
|
`,Ov=wt.styled.div`
|
|
302
|
+
padding: 8px 0 20px;
|
|
303
|
+
`,Tv=wt.styled.div`
|
|
304
304
|
padding: 4px 0;
|
|
305
|
-
`;var
|
|
305
|
+
`;var Pv=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});function Iv(t){var r,i;const{scheme:a,defaultValues:s}=t,[p,y]=d.useState({}),[E,w]=d.useState(),[A,k]=d.useState(!1);d.useEffect(()=>{G(a.openIdConnectUrl)},[a.openIdConnectUrl]);const G=se=>Pv(this,null,function*(){k(!0),w("");try{const ye=yield Qh(se);y(ye)}catch(ye){w(ye.message)}k(!1)}),ne=d.useCallback(()=>A?d.createElement("div",null,d.createElement("div",null,d.createElement("div",null,"Fetching OpenID Connect metadata..."),d.createElement(Nd,null))):null,[A]),re=d.useCallback(()=>E?d.createElement("div",null,d.createElement("div",null,d.createElement(it.Xq,null,E))):null,[E]);return A?d.createElement(ne,null):E?d.createElement(re,null):d.createElement("div",null,d.createElement("div",null,((r=p==null?void 0:p.response_types_supported)==null?void 0:r.includes("token"))?d.createElement(d.Fragment,null,d.createElement(Hd,null,"OAuth2 Implicit Flow"),d.createElement(wl,{key:t.id,authorizationUrl:p.authorization_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:p.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,flow:"implicit",defaultValues:s})):((i=p==null?void 0:p.response_types_supported)==null?void 0:i.includes("code"))?d.createElement(d.Fragment,null,d.createElement(Hd,null,"OAuth2 Authorization Flow"),d.createElement(wl,{key:t.id,authorizationUrl:p.authorization_endpoint,tokenUrl:p.token_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:p.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,tokenEndpointAuthMethod:p==null?void 0:p.token_endpoint_auth_methods_supported,flow:"authorizationCode",defaultValues:s})):d.createElement("div",null,"Unsupported flow")))}const Hd=wt.styled.div`
|
|
306
306
|
margin-top: 5px;
|
|
307
307
|
margin-bottom: 10px;
|
|
308
|
-
`;var Fv=Object.defineProperty,kv=Object.defineProperties,Mv=Object.getOwnPropertyDescriptors,Hd=Object.getOwnPropertySymbols,Rv=Object.prototype.hasOwnProperty,Lv=Object.prototype.propertyIsEnumerable,Hc=(t,r,i)=>r in t?Fv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,zd=(t,r)=>{for(var i in r||(r={}))Rv.call(r,i)&&Hc(t,i,r[i]);if(Hd)for(var i of Hd(r))Lv.call(r,i)&&Hc(t,i,r[i]);return t},Gd=(t,r)=>kv(t,Mv(r)),df=(t,r,i)=>(Hc(t,typeof r!="symbol"?r+"":r,i),i),Dv=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});function Nv(t){if(!t)return"Token is required"}class Bv extends d.Component{constructor(){super(...arguments);df(this,"state",{error:"",loading:!1,tokenMasked:!0}),df(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,""),(0,zt.WW)(`auth.${this.props.id}.token`,"")}),df(this,"toggleTokenMask",()=>{this.setState({tokenMasked:!this.state.tokenMasked})}),df(this,"requestToken",()=>Dv(this,null,function*(){if(this.state.loading)return;const{server:r,flow:i,authCorsProxyUrl:a}=this.props,s=a&&i.tokenUrl?a+(0,kr.jg)(i.tokenUrl):i.tokenUrl;if(this.errors.client_id||this.errors.client_secret){console.log("Provide client_id and client_secret");return}const p=this.values.client_id,y=this.values.client_secret;if(!p||!y){console.log("Provide client_id and client_secret");return}this.setState({loading:!0});const E=i["x-tokenEndpointAuthMethod"];if(!(0,kr.xl)(E)){console.log(`Unsupported token endpoint auth method: ${E}`);return}yield m.authorizeClientCredentials({tokenUrl:s.startsWith("http")?s:r+s,clientId:p,clientSecret:y,scopes:this.values.scopes,extraHeaders:(0,kr.Or)({authMethod:E,clientId:p,clientSecret:y}),successCallback:w=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,w),this.setState({loading:!1})},errorCallback:w=>{this.clearToken(),this.setState({error:w.message,loading:!1})}})}))}get values(){var r,i,a;return((a=(i=(r=this.props.form)==null?void 0:r.values)==null?void 0:i.auth)==null?void 0:a[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}render(){const{loading:r,error:i,tokenMasked:a}=this.state,{id:s,defaultValues:p}=this.props,y=Object.keys(this.props.flow.scopes);let E=(0,zt.YQ)(`auth.${s}.token`)||JSON.stringify(p==null?void 0:p.token);E=E?JSON.parse(E):"";const w=(0,zt.Al)(s,"client_id"),A={field:`auth.${s}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),initValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),placeholder:"Your OAuth2 app Client ID"};return d.createElement(d.Fragment,null,d.createElement(it.n5,null,d.createElement(it.NI,null,d.createElement(it.lX,null,"Client ID:"),w?d.createElement(Kn,Gd(zd({},A),{options:w})):d.createElement(Er,Gd(zd({},A),{type:"password"}))),d.createElement(it.NI,null,d.createElement(it.lX,null,"Client Secret:"),d.createElement(Er,{type:"password",fullWidth:!0,field:`auth.${s}.client_secret`,initialValue:(0,zt.YQ)(`auth.${s}.client_secret`)||(p==null?void 0:p.client_secret)})),d.createElement(Er,{fullWidth:!0,field:`auth.${s}.token`,type:"hidden",initialValue:E,validate:Nv}),d.createElement(Vd,{id:s,scopes:y})),d.createElement(fa.zx,{color:"primary",onClick:this.requestToken,blinking:r},r?"Loading...":"Request Token"),d.createElement(it.ph,null," Access Token "),i?d.createElement(it.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",d.createElement("pre",null,i)," "):this.values.token&&this.values.token.access_token?d.createElement(it.TR,null,d.createElement(it.WA,{length:this.values.token.access_token.length,masked:a},this.values.token.access_token),d.createElement(it.lf,{onClick:this.toggleTokenMask},a?"Show":"Hide"," "),d.createElement(it.h,{onClick:this.clearToken}," Clear ")):d.createElement(it.Xq,{style:{marginBottom:"1em"}},"No token"))}}const Uv=Bv;var jv=Object.defineProperty,Vv=Object.defineProperties,Wv=Object.getOwnPropertyDescriptors,$d=Object.getOwnPropertySymbols,Hv=Object.prototype.hasOwnProperty,zv=Object.prototype.propertyIsEnumerable,zc=(t,r,i)=>r in t?jv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,os=(t,r)=>{for(var i in r||(r={}))Hv.call(r,i)&&zc(t,i,r[i]);if($d)for(var i of $d(r))zv.call(r,i)&&zc(t,i,r[i]);return t},wl=(t,r)=>Vv(t,Wv(r)),Kd=(t,r,i)=>(zc(t,typeof r!="symbol"?r+"":r,i),i);function Sl(t){if(!t)return"Field is required"}const Gv=function(t){const r=document.cookie.match("\\b"+t+"=([^;]*)\\b");return r?r[1]:void 0};function Yd(t){if(t.in==="cookie")return Gv(t.name)}class $v extends d.Component{constructor(){super(...arguments);Kd(this,"state",{activeScheme:0}),Kd(this,"handleSchemeChange",r=>{this.setState({activeScheme:r.idx}),(0,zt.WW)("securityRequirementName",r.value)})}static getDerivedStateFromProps(r){const a=r.operation.security.map(y=>y.schemes.map(E=>E.id).join(" and ")),s=(0,zt.YQ)("securityRequirementName"),p=a.findIndex(y=>y===s);return{activeScheme:p<0?0:p}}render(){const{securityDefaults:r}=this.props,{activeScheme:i}=this.state,a=this.props.operation.security,p=a.map(y=>y.schemes.map(E=>E.id).join(" and ")).map((y,E)=>({value:y,idx:E}));return p.length===0?null:d.createElement(d.Fragment,null,d.createElement(it.n5,null,p.length>1&&d.createElement(it.NI,null,d.createElement(it.lX,null," Security scheme: "),d.createElement(hr.Dropdown,{variant:"dark",fullWidth:!0,options:p,value:p[i].value,onChange:this.handleSchemeChange}))||null,a[i].schemes.map(y=>{var E,w,A,k,G,ne,re;const se=(0,zt.A8)(y.id);if(y.type==="apiKey"){const ye=(0,zt.Al)(se,""),ge={field:`auth.${se}`,fullWidth:!0,initialValue:Yd(y)||(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),initValue:Yd(y)||(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),validate:Sl,validateOnBlur:!0,validateOnChange:!0};return d.createElement(it.NI,{key:se},d.createElement(it.lX,null," ",y.name,": "),ye?d.createElement(Kn,wl(os({},ge),{options:ye})):d.createElement(Er,wl(os({},ge),{type:"password","data-cy":"apiKey-auth-password"})))}else if(y.type==="http"){if(y.scheme==="basic"){const ye=(0,zt.Al)(se,"username"),ge={field:`auth.${se}.username`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${se}.username`)||((E=r==null?void 0:r[se])==null?void 0:E.username),initValue:(0,zt.YQ)(`auth.${se}.username`)||((w=r==null?void 0:r[se])==null?void 0:w.username),validate:Sl,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:se},d.createElement(it.NI,null,d.createElement(it.lX,null," ",(0,la.l)("tryItAuthBasicUsername"),": "),ye?d.createElement(Kn,wl(os({},ge),{options:ye})):d.createElement(Er,os({},ge))),d.createElement(it.NI,null,d.createElement(it.lX,null," ",(0,la.l)("tryItAuthBasicPassword"),": "),d.createElement(Er,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${se}.password`,initialValue:(0,zt.YQ)(`auth.${se}.password`)||((A=r==null?void 0:r[se])==null?void 0:A.password)||"",validateOnBlur:!0,validateOnChange:!0})))}else if(y.scheme==="bearer"){const ye=(0,zt.Al)(se,""),ge={field:`auth.${se}`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),initValue:(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),validate:Sl,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:se},d.createElement(it.NI,null,d.createElement(it.lX,null," Bearer Token: "),ye?d.createElement(Kn,wl(os({},ge),{options:ye})):d.createElement(Er,wl(os({},ge),{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if(y.type==="oauth2"&&y.flows&&y.flows.clientCredentials)return d.createElement(Uv,{key:se,flow:y.flows.clientCredentials,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:se,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.clientCredentials["x-defaultClientId"]||y["x-defaultClientId"],defaultValues:r==null?void 0:r[se]});if(y.type==="oauth2"&&y.flows&&y.flows.implicit)return d.createElement(cf,{key:se,authorizationUrl:y.flows.implicit.authorizationUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((G=(k=y==null?void 0:y.flows)==null?void 0:k.implicit)==null?void 0:G.scopes)||{}),server:this.props.activeServer,id:se,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.implicit["x-defaultClientId"]||y["x-defaultClientId"],flow:"implicit",defaultValues:r==null?void 0:r[se]});if(y.type==="oauth2"&&y.flows&&y.flows.authorizationCode)return d.createElement(cf,{key:se,authorizationUrl:y.flows.authorizationCode.authorizationUrl,tokenUrl:y.flows.authorizationCode.tokenUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((ne=y.flows.authorizationCode)==null?void 0:ne.scopes)||{}),server:this.props.activeServer,id:se,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.authorizationCode["x-defaultClientId"]||y["x-defaultClientId"],flow:"authorizationCode",tokenEndpointAuthMethod:y.flows.authorizationCode["x-tokenEndpointAuthMethod"],usePkce:y.flows.authorizationCode["x-usePkce"],defaultValues:r==null?void 0:r[se]});if(y.type==="oauth2"){let ye=(0,zt.YQ)(`auth.${se}.token`)||JSON.stringify((re=r==null?void 0:r[se])==null?void 0:re.token);return ye=ye?JSON.parse(ye):{},d.createElement(d.Fragment,{key:se},d.createElement(it.NI,null,d.createElement(it.lX,null," Access Token Type: "),d.createElement(Er,{fullWidth:!0,field:`auth.${se}.token.token_type`,initialValue:ye.token_type||"Bearer"})),d.createElement(it.NI,null,d.createElement(it.lX,null," Access Token: "),d.createElement(Er,{type:"password",fullWidth:!0,field:`auth.${se}.token.access_token`,validate:Sl,initialValue:ye.access_token,validateOnBlur:!0,validateOnChange:!0})))}else if(y.type==="openIdConnect")return d.createElement(Pv,{key:se,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:se,form:this.props.form,formApi:this.props.formApi,scheme:y,clientId:y["x-defaultClientId"],defaultValues:r==null?void 0:r[se]})}})),d.createElement("small",null,d.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}var Jd=o(39895);const Kv=wt.styled.div`
|
|
308
|
+
`;var Fv=Object.defineProperty,kv=Object.defineProperties,Mv=Object.getOwnPropertyDescriptors,zd=Object.getOwnPropertySymbols,Rv=Object.prototype.hasOwnProperty,Lv=Object.prototype.propertyIsEnumerable,Hc=(t,r,i)=>r in t?Fv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Gd=(t,r)=>{for(var i in r||(r={}))Rv.call(r,i)&&Hc(t,i,r[i]);if(zd)for(var i of zd(r))Lv.call(r,i)&&Hc(t,i,r[i]);return t},$d=(t,r)=>kv(t,Mv(r)),df=(t,r,i)=>(Hc(t,typeof r!="symbol"?r+"":r,i),i),Dv=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});function Nv(t){if(!t)return"Token is required"}class Bv extends d.Component{constructor(){super(...arguments);df(this,"state",{error:"",loading:!1,tokenMasked:!0}),df(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,""),(0,zt.WW)(`auth.${this.props.id}.token`,"")}),df(this,"toggleTokenMask",()=>{this.setState({tokenMasked:!this.state.tokenMasked})}),df(this,"requestToken",()=>Dv(this,null,function*(){if(this.state.loading)return;const{server:r,flow:i,authCorsProxyUrl:a}=this.props,s=a&&i.tokenUrl?a+(0,kr.jg)(i.tokenUrl):i.tokenUrl;if(this.errors.client_id||this.errors.client_secret){console.log("Provide client_id and client_secret");return}const p=this.values.client_id,y=this.values.client_secret;if(!p||!y){console.log("Provide client_id and client_secret");return}this.setState({loading:!0});const E=i["x-tokenEndpointAuthMethod"];if(!(0,kr.xl)(E)){console.log(`Unsupported token endpoint auth method: ${E}`);return}yield m.authorizeClientCredentials({tokenUrl:s.startsWith("http")?s:r+s,clientId:p,clientSecret:y,scopes:this.values.scopes,extraHeaders:(0,kr.Or)({authMethod:E,clientId:p,clientSecret:y}),successCallback:w=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,w),this.setState({loading:!1})},errorCallback:w=>{this.clearToken(),this.setState({error:w.message,loading:!1})}})}))}get values(){var r,i,a;return((a=(i=(r=this.props.form)==null?void 0:r.values)==null?void 0:i.auth)==null?void 0:a[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}render(){const{loading:r,error:i,tokenMasked:a}=this.state,{id:s,defaultValues:p}=this.props,y=Object.keys(this.props.flow.scopes);let E=(0,zt.YQ)(`auth.${s}.token`)||JSON.stringify(p==null?void 0:p.token);E=E?JSON.parse(E):"";const w=(0,zt.Al)(s,"client_id"),A={field:`auth.${s}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),initValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),placeholder:"Your OAuth2 app Client ID"};return d.createElement(d.Fragment,null,d.createElement(it.n5,null,d.createElement(it.NI,null,d.createElement(it.lX,null,"Client ID:"),w?d.createElement(Kn,$d(Gd({},A),{options:w})):d.createElement(Er,$d(Gd({},A),{type:"password"}))),d.createElement(it.NI,null,d.createElement(it.lX,null,"Client Secret:"),d.createElement(Er,{type:"password",fullWidth:!0,field:`auth.${s}.client_secret`,initialValue:(0,zt.YQ)(`auth.${s}.client_secret`)||(p==null?void 0:p.client_secret)})),d.createElement(Er,{fullWidth:!0,field:`auth.${s}.token`,type:"hidden",initialValue:E,validate:Nv}),d.createElement(Vd,{id:s,scopes:y})),d.createElement(fa.zx,{color:"primary",onClick:this.requestToken,blinking:r},r?"Loading...":"Request Token"),d.createElement(it.ph,null," Access Token "),i?d.createElement(it.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",d.createElement("pre",null,i)," "):this.values.token&&this.values.token.access_token?d.createElement(it.TR,null,d.createElement(it.WA,{length:this.values.token.access_token.length,masked:a},this.values.token.access_token),d.createElement(it.lf,{onClick:this.toggleTokenMask},a?"Show":"Hide"," "),d.createElement(it.h,{onClick:this.clearToken}," Clear ")):d.createElement(it.Xq,{style:{marginBottom:"1em"}},"No token"))}}const Uv=Bv;var jv=Object.defineProperty,Vv=Object.defineProperties,Wv=Object.getOwnPropertyDescriptors,Kd=Object.getOwnPropertySymbols,Hv=Object.prototype.hasOwnProperty,zv=Object.prototype.propertyIsEnumerable,zc=(t,r,i)=>r in t?jv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,os=(t,r)=>{for(var i in r||(r={}))Hv.call(r,i)&&zc(t,i,r[i]);if(Kd)for(var i of Kd(r))zv.call(r,i)&&zc(t,i,r[i]);return t},Sl=(t,r)=>Vv(t,Wv(r)),Yd=(t,r,i)=>(zc(t,typeof r!="symbol"?r+"":r,i),i);function Al(t){if(!t)return"Field is required"}const Gv=function(t){const r=document.cookie.match("\\b"+t+"=([^;]*)\\b");return r?r[1]:void 0};function Jd(t){if(t.in==="cookie")return Gv(t.name)}class $v extends d.Component{constructor(){super(...arguments);Yd(this,"state",{activeScheme:0}),Yd(this,"handleSchemeChange",r=>{this.setState({activeScheme:r.idx}),(0,zt.WW)("securityRequirementName",r.value)})}static getDerivedStateFromProps(r){const a=r.operation.security.map(y=>y.schemes.map(E=>E.id).join(" and ")),s=(0,zt.YQ)("securityRequirementName"),p=a.findIndex(y=>y===s);return{activeScheme:p<0?0:p}}render(){const{securityDefaults:r}=this.props,{activeScheme:i}=this.state,a=this.props.operation.security,p=a.map(y=>y.schemes.map(E=>E.id).join(" and ")).map((y,E)=>({value:y,idx:E}));return p.length===0?null:d.createElement(d.Fragment,null,d.createElement(it.n5,null,p.length>1&&d.createElement(it.NI,null,d.createElement(it.lX,null," Security scheme: "),d.createElement(hr.Dropdown,{variant:"dark",fullWidth:!0,options:p,value:p[i].value,onChange:this.handleSchemeChange}))||null,a[i].schemes.map(y=>{var E,w,A,k,G,ne,re;const se=(0,zt.A8)(y.id);if(y.type==="apiKey"){const ye=(0,zt.Al)(se,""),ge={field:`auth.${se}`,fullWidth:!0,initialValue:Jd(y)||(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),initValue:Jd(y)||(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),validate:Al,validateOnBlur:!0,validateOnChange:!0};return d.createElement(it.NI,{key:se},d.createElement(it.lX,null," ",y.name,": "),ye?d.createElement(Kn,Sl(os({},ge),{options:ye})):d.createElement(Er,Sl(os({},ge),{type:"password","data-cy":"apiKey-auth-password"})))}else if(y.type==="http"){if(y.scheme==="basic"){const ye=(0,zt.Al)(se,"username"),ge={field:`auth.${se}.username`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${se}.username`)||((E=r==null?void 0:r[se])==null?void 0:E.username),initValue:(0,zt.YQ)(`auth.${se}.username`)||((w=r==null?void 0:r[se])==null?void 0:w.username),validate:Al,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:se},d.createElement(it.NI,null,d.createElement(it.lX,null," ",(0,la.l)("tryItAuthBasicUsername"),": "),ye?d.createElement(Kn,Sl(os({},ge),{options:ye})):d.createElement(Er,os({},ge))),d.createElement(it.NI,null,d.createElement(it.lX,null," ",(0,la.l)("tryItAuthBasicPassword"),": "),d.createElement(Er,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${se}.password`,initialValue:(0,zt.YQ)(`auth.${se}.password`)||((A=r==null?void 0:r[se])==null?void 0:A.password)||"",validateOnBlur:!0,validateOnChange:!0})))}else if(y.scheme==="bearer"){const ye=(0,zt.Al)(se,""),ge={field:`auth.${se}`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),initValue:(0,zt.YQ)(`auth.${se}`)||(r==null?void 0:r[se]),validate:Al,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:se},d.createElement(it.NI,null,d.createElement(it.lX,null," Bearer Token: "),ye?d.createElement(Kn,Sl(os({},ge),{options:ye})):d.createElement(Er,Sl(os({},ge),{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if(y.type==="oauth2"&&y.flows&&y.flows.clientCredentials)return d.createElement(Uv,{key:se,flow:y.flows.clientCredentials,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:se,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.clientCredentials["x-defaultClientId"]||y["x-defaultClientId"],defaultValues:r==null?void 0:r[se]});if(y.type==="oauth2"&&y.flows&&y.flows.implicit)return d.createElement(wl,{key:se,authorizationUrl:y.flows.implicit.authorizationUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((G=(k=y==null?void 0:y.flows)==null?void 0:k.implicit)==null?void 0:G.scopes)||{}),server:this.props.activeServer,id:se,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.implicit["x-defaultClientId"]||y["x-defaultClientId"],flow:"implicit",defaultValues:r==null?void 0:r[se]});if(y.type==="oauth2"&&y.flows&&y.flows.authorizationCode)return d.createElement(wl,{key:se,authorizationUrl:y.flows.authorizationCode.authorizationUrl,tokenUrl:y.flows.authorizationCode.tokenUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((ne=y.flows.authorizationCode)==null?void 0:ne.scopes)||{}),server:this.props.activeServer,id:se,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.authorizationCode["x-defaultClientId"]||y["x-defaultClientId"],flow:"authorizationCode",tokenEndpointAuthMethod:y.flows.authorizationCode["x-tokenEndpointAuthMethod"],usePkce:y.flows.authorizationCode["x-usePkce"],defaultValues:r==null?void 0:r[se]});if(y.type==="oauth2"){let ye=(0,zt.YQ)(`auth.${se}.token`)||JSON.stringify((re=r==null?void 0:r[se])==null?void 0:re.token);return ye=ye?JSON.parse(ye):{},d.createElement(d.Fragment,{key:se},d.createElement(it.NI,null,d.createElement(it.lX,null," Access Token Type: "),d.createElement(Er,{fullWidth:!0,field:`auth.${se}.token.token_type`,initialValue:ye.token_type||"Bearer"})),d.createElement(it.NI,null,d.createElement(it.lX,null," Access Token: "),d.createElement(Er,{type:"password",fullWidth:!0,field:`auth.${se}.token.access_token`,validate:Al,initialValue:ye.access_token,validateOnBlur:!0,validateOnChange:!0})))}else if(y.type==="openIdConnect")return d.createElement(Iv,{key:se,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:se,form:this.props.form,formApi:this.props.formApi,scheme:y,clientId:y["x-defaultClientId"],defaultValues:r==null?void 0:r[se]})}})),d.createElement("small",null,d.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}var Xd=o(39895);const Kv=wt.styled.div`
|
|
309
309
|
display: flex;
|
|
310
310
|
font-size: 12px;
|
|
311
311
|
button {
|
|
312
312
|
margin: 0;
|
|
313
313
|
}
|
|
314
|
-
`,
|
|
314
|
+
`,Qd=wt.styled.button`
|
|
315
315
|
outline: none;
|
|
316
316
|
border: none;
|
|
317
317
|
background-color: ${({theme:t})=>t.rightPanel.panelBackgroundColor};
|
|
@@ -344,18 +344,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
344
344
|
|
|
345
345
|
${({active:t,theme:r})=>t&&`
|
|
346
346
|
border-bottom: 4px solid ${r.colors.accent.main};
|
|
347
|
-
background-color: ${(0,
|
|
347
|
+
background-color: ${(0,Xd._j)(.05,r.rightPanel.panelBackgroundColor)};
|
|
348
348
|
`||""}
|
|
349
349
|
|
|
350
350
|
${({disabled:t,theme:r})=>t&&`
|
|
351
351
|
cursor: default;
|
|
352
|
-
color: ${(0,
|
|
352
|
+
color: ${(0,Xd.DZ)(.3,r.colors.text.light)};
|
|
353
353
|
`||""}
|
|
354
|
-
`;class Yv extends d.Component{render(){const{onChange:r,active:i,hasResponse:a}=this.props;return d.createElement(Kv,null,d.createElement(
|
|
354
|
+
`;class Yv extends d.Component{render(){const{onChange:r,active:i,hasResponse:a}=this.props;return d.createElement(Kv,null,d.createElement(Qd,{onClick:()=>r(0),active:i===0},a?"Edit Request":"Request"),d.createElement(Qd,{onClick:()=>a&&r(1),active:i===1,disabled:!a}," ","Response"," "))}}var Jv=o(9996),Zd=o.n(Jv),Gc=o(67897),El=o(49376),Xv=Object.defineProperty,pf=Object.getOwnPropertySymbols,_d=Object.prototype.hasOwnProperty,qd=Object.prototype.propertyIsEnumerable,ep=(t,r,i)=>r in t?Xv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Qv=(t,r)=>{for(var i in r||(r={}))_d.call(r,i)&&ep(t,i,r[i]);if(pf)for(var i of pf(r))qd.call(r,i)&&ep(t,i,r[i]);return t},Zv=(t,r)=>{var i={};for(var a in t)_d.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&pf)for(var a of pf(t))r.indexOf(a)<0&&qd.call(t,a)&&(i[a]=t[a]);return i},_v=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});const tp=d.forwardRef((t,r)=>{var i=Zv(t,[]);const{schema:a,contentName:s,onChange:p,name:y}=i,{render:E}=Tn(Qv({field:y},i)),w=A=>_v(void 0,null,function*(){const k=yield It(A.target.files,a);p(s,k)});return E(d.createElement("input",{"data-cy":"file-upload-input",type:"file",id:i.id,className:i.className,name:i.name,onChange:w,multiple:i.multiple,accept:i.accept,ref:r}))});tp.displayName="FileUpload";const qv=(0,Io.Pi)(t=>{var r;const{mediaType:i,onChange:a,formApi:s}=t,p=i.examples||{},{exampleKey:y}=(0,Gc.C6)(i.operation,p),E=(r=p[y])==null?void 0:r.rawValue,w=eg(i);(0,d.useEffect)(()=>s&&w.forEach(k=>{var G,ne;const re=E==null?void 0:E[k.name],se=(ne=(G=k.example)!=null?G:re==null?void 0:re.example)!=null?ne:re,ye=typeof se=="object"?JSON.stringify(se):se;se!==void 0&&s.setValue("body."+k.name,`${ye}`)}),[y]);const A=i.schema||{};return dt(A,i.name)?d.createElement(rp,null,d.createElement(it.NI,null,d.createElement(np,{fullWidth:!0,id:`body.${i.name}`,name:`body.${i.name}`,accept:at(i.name),schema:A,contentName:i.name,onChange:a}))):A.type!==be.OBJECT&&!w?(console.warn(`Invalid schema for request body and mime type: "${i.name}"`,A),null):d.createElement(rp,null,w.map(k=>{const G=k.schema||{},ne=i.name===El.T.MULTIPART&>(G),re=G.contentMediaType||"",se=ne?d.createElement(np,{fullWidth:!0,id:"body."+k.name,name:"body."+k.name,accept:at(re),multiple:G.type==="array",schema:G,contentName:k.name,onChange:a}):d.createElement(Er,{fullWidth:!0,id:"body."+k.name,field:"body."+k.name,placeholder:G.description||k.name});return d.createElement(it.NI,{key:k.name},d.createElement(it.lX,null,k.name,":"),se)}))});function eg(t){var r,i,a,s,p;return(((i=(r=t.schema)==null?void 0:r.oneOf)==null?void 0:i.length)?((s=t.schema)==null?void 0:s.oneOf[(a=t.schema)==null?void 0:a.activeOneOf].fields)||[]:((p=t.schema)==null?void 0:p.fields)||[]).filter(y=>!y.schema.readOnly)}const rp=wt.styled.div`
|
|
355
355
|
> div {
|
|
356
356
|
margin-top: 10px;
|
|
357
357
|
}
|
|
358
|
-
`,
|
|
358
|
+
`,np=(0,wt.styled)(tp)`
|
|
359
359
|
${nn}
|
|
360
360
|
${({inputType:t})=>t==="password"?"padding-right: 40px;":""};
|
|
361
361
|
${({fullWidth:t})=>t?"width: 100%;":""}
|
|
@@ -363,21 +363,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
363
363
|
border-radius: ${({theme:t})=>t.components.panels.borderRadius};
|
|
364
364
|
margin-bottom: 10px;
|
|
365
365
|
`;var rg=o(35310),as=o(4631);function hf(t,r){r===void 0&&(r=!1);var i=t.length,a=0,s="",p=0,y=16,E=0,w=0,A=0,k=0,G=0;function ne(Pe,Ge){for(var je=0,He=0;je<Pe||!Ge;){var Ne=t.charCodeAt(a);if(Ne>=48&&Ne<=57)He=He*16+Ne-48;else if(Ne>=65&&Ne<=70)He=He*16+Ne-65+10;else if(Ne>=97&&Ne<=102)He=He*16+Ne-97+10;else break;a++,je++}return je<Pe&&(He=-1),He}function re(Pe){a=Pe,s="",p=0,y=16,G=0}function se(){var Pe=a;if(t.charCodeAt(a)===48)a++;else for(a++;a<t.length&&ss(t.charCodeAt(a));)a++;if(a<t.length&&t.charCodeAt(a)===46)if(a++,a<t.length&&ss(t.charCodeAt(a)))for(a++;a<t.length&&ss(t.charCodeAt(a));)a++;else return G=3,t.substring(Pe,a);var Ge=a;if(a<t.length&&(t.charCodeAt(a)===69||t.charCodeAt(a)===101))if(a++,(a<t.length&&t.charCodeAt(a)===43||t.charCodeAt(a)===45)&&a++,a<t.length&&ss(t.charCodeAt(a))){for(a++;a<t.length&&ss(t.charCodeAt(a));)a++;Ge=a}else G=3;return t.substring(Pe,Ge)}function ye(){for(var Pe="",Ge=a;;){if(a>=i){Pe+=t.substring(Ge,a),G=2;break}var je=t.charCodeAt(a);if(je===34){Pe+=t.substring(Ge,a),a++;break}if(je===92){if(Pe+=t.substring(Ge,a),a++,a>=i){G=2;break}var He=t.charCodeAt(a++);switch(He){case 34:Pe+='"';break;case 92:Pe+="\\";break;case 47:Pe+="/";break;case 98:Pe+="\b";break;case 102:Pe+="\f";break;case 110:Pe+=`
|
|
366
|
-
`;break;case 114:Pe+="\r";break;case 116:Pe+=" ";break;case 117:var Ne=ne(4,!0);Ne>=0?Pe+=String.fromCharCode(Ne):G=4;break;default:G=5}Ge=a;continue}if(je>=0&&je<=31)if(
|
|
367
|
-
`),E++,A=a,y=14;switch(Pe){case 123:return a++,y=1;case 125:return a++,y=2;case 91:return a++,y=3;case 93:return a++,y=4;case 58:return a++,y=6;case 44:return a++,y=5;case 34:return a++,s=ye(),y=10;case 47:var Ge=a-1;if(t.charCodeAt(a+1)===47){for(a+=2;a<i&&!
|
|
366
|
+
`;break;case 114:Pe+="\r";break;case 116:Pe+=" ";break;case 117:var Ne=ne(4,!0);Ne>=0?Pe+=String.fromCharCode(Ne):G=4;break;default:G=5}Ge=a;continue}if(je>=0&&je<=31)if(Cl(je)){Pe+=t.substring(Ge,a),G=2;break}else G=6;a++}return Pe}function ge(){if(s="",G=0,p=a,w=E,k=A,a>=i)return p=i,y=17;var Pe=t.charCodeAt(a);if($c(Pe)){do a++,s+=String.fromCharCode(Pe),Pe=t.charCodeAt(a);while($c(Pe));return y=15}if(Cl(Pe))return a++,s+=String.fromCharCode(Pe),Pe===13&&t.charCodeAt(a)===10&&(a++,s+=`
|
|
367
|
+
`),E++,A=a,y=14;switch(Pe){case 123:return a++,y=1;case 125:return a++,y=2;case 91:return a++,y=3;case 93:return a++,y=4;case 58:return a++,y=6;case 44:return a++,y=5;case 34:return a++,s=ye(),y=10;case 47:var Ge=a-1;if(t.charCodeAt(a+1)===47){for(a+=2;a<i&&!Cl(t.charCodeAt(a));)a++;return s=t.substring(Ge,a),y=12}if(t.charCodeAt(a+1)===42){a+=2;for(var je=i-1,He=!1;a<je;){var Ne=t.charCodeAt(a);if(Ne===42&&t.charCodeAt(a+1)===47){a+=2,He=!0;break}a++,Cl(Ne)&&(Ne===13&&t.charCodeAt(a)===10&&a++,E++,A=a)}return He||(a++,G=1),s=t.substring(Ge,a),y=13}return s+=String.fromCharCode(Pe),a++,y=16;case 45:if(s+=String.fromCharCode(Pe),a++,a===i||!ss(t.charCodeAt(a)))return y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=se(),y=11;default:for(;a<i&&Ee(Pe);)a++,Pe=t.charCodeAt(a);if(p!==a){switch(s=t.substring(p,a),s){case"true":return y=8;case"false":return y=9;case"null":return y=7}return y=16}return s+=String.fromCharCode(Pe),a++,y=16}}function Ee(Pe){if($c(Pe)||Cl(Pe))return!1;switch(Pe){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function me(){var Pe;do Pe=ge();while(Pe>=12&&Pe<=15);return Pe}return{setPosition:re,getPosition:function(){return a},scan:r?me:ge,getToken:function(){return y},getTokenValue:function(){return s},getTokenOffset:function(){return p},getTokenLength:function(){return a-p},getTokenStartLine:function(){return w},getTokenStartCharacter:function(){return p-k},getTokenError:function(){return G}}}function $c(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function Cl(t){return t===10||t===13||t===8232||t===8233}function ss(t){return t>=48&&t<=57}function ng(t,r,i){var a,s,p,y,E;if(r){for(y=r.offset,E=y+r.length,p=y;p>0&&!ip(t,p-1);)p--;for(var w=E;w<t.length&&!ip(t,w);)w++;s=t.substring(p,w),a=ig(s,i)}else s=t,a=0,p=0,y=0,E=t.length;var A=og(i,t),k=!1,G=0,ne;i.insertSpaces?ne=Kc(" ",i.tabSize||4):ne=" ";var re=hf(s,!1),se=!1;function ye(){return A+Kc(ne,a+G)}function ge(){var ze=re.scan();for(k=!1;ze===15||ze===14;)k=k||ze===14,ze=re.scan();return se=ze===16||re.getTokenError()!==0,ze}var Ee=[];function me(ze,et,At){!se&&et<E&&At>y&&t.substring(et,At)!==ze&&Ee.push({offset:et,length:At-et,content:ze})}var Pe=ge();if(Pe!==17){var Ge=re.getTokenOffset()+p,je=Kc(ne,a);me(je,p,Ge)}for(;Pe!==17;){for(var He=re.getTokenOffset()+re.getTokenLength()+p,Ne=ge(),Ve="";!k&&(Ne===12||Ne===13);){var We=re.getTokenOffset()+p;me(" ",He,We),He=re.getTokenOffset()+re.getTokenLength()+p,Ve=Ne===12?ye():"",Ne=ge()}if(Ne===2)Pe!==1&&(G--,Ve=ye());else if(Ne===4)Pe!==3&&(G--,Ve=ye());else{switch(Pe){case 3:case 1:G++,Ve=ye();break;case 5:case 12:Ve=ye();break;case 13:k?Ve=ye():Ve=" ";break;case 6:Ve=" ";break;case 10:if(Ne===6){Ve="";break}case 7:case 8:case 9:case 11:case 2:case 4:Ne===12||Ne===13?Ve=" ":Ne!==5&&Ne!==17&&(se=!0);break;case 16:se=!0;break}k&&(Ne===12||Ne===13)&&(Ve=ye())}var Je=re.getTokenOffset()+p;me(Ve,He,Je),Pe=Ne}return Ee}function Kc(t,r){for(var i="",a=0;a<r;a++)i+=t;return i}function ig(t,r){for(var i=0,a=0,s=r.tabSize||4;i<t.length;){var p=t.charAt(i);if(p===" ")a++;else if(p===" ")a+=s;else break;i++}return Math.floor(a/s)}function og(t,r){for(var i=0;i<r.length;i++){var a=r.charAt(i);if(a==="\r")return i+1<r.length&&r.charAt(i+1)===`
|
|
368
368
|
`?`\r
|
|
369
369
|
`:"\r";if(a===`
|
|
370
370
|
`)return`
|
|
371
371
|
`}return t&&t.eol||`
|
|
372
|
-
`}function
|
|
373
|
-
`.indexOf(t.charAt(r))!==-1}var Cl;(function(t){t.DEFAULT={allowTrailingComma:!1}})(Cl||(Cl={}));function ag(t,r){var i=[],a=new Object,s=void 0,p={value:{},offset:0,length:0,type:"object",parent:void 0},y=!1;function E(w,A,k,G){p.value=w,p.offset=A,p.length=k,p.type=G,p.colonOffset=void 0,s=p}try{vf(t,{onObjectBegin:function(w,A){if(r<=w)throw a;s=void 0,y=r>w,i.push("")},onObjectProperty:function(w,A,k){if(r<A||(E(w,A,k,"property"),i[i.length-1]=w,r<=A+k))throw a},onObjectEnd:function(w,A){if(r<=w)throw a;s=void 0,i.pop()},onArrayBegin:function(w,A){if(r<=w)throw a;s=void 0,i.push(0)},onArrayEnd:function(w,A){if(r<=w)throw a;s=void 0,i.pop()},onLiteralValue:function(w,A,k){if(r<A||(E(w,A,k,ap(w)),r<=A+k))throw a},onSeparator:function(w,A,k){if(r<=A)throw a;if(w===":"&&s&&s.type==="property")s.colonOffset=A,y=!1,s=void 0;else if(w===","){var G=i[i.length-1];typeof G=="number"?i[i.length-1]=G+1:(y=!0,i[i.length-1]=""),s=void 0}}})}catch(w){if(w!==a)throw w}return{path:i,previousNode:s,isAtPropertyKey:y,matches:function(w){for(var A=0,k=0;A<w.length&&k<i.length;k++)if(w[A]===i[k]||w[A]==="*")A++;else if(w[A]!=="**")return!1;return A===w.length}}}function sg(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=Cl.DEFAULT);var a=null,s=[],p=[];function y(w){Array.isArray(s)?s.push(w):a!==null&&(s[a]=w)}var E={onObjectBegin:function(){var w={};y(w),p.push(s),s=w,a=null},onObjectProperty:function(w){a=w},onObjectEnd:function(){s=p.pop()},onArrayBegin:function(){var w=[];y(w),p.push(s),s=w,a=null},onArrayEnd:function(){s=p.pop()},onLiteralValue:y,onError:function(w,A,k){r.push({error:w,offset:A,length:k})}};return vf(t,E,i),s[0]}function lg(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=Cl.DEFAULT);var a={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(w){a.type==="property"&&(a.length=w-a.offset,a=a.parent)}function p(w){return a.children.push(w),w}var y={onObjectBegin:function(w){a=p({type:"object",offset:w,length:-1,parent:a,children:[]})},onObjectProperty:function(w,A,k){a=p({type:"property",offset:A,length:-1,parent:a,children:[]}),a.children.push({type:"string",value:w,offset:A,length:k,parent:a})},onObjectEnd:function(w,A){s(w+A),a.length=w+A-a.offset,a=a.parent,s(w+A)},onArrayBegin:function(w,A){a=p({type:"array",offset:w,length:-1,parent:a,children:[]})},onArrayEnd:function(w,A){a.length=w+A-a.offset,a=a.parent,s(w+A)},onLiteralValue:function(w,A,k){p({type:ap(w),offset:A,length:k,parent:a,value:w}),s(A+k)},onSeparator:function(w,A,k){a.type==="property"&&(w===":"?a.colonOffset=A:w===","&&s(A))},onError:function(w,A,k){r.push({error:w,offset:A,length:k})}};vf(t,y,i);var E=a.children[0];return E&&delete E.parent,E}function ug(t,r){if(!!t){for(var i=t,a=0,s=r;a<s.length;a++){var p=s[a];if(typeof p=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var y=!1,E=0,w=i.children;E<w.length;E++){var A=w[E];if(Array.isArray(A.children)&&A.children[0].value===p){i=A.children[1],y=!0;break}}if(!y)return}else{var k=p;if(i.type!=="array"||k<0||!Array.isArray(i.children)||k>=i.children.length)return;i=i.children[k]}}return i}}function ip(t){if(!t.parent||!t.parent.children)return[];var r=ip(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var a=t.parent.children.indexOf(t);a!==-1&&r.push(a)}return r}function Yc(t){switch(t.type){case"array":return t.children.map(Yc);case"object":for(var r=Object.create(null),i=0,a=t.children;i<a.length;i++){var s=a[i],p=s.children[1];p&&(r[s.children[0].value]=Yc(p))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function fg(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function op(t,r,i){if(i===void 0&&(i=!1),fg(t,r,i)){var a=t.children;if(Array.isArray(a))for(var s=0;s<a.length&&a[s].offset<=r;s++){var p=op(a[s],r,i);if(p)return p}return t}}function vf(t,r,i){i===void 0&&(i=Cl.DEFAULT);var a=hf(t,!1);function s(We){return We?function(){return We(a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}function p(We){return We?function(Je){return We(Je,a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}var y=s(r.onObjectBegin),E=p(r.onObjectProperty),w=s(r.onObjectEnd),A=s(r.onArrayBegin),k=s(r.onArrayEnd),G=p(r.onLiteralValue),ne=p(r.onSeparator),re=s(r.onComment),se=p(r.onError),ye=i&&i.disallowComments,ge=i&&i.allowTrailingComma;function Ee(){for(;;){var We=a.scan();switch(a.getTokenError()){case 4:me(14);break;case 5:me(15);break;case 3:me(13);break;case 1:ye||me(11);break;case 2:me(12);break;case 6:me(16);break}switch(We){case 12:case 13:ye?me(10):re();break;case 16:me(1);break;case 15:case 14:break;default:return We}}}function me(We,Je,ze){if(Je===void 0&&(Je=[]),ze===void 0&&(ze=[]),se(We),Je.length+ze.length>0)for(var et=a.getToken();et!==17;){if(Je.indexOf(et)!==-1){Ee();break}else if(ze.indexOf(et)!==-1)break;et=Ee()}}function Pe(We){var Je=a.getTokenValue();return We?G(Je):E(Je),Ee(),!0}function Ge(){switch(a.getToken()){case 11:var We=a.getTokenValue(),Je=Number(We);isNaN(Je)&&(me(2),Je=0),G(Je);break;case 7:G(null);break;case 8:G(!0);break;case 9:G(!1);break;default:return!1}return Ee(),!0}function je(){return a.getToken()!==10?(me(3,[],[2,5]),!1):(Pe(!1),a.getToken()===6?(ne(":"),Ee(),Ve()||me(4,[],[2,5])):me(5,[],[2,5]),!0)}function He(){y(),Ee();for(var We=!1;a.getToken()!==2&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ne(","),Ee(),a.getToken()===2&&ge)break}else We&&me(6,[],[]);je()||me(4,[],[2,5]),We=!0}return w(),a.getToken()!==2?me(7,[2],[]):Ee(),!0}function Ne(){A(),Ee();for(var We=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ne(","),Ee(),a.getToken()===4&&ge)break}else We&&me(6,[],[]);Ve()||me(4,[],[4,5]),We=!0}return k(),a.getToken()!==4?me(8,[4],[]):Ee(),!0}function Ve(){switch(a.getToken()){case 3:return Ne();case 1:return He();case 10:return Pe(!0);default:return Ge()}}return Ee(),a.getToken()===17?i.allowEmptyContent?!0:(me(4,[],[]),!1):Ve()?(a.getToken()!==17&&me(9,[],[]),!0):(me(4,[],[]),!1)}function cg(t,r){var i=hf(t),a=[],s,p=0,y;do switch(y=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:p!==y&&a.push(t.substring(p,y)),r!==void 0&&a.push(i.getTokenValue().replace(/[^\r\n]/g,r)),p=i.getPosition();break}while(s!==17);return a.join("")}function ap(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}function Mm(t,r,i){return dg(t,r,void 0,i)}function dg(t,r,i,a){for(var s,p=r.slice(),y=[],E=parseTree(t,y),w=void 0,A=void 0;p.length>0&&(A=p.pop(),w=findNodeAtLocation(E,p),w===void 0&&i!==void 0);)typeof A=="string"?i=(s={},s[A]=i,s):i=[i];if(w)if(w.type==="object"&&typeof A=="string"&&Array.isArray(w.children)){var k=findNodeAtLocation(w,[A]);if(k!==void 0)if(i===void 0){if(!k.parent)throw new Error("Malformed AST");var G=w.children.indexOf(k.parent),ne=void 0,re=k.parent.offset+k.parent.length;if(G>0){var se=w.children[G-1];ne=se.offset+se.length}else if(ne=w.offset+1,w.children.length>1){var ye=w.children[1];re=ye.offset}return ca(t,{offset:ne,length:re-ne,content:""},a)}else return ca(t,{offset:k.offset,length:k.length,content:JSON.stringify(i)},a);else{if(i===void 0)return[];var ge=JSON.stringify(A)+": "+JSON.stringify(i),Ee=a.getInsertionIndex?a.getInsertionIndex(w.children.map(function(We){return We.children[0].value})):w.children.length,me=void 0;if(Ee>0){var se=w.children[Ee-1];me={offset:se.offset+se.length,length:0,content:","+ge}}else w.children.length===0?me={offset:w.offset+1,length:0,content:ge}:me={offset:w.offset+1,length:0,content:ge+","};return ca(t,me,a)}}else if(w.type==="array"&&typeof A=="number"&&Array.isArray(w.children)){var Pe=A;if(Pe===-1){var ge=""+JSON.stringify(i),me=void 0;if(w.children.length===0)me={offset:w.offset+1,length:0,content:ge};else{var se=w.children[w.children.length-1];me={offset:se.offset+se.length,length:0,content:","+ge}}return ca(t,me,a)}else if(i===void 0&&w.children.length>=0){var Ge=A,je=w.children[Ge],me=void 0;if(w.children.length===1)me={offset:w.offset+1,length:w.length-2,content:""};else if(w.children.length-1===Ge){var se=w.children[Ge-1],He=se.offset+se.length,Ne=w.offset+w.length;me={offset:He,length:Ne-2-He,content:""}}else me={offset:je.offset,length:w.children[Ge+1].offset-je.offset,content:""};return ca(t,me,a)}else if(i!==void 0){var me=void 0,ge=""+JSON.stringify(i);if(!a.isArrayInsertion&&w.children.length>A){var Ve=w.children[A];me={offset:Ve.offset,length:Ve.length,content:ge}}else if(w.children.length===0||A===0)me={offset:w.offset+1,length:0,content:w.children.length===0?ge:ge+","};else{var Ee=A>w.children.length?w.children.length:A,se=w.children[Ee-1];me={offset:se.offset+se.length,length:0,content:","+ge}}return ca(t,me,a)}else throw new Error("Can not "+(i===void 0?"remove":a.isArrayInsertion?"insert":"modify")+" Array index "+Pe+" as length is not sufficient")}else throw new Error("Can not add "+(typeof A!="number"?"index":"property")+" to parent of type "+w.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return ca(t,{offset:E?E.offset:0,length:E?E.length:0,content:JSON.stringify(i)},a)}}function ca(t,r,i){if(!i.formattingOptions)return[r];var a=sp(t,r),s=r.offset,p=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(a,s-1);)s--;for(;p<a.length&&!isEOL(a,p);)p++}for(var y=format(a,{offset:s,length:p-s},i.formattingOptions),E=y.length-1;E>=0;E--){var w=y[E];a=sp(a,w),s=Math.min(s,w.offset),p=Math.max(p,w.offset+w.length),p+=w.content.length-w.length}var A=t.length-(a.length-p)-s;return[{offset:s,length:A,content:a.substring(s,p)}]}function sp(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function Rm(t,r){return`\r
|
|
374
|
-
`.indexOf(t.charAt(r))!==-1}var ls=hf,Lm=ag,pg=sg,Dm=lg,Nm=ug,hg=op,vg=ip,gg=Yc,Bm=vf,Um=cg;function jm(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function yg(t,r,i){return ng(t,r,i)}function Vm(t,r,i,a){return edit.setProperty(t,r,i,a)}function Wm(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function Ol(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,a;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!Ol(t[i],r[i]))return!1}else{var s=[];for(a in t)s.push(a);s.sort();var p=[];for(a in r)p.push(a);if(p.sort(),!Ol(s,p))return!1;for(i=0;i<s.length;i++)if(!Ol(t[s[i]],r[s[i]]))return!1}return!0}function Yn(t){return typeof t=="number"}function oo(t){return typeof t!="undefined"}function Ri(t){return typeof t=="boolean"}function mg(t){return typeof t=="string"}var lp;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(lp||(lp={}));var gf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(gf||(gf={}));var hi;(function(t){function r(a,s){return a===Number.MAX_VALUE&&(a=gf.MAX_VALUE),s===Number.MAX_VALUE&&(s=gf.MAX_VALUE),{line:a,character:s}}t.create=r;function i(a){var s=a;return _e.objectLiteral(s)&&_e.uinteger(s.line)&&_e.uinteger(s.character)}t.is=i})(hi||(hi={}));var lr;(function(t){function r(a,s,p,y){if(_e.uinteger(a)&&_e.uinteger(s)&&_e.uinteger(p)&&_e.uinteger(y))return{start:hi.create(a,s),end:hi.create(p,y)};if(hi.is(a)&&hi.is(s))return{start:a,end:s};throw new Error("Range#create called with invalid arguments["+a+", "+s+", "+p+", "+y+"]")}t.create=r;function i(a){var s=a;return _e.objectLiteral(s)&&hi.is(s.start)&&hi.is(s.end)}t.is=i})(lr||(lr={}));var Tl;(function(t){function r(a,s){return{uri:a,range:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.range)&&(_e.string(s.uri)||_e.undefined(s.uri))}t.is=i})(Tl||(Tl={}));var up;(function(t){function r(a,s,p,y){return{targetUri:a,targetRange:s,targetSelectionRange:p,originSelectionRange:y}}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.targetRange)&&_e.string(s.targetUri)&&(lr.is(s.targetSelectionRange)||_e.undefined(s.targetSelectionRange))&&(lr.is(s.originSelectionRange)||_e.undefined(s.originSelectionRange))}t.is=i})(up||(up={}));var Jc;(function(t){function r(a,s,p,y){return{red:a,green:s,blue:p,alpha:y}}t.create=r;function i(a){var s=a;return _e.numberRange(s.red,0,1)&&_e.numberRange(s.green,0,1)&&_e.numberRange(s.blue,0,1)&&_e.numberRange(s.alpha,0,1)}t.is=i})(Jc||(Jc={}));var fp;(function(t){function r(a,s){return{range:a,color:s}}t.create=r;function i(a){var s=a;return lr.is(s.range)&&Jc.is(s.color)}t.is=i})(fp||(fp={}));var cp;(function(t){function r(a,s,p){return{label:a,textEdit:s,additionalTextEdits:p}}t.create=r;function i(a){var s=a;return _e.string(s.label)&&(_e.undefined(s.textEdit)||vi.is(s))&&(_e.undefined(s.additionalTextEdits)||_e.typedArray(s.additionalTextEdits,vi.is))}t.is=i})(cp||(cp={}));var Pl;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Pl||(Pl={}));var dp;(function(t){function r(a,s,p,y,E){var w={startLine:a,endLine:s};return _e.defined(p)&&(w.startCharacter=p),_e.defined(y)&&(w.endCharacter=y),_e.defined(E)&&(w.kind=E),w}t.create=r;function i(a){var s=a;return _e.uinteger(s.startLine)&&_e.uinteger(s.startLine)&&(_e.undefined(s.startCharacter)||_e.uinteger(s.startCharacter))&&(_e.undefined(s.endCharacter)||_e.uinteger(s.endCharacter))&&(_e.undefined(s.kind)||_e.string(s.kind))}t.is=i})(dp||(dp={}));var Xc;(function(t){function r(a,s){return{location:a,message:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&Tl.is(s.location)&&_e.string(s.message)}t.is=i})(Xc||(Xc={}));var $t;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})($t||($t={}));var pp;(function(t){t.Unnecessary=1,t.Deprecated=2})(pp||(pp={}));var hp;(function(t){function r(i){var a=i;return a!=null&&_e.string(a.href)}t.is=r})(hp||(hp={}));var ao;(function(t){function r(a,s,p,y,E,w){var A={range:a,message:s};return _e.defined(p)&&(A.severity=p),_e.defined(y)&&(A.code=y),_e.defined(E)&&(A.source=E),_e.defined(w)&&(A.relatedInformation=w),A}t.create=r;function i(a){var s,p=a;return _e.defined(p)&&lr.is(p.range)&&_e.string(p.message)&&(_e.number(p.severity)||_e.undefined(p.severity))&&(_e.integer(p.code)||_e.string(p.code)||_e.undefined(p.code))&&(_e.undefined(p.codeDescription)||_e.string((s=p.codeDescription)===null||s===void 0?void 0:s.href))&&(_e.string(p.source)||_e.undefined(p.source))&&(_e.undefined(p.relatedInformation)||_e.typedArray(p.relatedInformation,Xc.is))}t.is=i})(ao||(ao={}));var Il;(function(t){function r(a,s){for(var p=[],y=2;y<arguments.length;y++)p[y-2]=arguments[y];var E={title:a,command:s};return _e.defined(p)&&p.length>0&&(E.arguments=p),E}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.title)&&_e.string(s.command)}t.is=i})(Il||(Il={}));var vi;(function(t){function r(p,y){return{range:p,newText:y}}t.replace=r;function i(p,y){return{range:{start:p,end:p},newText:y}}t.insert=i;function a(p){return{range:p,newText:""}}t.del=a;function s(p){var y=p;return _e.objectLiteral(y)&&_e.string(y.newText)&&lr.is(y.range)}t.is=s})(vi||(vi={}));var us;(function(t){function r(a,s,p){var y={label:a};return s!==void 0&&(y.needsConfirmation=s),p!==void 0&&(y.description=p),y}t.create=r;function i(a){var s=a;return s!==void 0&&_e.objectLiteral(s)&&_e.string(s.label)&&(_e.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(_e.string(s.description)||s.description===void 0)}t.is=i})(us||(us={}));var wn;(function(t){function r(i){var a=i;return typeof a=="string"}t.is=r})(wn||(wn={}));var Co;(function(t){function r(p,y,E){return{range:p,newText:y,annotationId:E}}t.replace=r;function i(p,y,E){return{range:{start:p,end:p},newText:y,annotationId:E}}t.insert=i;function a(p,y){return{range:p,newText:"",annotationId:y}}t.del=a;function s(p){var y=p;return vi.is(y)&&(us.is(y.annotationId)||wn.is(y.annotationId))}t.is=s})(Co||(Co={}));var yf;(function(t){function r(a,s){return{textDocument:a,edits:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&xf.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(yf||(yf={}));var Fl;(function(t){function r(a,s,p){var y={kind:"create",uri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="create"&&_e.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||_e.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||_e.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||wn.is(s.annotationId))}t.is=i})(Fl||(Fl={}));var kl;(function(t){function r(a,s,p,y){var E={kind:"rename",oldUri:a,newUri:s};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(E.options=p),y!==void 0&&(E.annotationId=y),E}t.create=r;function i(a){var s=a;return s&&s.kind==="rename"&&_e.string(s.oldUri)&&_e.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||_e.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||_e.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||wn.is(s.annotationId))}t.is=i})(kl||(kl={}));var Ml;(function(t){function r(a,s,p){var y={kind:"delete",uri:a};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="delete"&&_e.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||_e.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||_e.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||wn.is(s.annotationId))}t.is=i})(Ml||(Ml={}));var Qc;(function(t){function r(i){var a=i;return a&&(a.changes!==void 0||a.documentChanges!==void 0)&&(a.documentChanges===void 0||a.documentChanges.every(function(s){return _e.string(s.kind)?Fl.is(s)||kl.is(s)||Ml.is(s):yf.is(s)}))}t.is=r})(Qc||(Qc={}));var mf=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,a){var s,p;if(a===void 0?s=vi.insert(r,i):wn.is(a)?(p=a,s=Co.insert(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Co.insert(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.replace=function(r,i,a){var s,p;if(a===void 0?s=vi.replace(r,i):wn.is(a)?(p=a,s=Co.replace(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Co.replace(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.delete=function(r,i){var a,s;if(i===void 0?a=vi.del(r):wn.is(i)?(s=i,a=Co.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),a=Co.del(r,s)),this.edits.push(a),s!==void 0)return s},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),vp=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var a;if(wn.is(r)?a=r:(a=this.nextId(),i=r),this._annotations[a]!==void 0)throw new Error("Id "+a+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+a);return this._annotations[a]=i,this._size++,a},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),Hm=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new vp(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(a){if(yf.is(a)){var s=new mf(a.edits,i._changeAnnotations);i._textEditChanges[a.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(a){var s=new mf(r.changes[a]);i._textEditChanges[a]=s})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(xf.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},a=this._textEditChanges[i.uri];if(!a){var s=[],p={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(p),a=new mf(s,this._changeAnnotations),this._textEditChanges[i.uri]=a}return a}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var a=this._textEditChanges[r];if(!a){var s=[];this._workspaceEdit.changes[r]=s,a=new mf(s),this._textEditChanges[r]=a}return a}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new vp,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;us.is(i)||wn.is(i)?s=i:a=i;var p,y;if(s===void 0?p=Fl.create(r,a):(y=wn.is(s)?s:this._changeAnnotations.manage(s),p=Fl.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t.prototype.renameFile=function(r,i,a,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;us.is(a)||wn.is(a)?p=a:s=a;var y,E;if(p===void 0?y=kl.create(r,i,s):(E=wn.is(p)?p:this._changeAnnotations.manage(p),y=kl.create(r,i,s,E)),this._workspaceEdit.documentChanges.push(y),E!==void 0)return E},t.prototype.deleteFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;us.is(i)||wn.is(i)?s=i:a=i;var p,y;if(s===void 0?p=Ml.create(r,a):(y=wn.is(s)?s:this._changeAnnotations.manage(s),p=Ml.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t}(),gp;(function(t){function r(a){return{uri:a}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)}t.is=i})(gp||(gp={}));var yp;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)&&_e.integer(s.version)}t.is=i})(yp||(yp={}));var xf;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)&&(s.version===null||_e.integer(s.version))}t.is=i})(xf||(xf={}));var mp;(function(t){function r(a,s,p,y){return{uri:a,languageId:s,version:p,text:y}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)&&_e.string(s.languageId)&&_e.integer(s.version)&&_e.string(s.text)}t.is=i})(mp||(mp={}));var so;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(so||(so={})),function(t){function r(i){var a=i;return a===t.PlainText||a===t.Markdown}t.is=r}(so||(so={}));var Zc;(function(t){function r(i){var a=i;return _e.objectLiteral(i)&&so.is(a.kind)&&_e.string(a.value)}t.is=r})(Zc||(Zc={}));var Jn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Jn||(Jn={}));var Zr;(function(t){t.PlainText=1,t.Snippet=2})(Zr||(Zr={}));var xp;(function(t){t.Deprecated=1})(xp||(xp={}));var bp;(function(t){function r(a,s,p){return{newText:a,insert:s,replace:p}}t.create=r;function i(a){var s=a;return s&&_e.string(s.newText)&&lr.is(s.insert)&&lr.is(s.replace)}t.is=i})(bp||(bp={}));var wp;(function(t){t.asIs=1,t.adjustIndentation=2})(wp||(wp={}));var _c;(function(t){function r(i){return{label:i}}t.create=r})(_c||(_c={}));var Sp;(function(t){function r(i,a){return{items:i||[],isIncomplete:!!a}}t.create=r})(Sp||(Sp={}));var bf;(function(t){function r(a){return a.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(a){var s=a;return _e.string(s)||_e.objectLiteral(s)&&_e.string(s.language)&&_e.string(s.value)}t.is=i})(bf||(bf={}));var Ap;(function(t){function r(i){var a=i;return!!a&&_e.objectLiteral(a)&&(Zc.is(a.contents)||bf.is(a.contents)||_e.typedArray(a.contents,bf.is))&&(i.range===void 0||lr.is(i.range))}t.is=r})(Ap||(Ap={}));var Ep;(function(t){function r(i,a){return a?{label:i,documentation:a}:{label:i}}t.create=r})(Ep||(Ep={}));var Cp;(function(t){function r(i,a){for(var s=[],p=2;p<arguments.length;p++)s[p-2]=arguments[p];var y={label:i};return _e.defined(a)&&(y.documentation=a),_e.defined(s)?y.parameters=s:y.parameters=[],y}t.create=r})(Cp||(Cp={}));var Op;(function(t){t.Text=1,t.Read=2,t.Write=3})(Op||(Op={}));var Tp;(function(t){function r(i,a){var s={range:i};return _e.number(a)&&(s.kind=a),s}t.create=r})(Tp||(Tp={}));var Li;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Li||(Li={}));var Pp;(function(t){t.Deprecated=1})(Pp||(Pp={}));var Ip;(function(t){function r(i,a,s,p,y){var E={name:i,kind:a,location:{uri:p,range:s}};return y&&(E.containerName=y),E}t.create=r})(Ip||(Ip={}));var Fp;(function(t){function r(a,s,p,y,E,w){var A={name:a,detail:s,kind:p,range:y,selectionRange:E};return w!==void 0&&(A.children=w),A}t.create=r;function i(a){var s=a;return s&&_e.string(s.name)&&_e.number(s.kind)&&lr.is(s.range)&&lr.is(s.selectionRange)&&(s.detail===void 0||_e.string(s.detail))&&(s.deprecated===void 0||_e.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(Fp||(Fp={}));var kp;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(kp||(kp={}));var Mp;(function(t){function r(a,s){var p={diagnostics:a};return s!=null&&(p.only=s),p}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.typedArray(s.diagnostics,ao.is)&&(s.only===void 0||_e.typedArray(s.only,_e.string))}t.is=i})(Mp||(Mp={}));var Rp;(function(t){function r(a,s,p){var y={title:a},E=!0;return typeof s=="string"?(E=!1,y.kind=s):Il.is(s)?y.command=s:y.edit=s,E&&p!==void 0&&(y.kind=p),y}t.create=r;function i(a){var s=a;return s&&_e.string(s.title)&&(s.diagnostics===void 0||_e.typedArray(s.diagnostics,ao.is))&&(s.kind===void 0||_e.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Il.is(s.command))&&(s.isPreferred===void 0||_e.boolean(s.isPreferred))&&(s.edit===void 0||Qc.is(s.edit))}t.is=i})(Rp||(Rp={}));var Lp;(function(t){function r(a,s){var p={range:a};return _e.defined(s)&&(p.data=s),p}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.range)&&(_e.undefined(s.command)||Il.is(s.command))}t.is=i})(Lp||(Lp={}));var Dp;(function(t){function r(a,s){return{tabSize:a,insertSpaces:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.uinteger(s.tabSize)&&_e.boolean(s.insertSpaces)}t.is=i})(Dp||(Dp={}));var Np;(function(t){function r(a,s,p){return{range:a,target:s,data:p}}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.range)&&(_e.undefined(s.target)||_e.string(s.target))}t.is=i})(Np||(Np={}));var wf;(function(t){function r(a,s){return{range:a,parent:s}}t.create=r;function i(a){var s=a;return s!==void 0&&lr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(wf||(wf={}));var zm=null,Bp;(function(t){function r(p,y,E,w){return new xg(p,y,E,w)}t.create=r;function i(p){var y=p;return!!(_e.defined(y)&&_e.string(y.uri)&&(_e.undefined(y.languageId)||_e.string(y.languageId))&&_e.uinteger(y.lineCount)&&_e.func(y.getText)&&_e.func(y.positionAt)&&_e.func(y.offsetAt))}t.is=i;function a(p,y){for(var E=p.getText(),w=s(y,function(se,ye){var ge=se.range.start.line-ye.range.start.line;return ge===0?se.range.start.character-ye.range.start.character:ge}),A=E.length,k=w.length-1;k>=0;k--){var G=w[k],ne=p.offsetAt(G.range.start),re=p.offsetAt(G.range.end);if(re<=A)E=E.substring(0,ne)+G.newText+E.substring(re,E.length);else throw new Error("Overlapping edit");A=ne}return E}t.applyEdits=a;function s(p,y){if(p.length<=1)return p;var E=p.length/2|0,w=p.slice(0,E),A=p.slice(E);s(w,y),s(A,y);for(var k=0,G=0,ne=0;k<w.length&&G<A.length;){var re=y(w[k],A[G]);re<=0?p[ne++]=w[k++]:p[ne++]=A[G++]}for(;k<w.length;)p[ne++]=w[k++];for(;G<A.length;)p[ne++]=A[G++];return p}})(Bp||(Bp={}));var xg=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){this._content=r.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var r=[],i=this._content,a=!0,s=0;s<i.length;s++){a&&(r.push(s),a=!1);var p=i.charAt(s);a=p==="\r"||p===`
|
|
372
|
+
`}function ip(t,r){return`\r
|
|
373
|
+
`.indexOf(t.charAt(r))!==-1}var Ol;(function(t){t.DEFAULT={allowTrailingComma:!1}})(Ol||(Ol={}));function ag(t,r){var i=[],a=new Object,s=void 0,p={value:{},offset:0,length:0,type:"object",parent:void 0},y=!1;function E(w,A,k,G){p.value=w,p.offset=A,p.length=k,p.type=G,p.colonOffset=void 0,s=p}try{vf(t,{onObjectBegin:function(w,A){if(r<=w)throw a;s=void 0,y=r>w,i.push("")},onObjectProperty:function(w,A,k){if(r<A||(E(w,A,k,"property"),i[i.length-1]=w,r<=A+k))throw a},onObjectEnd:function(w,A){if(r<=w)throw a;s=void 0,i.pop()},onArrayBegin:function(w,A){if(r<=w)throw a;s=void 0,i.push(0)},onArrayEnd:function(w,A){if(r<=w)throw a;s=void 0,i.pop()},onLiteralValue:function(w,A,k){if(r<A||(E(w,A,k,sp(w)),r<=A+k))throw a},onSeparator:function(w,A,k){if(r<=A)throw a;if(w===":"&&s&&s.type==="property")s.colonOffset=A,y=!1,s=void 0;else if(w===","){var G=i[i.length-1];typeof G=="number"?i[i.length-1]=G+1:(y=!0,i[i.length-1]=""),s=void 0}}})}catch(w){if(w!==a)throw w}return{path:i,previousNode:s,isAtPropertyKey:y,matches:function(w){for(var A=0,k=0;A<w.length&&k<i.length;k++)if(w[A]===i[k]||w[A]==="*")A++;else if(w[A]!=="**")return!1;return A===w.length}}}function sg(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=Ol.DEFAULT);var a=null,s=[],p=[];function y(w){Array.isArray(s)?s.push(w):a!==null&&(s[a]=w)}var E={onObjectBegin:function(){var w={};y(w),p.push(s),s=w,a=null},onObjectProperty:function(w){a=w},onObjectEnd:function(){s=p.pop()},onArrayBegin:function(){var w=[];y(w),p.push(s),s=w,a=null},onArrayEnd:function(){s=p.pop()},onLiteralValue:y,onError:function(w,A,k){r.push({error:w,offset:A,length:k})}};return vf(t,E,i),s[0]}function lg(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=Ol.DEFAULT);var a={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(w){a.type==="property"&&(a.length=w-a.offset,a=a.parent)}function p(w){return a.children.push(w),w}var y={onObjectBegin:function(w){a=p({type:"object",offset:w,length:-1,parent:a,children:[]})},onObjectProperty:function(w,A,k){a=p({type:"property",offset:A,length:-1,parent:a,children:[]}),a.children.push({type:"string",value:w,offset:A,length:k,parent:a})},onObjectEnd:function(w,A){s(w+A),a.length=w+A-a.offset,a=a.parent,s(w+A)},onArrayBegin:function(w,A){a=p({type:"array",offset:w,length:-1,parent:a,children:[]})},onArrayEnd:function(w,A){a.length=w+A-a.offset,a=a.parent,s(w+A)},onLiteralValue:function(w,A,k){p({type:sp(w),offset:A,length:k,parent:a,value:w}),s(A+k)},onSeparator:function(w,A,k){a.type==="property"&&(w===":"?a.colonOffset=A:w===","&&s(A))},onError:function(w,A,k){r.push({error:w,offset:A,length:k})}};vf(t,y,i);var E=a.children[0];return E&&delete E.parent,E}function ug(t,r){if(!!t){for(var i=t,a=0,s=r;a<s.length;a++){var p=s[a];if(typeof p=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var y=!1,E=0,w=i.children;E<w.length;E++){var A=w[E];if(Array.isArray(A.children)&&A.children[0].value===p){i=A.children[1],y=!0;break}}if(!y)return}else{var k=p;if(i.type!=="array"||k<0||!Array.isArray(i.children)||k>=i.children.length)return;i=i.children[k]}}return i}}function op(t){if(!t.parent||!t.parent.children)return[];var r=op(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var a=t.parent.children.indexOf(t);a!==-1&&r.push(a)}return r}function Yc(t){switch(t.type){case"array":return t.children.map(Yc);case"object":for(var r=Object.create(null),i=0,a=t.children;i<a.length;i++){var s=a[i],p=s.children[1];p&&(r[s.children[0].value]=Yc(p))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function fg(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function ap(t,r,i){if(i===void 0&&(i=!1),fg(t,r,i)){var a=t.children;if(Array.isArray(a))for(var s=0;s<a.length&&a[s].offset<=r;s++){var p=ap(a[s],r,i);if(p)return p}return t}}function vf(t,r,i){i===void 0&&(i=Ol.DEFAULT);var a=hf(t,!1);function s(We){return We?function(){return We(a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}function p(We){return We?function(Je){return We(Je,a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}var y=s(r.onObjectBegin),E=p(r.onObjectProperty),w=s(r.onObjectEnd),A=s(r.onArrayBegin),k=s(r.onArrayEnd),G=p(r.onLiteralValue),ne=p(r.onSeparator),re=s(r.onComment),se=p(r.onError),ye=i&&i.disallowComments,ge=i&&i.allowTrailingComma;function Ee(){for(;;){var We=a.scan();switch(a.getTokenError()){case 4:me(14);break;case 5:me(15);break;case 3:me(13);break;case 1:ye||me(11);break;case 2:me(12);break;case 6:me(16);break}switch(We){case 12:case 13:ye?me(10):re();break;case 16:me(1);break;case 15:case 14:break;default:return We}}}function me(We,Je,ze){if(Je===void 0&&(Je=[]),ze===void 0&&(ze=[]),se(We),Je.length+ze.length>0)for(var et=a.getToken();et!==17;){if(Je.indexOf(et)!==-1){Ee();break}else if(ze.indexOf(et)!==-1)break;et=Ee()}}function Pe(We){var Je=a.getTokenValue();return We?G(Je):E(Je),Ee(),!0}function Ge(){switch(a.getToken()){case 11:var We=a.getTokenValue(),Je=Number(We);isNaN(Je)&&(me(2),Je=0),G(Je);break;case 7:G(null);break;case 8:G(!0);break;case 9:G(!1);break;default:return!1}return Ee(),!0}function je(){return a.getToken()!==10?(me(3,[],[2,5]),!1):(Pe(!1),a.getToken()===6?(ne(":"),Ee(),Ve()||me(4,[],[2,5])):me(5,[],[2,5]),!0)}function He(){y(),Ee();for(var We=!1;a.getToken()!==2&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ne(","),Ee(),a.getToken()===2&&ge)break}else We&&me(6,[],[]);je()||me(4,[],[2,5]),We=!0}return w(),a.getToken()!==2?me(7,[2],[]):Ee(),!0}function Ne(){A(),Ee();for(var We=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ne(","),Ee(),a.getToken()===4&&ge)break}else We&&me(6,[],[]);Ve()||me(4,[],[4,5]),We=!0}return k(),a.getToken()!==4?me(8,[4],[]):Ee(),!0}function Ve(){switch(a.getToken()){case 3:return Ne();case 1:return He();case 10:return Pe(!0);default:return Ge()}}return Ee(),a.getToken()===17?i.allowEmptyContent?!0:(me(4,[],[]),!1):Ve()?(a.getToken()!==17&&me(9,[],[]),!0):(me(4,[],[]),!1)}function cg(t,r){var i=hf(t),a=[],s,p=0,y;do switch(y=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:p!==y&&a.push(t.substring(p,y)),r!==void 0&&a.push(i.getTokenValue().replace(/[^\r\n]/g,r)),p=i.getPosition();break}while(s!==17);return a.join("")}function sp(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}function Mm(t,r,i){return dg(t,r,void 0,i)}function dg(t,r,i,a){for(var s,p=r.slice(),y=[],E=parseTree(t,y),w=void 0,A=void 0;p.length>0&&(A=p.pop(),w=findNodeAtLocation(E,p),w===void 0&&i!==void 0);)typeof A=="string"?i=(s={},s[A]=i,s):i=[i];if(w)if(w.type==="object"&&typeof A=="string"&&Array.isArray(w.children)){var k=findNodeAtLocation(w,[A]);if(k!==void 0)if(i===void 0){if(!k.parent)throw new Error("Malformed AST");var G=w.children.indexOf(k.parent),ne=void 0,re=k.parent.offset+k.parent.length;if(G>0){var se=w.children[G-1];ne=se.offset+se.length}else if(ne=w.offset+1,w.children.length>1){var ye=w.children[1];re=ye.offset}return ca(t,{offset:ne,length:re-ne,content:""},a)}else return ca(t,{offset:k.offset,length:k.length,content:JSON.stringify(i)},a);else{if(i===void 0)return[];var ge=JSON.stringify(A)+": "+JSON.stringify(i),Ee=a.getInsertionIndex?a.getInsertionIndex(w.children.map(function(We){return We.children[0].value})):w.children.length,me=void 0;if(Ee>0){var se=w.children[Ee-1];me={offset:se.offset+se.length,length:0,content:","+ge}}else w.children.length===0?me={offset:w.offset+1,length:0,content:ge}:me={offset:w.offset+1,length:0,content:ge+","};return ca(t,me,a)}}else if(w.type==="array"&&typeof A=="number"&&Array.isArray(w.children)){var Pe=A;if(Pe===-1){var ge=""+JSON.stringify(i),me=void 0;if(w.children.length===0)me={offset:w.offset+1,length:0,content:ge};else{var se=w.children[w.children.length-1];me={offset:se.offset+se.length,length:0,content:","+ge}}return ca(t,me,a)}else if(i===void 0&&w.children.length>=0){var Ge=A,je=w.children[Ge],me=void 0;if(w.children.length===1)me={offset:w.offset+1,length:w.length-2,content:""};else if(w.children.length-1===Ge){var se=w.children[Ge-1],He=se.offset+se.length,Ne=w.offset+w.length;me={offset:He,length:Ne-2-He,content:""}}else me={offset:je.offset,length:w.children[Ge+1].offset-je.offset,content:""};return ca(t,me,a)}else if(i!==void 0){var me=void 0,ge=""+JSON.stringify(i);if(!a.isArrayInsertion&&w.children.length>A){var Ve=w.children[A];me={offset:Ve.offset,length:Ve.length,content:ge}}else if(w.children.length===0||A===0)me={offset:w.offset+1,length:0,content:w.children.length===0?ge:ge+","};else{var Ee=A>w.children.length?w.children.length:A,se=w.children[Ee-1];me={offset:se.offset+se.length,length:0,content:","+ge}}return ca(t,me,a)}else throw new Error("Can not "+(i===void 0?"remove":a.isArrayInsertion?"insert":"modify")+" Array index "+Pe+" as length is not sufficient")}else throw new Error("Can not add "+(typeof A!="number"?"index":"property")+" to parent of type "+w.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return ca(t,{offset:E?E.offset:0,length:E?E.length:0,content:JSON.stringify(i)},a)}}function ca(t,r,i){if(!i.formattingOptions)return[r];var a=lp(t,r),s=r.offset,p=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(a,s-1);)s--;for(;p<a.length&&!isEOL(a,p);)p++}for(var y=format(a,{offset:s,length:p-s},i.formattingOptions),E=y.length-1;E>=0;E--){var w=y[E];a=lp(a,w),s=Math.min(s,w.offset),p=Math.max(p,w.offset+w.length),p+=w.content.length-w.length}var A=t.length-(a.length-p)-s;return[{offset:s,length:A,content:a.substring(s,p)}]}function lp(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function Rm(t,r){return`\r
|
|
374
|
+
`.indexOf(t.charAt(r))!==-1}var ls=hf,Lm=ag,pg=sg,Dm=lg,Nm=ug,hg=ap,vg=op,gg=Yc,Bm=vf,Um=cg;function jm(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function yg(t,r,i){return ng(t,r,i)}function Vm(t,r,i,a){return edit.setProperty(t,r,i,a)}function Wm(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function Tl(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,a;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!Tl(t[i],r[i]))return!1}else{var s=[];for(a in t)s.push(a);s.sort();var p=[];for(a in r)p.push(a);if(p.sort(),!Tl(s,p))return!1;for(i=0;i<s.length;i++)if(!Tl(t[s[i]],r[s[i]]))return!1}return!0}function Yn(t){return typeof t=="number"}function oo(t){return typeof t!="undefined"}function Ri(t){return typeof t=="boolean"}function mg(t){return typeof t=="string"}var up;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(up||(up={}));var gf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(gf||(gf={}));var hi;(function(t){function r(a,s){return a===Number.MAX_VALUE&&(a=gf.MAX_VALUE),s===Number.MAX_VALUE&&(s=gf.MAX_VALUE),{line:a,character:s}}t.create=r;function i(a){var s=a;return _e.objectLiteral(s)&&_e.uinteger(s.line)&&_e.uinteger(s.character)}t.is=i})(hi||(hi={}));var lr;(function(t){function r(a,s,p,y){if(_e.uinteger(a)&&_e.uinteger(s)&&_e.uinteger(p)&&_e.uinteger(y))return{start:hi.create(a,s),end:hi.create(p,y)};if(hi.is(a)&&hi.is(s))return{start:a,end:s};throw new Error("Range#create called with invalid arguments["+a+", "+s+", "+p+", "+y+"]")}t.create=r;function i(a){var s=a;return _e.objectLiteral(s)&&hi.is(s.start)&&hi.is(s.end)}t.is=i})(lr||(lr={}));var Pl;(function(t){function r(a,s){return{uri:a,range:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.range)&&(_e.string(s.uri)||_e.undefined(s.uri))}t.is=i})(Pl||(Pl={}));var fp;(function(t){function r(a,s,p,y){return{targetUri:a,targetRange:s,targetSelectionRange:p,originSelectionRange:y}}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.targetRange)&&_e.string(s.targetUri)&&(lr.is(s.targetSelectionRange)||_e.undefined(s.targetSelectionRange))&&(lr.is(s.originSelectionRange)||_e.undefined(s.originSelectionRange))}t.is=i})(fp||(fp={}));var Jc;(function(t){function r(a,s,p,y){return{red:a,green:s,blue:p,alpha:y}}t.create=r;function i(a){var s=a;return _e.numberRange(s.red,0,1)&&_e.numberRange(s.green,0,1)&&_e.numberRange(s.blue,0,1)&&_e.numberRange(s.alpha,0,1)}t.is=i})(Jc||(Jc={}));var cp;(function(t){function r(a,s){return{range:a,color:s}}t.create=r;function i(a){var s=a;return lr.is(s.range)&&Jc.is(s.color)}t.is=i})(cp||(cp={}));var dp;(function(t){function r(a,s,p){return{label:a,textEdit:s,additionalTextEdits:p}}t.create=r;function i(a){var s=a;return _e.string(s.label)&&(_e.undefined(s.textEdit)||vi.is(s))&&(_e.undefined(s.additionalTextEdits)||_e.typedArray(s.additionalTextEdits,vi.is))}t.is=i})(dp||(dp={}));var Il;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Il||(Il={}));var pp;(function(t){function r(a,s,p,y,E){var w={startLine:a,endLine:s};return _e.defined(p)&&(w.startCharacter=p),_e.defined(y)&&(w.endCharacter=y),_e.defined(E)&&(w.kind=E),w}t.create=r;function i(a){var s=a;return _e.uinteger(s.startLine)&&_e.uinteger(s.startLine)&&(_e.undefined(s.startCharacter)||_e.uinteger(s.startCharacter))&&(_e.undefined(s.endCharacter)||_e.uinteger(s.endCharacter))&&(_e.undefined(s.kind)||_e.string(s.kind))}t.is=i})(pp||(pp={}));var Xc;(function(t){function r(a,s){return{location:a,message:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&Pl.is(s.location)&&_e.string(s.message)}t.is=i})(Xc||(Xc={}));var $t;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})($t||($t={}));var hp;(function(t){t.Unnecessary=1,t.Deprecated=2})(hp||(hp={}));var vp;(function(t){function r(i){var a=i;return a!=null&&_e.string(a.href)}t.is=r})(vp||(vp={}));var ao;(function(t){function r(a,s,p,y,E,w){var A={range:a,message:s};return _e.defined(p)&&(A.severity=p),_e.defined(y)&&(A.code=y),_e.defined(E)&&(A.source=E),_e.defined(w)&&(A.relatedInformation=w),A}t.create=r;function i(a){var s,p=a;return _e.defined(p)&&lr.is(p.range)&&_e.string(p.message)&&(_e.number(p.severity)||_e.undefined(p.severity))&&(_e.integer(p.code)||_e.string(p.code)||_e.undefined(p.code))&&(_e.undefined(p.codeDescription)||_e.string((s=p.codeDescription)===null||s===void 0?void 0:s.href))&&(_e.string(p.source)||_e.undefined(p.source))&&(_e.undefined(p.relatedInformation)||_e.typedArray(p.relatedInformation,Xc.is))}t.is=i})(ao||(ao={}));var Fl;(function(t){function r(a,s){for(var p=[],y=2;y<arguments.length;y++)p[y-2]=arguments[y];var E={title:a,command:s};return _e.defined(p)&&p.length>0&&(E.arguments=p),E}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.title)&&_e.string(s.command)}t.is=i})(Fl||(Fl={}));var vi;(function(t){function r(p,y){return{range:p,newText:y}}t.replace=r;function i(p,y){return{range:{start:p,end:p},newText:y}}t.insert=i;function a(p){return{range:p,newText:""}}t.del=a;function s(p){var y=p;return _e.objectLiteral(y)&&_e.string(y.newText)&&lr.is(y.range)}t.is=s})(vi||(vi={}));var us;(function(t){function r(a,s,p){var y={label:a};return s!==void 0&&(y.needsConfirmation=s),p!==void 0&&(y.description=p),y}t.create=r;function i(a){var s=a;return s!==void 0&&_e.objectLiteral(s)&&_e.string(s.label)&&(_e.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(_e.string(s.description)||s.description===void 0)}t.is=i})(us||(us={}));var wn;(function(t){function r(i){var a=i;return typeof a=="string"}t.is=r})(wn||(wn={}));var Co;(function(t){function r(p,y,E){return{range:p,newText:y,annotationId:E}}t.replace=r;function i(p,y,E){return{range:{start:p,end:p},newText:y,annotationId:E}}t.insert=i;function a(p,y){return{range:p,newText:"",annotationId:y}}t.del=a;function s(p){var y=p;return vi.is(y)&&(us.is(y.annotationId)||wn.is(y.annotationId))}t.is=s})(Co||(Co={}));var yf;(function(t){function r(a,s){return{textDocument:a,edits:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&xf.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(yf||(yf={}));var kl;(function(t){function r(a,s,p){var y={kind:"create",uri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="create"&&_e.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||_e.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||_e.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||wn.is(s.annotationId))}t.is=i})(kl||(kl={}));var Ml;(function(t){function r(a,s,p,y){var E={kind:"rename",oldUri:a,newUri:s};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(E.options=p),y!==void 0&&(E.annotationId=y),E}t.create=r;function i(a){var s=a;return s&&s.kind==="rename"&&_e.string(s.oldUri)&&_e.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||_e.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||_e.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||wn.is(s.annotationId))}t.is=i})(Ml||(Ml={}));var Rl;(function(t){function r(a,s,p){var y={kind:"delete",uri:a};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="delete"&&_e.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||_e.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||_e.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||wn.is(s.annotationId))}t.is=i})(Rl||(Rl={}));var Qc;(function(t){function r(i){var a=i;return a&&(a.changes!==void 0||a.documentChanges!==void 0)&&(a.documentChanges===void 0||a.documentChanges.every(function(s){return _e.string(s.kind)?kl.is(s)||Ml.is(s)||Rl.is(s):yf.is(s)}))}t.is=r})(Qc||(Qc={}));var mf=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,a){var s,p;if(a===void 0?s=vi.insert(r,i):wn.is(a)?(p=a,s=Co.insert(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Co.insert(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.replace=function(r,i,a){var s,p;if(a===void 0?s=vi.replace(r,i):wn.is(a)?(p=a,s=Co.replace(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Co.replace(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.delete=function(r,i){var a,s;if(i===void 0?a=vi.del(r):wn.is(i)?(s=i,a=Co.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),a=Co.del(r,s)),this.edits.push(a),s!==void 0)return s},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),gp=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var a;if(wn.is(r)?a=r:(a=this.nextId(),i=r),this._annotations[a]!==void 0)throw new Error("Id "+a+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+a);return this._annotations[a]=i,this._size++,a},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),Hm=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new gp(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(a){if(yf.is(a)){var s=new mf(a.edits,i._changeAnnotations);i._textEditChanges[a.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(a){var s=new mf(r.changes[a]);i._textEditChanges[a]=s})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(xf.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},a=this._textEditChanges[i.uri];if(!a){var s=[],p={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(p),a=new mf(s,this._changeAnnotations),this._textEditChanges[i.uri]=a}return a}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var a=this._textEditChanges[r];if(!a){var s=[];this._workspaceEdit.changes[r]=s,a=new mf(s),this._textEditChanges[r]=a}return a}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new gp,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;us.is(i)||wn.is(i)?s=i:a=i;var p,y;if(s===void 0?p=kl.create(r,a):(y=wn.is(s)?s:this._changeAnnotations.manage(s),p=kl.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t.prototype.renameFile=function(r,i,a,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;us.is(a)||wn.is(a)?p=a:s=a;var y,E;if(p===void 0?y=Ml.create(r,i,s):(E=wn.is(p)?p:this._changeAnnotations.manage(p),y=Ml.create(r,i,s,E)),this._workspaceEdit.documentChanges.push(y),E!==void 0)return E},t.prototype.deleteFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;us.is(i)||wn.is(i)?s=i:a=i;var p,y;if(s===void 0?p=Rl.create(r,a):(y=wn.is(s)?s:this._changeAnnotations.manage(s),p=Rl.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t}(),yp;(function(t){function r(a){return{uri:a}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)}t.is=i})(yp||(yp={}));var mp;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)&&_e.integer(s.version)}t.is=i})(mp||(mp={}));var xf;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)&&(s.version===null||_e.integer(s.version))}t.is=i})(xf||(xf={}));var xp;(function(t){function r(a,s,p,y){return{uri:a,languageId:s,version:p,text:y}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.string(s.uri)&&_e.string(s.languageId)&&_e.integer(s.version)&&_e.string(s.text)}t.is=i})(xp||(xp={}));var so;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(so||(so={})),function(t){function r(i){var a=i;return a===t.PlainText||a===t.Markdown}t.is=r}(so||(so={}));var Zc;(function(t){function r(i){var a=i;return _e.objectLiteral(i)&&so.is(a.kind)&&_e.string(a.value)}t.is=r})(Zc||(Zc={}));var Jn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Jn||(Jn={}));var Zr;(function(t){t.PlainText=1,t.Snippet=2})(Zr||(Zr={}));var bp;(function(t){t.Deprecated=1})(bp||(bp={}));var wp;(function(t){function r(a,s,p){return{newText:a,insert:s,replace:p}}t.create=r;function i(a){var s=a;return s&&_e.string(s.newText)&&lr.is(s.insert)&&lr.is(s.replace)}t.is=i})(wp||(wp={}));var Sp;(function(t){t.asIs=1,t.adjustIndentation=2})(Sp||(Sp={}));var _c;(function(t){function r(i){return{label:i}}t.create=r})(_c||(_c={}));var Ap;(function(t){function r(i,a){return{items:i||[],isIncomplete:!!a}}t.create=r})(Ap||(Ap={}));var bf;(function(t){function r(a){return a.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(a){var s=a;return _e.string(s)||_e.objectLiteral(s)&&_e.string(s.language)&&_e.string(s.value)}t.is=i})(bf||(bf={}));var Ep;(function(t){function r(i){var a=i;return!!a&&_e.objectLiteral(a)&&(Zc.is(a.contents)||bf.is(a.contents)||_e.typedArray(a.contents,bf.is))&&(i.range===void 0||lr.is(i.range))}t.is=r})(Ep||(Ep={}));var Cp;(function(t){function r(i,a){return a?{label:i,documentation:a}:{label:i}}t.create=r})(Cp||(Cp={}));var Op;(function(t){function r(i,a){for(var s=[],p=2;p<arguments.length;p++)s[p-2]=arguments[p];var y={label:i};return _e.defined(a)&&(y.documentation=a),_e.defined(s)?y.parameters=s:y.parameters=[],y}t.create=r})(Op||(Op={}));var Tp;(function(t){t.Text=1,t.Read=2,t.Write=3})(Tp||(Tp={}));var Pp;(function(t){function r(i,a){var s={range:i};return _e.number(a)&&(s.kind=a),s}t.create=r})(Pp||(Pp={}));var Li;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Li||(Li={}));var Ip;(function(t){t.Deprecated=1})(Ip||(Ip={}));var Fp;(function(t){function r(i,a,s,p,y){var E={name:i,kind:a,location:{uri:p,range:s}};return y&&(E.containerName=y),E}t.create=r})(Fp||(Fp={}));var kp;(function(t){function r(a,s,p,y,E,w){var A={name:a,detail:s,kind:p,range:y,selectionRange:E};return w!==void 0&&(A.children=w),A}t.create=r;function i(a){var s=a;return s&&_e.string(s.name)&&_e.number(s.kind)&&lr.is(s.range)&&lr.is(s.selectionRange)&&(s.detail===void 0||_e.string(s.detail))&&(s.deprecated===void 0||_e.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(kp||(kp={}));var Mp;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Mp||(Mp={}));var Rp;(function(t){function r(a,s){var p={diagnostics:a};return s!=null&&(p.only=s),p}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.typedArray(s.diagnostics,ao.is)&&(s.only===void 0||_e.typedArray(s.only,_e.string))}t.is=i})(Rp||(Rp={}));var Lp;(function(t){function r(a,s,p){var y={title:a},E=!0;return typeof s=="string"?(E=!1,y.kind=s):Fl.is(s)?y.command=s:y.edit=s,E&&p!==void 0&&(y.kind=p),y}t.create=r;function i(a){var s=a;return s&&_e.string(s.title)&&(s.diagnostics===void 0||_e.typedArray(s.diagnostics,ao.is))&&(s.kind===void 0||_e.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Fl.is(s.command))&&(s.isPreferred===void 0||_e.boolean(s.isPreferred))&&(s.edit===void 0||Qc.is(s.edit))}t.is=i})(Lp||(Lp={}));var Dp;(function(t){function r(a,s){var p={range:a};return _e.defined(s)&&(p.data=s),p}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.range)&&(_e.undefined(s.command)||Fl.is(s.command))}t.is=i})(Dp||(Dp={}));var Np;(function(t){function r(a,s){return{tabSize:a,insertSpaces:s}}t.create=r;function i(a){var s=a;return _e.defined(s)&&_e.uinteger(s.tabSize)&&_e.boolean(s.insertSpaces)}t.is=i})(Np||(Np={}));var Bp;(function(t){function r(a,s,p){return{range:a,target:s,data:p}}t.create=r;function i(a){var s=a;return _e.defined(s)&&lr.is(s.range)&&(_e.undefined(s.target)||_e.string(s.target))}t.is=i})(Bp||(Bp={}));var wf;(function(t){function r(a,s){return{range:a,parent:s}}t.create=r;function i(a){var s=a;return s!==void 0&&lr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(wf||(wf={}));var zm=null,Up;(function(t){function r(p,y,E,w){return new xg(p,y,E,w)}t.create=r;function i(p){var y=p;return!!(_e.defined(y)&&_e.string(y.uri)&&(_e.undefined(y.languageId)||_e.string(y.languageId))&&_e.uinteger(y.lineCount)&&_e.func(y.getText)&&_e.func(y.positionAt)&&_e.func(y.offsetAt))}t.is=i;function a(p,y){for(var E=p.getText(),w=s(y,function(se,ye){var ge=se.range.start.line-ye.range.start.line;return ge===0?se.range.start.character-ye.range.start.character:ge}),A=E.length,k=w.length-1;k>=0;k--){var G=w[k],ne=p.offsetAt(G.range.start),re=p.offsetAt(G.range.end);if(re<=A)E=E.substring(0,ne)+G.newText+E.substring(re,E.length);else throw new Error("Overlapping edit");A=ne}return E}t.applyEdits=a;function s(p,y){if(p.length<=1)return p;var E=p.length/2|0,w=p.slice(0,E),A=p.slice(E);s(w,y),s(A,y);for(var k=0,G=0,ne=0;k<w.length&&G<A.length;){var re=y(w[k],A[G]);re<=0?p[ne++]=w[k++]:p[ne++]=A[G++]}for(;k<w.length;)p[ne++]=w[k++];for(;G<A.length;)p[ne++]=A[G++];return p}})(Up||(Up={}));var xg=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){this._content=r.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var r=[],i=this._content,a=!0,s=0;s<i.length;s++){a&&(r.push(s),a=!1);var p=i.charAt(s);a=p==="\r"||p===`
|
|
375
375
|
`,p==="\r"&&s+1<i.length&&i.charAt(s+1)===`
|
|
376
|
-
`&&s++}a&&i.length>0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return hi.create(0,r);for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return hi.create(y,r-i[y])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),_e;(function(t){var r=Object.prototype.toString;function i(re){return typeof re!="undefined"}t.defined=i;function a(re){return typeof re=="undefined"}t.undefined=a;function s(re){return re===!0||re===!1}t.boolean=s;function p(re){return r.call(re)==="[object String]"}t.string=p;function y(re){return r.call(re)==="[object Number]"}t.number=y;function E(re,se,ye){return r.call(re)==="[object Number]"&&se<=re&&re<=ye}t.numberRange=E;function w(re){return r.call(re)==="[object Number]"&&-2147483648<=re&&re<=2147483647}t.integer=w;function A(re){return r.call(re)==="[object Number]"&&0<=re&&re<=2147483647}t.uinteger=A;function k(re){return r.call(re)==="[object Function]"}t.func=k;function G(re){return re!==null&&typeof re=="object"}t.objectLiteral=G;function ne(re,se){return Array.isArray(re)&&re.every(se)}t.typedArray=ne})(_e||(_e={}));var Up=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){for(var a=0,s=r;a<s.length;a++){var p=s[a];if(t.isIncremental(p)){var y=Vp(p.range),E=this.offsetAt(y.start),w=this.offsetAt(y.end);this._content=this._content.substring(0,E)+p.text+this._content.substring(w,this._content.length);var A=Math.max(y.start.line,0),k=Math.max(y.end.line,0),G=this._lineOffsets,ne=jp(p.text,!1,E);if(k-A===ne.length)for(var re=0,se=ne.length;re<se;re++)G[re+A+1]=ne[re];else ne.length<1e4?G.splice.apply(G,[A+1,k-A].concat(ne)):this._lineOffsets=G=G.slice(0,A+1).concat(ne,G.slice(k+1));var ye=p.text.length-(w-E);if(ye!==0)for(var re=A+1+ne.length,se=G.length;re<se;re++)G[re]=G[re]+ye}else if(t.isFull(p))this._content=p.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=i},t.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=jp(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return{line:0,character:r};for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return{line:y,character:r-i[y]}},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),t.isIncremental=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")},t.isFull=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0},t}(),Sf;(function(t){function r(s,p,y,E){return new Up(s,p,y,E)}t.create=r;function i(s,p,y){if(s instanceof Up)return s.update(p,y),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function a(s,p){for(var y=s.getText(),E=qc(p.map(bg),function(se,ye){var ge=se.range.start.line-ye.range.start.line;return ge===0?se.range.start.character-ye.range.start.character:ge}),w=0,A=[],k=0,G=E;k<G.length;k++){var ne=G[k],re=s.offsetAt(ne.range.start);if(re<w)throw new Error("Overlapping edit");re>w&&A.push(y.substring(w,re)),ne.newText.length&&A.push(ne.newText),w=s.offsetAt(ne.range.end)}return A.push(y.substr(w)),A.join("")}t.applyEdits=a})(Sf||(Sf={}));function qc(t,r){if(t.length<=1)return t;var i=t.length/2|0,a=t.slice(0,i),s=t.slice(i);qc(a,r),qc(s,r);for(var p=0,y=0,E=0;p<a.length&&y<s.length;){var w=r(a[p],s[y]);w<=0?t[E++]=a[p++]:t[E++]=s[y++]}for(;p<a.length;)t[E++]=a[p++];for(;y<s.length;)t[E++]=s[y++];return t}function jp(t,r,i){i===void 0&&(i=0);for(var a=r?[i]:[],s=0;s<t.length;s++){var p=t.charCodeAt(s);(p===13||p===10)&&(p===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,a.push(i+s+1))}return a}function Vp(t){var r=t.start,i=t.end;return r.line>i.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function bg(t){var r=Vp(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var tr;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(tr||(tr={}));var Wp;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[so.Markdown,so.PlainText],commitCharactersSupport:!0}}}}})(Wp||(Wp={}));var da=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),wg={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},pa=function(){function t(r,i,a){this.offset=i,this.length=a,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}(),Sg=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="null",s.value=null,s}return r}(pa),Hp=function(t){da(r,t);function r(i,a,s){var p=t.call(this,i,s)||this;return p.type="boolean",p.value=a,p}return r}(pa),Ag=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(pa),Eg=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(pa),zp=function(t){da(r,t);function r(i,a,s){var p=t.call(this,i,a,s)||this;return p.type="string",p.value="",p}return r}(pa),Cg=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="property",s.colonOffset=-1,s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),r}(pa),Og=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(pa);function Mn(t){return Ri(t)?t?{}:{not:{}}:t}var Gp;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(Gp||(Gp={}));var Tg=function(){function t(r,i){r===void 0&&(r=-1),i===void 0&&(i=null),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){var i;(i=this.schemas).push.apply(i,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||$p(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),ed=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),Rn=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,a=r;i<a.length;i++){var s=a[i];this.merge(s)}},t.prototype.merge=function(r){this.problems=this.problems.concat(r.problems)},t.prototype.mergeEnumValues=function(r){if(!this.enumValueMatch&&!r.enumValueMatch&&this.enumValues&&r.enumValues){this.enumValues=this.enumValues.concat(r.enumValues);for(var i=0,a=this.problems;i<a.length;i++){var s=a[i];s.code===tr.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(p){return JSON.stringify(p)}).join(", ")+".")}}},t.prototype.mergePropertyMatch=function(r){this.merge(r),this.propertiesMatches++,(r.enumValueMatch||!r.hasProblems()&&r.propertiesMatches)&&this.propertiesValueMatches++,r.enumValueMatch&&r.enumValues&&r.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(r){var i=this.hasProblems();return i!==r.hasProblems()?i?-1:1:this.enumValueMatch!==r.enumValueMatch?r.enumValueMatch?-1:1:this.primaryValueMatches!==r.primaryValueMatches?this.primaryValueMatches-r.primaryValueMatches:this.propertiesValueMatches!==r.propertiesValueMatches?this.propertiesValueMatches-r.propertiesValueMatches:this.propertiesMatches-r.propertiesMatches},t}();function Pg(t,r){return r===void 0&&(r=[]),new Kp(t,r,[])}function Oo(t){return gg(t)}function td(t){return vg(t)}function $p(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var Kp=function(){function t(r,i,a){i===void 0&&(i=[]),a===void 0&&(a=[]),this.root=r,this.syntaxErrors=i,this.comments=a}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return hg(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(a){var s=r(a),p=a.children;if(Array.isArray(p))for(var y=0;y<p.length&&s;y++)s=i(p[y]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var a=new Rn;return dn(this.root,i,a,ed.instance),a.problems.map(function(s){var p=lr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return ao.create(p,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,a){i===void 0&&(i=-1),a===void 0&&(a=null);var s=new Tg(i,a);return this.root&&r&&dn(this.root,r,new Rn,s),s.schemas},t}();function dn(t,r,i,a){if(!t||!a.include(t))return;switch(t.type){case"object":w(t,r,i,a);break;case"array":E(t,r,i,a);break;case"string":y(t,r,i,a);break;case"number":p(t,r,i,a);break;case"property":return dn(t.valueNode,r,i,a)}s(),a.add({node:t,schema:r});function s(){function A(et){return t.type===et||et==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(A)||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(A(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var k=0,G=r.allOf;k<G.length;k++){var ne=G[k];dn(t,Mn(ne),i,a)}var re=Mn(r.not);if(re){var se=new Rn,ye=a.newSub();dn(t,re,se,ye),se.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,message:"Matches a schema that is not allowed."});for(var ge=0,Ee=ye.schemas;ge<Ee.length;ge++){var me=Ee[ge];me.inverted=!me.inverted,a.add(me)}}var Pe=function(et,At){for(var Nt=[],Ht=null,or=0,Mr=et;or<Mr.length;or++){var Cr=Mr[or],Jr=Mn(Cr),wr=new Rn,Dr=a.newSub();if(dn(t,Jr,wr,Dr),wr.hasProblems()||Nt.push(Jr),!Ht)Ht={schema:Jr,validationResult:wr,matchingSchemas:Dr};else if(!At&&!wr.hasProblems()&&!Ht.validationResult.hasProblems())Ht.matchingSchemas.merge(Dr),Ht.validationResult.propertiesMatches+=wr.propertiesMatches,Ht.validationResult.propertiesValueMatches+=wr.propertiesValueMatches;else{var Sn=wr.compare(Ht.validationResult);Sn>0?Ht={schema:Jr,validationResult:wr,matchingSchemas:Dr}:Sn===0&&(Ht.matchingSchemas.merge(Dr),Ht.validationResult.mergeEnumValues(wr))}}return Nt.length>1&&At&&i.problems.push({location:{offset:t.offset,length:1},severity:$t.Warning,message:"Matches multiple schemas when only one must validate."}),Ht!==null&&(i.merge(Ht.validationResult),i.propertiesMatches+=Ht.validationResult.propertiesMatches,i.propertiesValueMatches+=Ht.validationResult.propertiesValueMatches,a.merge(Ht.matchingSchemas)),Nt.length};Array.isArray(r.anyOf)&&Pe(r.anyOf,!1),Array.isArray(r.oneOf)&&Pe(r.oneOf,!0);var Ge=function(et){var At=new Rn,Nt=a.newSub();dn(t,Mn(et),At,Nt),i.merge(At),i.propertiesMatches+=At.propertiesMatches,i.propertiesValueMatches+=At.propertiesValueMatches,a.merge(Nt)},je=function(et,At,Nt){var Ht=Mn(et),or=new Rn,Mr=a.newSub();dn(t,Ht,or,Mr),a.merge(Mr),or.hasProblems()?Nt&&Ge(Nt):At&&Ge(At)},He=Mn(r.if);if(He&&je(He,Mn(r.then),Mn(r.else)),Array.isArray(r.enum)){for(var Ne=Oo(t),Ve=!1,We=0,Je=r.enum;We<Je.length;We++){var ze=Je[We];if(Ol(Ne,ze)){Ve=!0;break}}i.enumValues=r.enum,i.enumValueMatch=Ve,Ve||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,code:tr.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(et){return JSON.stringify(et)}).join(", ")+"."})}if(oo(r.const)){var Ne=Oo(t);Ol(Ne,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,code:tr.EnumValueMismatch,message:r.errorMessage||"Value must be "+JSON.stringify(r.const)+"."}),i.enumValueMatch=!1),i.enumValues=[r.const]}r.deprecationMessage&&t.parent&&i.problems.push({location:{offset:t.parent.offset,length:t.parent.length},severity:$t.Warning,message:r.deprecationMessage})}function p(A,k,G,ne){var re=A.value;Yn(k.multipleOf)&&re%k.multipleOf!=0&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is not divisible by "+k.multipleOf+"."});function se(Ge,je){if(Yn(je))return je;if(Ri(je)&&je)return Ge}function ye(Ge,je){if(!Ri(je)||!je)return Ge}var ge=se(k.minimum,k.exclusiveMinimum);Yn(ge)&&re<=ge&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is below the exclusive minimum of "+ge+"."});var Ee=se(k.maximum,k.exclusiveMaximum);Yn(Ee)&&re>=Ee&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is above the exclusive maximum of "+Ee+"."});var me=ye(k.minimum,k.exclusiveMinimum);Yn(me)&&re<me&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is below the minimum of "+me+"."});var Pe=ye(k.maximum,k.exclusiveMaximum);Yn(Pe)&&re>Pe&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is above the maximum of "+Pe+"."})}function y(A,k,G,ne){if(Yn(k.minLength)&&A.value.length<k.minLength&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"String is shorter than the minimum length of "+k.minLength+"."}),Yn(k.maxLength)&&A.value.length>k.maxLength&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"String is longer than the maximum length of "+k.maxLength+"."}),mg(k.pattern)){var re=new RegExp(k.pattern);re.test(A.value)||G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.patternErrorMessage||k.errorMessage||'String does not match the pattern of "'+k.pattern+'".'})}if(k.format)switch(k.format){case"uri":case"uri-reference":{var se=void 0;if(!A.value)se="URI expected.";else{var ye=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(A.value);ye?!ye[2]&&k.format==="uri"&&(se="URI with a scheme is expected."):se="URI is expected."}se&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.patternErrorMessage||k.errorMessage||"String is not a URI: "+se})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var ge=wg[k.format];(!A.value||!ge.pattern.exec(A.value))&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.patternErrorMessage||k.errorMessage||ge.errorMessage});break;default:}}function E(A,k,G,ne){if(Array.isArray(k.items)){for(var re=k.items,se=0;se<re.length;se++){var ye=re[se],ge=Mn(ye),Ee=new Rn,me=A.items[se];me?(dn(me,ge,Ee,ne),G.mergePropertyMatch(Ee)):A.items.length>=re.length&&G.propertiesValueMatches++}if(A.items.length>re.length)if(typeof k.additionalItems=="object")for(var Pe=re.length;Pe<A.items.length;Pe++){var Ee=new Rn;dn(A.items[Pe],k.additionalItems,Ee,ne),G.mergePropertyMatch(Ee)}else k.additionalItems===!1&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has too many items according to schema. Expected "+re.length+" or fewer."})}else{var Ge=Mn(k.items);if(Ge)for(var je=0,He=A.items;je<He.length;je++){var me=He[je],Ee=new Rn;dn(me,Ge,Ee,ne),G.mergePropertyMatch(Ee)}}var Ne=Mn(k.contains);if(Ne){var Ve=A.items.some(function(ze){var et=new Rn;return dn(ze,Ne,et,ed.instance),!et.hasProblems()});Ve||G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.errorMessage||"Array does not contain required item."})}if(Yn(k.minItems)&&A.items.length<k.minItems&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has too few items. Expected "+k.minItems+" or more."}),Yn(k.maxItems)&&A.items.length>k.maxItems&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has too many items. Expected "+k.maxItems+" or fewer."}),k.uniqueItems===!0){var We=Oo(A),Je=We.some(function(ze,et){return et!==We.lastIndexOf(ze)});Je&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has duplicate items."})}}function w(A,k,G,ne){for(var re=Object.create(null),se=[],ye=0,ge=A.properties;ye<ge.length;ye++){var Ee=ge[ye],me=Ee.keyNode.value;re[me]=Ee.valueNode,se.push(me)}if(Array.isArray(k.required))for(var Pe=0,Ge=k.required;Pe<Ge.length;Pe++){var je=Ge[Pe];if(!re[je]){var He=A.parent&&A.parent.type==="property"&&A.parent.keyNode,Ne=He?{offset:He.offset,length:He.length}:{offset:A.offset,length:1};G.problems.push({location:Ne,severity:$t.Warning,message:'Missing property "'+je+'".'})}}var Ve=function(yi){for(var Nl=se.indexOf(yi);Nl>=0;)se.splice(Nl,1),Nl=se.indexOf(yi)};if(k.properties)for(var We=0,Je=Object.keys(k.properties);We<Je.length;We++){var je=Je[We];Ve(je);var ze=k.properties[je],et=re[je];if(et)if(Ri(ze))if(ze)G.propertiesMatches++,G.propertiesValueMatches++;else{var Ee=et.parent;G.problems.push({location:{offset:Ee.keyNode.offset,length:Ee.keyNode.length},severity:$t.Warning,message:k.errorMessage||"Property "+je+" is not allowed."})}else{var At=new Rn;dn(et,ze,At,ne),G.mergePropertyMatch(At)}}if(k.patternProperties)for(var Nt=0,Ht=Object.keys(k.patternProperties);Nt<Ht.length;Nt++)for(var or=Ht[Nt],Mr=new RegExp(or),Cr=0,Jr=se.slice(0);Cr<Jr.length;Cr++){var je=Jr[Cr];if(Mr.test(je)){Ve(je);var et=re[je];if(et){var ze=k.patternProperties[or];if(Ri(ze))if(ze)G.propertiesMatches++,G.propertiesValueMatches++;else{var Ee=et.parent;G.problems.push({location:{offset:Ee.keyNode.offset,length:Ee.keyNode.length},severity:$t.Warning,message:k.errorMessage||"Property "+je+" is not allowed."})}else{var At=new Rn;dn(et,ze,At,ne),G.mergePropertyMatch(At)}}}}if(typeof k.additionalProperties=="object")for(var wr=0,Dr=se;wr<Dr.length;wr++){var je=Dr[wr],et=re[je];if(et){var At=new Rn;dn(et,k.additionalProperties,At,ne),G.mergePropertyMatch(At)}}else if(k.additionalProperties===!1&&se.length>0)for(var Sn=0,Yt=se;Sn<Yt.length;Sn++){var je=Yt[Sn],et=re[je];if(et){var Ee=et.parent;G.problems.push({location:{offset:Ee.keyNode.offset,length:Ee.keyNode.length},severity:$t.Warning,message:k.errorMessage||"Property "+je+" is not allowed."})}}if(Yn(k.maxProperties)&&A.properties.length>k.maxProperties&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Object has more properties than limit of "+k.maxProperties+"."}),Yn(k.minProperties)&&A.properties.length<k.minProperties&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Object has fewer properties than the required number of "+k.minProperties}),k.dependencies)for(var Rt=0,Ut=Object.keys(k.dependencies);Rt<Ut.length;Rt++){var me=Ut[Rt],ar=re[me];if(ar){var an=k.dependencies[me];if(Array.isArray(an))for(var mr=0,hs=an;mr<hs.length;mr++){var Ll=hs[mr];re[Ll]?G.propertiesValueMatches++:G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Object is missing property "+Ll+" required by property {$key}."})}else{var ze=Mn(an);if(ze){var At=new Rn;dn(A,ze,At,ne),G.mergePropertyMatch(At)}}}}var ha=Mn(k.propertyNames);if(ha)for(var Di=0,Dl=A.properties;Di<Dl.length;Di++){var Ff=Dl[Di],me=Ff.keyNode;me&&dn(me,ha,G,ed.instance)}}}function Ig(t,r){var i=[],a=-1,s=t.getText(),p=ls(s,!1),y=r&&r.collectComments?[]:void 0;function E(){for(;;){var He=p.scan();switch(G(),He){case 12:case 13:Array.isArray(y)&&y.push(lr.create(t.positionAt(p.getTokenOffset()),t.positionAt(p.getTokenOffset()+p.getTokenLength())));break;case 15:case 14:break;default:return He}}}function w(He){return p.getToken()===He?(E(),!0):!1}function A(He,Ne,Ve,We,Je){if(Je===void 0&&(Je=$t.Error),i.length===0||Ve!==a){var ze=lr.create(t.positionAt(Ve),t.positionAt(We));i.push(ao.create(ze,He,Je,Ne,t.languageId)),a=Ve}}function k(He,Ne,Ve,We,Je){Ve===void 0&&(Ve=null),We===void 0&&(We=[]),Je===void 0&&(Je=[]);var ze=p.getTokenOffset(),et=p.getTokenOffset()+p.getTokenLength();if(ze===et&&ze>0){for(ze--;ze>0&&/\s/.test(s.charAt(ze));)ze--;et=ze+1}if(A(He,Ne,ze,et),Ve&&ne(Ve,!1),We.length+Je.length>0)for(var At=p.getToken();At!==17;){if(We.indexOf(At)!==-1){E();break}else if(Je.indexOf(At)!==-1)break;At=E()}return Ve}function G(){switch(p.getTokenError()){case 4:return k("Invalid unicode sequence in string.",tr.InvalidUnicode),!0;case 5:return k("Invalid escape character in string.",tr.InvalidEscapeCharacter),!0;case 3:return k("Unexpected end of number.",tr.UnexpectedEndOfNumber),!0;case 1:return k("Unexpected end of comment.",tr.UnexpectedEndOfComment),!0;case 2:return k("Unexpected end of string.",tr.UnexpectedEndOfString),!0;case 6:return k("Invalid characters in string. Control characters must be escaped.",tr.InvalidCharacter),!0}return!1}function ne(He,Ne){return He.length=p.getTokenOffset()+p.getTokenLength()-He.offset,Ne&&E(),He}function re(He){if(p.getToken()!==3)return null;var Ne=new Ag(He,p.getTokenOffset());E();for(var Ve=0,We=!1;p.getToken()!==4&&p.getToken()!==17;){if(p.getToken()===5){We||k("Value expected",tr.ValueExpected);var Je=p.getTokenOffset();if(E(),p.getToken()===4){We&&A("Trailing comma",tr.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",tr.CommaExpected);var ze=Pe(Ne,Ve++);ze?Ne.items.push(ze):k("Value expected",tr.ValueExpected,null,[],[4,5]),We=!0}return p.getToken()!==4?k("Expected comma or closing bracket",tr.CommaOrCloseBacketExpected,Ne):ne(Ne,!0)}function se(He,Ne){var Ve=new Cg(He,p.getTokenOffset()),We=ge(Ve);if(!We)if(p.getToken()===16){k("Property keys must be doublequoted",tr.Undefined);var Je=new zp(Ve,p.getTokenOffset(),p.getTokenLength());Je.value=p.getTokenValue(),We=Je,E()}else return null;Ve.keyNode=We;var ze=Ne[We.value];if(ze?(A("Duplicate object key",tr.DuplicateKey,Ve.keyNode.offset,Ve.keyNode.offset+Ve.keyNode.length,$t.Warning),typeof ze=="object"&&A("DuplicateKeyWarning",tr.DuplicateKey,ze.keyNode.offset,ze.keyNode.offset+ze.keyNode.length,$t.Warning),Ne[We.value]=!0):Ne[We.value]=Ve,p.getToken()===6)Ve.colonOffset=p.getTokenOffset(),E();else if(k("Colon expected",tr.ColonExpected),p.getToken()===10&&t.positionAt(We.offset+We.length).line<t.positionAt(p.getTokenOffset()).line)return Ve.length=We.length,Ve;var et=Pe(Ve,We.value);return et?(Ve.valueNode=et,Ve.length=et.offset+et.length-Ve.offset,Ve):k("Value expected",tr.ValueExpected,Ve,[],[2,5])}function ye(He){if(p.getToken()!==1)return null;var Ne=new Og(He,p.getTokenOffset()),Ve=Object.create(null);E();for(var We=!1;p.getToken()!==2&&p.getToken()!==17;){if(p.getToken()===5){We||k("Property expected",tr.PropertyExpected);var Je=p.getTokenOffset();if(E(),p.getToken()===2){We&&A("Trailing comma",tr.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",tr.CommaExpected);var ze=se(Ne,Ve);ze?Ne.properties.push(ze):k("Property expected",tr.PropertyExpected,null,[],[2,5]),We=!0}return p.getToken()!==2?k("Expected comma or closing brace",tr.CommaOrCloseBraceExpected,Ne):ne(Ne,!0)}function ge(He){if(p.getToken()!==10)return null;var Ne=new zp(He,p.getTokenOffset());return Ne.value=p.getTokenValue(),ne(Ne,!0)}function Ee(He){if(p.getToken()!==11)return null;var Ne=new Eg(He,p.getTokenOffset());if(p.getTokenError()===0){var Ve=p.getTokenValue();try{var We=JSON.parse(Ve);if(!Yn(We))return k("Invalid number format.",tr.Undefined,Ne);Ne.value=We}catch(Je){return k("Invalid number format.",tr.Undefined,Ne)}Ne.isInteger=Ve.indexOf(".")===-1}return ne(Ne,!0)}function me(He){var Ne;switch(p.getToken()){case 7:return ne(new Sg(He,p.getTokenOffset()),!0);case 8:return ne(new Hp(He,!0,p.getTokenOffset()),!0);case 9:return ne(new Hp(He,!1,p.getTokenOffset()),!0);default:return null}}function Pe(He,Ne){return re(He)||ye(He)||ge(He)||Ee(He)||me(He)}var Ge=null,je=E();return je!==17&&(Ge=Pe(null,null),Ge?p.getToken()!==17&&k("End of file expected.",tr.Undefined):k("Expected a JSON object, array or literal.",tr.Undefined)),new Kp(Ge,i,y)}function rd(t,r,i){if(t!==null&&typeof t=="object"){var a=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
|
|
376
|
+
`&&s++}a&&i.length>0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return hi.create(0,r);for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return hi.create(y,r-i[y])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),_e;(function(t){var r=Object.prototype.toString;function i(re){return typeof re!="undefined"}t.defined=i;function a(re){return typeof re=="undefined"}t.undefined=a;function s(re){return re===!0||re===!1}t.boolean=s;function p(re){return r.call(re)==="[object String]"}t.string=p;function y(re){return r.call(re)==="[object Number]"}t.number=y;function E(re,se,ye){return r.call(re)==="[object Number]"&&se<=re&&re<=ye}t.numberRange=E;function w(re){return r.call(re)==="[object Number]"&&-2147483648<=re&&re<=2147483647}t.integer=w;function A(re){return r.call(re)==="[object Number]"&&0<=re&&re<=2147483647}t.uinteger=A;function k(re){return r.call(re)==="[object Function]"}t.func=k;function G(re){return re!==null&&typeof re=="object"}t.objectLiteral=G;function ne(re,se){return Array.isArray(re)&&re.every(se)}t.typedArray=ne})(_e||(_e={}));var jp=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){for(var a=0,s=r;a<s.length;a++){var p=s[a];if(t.isIncremental(p)){var y=Wp(p.range),E=this.offsetAt(y.start),w=this.offsetAt(y.end);this._content=this._content.substring(0,E)+p.text+this._content.substring(w,this._content.length);var A=Math.max(y.start.line,0),k=Math.max(y.end.line,0),G=this._lineOffsets,ne=Vp(p.text,!1,E);if(k-A===ne.length)for(var re=0,se=ne.length;re<se;re++)G[re+A+1]=ne[re];else ne.length<1e4?G.splice.apply(G,[A+1,k-A].concat(ne)):this._lineOffsets=G=G.slice(0,A+1).concat(ne,G.slice(k+1));var ye=p.text.length-(w-E);if(ye!==0)for(var re=A+1+ne.length,se=G.length;re<se;re++)G[re]=G[re]+ye}else if(t.isFull(p))this._content=p.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=i},t.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=Vp(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return{line:0,character:r};for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return{line:y,character:r-i[y]}},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),t.isIncremental=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")},t.isFull=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0},t}(),Sf;(function(t){function r(s,p,y,E){return new jp(s,p,y,E)}t.create=r;function i(s,p,y){if(s instanceof jp)return s.update(p,y),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function a(s,p){for(var y=s.getText(),E=qc(p.map(bg),function(se,ye){var ge=se.range.start.line-ye.range.start.line;return ge===0?se.range.start.character-ye.range.start.character:ge}),w=0,A=[],k=0,G=E;k<G.length;k++){var ne=G[k],re=s.offsetAt(ne.range.start);if(re<w)throw new Error("Overlapping edit");re>w&&A.push(y.substring(w,re)),ne.newText.length&&A.push(ne.newText),w=s.offsetAt(ne.range.end)}return A.push(y.substr(w)),A.join("")}t.applyEdits=a})(Sf||(Sf={}));function qc(t,r){if(t.length<=1)return t;var i=t.length/2|0,a=t.slice(0,i),s=t.slice(i);qc(a,r),qc(s,r);for(var p=0,y=0,E=0;p<a.length&&y<s.length;){var w=r(a[p],s[y]);w<=0?t[E++]=a[p++]:t[E++]=s[y++]}for(;p<a.length;)t[E++]=a[p++];for(;y<s.length;)t[E++]=s[y++];return t}function Vp(t,r,i){i===void 0&&(i=0);for(var a=r?[i]:[],s=0;s<t.length;s++){var p=t.charCodeAt(s);(p===13||p===10)&&(p===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,a.push(i+s+1))}return a}function Wp(t){var r=t.start,i=t.end;return r.line>i.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function bg(t){var r=Wp(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var tr;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(tr||(tr={}));var Hp;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[so.Markdown,so.PlainText],commitCharactersSupport:!0}}}}})(Hp||(Hp={}));var da=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),wg={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},pa=function(){function t(r,i,a){this.offset=i,this.length=a,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}(),Sg=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="null",s.value=null,s}return r}(pa),zp=function(t){da(r,t);function r(i,a,s){var p=t.call(this,i,s)||this;return p.type="boolean",p.value=a,p}return r}(pa),Ag=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(pa),Eg=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(pa),Gp=function(t){da(r,t);function r(i,a,s){var p=t.call(this,i,a,s)||this;return p.type="string",p.value="",p}return r}(pa),Cg=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="property",s.colonOffset=-1,s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),r}(pa),Og=function(t){da(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(pa);function Mn(t){return Ri(t)?t?{}:{not:{}}:t}var $p;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})($p||($p={}));var Tg=function(){function t(r,i){r===void 0&&(r=-1),i===void 0&&(i=null),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){var i;(i=this.schemas).push.apply(i,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||Kp(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),ed=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),Rn=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,a=r;i<a.length;i++){var s=a[i];this.merge(s)}},t.prototype.merge=function(r){this.problems=this.problems.concat(r.problems)},t.prototype.mergeEnumValues=function(r){if(!this.enumValueMatch&&!r.enumValueMatch&&this.enumValues&&r.enumValues){this.enumValues=this.enumValues.concat(r.enumValues);for(var i=0,a=this.problems;i<a.length;i++){var s=a[i];s.code===tr.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(p){return JSON.stringify(p)}).join(", ")+".")}}},t.prototype.mergePropertyMatch=function(r){this.merge(r),this.propertiesMatches++,(r.enumValueMatch||!r.hasProblems()&&r.propertiesMatches)&&this.propertiesValueMatches++,r.enumValueMatch&&r.enumValues&&r.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(r){var i=this.hasProblems();return i!==r.hasProblems()?i?-1:1:this.enumValueMatch!==r.enumValueMatch?r.enumValueMatch?-1:1:this.primaryValueMatches!==r.primaryValueMatches?this.primaryValueMatches-r.primaryValueMatches:this.propertiesValueMatches!==r.propertiesValueMatches?this.propertiesValueMatches-r.propertiesValueMatches:this.propertiesMatches-r.propertiesMatches},t}();function Pg(t,r){return r===void 0&&(r=[]),new Yp(t,r,[])}function Oo(t){return gg(t)}function td(t){return vg(t)}function Kp(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var Yp=function(){function t(r,i,a){i===void 0&&(i=[]),a===void 0&&(a=[]),this.root=r,this.syntaxErrors=i,this.comments=a}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return hg(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(a){var s=r(a),p=a.children;if(Array.isArray(p))for(var y=0;y<p.length&&s;y++)s=i(p[y]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var a=new Rn;return dn(this.root,i,a,ed.instance),a.problems.map(function(s){var p=lr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return ao.create(p,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,a){i===void 0&&(i=-1),a===void 0&&(a=null);var s=new Tg(i,a);return this.root&&r&&dn(this.root,r,new Rn,s),s.schemas},t}();function dn(t,r,i,a){if(!t||!a.include(t))return;switch(t.type){case"object":w(t,r,i,a);break;case"array":E(t,r,i,a);break;case"string":y(t,r,i,a);break;case"number":p(t,r,i,a);break;case"property":return dn(t.valueNode,r,i,a)}s(),a.add({node:t,schema:r});function s(){function A(et){return t.type===et||et==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(A)||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(A(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var k=0,G=r.allOf;k<G.length;k++){var ne=G[k];dn(t,Mn(ne),i,a)}var re=Mn(r.not);if(re){var se=new Rn,ye=a.newSub();dn(t,re,se,ye),se.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,message:"Matches a schema that is not allowed."});for(var ge=0,Ee=ye.schemas;ge<Ee.length;ge++){var me=Ee[ge];me.inverted=!me.inverted,a.add(me)}}var Pe=function(et,At){for(var Nt=[],Ht=null,or=0,Mr=et;or<Mr.length;or++){var Cr=Mr[or],Jr=Mn(Cr),wr=new Rn,Dr=a.newSub();if(dn(t,Jr,wr,Dr),wr.hasProblems()||Nt.push(Jr),!Ht)Ht={schema:Jr,validationResult:wr,matchingSchemas:Dr};else if(!At&&!wr.hasProblems()&&!Ht.validationResult.hasProblems())Ht.matchingSchemas.merge(Dr),Ht.validationResult.propertiesMatches+=wr.propertiesMatches,Ht.validationResult.propertiesValueMatches+=wr.propertiesValueMatches;else{var Sn=wr.compare(Ht.validationResult);Sn>0?Ht={schema:Jr,validationResult:wr,matchingSchemas:Dr}:Sn===0&&(Ht.matchingSchemas.merge(Dr),Ht.validationResult.mergeEnumValues(wr))}}return Nt.length>1&&At&&i.problems.push({location:{offset:t.offset,length:1},severity:$t.Warning,message:"Matches multiple schemas when only one must validate."}),Ht!==null&&(i.merge(Ht.validationResult),i.propertiesMatches+=Ht.validationResult.propertiesMatches,i.propertiesValueMatches+=Ht.validationResult.propertiesValueMatches,a.merge(Ht.matchingSchemas)),Nt.length};Array.isArray(r.anyOf)&&Pe(r.anyOf,!1),Array.isArray(r.oneOf)&&Pe(r.oneOf,!0);var Ge=function(et){var At=new Rn,Nt=a.newSub();dn(t,Mn(et),At,Nt),i.merge(At),i.propertiesMatches+=At.propertiesMatches,i.propertiesValueMatches+=At.propertiesValueMatches,a.merge(Nt)},je=function(et,At,Nt){var Ht=Mn(et),or=new Rn,Mr=a.newSub();dn(t,Ht,or,Mr),a.merge(Mr),or.hasProblems()?Nt&&Ge(Nt):At&&Ge(At)},He=Mn(r.if);if(He&&je(He,Mn(r.then),Mn(r.else)),Array.isArray(r.enum)){for(var Ne=Oo(t),Ve=!1,We=0,Je=r.enum;We<Je.length;We++){var ze=Je[We];if(Tl(Ne,ze)){Ve=!0;break}}i.enumValues=r.enum,i.enumValueMatch=Ve,Ve||i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,code:tr.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(et){return JSON.stringify(et)}).join(", ")+"."})}if(oo(r.const)){var Ne=Oo(t);Tl(Ne,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:$t.Warning,code:tr.EnumValueMismatch,message:r.errorMessage||"Value must be "+JSON.stringify(r.const)+"."}),i.enumValueMatch=!1),i.enumValues=[r.const]}r.deprecationMessage&&t.parent&&i.problems.push({location:{offset:t.parent.offset,length:t.parent.length},severity:$t.Warning,message:r.deprecationMessage})}function p(A,k,G,ne){var re=A.value;Yn(k.multipleOf)&&re%k.multipleOf!=0&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is not divisible by "+k.multipleOf+"."});function se(Ge,je){if(Yn(je))return je;if(Ri(je)&&je)return Ge}function ye(Ge,je){if(!Ri(je)||!je)return Ge}var ge=se(k.minimum,k.exclusiveMinimum);Yn(ge)&&re<=ge&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is below the exclusive minimum of "+ge+"."});var Ee=se(k.maximum,k.exclusiveMaximum);Yn(Ee)&&re>=Ee&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is above the exclusive maximum of "+Ee+"."});var me=ye(k.minimum,k.exclusiveMinimum);Yn(me)&&re<me&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is below the minimum of "+me+"."});var Pe=ye(k.maximum,k.exclusiveMaximum);Yn(Pe)&&re>Pe&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Value is above the maximum of "+Pe+"."})}function y(A,k,G,ne){if(Yn(k.minLength)&&A.value.length<k.minLength&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"String is shorter than the minimum length of "+k.minLength+"."}),Yn(k.maxLength)&&A.value.length>k.maxLength&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"String is longer than the maximum length of "+k.maxLength+"."}),mg(k.pattern)){var re=new RegExp(k.pattern);re.test(A.value)||G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.patternErrorMessage||k.errorMessage||'String does not match the pattern of "'+k.pattern+'".'})}if(k.format)switch(k.format){case"uri":case"uri-reference":{var se=void 0;if(!A.value)se="URI expected.";else{var ye=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(A.value);ye?!ye[2]&&k.format==="uri"&&(se="URI with a scheme is expected."):se="URI is expected."}se&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.patternErrorMessage||k.errorMessage||"String is not a URI: "+se})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var ge=wg[k.format];(!A.value||!ge.pattern.exec(A.value))&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.patternErrorMessage||k.errorMessage||ge.errorMessage});break;default:}}function E(A,k,G,ne){if(Array.isArray(k.items)){for(var re=k.items,se=0;se<re.length;se++){var ye=re[se],ge=Mn(ye),Ee=new Rn,me=A.items[se];me?(dn(me,ge,Ee,ne),G.mergePropertyMatch(Ee)):A.items.length>=re.length&&G.propertiesValueMatches++}if(A.items.length>re.length)if(typeof k.additionalItems=="object")for(var Pe=re.length;Pe<A.items.length;Pe++){var Ee=new Rn;dn(A.items[Pe],k.additionalItems,Ee,ne),G.mergePropertyMatch(Ee)}else k.additionalItems===!1&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has too many items according to schema. Expected "+re.length+" or fewer."})}else{var Ge=Mn(k.items);if(Ge)for(var je=0,He=A.items;je<He.length;je++){var me=He[je],Ee=new Rn;dn(me,Ge,Ee,ne),G.mergePropertyMatch(Ee)}}var Ne=Mn(k.contains);if(Ne){var Ve=A.items.some(function(ze){var et=new Rn;return dn(ze,Ne,et,ed.instance),!et.hasProblems()});Ve||G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:k.errorMessage||"Array does not contain required item."})}if(Yn(k.minItems)&&A.items.length<k.minItems&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has too few items. Expected "+k.minItems+" or more."}),Yn(k.maxItems)&&A.items.length>k.maxItems&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has too many items. Expected "+k.maxItems+" or fewer."}),k.uniqueItems===!0){var We=Oo(A),Je=We.some(function(ze,et){return et!==We.lastIndexOf(ze)});Je&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Array has duplicate items."})}}function w(A,k,G,ne){for(var re=Object.create(null),se=[],ye=0,ge=A.properties;ye<ge.length;ye++){var Ee=ge[ye],me=Ee.keyNode.value;re[me]=Ee.valueNode,se.push(me)}if(Array.isArray(k.required))for(var Pe=0,Ge=k.required;Pe<Ge.length;Pe++){var je=Ge[Pe];if(!re[je]){var He=A.parent&&A.parent.type==="property"&&A.parent.keyNode,Ne=He?{offset:He.offset,length:He.length}:{offset:A.offset,length:1};G.problems.push({location:Ne,severity:$t.Warning,message:'Missing property "'+je+'".'})}}var Ve=function(yi){for(var Bl=se.indexOf(yi);Bl>=0;)se.splice(Bl,1),Bl=se.indexOf(yi)};if(k.properties)for(var We=0,Je=Object.keys(k.properties);We<Je.length;We++){var je=Je[We];Ve(je);var ze=k.properties[je],et=re[je];if(et)if(Ri(ze))if(ze)G.propertiesMatches++,G.propertiesValueMatches++;else{var Ee=et.parent;G.problems.push({location:{offset:Ee.keyNode.offset,length:Ee.keyNode.length},severity:$t.Warning,message:k.errorMessage||"Property "+je+" is not allowed."})}else{var At=new Rn;dn(et,ze,At,ne),G.mergePropertyMatch(At)}}if(k.patternProperties)for(var Nt=0,Ht=Object.keys(k.patternProperties);Nt<Ht.length;Nt++)for(var or=Ht[Nt],Mr=new RegExp(or),Cr=0,Jr=se.slice(0);Cr<Jr.length;Cr++){var je=Jr[Cr];if(Mr.test(je)){Ve(je);var et=re[je];if(et){var ze=k.patternProperties[or];if(Ri(ze))if(ze)G.propertiesMatches++,G.propertiesValueMatches++;else{var Ee=et.parent;G.problems.push({location:{offset:Ee.keyNode.offset,length:Ee.keyNode.length},severity:$t.Warning,message:k.errorMessage||"Property "+je+" is not allowed."})}else{var At=new Rn;dn(et,ze,At,ne),G.mergePropertyMatch(At)}}}}if(typeof k.additionalProperties=="object")for(var wr=0,Dr=se;wr<Dr.length;wr++){var je=Dr[wr],et=re[je];if(et){var At=new Rn;dn(et,k.additionalProperties,At,ne),G.mergePropertyMatch(At)}}else if(k.additionalProperties===!1&&se.length>0)for(var Sn=0,Yt=se;Sn<Yt.length;Sn++){var je=Yt[Sn],et=re[je];if(et){var Ee=et.parent;G.problems.push({location:{offset:Ee.keyNode.offset,length:Ee.keyNode.length},severity:$t.Warning,message:k.errorMessage||"Property "+je+" is not allowed."})}}if(Yn(k.maxProperties)&&A.properties.length>k.maxProperties&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Object has more properties than limit of "+k.maxProperties+"."}),Yn(k.minProperties)&&A.properties.length<k.minProperties&&G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Object has fewer properties than the required number of "+k.minProperties}),k.dependencies)for(var Rt=0,Ut=Object.keys(k.dependencies);Rt<Ut.length;Rt++){var me=Ut[Rt],ar=re[me];if(ar){var an=k.dependencies[me];if(Array.isArray(an))for(var mr=0,hs=an;mr<hs.length;mr++){var Dl=hs[mr];re[Dl]?G.propertiesValueMatches++:G.problems.push({location:{offset:A.offset,length:A.length},severity:$t.Warning,message:"Object is missing property "+Dl+" required by property {$key}."})}else{var ze=Mn(an);if(ze){var At=new Rn;dn(A,ze,At,ne),G.mergePropertyMatch(At)}}}}var ha=Mn(k.propertyNames);if(ha)for(var Di=0,Nl=A.properties;Di<Nl.length;Di++){var Ff=Nl[Di],me=Ff.keyNode;me&&dn(me,ha,G,ed.instance)}}}function Ig(t,r){var i=[],a=-1,s=t.getText(),p=ls(s,!1),y=r&&r.collectComments?[]:void 0;function E(){for(;;){var He=p.scan();switch(G(),He){case 12:case 13:Array.isArray(y)&&y.push(lr.create(t.positionAt(p.getTokenOffset()),t.positionAt(p.getTokenOffset()+p.getTokenLength())));break;case 15:case 14:break;default:return He}}}function w(He){return p.getToken()===He?(E(),!0):!1}function A(He,Ne,Ve,We,Je){if(Je===void 0&&(Je=$t.Error),i.length===0||Ve!==a){var ze=lr.create(t.positionAt(Ve),t.positionAt(We));i.push(ao.create(ze,He,Je,Ne,t.languageId)),a=Ve}}function k(He,Ne,Ve,We,Je){Ve===void 0&&(Ve=null),We===void 0&&(We=[]),Je===void 0&&(Je=[]);var ze=p.getTokenOffset(),et=p.getTokenOffset()+p.getTokenLength();if(ze===et&&ze>0){for(ze--;ze>0&&/\s/.test(s.charAt(ze));)ze--;et=ze+1}if(A(He,Ne,ze,et),Ve&&ne(Ve,!1),We.length+Je.length>0)for(var At=p.getToken();At!==17;){if(We.indexOf(At)!==-1){E();break}else if(Je.indexOf(At)!==-1)break;At=E()}return Ve}function G(){switch(p.getTokenError()){case 4:return k("Invalid unicode sequence in string.",tr.InvalidUnicode),!0;case 5:return k("Invalid escape character in string.",tr.InvalidEscapeCharacter),!0;case 3:return k("Unexpected end of number.",tr.UnexpectedEndOfNumber),!0;case 1:return k("Unexpected end of comment.",tr.UnexpectedEndOfComment),!0;case 2:return k("Unexpected end of string.",tr.UnexpectedEndOfString),!0;case 6:return k("Invalid characters in string. Control characters must be escaped.",tr.InvalidCharacter),!0}return!1}function ne(He,Ne){return He.length=p.getTokenOffset()+p.getTokenLength()-He.offset,Ne&&E(),He}function re(He){if(p.getToken()!==3)return null;var Ne=new Ag(He,p.getTokenOffset());E();for(var Ve=0,We=!1;p.getToken()!==4&&p.getToken()!==17;){if(p.getToken()===5){We||k("Value expected",tr.ValueExpected);var Je=p.getTokenOffset();if(E(),p.getToken()===4){We&&A("Trailing comma",tr.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",tr.CommaExpected);var ze=Pe(Ne,Ve++);ze?Ne.items.push(ze):k("Value expected",tr.ValueExpected,null,[],[4,5]),We=!0}return p.getToken()!==4?k("Expected comma or closing bracket",tr.CommaOrCloseBacketExpected,Ne):ne(Ne,!0)}function se(He,Ne){var Ve=new Cg(He,p.getTokenOffset()),We=ge(Ve);if(!We)if(p.getToken()===16){k("Property keys must be doublequoted",tr.Undefined);var Je=new Gp(Ve,p.getTokenOffset(),p.getTokenLength());Je.value=p.getTokenValue(),We=Je,E()}else return null;Ve.keyNode=We;var ze=Ne[We.value];if(ze?(A("Duplicate object key",tr.DuplicateKey,Ve.keyNode.offset,Ve.keyNode.offset+Ve.keyNode.length,$t.Warning),typeof ze=="object"&&A("DuplicateKeyWarning",tr.DuplicateKey,ze.keyNode.offset,ze.keyNode.offset+ze.keyNode.length,$t.Warning),Ne[We.value]=!0):Ne[We.value]=Ve,p.getToken()===6)Ve.colonOffset=p.getTokenOffset(),E();else if(k("Colon expected",tr.ColonExpected),p.getToken()===10&&t.positionAt(We.offset+We.length).line<t.positionAt(p.getTokenOffset()).line)return Ve.length=We.length,Ve;var et=Pe(Ve,We.value);return et?(Ve.valueNode=et,Ve.length=et.offset+et.length-Ve.offset,Ve):k("Value expected",tr.ValueExpected,Ve,[],[2,5])}function ye(He){if(p.getToken()!==1)return null;var Ne=new Og(He,p.getTokenOffset()),Ve=Object.create(null);E();for(var We=!1;p.getToken()!==2&&p.getToken()!==17;){if(p.getToken()===5){We||k("Property expected",tr.PropertyExpected);var Je=p.getTokenOffset();if(E(),p.getToken()===2){We&&A("Trailing comma",tr.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",tr.CommaExpected);var ze=se(Ne,Ve);ze?Ne.properties.push(ze):k("Property expected",tr.PropertyExpected,null,[],[2,5]),We=!0}return p.getToken()!==2?k("Expected comma or closing brace",tr.CommaOrCloseBraceExpected,Ne):ne(Ne,!0)}function ge(He){if(p.getToken()!==10)return null;var Ne=new Gp(He,p.getTokenOffset());return Ne.value=p.getTokenValue(),ne(Ne,!0)}function Ee(He){if(p.getToken()!==11)return null;var Ne=new Eg(He,p.getTokenOffset());if(p.getTokenError()===0){var Ve=p.getTokenValue();try{var We=JSON.parse(Ve);if(!Yn(We))return k("Invalid number format.",tr.Undefined,Ne);Ne.value=We}catch(Je){return k("Invalid number format.",tr.Undefined,Ne)}Ne.isInteger=Ve.indexOf(".")===-1}return ne(Ne,!0)}function me(He){var Ne;switch(p.getToken()){case 7:return ne(new Sg(He,p.getTokenOffset()),!0);case 8:return ne(new zp(He,!0,p.getTokenOffset()),!0);case 9:return ne(new zp(He,!1,p.getTokenOffset()),!0);default:return null}}function Pe(He,Ne){return re(He)||ye(He)||ge(He)||Ee(He)||me(He)}var Ge=null,je=E();return je!==17&&(Ge=Pe(null,null),Ge?p.getToken()!==17&&k("End of file expected.",tr.Undefined):k("Expected a JSON object, array or literal.",tr.Undefined)),new Yp(Ge,i,y)}function rd(t,r,i){if(t!==null&&typeof t=="object"){var a=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
|
|
377
377
|
`,p=0;p<t.length;p++)s+=a+rd(t[p],a,i),p<t.length-1&&(s+=","),s+=`
|
|
378
378
|
`;return s+=r+"]",s}else{var y=Object.keys(t);if(y.length===0)return"{}";for(var s=`{
|
|
379
379
|
`,p=0;p<y.length;p++){var E=y[p];s+=a+JSON.stringify(E)+": "+rd(t[E],a,i),p<y.length-1&&(s+=","),s+=`
|
|
380
|
-
`}return s+=r+"}",s}}return i(t)}function Fg(t,r){if(t.length<r.length)return!1;for(var i=0;i<r.length;i++)if(t[i]!==r[i])return!1;return!0}function nd(t,r){var i=t.length-r.length;return i>0?t.lastIndexOf(r)===i:i===0?t===r:!1}function kg(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Gm(t,r){for(var i="";r>0;)(r&1)==1&&(i+=t),t+=t,r=r>>>1;return i}var Mg=[",","}","]"],Rg=[":"],Lg=function(){function t(r,i,a,s){i===void 0&&(i=[]),a===void 0&&(a=Promise),s===void 0&&(s={}),this.schemaService=r,this.contributions=i,this.promiseConstructor=a,this.clientCapabilities=s,this.templateVarIdCounter=0}return t.prototype.doResolve=function(r){for(var i=this.contributions.length-1;i>=0;i--)if(this.contributions[i].resolveCompletion){var a=this.contributions[i].resolveCompletion(r);if(a)return a}return this.promiseConstructor.resolve(r)},t.prototype.doComplete=function(r,i,a){var s=this,p={items:[],isIncomplete:!1},y=r.getText(),E=r.offsetAt(i),w=a.getNodeFromOffset(E,!0);if(this.isInComment(r,w?w.offset:0,E))return Promise.resolve(p);if(w&&E===w.offset+w.length&&E>0){var A=y[E-1];(w.type==="object"&&A==="}"||w.type==="array"&&A==="]")&&(w=w.parent)}var k=this.getCurrentWord(r,E),G=null;if(w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null"))G=lr.create(r.positionAt(w.offset),r.positionAt(w.offset+w.length));else{var ne=E-k.length;ne>0&&y[ne-1]==='"'&&ne--,G=lr.create(r.positionAt(ne),i)}var re=this.doesSupportsCommitCharacters(),se={},ye={add:function(ge){var Ee=se[ge.label];Ee?Ee.documentation||(Ee.documentation=ge.documentation):(se[ge.label]=ge,G&&(ge.textEdit=vi.replace(G,ge.insertText)),re&&(ge.commitCharacters=ge.kind===Jn.Property?Rg:Mg),p.items.push(ge))},setAsIncomplete:function(){p.isIncomplete=!0},error:function(ge){console.error(ge)},log:function(ge){console.log(ge)},getNumberOfProposals:function(){return p.items.length}};return this.schemaService.getSchemaForResource(r.uri,a).then(function(ge){var Ee=[],me=!0,Pe="",Ge=null;if(w&&w.type==="string"){var je=w.parent;je&&je.type==="property"&&je.keyNode===w&&(me=!je.valueNode,Ge=je,Pe=y.substr(w.offset+1,w.length-2),je&&(w=je.parent))}if(w&&w.type==="object"){if(w.offset===E)return p;var He=w.properties;He.forEach(function(Je){(!Ge||Ge!==Je)&&(se[Je.keyNode.value]=_c.create("__"))});var Ne="";me&&(Ne=s.evaluateSeparatorAfter(r,r.offsetAt(G.end))),ge?s.getPropertyCompletions(ge,a,w,me,Ne,ye):s.getSchemaLessPropertyCompletions(a,w,Pe,ye);var Ve=td(w);s.contributions.forEach(function(Je){var ze=Je.collectPropertyCompletions(r.uri,Ve,k,me,Ne==="",ye);ze&&Ee.push(ze)}),!ge&&k.length>0&&y.charAt(E-k.length-1)!=='"'&&(ye.add({kind:Jn.Property,label:s.getLabelForValue(k),insertText:s.getInsertTextForProperty(k,null,!1,Ne),insertTextFormat:Zr.Snippet,documentation:""}),ye.setAsIncomplete())}var We={};return ge?s.getValueCompletions(ge,a,w,E,r,ye,We):s.getSchemaLessValueCompletions(a,w,E,r,ye),s.contributions.length>0&&s.getContributedValueCompletions(a,w,E,r,ye,Ee),s.promiseConstructor.all(Ee).then(function(){if(ye.getNumberOfProposals()===0){var Je=E;w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null")&&(Je=w.offset+w.length);var ze=s.evaluateSeparatorAfter(r,Je);s.addFillerValueCompletions(We,ze,ye)}return p})})},t.prototype.getPropertyCompletions=function(r,i,a,s,p,y){var E=this,w=i.getMatchingSchemas(r.schema,a.offset);w.forEach(function(A){if(A.node===a&&!A.inverted){var k=A.schema.properties;k&&Object.keys(k).forEach(function(G){var ne=k[G],re=!1;if(typeof ne=="object"&&ne.allOf)for(var se=0,ye=ne.allOf;se<ye.length;se++){var ge=ye[se];if(ge.readOnly){re=!0;break}}if(typeof ne=="object"&&!ne.deprecationMessage&&!ne.doNotSuggest&&!re){var Ee={kind:Jn.Property,label:E.sanitizeLabel(G),insertText:E.getInsertTextForProperty(G,ne,s,p),insertTextFormat:Zr.Snippet,filterText:E.getFilterTextForValue(G),documentation:E.fromMarkup(ne.markdownDescription)||ne.description||""};nd(Ee.insertText,"$1"+p)&&(Ee.command={title:"Suggest",command:"editor.action.triggerSuggest"}),y.add(Ee)}})}})},t.prototype.getSchemaLessPropertyCompletions=function(r,i,a,s){var p=this,y=function(w){w.properties.forEach(function(A){var k=A.keyNode.value;s.add({kind:Jn.Property,label:p.sanitizeLabel(k),insertText:p.getInsertTextForValue(k,""),insertTextFormat:Zr.Snippet,filterText:p.getFilterTextForValue(k),documentation:""})})};if(i.parent)if(i.parent.type==="property"){var E=i.parent.keyNode.value;r.visit(function(w){return w.type==="property"&&w!==i.parent&&w.keyNode.value===E&&w.valueNode&&w.valueNode.type==="object"&&y(w.valueNode),!0})}else i.parent.type==="array"&&i.parent.items.forEach(function(w){w.type==="object"&&w!==i&&y(w)});else i.type==="object"&&s.add({kind:Jn.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Zr.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},t.prototype.getSchemaLessValueCompletions=function(r,i,a,s,p){var y=this,E=a;if(i&&(i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(E=i.offset+i.length,i=i.parent),!i){p.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Zr.Snippet,documentation:""}),p.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Zr.Snippet,documentation:""});return}var w=this.evaluateSeparatorAfter(s,E),A=function(re){
|
|
380
|
+
`}return s+=r+"}",s}}return i(t)}function Fg(t,r){if(t.length<r.length)return!1;for(var i=0;i<r.length;i++)if(t[i]!==r[i])return!1;return!0}function nd(t,r){var i=t.length-r.length;return i>0?t.lastIndexOf(r)===i:i===0?t===r:!1}function kg(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Gm(t,r){for(var i="";r>0;)(r&1)==1&&(i+=t),t+=t,r=r>>>1;return i}var Mg=[",","}","]"],Rg=[":"],Lg=function(){function t(r,i,a,s){i===void 0&&(i=[]),a===void 0&&(a=Promise),s===void 0&&(s={}),this.schemaService=r,this.contributions=i,this.promiseConstructor=a,this.clientCapabilities=s,this.templateVarIdCounter=0}return t.prototype.doResolve=function(r){for(var i=this.contributions.length-1;i>=0;i--)if(this.contributions[i].resolveCompletion){var a=this.contributions[i].resolveCompletion(r);if(a)return a}return this.promiseConstructor.resolve(r)},t.prototype.doComplete=function(r,i,a){var s=this,p={items:[],isIncomplete:!1},y=r.getText(),E=r.offsetAt(i),w=a.getNodeFromOffset(E,!0);if(this.isInComment(r,w?w.offset:0,E))return Promise.resolve(p);if(w&&E===w.offset+w.length&&E>0){var A=y[E-1];(w.type==="object"&&A==="}"||w.type==="array"&&A==="]")&&(w=w.parent)}var k=this.getCurrentWord(r,E),G=null;if(w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null"))G=lr.create(r.positionAt(w.offset),r.positionAt(w.offset+w.length));else{var ne=E-k.length;ne>0&&y[ne-1]==='"'&&ne--,G=lr.create(r.positionAt(ne),i)}var re=this.doesSupportsCommitCharacters(),se={},ye={add:function(ge){var Ee=se[ge.label];Ee?Ee.documentation||(Ee.documentation=ge.documentation):(se[ge.label]=ge,G&&(ge.textEdit=vi.replace(G,ge.insertText)),re&&(ge.commitCharacters=ge.kind===Jn.Property?Rg:Mg),p.items.push(ge))},setAsIncomplete:function(){p.isIncomplete=!0},error:function(ge){console.error(ge)},log:function(ge){console.log(ge)},getNumberOfProposals:function(){return p.items.length}};return this.schemaService.getSchemaForResource(r.uri,a).then(function(ge){var Ee=[],me=!0,Pe="",Ge=null;if(w&&w.type==="string"){var je=w.parent;je&&je.type==="property"&&je.keyNode===w&&(me=!je.valueNode,Ge=je,Pe=y.substr(w.offset+1,w.length-2),je&&(w=je.parent))}if(w&&w.type==="object"){if(w.offset===E)return p;var He=w.properties;He.forEach(function(Je){(!Ge||Ge!==Je)&&(se[Je.keyNode.value]=_c.create("__"))});var Ne="";me&&(Ne=s.evaluateSeparatorAfter(r,r.offsetAt(G.end))),ge?s.getPropertyCompletions(ge,a,w,me,Ne,ye):s.getSchemaLessPropertyCompletions(a,w,Pe,ye);var Ve=td(w);s.contributions.forEach(function(Je){var ze=Je.collectPropertyCompletions(r.uri,Ve,k,me,Ne==="",ye);ze&&Ee.push(ze)}),!ge&&k.length>0&&y.charAt(E-k.length-1)!=='"'&&(ye.add({kind:Jn.Property,label:s.getLabelForValue(k),insertText:s.getInsertTextForProperty(k,null,!1,Ne),insertTextFormat:Zr.Snippet,documentation:""}),ye.setAsIncomplete())}var We={};return ge?s.getValueCompletions(ge,a,w,E,r,ye,We):s.getSchemaLessValueCompletions(a,w,E,r,ye),s.contributions.length>0&&s.getContributedValueCompletions(a,w,E,r,ye,Ee),s.promiseConstructor.all(Ee).then(function(){if(ye.getNumberOfProposals()===0){var Je=E;w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null")&&(Je=w.offset+w.length);var ze=s.evaluateSeparatorAfter(r,Je);s.addFillerValueCompletions(We,ze,ye)}return p})})},t.prototype.getPropertyCompletions=function(r,i,a,s,p,y){var E=this,w=i.getMatchingSchemas(r.schema,a.offset);w.forEach(function(A){if(A.node===a&&!A.inverted){var k=A.schema.properties;k&&Object.keys(k).forEach(function(G){var ne=k[G],re=!1;if(typeof ne=="object"&&ne.allOf)for(var se=0,ye=ne.allOf;se<ye.length;se++){var ge=ye[se];if(ge.readOnly){re=!0;break}}if(typeof ne=="object"&&!ne.deprecationMessage&&!ne.doNotSuggest&&!re){var Ee={kind:Jn.Property,label:E.sanitizeLabel(G),insertText:E.getInsertTextForProperty(G,ne,s,p),insertTextFormat:Zr.Snippet,filterText:E.getFilterTextForValue(G),documentation:E.fromMarkup(ne.markdownDescription)||ne.description||""};nd(Ee.insertText,"$1"+p)&&(Ee.command={title:"Suggest",command:"editor.action.triggerSuggest"}),y.add(Ee)}})}})},t.prototype.getSchemaLessPropertyCompletions=function(r,i,a,s){var p=this,y=function(w){w.properties.forEach(function(A){var k=A.keyNode.value;s.add({kind:Jn.Property,label:p.sanitizeLabel(k),insertText:p.getInsertTextForValue(k,""),insertTextFormat:Zr.Snippet,filterText:p.getFilterTextForValue(k),documentation:""})})};if(i.parent)if(i.parent.type==="property"){var E=i.parent.keyNode.value;r.visit(function(w){return w.type==="property"&&w!==i.parent&&w.keyNode.value===E&&w.valueNode&&w.valueNode.type==="object"&&y(w.valueNode),!0})}else i.parent.type==="array"&&i.parent.items.forEach(function(w){w.type==="object"&&w!==i&&y(w)});else i.type==="object"&&s.add({kind:Jn.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Zr.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},t.prototype.getSchemaLessValueCompletions=function(r,i,a,s,p){var y=this,E=a;if(i&&(i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(E=i.offset+i.length,i=i.parent),!i){p.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Zr.Snippet,documentation:""}),p.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Zr.Snippet,documentation:""});return}var w=this.evaluateSeparatorAfter(s,E),A=function(re){Kp(re.parent,a,!0)||p.add({kind:y.getSuggestionKind(re.type),label:y.getLabelTextForMatchingNode(re,s),insertText:y.getInsertTextForMatchingNode(re,s,w),insertTextFormat:Zr.Snippet,documentation:""}),re.type==="boolean"&&y.addBooleanValueCompletion(!re.value,w,p)};if(i.type==="property"&&a>i.colonOffset){var k=i.valueNode;if(k&&(a>k.offset+k.length||k.type==="object"||k.type==="array"))return;var G=i.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===G&&re.valueNode&&A(re.valueNode),!0}),G==="$schema"&&i.parent&&!i.parent.parent&&this.addDollarSchemaCompletions(w,p)}if(i.type==="array")if(i.parent&&i.parent.type==="property"){var ne=i.parent.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===ne&&re.valueNode&&re.valueNode.type==="array"&&re.valueNode.items.forEach(A),!0})}else i.items.forEach(A)},t.prototype.getValueCompletions=function(r,i,a,s,p,y,E){var w=this,A=s,k=null,G=null;if(a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null")&&(A=a.offset+a.length,G=a,a=a.parent),!a){this.addSchemaValueCompletions(r.schema,"",y,E);return}if(a.type==="property"&&s>a.colonOffset){var ne=a.valueNode;if(ne&&s>ne.offset+ne.length)return;k=a.keyNode.value,a=a.parent}if(a&&(k!==null||a.type==="array")){var re=this.evaluateSeparatorAfter(p,A),se=i.getMatchingSchemas(r.schema,a.offset,G);se.forEach(function(ye){if(ye.node===a&&!ye.inverted&&ye.schema){if(a.type==="array"&&ye.schema.items)if(Array.isArray(ye.schema.items)){var ge=w.findItemAtOffset(a,p,s);ge<ye.schema.items.length&&w.addSchemaValueCompletions(ye.schema.items[ge],re,y,E)}else w.addSchemaValueCompletions(ye.schema.items,re,y,E);if(ye.schema.properties){var Ee=ye.schema.properties[k];Ee&&w.addSchemaValueCompletions(Ee,re,y,E)}}}),k==="$schema"&&!a.parent&&this.addDollarSchemaCompletions(re,y),E.boolean&&(this.addBooleanValueCompletion(!0,re,y),this.addBooleanValueCompletion(!1,re,y)),E.null&&this.addNullValueCompletion(re,y)}},t.prototype.getContributedValueCompletions=function(r,i,a,s,p,y){if(!i)this.contributions.forEach(function(k){var G=k.collectDefaultCompletions(s.uri,p);G&&y.push(G)});else if((i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(i=i.parent),i.type==="property"&&a>i.colonOffset){var E=i.keyNode.value,w=i.valueNode;if(!w||a<=w.offset+w.length){var A=td(i.parent);this.contributions.forEach(function(k){var G=k.collectValueCompletions(s.uri,A,E,p);G&&y.push(G)})}}},t.prototype.addSchemaValueCompletions=function(r,i,a,s){var p=this;typeof r=="object"&&(this.addEnumValueCompletions(r,i,a),this.addDefaultValueCompletions(r,i,a),this.collectTypes(r,s),Array.isArray(r.allOf)&&r.allOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}),Array.isArray(r.anyOf)&&r.anyOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}),Array.isArray(r.oneOf)&&r.oneOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}))},t.prototype.addDefaultValueCompletions=function(r,i,a,s){var p=this;s===void 0&&(s=0);var y=!1;if(oo(r.default)){for(var E=r.type,w=r.default,A=s;A>0;A--)w=[w],E="array";a.add({kind:this.getSuggestionKind(E),label:this.getLabelForValue(w),insertText:this.getInsertTextForValue(w,i),insertTextFormat:Zr.Snippet}),y=!0}Array.isArray(r.examples)&&r.examples.forEach(function(k){for(var G=r.type,ne=k,re=s;re>0;re--)ne=[ne],G="array";a.add({kind:p.getSuggestionKind(G),label:p.getLabelForValue(ne),insertText:p.getInsertTextForValue(ne,i),insertTextFormat:Zr.Snippet}),y=!0}),Array.isArray(r.defaultSnippets)&&r.defaultSnippets.forEach(function(k){var G=r.type,ne=k.body,re=k.label,se,ye;if(oo(ne)){for(var ge=r.type,Ee=s;Ee>0;Ee--)ne=[ne],ge="array";se=p.getInsertTextForSnippetValue(ne,i),ye=p.getFilterTextForSnippetValue(ne),re=re||p.getLabelForSnippetValue(ne)}else if(typeof k.bodyText=="string"){for(var me="",Pe="",Ge="",Ee=s;Ee>0;Ee--)me=me+Ge+`[
|
|
381
381
|
`,Pe=Pe+`
|
|
382
382
|
`+Ge+"]",Ge+=" ",G="array";se=me+Ge+k.bodyText.split(`
|
|
383
383
|
`).join(`
|
|
@@ -388,8 +388,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
388
388
|
|
|
389
389
|
`),Ge+="`"+Ng(Pe)+"`: "+me),A([Ge])}return null})},t}();function id(t){if(t){var r=t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
|
390
390
|
|
|
391
|
-
$3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function Ng(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var Bg=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),Wr,Rl;if(typeof process=="object")Rl=!1;else if(typeof navigator=="object"){var Ug=navigator.userAgent;Rl=Ug.indexOf("Windows")>=0}function $m(t){return 55296<=t&&t<=56319}function Km(t){return 56320<=t&&t<=57343}function Ym(t){return t>=97&&t<=102}function jg(t){return t>=97&&t<=122}function Vg(t){return t>=65&&t<=90}function Jm(t){return jg(t)||Vg(t)}var Wg=/^\w[\w\d+.-]*$/,Hg=/^\//,zg=/^\/\//;function Gg(t,r){if(!t.scheme&&r)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!Wg.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!Hg.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(zg.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function $g(t,r){return!t&&!r?"file":t}function Kg(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==gi&&(r=gi+r):r=gi;break}return r}var pr="",gi="/",Yg=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,od=function(){function t(r,i,a,s,p,y){y===void 0&&(y=!1),typeof r=="object"?(this.scheme=r.scheme||pr,this.authority=r.authority||pr,this.path=r.path||pr,this.query=r.query||pr,this.fragment=r.fragment||pr):(this.scheme=$g(r,y),this.authority=i||pr,this.path=Kg(this.scheme,a||pr),this.query=s||pr,this.fragment=p||pr,Gg(this,y))}return t.isUri=function(r){return r instanceof t?!0:r?typeof r.authority=="string"&&typeof r.fragment=="string"&&typeof r.path=="string"&&typeof r.query=="string"&&typeof r.scheme=="string"&&typeof r.fsPath=="function"&&typeof r.with=="function"&&typeof r.toString=="function":!1},Object.defineProperty(t.prototype,"fsPath",{get:function(){return Qp(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,a=r.authority,s=r.path,p=r.query,y=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=pr),a===void 0?a=this.authority:a===null&&(a=pr),s===void 0?s=this.path:s===null&&(s=pr),p===void 0?p=this.query:p===null&&(p=pr),y===void 0?y=this.fragment:y===null&&(y=pr),i===this.scheme&&a===this.authority&&s===this.path&&p===this.query&&y===this.fragment?this:new fs(i,a,s,p,y)},t.parse=function(r,i){i===void 0&&(i=!1);var a=Yg.exec(r);return a?new fs(a[2]||pr,Af(a[4]||pr),Af(a[5]||pr),Af(a[7]||pr),Af(a[9]||pr),i):new fs(pr,pr,pr,pr,pr)},t.file=function(r){var i=pr;if(Rl&&(r=r.replace(/\\/g,gi)),r[0]===gi&&r[1]===gi){var a=r.indexOf(gi,2);a===-1?(i=r.substring(2),r=gi):(i=r.substring(2,a),r=r.substring(a)||gi)}return new fs("file",i,r,pr,pr)},t.from=function(r){return new fs(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),ad(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new fs(r);return i._formatted=r.external,i._fsPath=r._sep===Yp?r.fsPath:null,i}else return r},t}(),Yp=Rl?1:void 0,fs=function(t){Bg(r,t);function r(){var i=t!==null&&t.apply(this,arguments)||this;return i._formatted=null,i._fsPath=null,i}return Object.defineProperty(r.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=Qp(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?ad(this,!0):(this._formatted||(this._formatted=ad(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=Yp),this._formatted&&(i.external=this._formatted),this.path&&(i.path=this.path),this.scheme&&(i.scheme=this.scheme),this.authority&&(i.authority=this.authority),this.query&&(i.query=this.query),this.fragment&&(i.fragment=this.fragment),i},r}(od),Jp=(Wr={},Wr[58]="%3A",Wr[47]="%2F",Wr[63]="%3F",Wr[35]="%23",Wr[91]="%5B",Wr[93]="%5D",Wr[64]="%40",Wr[33]="%21",Wr[36]="%24",Wr[38]="%26",Wr[39]="%27",Wr[40]="%28",Wr[41]="%29",Wr[42]="%2A",Wr[43]="%2B",Wr[44]="%2C",Wr[59]="%3B",Wr[61]="%3D",Wr[32]="%20",Wr);function Xp(t,r){for(var i=void 0,a=-1,s=0;s<t.length;s++){var p=t.charCodeAt(s);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45||p===46||p===95||p===126||r&&p===47)a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var y=Jp[p];y!==void 0?(a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i+=y):a===-1&&(a=s)}}return a!==-1&&(i+=encodeURIComponent(t.substring(a))),i!==void 0?i:t}function Jg(t){for(var r=void 0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a===35||a===63?(r===void 0&&(r=t.substr(0,i)),r+=Jp[a]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function Qp(t,r){var i;return t.authority&&t.path.length>1&&t.scheme==="file"?i="//"+t.authority+t.path:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?r?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,Rl&&(i=i.replace(/\//g,"\\")),i}function ad(t,r){var i=r?Jg:Xp,a="",s=t.scheme,p=t.authority,y=t.path,E=t.query,w=t.fragment;if(s&&(a+=s,a+=":"),(p||s==="file")&&(a+=gi,a+=gi),p){var A=p.indexOf("@");if(A!==-1){var k=p.substr(0,A);p=p.substr(A+1),A=k.indexOf(":"),A===-1?a+=i(k,!1):(a+=i(k.substr(0,A),!1),a+=":",a+=i(k.substr(A+1),!1)),a+="@"}p=p.toLowerCase(),A=p.indexOf(":"),A===-1?a+=i(p,!1):(a+=i(p.substr(0,A),!1),a+=p.substr(A))}if(y){if(y.length>=3&&y.charCodeAt(0)===47&&y.charCodeAt(2)===58){var G=y.charCodeAt(1);G>=65&&G<=90&&(y="/"+String.fromCharCode(G+32)+":"+y.substr(3))}else if(y.length>=2&&y.charCodeAt(1)===58){var G=y.charCodeAt(0);G>=65&&G<=90&&(y=String.fromCharCode(G+32)+":"+y.substr(2))}a+=i(y,!0)}return E&&(a+="?",a+=i(E,!1)),w&&(a+="#",a+=r?w:Xp(w,!1)),a}function Zp(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+Zp(t.substr(3)):t}}var _p=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Af(t){return t.match(_p)?t.replace(_p,function(r){return Zp(r)}):t}var Xg=function(){function t(r){try{this.patternRegExp=new RegExp(kg(r)+"$")}catch(i){this.patternRegExp=null}this.schemas=[]}return t.prototype.addSchema=function(r){this.schemas.push(r)},t.prototype.matchesPattern=function(r){return this.patternRegExp&&this.patternRegExp.test(r)},t.prototype.getSchemas=function(){return this.schemas},t}(),Qg=function(){function t(r,i,a){this.service=r,this.url=i,this.dependencies={},a&&(this.unresolvedSchema=this.service.promise.resolve(new cs(a)))}return t.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},t.prototype.getResolvedSchema=function(){var r=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(i){return r.service.resolveSchemaContent(i,r.url,r.dependencies)})),this.resolvedSchema},t.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},t}(),cs=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),qp=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return Mn(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var a=r.shift();if(i.properties&&typeof i.properties[a])return this.getSectionRecursive(r,i.properties[a]);if(i.patternProperties)for(var s=0,p=Object.keys(i.patternProperties);s<p.length;s++){var y=p[s],E=new RegExp(y);if(E.test(a))return this.getSectionRecursive(r,i.patternProperties[y])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(a.match("[0-9]+")){if(Array.isArray(i.items)){var w=parseInt(a,10);if(!isNaN(w)&&i.items[w])return this.getSectionRecursive(r,i.items[w])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),Zg=function(){function t(r,i,a){this.contextService=i,this.requestService=r,this.promiseConstructor=a||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return t.prototype.getRegisteredSchemaIds=function(r){return Object.keys(this.registeredSchemasIds).filter(function(i){var a=od.parse(i).scheme;return a!=="schemaservice"&&(!r||r(a))})},Object.defineProperty(t.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},t.prototype.onResourceChange=function(r){var i=this,a=!1;r=this.normalizeId(r);for(var s=[r],p=Object.keys(this.schemasById).map(function(A){return i.schemasById[A]});s.length;)for(var y=s.pop(),E=0;E<p.length;E++){var w=p[E];w&&(w.url===y||w.dependencies[y])&&(w.url!==y&&s.push(w.url),w.clearSchema(),p[E]=void 0,a=!0)}return a},t.prototype.normalizeId=function(r){try{return od.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var a in i){var s=this.normalizeId(a);this.contributionSchemas[s]=this.addSchemaHandle(s,i[a])}}if(r.schemaAssociations){var p=r.schemaAssociations;for(var y in p){var E=p[y];this.contributionAssociations[y]=E;for(var w=this.getOrAddFilePatternAssociation(y),A=0,k=E;A<k.length;A++){var G=k[A],a=this.normalizeId(G);w.addSchema(a)}}}},t.prototype.addSchemaHandle=function(r,i){var a=new Qg(this,r,i);return this.schemasById[r]=a,a},t.prototype.getOrAddSchemaHandle=function(r,i){return this.schemasById[r]||this.addSchemaHandle(r,i)},t.prototype.getOrAddFilePatternAssociation=function(r){var i=this.filePatternAssociationById[r];return i||(i=new Xg(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,a){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var p=0,y=i;p<y.length;p++){var E=y[p];this.getOrAddFilePatternAssociation(E).addSchema(s)}return a?this.addSchemaHandle(s,a):this.getOrAddSchemaHandle(s)},t.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var r in this.contributionSchemas)this.schemasById[r]=this.contributionSchemas[r],this.registeredSchemasIds[r]=!0;for(var i in this.contributionAssociations)for(var a=this.getOrAddFilePatternAssociation(i),s=0,p=this.contributionAssociations[i];s<p.length;s++){var y=p[s],r=this.normalizeId(y);a.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),a=this.schemasById[i];return a?a.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+Ef(r)+"'. No schema request service available";return this.promise.resolve(new cs({},[i]))}return this.requestService(r).then(function(a){if(!a){var s="Unable to load schema from '"+Ef(r)+"': No content.";return new cs({},[s])}var p={},y=[];p=pg(a,y);var E=y.length?["Unable to parse content from '"+Ef(r)+"': Parse error at offset "+y[0].offset]:[];return new cs(p,E)},function(a){var s="Unable to load schema from '"+Ef(r)+"': "+a.toString();return new cs({},[s])})},t.prototype.resolveSchemaContent=function(r,i,a){var s=this,p=r.errors.slice(0),y=r.schema;if(y.$schema){var E=this.normalizeId(y.$schema);if(E==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new qp({},["Draft-03 schemas are not supported."]));E==="https://json-schema.org/draft/2019-09/schema"&&r.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var w=this.contextService,A=function(re,se){if(!se)return re;var ye=re;return se[0]==="/"&&(se=se.substr(1)),se.split("/").some(function(ge){return ye=ye[ge],!ye}),ye},k=function(re,se,ye,ge){var Ee=A(se,ge);if(Ee)for(var me in Ee)Ee.hasOwnProperty(me)&&!re.hasOwnProperty(me)&&(re[me]=Ee[me]);else p.push("$ref '"+ge+"' in '"+ye+"' can not be resolved.")},G=function(re,se,ye,ge,Ee){w&&!/^\w+:\/\/.*/.test(se)&&(se=w.resolveRelativePath(se,ge)),se=s.normalizeId(se);var me=s.getOrAddSchemaHandle(se);return me.getUnresolvedSchema().then(function(Pe){if(Ee[se]=!0,Pe.errors.length){var Ge=ye?se+"#"+ye:se;p.push("Problems loading reference '"+Ge+"': "+Pe.errors[0]+".")}return k(re,Pe.schema,se,ye),ne(re,Pe.schema,se,me.dependencies)})},ne=function(re,se,ye,ge){if(!re||typeof re!="object")return Promise.resolve(null);for(var Ee=[re],me=[],Pe=[],Ge=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var At=et[ze];typeof At=="object"&&Ee.push(At)}},je=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var At=et[ze];if(typeof At=="object")for(var Nt in At){var Ht=At[Nt];typeof Ht=="object"&&Ee.push(Ht)}}},He=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var At=et[ze];if(Array.isArray(At))for(var Nt=0,Ht=At;Nt<Ht.length;Nt++){var or=Ht[Nt];typeof or=="object"&&Ee.push(or)}}},Ne=function(We){for(var Je=[];We.$ref;){var ze=We.$ref,et=ze.split("#",2);if(delete We.$ref,et[0].length>0){Pe.push(G(We,et[0],et[1],ye,ge));return}else Je.indexOf(ze)===-1&&(k(We,se,ye,et[1]),Je.push(ze))}Ge(We.items,We.additionalProperties,We.not,We.contains,We.propertyNames,We.if,We.then,We.else),je(We.definitions,We.properties,We.patternProperties,We.dependencies),He(We.anyOf,We.allOf,We.oneOf,We.items)};Ee.length;){var Ve=Ee.pop();me.indexOf(Ve)>=0||(me.push(Ve),Ne(Ve))}return s.promise.all(Pe)};return ne(y,y,i,a).then(function(re){return new qp(y,p)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var a=i.root.properties.filter(function(se){return se.keyNode.value==="$schema"&&se.valueNode&&se.valueNode.type==="string"});if(a.length>0){var s=Oo(a[0].valueNode);if(s&&Fg(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var p=this.normalizeId(s);return this.getOrAddSchemaHandle(p).getResolvedSchema()}}}for(var y=Object.create(null),E=[],w=0,A=this.filePatternAssociations;w<A.length;w++){var k=A[w];if(k.matchesPattern(r))for(var G=0,ne=k.getSchemas();G<ne.length;G++){var re=ne[G];y[re]||(E.push(re),y[re]=!0)}}return E.length>0?this.createCombinedSchema(r,E).getResolvedSchema():this.promise.resolve(null)},t.prototype.createCombinedSchema=function(r,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var a="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(p){return{$ref:p}})};return this.addSchemaHandle(a,s)},t}();function Ef(t){try{}catch(r){}return t}var _g=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate,this.commentSeverity=r.allowComments?void 0:$t.Error)},t.prototype.doValidation=function(r,i,a,s){var p=this;if(!this.validationEnabled)return this.promise.resolve([]);var y=[],E={},w=function(G){var ne=G.range.start.line+" "+G.range.start.character+" "+G.message;E[ne]||(E[ne]=!0,y.push(G))},A=function(G){var ne=a?rh(a.trailingCommas):$t.Error,re=a?rh(a.comments):p.commentSeverity;if(G){if(G.errors.length&&i.root){var se=i.root,ye=se.type==="object"?se.properties[0]:null;if(ye&&ye.keyNode.value==="$schema"){var ge=ye.valueNode||ye,Ee=lr.create(r.positionAt(ge.offset),r.positionAt(ge.offset+ge.length));w(ao.create(Ee,G.errors[0],$t.Warning,tr.SchemaResolveError))}else{var Ee=lr.create(r.positionAt(se.offset),r.positionAt(se.offset+1));w(ao.create(Ee,G.errors[0],$t.Warning,tr.SchemaResolveError))}}else{var me=i.validate(r,G.schema);me&&me.forEach(w)}eh(G.schema)&&(re=void 0),th(G.schema)&&(ne=void 0)}for(var Pe=0,Ge=i.syntaxErrors;Pe<Ge.length;Pe++){var je=Ge[Pe];if(je.code===tr.TrailingComma){if(typeof ne!="number")continue;je.severity=ne}w(je)}if(typeof re=="number"){var He="Comments are not permitted in JSON.";i.comments.forEach(function(Ne){w(ao.create(Ne,He,re,tr.CommentNotPermitted))})}return y};if(s){var k=s.id||"schemaservice://untitled/"+qg++;return this.jsonSchemaService.resolveSchemaContent(new cs(s),k,{}).then(function(G){return A(G)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function(G){return A(G)})},t}(),qg=0;function eh(t){if(t&&typeof t=="object"){if(Ri(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=eh(a);if(Ri(s))return s}}}function th(t){if(t&&typeof t=="object"){if(Ri(t.allowTrailingCommas))return t.allowTrailingCommas;if(Ri(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=th(a);if(Ri(s))return s}}}function rh(t){switch(t){case"error":return $t.Error;case"warning":return $t.Warning;case"ignore":return}}var nh=48,ey=57,ty=65,Cf=97,ry=102;function Hr(t){return t<nh?0:t<=ey?t-nh:(t<Cf&&(t+=Cf-ty),t>=Cf&&t<=ry?t-Cf+10:0)}function ny(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:Hr(t.charCodeAt(1))*17/255,green:Hr(t.charCodeAt(2))*17/255,blue:Hr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Hr(t.charCodeAt(1))*17/255,green:Hr(t.charCodeAt(2))*17/255,blue:Hr(t.charCodeAt(3))*17/255,alpha:Hr(t.charCodeAt(4))*17/255};case 7:return{red:(Hr(t.charCodeAt(1))*16+Hr(t.charCodeAt(2)))/255,green:(Hr(t.charCodeAt(3))*16+Hr(t.charCodeAt(4)))/255,blue:(Hr(t.charCodeAt(5))*16+Hr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Hr(t.charCodeAt(1))*16+Hr(t.charCodeAt(2)))/255,green:(Hr(t.charCodeAt(3))*16+Hr(t.charCodeAt(4)))/255,blue:(Hr(t.charCodeAt(5))*16+Hr(t.charCodeAt(6)))/255,alpha:(Hr(t.charCodeAt(7))*16+Hr(t.charCodeAt(8)))/255}}return null}function Xm(t,r,i,a){return a===void 0&&(a=1),{red:t/255,green:r/255,blue:i/255,alpha:a}}var iy=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,E=r.uri;if((E==="vscode://defaultsettings/keybindings.json"||nd(E.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],A=0,k=p.items;A<k.length;A++){var G=k[A];if(G.type==="object")for(var ne=0,re=G.properties;ne<re.length;ne++){var se=re[ne];if(se.keyNode.value==="key"&&se.valueNode){var ye=Tl.create(r.uri,To(r,G));if(w.push({name:Oo(se.valueNode),kind:Li.Function,location:ye}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E),w}}}return w}var ge=function(me,Pe,Ge){return y>=0&&(Pe.type==="array"?Pe.items.forEach(function(je){return ge(me,je,Ge)}):Pe.type==="object"&&Pe.properties.forEach(function(je){if(y>=0){var He=je.valueNode;if(He){y--;var Ne=Tl.create(r.uri,To(r,je)),Ve=Ge?Ge+"."+je.keyNode.value:je.keyNode.value;me.push({name:s.getKeyLabel(je),kind:s.getSymbolKind(He.type),location:Ne,containerName:Ge}),ge(me,He,Ve)}}})),me},Ee=ge([],p,void 0);return y<0&&(Ee.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E)),Ee},t.prototype.findDocumentSymbols2=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,E=r.uri;if((E==="vscode://defaultsettings/keybindings.json"||nd(E.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],A=0,k=p.items;A<k.length;A++){var G=k[A];if(G.type==="object")for(var ne=0,re=G.properties;ne<re.length;ne++){var se=re[ne];if(se.keyNode.value==="key"&&se.valueNode){var ye=To(r,G),ge=To(r,se.keyNode);if(w.push({name:Oo(se.valueNode),kind:Li.Function,range:ye,selectionRange:ge}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E),w}}}return w}var Ee=function(Pe,Ge){return y>=0&&(Ge.type==="array"?Ge.items.forEach(function(je,He){if(je&&y>=0){y--;var Ne=To(r,je),Ve=Ne,We=String(He),Je=Ee([],je);Pe.push({name:We,kind:s.getSymbolKind(je.type),range:Ne,selectionRange:Ve,children:Je})}}):Ge.type==="object"&&Ge.properties.forEach(function(je){var He=je.valueNode;if(He&&y>=0){y--;var Ne=To(r,je),Ve=To(r,je.keyNode),We=Ee([],He);Pe.push({name:s.getKeyLabel(je),kind:s.getSymbolKind(He.type),range:Ne,selectionRange:Ve,children:We})}})),Pe},me=Ee([],p);return y<0&&(me.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E)),me},t.prototype.getSymbolKind=function(r){switch(r){case"object":return Li.Module;case"string":return Li.String;case"number":return Li.Number;case"array":return Li.Array;case"boolean":return Li.Boolean;default:return Li.Variable}},t.prototype.getKeyLabel=function(r){var i=r.keyNode.value;return i&&(i=i.replace(/[\n]/g,"\u21B5")),i&&i.trim()?i:'"'+i+'"'},t.prototype.findDocumentColors=function(r,i,a){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var p=[];if(s)for(var y=a&&typeof a.resultLimit=="number"?a.resultLimit:Number.MAX_VALUE,E=i.getMatchingSchemas(s.schema),w={},A=0,k=E;A<k.length;A++){var G=k[A];if(!G.inverted&&G.schema&&(G.schema.format==="color"||G.schema.format==="color-hex")&&G.node&&G.node.type==="string"){var ne=String(G.node.offset);if(!w[ne]){var re=ny(Oo(G.node));if(re){var se=To(r,G.node);p.push({color:re,range:se})}if(w[ne]=!0,y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(r.uri),p}}}return p})},t.prototype.getColorPresentations=function(r,i,a,s){var p=[],y=Math.round(a.red*255),E=Math.round(a.green*255),w=Math.round(a.blue*255);function A(G){var ne=G.toString(16);return ne.length!==2?"0"+ne:ne}var k;return a.alpha===1?k="#"+A(y)+A(E)+A(w):k="#"+A(y)+A(E)+A(w)+A(Math.round(a.alpha*255)),p.push({label:k,textEdit:vi.replace(s,JSON.stringify(k))}),p},t}();function To(t,r){return lr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var oy={schemaAssociations:{},schemas:{}};function ay(t,r){var i=[],a=[],s=[],p=-1,y=ls(t.getText(),!1),E=y.scan();function w(Je){i.push(Je),a.push(s.length)}for(;E!==17;){switch(E){case 1:case 3:{var A=t.positionAt(y.getTokenOffset()).line,k={startLine:A,endLine:A,kind:E===1?"object":"array"};s.push(k);break}case 2:case 4:{var G=E===2?"object":"array";if(s.length>0&&s[s.length-1].kind===G){var k=s.pop(),ne=t.positionAt(y.getTokenOffset()).line;k&&ne>k.startLine+1&&p!==k.startLine&&(k.endLine=ne-1,w(k),p=k.startLine)}break}case 13:{var A=t.positionAt(y.getTokenOffset()).line,re=t.positionAt(y.getTokenOffset()+y.getTokenLength()).line;y.getTokenError()===1&&A+1<t.lineCount?y.setPosition(t.offsetAt(hi.create(A+1,0))):A<re&&(w({startLine:A,endLine:re,kind:Pl.Comment}),p=A);break}case 12:{var se=t.getText().substr(y.getTokenOffset(),y.getTokenLength()),ye=se.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(ye){var ne=t.positionAt(y.getTokenOffset()).line;if(ye[1]){var k={startLine:ne,endLine:ne,kind:Pl.Region};s.push(k)}else{for(var ge=s.length-1;ge>=0&&s[ge].kind!==Pl.Region;)ge--;if(ge>=0){var k=s[ge];s.length=ge,ne>k.startLine&&p!==k.startLine&&(k.endLine=ne,w(k),p=k.startLine)}}}break}}E=y.scan()}var Ee=r&&r.rangeLimit;if(typeof Ee!="number"||i.length<=Ee)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var me=[],Pe=0,Ge=a;Pe<Ge.length;Pe++){var je=Ge[Pe];je<30&&(me[je]=(me[je]||0)+1)}for(var He=0,Ne=0,ge=0;ge<me.length;ge++){var Ve=me[ge];if(Ve){if(Ve+He>Ee){Ne=ge;break}He+=Ve}}for(var We=[],ge=0;ge<i.length;ge++){var je=a[ge];typeof je=="number"&&(je<Ne||je===Ne&&He++<Ee)&&We.push(i[ge])}return We}function sy(t,r,i){function a(E){for(var w=t.offsetAt(E),A=i.getNodeFromOffset(w,!0),k=[];A;){switch(A.type){case"string":case"object":case"array":var G=A.offset+1,ne=A.offset+A.length-1;G<ne&&w>=G&&w<=ne&&k.push(s(G,ne)),k.push(s(A.offset,A.offset+A.length));break;case"number":case"boolean":case"null":case"property":k.push(s(A.offset,A.offset+A.length));break}if(A.type==="property"||A.parent&&A.parent.type==="array"){var re=y(A.offset+A.length,5);re!==-1&&k.push(s(A.offset,re))}A=A.parent}for(var se=void 0,ye=k.length-1;ye>=0;ye--)se=wf.create(k[ye],se);return se||(se=wf.create(lr.create(E,E))),se}function s(E,w){return lr.create(t.positionAt(E),t.positionAt(w))}var p=ls(t.getText(),!0);function y(E,w){p.setPosition(E);var A=p.scan();return A===w?p.getTokenOffset()+p.getTokenLength():-1}return r.map(a)}function ly(t){var r=t.promiseConstructor||Promise,i=new Zg(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(oy);var a=new Lg(i,t.contributions,r,t.clientCapabilities),s=new Dg(i,t.contributions,r),p=new iy(i),y=new _g(i,r);return{configure:function(E){i.clearExternalSchemas(),E.schemas&&E.schemas.forEach(function(w){i.registerExternalSchema(w.uri,w.fileMatch,w.schema)}),y.configure(E)},resetSchema:function(E){return i.onResourceChange(E)},doValidation:y.doValidation.bind(y),parseJSONDocument:function(E){return Ig(E,{collectComments:!0})},newJSONDocument:function(E,w){return Pg(E,w)},doComplete:a.doComplete.bind(a),findDocumentSymbols:p.findDocumentSymbols.bind(p),findDocumentSymbols2:p.findDocumentSymbols2.bind(p),findColorSymbols:function(E,w){return p.findDocumentColors(E,w).then(function(A){return A.map(function(k){return k.range})})},findDocumentColors:p.findDocumentColors.bind(p),getColorPresentations:p.getColorPresentations.bind(p),doHover:s.doHover.bind(s),getFoldingRanges:ay,getSelectionRanges:sy,format:function(E,w,A){var k=void 0;if(w){var G=E.offsetAt(w.start),ne=E.offsetAt(w.end)-G;k={offset:G,length:ne}}var re={tabSize:A?A.tabSize:4,insertSpaces:A?A.insertSpaces:!0,eol:`
|
|
392
|
-
`};return yg(E.getText(),k,re).map(function(se){return vi.replace(lr.create(E.positionAt(se.offset),E.positionAt(se.offset+se.length)),se.content)})}}}var Qm=o(96876),Zm=o(4328),_m=o(3256),qm=o(71707),e0=o(82801),t0=o(32095),r0=o(86081),n0=o(44254),i0=o(75019),o0=o(13837),
|
|
391
|
+
$3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function Ng(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var Bg=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),Wr,Ll;if(typeof process=="object")Ll=!1;else if(typeof navigator=="object"){var Ug=navigator.userAgent;Ll=Ug.indexOf("Windows")>=0}function $m(t){return 55296<=t&&t<=56319}function Km(t){return 56320<=t&&t<=57343}function Ym(t){return t>=97&&t<=102}function jg(t){return t>=97&&t<=122}function Vg(t){return t>=65&&t<=90}function Jm(t){return jg(t)||Vg(t)}var Wg=/^\w[\w\d+.-]*$/,Hg=/^\//,zg=/^\/\//;function Gg(t,r){if(!t.scheme&&r)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!Wg.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!Hg.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(zg.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function $g(t,r){return!t&&!r?"file":t}function Kg(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==gi&&(r=gi+r):r=gi;break}return r}var pr="",gi="/",Yg=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,od=function(){function t(r,i,a,s,p,y){y===void 0&&(y=!1),typeof r=="object"?(this.scheme=r.scheme||pr,this.authority=r.authority||pr,this.path=r.path||pr,this.query=r.query||pr,this.fragment=r.fragment||pr):(this.scheme=$g(r,y),this.authority=i||pr,this.path=Kg(this.scheme,a||pr),this.query=s||pr,this.fragment=p||pr,Gg(this,y))}return t.isUri=function(r){return r instanceof t?!0:r?typeof r.authority=="string"&&typeof r.fragment=="string"&&typeof r.path=="string"&&typeof r.query=="string"&&typeof r.scheme=="string"&&typeof r.fsPath=="function"&&typeof r.with=="function"&&typeof r.toString=="function":!1},Object.defineProperty(t.prototype,"fsPath",{get:function(){return Zp(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,a=r.authority,s=r.path,p=r.query,y=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=pr),a===void 0?a=this.authority:a===null&&(a=pr),s===void 0?s=this.path:s===null&&(s=pr),p===void 0?p=this.query:p===null&&(p=pr),y===void 0?y=this.fragment:y===null&&(y=pr),i===this.scheme&&a===this.authority&&s===this.path&&p===this.query&&y===this.fragment?this:new fs(i,a,s,p,y)},t.parse=function(r,i){i===void 0&&(i=!1);var a=Yg.exec(r);return a?new fs(a[2]||pr,Af(a[4]||pr),Af(a[5]||pr),Af(a[7]||pr),Af(a[9]||pr),i):new fs(pr,pr,pr,pr,pr)},t.file=function(r){var i=pr;if(Ll&&(r=r.replace(/\\/g,gi)),r[0]===gi&&r[1]===gi){var a=r.indexOf(gi,2);a===-1?(i=r.substring(2),r=gi):(i=r.substring(2,a),r=r.substring(a)||gi)}return new fs("file",i,r,pr,pr)},t.from=function(r){return new fs(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),ad(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new fs(r);return i._formatted=r.external,i._fsPath=r._sep===Jp?r.fsPath:null,i}else return r},t}(),Jp=Ll?1:void 0,fs=function(t){Bg(r,t);function r(){var i=t!==null&&t.apply(this,arguments)||this;return i._formatted=null,i._fsPath=null,i}return Object.defineProperty(r.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=Zp(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?ad(this,!0):(this._formatted||(this._formatted=ad(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=Jp),this._formatted&&(i.external=this._formatted),this.path&&(i.path=this.path),this.scheme&&(i.scheme=this.scheme),this.authority&&(i.authority=this.authority),this.query&&(i.query=this.query),this.fragment&&(i.fragment=this.fragment),i},r}(od),Xp=(Wr={},Wr[58]="%3A",Wr[47]="%2F",Wr[63]="%3F",Wr[35]="%23",Wr[91]="%5B",Wr[93]="%5D",Wr[64]="%40",Wr[33]="%21",Wr[36]="%24",Wr[38]="%26",Wr[39]="%27",Wr[40]="%28",Wr[41]="%29",Wr[42]="%2A",Wr[43]="%2B",Wr[44]="%2C",Wr[59]="%3B",Wr[61]="%3D",Wr[32]="%20",Wr);function Qp(t,r){for(var i=void 0,a=-1,s=0;s<t.length;s++){var p=t.charCodeAt(s);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45||p===46||p===95||p===126||r&&p===47)a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var y=Xp[p];y!==void 0?(a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i+=y):a===-1&&(a=s)}}return a!==-1&&(i+=encodeURIComponent(t.substring(a))),i!==void 0?i:t}function Jg(t){for(var r=void 0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a===35||a===63?(r===void 0&&(r=t.substr(0,i)),r+=Xp[a]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function Zp(t,r){var i;return t.authority&&t.path.length>1&&t.scheme==="file"?i="//"+t.authority+t.path:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?r?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,Ll&&(i=i.replace(/\//g,"\\")),i}function ad(t,r){var i=r?Jg:Qp,a="",s=t.scheme,p=t.authority,y=t.path,E=t.query,w=t.fragment;if(s&&(a+=s,a+=":"),(p||s==="file")&&(a+=gi,a+=gi),p){var A=p.indexOf("@");if(A!==-1){var k=p.substr(0,A);p=p.substr(A+1),A=k.indexOf(":"),A===-1?a+=i(k,!1):(a+=i(k.substr(0,A),!1),a+=":",a+=i(k.substr(A+1),!1)),a+="@"}p=p.toLowerCase(),A=p.indexOf(":"),A===-1?a+=i(p,!1):(a+=i(p.substr(0,A),!1),a+=p.substr(A))}if(y){if(y.length>=3&&y.charCodeAt(0)===47&&y.charCodeAt(2)===58){var G=y.charCodeAt(1);G>=65&&G<=90&&(y="/"+String.fromCharCode(G+32)+":"+y.substr(3))}else if(y.length>=2&&y.charCodeAt(1)===58){var G=y.charCodeAt(0);G>=65&&G<=90&&(y=String.fromCharCode(G+32)+":"+y.substr(2))}a+=i(y,!0)}return E&&(a+="?",a+=i(E,!1)),w&&(a+="#",a+=r?w:Qp(w,!1)),a}function _p(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+_p(t.substr(3)):t}}var qp=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Af(t){return t.match(qp)?t.replace(qp,function(r){return _p(r)}):t}var Xg=function(){function t(r){try{this.patternRegExp=new RegExp(kg(r)+"$")}catch(i){this.patternRegExp=null}this.schemas=[]}return t.prototype.addSchema=function(r){this.schemas.push(r)},t.prototype.matchesPattern=function(r){return this.patternRegExp&&this.patternRegExp.test(r)},t.prototype.getSchemas=function(){return this.schemas},t}(),Qg=function(){function t(r,i,a){this.service=r,this.url=i,this.dependencies={},a&&(this.unresolvedSchema=this.service.promise.resolve(new cs(a)))}return t.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},t.prototype.getResolvedSchema=function(){var r=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(i){return r.service.resolveSchemaContent(i,r.url,r.dependencies)})),this.resolvedSchema},t.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},t}(),cs=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),eh=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return Mn(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var a=r.shift();if(i.properties&&typeof i.properties[a])return this.getSectionRecursive(r,i.properties[a]);if(i.patternProperties)for(var s=0,p=Object.keys(i.patternProperties);s<p.length;s++){var y=p[s],E=new RegExp(y);if(E.test(a))return this.getSectionRecursive(r,i.patternProperties[y])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(a.match("[0-9]+")){if(Array.isArray(i.items)){var w=parseInt(a,10);if(!isNaN(w)&&i.items[w])return this.getSectionRecursive(r,i.items[w])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),Zg=function(){function t(r,i,a){this.contextService=i,this.requestService=r,this.promiseConstructor=a||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return t.prototype.getRegisteredSchemaIds=function(r){return Object.keys(this.registeredSchemasIds).filter(function(i){var a=od.parse(i).scheme;return a!=="schemaservice"&&(!r||r(a))})},Object.defineProperty(t.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},t.prototype.onResourceChange=function(r){var i=this,a=!1;r=this.normalizeId(r);for(var s=[r],p=Object.keys(this.schemasById).map(function(A){return i.schemasById[A]});s.length;)for(var y=s.pop(),E=0;E<p.length;E++){var w=p[E];w&&(w.url===y||w.dependencies[y])&&(w.url!==y&&s.push(w.url),w.clearSchema(),p[E]=void 0,a=!0)}return a},t.prototype.normalizeId=function(r){try{return od.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var a in i){var s=this.normalizeId(a);this.contributionSchemas[s]=this.addSchemaHandle(s,i[a])}}if(r.schemaAssociations){var p=r.schemaAssociations;for(var y in p){var E=p[y];this.contributionAssociations[y]=E;for(var w=this.getOrAddFilePatternAssociation(y),A=0,k=E;A<k.length;A++){var G=k[A],a=this.normalizeId(G);w.addSchema(a)}}}},t.prototype.addSchemaHandle=function(r,i){var a=new Qg(this,r,i);return this.schemasById[r]=a,a},t.prototype.getOrAddSchemaHandle=function(r,i){return this.schemasById[r]||this.addSchemaHandle(r,i)},t.prototype.getOrAddFilePatternAssociation=function(r){var i=this.filePatternAssociationById[r];return i||(i=new Xg(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,a){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var p=0,y=i;p<y.length;p++){var E=y[p];this.getOrAddFilePatternAssociation(E).addSchema(s)}return a?this.addSchemaHandle(s,a):this.getOrAddSchemaHandle(s)},t.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var r in this.contributionSchemas)this.schemasById[r]=this.contributionSchemas[r],this.registeredSchemasIds[r]=!0;for(var i in this.contributionAssociations)for(var a=this.getOrAddFilePatternAssociation(i),s=0,p=this.contributionAssociations[i];s<p.length;s++){var y=p[s],r=this.normalizeId(y);a.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),a=this.schemasById[i];return a?a.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+Ef(r)+"'. No schema request service available";return this.promise.resolve(new cs({},[i]))}return this.requestService(r).then(function(a){if(!a){var s="Unable to load schema from '"+Ef(r)+"': No content.";return new cs({},[s])}var p={},y=[];p=pg(a,y);var E=y.length?["Unable to parse content from '"+Ef(r)+"': Parse error at offset "+y[0].offset]:[];return new cs(p,E)},function(a){var s="Unable to load schema from '"+Ef(r)+"': "+a.toString();return new cs({},[s])})},t.prototype.resolveSchemaContent=function(r,i,a){var s=this,p=r.errors.slice(0),y=r.schema;if(y.$schema){var E=this.normalizeId(y.$schema);if(E==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new eh({},["Draft-03 schemas are not supported."]));E==="https://json-schema.org/draft/2019-09/schema"&&r.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var w=this.contextService,A=function(re,se){if(!se)return re;var ye=re;return se[0]==="/"&&(se=se.substr(1)),se.split("/").some(function(ge){return ye=ye[ge],!ye}),ye},k=function(re,se,ye,ge){var Ee=A(se,ge);if(Ee)for(var me in Ee)Ee.hasOwnProperty(me)&&!re.hasOwnProperty(me)&&(re[me]=Ee[me]);else p.push("$ref '"+ge+"' in '"+ye+"' can not be resolved.")},G=function(re,se,ye,ge,Ee){w&&!/^\w+:\/\/.*/.test(se)&&(se=w.resolveRelativePath(se,ge)),se=s.normalizeId(se);var me=s.getOrAddSchemaHandle(se);return me.getUnresolvedSchema().then(function(Pe){if(Ee[se]=!0,Pe.errors.length){var Ge=ye?se+"#"+ye:se;p.push("Problems loading reference '"+Ge+"': "+Pe.errors[0]+".")}return k(re,Pe.schema,se,ye),ne(re,Pe.schema,se,me.dependencies)})},ne=function(re,se,ye,ge){if(!re||typeof re!="object")return Promise.resolve(null);for(var Ee=[re],me=[],Pe=[],Ge=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var At=et[ze];typeof At=="object"&&Ee.push(At)}},je=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var At=et[ze];if(typeof At=="object")for(var Nt in At){var Ht=At[Nt];typeof Ht=="object"&&Ee.push(Ht)}}},He=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var At=et[ze];if(Array.isArray(At))for(var Nt=0,Ht=At;Nt<Ht.length;Nt++){var or=Ht[Nt];typeof or=="object"&&Ee.push(or)}}},Ne=function(We){for(var Je=[];We.$ref;){var ze=We.$ref,et=ze.split("#",2);if(delete We.$ref,et[0].length>0){Pe.push(G(We,et[0],et[1],ye,ge));return}else Je.indexOf(ze)===-1&&(k(We,se,ye,et[1]),Je.push(ze))}Ge(We.items,We.additionalProperties,We.not,We.contains,We.propertyNames,We.if,We.then,We.else),je(We.definitions,We.properties,We.patternProperties,We.dependencies),He(We.anyOf,We.allOf,We.oneOf,We.items)};Ee.length;){var Ve=Ee.pop();me.indexOf(Ve)>=0||(me.push(Ve),Ne(Ve))}return s.promise.all(Pe)};return ne(y,y,i,a).then(function(re){return new eh(y,p)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var a=i.root.properties.filter(function(se){return se.keyNode.value==="$schema"&&se.valueNode&&se.valueNode.type==="string"});if(a.length>0){var s=Oo(a[0].valueNode);if(s&&Fg(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var p=this.normalizeId(s);return this.getOrAddSchemaHandle(p).getResolvedSchema()}}}for(var y=Object.create(null),E=[],w=0,A=this.filePatternAssociations;w<A.length;w++){var k=A[w];if(k.matchesPattern(r))for(var G=0,ne=k.getSchemas();G<ne.length;G++){var re=ne[G];y[re]||(E.push(re),y[re]=!0)}}return E.length>0?this.createCombinedSchema(r,E).getResolvedSchema():this.promise.resolve(null)},t.prototype.createCombinedSchema=function(r,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var a="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(p){return{$ref:p}})};return this.addSchemaHandle(a,s)},t}();function Ef(t){try{}catch(r){}return t}var _g=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate,this.commentSeverity=r.allowComments?void 0:$t.Error)},t.prototype.doValidation=function(r,i,a,s){var p=this;if(!this.validationEnabled)return this.promise.resolve([]);var y=[],E={},w=function(G){var ne=G.range.start.line+" "+G.range.start.character+" "+G.message;E[ne]||(E[ne]=!0,y.push(G))},A=function(G){var ne=a?nh(a.trailingCommas):$t.Error,re=a?nh(a.comments):p.commentSeverity;if(G){if(G.errors.length&&i.root){var se=i.root,ye=se.type==="object"?se.properties[0]:null;if(ye&&ye.keyNode.value==="$schema"){var ge=ye.valueNode||ye,Ee=lr.create(r.positionAt(ge.offset),r.positionAt(ge.offset+ge.length));w(ao.create(Ee,G.errors[0],$t.Warning,tr.SchemaResolveError))}else{var Ee=lr.create(r.positionAt(se.offset),r.positionAt(se.offset+1));w(ao.create(Ee,G.errors[0],$t.Warning,tr.SchemaResolveError))}}else{var me=i.validate(r,G.schema);me&&me.forEach(w)}th(G.schema)&&(re=void 0),rh(G.schema)&&(ne=void 0)}for(var Pe=0,Ge=i.syntaxErrors;Pe<Ge.length;Pe++){var je=Ge[Pe];if(je.code===tr.TrailingComma){if(typeof ne!="number")continue;je.severity=ne}w(je)}if(typeof re=="number"){var He="Comments are not permitted in JSON.";i.comments.forEach(function(Ne){w(ao.create(Ne,He,re,tr.CommentNotPermitted))})}return y};if(s){var k=s.id||"schemaservice://untitled/"+qg++;return this.jsonSchemaService.resolveSchemaContent(new cs(s),k,{}).then(function(G){return A(G)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function(G){return A(G)})},t}(),qg=0;function th(t){if(t&&typeof t=="object"){if(Ri(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=th(a);if(Ri(s))return s}}}function rh(t){if(t&&typeof t=="object"){if(Ri(t.allowTrailingCommas))return t.allowTrailingCommas;if(Ri(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=rh(a);if(Ri(s))return s}}}function nh(t){switch(t){case"error":return $t.Error;case"warning":return $t.Warning;case"ignore":return}}var ih=48,ey=57,ty=65,Cf=97,ry=102;function Hr(t){return t<ih?0:t<=ey?t-ih:(t<Cf&&(t+=Cf-ty),t>=Cf&&t<=ry?t-Cf+10:0)}function ny(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:Hr(t.charCodeAt(1))*17/255,green:Hr(t.charCodeAt(2))*17/255,blue:Hr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Hr(t.charCodeAt(1))*17/255,green:Hr(t.charCodeAt(2))*17/255,blue:Hr(t.charCodeAt(3))*17/255,alpha:Hr(t.charCodeAt(4))*17/255};case 7:return{red:(Hr(t.charCodeAt(1))*16+Hr(t.charCodeAt(2)))/255,green:(Hr(t.charCodeAt(3))*16+Hr(t.charCodeAt(4)))/255,blue:(Hr(t.charCodeAt(5))*16+Hr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Hr(t.charCodeAt(1))*16+Hr(t.charCodeAt(2)))/255,green:(Hr(t.charCodeAt(3))*16+Hr(t.charCodeAt(4)))/255,blue:(Hr(t.charCodeAt(5))*16+Hr(t.charCodeAt(6)))/255,alpha:(Hr(t.charCodeAt(7))*16+Hr(t.charCodeAt(8)))/255}}return null}function Xm(t,r,i,a){return a===void 0&&(a=1),{red:t/255,green:r/255,blue:i/255,alpha:a}}var iy=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,E=r.uri;if((E==="vscode://defaultsettings/keybindings.json"||nd(E.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],A=0,k=p.items;A<k.length;A++){var G=k[A];if(G.type==="object")for(var ne=0,re=G.properties;ne<re.length;ne++){var se=re[ne];if(se.keyNode.value==="key"&&se.valueNode){var ye=Pl.create(r.uri,To(r,G));if(w.push({name:Oo(se.valueNode),kind:Li.Function,location:ye}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E),w}}}return w}var ge=function(me,Pe,Ge){return y>=0&&(Pe.type==="array"?Pe.items.forEach(function(je){return ge(me,je,Ge)}):Pe.type==="object"&&Pe.properties.forEach(function(je){if(y>=0){var He=je.valueNode;if(He){y--;var Ne=Pl.create(r.uri,To(r,je)),Ve=Ge?Ge+"."+je.keyNode.value:je.keyNode.value;me.push({name:s.getKeyLabel(je),kind:s.getSymbolKind(He.type),location:Ne,containerName:Ge}),ge(me,He,Ve)}}})),me},Ee=ge([],p,void 0);return y<0&&(Ee.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E)),Ee},t.prototype.findDocumentSymbols2=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,E=r.uri;if((E==="vscode://defaultsettings/keybindings.json"||nd(E.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],A=0,k=p.items;A<k.length;A++){var G=k[A];if(G.type==="object")for(var ne=0,re=G.properties;ne<re.length;ne++){var se=re[ne];if(se.keyNode.value==="key"&&se.valueNode){var ye=To(r,G),ge=To(r,se.keyNode);if(w.push({name:Oo(se.valueNode),kind:Li.Function,range:ye,selectionRange:ge}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E),w}}}return w}var Ee=function(Pe,Ge){return y>=0&&(Ge.type==="array"?Ge.items.forEach(function(je,He){if(je&&y>=0){y--;var Ne=To(r,je),Ve=Ne,We=String(He),Je=Ee([],je);Pe.push({name:We,kind:s.getSymbolKind(je.type),range:Ne,selectionRange:Ve,children:Je})}}):Ge.type==="object"&&Ge.properties.forEach(function(je){var He=je.valueNode;if(He&&y>=0){y--;var Ne=To(r,je),Ve=To(r,je.keyNode),We=Ee([],He);Pe.push({name:s.getKeyLabel(je),kind:s.getSymbolKind(He.type),range:Ne,selectionRange:Ve,children:We})}})),Pe},me=Ee([],p);return y<0&&(me.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(E)),me},t.prototype.getSymbolKind=function(r){switch(r){case"object":return Li.Module;case"string":return Li.String;case"number":return Li.Number;case"array":return Li.Array;case"boolean":return Li.Boolean;default:return Li.Variable}},t.prototype.getKeyLabel=function(r){var i=r.keyNode.value;return i&&(i=i.replace(/[\n]/g,"\u21B5")),i&&i.trim()?i:'"'+i+'"'},t.prototype.findDocumentColors=function(r,i,a){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var p=[];if(s)for(var y=a&&typeof a.resultLimit=="number"?a.resultLimit:Number.MAX_VALUE,E=i.getMatchingSchemas(s.schema),w={},A=0,k=E;A<k.length;A++){var G=k[A];if(!G.inverted&&G.schema&&(G.schema.format==="color"||G.schema.format==="color-hex")&&G.node&&G.node.type==="string"){var ne=String(G.node.offset);if(!w[ne]){var re=ny(Oo(G.node));if(re){var se=To(r,G.node);p.push({color:re,range:se})}if(w[ne]=!0,y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(r.uri),p}}}return p})},t.prototype.getColorPresentations=function(r,i,a,s){var p=[],y=Math.round(a.red*255),E=Math.round(a.green*255),w=Math.round(a.blue*255);function A(G){var ne=G.toString(16);return ne.length!==2?"0"+ne:ne}var k;return a.alpha===1?k="#"+A(y)+A(E)+A(w):k="#"+A(y)+A(E)+A(w)+A(Math.round(a.alpha*255)),p.push({label:k,textEdit:vi.replace(s,JSON.stringify(k))}),p},t}();function To(t,r){return lr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var oy={schemaAssociations:{},schemas:{}};function ay(t,r){var i=[],a=[],s=[],p=-1,y=ls(t.getText(),!1),E=y.scan();function w(Je){i.push(Je),a.push(s.length)}for(;E!==17;){switch(E){case 1:case 3:{var A=t.positionAt(y.getTokenOffset()).line,k={startLine:A,endLine:A,kind:E===1?"object":"array"};s.push(k);break}case 2:case 4:{var G=E===2?"object":"array";if(s.length>0&&s[s.length-1].kind===G){var k=s.pop(),ne=t.positionAt(y.getTokenOffset()).line;k&&ne>k.startLine+1&&p!==k.startLine&&(k.endLine=ne-1,w(k),p=k.startLine)}break}case 13:{var A=t.positionAt(y.getTokenOffset()).line,re=t.positionAt(y.getTokenOffset()+y.getTokenLength()).line;y.getTokenError()===1&&A+1<t.lineCount?y.setPosition(t.offsetAt(hi.create(A+1,0))):A<re&&(w({startLine:A,endLine:re,kind:Il.Comment}),p=A);break}case 12:{var se=t.getText().substr(y.getTokenOffset(),y.getTokenLength()),ye=se.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(ye){var ne=t.positionAt(y.getTokenOffset()).line;if(ye[1]){var k={startLine:ne,endLine:ne,kind:Il.Region};s.push(k)}else{for(var ge=s.length-1;ge>=0&&s[ge].kind!==Il.Region;)ge--;if(ge>=0){var k=s[ge];s.length=ge,ne>k.startLine&&p!==k.startLine&&(k.endLine=ne,w(k),p=k.startLine)}}}break}}E=y.scan()}var Ee=r&&r.rangeLimit;if(typeof Ee!="number"||i.length<=Ee)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var me=[],Pe=0,Ge=a;Pe<Ge.length;Pe++){var je=Ge[Pe];je<30&&(me[je]=(me[je]||0)+1)}for(var He=0,Ne=0,ge=0;ge<me.length;ge++){var Ve=me[ge];if(Ve){if(Ve+He>Ee){Ne=ge;break}He+=Ve}}for(var We=[],ge=0;ge<i.length;ge++){var je=a[ge];typeof je=="number"&&(je<Ne||je===Ne&&He++<Ee)&&We.push(i[ge])}return We}function sy(t,r,i){function a(E){for(var w=t.offsetAt(E),A=i.getNodeFromOffset(w,!0),k=[];A;){switch(A.type){case"string":case"object":case"array":var G=A.offset+1,ne=A.offset+A.length-1;G<ne&&w>=G&&w<=ne&&k.push(s(G,ne)),k.push(s(A.offset,A.offset+A.length));break;case"number":case"boolean":case"null":case"property":k.push(s(A.offset,A.offset+A.length));break}if(A.type==="property"||A.parent&&A.parent.type==="array"){var re=y(A.offset+A.length,5);re!==-1&&k.push(s(A.offset,re))}A=A.parent}for(var se=void 0,ye=k.length-1;ye>=0;ye--)se=wf.create(k[ye],se);return se||(se=wf.create(lr.create(E,E))),se}function s(E,w){return lr.create(t.positionAt(E),t.positionAt(w))}var p=ls(t.getText(),!0);function y(E,w){p.setPosition(E);var A=p.scan();return A===w?p.getTokenOffset()+p.getTokenLength():-1}return r.map(a)}function ly(t){var r=t.promiseConstructor||Promise,i=new Zg(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(oy);var a=new Lg(i,t.contributions,r,t.clientCapabilities),s=new Dg(i,t.contributions,r),p=new iy(i),y=new _g(i,r);return{configure:function(E){i.clearExternalSchemas(),E.schemas&&E.schemas.forEach(function(w){i.registerExternalSchema(w.uri,w.fileMatch,w.schema)}),y.configure(E)},resetSchema:function(E){return i.onResourceChange(E)},doValidation:y.doValidation.bind(y),parseJSONDocument:function(E){return Ig(E,{collectComments:!0})},newJSONDocument:function(E,w){return Pg(E,w)},doComplete:a.doComplete.bind(a),findDocumentSymbols:p.findDocumentSymbols.bind(p),findDocumentSymbols2:p.findDocumentSymbols2.bind(p),findColorSymbols:function(E,w){return p.findDocumentColors(E,w).then(function(A){return A.map(function(k){return k.range})})},findDocumentColors:p.findDocumentColors.bind(p),getColorPresentations:p.getColorPresentations.bind(p),doHover:s.doHover.bind(s),getFoldingRanges:ay,getSelectionRanges:sy,format:function(E,w,A){var k=void 0;if(w){var G=E.offsetAt(w.start),ne=E.offsetAt(w.end)-G;k={offset:G,length:ne}}var re={tabSize:A?A.tabSize:4,insertSpaces:A?A.insertSpaces:!0,eol:`
|
|
392
|
+
`};return yg(E.getText(),k,re).map(function(se){return vi.replace(lr.create(E.positionAt(se.offset),E.positionAt(se.offset+se.length)),se.content)})}}}var Qm=o(96876),Zm=o(4328),_m=o(3256),qm=o(71707),e0=o(82801),t0=o(32095),r0=o(86081),n0=o(44254),i0=o(75019),o0=o(13837),oh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});const ds=ly({});as.registerHelper("lint","json",function(t,r){return oh(this,null,function*(){const{schema:i,setError:a}=r;ds.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const s=Sf.create(r.id+".json","json",0,t),p=ds.parseJSONDocument(s),y=yield ds.doValidation(s,p);return y.length?a&&a(y[0].message):a&&a(void 0),y.map(E=>({from:as.Pos(E.range.start.line,E.range.start.character),to:as.Pos(E.range.end.line,E.range.end.character),message:E.message}))})}),as.registerHelper("hint","json",(t,r)=>oh(void 0,null,function*(){const i=r.schema;if(!i)return;ds.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const a=t.getDoc().getCursor(),s=t.getTokenAt(a),p=Sf.create(r.id+".json","json",0,t.getValue()),y=ds.parseJSONDocument(p),E=yield ds.doComplete(p,{line:a.line,character:a.ch},y),w=k=>{let G="";for(;k--;)G+=" ";return G};let A=E?E.items.map(k=>({text:k.insertText,displayText:k.label,filter:k.filterText||k.label,from:{line:k.textEdit.range.start.line,ch:k.textEdit.range.start.character},to:{line:k.textEdit.range.end.line,ch:k.textEdit.range.end.character},hint:(G,ne,re)=>{const se="_$__REDOC_CURSOR_HERE";let ye=re.text.replace(/(\$1|\${1:[^}]+})/,se)||"";if(ye=ye.replace(/(\$\d+|\${[^}]+})/g,"")||"",G.setSelection(re.from,re.to),ye.indexOf(`
|
|
393
393
|
`)>-1){const Ee=G.getLine(G.getCursor().line).search(/(\S|$)/);ye=ye.replace(/\n/g,`
|
|
394
394
|
`+w(Ee))}G.replaceSelection(ye);const ge=G.getSearchCursor(se,re.from);ge.findNext()&&(G.setCursor(ge.from()),ge.replace(""))}})):[];return/(property|string)/.test(s.type||"")&&(A=A.filter(k=>k.filter.replace(/(^"|"$)/g,"").startsWith(s.string.replace(/(^"|"$)/g,"")))),{from:as.Pos(a.line,s.start),to:as.Pos(a.line,a.ch),list:A}}));var uy=Object.defineProperty,fy=(t,r,i)=>r in t?uy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Of=(t,r,i)=>(fy(t,typeof r!="symbol"?r+"":r,i),i);const cy=wt.createGlobalStyle`
|
|
395
395
|
.cm-s-material.CodeMirror {
|
|
@@ -439,15 +439,15 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function Ng(t){return t.i
|
|
|
439
439
|
flex: 1;
|
|
440
440
|
border-radius: ${({theme:t})=>t.components.panels.borderRadius};
|
|
441
441
|
}
|
|
442
|
-
`;class dy extends d.Component{constructor(){super(...arguments);Of(this,"editor"),Of(this,"_onKeyUp",(r,i)=>{/^[a-zA-Z0-9_":]$/.test(i.key)&&this.editor.execCommand("autocomplete")}),Of(this,"initEditor",r=>{this.editor=r,r.on("keyup",this._onKeyUp)}),Of(this,"refreshEditor",()=>{this.editor.refresh()})}componentDidMount(){setTimeout(()=>{this.editor.refresh()},0),document.addEventListener("click",this.refreshEditor)}componentWillUnmount(){document.removeEventListener("click",this.refreshEditor)}render(){const{value:r}=this.props.fieldState,{setValue:i,setTouched:a,setError:s}=this.props.fieldApi,{onChange:p,onBlur:y,forwardedRef:E}=this.props;return d.createElement(d.Fragment,null,d.createElement(cy,null),d.createElement(rg.fk,{editorDidMount:this.initEditor,value:r||"",ref:E||void 0,onBeforeChange:(w,A,k)=>{i(k),p&&p(k)},onBlur:w=>{a(),y&&y(w)},options:{mode:this.props.mode||
|
|
442
|
+
`;class dy extends d.Component{constructor(){super(...arguments);Of(this,"editor"),Of(this,"_onKeyUp",(r,i)=>{/^[a-zA-Z0-9_":]$/.test(i.key)&&this.editor.execCommand("autocomplete")}),Of(this,"initEditor",r=>{this.editor=r,r.on("keyup",this._onKeyUp)}),Of(this,"refreshEditor",()=>{this.editor.refresh()})}componentDidMount(){setTimeout(()=>{this.editor.refresh()},0),document.addEventListener("click",this.refreshEditor)}componentWillUnmount(){document.removeEventListener("click",this.refreshEditor)}render(){const{value:r}=this.props.fieldState,{setValue:i,setTouched:a,setError:s}=this.props.fieldApi,{onChange:p,onBlur:y,forwardedRef:E}=this.props;return d.createElement(d.Fragment,null,d.createElement(cy,null),d.createElement(rg.fk,{editorDidMount:this.initEditor,value:r||"",ref:E||void 0,onBeforeChange:(w,A,k)=>{i(k),p&&p(k)},onBlur:w=>{a(),y&&y(w)},options:{mode:this.props.mode||El.T.JSON,theme:"material",matchBrackets:!0,autoCloseBrackets:!0,tabSize:2,foldGutter:!0,extraKeys:{"Cmd-Space":()=>this.editor.showHint({completeSingle:!0}),"Ctrl-Space":()=>this.editor.showHint({completeSingle:!0})},hintOptions:{id:this.props.id,completeSingle:!1,schema:this.props.schema},lint:{id:this.props.id,schema:this.props.schema,setError:s}}}))}}const py=Gr(dy);var hy=Object.defineProperty,vy=Object.defineProperties,gy=Object.getOwnPropertyDescriptors,ah=Object.getOwnPropertySymbols,yy=Object.prototype.hasOwnProperty,my=Object.prototype.propertyIsEnumerable,sh=(t,r,i)=>r in t?hy(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,xy=(t,r)=>{for(var i in r||(r={}))yy.call(r,i)&&sh(t,i,r[i]);if(ah)for(var i of ah(r))my.call(r,i)&&sh(t,i,r[i]);return t},by=(t,r)=>vy(t,gy(r)),wy=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});const Sy=(0,Io.Pi)(t=>{var r;const i=t.body.content,a=t.console.formApi,s=ne=>{var re;if(!i||!i.hasSample)return"";const se=(re=i.active)==null?void 0:re.examples;if(!(se==null?void 0:se[ne]))return"";const ye=se==null?void 0:se[ne].value,ge=t.properties?Zd()(ye,t.properties,{arrayMerge:kn.lN}):ye;return JSON.stringify(ge,null,2)},p=(r=i==null?void 0:i.operation)==null?void 0:r.activeExampleName,y=ne=>{var re;(re=i==null?void 0:i.operation)==null||re.activateExampleName(ne),a.setValue("body",s(ne))},E=ne=>{if(!ne)return"";if(ne.mime===El.T.URL_ENCODED)return ne.value;const re=ne.value,se=t.properties?Zd()(re,t.properties,{arrayMerge:kn.lN}):re;return JSON.stringify(se,null,2)},w=(ne,re)=>wy(void 0,null,function*(){const{setValue:se}=a;se(`body.${ne}`,re)});(0,d.useEffect)(()=>{p!==!1?p&&a.setValue("body",s(p)):a.setValue("body",JSON.stringify(t.properties||{},null,2))},[p]);const{validate:A,body:k}=t,G=ne=>d.createElement(wt.DropdownOrLabel,by(xy({},ne),{variant:"dark",fullWidth:!0,Label:tg,Dropdown:hr.Dropdown}));return d.createElement(d.Fragment,null,d.createElement(wt.MediaTypesSwitch,{content:k.content,renderDropdown:G},ne=>{var re;const se=ne.examples||{},ye=Object.keys(se),ge=ne.schema,Ee=dt(ge||{},ne.name)||ne.name===El.T.MULTIPART||ne.name===El.T.URL_ENCODED,{exampleKey:me}=(0,Gc.C6)(ne.operation,se),Pe=se[me];return d.createElement(d.Fragment,null,ye.length&&ye.length!==1&&d.createElement(Gc.b_,{examples:se,onChange:y,exampleKey:me})||null,Ee?d.createElement(qv,{mediaType:ne,formApi:a,onChange:w.bind(void 0)}):d.createElement(py,{id:"body"+t.id,field:"body",initialValue:E(Pe),schema:(((re=t==null?void 0:t.resolvedBody)==null?void 0:re.content[ne.name])||{}).schema,mode:ne.name,validate:A}))}))}),Ay=d.memo(Sy);function Ey({response:t}){return d.createElement(d.Fragment,null,d.createElement(ch,null," Body: "),Cy(t))}function Cy(t){return t.body?d.createElement(wt.JsonViewer,{data:t.body}):t.fileInfo?d.createElement(wt.SourceCodeWithFile,{fileInfo:t.fileInfo}):t.data!==null?t.data?d.createElement(wt.SourceCodeWithText,{lang:(0,wt.langFromMime)(t.headers["Content-Type"]||"text/plain"),source:t.data}):d.createElement(dh,null,d.createElement("i",null,"(no content)")):null}function Oy({headers:t}){const r=d.useContext(wt.OptionsContext),[i,a]=d.useState(!0),{maxResponseHeadersToShowInTryIt:s}=r,p=Object.keys(t),y=!!s&&p.length>s,E=y&&i?[...p].splice(0,s):[...p],w=()=>{a(!i)};return d.createElement(d.Fragment,null,d.createElement(ch,null," Headers: "),d.createElement(dh,null,E.map(A=>d.createElement("div",{key:A},d.createElement(lh,null,A,":"),d.createElement("code",null,t[A]))),y&&d.createElement(uh,{onClick:w},i?"Show more...":"Hide headers")))}const lh=wt.styled.strong`
|
|
443
443
|
text-transform: capitalize;
|
|
444
444
|
display: inline-block;
|
|
445
445
|
padding-right: 5px;
|
|
446
|
-
`,
|
|
446
|
+
`,uh=wt.styled.div`
|
|
447
447
|
cursor: pointer;
|
|
448
448
|
margin-top: 5px;
|
|
449
449
|
font-size: 14px;
|
|
450
|
-
`;
|
|
450
|
+
`;lh.displayName="HeaderName",uh.displayName="StyledShowMoreLabel";const Ty=wt.styled.div`
|
|
451
451
|
margin-bottom: 10px;
|
|
452
452
|
`,sd=wt.styled.div`
|
|
453
453
|
display: inline-block;
|
|
@@ -457,22 +457,22 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function Ng(t){return t.i
|
|
|
457
457
|
color: ${({theme:t})=>t.colors.text.light};
|
|
458
458
|
`,Py=(0,wt.styled)(sd)`
|
|
459
459
|
color: ${({theme:t,code:r})=>r>=200&&r<300?t.colors.responses.success.tabTextColor:r>=300&&r<400?t.colors.responses.redirect.tabTextColor:r>400?t.colors.responses.error.tabTextColor:t.colors.responses.info.tabTextColor};
|
|
460
|
-
`,
|
|
460
|
+
`,fh=wt.styled.header`
|
|
461
461
|
font-weight: bold;
|
|
462
462
|
margin-bottom: 10px;
|
|
463
463
|
`,Iy=wt.styled.code`
|
|
464
464
|
border-left: 3px solid #ff4040;
|
|
465
465
|
padding-left: 5px;
|
|
466
|
-
`,
|
|
466
|
+
`,ch=wt.styled.div`
|
|
467
467
|
margin-bottom: 10px;
|
|
468
468
|
|
|
469
469
|
&:not(:first-child) {
|
|
470
470
|
margin-top: 10px;
|
|
471
471
|
}
|
|
472
|
-
`,
|
|
472
|
+
`,dh=(0,wt.styled)(xl.nr)`
|
|
473
473
|
border-top-left-radius: 0;
|
|
474
474
|
border-top-right-radius: 0;
|
|
475
|
-
`;class Fy extends d.PureComponent{render(){const{error:r,response:i,time:a}=this.props,s=i||r&&r.response,p=s&&s.data&&s.data.length||0;let y;return p>1e6?y=(p/1e6).toFixed(2)+" MB":p>1e3?y=(p/1e3).toFixed(2)+" KB":y=p+" B",r&&!r.response||!s?d.createElement(d.Fragment,null,d.createElement(
|
|
475
|
+
`;class Fy extends d.PureComponent{render(){const{error:r,response:i,time:a}=this.props,s=i||r&&r.response,p=s&&s.data&&s.data.length||0;let y;return p>1e6?y=(p/1e6).toFixed(2)+" MB":p>1e3?y=(p/1e3).toFixed(2)+" KB":y=p+" B",r&&!r.response||!s?d.createElement(d.Fragment,null,d.createElement(fh,null," Could not get any response "),d.createElement(Iy,null,r&&r.message||"Unknown error"),d.createElement("br",null),d.createElement(fh,null," Why this might have happened:"),d.createElement("div",null," - CORS is misconfigured on the server"),d.createElement("div",null," - ","The server couldn't sent a response"),d.createElement("div",null," - No internet access"),d.createElement("div",null," - Documentation issue - contact API owner"),d.createElement("div",null," - Misconfigured security definition")):s?d.createElement(d.Fragment,null,d.createElement(Ty,null,d.createElement(Py,{code:s.status},d.createElement("span",null," Status: "),s.status," ",s.statusText),d.createElement(sd,null,d.createElement("span",null," Time: "),a,"ms"),d.createElement(sd,null,d.createElement("span",null," Size: "),y)),d.createElement("div",null,d.createElement(Oy,{headers:s.headers}),d.createElement(Ey,{response:s}))):d.createElement(d.Fragment,null,"Something went wrong")}}var ph=o(46538);function ky(t,r,i){const a=r.path||{},s=r.query||{},p=Object.keys(s);let y=(0,kr.v5)(t,a);const E=w=>i.find(A=>A.name===w&&A.in==="query");return p.length&&(y+="?"+p.map(w=>{if(!s[w])return"";const A=E(w);return A?(0,wt.serializeParameterValue)(A,s[w]):`${w}=${encodeURIComponent(s[w])}`}).filter(Boolean).join("&")),y}const My=({loading:t,operation:r,hasResponse:i,execute:a,params:s={}})=>d.createElement(Ly,null,d.createElement(ph.__,null,d.createElement(fa.FH,{type:r.httpVerb},r.httpVerb),d.createElement(ph.y$,{wrap:"true"},ky(r.path,s,r.parameters))),d.createElement(Ry,{"data-cy":"send-button",color:"primary",blinking:t,onClick:()=>!t&&a()},t?"Sending...":i?"Resend":"Send")),Ry=(0,wt.styled)(fa.zx)`
|
|
476
476
|
width: ${({theme:t})=>t.components.tryItSendButton.fullWidth?"100%":"auto"};
|
|
477
477
|
`,Ly=(0,wt.styled)(On.k1)`
|
|
478
478
|
${({theme:t})=>t.components.tryItSendButton.fullWidth?`
|
|
@@ -482,12 +482,12 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function Ng(t){return t.i
|
|
|
482
482
|
display: inline-block;
|
|
483
483
|
margin-top: 5px;
|
|
484
484
|
color: #d0d0d0;
|
|
485
|
-
`;var
|
|
485
|
+
`;var hh=Object.defineProperty,Uy=Object.defineProperties,jy=Object.getOwnPropertyDescriptor,Vy=Object.getOwnPropertyDescriptors,vh=Object.getOwnPropertySymbols,Wy=Object.prototype.hasOwnProperty,Hy=Object.prototype.propertyIsEnumerable,ld=(t,r,i)=>r in t?hh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,gh=(t,r)=>{for(var i in r||(r={}))Wy.call(r,i)&&ld(t,i,r[i]);if(vh)for(var i of vh(r))Hy.call(r,i)&&ld(t,i,r[i]);return t},yh=(t,r)=>Uy(t,Vy(r)),zy=(t,r,i,a)=>{for(var s=a>1?void 0:a?jy(r,i):r,p=t.length-1,y;p>=0;p--)(y=t[p])&&(s=(a?y(r,i,s):y(s))||s);return a&&s&&hh(r,i,s),s},ud=(t,r,i)=>(ld(t,typeof r!="symbol"?r+"":r,i),i);let fd=class extends d.Component{constructor(){super(...arguments);ud(this,"state",{activeIdx:0,variables:{}}),ud(this,"handleServerChange",t=>{const r=this.props.operation.servers.find(a=>a.url===t.serverUrl),i=(0,kr.mj)(r);this.props.onChange({url:t.serverUrl||"",variables:i}),(0,zt.WW)("serverUrl",t.serverUrl||""),this.setState({variables:i})}),ud(this,"handleVariableChange",(t,r)=>{const i=this.props.operation.servers[this.state.activeIdx],a=r||r===""?r:(0,kr.mj)(i)[t],s=yh(gh({},this.state.variables),{[t]:a});this.setState({variables:s}),(0,kr.UY)(t,a),this.props.onChange(yh(gh({},i),{variables:s}))})}static getDerivedStateFromProps(t){const r=t.operation,i=(0,zt.YQ)("serverUrl"),a=r.servers.findIndex(s=>s.url===i);return{activeIdx:a<0?0:a}}componentDidMount(){const t=(0,kr.fz)(this.props.operation.servers,this.state.activeIdx);this.props.onChange(t),this.setState({variables:t.variables})}render(){const{activeIdx:t}=this.state,i=this.props.operation.servers.map((s,p)=>({idx:p,serverUrl:s.url,value:`
|
|
486
486
|
${(0,kr.nq)((0,kr.v5)(s.url,this.state.variables),s.variables)}
|
|
487
487
|
- ${s.description||"Default"}
|
|
488
488
|
`})),a=Object.keys(this.state.variables);return d.createElement(Gy,null,d.createElement(it.lX,{htmlFor:"server"},"Target server: "),d.createElement(it.NI,null,d.createElement(hr.Dropdown,{variant:"dark",value:i[t].value,options:i,fullWidth:!0,onChange:this.handleServerChange})),a.length?a.map(s=>{var p;const y=(p=this.props.operation.servers[this.state.activeIdx].variables)==null?void 0:p[s];if(y)return d.createElement(Ny,{key:s,name:s,value:this.state.variables[s],defaultValue:y.default,onChange:E=>this.handleVariableChange(s,E),variableEnum:y.enum,description:y.description})}):null)}};fd=zy([Io.Pi],fd);const Gy=wt.styled.div`
|
|
489
489
|
margin-top: 20px;
|
|
490
|
-
`;var $y=o(72940),Ky=Object.defineProperty,Yy=Object.defineProperties,Jy=Object.getOwnPropertyDescriptors,Tf=Object.getOwnPropertySymbols,
|
|
490
|
+
`;var $y=o(72940),Ky=Object.defineProperty,Yy=Object.defineProperties,Jy=Object.getOwnPropertyDescriptors,Tf=Object.getOwnPropertySymbols,mh=Object.prototype.hasOwnProperty,xh=Object.prototype.propertyIsEnumerable,bh=(t,r,i)=>r in t?Ky(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Xy=(t,r)=>{for(var i in r||(r={}))mh.call(r,i)&&bh(t,i,r[i]);if(Tf)for(var i of Tf(r))xh.call(r,i)&&bh(t,i,r[i]);return t},Qy=(t,r)=>Yy(t,Jy(r)),Zy=(t,r)=>{var i={};for(var a in t)mh.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&Tf)for(var a of Tf(t))r.indexOf(a)<0&&xh.call(t,a)&&(i[a]=t[a]);return i};function cd(t){var r=t,{header:i,error:a,success:s}=r,p=Zy(r,["header","error","success"]);const y=({toggle:E,expanded:w})=>d.createElement(On.h4,{onClick:E,isExpanded:w,"data-cy":p["data-cy"]},d.createElement(On.xz,null,d.createElement(On.Dx,null,i),d.createElement(wt.ShelfIcon,{direction:w?"down":"right"})),a&&d.createElement(wt.CrossIcon,{size:"14px",color:"#ff908b"})||null,s&&d.createElement(wt.LockIcon,{size:"14px",color:"#56ff26"})||null);return d.createElement(_y,Qy(Xy({},p),{header:y}))}const _y=(0,Gt.ZP)(On.s_)`
|
|
491
491
|
${On.h4} {
|
|
492
492
|
color: white;
|
|
493
493
|
border: 1px solid ${({error:t})=>t?"#ff908b":"#89949f"};
|
|
@@ -504,7 +504,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function Ng(t){return t.i
|
|
|
504
504
|
border: 1px solid ${({error:t})=>t?"#ff908b":"#89949f"};
|
|
505
505
|
border-top: 0;
|
|
506
506
|
}
|
|
507
|
-
`;var Pf=o(25973),bh=Object.defineProperty,qy=Object.defineProperties,em=Object.getOwnPropertyDescriptor,tm=Object.getOwnPropertyDescriptors,If=Object.getOwnPropertySymbols,wh=Object.prototype.hasOwnProperty,Sh=Object.prototype.propertyIsEnumerable,dd=(t,r,i)=>r in t?bh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Yr=(t,r)=>{for(var i in r||(r={}))wh.call(r,i)&&dd(t,i,r[i]);if(If)for(var i of If(r))Sh.call(r,i)&&dd(t,i,r[i]);return t},Ln=(t,r)=>qy(t,tm(r)),Ah=(t,r)=>{var i={};for(var a in t)wh.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&If)for(var a of If(t))r.indexOf(a)<0&&Sh.call(t,a)&&(i[a]=t[a]);return i},rm=(t,r,i,a)=>{for(var s=a>1?void 0:a?em(r,i):r,p=t.length-1,y;p>=0;p--)(y=t[p])&&(s=(a?y(r,i,s):y(s))||s);return a&&s&&bh(r,i,s),s},ps=(t,r,i)=>(dd(t,typeof r!="symbol"?r+"":r,i),i),Eh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});function Ch(t){return t.startsWith("//")?"https:"+t:t}const nm={flex:1,display:"flex",flexDirection:"column"};let pd=class extends d.Component{constructor(t){super(t);ps(this,"formApi"),ps(this,"setFormApi",(r,i=r.getState())=>{var a=i,{values:s}=a,p=Ah(a,["values"]);this.formApi=r,setTimeout(()=>{const y=Ln(Yr({},p),{values:Ln(Yr({},s),{query:(0,kr.FU)(s.query||{})})});this.setState({form:y})},0)}),ps(this,"handleChange",r=>{var i=r,{values:a}=i,s=Ah(i,["values"]);const p=Ln(Yr({},s),{values:Ln(Yr({},a),{query:(0,kr.FU)(a.query||{})})});this.setState({form:p}),(0,kr.Hc)(p),this.props.operation.setRequestValues(a)}),ps(this,"handleTabChange",r=>{this.setState({activeTab:r})}),ps(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),ps(this,"handleExecute",()=>Eh(this,null,function*(){var r,i,a,s,p,y,E;const{store:w,operation:A,onResponse:k}=this.props,{values:G,invalid:ne}=this.state.form;if(this.formApi.submitForm(),ne){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(i=(r=w==null?void 0:w.options.events)==null?void 0:r.tryItSent)==null||i.call(r,{eventType:ml.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:A.operationId,operationPath:A.path,operationHttpVerb:A.httpVerb,operationSummary:A.description});return}const re=this.props.operation.requestBody,se=re&&re.content&&re.content.active&&re.content.active.name||"";let ye=G.body;if(/json/.test(se))try{ye=JSON.parse(ye)}catch(ze){console.error(ze)}this.setState({loading:!0});const ge=this.state.resolvedRawSpec,Ee=(A.httpVerb||"").toLowerCase(),me=(0,zt.U2)(ge,["paths",A.path,Ee,"servers"])||(0,zt.U2)(ge,["paths",A.path,"servers"])||(0,zt.U2)(ge,["servers"]);if(!me)throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");const Pe=me.find(ze=>this.state.server.url.endsWith(ze.url.endsWith("/")?ze.url.substring(0,ze.url.length-1):ze.url)),Ge=Date.now(),je=!!window.document.documentMode;let He,Ne=G.auth;if(G.auth){const ze=Object.keys(G.auth)[0],et=(0,zt.dw)(ze);He=Ln(Yr({},ge),{components:Ln(Yr({},ge.components),{securitySchemes:Ln(Yr({},ge.components.securitySchemes),{[et]:Ln(Yr({},ge.components.securitySchemes[et]),{type:ge.components.securitySchemes[et].type==="openIdConnect"?"oauth2":ge.components.securitySchemes[et].type})})})}),Ne=Ln(Yr({},Ne),{[et]:Ne[ze]})}else He=Yr({},ge);const Ve=w.options.corsProxyUrl;Ve&&me.length&&(He.servers=me.map(ze=>Ln(Yr({},ze),{url:Ve+Ch(ze.url)})),He.paths=Ln(Yr({},He.paths),{[A.path]:Ln(Yr({},He.paths[A.path]),{[Ee]:Ln(Yr({},He.paths[A.path][Ee]),{servers:void 0}),servers:void 0})}));const We=((s=(a=re==null?void 0:re.content)==null?void 0:a.active)==null?void 0:s.name)||null;if(We&&ye&&ct(We)){const ze=Object.values(ye);ye=ze.length>1?ze:ze[0]}const Je={userFetch:je&&o(54098).fetch,server:Ve?Ve+Ch(Pe.url):Pe.url,serverVariables:this.state.server.variables,spec:He,pathName:A.path,method:A.httpVerb,parameters:Yr(Yr(Yr(Yr({},G.path),G.query),G.header),G.cookie),securities:{authorized:Ne},requestBody:ye,requestContentType:We,responseContentType:((p=G.header)==null?void 0:p.Accept)||null,requestInterceptor:(0,kr.Tz)(w.options,A,Ne==null?void 0:Ne.Authorization)};try{const ze=yield Nc.execute(Je),et=ze==null?void 0:ze.data;et instanceof Blob&&(ct(et.type)&&(ze.fileInfo={rawData:et,fileName:(0,kr.AM)(ze.headers)}),ze.data=yield et.text()),k==null||k({request:Je,response:ze}),this.setState({response:ze,error:void 0})}catch(ze){ze&&ze.response&&ze.response.data instanceof Blob&&(ze.response.data=yield ze.response.data.text(),k==null||k({request:Je,response:ze.response})),this.setState({response:void 0,error:ze})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-Ge}),(E=(y=w==null?void 0:w.options.events)==null?void 0:y.tryItSent)==null||E.call(y,{eventType:ml.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:A.operationId,operationPath:A.path,operationHttpVerb:A.httpVerb,operationSummary:A.description})}})),this.state={form:{values:{path:(0,kr.ZS)(t.operation.parameters,"path"),cookie:(0,kr.ZS)(t.operation.parameters,"cookie"),header:(0,kr.ZS)(t.operation.parameters,"header"),query:(0,kr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return Eh(this,null,function*(){const{store:t,operation:r}=this.props,i=yield t.dereferenceSpecForTryIt(r);this.setState({resolvedRawSpec:i}),this.formApi.setValues({})})}componentDidUpdate(t){t.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}render(){const{operation:t,className:r,rootElement:i}=this.props,{shaking:a,activeTab:s,form:p,response:y,loading:E,error:w}=this.state,A=!!(y||w);return d.createElement(om,{shaking:a,className:r,rootElement:i},d.createElement(On.k1,null,d.createElement(Yv,{active:s,hasResponse:A,onChange:this.handleTabChange}),this.props.onClose&&d.createElement(Pf.PZ,{onClick:this.props.onClose}," \u2715 ")),d.createElement(Pf.RE,{hidden:s!==0},this.renderRequest()),d.createElement(Pf.RE,{hidden:s!==1},this.renderResponse()),d.createElement(Dy,{hasResponse:A,params:p.values,operation:t,loading:E,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:a,securityDefaults:s}=this.props,{form:p,resolvedRawSpec:y,server:E}=this.state,w=p.errors||{},A=w.path||w.cookie||w.header||w.query,k=y&&wt.JsonPointer.get(y,r.pointer);let G=p.values&&p.values.auth&&Object.keys(p.values.auth)[0];(!G||!p.values.auth[G])&&(G=void 0),G&&(p.values.auth[G].token!==void 0||p.values.auth[G].client_id!==void 0||p.values.auth[G].client_secret!==void 0)&&(!p.values.auth[G].token||!p.values.auth[G].token.access_token)&&(G=void 0),G&&p.values.auth[G].username!=null&&(!p.values.auth[G].username||!p.values.auth[G].password)&&(G=void 0);const ne=r.parameters||[],re=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!y&&d.createElement(d.Fragment,null,"Loading...")||d.createElement(d.Fragment,null,d.createElement(zl,{onChange:this.handleChange,getApi:this.setFormApi,style:Ln(Yr({},nm),{margin:0})},d.createElement(On.UQ,{initialActiveIdx:r.security.length&&G?1:0},r.security.length&&d.createElement(cd,{header:(0,la.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!G&&!!w.auth,success:!!G},re?d.createElement(am,{field:"auth",validate:Sl},se=>d.createElement(af.Q,{Hook:re,props:{server:E,operation:r,onChange:se,OAuth2:m}})):d.createElement($v,{formApi:this.formApi,form:p,operation:r,activeServer:E.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&d.createElement(cd,{header:(0,la.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!w.body},d.createElement(Ay,{validate:im,console:this,body:r.requestBody,id:r.id,resolvedBody:k.requestBody,properties:a}))||null,ne.length&&d.createElement(cd,{header:(0,la.l)("tryItParameters"),"data-cy":"parameters-trigger",error:A,renderChildrenHidden:!0},d.createElement(Yh,{operation:r,values:p.values,errors:p.errors||{}}))||null)),d.createElement(fd,{operation:r,onChange:this.handleServerChange}))}renderResponse(){const{response:t,error:r,time:i}=this.state;return d.createElement(Fy,{response:t,error:r,time:i})}};pd=rm([Io.Pi],pd);function im(){}function om(t){const{shaking:r,className:i,children:a,rootElement:s}=t,[p]=(0,zt.Bs)(s);return d.createElement(Pf.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:p==null?void 0:p.width},a)}function am(t){const{fieldApi:r,render:i,userProps:a}=Tn(Yr({},t)),{setValue:s}=r,{children:p}=a;return i(d.createElement(d.Fragment,null,p(s)))}},68929:()=>{},17648:h=>{"use strict";var I="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,c=Object.prototype.toString,v="[object Function]";h.exports=function(d){var b=this;if(typeof b!="function"||c.call(b)!==v)throw new TypeError(I+b);for(var S=o.call(arguments,1),g,L=function(){if(this instanceof g){var W=b.apply(this,S.concat(o.call(arguments)));return Object(W)===W?W:this}else return b.apply(d,S.concat(o.call(arguments)))},D=Math.max(0,b.length-S.length),B=[],j=0;j<D;j++)B.push("$"+j);if(g=Function("binder","return function ("+B.join(",")+"){ return binder.apply(this,arguments); }")(L),b.prototype){var q=function(){};q.prototype=b.prototype,g.prototype=new q,q.prototype=null}return g}},58612:(h,I,o)=>{"use strict";var c=o(17648);h.exports=Function.prototype.bind||c},40210:(h,I,o)=>{"use strict";var c,v=SyntaxError,x=Function,d=TypeError,b=function(xe){try{return x('"use strict"; return ('+xe+").constructor;")()}catch(we){}},S=Object.getOwnPropertyDescriptor;if(S)try{S({},"")}catch(xe){S=null}var g=function(){throw new d},L=S?function(){try{return arguments.callee,g}catch(xe){try{return S(arguments,"callee").get}catch(we){return g}}}():g,D=o(41405)(),B=Object.getPrototypeOf||function(xe){return xe.__proto__},j={},q=typeof Uint8Array=="undefined"?c:B(Uint8Array),W={"%AggregateError%":typeof AggregateError=="undefined"?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?c:ArrayBuffer,"%ArrayIteratorPrototype%":D?B([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":j,"%AsyncGenerator%":j,"%AsyncGeneratorFunction%":j,"%AsyncIteratorPrototype%":j,"%Atomics%":typeof Atomics=="undefined"?c:Atomics,"%BigInt%":typeof BigInt=="undefined"?c:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?c:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?c:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?c:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":j,"%Int8Array%":typeof Int8Array=="undefined"?c:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?c:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D?B(B([][Symbol.iterator]())):c,"%JSON%":typeof JSON=="object"?JSON:c,"%Map%":typeof Map=="undefined"?c:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!D?c:B(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?c:Promise,"%Proxy%":typeof Proxy=="undefined"?c:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?c:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?c:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!D?c:B(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D?B(""[Symbol.iterator]()):c,"%Symbol%":D?Symbol:c,"%SyntaxError%":v,"%ThrowTypeError%":L,"%TypedArray%":q,"%TypeError%":d,"%Uint8Array%":typeof Uint8Array=="undefined"?c:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?c:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?c:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?c:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?c:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?c:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?c:WeakSet},M=function xe(we){var he;if(we==="%AsyncFunction%")he=b("async function () {}");else if(we==="%GeneratorFunction%")he=b("function* () {}");else if(we==="%AsyncGeneratorFunction%")he=b("async function* () {}");else if(we==="%AsyncGenerator%"){var fe=xe("%AsyncGeneratorFunction%");fe&&(he=fe.prototype)}else if(we==="%AsyncIteratorPrototype%"){var ae=xe("%AsyncGenerator%");ae&&(he=B(ae.prototype))}return W[we]=he,he},X={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=o(58612),C=o(17642),V=R.call(Function.call,Array.prototype.concat),J=R.call(Function.apply,Array.prototype.splice),_=R.call(Function.call,String.prototype.replace),Q=R.call(Function.call,String.prototype.slice),Y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ce=/\\(\\)?/g,ee=function(we){var he=Q(we,0,1),fe=Q(we,-1);if(he==="%"&&fe!=="%")throw new v("invalid intrinsic syntax, expected closing `%`");if(fe==="%"&&he!=="%")throw new v("invalid intrinsic syntax, expected opening `%`");var ae=[];return _(we,Y,function(Fe,Le,Me,Te){ae[ae.length]=Me?_(Te,ce,"$1"):Le||Fe}),ae},ie=function(we,he){var fe=we,ae;if(C(X,fe)&&(ae=X[fe],fe="%"+ae[0]+"%"),C(W,fe)){var Fe=W[fe];if(Fe===j&&(Fe=M(fe)),typeof Fe=="undefined"&&!he)throw new d("intrinsic "+we+" exists, but is not available. Please file an issue!");return{alias:ae,name:fe,value:Fe}}throw new v("intrinsic "+we+" does not exist!")};h.exports=function(we,he){if(typeof we!="string"||we.length===0)throw new d("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof he!="boolean")throw new d('"allowMissing" argument must be a boolean');var fe=ee(we),ae=fe.length>0?fe[0]:"",Fe=ie("%"+ae+"%",he),Le=Fe.name,Me=Fe.value,Te=!1,rt=Fe.alias;rt&&(ae=rt[0],J(fe,V([0,1],rt)));for(var Ze=1,Xe=!0;Ze<fe.length;Ze+=1){var ft=fe[Ze],ht=Q(ft,0,1),bt=Q(ft,-1);if((ht==='"'||ht==="'"||ht==="`"||bt==='"'||bt==="'"||bt==="`")&&ht!==bt)throw new v("property names with quotes must have matching quotes");if((ft==="constructor"||!Xe)&&(Te=!0),ae+="."+ft,Le="%"+ae+"%",C(W,Le))Me=W[Le];else if(Me!=null){if(!(ft in Me)){if(!he)throw new d("base intrinsic for "+we+" exists, but the property is not available.");return}if(S&&Ze+1>=fe.length){var nt=S(Me,ft);Xe=!!nt,Xe&&"get"in nt&&!("originalValue"in nt.get)?Me=nt.get:Me=Me[ft]}else Xe=C(Me,ft),Me=Me[ft];Xe&&!Te&&(W[Le]=Me)}}return Me}},41405:(h,I,o)=>{"use strict";var c=typeof Symbol!="undefined"&&Symbol,v=o(55419);h.exports=function(){return typeof c!="function"||typeof Symbol!="function"||typeof c("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:v()}},55419:h=>{"use strict";h.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},c=Symbol("test"),v=Object(c);if(typeof c=="string"||Object.prototype.toString.call(c)!=="[object Symbol]"||Object.prototype.toString.call(v)!=="[object Symbol]")return!1;var x=42;o[c]=x;for(c in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var d=Object.getOwnPropertySymbols(o);if(d.length!==1||d[0]!==c||!Object.prototype.propertyIsEnumerable.call(o,c))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var b=Object.getOwnPropertyDescriptor(o,c);if(b.value!==x||b.enumerable!==!0)return!1}return!0}},17642:(h,I,o)=>{"use strict";var c=o(58612);h.exports=c.call(Function.call,Object.prototype.hasOwnProperty)},80645:(h,I)=>{/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */I.read=function(o,c,v,x,d){var b,S,g=d*8-x-1,L=(1<<g)-1,D=L>>1,B=-7,j=v?d-1:0,q=v?-1:1,W=o[c+j];for(j+=q,b=W&(1<<-B)-1,W>>=-B,B+=g;B>0;b=b*256+o[c+j],j+=q,B-=8);for(S=b&(1<<-B)-1,b>>=-B,B+=x;B>0;S=S*256+o[c+j],j+=q,B-=8);if(b===0)b=1-D;else{if(b===L)return S?NaN:(W?-1:1)*(1/0);S=S+Math.pow(2,x),b=b-D}return(W?-1:1)*S*Math.pow(2,b-x)},I.write=function(o,c,v,x,d,b){var S,g,L,D=b*8-d-1,B=(1<<D)-1,j=B>>1,q=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,W=x?0:b-1,M=x?1:-1,X=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(g=isNaN(c)?1:0,S=B):(S=Math.floor(Math.log(c)/Math.LN2),c*(L=Math.pow(2,-S))<1&&(S--,L*=2),S+j>=1?c+=q/L:c+=q*Math.pow(2,1-j),c*L>=2&&(S++,L/=2),S+j>=B?(g=0,S=B):S+j>=1?(g=(c*L-1)*Math.pow(2,d),S=S+j):(g=c*Math.pow(2,j-1)*Math.pow(2,d),S=0));d>=8;o[v+W]=g&255,W+=M,g/=256,d-=8);for(S=S<<d|g,D+=d;D>0;o[v+W]=S&255,W+=M,S/=256,D-=8);o[v+W-M]|=X*128}},5826:h=>{var I={}.toString;h.exports=Array.isArray||function(o){return I.call(o)=="[object Array]"}},57514:h=>{h.exports=window.FormData},93320:(h,I,o)=>{"use strict";var c=o(51294);h.exports=c},51294:(h,I,o)=>{"use strict";var c=o(40028),v=o(96157);function x(d){return function(){throw new Error("Function "+d+" is deprecated and cannot be used.")}}h.exports.Type=o(53899),h.exports.Schema=o(82409),h.exports.FAILSAFE_SCHEMA=o(75322),h.exports.JSON_SCHEMA=o(65796),h.exports.CORE_SCHEMA=o(17318),h.exports.DEFAULT_SAFE_SCHEMA=o(5972),h.exports.DEFAULT_FULL_SCHEMA=o(19321),h.exports.load=c.load,h.exports.loadAll=c.loadAll,h.exports.safeLoad=c.safeLoad,h.exports.safeLoadAll=c.safeLoadAll,h.exports.dump=v.dump,h.exports.safeDump=v.safeDump,h.exports.YAMLException=o(14884),h.exports.MINIMAL_SCHEMA=o(75322),h.exports.SAFE_SCHEMA=o(5972),h.exports.DEFAULT_SCHEMA=o(19321),h.exports.scan=x("scan"),h.exports.parse=x("parse"),h.exports.compose=x("compose"),h.exports.addConstructor=x("addConstructor")},25596:h=>{"use strict";function I(b){return typeof b=="undefined"||b===null}function o(b){return typeof b=="object"&&b!==null}function c(b){return Array.isArray(b)?b:I(b)?[]:[b]}function v(b,S){var g,L,D,B;if(S)for(B=Object.keys(S),g=0,L=B.length;g<L;g+=1)D=B[g],b[D]=S[D];return b}function x(b,S){var g="",L;for(L=0;L<S;L+=1)g+=b;return g}function d(b){return b===0&&Number.NEGATIVE_INFINITY===1/b}h.exports.isNothing=I,h.exports.isObject=o,h.exports.toArray=c,h.exports.repeat=x,h.exports.isNegativeZero=d,h.exports.extend=v},96157:(h,I,o)=>{"use strict";var c=o(25596),v=o(14884),x=o(19321),d=o(5972),b=Object.prototype.toString,S=Object.prototype.hasOwnProperty,g=9,L=10,D=13,B=32,j=33,q=34,W=35,M=37,X=38,R=39,C=42,V=44,J=45,_=58,Q=61,Y=62,ce=63,ee=64,ie=91,xe=93,we=96,he=123,fe=124,ae=125,Fe={};Fe[0]="\\0",Fe[7]="\\a",Fe[8]="\\b",Fe[9]="\\t",Fe[10]="\\n",Fe[11]="\\v",Fe[12]="\\f",Fe[13]="\\r",Fe[27]="\\e",Fe[34]='\\"',Fe[92]="\\\\",Fe[133]="\\N",Fe[160]="\\_",Fe[8232]="\\L",Fe[8233]="\\P";var Le=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Me(N,te){var de,oe,pe,Ae,Be,Ue,Qe;if(te===null)return{};for(de={},oe=Object.keys(te),pe=0,Ae=oe.length;pe<Ae;pe+=1)Be=oe[pe],Ue=String(te[Be]),Be.slice(0,2)==="!!"&&(Be="tag:yaml.org,2002:"+Be.slice(2)),Qe=N.compiledTypeMap.fallback[Be],Qe&&S.call(Qe.styleAliases,Ue)&&(Ue=Qe.styleAliases[Ue]),de[Be]=Ue;return de}function Te(N){var te,de,oe;if(te=N.toString(16).toUpperCase(),N<=255)de="x",oe=2;else if(N<=65535)de="u",oe=4;else if(N<=4294967295)de="U",oe=8;else throw new v("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+de+c.repeat("0",oe-te.length)+te}function rt(N){this.schema=N.schema||x,this.indent=Math.max(1,N.indent||2),this.noArrayIndent=N.noArrayIndent||!1,this.skipInvalid=N.skipInvalid||!1,this.flowLevel=c.isNothing(N.flowLevel)?-1:N.flowLevel,this.styleMap=Me(this.schema,N.styles||null),this.sortKeys=N.sortKeys||!1,this.lineWidth=N.lineWidth||80,this.noRefs=N.noRefs||!1,this.noCompatMode=N.noCompatMode||!1,this.condenseFlow=N.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ze(N,te){for(var de=c.repeat(" ",te),oe=0,pe=-1,Ae="",Be,Ue=N.length;oe<Ue;)pe=N.indexOf(`
|
|
507
|
+
`;var Pf=o(25973),wh=Object.defineProperty,qy=Object.defineProperties,em=Object.getOwnPropertyDescriptor,tm=Object.getOwnPropertyDescriptors,If=Object.getOwnPropertySymbols,Sh=Object.prototype.hasOwnProperty,Ah=Object.prototype.propertyIsEnumerable,dd=(t,r,i)=>r in t?wh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Yr=(t,r)=>{for(var i in r||(r={}))Sh.call(r,i)&&dd(t,i,r[i]);if(If)for(var i of If(r))Ah.call(r,i)&&dd(t,i,r[i]);return t},Ln=(t,r)=>qy(t,tm(r)),Eh=(t,r)=>{var i={};for(var a in t)Sh.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&If)for(var a of If(t))r.indexOf(a)<0&&Ah.call(t,a)&&(i[a]=t[a]);return i},rm=(t,r,i,a)=>{for(var s=a>1?void 0:a?em(r,i):r,p=t.length-1,y;p>=0;p--)(y=t[p])&&(s=(a?y(r,i,s):y(s))||s);return a&&s&&wh(r,i,s),s},ps=(t,r,i)=>(dd(t,typeof r!="symbol"?r+"":r,i),i),Ch=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{E(i.next(w))}catch(A){s(A)}},y=w=>{try{E(i.throw(w))}catch(A){s(A)}},E=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);E((i=i.apply(t,r)).next())});function Oh(t){return t.startsWith("//")?"https:"+t:t}const nm={flex:1,display:"flex",flexDirection:"column"};let pd=class extends d.Component{constructor(t){super(t);ps(this,"formApi"),ps(this,"setFormApi",(r,i=r.getState())=>{var a=i,{values:s}=a,p=Eh(a,["values"]);this.formApi=r,setTimeout(()=>{const y=Ln(Yr({},p),{values:Ln(Yr({},s),{query:(0,kr.FU)(s.query||{})})});this.setState({form:y})},0)}),ps(this,"handleChange",r=>{var i=r,{values:a}=i,s=Eh(i,["values"]);const p=Ln(Yr({},s),{values:Ln(Yr({},a),{query:(0,kr.FU)(a.query||{})})});this.setState({form:p}),(0,kr.Hc)(p),this.props.operation.setRequestValues(a)}),ps(this,"handleTabChange",r=>{this.setState({activeTab:r})}),ps(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),ps(this,"handleExecute",()=>Ch(this,null,function*(){var r,i,a,s,p,y,E;const{store:w,operation:A,onResponse:k}=this.props,{values:G,invalid:ne}=this.state.form;if(this.formApi.submitForm(),ne){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(i=(r=w==null?void 0:w.options.events)==null?void 0:r.tryItSent)==null||i.call(r,{eventType:ml.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:A.operationId,operationPath:A.path,operationHttpVerb:A.httpVerb,operationSummary:A.description});return}const re=this.props.operation.requestBody,se=re&&re.content&&re.content.active&&re.content.active.name||"";let ye=G.body;if(/json/.test(se))try{ye=JSON.parse(ye)}catch(ze){console.error(ze)}this.setState({loading:!0});const ge=this.state.resolvedRawSpec,Ee=(A.httpVerb||"").toLowerCase(),me=(0,zt.U2)(ge,["paths",A.path,Ee,"servers"])||(0,zt.U2)(ge,["paths",A.path,"servers"])||(0,zt.U2)(ge,["servers"]);if(!me)throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");const Pe=me.find(ze=>this.state.server.url.endsWith(ze.url.endsWith("/")?ze.url.substring(0,ze.url.length-1):ze.url)),Ge=Date.now(),je=!!window.document.documentMode;let He,Ne=G.auth;if(G.auth){const ze=Object.keys(G.auth)[0],et=(0,zt.dw)(ze);He=Ln(Yr({},ge),{components:Ln(Yr({},ge.components),{securitySchemes:Ln(Yr({},ge.components.securitySchemes),{[et]:Ln(Yr({},ge.components.securitySchemes[et]),{type:ge.components.securitySchemes[et].type==="openIdConnect"?"oauth2":ge.components.securitySchemes[et].type})})})}),Ne=Ln(Yr({},Ne),{[et]:Ne[ze]})}else He=Yr({},ge);const Ve=w.options.corsProxyUrl;Ve&&me.length&&(He.servers=me.map(ze=>Ln(Yr({},ze),{url:Ve+Oh(ze.url)})),He.paths=Ln(Yr({},He.paths),{[A.path]:Ln(Yr({},He.paths[A.path]),{[Ee]:Ln(Yr({},He.paths[A.path][Ee]),{servers:void 0}),servers:void 0})}));const We=((s=(a=re==null?void 0:re.content)==null?void 0:a.active)==null?void 0:s.name)||null;if(We&&ye&&ct(We)){const ze=Object.values(ye);ye=ze.length>1?ze:ze[0]}const Je={userFetch:je&&o(54098).fetch,server:Ve?Ve+Oh(Pe.url):Pe.url,serverVariables:this.state.server.variables,spec:He,pathName:A.path,method:A.httpVerb,parameters:Yr(Yr(Yr(Yr({},G.path),G.query),G.header),G.cookie),securities:{authorized:Ne},requestBody:ye,requestContentType:We,responseContentType:((p=G.header)==null?void 0:p.Accept)||null,requestInterceptor:(0,kr.Tz)(w.options,A,Ne==null?void 0:Ne.Authorization)};try{const ze=yield Nc.execute(Je),et=ze==null?void 0:ze.data;et instanceof Blob&&(ct(et.type)&&(ze.fileInfo={rawData:et,fileName:(0,kr.AM)(ze.headers)}),ze.data=yield et.text()),k==null||k({request:Je,response:ze}),this.setState({response:ze,error:void 0})}catch(ze){ze&&ze.response&&ze.response.data instanceof Blob&&(ze.response.data=yield ze.response.data.text(),k==null||k({request:Je,response:ze.response})),this.setState({response:void 0,error:ze})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-Ge}),(E=(y=w==null?void 0:w.options.events)==null?void 0:y.tryItSent)==null||E.call(y,{eventType:ml.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:A.operationId,operationPath:A.path,operationHttpVerb:A.httpVerb,operationSummary:A.description})}})),this.state={form:{values:{path:(0,kr.ZS)(t.operation.parameters,"path"),cookie:(0,kr.ZS)(t.operation.parameters,"cookie"),header:(0,kr.ZS)(t.operation.parameters,"header"),query:(0,kr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return Ch(this,null,function*(){const{store:t,operation:r}=this.props,i=yield t.dereferenceSpecForTryIt(r);this.setState({resolvedRawSpec:i}),this.formApi.setValues({})})}componentDidUpdate(t){t.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}render(){const{operation:t,className:r,rootElement:i}=this.props,{shaking:a,activeTab:s,form:p,response:y,loading:E,error:w}=this.state,A=!!(y||w);return d.createElement(om,{shaking:a,className:r,rootElement:i},d.createElement(On.k1,null,d.createElement(Yv,{active:s,hasResponse:A,onChange:this.handleTabChange}),this.props.onClose&&d.createElement(Pf.PZ,{onClick:this.props.onClose}," \u2715 ")),d.createElement(Pf.RE,{hidden:s!==0},this.renderRequest()),d.createElement(Pf.RE,{hidden:s!==1},this.renderResponse()),d.createElement(Dy,{hasResponse:A,params:p.values,operation:t,loading:E,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:a,securityDefaults:s}=this.props,{form:p,resolvedRawSpec:y,server:E}=this.state,w=p.errors||{},A=w.path||w.cookie||w.header||w.query,k=y&&wt.JsonPointer.get(y,r.pointer);let G=p.values&&p.values.auth&&Object.keys(p.values.auth)[0];(!G||!p.values.auth[G])&&(G=void 0),G&&(p.values.auth[G].token!==void 0||p.values.auth[G].client_id!==void 0||p.values.auth[G].client_secret!==void 0)&&(!p.values.auth[G].token||!p.values.auth[G].token.access_token)&&(G=void 0),G&&p.values.auth[G].username!=null&&(!p.values.auth[G].username||!p.values.auth[G].password)&&(G=void 0);const ne=r.parameters||[],re=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!y&&d.createElement(d.Fragment,null,"Loading...")||d.createElement(d.Fragment,null,d.createElement(Gl,{onChange:this.handleChange,getApi:this.setFormApi,style:Ln(Yr({},nm),{margin:0})},d.createElement(On.UQ,{initialActiveIdx:r.security.length&&G?1:0},r.security.length&&d.createElement(cd,{header:(0,la.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!G&&!!w.auth,success:!!G},re?d.createElement(am,{field:"auth",validate:Al},se=>d.createElement(sf.Q,{Hook:re,props:{server:E,operation:r,onChange:se,OAuth2:m}})):d.createElement($v,{formApi:this.formApi,form:p,operation:r,activeServer:E.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&d.createElement(cd,{header:(0,la.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!w.body},d.createElement(Ay,{validate:im,console:this,body:r.requestBody,id:r.id,resolvedBody:k.requestBody,properties:a}))||null,ne.length&&d.createElement(cd,{header:(0,la.l)("tryItParameters"),"data-cy":"parameters-trigger",error:A,renderChildrenHidden:!0},d.createElement(Jh,{operation:r,values:p.values,errors:p.errors||{}}))||null)),d.createElement(fd,{operation:r,onChange:this.handleServerChange}))}renderResponse(){const{response:t,error:r,time:i}=this.state;return d.createElement(Fy,{response:t,error:r,time:i})}};pd=rm([Io.Pi],pd);function im(){}function om(t){const{shaking:r,className:i,children:a,rootElement:s}=t,[p]=(0,zt.Bs)(s);return d.createElement(Pf.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:p==null?void 0:p.width},a)}function am(t){const{fieldApi:r,render:i,userProps:a}=Tn(Yr({},t)),{setValue:s}=r,{children:p}=a;return i(d.createElement(d.Fragment,null,p(s)))}},68929:()=>{},17648:h=>{"use strict";var I="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,c=Object.prototype.toString,v="[object Function]";h.exports=function(d){var b=this;if(typeof b!="function"||c.call(b)!==v)throw new TypeError(I+b);for(var S=o.call(arguments,1),g,L=function(){if(this instanceof g){var W=b.apply(this,S.concat(o.call(arguments)));return Object(W)===W?W:this}else return b.apply(d,S.concat(o.call(arguments)))},D=Math.max(0,b.length-S.length),B=[],j=0;j<D;j++)B.push("$"+j);if(g=Function("binder","return function ("+B.join(",")+"){ return binder.apply(this,arguments); }")(L),b.prototype){var q=function(){};q.prototype=b.prototype,g.prototype=new q,q.prototype=null}return g}},58612:(h,I,o)=>{"use strict";var c=o(17648);h.exports=Function.prototype.bind||c},40210:(h,I,o)=>{"use strict";var c,v=SyntaxError,x=Function,d=TypeError,b=function(xe){try{return x('"use strict"; return ('+xe+").constructor;")()}catch(we){}},S=Object.getOwnPropertyDescriptor;if(S)try{S({},"")}catch(xe){S=null}var g=function(){throw new d},L=S?function(){try{return arguments.callee,g}catch(xe){try{return S(arguments,"callee").get}catch(we){return g}}}():g,D=o(41405)(),B=Object.getPrototypeOf||function(xe){return xe.__proto__},j={},q=typeof Uint8Array=="undefined"?c:B(Uint8Array),W={"%AggregateError%":typeof AggregateError=="undefined"?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?c:ArrayBuffer,"%ArrayIteratorPrototype%":D?B([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":j,"%AsyncGenerator%":j,"%AsyncGeneratorFunction%":j,"%AsyncIteratorPrototype%":j,"%Atomics%":typeof Atomics=="undefined"?c:Atomics,"%BigInt%":typeof BigInt=="undefined"?c:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?c:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?c:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?c:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":j,"%Int8Array%":typeof Int8Array=="undefined"?c:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?c:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D?B(B([][Symbol.iterator]())):c,"%JSON%":typeof JSON=="object"?JSON:c,"%Map%":typeof Map=="undefined"?c:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!D?c:B(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?c:Promise,"%Proxy%":typeof Proxy=="undefined"?c:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?c:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?c:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!D?c:B(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D?B(""[Symbol.iterator]()):c,"%Symbol%":D?Symbol:c,"%SyntaxError%":v,"%ThrowTypeError%":L,"%TypedArray%":q,"%TypeError%":d,"%Uint8Array%":typeof Uint8Array=="undefined"?c:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?c:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?c:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?c:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?c:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?c:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?c:WeakSet},M=function xe(we){var he;if(we==="%AsyncFunction%")he=b("async function () {}");else if(we==="%GeneratorFunction%")he=b("function* () {}");else if(we==="%AsyncGeneratorFunction%")he=b("async function* () {}");else if(we==="%AsyncGenerator%"){var fe=xe("%AsyncGeneratorFunction%");fe&&(he=fe.prototype)}else if(we==="%AsyncIteratorPrototype%"){var ae=xe("%AsyncGenerator%");ae&&(he=B(ae.prototype))}return W[we]=he,he},X={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=o(58612),C=o(17642),V=R.call(Function.call,Array.prototype.concat),J=R.call(Function.apply,Array.prototype.splice),_=R.call(Function.call,String.prototype.replace),Q=R.call(Function.call,String.prototype.slice),Y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ce=/\\(\\)?/g,ee=function(we){var he=Q(we,0,1),fe=Q(we,-1);if(he==="%"&&fe!=="%")throw new v("invalid intrinsic syntax, expected closing `%`");if(fe==="%"&&he!=="%")throw new v("invalid intrinsic syntax, expected opening `%`");var ae=[];return _(we,Y,function(Fe,Le,Me,Te){ae[ae.length]=Me?_(Te,ce,"$1"):Le||Fe}),ae},ie=function(we,he){var fe=we,ae;if(C(X,fe)&&(ae=X[fe],fe="%"+ae[0]+"%"),C(W,fe)){var Fe=W[fe];if(Fe===j&&(Fe=M(fe)),typeof Fe=="undefined"&&!he)throw new d("intrinsic "+we+" exists, but is not available. Please file an issue!");return{alias:ae,name:fe,value:Fe}}throw new v("intrinsic "+we+" does not exist!")};h.exports=function(we,he){if(typeof we!="string"||we.length===0)throw new d("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof he!="boolean")throw new d('"allowMissing" argument must be a boolean');var fe=ee(we),ae=fe.length>0?fe[0]:"",Fe=ie("%"+ae+"%",he),Le=Fe.name,Me=Fe.value,Te=!1,rt=Fe.alias;rt&&(ae=rt[0],J(fe,V([0,1],rt)));for(var Ze=1,Xe=!0;Ze<fe.length;Ze+=1){var ft=fe[Ze],ht=Q(ft,0,1),bt=Q(ft,-1);if((ht==='"'||ht==="'"||ht==="`"||bt==='"'||bt==="'"||bt==="`")&&ht!==bt)throw new v("property names with quotes must have matching quotes");if((ft==="constructor"||!Xe)&&(Te=!0),ae+="."+ft,Le="%"+ae+"%",C(W,Le))Me=W[Le];else if(Me!=null){if(!(ft in Me)){if(!he)throw new d("base intrinsic for "+we+" exists, but the property is not available.");return}if(S&&Ze+1>=fe.length){var nt=S(Me,ft);Xe=!!nt,Xe&&"get"in nt&&!("originalValue"in nt.get)?Me=nt.get:Me=Me[ft]}else Xe=C(Me,ft),Me=Me[ft];Xe&&!Te&&(W[Le]=Me)}}return Me}},41405:(h,I,o)=>{"use strict";var c=typeof Symbol!="undefined"&&Symbol,v=o(55419);h.exports=function(){return typeof c!="function"||typeof Symbol!="function"||typeof c("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:v()}},55419:h=>{"use strict";h.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},c=Symbol("test"),v=Object(c);if(typeof c=="string"||Object.prototype.toString.call(c)!=="[object Symbol]"||Object.prototype.toString.call(v)!=="[object Symbol]")return!1;var x=42;o[c]=x;for(c in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var d=Object.getOwnPropertySymbols(o);if(d.length!==1||d[0]!==c||!Object.prototype.propertyIsEnumerable.call(o,c))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var b=Object.getOwnPropertyDescriptor(o,c);if(b.value!==x||b.enumerable!==!0)return!1}return!0}},17642:(h,I,o)=>{"use strict";var c=o(58612);h.exports=c.call(Function.call,Object.prototype.hasOwnProperty)},80645:(h,I)=>{/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */I.read=function(o,c,v,x,d){var b,S,g=d*8-x-1,L=(1<<g)-1,D=L>>1,B=-7,j=v?d-1:0,q=v?-1:1,W=o[c+j];for(j+=q,b=W&(1<<-B)-1,W>>=-B,B+=g;B>0;b=b*256+o[c+j],j+=q,B-=8);for(S=b&(1<<-B)-1,b>>=-B,B+=x;B>0;S=S*256+o[c+j],j+=q,B-=8);if(b===0)b=1-D;else{if(b===L)return S?NaN:(W?-1:1)*(1/0);S=S+Math.pow(2,x),b=b-D}return(W?-1:1)*S*Math.pow(2,b-x)},I.write=function(o,c,v,x,d,b){var S,g,L,D=b*8-d-1,B=(1<<D)-1,j=B>>1,q=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,W=x?0:b-1,M=x?1:-1,X=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(g=isNaN(c)?1:0,S=B):(S=Math.floor(Math.log(c)/Math.LN2),c*(L=Math.pow(2,-S))<1&&(S--,L*=2),S+j>=1?c+=q/L:c+=q*Math.pow(2,1-j),c*L>=2&&(S++,L/=2),S+j>=B?(g=0,S=B):S+j>=1?(g=(c*L-1)*Math.pow(2,d),S=S+j):(g=c*Math.pow(2,j-1)*Math.pow(2,d),S=0));d>=8;o[v+W]=g&255,W+=M,g/=256,d-=8);for(S=S<<d|g,D+=d;D>0;o[v+W]=S&255,W+=M,S/=256,D-=8);o[v+W-M]|=X*128}},5826:h=>{var I={}.toString;h.exports=Array.isArray||function(o){return I.call(o)=="[object Array]"}},57514:h=>{h.exports=window.FormData},93320:(h,I,o)=>{"use strict";var c=o(51294);h.exports=c},51294:(h,I,o)=>{"use strict";var c=o(40028),v=o(96157);function x(d){return function(){throw new Error("Function "+d+" is deprecated and cannot be used.")}}h.exports.Type=o(53899),h.exports.Schema=o(82409),h.exports.FAILSAFE_SCHEMA=o(75322),h.exports.JSON_SCHEMA=o(65796),h.exports.CORE_SCHEMA=o(17318),h.exports.DEFAULT_SAFE_SCHEMA=o(5972),h.exports.DEFAULT_FULL_SCHEMA=o(19321),h.exports.load=c.load,h.exports.loadAll=c.loadAll,h.exports.safeLoad=c.safeLoad,h.exports.safeLoadAll=c.safeLoadAll,h.exports.dump=v.dump,h.exports.safeDump=v.safeDump,h.exports.YAMLException=o(14884),h.exports.MINIMAL_SCHEMA=o(75322),h.exports.SAFE_SCHEMA=o(5972),h.exports.DEFAULT_SCHEMA=o(19321),h.exports.scan=x("scan"),h.exports.parse=x("parse"),h.exports.compose=x("compose"),h.exports.addConstructor=x("addConstructor")},25596:h=>{"use strict";function I(b){return typeof b=="undefined"||b===null}function o(b){return typeof b=="object"&&b!==null}function c(b){return Array.isArray(b)?b:I(b)?[]:[b]}function v(b,S){var g,L,D,B;if(S)for(B=Object.keys(S),g=0,L=B.length;g<L;g+=1)D=B[g],b[D]=S[D];return b}function x(b,S){var g="",L;for(L=0;L<S;L+=1)g+=b;return g}function d(b){return b===0&&Number.NEGATIVE_INFINITY===1/b}h.exports.isNothing=I,h.exports.isObject=o,h.exports.toArray=c,h.exports.repeat=x,h.exports.isNegativeZero=d,h.exports.extend=v},96157:(h,I,o)=>{"use strict";var c=o(25596),v=o(14884),x=o(19321),d=o(5972),b=Object.prototype.toString,S=Object.prototype.hasOwnProperty,g=9,L=10,D=13,B=32,j=33,q=34,W=35,M=37,X=38,R=39,C=42,V=44,J=45,_=58,Q=61,Y=62,ce=63,ee=64,ie=91,xe=93,we=96,he=123,fe=124,ae=125,Fe={};Fe[0]="\\0",Fe[7]="\\a",Fe[8]="\\b",Fe[9]="\\t",Fe[10]="\\n",Fe[11]="\\v",Fe[12]="\\f",Fe[13]="\\r",Fe[27]="\\e",Fe[34]='\\"',Fe[92]="\\\\",Fe[133]="\\N",Fe[160]="\\_",Fe[8232]="\\L",Fe[8233]="\\P";var Le=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Me(N,te){var de,oe,pe,Ae,Be,Ue,Qe;if(te===null)return{};for(de={},oe=Object.keys(te),pe=0,Ae=oe.length;pe<Ae;pe+=1)Be=oe[pe],Ue=String(te[Be]),Be.slice(0,2)==="!!"&&(Be="tag:yaml.org,2002:"+Be.slice(2)),Qe=N.compiledTypeMap.fallback[Be],Qe&&S.call(Qe.styleAliases,Ue)&&(Ue=Qe.styleAliases[Ue]),de[Be]=Ue;return de}function Te(N){var te,de,oe;if(te=N.toString(16).toUpperCase(),N<=255)de="x",oe=2;else if(N<=65535)de="u",oe=4;else if(N<=4294967295)de="U",oe=8;else throw new v("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+de+c.repeat("0",oe-te.length)+te}function rt(N){this.schema=N.schema||x,this.indent=Math.max(1,N.indent||2),this.noArrayIndent=N.noArrayIndent||!1,this.skipInvalid=N.skipInvalid||!1,this.flowLevel=c.isNothing(N.flowLevel)?-1:N.flowLevel,this.styleMap=Me(this.schema,N.styles||null),this.sortKeys=N.sortKeys||!1,this.lineWidth=N.lineWidth||80,this.noRefs=N.noRefs||!1,this.noCompatMode=N.noCompatMode||!1,this.condenseFlow=N.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ze(N,te){for(var de=c.repeat(" ",te),oe=0,pe=-1,Ae="",Be,Ue=N.length;oe<Ue;)pe=N.indexOf(`
|
|
508
508
|
`,oe),pe===-1?(Be=N.slice(oe),oe=Ue):(Be=N.slice(oe,pe+1),oe=pe+1),Be.length&&Be!==`
|
|
509
509
|
`&&(Ae+=de),Ae+=Be;return Ae}function Xe(N,te){return`
|
|
510
510
|
`+c.repeat(" ",N.indent*te)}function ft(N,te){var de,oe,pe;for(de=0,oe=N.implicitTypes.length;de<oe;de+=1)if(pe=N.implicitTypes[de],pe.resolve(te))return!0;return!1}function ht(N){return N===B||N===g}function bt(N){return 32<=N&&N<=126||161<=N&&N<=55295&&N!==8232&&N!==8233||57344<=N&&N<=65533&&N!==65279||65536<=N&&N<=1114111}function nt(N){return bt(N)&&!ht(N)&&N!==65279&&N!==D&&N!==L}function ut(N,te){return bt(N)&&N!==65279&&N!==V&&N!==ie&&N!==xe&&N!==he&&N!==ae&&N!==_&&(N!==W||te&&nt(te))}function yt(N){return bt(N)&&N!==65279&&!ht(N)&&N!==J&&N!==ce&&N!==_&&N!==V&&N!==ie&&N!==xe&&N!==he&&N!==ae&&N!==W&&N!==X&&N!==C&&N!==j&&N!==fe&&N!==Q&&N!==Y&&N!==R&&N!==q&&N!==M&&N!==ee&&N!==we}function mt(N){var te=/^\n* /;return te.test(N)}var pt=1,Mt=2,kt=3,Ct=4,Wt=5;function jt(N,te,de,oe,pe){var Ae,Be,Ue,Qe=!1,vt=!1,Et=oe!==-1,Bt=-1,Pt=yt(N.charCodeAt(0))&&!ht(N.charCodeAt(N.length-1));if(te)for(Ae=0;Ae<N.length;Ae++){if(Be=N.charCodeAt(Ae),!bt(Be))return Wt;Ue=Ae>0?N.charCodeAt(Ae-1):null,Pt=Pt&&ut(Be,Ue)}else{for(Ae=0;Ae<N.length;Ae++){if(Be=N.charCodeAt(Ae),Be===L)Qe=!0,Et&&(vt=vt||Ae-Bt-1>oe&&N[Bt+1]!==" ",Bt=Ae);else if(!bt(Be))return Wt;Ue=Ae>0?N.charCodeAt(Ae-1):null,Pt=Pt&&ut(Be,Ue)}vt=vt||Et&&Ae-Bt-1>oe&&N[Bt+1]!==" "}return!Qe&&!vt?Pt&&!pe(N)?pt:Mt:de>9&&mt(N)?Wt:vt?Ct:kt}function Vt(N,te,de,oe){N.dump=function(){if(te.length===0)return"''";if(!N.noCompatMode&&Le.indexOf(te)!==-1)return"'"+te+"'";var pe=N.indent*Math.max(1,de),Ae=N.lineWidth===-1?-1:Math.max(Math.min(N.lineWidth,40),N.lineWidth-pe),Be=oe||N.flowLevel>-1&&de>=N.flowLevel;function Ue(Qe){return ft(N,Qe)}switch(jt(te,Be,N.indent,Ae,Ue)){case pt:return te;case Mt:return"'"+te.replace(/'/g,"''")+"'";case kt:return"|"+St(te,N.indent)+Dt(Ze(te,pe));case Ct:return">"+St(te,N.indent)+Dt(Ze(ve(te,Ae),pe));case Wt:return'"'+$(te,Ae)+'"';default:throw new v("impossible error: invalid scalar style")}}()}function St(N,te){var de=mt(N)?String(te):"",oe=N[N.length-1]===`
|