@kong-ui-public/entities-config-editor 0.1.0 → 0.1.1-pr.2078.e2c06ca6d.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/assets/editor.worker-BKD3YLiN.js +12 -0
  2. package/dist/assets/json.worker-BXX47FAd.js +49 -0
  3. package/dist/editor.worker-BYRgh9Cz.js +11 -0
  4. package/dist/entities-config-editor.es.js +6257 -18
  5. package/dist/entities-config-editor.umd.js +35 -1
  6. package/dist/json.worker-BA4mAGd_.js +11 -0
  7. package/dist/style.css +1 -0
  8. package/dist/types/components/EntitiesConfigEditor.vue.d.ts +13 -1
  9. package/dist/types/components/EntitiesConfigEditor.vue.d.ts.map +1 -1
  10. package/dist/types/composables/index.d.ts +6 -0
  11. package/dist/types/composables/index.d.ts.map +1 -0
  12. package/dist/types/composables/useMonacoEditor.d.ts +18 -0
  13. package/dist/types/composables/useMonacoEditor.d.ts.map +1 -0
  14. package/dist/types/types/editor.d.ts +9 -0
  15. package/dist/types/types/editor.d.ts.map +1 -0
  16. package/dist/types/types/fields.d.ts +102 -0
  17. package/dist/types/types/fields.d.ts.map +1 -0
  18. package/dist/types/types/foreign.d.ts +7 -0
  19. package/dist/types/types/foreign.d.ts.map +1 -0
  20. package/dist/types/types/index.d.ts +3 -1
  21. package/dist/types/types/index.d.ts.map +1 -1
  22. package/dist/types/types/jsonschema.d.ts +10 -0
  23. package/dist/types/types/jsonschema.d.ts.map +1 -0
  24. package/dist/types/utils/builders.d.ts +10 -0
  25. package/dist/types/utils/builders.d.ts.map +1 -0
  26. package/dist/types/utils/index.d.ts +5 -0
  27. package/dist/types/utils/index.d.ts.map +1 -0
  28. package/dist/types/utils/monaco.d.ts +3 -0
  29. package/dist/types/utils/monaco.d.ts.map +1 -0
  30. package/dist/types/utils/strings.d.ts +9 -0
  31. package/dist/types/utils/strings.d.ts.map +1 -0
  32. package/dist/types/utils/uuid.d.ts +2 -0
  33. package/dist/types/utils/uuid.d.ts.map +1 -0
  34. package/package.json +5 -2
@@ -1 +1,35 @@
1
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["kong-ui-public-entities-config-editor"]={},t.Vue))})(this,function(t,e){"use strict";const c=(i,n)=>{const o=i.__vccOpts||i;for(const[u,l]of n)o[u]=l;return o},s={},r={class:"kong-ui-public-entities-config-editor"};function d(i,n){return e.openBlock(),e.createElementBlock("div",r,n[0]||(n[0]=[e.createElementVNode("p",null,[e.createTextVNode("This is the "),e.createElementVNode("b",null,"EntitiesConfigEditor"),e.createTextVNode(" content.")],-1)]))}const f=c(s,[["render",d],["__scopeId","data-v-f3ac49f3"]]);t.EntitiesConfigEditor=f,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(W,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],C):(W=typeof globalThis<"u"?globalThis:W||self,C(W["kong-ui-public-entities-config-editor"]={},W.Vue))})(this,function(W,C){"use strict";var Pu=Object.defineProperty;var $u=(W,C,be)=>C in W?Pu(W,C,{enumerable:!0,configurable:!0,writable:!0,value:be}):W[C]=be;var we=(W,C,be)=>$u(W,typeof C!="symbol"?C+"":C,be);function be(e,t=!1){const n=e.length;let r=0,i="",s=0,o=16,a=0,l=0,c=0,f=0,u=0;function d(p,N){let T=0,A=0;for(;T<p||!N;){let v=e.charCodeAt(r);if(v>=48&&v<=57)A=A*16+v-48;else if(v>=65&&v<=70)A=A*16+v-65+10;else if(v>=97&&v<=102)A=A*16+v-97+10;else break;r++,T++}return T<p&&(A=-1),A}function g(p){r=p,i="",s=0,o=16,u=0}function h(){let p=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&je(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&je(e.charCodeAt(r)))for(r++;r<e.length&&je(e.charCodeAt(r));)r++;else return u=3,e.substring(p,r);let N=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&je(e.charCodeAt(r))){for(r++;r<e.length&&je(e.charCodeAt(r));)r++;N=r}else u=3;return e.substring(p,N)}function b(){let p="",N=r;for(;;){if(r>=n){p+=e.substring(N,r),u=2;break}const T=e.charCodeAt(r);if(T===34){p+=e.substring(N,r),r++;break}if(T===92){if(p+=e.substring(N,r),r++,r>=n){u=2;break}switch(e.charCodeAt(r++)){case 34:p+='"';break;case 92:p+="\\";break;case 47:p+="/";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+=`
2
+ `;break;case 114:p+="\r";break;case 116:p+=" ";break;case 117:const v=d(4,!0);v>=0?p+=String.fromCharCode(v):u=4;break;default:u=5}N=r;continue}if(T>=0&&T<=31)if(qe(T)){p+=e.substring(N,r),u=2;break}else u=6;r++}return p}function m(){if(i="",u=0,s=r,l=a,f=c,r>=n)return s=n,o=17;let p=e.charCodeAt(r);if(At(p)){do r++,i+=String.fromCharCode(p),p=e.charCodeAt(r);while(At(p));return o=15}if(qe(p))return r++,i+=String.fromCharCode(p),p===13&&e.charCodeAt(r)===10&&(r++,i+=`
3
+ `),a++,c=r,o=14;switch(p){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=b(),o=10;case 47:const N=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!qe(e.charCodeAt(r));)r++;return i=e.substring(N,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;const T=n-1;let A=!1;for(;r<T;){const v=e.charCodeAt(r);if(v===42&&e.charCodeAt(r+1)===47){r+=2,A=!0;break}r++,qe(v)&&(v===13&&e.charCodeAt(r)===10&&r++,a++,c=r)}return A||(r++,u=1),i=e.substring(N,r),o=13}return i+=String.fromCharCode(p),r++,o=16;case 45:if(i+=String.fromCharCode(p),r++,r===n||!je(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=h(),o=11;default:for(;r<n&&w(p);)r++,p=e.charCodeAt(r);if(s!==r){switch(i=e.substring(s,r),i){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return i+=String.fromCharCode(p),r++,o=16}}function w(p){if(At(p)||qe(p))return!1;switch(p){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function j(){let p;do p=m();while(p>=12&&p<=15);return p}return{setPosition:g,getPosition:()=>r,scan:t?j:m,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>s,getTokenLength:()=>r-s,getTokenStartLine:()=>l,getTokenStartCharacter:()=>s-f,getTokenError:()=>u}}function At(e){return e===32||e===9}function qe(e){return e===10||e===13}function je(e){return e>=48&&e<=57}var an;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(an||(an={}));const oe=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),Pe=200,cn={" ":{"\n":new Array(Pe).fill(0).map((e,t)=>`
4
+ `+" ".repeat(t)),"\r":new Array(Pe).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(Pe).fill(0).map((e,t)=>`\r
5
+ `+" ".repeat(t))}," ":{"\n":new Array(Pe).fill(0).map((e,t)=>`
6
+ `+" ".repeat(t)),"\r":new Array(Pe).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(Pe).fill(0).map((e,t)=>`\r
7
+ `+" ".repeat(t))}},Ii=[`
8
+ `,"\r",`\r
9
+ `];function ji(e,t,n){let r,i,s,o,a;if(t){for(o=t.offset,a=o+t.length,s=o;s>0&&!un(e,s-1);)s--;let T=a;for(;T<e.length&&!un(e,T);)T++;i=e.substring(s,T),r=Pi(i,n)}else i=e,r=0,s=0,o=0,a=e.length;const l=$i(n,e),c=Ii.includes(l);let f=0,u=0,d;n.insertSpaces?d=oe[n.tabSize||4]??$e(oe[1],n.tabSize||4):d=" ";const g=d===" "?" ":" ";let h=be(i,!1),b=!1;function m(){if(f>1)return $e(l,f)+$e(d,r+u);const T=d.length*(r+u);return!c||T>cn[g][l].length?l+$e(d,r+u):T<=0?l:cn[g][l][T]}function w(){let T=h.scan();for(f=0;T===15||T===14;)T===14&&n.keepLines?f+=1:T===14&&(f=1),T=h.scan();return b=T===16||h.getTokenError()!==0,T}const j=[];function p(T,A,v){!b&&(!t||A<a&&v>o)&&e.substring(A,v)!==T&&j.push({offset:A,length:v-A,content:T})}let N=w();if(n.keepLines&&f>0&&p($e(l,f),0,0),N!==17){let T=h.getTokenOffset()+s,A=d.length*r<20&&n.insertSpaces?oe[d.length*r]:$e(d,r);p(A,s,T)}for(;N!==17;){let T=h.getTokenOffset()+h.getTokenLength()+s,A=w(),v="",$=!1;for(;f===0&&(A===12||A===13);){let U=h.getTokenOffset()+s;p(oe[1],T,U),T=h.getTokenOffset()+h.getTokenLength()+s,$=A===12,v=$?m():"",A=w()}if(A===2)N!==1&&u--,n.keepLines&&f>0||!n.keepLines&&N!==1?v=m():n.keepLines&&(v=oe[1]);else if(A===4)N!==3&&u--,n.keepLines&&f>0||!n.keepLines&&N!==3?v=m():n.keepLines&&(v=oe[1]);else{switch(N){case 3:case 1:u++,n.keepLines&&f>0||!n.keepLines?v=m():v=oe[1];break;case 5:n.keepLines&&f>0||!n.keepLines?v=m():v=oe[1];break;case 12:v=m();break;case 13:f>0?v=m():$||(v=oe[1]);break;case 6:n.keepLines&&f>0?v=m():$||(v=oe[1]);break;case 10:n.keepLines&&f>0?v=m():A===6&&!$&&(v="");break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&f>0?v=m():(A===12||A===13)&&!$?v=oe[1]:A!==5&&A!==17&&(b=!0);break;case 16:b=!0;break}f>0&&(A===12||A===13)&&(v=m())}A===17&&(n.keepLines&&f>0?v=m():v=n.insertFinalNewline?l:"");const E=h.getTokenOffset()+s;p(v,T,E),N=A}return j}function $e(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}function Pi(e,t){let n=0,r=0;const i=t.tabSize||4;for(;n<e.length;){let s=e.charAt(n);if(s===oe[1])r++;else if(s===" ")r+=i;else break;n++}return Math.floor(r/i)}function $i(e,t){for(let n=0;n<t.length;n++){const r=t.charAt(n);if(r==="\r")return n+1<t.length&&t.charAt(n+1)===`
10
+ `?`\r
11
+ `:"\r";if(r===`
12
+ `)return`
13
+ `}return e&&e.eol||`
14
+ `}function un(e,t){return`\r
15
+ `.indexOf(e.charAt(t))!==-1}var st;(function(e){e.DEFAULT={allowTrailingComma:!1}})(st||(st={}));function Ei(e,t=[],n=st.DEFAULT){let r=null,i=[];const s=[];function o(l){Array.isArray(i)?i.push(l):r!==null&&(i[r]=l)}return Vi(e,{onObjectBegin:()=>{const l={};o(l),s.push(i),i=l,r=null},onObjectProperty:l=>{r=l},onObjectEnd:()=>{i=s.pop()},onArrayBegin:()=>{const l=[];o(l),s.push(i),i=l,r=null},onArrayEnd:()=>{i=s.pop()},onLiteralValue:o,onError:(l,c,f)=>{t.push({error:l,offset:c,length:f})}},n),i[0]}function ln(e){if(!e.parent||!e.parent.children)return[];const t=ln(e.parent);if(e.parent.type==="property"){const n=e.parent.children[0].value;t.push(n)}else if(e.parent.type==="array"){const n=e.parent.children.indexOf(e);n!==-1&&t.push(n)}return t}function kt(e){switch(e.type){case"array":return e.children.map(kt);case"object":const t=Object.create(null);for(let n of e.children){const r=n.children[1];r&&(t[n.children[0].value]=kt(r))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function Mi(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function fn(e,t,n=!1){if(Mi(e,t,n)){const r=e.children;if(Array.isArray(r))for(let i=0;i<r.length&&r[i].offset<=t;i++){const s=fn(r[i],t,n);if(s)return s}return e}}function Vi(e,t,n=st.DEFAULT){const r=be(e,!1),i=[];let s=0;function o(I){return I?()=>s===0&&I(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function a(I){return I?k=>s===0&&I(k,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function l(I){return I?k=>s===0&&I(k,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function c(I){return I?()=>{s>0?s++:I(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(s=1)}:()=>!0}function f(I){return I?()=>{s>0&&s--,s===0&&I(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}const u=c(t.onObjectBegin),d=l(t.onObjectProperty),g=f(t.onObjectEnd),h=c(t.onArrayBegin),b=f(t.onArrayEnd),m=l(t.onLiteralValue),w=a(t.onSeparator),j=o(t.onComment),p=a(t.onError),N=n&&n.disallowComments,T=n&&n.allowTrailingComma;function A(){for(;;){const I=r.scan();switch(r.getTokenError()){case 4:v(14);break;case 5:v(15);break;case 3:v(13);break;case 1:N||v(11);break;case 2:v(12);break;case 6:v(16);break}switch(I){case 12:case 13:N?v(10):j();break;case 16:v(1);break;case 15:case 14:break;default:return I}}}function v(I,k=[],L=[]){if(p(I),k.length+L.length>0){let _=r.getToken();for(;_!==17;){if(k.indexOf(_)!==-1){A();break}else if(L.indexOf(_)!==-1)break;_=A()}}}function $(I){const k=r.getTokenValue();return I?m(k):(d(k),i.push(k)),A(),!0}function E(){switch(r.getToken()){case 11:const I=r.getTokenValue();let k=Number(I);isNaN(k)&&(v(2),k=0),m(k);break;case 7:m(null);break;case 8:m(!0);break;case 9:m(!1);break;default:return!1}return A(),!0}function U(){return r.getToken()!==10?(v(3,[],[2,5]),!1):($(!1),r.getToken()===6?(w(":"),A(),P()||v(4,[],[2,5])):v(5,[],[2,5]),i.pop(),!0)}function S(){u(),A();let I=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(I||v(4,[],[]),w(","),A(),r.getToken()===2&&T)break}else I&&v(6,[],[]);U()||v(4,[],[2,5]),I=!0}return g(),r.getToken()!==2?v(7,[2],[]):A(),!0}function x(){h(),A();let I=!0,k=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(k||v(4,[],[]),w(","),A(),r.getToken()===4&&T)break}else k&&v(6,[],[]);I?(i.push(0),I=!1):i[i.length-1]++,P()||v(4,[],[4,5]),k=!0}return b(),I||i.pop(),r.getToken()!==4?v(8,[4],[]):A(),!0}function P(){switch(r.getToken()){case 3:return x();case 1:return S();case 10:return $(!0);default:return E()}}return A(),r.getToken()===17?n.allowEmptyContent?!0:(v(4,[],[]),!1):P()?(r.getToken()!==17&&v(9,[],[]),!0):(v(4,[],[]),!1)}const Oe=be;var dn;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(dn||(dn={}));var pn;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(pn||(pn={}));const Fi=Ei,Di=fn,Ui=ln,Ri=kt;var hn;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(hn||(hn={}));function Bi(e,t,n){return ji(e,t,n)}function Ee(e,t){if(e===t)return!0;if(e==null||t===null||t===void 0||typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;let n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!Ee(e[n],t[n]))return!1}else{const i=[];for(r in e)i.push(r);i.sort();const s=[];for(r in t)s.push(r);if(s.sort(),!Ee(i,s))return!1;for(n=0;n<i.length;n++)if(!Ee(e[i[n]],t[i[n]]))return!1}return!0}function ee(e){return typeof e=="number"}function ce(e){return typeof e<"u"}function le(e){return typeof e=="boolean"}function gn(e){return typeof e=="string"}function ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qi(e,t){if(e.length<t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function We(e,t){const n=e.length-t.length;return n>0?e.lastIndexOf(t)===n:n===0?e===t:!1}function ot(e){let t="";qi(e,"(?i)")&&(e=e.substring(4),t="i");try{return new RegExp(e,t+"u")}catch{try{return new RegExp(e,t)}catch{return}}}function mn(e){let t=0;for(let n=0;n<e.length;n++){t++;const r=e.charCodeAt(n);55296<=r&&r<=56319&&n++}return t}var yn;(function(e){function t(n){return typeof n=="string"}e.is=t})(yn||(yn={}));var Tt;(function(e){function t(n){return typeof n=="string"}e.is=t})(Tt||(Tt={}));var bn;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(bn||(bn={}));var at;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(at||(at={}));var H;(function(e){function t(r,i){return r===Number.MAX_VALUE&&(r=at.MAX_VALUE),i===Number.MAX_VALUE&&(i=at.MAX_VALUE),{line:r,character:i}}e.create=t;function n(r){let i=r;return y.objectLiteral(i)&&y.uinteger(i.line)&&y.uinteger(i.character)}e.is=n})(H||(H={}));var D;(function(e){function t(r,i,s,o){if(y.uinteger(r)&&y.uinteger(i)&&y.uinteger(s)&&y.uinteger(o))return{start:H.create(r,i),end:H.create(s,o)};if(H.is(r)&&H.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}e.create=t;function n(r){let i=r;return y.objectLiteral(i)&&H.is(i.start)&&H.is(i.end)}e.is=n})(D||(D={}));var Me;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){let i=r;return y.objectLiteral(i)&&D.is(i.range)&&(y.string(i.uri)||y.undefined(i.uri))}e.is=n})(Me||(Me={}));var vn;(function(e){function t(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}e.create=t;function n(r){let i=r;return y.objectLiteral(i)&&D.is(i.targetRange)&&y.string(i.targetUri)&&D.is(i.targetSelectionRange)&&(D.is(i.originSelectionRange)||y.undefined(i.originSelectionRange))}e.is=n})(vn||(vn={}));var wt;(function(e){function t(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}e.create=t;function n(r){const i=r;return y.objectLiteral(i)&&y.numberRange(i.red,0,1)&&y.numberRange(i.green,0,1)&&y.numberRange(i.blue,0,1)&&y.numberRange(i.alpha,0,1)}e.is=n})(wt||(wt={}));var An;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){const i=r;return y.objectLiteral(i)&&D.is(i.range)&&wt.is(i.color)}e.is=n})(An||(An={}));var kn;(function(e){function t(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}e.create=t;function n(r){const i=r;return y.objectLiteral(i)&&y.string(i.label)&&(y.undefined(i.textEdit)||fe.is(i))&&(y.undefined(i.additionalTextEdits)||y.typedArray(i.additionalTextEdits,fe.is))}e.is=n})(kn||(kn={}));var Ce;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Ce||(Ce={}));var Tn;(function(e){function t(r,i,s,o,a,l){const c={startLine:r,endLine:i};return y.defined(s)&&(c.startCharacter=s),y.defined(o)&&(c.endCharacter=o),y.defined(a)&&(c.kind=a),y.defined(l)&&(c.collapsedText=l),c}e.create=t;function n(r){const i=r;return y.objectLiteral(i)&&y.uinteger(i.startLine)&&y.uinteger(i.startLine)&&(y.undefined(i.startCharacter)||y.uinteger(i.startCharacter))&&(y.undefined(i.endCharacter)||y.uinteger(i.endCharacter))&&(y.undefined(i.kind)||y.string(i.kind))}e.is=n})(Tn||(Tn={}));var Ot;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){let i=r;return y.defined(i)&&Me.is(i.location)&&y.string(i.message)}e.is=n})(Ot||(Ot={}));var re;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(re||(re={}));var wn;(function(e){e.Unnecessary=1,e.Deprecated=2})(wn||(wn={}));var On;(function(e){function t(n){const r=n;return y.objectLiteral(r)&&y.string(r.href)}e.is=t})(On||(On={}));var he;(function(e){function t(r,i,s,o,a,l){let c={range:r,message:i};return y.defined(s)&&(c.severity=s),y.defined(o)&&(c.code=o),y.defined(a)&&(c.source=a),y.defined(l)&&(c.relatedInformation=l),c}e.create=t;function n(r){var i;let s=r;return y.defined(s)&&D.is(s.range)&&y.string(s.message)&&(y.number(s.severity)||y.undefined(s.severity))&&(y.integer(s.code)||y.string(s.code)||y.undefined(s.code))&&(y.undefined(s.codeDescription)||y.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(y.string(s.source)||y.undefined(s.source))&&(y.undefined(s.relatedInformation)||y.typedArray(s.relatedInformation,Ot.is))}e.is=n})(he||(he={}));var Ve;(function(e){function t(r,i,...s){let o={title:r,command:i};return y.defined(s)&&s.length>0&&(o.arguments=s),o}e.create=t;function n(r){let i=r;return y.defined(i)&&y.string(i.title)&&y.string(i.command)}e.is=n})(Ve||(Ve={}));var fe;(function(e){function t(s,o){return{range:s,newText:o}}e.replace=t;function n(s,o){return{range:{start:s,end:s},newText:o}}e.insert=n;function r(s){return{range:s,newText:""}}e.del=r;function i(s){const o=s;return y.objectLiteral(o)&&y.string(o.newText)&&D.is(o.range)}e.is=i})(fe||(fe={}));var Nt;(function(e){function t(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}e.create=t;function n(r){const i=r;return y.objectLiteral(i)&&y.string(i.label)&&(y.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(y.string(i.description)||i.description===void 0)}e.is=n})(Nt||(Nt={}));var Fe;(function(e){function t(n){const r=n;return y.string(r)}e.is=t})(Fe||(Fe={}));var Nn;(function(e){function t(s,o,a){return{range:s,newText:o,annotationId:a}}e.replace=t;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}e.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}e.del=r;function i(s){const o=s;return fe.is(o)&&(Nt.is(o.annotationId)||Fe.is(o.annotationId))}e.is=i})(Nn||(Nn={}));var xt;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){let i=r;return y.defined(i)&&jt.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(xt||(xt={}));var St;(function(e){function t(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}e.create=t;function n(r){let i=r;return i&&i.kind==="create"&&y.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||y.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||y.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Fe.is(i.annotationId))}e.is=n})(St||(St={}));var Lt;(function(e){function t(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}e.create=t;function n(r){let i=r;return i&&i.kind==="rename"&&y.string(i.oldUri)&&y.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||y.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||y.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Fe.is(i.annotationId))}e.is=n})(Lt||(Lt={}));var _t;(function(e){function t(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}e.create=t;function n(r){let i=r;return i&&i.kind==="delete"&&y.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||y.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||y.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Fe.is(i.annotationId))}e.is=n})(_t||(_t={}));var It;(function(e){function t(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>y.string(i.kind)?St.is(i)||Lt.is(i)||_t.is(i):xt.is(i)))}e.is=t})(It||(It={}));var xn;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){let i=r;return y.defined(i)&&y.string(i.uri)}e.is=n})(xn||(xn={}));var Sn;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return y.defined(i)&&y.string(i.uri)&&y.integer(i.version)}e.is=n})(Sn||(Sn={}));var jt;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return y.defined(i)&&y.string(i.uri)&&(i.version===null||y.integer(i.version))}e.is=n})(jt||(jt={}));var Ln;(function(e){function t(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}e.create=t;function n(r){let i=r;return y.defined(i)&&y.string(i.uri)&&y.string(i.languageId)&&y.integer(i.version)&&y.string(i.text)}e.is=n})(Ln||(Ln={}));var Ne;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){const r=n;return r===e.PlainText||r===e.Markdown}e.is=t})(Ne||(Ne={}));var ze;(function(e){function t(n){const r=n;return y.objectLiteral(n)&&Ne.is(r.kind)&&y.string(r.value)}e.is=t})(ze||(ze={}));var ie;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(ie||(ie={}));var Z;(function(e){e.PlainText=1,e.Snippet=2})(Z||(Z={}));var _n;(function(e){e.Deprecated=1})(_n||(_n={}));var In;(function(e){function t(r,i,s){return{newText:r,insert:i,replace:s}}e.create=t;function n(r){const i=r;return i&&y.string(i.newText)&&D.is(i.insert)&&D.is(i.replace)}e.is=n})(In||(In={}));var jn;(function(e){e.asIs=1,e.adjustIndentation=2})(jn||(jn={}));var Pn;(function(e){function t(n){const r=n;return r&&(y.string(r.detail)||r.detail===void 0)&&(y.string(r.description)||r.description===void 0)}e.is=t})(Pn||(Pn={}));var Pt;(function(e){function t(n){return{label:n}}e.create=t})(Pt||(Pt={}));var $n;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})($n||($n={}));var ct;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){const i=r;return y.string(i)||y.objectLiteral(i)&&y.string(i.language)&&y.string(i.value)}e.is=n})(ct||(ct={}));var En;(function(e){function t(n){let r=n;return!!r&&y.objectLiteral(r)&&(ze.is(r.contents)||ct.is(r.contents)||y.typedArray(r.contents,ct.is))&&(n.range===void 0||D.is(n.range))}e.is=t})(En||(En={}));var Mn;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(Mn||(Mn={}));var Vn;(function(e){function t(n,r,...i){let s={label:n};return y.defined(r)&&(s.documentation=r),y.defined(i)?s.parameters=i:s.parameters=[],s}e.create=t})(Vn||(Vn={}));var Fn;(function(e){e.Text=1,e.Read=2,e.Write=3})(Fn||(Fn={}));var Dn;(function(e){function t(n,r){let i={range:n};return y.number(r)&&(i.kind=r),i}e.create=t})(Dn||(Dn={}));var de;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(de||(de={}));var Un;(function(e){e.Deprecated=1})(Un||(Un={}));var Rn;(function(e){function t(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}e.create=t})(Rn||(Rn={}));var Bn;(function(e){function t(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}e.create=t})(Bn||(Bn={}));var qn;(function(e){function t(r,i,s,o,a,l){let c={name:r,detail:i,kind:s,range:o,selectionRange:a};return l!==void 0&&(c.children=l),c}e.create=t;function n(r){let i=r;return i&&y.string(i.name)&&y.number(i.kind)&&D.is(i.range)&&D.is(i.selectionRange)&&(i.detail===void 0||y.string(i.detail))&&(i.deprecated===void 0||y.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}e.is=n})(qn||(qn={}));var Wn;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Wn||(Wn={}));var ut;(function(e){e.Invoked=1,e.Automatic=2})(ut||(ut={}));var Cn;(function(e){function t(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}e.create=t;function n(r){let i=r;return y.defined(i)&&y.typedArray(i.diagnostics,he.is)&&(i.only===void 0||y.typedArray(i.only,y.string))&&(i.triggerKind===void 0||i.triggerKind===ut.Invoked||i.triggerKind===ut.Automatic)}e.is=n})(Cn||(Cn={}));var zn;(function(e){function t(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Ve.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}e.create=t;function n(r){let i=r;return i&&y.string(i.title)&&(i.diagnostics===void 0||y.typedArray(i.diagnostics,he.is))&&(i.kind===void 0||y.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ve.is(i.command))&&(i.isPreferred===void 0||y.boolean(i.isPreferred))&&(i.edit===void 0||It.is(i.edit))}e.is=n})(zn||(zn={}));var Jn;(function(e){function t(r,i){let s={range:r};return y.defined(i)&&(s.data=i),s}e.create=t;function n(r){let i=r;return y.defined(i)&&D.is(i.range)&&(y.undefined(i.command)||Ve.is(i.command))}e.is=n})(Jn||(Jn={}));var Gn;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){let i=r;return y.defined(i)&&y.uinteger(i.tabSize)&&y.boolean(i.insertSpaces)}e.is=n})(Gn||(Gn={}));var Hn;(function(e){function t(r,i,s){return{range:r,target:i,data:s}}e.create=t;function n(r){let i=r;return y.defined(i)&&D.is(i.range)&&(y.undefined(i.target)||y.string(i.target))}e.is=n})(Hn||(Hn={}));var lt;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){let i=r;return y.objectLiteral(i)&&D.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})(lt||(lt={}));var Xn;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Xn||(Xn={}));var Zn;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(Zn||(Zn={}));var Yn;(function(e){function t(n){const r=n;return y.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=t})(Yn||(Yn={}));var Qn;(function(e){function t(r,i){return{range:r,text:i}}e.create=t;function n(r){const i=r;return i!=null&&D.is(i.range)&&y.string(i.text)}e.is=n})(Qn||(Qn={}));var Kn;(function(e){function t(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}e.create=t;function n(r){const i=r;return i!=null&&D.is(i.range)&&y.boolean(i.caseSensitiveLookup)&&(y.string(i.variableName)||i.variableName===void 0)}e.is=n})(Kn||(Kn={}));var er;(function(e){function t(r,i){return{range:r,expression:i}}e.create=t;function n(r){const i=r;return i!=null&&D.is(i.range)&&(y.string(i.expression)||i.expression===void 0)}e.is=n})(er||(er={}));var tr;(function(e){function t(r,i){return{frameId:r,stoppedLocation:i}}e.create=t;function n(r){const i=r;return y.defined(i)&&D.is(r.stoppedLocation)}e.is=n})(tr||(tr={}));var $t;(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})($t||($t={}));var Et;(function(e){function t(r){return{value:r}}e.create=t;function n(r){const i=r;return y.objectLiteral(i)&&(i.tooltip===void 0||y.string(i.tooltip)||ze.is(i.tooltip))&&(i.location===void 0||Me.is(i.location))&&(i.command===void 0||Ve.is(i.command))}e.is=n})(Et||(Et={}));var nr;(function(e){function t(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}e.create=t;function n(r){const i=r;return y.objectLiteral(i)&&H.is(i.position)&&(y.string(i.label)||y.typedArray(i.label,Et.is))&&(i.kind===void 0||$t.is(i.kind))&&i.textEdits===void 0||y.typedArray(i.textEdits,fe.is)&&(i.tooltip===void 0||y.string(i.tooltip)||ze.is(i.tooltip))&&(i.paddingLeft===void 0||y.boolean(i.paddingLeft))&&(i.paddingRight===void 0||y.boolean(i.paddingRight))}e.is=n})(nr||(nr={}));var rr;(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t})(rr||(rr={}));var ir;(function(e){function t(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}e.create=t})(ir||(ir={}));var sr;(function(e){function t(n){return{items:n}}e.create=t})(sr||(sr={}));var or;(function(e){e.Invoked=0,e.Automatic=1})(or||(or={}));var ar;(function(e){function t(n,r){return{range:n,text:r}}e.create=t})(ar||(ar={}));var cr;(function(e){function t(n,r){return{triggerKind:n,selectedCompletionInfo:r}}e.create=t})(cr||(cr={}));var ur;(function(e){function t(n){const r=n;return y.objectLiteral(r)&&Tt.is(r.uri)&&y.string(r.name)}e.is=t})(ur||(ur={}));var lr;(function(e){function t(s,o,a,l){return new Wi(s,o,a,l)}e.create=t;function n(s){let o=s;return!!(y.defined(o)&&y.string(o.uri)&&(y.undefined(o.languageId)||y.string(o.languageId))&&y.uinteger(o.lineCount)&&y.func(o.getText)&&y.func(o.positionAt)&&y.func(o.offsetAt))}e.is=n;function r(s,o){let a=s.getText(),l=i(o,(f,u)=>{let d=f.range.start.line-u.range.start.line;return d===0?f.range.start.character-u.range.start.character:d}),c=a.length;for(let f=l.length-1;f>=0;f--){let u=l[f],d=s.offsetAt(u.range.start),g=s.offsetAt(u.range.end);if(g<=c)a=a.substring(0,d)+u.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");c=d}return a}e.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,l=s.slice(0,a),c=s.slice(a);i(l,o),i(c,o);let f=0,u=0,d=0;for(;f<l.length&&u<c.length;)o(l[f],c[u])<=0?s[d++]=l[f++]:s[d++]=c[u++];for(;f<l.length;)s[d++]=l[f++];for(;u<c.length;)s[d++]=c[u++];return s}})(lr||(lr={}));let Wi=class{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(t.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
16
+ `,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
17
+ `&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return H.create(0,t);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>t?i=o:r=o+1}let s=r-1;return H.create(s,t-n[s])}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var y;(function(e){const t=Object.prototype.toString;function n(g){return typeof g<"u"}e.defined=n;function r(g){return typeof g>"u"}e.undefined=r;function i(g){return g===!0||g===!1}e.boolean=i;function s(g){return t.call(g)==="[object String]"}e.string=s;function o(g){return t.call(g)==="[object Number]"}e.number=o;function a(g,h,b){return t.call(g)==="[object Number]"&&h<=g&&g<=b}e.numberRange=a;function l(g){return t.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}e.integer=l;function c(g){return t.call(g)==="[object Number]"&&0<=g&&g<=2147483647}e.uinteger=c;function f(g){return t.call(g)==="[object Function]"}e.func=f;function u(g){return g!==null&&typeof g=="object"}e.objectLiteral=u;function d(g,h){return Array.isArray(g)&&g.every(h)}e.typedArray=d})(y||(y={}));class Je{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){for(const r of t)if(Je.isIncremental(r)){const i=pr(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let c=this._lineOffsets;const f=fr(r.text,!1,s);if(l-a===f.length)for(let d=0,g=f.length;d<g;d++)c[d+a+1]=f[d];else f.length<1e4?c.splice(a+1,l-a,...f):this._lineOffsets=c=c.slice(0,a+1).concat(f,c.slice(l+1));const u=r.text.length-(o-s);if(u!==0)for(let d=a+1+f.length,g=c.length;d<g;d++)c[d]=c[d]+u}else if(Je.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=fr(this._content,!0)),this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);const n=this.getLineOffsets();let r=0,i=n.length;if(i===0)return{line:0,character:t};for(;r<i;){const o=Math.floor((r+i)/2);n[o]>t?i=o:r=o+1}const s=r-1;return t=this.ensureBeforeEOL(t,n[s]),{line:s,character:t-n[s]}}offsetAt(t){const n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;const r=n[t.line];if(t.character<=0)return r;const i=t.line+1<n.length?n[t.line+1]:this._content.length,s=Math.min(r+t.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(t,n){for(;t>n&&dr(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(t){const n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var ae;(function(e){function t(i,s,o,a){return new Je(i,s,o,a)}e.create=t;function n(i,s,o){if(i instanceof Je)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function r(i,s){const o=i.getText(),a=Mt(s.map(Ci),(f,u)=>{const d=f.range.start.line-u.range.start.line;return d===0?f.range.start.character-u.range.start.character:d});let l=0;const c=[];for(const f of a){const u=i.offsetAt(f.range.start);if(u<l)throw new Error("Overlapping edit");u>l&&c.push(o.substring(l,u)),f.newText.length&&c.push(f.newText),l=i.offsetAt(f.range.end)}return c.push(o.substr(l)),c.join("")}e.applyEdits=r})(ae||(ae={}));function Mt(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Mt(r,t),Mt(i,t);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)t(r[s],i[o])<=0?e[a++]=r[s++]:e[a++]=i[o++];for(;s<r.length;)e[a++]=r[s++];for(;o<i.length;)e[a++]=i[o++];return e}function fr(e,t,n=0){const r=t?[n]:[];for(let i=0;i<e.length;i++){const s=e.charCodeAt(i);dr(s)&&(s===13&&i+1<e.length&&e.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function dr(e){return e===13||e===10}function pr(e){const t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function Ci(e){const t=pr(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var q;(function(e){e[e.Undefined=0]="Undefined",e[e.EnumValueMismatch=1]="EnumValueMismatch",e[e.Deprecated=2]="Deprecated",e[e.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=258]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",e[e.InvalidUnicode=260]="InvalidUnicode",e[e.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",e[e.InvalidCharacter=262]="InvalidCharacter",e[e.PropertyExpected=513]="PropertyExpected",e[e.CommaExpected=514]="CommaExpected",e[e.ColonExpected=515]="ColonExpected",e[e.ValueExpected=516]="ValueExpected",e[e.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",e[e.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",e[e.TrailingComma=519]="TrailingComma",e[e.DuplicateKey=520]="DuplicateKey",e[e.CommentNotPermitted=521]="CommentNotPermitted",e[e.PropertyKeysMustBeDoublequoted=528]="PropertyKeysMustBeDoublequoted",e[e.SchemaResolveError=768]="SchemaResolveError",e[e.SchemaUnsupportedFeature=769]="SchemaUnsupportedFeature"})(q||(q={}));var ue;(function(e){e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v6=6]="v6",e[e.v7=7]="v7",e[e.v2019_09=19]="v2019_09",e[e.v2020_12=20]="v2020_12"})(ue||(ue={}));var hr;(function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Ne.Markdown,Ne.PlainText],commitCharactersSupport:!0,labelDetailsSupport:!0}}}}})(hr||(hr={}));function O(...e){const t=e[0];let n,r,i;if(typeof t=="string")n=t,r=t,e.splice(0,1),i=!e||typeof e[0]!="object"?e:e[0];else if(t instanceof Array){const s=e.slice(1);if(t.length!==s.length+1)throw new Error("expected a string as the first argument to l10n.t");let o=t[0];for(let a=1;a<t.length;a++)o+=`{${a-1}}`+t[a];return O(o,...s)}else r=t.message,n=r,t.comment&&t.comment.length>0&&(n+=`/${Array.isArray(t.comment)?t.comment.join(""):t.comment}`),i=t.args??{};return Ji(r,i)}var zi=/{([^}]+)}/g;function Ji(e,t){return Object.keys(t).length===0?e:e.replace(zi,(n,r)=>t[r]??n)}const Gi={"color-hex":{errorMessage:O("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:O("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:O("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:O("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:O("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-Z0-9-]+\.)+[a-zA-Z]{2,}))$/},hostname:{errorMessage:O("String is not a hostname."),pattern:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i},ipv4:{errorMessage:O("String is not an IPv4 address."),pattern:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/},ipv6:{errorMessage:O("String is not an IPv6 address."),pattern:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i}};class xe{constructor(t,n,r=0){this.offset=n,this.length=r,this.parent=t}get children(){return[]}toString(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")}}class Hi extends xe{constructor(t,n){super(t,n),this.type="null",this.value=null}}class gr extends xe{constructor(t,n,r){super(t,r),this.type="boolean",this.value=n}}class Xi extends xe{constructor(t,n){super(t,n),this.type="array",this.items=[]}get children(){return this.items}}class Zi extends xe{constructor(t,n){super(t,n),this.type="number",this.isInteger=!0,this.value=Number.NaN}}class Vt extends xe{constructor(t,n,r){super(t,n,r),this.type="string",this.value=""}}class Yi extends xe{constructor(t,n,r){super(t,n),this.type="property",this.colonOffset=-1,this.keyNode=r}get children(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]}}class Qi extends xe{constructor(t,n){super(t,n),this.type="object",this.properties=[]}get children(){return this.properties}}function se(e){return le(e)?e?{}:{not:{}}:e}var mr;(function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"})(mr||(mr={}));const Ki={"http://json-schema.org/draft-03/schema#":ue.v3,"http://json-schema.org/draft-04/schema#":ue.v4,"http://json-schema.org/draft-06/schema#":ue.v6,"http://json-schema.org/draft-07/schema#":ue.v7,"https://json-schema.org/draft/2019-09/schema":ue.v2019_09,"https://json-schema.org/draft/2020-12/schema":ue.v2020_12};class yr{constructor(t){this.schemaDraft=t}}class Ft{constructor(t=-1,n){this.focusOffset=t,this.exclude=n,this.schemas=[]}add(t){this.schemas.push(t)}merge(t){Array.prototype.push.apply(this.schemas,t.schemas)}include(t){return(this.focusOffset===-1||br(t,this.focusOffset))&&t!==this.exclude}newSub(){return new Ft(-1,this.exclude)}}class Ge{constructor(){}get schemas(){return[]}add(t){}merge(t){}include(t){return!0}newSub(){return this}}Ge.instance=new Ge;class te{constructor(){this.problems=[],this.propertiesMatches=0,this.processedProperties=new Set,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}hasProblems(){return!!this.problems.length}merge(t){this.problems=this.problems.concat(t.problems),this.propertiesMatches+=t.propertiesMatches,this.propertiesValueMatches+=t.propertiesValueMatches,this.mergeProcessedProperties(t)}mergeEnumValues(t){!this.enumValueMatch&&!t.enumValueMatch&&this.enumValues&&t.enumValues&&(this.enumValues=this.enumValues.concat(t.enumValues))}updateEnumMismatchProblemMessages(){if(!this.enumValueMatch&&this.enumValues)for(const t of this.problems)t.code===q.EnumValueMismatch&&(t.message=O("Value is not accepted. Valid values: {0}.",this.enumValues.map(n=>JSON.stringify(n)).join(", ")))}mergePropertyMatch(t){this.problems=this.problems.concat(t.problems),this.propertiesMatches++,(t.enumValueMatch||!t.hasProblems()&&t.propertiesMatches)&&this.propertiesValueMatches++,t.enumValueMatch&&t.enumValues&&t.enumValues.length===1&&this.primaryValueMatches++}mergeProcessedProperties(t){t.processedProperties.forEach(n=>this.processedProperties.add(n))}compare(t){const n=this.hasProblems();return n!==t.hasProblems()?n?-1:1:this.enumValueMatch!==t.enumValueMatch?t.enumValueMatch?-1:1:this.primaryValueMatches!==t.primaryValueMatches?this.primaryValueMatches-t.primaryValueMatches:this.propertiesValueMatches!==t.propertiesValueMatches?this.propertiesValueMatches-t.propertiesValueMatches:this.propertiesMatches-t.propertiesMatches}}function es(e,t=[]){return new vr(e,t,[])}function Se(e){return Ri(e)}function Dt(e){return Ui(e)}function br(e,t,n=!1){return t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}class vr{constructor(t,n=[],r=[]){this.root=t,this.syntaxErrors=n,this.comments=r}getNodeFromOffset(t,n=!1){if(this.root)return Di(this.root,t,n)}visit(t){if(this.root){const n=r=>{let i=t(r);const s=r.children;if(Array.isArray(s))for(let o=0;o<s.length&&i;o++)i=n(s[o]);return i};n(this.root)}}validate(t,n,r=re.Warning,i){if(this.root&&n){const s=new te;return Q(this.root,n,s,Ge.instance,new yr(i??Ar(n))),s.problems.map(o=>{const a=D.create(t.positionAt(o.location.offset),t.positionAt(o.location.offset+o.location.length));return he.create(a,o.message,o.severity??r,o.code)})}}getMatchingSchemas(t,n=-1,r){if(this.root&&t){const i=new Ft(n,r),s=Ar(t),o=new yr(s);return Q(this.root,t,new te,i,o),i.schemas}return[]}}function Ar(e,t=ue.v2020_12){let n=e.$schema;return n?Ki[n]??t:t}function Q(e,t,n,r,i){if(!e||!r.include(e))return;if(e.type==="property")return Q(e.valueNode,t,n,r,i);const s=e;switch(o(),s.type){case"object":f(s);break;case"array":c(s);break;case"string":l(s);break;case"number":a(s);break}r.add({node:s,schema:t});function o(){var j;function u(p){return s.type===p||p==="integer"&&s.type==="number"&&s.isInteger}if(Array.isArray(t.type)?t.type.some(u)||n.problems.push({location:{offset:s.offset,length:s.length},message:t.errorMessage||O("Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&(u(t.type)||n.problems.push({location:{offset:s.offset,length:s.length},message:t.errorMessage||O('Incorrect type. Expected "{0}".',t.type)})),Array.isArray(t.allOf))for(const p of t.allOf){const N=new te,T=r.newSub();Q(s,se(p),N,T,i),n.merge(N),r.merge(T)}const d=se(t.not);if(d){const p=new te,N=r.newSub();Q(s,d,p,N,i),p.hasProblems()||n.problems.push({location:{offset:s.offset,length:s.length},message:t.errorMessage||O("Matches a schema that is not allowed.")});for(const T of N.schemas)T.inverted=!T.inverted,r.add(T)}const g=(p,N)=>{const T=[];let A;for(const v of p){const $=se(v),E=new te,U=r.newSub();if(Q(s,$,E,U,i),E.hasProblems()||T.push($),!A)A={schema:$,validationResult:E,matchingSchemas:U};else if(!N&&!E.hasProblems()&&!A.validationResult.hasProblems())A.matchingSchemas.merge(U),A.validationResult.propertiesMatches+=E.propertiesMatches,A.validationResult.propertiesValueMatches+=E.propertiesValueMatches,A.validationResult.mergeProcessedProperties(E);else{const S=E.compare(A.validationResult);S>0?A={schema:$,validationResult:E,matchingSchemas:U}:S===0&&(A.matchingSchemas.merge(U),A.validationResult.mergeEnumValues(E))}}return T.length>1&&N&&n.problems.push({location:{offset:s.offset,length:1},message:O("Matches multiple schemas when only one must validate.")}),A&&(A.validationResult.updateEnumMismatchProblemMessages(),n.merge(A.validationResult),r.merge(A.matchingSchemas)),T.length};Array.isArray(t.anyOf)&&g(t.anyOf,!1),Array.isArray(t.oneOf)&&g(t.oneOf,!0);const h=p=>{const N=new te,T=r.newSub();Q(s,se(p),N,T,i),n.merge(N),r.merge(T)},b=(p,N,T)=>{const A=se(p),v=new te,$=r.newSub();Q(s,A,v,$,i),r.merge($),n.mergeProcessedProperties(v),v.hasProblems()?T&&h(T):N&&h(N)},m=se(t.if);if(m&&b(m,se(t.then),se(t.else)),Array.isArray(t.enum)){const p=Se(s);let N=!1;for(const T of t.enum)if(Ee(p,T)){N=!0;break}n.enumValues=t.enum,n.enumValueMatch=N,N||n.problems.push({location:{offset:s.offset,length:s.length},code:q.EnumValueMismatch,message:t.errorMessage||O("Value is not accepted. Valid values: {0}.",t.enum.map(T=>JSON.stringify(T)).join(", "))})}if(ce(t.const)){const p=Se(s);Ee(p,t.const)?n.enumValueMatch=!0:(n.problems.push({location:{offset:s.offset,length:s.length},code:q.EnumValueMismatch,message:t.errorMessage||O("Value must be {0}.",JSON.stringify(t.const))}),n.enumValueMatch=!1),n.enumValues=[t.const]}let w=t.deprecationMessage;if(w||t.deprecated){w=w||O("Value is deprecated");let p=((j=s.parent)==null?void 0:j.type)==="property"?s.parent:s;n.problems.push({location:{offset:p.offset,length:p.length},severity:re.Warning,message:w,code:q.Deprecated})}}function a(u){const d=u.value;function g(N){var A;const T=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(N.toString());return T&&{value:Number(T[1]+(T[2]||"")),multiplier:(((A=T[2])==null?void 0:A.length)||0)-(parseInt(T[3])||0)}}if(ee(t.multipleOf)){let N=-1;if(Number.isInteger(t.multipleOf))N=d%t.multipleOf;else{let T=g(t.multipleOf),A=g(d);if(T&&A){const v=10**Math.abs(A.multiplier-T.multiplier);A.multiplier<T.multiplier?A.value*=v:T.value*=v,N=A.value%T.value}}N!==0&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Value is not divisible by {0}.",t.multipleOf)})}function h(N,T){if(ee(T))return T;if(le(T)&&T)return N}function b(N,T){if(!le(T)||!T)return N}const m=h(t.minimum,t.exclusiveMinimum);ee(m)&&d<=m&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Value is below the exclusive minimum of {0}.",m)});const w=h(t.maximum,t.exclusiveMaximum);ee(w)&&d>=w&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Value is above the exclusive maximum of {0}.",w)});const j=b(t.minimum,t.exclusiveMinimum);ee(j)&&d<j&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Value is below the minimum of {0}.",j)});const p=b(t.maximum,t.exclusiveMaximum);ee(p)&&d>p&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Value is above the maximum of {0}.",p)})}function l(u){if(ee(t.minLength)&&mn(u.value)<t.minLength&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("String is shorter than the minimum length of {0}.",t.minLength)}),ee(t.maxLength)&&mn(u.value)>t.maxLength&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("String is longer than the maximum length of {0}.",t.maxLength)}),gn(t.pattern)){const d=ot(t.pattern);d!=null&&d.test(u.value)||n.problems.push({location:{offset:u.offset,length:u.length},message:t.patternErrorMessage||t.errorMessage||O('String does not match the pattern of "{0}".',t.pattern)})}if(t.format)switch(t.format){case"uri":case"uri-reference":{let g;if(!u.value)g=O("URI expected.");else{const h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(u.value);h?!h[2]&&t.format==="uri"&&(g=O("URI with a scheme is expected.")):g=O("URI is expected.")}g&&n.problems.push({location:{offset:u.offset,length:u.length},message:t.patternErrorMessage||t.errorMessage||O("String is not a URI: {0}",g)})}break;case"color-hex":case"date-time":case"date":case"time":case"email":case"hostname":case"ipv4":case"ipv6":const d=Gi[t.format];(!u.value||!d.pattern.exec(u.value))&&n.problems.push({location:{offset:u.offset,length:u.length},message:t.patternErrorMessage||t.errorMessage||d.errorMessage})}}function c(u){let d,g;i.schemaDraft>=ue.v2020_12?(d=t.prefixItems,g=Array.isArray(t.items)?void 0:t.items):(d=Array.isArray(t.items)?t.items:void 0,g=Array.isArray(t.items)?t.additionalItems:t.items);let h=0;if(d!==void 0){const w=Math.min(d.length,u.items.length);for(;h<w;h++){const j=d[h],p=se(j),N=new te,T=u.items[h];T&&(Q(T,p,N,r,i),n.mergePropertyMatch(N)),n.processedProperties.add(String(h))}}if(g!==void 0&&h<u.items.length)if(typeof g=="boolean")for(g===!1&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Array has too many items according to schema. Expected {0} or fewer.",h)});h<u.items.length;h++)n.processedProperties.add(String(h)),n.propertiesValueMatches++;else for(;h<u.items.length;h++){const w=new te;Q(u.items[h],g,w,r,i),n.mergePropertyMatch(w),n.processedProperties.add(String(h))}const b=se(t.contains);if(b){let w=0;for(let j=0;j<u.items.length;j++){const p=u.items[j],N=new te;Q(p,b,N,Ge.instance,i),N.hasProblems()||(w++,i.schemaDraft>=ue.v2020_12&&n.processedProperties.add(String(j)))}w===0&&!ee(t.minContains)&&n.problems.push({location:{offset:u.offset,length:u.length},message:t.errorMessage||O("Array does not contain required item.")}),ee(t.minContains)&&w<t.minContains&&n.problems.push({location:{offset:u.offset,length:u.length},message:t.errorMessage||O("Array has too few items that match the contains contraint. Expected {0} or more.",t.minContains)}),ee(t.maxContains)&&w>t.maxContains&&n.problems.push({location:{offset:u.offset,length:u.length},message:t.errorMessage||O("Array has too many items that match the contains contraint. Expected {0} or less.",t.maxContains)})}const m=t.unevaluatedItems;if(m!==void 0)for(let w=0;w<u.items.length;w++){if(!n.processedProperties.has(String(w)))if(m===!1)n.problems.push({location:{offset:u.offset,length:u.length},message:O("Item does not match any validation rule from the array.")});else{const j=new te;Q(u.items[w],t.unevaluatedItems,j,r,i),n.mergePropertyMatch(j)}n.processedProperties.add(String(w)),n.propertiesValueMatches++}if(ee(t.minItems)&&u.items.length<t.minItems&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Array has too few items. Expected {0} or more.",t.minItems)}),ee(t.maxItems)&&u.items.length>t.maxItems&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Array has too many items. Expected {0} or fewer.",t.maxItems)}),t.uniqueItems===!0){let j=function(){for(let p=0;p<w.length-1;p++){const N=w[p];for(let T=p+1;T<w.length;T++)if(Ee(N,w[T]))return!0}return!1};const w=Se(u);j()&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Array has duplicate items.")})}}function f(u){const d=Object.create(null),g=new Set;for(const p of u.properties){const N=p.keyNode.value;d[N]=p.valueNode,g.add(N)}if(Array.isArray(t.required)){for(const p of t.required)if(!d[p]){const N=u.parent&&u.parent.type==="property"&&u.parent.keyNode,T=N?{offset:N.offset,length:N.length}:{offset:u.offset,length:1};n.problems.push({location:T,message:O('Missing property "{0}".',p)})}}const h=p=>{g.delete(p),n.processedProperties.add(p)};if(t.properties)for(const p of Object.keys(t.properties)){h(p);const N=t.properties[p],T=d[p];if(T)if(le(N))if(N)n.propertiesMatches++,n.propertiesValueMatches++;else{const A=T.parent;n.problems.push({location:{offset:A.keyNode.offset,length:A.keyNode.length},message:t.errorMessage||O("Property {0} is not allowed.",p)})}else{const A=new te;Q(T,N,A,r,i),n.mergePropertyMatch(A)}}if(t.patternProperties)for(const p of Object.keys(t.patternProperties)){const N=ot(p);if(N){const T=[];for(const A of g)if(N.test(A)){T.push(A);const v=d[A];if(v){const $=t.patternProperties[p];if(le($))if($)n.propertiesMatches++,n.propertiesValueMatches++;else{const E=v.parent;n.problems.push({location:{offset:E.keyNode.offset,length:E.keyNode.length},message:t.errorMessage||O("Property {0} is not allowed.",A)})}else{const E=new te;Q(v,$,E,r,i),n.mergePropertyMatch(E)}}}T.forEach(h)}}const b=t.additionalProperties;if(b!==void 0)for(const p of g){h(p);const N=d[p];if(N){if(b===!1){const T=N.parent;n.problems.push({location:{offset:T.keyNode.offset,length:T.keyNode.length},message:t.errorMessage||O("Property {0} is not allowed.",p)})}else if(b!==!0){const T=new te;Q(N,b,T,r,i),n.mergePropertyMatch(T)}}}const m=t.unevaluatedProperties;if(m!==void 0){const p=[];for(const N of g)if(!n.processedProperties.has(N)){p.push(N);const T=d[N];if(T){if(m===!1){const A=T.parent;n.problems.push({location:{offset:A.keyNode.offset,length:A.keyNode.length},message:t.errorMessage||O("Property {0} is not allowed.",N)})}else if(m!==!0){const A=new te;Q(T,m,A,r,i),n.mergePropertyMatch(A)}}}p.forEach(h)}if(ee(t.maxProperties)&&u.properties.length>t.maxProperties&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Object has more properties than limit of {0}.",t.maxProperties)}),ee(t.minProperties)&&u.properties.length<t.minProperties&&n.problems.push({location:{offset:u.offset,length:u.length},message:O("Object has fewer properties than the required number of {0}",t.minProperties)}),t.dependentRequired)for(const p in t.dependentRequired){const N=d[p],T=t.dependentRequired[p];N&&Array.isArray(T)&&j(p,T)}if(t.dependentSchemas)for(const p in t.dependentSchemas){const N=d[p],T=t.dependentSchemas[p];N&&ve(T)&&j(p,T)}if(t.dependencies)for(const p in t.dependencies)d[p]&&j(p,t.dependencies[p]);const w=se(t.propertyNames);if(w)for(const p of u.properties){const N=p.keyNode;N&&Q(N,w,n,Ge.instance,i)}function j(p,N){if(Array.isArray(N))for(const T of N)d[T]?n.propertiesValueMatches++:n.problems.push({location:{offset:u.offset,length:u.length},message:O("Object is missing property {0} required by property {1}.",T,p)});else{const T=se(N);if(T){const A=new te;Q(u,T,A,r,i),n.mergePropertyMatch(A)}}}}}function ts(e,t){const n=[];let r=-1;const i=e.getText(),s=Oe(i,!1),o=t&&t.collectComments?[]:void 0;function a(){for(;;){const A=s.scan();switch(f(),A){case 12:case 13:Array.isArray(o)&&o.push(D.create(e.positionAt(s.getTokenOffset()),e.positionAt(s.getTokenOffset()+s.getTokenLength())));break;case 15:case 14:break;default:return A}}}function l(A,v,$,E,U=re.Error){if(n.length===0||$!==r){const S=D.create(e.positionAt($),e.positionAt(E));n.push(he.create(S,A,U,v,e.languageId)),r=$}}function c(A,v,$=void 0,E=[],U=[]){let S=s.getTokenOffset(),x=s.getTokenOffset()+s.getTokenLength();if(S===x&&S>0){for(S--;S>0&&/\s/.test(i.charAt(S));)S--;x=S+1}if(l(A,v,S,x),$&&u($,!1),E.length+U.length>0){let P=s.getToken();for(;P!==17;){if(E.indexOf(P)!==-1){a();break}else if(U.indexOf(P)!==-1)break;P=a()}}return $}function f(){switch(s.getTokenError()){case 4:return c(O("Invalid unicode sequence in string."),q.InvalidUnicode),!0;case 5:return c(O("Invalid escape character in string."),q.InvalidEscapeCharacter),!0;case 3:return c(O("Unexpected end of number."),q.UnexpectedEndOfNumber),!0;case 1:return c(O("Unexpected end of comment."),q.UnexpectedEndOfComment),!0;case 2:return c(O("Unexpected end of string."),q.UnexpectedEndOfString),!0;case 6:return c(O("Invalid characters in string. Control characters must be escaped."),q.InvalidCharacter),!0}return!1}function u(A,v){return A.length=s.getTokenOffset()+s.getTokenLength()-A.offset,v&&a(),A}function d(A){if(s.getToken()!==3)return;const v=new Xi(A,s.getTokenOffset());a();let $=!1;for(;s.getToken()!==4&&s.getToken()!==17;){if(s.getToken()===5){$||c(O("Value expected"),q.ValueExpected);const U=s.getTokenOffset();if(a(),s.getToken()===4){$&&l(O("Trailing comma"),q.TrailingComma,U,U+1);continue}}else $&&c(O("Expected comma"),q.CommaExpected);const E=p(v);E?v.items.push(E):c(O("Value expected"),q.ValueExpected,void 0,[],[4,5]),$=!0}return s.getToken()!==4?c(O("Expected comma or closing bracket"),q.CommaOrCloseBacketExpected,v):u(v,!0)}const g=new Vt(void 0,0,0);function h(A,v){const $=new Yi(A,s.getTokenOffset(),g);let E=m($);if(!E)if(s.getToken()===16){c(O("Property keys must be doublequoted"),q.PropertyKeysMustBeDoublequoted);const S=new Vt($,s.getTokenOffset(),s.getTokenLength());S.value=s.getTokenValue(),E=S,a()}else return;if($.keyNode=E,E.value!=="//"){const S=v[E.value];S?(l(O("Duplicate object key"),q.DuplicateKey,$.keyNode.offset,$.keyNode.offset+$.keyNode.length,re.Warning),ve(S)&&l(O("Duplicate object key"),q.DuplicateKey,S.keyNode.offset,S.keyNode.offset+S.keyNode.length,re.Warning),v[E.value]=!0):v[E.value]=$}if(s.getToken()===6)$.colonOffset=s.getTokenOffset(),a();else if(c(O("Colon expected"),q.ColonExpected),s.getToken()===10&&e.positionAt(E.offset+E.length).line<e.positionAt(s.getTokenOffset()).line)return $.length=E.length,$;const U=p($);return U?($.valueNode=U,$.length=U.offset+U.length-$.offset,$):c(O("Value expected"),q.ValueExpected,$,[],[2,5])}function b(A){if(s.getToken()!==1)return;const v=new Qi(A,s.getTokenOffset()),$=Object.create(null);a();let E=!1;for(;s.getToken()!==2&&s.getToken()!==17;){if(s.getToken()===5){E||c(O("Property expected"),q.PropertyExpected);const S=s.getTokenOffset();if(a(),s.getToken()===2){E&&l(O("Trailing comma"),q.TrailingComma,S,S+1);continue}}else E&&c(O("Expected comma"),q.CommaExpected);const U=h(v,$);U?v.properties.push(U):c(O("Property expected"),q.PropertyExpected,void 0,[],[2,5]),E=!0}return s.getToken()!==2?c(O("Expected comma or closing brace"),q.CommaOrCloseBraceExpected,v):u(v,!0)}function m(A){if(s.getToken()!==10)return;const v=new Vt(A,s.getTokenOffset());return v.value=s.getTokenValue(),u(v,!0)}function w(A){if(s.getToken()!==11)return;const v=new Zi(A,s.getTokenOffset());if(s.getTokenError()===0){const $=s.getTokenValue();try{const E=JSON.parse($);if(!ee(E))return c(O("Invalid number format."),q.Undefined,v);v.value=E}catch{return c(O("Invalid number format."),q.Undefined,v)}v.isInteger=$.indexOf(".")===-1}return u(v,!0)}function j(A){switch(s.getToken()){case 7:return u(new Hi(A,s.getTokenOffset()),!0);case 8:return u(new gr(A,!0,s.getTokenOffset()),!0);case 9:return u(new gr(A,!1,s.getTokenOffset()),!0);default:return}}function p(A){return d(A)||b(A)||m(A)||w(A)||j(A)}let N;return a()!==17&&(N=p(N),N?s.getToken()!==17&&c(O("End of file expected."),q.Undefined):c(O("Expected a JSON object, array or literal."),q.Undefined)),new vr(N,n,o)}function Ut(e,t,n){if(e!==null&&typeof e=="object"){const r=t+" ";if(Array.isArray(e)){if(e.length===0)return"[]";let i=`[
18
+ `;for(let s=0;s<e.length;s++)i+=r+Ut(e[s],r,n),s<e.length-1&&(i+=","),i+=`
19
+ `;return i+=t+"]",i}else{const i=Object.keys(e);if(i.length===0)return"{}";let s=`{
20
+ `;for(let o=0;o<i.length;o++){const a=i[o];s+=r+JSON.stringify(a)+": "+Ut(e[a],r,n),o<i.length-1&&(s+=","),s+=`
21
+ `}return s+=t+"}",s}}return n(e)}class ns{constructor(t,n=[],r=Promise,i={}){this.schemaService=t,this.contributions=n,this.promiseConstructor=r,this.clientCapabilities=i}doResolve(t){for(let n=this.contributions.length-1;n>=0;n--){const r=this.contributions[n].resolveCompletion;if(r){const i=r(t);if(i)return i}}return this.promiseConstructor.resolve(t)}doComplete(t,n,r){const i={items:[],isIncomplete:!1},s=t.getText(),o=t.offsetAt(n);let a=r.getNodeFromOffset(o,!0);if(this.isInComment(t,a?a.offset:0,o))return Promise.resolve(i);if(a&&o===a.offset+a.length&&o>0){const d=s[o-1];(a.type==="object"&&d==="}"||a.type==="array"&&d==="]")&&(a=a.parent)}const l=this.getCurrentWord(t,o);let c;if(a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null"))c=D.create(t.positionAt(a.offset),t.positionAt(a.offset+a.length));else{let d=o-l.length;d>0&&s[d-1]==='"'&&d--,c=D.create(t.positionAt(d),n)}const f=new Map,u={add:d=>{let g=d.label;const h=f.get(g);if(h)h.documentation||(h.documentation=d.documentation),h.detail||(h.detail=d.detail),h.labelDetails||(h.labelDetails=d.labelDetails);else{if(g=g.replace(/[\n]/g,"↵"),g.length>60){const b=g.substr(0,57).trim()+"...";f.has(b)||(g=b)}d.textEdit=fe.replace(c,d.insertText),d.label=g,f.set(g,d),i.items.push(d)}},setAsIncomplete:()=>{i.isIncomplete=!0},error:d=>{console.error(d)},getNumberOfProposals:()=>i.items.length};return this.schemaService.getSchemaForResource(t.uri,r).then(d=>{const g=[];let h=!0,b="",m;if(a&&a.type==="string"){const j=a.parent;j&&j.type==="property"&&j.keyNode===a&&(h=!j.valueNode,m=j,b=s.substr(a.offset+1,a.length-2),j&&(a=j.parent))}if(a&&a.type==="object"){if(a.offset===o)return i;a.properties.forEach(T=>{(!m||m!==T)&&f.set(T.keyNode.value,Pt.create("__"))});let p="";h&&(p=this.evaluateSeparatorAfter(t,t.offsetAt(c.end))),d?this.getPropertyCompletions(d,r,a,h,p,u):this.getSchemaLessPropertyCompletions(r,a,b,u);const N=Dt(a);this.contributions.forEach(T=>{const A=T.collectPropertyCompletions(t.uri,N,l,h,p==="",u);A&&g.push(A)}),!d&&l.length>0&&s.charAt(o-l.length-1)!=='"'&&(u.add({kind:ie.Property,label:this.getLabelForValue(l),insertText:this.getInsertTextForProperty(l,void 0,!1,p),insertTextFormat:Z.Snippet,documentation:""}),u.setAsIncomplete())}const w={};return d?this.getValueCompletions(d,r,a,o,t,u,w):this.getSchemaLessValueCompletions(r,a,o,t,u),this.contributions.length>0&&this.getContributedValueCompletions(r,a,o,t,u,g),this.promiseConstructor.all(g).then(()=>{if(u.getNumberOfProposals()===0){let j=o;a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null")&&(j=a.offset+a.length);const p=this.evaluateSeparatorAfter(t,j);this.addFillerValueCompletions(w,p,u)}return i})})}getPropertyCompletions(t,n,r,i,s,o){n.getMatchingSchemas(t.schema,r.offset).forEach(l=>{if(l.node===r&&!l.inverted){const c=l.schema.properties;c&&Object.keys(c).forEach(u=>{const d=c[u];if(typeof d=="object"&&!d.deprecationMessage&&!d.doNotSuggest){const g={kind:ie.Property,label:u,insertText:this.getInsertTextForProperty(u,d,i,s),insertTextFormat:Z.Snippet,filterText:this.getFilterTextForValue(u),documentation:this.fromMarkup(d.markdownDescription)||d.description||""};d.completionDetail!==void 0&&(g.detail=d.completionDetail),d.suggestSortText!==void 0&&(g.sortText=d.suggestSortText),g.insertText&&We(g.insertText,`$1${s}`)&&(g.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(g)}});const f=l.schema.propertyNames;if(typeof f=="object"&&!f.deprecationMessage&&!f.doNotSuggest){const u=(d,g=void 0)=>{const h={kind:ie.Property,label:d,insertText:this.getInsertTextForProperty(d,void 0,i,s),insertTextFormat:Z.Snippet,filterText:this.getFilterTextForValue(d),documentation:g||this.fromMarkup(f.markdownDescription)||f.description||""};f.completionDetail!==void 0&&(h.detail=f.completionDetail),f.suggestSortText!==void 0&&(h.sortText=f.suggestSortText),h.insertText&&We(h.insertText,`$1${s}`)&&(h.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(h)};if(f.enum)for(let d=0;d<f.enum.length;d++){let g;f.markdownEnumDescriptions&&d<f.markdownEnumDescriptions.length?g=this.fromMarkup(f.markdownEnumDescriptions[d]):f.enumDescriptions&&d<f.enumDescriptions.length&&(g=f.enumDescriptions[d]),u(f.enum[d],g)}f.const&&u(f.const)}}})}getSchemaLessPropertyCompletions(t,n,r,i){const s=o=>{o.properties.forEach(a=>{const l=a.keyNode.value;i.add({kind:ie.Property,label:l,insertText:this.getInsertTextForValue(l,""),insertTextFormat:Z.Snippet,filterText:this.getFilterTextForValue(l),documentation:""})})};if(n.parent)if(n.parent.type==="property"){const o=n.parent.keyNode.value;t.visit(a=>(a.type==="property"&&a!==n.parent&&a.keyNode.value===o&&a.valueNode&&a.valueNode.type==="object"&&s(a.valueNode),!0))}else n.parent.type==="array"&&n.parent.items.forEach(o=>{o.type==="object"&&o!==n&&s(o)});else n.type==="object"&&i.add({kind:ie.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",void 0,!0,""),insertTextFormat:Z.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})}getSchemaLessValueCompletions(t,n,r,i,s){let o=r;if(n&&(n.type==="string"||n.type==="number"||n.type==="boolean"||n.type==="null")&&(o=n.offset+n.length,n=n.parent),!n){s.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Z.Snippet,documentation:""}),s.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Z.Snippet,documentation:""});return}const a=this.evaluateSeparatorAfter(i,o),l=c=>{c.parent&&!br(c.parent,r,!0)&&s.add({kind:this.getSuggestionKind(c.type),label:this.getLabelTextForMatchingNode(c,i),insertText:this.getInsertTextForMatchingNode(c,i,a),insertTextFormat:Z.Snippet,documentation:""}),c.type==="boolean"&&this.addBooleanValueCompletion(!c.value,a,s)};if(n.type==="property"&&r>(n.colonOffset||0)){const c=n.valueNode;if(c&&(r>c.offset+c.length||c.type==="object"||c.type==="array"))return;const f=n.keyNode.value;t.visit(u=>(u.type==="property"&&u.keyNode.value===f&&u.valueNode&&l(u.valueNode),!0)),f==="$schema"&&n.parent&&!n.parent.parent&&this.addDollarSchemaCompletions(a,s)}if(n.type==="array")if(n.parent&&n.parent.type==="property"){const c=n.parent.keyNode.value;t.visit(f=>(f.type==="property"&&f.keyNode.value===c&&f.valueNode&&f.valueNode.type==="array"&&f.valueNode.items.forEach(l),!0))}else n.items.forEach(l)}getValueCompletions(t,n,r,i,s,o,a){let l=i,c,f;if(r&&(r.type==="string"||r.type==="number"||r.type==="boolean"||r.type==="null")&&(l=r.offset+r.length,f=r,r=r.parent),!r){this.addSchemaValueCompletions(t.schema,"",o,a);return}if(r.type==="property"&&i>(r.colonOffset||0)){const u=r.valueNode;if(u&&i>u.offset+u.length)return;c=r.keyNode.value,r=r.parent}if(r&&(c!==void 0||r.type==="array")){const u=this.evaluateSeparatorAfter(s,l),d=n.getMatchingSchemas(t.schema,r.offset,f);for(const g of d)if(g.node===r&&!g.inverted&&g.schema){if(r.type==="array"&&g.schema.items){let h=o;if(g.schema.uniqueItems){const b=new Set;r.children.forEach(m=>{m.type!=="array"&&m.type!=="object"&&b.add(this.getLabelForValue(Se(m)))}),h={...o,add(m){b.has(m.label)||o.add(m)}}}if(Array.isArray(g.schema.items)){const b=this.findItemAtOffset(r,s,i);b<g.schema.items.length&&this.addSchemaValueCompletions(g.schema.items[b],u,h,a)}else this.addSchemaValueCompletions(g.schema.items,u,h,a)}if(c!==void 0){let h=!1;if(g.schema.properties){const b=g.schema.properties[c];b&&(h=!0,this.addSchemaValueCompletions(b,u,o,a))}if(g.schema.patternProperties&&!h)for(const b of Object.keys(g.schema.patternProperties)){const m=ot(b);if(m!=null&&m.test(c)){h=!0;const w=g.schema.patternProperties[b];this.addSchemaValueCompletions(w,u,o,a)}}if(g.schema.additionalProperties&&!h){const b=g.schema.additionalProperties;this.addSchemaValueCompletions(b,u,o,a)}}}c==="$schema"&&!r.parent&&this.addDollarSchemaCompletions(u,o),a.boolean&&(this.addBooleanValueCompletion(!0,u,o),this.addBooleanValueCompletion(!1,u,o)),a.null&&this.addNullValueCompletion(u,o)}}getContributedValueCompletions(t,n,r,i,s,o){if(!n)this.contributions.forEach(a=>{const l=a.collectDefaultCompletions(i.uri,s);l&&o.push(l)});else if((n.type==="string"||n.type==="number"||n.type==="boolean"||n.type==="null")&&(n=n.parent),n&&n.type==="property"&&r>(n.colonOffset||0)){const a=n.keyNode.value,l=n.valueNode;if((!l||r<=l.offset+l.length)&&n.parent){const c=Dt(n.parent);this.contributions.forEach(f=>{const u=f.collectValueCompletions(i.uri,c,a,s);u&&o.push(u)})}}}addSchemaValueCompletions(t,n,r,i){typeof t=="object"&&(this.addEnumValueCompletions(t,n,r),this.addDefaultValueCompletions(t,n,r),this.collectTypes(t,i),Array.isArray(t.allOf)&&t.allOf.forEach(s=>this.addSchemaValueCompletions(s,n,r,i)),Array.isArray(t.anyOf)&&t.anyOf.forEach(s=>this.addSchemaValueCompletions(s,n,r,i)),Array.isArray(t.oneOf)&&t.oneOf.forEach(s=>this.addSchemaValueCompletions(s,n,r,i)))}addDefaultValueCompletions(t,n,r,i=0){let s=!1;if(ce(t.default)){let o=t.type,a=t.default;for(let c=i;c>0;c--)a=[a],o="array";const l={kind:this.getSuggestionKind(o),label:this.getLabelForValue(a),insertText:this.getInsertTextForValue(a,n),insertTextFormat:Z.Snippet};this.doesSupportsLabelDetails()?l.labelDetails={description:O("Default value")}:l.detail=O("Default value"),r.add(l),s=!0}Array.isArray(t.examples)&&t.examples.forEach(o=>{let a=t.type,l=o;for(let c=i;c>0;c--)l=[l],a="array";r.add({kind:this.getSuggestionKind(a),label:this.getLabelForValue(l),insertText:this.getInsertTextForValue(l,n),insertTextFormat:Z.Snippet}),s=!0}),Array.isArray(t.defaultSnippets)&&t.defaultSnippets.forEach(o=>{let a=t.type,l=o.body,c=o.label,f,u;if(ce(l)){t.type;for(let d=i;d>0;d--)l=[l];f=this.getInsertTextForSnippetValue(l,n),u=this.getFilterTextForSnippetValue(l),c=c||this.getLabelForSnippetValue(l)}else if(typeof o.bodyText=="string"){let d="",g="",h="";for(let b=i;b>0;b--)d=d+h+`[
22
+ `,g=g+`
23
+ `+h+"]",h+=" ",a="array";f=d+h+o.bodyText.split(`
24
+ `).join(`
25
+ `+h)+g+n,c=c||f,u=f.replace(/[\n]/g,"")}else return;r.add({kind:this.getSuggestionKind(a),label:c,documentation:this.fromMarkup(o.markdownDescription)||o.description,insertText:f,insertTextFormat:Z.Snippet,filterText:u}),s=!0}),!s&&typeof t.items=="object"&&!Array.isArray(t.items)&&i<5&&this.addDefaultValueCompletions(t.items,n,r,i+1)}addEnumValueCompletions(t,n,r){if(ce(t.const)&&r.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(t.const),insertText:this.getInsertTextForValue(t.const,n),insertTextFormat:Z.Snippet,documentation:this.fromMarkup(t.markdownDescription)||t.description}),Array.isArray(t.enum))for(let i=0,s=t.enum.length;i<s;i++){const o=t.enum[i];let a=this.fromMarkup(t.markdownDescription)||t.description;t.markdownEnumDescriptions&&i<t.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?a=this.fromMarkup(t.markdownEnumDescriptions[i]):t.enumDescriptions&&i<t.enumDescriptions.length&&(a=t.enumDescriptions[i]),r.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(o),insertText:this.getInsertTextForValue(o,n),insertTextFormat:Z.Snippet,documentation:a})}}collectTypes(t,n){if(Array.isArray(t.enum)||ce(t.const))return;const r=t.type;Array.isArray(r)?r.forEach(i=>n[i]=!0):r&&(n[r]=!0)}addFillerValueCompletions(t,n,r){t.object&&r.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},n),insertTextFormat:Z.Snippet,detail:O("New object"),documentation:""}),t.array&&r.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],n),insertTextFormat:Z.Snippet,detail:O("New array"),documentation:""})}addBooleanValueCompletion(t,n,r){r.add({kind:this.getSuggestionKind("boolean"),label:t?"true":"false",insertText:this.getInsertTextForValue(t,n),insertTextFormat:Z.Snippet,documentation:""})}addNullValueCompletion(t,n){n.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+t,insertTextFormat:Z.Snippet,documentation:""})}addDollarSchemaCompletions(t,n){this.schemaService.getRegisteredSchemaIds(i=>i==="http"||i==="https").forEach(i=>{i.startsWith("http://json-schema.org/draft-")&&(i=i+"#"),n.add({kind:ie.Module,label:this.getLabelForValue(i),filterText:this.getFilterTextForValue(i),insertText:this.getInsertTextForValue(i,t),insertTextFormat:Z.Snippet,documentation:""})})}getLabelForValue(t){return JSON.stringify(t)}getValueFromLabel(t){return JSON.parse(t)}getFilterTextForValue(t){return JSON.stringify(t)}getFilterTextForSnippetValue(t){return JSON.stringify(t).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")}getLabelForSnippetValue(t){return JSON.stringify(t).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")}getInsertTextForPlainText(t){return t.replace(/[\\\$\}]/g,"\\$&")}getInsertTextForValue(t,n){const r=JSON.stringify(t,null," ");return r==="{}"?"{$1}"+n:r==="[]"?"[$1]"+n:this.getInsertTextForPlainText(r+n)}getInsertTextForSnippetValue(t,n){return Ut(t,"",i=>typeof i=="string"&&i[0]==="^"?i.substr(1):JSON.stringify(i))+n}getInsertTextForGuessedValue(t,n){switch(typeof t){case"object":return t===null?"${1:null}"+n:this.getInsertTextForValue(t,n);case"string":let r=JSON.stringify(t);return r=r.substr(1,r.length-2),r=this.getInsertTextForPlainText(r),'"${1:'+r+'}"'+n;case"number":case"boolean":return"${1:"+JSON.stringify(t)+"}"+n}return this.getInsertTextForValue(t,n)}getSuggestionKind(t){if(Array.isArray(t)){const n=t;t=n.length>0?n[0]:void 0}if(!t)return ie.Value;switch(t){case"string":return ie.Value;case"object":return ie.Module;case"property":return ie.Property;default:return ie.Value}}getLabelTextForMatchingNode(t,n){switch(t.type){case"array":return"[]";case"object":return"{}";default:return n.getText().substr(t.offset,t.length)}}getInsertTextForMatchingNode(t,n,r){switch(t.type){case"array":return this.getInsertTextForValue([],r);case"object":return this.getInsertTextForValue({},r);default:const i=n.getText().substr(t.offset,t.length)+r;return this.getInsertTextForPlainText(i)}}getInsertTextForProperty(t,n,r,i){const s=this.getInsertTextForValue(t,"");if(!r)return s;const o=s+": ";let a,l=0;if(n){if(Array.isArray(n.defaultSnippets)){if(n.defaultSnippets.length===1){const c=n.defaultSnippets[0].body;ce(c)&&(a=this.getInsertTextForSnippetValue(c,""))}l+=n.defaultSnippets.length}if(n.enum&&(!a&&n.enum.length===1&&(a=this.getInsertTextForGuessedValue(n.enum[0],"")),l+=n.enum.length),ce(n.const)&&(a||(a=this.getInsertTextForGuessedValue(n.const,"")),l++),ce(n.default)&&(a||(a=this.getInsertTextForGuessedValue(n.default,"")),l++),Array.isArray(n.examples)&&n.examples.length&&(a||(a=this.getInsertTextForGuessedValue(n.examples[0],"")),l+=n.examples.length),l===0){let c=Array.isArray(n.type)?n.type[0]:n.type;switch(c||(n.properties?c="object":n.items&&(c="array")),c){case"boolean":a="$1";break;case"string":a='"$1"';break;case"object":a="{$1}";break;case"array":a="[$1]";break;case"number":case"integer":a="${1:0}";break;case"null":a="${1:null}";break;default:return s}}}return(!a||l>1)&&(a="$1"),o+a+i}getCurrentWord(t,n){let r=n-1;const i=t.getText();for(;r>=0&&`
26
+ \r\v":{[,]}`.indexOf(i.charAt(r))===-1;)r--;return i.substring(r+1,n)}evaluateSeparatorAfter(t,n){const r=Oe(t.getText(),!0);switch(r.setPosition(n),r.scan()){case 5:case 2:case 4:case 17:return"";default:return","}}findItemAtOffset(t,n,r){const i=Oe(n.getText(),!0),s=t.items;for(let o=s.length-1;o>=0;o--){const a=s[o];if(r>a.offset+a.length)return i.setPosition(a.offset+a.length),i.scan()===5&&r>=i.getTokenOffset()+i.getTokenLength()?o+1:o;if(r>=a.offset)return o}return 0}isInComment(t,n,r){const i=Oe(t.getText(),!1);i.setPosition(n);let s=i.scan();for(;s!==17&&i.getTokenOffset()+i.getTokenLength()<r;)s=i.scan();return(s===12||s===13)&&i.getTokenOffset()<=r}fromMarkup(t){if(t&&this.doesSupportMarkdown())return{kind:Ne.Markdown,value:t}}doesSupportMarkdown(){var t,n,r;if(!ce(this.supportsMarkdown)){const i=(r=(n=(t=this.clientCapabilities.textDocument)==null?void 0:t.completion)==null?void 0:n.completionItem)==null?void 0:r.documentationFormat;this.supportsMarkdown=Array.isArray(i)&&i.indexOf(Ne.Markdown)!==-1}return this.supportsMarkdown}doesSupportsCommitCharacters(){var t,n,r;return ce(this.supportsCommitCharacters)||(this.labelDetailsSupport=(r=(n=(t=this.clientCapabilities.textDocument)==null?void 0:t.completion)==null?void 0:n.completionItem)==null?void 0:r.commitCharactersSupport),this.supportsCommitCharacters}doesSupportsLabelDetails(){var t,n,r;return ce(this.labelDetailsSupport)||(this.labelDetailsSupport=(r=(n=(t=this.clientCapabilities.textDocument)==null?void 0:t.completion)==null?void 0:n.completionItem)==null?void 0:r.labelDetailsSupport),this.labelDetailsSupport}}class rs{constructor(t,n=[],r){this.schemaService=t,this.contributions=n,this.promise=r||Promise}doHover(t,n,r){const i=t.offsetAt(n);let s=r.getNodeFromOffset(i);if(!s||(s.type==="object"||s.type==="array")&&i>s.offset+1&&i<s.offset+s.length-1)return this.promise.resolve(null);const o=s;if(s.type==="string"){const f=s.parent;if(f&&f.type==="property"&&f.keyNode===s&&(s=f.valueNode,!s))return this.promise.resolve(null)}const a=D.create(t.positionAt(o.offset),t.positionAt(o.offset+o.length)),l=f=>({contents:f,range:a}),c=Dt(s);for(let f=this.contributions.length-1;f>=0;f--){const d=this.contributions[f].getInfoContribution(t.uri,c);if(d)return d.then(g=>l(g))}return this.schemaService.getSchemaForResource(t.uri,r).then(f=>{if(f&&s){const u=r.getMatchingSchemas(f.schema,s.offset);let d,g,h,b;u.every(w=>{if(w.node===s&&!w.inverted&&w.schema&&(d=d||w.schema.title,g=g||w.schema.markdownDescription||Rt(w.schema.description),w.schema.enum)){const j=w.schema.enum.indexOf(Se(s));w.schema.markdownEnumDescriptions?h=w.schema.markdownEnumDescriptions[j]:w.schema.enumDescriptions&&(h=Rt(w.schema.enumDescriptions[j])),h&&(b=w.schema.enum[j],typeof b!="string"&&(b=JSON.stringify(b)))}return!0});let m="";return d&&(m=Rt(d)),g&&(m.length>0&&(m+=`
27
+
28
+ `),m+=g),h&&(m.length>0&&(m+=`
29
+
30
+ `),m+=`\`${is(b)}\`: ${h}`),l([m])}return null})}}function Rt(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
31
+
32
+ $3`).replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function is(e){return e.indexOf("`")!==-1?"`` "+e+" ``":e}class ss{constructor(t,n){this.jsonSchemaService=t,this.promise=n,this.validationEnabled=!0}configure(t){t&&(this.validationEnabled=t.validate!==!1,this.commentSeverity=t.allowComments?void 0:re.Error)}doValidation(t,n,r,i){if(!this.validationEnabled)return this.promise.resolve([]);const s=[],o={},a=c=>{const f=c.range.start.line+" "+c.range.start.character+" "+c.message;o[f]||(o[f]=!0,s.push(c))},l=c=>{let f=r!=null&&r.trailingCommas?ft(r.trailingCommas):re.Error,u=r!=null&&r.comments?ft(r.comments):this.commentSeverity,d=r!=null&&r.schemaValidation?ft(r.schemaValidation):re.Warning,g=r!=null&&r.schemaRequest?ft(r.schemaRequest):re.Warning;if(c){const h=(b,m)=>{if(n.root&&g){const w=n.root,j=w.type==="object"?w.properties[0]:void 0;if(j&&j.keyNode.value==="$schema"){const p=j.valueNode||j,N=D.create(t.positionAt(p.offset),t.positionAt(p.offset+p.length));a(he.create(N,b,g,m))}else{const p=D.create(t.positionAt(w.offset),t.positionAt(w.offset+1));a(he.create(p,b,g,m))}}};if(c.errors.length)h(c.errors[0],q.SchemaResolveError);else if(d){for(const m of c.warnings)h(m,q.SchemaUnsupportedFeature);const b=n.validate(t,c.schema,d,r==null?void 0:r.schemaDraft);b&&b.forEach(a)}kr(c.schema)&&(u=void 0),Tr(c.schema)&&(f=void 0)}for(const h of n.syntaxErrors){if(h.code===q.TrailingComma){if(typeof f!="number")continue;h.severity=f}a(h)}if(typeof u=="number"){const h=O("Comments are not permitted in JSON.");n.comments.forEach(b=>{a(he.create(b,h,u,q.CommentNotPermitted))})}return s};if(i){const c=i.id||"schemaservice://untitled/"+os++;return this.jsonSchemaService.registerExternalSchema({uri:c,schema:i}).getResolvedSchema().then(u=>l(u))}return this.jsonSchemaService.getSchemaForResource(t.uri,n).then(c=>l(c))}getLanguageStatus(t,n){return{schemas:this.jsonSchemaService.getSchemaURIsForResource(t.uri,n)}}}let os=0;function kr(e){if(e&&typeof e=="object"){if(le(e.allowComments))return e.allowComments;if(e.allOf)for(const t of e.allOf){const n=kr(t);if(le(n))return n}}}function Tr(e){if(e&&typeof e=="object"){if(le(e.allowTrailingCommas))return e.allowTrailingCommas;const t=e;if(le(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(e.allOf)for(const n of e.allOf){const r=Tr(n);if(le(r))return r}}}function ft(e){switch(e){case"error":return re.Error;case"warning":return re.Warning;case"ignore":return}}const wr=48,as=57,cs=65,dt=97,us=102;function X(e){return e<wr?0:e<=as?e-wr:(e<dt&&(e+=dt-cs),e>=dt&&e<=us?e-dt+10:0)}function ls(e){if(e[0]==="#")switch(e.length){case 4:return{red:X(e.charCodeAt(1))*17/255,green:X(e.charCodeAt(2))*17/255,blue:X(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:X(e.charCodeAt(1))*17/255,green:X(e.charCodeAt(2))*17/255,blue:X(e.charCodeAt(3))*17/255,alpha:X(e.charCodeAt(4))*17/255};case 7:return{red:(X(e.charCodeAt(1))*16+X(e.charCodeAt(2)))/255,green:(X(e.charCodeAt(3))*16+X(e.charCodeAt(4)))/255,blue:(X(e.charCodeAt(5))*16+X(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(X(e.charCodeAt(1))*16+X(e.charCodeAt(2)))/255,green:(X(e.charCodeAt(3))*16+X(e.charCodeAt(4)))/255,blue:(X(e.charCodeAt(5))*16+X(e.charCodeAt(6)))/255,alpha:(X(e.charCodeAt(7))*16+X(e.charCodeAt(8)))/255}}}class fs{constructor(t){this.schemaService=t}findDocumentSymbols(t,n,r={resultLimit:Number.MAX_VALUE}){const i=n.root;if(!i)return[];let s=r.resultLimit||Number.MAX_VALUE;const o=t.uri;if((o==="vscode://defaultsettings/keybindings.json"||We(o.toLowerCase(),"/user/keybindings.json"))&&i.type==="array"){const d=[];for(const g of i.items)if(g.type==="object"){for(const h of g.properties)if(h.keyNode.value==="key"&&h.valueNode){const b=Me.create(t.uri,Ae(t,g));if(d.push({name:Or(h.valueNode),kind:de.Function,location:b}),s--,s<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(o),d}}return d}const a=[{node:i,containerName:""}];let l=0,c=!1;const f=[],u=(d,g)=>{d.type==="array"?d.items.forEach(h=>{h&&a.push({node:h,containerName:g})}):d.type==="object"&&d.properties.forEach(h=>{const b=h.valueNode;if(b)if(s>0){s--;const m=Me.create(t.uri,Ae(t,h)),w=g?g+"."+h.keyNode.value:h.keyNode.value;f.push({name:this.getKeyLabel(h),kind:this.getSymbolKind(b.type),location:m,containerName:g}),a.push({node:b,containerName:w})}else c=!0})};for(;l<a.length;){const d=a[l++];u(d.node,d.containerName)}return c&&r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(o),f}findDocumentSymbols2(t,n,r={resultLimit:Number.MAX_VALUE}){const i=n.root;if(!i)return[];let s=r.resultLimit||Number.MAX_VALUE;const o=t.uri;if((o==="vscode://defaultsettings/keybindings.json"||We(o.toLowerCase(),"/user/keybindings.json"))&&i.type==="array"){const d=[];for(const g of i.items)if(g.type==="object"){for(const h of g.properties)if(h.keyNode.value==="key"&&h.valueNode){const b=Ae(t,g),m=Ae(t,h.keyNode);if(d.push({name:Or(h.valueNode),kind:de.Function,range:b,selectionRange:m}),s--,s<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(o),d}}return d}const a=[],l=[{node:i,result:a}];let c=0,f=!1;const u=(d,g)=>{d.type==="array"?d.items.forEach((h,b)=>{if(h)if(s>0){s--;const m=Ae(t,h),w=m,p={name:String(b),kind:this.getSymbolKind(h.type),range:m,selectionRange:w,children:[]};g.push(p),l.push({result:p.children,node:h})}else f=!0}):d.type==="object"&&d.properties.forEach(h=>{const b=h.valueNode;if(b)if(s>0){s--;const m=Ae(t,h),w=Ae(t,h.keyNode),j=[],p={name:this.getKeyLabel(h),kind:this.getSymbolKind(b.type),range:m,selectionRange:w,children:j,detail:this.getDetail(b)};g.push(p),l.push({result:j,node:b})}else f=!0})};for(;c<l.length;){const d=l[c++];u(d.node,d.result)}return f&&r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(o),a}getSymbolKind(t){switch(t){case"object":return de.Module;case"string":return de.String;case"number":return de.Number;case"array":return de.Array;case"boolean":return de.Boolean;default:return de.Variable}}getKeyLabel(t){let n=t.keyNode.value;return n&&(n=n.replace(/[\n]/g,"↵")),n&&n.trim()?n:`"${n}"`}getDetail(t){if(t){if(t.type==="boolean"||t.type==="number"||t.type==="null"||t.type==="string")return String(t.value);if(t.type==="array")return t.children.length?void 0:"[]";if(t.type==="object")return t.children.length?void 0:"{}"}}findDocumentColors(t,n,r){return this.schemaService.getSchemaForResource(t.uri,n).then(i=>{const s=[];if(i){let o=r&&typeof r.resultLimit=="number"?r.resultLimit:Number.MAX_VALUE;const a=n.getMatchingSchemas(i.schema),l={};for(const c of a)if(!c.inverted&&c.schema&&(c.schema.format==="color"||c.schema.format==="color-hex")&&c.node&&c.node.type==="string"){const f=String(c.node.offset);if(!l[f]){const u=ls(Se(c.node));if(u){const d=Ae(t,c.node);s.push({color:u,range:d})}if(l[f]=!0,o--,o<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(t.uri),s}}}return s})}getColorPresentations(t,n,r,i){const s=[],o=Math.round(r.red*255),a=Math.round(r.green*255),l=Math.round(r.blue*255);function c(u){const d=u.toString(16);return d.length!==2?"0"+d:d}let f;return r.alpha===1?f=`#${c(o)}${c(a)}${c(l)}`:f=`#${c(o)}${c(a)}${c(l)}${c(Math.round(r.alpha*255))}`,s.push({label:f,textEdit:fe.replace(i,JSON.stringify(f))}),s}}function Ae(e,t){return D.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}function Or(e){return Se(e)||O("<empty>")}const Bt={schemaAssociations:[],schemas:{"http://json-schema.org/draft-04/schema#":{$schema:"http://json-schema.org/draft-04/schema#",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{type:"string",enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{allOf:[{$ref:"#/definitions/positiveInteger"}]},minLength:{allOf:[{$ref:"#/definitions/positiveIntegerDefault0"}]},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{allOf:[{$ref:"#/definitions/positiveInteger"}]},minItems:{allOf:[{$ref:"#/definitions/positiveIntegerDefault0"}]},uniqueItems:{type:"boolean",default:!1},maxProperties:{allOf:[{$ref:"#/definitions/positiveInteger"}]},minProperties:{allOf:[{$ref:"#/definitions/positiveIntegerDefault0"}]},required:{allOf:[{$ref:"#/definitions/stringArray"}]},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{anyOf:[{type:"string",enum:["date-time","uri","email","hostname","ipv4","ipv6","regex"]},{type:"string"}]},allOf:{allOf:[{$ref:"#/definitions/schemaArray"}]},anyOf:{allOf:[{$ref:"#/definitions/schemaArray"}]},oneOf:{allOf:[{$ref:"#/definitions/schemaArray"}]},not:{allOf:[{$ref:"#"}]}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}},"http://json-schema.org/draft-07/schema#":{definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}},ds={id:O("A unique identifier for the schema."),$schema:O("The schema to verify this document against."),title:O("A descriptive title of the schema."),description:O("A long description of the schema. Used in hover menus and suggestions."),default:O("A default value. Used by suggestions."),multipleOf:O("A number that should cleanly divide the current value (i.e. have no remainder)."),maximum:O("The maximum numerical value, inclusive by default."),exclusiveMaximum:O("Makes the maximum property exclusive."),minimum:O("The minimum numerical value, inclusive by default."),exclusiveMinimum:O("Makes the minimum property exclusive."),maxLength:O("The maximum length of a string."),minLength:O("The minimum length of a string."),pattern:O("A regular expression to match the string against. It is not implicitly anchored."),additionalItems:O("For arrays, only when items is set as an array. If items are a schema, this schema validates items after the ones specified by the items schema. If false, additional items will cause validation to fail."),items:O("For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on."),maxItems:O("The maximum number of items that can be inside an array. Inclusive."),minItems:O("The minimum number of items that can be inside an array. Inclusive."),uniqueItems:O("If all of the items in the array must be unique. Defaults to false."),maxProperties:O("The maximum number of properties an object can have. Inclusive."),minProperties:O("The minimum number of properties an object can have. Inclusive."),required:O("An array of strings that lists the names of all properties required on this object."),additionalProperties:O("Either a schema or a boolean. If a schema, used to validate all properties not matched by 'properties', 'propertyNames', or 'patternProperties'. If false, any properties not defined by the adajacent keywords will cause this schema to fail."),definitions:O("Not used for validation. Place subschemas here that you wish to reference inline with $ref."),properties:O("A map of property names to schemas for each property."),patternProperties:O("A map of regular expressions on property names to schemas for matching properties."),dependencies:O("A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object."),enum:O("The set of literal values that are valid."),type:O("Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types."),format:O("Describes the format expected for the value. By default, not used for validation"),allOf:O("An array of schemas, all of which must match."),anyOf:O("An array of schemas, where at least one must match."),oneOf:O("An array of schemas, exactly one of which must match."),not:O("A schema which must not match."),$id:O("A unique identifier for the schema."),$ref:O("Reference a definition hosted on any location."),$comment:O("Comments from schema authors to readers or maintainers of the schema."),readOnly:O("Indicates that the value of the instance is managed exclusively by the owning authority."),examples:O("Sample JSON values associated with a particular schema, for the purpose of illustrating usage."),contains:O('An array instance is valid against "contains" if at least one of its elements is valid against the given schema.'),propertyNames:O("If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema."),const:O("An instance validates successfully against this keyword if its value is equal to the value of the keyword."),contentMediaType:O("Describes the media type of a string property."),contentEncoding:O("Describes the content encoding of a string property."),if:O('The validation outcome of the "if" subschema controls which of the "then" or "else" keywords are evaluated.'),then:O('The "then" subschema is used for validation when the "if" subschema succeeds.'),else:O('The "else" subschema is used for validation when the "if" subschema fails.')};for(const e in Bt.schemas){const t=Bt.schemas[e];for(const n in t.properties){let r=t.properties[n];typeof r=="boolean"&&(r=t.properties[n]={});const i=ds[n];i&&(r.description=i)}}var Nr;(()=>{var e={975:S=>{function x(k){if(typeof k!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(k))}function P(k,L){for(var _,M="",F=0,V=-1,R=0,B=0;B<=k.length;++B){if(B<k.length)_=k.charCodeAt(B);else{if(_===47)break;_=47}if(_===47){if(!(V===B-1||R===1))if(V!==B-1&&R===2){if(M.length<2||F!==2||M.charCodeAt(M.length-1)!==46||M.charCodeAt(M.length-2)!==46){if(M.length>2){var ne=M.lastIndexOf("/");if(ne!==M.length-1){ne===-1?(M="",F=0):F=(M=M.slice(0,ne)).length-1-M.lastIndexOf("/"),V=B,R=0;continue}}else if(M.length===2||M.length===1){M="",F=0,V=B,R=0;continue}}L&&(M.length>0?M+="/..":M="..",F=2)}else M.length>0?M+="/"+k.slice(V+1,B):M=k.slice(V+1,B),F=B-V-1;V=B,R=0}else _===46&&R!==-1?++R:R=-1}return M}var I={resolve:function(){for(var k,L="",_=!1,M=arguments.length-1;M>=-1&&!_;M--){var F;M>=0?F=arguments[M]:(k===void 0&&(k=process.cwd()),F=k),x(F),F.length!==0&&(L=F+"/"+L,_=F.charCodeAt(0)===47)}return L=P(L,!_),_?L.length>0?"/"+L:"/":L.length>0?L:"."},normalize:function(k){if(x(k),k.length===0)return".";var L=k.charCodeAt(0)===47,_=k.charCodeAt(k.length-1)===47;return(k=P(k,!L)).length!==0||L||(k="."),k.length>0&&_&&(k+="/"),L?"/"+k:k},isAbsolute:function(k){return x(k),k.length>0&&k.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var k,L=0;L<arguments.length;++L){var _=arguments[L];x(_),_.length>0&&(k===void 0?k=_:k+="/"+_)}return k===void 0?".":I.normalize(k)},relative:function(k,L){if(x(k),x(L),k===L||(k=I.resolve(k))===(L=I.resolve(L)))return"";for(var _=1;_<k.length&&k.charCodeAt(_)===47;++_);for(var M=k.length,F=M-_,V=1;V<L.length&&L.charCodeAt(V)===47;++V);for(var R=L.length-V,B=F<R?F:R,ne=-1,G=0;G<=B;++G){if(G===B){if(R>B){if(L.charCodeAt(V+G)===47)return L.slice(V+G+1);if(G===0)return L.slice(V+G)}else F>B&&(k.charCodeAt(_+G)===47?ne=G:G===0&&(ne=0));break}var Te=k.charCodeAt(_+G);if(Te!==L.charCodeAt(V+G))break;Te===47&&(ne=G)}var it="";for(G=_+ne+1;G<=M;++G)G!==M&&k.charCodeAt(G)!==47||(it.length===0?it+="..":it+="/..");return it.length>0?it+L.slice(V+ne):(V+=ne,L.charCodeAt(V)===47&&++V,L.slice(V))},_makeLong:function(k){return k},dirname:function(k){if(x(k),k.length===0)return".";for(var L=k.charCodeAt(0),_=L===47,M=-1,F=!0,V=k.length-1;V>=1;--V)if((L=k.charCodeAt(V))===47){if(!F){M=V;break}}else F=!1;return M===-1?_?"/":".":_&&M===1?"//":k.slice(0,M)},basename:function(k,L){if(L!==void 0&&typeof L!="string")throw new TypeError('"ext" argument must be a string');x(k);var _,M=0,F=-1,V=!0;if(L!==void 0&&L.length>0&&L.length<=k.length){if(L.length===k.length&&L===k)return"";var R=L.length-1,B=-1;for(_=k.length-1;_>=0;--_){var ne=k.charCodeAt(_);if(ne===47){if(!V){M=_+1;break}}else B===-1&&(V=!1,B=_+1),R>=0&&(ne===L.charCodeAt(R)?--R==-1&&(F=_):(R=-1,F=B))}return M===F?F=B:F===-1&&(F=k.length),k.slice(M,F)}for(_=k.length-1;_>=0;--_)if(k.charCodeAt(_)===47){if(!V){M=_+1;break}}else F===-1&&(V=!1,F=_+1);return F===-1?"":k.slice(M,F)},extname:function(k){x(k);for(var L=-1,_=0,M=-1,F=!0,V=0,R=k.length-1;R>=0;--R){var B=k.charCodeAt(R);if(B!==47)M===-1&&(F=!1,M=R+1),B===46?L===-1?L=R:V!==1&&(V=1):L!==-1&&(V=-1);else if(!F){_=R+1;break}}return L===-1||M===-1||V===0||V===1&&L===M-1&&L===_+1?"":k.slice(L,M)},format:function(k){if(k===null||typeof k!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof k);return function(L,_){var M=_.dir||_.root,F=_.base||(_.name||"")+(_.ext||"");return M?M===_.root?M+F:M+"/"+F:F}(0,k)},parse:function(k){x(k);var L={root:"",dir:"",base:"",ext:"",name:""};if(k.length===0)return L;var _,M=k.charCodeAt(0),F=M===47;F?(L.root="/",_=1):_=0;for(var V=-1,R=0,B=-1,ne=!0,G=k.length-1,Te=0;G>=_;--G)if((M=k.charCodeAt(G))!==47)B===-1&&(ne=!1,B=G+1),M===46?V===-1?V=G:Te!==1&&(Te=1):V!==-1&&(Te=-1);else if(!ne){R=G+1;break}return V===-1||B===-1||Te===0||Te===1&&V===B-1&&V===R+1?B!==-1&&(L.base=L.name=R===0&&F?k.slice(1,B):k.slice(R,B)):(R===0&&F?(L.name=k.slice(1,V),L.base=k.slice(1,B)):(L.name=k.slice(R,V),L.base=k.slice(R,B)),L.ext=k.slice(V,B)),R>0?L.dir=k.slice(0,R-1):F&&(L.dir="/"),L},sep:"/",delimiter:":",win32:null,posix:null};I.posix=I,S.exports=I}},t={};function n(S){var x=t[S];if(x!==void 0)return x.exports;var P=t[S]={exports:{}};return e[S](P,P.exports,n),P.exports}n.d=(S,x)=>{for(var P in x)n.o(x,P)&&!n.o(S,P)&&Object.defineProperty(S,P,{enumerable:!0,get:x[P]})},n.o=(S,x)=>Object.prototype.hasOwnProperty.call(S,x),n.r=S=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>d,Utils:()=>U}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function l(S,x){if(!S.scheme&&x)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${S.authority}", path: "${S.path}", query: "${S.query}", fragment: "${S.fragment}"}`);if(S.scheme&&!s.test(S.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(S.path){if(S.authority){if(!o.test(S.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(a.test(S.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",f="/",u=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(x,P,I,k,L,_=!1){we(this,"scheme");we(this,"authority");we(this,"path");we(this,"query");we(this,"fragment");typeof x=="object"?(this.scheme=x.scheme||c,this.authority=x.authority||c,this.path=x.path||c,this.query=x.query||c,this.fragment=x.fragment||c):(this.scheme=function(M,F){return M||F?M:"file"}(x,_),this.authority=P||c,this.path=function(M,F){switch(M){case"https":case"http":case"file":F?F[0]!==f&&(F=f+F):F=f}return F}(this.scheme,I||c),this.query=k||c,this.fragment=L||c,l(this,_))}static isUri(x){return x instanceof d||!!x&&typeof x.authority=="string"&&typeof x.fragment=="string"&&typeof x.path=="string"&&typeof x.query=="string"&&typeof x.scheme=="string"&&typeof x.fsPath=="string"&&typeof x.with=="function"&&typeof x.toString=="function"}get fsPath(){return j(this)}with(x){if(!x)return this;let{scheme:P,authority:I,path:k,query:L,fragment:_}=x;return P===void 0?P=this.scheme:P===null&&(P=c),I===void 0?I=this.authority:I===null&&(I=c),k===void 0?k=this.path:k===null&&(k=c),L===void 0?L=this.query:L===null&&(L=c),_===void 0?_=this.fragment:_===null&&(_=c),P===this.scheme&&I===this.authority&&k===this.path&&L===this.query&&_===this.fragment?this:new h(P,I,k,L,_)}static parse(x,P=!1){const I=u.exec(x);return I?new h(I[2]||c,A(I[4]||c),A(I[5]||c),A(I[7]||c),A(I[9]||c),P):new h(c,c,c,c,c)}static file(x){let P=c;if(i&&(x=x.replace(/\\/g,f)),x[0]===f&&x[1]===f){const I=x.indexOf(f,2);I===-1?(P=x.substring(2),x=f):(P=x.substring(2,I),x=x.substring(I)||f)}return new h("file",P,x,c,c)}static from(x){const P=new h(x.scheme,x.authority,x.path,x.query,x.fragment);return l(P,!0),P}toString(x=!1){return p(this,x)}toJSON(){return this}static revive(x){if(x){if(x instanceof d)return x;{const P=new h(x);return P._formatted=x.external,P._fsPath=x._sep===g?x.fsPath:null,P}}return x}}const g=i?1:void 0;class h extends d{constructor(){super(...arguments);we(this,"_formatted",null);we(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=j(this)),this._fsPath}toString(P=!1){return P?p(this,!0):(this._formatted||(this._formatted=p(this,!1)),this._formatted)}toJSON(){const P={$mid:1};return this._fsPath&&(P.fsPath=this._fsPath,P._sep=g),this._formatted&&(P.external=this._formatted),this.path&&(P.path=this.path),this.scheme&&(P.scheme=this.scheme),this.authority&&(P.authority=this.authority),this.query&&(P.query=this.query),this.fragment&&(P.fragment=this.fragment),P}}const b={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function m(S,x,P){let I,k=-1;for(let L=0;L<S.length;L++){const _=S.charCodeAt(L);if(_>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===45||_===46||_===95||_===126||x&&_===47||P&&_===91||P&&_===93||P&&_===58)k!==-1&&(I+=encodeURIComponent(S.substring(k,L)),k=-1),I!==void 0&&(I+=S.charAt(L));else{I===void 0&&(I=S.substr(0,L));const M=b[_];M!==void 0?(k!==-1&&(I+=encodeURIComponent(S.substring(k,L)),k=-1),I+=M):k===-1&&(k=L)}}return k!==-1&&(I+=encodeURIComponent(S.substring(k))),I!==void 0?I:S}function w(S){let x;for(let P=0;P<S.length;P++){const I=S.charCodeAt(P);I===35||I===63?(x===void 0&&(x=S.substr(0,P)),x+=b[I]):x!==void 0&&(x+=S[P])}return x!==void 0?x:S}function j(S,x){let P;return P=S.authority&&S.path.length>1&&S.scheme==="file"?`//${S.authority}${S.path}`:S.path.charCodeAt(0)===47&&(S.path.charCodeAt(1)>=65&&S.path.charCodeAt(1)<=90||S.path.charCodeAt(1)>=97&&S.path.charCodeAt(1)<=122)&&S.path.charCodeAt(2)===58?S.path[1].toLowerCase()+S.path.substr(2):S.path,i&&(P=P.replace(/\//g,"\\")),P}function p(S,x){const P=x?w:m;let I="",{scheme:k,authority:L,path:_,query:M,fragment:F}=S;if(k&&(I+=k,I+=":"),(L||k==="file")&&(I+=f,I+=f),L){let V=L.indexOf("@");if(V!==-1){const R=L.substr(0,V);L=L.substr(V+1),V=R.lastIndexOf(":"),V===-1?I+=P(R,!1,!1):(I+=P(R.substr(0,V),!1,!1),I+=":",I+=P(R.substr(V+1),!1,!0)),I+="@"}L=L.toLowerCase(),V=L.lastIndexOf(":"),V===-1?I+=P(L,!1,!0):(I+=P(L.substr(0,V),!1,!0),I+=L.substr(V))}if(_){if(_.length>=3&&_.charCodeAt(0)===47&&_.charCodeAt(2)===58){const V=_.charCodeAt(1);V>=65&&V<=90&&(_=`/${String.fromCharCode(V+32)}:${_.substr(3)}`)}else if(_.length>=2&&_.charCodeAt(1)===58){const V=_.charCodeAt(0);V>=65&&V<=90&&(_=`${String.fromCharCode(V+32)}:${_.substr(2)}`)}I+=P(_,!0,!1)}return M&&(I+="?",I+=P(M,!1,!1)),F&&(I+="#",I+=x?F:m(F,!1,!1)),I}function N(S){try{return decodeURIComponent(S)}catch{return S.length>3?S.substr(0,3)+N(S.substr(3)):S}}const T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function A(S){return S.match(T)?S.replace(T,x=>N(x)):S}var v=n(975);const $=v.posix||v,E="/";var U;(function(S){S.joinPath=function(x,...P){return x.with({path:$.join(x.path,...P)})},S.resolvePath=function(x,...P){let I=x.path,k=!1;I[0]!==E&&(I=E+I,k=!0);let L=$.resolve(I,...P);return k&&L[0]===E&&!x.authority&&(L=L.substring(1)),x.with({path:L})},S.dirname=function(x){if(x.path.length===0||x.path===E)return x;let P=$.dirname(x.path);return P.length===1&&P.charCodeAt(0)===46&&(P=""),x.with({path:P})},S.basename=function(x){return $.basename(x.path)},S.extname=function(x){return $.extname(x.path)}})(U||(U={})),Nr=r})();const{URI:pt,Utils:Eu}=Nr;function ps(e,t){if(typeof e!="string")throw new TypeError("Expected a string");const n=String(e);let r="";const i=t?!!t.extended:!1,s=t?!!t.globstar:!1;let o=!1;const a=t&&typeof t.flags=="string"?t.flags:"";let l;for(let c=0,f=n.length;c<f;c++)switch(l=n[c],l){case"/":case"$":case"^":case"+":case".":case"(":case")":case"=":case"!":case"|":r+="\\"+l;break;case"?":if(i){r+=".";break}case"[":case"]":if(i){r+=l;break}case"{":if(i){o=!0,r+="(";break}case"}":if(i){o=!1,r+=")";break}case",":if(o){r+="|";break}r+="\\"+l;break;case"*":const u=n[c-1];let d=1;for(;n[c+1]==="*";)d++,c++;const g=n[c+1];s?d>1&&(u==="/"||u===void 0||u==="{"||u===",")&&(g==="/"||g===void 0||g===","||g==="}")?(g==="/"?c++:u==="/"&&r.endsWith("\\/")&&(r=r.substr(0,r.length-2)),r+="((?:[^/]*(?:/|$))*)"):r+="([^/]*)":r+=".*";break;default:r+=l}return(!a||!~a.indexOf("g"))&&(r="^"+r+"$"),new RegExp(r,a)}const hs="!",gs="/";class ms{constructor(t,n,r){this.folderUri=n,this.uris=r,this.globWrappers=[];try{for(let i of t){const s=i[0]!==hs;s||(i=i.substring(1)),i.length>0&&(i[0]===gs&&(i=i.substring(1)),this.globWrappers.push({regexp:ps("**/"+i,{extended:!0,globstar:!0}),include:s}))}n&&(n=Sr(n),n.endsWith("/")||(n=n+"/"),this.folderUri=n)}catch{this.globWrappers.length=0,this.uris=[]}}matchesPattern(t){if(this.folderUri&&!t.startsWith(this.folderUri))return!1;let n=!1;for(const{regexp:r,include:i}of this.globWrappers)r.test(t)&&(n=i);return n}getURIs(){return this.uris}}class ys{constructor(t,n,r){this.service=t,this.uri=n,this.dependencies=new Set,this.anchors=void 0,r&&(this.unresolvedSchema=this.service.promise.resolve(new He(r)))}getUnresolvedSchema(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.uri)),this.unresolvedSchema}getResolvedSchema(){return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(t=>this.service.resolveSchemaContent(t,this))),this.resolvedSchema}clearSchema(){const t=!!this.unresolvedSchema;return this.resolvedSchema=void 0,this.unresolvedSchema=void 0,this.dependencies.clear(),this.anchors=void 0,t}}class He{constructor(t,n=[]){this.schema=t,this.errors=n}}class xr{constructor(t,n=[],r=[],i){this.schema=t,this.errors=n,this.warnings=r,this.schemaDraft=i}getSection(t){const n=this.getSectionRecursive(t,this.schema);if(n)return se(n)}getSectionRecursive(t,n){if(!n||typeof n=="boolean"||t.length===0)return n;const r=t.shift();if(n.properties&&typeof n.properties[r])return this.getSectionRecursive(t,n.properties[r]);if(n.patternProperties)for(const i of Object.keys(n.patternProperties)){const s=ot(i);if(s!=null&&s.test(r))return this.getSectionRecursive(t,n.patternProperties[i])}else{if(typeof n.additionalProperties=="object")return this.getSectionRecursive(t,n.additionalProperties);if(r.match("[0-9]+")){if(Array.isArray(n.items)){const i=parseInt(r,10);if(!isNaN(i)&&n.items[i])return this.getSectionRecursive(t,n.items[i])}else if(n.items)return this.getSectionRecursive(t,n.items)}}}}class bs{constructor(t,n,r){this.contextService=n,this.requestService=t,this.promiseConstructor=r||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations=[],this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={}}getRegisteredSchemaIds(t){return Object.keys(this.registeredSchemasIds).filter(n=>{const r=pt.parse(n).scheme;return r!=="schemaservice"&&(!t||t(r))})}get promise(){return this.promiseConstructor}dispose(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()}onResourceChange(t){this.cachedSchemaForResource=void 0;let n=!1;t=ke(t);const r=[t],i=Object.keys(this.schemasById).map(s=>this.schemasById[s]);for(;r.length;){const s=r.pop();for(let o=0;o<i.length;o++){const a=i[o];a&&(a.uri===s||a.dependencies.has(s))&&(a.uri!==s&&r.push(a.uri),a.clearSchema()&&(n=!0),i[o]=void 0)}}return n}setSchemaContributions(t){if(t.schemas){const n=t.schemas;for(const r in n){const i=ke(r);this.contributionSchemas[i]=this.addSchemaHandle(i,n[r])}}if(Array.isArray(t.schemaAssociations)){const n=t.schemaAssociations;for(let r of n){const i=r.uris.map(ke),s=this.addFilePatternAssociation(r.pattern,r.folderUri,i);this.contributionAssociations.push(s)}}}addSchemaHandle(t,n){const r=new ys(this,t,n);return this.schemasById[t]=r,r}getOrAddSchemaHandle(t,n){return this.schemasById[t]||this.addSchemaHandle(t,n)}addFilePatternAssociation(t,n,r){const i=new ms(t,n,r);return this.filePatternAssociations.push(i),i}registerExternalSchema(t){const n=ke(t.uri);return this.registeredSchemasIds[n]=!0,this.cachedSchemaForResource=void 0,t.fileMatch&&t.fileMatch.length&&this.addFilePatternAssociation(t.fileMatch,t.folderUri,[n]),t.schema?this.addSchemaHandle(n,t.schema):this.getOrAddSchemaHandle(n)}clearExternalSchemas(){this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={},this.cachedSchemaForResource=void 0;for(const t in this.contributionSchemas)this.schemasById[t]=this.contributionSchemas[t],this.registeredSchemasIds[t]=!0;for(const t of this.contributionAssociations)this.filePatternAssociations.push(t)}getResolvedSchema(t){const n=ke(t),r=this.schemasById[n];return r?r.getResolvedSchema():this.promise.resolve(void 0)}loadSchema(t){if(!this.requestService){const n=O("Unable to load schema from '{0}'. No schema request service available",Xe(t));return this.promise.resolve(new He({},[n]))}return t.startsWith("http://json-schema.org/")&&(t="https"+t.substring(4)),this.requestService(t).then(n=>{if(!n){const o=O("Unable to load schema from '{0}': No content.",Xe(t));return new He({},[o])}const r=[];n.charCodeAt(0)===65279&&(r.push(O("Problem reading content from '{0}': UTF-8 with BOM detected, only UTF 8 is allowed.",Xe(t))),n=n.trimStart());let i={};const s=[];return i=Fi(n,s),s.length&&r.push(O("Unable to parse content from '{0}': Parse error at offset {1}.",Xe(t),s[0].offset)),new He(i,r)},n=>{let r=n.toString();const i=n.toString().split("Error: ");return i.length>1&&(r=i[1]),We(r,".")&&(r=r.substr(0,r.length-1)),new He({},[O("Unable to load schema from '{0}': {1}.",Xe(t),r)])})}resolveSchemaContent(t,n){const r=t.errors.slice(0),i=t.schema;let s=i.$schema?ke(i.$schema):void 0;if(s==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new xr({},[O("Draft-03 schemas are not supported.")],[],s));let o=new Set;const a=this.contextService,l=(b,m)=>{m=decodeURIComponent(m);let w=b;return m[0]==="/"&&(m=m.substring(1)),m.split("/").some(j=>(j=j.replace(/~1/g,"/").replace(/~0/g,"~"),w=w[j],!w)),w},c=(b,m,w)=>(m.anchors||(m.anchors=h(b)),m.anchors.get(w)),f=(b,m)=>{for(const w in m)m.hasOwnProperty(w)&&w!=="id"&&w!=="$id"&&(b[w]=m[w])},u=(b,m,w,j)=>{let p;j===void 0||j.length===0?p=m:j.charAt(0)==="/"?p=l(m,j):p=c(m,w,j),p?f(b,p):r.push(O("$ref '{0}' in '{1}' can not be resolved.",j||"",w.uri))},d=(b,m,w,j)=>{a&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/.*/.test(m)&&(m=a.resolveRelativePath(m,j.uri)),m=ke(m);const p=this.getOrAddSchemaHandle(m);return p.getUnresolvedSchema().then(N=>{if(j.dependencies.add(m),N.errors.length){const T=w?m+"#"+w:m;r.push(O("Problems loading reference '{0}': {1}",T,N.errors[0]))}return u(b,N.schema,p,w),g(b,N.schema,p)})},g=(b,m,w)=>{const j=[];return this.traverseNodes(b,p=>{const N=new Set;for(;p.$ref;){const T=p.$ref,A=T.split("#",2);if(delete p.$ref,A[0].length>0){j.push(d(p,A[0],A[1],w));return}else if(!N.has(T)){const v=A[1];u(p,m,w,v),N.add(T)}}p.$recursiveRef&&o.add("$recursiveRef"),p.$dynamicRef&&o.add("$dynamicRef")}),this.promise.all(j)},h=b=>{const m=new Map;return this.traverseNodes(b,w=>{const j=w.$id||w.id,p=gn(j)&&j.charAt(0)==="#"?j.substring(1):w.$anchor;p&&(m.has(p)?r.push(O("Duplicate anchor declaration: '{0}'",p)):m.set(p,w)),w.$recursiveAnchor&&o.add("$recursiveAnchor"),w.$dynamicAnchor&&o.add("$dynamicAnchor")}),m};return g(i,i,n).then(b=>{let m=[];return o.size&&m.push(O("The schema uses meta-schema features ({0}) that are not yet supported by the validator.",Array.from(o.keys()).join(", "))),new xr(i,r,m,s)})}traverseNodes(t,n){if(!t||typeof t!="object")return Promise.resolve(null);const r=new Set,i=(...f)=>{for(const u of f)ve(u)&&l.push(u)},s=(...f)=>{for(const u of f)if(ve(u))for(const d in u){const h=u[d];ve(h)&&l.push(h)}},o=(...f)=>{for(const u of f)if(Array.isArray(u))for(const d of u)ve(d)&&l.push(d)},a=f=>{if(Array.isArray(f))for(const u of f)ve(u)&&l.push(u);else ve(f)&&l.push(f)},l=[t];let c=l.pop();for(;c;)r.has(c)||(r.add(c),n(c),i(c.additionalItems,c.additionalProperties,c.not,c.contains,c.propertyNames,c.if,c.then,c.else,c.unevaluatedItems,c.unevaluatedProperties),s(c.definitions,c.$defs,c.properties,c.patternProperties,c.dependencies,c.dependentSchemas),o(c.anyOf,c.allOf,c.oneOf,c.prefixItems),a(c.items)),c=l.pop()}getSchemaFromProperty(t,n){var r,i;if(((r=n.root)==null?void 0:r.type)==="object"){for(const s of n.root.properties)if(s.keyNode.value==="$schema"&&((i=s.valueNode)==null?void 0:i.type)==="string"){let o=s.valueNode.value;return this.contextService&&!/^\w[\w\d+.-]*:/.test(o)&&(o=this.contextService.resolveRelativePath(o,t)),o}}}getAssociatedSchemas(t){const n=Object.create(null),r=[],i=Sr(t);for(const s of this.filePatternAssociations)if(s.matchesPattern(i))for(const o of s.getURIs())n[o]||(r.push(o),n[o]=!0);return r}getSchemaURIsForResource(t,n){let r=n&&this.getSchemaFromProperty(t,n);return r?[r]:this.getAssociatedSchemas(t)}getSchemaForResource(t,n){if(n){let s=this.getSchemaFromProperty(t,n);if(s){const o=ke(s);return this.getOrAddSchemaHandle(o).getResolvedSchema()}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===t)return this.cachedSchemaForResource.resolvedSchema;const r=this.getAssociatedSchemas(t),i=r.length>0?this.createCombinedSchema(t,r).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:t,resolvedSchema:i},i}createCombinedSchema(t,n){if(n.length===1)return this.getOrAddSchemaHandle(n[0]);{const r="schemaservice://combinedSchema/"+encodeURIComponent(t),i={allOf:n.map(s=>({$ref:s}))};return this.addSchemaHandle(r,i)}}getMatchingSchemas(t,n,r){if(r){const i=r.id||"schemaservice://untitled/matchingSchemas/"+vs++;return this.addSchemaHandle(i,r).getResolvedSchema().then(o=>n.getMatchingSchemas(o.schema).filter(a=>!a.inverted))}return this.getSchemaForResource(t.uri,n).then(i=>i?n.getMatchingSchemas(i.schema).filter(s=>!s.inverted):[])}}let vs=0;function ke(e){try{return pt.parse(e).toString(!0)}catch{return e}}function Sr(e){try{return pt.parse(e).with({fragment:null,query:null}).toString(!0)}catch{return e}}function Xe(e){try{const t=pt.parse(e);if(t.scheme==="file")return t.fsPath}catch{}return e}function As(e,t){const n=[],r=[],i=[];let s=-1;const o=Oe(e.getText(),!1);let a=o.scan();function l(h){n.push(h),r.push(i.length)}for(;a!==17;){switch(a){case 1:case 3:{const h=e.positionAt(o.getTokenOffset()).line,b={startLine:h,endLine:h,kind:a===1?"object":"array"};i.push(b);break}case 2:case 4:{const h=a===2?"object":"array";if(i.length>0&&i[i.length-1].kind===h){const b=i.pop(),m=e.positionAt(o.getTokenOffset()).line;b&&m>b.startLine+1&&s!==b.startLine&&(b.endLine=m-1,l(b),s=b.startLine)}break}case 13:{const h=e.positionAt(o.getTokenOffset()).line,b=e.positionAt(o.getTokenOffset()+o.getTokenLength()).line;o.getTokenError()===1&&h+1<e.lineCount?o.setPosition(e.offsetAt(H.create(h+1,0))):h<b&&(l({startLine:h,endLine:b,kind:Ce.Comment}),s=h);break}case 12:{const b=e.getText().substr(o.getTokenOffset(),o.getTokenLength()).match(/^\/\/\s*#(region\b)|(endregion\b)/);if(b){const m=e.positionAt(o.getTokenOffset()).line;if(b[1]){const w={startLine:m,endLine:m,kind:Ce.Region};i.push(w)}else{let w=i.length-1;for(;w>=0&&i[w].kind!==Ce.Region;)w--;if(w>=0){const j=i[w];i.length=w,m>j.startLine&&s!==j.startLine&&(j.endLine=m,l(j),s=j.startLine)}}}break}}a=o.scan()}const c=t&&t.rangeLimit;if(typeof c!="number"||n.length<=c)return n;t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri);const f=[];for(let h of r)h<30&&(f[h]=(f[h]||0)+1);let u=0,d=0;for(let h=0;h<f.length;h++){const b=f[h];if(b){if(b+u>c){d=h;break}u+=b}}const g=[];for(let h=0;h<n.length;h++){const b=r[h];typeof b=="number"&&(b<d||b===d&&u++<c)&&g.push(n[h])}return g}function ks(e,t,n){function r(a){let l=e.offsetAt(a),c=n.getNodeFromOffset(l,!0);const f=[];for(;c;){switch(c.type){case"string":case"object":case"array":const d=c.offset+1,g=c.offset+c.length-1;d<g&&l>=d&&l<=g&&f.push(i(d,g)),f.push(i(c.offset,c.offset+c.length));break;case"number":case"boolean":case"null":case"property":f.push(i(c.offset,c.offset+c.length));break}if(c.type==="property"||c.parent&&c.parent.type==="array"){const d=o(c.offset+c.length,5);d!==-1&&f.push(i(c.offset,d))}c=c.parent}let u;for(let d=f.length-1;d>=0;d--)u=lt.create(f[d],u);return u||(u=lt.create(D.create(a,a))),u}function i(a,l){return D.create(e.positionAt(a),e.positionAt(l))}const s=Oe(e.getText(),!0);function o(a,l){return s.setPosition(a),s.scan()===l?s.getTokenOffset()+s.getTokenLength():-1}return t.map(r)}function qt(e,t,n){let r;if(n){const s=e.offsetAt(n.start),o=e.offsetAt(n.end)-s;r={offset:s,length:o}}const i={tabSize:t?t.tabSize:4,insertSpaces:(t==null?void 0:t.insertSpaces)===!0,insertFinalNewline:(t==null?void 0:t.insertFinalNewline)===!0,eol:`
33
+ `,keepLines:(t==null?void 0:t.keepLines)===!0};return Bi(e.getText(),r,i).map(s=>fe.replace(D.create(e.positionAt(s.offset),e.positionAt(s.offset+s.length)),s.content))}var Y;(function(e){e[e.Object=0]="Object",e[e.Array=1]="Array"})(Y||(Y={}));class ht{constructor(t,n){this.propertyName=t??"",this.beginningLineNumber=n,this.childrenProperties=[],this.lastProperty=!1,this.noKeyName=!1}addChildProperty(t){if(t.parent=this,this.childrenProperties.length>0){let n=0;t.noKeyName?n=this.childrenProperties.length:n=ws(this.childrenProperties,t,Ts),n<0&&(n=n*-1-1),this.childrenProperties.splice(n,0,t)}else this.childrenProperties.push(t);return t}}function Ts(e,t){const n=e.propertyName.toLowerCase(),r=t.propertyName.toLowerCase();return n<r?-1:n>r?1:0}function ws(e,t,n){const r=t.propertyName.toLowerCase(),i=e[0].propertyName.toLowerCase(),s=e[e.length-1].propertyName.toLowerCase();if(r<i)return 0;if(r>s)return e.length;let o=0,a=e.length-1;for(;o<=a;){let l=a+o>>1,c=n(t,e[l]);if(c>0)o=l+1;else if(c<0)a=l-1;else return l}return-o-1}function Os(e,t){const n={...t,keepLines:!1},r=ae.applyEdits(e,qt(e,n,void 0)),i=ae.create("test://test.json","json",0,r),s=Ns(i),o=xs(i,s),a=qt(o,n,void 0),l=ae.applyEdits(o,a);return[fe.replace(D.create(H.create(0,0),e.positionAt(e.getText().length)),l)]}function Ns(e){const t=e.getText(),n=Oe(t,!1);let r=new ht,i=r,s=r,o=r,a,l=0,c=0,f,u,d=-1,g=-1,h=0,b=0,m=[],w=!1,j=!1;for(;(a=n.scan())!==17;){if(w===!0&&a!==14&&a!==15&&a!==12&&a!==13&&s.endLineNumber===void 0){let p=n.getTokenStartLine();u===2||u===4?o.endLineNumber=p-1:s.endLineNumber=p-1,h=p,w=!1}if(j===!0&&a!==14&&a!==15&&a!==12&&a!==13&&(h=n.getTokenStartLine(),j=!1),n.getTokenStartLine()!==l){for(let p=l;p<n.getTokenStartLine();p++){const N=e.getText(D.create(H.create(p,0),H.create(p+1,0))).length;c=c+N}l=n.getTokenStartLine()}switch(a){case 10:{if(f===void 0||f===1||f===5&&m[m.length-1]===Y.Object){const p=new ht(n.getTokenValue(),h);o=s,s=i.addChildProperty(p)}break}case 3:{if(r.beginningLineNumber===void 0&&(r.beginningLineNumber=n.getTokenStartLine()),m[m.length-1]===Y.Object)i=s;else if(m[m.length-1]===Y.Array){const p=new ht(n.getTokenValue(),h);p.noKeyName=!0,o=s,s=i.addChildProperty(p),i=s}m.push(Y.Array),s.type=Y.Array,h=n.getTokenStartLine(),h++;break}case 1:{if(r.beginningLineNumber===void 0)r.beginningLineNumber=n.getTokenStartLine();else if(m[m.length-1]===Y.Array){const p=new ht(n.getTokenValue(),h);p.noKeyName=!0,o=s,s=i.addChildProperty(p)}s.type=Y.Object,m.push(Y.Object),i=s,h=n.getTokenStartLine(),h++;break}case 4:{b=n.getTokenStartLine(),m.pop(),s.endLineNumber===void 0&&(f===2||f===4)&&(s.endLineNumber=b-1,s.lastProperty=!0,s.lineWhereToAddComma=d,s.indexWhereToAddComa=g,o=s,s=s?s.parent:void 0,i=s),r.endLineNumber=b,h=b+1;break}case 2:{b=n.getTokenStartLine(),m.pop(),f!==1&&(s.endLineNumber===void 0&&(s.endLineNumber=b-1,s.lastProperty=!0,s.lineWhereToAddComma=d,s.indexWhereToAddComa=g),o=s,s=s?s.parent:void 0,i=s),r.endLineNumber=n.getTokenStartLine(),h=b+1;break}case 5:{b=n.getTokenStartLine(),s.endLineNumber===void 0&&(m[m.length-1]===Y.Object||m[m.length-1]===Y.Array&&(f===2||f===4))&&(s.endLineNumber=b,s.commaIndex=n.getTokenOffset()-c,s.commaLine=b),(f===2||f===4)&&(o=s,s=s?s.parent:void 0,i=s),h=b+1;break}case 13:{f===5&&d===n.getTokenStartLine()&&(m[m.length-1]===Y.Array&&(u===2||u===4)||m[m.length-1]===Y.Object)&&(m[m.length-1]===Y.Array&&(u===2||u===4)||m[m.length-1]===Y.Object)&&(s.endLineNumber=void 0,w=!0),(f===1||f===3)&&d===n.getTokenStartLine()&&(j=!0);break}}a!==14&&a!==13&&a!==12&&a!==15&&(u=f,f=a,d=n.getTokenStartLine(),g=n.getTokenOffset()+n.getTokenLength()-c)}return r}function xs(e,t){if(t.childrenProperties.length===0)return e;const n=ae.create("test://test.json","json",0,e.getText()),r=[];for(Lr(r,t,t.beginningLineNumber);r.length>0;){const i=r.shift(),s=i.propertyTreeArray;let o=i.beginningLineNumber;for(let a=0;a<s.length;a++){const l=s[a],c=D.create(H.create(l.beginningLineNumber,0),H.create(l.endLineNumber+1,0)),f=e.getText(c),u=ae.create("test://test.json","json",0,f);if(l.lastProperty===!0&&a!==s.length-1){const h=l.lineWhereToAddComma-l.beginningLineNumber,b=l.indexWhereToAddComa,m={range:D.create(H.create(h,b),H.create(h,b)),text:","};ae.update(u,[m],1)}else if(l.lastProperty===!1&&a===s.length-1){const h=l.commaIndex,m=l.commaLine-l.beginningLineNumber,w={range:D.create(H.create(m,h),H.create(m,h+1)),text:""};ae.update(u,[w],1)}const d=l.endLineNumber-l.beginningLineNumber+1,g={range:D.create(H.create(o,0),H.create(o+d,0)),text:u.getText()};ae.update(n,[g],1),Lr(r,l,o),o=o+d}}return n}function Ss(e){e.sort((t,n)=>t.propertyName.localeCompare(n.propertyName))}function Lr(e,t,n){if(t.childrenProperties.length!==0)if(t.type===Y.Object){let r=1/0;for(const s of t.childrenProperties)s.beginningLineNumber<r&&(r=s.beginningLineNumber);const i=r-t.beginningLineNumber;n=n+i,Ss(t.childrenProperties),e.push(new Ir(n,t.childrenProperties))}else t.type===Y.Array&&_r(e,t,n)}function _r(e,t,n){for(const r of t.childrenProperties){if(r.type===Y.Object){let i=1/0;for(const o of r.childrenProperties)o.beginningLineNumber<i&&(i=o.beginningLineNumber);const s=i-r.beginningLineNumber;e.push(new Ir(n+r.beginningLineNumber-t.beginningLineNumber+s,r.childrenProperties))}r.type===Y.Array&&_r(e,r,n+r.beginningLineNumber-t.beginningLineNumber)}}class Ir{constructor(t,n){this.beginningLineNumber=t,this.propertyTreeArray=n}}function Ls(e,t){const n=[];return t.visit(r=>{var i;if(r.type==="property"&&r.keyNode.value==="$ref"&&((i=r.valueNode)==null?void 0:i.type)==="string"){const s=r.valueNode.value,o=Is(t,s);if(o){const a=e.positionAt(o.offset);n.push({target:`${e.uri}#${a.line+1},${a.character+1}`,range:_s(e,r.valueNode)})}}return!0}),Promise.resolve(n)}function _s(e,t){return D.create(e.positionAt(t.offset+1),e.positionAt(t.offset+t.length-1))}function Is(e,t){const n=js(t);return n?Wt(n,e.root):null}function Wt(e,t){if(!t)return null;if(e.length===0)return t;const n=e.shift();if(t&&t.type==="object"){const r=t.properties.find(i=>i.keyNode.value===n);return r?Wt(e,r.valueNode):null}else if(t&&t.type==="array"&&n.match(/^(0|[1-9][0-9]*)$/)){const r=Number.parseInt(n),i=t.items[r];return i?Wt(e,i):null}return null}function js(e){return e==="#"?[]:e[0]!=="#"||e[1]!=="/"?null:e.substring(2).split(/\//).map(Ps)}function Ps(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function $s(e){const t=e.promiseConstructor||Promise,n=new bs(e.schemaRequestService,e.workspaceContext,t);n.setSchemaContributions(Bt);const r=new ns(n,e.contributions,t,e.clientCapabilities),i=new rs(n,e.contributions,t),s=new fs(n),o=new ss(n,t);return{configure:a=>{var l;n.clearExternalSchemas(),(l=a.schemas)==null||l.forEach(n.registerExternalSchema.bind(n)),o.configure(a)},resetSchema:a=>n.onResourceChange(a),doValidation:o.doValidation.bind(o),getLanguageStatus:o.getLanguageStatus.bind(o),parseJSONDocument:a=>ts(a,{collectComments:!0}),newJSONDocument:(a,l)=>es(a,l),getMatchingSchemas:n.getMatchingSchemas.bind(n),doResolve:r.doResolve.bind(r),doComplete:r.doComplete.bind(r),findDocumentSymbols:s.findDocumentSymbols.bind(s),findDocumentSymbols2:s.findDocumentSymbols2.bind(s),findDocumentColors:s.findDocumentColors.bind(s),getColorPresentations:s.getColorPresentations.bind(s),doHover:i.doHover.bind(i),getFoldingRanges:As,getSelectionRanges:ks,findDefinition:()=>Promise.resolve([]),findLinks:Ls,format:(a,l,c)=>qt(a,c,l),sort:(a,l)=>Os(a,l)}}var jr=typeof global=="object"&&global&&global.Object===Object&&global,Es=typeof self=="object"&&self&&self.Object===Object&&self,pe=jr||Es||Function("return this")(),De=pe.Symbol,Pr=Object.prototype,Ms=Pr.hasOwnProperty,Vs=Pr.toString,Ze=De?De.toStringTag:void 0;function Fs(e){var t=Ms.call(e,Ze),n=e[Ze];try{e[Ze]=void 0;var r=!0}catch{}var i=Vs.call(e);return r&&(t?e[Ze]=n:delete e[Ze]),i}var Ds=Object.prototype,Us=Ds.toString;function Rs(e){return Us.call(e)}var Bs="[object Null]",qs="[object Undefined]",$r=De?De.toStringTag:void 0;function Ye(e){return e==null?e===void 0?qs:Bs:$r&&$r in Object(e)?Fs(e):Rs(e)}function Qe(e){return e!=null&&typeof e=="object"}var Ct=Array.isArray;function Ke(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ws="[object AsyncFunction]",Cs="[object Function]",zs="[object GeneratorFunction]",Js="[object Proxy]";function Er(e){if(!Ke(e))return!1;var t=Ye(e);return t==Cs||t==zs||t==Ws||t==Js}var zt=pe["__core-js_shared__"],Mr=function(){var e=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Gs(e){return!!Mr&&Mr in e}var Hs=Function.prototype,Xs=Hs.toString;function Le(e){if(e!=null){try{return Xs.call(e)}catch{}try{return e+""}catch{}}return""}var Zs=/[\\^$.*+?()[\]{}|]/g,Ys=/^\[object .+?Constructor\]$/,Qs=Function.prototype,Ks=Object.prototype,eo=Qs.toString,to=Ks.hasOwnProperty,no=RegExp("^"+eo.call(to).replace(Zs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ro(e){if(!Ke(e)||Gs(e))return!1;var t=Er(e)?no:Ys;return t.test(Le(e))}function io(e,t){return e==null?void 0:e[t]}function _e(e,t){var n=io(e,t);return ro(n)?n:void 0}var Jt=_e(pe,"WeakMap"),Vr=Object.create,so=function(){function e(){}return function(t){if(!Ke(t))return{};if(Vr)return Vr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function oo(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Fr=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch{}}();function ao(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var co=9007199254740991,uo=/^(?:0|[1-9]\d*)$/;function lo(e,t){var n=typeof e;return t=t??co,!!t&&(n=="number"||n!="symbol"&&uo.test(e))&&e>-1&&e%1==0&&e<t}function Dr(e,t,n){t=="__proto__"&&Fr?Fr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ur(e,t){return e===t||e!==e&&t!==t}var fo=Object.prototype,po=fo.hasOwnProperty;function Rr(e,t,n){var r=e[t];(!(po.call(e,t)&&Ur(r,n))||n===void 0&&!(t in e))&&Dr(e,t,n)}function gt(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?Dr(n,a,l):Rr(n,a,l)}return n}var ho=9007199254740991;function Br(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ho}function qr(e){return e!=null&&Br(e.length)&&!Er(e)}var go=Object.prototype;function Gt(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||go;return e===n}function mo(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var yo="[object Arguments]";function Wr(e){return Qe(e)&&Ye(e)==yo}var Cr=Object.prototype,bo=Cr.hasOwnProperty,vo=Cr.propertyIsEnumerable,Ao=Wr(function(){return arguments}())?Wr:function(e){return Qe(e)&&bo.call(e,"callee")&&!vo.call(e,"callee")};function ko(){return!1}var zr=typeof W=="object"&&W&&!W.nodeType&&W,Jr=zr&&typeof module=="object"&&module&&!module.nodeType&&module,To=Jr&&Jr.exports===zr,Gr=To?pe.Buffer:void 0,wo=Gr?Gr.isBuffer:void 0,Hr=wo||ko,Oo="[object Arguments]",No="[object Array]",xo="[object Boolean]",So="[object Date]",Lo="[object Error]",_o="[object Function]",Io="[object Map]",jo="[object Number]",Po="[object Object]",$o="[object RegExp]",Eo="[object Set]",Mo="[object String]",Vo="[object WeakMap]",Fo="[object ArrayBuffer]",Do="[object DataView]",Uo="[object Float32Array]",Ro="[object Float64Array]",Bo="[object Int8Array]",qo="[object Int16Array]",Wo="[object Int32Array]",Co="[object Uint8Array]",zo="[object Uint8ClampedArray]",Jo="[object Uint16Array]",Go="[object Uint32Array]",J={};J[Uo]=J[Ro]=J[Bo]=J[qo]=J[Wo]=J[Co]=J[zo]=J[Jo]=J[Go]=!0,J[Oo]=J[No]=J[Fo]=J[xo]=J[Do]=J[So]=J[Lo]=J[_o]=J[Io]=J[jo]=J[Po]=J[$o]=J[Eo]=J[Mo]=J[Vo]=!1;function Ho(e){return Qe(e)&&Br(e.length)&&!!J[Ye(e)]}function Ht(e){return function(t){return e(t)}}var Xr=typeof W=="object"&&W&&!W.nodeType&&W,et=Xr&&typeof module=="object"&&module&&!module.nodeType&&module,Xo=et&&et.exports===Xr,Xt=Xo&&jr.process,Ue=function(){try{var e=et&&et.require&&et.require("util").types;return e||Xt&&Xt.binding&&Xt.binding("util")}catch{}}(),Zr=Ue&&Ue.isTypedArray,Zo=Zr?Ht(Zr):Ho,Yo=Object.prototype,Qo=Yo.hasOwnProperty;function Yr(e,t){var n=Ct(e),r=!n&&Ao(e),i=!n&&!r&&Hr(e),s=!n&&!r&&!i&&Zo(e),o=n||r||i||s,a=o?mo(e.length,String):[],l=a.length;for(var c in e)(t||Qo.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||lo(c,l)))&&a.push(c);return a}function Qr(e,t){return function(n){return e(t(n))}}var Ko=Qr(Object.keys,Object),ea=Object.prototype,ta=ea.hasOwnProperty;function na(e){if(!Gt(e))return Ko(e);var t=[];for(var n in Object(e))ta.call(e,n)&&n!="constructor"&&t.push(n);return t}function Zt(e){return qr(e)?Yr(e):na(e)}function ra(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ia=Object.prototype,sa=ia.hasOwnProperty;function oa(e){if(!Ke(e))return ra(e);var t=Gt(e),n=[];for(var r in e)r=="constructor"&&(t||!sa.call(e,r))||n.push(r);return n}function Yt(e){return qr(e)?Yr(e,!0):oa(e)}var tt=_e(Object,"create");function aa(){this.__data__=tt?tt(null):{},this.size=0}function ca(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ua="__lodash_hash_undefined__",la=Object.prototype,fa=la.hasOwnProperty;function da(e){var t=this.__data__;if(tt){var n=t[e];return n===ua?void 0:n}return fa.call(t,e)?t[e]:void 0}var pa=Object.prototype,ha=pa.hasOwnProperty;function ga(e){var t=this.__data__;return tt?t[e]!==void 0:ha.call(t,e)}var ma="__lodash_hash_undefined__";function ya(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tt&&t===void 0?ma:t,this}function Ie(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ie.prototype.clear=aa,Ie.prototype.delete=ca,Ie.prototype.get=da,Ie.prototype.has=ga,Ie.prototype.set=ya;function ba(){this.__data__=[],this.size=0}function mt(e,t){for(var n=e.length;n--;)if(Ur(e[n][0],t))return n;return-1}var va=Array.prototype,Aa=va.splice;function ka(e){var t=this.__data__,n=mt(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Aa.call(t,n,1),--this.size,!0}function Ta(e){var t=this.__data__,n=mt(t,e);return n<0?void 0:t[n][1]}function wa(e){return mt(this.__data__,e)>-1}function Oa(e,t){var n=this.__data__,r=mt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ge(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ge.prototype.clear=ba,ge.prototype.delete=ka,ge.prototype.get=Ta,ge.prototype.has=wa,ge.prototype.set=Oa;var nt=_e(pe,"Map");function Na(){this.size=0,this.__data__={hash:new Ie,map:new(nt||ge),string:new Ie}}function xa(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function yt(e,t){var n=e.__data__;return xa(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Sa(e){var t=yt(this,e).delete(e);return this.size-=t?1:0,t}function La(e){return yt(this,e).get(e)}function _a(e){return yt(this,e).has(e)}function Ia(e,t){var n=yt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Re(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Re.prototype.clear=Na,Re.prototype.delete=Sa,Re.prototype.get=La,Re.prototype.has=_a,Re.prototype.set=Ia;function Kr(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ei=Qr(Object.getPrototypeOf,Object);function ja(){this.__data__=new ge,this.size=0}function Pa(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function $a(e){return this.__data__.get(e)}function Ea(e){return this.__data__.has(e)}var Ma=200;function Va(e,t){var n=this.__data__;if(n instanceof ge){var r=n.__data__;if(!nt||r.length<Ma-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Re(r)}return n.set(e,t),this.size=n.size,this}function Be(e){var t=this.__data__=new ge(e);this.size=t.size}Be.prototype.clear=ja,Be.prototype.delete=Pa,Be.prototype.get=$a,Be.prototype.has=Ea,Be.prototype.set=Va;function Fa(e,t){return e&&gt(t,Zt(t),e)}function Da(e,t){return e&&gt(t,Yt(t),e)}var ti=typeof W=="object"&&W&&!W.nodeType&&W,ni=ti&&typeof module=="object"&&module&&!module.nodeType&&module,Ua=ni&&ni.exports===ti,ri=Ua?pe.Buffer:void 0,ii=ri?ri.allocUnsafe:void 0;function Ra(e,t){if(t)return e.slice();var n=e.length,r=ii?ii(n):new e.constructor(n);return e.copy(r),r}function Ba(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function si(){return[]}var qa=Object.prototype,Wa=qa.propertyIsEnumerable,oi=Object.getOwnPropertySymbols,Qt=oi?function(e){return e==null?[]:(e=Object(e),Ba(oi(e),function(t){return Wa.call(e,t)}))}:si;function Ca(e,t){return gt(e,Qt(e),t)}var za=Object.getOwnPropertySymbols,ai=za?function(e){for(var t=[];e;)Kr(t,Qt(e)),e=ei(e);return t}:si;function Ja(e,t){return gt(e,ai(e),t)}function ci(e,t,n){var r=t(e);return Ct(e)?r:Kr(r,n(e))}function Ga(e){return ci(e,Zt,Qt)}function Ha(e){return ci(e,Yt,ai)}var Kt=_e(pe,"DataView"),en=_e(pe,"Promise"),tn=_e(pe,"Set"),ui="[object Map]",Xa="[object Object]",li="[object Promise]",fi="[object Set]",di="[object WeakMap]",pi="[object DataView]",Za=Le(Kt),Ya=Le(nt),Qa=Le(en),Ka=Le(tn),ec=Le(Jt),me=Ye;(Kt&&me(new Kt(new ArrayBuffer(1)))!=pi||nt&&me(new nt)!=ui||en&&me(en.resolve())!=li||tn&&me(new tn)!=fi||Jt&&me(new Jt)!=di)&&(me=function(e){var t=Ye(e),n=t==Xa?e.constructor:void 0,r=n?Le(n):"";if(r)switch(r){case Za:return pi;case Ya:return ui;case Qa:return li;case Ka:return fi;case ec:return di}return t});var tc=Object.prototype,nc=tc.hasOwnProperty;function rc(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&nc.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var hi=pe.Uint8Array;function nn(e){var t=new e.constructor(e.byteLength);return new hi(t).set(new hi(e)),t}function ic(e,t){var n=t?nn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var sc=/\w*$/;function oc(e){var t=new e.constructor(e.source,sc.exec(e));return t.lastIndex=e.lastIndex,t}var gi=De?De.prototype:void 0,mi=gi?gi.valueOf:void 0;function ac(e){return mi?Object(mi.call(e)):{}}function cc(e,t){var n=t?nn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var uc="[object Boolean]",lc="[object Date]",fc="[object Map]",dc="[object Number]",pc="[object RegExp]",hc="[object Set]",gc="[object String]",mc="[object Symbol]",yc="[object ArrayBuffer]",bc="[object DataView]",vc="[object Float32Array]",Ac="[object Float64Array]",kc="[object Int8Array]",Tc="[object Int16Array]",wc="[object Int32Array]",Oc="[object Uint8Array]",Nc="[object Uint8ClampedArray]",xc="[object Uint16Array]",Sc="[object Uint32Array]";function Lc(e,t,n){var r=e.constructor;switch(t){case yc:return nn(e);case uc:case lc:return new r(+e);case bc:return ic(e,n);case vc:case Ac:case kc:case Tc:case wc:case Oc:case Nc:case xc:case Sc:return cc(e,n);case fc:return new r;case dc:case gc:return new r(e);case pc:return oc(e);case hc:return new r;case mc:return ac(e)}}function _c(e){return typeof e.constructor=="function"&&!Gt(e)?so(ei(e)):{}}var Ic="[object Map]";function jc(e){return Qe(e)&&me(e)==Ic}var yi=Ue&&Ue.isMap,Pc=yi?Ht(yi):jc,$c="[object Set]";function Ec(e){return Qe(e)&&me(e)==$c}var bi=Ue&&Ue.isSet,Mc=bi?Ht(bi):Ec,Vc=1,Fc=2,Dc=4,vi="[object Arguments]",Uc="[object Array]",Rc="[object Boolean]",Bc="[object Date]",qc="[object Error]",Ai="[object Function]",Wc="[object GeneratorFunction]",Cc="[object Map]",zc="[object Number]",ki="[object Object]",Jc="[object RegExp]",Gc="[object Set]",Hc="[object String]",Xc="[object Symbol]",Zc="[object WeakMap]",Yc="[object ArrayBuffer]",Qc="[object DataView]",Kc="[object Float32Array]",eu="[object Float64Array]",tu="[object Int8Array]",nu="[object Int16Array]",ru="[object Int32Array]",iu="[object Uint8Array]",su="[object Uint8ClampedArray]",ou="[object Uint16Array]",au="[object Uint32Array]",z={};z[vi]=z[Uc]=z[Yc]=z[Qc]=z[Rc]=z[Bc]=z[Kc]=z[eu]=z[tu]=z[nu]=z[ru]=z[Cc]=z[zc]=z[ki]=z[Jc]=z[Gc]=z[Hc]=z[Xc]=z[iu]=z[su]=z[ou]=z[au]=!0,z[qc]=z[Ai]=z[Zc]=!1;function bt(e,t,n,r,i,s){var o,a=t&Vc,l=t&Fc,c=t&Dc;if(o!==void 0)return o;if(!Ke(e))return e;var f=Ct(e);if(f){if(o=rc(e),!a)return oo(e,o)}else{var u=me(e),d=u==Ai||u==Wc;if(Hr(e))return Ra(e,a);if(u==ki||u==vi||d&&!i){if(o=l||d?{}:_c(e),!a)return l?Ja(e,Da(o,e)):Ca(e,Fa(o,e))}else{if(!z[u])return i?e:{};o=Lc(e,u,a)}}s||(s=new Be);var g=s.get(e);if(g)return g;s.set(e,o),Mc(e)?e.forEach(function(m){o.add(bt(m,t,n,m,e,s))}):Pc(e)&&e.forEach(function(m,w){o.set(w,bt(m,t,n,w,e,s))});var h=c?l?Ha:Ga:l?Yt:Zt,b=f?void 0:h(e);return ao(b||e,function(m,w){b&&(w=m,m=e[w]),Rr(o,w,bt(m,t,n,w,e,s))}),o}var cu=1,uu=4;function lu(e){return bt(e,cu|uu)}for(var K=[],rn=0;rn<256;++rn)K.push((rn+256).toString(16).slice(1));function fu(e,t=0){return(K[e[t+0]]+K[e[t+1]]+K[e[t+2]]+K[e[t+3]]+"-"+K[e[t+4]]+K[e[t+5]]+"-"+K[e[t+6]]+K[e[t+7]]+"-"+K[e[t+8]]+K[e[t+9]]+"-"+K[e[t+10]]+K[e[t+11]]+K[e[t+12]]+K[e[t+13]]+K[e[t+14]]+K[e[t+15]]).toLowerCase()}var vt,du=new Uint8Array(16);function pu(){if(!vt&&(vt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vt(du)}var hu=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Ti={randomUUID:hu};function gu(e,t,n){if(Ti.randomUUID&&!t&&!e)return Ti.randomUUID();e=e||{};var r=e.random||(e.rng||pu)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,fu(r)}const mu={JSON:"json"},ye={STRING:"string",NUMBER:"number",INTEGER:"integer",BOOLEAN:"boolean",FOREIGN:"foreign",ARRAY:"array",SET:"set",MAP:"map",RECORD:"record",FUNCTION:"function",JSON:"json"},yu=e=>Object.prototype.hasOwnProperty.call(e,"at_least_one_of"),sn=e=>e.type===ye.STRING,wi=e=>e.type===ye.NUMBER||e.type===ye.INTEGER,Oi=e=>e.type===ye.BOOLEAN,Ni=e=>e.type===ye.ARRAY||e.type===ye.SET,xi=e=>e.type===ye.MAP,Si=e=>e.type===ye.RECORD,rt=e=>e.replace(/%a/g,"[A-Za-z]").replace(/%d/g,"\\d").replace(/%l/g,"[a-z]").replace(/%p/g,"[!\"#$%&'()*+,\\-./:;<=>?@[\\]^_`{|}~]").replace(/%s/g,"\\s").replace(/%u/g,"[A-Z]").replace(/%w/g,"\\w").replace(/%x/g,"[0-9A-Fa-f]").replace(/%\(/g,"\\(").replace(/%\)/g,"\\)").replace(/%\./g,"\\.").replace(/%\+/g,"\\+").replace(/%-/g,"\\-").replace(/%\*/g,"\\*").replace(/%\?/g,"\\?").replace(/%\[/g,"\\[").replace(/%\^/g,"\\^").replace(/%\$/g,"\\$").replace(/%%/g,"%"),bu=e=>{const t={type:"string"};e.len_eq!==void 0?(t.minLength=e.len_eq,t.maxLength=e.len_eq):(t.minLength=e.len_min,t.maxLength=e.len_max),e.one_of!==void 0&&(t.enum=e.one_of);const n=[];return e.match!==void 0&&n.push({pattern:rt(e.match),$comment:"source: match"}),e.match_none&&n.push(...e.match_none.map(r=>{const i=rt(r.pattern);return{errorMessage:r.err,not:{pattern:i},$comment:"source: match_none"}})),e.match_any&&n.push({errorMessage:e.match_any.err,anyOf:e.match_any.patterns.map(r=>({pattern:rt(r)})),$comment:"source: match_any"}),e.match_all&&n.push(...e.match_all.map(r=>{const i=rt(r.pattern);return{errorMessage:r.err,pattern:i,$comment:"source: match_all"}})),n.length>0&&(t.allOf=n),t},vu=e=>{var n,r;const t={type:"number"};return t.minimum=(n=e.between)==null?void 0:n[0],t.maximum=(r=e.between)==null?void 0:r[1],typeof e.gt=="number"&&!Number.isNaN(e.gt)&&(typeof t.minimum!="number"||e.gt>t.minimum)&&(t.minimum=e.gt),e.one_of!==void 0&&(t.enum=e.one_of),t},Au=e=>({type:"boolean"}),ku=(e,t,n)=>{const r={type:"array",items:on(e,t.elements,n)};return typeof t.len_min=="number"&&!Number.isNaN(t.len_min)&&(r.minItems=t.len_min),typeof t.len_max=="number"&&!Number.isNaN(t.len_max)&&(r.maxItems=t.len_max),r},Tu=(e,t)=>{const n={type:"object",additionalProperties:!0},r={};if(sn(e.keys)&&e.keys.match_none)for(const i of e.keys.match_none)r[rt(i.pattern)]={not:{}};return r[".*"]=on("value",e.values,t),n.patternProperties=r,typeof e.len_min=="number"&&!Number.isNaN(e.len_min)&&(n.minProperties=e.len_min),typeof e.len_max=="number"&&!Number.isNaN(e.len_max)&&(n.maxProperties=e.len_max),n},wu=e=>({detail:"unknown",markdownDescription:"Unknown field type"}),Li=(e,t)=>{const n={},r=[],i={type:"object",properties:n};for(const s of e.fields){const[o,a]=Object.entries(s)[0];n[o]=on(o,a,t),t==="json"&&a.required&&r.push(o)}return r.length>0&&(i.required=r),i},on=(e,t,n)=>{const r=`${t.required?" ":""}${e}`,i={_fieldSchema:t,default:t.default,markdownDescription:[...t.required?["_Required_"]:[],`Type: \`${t.type}\``,t.description,...t.default?[`Default: \`${JSON.stringify(t.default)}\``]:[]].join(`
34
+
35
+ `)};switch(n){case"json":{i.suggestSortText=r;break}}return sn(t)?{...i,...bu(t)}:wi(t)?{...i,...vu(t)}:Oi(t)?{...i,...Au()}:Ni(t)?{...i,...ku(e,t,n)}:xi(t)?{...i,...Tu(t,n)}:Si(t)?{...i,...Li(t,n)}:(console.warn(`Unknown field schema with type "${t.type}": ${JSON.stringify(t)}`),{...i,...wu()})},Ou=async()=>{const[e,t]=await Promise.all([Promise.resolve().then(()=>_u).then(n=>n.default),Promise.resolve().then(()=>ju).then(n=>n.default)]);return window.MonacoEnvironment={getWorker(n,r){return r==="json"?new t:new e}},await import("monaco-editor")},_i=$s({});function Nu(e,t,n,r){const i=C.computed(()=>{const f=C.unref(n)||`unsaved_${gu()}`;return e.Uri.parse(`kong:///editor/entities/${f}.${C.unref(t)}`)}),s=C.computed(()=>{const f=C.unref(r);if(!f)return;const u=lu(Li(f,C.unref(t)));return u.properties={...u.properties},u}),o=C.computed(()=>{const f=C.unref(t),u=e.editor.getModel(i.value);return u&&u.dispose(),e.editor.createModel(f==="json"?"{}":"",f,i.value)}),a=C.computed(()=>{const f=C.unref(t);return ae.create(i.value.toString(),f,0,f==="json"?"{}":"")}),l=C.shallowRef(_i.parseJSONDocument(a.value));return{model:o,schema:s,uri:i,textDocument:a,languageSpecificDocument:l,onDidChangeModelContent:f=>{ae.update(a.value,f.changes.map(u=>({range:{start:a.value.positionAt(u.rangeOffset),end:a.value.positionAt(u.rangeOffset+u.rangeLength)},rangeLength:u.rangeLength,text:u.text})),a.value.version+1),l.value=_i.parseJSONDocument(a.value)}}}const xu={useMonacoEditor:Nu},Su=((e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n})(C.defineComponent({__name:"EntitiesConfigEditor",props:{language:{},id:{},luaSchema:{},foreignFetchers:{}},async setup(e){let t,n;const r=e,i=([t,n]=C.withAsyncContext(()=>Ou()),t=await t,n(),t);let s=[],o,a=[];const l=C.ref(),{language:c,id:f,luaSchema:u}=C.toRefs(r),d=C.ref(void 0),{model:g,schema:h,uri:b,textDocument:m,languageSpecificDocument:w,onDidChangeModelContent:j}=xu.useMonacoEditor(i,c,f,u),p=v=>{o.setModel(v)},N=(v,$)=>{const E=i.languages.json.jsonDefaults.diagnosticsOptions.schemas;i.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[...(E==null?void 0:E.filter(U=>U.uri.toString()!==$.toString()))??[],{uri:$.toString(),fileMatch:[$.toString()],schema:v}],schemaRequest:"ignore",enableSchemaRequest:!1})},T=()=>{var $;const v=o.getContribution("editor.contrib.suggestController");if(v){const E=($=v.widget)==null?void 0:$.value;E&&E._setDetailsVisible&&E._setDetailsVisible(!0)}};C.watch(g,v=>{console.log("model updated",v),p(v)}),C.watch([h,b],([v,$])=>{console.log("schema & uri updated",v,$),N(v,$)}),C.onBeforeUnmount(()=>{s.forEach(v=>v==null?void 0:v.dispose())});const A=(v,$)=>{if(v.type==="property")return!1;let E=v.parent;for(let U=$.length-1;U>=0;U--){if(!E||E.type!=="property"||E.keyNode.value!==$[U]||(E=E.parent,!E||E.type!=="object"))return!1;E=E.parent}return(E==null?void 0:E.parent)===void 0};return C.onMounted(async()=>{o=i.editor.create(l.value,{theme:"vs",quickSuggestions:{other:!0,comments:!1,strings:!0},automaticLayout:!0,tabSize:2}),T(),s.push(o.onDidChangeModelContent(v=>{T(),j(v)})),o.onDidChangeCursorPosition(v=>{var U;const $=m.value.offsetAt({line:v.position.lineNumber-1,character:v.position.column-1}),E=w.value.getNodeFromOffset($);if(d.value=E,(E==null?void 0:E.type)==="string"&&((U=E.parent)==null?void 0:U.type)==="property"&&E.parent.keyNode.value==="service"){const S=o.getContribution("editor.contrib.suggestController");S&&S.triggerSuggest()}}),s.push(i.editor.onDidChangeMarkers(v=>{var S;if(!v.find(x=>x.toString()===b.value.toString()))return;const E=[],U=i.editor.getModelMarkers({resource:b.value});for(const x of U){const P=w.value.getNodeFromOffset(m.value.offsetAt({line:x.startLineNumber-1,character:x.startColumn-1}));if(P!==void 0){const I=m.value.positionAt(P.offset),k=m.value.positionAt(P.offset+P.length);E.push({range:{startLineNumber:I.line+1,startColumn:1,endLineNumber:k.line+1,endColumn:1},options:{isWholeLine:!0,linesDecorationsClassName:"line-error-decorator"}}),E.push({range:{startLineNumber:x.startLineNumber,startColumn:1,endLineNumber:x.endLineNumber,endColumn:1},options:{isWholeLine:!0,className:"line-error"}})}a=((S=o.getModel())==null?void 0:S.deltaDecorations(a,E))??[]}})),s.push(i.languages.registerHoverProvider("json",{provideHover:async(v,$)=>{const E=w.value.getNodeFromOffset(m.value.offsetAt({line:$.lineNumber-1,character:$.column-1}));if(E){if(A(E,["service","id"]))return{range:{startLineNumber:$.lineNumber,startColumn:$.column,endLineNumber:$.lineNumber,endColumn:$.column},contents:[{value:"TODO: Hovering on a service ID. Show something meaningful here."}]};if(A(E,["service","name"]))return{range:{startLineNumber:$.lineNumber,startColumn:$.column,endLineNumber:$.lineNumber,endColumn:$.column},contents:[{value:"TODO: Hovering on a service name. Show something meaningful here."}]}}}})),o.setModel(g.value),N(h.value,b.value),o.focus(),s.push(o)}),(v,$)=>(C.openBlock(),C.createElementBlock("div",{ref_key:"editorRef",ref:l,class:"entities-config-editor"},null,512))}}),[["__scopeId","data-v-b4d23d4d"]]);function Lu(e){return new Worker("/assets/editor.worker-BKD3YLiN.js",{name:e==null?void 0:e.name})}const _u=Object.freeze(Object.defineProperty({__proto__:null,default:Lu},Symbol.toStringTag,{value:"Module"}));function Iu(e){return new Worker("/assets/json.worker-BXX47FAd.js",{name:e==null?void 0:e.name})}const ju=Object.freeze(Object.defineProperty({__proto__:null,default:Iu},Symbol.toStringTag,{value:"Module"}));W.EDITOR_LANGUAGES=mu,W.EntitiesConfigEditor=Su,W.FIELD_TYPES=ye,W.isArrayLikeField=Ni,W.isAtLeastOneOfEntityCheck=yu,W.isBooleanField=Oi,W.isMapField=xi,W.isNumberLikeField=wi,W.isRecordField=Si,W.isStringField=sn,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,11 @@
1
+ function r(e) {
2
+ return new Worker(
3
+ "/assets/json.worker-BXX47FAd.js",
4
+ {
5
+ name: e == null ? void 0 : e.name
6
+ }
7
+ );
8
+ }
9
+ export {
10
+ r as default
11
+ };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .entities-config-editor[data-v-b4d23d4d]{border:1px solid rgba(0,0,0,.1);display:flex;flex-direction:column;height:100%;width:100%}.entities-config-editor .plugin-config-editor-toolbar[data-v-b4d23d4d]{border-bottom:1px solid rgba(0,0,0,.1);display:flex;flex-direction:row;justify-content:flex-end;padding:8px}.entities-config-editor .plugin-config-editor-toolbar .language-control[data-v-b4d23d4d]{max-width:300px}.entities-config-editor .plugin-config-editor-wrapper[data-v-b4d23d4d]{display:flex;flex-direction:row;justify-content:space-between}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-editor[data-v-b4d23d4d]{flex-grow:1;height:500px}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-editor[data-v-b4d23d4d] .line-error-decorator{background-color:#ffdcdc;margin-left:3px;width:5px!important}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-editor[data-v-b4d23d4d] .line-error{background-color:#ff00000d}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-panel[data-v-b4d23d4d]{border-left:1px solid rgba(0,0,0,.1);padding:16px;width:300px}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-panel .suggested-properties-title[data-v-b4d23d4d]{font-weight:700;padding:8px}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-panel .suggested-properties[data-v-b4d23d4d]{display:flex;flex-direction:column}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-panel .suggested-properties .suggested-property[data-v-b4d23d4d]{border-bottom:1px solid rgba(0,0,0,.1);cursor:pointer;padding:8px;transition:background-color linear .2s}.entities-config-editor .plugin-config-editor-wrapper .plugin-config-editor-panel .suggested-properties .suggested-property[data-v-b4d23d4d]:hover{background-color:#0000000d}
@@ -1,3 +1,15 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ import type { ForeignCompletionFetchers } from 'src/types/foreign';
2
+ import { type EditorLanguage, type LuaSchema } from '../types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ language: EditorLanguage;
5
+ id?: string;
6
+ luaSchema?: LuaSchema;
7
+ foreignFetchers?: ForeignCompletionFetchers;
8
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
9
+ language: EditorLanguage;
10
+ id?: string;
11
+ luaSchema?: LuaSchema;
12
+ foreignFetchers?: ForeignCompletionFetchers;
13
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
14
  export default _default;
3
15
  //# sourceMappingURL=EntitiesConfigEditor.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntitiesConfigEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/EntitiesConfigEditor.vue"],"names":[],"mappings":";AAyEA,wBAKG"}
1
+ {"version":3,"file":"EntitiesConfigEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/EntitiesConfigEditor.vue"],"names":[],"mappings":"AAulBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAIlE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;;cAMlD,cAAc;SACnB,MAAM;gBACC,SAAS;sBACH,yBAAyB;;cAHjC,cAAc;SACnB,MAAM;gBACC,SAAS;sBACH,yBAAyB;;AAyjB7C,wBAMG"}
@@ -0,0 +1,6 @@
1
+ import useMonacoEditor from './useMonacoEditor';
2
+ declare const _default: {
3
+ useMonacoEditor: typeof useMonacoEditor;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAA;;;;AAE/C,wBAAkC"}
@@ -0,0 +1,18 @@
1
+ import type * as Monaco from 'monaco-editor';
2
+ import { TextDocument, type JSONDocument } from 'vscode-json-languageservice';
3
+ import { type MaybeRef } from 'vue';
4
+ import { type EditorLanguage, type LuaSchema } from '../types';
5
+ declare global {
6
+ interface Window {
7
+ require: any;
8
+ }
9
+ }
10
+ export default function useMonacoEditor(monaco: typeof Monaco, language: MaybeRef<EditorLanguage>, documentId: MaybeRef<string | undefined>, luaSchema: MaybeRef<LuaSchema | undefined>): {
11
+ model: import("vue").ComputedRef<Monaco.editor.ITextModel>;
12
+ schema: import("vue").ComputedRef<import("../types").ExtendedJSONSchema | undefined>;
13
+ uri: import("vue").ComputedRef<Monaco.Uri>;
14
+ textDocument: import("vue").ComputedRef<TextDocument>;
15
+ languageSpecificDocument: import("vue").ShallowRef<JSONDocument, JSONDocument>;
16
+ onDidChangeModelContent: (e: Monaco.editor.IModelContentChangedEvent) => void;
17
+ };
18
+ //# sourceMappingURL=useMonacoEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMonacoEditor.d.ts","sourceRoot":"","sources":["../../../src/composables/useMonacoEditor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,OAAO,EAEL,YAAY,EACZ,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAA+B,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAChE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAG9D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,EAAE,GAAG,CAAA;KACb;CACF;AAID,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,MAAM,EAAE,OAAO,MAAM,EACrB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,EAClC,UAAU,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,SAAS,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;;;;;;iCAoCN,MAAM,CAAC,MAAM,CAAC,yBAAyB;EA2B5E"}
@@ -0,0 +1,9 @@
1
+ export declare const EDITOR_LANGUAGES: {
2
+ readonly JSON: "json";
3
+ };
4
+ export type EditorLanguage = typeof EDITOR_LANGUAGES[keyof typeof EDITOR_LANGUAGES];
5
+ export interface EditingEntity {
6
+ kind: string;
7
+ identifier?: string;
8
+ }
9
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/types/editor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;CAEnB,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAA;AAEnF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}