BF:BFD[
5.658726] → [
5.658727:658759]
BF:BFD[
5.658759] → [
5.658760:658760]
B:BD[
5.658760] → [
5.658761:1811048]
(function () {
var v = process.version
var parts = v.slice(1).split('.')
var major = parseInt(parts[0], 10)
var minor = parseInt(parts[1], 10)
if (major < 12 || (major == 12 && minor < 12)) {
throw new Error('coc.nvim requires node >= v12.12.0, current version: ' + v)
}
})();
var x9=Object.create;var Al=Object.defineProperty,S9=Object.defineProperties,ZD=Object.getOwnPropertyDescriptor,C9=Object.getOwnPropertyDescriptors,_9=Object.getOwnPropertyNames,QD=Object.getOwnPropertySymbols,E9=Object.getPrototypeOf,eR=Object.prototype.hasOwnProperty,T9=Object.prototype.propertyIsEnumerable;var tR=(r,e,t)=>e in r?Al(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ut=(r,e)=>{for(var t in e||(e={}))eR.call(e,t)&&tR(r,t,e[t]);if(QD)for(var t of QD(e))T9.call(e,t)&&tR(r,t,e[t]);return r},ff=(r,e)=>S9(r,C9(e)),iR=r=>Al(r,"__esModule",{value:!0});var R=(r,e)=>()=>(r&&(e=r(r=0)),e);var x=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Bn=(r,e)=>{iR(r);for(var t in e)Al(r,t,{get:e[t],enumerable:!0})},D9=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _9(e))!eR.call(r,i)&&i!=="default"&&Al(r,i,{get:()=>e[i],enumerable:!(t=ZD(e,i))||t.enumerable});return r},E=r=>D9(iR(Al(r!=null?x9(E9(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),Nw=(r,e,t,i)=>{for(var n=i>1?void 0:i?ZD(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Al(e,t,n),n};var nR=x((_ge,rR)=>{var Fl=1e3,Ml=Fl*60,Nl=Ml*60,ca=Nl*24,R9=ca*7,P9=ca*365.25;rR.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return k9(r);if(t==="number"&&isFinite(r))return e.long?O9(r):I9(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function k9(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!!e){var t=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return t*P9;case"weeks":case"week":case"w":return t*R9;case"days":case"day":case"d":return t*ca;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Nl;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ml;case"seconds":case"second":case"secs":case"sec":case"s":return t*Fl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function I9(r){var e=Math.abs(r);return e>=ca?Math.round(r/ca)+"d":e>=Nl?Math.round(r/Nl)+"h":e>=Ml?Math.round(r/Ml)+"m":e>=Fl?Math.round(r/Fl)+"s":r+"ms"}function O9(r){var e=Math.abs(r);return e>=ca?Cp(r,e,ca,"day"):e>=Nl?Cp(r,e,Nl,"hour"):e>=Ml?Cp(r,e,Ml,"minute"):e>=Fl?Cp(r,e,Fl,"second"):r+" ms"}function Cp(r,e,t,i){var n=e>=t*1.5;return Math.round(r/t)+" "+i+(n?"s":"")}});var qw=x((Ege,sR)=>{function L9(r){t.debug=t,t.default=t,t.coerce=l,t.disable=s,t.enable=n,t.enabled=o,t.humanize=nR(),t.destroy=c,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let d=0;d<u.length;d++)f=(f<<5)-f+u.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,d=null,h,p;function g(...b){if(!g.enabled)return;let y=g,S=Number(new Date),w=S-(f||S);y.diff=w,y.prev=f,y.curr=S,f=S,b[0]=t.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let _=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,($,I)=>{if($==="%%")return"%";_++;let W=t.formatters[I];if(typeof W=="function"){let A=b[_];$=W.call(y,A),b.splice(_,1),_--}return $}),t.formatArgs.call(y,b),(y.log||t.log).apply(y,b)}return g.namespace=u,g.useColors=t.useColors(),g.color=t.selectColor(u),g.extend=i,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==t.namespaces&&(h=t.namespaces,p=t.enabled(u)),p),set:b=>{d=b}}),typeof t.init=="function"&&t.init(g),g}function i(u,f){let d=t(this.namespace+(typeof f=="undefined"?":":f)+u);return d.log=this.log,d}function n(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f,d=(typeof u=="string"?u:"").split(/[\s,]+/),h=d.length;for(f=0;f<h;f++)!d[f]||(u=d[f].replace(/\*/g,".*?"),u[0]==="-"?t.skips.push(new RegExp("^"+u.substr(1)+"$")):t.names.push(new RegExp("^"+u+"$")))}function s(){let u=[...t.names.map(a),...t.skips.map(a).map(f=>"-"+f)].join(",");return t.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let f,d;for(f=0,d=t.skips.length;f<d;f++)if(t.skips[f].test(u))return!1;for(f=0,d=t.names.length;f<d;f++)if(t.names[f].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}sR.exports=L9});var oR=x((gr,_p)=>{gr.formatArgs=F9;gr.save=M9;gr.load=N9;gr.useColors=A9;gr.storage=q9();gr.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();gr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function A9(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function F9(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+_p.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,i=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(i=t))}),r.splice(i,0,e)}gr.log=console.debug||console.log||(()=>{});function M9(r){try{r?gr.storage.setItem("debug",r):gr.storage.removeItem("debug")}catch(e){}}function N9(){let r;try{r=gr.storage.getItem("debug")}catch(e){}return!r&&typeof process!="undefined"&&"env"in process&&(r=process.env.DEBUG),r}function q9(){try{return localStorage}catch(r){}}_p.exports=qw()(gr);var{formatters:$9}=_p.exports;$9.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var lR=x((Tge,aR)=>{"use strict";aR.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",i=e.indexOf(t+r),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}});var fR=x((Dge,uR)=>{"use strict";var B9=require("os"),cR=require("tty"),Or=lR(),{env:ei}=process,no;Or("no-color")||Or("no-colors")||Or("color=false")||Or("color=never")?no=0:(Or("color")||Or("colors")||Or("color=true")||Or("color=always"))&&(no=1);"FORCE_COLOR"in ei&&(ei.FORCE_COLOR==="true"?no=1:ei.FORCE_COLOR==="false"?no=0:no=ei.FORCE_COLOR.length===0?1:Math.min(parseInt(ei.FORCE_COLOR,10),3));function $w(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Bw(r,e){if(no===0)return 0;if(Or("color=16m")||Or("color=full")||Or("color=truecolor"))return 3;if(Or("color=256"))return 2;if(r&&!e&&no===void 0)return 0;let t=no||0;if(ei.TERM==="dumb")return t;if(process.platform==="win32"){let i=B9.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in ei)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in ei)||ei.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in ei)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ei.TEAMCITY_VERSION)?1:0;if(ei.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ei){let i=parseInt((ei.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ei.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ei.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ei.TERM)||"COLORTERM"in ei?1:t}function j9(r){let e=Bw(r,r&&r.isTTY);return $w(e)}uR.exports={supportsColor:j9,stdout:$w(Bw(!0,cR.isatty(1))),stderr:$w(Bw(!0,cR.isatty(2)))}});var hR=x((ai,Tp)=>{var U9=require("tty"),Ep=require("util");ai.init=J9;ai.log=V9;ai.formatArgs=W9;ai.save=G9;ai.load=K9;ai.useColors=H9;ai.destroy=Ep.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ai.colors=[6,2,3,4,5,1];try{let r=fR();r&&(r.stderr||r).level>=2&&(ai.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(r){}ai.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,s)=>s.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),r[t]=i,r},{});function H9(){return"colors"in ai.inspectOpts?Boolean(ai.inspectOpts.colors):U9.isatty(process.stderr.fd)}function W9(r){let{namespace:e,useColors:t}=this;if(t){let i=this.color,n="[3"+(i<8?i:"8;5;"+i),s=` ${n};1m${e} [0m`;r[0]=s+r[0].split(`
`).join(`
`+s),r.push(n+"m+"+Tp.exports.humanize(this.diff)+"[0m")}else r[0]=z9()+e+" "+r[0]}function z9(){return ai.inspectOpts.hideDate?"":new Date().toISOString()+" "}function V9(...r){return process.stderr.write(Ep.format(...r)+`
`)}function G9(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function K9(){return process.env.DEBUG}function J9(r){r.inspectOpts={};let e=Object.keys(ai.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=ai.inspectOpts[e[t]]}Tp.exports=qw()(ai);var{formatters:dR}=Tp.exports;dR.o=function(r){return this.inspectOpts.colors=this.useColors,Ep.inspect(r,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};dR.O=function(r){return this.inspectOpts.colors=this.useColors,Ep.inspect(r,this.inspectOpts)}});var Bt=x((Rge,jw)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?jw.exports=oR():jw.exports=hR()});var mR=x((Pge,pR)=>{"use strict";pR.exports=Y9;function ql(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function Y9(r){if(r=r||{},r.circles)return X9(r);return r.proto?i:t;function e(n,s){for(var o=Object.keys(n),a=new Array(o.length),l=0;l<o.length;l++){var c=o[l],u=n[c];typeof u!="object"||u===null?a[c]=u:u instanceof Date?a[c]=new Date(u):ArrayBuffer.isView(u)?a[c]=ql(u):a[c]=s(u)}return a}function t(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,t);if(n instanceof Map)return new Map(e(Array.from(n),t));if(n instanceof Set)return new Set(e(Array.from(n),t));var s={};for(var o in n)if(Object.hasOwnProperty.call(n,o)!==!1){var a=n[o];typeof a!="object"||a===null?s[o]=a:a instanceof Date?s[o]=new Date(a):a instanceof Map?s[o]=new Map(e(Array.from(a),t)):a instanceof Set?s[o]=new Set(e(Array.from(a),t)):ArrayBuffer.isView(a)?s[o]=ql(a):s[o]=t(a)}return s}function i(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,i);if(n instanceof Map)return new Map(e(Array.from(n),i));if(n instanceof Set)return new Set(e(Array.from(n),i));var s={};for(var o in n){var a=n[o];typeof a!="object"||a===null?s[o]=a:a instanceof Date?s[o]=new Date(a):a instanceof Map?s[o]=new Map(e(Array.from(a),i)):a instanceof Set?s[o]=new Set(e(Array.from(a),i)):ArrayBuffer.isView(a)?s[o]=ql(a):s[o]=i(a)}return s}}function X9(r){var e=[],t=[];return r.proto?s:n;function i(o,a){for(var l=Object.keys(o),c=new Array(l.length),u=0;u<l.length;u++){var f=l[u],d=o[f];if(typeof d!="object"||d===null)c[f]=d;else if(d instanceof Date)c[f]=new Date(d);else if(ArrayBuffer.isView(d))c[f]=ql(d);else{var h=e.indexOf(d);h!==-1?c[f]=t[h]:c[f]=a(d)}}return c}function n(o){if(typeof o!="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return i(o,n);if(o instanceof Map)return new Map(i(Array.from(o),n));if(o instanceof Set)return new Set(i(Array.from(o),n));var a={};e.push(o),t.push(a);for(var l in o)if(Object.hasOwnProperty.call(o,l)!==!1){var c=o[l];if(typeof c!="object"||c===null)a[l]=c;else if(c instanceof Date)a[l]=new Date(c);else if(c instanceof Map)a[l]=new Map(i(Array.from(c),n));else if(c instanceof Set)a[l]=new Set(i(Array.from(c),n));else if(ArrayBuffer.isView(c))a[l]=ql(c);else{var u=e.indexOf(c);u!==-1?a[l]=t[u]:a[l]=n(c)}}return e.pop(),t.pop(),a}function s(o){if(typeof o!="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return i(o,s);if(o instanceof Map)return new Map(i(Array.from(o),s));if(o instanceof Set)return new Set(i(Array.from(o),s));var a={};e.push(o),t.push(a);for(var l in o){var c=o[l];if(typeof c!="object"||c===null)a[l]=c;else if(c instanceof Date)a[l]=new Date(c);else if(c instanceof Map)a[l]=new Map(i(Array.from(c),s));else if(c instanceof Set)a[l]=new Set(i(Array.from(c),s));else if(ArrayBuffer.isView(c))a[l]=ql(c);else{var u=e.indexOf(c);u!==-1?a[l]=t[u]:a[l]=s(c)}}return e.pop(),t.pop(),a}}});var fa=x((kge,yR)=>{var Z9=require("util"),ua=Bt()("log4js:configuration"),Dp=[],Rp=[],gR=r=>!r,vR=r=>r&&typeof r=="object"&&!Array.isArray(r),Q9=r=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(r),eK=r=>r&&typeof r=="number"&&Number.isInteger(r),tK=r=>{Rp.push(r),ua(`Added listener, now ${Rp.length} listeners`)},iK=r=>{Dp.push(r),ua(`Added pre-processing listener, now ${Dp.length} listeners`)},bR=(r,e,t)=>{(Array.isArray(e)?e:[e]).forEach(n=>{if(n)throw new Error(`Problem with log4js configuration: (${Z9.inspect(r,{depth:5})}) - ${t}`)})},rK=r=>{ua("New configuration to be validated: ",r),bR(r,gR(vR(r)),"must be an object."),ua(`Calling pre-processing listeners (${Dp.length})`),Dp.forEach(e=>e(r)),ua("Configuration pre-processing finished."),ua(`Calling configuration listeners (${Rp.length})`),Rp.forEach(e=>e(r)),ua("Configuration finished.")};yR.exports={configure:rK,addListener:tK,addPreProcessingListener:iK,throwExceptionIf:bR,anObject:vR,anInteger:eK,validIdentifier:Q9,not:gR}});var SR=x((Ige,Lr)=>{"use strict";function wR(r,e){for(var t=r.toString();t.length<e;)t="0"+t;return t}function da(r){return wR(r,2)}function nK(r){var e=Math.abs(r),t=String(Math.floor(e/60)),i=String(e%60);return t.length===1&&(t="0"+t),i.length===1&&(i="0"+i),r<0?"+"+t+i:"-"+t+i}function xR(r,e){typeof r!="string"&&(e=r,r=Lr.exports.ISO8601_FORMAT),e||(e=Lr.exports.now());var t=da(e.getDate()),i=da(e.getMonth()+1),n=da(e.getFullYear()),s=da(n.substring(2,4)),o=r.indexOf("yyyy")>-1?n:s,a=da(e.getHours()),l=da(e.getMinutes()),c=da(e.getSeconds()),u=wR(e.getMilliseconds(),3),f=nK(e.getTimezoneOffset()),d=r.replace(/dd/g,t).replace(/MM/g,i).replace(/y{1,4}/g,o).replace(/hh/g,a).replace(/mm/g,l).replace(/ss/g,c).replace(/SSS/g,u).replace(/O/g,f);return d}function ha(r,e,t,i){r["set"+(i?"":"UTC")+e](t)}function sK(r,e,t){var i=r.indexOf("O")<0,n=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(u,f){ha(u,"FullYear",f,i)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(u,f){ha(u,"Month",f-1,i)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(u,f){ha(u,"Date",f,i)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(u,f){ha(u,"Hours",f,i)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(u,f){ha(u,"Minutes",f,i)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(u,f){ha(u,"Seconds",f,i)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(u,f){ha(u,"Milliseconds",f,i)}},{pattern:/O/,regexp:"[+-]\\d{3,4}|Z",fn:function(u,f){f==="Z"&&(f=0);var d=Math.abs(f),h=(f>0?-1:1)*(d%100+Math.floor(d/100)*60);u.setUTCMinutes(u.getUTCMinutes()+h)}}],s=n.reduce(function(u,f){return f.pattern.test(u.regexp)?(f.index=u.regexp.match(f.pattern).index,u.regexp=u.regexp.replace(f.pattern,"("+f.regexp+")")):f.index=-1,u},{regexp:r,index:[]}),o=n.filter(function(u){return u.index>-1});o.sort(function(u,f){return u.index-f.index});var a=new RegExp(s.regexp),l=a.exec(e);if(l){var c=t||Lr.exports.now();return o.forEach(function(u,f){u.fn(c,l[f+1])}),c}throw new Error("String '"+e+"' could not be parsed as '"+r+"'")}function oK(r,e,t){if(!r)throw new Error("pattern must be supplied");return sK(r,e,t)}function aK(){return new Date}Lr.exports=xR;Lr.exports.asString=xR;Lr.exports.parse=oK;Lr.exports.now=aK;Lr.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS";Lr.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO";Lr.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS";Lr.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"});var Hw=x((Oge,LR)=>{var so=SR(),CR=require("os"),df=require("util"),_R=require("path"),ER={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function TR(r){return r?`[${ER[r][0]}m`:""}function DR(r){return r?`[${ER[r][1]}m`:""}function lK(r,e){return TR(e)+r+DR(e)}function RR(r,e){return lK(df.format("[%s] [%s] %s - ",so.asString(r.startTime),r.level.toString(),r.categoryName),e)}function PR(r){return RR(r)+df.format(...r.data)}function Pp(r){return RR(r,r.level.colour)+df.format(...r.data)}function kR(r){return df.format(...r.data)}function IR(r){return r.data[0]}function OR(r,e){let t="%r %p %c - %m%n",i=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;r=r||t;function n(k,F){let j=k.categoryName;if(F){let X=parseInt(F,10),ae=j.split(".");X<ae.length&&(j=ae.slice(ae.length-X).join("."))}return j}function s(k,F){let j=so.ISO8601_FORMAT;return F&&(j=F,j==="ISO8601"?j=so.ISO8601_FORMAT:j==="ISO8601_WITH_TZ_OFFSET"?j=so.ISO8601_WITH_TZ_OFFSET_FORMAT:j==="ABSOLUTE"?j=so.ABSOLUTETIME_FORMAT:j==="DATE"&&(j=so.DATETIME_FORMAT)),so.asString(j,k.startTime)}function o(){return CR.hostname().toString()}function a(k){return df.format(...k.data)}function l(){return CR.EOL}function c(k){return k.level.toString()}function u(k){return so.asString("hh:mm:ss",k.startTime)}function f(k){return TR(k.level.colour)}function d(k){return DR(k.level.colour)}function h(){return"%"}function p(k){return k&&k.pid?k.pid.toString():process.pid.toString()}function g(){return p()}function b(k,F){return typeof e[F]!="undefined"?typeof e[F]=="function"?e[F](k):e[F]:null}function y(k,F){let j=k.context[F];return typeof j!="undefined"?typeof j=="function"?j(k):j:null}function S(k,F){let j=k.fileName||"";if(F){let X=parseInt(F,10),ae=j.split(_R.sep);ae.length>X&&(j=ae.slice(-X).join(_R.sep))}return j}function w(k){return k.lineNumber?`${k.lineNumber}`:""}function _(k){return k.columnNumber?`${k.columnNumber}`:""}function L(k){return k.callStack||""}let $={c:n,d:s,h:o,m:a,n:l,p:c,r:u,"[":f,"]":d,y:g,z:p,"%":h,x:b,X:y,f:S,l:w,o:_,s:L};function I(k,F,j){return $[k](F,j)}function W(k,F){let j;return k?(j=parseInt(k.substr(1),10),j>0?F.slice(0,j):F.slice(j)):F}function A(k,F){let j;if(k)if(k.charAt(0)==="-")for(j=parseInt(k.substr(1),10);F.length<j;)F+=" ";else for(j=parseInt(k,10);F.length<j;)F=` ${F}`;return F}function M(k,F,j){let X=k;return X=W(F,X),X=A(j,X),X}return function(k){let F="",j,X=r;for(;(j=i.exec(X))!==null;){let ae=j[1],Pe=j[2],ke=j[3],Qe=j[5],St=j[6];if(St)F+=St.toString();else{let bi=I(ke,k,Qe);F+=M(bi,Pe,ae)}X=X.substr(j.index+j[0].length)}return F}}var Uw={messagePassThrough(){return kR},basic(){return PR},colored(){return Pp},coloured(){return Pp},pattern(r){return OR(r&&r.pattern,r&&r.tokens)},dummy(){return IR}};LR.exports={basicLayout:PR,messagePassThroughLayout:kR,patternLayout:OR,colouredLayout:Pp,coloredLayout:Pp,dummyLayout:IR,addLayout(r,e){Uw[r]=e},layout(r,e){return Uw[r]&&Uw[r](e)}}});var pa=x((Lge,FR)=>{var jt=fa(),AR=["white","grey","black","blue","cyan","green","magenta","red","yellow"],Xt=class{constructor(e,t,i){this.level=e,this.levelStr=t,this.colour=i}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Xt?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Xt[e.toString().toUpperCase()]||t):t}static addLevels(e){e&&(Object.keys(e).forEach(i=>{let n=i.toUpperCase();Xt[n]=new Xt(e[i].value,n,e[i].colour);let s=Xt.levels.findIndex(o=>o.levelStr===n);s>-1?Xt.levels[s]=Xt[n]:Xt.levels.push(Xt[n])}),Xt.levels.sort((i,n)=>i.level-n.level))}isLessThanOrEqualTo(e){return typeof e=="string"&&(e=Xt.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return typeof e=="string"&&(e=Xt.getLevel(e)),this.level>=e.level}isEqualTo(e){return typeof e=="string"&&(e=Xt.getLevel(e)),this.level===e.level}};Xt.levels=[];Xt.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}});jt.addListener(r=>{let e=r.levels;e&&(jt.throwExceptionIf(r,jt.not(jt.anObject(e)),"levels must be an object"),Object.keys(e).forEach(i=>{jt.throwExceptionIf(r,jt.not(jt.validIdentifier(i)),`level name "${i}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),jt.throwExceptionIf(r,jt.not(jt.anObject(e[i])),`level "${i}" must be an object`),jt.throwExceptionIf(r,jt.not(e[i].value),`level "${i}" must have a 'value' property`),jt.throwExceptionIf(r,jt.not(jt.anInteger(e[i].value)),`level "${i}".value must have an integer value`),jt.throwExceptionIf(r,jt.not(e[i].colour),`level "${i}" must have a 'colour' property`),jt.throwExceptionIf(r,jt.not(AR.indexOf(e[i].colour)>-1),`level "${i}".colour must be one of ${AR.join(", ")}`)}))});jt.addListener(r=>{Xt.addLevels(r.levels)});FR.exports=Xt});var MR={};Bn(MR,{default:()=>cK,parse:()=>uK,stringify:()=>fK});var Ww,cK,uK,fK,NR=R(()=>{Ww=function(r,e){var t={parse:function(c,u){var f=JSON.parse(c,a).map(o),d=f[0],h=u||i,p=typeof d=="object"&&d?n(f,new Set,d,h):d;return h.call({"":p},"",p)},stringify:function(c,u,f){for(var d,h=new Map,p=[],g=[],b=u&&typeof u==typeof p?function(w,_){if(w===""||-1<u.indexOf(w))return _}:u||i,y=+s(h,p,b.call({"":c},"",c)),S=function(w,_){if(d)return d=!d,_;var L=b.call(this,w,_);switch(typeof L){case"object":if(L===null)return L;case e:return h.get(L)||s(h,p,L)}return L};y<p.length;y++)d=!0,g[y]=JSON.stringify(p[y],S,f);return"["+g.join(",")+"]"}};return t;function i(l,c){return c}function n(l,c,u,f){return Object.keys(u).reduce(function(d,h){var p=d[h];if(p instanceof r){var g=l[p];typeof g=="object"&&!c.has(g)?(c.add(g),d[h]=f.call(d,h,n(l,c,g,f))):d[h]=f.call(d,h,g)}else d[h]=f.call(d,h,p);return d},u)}function s(l,c,u){var f=r(c.push(u)-1);return l.set(u,f),f}function o(l){return l instanceof r?r(l):l}function a(l,c){return typeof c===e?new r(c):c}}(String,"string"),cK=Ww,uK=Ww.parse,fK=Ww.stringify});var zw=x((Age,BR)=>{var qR=(NR(),MR),$R=pa(),hf=class{constructor(e,t,i,n,s){this.startTime=new Date,this.categoryName=e,this.data=i,this.level=t,this.context=Object.assign({},n),this.pid=process.pid,s&&(this.functionName=s.functionName,this.fileName=s.fileName,this.lineNumber=s.lineNumber,this.columnNumber=s.columnNumber,this.callStack=s.callStack)}serialise(){let e=this.data.map(t=>(t&&t.message&&t.stack&&(t=Object.assign({message:t.message,stack:t.stack},t)),t));return this.data=e,qR.stringify(this)}static deserialise(e){let t;try{let i=qR.parse(e);i.data=i.data.map(n=>{if(n&&n.message&&n.stack){let s=new Error(n);Object.keys(n).forEach(o=>{s[o]=n[o]}),n=s}return n}),t=new hf(i.categoryName,$R.getLevel(i.level.levelStr),i.data,i.context),t.startTime=new Date(i.startTime),t.pid=i.pid,t.cluster=i.cluster}catch(i){t=new hf("log4js",$R.ERROR,["Unable to parse log:",e,"because: ",i])}return t}};BR.exports=hf});var Ip=x((Fge,HR)=>{var Ar=Bt()("log4js:clustering"),dK=zw(),hK=fa(),$l=!1,jn=null;try{jn=require("cluster")}catch(r){Ar("cluster module not present"),$l=!0}var Vw=[],pf=!1,mf="NODE_APP_INSTANCE",jR=()=>pf&&process.env[mf]==="0",Gw=()=>$l||jn.isMaster||jR(),UR=r=>{Vw.forEach(e=>e(r))},kp=(r,e)=>{if(Ar("cluster message received from worker ",r,": ",e),r.topic&&r.data&&(e=r,r=void 0),e&&e.topic&&e.topic==="log4js:message"){Ar("received message: ",e.data);let t=dK.deserialise(e.data);UR(t)}};$l||hK.addListener(r=>{Vw.length=0,{pm2:pf,disableClustering:$l,pm2InstanceVar:mf="NODE_APP_INSTANCE"}=r,Ar(`clustering disabled ? ${$l}`),Ar(`cluster.isMaster ? ${jn&&jn.isMaster}`),Ar(`pm2 enabled ? ${pf}`),Ar(`pm2InstanceVar = ${mf}`),Ar(`process.env[${mf}] = ${process.env[mf]}`),pf&&process.removeListener("message",kp),jn&&jn.removeListener&&jn.removeListener("message",kp),$l||r.disableClustering?Ar("Not listening for cluster messages, because clustering disabled."):jR()?(Ar("listening for PM2 broadcast messages"),process.on("message",kp)):jn.isMaster?(Ar("listening for cluster messages"),jn.on("message",kp)):Ar("not listening for messages, because we are not a master process")});HR.exports={onlyOnMaster:(r,e)=>Gw()?r():e,isMaster:Gw,send:r=>{Gw()?UR(r):(pf||(r.cluster={workerId:jn.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:r.serialise()}))},onMessage:r=>{Vw.push(r)}}});var GR=x((Mge,VR)=>{function pK(r){if(typeof r=="number"&&Number.isInteger(r))return r;let e={K:1024,M:1024*1024,G:1024*1024*1024},t=Object.keys(e),i=r.substr(r.length-1).toLocaleUpperCase(),n=r.substring(0,r.length-1).trim();if(t.indexOf(i)<0||!Number.isInteger(Number(n)))throw Error(`maxLogSize: "${r}" is invalid`);return n*e[i]}function mK(r,e){let t=Object.assign({},e);return Object.keys(r).forEach(i=>{t[i]&&(t[i]=r[i](e[i]))}),t}function WR(r){return mK({maxLogSize:pK},r)}var zR={file:WR,fileSync:WR};VR.exports.modifyConfig=r=>zR[r.type]?zR[r.type](r):r});var JR=x((Nge,KR)=>{var gK=console.log.bind(console);function vK(r,e){return t=>{gK(r(t,e))}}function bK(r,e){let t=e.colouredLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),vK(t,r.timezoneOffset)}KR.exports.configure=bK});var XR=x(YR=>{function yK(r,e){return t=>{process.stdout.write(`${r(t,e)}
`)}}function wK(r,e){let t=e.colouredLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),yK(t,r.timezoneOffset)}YR.configure=wK});var QR=x(($ge,ZR)=>{function xK(r,e){return t=>{process.stderr.write(`${r(t,e)}
`)}}function SK(r,e){let t=e.colouredLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),xK(t,r.timezoneOffset)}ZR.exports.configure=SK});var tP=x((Bge,eP)=>{function CK(r,e,t,i){let n=i.getLevel(r),s=i.getLevel(e,i.FATAL);return o=>{let a=o.level;a.isGreaterThanOrEqualTo(n)&&a.isLessThanOrEqualTo(s)&&t(o)}}function _K(r,e,t,i){let n=t(r.appender);return CK(r.level,r.maxLevel,n,i)}eP.exports.configure=_K});var nP=x((jge,rP)=>{var iP=Bt()("log4js:categoryFilter");function EK(r,e){return typeof r=="string"&&(r=[r]),t=>{iP(`Checking ${t.categoryName} against ${r}`),r.indexOf(t.categoryName)===-1&&(iP("Not excluded, sending to appender"),e(t))}}function TK(r,e,t){let i=t(r.appender);return EK(r.exclude,i)}rP.exports.configure=TK});var aP=x((Uge,oP)=>{var sP=Bt()("log4js:noLogFilter");function DK(r){return r.filter(t=>t!=null&&t!=="")}function RK(r,e){return t=>{sP(`Checking data: ${t.data} against filters: ${r}`),typeof r=="string"&&(r=[r]),r=DK(r);let i=new RegExp(r.join("|"),"i");(r.length===0||t.data.findIndex(n=>i.test(n))<0)&&(sP("Not excluded, sending to appender"),e(t))}}function PK(r,e,t){let i=t(r.appender);return RK(r.exclude,i)}oP.exports.configure=PK});var Ki=x(Kw=>{"use strict";Kw.fromCallback=function(r){return Object.defineProperty(function(){if(typeof arguments[arguments.length-1]=="function")r.apply(this,arguments);else return new Promise((e,t)=>{arguments[arguments.length]=(i,n)=>{if(i)return t(i);e(n)},arguments.length++,r.apply(this,arguments)})},"name",{value:r.name})};Kw.fromPromise=function(r){return Object.defineProperty(function(){let e=arguments[arguments.length-1];if(typeof e!="function")return r.apply(this,arguments);r.apply(this,arguments).then(t=>e(null,t),e)},"name",{value:r.name})}});var cP=x((Wge,lP)=>{var oo=require("constants"),kK=process.cwd,Op=null,IK=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Op||(Op=kK.call(process)),Op};try{process.cwd()}catch(r){}typeof process.chdir=="function"&&(Jw=process.chdir,process.chdir=function(r){Op=null,Jw.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Jw));var Jw;lP.exports=OK;function OK(r){oo.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(r),r.lutimes||t(r),r.chown=s(r.chown),r.fchown=s(r.fchown),r.lchown=s(r.lchown),r.chmod=i(r.chmod),r.fchmod=i(r.fchmod),r.lchmod=i(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=n(r.chmodSync),r.fchmodSync=n(r.fchmodSync),r.lchmodSync=n(r.lchmodSync),r.stat=a(r.stat),r.fstat=a(r.fstat),r.lstat=a(r.lstat),r.statSync=l(r.statSync),r.fstatSync=l(r.fstatSync),r.lstatSync=l(r.lstatSync),r.lchmod||(r.lchmod=function(u,f,d){d&&process.nextTick(d)},r.lchmodSync=function(){}),r.lchown||(r.lchown=function(u,f,d,h){h&&process.nextTick(h)},r.lchownSync=function(){}),IK==="win32"&&(r.rename=function(u){return function(f,d,h){var p=Date.now(),g=0;u(f,d,function b(y){if(y&&(y.code==="EACCES"||y.code==="EPERM")&&Date.now()-p<6e4){setTimeout(function(){r.stat(d,function(S,w){S&&S.code==="ENOENT"?u(f,d,b):h(y)})},g),g<100&&(g+=10);return}h&&h(y)})}}(r.rename)),r.read=function(u){function f(d,h,p,g,b,y){var S;if(y&&typeof y=="function"){var w=0;S=function(_,L,$){if(_&&_.code==="EAGAIN"&&w<10)return w++,u.call(r,d,h,p,g,b,S);y.apply(this,arguments)}}return u.call(r,d,h,p,g,b,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(r.read),r.readSync=function(u){return function(f,d,h,p,g){for(var b=0;;)try{return u.call(r,f,d,h,p,g)}catch(y){if(y.code==="EAGAIN"&&b<10){b++;continue}throw y}}}(r.readSync);function e(u){u.lchmod=function(f,d,h){u.open(f,oo.O_WRONLY|oo.O_SYMLINK,d,function(p,g){if(p){h&&h(p);return}u.fchmod(g,d,function(b){u.close(g,function(y){h&&h(b||y)})})})},u.lchmodSync=function(f,d){var h=u.openSync(f,oo.O_WRONLY|oo.O_SYMLINK,d),p=!0,g;try{g=u.fchmodSync(h,d),p=!1}finally{if(p)try{u.closeSync(h)}catch(b){}else u.closeSync(h)}return g}}function t(u){oo.hasOwnProperty("O_SYMLINK")?(u.lutimes=function(f,d,h,p){u.open(f,oo.O_SYMLINK,function(g,b){if(g){p&&p(g);return}u.futimes(b,d,h,function(y){u.close(b,function(S){p&&p(y||S)})})})},u.lutimesSync=function(f,d,h){var p=u.openSync(f,oo.O_SYMLINK),g,b=!0;try{g=u.futimesSync(p,d,h),b=!1}finally{if(b)try{u.closeSync(p)}catch(y){}else u.closeSync(p)}return g}):(u.lutimes=function(f,d,h,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function i(u){return u&&function(f,d,h){return u.call(r,f,d,function(p){c(p)&&(p=null),h&&h.apply(this,arguments)})}}function n(u){return u&&function(f,d){try{return u.call(r,f,d)}catch(h){if(!c(h))throw h}}}function s(u){return u&&function(f,d,h,p){return u.call(r,f,d,h,function(g){c(g)&&(g=null),p&&p.apply(this,arguments)})}}function o(u){return u&&function(f,d,h){try{return u.call(r,f,d,h)}catch(p){if(!c(p))throw p}}}function a(u){return u&&function(f,d,h){typeof d=="function"&&(h=d,d=null);function p(g,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),h&&h.apply(this,arguments)}return d?u.call(r,f,d,p):u.call(r,f,p)}}function l(u){return u&&function(f,d){var h=d?u.call(r,f,d):u.call(r,f);return h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296),h}}function c(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var dP=x((zge,fP)=>{var uP=require("stream").Stream;fP.exports=LK;function LK(r){return{ReadStream:e,WriteStream:t};function e(i,n){if(!(this instanceof e))return new e(i,n);uP.call(this);var s=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),a=0,l=o.length;a<l;a++){var c=o[a];this[c]=n[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}r.open(this.path,this.flags,this.mode,function(u,f){if(u){s.emit("error",u),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function t(i,n){if(!(this instanceof t))return new t(i,n);uP.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o<a;o++){var l=s[o];this[l]=n[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var pP=x((Vge,hP)=>{"use strict";hP.exports=FK;var AK=Object.getPrototypeOf||function(r){return r.__proto__};function FK(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var e={__proto__:AK(r)};else var e=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}});var Le=x((Gge,Xw)=>{var li=require("fs"),MK=cP(),NK=dP(),qK=pP(),Lp=require("util"),dn,Ap;typeof Symbol=="function"&&typeof Symbol.for=="function"?(dn=Symbol.for("graceful-fs.queue"),Ap=Symbol.for("graceful-fs.previous")):(dn="___graceful-fs.queue",Ap="___graceful-fs.previous");function $K(){}function mP(r,e){Object.defineProperty(r,dn,{get:function(){return e}})}var gf=$K;Lp.debuglog?gf=Lp.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(gf=function(){var r=Lp.format.apply(Lp,arguments);r="GFS4: "+r.split(/\n/).join(`
GFS4: `),console.error(r)});li[dn]||(gP=global[dn]||[],mP(li,gP),li.close=function(r){function e(t,i){return r.call(li,t,function(n){n||ao(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,Ap,{value:r}),e}(li.close),li.closeSync=function(r){function e(t){r.apply(li,arguments),ao()}return Object.defineProperty(e,Ap,{value:r}),e}(li.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){gf(li[dn]),require("assert").equal(li[dn].length,0)}));var gP;global[dn]||mP(global,li[dn]);Xw.exports=Yw(qK(li));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!li.__patched&&(Xw.exports=Yw(li),li.__patched=!0);function Yw(r){MK(r),r.gracefulify=Yw,r.createReadStream=L,r.createWriteStream=$;var e=r.readFile;r.readFile=t;function t(A,M,k){return typeof M=="function"&&(k=M,M=null),F(A,M,k);function F(j,X,ae){return e(j,X,function(Pe){Pe&&(Pe.code==="EMFILE"||Pe.code==="ENFILE")?Bl([F,[j,X,ae]]):(typeof ae=="function"&&ae.apply(this,arguments),ao())})}}var i=r.writeFile;r.writeFile=n;function n(A,M,k,F){return typeof k=="function"&&(F=k,k=null),j(A,M,k,F);function j(X,ae,Pe,ke){return i(X,ae,Pe,function(Qe){Qe&&(Qe.code==="EMFILE"||Qe.code==="ENFILE")?Bl([j,[X,ae,Pe,ke]]):(typeof ke=="function"&&ke.apply(this,arguments),ao())})}}var s=r.appendFile;s&&(r.appendFile=o);function o(A,M,k,F){return typeof k=="function"&&(F=k,k=null),j(A,M,k,F);function j(X,ae,Pe,ke){return s(X,ae,Pe,function(Qe){Qe&&(Qe.code==="EMFILE"||Qe.code==="ENFILE")?Bl([j,[X,ae,Pe,ke]]):(typeof ke=="function"&&ke.apply(this,arguments),ao())})}}var a=r.copyFile;a&&(r.copyFile=l);function l(A,M,k,F){return typeof k=="function"&&(F=k,k=0),a(A,M,k,function(j){j&&(j.code==="EMFILE"||j.code==="ENFILE")?Bl([a,[A,M,k,F]]):(typeof F=="function"&&F.apply(this,arguments),ao())})}var c=r.readdir;r.readdir=u;function u(A,M,k){var F=[A];return typeof M!="function"?F.push(M):k=M,F.push(j),f(F);function j(X,ae){ae&&ae.sort&&ae.sort(),X&&(X.code==="EMFILE"||X.code==="ENFILE")?Bl([f,[F]]):(typeof k=="function"&&k.apply(this,arguments),ao())}}function f(A){return c.apply(r,A)}if(process.version.substr(0,4)==="v0.8"){var d=NK(r);y=d.ReadStream,w=d.WriteStream}var h=r.ReadStream;h&&(y.prototype=Object.create(h.prototype),y.prototype.open=S);var p=r.WriteStream;p&&(w.prototype=Object.create(p.prototype),w.prototype.open=_),Object.defineProperty(r,"ReadStream",{get:function(){return y},set:function(A){y=A},enumerable:!0,configurable:!0}),Object.defineProperty(r,"WriteStream",{get:function(){return w},set:function(A){w=A},enumerable:!0,configurable:!0});var g=y;Object.defineProperty(r,"FileReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0});var b=w;Object.defineProperty(r,"FileWriteStream",{get:function(){return b},set:function(A){b=A},enumerable:!0,configurable:!0});function y(A,M){return this instanceof y?(h.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function S(){var A=this;W(A.path,A.flags,A.mode,function(M,k){M?(A.autoClose&&A.destroy(),A.emit("error",M)):(A.fd=k,A.emit("open",k),A.read())})}function w(A,M){return this instanceof w?(p.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function _(){var A=this;W(A.path,A.flags,A.mode,function(M,k){M?(A.destroy(),A.emit("error",M)):(A.fd=k,A.emit("open",k))})}function L(A,M){return new r.ReadStream(A,M)}function $(A,M){return new r.WriteStream(A,M)}var I=r.open;r.open=W;function W(A,M,k,F){return typeof k=="function"&&(F=k,k=null),j(A,M,k,F);function j(X,ae,Pe,ke){return I(X,ae,Pe,function(Qe,St){Qe&&(Qe.code==="EMFILE"||Qe.code==="ENFILE")?Bl([j,[X,ae,Pe,ke]]):(typeof ke=="function"&&ke.apply(this,arguments),ao())})}}return r}function Bl(r){gf("ENQUEUE",r[0].name,r[1]),li[dn].push(r)}function ao(){var r=li[dn].shift();r&&(gf("RETRY",r[0].name,r[1]),r[0].apply(null,r[1]))}});var Zw=x(ma=>{"use strict";var vP=Ki().fromCallback,Fr=Le(),BK=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(r=>typeof Fr[r]=="function");Object.keys(Fr).forEach(r=>{r!=="promises"&&(ma[r]=Fr[r])});BK.forEach(r=>{ma[r]=vP(Fr[r])});ma.exists=function(r,e){return typeof e=="function"?Fr.exists(r,e):new Promise(t=>Fr.exists(r,t))};ma.read=function(r,e,t,i,n,s){return typeof s=="function"?Fr.read(r,e,t,i,n,s):new Promise((o,a)=>{Fr.read(r,e,t,i,n,(l,c,u)=>{if(l)return a(l);o({bytesRead:c,buffer:u})})})};ma.write=function(r,e,...t){return typeof t[t.length-1]=="function"?Fr.write(r,e,...t):new Promise((i,n)=>{Fr.write(r,e,...t,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffer:a})})})};typeof Fr.realpath.native=="function"&&(ma.realpath.native=vP(Fr.realpath.native))});var ex=x((Jge,yP)=>{"use strict";var Qw=require("path");function bP(r){return r=Qw.normalize(Qw.resolve(r)).split(Qw.sep),r.length>0?r[0]:null}var jK=/[<>:"|?*]/;function UK(r){let e=bP(r);return r=r.replace(e,""),jK.test(r)}yP.exports={getRootPath:bP,invalidWin32Path:UK}});var xP=x((Yge,wP)=>{"use strict";var HK=Le(),tx=require("path"),WK=ex().invalidWin32Path,zK=parseInt("0777",8);function ix(r,e,t,i){if(typeof e=="function"?(t=e,e={}):(!e||typeof e!="object")&&(e={mode:e}),process.platform==="win32"&&WK(r)){let o=new Error(r+" contains invalid WIN32 path characters.");return o.code="EINVAL",t(o)}let n=e.mode,s=e.fs||HK;n===void 0&&(n=zK&~process.umask()),i||(i=null),t=t||function(){},r=tx.resolve(r),s.mkdir(r,n,o=>{if(!o)return i=i||r,t(null,i);switch(o.code){case"ENOENT":if(tx.dirname(r)===r)return t(o);ix(tx.dirname(r),e,(a,l)=>{a?t(a,l):ix(r,e,t,l)});break;default:s.stat(r,(a,l)=>{a||!l.isDirectory()?t(o,i):t(null,i)});break}})}wP.exports=ix});var CP=x((Xge,SP)=>{"use strict";var VK=Le(),rx=require("path"),GK=ex().invalidWin32Path,KK=parseInt("0777",8);function nx(r,e,t){(!e||typeof e!="object")&&(e={mode:e});let i=e.mode,n=e.fs||VK;if(process.platform==="win32"&&GK(r)){let s=new Error(r+" contains invalid WIN32 path characters.");throw s.code="EINVAL",s}i===void 0&&(i=KK&~process.umask()),t||(t=null),r=rx.resolve(r);try{n.mkdirSync(r,i),t=t||r}catch(s){if(s.code==="ENOENT"){if(rx.dirname(r)===r)throw s;t=nx(rx.dirname(r),e,t),nx(r,e,t)}else{let o;try{o=n.statSync(r)}catch(a){throw s}if(!o.isDirectory())throw s}}return t}SP.exports=nx});var vr=x((Zge,_P)=>{"use strict";var JK=Ki().fromCallback,sx=JK(xP()),ox=CP();_P.exports={mkdirs:sx,mkdirsSync:ox,mkdirp:sx,mkdirpSync:ox,ensureDir:sx,ensureDirSync:ox}});var ax=x((Qge,TP)=>{"use strict";var yi=Le(),EP=require("os"),Fp=require("path");function YK(){let r=Fp.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));r=Fp.join(EP.tmpdir(),r);let e=new Date(1435410243862);yi.writeFileSync(r,"https://github.com/jprichardson/node-fs-extra/pull/141");let t=yi.openSync(r,"r+");return yi.futimesSync(t,e,e),yi.closeSync(t),yi.statSync(r).mtime>1435410243e3}function XK(r){let e=Fp.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));e=Fp.join(EP.tmpdir(),e);let t=new Date(1435410243862);yi.writeFile(e,"https://github.com/jprichardson/node-fs-extra/pull/141",i=>{if(i)return r(i);yi.open(e,"r+",(n,s)=>{if(n)return r(n);yi.futimes(s,t,t,o=>{if(o)return r(o);yi.close(s,a=>{if(a)return r(a);yi.stat(e,(l,c)=>{if(l)return r(l);r(null,c.mtime>1435410243e3)})})})})})}function ZK(r){if(typeof r=="number")return Math.floor(r/1e3)*1e3;if(r instanceof Date)return new Date(Math.floor(r.getTime()/1e3)*1e3);throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}function QK(r,e,t,i){yi.open(r,"r+",(n,s)=>{if(n)return i(n);yi.futimes(s,e,t,o=>{yi.close(s,a=>{i&&i(o||a)})})})}function e7(r,e,t){let i=yi.openSync(r,"r+");return yi.futimesSync(i,e,t),yi.closeSync(i)}TP.exports={hasMillisRes:XK,hasMillisResSync:YK,timeRemoveMillis:ZK,utimesMillis:QK,utimesMillisSync:e7}});var yf=x((eve,OP)=>{"use strict";var Mr=Le(),Ji=require("path"),DP=10,RP=5,t7=0,lx=process.versions.node.split("."),PP=Number.parseInt(lx[0],10),kP=Number.parseInt(lx[1],10),i7=Number.parseInt(lx[2],10);function vf(){if(PP>DP)return!0;if(PP===DP){if(kP>RP)return!0;if(kP===RP&&i7>=t7)return!0}return!1}function r7(r,e,t){vf()?Mr.stat(r,{bigint:!0},(i,n)=>{if(i)return t(i);Mr.stat(e,{bigint:!0},(s,o)=>s?s.code==="ENOENT"?t(null,{srcStat:n,destStat:null}):t(s):t(null,{srcStat:n,destStat:o}))}):Mr.stat(r,(i,n)=>{if(i)return t(i);Mr.stat(e,(s,o)=>s?s.code==="ENOENT"?t(null,{srcStat:n,destStat:null}):t(s):t(null,{srcStat:n,destStat:o}))})}function n7(r,e){let t,i;vf()?t=Mr.statSync(r,{bigint:!0}):t=Mr.statSync(r);try{vf()?i=Mr.statSync(e,{bigint:!0}):i=Mr.statSync(e)}catch(n){if(n.code==="ENOENT")return{srcStat:t,destStat:null};throw n}return{srcStat:t,destStat:i}}function s7(r,e,t,i){r7(r,e,(n,s)=>{if(n)return i(n);let{srcStat:o,destStat:a}=s;return a&&a.ino&&a.dev&&a.ino===o.ino&&a.dev===o.dev?i(new Error("Source and destination must not be the same.")):o.isDirectory()&&ux(r,e)?i(new Error(bf(r,e,t))):i(null,{srcStat:o,destStat:a})})}function o7(r,e,t){let{srcStat:i,destStat:n}=n7(r,e);if(n&&n.ino&&n.dev&&n.ino===i.ino&&n.dev===i.dev)throw new Error("Source and destination must not be the same.");if(i.isDirectory()&&ux(r,e))throw new Error(bf(r,e,t));return{srcStat:i,destStat:n}}function cx(r,e,t,i,n){let s=Ji.resolve(Ji.dirname(r)),o=Ji.resolve(Ji.dirname(t));if(o===s||o===Ji.parse(o).root)return n();vf()?Mr.stat(o,{bigint:!0},(a,l)=>a?a.code==="ENOENT"?n():n(a):l.ino&&l.dev&&l.ino===e.ino&&l.dev===e.dev?n(new Error(bf(r,t,i))):cx(r,e,o,i,n)):Mr.stat(o,(a,l)=>a?a.code==="ENOENT"?n():n(a):l.ino&&l.dev&&l.ino===e.ino&&l.dev===e.dev?n(new Error(bf(r,t,i))):cx(r,e,o,i,n))}function IP(r,e,t,i){let n=Ji.resolve(Ji.dirname(r)),s=Ji.resolve(Ji.dirname(t));if(s===n||s===Ji.parse(s).root)return;let o;try{vf()?o=Mr.statSync(s,{bigint:!0}):o=Mr.statSync(s)}catch(a){if(a.code==="ENOENT")return;throw a}if(o.ino&&o.dev&&o.ino===e.ino&&o.dev===e.dev)throw new Error(bf(r,t,i));return IP(r,e,s,i)}function ux(r,e){let t=Ji.resolve(r).split(Ji.sep).filter(n=>n),i=Ji.resolve(e).split(Ji.sep).filter(n=>n);return t.reduce((n,s,o)=>n&&i[o]===s,!0)}function bf(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}OP.exports={checkPaths:s7,checkPathsSync:o7,checkParentPaths:cx,checkParentPathsSync:IP,isSrcSubdir:ux}});var AP=x((tve,LP)=>{"use strict";LP.exports=function(r){if(typeof Buffer.allocUnsafe=="function")try{return Buffer.allocUnsafe(r)}catch(e){return new Buffer(r)}return new Buffer(r)}});var $P=x((ive,qP)=>{"use strict";var mt=Le(),wf=require("path"),a7=vr().mkdirsSync,l7=ax().utimesMillisSync,xf=yf();function c7(r,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:i,destStat:n}=xf.checkPathsSync(r,e,"copy");return xf.checkParentPathsSync(r,i,e,"copy"),u7(n,r,e,t)}function u7(r,e,t,i){if(i.filter&&!i.filter(e,t))return;let n=wf.dirname(t);return mt.existsSync(n)||a7(n),FP(r,e,t,i)}function FP(r,e,t,i){if(!(i.filter&&!i.filter(e,t)))return f7(r,e,t,i)}function f7(r,e,t,i){let s=(i.dereference?mt.statSync:mt.lstatSync)(e);if(s.isDirectory())return m7(s,r,e,t,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return d7(s,r,e,t,i);if(s.isSymbolicLink())return b7(r,e,t,i)}function d7(r,e,t,i,n){return e?h7(r,t,i,n):MP(r,t,i,n)}function h7(r,e,t,i){if(i.overwrite)return mt.unlinkSync(t),MP(r,e,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}function MP(r,e,t,i){return typeof mt.copyFileSync=="function"?(mt.copyFileSync(e,t),mt.chmodSync(t,r.mode),i.preserveTimestamps?l7(t,r.atime,r.mtime):void 0):p7(r,e,t,i)}function p7(r,e,t,i){let n=64*1024,s=AP()(n),o=mt.openSync(e,"r"),a=mt.openSync(t,"w",r.mode),l=0;for(;l<r.size;){let c=mt.readSync(o,s,0,n,l);mt.writeSync(a,s,0,c),l+=c}i.preserveTimestamps&&mt.futimesSync(a,r.atime,r.mtime),mt.closeSync(o),mt.closeSync(a)}function m7(r,e,t,i,n){if(!e)return g7(r,t,i,n);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`);return NP(t,i,n)}function g7(r,e,t,i){return mt.mkdirSync(t),NP(e,t,i),mt.chmodSync(t,r.mode)}function NP(r,e,t){mt.readdirSync(r).forEach(i=>v7(i,r,e,t))}function v7(r,e,t,i){let n=wf.join(e,r),s=wf.join(t,r),{destStat:o}=xf.checkPathsSync(n,s,"copy");return FP(o,n,s,i)}function b7(r,e,t,i){let n=mt.readlinkSync(e);if(i.dereference&&(n=wf.resolve(process.cwd(),n)),r){let s;try{s=mt.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return mt.symlinkSync(n,t);throw o}if(i.dereference&&(s=wf.resolve(process.cwd(),s)),xf.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(mt.statSync(t).isDirectory()&&xf.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`);return y7(n,t)}else return mt.symlinkSync(n,t)}function y7(r,e){return mt.unlinkSync(e),mt.symlinkSync(r,e)}qP.exports=c7});var fx=x((rve,BP)=>{"use strict";BP.exports={copySync:$P()}});var Un=x((nve,UP)=>{"use strict";var w7=Ki().fromPromise,jP=Zw();function x7(r){return jP.access(r).then(()=>!0).catch(()=>!1)}UP.exports={pathExists:w7(x7),pathExistsSync:jP.existsSync}});var XP=x((sve,YP)=>{"use strict";var ci=Le(),Sf=require("path"),S7=vr().mkdirs,C7=Un().pathExists,_7=ax().utimesMillis,Cf=yf();function E7(r,e,t,i){typeof t=="function"&&!i?(i=t,t={}):typeof t=="function"&&(t={filter:t}),i=i||function(){},t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`),Cf.checkPaths(r,e,"copy",(n,s)=>{if(n)return i(n);let{srcStat:o,destStat:a}=s;Cf.checkParentPaths(r,o,e,"copy",l=>l?i(l):t.filter?WP(HP,a,r,e,t,i):HP(a,r,e,t,i))})}function HP(r,e,t,i,n){let s=Sf.dirname(t);C7(s,(o,a)=>{if(o)return n(o);if(a)return dx(r,e,t,i,n);S7(s,l=>l?n(l):dx(r,e,t,i,n))})}function WP(r,e,t,i,n,s){Promise.resolve(n.filter(t,i)).then(o=>o?r(e,t,i,n,s):s(),o=>s(o))}function dx(r,e,t,i,n){return i.filter?WP(zP,r,e,t,i,n):zP(r,e,t,i,n)}function zP(r,e,t,i,n){(i.dereference?ci.stat:ci.lstat)(e,(o,a)=>{if(o)return n(o);if(a.isDirectory())return P7(a,r,e,t,i,n);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return T7(a,r,e,t,i,n);if(a.isSymbolicLink())return O7(r,e,t,i,n)})}function T7(r,e,t,i,n,s){return e?D7(r,t,i,n,s):VP(r,t,i,n,s)}function D7(r,e,t,i,n){if(i.overwrite)ci.unlink(t,s=>s?n(s):VP(r,e,t,i,n));else return i.errorOnExist?n(new Error(`'${t}' already exists`)):n()}function VP(r,e,t,i,n){return typeof ci.copyFile=="function"?ci.copyFile(e,t,s=>s?n(s):GP(r,t,i,n)):R7(r,e,t,i,n)}function R7(r,e,t,i,n){let s=ci.createReadStream(e);s.on("error",o=>n(o)).once("open",()=>{let o=ci.createWriteStream(t,{mode:r.mode});o.on("error",a=>n(a)).on("open",()=>s.pipe(o)).once("close",()=>GP(r,t,i,n))})}function GP(r,e,t,i){ci.chmod(e,r.mode,n=>n?i(n):t.preserveTimestamps?_7(e,r.atime,r.mtime,i):i())}function P7(r,e,t,i,n,s){return e?e&&!e.isDirectory()?s(new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`)):KP(t,i,n,s):k7(r,t,i,n,s)}function k7(r,e,t,i,n){ci.mkdir(t,s=>{if(s)return n(s);KP(e,t,i,o=>o?n(o):ci.chmod(t,r.mode,n))})}function KP(r,e,t,i){ci.readdir(r,(n,s)=>n?i(n):JP(s,r,e,t,i))}function JP(r,e,t,i,n){let s=r.pop();return s?I7(r,s,e,t,i,n):n()}function I7(r,e,t,i,n,s){let o=Sf.join(t,e),a=Sf.join(i,e);Cf.checkPaths(o,a,"copy",(l,c)=>{if(l)return s(l);let{destStat:u}=c;dx(u,o,a,n,f=>f?s(f):JP(r,t,i,n,s))})}function O7(r,e,t,i,n){ci.readlink(e,(s,o)=>{if(s)return n(s);if(i.dereference&&(o=Sf.resolve(process.cwd(),o)),r)ci.readlink(t,(a,l)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?ci.symlink(o,t,n):n(a):(i.dereference&&(l=Sf.resolve(process.cwd(),l)),Cf.isSrcSubdir(o,l)?n(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${l}'.`)):r.isDirectory()&&Cf.isSrcSubdir(l,o)?n(new Error(`Cannot overwrite '${l}' with '${o}'.`)):L7(o,t,n)));else return ci.symlink(o,t,n)})}function L7(r,e,t){ci.unlink(e,i=>i?t(i):ci.symlink(r,e,t))}YP.exports=E7});var hx=x((ove,ZP)=>{"use strict";var A7=Ki().fromCallback;ZP.exports={copy:A7(XP())}});var ak=x((ave,ok)=>{"use strict";var QP=Le(),ek=require("path"),Ve=require("assert"),_f=process.platform==="win32";function tk(r){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{r[t]=r[t]||QP[t],t=t+"Sync",r[t]=r[t]||QP[t]}),r.maxBusyTries=r.maxBusyTries||3}function px(r,e,t){let i=0;typeof e=="function"&&(t=e,e={}),Ve(r,"rimraf: missing path"),Ve.strictEqual(typeof r,"string","rimraf: path should be a string"),Ve.strictEqual(typeof t,"function","rimraf: callback function required"),Ve(e,"rimraf: invalid options argument provided"),Ve.strictEqual(typeof e,"object","rimraf: options should be object"),tk(e),ik(r,e,function n(s){if(s){if((s.code==="EBUSY"||s.code==="ENOTEMPTY"||s.code==="EPERM")&&i<e.maxBusyTries){i++;let o=i*100;return setTimeout(()=>ik(r,e,n),o)}s.code==="ENOENT"&&(s=null)}t(s)})}function ik(r,e,t){Ve(r),Ve(e),Ve(typeof t=="function"),e.lstat(r,(i,n)=>{if(i&&i.code==="ENOENT")return t(null);if(i&&i.code==="EPERM"&&_f)return rk(r,e,i,t);if(n&&n.isDirectory())return Mp(r,e,i,t);e.unlink(r,s=>{if(s){if(s.code==="ENOENT")return t(null);if(s.code==="EPERM")return _f?rk(r,e,s,t):Mp(r,e,s,t);if(s.code==="EISDIR")return Mp(r,e,s,t)}return t(s)})})}function rk(r,e,t,i){Ve(r),Ve(e),Ve(typeof i=="function"),t&&Ve(t instanceof Error),e.chmod(r,438,n=>{n?i(n.code==="ENOENT"?null:t):e.stat(r,(s,o)=>{s?i(s.code==="ENOENT"?null:t):o.isDirectory()?Mp(r,e,t,i):e.unlink(r,i)})})}function nk(r,e,t){let i;Ve(r),Ve(e),t&&Ve(t instanceof Error);try{e.chmodSync(r,438)}catch(n){if(n.code==="ENOENT")return;throw t}try{i=e.statSync(r)}catch(n){if(n.code==="ENOENT")return;throw t}i.isDirectory()?Np(r,e,t):e.unlinkSync(r)}function Mp(r,e,t,i){Ve(r),Ve(e),t&&Ve(t instanceof Error),Ve(typeof i=="function"),e.rmdir(r,n=>{n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")?F7(r,e,i):n&&n.code==="ENOTDIR"?i(t):i(n)})}function F7(r,e,t){Ve(r),Ve(e),Ve(typeof t=="function"),e.readdir(r,(i,n)=>{if(i)return t(i);let s=n.length,o;if(s===0)return e.rmdir(r,t);n.forEach(a=>{px(ek.join(r,a),e,l=>{if(!o){if(l)return t(o=l);--s==0&&e.rmdir(r,t)}})})})}function sk(r,e){let t;e=e||{},tk(e),Ve(r,"rimraf: missing path"),Ve.strictEqual(typeof r,"string","rimraf: path should be a string"),Ve(e,"rimraf: missing options"),Ve.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(r)}catch(i){if(i.code==="ENOENT")return;i.code==="EPERM"&&_f&&nk(r,e,i)}try{t&&t.isDirectory()?Np(r,e,null):e.unlinkSync(r)}catch(i){if(i.code==="ENOENT")return;if(i.code==="EPERM")return _f?nk(r,e,i):Np(r,e,i);if(i.code!=="EISDIR")throw i;Np(r,e,i)}}function Np(r,e,t){Ve(r),Ve(e),t&&Ve(t instanceof Error);try{e.rmdirSync(r)}catch(i){if(i.code==="ENOTDIR")throw t;if(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")M7(r,e);else if(i.code!=="ENOENT")throw i}}function M7(r,e){if(Ve(r),Ve(e),e.readdirSync(r).forEach(t=>sk(ek.join(r,t),e)),_f){let t=Date.now();do try{return e.rmdirSync(r,e)}catch(i){}while(Date.now()-t<500)}else return e.rmdirSync(r,e)}ok.exports=px;px.sync=sk});var Ef=x((lve,ck)=>{"use strict";var N7=Ki().fromCallback,lk=ak();ck.exports={remove:N7(lk),removeSync:lk.sync}});var vk=x((cve,gk)=>{"use strict";var q7=Ki().fromCallback,uk=Le(),fk=require("path"),dk=vr(),hk=Ef(),pk=q7(function(e,t){t=t||function(){},uk.readdir(e,(i,n)=>{if(i)return dk.mkdirs(e,t);n=n.map(o=>fk.join(e,o)),s();function s(){let o=n.pop();if(!o)return t();hk.remove(o,a=>{if(a)return t(a);s()})}})});function mk(r){let e;try{e=uk.readdirSync(r)}catch(t){return dk.mkdirsSync(r)}e.forEach(t=>{t=fk.join(r,t),hk.removeSync(t)})}gk.exports={emptyDirSync:mk,emptydirSync:mk,emptyDir:pk,emptydir:pk}});var xk=x((uve,wk)=>{"use strict";var $7=Ki().fromCallback,bk=require("path"),Tf=Le(),yk=vr(),B7=Un().pathExists;function j7(r,e){function t(){Tf.writeFile(r,"",i=>{if(i)return e(i);e()})}Tf.stat(r,(i,n)=>{if(!i&&n.isFile())return e();let s=bk.dirname(r);B7(s,(o,a)=>{if(o)return e(o);if(a)return t();yk.mkdirs(s,l=>{if(l)return e(l);t()})})})}function U7(r){let e;try{e=Tf.statSync(r)}catch(i){}if(e&&e.isFile())return;let t=bk.dirname(r);Tf.existsSync(t)||yk.mkdirsSync(t),Tf.writeFileSync(r,"")}wk.exports={createFile:$7(j7),createFileSync:U7}});var Tk=x((fve,Ek)=>{"use strict";var H7=Ki().fromCallback,Sk=require("path"),ga=Le(),Ck=vr(),_k=Un().pathExists;function W7(r,e,t){function i(n,s){ga.link(n,s,o=>{if(o)return t(o);t(null)})}_k(e,(n,s)=>{if(n)return t(n);if(s)return t(null);ga.lstat(r,o=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),t(o);let a=Sk.dirname(e);_k(a,(l,c)=>{if(l)return t(l);if(c)return i(r,e);Ck.mkdirs(a,u=>{if(u)return t(u);i(r,e)})})})})}function z7(r,e){if(ga.existsSync(e))return;try{ga.lstatSync(r)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let i=Sk.dirname(e);return ga.existsSync(i)||Ck.mkdirsSync(i),ga.linkSync(r,e)}Ek.exports={createLink:H7(W7),createLinkSync:z7}});var Rk=x((dve,Dk)=>{"use strict";var lo=require("path"),Df=Le(),V7=Un().pathExists;function G7(r,e,t){if(lo.isAbsolute(r))return Df.lstat(r,i=>i?(i.message=i.message.replace("lstat","ensureSymlink"),t(i)):t(null,{toCwd:r,toDst:r}));{let i=lo.dirname(e),n=lo.join(i,r);return V7(n,(s,o)=>s?t(s):o?t(null,{toCwd:n,toDst:r}):Df.lstat(r,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),t(a)):t(null,{toCwd:r,toDst:lo.relative(i,r)})))}}function K7(r,e){let t;if(lo.isAbsolute(r)){if(t=Df.existsSync(r),!t)throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}else{let i=lo.dirname(e),n=lo.join(i,r);if(t=Df.existsSync(n),t)return{toCwd:n,toDst:r};if(t=Df.existsSync(r),!t)throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:lo.relative(i,r)}}}Dk.exports={symlinkPaths:G7,symlinkPathsSync:K7}});var Ik=x((hve,kk)=>{"use strict";var Pk=Le();function J7(r,e,t){if(t=typeof e=="function"?e:t,e=typeof e=="function"?!1:e,e)return t(null,e);Pk.lstat(r,(i,n)=>{if(i)return t(null,"file");e=n&&n.isDirectory()?"dir":"file",t(null,e)})}function Y7(r,e){let t;if(e)return e;try{t=Pk.lstatSync(r)}catch(i){return"file"}return t&&t.isDirectory()?"dir":"file"}kk.exports={symlinkType:J7,symlinkTypeSync:Y7}});var qk=x((pve,Nk)=>{"use strict";var X7=Ki().fromCallback,Ok=require("path"),jl=Le(),Lk=vr(),Z7=Lk.mkdirs,Q7=Lk.mkdirsSync,Ak=Rk(),eJ=Ak.symlinkPaths,tJ=Ak.symlinkPathsSync,Fk=Ik(),iJ=Fk.symlinkType,rJ=Fk.symlinkTypeSync,Mk=Un().pathExists;function nJ(r,e,t,i){i=typeof t=="function"?t:i,t=typeof t=="function"?!1:t,Mk(e,(n,s)=>{if(n)return i(n);if(s)return i(null);eJ(r,e,(o,a)=>{if(o)return i(o);r=a.toDst,iJ(a.toCwd,t,(l,c)=>{if(l)return i(l);let u=Ok.dirname(e);Mk(u,(f,d)=>{if(f)return i(f);if(d)return jl.symlink(r,e,c,i);Z7(u,h=>{if(h)return i(h);jl.symlink(r,e,c,i)})})})})})}function sJ(r,e,t){if(jl.existsSync(e))return;let n=tJ(r,e);r=n.toDst,t=rJ(n.toCwd,t);let s=Ok.dirname(e);return jl.existsSync(s)||Q7(s),jl.symlinkSync(r,e,t)}Nk.exports={createSymlink:X7(nJ),createSymlinkSync:sJ}});var Bk=x((mve,$k)=>{"use strict";var qp=xk(),$p=Tk(),Bp=qk();$k.exports={createFile:qp.createFile,createFileSync:qp.createFileSync,ensureFile:qp.createFile,ensureFileSync:qp.createFileSync,createLink:$p.createLink,createLinkSync:$p.createLinkSync,ensureLink:$p.createLink,ensureLinkSync:$p.createLinkSync,createSymlink:Bp.createSymlink,createSymlinkSync:Bp.createSymlinkSync,ensureSymlink:Bp.createSymlink,ensureSymlinkSync:Bp.createSymlinkSync}});var Wk=x((gve,Hk)=>{var Ul;try{Ul=Le()}catch(r){Ul=require("fs")}function oJ(r,e,t){t==null&&(t=e,e={}),typeof e=="string"&&(e={encoding:e}),e=e||{};var i=e.fs||Ul,n=!0;"throws"in e&&(n=e.throws),i.readFile(r,e,function(s,o){if(s)return t(s);o=Uk(o);var a;try{a=JSON.parse(o,e?e.reviver:null)}catch(l){return n?(l.message=r+": "+l.message,t(l)):t(null,null)}t(null,a)})}function aJ(r,e){e=e||{},typeof e=="string"&&(e={encoding:e});var t=e.fs||Ul,i=!0;"throws"in e&&(i=e.throws);try{var n=t.readFileSync(r,e);return n=Uk(n),JSON.parse(n,e.reviver)}catch(s){if(i)throw s.message=r+": "+s.message,s;return null}}function jk(r,e){var t,i=`
`;typeof e=="object"&&e!==null&&(e.spaces&&(t=e.spaces),e.EOL&&(i=e.EOL));var n=JSON.stringify(r,e?e.replacer:null,t);return n.replace(/\n/g,i)+i}function lJ(r,e,t,i){i==null&&(i=t,t={}),t=t||{};var n=t.fs||Ul,s="";try{s=jk(e,t)}catch(o){i&&i(o,null);return}n.writeFile(r,s,t,i)}function cJ(r,e,t){t=t||{};var i=t.fs||Ul,n=jk(e,t);return i.writeFileSync(r,n,t)}function Uk(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r=r.replace(/^\uFEFF/,""),r}var uJ={readFile:oJ,readFileSync:aJ,writeFile:lJ,writeFileSync:cJ};Hk.exports=uJ});var Up=x((vve,Vk)=>{"use strict";var zk=Ki().fromCallback,jp=Wk();Vk.exports={readJson:zk(jp.readFile),readJsonSync:jp.readFileSync,writeJson:zk(jp.writeFile),writeJsonSync:jp.writeFileSync}});var Jk=x((bve,Kk)=>{"use strict";var fJ=require("path"),dJ=vr(),hJ=Un().pathExists,Gk=Up();function pJ(r,e,t,i){typeof t=="function"&&(i=t,t={});let n=fJ.dirname(r);hJ(n,(s,o)=>{if(s)return i(s);if(o)return Gk.writeJson(r,e,t,i);dJ.mkdirs(n,a=>{if(a)return i(a);Gk.writeJson(r,e,t,i)})})}Kk.exports=pJ});var Xk=x((yve,Yk)=>{"use strict";var mJ=Le(),gJ=require("path"),vJ=vr(),bJ=Up();function yJ(r,e,t){let i=gJ.dirname(r);mJ.existsSync(i)||vJ.mkdirsSync(i),bJ.writeJsonSync(r,e,t)}Yk.exports=yJ});var Qk=x((wve,Zk)=>{"use strict";var wJ=Ki().fromCallback,Mi=Up();Mi.outputJson=wJ(Jk());Mi.outputJsonSync=Xk();Mi.outputJSON=Mi.outputJson;Mi.outputJSONSync=Mi.outputJsonSync;Mi.writeJSON=Mi.writeJson;Mi.writeJSONSync=Mi.writeJsonSync;Mi.readJSON=Mi.readJson;Mi.readJSONSync=Mi.readJsonSync;Zk.exports=Mi});var sI=x((xve,nI)=>{"use strict";var eI=Le(),xJ=require("path"),SJ=fx().copySync,tI=Ef().removeSync,CJ=vr().mkdirpSync,iI=yf();function _J(r,e,t){t=t||{};let i=t.overwrite||t.clobber||!1,{srcStat:n}=iI.checkPathsSync(r,e,"move");return iI.checkParentPathsSync(r,n,e,"move"),CJ(xJ.dirname(e)),EJ(r,e,i)}function EJ(r,e,t){if(t)return tI(e),rI(r,e,t);if(eI.existsSync(e))throw new Error("dest already exists.");return rI(r,e,t)}function rI(r,e,t){try{eI.renameSync(r,e)}catch(i){if(i.code!=="EXDEV")throw i;return TJ(r,e,t)}}function TJ(r,e,t){return SJ(r,e,{overwrite:t,errorOnExist:!0}),tI(r)}nI.exports=_J});var aI=x((Sve,oI)=>{"use strict";oI.exports={moveSync:sI()}});var dI=x((Cve,fI)=>{"use strict";var DJ=Le(),RJ=require("path"),PJ=hx().copy,lI=Ef().remove,kJ=vr().mkdirp,IJ=Un().pathExists,cI=yf();function OJ(r,e,t,i){typeof t=="function"&&(i=t,t={});let n=t.overwrite||t.clobber||!1;cI.checkPaths(r,e,"move",(s,o)=>{if(s)return i(s);let{srcStat:a}=o;cI.checkParentPaths(r,a,e,"move",l=>{if(l)return i(l);kJ(RJ.dirname(e),c=>c?i(c):LJ(r,e,n,i))})})}function LJ(r,e,t,i){if(t)return lI(e,n=>n?i(n):uI(r,e,t,i));IJ(e,(n,s)=>n?i(n):s?i(new Error("dest already exists.")):uI(r,e,t,i))}function uI(r,e,t,i){DJ.rename(r,e,n=>n?n.code!=="EXDEV"?i(n):AJ(r,e,t,i):i())}function AJ(r,e,t,i){PJ(r,e,{overwrite:t,errorOnExist:!0},s=>s?i(s):lI(r,i))}fI.exports=OJ});var pI=x((_ve,hI)=>{"use strict";var FJ=Ki().fromCallback;hI.exports={move:FJ(dI())}});var bI=x((Eve,vI)=>{"use strict";var MJ=Ki().fromCallback,Rf=Le(),mI=require("path"),gI=vr(),NJ=Un().pathExists;function qJ(r,e,t,i){typeof t=="function"&&(i=t,t="utf8");let n=mI.dirname(r);NJ(n,(s,o)=>{if(s)return i(s);if(o)return Rf.writeFile(r,e,t,i);gI.mkdirs(n,a=>{if(a)return i(a);Rf.writeFile(r,e,t,i)})})}function $J(r,...e){let t=mI.dirname(r);if(Rf.existsSync(t))return Rf.writeFileSync(r,...e);gI.mkdirsSync(t),Rf.writeFileSync(r,...e)}vI.exports={outputFile:MJ(qJ),outputFileSync:$J}});var gx=x((Tve,mx)=>{"use strict";mx.exports=Object.assign({},Zw(),fx(),hx(),vk(),Bk(),Qk(),vr(),aI(),pI(),bI(),Un(),Ef());var yI=require("fs");Object.getOwnPropertyDescriptor(yI,"promises")&&Object.defineProperty(mx.exports,"promises",{get(){return yI.promises}})});var xI=x((Dve,wI)=>{wI.exports=()=>new Date});var vx=x((Rve,Nr)=>{"use strict";function SI(r,e){for(var t=r.toString();t.length<e;)t="0"+t;return t}function va(r){return SI(r,2)}function BJ(r){var e=Math.abs(r),t=String(Math.floor(e/60)),i=String(e%60);return t.length===1&&(t="0"+t),i.length===1&&(i="0"+i),r<0?"+"+t+i:"-"+t+i}function ba(r,e,t){return e?r["getUTC"+t]():r["get"+t]()}function CI(r,e){typeof r!="string"&&(e=r,r=Nr.exports.ISO8601_FORMAT),e||(e=Nr.exports.now());var t=r.indexOf("O")>-1,i=va(ba(e,t,"Date")),n=va(ba(e,t,"Month")+1),s=va(ba(e,t,"FullYear")),o=va(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:o,l=va(ba(e,t,"Hours")),c=va(ba(e,t,"Minutes")),u=va(ba(e,t,"Seconds")),f=SI(ba(e,t,"Milliseconds"),3),d=BJ(e.getTimezoneOffset()),h=r.replace(/dd/g,i).replace(/MM/g,n).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,c).replace(/ss/g,u).replace(/SSS/g,f).replace(/O/g,d);return h}function jJ(r,e,t){var i=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(c,u){c.setFullYear(u)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(c,u){c.setMonth(u-1)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(c,u){c.setDate(u)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(c,u){c.setHours(u)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(c,u){c.setMinutes(u)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(c,u){c.setSeconds(u)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(c,u){c.setMilliseconds(u)}},{pattern:/O/,regexp:"[+-]\\d{3,4}|Z",fn:function(c,u){u==="Z"&&(u=0);var f=Math.abs(u),d=f%100+Math.floor(f/100)*60;c.setMinutes(c.getMinutes()+(u>0?d:-d))}}],n=i.reduce(function(c,u){return u.pattern.test(c.regexp)?(u.index=c.regexp.match(u.pattern).index,c.regexp=c.regexp.replace(u.pattern,"("+u.regexp+")")):u.index=-1,c},{regexp:r,index:[]}),s=i.filter(function(c){return c.index>-1});s.sort(function(c,u){return c.index-u.index});var o=new RegExp(n.regexp),a=o.exec(e);if(a){var l=t||Nr.exports.now();return s.forEach(function(c,u){c.fn(l,a[u+1])}),l}throw new Error("String '"+e+"' could not be parsed as '"+r+"'")}function UJ(r,e,t){if(!r)throw new Error("pattern must be supplied");return jJ(r,e,t)}function HJ(){return new Date}Nr.exports=CI;Nr.exports.asString=CI;Nr.exports.parse=UJ;Nr.exports.now=HJ;Nr.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS";Nr.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO";Nr.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS";Nr.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"});var TI=x((Pve,EI)=>{var WJ=Bt()("streamroller:fileNameFormatter"),zJ=require("path"),_I=".",VJ=".gz";EI.exports=({file:r,keepFileExt:e,needsIndex:t,alwaysIncludeDate:i,compress:n})=>{let s=zJ.join(r.dir,r.name),o=f=>f+r.ext,a=(f,d,h)=>(t||!h)&&d?f+_I+d:f,l=(f,d,h)=>(d>0||i)&&h?f+_I+h:f,c=(f,d)=>d&&n?f+VJ:f,u=e?[l,a,o,c]:[o,l,a,c];return({date:f,index:d})=>(WJ(`_formatFileName: date=${f}, index=${d}`),u.reduce((h,p)=>p(h,d,f),s))}});var kI=x((kve,PI)=>{var ya=Bt()("streamroller:fileNameParser"),GJ=".",DI=".gz",RI=vx();PI.exports=({file:r,keepFileExt:e,pattern:t})=>{let i=(u,f)=>u.endsWith(DI)?(ya("it is gzipped"),f.isCompressed=!0,u.slice(0,-1*DI.length)):u,n="__NOT_MATCHING__",c=[i,e?u=>u.startsWith(r.name)&&u.endsWith(r.ext)?(ya("it starts and ends with the right things"),u.slice(r.name.length+1,-1*r.ext.length)):n:u=>u.startsWith(r.base)?(ya("it starts with the right things"),u.slice(r.base.length+1)):n,t?(u,f)=>{let d=u.split(GJ),h=d[d.length-1];ya("items: ",d,", indexStr: ",h);let p=u;h!==void 0&&h.match(/^\d+$/)?(p=u.slice(0,-1*(h.length+1)),ya(`dateStr is ${p}`),t&&!p&&(p=h,h="0")):h="0";try{let g=RI.parse(t,p,new Date(0,0));return RI.asString(t,g)!==p?u:(f.index=parseInt(h,10),f.date=p,f.timestamp=g.getTime(),"")}catch(g){return ya(`Problem parsing ${p} as ${t}, error was: `,g),u}}:(u,f)=>u.match(/^\d+$/)?(ya("it has an index"),f.index=parseInt(u,10),""):u];return u=>{let f={filename:u,index:0,isCompressed:!1};return c.reduce((h,p)=>p(h,f),u)?null:f}}});var OI=x((Ive,II)=>{var wa=Bt()("streamroller:moveAndMaybeCompressFile"),co=gx(),KJ=require("zlib"),JJ=async(r,e,t)=>{if(r===e){wa("moveAndMaybeCompressFile: source and target are the same, not doing anything");return}if(await co.pathExists(r))if(wa(`moveAndMaybeCompressFile: moving file from ${r} to ${e} ${t?"with":"without"} compress`),t)await new Promise((i,n)=>{co.createReadStream(r).pipe(KJ.createGzip()).pipe(co.createWriteStream(e)).on("finish",()=>{wa(`moveAndMaybeCompressFile: finished compressing ${e}, deleting ${r}`),co.unlink(r).then(i).catch(()=>{wa(`Deleting ${r} failed, truncating instead`),co.truncate(r).then(i).catch(n)})})});else{wa(`moveAndMaybeCompressFile: deleting file=${e}, renaming ${r} to ${e}`);try{await co.move(r,e,{overwrite:!0})}catch(i){wa(`moveAndMaybeCompressFile: error moving ${r} to ${e}`,i),wa("Trying copy+truncate instead"),await co.copy(r,e,{overwrite:!0}),await co.truncate(r)}}};II.exports=JJ});var Vp=x((Ove,AI)=>{var br=Bt()("streamroller:RollingFileWriteStream"),Pf=gx(),Hp=require("path"),Wp=xI(),zp=vx(),{Writable:YJ}=require("stream"),XJ=TI(),ZJ=kI(),QJ=OI(),LI=class extends YJ{constructor(e,t){br(`constructor: creating RollingFileWriteStream. path=${e}`),super(t),this.options=this._parseOption(t),this.fileObject=Hp.parse(e),this.fileObject.dir===""&&(this.fileObject=Hp.parse(Hp.join(process.cwd(),e))),this.fileFormatter=XJ({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt}),this.fileNameParser=ZJ({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=zp(this.options.pattern,Wp())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),br(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{let e=Pf.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=zp(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){let t={maxSize:Number.MAX_SAFE_INTEGER,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0644",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},i=Object.assign({},t,e);if(i.maxSize<=0)throw new Error(`options.maxSize (${i.maxSize}) should be > 0`);if(i.numToKeep<=0)throw new Error(`options.numToKeep (${i.numToKeep}) should be > 0`);return br(`_parseOption: creating stream with option=${JSON.stringify(i)}`),i}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,i){this._shouldRoll().then(()=>{br(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,n=>{this.state.currentSize+=e.length,i(n)})})}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(br(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==zp(this.options.pattern,Wp())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return br("_roll: closing the current stream"),new Promise((e,t)=>{this.currentFileStream.end("",this.options.encoding,()=>{this._moveOldFiles().then(e).catch(t)})})}async _moveOldFiles(){let e=await this._getExistingFiles(),t=this.state.currentDate?e.filter(i=>i.date===this.state.currentDate):e;for(let i=t.length;i>=0;i--){br(`_moveOldFiles: i = ${i}`);let n=this.fileFormatter({date:this.state.currentDate,index:i}),s=this.fileFormatter({date:this.state.currentDate,index:i+1});await QJ(n,s,this.options.compress&&i===0)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?zp(this.options.pattern,Wp()):null,br(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise((i,n)=>{this.currentFileStream.write("","utf8",()=>{this._clean().then(i).catch(n)})})}async _getExistingFiles(){let e=await Pf.readdir(this.fileObject.dir).catch(()=>[]);br(`_getExistingFiles: files=${e}`);let t=e.map(n=>this.fileNameParser(n)).filter(n=>n),i=n=>(n.timestamp?n.timestamp:Wp().getTime())-n.index;return t.sort((n,s)=>i(n)-i(s)),t}_renewWriteStream(){Pf.ensureDirSync(this.fileObject.dir);let e=this.fileFormatter({date:this.state.currentDate,index:0}),t={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};this.currentFileStream=Pf.createWriteStream(e,t),this.currentFileStream.on("error",i=>{this.emit("error",i)})}async _clean(){let e=await this._getExistingFiles();if(br(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),br("_clean: existing files are: ",e),this._tooManyFiles(e.length)){let t=e.slice(0,e.length-this.options.numToKeep-1).map(i=>Hp.format({dir:this.fileObject.dir,base:i.filename}));await eY(t)}}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}},eY=r=>(br(`deleteFiles: files to delete: ${r}`),Promise.all(r.map(e=>Pf.unlink(e).catch(t=>{br(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))));AI.exports=LI});var NI=x((Lve,MI)=>{var tY=Vp(),FI=class extends tY{constructor(e,t,i,n){n||(n={}),t&&(n.maxSize=t),i||(i=1),n.numToKeep=i,super(e,n),this.backups=this.options.numToKeep,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};MI.exports=FI});var BI=x((Ave,$I)=>{var iY=Vp(),qI=class extends iY{constructor(e,t,i){t&&typeof t=="object"&&(i=t,t=null),i||(i={}),t||(t="yyyy-MM-dd"),i.daysToKeep&&(i.numToKeep=i.daysToKeep),t.startsWith(".")&&(t=t.substring(1)),i.pattern=t,super(e,i),this.mode=this.options.mode}get theStream(){return this.currentFileStream}};$I.exports=qI});var bx=x((Fve,jI)=>{jI.exports={RollingFileWriteStream:Vp(),RollingFileStream:NI(),DateRollingFileStream:BI()}});var zI=x((Mve,WI)=>{var UI=Bt()("log4js:file"),rY=require("path"),nY=bx(),sY=require("os"),oY=sY.EOL;function HI(r,e,t,i){let n=new nY.RollingFileStream(r,e,t,i);return n.on("error",s=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",r,s)}),n.on("drain",()=>{process.emit("log4js:pause",!1)}),n}function aY(r,e,t,i,n,s){r=rY.normalize(r),i=i===void 0?5:i,i=i===0?1:i,UI("Creating file appender (",r,", ",t,", ",i,", ",n,", ",s,")");let o=HI(r,t,i,n),a=function(l){if(n.removeColor===!0){let c=/\x1b[[0-9;]*m/g;l.data=l.data.map(u=>typeof u=="string"?u.replace(c,""):u)}o.write(e(l,s)+oY,"utf8")||process.emit("log4js:pause",!0)};return a.reopen=function(){o.end(()=>{o=HI(r,t,i,n)})},a.sighupHandler=function(){UI("SIGHUP handler called."),a.reopen()},a.shutdown=function(l){process.removeListener("SIGHUP",a.sighupHandler),o.end("","utf-8",l)},process.on("SIGHUP",a.sighupHandler),a}function lY(r,e){let t=e.basicLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),aY(r.filename,t,r.maxLogSize,r.backups,r,r.timezoneOffset)}WI.exports.configure=lY});var GI=x((Nve,VI)=>{var cY=bx(),uY=require("os"),fY=uY.EOL;function dY(r,e,t,i,n){i.maxSize=i.maxLogSize;let s=new cY.DateRollingFileStream(r,e,i);s.on("drain",()=>{process.emit("log4js:pause",!1)});let o=function(a){s.write(t(a,n)+fY,"utf8")||process.emit("log4js:pause",!0)};return o.shutdown=function(a){s.write("","utf-8",()=>{s.end(a)})},o}function hY(r,e){let t=e.basicLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),r.alwaysIncludePattern||(r.alwaysIncludePattern=!1),dY(r.filename,r.pattern,t,r,r.timezoneOffset)}VI.exports.configure=hY});var XI=x((qve,YI)=>{var gs=Bt()("log4js:fileSync"),Hl=require("path"),vs=require("fs"),pY=require("os"),mY=pY.EOL||`
`;function KI(r,e){if(vs.existsSync(r))return;let t=vs.openSync(r,e.flags,e.mode);vs.closeSync(t)}var JI=class{constructor(e,t,i,n){gs("In RollingFileStream");function s(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}s(),this.filename=e,this.size=t,this.backups=i||1,this.options=n,this.currentSize=0;function o(a){let l=0;try{l=vs.statSync(a).size}catch(c){KI(a,n)}return l}this.currentSize=o(this.filename)}shouldRoll(){return gs("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){let t=this,i=new RegExp(`^${Hl.basename(e)}`);function n(c){return i.test(c)}function s(c){return parseInt(c.substring(`${Hl.basename(e)}.`.length),10)||0}function o(c,u){return s(c)>s(u)?1:s(c)<s(u)?-1:0}function a(c){let u=s(c);if(gs(`Index of ${c} is ${u}`),u<t.backups){try{vs.unlinkSync(`${e}.${u+1}`)}catch(f){}gs(`Renaming ${c} -> ${e}.${u+1}`),vs.renameSync(Hl.join(Hl.dirname(e),c),`${e}.${u+1}`)}}function l(){gs("Renaming the old files"),vs.readdirSync(Hl.dirname(e)).filter(n).sort(o).reverse().forEach(a)}gs("Rolling, rolling, rolling"),l()}write(e,t){let i=this;function n(){gs("writing the chunk to the file"),i.currentSize+=e.length,vs.appendFileSync(i.filename,e)}gs("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),n()}};function gY(r,e,t,i,n,s){gs("fileSync appender created"),r=Hl.normalize(r),i=i===void 0?5:i,i=i===0?1:i;function o(l,c,u){let f;return c?f=new JI(l,c,u,s):f=(d=>(KI(d,s),{write(h){vs.appendFileSync(d,h)}}))(l),f}let a=o(r,t,i);return l=>{a.write(e(l,n)+mY)}}function vY(r,e){let t=e.basicLayout;r.layout&&(t=e.layout(r.layout.type,r.layout));let i={flags:r.flags||"a",encoding:r.encoding||"utf8",mode:r.mode||420};return gY(r.filename,t,r.maxLogSize,r.backups,r.timezoneOffset,i)}YI.exports.configure=vY});var wx=x(($ve,tO)=>{var bY=require("path"),xa=Bt()("log4js:appenders"),qr=fa(),ZI=Ip(),yY=pa(),wY=Hw(),xY=GR(),Hn=new Map;Hn.set("console",JR());Hn.set("stdout",XR());Hn.set("stderr",QR());Hn.set("logLevelFilter",tP());Hn.set("categoryFilter",nP());Hn.set("noLogFilter",aP());Hn.set("file",zI());Hn.set("dateFile",GI());Hn.set("fileSync",XI());var kf=new Map,yx=(r,e)=>{xa("Loading module from ",r);try{return require(r)}catch(t){qr.throwExceptionIf(e,t.code!=="MODULE_NOT_FOUND",`appender "${r}" could not be loaded (error was: ${t})`);return}},SY=(r,e)=>Hn.get(r)||yx(`./${r}`,e)||yx(r,e)||""||yx(bY.join(process.cwd(),r),e),Gp=new Set,QI=(r,e)=>{if(kf.has(r))return kf.get(r);if(!e.appenders[r])return!1;if(Gp.has(r))throw new Error(`Dependency loop detected for appender ${r}.`);Gp.add(r),xa(`Creating appender ${r}`);let t=CY(r,e);return Gp.delete(r),kf.set(r,t),t},CY=(r,e)=>{let t=e.appenders[r],i=t.type.configure?t.type:SY(t.type,e);return qr.throwExceptionIf(e,qr.not(i),`appender "${r}" is not valid (type "${t.type}" could not be found)`),i.appender&&xa(`DEPRECATION: Appender ${t.type} exports an appender function.`),i.shutdown&&xa(`DEPRECATION: Appender ${t.type} exports a shutdown function.`),xa(`${r}: clustering.isMaster ? ${ZI.isMaster()}`),xa(`${r}: appenderModule is ${require("util").inspect(i)}`),ZI.onlyOnMaster(()=>(xa(`calling appenderModule.configure for ${r} / ${t.type}`),i.configure(xY.modifyConfig(t),wY,n=>QI(n,e),yY)),()=>{})},eO=r=>{kf.clear(),Gp.clear();let e=[];Object.values(r.categories).forEach(t=>{e.push(...t.appenders)}),Object.keys(r.appenders).forEach(t=>{(e.includes(t)||r.appenders[t].type==="tcp-server")&&QI(t,r)})};eO({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}});qr.addListener(r=>{qr.throwExceptionIf(r,qr.not(qr.anObject(r.appenders)),'must have a property "appenders" of type object.');let e=Object.keys(r.appenders);qr.throwExceptionIf(r,qr.not(e.length),"must define at least one appender."),e.forEach(t=>{qr.throwExceptionIf(r,qr.not(r.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)})});qr.addListener(eO);tO.exports=kf});var Sx=x((Bve,sO)=>{var Sa=Bt()("log4js:categories"),kt=fa(),xx=pa(),iO=wx(),Wl=new Map;function rO(r,e,t){if(e.inherit===!1)return;let i=t.lastIndexOf(".");if(i<0)return;let n=t.substring(0,i),s=r.categories[n];s||(s={inherit:!0,appenders:[]}),rO(r,s,n),!r.categories[n]&&s.appenders&&s.appenders.length&&s.level&&(r.categories[n]=s),e.appenders=e.appenders||[],e.level=e.level||s.level,s.appenders.forEach(o=>{e.appenders.includes(o)||e.appenders.push(o)}),e.parent=s}function _Y(r){if(!r.categories)return;Object.keys(r.categories).forEach(t=>{let i=r.categories[t];rO(r,i,t)})}kt.addPreProcessingListener(r=>_Y(r));kt.addListener(r=>{kt.throwExceptionIf(r,kt.not(kt.anObject(r.categories)),'must have a property "categories" of type object.');let e=Object.keys(r.categories);kt.throwExceptionIf(r,kt.not(e.length),"must define at least one category."),e.forEach(t=>{let i=r.categories[t];kt.throwExceptionIf(r,[kt.not(i.appenders),kt.not(i.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),kt.throwExceptionIf(r,kt.not(Array.isArray(i.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),kt.throwExceptionIf(r,kt.not(i.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(i,"enableCallStack")&&kt.throwExceptionIf(r,typeof i.enableCallStack!="boolean",`category "${t}" is not valid (enableCallStack must be boolean type)`),i.appenders.forEach(n=>{kt.throwExceptionIf(r,kt.not(iO.get(n)),`category "${t}" is not valid (appender "${n}" is not defined)`)}),kt.throwExceptionIf(r,kt.not(xx.getLevel(i.level)),`category "${t}" is not valid (level "${i.level}" not recognised; valid levels are ${xx.levels.join(", ")})`)}),kt.throwExceptionIf(r,kt.not(r.categories.default),'must define a "default" category.')});var nO=r=>{Wl.clear(),Object.keys(r.categories).forEach(t=>{let i=r.categories[t],n=[];i.appenders.forEach(s=>{n.push(iO.get(s)),Sa(`Creating category ${t}`),Wl.set(t,{appenders:n,level:xx.getLevel(i.level),enableCallStack:i.enableCallStack||!1})})})};nO({categories:{default:{appenders:["out"],level:"OFF"}}});kt.addListener(nO);var Ca=r=>(Sa(`configForCategory: searching for config for ${r}`),Wl.has(r)?(Sa(`configForCategory: ${r} exists in config, returning it`),Wl.get(r)):r.indexOf(".")>0?(Sa(`configForCategory: ${r} has hierarchy, searching for parents`),Ca(r.substring(0,r.lastIndexOf(".")))):(Sa("configForCategory: returning config for default category"),Ca("default"))),EY=r=>Ca(r).appenders,TY=r=>Ca(r).level,DY=(r,e)=>{let t=Wl.get(r);if(Sa(`setLevelForCategory: found ${t} for ${r}`),!t){let i=Ca(r);Sa(`setLevelForCategory: no config found for category, found ${i} for parents of ${r}`),t={appenders:i.appenders}}t.level=e,Wl.set(r,t)},RY=r=>Ca(r).enableCallStack===!0,PY=(r,e)=>{Ca(r).enableCallStack=e};sO.exports={appendersForCategory:EY,getLevelForCategory:TY,setLevelForCategory:DY,getEnableCallStackForCategory:RY,setEnableCallStackForCategory:PY}});var cO=x((jve,lO)=>{var oO=Bt()("log4js:logger"),kY=zw(),uo=pa(),IY=Ip(),Kp=Sx(),OY=fa(),LY=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function AY(r,e=4){let t=r.stack.split(`
`).slice(e),i=LY.exec(t[0]);return i&&i.length===6?{functionName:i[1],fileName:i[2],lineNumber:parseInt(i[3],10),columnNumber:parseInt(i[4],10),callStack:t.join(`
`)}:null}var Jp=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=AY,oO(`Logger created (${this.category}, ${this.level})`)}get level(){return uo.getLevel(Kp.getLevelForCategory(this.category),uo.TRACE)}set level(e){Kp.setLevelForCategory(this.category,uo.getLevel(e,this.level))}get useCallStack(){return Kp.getEnableCallStackForCategory(this.category)}set useCallStack(e){Kp.setEnableCallStackForCategory(this.category,e===!0)}log(e,...t){let i=uo.getLevel(e,uo.INFO);this.isLevelEnabled(i)&&this._log(i,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){oO(`sending log data (${e}) to appenders`);let i=new kY(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));IY.send(i)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}};function aO(r){let e=uo.getLevel(r),i=e.toString().toLowerCase().replace(/_([a-z])/g,s=>s[1].toUpperCase()),n=i[0].toUpperCase()+i.slice(1);Jp.prototype[`is${n}Enabled`]=function(){return this.isLevelEnabled(e)},Jp.prototype[i]=function(...s){this.log(e,...s)}}uo.levels.forEach(aO);OY.addListener(()=>{uo.levels.forEach(aO)});lO.exports=Jp});var dO=x((Uve,fO)=>{var zl=pa(),FY=':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"';function MY(r){return r.originalUrl||r.url}function NY(r,e,t){let i=s=>{let o=s.concat();for(let a=0;a<o.length;++a)for(let l=a+1;l<o.length;++l)o[a].token==o[l].token&&o.splice(l--,1);return o},n=[];return n.push({token:":url",replacement:MY(r)}),n.push({token:":protocol",replacement:r.protocol}),n.push({token:":hostname",replacement:r.hostname}),n.push({token:":method",replacement:r.method}),n.push({token:":status",replacement:e.__statusCode||e.statusCode}),n.push({token:":response-time",replacement:e.responseTime}),n.push({token:":date",replacement:new Date().toUTCString()}),n.push({token:":referrer",replacement:r.headers.referer||r.headers.referrer||""}),n.push({token:":http-version",replacement:`${r.httpVersionMajor}.${r.httpVersionMinor}`}),n.push({token:":remote-addr",replacement:r.headers["x-forwarded-for"]||r.ip||r._remoteAddress||r.socket&&(r.socket.remoteAddress||r.socket.socket&&r.socket.socket.remoteAddress)}),n.push({token:":user-agent",replacement:r.headers["user-agent"]}),n.push({token:":content-length",replacement:e.getHeader("content-length")||e.__headers&&e.__headers["Content-Length"]||"-"}),n.push({token:/:req\[([^\]]+)]/g,replacement(s,o){return r.headers[o.toLowerCase()]}}),n.push({token:/:res\[([^\]]+)]/g,replacement(s,o){return e.getHeader(o.toLowerCase())||e.__headers&&e.__headers[o]}}),i(t.concat(n))}function uO(r,e){for(let t=0;t<e.length;t++)r=r.replace(e[t].token,e[t].replacement);return r}function qY(r){let e=null;if(r instanceof RegExp&&(e=r),typeof r=="string"&&(e=new RegExp(r)),Array.isArray(r)){let t=r.map(i=>i.source?i.source:i);e=new RegExp(t.join("|"))}return e}function $Y(r,e,t){let i=e;if(t){let n=t.find(s=>{let o=!1;return s.from&&s.to?o=r>=s.from&&r<=s.to:o=s.codes.indexOf(r)!==-1,o});n&&(i=zl.getLevel(n.level,i))}return i}fO.exports=function(e,t){typeof t=="string"||typeof t=="function"?t={format:t}:t=t||{};let i=e,n=zl.getLevel(t.level,zl.INFO),s=t.format||FY,o=qY(t.nolog);return(a,l,c)=>{if(a._logging||o&&o.test(a.originalUrl))return c();if(i.isLevelEnabled(n)||t.level==="auto"){let u=new Date,{writeHead:f}=l;a._logging=!0,l.writeHead=(d,h)=>{l.writeHead=f,l.writeHead(d,h),l.__statusCode=d,l.__headers=h||{}},l.on("finish",()=>{l.responseTime=new Date-u,l.statusCode&&t.level==="auto"&&(n=zl.INFO,l.statusCode>=300&&(n=zl.WARN),l.statusCode>=400&&(n=zl.ERROR)),n=$Y(l.statusCode,n,t.statusRules);let d=NY(a,l,t.tokens||[]);if(t.context&&i.addContext("res",l),typeof s=="function"){let h=s(a,l,p=>uO(p,d));h&&i.log(n,h)}else i.log(n,uO(s,d));t.context&&i.removeContext("res")})}return c()}}});var Cx=x((Hve,mO)=>{var fo=Bt()("log4js:main"),BY=require("fs"),jY=mR()({proto:!0}),UY=fa(),HY=Hw(),WY=pa(),zY=wx(),VY=Sx(),GY=cO(),KY=Ip(),JY=dO(),Yp=!1;function YY(r){if(!Yp)return;fo("Received log event ",r),VY.appendersForCategory(r.categoryName).forEach(t=>{t(r)})}function XY(r){fo(`Loading configuration from ${r}`);try{return JSON.parse(BY.readFileSync(r,"utf8"))}catch(e){throw new Error(`Problem reading config from file "${r}". Error was ${e.message}`,e)}}function hO(r){let e=r;return typeof e=="string"&&(e=XY(r)),fo(`Configuration is ${e}`),UY.configure(jY(e)),KY.onMessage(YY),Yp=!0,pO}function ZY(r){fo("Shutdown called. Disabling all log writing."),Yp=!1;let e=Array.from(zY.values()),t=e.reduceRight((o,a)=>a.shutdown?o+1:o,0),i=0,n;fo(`Found ${t} appenders with shutdown functions.`);function s(o){n=n||o,i+=1,fo(`Appender shutdowns complete: ${i} / ${t}`),i>=t&&(fo("All shutdown functions completed."),r&&r(n))}return t===0?(fo("No appenders with shutdown functions found."),r!==void 0&&r()):(e.filter(o=>o.shutdown).forEach(o=>o.shutdown(s)),null)}function QY(r){return Yp||hO(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new GY(r||"default")}var pO={getLogger:QY,configure:hO,shutdown:ZY,connectLogger:JY,levels:WY,addLayout:HY.addLayout};mO.exports=pO});var yr=x(_x=>{"use strict";_x.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,i)=>{r.call(this,...e,(n,s)=>n!=null?i(n):t(s))})},"name",{value:r.name})};_x.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);r.apply(this,e.slice(0,-1)).then(i=>t(null,i),t)},"name",{value:r.name})}});var If=x(ho=>{"use strict";var gO=yr().fromCallback,Ni=Le(),eX=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(r=>typeof Ni[r]=="function");Object.keys(Ni).forEach(r=>{r!=="promises"&&(ho[r]=Ni[r])});eX.forEach(r=>{ho[r]=gO(Ni[r])});ho.exists=function(r,e){return typeof e=="function"?Ni.exists(r,e):new Promise(t=>Ni.exists(r,t))};ho.read=function(r,e,t,i,n,s){return typeof s=="function"?Ni.read(r,e,t,i,n,s):new Promise((o,a)=>{Ni.read(r,e,t,i,n,(l,c,u)=>{if(l)return a(l);o({bytesRead:c,buffer:u})})})};ho.write=function(r,e,...t){return typeof t[t.length-1]=="function"?Ni.write(r,e,...t):new Promise((i,n)=>{Ni.write(r,e,...t,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffer:a})})})};typeof Ni.writev=="function"&&(ho.writev=function(r,e,...t){return typeof t[t.length-1]=="function"?Ni.writev(r,e,...t):new Promise((i,n)=>{Ni.writev(r,e,...t,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffers:a})})})});typeof Ni.realpath.native=="function"&&(ho.realpath.native=gO(Ni.realpath.native))});var Ex=x((Vve,vO)=>{vO.exports=r=>{let e=process.versions.node.split(".").map(t=>parseInt(t,10));return r=r.split(".").map(t=>parseInt(t,10)),e[0]>r[0]||e[0]===r[0]&&(e[1]>r[1]||e[1]===r[1]&&e[2]>=r[2])}});var SO=x((Gve,Tx)=>{"use strict";var Vl=If(),bs=require("path"),tX=Ex(),bO=tX("10.12.0"),yO=r=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(r.replace(bs.parse(r).root,""))){let t=new Error(`Path contains invalid characters: ${r}`);throw t.code="EINVAL",t}},wO=r=>{let e={mode:511};return typeof r=="number"&&(r={mode:r}),ut(ut({},e),r)},xO=r=>{let e=new Error(`operation not permitted, mkdir '${r}'`);return e.code="EPERM",e.errno=-4048,e.path=r,e.syscall="mkdir",e};Tx.exports.makeDir=async(r,e)=>{if(yO(r),e=wO(e),bO){let i=bs.resolve(r);return Vl.mkdir(i,{mode:e.mode,recursive:!0})}let t=async i=>{try{await Vl.mkdir(i,e.mode)}catch(n){if(n.code==="EPERM")throw n;if(n.code==="ENOENT"){if(bs.dirname(i)===i)throw xO(i);if(n.message.includes("null bytes"))throw n;return await t(bs.dirname(i)),t(i)}try{if(!(await Vl.stat(i)).isDirectory())throw new Error("The path is not a directory")}catch{throw n}}};return t(bs.resolve(r))};Tx.exports.makeDirSync=(r,e)=>{if(yO(r),e=wO(e),bO){let i=bs.resolve(r);return Vl.mkdirSync(i,{mode:e.mode,recursive:!0})}let t=i=>{try{Vl.mkdirSync(i,e.mode)}catch(n){if(n.code==="EPERM")throw n;if(n.code==="ENOENT"){if(bs.dirname(i)===i)throw xO(i);if(n.message.includes("null bytes"))throw n;return t(bs.dirname(i)),t(i)}try{if(!Vl.statSync(i).isDirectory())throw new Error("The path is not a directory")}catch{throw n}}};return t(bs.resolve(r))}});var hn=x((Kve,CO)=>{"use strict";var iX=yr().fromPromise,{makeDir:rX,makeDirSync:Dx}=SO(),Rx=iX(rX);CO.exports={mkdirs:Rx,mkdirsSync:Dx,mkdirp:Rx,mkdirpSync:Dx,ensureDir:Rx,ensureDirSync:Dx}});var Px=x((Jve,_O)=>{"use strict";var Gl=Le();function nX(r,e,t,i){Gl.open(r,"r+",(n,s)=>{if(n)return i(n);Gl.futimes(s,e,t,o=>{Gl.close(s,a=>{i&&i(o||a)})})})}function sX(r,e,t){let i=Gl.openSync(r,"r+");return Gl.futimesSync(i,e,t),Gl.closeSync(i)}_O.exports={utimesMillis:nX,utimesMillisSync:sX}});var Of=x((Yve,RO)=>{"use strict";var Kl=If(),Yi=require("path"),oX=require("util"),aX=Ex(),Xp=aX("10.5.0"),EO=r=>Xp?Kl.stat(r,{bigint:!0}):Kl.stat(r),kx=r=>Xp?Kl.statSync(r,{bigint:!0}):Kl.statSync(r);function lX(r,e){return Promise.all([EO(r),EO(e).catch(t=>{if(t.code==="ENOENT")return null;throw t})]).then(([t,i])=>({srcStat:t,destStat:i}))}function cX(r,e){let t,i=kx(r);try{t=kx(e)}catch(n){if(n.code==="ENOENT")return{srcStat:i,destStat:null};throw n}return{srcStat:i,destStat:t}}function uX(r,e,t,i){oX.callbackify(lX)(r,e,(n,s)=>{if(n)return i(n);let{srcStat:o,destStat:a}=s;return a&&Zp(o,a)?i(new Error("Source and destination must not be the same.")):o.isDirectory()&&Ix(r,e)?i(new Error(Qp(r,e,t))):i(null,{srcStat:o,destStat:a})})}function fX(r,e,t){let{srcStat:i,destStat:n}=cX(r,e);if(n&&Zp(i,n))throw new Error("Source and destination must not be the same.");if(i.isDirectory()&&Ix(r,e))throw new Error(Qp(r,e,t));return{srcStat:i,destStat:n}}function TO(r,e,t,i,n){let s=Yi.resolve(Yi.dirname(r)),o=Yi.resolve(Yi.dirname(t));if(o===s||o===Yi.parse(o).root)return n();let a=(l,c)=>l?l.code==="ENOENT"?n():n(l):Zp(e,c)?n(new Error(Qp(r,t,i))):TO(r,e,o,i,n);Xp?Kl.stat(o,{bigint:!0},a):Kl.stat(o,a)}function DO(r,e,t,i){let n=Yi.resolve(Yi.dirname(r)),s=Yi.resolve(Yi.dirname(t));if(s===n||s===Yi.parse(s).root)return;let o;try{o=kx(s)}catch(a){if(a.code==="ENOENT")return;throw a}if(Zp(e,o))throw new Error(Qp(r,t,i));return DO(r,e,s,i)}function Zp(r,e){return!!(e.ino&&e.dev&&e.ino===r.ino&&e.dev===r.dev&&(Xp||e.ino<Number.MAX_SAFE_INTEGER||e.size===r.size&&e.mode===r.mode&&e.nlink===r.nlink&&e.atimeMs===r.atimeMs&&e.mtimeMs===r.mtimeMs&&e.ctimeMs===r.ctimeMs&&e.birthtimeMs===r.birthtimeMs))}function Ix(r,e){let t=Yi.resolve(r).split(Yi.sep).filter(n=>n),i=Yi.resolve(e).split(Yi.sep).filter(n=>n);return t.reduce((n,s,o)=>n&&i[o]===s,!0)}function Qp(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}RO.exports={checkPaths:uX,checkPathsSync:fX,checkParentPaths:TO,checkParentPathsSync:DO,isSrcSubdir:Ix}});var LO=x((Xve,OO)=>{"use strict";var wi=Le(),Lf=require("path"),dX=hn().mkdirsSync,hX=Px().utimesMillisSync,Af=Of();function pX(r,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:i,destStat:n}=Af.checkPathsSync(r,e,"copy");return Af.checkParentPathsSync(r,i,e,"copy"),mX(n,r,e,t)}function mX(r,e,t,i){if(i.filter&&!i.filter(e,t))return;let n=Lf.dirname(t);return wi.existsSync(n)||dX(n),PO(r,e,t,i)}function PO(r,e,t,i){if(!(i.filter&&!i.filter(e,t)))return gX(r,e,t,i)}function gX(r,e,t,i){let s=(i.dereference?wi.statSync:wi.lstatSync)(e);if(s.isDirectory())return CX(s,r,e,t,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return vX(s,r,e,t,i);if(s.isSymbolicLink())return TX(r,e,t,i)}function vX(r,e,t,i,n){return e?bX(r,t,i,n):kO(r,t,i,n)}function bX(r,e,t,i){if(i.overwrite)return wi.unlinkSync(t),kO(r,e,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}function kO(r,e,t,i){return wi.copyFileSync(e,t),i.preserveTimestamps&&yX(r.mode,e,t),Ox(t,r.mode)}function yX(r,e,t){return wX(r)&&xX(t,r),SX(e,t)}function wX(r){return(r&128)==0}function xX(r,e){return Ox(r,e|128)}function Ox(r,e){return wi.chmodSync(r,e)}function SX(r,e){let t=wi.statSync(r);return hX(e,t.atime,t.mtime)}function CX(r,e,t,i,n){if(!e)return _X(r.mode,t,i,n);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`);return IO(t,i,n)}function _X(r,e,t,i){return wi.mkdirSync(t),IO(e,t,i),Ox(t,r)}function IO(r,e,t){wi.readdirSync(r).forEach(i=>EX(i,r,e,t))}function EX(r,e,t,i){let n=Lf.join(e,r),s=Lf.join(t,r),{destStat:o}=Af.checkPathsSync(n,s,"copy");return PO(o,n,s,i)}function TX(r,e,t,i){let n=wi.readlinkSync(e);if(i.dereference&&(n=Lf.resolve(process.cwd(),n)),r){let s;try{s=wi.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return wi.symlinkSync(n,t);throw o}if(i.dereference&&(s=Lf.resolve(process.cwd(),s)),Af.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(wi.statSync(t).isDirectory()&&Af.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`);return DX(n,t)}else return wi.symlinkSync(n,t)}function DX(r,e){return wi.unlinkSync(e),wi.symlinkSync(r,e)}OO.exports=pX});var Lx=x((Zve,AO)=>{"use strict";AO.exports={copySync:LO()}});var po=x((Qve,MO)=>{"use strict";var RX=yr().fromPromise,FO=If();function PX(r){return FO.access(r).then(()=>!0).catch(()=>!1)}MO.exports={pathExists:RX(PX),pathExistsSync:FO.existsSync}});var zO=x((ebe,WO)=>{"use strict";var Xi=Le(),Ff=require("path"),kX=hn().mkdirs,IX=po().pathExists,OX=Px().utimesMillis,Mf=Of();function LX(r,e,t,i){typeof t=="function"&&!i?(i=t,t={}):typeof t=="function"&&(t={filter:t}),i=i||function(){},t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`),Mf.checkPaths(r,e,"copy",(n,s)=>{if(n)return i(n);let{srcStat:o,destStat:a}=s;Mf.checkParentPaths(r,o,e,"copy",l=>l?i(l):t.filter?qO(NO,a,r,e,t,i):NO(a,r,e,t,i))})}function NO(r,e,t,i,n){let s=Ff.dirname(t);IX(s,(o,a)=>{if(o)return n(o);if(a)return Ax(r,e,t,i,n);kX(s,l=>l?n(l):Ax(r,e,t,i,n))})}function qO(r,e,t,i,n,s){Promise.resolve(n.filter(t,i)).then(o=>o?r(e,t,i,n,s):s(),o=>s(o))}function Ax(r,e,t,i,n){return i.filter?qO($O,r,e,t,i,n):$O(r,e,t,i,n)}function $O(r,e,t,i,n){(i.dereference?Xi.stat:Xi.lstat)(e,(o,a)=>{if(o)return n(o);if(a.isDirectory())return BX(a,r,e,t,i,n);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return AX(a,r,e,t,i,n);if(a.isSymbolicLink())return HX(r,e,t,i,n)})}function AX(r,e,t,i,n,s){return e?FX(r,t,i,n,s):BO(r,t,i,n,s)}function FX(r,e,t,i,n){if(i.overwrite)Xi.unlink(t,s=>s?n(s):BO(r,e,t,i,n));else return i.errorOnExist?n(new Error(`'${t}' already exists`)):n()}function BO(r,e,t,i,n){Xi.copyFile(e,t,s=>s?n(s):i.preserveTimestamps?MX(r.mode,e,t,n):em(t,r.mode,n))}function MX(r,e,t,i){return NX(r)?qX(t,r,n=>n?i(n):jO(r,e,t,i)):jO(r,e,t,i)}function NX(r){return(r&128)==0}function qX(r,e,t){return em(r,e|128,t)}function jO(r,e,t,i){$X(e,t,n=>n?i(n):em(t,r,i))}function em(r,e,t){return Xi.chmod(r,e,t)}function $X(r,e,t){Xi.stat(r,(i,n)=>i?t(i):OX(e,n.atime,n.mtime,t))}function BX(r,e,t,i,n,s){return e?e&&!e.isDirectory()?s(new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`)):UO(t,i,n,s):jX(r.mode,t,i,n,s)}function jX(r,e,t,i,n){Xi.mkdir(t,s=>{if(s)return n(s);UO(e,t,i,o=>o?n(o):em(t,r,n))})}function UO(r,e,t,i){Xi.readdir(r,(n,s)=>n?i(n):HO(s,r,e,t,i))}function HO(r,e,t,i,n){let s=r.pop();return s?UX(r,s,e,t,i,n):n()}function UX(r,e,t,i,n,s){let o=Ff.join(t,e),a=Ff.join(i,e);Mf.checkPaths(o,a,"copy",(l,c)=>{if(l)return s(l);let{destStat:u}=c;Ax(u,o,a,n,f=>f?s(f):HO(r,t,i,n,s))})}function HX(r,e,t,i,n){Xi.readlink(e,(s,o)=>{if(s)return n(s);if(i.dereference&&(o=Ff.resolve(process.cwd(),o)),r)Xi.readlink(t,(a,l)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Xi.symlink(o,t,n):n(a):(i.dereference&&(l=Ff.resolve(process.cwd(),l)),Mf.isSrcSubdir(o,l)?n(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${l}'.`)):r.isDirectory()&&Mf.isSrcSubdir(l,o)?n(new Error(`Cannot overwrite '${l}' with '${o}'.`)):WX(o,t,n)));else return Xi.symlink(o,t,n)})}function WX(r,e,t){Xi.unlink(e,i=>i?t(i):Xi.symlink(r,e,t))}WO.exports=LX});var Fx=x((tbe,VO)=>{"use strict";var zX=yr().fromCallback;VO.exports={copy:zX(zO())}});var t1=x((ibe,e1)=>{"use strict";var GO=Le(),KO=require("path"),rt=require("assert"),Nf=process.platform==="win32";function JO(r){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{r[t]=r[t]||GO[t],t=t+"Sync",r[t]=r[t]||GO[t]}),r.maxBusyTries=r.maxBusyTries||3}function Mx(r,e,t){let i=0;typeof e=="function"&&(t=e,e={}),rt(r,"rimraf: missing path"),rt.strictEqual(typeof r,"string","rimraf: path should be a string"),rt.strictEqual(typeof t,"function","rimraf: callback function required"),rt(e,"rimraf: invalid options argument provided"),rt.strictEqual(typeof e,"object","rimraf: options should be object"),JO(e),YO(r,e,function n(s){if(s){if((s.code==="EBUSY"||s.code==="ENOTEMPTY"||s.code==="EPERM")&&i<e.maxBusyTries){i++;let o=i*100;return setTimeout(()=>YO(r,e,n),o)}s.code==="ENOENT"&&(s=null)}t(s)})}function YO(r,e,t){rt(r),rt(e),rt(typeof t=="function"),e.lstat(r,(i,n)=>{if(i&&i.code==="ENOENT")return t(null);if(i&&i.code==="EPERM"&&Nf)return XO(r,e,i,t);if(n&&n.isDirectory())return tm(r,e,i,t);e.unlink(r,s=>{if(s){if(s.code==="ENOENT")return t(null);if(s.code==="EPERM")return Nf?XO(r,e,s,t):tm(r,e,s,t);if(s.code==="EISDIR")return tm(r,e,s,t)}return t(s)})})}function XO(r,e,t,i){rt(r),rt(e),rt(typeof i=="function"),e.chmod(r,438,n=>{n?i(n.code==="ENOENT"?null:t):e.stat(r,(s,o)=>{s?i(s.code==="ENOENT"?null:t):o.isDirectory()?tm(r,e,t,i):e.unlink(r,i)})})}function ZO(r,e,t){let i;rt(r),rt(e);try{e.chmodSync(r,438)}catch(n){if(n.code==="ENOENT")return;throw t}try{i=e.statSync(r)}catch(n){if(n.code==="ENOENT")return;throw t}i.isDirectory()?im(r,e,t):e.unlinkSync(r)}function tm(r,e,t,i){rt(r),rt(e),rt(typeof i=="function"),e.rmdir(r,n=>{n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")?VX(r,e,i):n&&n.code==="ENOTDIR"?i(t):i(n)})}function VX(r,e,t){rt(r),rt(e),rt(typeof t=="function"),e.readdir(r,(i,n)=>{if(i)return t(i);let s=n.length,o;if(s===0)return e.rmdir(r,t);n.forEach(a=>{Mx(KO.join(r,a),e,l=>{if(!o){if(l)return t(o=l);--s==0&&e.rmdir(r,t)}})})})}function QO(r,e){let t;e=e||{},JO(e),rt(r,"rimraf: missing path"),rt.strictEqual(typeof r,"string","rimraf: path should be a string"),rt(e,"rimraf: missing options"),rt.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(r)}catch(i){if(i.code==="ENOENT")return;i.code==="EPERM"&&Nf&&ZO(r,e,i)}try{t&&t.isDirectory()?im(r,e,null):e.unlinkSync(r)}catch(i){if(i.code==="ENOENT")return;if(i.code==="EPERM")return Nf?ZO(r,e,i):im(r,e,i);if(i.code!=="EISDIR")throw i;im(r,e,i)}}function im(r,e,t){rt(r),rt(e);try{e.rmdirSync(r)}catch(i){if(i.code==="ENOTDIR")throw t;if(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")GX(r,e);else if(i.code!=="ENOENT")throw i}}function GX(r,e){if(rt(r),rt(e),e.readdirSync(r).forEach(t=>QO(KO.join(r,t),e)),Nf){let t=Date.now();do try{return e.rmdirSync(r,e)}catch{}while(Date.now()-t<500)}else return e.rmdirSync(r,e)}e1.exports=Mx;Mx.sync=QO});var qf=x((rbe,r1)=>{"use strict";var KX=yr().fromCallback,i1=t1();r1.exports={remove:KX(i1),removeSync:i1.sync}});var f1=x((nbe,u1)=>{"use strict";var JX=yr().fromCallback,n1=Le(),s1=require("path"),o1=hn(),a1=qf(),l1=JX(function(e,t){t=t||function(){},n1.readdir(e,(i,n)=>{if(i)return o1.mkdirs(e,t);n=n.map(o=>s1.join(e,o)),s();function s(){let o=n.pop();if(!o)return t();a1.remove(o,a=>{if(a)return t(a);s()})}})});function c1(r){let e;try{e=n1.readdirSync(r)}catch{return o1.mkdirsSync(r)}e.forEach(t=>{t=s1.join(r,t),a1.removeSync(t)})}u1.exports={emptyDirSync:c1,emptydirSync:c1,emptyDir:l1,emptydir:l1}});var m1=x((sbe,p1)=>{"use strict";var YX=yr().fromCallback,d1=require("path"),mo=Le(),h1=hn();function XX(r,e){function t(){mo.writeFile(r,"",i=>{if(i)return e(i);e()})}mo.stat(r,(i,n)=>{if(!i&&n.isFile())return e();let s=d1.dirname(r);mo.stat(s,(o,a)=>{if(o)return o.code==="ENOENT"?h1.mkdirs(s,l=>{if(l)return e(l);t()}):e(o);a.isDirectory()?t():mo.readdir(s,l=>{if(l)return e(l)})})})}function ZX(r){let e;try{e=mo.statSync(r)}catch{}if(e&&e.isFile())return;let t=d1.dirname(r);try{mo.statSync(t).isDirectory()||mo.readdirSync(t)}catch(i){if(i&&i.code==="ENOENT")h1.mkdirsSync(t);else throw i}mo.writeFileSync(r,"")}p1.exports={createFile:YX(XX),createFileSync:ZX}});var w1=x((obe,y1)=>{"use strict";var QX=yr().fromCallback,g1=require("path"),_a=Le(),v1=hn(),b1=po().pathExists;function eZ(r,e,t){function i(n,s){_a.link(n,s,o=>{if(o)return t(o);t(null)})}b1(e,(n,s)=>{if(n)return t(n);if(s)return t(null);_a.lstat(r,o=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),t(o);let a=g1.dirname(e);b1(a,(l,c)=>{if(l)return t(l);if(c)return i(r,e);v1.mkdirs(a,u=>{if(u)return t(u);i(r,e)})})})})}function tZ(r,e){if(_a.existsSync(e))return;try{_a.lstatSync(r)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let i=g1.dirname(e);return _a.existsSync(i)||v1.mkdirsSync(i),_a.linkSync(r,e)}y1.exports={createLink:QX(eZ),createLinkSync:tZ}});var S1=x((abe,x1)=>{"use strict";var go=require("path"),$f=Le(),iZ=po().pathExists;function rZ(r,e,t){if(go.isAbsolute(r))return $f.lstat(r,i=>i?(i.message=i.message.replace("lstat","ensureSymlink"),t(i)):t(null,{toCwd:r,toDst:r}));{let i=go.dirname(e),n=go.join(i,r);return iZ(n,(s,o)=>s?t(s):o?t(null,{toCwd:n,toDst:r}):$f.lstat(r,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),t(a)):t(null,{toCwd:r,toDst:go.relative(i,r)})))}}function nZ(r,e){let t;if(go.isAbsolute(r)){if(t=$f.existsSync(r),!t)throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}else{let i=go.dirname(e),n=go.join(i,r);if(t=$f.existsSync(n),t)return{toCwd:n,toDst:r};if(t=$f.existsSync(r),!t)throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:go.relative(i,r)}}}x1.exports={symlinkPaths:rZ,symlinkPathsSync:nZ}});var E1=x((lbe,_1)=>{"use strict";var C1=Le();function sZ(r,e,t){if(t=typeof e=="function"?e:t,e=typeof e=="function"?!1:e,e)return t(null,e);C1.lstat(r,(i,n)=>{if(i)return t(null,"file");e=n&&n.isDirectory()?"dir":"file",t(null,e)})}function oZ(r,e){let t;if(e)return e;try{t=C1.lstatSync(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}_1.exports={symlinkType:sZ,symlinkTypeSync:oZ}});var O1=x((cbe,I1)=>{"use strict";var aZ=yr().fromCallback,T1=require("path"),Jl=Le(),D1=hn(),lZ=D1.mkdirs,cZ=D1.mkdirsSync,R1=S1(),uZ=R1.symlinkPaths,fZ=R1.symlinkPathsSync,P1=E1(),dZ=P1.symlinkType,hZ=P1.symlinkTypeSync,k1=po().pathExists;function pZ(r,e,t,i){i=typeof t=="function"?t:i,t=typeof t=="function"?!1:t,k1(e,(n,s)=>{if(n)return i(n);if(s)return i(null);uZ(r,e,(o,a)=>{if(o)return i(o);r=a.toDst,dZ(a.toCwd,t,(l,c)=>{if(l)return i(l);let u=T1.dirname(e);k1(u,(f,d)=>{if(f)return i(f);if(d)return Jl.symlink(r,e,c,i);lZ(u,h=>{if(h)return i(h);Jl.symlink(r,e,c,i)})})})})})}function mZ(r,e,t){if(Jl.existsSync(e))return;let n=fZ(r,e);r=n.toDst,t=hZ(n.toCwd,t);let s=T1.dirname(e);return Jl.existsSync(s)||cZ(s),Jl.symlinkSync(r,e,t)}I1.exports={createSymlink:aZ(pZ),createSymlinkSync:mZ}});var A1=x((ube,L1)=>{"use strict";var rm=m1(),nm=w1(),sm=O1();L1.exports={createFile:rm.createFile,createFileSync:rm.createFileSync,ensureFile:rm.createFile,ensureFileSync:rm.createFileSync,createLink:nm.createLink,createLinkSync:nm.createLinkSync,ensureLink:nm.createLink,ensureLinkSync:nm.createLinkSync,createSymlink:sm.createSymlink,createSymlinkSync:sm.createSymlinkSync,ensureSymlink:sm.createSymlink,ensureSymlinkSync:sm.createSymlinkSync}});var F1=x(Nx=>{"use strict";Nx.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,i)=>{r.call(this,...e,(n,s)=>n!=null?i(n):t(s))})},"name",{value:r.name})};Nx.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);r.apply(this,e.slice(0,-1)).then(i=>t(null,i),t)},"name",{value:r.name})}});var om=x((dbe,M1)=>{function gZ(r,{EOL:e=`
`,finalEOL:t=!0,replacer:i=null,spaces:n}={}){let s=t?e:"";return JSON.stringify(r,i,n).replace(/\n/g,e)+s}function vZ(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}M1.exports={stringify:gZ,stripBom:vZ}});var B1=x((hbe,$1)=>{var Yl;try{Yl=Le()}catch(r){Yl=require("fs")}var am=F1(),{stringify:N1,stripBom:q1}=om();async function bZ(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Yl,i="throws"in e?e.throws:!0,n=await am.fromCallback(t.readFile)(r,e);n=q1(n);let s;try{s=JSON.parse(n,e?e.reviver:null)}catch(o){if(i)throw o.message=`${r}: ${o.message}`,o;return null}return s}var yZ=am.fromPromise(bZ);function wZ(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Yl,i="throws"in e?e.throws:!0;try{let n=t.readFileSync(r,e);return n=q1(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${r}: ${n.message}`,n;return null}}async function xZ(r,e,t={}){let i=t.fs||Yl,n=N1(e,t);await am.fromCallback(i.writeFile)(r,n,t)}var SZ=am.fromPromise(xZ);function CZ(r,e,t={}){let i=t.fs||Yl,n=N1(e,t);return i.writeFileSync(r,n,t)}var _Z={readFile:yZ,readFileSync:wZ,writeFile:SZ,writeFileSync:CZ};$1.exports=_Z});var U1=x((pbe,j1)=>{"use strict";var lm=B1();j1.exports={readJson:lm.readFile,readJsonSync:lm.readFileSync,writeJson:lm.writeFile,writeJsonSync:lm.writeFileSync}});var cm=x((mbe,z1)=>{"use strict";var EZ=yr().fromCallback,Bf=Le(),H1=require("path"),W1=hn(),TZ=po().pathExists;function DZ(r,e,t,i){typeof t=="function"&&(i=t,t="utf8");let n=H1.dirname(r);TZ(n,(s,o)=>{if(s)return i(s);if(o)return Bf.writeFile(r,e,t,i);W1.mkdirs(n,a=>{if(a)return i(a);Bf.writeFile(r,e,t,i)})})}function RZ(r,...e){let t=H1.dirname(r);if(Bf.existsSync(t))return Bf.writeFileSync(r,...e);W1.mkdirsSync(t),Bf.writeFileSync(r,...e)}z1.exports={outputFile:EZ(DZ),outputFileSync:RZ}});var G1=x((gbe,V1)=>{"use strict";var{stringify:PZ}=om(),{outputFile:kZ}=cm();async function IZ(r,e,t={}){let i=PZ(e,t);await kZ(r,i,t)}V1.exports=IZ});var J1=x((vbe,K1)=>{"use strict";var{stringify:OZ}=om(),{outputFileSync:LZ}=cm();function AZ(r,e,t){let i=OZ(e,t);LZ(r,i,t)}K1.exports=AZ});var X1=x((bbe,Y1)=>{"use strict";var FZ=yr().fromPromise,qi=U1();qi.outputJson=FZ(G1());qi.outputJsonSync=J1();qi.outputJSON=qi.outputJson;qi.outputJSONSync=qi.outputJsonSync;qi.writeJSON=qi.writeJson;qi.writeJSONSync=qi.writeJsonSync;qi.readJSON=qi.readJson;qi.readJSONSync=qi.readJsonSync;Y1.exports=qi});var rL=x((ybe,iL)=>{"use strict";var Z1=Le(),MZ=require("path"),NZ=Lx().copySync,Q1=qf().removeSync,qZ=hn().mkdirpSync,eL=Of();function $Z(r,e,t){t=t||{};let i=t.overwrite||t.clobber||!1,{srcStat:n}=eL.checkPathsSync(r,e,"move");return eL.checkParentPathsSync(r,n,e,"move"),qZ(MZ.dirname(e)),BZ(r,e,i)}function BZ(r,e,t){if(t)return Q1(e),tL(r,e,t);if(Z1.existsSync(e))throw new Error("dest already exists.");return tL(r,e,t)}function tL(r,e,t){try{Z1.renameSync(r,e)}catch(i){if(i.code!=="EXDEV")throw i;return jZ(r,e,t)}}function jZ(r,e,t){return NZ(r,e,{overwrite:t,errorOnExist:!0}),Q1(r)}iL.exports=$Z});var sL=x((wbe,nL)=>{"use strict";nL.exports={moveSync:rL()}});var uL=x((xbe,cL)=>{"use strict";var UZ=Le(),HZ=require("path"),WZ=Fx().copy,oL=qf().remove,zZ=hn().mkdirp,VZ=po().pathExists,aL=Of();function GZ(r,e,t,i){typeof t=="function"&&(i=t,t={});let n=t.overwrite||t.clobber||!1;aL.checkPaths(r,e,"move",(s,o)=>{if(s)return i(s);let{srcStat:a}=o;aL.checkParentPaths(r,a,e,"move",l=>{if(l)return i(l);zZ(HZ.dirname(e),c=>c?i(c):KZ(r,e,n,i))})})}function KZ(r,e,t,i){if(t)return oL(e,n=>n?i(n):lL(r,e,t,i));VZ(e,(n,s)=>n?i(n):s?i(new Error("dest already exists.")):lL(r,e,t,i))}function lL(r,e,t,i){UZ.rename(r,e,n=>n?n.code!=="EXDEV"?i(n):JZ(r,e,t,i):i())}function JZ(r,e,t,i){WZ(r,e,{overwrite:t,errorOnExist:!0},s=>s?i(s):oL(r,i))}cL.exports=GZ});var dL=x((Sbe,fL)=>{"use strict";var YZ=yr().fromCallback;fL.exports={move:YZ(uL())}});var pn=x((Cbe,qx)=>{"use strict";qx.exports=ut(ut(ut(ut(ut(ut(ut(ut(ut(ut(ut(ut({},If()),Lx()),Fx()),f1()),A1()),X1()),hn()),sL()),dL()),cm()),po()),qf());var hL=require("fs");Object.getOwnPropertyDescriptor(hL,"promises")&&Object.defineProperty(qx.exports,"promises",{get(){return hL.promises}})});var U=x((_be,gL)=>{var Ea=E(require("fs")),$x=E(Cx()),um=E(require("path")),pL=E(require("os")),mL=E(pn());function XZ(){let r=process.env.NVIM_COC_LOG_FILE;if(r)return r;let e=process.env.XDG_RUNTIME_DIR;if(e)try{return Ea.default.accessSync(e,Ea.default.constants.R_OK|Ea.default.constants.W_OK),um.default.join(e,`coc-nvim-${process.pid}.log`)}catch(i){}let t=pL.default.tmpdir();return e=um.default.join(t,`coc.nvim-${process.pid}`),Ea.default.existsSync(e)||(0,mL.mkdirpSync)(e),um.default.join(e,"coc-nvim.log")}var ZZ=1024*1024,QZ=10,fm=XZ(),eQ=process.env.NVIM_COC_LOG_LEVEL||"info";if(Ea.default.existsSync(fm))try{Ea.default.writeFileSync(fm,"",{encoding:"utf8",mode:438})}catch(r){}$x.default.configure({disableClustering:!0,appenders:{out:{type:"file",mode:438,filename:fm,maxLogSize:ZZ,backups:QZ,layout:{type:"pattern",pattern:`%d{ISO8601} %p (pid:${process.pid}) [%c] - %m`}}},categories:{default:{appenders:["out"],level:eQ}}});gL.exports=(r="coc-nvim")=>{let e=$x.default.getLogger(r);return e.getLogFile=()=>fm,e}});var dm=x(()=>{Promise.prototype.logError=function(){this.catch(r=>{U()("extensions").error(r)})}});var bL=x((jx,vL)=>{vL.exports=Bx(typeof Buffer!="undefined"&&Buffer)||Bx(jx.Buffer)||Bx(typeof window!="undefined"&&window.Buffer)||jx.Buffer;function Bx(r){return r&&r.isBuffer&&r}});var hm=x((Dbe,yL)=>{var tQ={}.toString;yL.exports=Array.isArray||function(r){return tQ.call(r)=="[object Array]"}});var SL=x((Zl,xL)=>{var Xl=wr(),Zl=xL.exports=wL(0);Zl.alloc=wL;Zl.concat=Xl.concat;Zl.from=iQ;function wL(r){return new Array(r)}function iQ(r){if(!Xl.isBuffer(r)&&Xl.isView(r))r=Xl.Uint8Array.from(r);else if(Xl.isArrayBuffer(r))r=new Uint8Array(r);else{if(typeof r=="string")return Xl.from.call(Zl,r);if(typeof r=="number")throw new TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(r)}});var EL=x((ec,_L)=>{var ys=wr(),Ql=ys.global,ec=_L.exports=ys.hasBuffer?CL(0):[];ec.alloc=ys.hasBuffer&&Ql.alloc||CL;ec.concat=ys.concat;ec.from=rQ;function CL(r){return new Ql(r)}function rQ(r){if(!ys.isBuffer(r)&&ys.isView(r))r=ys.Uint8Array.from(r);else if(ys.isArrayBuffer(r))r=new Uint8Array(r);else{if(typeof r=="string")return ys.from.call(ec,r);if(typeof r=="number")throw new TypeError('"value" argument must not be a number')}return Ql.from&&Ql.from.length!==1?Ql.from(r):new Ql(r)}});var RL=x((tc,DL)=>{var pm=wr(),tc=DL.exports=pm.hasArrayBuffer?TL(0):[];tc.alloc=TL;tc.concat=pm.concat;tc.from=nQ;function TL(r){return new Uint8Array(r)}function nQ(r){if(pm.isView(r)){var e=r.byteOffset,t=r.byteLength;r=r.buffer,r.byteLength!==t&&(r.slice?r=r.slice(e,e+t):(r=new Uint8Array(r),r.byteLength!==t&&(r=Array.prototype.slice.call(r,e,e+t))))}else{if(typeof r=="string")return pm.from.call(tc,r);if(typeof r=="number")throw new TypeError('"value" argument must not be a number')}return new Uint8Array(r)}});var PL=x(mm=>{mm.copy=aQ;mm.toString=oQ;mm.write=sQ;function sQ(r,e){for(var t=this,i=e||(e|=0),n=r.length,s=0,o=0;o<n;)s=r.charCodeAt(o++),s<128?t[i++]=s:s<2048?(t[i++]=192|s>>>6,t[i++]=128|s&63):s<55296||s>57343?(t[i++]=224|s>>>12,t[i++]=128|s>>>6&63,t[i++]=128|s&63):(s=(s-55296<<10|r.charCodeAt(o++)-56320)+65536,t[i++]=240|s>>>18,t[i++]=128|s>>>12&63,t[i++]=128|s>>>6&63,t[i++]=128|s&63);return i-e}function oQ(r,e,t){var i=this,n=e|0;t||(t=i.length);for(var s="",o=0;n<t;){if(o=i[n++],o<128){s+=String.fromCharCode(o);continue}(o&224)==192?o=(o&31)<<6|i[n++]&63:(o&240)==224?o=(o&15)<<12|(i[n++]&63)<<6|i[n++]&63:(o&248)==240&&(o=(o&7)<<18|(i[n++]&63)<<12|(i[n++]&63)<<6|i[n++]&63),o>=65536?(o-=65536,s+=String.fromCharCode((o>>>10)+55296,(o&1023)+56320)):s+=String.fromCharCode(o)}return s}function aQ(r,e,t,i){var n;t||(t=0),!i&&i!==0&&(i=this.length),e||(e=0);var s=i-t;if(r===this&&t<e&&e<i)for(n=s-1;n>=0;n--)r[n+e]=this[n+t];else for(n=0;n<s;n++)r[n+e]=this[n+t];return s}});var gm=x(jf=>{var Ux=PL();jf.copy=LL;jf.slice=AL;jf.toString=lQ;jf.write=cQ("write");var vo=wr(),kL=vo.global,IL=vo.hasBuffer&&"TYPED_ARRAY_SUPPORT"in kL,OL=IL&&!kL.TYPED_ARRAY_SUPPORT;function LL(r,e,t,i){var n=vo.isBuffer(this),s=vo.isBuffer(r);if(n&&s)return this.copy(r,e,t,i);if(!OL&&!n&&!s&&vo.isView(this)&&vo.isView(r)){var o=t||i!=null?AL.call(this,t,i):this;return r.set(o,e),o.length}else return Ux.copy.call(this,r,e,t,i)}function AL(r,e){var t=this.slice||!OL&&this.subarray;if(t)return t.call(this,r,e);var i=vo.alloc.call(this,e-r);return LL.call(this,i,0,r,e),i}function lQ(r,e,t){var i=!IL&&vo.isBuffer(this)?this.toString:Ux.toString;return i.apply(this,arguments)}function cQ(r){return e;function e(){var t=this[r]||Ux[r];return t.apply(this,arguments)}}});var wr=x(xi=>{var Hx=xi.global=bL(),FL=xi.hasBuffer=Hx&&!!Hx.isBuffer,Wx=xi.hasArrayBuffer=typeof ArrayBuffer!="undefined",uQ=xi.isArray=hm();xi.isArrayBuffer=Wx?gQ:Gx;var fQ=xi.isBuffer=FL?Hx.isBuffer:Gx,dQ=xi.isView=Wx?ArrayBuffer.isView||BL("ArrayBuffer","buffer"):Gx;xi.alloc=Vx;xi.concat=pQ;xi.from=hQ;var ML=xi.Array=SL(),NL=xi.Buffer=EL(),qL=xi.Uint8Array=RL(),zx=xi.prototype=gm();function hQ(r){return typeof r=="string"?vQ.call(this,r):$L(this).from(r)}function Vx(r){return $L(this).alloc(r)}function pQ(r,e){e||(e=0,Array.prototype.forEach.call(r,s));var t=this!==xi&&this||r[0],i=Vx.call(t,e),n=0;return Array.prototype.forEach.call(r,o),i;function s(a){e+=a.length}function o(a){n+=zx.copy.call(a,i,n)}}var mQ=BL("ArrayBuffer");function gQ(r){return r instanceof ArrayBuffer||mQ(r)}function vQ(r){var e=r.length*3,t=Vx.call(this,e),i=zx.write.call(t,r);return e!==i&&(t=zx.slice.call(t,0,i)),t}function $L(r){return fQ(r)?NL:dQ(r)?qL:uQ(r)?ML:FL?NL:Wx?qL:ML}function Gx(){return!1}function BL(r,e){return r="[object "+r+"]",function(t){return t!=null&&{}.toString.call(e?t[e]:t)===r}}});var vm=x(jL=>{jL.ExtBuffer=Kx;var bQ=wr();function Kx(r,e){if(!(this instanceof Kx))return new Kx(r,e);this.buffer=bQ.from(r),this.type=e}});var HL=x(UL=>{UL.setExtPackers=xQ;var bm=wr(),yQ=bm.global,mn=bm.Uint8Array.from,Jx,wQ={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function xQ(r){r.addExtPacker(14,Error,[Ta,$r]),r.addExtPacker(1,EvalError,[Ta,$r]),r.addExtPacker(2,RangeError,[Ta,$r]),r.addExtPacker(3,ReferenceError,[Ta,$r]),r.addExtPacker(4,SyntaxError,[Ta,$r]),r.addExtPacker(5,TypeError,[Ta,$r]),r.addExtPacker(6,URIError,[Ta,$r]),r.addExtPacker(10,RegExp,[SQ,$r]),r.addExtPacker(11,Boolean,[Yx,$r]),r.addExtPacker(12,String,[Yx,$r]),r.addExtPacker(13,Date,[Number,$r]),r.addExtPacker(15,Number,[Yx,$r]),typeof Uint8Array!="undefined"&&(r.addExtPacker(17,Int8Array,mn),r.addExtPacker(18,Uint8Array,mn),r.addExtPacker(19,Int16Array,mn),r.addExtPacker(20,Uint16Array,mn),r.addExtPacker(21,Int32Array,mn),r.addExtPacker(22,Uint32Array,mn),r.addExtPacker(23,Float32Array,mn),typeof Float64Array!="undefined"&&r.addExtPacker(24,Float64Array,mn),typeof Uint8ClampedArray!="undefined"&&r.addExtPacker(25,Uint8ClampedArray,mn),r.addExtPacker(26,ArrayBuffer,mn),r.addExtPacker(29,DataView,mn)),bm.hasBuffer&&r.addExtPacker(27,yQ,bm.from)}function $r(r){return Jx||(Jx=Xx().encode),Jx(r)}function Yx(r){return r.valueOf()}function SQ(r){r=RegExp.prototype.toString.call(r).split("/"),r.shift();var e=[r.pop()];return e.unshift(r.join("/")),e}function Ta(r){var e={};for(var t in wQ)e[t]=r[t];return e}});var ym=x(Uf=>{var CQ,_Q,EQ,TQ;(function(r){var e="undefined",t=e!==typeof Buffer&&Buffer,i=e!==typeof Uint8Array&&Uint8Array,n=e!==typeof ArrayBuffer&&ArrayBuffer,s=[0,0,0,0,0,0,0,0],o=Array.isArray||L,a=4294967296,l=16777216,c;CQ=u("Uint64BE",!0,!0),_Q=u("Int64BE",!0,!1),EQ=u("Uint64LE",!1,!0),TQ=u("Int64LE",!1,!1);function u($,I,W){var A=I?0:4,M=I?4:0,k=I?0:3,F=I?1:2,j=I?2:1,X=I?3:0,ae=I?y:w,Pe=I?S:_,ke=bi.prototype,Qe="is"+$,St="_"+Qe;return ke.buffer=void 0,ke.offset=0,ke[St]=!0,ke.toNumber=Sp,ke.toString=Fw,ke.toJSON=Sp,ke.toArray=f,t&&(ke.toBuffer=d),i&&(ke.toArrayBuffer=h),bi[Qe]=eo,r[$]=bi,bi;function bi(Ie,Se,Ce,Oe){return this instanceof bi?ms(this,Ie,Se,Ce,Oe):new bi(Ie,Se,Ce,Oe)}function eo(Ie){return!!(Ie&&Ie[St])}function ms(Ie,Se,Ce,Oe,Dt){if(i&&n&&(Se instanceof n&&(Se=new i(Se)),Oe instanceof n&&(Oe=new i(Oe))),!Se&&!Ce&&!Oe&&!c){Ie.buffer=b(s,0);return}if(!p(Se,Ce)){var un=c||Array;Dt=Ce,Oe=Se,Ce=0,Se=new un(8)}Ie.buffer=Se,Ie.offset=Ce|=0,e!==typeof Oe&&(typeof Oe=="string"?xp(Se,Ce,Oe,Dt||10):p(Oe,Dt)?g(Se,Ce,Oe,Dt):typeof Dt=="number"?(Il(Se,Ce+A,Oe),Il(Se,Ce+M,Dt)):Oe>0?ae(Se,Ce,Oe):Oe<0?Pe(Se,Ce,Oe):g(Se,Ce,s,0))}function xp(Ie,Se,Ce,Oe){var Dt=0,un=Ce.length,fn=0,mr=0;Ce[0]==="-"&&Dt++;for(var to=Dt;Dt<un;){var io=parseInt(Ce[Dt++],Oe);if(!(io>=0))break;mr=mr*Oe+io,fn=fn*Oe+Math.floor(mr/a),mr%=a}to&&(fn=~fn,mr?mr=a-mr:fn++),Il(Ie,Se+A,fn),Il(Ie,Se+M,mr)}function Sp(){var Ie=this.buffer,Se=this.offset,Ce=Ol(Ie,Se+A),Oe=Ol(Ie,Se+M);return W||(Ce|=0),Ce?Ce*a+Oe:Oe}function Fw(Ie){var Se=this.buffer,Ce=this.offset,Oe=Ol(Se,Ce+A),Dt=Ol(Se,Ce+M),un="",fn=!W&&Oe&2147483648;for(fn&&(Oe=~Oe,Dt=a-Dt),Ie=Ie||10;;){var mr=Oe%Ie*a+Dt;if(Oe=Math.floor(Oe/Ie),Dt=Math.floor(mr/Ie),un=(mr%Ie).toString(Ie)+un,!Oe&&!Dt)break}return fn&&(un="-"+un),un}function Il(Ie,Se,Ce){Ie[Se+X]=Ce&255,Ce=Ce>>8,Ie[Se+j]=Ce&255,Ce=Ce>>8,Ie[Se+F]=Ce&255,Ce=Ce>>8,Ie[Se+k]=Ce&255}function Ol(Ie,Se){return Ie[Se+k]*l+(Ie[Se+F]<<16)+(Ie[Se+j]<<8)+Ie[Se+X]}}function f($){var I=this.buffer,W=this.offset;return c=null,$!==!1&&W===0&&I.length===8&&o(I)?I:b(I,W)}function d($){var I=this.buffer,W=this.offset;if(c=t,$!==!1&&W===0&&I.length===8&&Buffer.isBuffer(I))return I;var A=new t(8);return g(A,0,I,W),A}function h($){var I=this.buffer,W=this.offset,A=I.buffer;if(c=i,$!==!1&&W===0&&A instanceof n&&A.byteLength===8)return A;var M=new i(8);return g(M,0,I,W),M.buffer}function p($,I){var W=$&&$.length;return I|=0,W&&I+8<=W&&typeof $[I]!="string"}function g($,I,W,A){I|=0,A|=0;for(var M=0;M<8;M++)$[I++]=W[A++]&255}function b($,I){return Array.prototype.slice.call($,I,I+8)}function y($,I,W){for(var A=I+8;A>I;)$[--A]=W&255,W/=256}function S($,I,W){var A=I+8;for(W++;A>I;)$[--A]=-W&255^255,W/=256}function w($,I,W){for(var A=I+8;I<A;)$[I++]=W&255,W/=256}function _($,I,W){var A=I+8;for(W++;I<A;)$[I++]=-W&255^255,W/=256}function L($){return!!$&&Object.prototype.toString.call($)=="[object Array]"}})(typeof Uf=="object"&&typeof Uf.nodeName!="string"?Uf:Uf||{})});var Qx=x(Zx=>{Zx.read=function(r,e,t,i,n){var s,o,a=n*8-i-1,l=(1<<a)-1,c=l>>1,u=-7,f=t?n-1:0,d=t?-1:1,h=r[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=a;u>0;s=s*256+r[e+f],f+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=o*256+r[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-c}return(h?-1:1)*o*Math.pow(2,s-i)};Zx.write=function(r,e,t,i,n,s){var o,a,l,c=s*8-n-1,u=(1<<c)-1,f=u>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,p=i?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*l-1)*Math.pow(2,n),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;r[t+h]=a&255,h+=p,a/=256,n-=8);for(o=o<<n|a,c+=n;c>0;r[t+h]=o&255,h+=p,o/=256,c-=8);r[t+h-p]|=g*128}});var eS=x(WL=>{var DQ=WL.uint8=new Array(256);for(var wm=0;wm<=255;wm++)DQ[wm]=RQ(wm);function RQ(r){return function(e){var t=e.reserve(1);e.buffer[t]=r}}});var tA=x(eA=>{var zL=Qx(),VL=ym(),PQ=VL.Uint64BE,kQ=VL.Int64BE,GL=eS().uint8,xm=wr(),gt=xm.global,IQ=xm.hasBuffer&&"TYPED_ARRAY_SUPPORT"in gt,OQ=IQ&&!gt.TYPED_ARRAY_SUPPORT,KL=xm.hasBuffer&>.prototype||{};eA.getWriteToken=LQ;function LQ(r){return r&&r.uint8array?AQ():OQ||xm.hasBuffer&&r&&r.safe?FQ():JL()}function AQ(){var r=JL();return r[202]=Xe(202,4,ZL),r[203]=Xe(203,8,QL),r}function JL(){var r=GL.slice();return r[196]=Hf(196),r[197]=Da(197),r[198]=Ra(198),r[199]=Hf(199),r[200]=Da(200),r[201]=Ra(201),r[202]=Xe(202,4,KL.writeFloatBE||ZL,!0),r[203]=Xe(203,8,KL.writeDoubleBE||QL,!0),r[204]=Hf(204),r[205]=Da(205),r[206]=Ra(206),r[207]=Xe(207,8,YL),r[208]=Hf(208),r[209]=Da(209),r[210]=Ra(210),r[211]=Xe(211,8,XL),r[217]=Hf(217),r[218]=Da(218),r[219]=Ra(219),r[220]=Da(220),r[221]=Ra(221),r[222]=Da(222),r[223]=Ra(223),r}function FQ(){var r=GL.slice();return r[196]=Xe(196,1,gt.prototype.writeUInt8),r[197]=Xe(197,2,gt.prototype.writeUInt16BE),r[198]=Xe(198,4,gt.prototype.writeUInt32BE),r[199]=Xe(199,1,gt.prototype.writeUInt8),r[200]=Xe(200,2,gt.prototype.writeUInt16BE),r[201]=Xe(201,4,gt.prototype.writeUInt32BE),r[202]=Xe(202,4,gt.prototype.writeFloatBE),r[203]=Xe(203,8,gt.prototype.writeDoubleBE),r[204]=Xe(204,1,gt.prototype.writeUInt8),r[205]=Xe(205,2,gt.prototype.writeUInt16BE),r[206]=Xe(206,4,gt.prototype.writeUInt32BE),r[207]=Xe(207,8,YL),r[208]=Xe(208,1,gt.prototype.writeInt8),r[209]=Xe(209,2,gt.prototype.writeInt16BE),r[210]=Xe(210,4,gt.prototype.writeInt32BE),r[211]=Xe(211,8,XL),r[217]=Xe(217,1,gt.prototype.writeUInt8),r[218]=Xe(218,2,gt.prototype.writeUInt16BE),r[219]=Xe(219,4,gt.prototype.writeUInt32BE),r[220]=Xe(220,2,gt.prototype.writeUInt16BE),r[221]=Xe(221,4,gt.prototype.writeUInt32BE),r[222]=Xe(222,2,gt.prototype.writeUInt16BE),r[223]=Xe(223,4,gt.prototype.writeUInt32BE),r}function Hf(r){return function(e,t){var i=e.reserve(2),n=e.buffer;n[i++]=r,n[i]=t}}function Da(r){return function(e,t){var i=e.reserve(3),n=e.buffer;n[i++]=r,n[i++]=t>>>8,n[i]=t}}function Ra(r){return function(e,t){var i=e.reserve(5),n=e.buffer;n[i++]=r,n[i++]=t>>>24,n[i++]=t>>>16,n[i++]=t>>>8,n[i]=t}}function Xe(r,e,t,i){return function(n,s){var o=n.reserve(e+1);n.buffer[o++]=r,t.call(n.buffer,s,o,i)}}function YL(r,e){new PQ(this,e,r)}function XL(r,e){new kQ(this,e,r)}function ZL(r,e){zL.write(this,r,e,!1,23,4)}function QL(r,e){zL.write(this,r,e,!1,52,8)}});var oA=x(sA=>{var MQ=hm(),iA=ym(),NQ=iA.Uint64BE,qQ=iA.Int64BE,rA=wr(),nA=gm(),$Q=tA(),BQ=eS().uint8,jQ=vm().ExtBuffer,UQ=typeof Uint8Array!="undefined",HQ=typeof Map!="undefined",ic=[];ic[1]=212;ic[2]=213;ic[4]=214;ic[8]=215;ic[16]=216;sA.getWriteType=WQ;function WQ(r){var e=$Q.getWriteToken(r),t=r&&r.useraw,i=UQ&&r&&r.binarraybuffer,n=i?rA.isArrayBuffer:rA.isBuffer,s=i?L:_,o=HQ&&r&&r.usemap,a=o?W:I,l={boolean:c,function:S,number:u,object:t?y:b,string:g(t?p:h),symbol:S,undefined:S};return l;function c(M,k){var F=k?195:194;e[F](M,k)}function u(M,k){var F=k|0,j;if(k!==F){j=203,e[j](M,k);return}else-32<=F&&F<=127?j=F&255:0<=F?j=F<=255?204:F<=65535?205:206:j=-128<=F?208:-32768<=F?209:210;e[j](M,F)}function f(M,k){var F=207;e[F](M,k.toArray())}function d(M,k){var F=211;e[F](M,k.toArray())}function h(M){return M<32?1:M<=255?2:M<=65535?3:5}function p(M){return M<32?1:M<=65535?3:5}function g(M){return k;function k(F,j){var X=j.length,ae=5+X*3;F.offset=F.reserve(ae);var Pe=F.buffer,ke=M(X),Qe=F.offset+ke;X=nA.write.call(Pe,j,Qe);var St=M(X);if(ke!==St){var bi=Qe+St-ke,eo=Qe+X;nA.copy.call(Pe,Pe,bi,Qe,eo)}var ms=St===1?160+X:St<=3?215+St:219;e[ms](F,X),F.offset+=X}}function b(M,k){if(k===null)return S(M,k);if(n(k))return s(M,k);if(MQ(k))return w(M,k);if(NQ.isUint64BE(k))return f(M,k);if(qQ.isInt64BE(k))return d(M,k);var F=M.codec.getExtPacker(k);if(F&&(k=F(k)),k instanceof jQ)return $(M,k);a(M,k)}function y(M,k){if(n(k))return A(M,k);b(M,k)}function S(M,k){var F=192;e[F](M,k)}function w(M,k){var F=k.length,j=F<16?144+F:F<=65535?220:221;e[j](M,F);for(var X=M.codec.encode,ae=0;ae<F;ae++)X(M,k[ae])}function _(M,k){var F=k.length,j=F<255?196:F<=65535?197:198;e[j](M,F),M.send(k)}function L(M,k){_(M,new Uint8Array(k))}function $(M,k){var F=k.buffer,j=F.length,X=ic[j]||(j<255?199:j<=65535?200:201);e[X](M,j),BQ[k.type](M),M.send(F)}function I(M,k){var F=Object.keys(k),j=F.length,X=j<16?128+j:j<=65535?222:223;e[X](M,j);var ae=M.codec.encode;F.forEach(function(Pe){ae(M,Pe),ae(M,k[Pe])})}function W(M,k){if(!(k instanceof Map))return I(M,k);var F=k.size,j=F<16?128+F:F<=65535?222:223;e[j](M,F);var X=M.codec.encode;k.forEach(function(ae,Pe,ke){X(M,Pe),X(M,ae)})}function A(M,k){var F=k.length,j=F<32?160+F:F<=65535?218:219;e[j](M,F),M.send(k)}}});var zf=x(Wf=>{var zQ=hm();Wf.createCodec=aA;Wf.install=GQ;Wf.filter=YQ;var VQ=wr();function rc(r){if(!(this instanceof rc))return new rc(r);this.options=r,this.init()}rc.prototype.init=function(){var r=this.options;return r&&r.uint8array&&(this.bufferish=VQ.Uint8Array),this};function GQ(r){for(var e in r)rc.prototype[e]=KQ(rc.prototype[e],r[e])}function KQ(r,e){return r&&e?t:r||e;function t(){return r.apply(this,arguments),e.apply(this,arguments)}}function JQ(r){return r=r.slice(),function(t){return r.reduce(e,t)};function e(t,i){return i(t)}}function YQ(r){return zQ(r)?JQ(r):r}function aA(r){return new rc(r)}Wf.preset=aA({preset:!0})});var Sm=x(cA=>{var XQ=vm().ExtBuffer,ZQ=HL(),QQ=oA(),tS=zf();tS.install({addExtPacker:tee,getExtPacker:iee,init:lA});cA.preset=lA.call(tS.preset);function eee(r){var e=QQ.getWriteType(r);return t;function t(i,n){var s=e[typeof n];if(!s)throw new Error('Unsupported type "'+typeof n+'": '+n);s(i,n)}}function lA(){var r=this.options;return this.encode=eee(r),r&&r.preset&&ZQ.setExtPackers(this),this}function tee(r,e,t){t=tS.filter(t);var i=e.name;if(i&&i!=="Object"){var n=this.extPackers||(this.extPackers={});n[i]=o}else{var s=this.extEncoderList||(this.extEncoderList=[]);s.unshift([e,o])}function o(a){return t&&(a=t(a)),new XQ(a,r)}}function iee(r){var e=this.extPackers||(this.extPackers={}),t=r.constructor,i=t&&t.name&&e[t.name];if(i)return i;for(var n=this.extEncoderList||(this.extEncoderList=[]),s=n.length,o=0;o<s;o++){var a=n[o];if(t===a[0])return a[1]}}});var rS=x(iS=>{iS.FlexDecoder=nc;iS.FlexEncoder=sc;var Vf=wr(),ree=2048,nee=65536,uA="BUFFER_SHORTAGE";function nc(){if(!(this instanceof nc))return new nc}function sc(){if(!(this instanceof sc))return new sc}nc.mixin=hA(see());nc.mixin(nc.prototype);sc.mixin=hA(oee());sc.mixin(sc.prototype);function see(){return{bufferish:Vf,write:r,fetch:lee,flush:e,push:dA,pull:cee,read:fA,reserve:t,offset:0};function r(i){var n=this.offset?Vf.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=n?i?this.bufferish.concat([n,i]):n:i,this.offset=0}function e(){for(;this.offset<this.buffer.length;){var i=this.offset,n;try{n=this.fetch()}catch(s){if(s&&s.message!=uA)throw s;this.offset=i;break}this.push(n)}}function t(i){var n=this.offset,s=n+i;if(s>this.buffer.length)throw new Error(uA);return this.offset=s,n}}function oee(){return{bufferish:Vf,write:aee,fetch:r,flush:e,push:dA,pull:t,read:fA,reserve:i,send:n,maxBufferSize:nee,minBufferSize:ree,offset:0,start:0};function r(){var s=this.start;if(s<this.offset){var o=this.start=this.offset;return Vf.prototype.slice.call(this.buffer,s,o)}}function e(){for(;this.start<this.offset;){var s=this.fetch();s&&this.push(s)}}function t(){var s=this.buffers||(this.buffers=[]),o=s.length>1?this.bufferish.concat(s):s[0];return s.length=0,o}function i(s){var o=s|0;if(this.buffer){var a=this.buffer.length,l=this.offset|0,c=l+o;if(c<a)return this.offset=c,l;this.flush(),s=Math.max(s,Math.min(a*2,this.maxBufferSize))}return s=Math.max(s,this.minBufferSize),this.buffer=this.bufferish.alloc(s),this.start=0,this.offset=o,0}function n(s){var o=s.length;if(o>this.minBufferSize)this.flush(),this.push(s);else{var a=this.reserve(o);Vf.prototype.copy.call(s,this.buffer,a)}}}function aee(){throw new Error("method not implemented: write()")}function lee(){throw new Error("method not implemented: fetch()")}function fA(){var r=this.buffers&&this.buffers.length;return r?(this.flush(),this.pull()):this.fetch()}function dA(r){var e=this.buffers||(this.buffers=[]);e.push(r)}function cee(){var r=this.buffers||(this.buffers=[]);return r.shift()}function hA(r){return e;function e(t){for(var i in r)t[i]=r[i];return t}}});var Cm=x(pA=>{pA.EncodeBuffer=oc;var uee=Sm().preset,fee=rS().FlexEncoder;fee.mixin(oc.prototype);function oc(r){if(!(this instanceof oc))return new oc(r);if(r&&(this.options=r,r.codec)){var e=this.codec=r.codec;e.bufferish&&(this.bufferish=e.bufferish)}}oc.prototype.codec=uee;oc.prototype.write=function(r){this.codec.encode(this,r)}});var Xx=x(mA=>{mA.encode=hee;var dee=Cm().EncodeBuffer;function hee(r,e){var t=new dee(e);return t.write(r),t.read()}});var bA=x(vA=>{vA.setExtUnpackers=gee;var gA=wr(),pee=gA.global,nS,mee={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function gee(r){r.addExtUnpacker(14,[Br,Pa(Error)]),r.addExtUnpacker(1,[Br,Pa(EvalError)]),r.addExtUnpacker(2,[Br,Pa(RangeError)]),r.addExtUnpacker(3,[Br,Pa(ReferenceError)]),r.addExtUnpacker(4,[Br,Pa(SyntaxError)]),r.addExtUnpacker(5,[Br,Pa(TypeError)]),r.addExtUnpacker(6,[Br,Pa(URIError)]),r.addExtUnpacker(10,[Br,vee]),r.addExtUnpacker(11,[Br,$i(Boolean)]),r.addExtUnpacker(12,[Br,$i(String)]),r.addExtUnpacker(13,[Br,$i(Date)]),r.addExtUnpacker(15,[Br,$i(Number)]),typeof Uint8Array!="undefined"&&(r.addExtUnpacker(17,$i(Int8Array)),r.addExtUnpacker(18,$i(Uint8Array)),r.addExtUnpacker(19,[bo,$i(Int16Array)]),r.addExtUnpacker(20,[bo,$i(Uint16Array)]),r.addExtUnpacker(21,[bo,$i(Int32Array)]),r.addExtUnpacker(22,[bo,$i(Uint32Array)]),r.addExtUnpacker(23,[bo,$i(Float32Array)]),typeof Float64Array!="undefined"&&r.addExtUnpacker(24,[bo,$i(Float64Array)]),typeof Uint8ClampedArray!="undefined"&&r.addExtUnpacker(25,$i(Uint8ClampedArray)),r.addExtUnpacker(26,bo),r.addExtUnpacker(29,[bo,$i(DataView)])),gA.hasBuffer&&r.addExtUnpacker(27,$i(pee))}function Br(r){return nS||(nS=sS().decode),nS(r)}function vee(r){return RegExp.apply(null,r)}function Pa(r){return function(e){var t=new r;for(var i in mee)t[i]=e[i];return t}}function $i(r){return function(e){return new r(e)}}function bo(r){return new Uint8Array(r).buffer}});var lS=x(aS=>{var yA=Qx(),wA=ym(),xA=wA.Uint64BE,SA=wA.Int64BE;aS.getReadFormat=wee;aS.readUint8=CA;var oS=wr(),_m=gm(),bee=typeof Map!="undefined",yee=!0;function wee(r){var e=oS.hasArrayBuffer&&r&&r.binarraybuffer,t=r&&r.int64,i=bee&&r&&r.usemap,n={map:i?See:xee,array:Cee,str:_ee,bin:e?Tee:Eee,ext:Dee,uint8:CA,uint16:Pee,uint32:Iee,uint64:Em(8,t?Fee:Lee),int8:Ree,int16:kee,int32:Oee,int64:Em(8,t?Mee:Aee),float32:Em(4,Nee),float64:Em(8,qee)};return n}function xee(r,e){var t={},i,n=new Array(e),s=new Array(e),o=r.codec.decode;for(i=0;i<e;i++)n[i]=o(r),s[i]=o(r);for(i=0;i<e;i++)t[n[i]]=s[i];return t}function See(r,e){var t=new Map,i,n=new Array(e),s=new Array(e),o=r.codec.decode;for(i=0;i<e;i++)n[i]=o(r),s[i]=o(r);for(i=0;i<e;i++)t.set(n[i],s[i]);return t}function Cee(r,e){for(var t=new Array(e),i=r.codec.decode,n=0;n<e;n++)t[n]=i(r);return t}function _ee(r,e){var t=r.reserve(e),i=t+e;return _m.toString.call(r.buffer,"utf-8",t,i)}function Eee(r,e){var t=r.reserve(e),i=t+e,n=_m.slice.call(r.buffer,t,i);return oS.from(n)}function Tee(r,e){var t=r.reserve(e),i=t+e,n=_m.slice.call(r.buffer,t,i);return oS.Uint8Array.from(n).buffer}function Dee(r,e){var t=r.reserve(e+1),i=r.buffer[t++],n=t+e,s=r.codec.getExtUnpacker(i);if(!s)throw new Error("Invalid ext type: "+(i&&"0x"+i.toString(16)));var o=_m.slice.call(r.buffer,t,n);return s(o)}function CA(r){var e=r.reserve(1);return r.buffer[e]}function Ree(r){var e=r.reserve(1),t=r.buffer[e];return t&128?t-256:t}function Pee(r){var e=r.reserve(2),t=r.buffer;return t[e++]<<8|t[e]}function kee(r){var e=r.reserve(2),t=r.buffer,i=t[e++]<<8|t[e];return i&32768?i-65536:i}function Iee(r){var e=r.reserve(4),t=r.buffer;return t[e++]*16777216+(t[e++]<<16)+(t[e++]<<8)+t[e]}function Oee(r){var e=r.reserve(4),t=r.buffer;return t[e++]<<24|t[e++]<<16|t[e++]<<8|t[e]}function Em(r,e){return function(t){var i=t.reserve(r);return e.call(t.buffer,i,yee)}}function Lee(r){return new xA(this,r).toNumber()}function Aee(r){return new SA(this,r).toNumber()}function Fee(r){return new xA(this,r)}function Mee(r){return new SA(this,r)}function Nee(r){return yA.read(this,r,!1,23,4)}function qee(r){return yA.read(this,r,!1,52,8)}});var TA=x(EA=>{var $ee=lS();EA.getReadToken=Bee;function Bee(r){var e=$ee.getReadFormat(r);return r&&r.useraw?jee(e):_A(e)}function _A(r){var e,t=new Array(256);for(e=0;e<=127;e++)t[e]=Gf(e);for(e=128;e<=143;e++)t[e]=ws(e-128,r.map);for(e=144;e<=159;e++)t[e]=ws(e-144,r.array);for(e=160;e<=191;e++)t[e]=ws(e-160,r.str);for(t[192]=Gf(null),t[193]=null,t[194]=Gf(!1),t[195]=Gf(!0),t[196]=xr(r.uint8,r.bin),t[197]=xr(r.uint16,r.bin),t[198]=xr(r.uint32,r.bin),t[199]=xr(r.uint8,r.ext),t[200]=xr(r.uint16,r.ext),t[201]=xr(r.uint32,r.ext),t[202]=r.float32,t[203]=r.float64,t[204]=r.uint8,t[205]=r.uint16,t[206]=r.uint32,t[207]=r.uint64,t[208]=r.int8,t[209]=r.int16,t[210]=r.int32,t[211]=r.int64,t[212]=ws(1,r.ext),t[213]=ws(2,r.ext),t[214]=ws(4,r.ext),t[215]=ws(8,r.ext),t[216]=ws(16,r.ext),t[217]=xr(r.uint8,r.str),t[218]=xr(r.uint16,r.str),t[219]=xr(r.uint32,r.str),t[220]=xr(r.uint16,r.array),t[221]=xr(r.uint32,r.array),t[222]=xr(r.uint16,r.map),t[223]=xr(r.uint32,r.map),e=224;e<=255;e++)t[e]=Gf(e-256);return t}function jee(r){var e,t=_A(r).slice();for(t[217]=t[196],t[218]=t[197],t[219]=t[198],e=160;e<=191;e++)t[e]=ws(e-160,r.bin);return t}function Gf(r){return function(){return r}}function xr(r,e){return function(t){var i=r(t);return e(t,i)}}function ws(r,e){return function(t){return e(t,r)}}});var Tm=x(RA=>{var Uee=vm().ExtBuffer,Hee=bA(),Wee=lS().readUint8,zee=TA(),cS=zf();cS.install({addExtUnpacker:Gee,getExtUnpacker:Kee,init:DA});RA.preset=DA.call(cS.preset);function Vee(r){var e=zee.getReadToken(r);return t;function t(i){var n=Wee(i),s=e[n];if(!s)throw new Error("Invalid type: "+(n&&"0x"+n.toString(16)));return s(i)}}function DA(){var r=this.options;return this.decode=Vee(r),r&&r.preset&&Hee.setExtUnpackers(this),this}function Gee(r,e){var t=this.extUnpackers||(this.extUnpackers=[]);t[r]=cS.filter(e)}function Kee(r){var e=this.extUnpackers||(this.extUnpackers=[]);return e[r]||t;function t(i){return new Uee(i,r)}}});var Dm=x(PA=>{PA.DecodeBuffer=ac;var Jee=Tm().preset,Yee=rS().FlexDecoder;Yee.mixin(ac.prototype);function ac(r){if(!(this instanceof ac))return new ac(r);if(r&&(this.options=r,r.codec)){var e=this.codec=r.codec;e.bufferish&&(this.bufferish=e.bufferish)}}ac.prototype.codec=Jee;ac.prototype.fetch=function(){return this.codec.decode(this)}});var sS=x(kA=>{kA.decode=Zee;var Xee=Dm().DecodeBuffer;function Zee(r,e){var t=new Xee(e);return t.write(r),t.read()}});var dS=x((Jbe,fS)=>{function uS(){if(!(this instanceof uS))return new uS}(function(r){typeof fS!="undefined"&&(fS.exports=r);var e="listeners",t={on:n,once:s,off:o,emit:a};i(r.prototype),r.mixin=i;function i(c){for(var u in t)c[u]=t[u];return c}function n(c,u){return l(this,c).push(u),this}function s(c,u){var f=this;return d.originalListener=u,l(f,c).push(d),f;function d(){o.call(f,c,d),u.apply(this,arguments)}}function o(c,u){var f=this,d;if(!arguments.length)delete f[e];else if(u){if(d=l(f,c,!0),d){if(d=d.filter(h),!d.length)return o.call(f,c);f[e][c]=d}}else if(d=f[e],d&&(delete d[c],!Object.keys(d).length))return o.call(f);return f;function h(p){return p!==u&&p.originalListener!==u}}function a(c,u){var f=this,d=l(f,c,!0);if(!d)return!1;var h=arguments.length;if(h===1)d.forEach(g);else if(h===2)d.forEach(b);else{var p=Array.prototype.slice.call(arguments,1);d.forEach(y)}return!!d.length;function g(S){S.call(f)}function b(S){S.call(f,u)}function y(S){S.apply(f,p)}}function l(c,u,f){if(!(f&&!c[e])){var d=c[e]||(c[e]={});return d[u]||(d[u]=[])}}})(uS)});var LA=x(OA=>{OA.Encoder=ka;var Qee=dS(),IA=Cm().EncodeBuffer;function ka(r){if(!(this instanceof ka))return new ka(r);IA.call(this,r)}ka.prototype=new IA;Qee.mixin(ka.prototype);ka.prototype.encode=function(r){this.write(r),this.emit("data",this.read())};ka.prototype.end=function(r){arguments.length&&this.encode(r),this.flush(),this.emit("end")}});var MA=x(FA=>{FA.Decoder=yo;var ete=dS(),AA=Dm().DecodeBuffer;function yo(r){if(!(this instanceof yo))return new yo(r);AA.call(this,r)}yo.prototype=new AA;ete.mixin(yo.prototype);yo.prototype.decode=function(r){arguments.length&&this.write(r),this.flush()};yo.prototype.push=function(r){this.emit("data",r)};yo.prototype.end=function(r){this.decode(r),this.emit("end")}});var $A=x(qA=>{qA.createEncodeStream=lc;var tte=require("util"),NA=require("stream").Transform,ite=Cm().EncodeBuffer;tte.inherits(lc,NA);var rte={objectMode:!0};function lc(r){if(!(this instanceof lc))return new lc(r);r?r.objectMode=!0:r=rte,NA.call(this,r);var e=this,t=this.encoder=new ite(r);t.push=function(i){e.push(i)}}lc.prototype._transform=function(r,e,t){this.encoder.write(r),t&&t()};lc.prototype._flush=function(r){this.encoder.flush(),r&&r()}});var UA=x(jA=>{jA.createDecodeStream=Kf;var nte=require("util"),BA=require("stream").Transform,ste=Dm().DecodeBuffer;nte.inherits(Kf,BA);var ote={objectMode:!0};function Kf(r){if(!(this instanceof Kf))return new Kf(r);r?r.objectMode=!0:r=ote,BA.call(this,r);var e=this,t=this.decoder=new ste(r);t.push=function(i){e.push(i)}}Kf.prototype._transform=function(r,e,t){this.decoder.write(r),this.decoder.flush(),t&&t()}});var WA=x(HA=>{Tm();Sm();HA.createCodec=zf().createCodec});var VA=x(zA=>{Tm();Sm();zA.codec={preset:zf().preset}});var GA=x(xs=>{xs.encode=Xx().encode;xs.decode=sS().decode;xs.Encoder=LA().Encoder;xs.Decoder=MA().Decoder;xs.createEncodeStream=$A().createEncodeStream;xs.createDecodeStream=UA().createDecodeStream;xs.createCodec=WA().createCodec;xs.codec=VA().codec});var JA=x(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var ate=require("stream"),KA=class extends ate.Transform{constructor(){super({readableHighWaterMark:10*1024*1024,writableHighWaterMark:10*1024*1024});this.chunks=null,this.timer=null}sendData(){let{chunks:e}=this;if(e){this.chunks=null;let t=Buffer.concat(e);this.push(t)}}_transform(e,t,i){let{chunks:n,timer:s}=this,o=Buffer.poolSize;if(s&&clearTimeout(s),e.length<o){if(!n)return i(null,e);n.push(e),this.sendData(),i()}else n?n.push(e):this.chunks=[e],this.timer=setTimeout(this.sendData.bind(this),20),i()}_flush(e){let{chunks:t}=this;if(t){this.chunks=null;let i=Buffer.concat(t);e(null,i)}else e()}};hS.default=KA});var Jf=x(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.BaseApi=void 0;var lte=require("events"),cte=process.env.VIM_NODE_RPC=="1",YA=class extends lte.EventEmitter{constructor({transport:e,data:t,client:i}){super();this.setTransport(e),this.data=t,this.client=i}setTransport(e){this.transport=e}equals(e){try{return String(this.data)===String(e.data)}catch(t){return!1}}async request(e,t=[]){let i=Error().stack;return new Promise((n,s)=>{this.transport.request(e,this.getArgsByPrefix(t),(o,a)=>{if(o){let l=new Error(`request error ${e} - ${o[1]}`);l.stack=i,e.endsWith("get_var")||this.client.logError(`request error on "${e}"`,t,o[1],i),s(l)}else n(a)})})}getArgsByPrefix(e){return this.prefix!=="nvim_"&&e[0]!=this?[cte?this.data:this,...e]:e}getVar(e){return this.request(`${this.prefix}get_var`,[e]).then(t=>t,t=>null)}setVar(e,t,i=!1){if(i){this.notify(`${this.prefix}set_var`,[e,t]);return}return this.request(`${this.prefix}set_var`,[e,t])}deleteVar(e){this.notify(`${this.prefix}del_var`,[e])}getOption(e){return this.request(`${this.prefix}get_option`,[e])}setOption(e,t,i){if(i){this.notify(`${this.prefix}set_option`,[e,t]);return}return this.request(`${this.prefix}set_option`,[e,t])}notify(e,t=[]){this.transport.notify(e,this.getArgsByPrefix(t))}};Rm.BaseApi=YA});var Yf=x(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Buffer=void 0;var ute=Jf(),XA=class extends ute.BaseApi{constructor(){super(...arguments);this.prefix="nvim_buf_"}async attach(e=!1,t={}){return await this.request(`${this.prefix}attach`,[e,t])}async detach(){return await this.request(`${this.prefix}detach`,[])}get id(){return this.data}get length(){return this.request(`${this.prefix}line_count`,[])}get lines(){return this.getLines()}get changedtick(){return this.request(`${this.prefix}get_changedtick`,[])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[e])}getLines({start:e,end:t,strictIndexing:i}={start:0,end:-1,strictIndexing:!0}){let n=typeof i=="undefined"?!0:i;return this.request(`${this.prefix}get_lines`,[e,t,n])}setLines(e,{start:t,end:i,strictIndexing:n}={strictIndexing:!0},s=!1){let o=typeof n=="undefined"?!0:n,a=typeof e=="string"?[e]:e,l=typeof i!="undefined"?i:t+1;return this[s?"notify":"request"](`${this.prefix}set_lines`,[t,l,o,a])}setVirtualText(e,t,i,n={}){return this.notify(`${this.prefix}set_virtual_text`,[e,t,i,n]),Promise.resolve(e)}insert(e,t){return this.setLines(e,{start:t,end:t,strictIndexing:!0})}replace(e,t){let i=typeof e=="string"?[e]:e;return this.setLines(i,{start:t,end:t+i.length,strictIndexing:!1})}remove(e,t,i=!1){return this.setLines([],{start:e,end:t,strictIndexing:i})}append(e){return this.setLines(e,{start:-1,end:-1,strictIndexing:!1})}get name(){return this.request(`${this.prefix}get_name`,[])}setName(e){return this.request(`${this.prefix}set_name`,[e])}get valid(){return this.request(`${this.prefix}is_valid`,[])}mark(e){return this.request(`${this.prefix}get_mark`,[e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[e])}setKeymap(e,t,i,n={}){this.client.call("coc#compat#buf_add_keymap",[this.id,e,t,i,n],!0)}get loaded(){return this.request(`${this.prefix}is_loaded`,[])}getOffset(e){return this.request(`${this.prefix}get_offset`,[e])}addHighlight({hlGroup:e,line:t,colStart:i,colEnd:n,srcId:s}){if(!e)throw new Error("hlGroup should not empty");let o=typeof n!="undefined"?n:-1,a=typeof i!="undefined"?i:-0,l=typeof s!="undefined"?s:-1,c=l==0?"request":"notify",u=this[c](`${this.prefix}add_highlight`,[l,e,t,a,o]);return c==="request"?u:Promise.resolve(null)}clearHighlight(e={}){let t={srcId:-1,lineStart:0,lineEnd:-1},{srcId:i,lineStart:n,lineEnd:s}=Object.assign({},t,e);return this.notify(`${this.prefix}clear_highlight`,[i,n,s])}highlightRanges(e,t,i){this.client.call("coc#highlight#ranges",[this.id,e,t,i],!0)}clearNamespace(e,t=0,i=-1){this.client.call("coc#highlight#clear_highlight",[this.id,e,t,i],!0)}placeSign(e){let t={lnum:e.lnum};typeof e.priority=="number"&&(t.priority=e.priority),this.client.call("sign_place",[e.id||0,e.group||"",e.name,this.id,t],!0)}unplaceSign(e){let t={buffer:this.id};e.id!=null&&(t.id=e.id),this.client.call("sign_unplace",[e.group||"",t],!0)}async getSigns(e){return(await this.client.call("sign_getplaced",[this.id,e||{}]))[0].signs}async getHighlights(e,t=0,i=-1){let n=[],s=await this.client.call("coc#highlight#get",[this.id,e,t,i]);for(let o of Object.values(s))Array.isArray(o)&&n.push(...o);return n}updateHighlights(e,t,i=0,n=-1){this.client.call("coc#highlight#update_highlights",[this.id,e,t,i,n],!0)}listen(e,t,i){this.client.attachBufferEvent(this,e,t),i&&i.push({dispose:()=>{this.client.detachBufferEvent(this,e,t)}})}};Pm.Buffer=XA});var Xf=x(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.Window=void 0;var fte=Jf(),pS=require("timers"),ZA=class extends fte.BaseApi{constructor(){super(...arguments);this.prefix="nvim_win_"}get id(){return this.data}get buffer(){return this.request(`${this.prefix}get_buf`,[])}get tabpage(){return this.request(`${this.prefix}get_tabpage`,[])}get cursor(){return this.request(`${this.prefix}get_cursor`,[])}setCursor(e,t=!1){return this[t?"notify":"request"](`${this.prefix}set_cursor`,[e])}get height(){return this.request(`${this.prefix}get_height`,[])}setHeight(e,t=!1){return this[t?"notify":"request"](`${this.prefix}set_height`,[e])}get width(){return this.request(`${this.prefix}get_width`,[])}setWidth(e,t=!1){return this[t?"notify":"request"](`${this.prefix}set_height`,[e])}get position(){return this.request(`${this.prefix}get_position`,[])}get row(){return this.request(`${this.prefix}get_position`,[]).then(e=>e[0])}get col(){return this.request(`${this.prefix}get_position`,[]).then(e=>e[1])}get valid(){return this.request(`${this.prefix}is_valid`,[])}get number(){return this.request(`${this.prefix}get_number`,[])}setConfig(e,t){return this[t?"notify":"request"](`${this.prefix}set_config`,[e])}getConfig(){return this.request(`${this.prefix}get_config`,[])}close(e,t){if(t){this.notify(`${this.prefix}close`,[e]);let i=0,n=setInterval(()=>{if(i==5)return pS.clearInterval(n);this.request(`${this.prefix}is_valid`,[]).then(s=>{s?this.notify(`${this.prefix}close`,[e]):pS.clearInterval(n)},()=>{pS.clearInterval(n)}),i++},50);return null}return this.request(`${this.prefix}close`,[e])}highlightRanges(e,t,i=10,n){if(n){this.client.call("coc#highlight#match_ranges",[this.id,0,t,e,i],!0);return}return this.client.call("coc#highlight#match_ranges",[this.id,0,t,e,i])}clearMatchGroup(e){this.client.call("coc#highlight#clear_match_group",[this.id,e],!0)}clearMatches(e){this.client.call("coc#highlight#clear_matches",[this.id,e],!0)}};km.Window=ZA});var Zf=x(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.Tabpage=void 0;var dte=Jf(),QA=class extends dte.BaseApi{constructor(){super(...arguments);this.prefix="nvim_tabpage_"}get windows(){return this.request(`${this.prefix}list_wins`,[])}get window(){return this.request(`${this.prefix}get_win`,[])}get valid(){return this.request(`${this.prefix}is_valid`,[])}get number(){return this.request(`${this.prefix}get_number`,[])}getOption(){throw new Error("Tabpage does not have `getOption`")}setOption(){throw new Error("Tabpage does not have `setOption`")}};Im.Tabpage=QA});var eF=x(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.Metadata=Ia.ExtType=void 0;var hte=Yf(),pte=Xf(),mte=Zf(),gte;(function(r){r[r.Buffer=0]="Buffer",r[r.Window=1]="Window",r[r.Tabpage=2]="Tabpage"})(gte=Ia.ExtType||(Ia.ExtType={}));Ia.Metadata=[{constructor:hte.Buffer,name:"Buffer",prefix:"nvim_buf_"},{constructor:pte.Window,name:"Window",prefix:"nvim_win_"},{constructor:mte.Tabpage,name:"Tabpage",prefix:"nvim_tabpage_"}]});var Qf=x(cc=>{"use strict";var mS=cc&&cc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cc,"__esModule",{value:!0});cc.createLogger=void 0;var gS=mS(require("fs")),vte=mS(require("os")),vS=mS(require("path"));function bte(){let r=process.env.NODE_CLIENT_LOG_FILE;if(r)return r;let e=process.env.XDG_RUNTIME_DIR;return e?vS.default.join(e,"node-client.log"):vS.default.join(vte.default.tmpdir(),`node-client-${process.pid}.log`)}var bS=bte(),tF=process.env.NODE_CLIENT_LOG_LEVEL||"info",yS=process.getuid&&process.getuid()==0;if(!yS)try{gS.default.mkdirSync(vS.default.dirname(bS),{recursive:!0}),gS.default.writeFileSync(bS,"",{encoding:"utf8",mode:438})}catch(r){yS=!0}function iF(r){return r==null?r:Array.isArray(r)?r.map(e=>iF(e)):typeof r=="object"&&typeof r.prefix=="string"&&typeof r.data=="number"?"["+r.prefix+r.data+"]":r}function yte(r){return r==null?String(r):typeof r=="object"?JSON.stringify(r,null,2):String(r)}function wte(r){return`${r.getHours()}:${r.getMinutes()}:${r.getSeconds()}.${r.getMilliseconds()}`}var rF=class{constructor(e){this.name=e}get stream(){return yS?null:this._stream?this._stream:(this._stream=gS.default.createWriteStream(bS,{encoding:"utf8"}),this._stream)}getText(e,t,i){let n="";if(i.length){let s=iF(i);n=" "+s.map(o=>yte(o))}return`${wte(new Date)} ${e.toUpperCase()} [${this.name}] - ${t}${n}
`}debug(e,...t){tF!="debug"||this.stream==null||this.stream.write(this.getText("debug",e,t))}info(e,...t){this.stream!=null&&this.stream.write(this.getText("info",e,t))}error(e,...t){this.stream!=null&&this.stream.write(this.getText("error",e,t))}trace(e,...t){tF!="trace"||this.stream==null||this.stream.write(this.getText("trace",e,t))}};function xte(r){return new rF(r)}cc.createLogger=xte});var xS=x(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var Ste=require("events"),Cte=Qf(),nF=process.env.NODE_CLIENT_LOG_LEVEL=="debug",ed=Cte.createLogger("transport"),sF=class extends Ste.EventEmitter{constructor(e){super();this.logger=e,this.pauseLevel=0,this.paused=new Map}debug(e,...t){!nF||ed.debug(e,...t)}info(e,...t){ed.info(e,...t)}debugMessage(e){if(!nF)return;let t=e[0];t==0?ed.debug("receive request:",e.slice(1)):t==1||(t==2?ed.debug("receive notification:",e.slice(1)):ed.debug("unknown message:",e))}pauseNotification(){this.pauseLevel=this.pauseLevel+1,this.paused.set(this.pauseLevel,[])}cancelNotification(){let{pauseLevel:e}=this;e>0&&(this.paused.delete(e),this.pauseLevel=e-1)}resumeNotification(e=!1){let{pauseLevel:t}=this;if(t==0)return e?null:Promise.resolve([null,null]);let i=Error().stack;this.pauseLevel=t-1;let n=this.paused.get(t);return this.paused.delete(t),n&&n.length?new Promise((s,o)=>{if(!e)return this.request("nvim_call_atomic",[n],(a,l)=>{if(a){let c=new Error(`call_atomic error: ${a[1]}`);return c.stack=i,o(c)}if(Array.isArray(l)&&l[1]!=null){let[c,u,f]=l[1],[d,h]=n[c];this.logger.error(`request error ${u} on "${d}"`,h,f,i)}s(l)});this.notify("nvim_call_atomic",[n]),s()}):e?null:Promise.resolve([[],void 0])}};wS.default=sF});var lF=x(jr=>{"use strict";var _te=jr&&jr.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),Ete=jr&&jr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Tte=jr&&jr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&_te(e,r,t);return Ete(e,r),e},oF=jr&&jr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jr,"__esModule",{value:!0});jr.NvimTransport=void 0;var Ss=Tte(GA()),Dte=oF(JA()),Rte=eF(),Pte=oF(xS()),aF=class extends Pte.default{constructor(e){super(e);this.pending=new Map,this.nextRequestId=1,this.attached=!1;let t=this.setupCodec();this.encodeStream=Ss.createEncodeStream({codec:t}),this.decodeStream=Ss.createDecodeStream({codec:t}),this.decodeStream.on("data",i=>{this.parseMessage(i)}),this.decodeStream.on("end",()=>{this.detach(),this.emit("detach")})}parseMessage(e){let t=e[0];if(this.debugMessage(e),t===0)this.emit("request",e[2].toString(),e[3],this.createResponse(e[1]));else if(t===1){let i=e[1],n=this.pending.get(i);if(n){this.pending.delete(i);let s=e[2];s&&s.length!=2&&(s=[0,s instanceof Error?s.message:s]),n(s,e[3])}}else t===2?this.emit("notification",e[1].toString(),e[2]):console.error(`Invalid message type ${t}`)}setupCodec(){let e=Ss.createCodec();return Rte.Metadata.forEach(({constructor:t},i)=>{e.addExtPacker(i,t,n=>Ss.encode(n.data)),e.addExtUnpacker(i,n=>new t({transport:this,client:this.client,data:Ss.decode(n)}))}),this.codec=e,this.codec}attach(e,t,i){this.encodeStream=this.encodeStream.pipe(e);let n=new Dte.default;t.pipe(n).pipe(this.decodeStream),this.writer=e,this.reader=t,this.client=i,this.attached=!0}detach(){!this.attached||(this.attached=!1,this.encodeStream.unpipe(this.writer),this.reader.unpipe(this.decodeStream))}request(e,t,i){if(!this.attached)return;let n=this.nextRequestId;this.nextRequestId=this.nextRequestId+1;let s=Date.now();this.debug("request to nvim:",n,e,t),this.encodeStream.write(Ss.encode([0,n,e,t],{codec:this.codec}));let o=Error().stack,a=setTimeout(()=>{this.debug(`request to vim blocked more than 1s: ${e}`,t,o)},1e3);this.pending.set(n,(l,c)=>{clearTimeout(a),this.debug("response of nvim:",n,`${Date.now()-s}ms`,c,l),i(l,c)})}notify(e,t){if(!!this.attached){if(this.pauseLevel!=0){let i=this.paused.get(this.pauseLevel);if(i){i.push([e,t]);return}}this.debug("nvim notification:",e,t),this.encodeStream.write(Ss.encode([2,e,t],{codec:this.codec}))}}send(e){this.encodeStream.write(Ss.encode(e,{codec:this.codec}))}createResponse(e){let{encodeStream:t}=this,i=Date.now(),n=!1,s=setTimeout(()=>{this.debug("request to client cost more than 1s",e)},1e3);return{send:(o,a)=>{clearTimeout(s),!(n||!this.attached)&&(this.debug("response of client:",e,`${Date.now()-i}ms`,o,a==!0),n=!0,t.write(Ss.encode([1,e,a?o:null,a?null:o])))}}}};jr.NvimTransport=aF});var fF=x(td=>{"use strict";var cF=td&&td.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(td,"__esModule",{value:!0});var kte=cF(require("events")),Ite=cF(require("readline")),Ote=Qf(),uc=Ote.createLogger("connection"),uF=class extends kte.default{constructor(e,t){super();this.readable=e,this.writeable=t;let i=Ite.default.createInterface(this.readable);i.on("line",n=>{this.parseData(n)}),i.on("close",()=>{uc.error("connection closed"),process.exit(0)})}parseData(e){if(e.length==0)return;let t;try{t=JSON.parse(e)}catch(s){console.error(`Invalid data from vim: ${e}`);return}let[i,n]=t;i>0?(uc.debug("received request:",i,n),this.emit("request",i,n)):i==0?(uc.debug("received notification:",n),this.emit("notification",n)):(uc.debug("received response:",i,n),this.emit("response",i,n))}response(e,t){this.send([e,t||null])}notify(e,t){this.send([0,[e,t||null]])}send(e){uc.debug("send to vim:",e);try{this.writeable.write(JSON.stringify(e)+`
`)}catch(t){uc.error("Send error:",e)}}redraw(e=!1){this.send(["redraw",e?"force":""])}command(e){this.send(["ex",e])}expr(e){this.send(["expr",e])}call(e,t,i){if(!i){this.send(["call",e,t]);return}this.send(["call",e,t,i])}dispose(){this.removeAllListeners()}};td.default=uF});var hF=x(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var Lte=Qf(),Ate=Lte.createLogger("request"),Fte=process.env.NODE_CLIENT_LOG_LEVEL=="debug",Mte=process.env.COC_NVIM=="1"?"coc#api#call":"nvim#api#call",dF=class{constructor(e,t,i){this.connection=e,this.cb=t,this.id=i}request(e,t=[]){this.method=e,this.args=t,this.connection.call(Mte,[e.slice(5),t],this.id)}callback(e,t,i){let{method:n,cb:s}=this;if(Fte&&t&&Ate.debug(`request ${this.method} error:`,t,this.args),t)return s([0,t.toString()]);switch(n){case"nvim_list_wins":case"nvim_tabpage_list_wins":return s(null,i.map(o=>e.createWindow(o)));case"nvim_tabpage_get_win":case"nvim_get_current_win":case"nvim_open_win":return s(null,e.createWindow(i));case"nvim_list_bufs":return s(null,i.map(o=>e.createBuffer(o)));case"nvim_win_get_buf":case"nvim_create_buf":case"nvim_get_current_buf":return s(null,e.createBuffer(i));case"nvim_list_tabpages":return s(null,i.map(o=>e.createTabpage(o)));case"nvim_get_current_tabpage":return s(null,e.createTabpage(i));default:return s(null,i)}}};SS.default=dF});var mF=x(fc=>{"use strict";var CS=fc&&fc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fc,"__esModule",{value:!0});fc.VimTransport=void 0;var Nte=CS(xS()),qte=CS(fF()),$te=CS(hF()),pF=class extends Nte.default{constructor(e){super(e);this.pending=new Map,this.nextRequestId=-1,this.attached=!1,this.errText="",this.outText="",this.notifyMethod=process.env.COC_NVIM=="1"?"coc#api#notify":"nvim#api#notify"}attach(e,t,i){let n=this.connection=new qte.default(t,e);this.attached=!0,this.client=i,n.on("request",(s,o)=>{let[a,l]=o;this.emit("request",a,l,this.createResponse(s))}),n.on("notification",s=>{let[o,a]=s;this.emit("notification",o.toString(),a)}),n.on("response",(s,o)=>{let a=this.pending.get(s);if(a){this.pending.delete(s);let l=null,c=null;Array.isArray(o)?(l=o[0],c=o[1]):l=o,a.callback(this.client,l,c)}})}send(e){this.connection.send(e)}detach(){!this.attached||(this.attached=!1,this.connection.dispose())}request(e,t,i){if(!this.attached)return i([0,"transport disconnected"]);let n=this.nextRequestId;this.nextRequestId=this.nextRequestId-1;let s=Date.now();this.debug("request to vim:",n,e,t);let o=setTimeout(()=>{this.debug("request to vim cost more than 1s",e,t)},1e3),a=new $te.default(this.connection,(l,c)=>{clearTimeout(o),this.debug("response from vim cost:",n,`${Date.now()-s}ms`),i(l,c)},n);this.pending.set(n,a),a.request(e,t)}notify(e,t){if(!this.attached)return;if(this.pauseLevel!=0){let n=this.paused.get(this.pauseLevel);if(n){n.push([e,t]);return}}let i=e.slice(5);if(i=="err_write"){this.errText=this.errText+t[0].toString();return}if(i=="out_write"){let n=t[0].toString()||"";if(!n.includes(`
`))this.outText=this.outText+n;else{let s=this.outText+t[0].toString();this.outText="",this.connection.call(this.notifyMethod,[i,[s]])}return}if(i=="err_writeln"){let n=this.errText+t[0].toString();this.errText="",this.connection.call(this.notifyMethod,[i,[n]]);return}this.connection.call(this.notifyMethod,[i,t])}createResponse(e){let t=!1,{connection:i}=this,n=Date.now(),s=setTimeout(()=>{this.debug("request to client cost more than 1s",e)},1e3);return{send:(o,a)=>{if(clearTimeout(s),t||!this.attached)return;t=!0;let l=null;a&&(l=typeof o=="string"?o:o.toString()),this.debug("response of client cost:",e,`${Date.now()-n}ms`),i.response(e,[l,a?null:o])}}}};fc.VimTransport=pF});var vF=x(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.Neovim=void 0;var Bte=Jf(),jte=Yf(),Ute=Zf(),Hte=Xf(),Wte=process.env.VIM_NODE_RPC=="1",gF=class extends Bte.BaseApi{constructor(){super(...arguments);this.prefix="nvim_",this.Buffer=jte.Buffer,this.Window=Hte.Window,this.Tabpage=Ute.Tabpage}getArgs(e){return e?Array.isArray(e)?e:[e]:[]}get apiInfo(){return this.request(`${this.prefix}get_api_info`)}get buffers(){return this.request(`${this.prefix}list_bufs`)}get buffer(){return this.request(`${this.prefix}get_current_buf`)}async setBuffer(e){await this.request(`${this.prefix}set_current_buf`,[e])}get chans(){return this.request(`${this.prefix}list_chans`)}getChanInfo(e){return this.request(`${this.prefix}get_chan_info`,[e])}createNamespace(e=""){return this.request(`${this.prefix}create_namespace`,[e])}get namespaces(){return this.request(`${this.prefix}get_namespaces`,[])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[e])}get tabpages(){return this.request(`${this.prefix}list_tabpages`)}get tabpage(){return this.request(`${this.prefix}get_current_tabpage`)}async setTabpage(e){await this.request(`${this.prefix}set_current_tabpage`,[e])}get windows(){return this.getWindows()}get window(){return this.request(`${this.prefix}get_current_win`)}getWindows(){return this.request(`${this.prefix}list_wins`)}async setWindow(e){await this.request(`${this.prefix}set_current_win`,[e])}get runtimePaths(){return this.request(`${this.prefix}list_runtime_paths`)}setDirectory(e){return this.request(`${this.prefix}set_current_dir`,[e])}get line(){return this.getLine()}createNewBuffer(e=!1,t=!1){return this.request(`${this.prefix}create_buf`,[e,t])}openFloatWindow(e,t,i){return this.request(`${this.prefix}open_win`,[e,t,i])}getLine(){return this.request(`${this.prefix}get_current_line`)}setLine(e){return this.request(`${this.prefix}set_current_line`,[e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[e])}get mode(){return this.request(`${this.prefix}get_mode`)}get colorMap(){return this.request(`${this.prefix}get_color_map`)}getColorByName(e){return this.request(`${this.prefix}get_color_by_name`,[e])}getHighlight(e,t=!0){let i=typeof e=="string"?"by_name":"by_id";return this.request(`${this.prefix}get_hl_${i}`,[e,t])}getHighlightByName(e,t=!0){return this.request(`${this.prefix}get_hl_by_name`,[e,t])}getHighlightById(e,t=!0){return this.request(`${this.prefix}get_hl_by_id`,[e,t])}deleteCurrentLine(){return this.request(`${this.prefix}del_current_line`)}eval(e){return this.request(`${this.prefix}eval`,[e])}lua(e,t=[]){let i=this.getArgs(t);return this.request(`${this.prefix}execute_lua`,[e,i])}executeLua(e,t=[]){return this.lua(e,t)}callDictFunction(e,t,i=[]){let n=this.getArgs(i);return this.request(`${this.prefix}call_dict_function`,[e,t,n])}call(e,t=[],i){let n=this.getArgs(t);return i?(this.notify(`${this.prefix}call_function`,[e,n]),null):this.request(`${this.prefix}call_function`,[e,n])}callTimer(e,t=[],i){let n=this.getArgs(t);return i?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,n]]),null):Wte?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,n]]),new Promise(s=>{setTimeout(()=>{s(null)},20)})):this.request(`${this.prefix}call_function`,["coc#util#timer",[e,n]])}callAsync(e,t=[]){let i=this.getArgs(t);return this.client.sendAsyncRequest(e,i)}callFunction(e,t=[]){return this.call(e,t)}callAtomic(e){return this.request(`${this.prefix}call_atomic`,[e])}command(e,t){return t?(this.notify(`${this.prefix}command`,[e]),null):this.request(`${this.prefix}command`,[e])}commandOutput(e){return this.request(`${this.prefix}command_output`,[e])}getVvar(e){return this.request(`${this.prefix}get_vvar`,[e])}feedKeys(e,t,i){return this.request(`${this.prefix}feedkeys`,[e,t,i])}input(e){return this.request(`${this.prefix}input`,[e])}parseExpression(e,t,i){return this.request(`${this.prefix}parse_expression`,[e,t,i])}getProc(e){return this.request(`${this.prefix}get_proc`,[e])}getProcChildren(e){return this.request(`${this.prefix}get_proc_children`,[e])}replaceTermcodes(e,t,i,n){return this.request(`${this.prefix}replace_termcodes`,[e,t,i,n])}strWidth(e){return this.request(`${this.prefix}strwidth`,[e])}outWrite(e){this.notify(`${this.prefix}out_write`,[e])}outWriteLine(e){this.outWrite(`${e}
`)}errWrite(e){this.notify(`${this.prefix}err_write`,[e])}errWriteLine(e){this.notify(`${this.prefix}err_writeln`,[e])}get uis(){return this.request(`${this.prefix}list_uis`)}uiAttach(e,t,i){return this.request(`${this.prefix}ui_attach`,[e,t,i])}uiDetach(){return this.request(`${this.prefix}ui_detach`,[])}uiTryResize(e,t){return this.request(`${this.prefix}ui_try_resize`,[e,t])}uiSetOption(e,t){return this.request(`${this.prefix}ui_set_option`,[e,t])}subscribe(e){return this.request(`${this.prefix}subscribe`,[e])}unsubscribe(e){return this.request(`${this.prefix}unsubscribe`,[e])}setClientInfo(e,t,i,n,s){this.notify(`${this.prefix}set_client_info`,[e,t,i,n,s])}async quit(){this.command("qa!",!0),this.transport&&this.transport.detach()}};Om.Neovim=gF});var Lm=x(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.NeovimClient=dc.AsyncResponse=void 0;var zte=lF(),Vte=mF(),Gte=vF(),Kte=Yf(),Jte=Xf(),Yte=Zf(),Xte=Qf(),bF=Xte.createLogger("client"),yF=process.env.VIM_NODE_RPC=="1",_S=class{constructor(e,t){this.requestId=e,this.cb=t,this.finished=!1}finish(e,t){if(!this.finished){if(this.finished=!0,e){this.cb(new Error(e));return}this.cb(null,t)}}};dc.AsyncResponse=_S;var wF=class extends Gte.Neovim{constructor(e){super({});this.logger=e,this.requestId=1,this.responses=new Map,this.attachedBuffers=new Map,Object.defineProperty(this,"client",{value:this});let t=yF?new Vte.VimTransport(e):new zte.NvimTransport(e);this.setTransport(t),this.transportAttached=!1,this.handleRequest=this.handleRequest.bind(this),this.handleNotification=this.handleNotification.bind(this)}echoError(e){let t=process.env.COC_NVIM=="1"?"[coc.nvim] ":"";typeof e=="string"?(this.errWriteLine(t+e),this.logError(e,Error().stack)):(this.errWriteLine(t+e.message+" use :CocOpenLog for details"),this.logError(e.message||"Unknown error",e.stack))}logError(e,...t){!this.logger||this.logger.error(e,...t)}createBuffer(e){return new Kte.Buffer({transport:this.transport,data:e,client:this})}createWindow(e){return new Jte.Window({transport:this.transport,data:e,client:this})}createTabpage(e){return new Yte.Tabpage({transport:this.transport,data:e,client:this})}send(e){this.transport.send(e)}redrawVim(e){!yF||this.transport.send(["redraw",e?"force":""])}attach({reader:e,writer:t},i=!0){this.transport.attach(t,e,this),this.transportAttached=!0,this.setupTransport(i)}detach(){this.transport.detach(),this.transportAttached=!1}get isApiReady(){return this.transportAttached&&typeof this._channelId!="undefined"}get channelId(){return this._isReady.then(()=>this._channelId)}isAttached(e){return this.attachedBuffers.has(e)}handleRequest(e,t,i){this.emit("request",e,t,i)}sendAsyncRequest(e,t){let i=this.requestId;return this.requestId=i+1,this.notify("nvim_call_function",["coc#rpc#async_request",[i,e,t||[]]]),new Promise((n,s)=>{let o=new _S(i,(a,l)=>{if(a)return s(a);n(l)});this.responses.set(i,o)})}emitNotification(e,t){if(e.endsWith("_event")){if(e.startsWith("nvim_buf_")){let i=e.replace(/nvim_buf_(.*)_event/,"$1"),{id:n}=t[0];if(!this.attachedBuffers.has(n))return;(this.attachedBuffers.get(n).get(i)||[]).forEach(a=>a(...t)),i==="detach"&&this.attachedBuffers.delete(n);return}if(e.startsWith("nvim_async_request")){let[i,n,s]=t;this.handleRequest(n,s,{send:(o,a)=>{this.notify("nvim_call_function",["coc#rpc#async_response",[i,o,a]])}})}if(e.startsWith("nvim_async_response")){let[i,n,s]=t,o=this.responses.get(i);if(!o){console.error(`Response not found for request ${i}`);return}this.responses.delete(i),o.finish(n,s);return}}else this.emit("notification",e,t)}handleNotification(e,t){this.emitNotification(e,t)}setupTransport(e=!0){if(!this.transportAttached)throw new Error("Not attached to input/output");this.transport.on("request",this.handleRequest),this.transport.on("notification",this.handleNotification),this.transport.on("detach",()=>{this.emit("disconnect"),this.transport.removeAllListeners("request"),this.transport.removeAllListeners("notification"),this.transport.removeAllListeners("detach")}),e?this._isReady=this.generateApi():(this._channelId=0,this._isReady=Promise.resolve(!0))}requestApi(){return new Promise((e,t)=>{this.transport.request("nvim_get_api_info",[],(i,n)=>{i?t(new Error(Array.isArray(i)?i[1]:i.message||i.toString())):e(n)})})}async generateApi(){let e;try{e=await this.requestApi()}catch(t){console.error("Could not get vim api results"),bF.error(t)}if(e)try{let[t,i]=e;return this.functions=i.functions.map(n=>n.name),this._channelId=t,!0}catch(t){return bF.error(t.stack),null}return null}attachBufferEvent(e,t,i){let n=this.attachedBuffers.get(e.id)||new Map,s=n.get(t)||[];s.includes(i)||(s.push(i),n.set(t,s),this.attachedBuffers.set(e.id,n))}detachBufferEvent(e,t,i){let n=this.attachedBuffers.get(e.id);if(!n||!n.has(t))return;let s=n.get(t).filter(o=>o!==i);n.set(t,s)}pauseNotification(){this.transport.pauseNotification();let e=Error().stack;process.nextTick(()=>{this.transport.pauseLevel>0&&this.logError("resumeNotification not called within same tick:",e)})}resumeNotification(e,t){return e?Promise.resolve(this.transport.cancelNotification()):t?Promise.resolve(this.transport.resumeNotification(!0)):Promise.resolve(this.transport.resumeNotification())}hasFunction(e){return this.functions?this.functions.indexOf(e)!==-1:!0}};dc.NeovimClient=wF});var xF=x(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.attach=void 0;var Zte=require("net"),Qte=Lm();function eie({reader:r,writer:e,proc:t,socket:i},n=null,s=!0){let o,a,l;if(i){let c=Zte.createConnection(i);o=c,a=c,c.once("close",()=>{l.detach()})}else r&&e?(o=e,a=r):t&&(o=t.stdin,a=t.stdout,t.once("disconnect",()=>{l.detach()}));if(o.on("error",c=>{c.code=="EPIPE"&&l.detach()}),o&&a)return l=new Qte.NeovimClient(n),l.attach({writer:o,reader:a},s),l;throw new Error("Invalid arguments, could not attach")}Am.attach=eie});var SF=x(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.Tabpage=Ur.Window=Ur.Buffer=Ur.NeovimClient=Ur.Neovim=void 0;var tie=Lm();Object.defineProperty(Ur,"Neovim",{enumerable:!0,get:function(){return tie.NeovimClient}});var iie=Lm();Object.defineProperty(Ur,"NeovimClient",{enumerable:!0,get:function(){return iie.NeovimClient}});var rie=Yf();Object.defineProperty(Ur,"Buffer",{enumerable:!0,get:function(){return rie.Buffer}});var nie=Xf();Object.defineProperty(Ur,"Window",{enumerable:!0,get:function(){return nie.Window}});var sie=Zf();Object.defineProperty(Ur,"Tabpage",{enumerable:!0,get:function(){return sie.Tabpage}})});var ES=x(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.Window=Zi.Tabpage=Zi.Buffer=Zi.NeovimClient=Zi.Neovim=Zi.attach=void 0;var oie=xF();Object.defineProperty(Zi,"attach",{enumerable:!0,get:function(){return oie.attach}});var id=SF();Object.defineProperty(Zi,"Neovim",{enumerable:!0,get:function(){return id.Neovim}});Object.defineProperty(Zi,"NeovimClient",{enumerable:!0,get:function(){return id.NeovimClient}});Object.defineProperty(Zi,"Buffer",{enumerable:!0,get:function(){return id.Buffer}});Object.defineProperty(Zi,"Tabpage",{enumerable:!0,get:function(){return id.Tabpage}});Object.defineProperty(Zi,"Window",{enumerable:!0,get:function(){return id.Window}})});var Cs=x(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var TS;function DS(){if(TS===void 0)throw new Error("No runtime abstraction layer installed");return TS}(function(r){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");TS=t}r.install=e})(DS||(DS={}));RS.default=DS});var PS=x(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.Disposable=void 0;var aie;(function(r){function e(t){return{dispose:t}}r.create=e})(aie=rd.Disposable||(rd.Disposable={}))});var _F=x(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.AbstractMessageBuffer=void 0;var lie=13,cie=10,uie=`\r
`,CF=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,t=0,i=0,n=0;e:for(;t<this._chunks.length;){let l=this._chunks[t];i=0;t:for(;i<l.length;){switch(l[i]){case lie:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case cie:switch(e){case 1:e=2;break;case 3:e=4,i++;break e;default:e=0}break;default:e=0}i++}n+=l.byteLength,t++}if(e!==4)return;let s=this._read(n+i),o=new Map,a=this.toString(s,"ascii").split(uie);if(a.length<2)return o;for(let l=0;l<a.length-2;l++){let c=a[l],u=c.indexOf(":");if(u===-1)throw new Error("Message header must separate key and value using :");let f=c.substr(0,u),d=c.substr(u+1).trim();o.set(f,d)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),i=0,n=0;for(;e>0;){let s=this._chunks[n];if(s.byteLength>e){let o=s.slice(0,e);t.set(o,i),i+=e,this._chunks[n]=s.slice(e),this._totalLength-=e,e-=e}else t.set(s,i),i+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return t}};Fm.AbstractMessageBuffer=CF});var PF=x(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});var fie=Cs(),EF=require("util"),Oa=PS(),die=_F(),nd=class extends die.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return nd.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new EF.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};nd.emptyBuffer=Buffer.allocUnsafe(0);var TF=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Oa.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Oa.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Oa.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Oa.Disposable.create(()=>this.stream.off("data",e))}},DF=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Oa.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Oa.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Oa.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,n)=>{let s=o=>{o==null?i():n(o)};typeof e=="string"?this.stream.write(e,t,s):this.stream.write(e,s)})}end(){this.stream.end()}},RF=Object.freeze({messageBuffer:Object.freeze({create:r=>new nd(r)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(r,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(r,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(r,e)=>{try{return r instanceof Buffer?Promise.resolve(JSON.parse(r.toString(e.charset))):Promise.resolve(JSON.parse(new EF.TextDecoder(e.charset).decode(r)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:r=>new TF(r),asWritableStream:r=>new DF(r)}),console,timer:Object.freeze({setTimeout(r,e,...t){return setTimeout(r,e,...t)},clearTimeout(r){clearTimeout(r)},setImmediate(r,...e){return setImmediate(r,...e)},clearImmediate(r){clearImmediate(r)}})});function kS(){return RF}(function(r){function e(){fie.default.install(RF)}r.install=e})(kS||(kS={}));IS.default=kS});var hc=x(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.stringArray=Si.array=Si.func=Si.error=Si.number=Si.string=Si.boolean=void 0;function hie(r){return r===!0||r===!1}Si.boolean=hie;function kF(r){return typeof r=="string"||r instanceof String}Si.string=kF;function pie(r){return typeof r=="number"||r instanceof Number}Si.number=pie;function mie(r){return r instanceof Error}Si.error=mie;function gie(r){return typeof r=="function"}Si.func=gie;function IF(r){return Array.isArray(r)}Si.array=IF;function vie(r){return IF(r)&&r.every(e=>kF(e))}Si.stringArray=vie});var OS=x(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.isResponseMessage=ee.isNotificationMessage=ee.isRequestMessage=ee.NotificationType9=ee.NotificationType8=ee.NotificationType7=ee.NotificationType6=ee.NotificationType5=ee.NotificationType4=ee.NotificationType3=ee.NotificationType2=ee.NotificationType1=ee.NotificationType0=ee.NotificationType=ee.RequestType9=ee.RequestType8=ee.RequestType7=ee.RequestType6=ee.RequestType5=ee.RequestType4=ee.RequestType3=ee.RequestType2=ee.RequestType1=ee.RequestType=ee.RequestType0=ee.AbstractMessageSignature=ee.ParameterStructures=ee.ResponseError=ee.ErrorCodes=void 0;var La=hc(),OF;(function(r){r.ParseError=-32700,r.InvalidRequest=-32600,r.MethodNotFound=-32601,r.InvalidParams=-32602,r.InternalError=-32603,r.jsonrpcReservedErrorRangeStart=-32099,r.serverErrorStart=r.jsonrpcReservedErrorRangeStart,r.MessageWriteError=-32099,r.MessageReadError=-32098,r.ServerNotInitialized=-32002,r.UnknownErrorCode=-32001,r.jsonrpcReservedErrorRangeEnd=-32e3,r.serverErrorEnd=r.jsonrpcReservedErrorRangeEnd})(OF=ee.ErrorCodes||(ee.ErrorCodes={}));var Mm=class extends Error{constructor(e,t,i){super(t);this.code=La.number(e)?e:OF.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,Mm.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}};ee.ResponseError=Mm;var ui=class{constructor(e){this.kind=e}static is(e){return e===ui.auto||e===ui.byName||e===ui.byPosition}toString(){return this.kind}};ee.ParameterStructures=ui;ui.auto=new ui("auto");ui.byPosition=new ui("byPosition");ui.byName=new ui("byName");var vt=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return ui.auto}};ee.AbstractMessageSignature=vt;var LF=class extends vt{constructor(e){super(e,0)}};ee.RequestType0=LF;var AF=class extends vt{constructor(e,t=ui.auto){super(e,1);this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};ee.RequestType=AF;var FF=class extends vt{constructor(e,t=ui.auto){super(e,1);this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};ee.RequestType1=FF;var MF=class extends vt{constructor(e){super(e,2)}};ee.RequestType2=MF;var NF=class extends vt{constructor(e){super(e,3)}};ee.RequestType3=NF;var qF=class extends vt{constructor(e){super(e,4)}};ee.RequestType4=qF;var $F=class extends vt{constructor(e){super(e,5)}};ee.RequestType5=$F;var BF=class extends vt{constructor(e){super(e,6)}};ee.RequestType6=BF;var jF=class extends vt{constructor(e){super(e,7)}};ee.RequestType7=jF;var UF=class extends vt{constructor(e){super(e,8)}};ee.RequestType8=UF;var HF=class extends vt{constructor(e){super(e,9)}};ee.RequestType9=HF;var WF=class extends vt{constructor(e,t=ui.auto){super(e,1);this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};ee.NotificationType=WF;var zF=class extends vt{constructor(e){super(e,0)}};ee.NotificationType0=zF;var VF=class extends vt{constructor(e,t=ui.auto){super(e,1);this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};ee.NotificationType1=VF;var GF=class extends vt{constructor(e){super(e,2)}};ee.NotificationType2=GF;var KF=class extends vt{constructor(e){super(e,3)}};ee.NotificationType3=KF;var JF=class extends vt{constructor(e){super(e,4)}};ee.NotificationType4=JF;var YF=class extends vt{constructor(e){super(e,5)}};ee.NotificationType5=YF;var XF=class extends vt{constructor(e){super(e,6)}};ee.NotificationType6=XF;var ZF=class extends vt{constructor(e){super(e,7)}};ee.NotificationType7=ZF;var QF=class extends vt{constructor(e){super(e,8)}};ee.NotificationType8=QF;var eM=class extends vt{constructor(e){super(e,9)}};ee.NotificationType9=eM;function bie(r){let e=r;return e&&La.string(e.method)&&(La.string(e.id)||La.number(e.id))}ee.isRequestMessage=bie;function yie(r){let e=r;return e&&La.string(e.method)&&r.id===void 0}ee.isNotificationMessage=yie;function wie(r){let e=r;return e&&(e.result!==void 0||!!e.error)&&(La.string(e.id)||La.number(e.id)||e.id===null)}ee.isResponseMessage=wie});var pc=x(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.Emitter=Aa.Event=void 0;var xie=Cs(),Sie;(function(r){let e={dispose(){}};r.None=function(){return e}})(Sie=Aa.Event||(Aa.Event={}));var tM=class{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let n=0,s=this._callbacks.length;n<s;n++)if(this._callbacks[n]===e)if(this._contexts[n]===t){this._callbacks.splice(n,1),this._contexts.splice(n,1);return}else i=!0;if(i)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],i=this._callbacks.slice(0),n=this._contexts.slice(0);for(let s=0,o=i.length;s<o;s++)try{t.push(i[s].apply(n[s],e))}catch(a){xie.default().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},sd=class{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new tM),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let n={dispose:()=>{!this._callbacks||(this._callbacks.remove(e,t),n.dispose=sd._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(n),n}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Aa.Emitter=sd;sd._noop=function(){}});var MS=x(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.CancellationTokenSource=Fa.CancellationToken=void 0;var iM=Cs(),Cie=hc(),LS=pc(),AS;(function(r){r.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:LS.Event.None}),r.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:LS.Event.None});function e(t){let i=t;return i&&(i===r.None||i===r.Cancelled||Cie.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}r.is=e})(AS=Fa.CancellationToken||(Fa.CancellationToken={}));var _ie=Object.freeze(function(r,e){let t=iM.default().timer.setTimeout(r.bind(e),0);return{dispose(){iM.default().timer.clearTimeout(t)}}}),FS=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?_ie:(this._emitter||(this._emitter=new LS.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},rM=class{get token(){return this._token||(this._token=new FS),this._token}cancel(){this._token?this._token.cancel():this._token=AS.Cancelled}dispose(){this._token?this._token instanceof FS&&this._token.dispose():this._token=AS.None}};Fa.CancellationTokenSource=rM});var sM=x(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.ReadableStreamMessageReader=_s.AbstractMessageReader=_s.MessageReader=void 0;var Nm=Cs(),mc=hc(),NS=pc(),Eie;(function(r){function e(t){let i=t;return i&&mc.func(i.listen)&&mc.func(i.dispose)&&mc.func(i.onError)&&mc.func(i.onClose)&&mc.func(i.onPartialMessage)}r.is=e})(Eie=_s.MessageReader||(_s.MessageReader={}));var qS=class{constructor(){this.errorEmitter=new NS.Emitter,this.closeEmitter=new NS.Emitter,this.partialMessageEmitter=new NS.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${mc.string(e.message)?e.message:"unknown"}`)}};_s.AbstractMessageReader=qS;var $S;(function(r){function e(t){var i;let n,s,o,a=new Map,l,c=new Map;if(t===void 0||typeof t=="string")n=t!=null?t:"utf-8";else{if(n=(i=t.charset)!==null&&i!==void 0?i:"utf-8",t.contentDecoder!==void 0&&(o=t.contentDecoder,a.set(o.name,o)),t.contentDecoders!==void 0)for(let u of t.contentDecoders)a.set(u.name,u);if(t.contentTypeDecoder!==void 0&&(l=t.contentTypeDecoder,c.set(l.name,l)),t.contentTypeDecoders!==void 0)for(let u of t.contentTypeDecoders)c.set(u.name,u)}return l===void 0&&(l=Nm.default().applicationJson.decoder,c.set(l.name,l)),{charset:n,contentDecoder:o,contentDecoders:a,contentTypeDecoder:l,contentTypeDecoders:c}}r.fromOptions=e})($S||($S={}));var nM=class extends qS{constructor(e,t){super();this.readable=e,this.options=$S.fromOptions(t),this.buffer=Nm.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders();if(!n)return;let s=n.get("Content-Length");if(!s)throw new Error("Header must provide a Content-Length property.");let o=parseInt(s);if(isNaN(o))throw new Error("Content-Length value must be a number.");this.nextMessageLength=o}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1;let i;this.options.contentDecoder!==void 0?i=this.options.contentDecoder.decode(t):i=Promise.resolve(t),i.then(n=>{this.options.contentTypeDecoder.decode(n,this.options).then(s=>{this.callback(s)},s=>{this.fireError(s)})},n=>{this.fireError(n)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(Nm.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=Nm.default().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};_s.ReadableStreamMessageReader=nM});var aM=x(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.Semaphore=void 0;var Tie=Cs(),oM=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||Tie.default().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};qm.Semaphore=oM});var dM=x(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.WriteableStreamMessageWriter=Es.AbstractMessageWriter=Es.MessageWriter=void 0;var lM=Cs(),od=hc(),Die=aM(),cM=pc(),Rie="Content-Length: ",uM=`\r
`,Pie;(function(r){function e(t){let i=t;return i&&od.func(i.dispose)&&od.func(i.onClose)&&od.func(i.onError)&&od.func(i.write)}r.is=e})(Pie=Es.MessageWriter||(Es.MessageWriter={}));var BS=class{constructor(){this.errorEmitter=new cM.Emitter,this.closeEmitter=new cM.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${od.string(e.message)?e.message:"unknown"}`)}};Es.AbstractMessageWriter=BS;var jS;(function(r){function e(t){var i,n;return t===void 0||typeof t=="string"?{charset:t!=null?t:"utf-8",contentTypeEncoder:lM.default().applicationJson.encoder}:{charset:(i=t.charset)!==null&&i!==void 0?i:"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:(n=t.contentTypeEncoder)!==null&&n!==void 0?n:lM.default().applicationJson.encoder}}r.fromOptions=e})(jS||(jS={}));var fM=class extends BS{constructor(e,t){super();this.writable=e,this.options=jS.fromOptions(t),this.errorCount=0,this.writeSemaphore=new Die.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let n=[];return n.push(Rie,i.byteLength.toString(),uM),n.push(uM),this.doWrite(e,n,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};Es.WriteableStreamMessageWriter=fM});var pM=x(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.LRUCache=Ts.LinkedMap=Ts.Touch=void 0;var Bi;(function(r){r.None=0,r.First=1,r.AsOld=r.First,r.Last=2,r.AsNew=r.Last})(Bi=Ts.Touch||(Ts.Touch={}));var US=class{constructor(){this[Symbol.toStringTag]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=Bi.None){let i=this._map.get(e);if(!!i)return t!==Bi.None&&this.touch(i,t),i.value}set(e,t,i=Bi.None){let n=this._map.get(e);if(n)n.value=t,i!==Bi.None&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case Bi.None:this.addItemLast(n);break;case Bi.First:this.addItemFirst(n);break;case Bi.Last:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(!!t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){let e=this,t=this._state,i=this._head,n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let s={value:i.key,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}values(){let e=this,t=this._state,i=this._head,n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let s={value:i.value,done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}entries(){let e=this,t=this._state,i=this._head,n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let s={value:[i.key,i.value],done:!1};return i=i.next,s}else return{value:void 0,done:!0}}};return n}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==Bi.First&&t!==Bi.Last)){if(t===Bi.First){if(e===this._head)return;let i=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===Bi.Last){if(e===this._tail)return;let i=e.next,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}};Ts.LinkedMap=US;var hM=class extends US{constructor(e,t=1){super();this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=Bi.AsNew){return super.get(e,t)}peek(e){return super.get(e,Bi.None)}set(e,t){return super.set(e,t,Bi.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Ts.LRUCache=hM});var wM=x(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.createMessageConnection=ge.ConnectionOptions=ge.CancellationStrategy=ge.CancellationSenderStrategy=ge.CancellationReceiverStrategy=ge.ConnectionStrategy=ge.ConnectionError=ge.ConnectionErrors=ge.LogTraceNotification=ge.SetTraceNotification=ge.TraceFormat=ge.Trace=ge.NullLogger=ge.ProgressType=void 0;var mM=Cs(),ti=hc(),pe=OS(),gM=pM(),ad=pc(),HS=MS(),ld;(function(r){r.type=new pe.NotificationType("$/cancelRequest")})(ld||(ld={}));var $m;(function(r){r.type=new pe.NotificationType("$/progress")})($m||($m={}));var vM=class{constructor(){}};ge.ProgressType=vM;var WS;(function(r){function e(t){return ti.func(t)}r.is=e})(WS||(WS={}));ge.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ut;(function(r){r[r.Off=0]="Off",r[r.Messages=1]="Messages",r[r.Verbose=2]="Verbose"})(Ut=ge.Trace||(ge.Trace={}));(function(r){function e(i){if(!ti.string(i))return r.Off;switch(i=i.toLowerCase(),i){case"off":return r.Off;case"messages":return r.Messages;case"verbose":return r.Verbose;default:return r.Off}}r.fromString=e;function t(i){switch(i){case r.Off:return"off";case r.Messages:return"messages";case r.Verbose:return"verbose";default:return"off"}}r.toString=t})(Ut=ge.Trace||(ge.Trace={}));var gn;(function(r){r.Text="text",r.JSON="json"})(gn=ge.TraceFormat||(ge.TraceFormat={}));(function(r){function e(t){return t=t.toLowerCase(),t==="json"?r.JSON:r.Text}r.fromString=e})(gn=ge.TraceFormat||(ge.TraceFormat={}));var bM;(function(r){r.type=new pe.NotificationType("$/setTrace")})(bM=ge.SetTraceNotification||(ge.SetTraceNotification={}));var zS;(function(r){r.type=new pe.NotificationType("$/logTrace")})(zS=ge.LogTraceNotification||(ge.LogTraceNotification={}));var Bm;(function(r){r[r.Closed=1]="Closed",r[r.Disposed=2]="Disposed",r[r.AlreadyListening=3]="AlreadyListening"})(Bm=ge.ConnectionErrors||(ge.ConnectionErrors={}));var Ma=class extends Error{constructor(e,t){super(t);this.code=e,Object.setPrototypeOf(this,Ma.prototype)}};ge.ConnectionError=Ma;var yM;(function(r){function e(t){let i=t;return i&&ti.func(i.cancelUndispatched)}r.is=e})(yM=ge.ConnectionStrategy||(ge.ConnectionStrategy={}));var VS;(function(r){r.Message=Object.freeze({createCancellationTokenSource(t){return new HS.CancellationTokenSource}});function e(t){let i=t;return i&&ti.func(i.createCancellationTokenSource)}r.is=e})(VS=ge.CancellationReceiverStrategy||(ge.CancellationReceiverStrategy={}));var GS;(function(r){r.Message=Object.freeze({sendCancellation(t,i){t.sendNotification(ld.type,{id:i})},cleanup(t){}});function e(t){let i=t;return i&&ti.func(i.sendCancellation)&&ti.func(i.cleanup)}r.is=e})(GS=ge.CancellationSenderStrategy||(ge.CancellationSenderStrategy={}));var KS;(function(r){r.Message=Object.freeze({receiver:VS.Message,sender:GS.Message});function e(t){let i=t;return i&&VS.is(i.receiver)&&GS.is(i.sender)}r.is=e})(KS=ge.CancellationStrategy||(ge.CancellationStrategy={}));var kie;(function(r){function e(t){let i=t;return i&&(KS.is(i.cancellationStrategy)||yM.is(i.connectionStrategy))}r.is=e})(kie=ge.ConnectionOptions||(ge.ConnectionOptions={}));var vn;(function(r){r[r.New=1]="New",r[r.Listening=2]="Listening",r[r.Closed=3]="Closed",r[r.Disposed=4]="Disposed"})(vn||(vn={}));function Iie(r,e,t,i){let n=t!==void 0?t:ge.NullLogger,s=0,o=0,a=0,l="2.0",c,u=Object.create(null),f,d=Object.create(null),h=new Map,p,g=new gM.LinkedMap,b=Object.create(null),y=Object.create(null),S=Ut.Off,w=gn.Text,_,L=vn.New,$=new ad.Emitter,I=new ad.Emitter,W=new ad.Emitter,A=new ad.Emitter,M=new ad.Emitter,k=i&&i.cancellationStrategy?i.cancellationStrategy:KS.Message;function F(P){if(P===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+P.toString()}function j(P){return P===null?"res-unknown-"+(++a).toString():"res-"+P.toString()}function X(){return"not-"+(++o).toString()}function ae(P,z){pe.isRequestMessage(z)?P.set(F(z.id),z):pe.isResponseMessage(z)?P.set(j(z.id),z):P.set(X(),z)}function Pe(P){}function ke(){return L===vn.Listening}function Qe(){return L===vn.Closed}function St(){return L===vn.Disposed}function bi(){(L===vn.New||L===vn.Listening)&&(L=vn.Closed,I.fire(void 0))}function eo(P){$.fire([P,void 0,void 0])}function ms(P){$.fire(P)}r.onClose(bi),r.onError(eo),e.onClose(bi),e.onError(ms);function xp(){p||g.size===0||(p=mM.default().timer.setImmediate(()=>{p=void 0,Sp()}))}function Sp(){if(g.size===0)return;let P=g.shift();try{pe.isRequestMessage(P)?Il(P):pe.isNotificationMessage(P)?Ie(P):pe.isResponseMessage(P)?Ol(P):Se(P)}finally{xp()}}let Fw=P=>{try{if(pe.isNotificationMessage(P)&&P.method===ld.type.method){let z=F(P.params.id),K=g.get(z);if(pe.isRequestMessage(K)){let ce=i==null?void 0:i.connectionStrategy,ze=ce&&ce.cancelUndispatched?ce.cancelUndispatched(K,Pe):Pe(K);if(ze&&(ze.error!==void 0||ze.result!==void 0)){g.delete(z),ze.id=K.id,Dt(ze,P.method,Date.now()),e.write(ze);return}}}ae(g,P)}finally{xp()}};function Il(P){if(St())return;function z(Ke,Pt,Je){let Yt={jsonrpc:l,id:P.id};Ke instanceof pe.ResponseError?Yt.error=Ke.toJson():Yt.result=Ke===void 0?null:Ke,Dt(Yt,Pt,Je),e.write(Yt)}function K(Ke,Pt,Je){let Yt={jsonrpc:l,id:P.id,error:Ke.toJson()};Dt(Yt,Pt,Je),e.write(Yt)}function ce(Ke,Pt,Je){Ke===void 0&&(Ke=null);let Yt={jsonrpc:l,id:P.id,result:Ke};Dt(Yt,Pt,Je),e.write(Yt)}un(P);let ze=u[P.method],Rt,Jt;ze&&(Rt=ze.type,Jt=ze.handler);let Qt=Date.now();if(Jt||c){let Ke=String(P.id),Pt=k.receiver.createCancellationTokenSource(Ke);y[Ke]=Pt;try{let Je;if(Jt)if(P.params===void 0){if(Rt!==void 0&&Rt.numberOfParams!==0){K(new pe.ResponseError(pe.ErrorCodes.InvalidParams,`Request ${P.method} defines ${Rt.numberOfParams} params but recevied none.`),P.method,Qt);return}Je=Jt(Pt.token)}else if(Array.isArray(P.params)){if(Rt!==void 0&&Rt.parameterStructures===pe.ParameterStructures.byName){K(new pe.ResponseError(pe.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by name but received parameters by position`),P.method,Qt);return}Je=Jt(...P.params,Pt.token)}else{if(Rt!==void 0&&Rt.parameterStructures===pe.ParameterStructures.byPosition){K(new pe.ResponseError(pe.ErrorCodes.InvalidParams,`Request ${P.method} defines parameters by position but received parameters by name`),P.method,Qt);return}Je=Jt(P.params,Pt.token)}else c&&(Je=c(P.method,P.params,Pt.token));let Yt=Je;Je?Yt.then?Yt.then(Gi=>{delete y[Ke],z(Gi,P.method,Qt)},Gi=>{delete y[Ke],Gi instanceof pe.ResponseError?K(Gi,P.method,Qt):Gi&&ti.string(Gi.message)?K(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${Gi.message}`),P.method,Qt):K(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,Qt)}):(delete y[Ke],z(Je,P.method,Qt)):(delete y[Ke],ce(Je,P.method,Qt))}catch(Je){delete y[Ke],Je instanceof pe.ResponseError?z(Je,P.method,Qt):Je&&ti.string(Je.message)?K(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${P.method} failed with message: ${Je.message}`),P.method,Qt):K(new pe.ResponseError(pe.ErrorCodes.InternalError,`Request ${P.method} failed unexpectedly without providing any details.`),P.method,Qt)}}else K(new pe.ResponseError(pe.ErrorCodes.MethodNotFound,`Unhandled method ${P.method}`),P.method,Qt)}function Ol(P){if(!St())if(P.id===null)P.error?n.error(`Received response message without id: Error is:
${JSON.stringify(P.error,void 0,4)}`):n.error("Received response message without id. No further error information provided.");else{let z=String(P.id),K=b[z];if(mr(P,K),K){delete b[z];try{if(P.error){let ce=P.error;K.reject(new pe.ResponseError(ce.code,ce.message,ce.data))}else if(P.result!==void 0)K.resolve(P.result);else throw new Error("Should never happen.")}catch(ce){ce.message?n.error(`Response handler '${K.method}' failed with message: ${ce.message}`):n.error(`Response handler '${K.method}' failed unexpectedly.`)}}}}function Ie(P){if(St())return;let z,K;if(P.method===ld.type.method)K=ce=>{let ze=ce.id,Rt=y[String(ze)];Rt&&Rt.cancel()};else{let ce=d[P.method];ce&&(K=ce.handler,z=ce.type)}if(K||f)try{fn(P),K?P.params===void 0?(z!==void 0&&z.numberOfParams!==0&&z.parameterStructures!==pe.ParameterStructures.byName&&n.error(`Notification ${P.method} defines ${z.numberOfParams} params but recevied none.`),K()):Array.isArray(P.params)?(z!==void 0&&(z.parameterStructures===pe.ParameterStructures.byName&&n.error(`Notification ${P.method} defines parameters by name but received parameters by position`),z.numberOfParams!==P.params.length&&n.error(`Notification ${P.method} defines ${z.numberOfParams} params but received ${P.params.length} argumennts`)),K(...P.params)):(z!==void 0&&z.parameterStructures===pe.ParameterStructures.byPosition&&n.error(`Notification ${P.method} defines parameters by position but received parameters by name`),K(P.params)):f&&f(P.method,P.params)}catch(ce){ce.message?n.error(`Notification handler '${P.method}' failed with message: ${ce.message}`):n.error(`Notification handler '${P.method}' failed unexpectedly.`)}else W.fire(P)}function Se(P){if(!P){n.error("Received empty message.");return}n.error(`Received message which is neither a response nor a notification message:
${JSON.stringify(P,null,4)}`);let z=P;if(ti.string(z.id)||ti.number(z.id)){let K=String(z.id),ce=b[K];ce&&ce.reject(new Error("The received response has neither a result nor an error property."))}}function Ce(P){if(!(S===Ut.Off||!_))if(w===gn.Text){let z;S===Ut.Verbose&&P.params&&(z=`Params: ${JSON.stringify(P.params,null,4)}
`),_.log(`Sending request '${P.method} - (${P.id})'.`,z)}else to("send-request",P)}function Oe(P){if(!(S===Ut.Off||!_))if(w===gn.Text){let z;S===Ut.Verbose&&(P.params?z=`Params: ${JSON.stringify(P.params,null,4)}
`:z=`No parameters provided.
`),_.log(`Sending notification '${P.method}'.`,z)}else to("send-notification",P)}function Dt(P,z,K){if(!(S===Ut.Off||!_))if(w===gn.Text){let ce;S===Ut.Verbose&&(P.error&&P.error.data?ce=`Error data: ${JSON.stringify(P.error.data,null,4)}
`:P.result?ce=`Result: ${JSON.stringify(P.result,null,4)}
`:P.error===void 0&&(ce=`No result returned.
`)),_.log(`Sending response '${z} - (${P.id})'. Processing request took ${Date.now()-K}ms`,ce)}else to("send-response",P)}function un(P){if(!(S===Ut.Off||!_))if(w===gn.Text){let z;S===Ut.Verbose&&P.params&&(z=`Params: ${JSON.stringify(P.params,null,4)}
`),_.log(`Received request '${P.method} - (${P.id})'.`,z)}else to("receive-request",P)}function fn(P){if(!(S===Ut.Off||!_||P.method===zS.type.method))if(w===gn.Text){let z;S===Ut.Verbose&&(P.params?z=`Params: ${JSON.stringify(P.params,null,4)}
`:z=`No parameters provided.
`),_.log(`Received notification '${P.method}'.`,z)}else to("receive-notification",P)}function mr(P,z){if(!(S===Ut.Off||!_))if(w===gn.Text){let K;if(S===Ut.Verbose&&(P.error&&P.error.data?K=`Error data: ${JSON.stringify(P.error.data,null,4)}
`:P.result?K=`Result: ${JSON.stringify(P.result,null,4)}
`:P.error===void 0&&(K=`No result returned.
`)),z){let ce=P.error?` Request failed: ${P.error.message} (${P.error.code}).`:"";_.log(`Received response '${z.method} - (${P.id})' in ${Date.now()-z.timerStart}ms.${ce}`,K)}else _.log(`Received response ${P.id} without active response promise.`,K)}else to("receive-response",P)}function to(P,z){if(!_||S===Ut.Off)return;let K={isLSPMessage:!0,type:P,message:z,timestamp:Date.now()};_.log(K)}function io(){if(Qe())throw new Ma(Bm.Closed,"Connection is closed.");if(St())throw new Ma(Bm.Disposed,"Connection is disposed.")}function y9(){if(ke())throw new Ma(Bm.AlreadyListening,"Connection is already listening")}function w9(){if(!ke())throw new Error("Call listen() first.")}function uf(P){return P===void 0?null:P}function JD(P){if(P!==null)return P}function YD(P){return P!=null&&!Array.isArray(P)&&typeof P=="object"}function Mw(P,z){switch(P){case pe.ParameterStructures.auto:return YD(z)?JD(z):[uf(z)];case pe.ParameterStructures.byName:if(!YD(z))throw new Error("Recevied parameters by name but param is not an object literal.");return JD(z);case pe.ParameterStructures.byPosition:return[uf(z)];default:throw new Error(`Unknown parameter structure ${P.toString()}`)}}function XD(P,z){let K,ce=P.numberOfParams;switch(ce){case 0:K=void 0;break;case 1:K=Mw(P.parameterStructures,z[0]);break;default:K=[];for(let ze=0;ze<z.length&&ze<ce;ze++)K.push(uf(z[ze]));if(z.length<ce)for(let ze=z.length;ze<ce;ze++)K.push(null);break}return K}let Ll={sendNotification:(P,...z)=>{io();let K,ce;if(ti.string(P)){K=P;let Rt=z[0],Jt=0,Qt=pe.ParameterStructures.auto;pe.ParameterStructures.is(Rt)&&(Jt=1,Qt=Rt);let Ke=z.length,Pt=Ke-Jt;switch(Pt){case 0:ce=void 0;break;case 1:ce=Mw(Qt,z[Jt]);break;default:if(Qt===pe.ParameterStructures.byName)throw new Error(`Recevied ${Pt} parameters for 'by Name' notification parameter structure.`);ce=z.slice(Jt,Ke).map(Je=>uf(Je));break}}else{let Rt=z;K=P.method,ce=XD(P,Rt)}let ze={jsonrpc:l,method:K,params:ce};Oe(ze),e.write(ze)},onNotification:(P,z)=>{io();let K;return ti.func(P)?f=P:z&&(ti.string(P)?(K=P,d[P]={type:void 0,handler:z}):(K=P.method,d[P.method]={type:P,handler:z})),{dispose:()=>{K!==void 0?delete d[K]:f=void 0}}},onProgress:(P,z,K)=>{if(h.has(z))throw new Error(`Progress handler for token ${z} already registered`);return h.set(z,K),{dispose:()=>{h.delete(z)}}},sendProgress:(P,z,K)=>{Ll.sendNotification($m.type,{token:z,value:K})},onUnhandledProgress:A.event,sendRequest:(P,...z)=>{io(),w9();let K,ce,ze;if(ti.string(P)){K=P;let Ke=z[0],Pt=z[z.length-1],Je=0,Yt=pe.ParameterStructures.auto;pe.ParameterStructures.is(Ke)&&(Je=1,Yt=Ke);let Gi=z.length;HS.CancellationToken.is(Pt)&&(Gi=Gi-1,ze=Pt);let la=Gi-Je;switch(la){case 0:ce=void 0;break;case 1:ce=Mw(Yt,z[Je]);break;default:if(Yt===pe.ParameterStructures.byName)throw new Error(`Recevied ${la} parameters for 'by Name' request parameter structure.`);ce=z.slice(Je,Gi).map(ro=>uf(ro));break}}else{let Ke=z;K=P.method,ce=XD(P,Ke);let Pt=P.numberOfParams;ze=HS.CancellationToken.is(Ke[Pt])?Ke[Pt]:void 0}let Rt=s++,Jt;return ze&&(Jt=ze.onCancellationRequested(()=>{k.sender.sendCancellation(Ll,Rt)})),new Promise((Ke,Pt)=>{let Je={jsonrpc:l,id:Rt,method:K,params:ce},Yt=ro=>{Ke(ro),k.sender.cleanup(Rt),Jt==null||Jt.dispose()},Gi=ro=>{Pt(ro),k.sender.cleanup(Rt),Jt==null||Jt.dispose()},la={method:K,timerStart:Date.now(),resolve:Yt,reject:Gi};Ce(Je);try{e.write(Je)}catch(ro){la.reject(new pe.ResponseError(pe.ErrorCodes.MessageWriteError,ro.message?ro.message:"Unknown reason")),la=null}la&&(b[String(Rt)]=la)})},onRequest:(P,z)=>{io();let K=null;return WS.is(P)?(K=void 0,c=P):ti.string(P)?(K=null,z!==void 0&&(K=P,u[P]={handler:z,type:void 0})):z!==void 0&&(K=P.method,u[P.method]={type:P,handler:z}),{dispose:()=>{K!==null&&(K!==void 0?delete u[K]:c=void 0)}}},trace:(P,z,K)=>{let ce=!1,ze=gn.Text;K!==void 0&&(ti.boolean(K)?ce=K:(ce=K.sendNotification||!1,ze=K.traceFormat||gn.Text)),S=P,w=ze,S===Ut.Off?_=void 0:_=z,ce&&!Qe()&&!St()&&Ll.sendNotification(bM.type,{value:Ut.toString(P)})},onError:$.event,onClose:I.event,onUnhandledNotification:W.event,onDispose:M.event,end:()=>{e.end()},dispose:()=>{if(St())return;L=vn.Disposed,M.fire(void 0);let P=new Error("Connection got disposed.");Object.keys(b).forEach(z=>{b[z].reject(P)}),b=Object.create(null),y=Object.create(null),g=new gM.LinkedMap,ti.func(e.dispose)&&e.dispose(),ti.func(r.dispose)&&r.dispose()},listen:()=>{io(),y9(),L=vn.Listening,r.listen(Fw)},inspect:()=>{mM.default().console.log("inspect")}};return Ll.onNotification(zS.type,P=>{S===Ut.Off||!_||_.log(P.message,S===Ut.Verbose?P.verbose:void 0)}),Ll.onNotification($m.type,P=>{let z=h.get(P.token);z?z(P.value):A.fire(P)}),Ll}ge.createMessageConnection=Iie});var XS=x(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.CancellationSenderStrategy=V.CancellationReceiverStrategy=V.ConnectionError=V.ConnectionErrors=V.LogTraceNotification=V.SetTraceNotification=V.TraceFormat=V.Trace=V.ProgressType=V.createMessageConnection=V.NullLogger=V.ConnectionOptions=V.ConnectionStrategy=V.WriteableStreamMessageWriter=V.AbstractMessageWriter=V.MessageWriter=V.ReadableStreamMessageReader=V.AbstractMessageReader=V.MessageReader=V.CancellationToken=V.CancellationTokenSource=V.Emitter=V.Event=V.Disposable=V.ParameterStructures=V.NotificationType9=V.NotificationType8=V.NotificationType7=V.NotificationType6=V.NotificationType5=V.NotificationType4=V.NotificationType3=V.NotificationType2=V.NotificationType1=V.NotificationType0=V.NotificationType=V.ErrorCodes=V.ResponseError=V.RequestType9=V.RequestType8=V.RequestType7=V.RequestType6=V.RequestType5=V.RequestType4=V.RequestType3=V.RequestType2=V.RequestType1=V.RequestType0=V.RequestType=V.RAL=void 0;V.CancellationStrategy=void 0;var ft=OS();Object.defineProperty(V,"RequestType",{enumerable:!0,get:function(){return ft.RequestType}});Object.defineProperty(V,"RequestType0",{enumerable:!0,get:function(){return ft.RequestType0}});Object.defineProperty(V,"RequestType1",{enumerable:!0,get:function(){return ft.RequestType1}});Object.defineProperty(V,"RequestType2",{enumerable:!0,get:function(){return ft.RequestType2}});Object.defineProperty(V,"RequestType3",{enumerable:!0,get:function(){return ft.RequestType3}});Object.defineProperty(V,"RequestType4",{enumerable:!0,get:function(){return ft.RequestType4}});Object.defineProperty(V,"RequestType5",{enumerable:!0,get:function(){return ft.RequestType5}});Object.defineProperty(V,"RequestType6",{enumerable:!0,get:function(){return ft.RequestType6}});Object.defineProperty(V,"RequestType7",{enumerable:!0,get:function(){return ft.RequestType7}});Object.defineProperty(V,"RequestType8",{enumerable:!0,get:function(){return ft.RequestType8}});Object.defineProperty(V,"RequestType9",{enumerable:!0,get:function(){return ft.RequestType9}});Object.defineProperty(V,"ResponseError",{enumerable:!0,get:function(){return ft.ResponseError}});Object.defineProperty(V,"ErrorCodes",{enumerable:!0,get:function(){return ft.ErrorCodes}});Object.defineProperty(V,"NotificationType",{enumerable:!0,get:function(){return ft.NotificationType}});Object.defineProperty(V,"NotificationType0",{enumerable:!0,get:function(){return ft.NotificationType0}});Object.defineProperty(V,"NotificationType1",{enumerable:!0,get:function(){return ft.NotificationType1}});Object.defineProperty(V,"NotificationType2",{enumerable:!0,get:function(){return ft.NotificationType2}});Object.defineProperty(V,"NotificationType3",{enumerable:!0,get:function(){return ft.NotificationType3}});Object.defineProperty(V,"NotificationType4",{enumerable:!0,get:function(){return ft.NotificationType4}});Object.defineProperty(V,"NotificationType5",{enumerable:!0,get:function(){return ft.NotificationType5}});Object.defineProperty(V,"NotificationType6",{enumerable:!0,get:function(){return ft.NotificationType6}});Object.defineProperty(V,"NotificationType7",{enumerable:!0,get:function(){return ft.NotificationType7}});Object.defineProperty(V,"NotificationType8",{enumerable:!0,get:function(){return ft.NotificationType8}});Object.defineProperty(V,"NotificationType9",{enumerable:!0,get:function(){return ft.NotificationType9}});Object.defineProperty(V,"ParameterStructures",{enumerable:!0,get:function(){return ft.ParameterStructures}});var Oie=PS();Object.defineProperty(V,"Disposable",{enumerable:!0,get:function(){return Oie.Disposable}});var xM=pc();Object.defineProperty(V,"Event",{enumerable:!0,get:function(){return xM.Event}});Object.defineProperty(V,"Emitter",{enumerable:!0,get:function(){return xM.Emitter}});var SM=MS();Object.defineProperty(V,"CancellationTokenSource",{enumerable:!0,get:function(){return SM.CancellationTokenSource}});Object.defineProperty(V,"CancellationToken",{enumerable:!0,get:function(){return SM.CancellationToken}});var JS=sM();Object.defineProperty(V,"MessageReader",{enumerable:!0,get:function(){return JS.MessageReader}});Object.defineProperty(V,"AbstractMessageReader",{enumerable:!0,get:function(){return JS.AbstractMessageReader}});Object.defineProperty(V,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return JS.ReadableStreamMessageReader}});var YS=dM();Object.defineProperty(V,"MessageWriter",{enumerable:!0,get:function(){return YS.MessageWriter}});Object.defineProperty(V,"AbstractMessageWriter",{enumerable:!0,get:function(){return YS.AbstractMessageWriter}});Object.defineProperty(V,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return YS.WriteableStreamMessageWriter}});var Qi=wM();Object.defineProperty(V,"ConnectionStrategy",{enumerable:!0,get:function(){return Qi.ConnectionStrategy}});Object.defineProperty(V,"ConnectionOptions",{enumerable:!0,get:function(){return Qi.ConnectionOptions}});Object.defineProperty(V,"NullLogger",{enumerable:!0,get:function(){return Qi.NullLogger}});Object.defineProperty(V,"createMessageConnection",{enumerable:!0,get:function(){return Qi.createMessageConnection}});Object.defineProperty(V,"ProgressType",{enumerable:!0,get:function(){return Qi.ProgressType}});Object.defineProperty(V,"Trace",{enumerable:!0,get:function(){return Qi.Trace}});Object.defineProperty(V,"TraceFormat",{enumerable:!0,get:function(){return Qi.TraceFormat}});Object.defineProperty(V,"SetTraceNotification",{enumerable:!0,get:function(){return Qi.SetTraceNotification}});Object.defineProperty(V,"LogTraceNotification",{enumerable:!0,get:function(){return Qi.LogTraceNotification}});Object.defineProperty(V,"ConnectionErrors",{enumerable:!0,get:function(){return Qi.ConnectionErrors}});Object.defineProperty(V,"ConnectionError",{enumerable:!0,get:function(){return Qi.ConnectionError}});Object.defineProperty(V,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Qi.CancellationReceiverStrategy}});Object.defineProperty(V,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Qi.CancellationSenderStrategy}});Object.defineProperty(V,"CancellationStrategy",{enumerable:!0,get:function(){return Qi.CancellationStrategy}});var Lie=Cs();V.RAL=Lie.default});var yc=x(Ge=>{"use strict";var Aie=Ge&&Ge.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),Fie=Ge&&Ge.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Aie(e,r,t)};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.createMessageConnection=Ge.createServerSocketTransport=Ge.createClientSocketTransport=Ge.createServerPipeTransport=Ge.createClientPipeTransport=Ge.generateRandomPipeName=Ge.StreamMessageWriter=Ge.StreamMessageReader=Ge.SocketMessageWriter=Ge.SocketMessageReader=Ge.IPCMessageWriter=Ge.IPCMessageReader=void 0;var gc=PF();gc.default.install();var Wn=XS(),CM=require("path"),Mie=require("os"),Nie=require("crypto"),jm=require("net");Fie(XS(),Ge);var _M=class extends Wn.AbstractMessageReader{constructor(e){super();this.process=e;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Wn.Disposable.create(()=>this.process.off("message",e))}};Ge.IPCMessageReader=_M;var EM=class extends Wn.AbstractMessageWriter{constructor(e){super();this.process=e,this.errorCount=0;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};Ge.IPCMessageWriter=EM;var vc=class extends Wn.ReadableStreamMessageReader{constructor(e,t="utf-8"){super(gc.default().stream.asReadableStream(e),t)}};Ge.SocketMessageReader=vc;var bc=class extends Wn.WriteableStreamMessageWriter{constructor(e,t){super(gc.default().stream.asWritableStream(e),t);this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ge.SocketMessageWriter=bc;var ZS=class extends Wn.ReadableStreamMessageReader{constructor(e,t){super(gc.default().stream.asReadableStream(e),t)}};Ge.StreamMessageReader=ZS;var QS=class extends Wn.WriteableStreamMessageWriter{constructor(e,t){super(gc.default().stream.asWritableStream(e),t)}};Ge.StreamMessageWriter=QS;var TM=process.env.XDG_RUNTIME_DIR,qie=new Map([["linux",107],["darwin",103]]);function $ie(){let r=Nie.randomBytes(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${r}-sock`;let e;TM?e=CM.join(TM,`vscode-ipc-${r}.sock`):e=CM.join(Mie.tmpdir(),`vscode-${r}.sock`);let t=qie.get(process.platform);return t!==void 0&&e.length>=t&&gc.default().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}Ge.generateRandomPipeName=$ie;function Bie(r,e="utf-8"){let t,i=new Promise((n,s)=>{t=n});return new Promise((n,s)=>{let o=jm.createServer(a=>{o.close(),t([new vc(a,e),new bc(a,e)])});o.on("error",s),o.listen(r,()=>{o.removeListener("error",s),n({onConnected:()=>i})})})}Ge.createClientPipeTransport=Bie;function jie(r,e="utf-8"){let t=jm.createConnection(r);return[new vc(t,e),new bc(t,e)]}Ge.createServerPipeTransport=jie;function Uie(r,e="utf-8"){let t,i=new Promise((n,s)=>{t=n});return new Promise((n,s)=>{let o=jm.createServer(a=>{o.close(),t([new vc(a,e),new bc(a,e)])});o.on("error",s),o.listen(r,"127.0.0.1",()=>{o.removeListener("error",s),n({onConnected:()=>i})})})}Ge.createClientSocketTransport=Uie;function Hie(r,e="utf-8"){let t=jm.createConnection(r,"127.0.0.1");return[new vc(t,e),new bc(t,e)]}Ge.createServerSocketTransport=Hie;function Wie(r){let e=r;return e.read!==void 0&&e.addListener!==void 0}function zie(r){let e=r;return e.write!==void 0&&e.addListener!==void 0}function Vie(r,e,t,i){t||(t=Wn.NullLogger);let n=Wie(r)?new ZS(r):r,s=zie(e)?new QS(e):e;return Wn.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),Wn.createMessageConnection(n,s,t,i)}Ge.createMessageConnection=Vie});var eC=x((Fye,DM)=>{"use strict";DM.exports=yc()});var PM={};Bn(PM,{AnnotatedTextEdit:()=>Rs,ChangeAnnotation:()=>Na,ChangeAnnotationIdentifier:()=>fi,CodeAction:()=>IC,CodeActionContext:()=>kC,CodeActionKind:()=>PC,CodeDescription:()=>cC,CodeLens:()=>OC,Color:()=>Um,ColorInformation:()=>rC,ColorPresentation:()=>nC,Command:()=>wc,CompletionItem:()=>bC,CompletionItemKind:()=>hC,CompletionItemTag:()=>mC,CompletionList:()=>yC,CreateFile:()=>xc,DeleteFile:()=>Cc,Diagnostic:()=>ud,DiagnosticRelatedInformation:()=>Hm,DiagnosticSeverity:()=>aC,DiagnosticTag:()=>lC,DocumentHighlight:()=>_C,DocumentHighlightKind:()=>CC,DocumentLink:()=>AC,DocumentSymbol:()=>RC,EOL:()=>Kie,FoldingRange:()=>oC,FoldingRangeKind:()=>sC,FormattingOptions:()=>LC,Hover:()=>wC,InsertReplaceEdit:()=>gC,InsertTextFormat:()=>pC,InsertTextMode:()=>vC,Location:()=>er,LocationLink:()=>iC,MarkedString:()=>hd,MarkupContent:()=>Vm,MarkupKind:()=>_c,OptionalVersionedTextDocumentIdentifier:()=>dd,ParameterInformation:()=>xC,Position:()=>Sr,Range:()=>Ae,RenameFile:()=>Sc,SelectionRange:()=>FC,SignatureInformation:()=>SC,SymbolInformation:()=>DC,SymbolKind:()=>EC,SymbolTag:()=>TC,TextDocument:()=>MC,TextDocumentEdit:()=>fd,TextDocumentIdentifier:()=>uC,TextDocumentItem:()=>dC,TextEdit:()=>Ds,VersionedTextDocumentIdentifier:()=>fC,WorkspaceChange:()=>Gie,WorkspaceEdit:()=>Wm,integer:()=>tC,uinteger:()=>cd});var tC,cd,Sr,Ae,er,iC,Um,rC,nC,sC,oC,Hm,aC,lC,cC,ud,wc,Ds,Na,fi,Rs,fd,xc,Sc,Cc,Wm,zm,RM,Gie,uC,fC,dd,dC,_c,Vm,hC,pC,mC,gC,vC,bC,yC,hd,wC,xC,SC,CC,_C,EC,TC,DC,RC,PC,kC,IC,OC,LC,AC,FC,Kie,MC,Jie,q,Ps=R(()=>{"use strict";(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647})(tC||(tC={}));(function(r){r.MIN_VALUE=0,r.MAX_VALUE=2147483647})(cd||(cd={}));(function(r){function e(i,n){return i===Number.MAX_VALUE&&(i=cd.MAX_VALUE),n===Number.MAX_VALUE&&(n=cd.MAX_VALUE),{line:i,character:n}}r.create=e;function t(i){var n=i;return q.objectLiteral(n)&&q.uinteger(n.line)&&q.uinteger(n.character)}r.is=t})(Sr||(Sr={}));(function(r){function e(i,n,s,o){if(q.uinteger(i)&&q.uinteger(n)&&q.uinteger(s)&&q.uinteger(o))return{start:Sr.create(i,n),end:Sr.create(s,o)};if(Sr.is(i)&&Sr.is(n))return{start:i,end:n};throw new Error("Range#create called with invalid arguments["+i+", "+n+", "+s+", "+o+"]")}r.create=e;function t(i){var n=i;return q.objectLiteral(n)&&Sr.is(n.start)&&Sr.is(n.end)}r.is=t})(Ae||(Ae={}));(function(r){function e(i,n){return{uri:i,range:n}}r.create=e;function t(i){var n=i;return q.defined(n)&&Ae.is(n.range)&&(q.string(n.uri)||q.undefined(n.uri))}r.is=t})(er||(er={}));(function(r){function e(i,n,s,o){return{targetUri:i,targetRange:n,targetSelectionRange:s,originSelectionRange:o}}r.create=e;function t(i){var n=i;return q.defined(n)&&Ae.is(n.targetRange)&&q.string(n.targetUri)&&(Ae.is(n.targetSelectionRange)||q.undefined(n.targetSelectionRange))&&(Ae.is(n.originSelectionRange)||q.undefined(n.originSelectionRange))}r.is=t})(iC||(iC={}));(function(r){function e(i,n,s,o){return{red:i,green:n,blue:s,alpha:o}}r.create=e;function t(i){var n=i;return q.numberRange(n.red,0,1)&&q.numberRange(n.green,0,1)&&q.numberRange(n.blue,0,1)&&q.numberRange(n.alpha,0,1)}r.is=t})(Um||(Um={}));(function(r){function e(i,n){return{range:i,color:n}}r.create=e;function t(i){var n=i;return Ae.is(n.range)&&Um.is(n.color)}r.is=t})(rC||(rC={}));(function(r){function e(i,n,s){return{label:i,textEdit:n,additionalTextEdits:s}}r.create=e;function t(i){var n=i;return q.string(n.label)&&(q.undefined(n.textEdit)||Ds.is(n))&&(q.undefined(n.additionalTextEdits)||q.typedArray(n.additionalTextEdits,Ds.is))}r.is=t})(nC||(nC={}));(function(r){r.Comment="comment",r.Imports="imports",r.Region="region"})(sC||(sC={}));(function(r){function e(i,n,s,o,a){var l={startLine:i,endLine:n};return q.defined(s)&&(l.startCharacter=s),q.defined(o)&&(l.endCharacter=o),q.defined(a)&&(l.kind=a),l}r.create=e;function t(i){var n=i;return q.uinteger(n.startLine)&&q.uinteger(n.startLine)&&(q.undefined(n.startCharacter)||q.uinteger(n.startCharacter))&&(q.undefined(n.endCharacter)||q.uinteger(n.endCharacter))&&(q.undefined(n.kind)||q.string(n.kind))}r.is=t})(oC||(oC={}));(function(r){function e(i,n){return{location:i,message:n}}r.create=e;function t(i){var n=i;return q.defined(n)&&er.is(n.location)&&q.string(n.message)}r.is=t})(Hm||(Hm={}));(function(r){r.Error=1,r.Warning=2,r.Information=3,r.Hint=4})(aC||(aC={}));(function(r){r.Unnecessary=1,r.Deprecated=2})(lC||(lC={}));(function(r){function e(t){var i=t;return i!=null&&q.string(i.href)}r.is=e})(cC||(cC={}));(function(r){function e(i,n,s,o,a,l){var c={range:i,message:n};return q.defined(s)&&(c.severity=s),q.defined(o)&&(c.code=o),q.defined(a)&&(c.source=a),q.defined(l)&&(c.relatedInformation=l),c}r.create=e;function t(i){var n,s=i;return q.defined(s)&&Ae.is(s.range)&&q.string(s.message)&&(q.number(s.severity)||q.undefined(s.severity))&&(q.integer(s.code)||q.string(s.code)||q.undefined(s.code))&&(q.undefined(s.codeDescription)||q.string((n=s.codeDescription)===null||n===void 0?void 0:n.href))&&(q.string(s.source)||q.undefined(s.source))&&(q.undefined(s.relatedInformation)||q.typedArray(s.relatedInformation,Hm.is))}r.is=t})(ud||(ud={}));(function(r){function e(i,n){for(var s=[],o=2;o<arguments.length;o++)s[o-2]=arguments[o];var a={title:i,command:n};return q.defined(s)&&s.length>0&&(a.arguments=s),a}r.create=e;function t(i){var n=i;return q.defined(n)&&q.string(n.title)&&q.string(n.command)}r.is=t})(wc||(wc={}));(function(r){function e(s,o){return{range:s,newText:o}}r.replace=e;function t(s,o){return{range:{start:s,end:s},newText:o}}r.insert=t;function i(s){return{range:s,newText:""}}r.del=i;function n(s){var o=s;return q.objectLiteral(o)&&q.string(o.newText)&&Ae.is(o.range)}r.is=n})(Ds||(Ds={}));(function(r){function e(i,n,s){var o={label:i};return n!==void 0&&(o.needsConfirmation=n),s!==void 0&&(o.description=s),o}r.create=e;function t(i){var n=i;return n!==void 0&&q.objectLiteral(n)&&q.string(n.label)&&(q.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(q.string(n.description)||n.description===void 0)}r.is=t})(Na||(Na={}));(function(r){function e(t){var i=t;return typeof i=="string"}r.is=e})(fi||(fi={}));(function(r){function e(s,o,a){return{range:s,newText:o,annotationId:a}}r.replace=e;function t(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}r.insert=t;function i(s,o){return{range:s,newText:"",annotationId:o}}r.del=i;function n(s){var o=s;return Ds.is(o)&&(Na.is(o.annotationId)||fi.is(o.annotationId))}r.is=n})(Rs||(Rs={}));(function(r){function e(i,n){return{textDocument:i,edits:n}}r.create=e;function t(i){var n=i;return q.defined(n)&&dd.is(n.textDocument)&&Array.isArray(n.edits)}r.is=t})(fd||(fd={}));(function(r){function e(i,n,s){var o={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(o.options=n),s!==void 0&&(o.annotationId=s),o}r.create=e;function t(i){var n=i;return n&&n.kind==="create"&&q.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||q.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||q.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||fi.is(n.annotationId))}r.is=t})(xc||(xc={}));(function(r){function e(i,n,s,o){var a={kind:"rename",oldUri:i,newUri:n};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}r.create=e;function t(i){var n=i;return n&&n.kind==="rename"&&q.string(n.oldUri)&&q.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||q.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||q.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||fi.is(n.annotationId))}r.is=t})(Sc||(Sc={}));(function(r){function e(i,n,s){var o={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(o.options=n),s!==void 0&&(o.annotationId=s),o}r.create=e;function t(i){var n=i;return n&&n.kind==="delete"&&q.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||q.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||q.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||fi.is(n.annotationId))}r.is=t})(Cc||(Cc={}));(function(r){function e(t){var i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(function(n){return q.string(n.kind)?xc.is(n)||Sc.is(n)||Cc.is(n):fd.is(n)}))}r.is=e})(Wm||(Wm={}));zm=function(){function r(e,t){this.edits=e,this.changeAnnotations=t}return r.prototype.insert=function(e,t,i){var n,s;if(i===void 0?n=Ds.insert(e,t):fi.is(i)?(s=i,n=Rs.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),n=Rs.insert(e,t,s)),this.edits.push(n),s!==void 0)return s},r.prototype.replace=function(e,t,i){var n,s;if(i===void 0?n=Ds.replace(e,t):fi.is(i)?(s=i,n=Rs.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),n=Rs.replace(e,t,s)),this.edits.push(n),s!==void 0)return s},r.prototype.delete=function(e,t){var i,n;if(t===void 0?i=Ds.del(e):fi.is(t)?(n=t,i=Rs.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=Rs.del(e,n)),this.edits.push(i),n!==void 0)return n},r.prototype.add=function(e){this.edits.push(e)},r.prototype.all=function(){return this.edits},r.prototype.clear=function(){this.edits.splice(0,this.edits.length)},r.prototype.assertChangeAnnotations=function(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},r}(),RM=function(){function r(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}return r.prototype.all=function(){return this._annotations},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),r.prototype.manage=function(e,t){var i;if(fi.is(e)?i=e:(i=this.nextId(),t=e),this._annotations[i]!==void 0)throw new Error("Id "+i+" is already in use.");if(t===void 0)throw new Error("No annotation provided for id "+i);return this._annotations[i]=t,this._size++,i},r.prototype.nextId=function(){return this._counter++,this._counter.toString()},r}(),Gie=function(){function r(e){var t=this;this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new RM(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(function(i){if(fd.is(i)){var n=new zm(i.edits,t._changeAnnotations);t._textEditChanges[i.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(function(i){var n=new zm(e.changes[i]);t._textEditChanges[i]=n})):this._workspaceEdit={}}return Object.defineProperty(r.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),r.prototype.getTextEditChange=function(e){if(dd.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version},i=this._textEditChanges[t.uri];if(!i){var n=[],s={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(s),i=new zm(n,this._changeAnnotations),this._textEditChanges[t.uri]=i}return i}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var i=this._textEditChanges[e];if(!i){var n=[];this._workspaceEdit.changes[e]=n,i=new zm(n),this._textEditChanges[e]=i}return i}},r.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new RM,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},r.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},r.prototype.createFile=function(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;Na.is(t)||fi.is(t)?n=t:i=t;var s,o;if(n===void 0?s=xc.create(e,i):(o=fi.is(n)?n:this._changeAnnotations.manage(n),s=xc.create(e,i,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o},r.prototype.renameFile=function(e,t,i,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Na.is(i)||fi.is(i)?s=i:n=i;var o,a;if(s===void 0?o=Sc.create(e,t,n):(a=fi.is(s)?s:this._changeAnnotations.manage(s),o=Sc.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(o),a!==void 0)return a},r.prototype.deleteFile=function(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;Na.is(t)||fi.is(t)?n=t:i=t;var s,o;if(n===void 0?s=Cc.create(e,i):(o=fi.is(n)?n:this._changeAnnotations.manage(n),s=Cc.create(e,i,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o},r}();(function(r){function e(i){return{uri:i}}r.create=e;function t(i){var n=i;return q.defined(n)&&q.string(n.uri)}r.is=t})(uC||(uC={}));(function(r){function e(i,n){return{uri:i,version:n}}r.create=e;function t(i){var n=i;return q.defined(n)&&q.string(n.uri)&&q.integer(n.version)}r.is=t})(fC||(fC={}));(function(r){function e(i,n){return{uri:i,version:n}}r.create=e;function t(i){var n=i;return q.defined(n)&&q.string(n.uri)&&(n.version===null||q.integer(n.version))}r.is=t})(dd||(dd={}));(function(r){function e(i,n,s,o){return{uri:i,languageId:n,version:s,text:o}}r.create=e;function t(i){var n=i;return q.defined(n)&&q.string(n.uri)&&q.string(n.languageId)&&q.integer(n.version)&&q.string(n.text)}r.is=t})(dC||(dC={}));(function(r){r.PlainText="plaintext",r.Markdown="markdown"})(_c||(_c={}));(function(r){function e(t){var i=t;return i===r.PlainText||i===r.Markdown}r.is=e})(_c||(_c={}));(function(r){function e(t){var i=t;return q.objectLiteral(t)&&_c.is(i.kind)&&q.string(i.value)}r.is=e})(Vm||(Vm={}));(function(r){r.Text=1,r.Method=2,r.Function=3,r.Constructor=4,r.Field=5,r.Variable=6,r.Class=7,r.Interface=8,r.Module=9,r.Property=10,r.Unit=11,r.Value=12,r.Enum=13,r.Keyword=14,r.Snippet=15,r.Color=16,r.File=17,r.Reference=18,r.Folder=19,r.EnumMember=20,r.Constant=21,r.Struct=22,r.Event=23,r.Operator=24,r.TypeParameter=25})(hC||(hC={}));(function(r){r.PlainText=1,r.Snippet=2})(pC||(pC={}));(function(r){r.Deprecated=1})(mC||(mC={}));(function(r){function e(i,n,s){return{newText:i,insert:n,replace:s}}r.create=e;function t(i){var n=i;return n&&q.string(n.newText)&&Ae.is(n.insert)&&Ae.is(n.replace)}r.is=t})(gC||(gC={}));(function(r){r.asIs=1,r.adjustIndentation=2})(vC||(vC={}));(function(r){function e(t){return{label:t}}r.create=e})(bC||(bC={}));(function(r){function e(t,i){return{items:t||[],isIncomplete:!!i}}r.create=e})(yC||(yC={}));(function(r){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}r.fromPlainText=e;function t(i){var n=i;return q.string(n)||q.objectLiteral(n)&&q.string(n.language)&&q.string(n.value)}r.is=t})(hd||(hd={}));(function(r){function e(t){var i=t;return!!i&&q.objectLiteral(i)&&(Vm.is(i.contents)||hd.is(i.contents)||q.typedArray(i.contents,hd.is))&&(t.range===void 0||Ae.is(t.range))}r.is=e})(wC||(wC={}));(function(r){function e(t,i){return i?{label:t,documentation:i}:{label:t}}r.create=e})(xC||(xC={}));(function(r){function e(t,i){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];var o={label:t};return q.defined(i)&&(o.documentation=i),q.defined(n)?o.parameters=n:o.parameters=[],o}r.create=e})(SC||(SC={}));(function(r){r.Text=1,r.Read=2,r.Write=3})(CC||(CC={}));(function(r){function e(t,i){var n={range:t};return q.number(i)&&(n.kind=i),n}r.create=e})(_C||(_C={}));(function(r){r.File=1,r.Module=2,r.Namespace=3,r.Package=4,r.Class=5,r.Method=6,r.Property=7,r.Field=8,r.Constructor=9,r.Enum=10,r.Interface=11,r.Function=12,r.Variable=13,r.Constant=14,r.String=15,r.Number=16,r.Boolean=17,r.Array=18,r.Object=19,r.Key=20,r.Null=21,r.EnumMember=22,r.Struct=23,r.Event=24,r.Operator=25,r.TypeParameter=26})(EC||(EC={}));(function(r){r.Deprecated=1})(TC||(TC={}));(function(r){function e(t,i,n,s,o){var a={name:t,kind:i,location:{uri:s,range:n}};return o&&(a.containerName=o),a}r.create=e})(DC||(DC={}));(function(r){function e(i,n,s,o,a,l){var c={name:i,detail:n,kind:s,range:o,selectionRange:a};return l!==void 0&&(c.children=l),c}r.create=e;function t(i){var n=i;return n&&q.string(n.name)&&q.number(n.kind)&&Ae.is(n.range)&&Ae.is(n.selectionRange)&&(n.detail===void 0||q.string(n.detail))&&(n.deprecated===void 0||q.boolean(n.deprecated))&&(n.children===void 0||Array.isArray(n.children))&&(n.tags===void 0||Array.isArray(n.tags))}r.is=t})(RC||(RC={}));(function(r){r.Empty="",r.QuickFix="quickfix",r.Refactor="refactor",r.RefactorExtract="refactor.extract",r.RefactorInline="refactor.inline",r.RefactorRewrite="refactor.rewrite",r.Source="source",r.SourceOrganizeImports="source.organizeImports",r.SourceFixAll="source.fixAll"})(PC||(PC={}));(function(r){function e(i,n){var s={diagnostics:i};return n!=null&&(s.only=n),s}r.create=e;function t(i){var n=i;return q.defined(n)&&q.typedArray(n.diagnostics,ud.is)&&(n.only===void 0||q.typedArray(n.only,q.string))}r.is=t})(kC||(kC={}));(function(r){function e(i,n,s){var o={title:i},a=!0;return typeof n=="string"?(a=!1,o.kind=n):wc.is(n)?o.command=n:o.edit=n,a&&s!==void 0&&(o.kind=s),o}r.create=e;function t(i){var n=i;return n&&q.string(n.title)&&(n.diagnostics===void 0||q.typedArray(n.diagnostics,ud.is))&&(n.kind===void 0||q.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||wc.is(n.command))&&(n.isPreferred===void 0||q.boolean(n.isPreferred))&&(n.edit===void 0||Wm.is(n.edit))}r.is=t})(IC||(IC={}));(function(r){function e(i,n){var s={range:i};return q.defined(n)&&(s.data=n),s}r.create=e;function t(i){var n=i;return q.defined(n)&&Ae.is(n.range)&&(q.undefined(n.command)||wc.is(n.command))}r.is=t})(OC||(OC={}));(function(r){function e(i,n){return{tabSize:i,insertSpaces:n}}r.create=e;function t(i){var n=i;return q.defined(n)&&q.uinteger(n.tabSize)&&q.boolean(n.insertSpaces)}r.is=t})(LC||(LC={}));(function(r){function e(i,n,s){return{range:i,target:n,data:s}}r.create=e;function t(i){var n=i;return q.defined(n)&&Ae.is(n.range)&&(q.undefined(n.target)||q.string(n.target))}r.is=t})(AC||(AC={}));(function(r){function e(i,n){return{range:i,parent:n}}r.create=e;function t(i){var n=i;return n!==void 0&&Ae.is(n.range)&&(n.parent===void 0||r.is(n.parent))}r.is=t})(FC||(FC={}));Kie=[`
`,`\r
`,"\r"];(function(r){function e(s,o,a,l){return new Jie(s,o,a,l)}r.create=e;function t(s){var o=s;return!!(q.defined(o)&&q.string(o.uri)&&(q.undefined(o.languageId)||q.string(o.languageId))&&q.uinteger(o.lineCount)&&q.func(o.getText)&&q.func(o.positionAt)&&q.func(o.offsetAt))}r.is=t;function i(s,o){for(var a=s.getText(),l=n(o,function(p,g){var b=p.range.start.line-g.range.start.line;return b===0?p.range.start.character-g.range.start.character:b}),c=a.length,u=l.length-1;u>=0;u--){var f=l[u],d=s.offsetAt(f.range.start),h=s.offsetAt(f.range.end);if(h<=c)a=a.substring(0,d)+f.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");c=d}return a}r.applyEdits=i;function n(s,o){if(s.length<=1)return s;var a=s.length/2|0,l=s.slice(0,a),c=s.slice(a);n(l,o),n(c,o);for(var u=0,f=0,d=0;u<l.length&&f<c.length;){var h=o(l[u],c[f]);h<=0?s[d++]=l[u++]:s[d++]=c[f++]}for(;u<l.length;)s[d++]=l[u++];for(;f<c.length;)s[d++]=c[f++];return s}})(MC||(MC={}));Jie=function(){function r(e,t,i,n){this._uri=e,this._languageId=t,this._version=i,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(r.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),r.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content},r.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},r.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var e=[],t=this._content,i=!0,n=0;n<t.length;n++){i&&(e.push(n),i=!1);var s=t.charAt(n);i=s==="\r"||s===`
`,s==="\r"&&n+1<t.length&&t.charAt(n+1)===`
`&&n++}i&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},r.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return Sr.create(0,e);for(;i<n;){var s=Math.floor((i+n)/2);t[s]>e?n=s:i=s+1}var o=i-1;return Sr.create(o,e-t[o])},r.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var i=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,n),i)},Object.defineProperty(r.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),r}();(function(r){var e=Object.prototype.toString;function t(h){return typeof h!="undefined"}r.defined=t;function i(h){return typeof h=="undefined"}r.undefined=i;function n(h){return h===!0||h===!1}r.boolean=n;function s(h){return e.call(h)==="[object String]"}r.string=s;function o(h){return e.call(h)==="[object Number]"}r.number=o;function a(h,p,g){return e.call(h)==="[object Number]"&&p<=h&&h<=g}r.numberRange=a;function l(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}r.integer=l;function c(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}r.uinteger=c;function u(h){return e.call(h)==="[object Function]"}r.func=u;function f(h){return h!==null&&typeof h=="object"}r.objectLiteral=f;function d(h,p){return Array.isArray(h)&&h.every(p)}r.typedArray=d})(q||(q={}))});var ii=x(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.ProtocolNotificationType=Hr.ProtocolNotificationType0=Hr.ProtocolRequestType=Hr.ProtocolRequestType0=Hr.RegistrationType=void 0;var Ec=yc(),kM=class{constructor(e){this.method=e}};Hr.RegistrationType=kM;var IM=class extends Ec.RequestType0{constructor(e){super(e)}};Hr.ProtocolRequestType0=IM;var OM=class extends Ec.RequestType{constructor(e){super(e,Ec.ParameterStructures.byName)}};Hr.ProtocolRequestType=OM;var LM=class extends Ec.NotificationType0{constructor(e){super(e)}};Hr.ProtocolNotificationType0=LM;var AM=class extends Ec.NotificationType{constructor(e){super(e,Ec.ParameterStructures.byName)}};Hr.ProtocolNotificationType=AM});var NM=x(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.objectLiteral=Ht.typedArray=Ht.stringArray=Ht.array=Ht.func=Ht.error=Ht.number=Ht.string=Ht.boolean=void 0;function Yie(r){return r===!0||r===!1}Ht.boolean=Yie;function FM(r){return typeof r=="string"||r instanceof String}Ht.string=FM;function Xie(r){return typeof r=="number"||r instanceof Number}Ht.number=Xie;function Zie(r){return r instanceof Error}Ht.error=Zie;function Qie(r){return typeof r=="function"}Ht.func=Qie;function MM(r){return Array.isArray(r)}Ht.array=MM;function ere(r){return MM(r)&&r.every(e=>FM(e))}Ht.stringArray=ere;function tre(r,e){return Array.isArray(r)&&r.every(e)}Ht.typedArray=tre;function ire(r){return r!==null&&typeof r=="object"}Ht.objectLiteral=ire});var qM=x(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.ImplementationRequest=void 0;var rre=ii(),nre;(function(r){r.method="textDocument/implementation",r.type=new rre.ProtocolRequestType(r.method)})(nre=pd.ImplementationRequest||(pd.ImplementationRequest={}))});var $M=x(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.TypeDefinitionRequest=void 0;var sre=ii(),ore;(function(r){r.method="textDocument/typeDefinition",r.type=new sre.ProtocolRequestType(r.method)})(ore=md.TypeDefinitionRequest||(md.TypeDefinitionRequest={}))});var jM=x(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.DidChangeWorkspaceFoldersNotification=wo.WorkspaceFoldersRequest=void 0;var BM=ii(),are;(function(r){r.type=new BM.ProtocolRequestType0("workspace/workspaceFolders")})(are=wo.WorkspaceFoldersRequest||(wo.WorkspaceFoldersRequest={}));var lre;(function(r){r.type=new BM.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})(lre=wo.DidChangeWorkspaceFoldersNotification||(wo.DidChangeWorkspaceFoldersNotification={}))});var UM=x(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.ConfigurationRequest=void 0;var cre=ii(),ure;(function(r){r.type=new cre.ProtocolRequestType("workspace/configuration")})(ure=gd.ConfigurationRequest||(gd.ConfigurationRequest={}))});var WM=x(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.ColorPresentationRequest=xo.DocumentColorRequest=void 0;var HM=ii(),fre;(function(r){r.method="textDocument/documentColor",r.type=new HM.ProtocolRequestType(r.method)})(fre=xo.DocumentColorRequest||(xo.DocumentColorRequest={}));var dre;(function(r){r.type=new HM.ProtocolRequestType("textDocument/colorPresentation")})(dre=xo.ColorPresentationRequest||(xo.ColorPresentationRequest={}))});var zM=x(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.FoldingRangeRequest=So.FoldingRangeKind=void 0;var hre=ii(),pre;(function(r){r.Comment="comment",r.Imports="imports",r.Region="region"})(pre=So.FoldingRangeKind||(So.FoldingRangeKind={}));var mre;(function(r){r.method="textDocument/foldingRange",r.type=new hre.ProtocolRequestType(r.method)})(mre=So.FoldingRangeRequest||(So.FoldingRangeRequest={}))});var VM=x(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.DeclarationRequest=void 0;var gre=ii(),vre;(function(r){r.method="textDocument/declaration",r.type=new gre.ProtocolRequestType(r.method)})(vre=vd.DeclarationRequest||(vd.DeclarationRequest={}))});var GM=x(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.SelectionRangeRequest=void 0;var bre=ii(),yre;(function(r){r.method="textDocument/selectionRange",r.type=new bre.ProtocolRequestType(r.method)})(yre=bd.SelectionRangeRequest||(bd.SelectionRangeRequest={}))});var JM=x(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.WorkDoneProgressCancelNotification=bn.WorkDoneProgressCreateRequest=bn.WorkDoneProgress=void 0;var wre=yc(),KM=ii(),xre;(function(r){r.type=new wre.ProgressType;function e(t){return t===r.type}r.is=e})(xre=bn.WorkDoneProgress||(bn.WorkDoneProgress={}));var Sre;(function(r){r.type=new KM.ProtocolRequestType("window/workDoneProgress/create")})(Sre=bn.WorkDoneProgressCreateRequest||(bn.WorkDoneProgressCreateRequest={}));var Cre;(function(r){r.type=new KM.ProtocolNotificationType("window/workDoneProgress/cancel")})(Cre=bn.WorkDoneProgressCancelNotification||(bn.WorkDoneProgressCancelNotification={}))});var YM=x(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.CallHierarchyOutgoingCallsRequest=yn.CallHierarchyIncomingCallsRequest=yn.CallHierarchyPrepareRequest=void 0;var NC=ii(),_re;(function(r){r.method="textDocument/prepareCallHierarchy",r.type=new NC.ProtocolRequestType(r.method)})(_re=yn.CallHierarchyPrepareRequest||(yn.CallHierarchyPrepareRequest={}));var Ere;(function(r){r.method="callHierarchy/incomingCalls",r.type=new NC.ProtocolRequestType(r.method)})(Ere=yn.CallHierarchyIncomingCallsRequest||(yn.CallHierarchyIncomingCallsRequest={}));var Tre;(function(r){r.method="callHierarchy/outgoingCalls",r.type=new NC.ProtocolRequestType(r.method)})(Tre=yn.CallHierarchyOutgoingCallsRequest||(yn.CallHierarchyOutgoingCallsRequest={}))});var XM=x(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.SemanticTokensRefreshRequest=Ze.SemanticTokensRangeRequest=Ze.SemanticTokensDeltaRequest=Ze.SemanticTokensRequest=Ze.SemanticTokensRegistrationType=Ze.TokenFormat=Ze.SemanticTokens=Ze.SemanticTokenModifiers=Ze.SemanticTokenTypes=void 0;var yd=ii(),Dre;(function(r){r.namespace="namespace",r.type="type",r.class="class",r.enum="enum",r.interface="interface",r.struct="struct",r.typeParameter="typeParameter",r.parameter="parameter",r.variable="variable",r.property="property",r.enumMember="enumMember",r.event="event",r.function="function",r.method="method",r.macro="macro",r.keyword="keyword",r.modifier="modifier",r.comment="comment",r.string="string",r.number="number",r.regexp="regexp",r.operator="operator"})(Dre=Ze.SemanticTokenTypes||(Ze.SemanticTokenTypes={}));var Rre;(function(r){r.declaration="declaration",r.definition="definition",r.readonly="readonly",r.static="static",r.deprecated="deprecated",r.abstract="abstract",r.async="async",r.modification="modification",r.documentation="documentation",r.defaultLibrary="defaultLibrary"})(Rre=Ze.SemanticTokenModifiers||(Ze.SemanticTokenModifiers={}));var Pre;(function(r){function e(t){let i=t;return i!==void 0&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}r.is=e})(Pre=Ze.SemanticTokens||(Ze.SemanticTokens={}));var kre;(function(r){r.Relative="relative"})(kre=Ze.TokenFormat||(Ze.TokenFormat={}));var Ire;(function(r){r.method="textDocument/semanticTokens",r.type=new yd.RegistrationType(r.method)})(Ire=Ze.SemanticTokensRegistrationType||(Ze.SemanticTokensRegistrationType={}));var Ore;(function(r){r.method="textDocument/semanticTokens/full",r.type=new yd.ProtocolRequestType(r.method)})(Ore=Ze.SemanticTokensRequest||(Ze.SemanticTokensRequest={}));var Lre;(function(r){r.method="textDocument/semanticTokens/full/delta",r.type=new yd.ProtocolRequestType(r.method)})(Lre=Ze.SemanticTokensDeltaRequest||(Ze.SemanticTokensDeltaRequest={}));var Are;(function(r){r.method="textDocument/semanticTokens/range",r.type=new yd.ProtocolRequestType(r.method)})(Are=Ze.SemanticTokensRangeRequest||(Ze.SemanticTokensRangeRequest={}));var Fre;(function(r){r.method="workspace/semanticTokens/refresh",r.type=new yd.ProtocolRequestType0(r.method)})(Fre=Ze.SemanticTokensRefreshRequest||(Ze.SemanticTokensRefreshRequest={}))});var ZM=x(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.ShowDocumentRequest=void 0;var Mre=ii(),Nre;(function(r){r.method="window/showDocument",r.type=new Mre.ProtocolRequestType(r.method)})(Nre=wd.ShowDocumentRequest||(wd.ShowDocumentRequest={}))});var QM=x(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.LinkedEditingRangeRequest=void 0;var qre=ii(),$re;(function(r){r.method="textDocument/linkedEditingRange",r.type=new qre.ProtocolRequestType(r.method)})($re=xd.LinkedEditingRangeRequest||(xd.LinkedEditingRangeRequest={}))});var eN=x(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.WillDeleteFilesRequest=Ct.DidDeleteFilesNotification=Ct.DidRenameFilesNotification=Ct.WillRenameFilesRequest=Ct.DidCreateFilesNotification=Ct.WillCreateFilesRequest=Ct.FileOperationPatternKind=void 0;var Tc=ii(),Bre;(function(r){r.file="file",r.folder="folder"})(Bre=Ct.FileOperationPatternKind||(Ct.FileOperationPatternKind={}));var jre;(function(r){r.method="workspace/willCreateFiles",r.type=new Tc.ProtocolRequestType(r.method)})(jre=Ct.WillCreateFilesRequest||(Ct.WillCreateFilesRequest={}));var Ure;(function(r){r.method="workspace/didCreateFiles",r.type=new Tc.ProtocolNotificationType(r.method)})(Ure=Ct.DidCreateFilesNotification||(Ct.DidCreateFilesNotification={}));var Hre;(function(r){r.method="workspace/willRenameFiles",r.type=new Tc.ProtocolRequestType(r.method)})(Hre=Ct.WillRenameFilesRequest||(Ct.WillRenameFilesRequest={}));var Wre;(function(r){r.method="workspace/didRenameFiles",r.type=new Tc.ProtocolNotificationType(r.method)})(Wre=Ct.DidRenameFilesNotification||(Ct.DidRenameFilesNotification={}));var zre;(function(r){r.method="workspace/didDeleteFiles",r.type=new Tc.ProtocolNotificationType(r.method)})(zre=Ct.DidDeleteFilesNotification||(Ct.DidDeleteFilesNotification={}));var Vre;(function(r){r.method="workspace/willDeleteFiles",r.type=new Tc.ProtocolRequestType(r.method)})(Vre=Ct.WillDeleteFilesRequest||(Ct.WillDeleteFilesRequest={}))});var tN=x(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.MonikerRequest=wn.MonikerKind=wn.UniquenessLevel=void 0;var Gre=ii(),Kre;(function(r){r.document="document",r.project="project",r.group="group",r.scheme="scheme",r.global="global"})(Kre=wn.UniquenessLevel||(wn.UniquenessLevel={}));var Jre;(function(r){r.import="import",r.export="export",r.local="local"})(Jre=wn.MonikerKind||(wn.MonikerKind={}));var Yre;(function(r){r.method="textDocument/moniker",r.type=new Gre.ProtocolRequestType(r.method)})(Yre=wn.MonikerRequest||(wn.MonikerRequest={}))});var oN=x(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.DocumentLinkRequest=T.CodeLensRefreshRequest=T.CodeLensResolveRequest=T.CodeLensRequest=T.WorkspaceSymbolRequest=T.CodeActionResolveRequest=T.CodeActionRequest=T.DocumentSymbolRequest=T.DocumentHighlightRequest=T.ReferencesRequest=T.DefinitionRequest=T.SignatureHelpRequest=T.SignatureHelpTriggerKind=T.HoverRequest=T.CompletionResolveRequest=T.CompletionRequest=T.CompletionTriggerKind=T.PublishDiagnosticsNotification=T.WatchKind=T.FileChangeType=T.DidChangeWatchedFilesNotification=T.WillSaveTextDocumentWaitUntilRequest=T.WillSaveTextDocumentNotification=T.TextDocumentSaveReason=T.DidSaveTextDocumentNotification=T.DidCloseTextDocumentNotification=T.DidChangeTextDocumentNotification=T.TextDocumentContentChangeEvent=T.DidOpenTextDocumentNotification=T.TextDocumentSyncKind=T.TelemetryEventNotification=T.LogMessageNotification=T.ShowMessageRequest=T.ShowMessageNotification=T.MessageType=T.DidChangeConfigurationNotification=T.ExitNotification=T.ShutdownRequest=T.InitializedNotification=T.InitializeError=T.InitializeRequest=T.WorkDoneProgressOptions=T.TextDocumentRegistrationOptions=T.StaticRegistrationOptions=T.FailureHandlingKind=T.ResourceOperationKind=T.UnregistrationRequest=T.RegistrationRequest=T.DocumentSelector=T.DocumentFilter=void 0;T.MonikerRequest=T.MonikerKind=T.UniquenessLevel=T.WillDeleteFilesRequest=T.DidDeleteFilesNotification=T.WillRenameFilesRequest=T.DidRenameFilesNotification=T.WillCreateFilesRequest=T.DidCreateFilesNotification=T.FileOperationPatternKind=T.LinkedEditingRangeRequest=T.ShowDocumentRequest=T.SemanticTokensRegistrationType=T.SemanticTokensRefreshRequest=T.SemanticTokensRangeRequest=T.SemanticTokensDeltaRequest=T.SemanticTokensRequest=T.TokenFormat=T.SemanticTokens=T.SemanticTokenModifiers=T.SemanticTokenTypes=T.CallHierarchyPrepareRequest=T.CallHierarchyOutgoingCallsRequest=T.CallHierarchyIncomingCallsRequest=T.WorkDoneProgressCancelNotification=T.WorkDoneProgressCreateRequest=T.WorkDoneProgress=T.SelectionRangeRequest=T.DeclarationRequest=T.FoldingRangeRequest=T.ColorPresentationRequest=T.DocumentColorRequest=T.ConfigurationRequest=T.DidChangeWorkspaceFoldersNotification=T.WorkspaceFoldersRequest=T.TypeDefinitionRequest=T.ImplementationRequest=T.ApplyWorkspaceEditRequest=T.ExecuteCommandRequest=T.PrepareRenameRequest=T.RenameRequest=T.PrepareSupportDefaultBehavior=T.DocumentOnTypeFormattingRequest=T.DocumentRangeFormattingRequest=T.DocumentFormattingRequest=T.DocumentLinkResolveRequest=void 0;var Co=NM(),ve=ii(),Xre=qM();Object.defineProperty(T,"ImplementationRequest",{enumerable:!0,get:function(){return Xre.ImplementationRequest}});var Zre=$M();Object.defineProperty(T,"TypeDefinitionRequest",{enumerable:!0,get:function(){return Zre.TypeDefinitionRequest}});var iN=jM();Object.defineProperty(T,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return iN.WorkspaceFoldersRequest}});Object.defineProperty(T,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return iN.DidChangeWorkspaceFoldersNotification}});var Qre=UM();Object.defineProperty(T,"ConfigurationRequest",{enumerable:!0,get:function(){return Qre.ConfigurationRequest}});var rN=WM();Object.defineProperty(T,"DocumentColorRequest",{enumerable:!0,get:function(){return rN.DocumentColorRequest}});Object.defineProperty(T,"ColorPresentationRequest",{enumerable:!0,get:function(){return rN.ColorPresentationRequest}});var ene=zM();Object.defineProperty(T,"FoldingRangeRequest",{enumerable:!0,get:function(){return ene.FoldingRangeRequest}});var tne=VM();Object.defineProperty(T,"DeclarationRequest",{enumerable:!0,get:function(){return tne.DeclarationRequest}});var ine=GM();Object.defineProperty(T,"SelectionRangeRequest",{enumerable:!0,get:function(){return ine.SelectionRangeRequest}});var qC=JM();Object.defineProperty(T,"WorkDoneProgress",{enumerable:!0,get:function(){return qC.WorkDoneProgress}});Object.defineProperty(T,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return qC.WorkDoneProgressCreateRequest}});Object.defineProperty(T,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return qC.WorkDoneProgressCancelNotification}});var $C=YM();Object.defineProperty(T,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return $C.CallHierarchyIncomingCallsRequest}});Object.defineProperty(T,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return $C.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(T,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return $C.CallHierarchyPrepareRequest}});var ks=XM();Object.defineProperty(T,"SemanticTokenTypes",{enumerable:!0,get:function(){return ks.SemanticTokenTypes}});Object.defineProperty(T,"SemanticTokenModifiers",{enumerable:!0,get:function(){return ks.SemanticTokenModifiers}});Object.defineProperty(T,"SemanticTokens",{enumerable:!0,get:function(){return ks.SemanticTokens}});Object.defineProperty(T,"TokenFormat",{enumerable:!0,get:function(){return ks.TokenFormat}});Object.defineProperty(T,"SemanticTokensRequest",{enumerable:!0,get:function(){return ks.SemanticTokensRequest}});Object.defineProperty(T,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ks.SemanticTokensDeltaRequest}});Object.defineProperty(T,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ks.SemanticTokensRangeRequest}});Object.defineProperty(T,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ks.SemanticTokensRefreshRequest}});Object.defineProperty(T,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ks.SemanticTokensRegistrationType}});var rne=ZM();Object.defineProperty(T,"ShowDocumentRequest",{enumerable:!0,get:function(){return rne.ShowDocumentRequest}});var nne=QM();Object.defineProperty(T,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return nne.LinkedEditingRangeRequest}});var qa=eN();Object.defineProperty(T,"FileOperationPatternKind",{enumerable:!0,get:function(){return qa.FileOperationPatternKind}});Object.defineProperty(T,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qa.DidCreateFilesNotification}});Object.defineProperty(T,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qa.WillCreateFilesRequest}});Object.defineProperty(T,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qa.DidRenameFilesNotification}});Object.defineProperty(T,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qa.WillRenameFilesRequest}});Object.defineProperty(T,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qa.DidDeleteFilesNotification}});Object.defineProperty(T,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qa.WillDeleteFilesRequest}});var BC=tN();Object.defineProperty(T,"UniquenessLevel",{enumerable:!0,get:function(){return BC.UniquenessLevel}});Object.defineProperty(T,"MonikerKind",{enumerable:!0,get:function(){return BC.MonikerKind}});Object.defineProperty(T,"MonikerRequest",{enumerable:!0,get:function(){return BC.MonikerRequest}});var nN;(function(r){function e(t){let i=t;return Co.string(i.language)||Co.string(i.scheme)||Co.string(i.pattern)}r.is=e})(nN=T.DocumentFilter||(T.DocumentFilter={}));var sN;(function(r){function e(t){if(!Array.isArray(t))return!1;for(let i of t)if(!Co.string(i)&&!nN.is(i))return!1;return!0}r.is=e})(sN=T.DocumentSelector||(T.DocumentSelector={}));var sne;(function(r){r.type=new ve.ProtocolRequestType("client/registerCapability")})(sne=T.RegistrationRequest||(T.RegistrationRequest={}));var one;(function(r){r.type=new ve.ProtocolRequestType("client/unregisterCapability")})(one=T.UnregistrationRequest||(T.UnregistrationRequest={}));var ane;(function(r){r.Create="create",r.Rename="rename",r.Delete="delete"})(ane=T.ResourceOperationKind||(T.ResourceOperationKind={}));var lne;(function(r){r.Abort="abort",r.Transactional="transactional",r.TextOnlyTransactional="textOnlyTransactional",r.Undo="undo"})(lne=T.FailureHandlingKind||(T.FailureHandlingKind={}));var cne;(function(r){function e(t){let i=t;return i&&Co.string(i.id)&&i.id.length>0}r.hasId=e})(cne=T.StaticRegistrationOptions||(T.StaticRegistrationOptions={}));var une;(function(r){function e(t){let i=t;return i&&(i.documentSelector===null||sN.is(i.documentSelector))}r.is=e})(une=T.TextDocumentRegistrationOptions||(T.TextDocumentRegistrationOptions={}));var fne;(function(r){function e(i){let n=i;return Co.objectLiteral(n)&&(n.workDoneProgress===void 0||Co.boolean(n.workDoneProgress))}r.is=e;function t(i){let n=i;return n&&Co.boolean(n.workDoneProgress)}r.hasWorkDoneProgress=t})(fne=T.WorkDoneProgressOptions||(T.WorkDoneProgressOptions={}));var dne;(function(r){r.type=new ve.ProtocolRequestType("initialize")})(dne=T.InitializeRequest||(T.InitializeRequest={}));var hne;(function(r){r.unknownProtocolVersion=1})(hne=T.InitializeError||(T.InitializeError={}));var pne;(function(r){r.type=new ve.ProtocolNotificationType("initialized")})(pne=T.InitializedNotification||(T.InitializedNotification={}));var mne;(function(r){r.type=new ve.ProtocolRequestType0("shutdown")})(mne=T.ShutdownRequest||(T.ShutdownRequest={}));var gne;(function(r){r.type=new ve.ProtocolNotificationType0("exit")})(gne=T.ExitNotification||(T.ExitNotification={}));var vne;(function(r){r.type=new ve.ProtocolNotificationType("workspace/didChangeConfiguration")})(vne=T.DidChangeConfigurationNotification||(T.DidChangeConfigurationNotification={}));var bne;(function(r){r.Error=1,r.Warning=2,r.Info=3,r.Log=4})(bne=T.MessageType||(T.MessageType={}));var yne;(function(r){r.type=new ve.ProtocolNotificationType("window/showMessage")})(yne=T.ShowMessageNotification||(T.ShowMessageNotification={}));var wne;(function(r){r.type=new ve.ProtocolRequestType("window/showMessageRequest")})(wne=T.ShowMessageRequest||(T.ShowMessageRequest={}));var xne;(function(r){r.type=new ve.ProtocolNotificationType("window/logMessage")})(xne=T.LogMessageNotification||(T.LogMessageNotification={}));var Sne;(function(r){r.type=new ve.ProtocolNotificationType("telemetry/event")})(Sne=T.TelemetryEventNotification||(T.TelemetryEventNotification={}));var Cne;(function(r){r.None=0,r.Full=1,r.Incremental=2})(Cne=T.TextDocumentSyncKind||(T.TextDocumentSyncKind={}));var _ne;(function(r){r.method="textDocument/didOpen",r.type=new ve.ProtocolNotificationType(r.method)})(_ne=T.DidOpenTextDocumentNotification||(T.DidOpenTextDocumentNotification={}));var Ene;(function(r){function e(i){let n=i;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}r.isIncremental=e;function t(i){let n=i;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}r.isFull=t})(Ene=T.TextDocumentContentChangeEvent||(T.TextDocumentContentChangeEvent={}));var Tne;(function(r){r.method="textDocument/didChange",r.type=new ve.ProtocolNotificationType(r.method)})(Tne=T.DidChangeTextDocumentNotification||(T.DidChangeTextDocumentNotification={}));var Dne;(function(r){r.method="textDocument/didClose",r.type=new ve.ProtocolNotificationType(r.method)})(Dne=T.DidCloseTextDocumentNotification||(T.DidCloseTextDocumentNotification={}));var Rne;(function(r){r.method="textDocument/didSave",r.type=new ve.ProtocolNotificationType(r.method)})(Rne=T.DidSaveTextDocumentNotification||(T.DidSaveTextDocumentNotification={}));var Pne;(function(r){r.Manual=1,r.AfterDelay=2,r.FocusOut=3})(Pne=T.TextDocumentSaveReason||(T.TextDocumentSaveReason={}));var kne;(function(r){r.method="textDocument/willSave",r.type=new ve.ProtocolNotificationType(r.method)})(kne=T.WillSaveTextDocumentNotification||(T.WillSaveTextDocumentNotification={}));var Ine;(function(r){r.method="textDocument/willSaveWaitUntil",r.type=new ve.ProtocolRequestType(r.method)})(Ine=T.WillSaveTextDocumentWaitUntilRequest||(T.WillSaveTextDocumentWaitUntilRequest={}));var One;(function(r){r.type=new ve.ProtocolNotificationType("workspace/didChangeWatchedFiles")})(One=T.DidChangeWatchedFilesNotification||(T.DidChangeWatchedFilesNotification={}));var Lne;(function(r){r.Created=1,r.Changed=2,r.Deleted=3})(Lne=T.FileChangeType||(T.FileChangeType={}));var Ane;(function(r){r.Create=1,r.Change=2,r.Delete=4})(Ane=T.WatchKind||(T.WatchKind={}));var Fne;(function(r){r.type=new ve.ProtocolNotificationType("textDocument/publishDiagnostics")})(Fne=T.PublishDiagnosticsNotification||(T.PublishDiagnosticsNotification={}));var Mne;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.TriggerForIncompleteCompletions=3})(Mne=T.CompletionTriggerKind||(T.CompletionTriggerKind={}));var Nne;(function(r){r.method="textDocument/completion",r.type=new ve.ProtocolRequestType(r.method)})(Nne=T.CompletionRequest||(T.CompletionRequest={}));var qne;(function(r){r.method="completionItem/resolve",r.type=new ve.ProtocolRequestType(r.method)})(qne=T.CompletionResolveRequest||(T.CompletionResolveRequest={}));var $ne;(function(r){r.method="textDocument/hover",r.type=new ve.ProtocolRequestType(r.method)})($ne=T.HoverRequest||(T.HoverRequest={}));var Bne;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.ContentChange=3})(Bne=T.SignatureHelpTriggerKind||(T.SignatureHelpTriggerKind={}));var jne;(function(r){r.method="textDocument/signatureHelp",r.type=new ve.ProtocolRequestType(r.method)})(jne=T.SignatureHelpRequest||(T.SignatureHelpRequest={}));var Une;(function(r){r.method="textDocument/definition",r.type=new ve.ProtocolRequestType(r.method)})(Une=T.DefinitionRequest||(T.DefinitionRequest={}));var Hne;(function(r){r.method="textDocument/references",r.type=new ve.ProtocolRequestType(r.method)})(Hne=T.ReferencesRequest||(T.ReferencesRequest={}));var Wne;(function(r){r.method="textDocument/documentHighlight",r.type=new ve.ProtocolRequestType(r.method)})(Wne=T.DocumentHighlightRequest||(T.DocumentHighlightRequest={}));var zne;(function(r){r.method="textDocument/documentSymbol",r.type=new ve.ProtocolRequestType(r.method)})(zne=T.DocumentSymbolRequest||(T.DocumentSymbolRequest={}));var Vne;(function(r){r.method="textDocument/codeAction",r.type=new ve.ProtocolRequestType(r.method)})(Vne=T.CodeActionRequest||(T.CodeActionRequest={}));var Gne;(function(r){r.method="codeAction/resolve",r.type=new ve.ProtocolRequestType(r.method)})(Gne=T.CodeActionResolveRequest||(T.CodeActionResolveRequest={}));var Kne;(function(r){r.method="workspace/symbol",r.type=new ve.ProtocolRequestType(r.method)})(Kne=T.WorkspaceSymbolRequest||(T.WorkspaceSymbolRequest={}));var Jne;(function(r){r.method="textDocument/codeLens",r.type=new ve.ProtocolRequestType(r.method)})(Jne=T.CodeLensRequest||(T.CodeLensRequest={}));var Yne;(function(r){r.method="codeLens/resolve",r.type=new ve.ProtocolRequestType(r.method)})(Yne=T.CodeLensResolveRequest||(T.CodeLensResolveRequest={}));var Xne;(function(r){r.method="workspace/codeLens/refresh",r.type=new ve.ProtocolRequestType0(r.method)})(Xne=T.CodeLensRefreshRequest||(T.CodeLensRefreshRequest={}));var Zne;(function(r){r.method="textDocument/documentLink",r.type=new ve.ProtocolRequestType(r.method)})(Zne=T.DocumentLinkRequest||(T.DocumentLinkRequest={}));var Qne;(function(r){r.method="documentLink/resolve",r.type=new ve.ProtocolRequestType(r.method)})(Qne=T.DocumentLinkResolveRequest||(T.DocumentLinkResolveRequest={}));var ese;(function(r){r.method="textDocument/formatting",r.type=new ve.ProtocolRequestType(r.method)})(ese=T.DocumentFormattingRequest||(T.DocumentFormattingRequest={}));var tse;(function(r){r.method="textDocument/rangeFormatting",r.type=new ve.ProtocolRequestType(r.method)})(tse=T.DocumentRangeFormattingRequest||(T.DocumentRangeFormattingRequest={}));var ise;(function(r){r.method="textDocument/onTypeFormatting",r.type=new ve.ProtocolRequestType(r.method)})(ise=T.DocumentOnTypeFormattingRequest||(T.DocumentOnTypeFormattingRequest={}));var rse;(function(r){r.Identifier=1})(rse=T.PrepareSupportDefaultBehavior||(T.PrepareSupportDefaultBehavior={}));var nse;(function(r){r.method="textDocument/rename",r.type=new ve.ProtocolRequestType(r.method)})(nse=T.RenameRequest||(T.RenameRequest={}));var sse;(function(r){r.method="textDocument/prepareRename",r.type=new ve.ProtocolRequestType(r.method)})(sse=T.PrepareRenameRequest||(T.PrepareRenameRequest={}));var ose;(function(r){r.type=new ve.ProtocolRequestType("workspace/executeCommand")})(ose=T.ExecuteCommandRequest||(T.ExecuteCommandRequest={}));var ase;(function(r){r.type=new ve.ProtocolRequestType("workspace/applyEdit")})(ase=T.ApplyWorkspaceEditRequest||(T.ApplyWorkspaceEditRequest={}))});var lN=x(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.createProtocolConnection=void 0;var aN=yc();function lse(r,e,t,i){return aN.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),aN.createMessageConnection(r,e,t,i)}Gm.createProtocolConnection=lse});var cN=x(ji=>{"use strict";var cse=ji&&ji.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),Km=ji&&ji.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cse(e,r,t)};Object.defineProperty(ji,"__esModule",{value:!0});ji.LSPErrorCodes=ji.createProtocolConnection=void 0;Km(yc(),ji);Km((Ps(),PM),ji);Km(ii(),ji);Km(oN(),ji);var use=lN();Object.defineProperty(ji,"createProtocolConnection",{enumerable:!0,get:function(){return use.createProtocolConnection}});var fse;(function(r){r.lspReservedErrorRangeStart=-32899,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800})(fse=ji.LSPErrorCodes||(ji.LSPErrorCodes={}))});var H=x(zn=>{"use strict";var dse=zn&&zn.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),uN=zn&&zn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&dse(e,r,t)};Object.defineProperty(zn,"__esModule",{value:!0});zn.createProtocolConnection=void 0;var hse=eC();uN(eC(),zn);uN(cN(),zn);function pse(r,e,t,i){return hse.createMessageConnection(r,e,t,i)}zn.createProtocolConnection=pse});var Ui=x((rwe,fN)=>{function jC(r,e,t){var i,n,s,o,a;e==null&&(e=100);function l(){var u=Date.now()-o;u<e&&u>=0?i=setTimeout(l,e-u):(i=null,t||(a=r.apply(s,n),s=n=null))}var c=function(){s=this,n=arguments,o=Date.now();var u=t&&!i;return i||(i=setTimeout(l,e)),u&&(a=r.apply(s,n),s=n=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=r.apply(s,n),s=n=null,clearTimeout(i),i=null)},c}jC.debounce=jC;fN.exports=jC});var hN=x((nwe,dN)=>{"use strict";var It={rfc3986:{}};It.generate=function(){var r="|",e="0-9",t="["+e+"]",i="a-zA-Z",n="["+i+"]";It.rfc3986.cidr=t+r+"[1-2]"+t+r+"3[0-2]";var s=e+"A-Fa-f",o="["+s+"]",a=i+e+"-\\._~",l="!\\$&'\\(\\)\\*\\+,;=",c="%"+s,u=a+c+l+":@",f="["+u+"]",d="0?",h="(?:"+d+d+t+r+d+"[1-9]"+t+r+"1"+t+t+r+"2[0-4]"+t+r+"25[0-5])";It.rfc3986.IPv4address="(?:"+h+"\\.){3}"+h;var p=o+"{1,4}",g="(?:"+p+":"+p+"|"+It.rfc3986.IPv4address+")",b="(?:"+p+":){6}"+g,y="::(?:"+p+":){5}"+g,S="(?:"+p+")?::(?:"+p+":){4}"+g,w="(?:(?:"+p+":){0,1}"+p+")?::(?:"+p+":){3}"+g,_="(?:(?:"+p+":){0,2}"+p+")?::(?:"+p+":){2}"+g,L="(?:(?:"+p+":){0,3}"+p+")?::"+p+":"+g,$="(?:(?:"+p+":){0,4}"+p+")?::"+g,I="(?:(?:"+p+":){0,5}"+p+")?::"+p,W="(?:(?:"+p+":){0,6}"+p+")?::";It.rfc3986.IPv6address="(?:"+b+r+y+r+S+r+w+r+_+r+L+r+$+r+I+r+W+")",It.rfc3986.IPvFuture="v"+o+"+\\.["+a+l+":]+",It.rfc3986.scheme=n+"["+i+e+"+-\\.]*";var A="["+a+c+l+":]*";It.rfc3986.IPLiteral="\\[(?:"+It.rfc3986.IPv6address+r+It.rfc3986.IPvFuture+")\\]";var M="["+a+c+l+"]{0,255}",k="(?:"+It.rfc3986.IPLiteral+r+It.rfc3986.IPv4address+r+M+")",F=t+"*",j="(?:"+A+"@)?"+k+"(?::"+F+")?",X=f+"*",ae=f+"+",Pe="(?:\\/"+X+")*",ke="\\/(?:"+ae+Pe+")?",Qe=ae+Pe;It.rfc3986.hierPart="(?:(?:\\/\\/"+j+Pe+")"+r+ke+r+Qe+")",It.rfc3986.query="["+u+"\\/\\?]*(?=#|$)",It.rfc3986.fragment="["+u+"\\/\\?]*",It.rfc3986.uri="^(?:"+It.rfc3986.scheme+":"+It.rfc3986.hierPart+")(?:\\?"+It.rfc3986.query+")?(?:#"+It.rfc3986.fragment+")?$"};It.generate();dN.exports=It.rfc3986});var UC=x((swe,pN)=>{"use strict";var Sd=hN();function mse(r){return r.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}var Cd={Uri:{createUriRegex:function(r){if(r=r||{},typeof r!="object"||Array.isArray(r))throw new Error("options must be an object");var e="";if(r.scheme){if(Array.isArray(r.scheme)||(r.scheme=[r.scheme]),r.scheme.length<=0)throw new Error("scheme must have at least 1 scheme specified");for(var t=0;t<r.scheme.length;++t){var i=r.scheme[t];if(!(i instanceof RegExp||typeof i=="string"))throw new Error("scheme must only contain Regular Expressions or Strings");if(e=e+(e?"|":""),i instanceof RegExp)e=e+i.source;else{if(!/[a-zA-Z][a-zA-Z0-9+-\.]*/.test(i))throw new Error("scheme at position "+t+" must be a valid scheme");e=e+mse(i)}}}var n="(?:"+(e||Sd.scheme)+")";return new RegExp("^(?:"+n+":"+Sd.hierPart+")(?:\\?"+Sd.query+")?(?:#"+Sd.fragment+")?$")},uriRegex:new RegExp(Sd.uri)}};Cd.Uri.isValid=function(r){return Cd.Uri.uriRegex.test(r)};pN.exports={createUriRegex:Cd.Uri.createUriRegex,uriRegex:Cd.Uri.uriRegex,isValid:Cd.Uri.isValid}});function wse(r,e){if(!r.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+r.authority+'", path: "'+r.path+'", query: "'+r.query+'", fragment: "'+r.fragment+'"}');if(r.scheme&&!vse.test(r.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(r.path){if(r.authority){if(!bse.test(r.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(yse.test(r.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function xse(r,e){return!r&&!e?"file":r}function Sse(r,e){switch(r){case"https":case"http":case"file":e?e[0]!==xn&&(e=xn+e):e=xn;break}return e}function bN(r,e){for(var t=void 0,i=-1,n=0;n<r.length;n++){var s=r.charCodeAt(n);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47)i!==-1&&(t+=encodeURIComponent(r.substring(i,n)),i=-1),t!==void 0&&(t+=r.charAt(n));else{t===void 0&&(t=r.substr(0,n));var o=vN[s];o!==void 0?(i!==-1&&(t+=encodeURIComponent(r.substring(i,n)),i=-1),t+=o):i===-1&&(i=n)}}return i!==-1&&(t+=encodeURIComponent(r.substring(i))),t!==void 0?t:r}function _se(r){for(var e=void 0,t=0;t<r.length;t++){var i=r.charCodeAt(t);i===35||i===63?(e===void 0&&(e=r.substr(0,t)),e+=vN[i]):e!==void 0&&(e+=r[t])}return e!==void 0?e:r}function yN(r,e){var t;return r.authority&&r.path.length>1&&r.scheme==="file"?t="//"+r.authority+r.path:r.path.charCodeAt(0)===47&&(r.path.charCodeAt(1)>=65&&r.path.charCodeAt(1)<=90||r.path.charCodeAt(1)>=97&&r.path.charCodeAt(1)<=122)&&r.path.charCodeAt(2)===58?e?t=r.path.substr(1):t=r.path[1].toLowerCase()+r.path.substr(2):t=r.path,_d&&(t=t.replace(/\//g,"\\")),t}function HC(r,e){var t=e?_se:bN,i="",n=r.scheme,s=r.authority,o=r.path,a=r.query,l=r.fragment;if(n&&(i+=n,i+=":"),(s||n==="file")&&(i+=xn,i+=xn),s){var c=s.indexOf("@");if(c!==-1){var u=s.substr(0,c);s=s.substr(c+1),c=u.indexOf(":"),c===-1?i+=t(u,!1):(i+=t(u.substr(0,c),!1),i+=":",i+=t(u.substr(c+1),!1)),i+="@"}s=s.toLowerCase(),c=s.indexOf(":"),c===-1?i+=t(s,!1):(i+=t(s.substr(0,c),!1),i+=s.substr(c))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){var f=o.charCodeAt(1);f>=65&&f<=90&&(o="/"+String.fromCharCode(f+32)+":"+o.substr(3))}else if(o.length>=2&&o.charCodeAt(1)===58){var f=o.charCodeAt(0);f>=65&&f<=90&&(o=String.fromCharCode(f+32)+":"+o.substr(2))}i+=t(o,!0)}return a&&(i+="?",i+=t(a,!1)),l&&(i+="#",i+=e?l:bN(l,!1)),i}function wN(r){try{return decodeURIComponent(r)}catch(e){return r.length>3?r.substr(0,3)+wN(r.substr(3)):r}}function Jm(r){return r.match(xN)?r.replace(xN,function(e){return wN(e)}):r}var gse,At,_d,mN,vse,bse,yse,nt,xn,Cse,B,gN,Dc,vN,xN,qe=R(()=>{"use strict";gse=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s])},r(e,t)};return function(e,t){r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();typeof process=="object"?_d=process.platform==="win32":typeof navigator=="object"&&(mN=navigator.userAgent,_d=mN.indexOf("Windows")>=0);vse=/^\w[\w\d+.-]*$/,bse=/^\//,yse=/^\/\//;nt="",xn="/",Cse=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,B=function(){function r(e,t,i,n,s,o){o===void 0&&(o=!1),typeof e=="object"?(this.scheme=e.scheme||nt,this.authority=e.authority||nt,this.path=e.path||nt,this.query=e.query||nt,this.fragment=e.fragment||nt):(this.scheme=xse(e,o),this.authority=t||nt,this.path=Sse(this.scheme,i||nt),this.query=n||nt,this.fragment=s||nt,wse(this,o))}return r.isUri=function(e){return e instanceof r?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="function"&&typeof e.with=="function"&&typeof e.toString=="function":!1},Object.defineProperty(r.prototype,"fsPath",{get:function(){return yN(this,!1)},enumerable:!0,configurable:!0}),r.prototype.with=function(e){if(!e)return this;var t=e.scheme,i=e.authority,n=e.path,s=e.query,o=e.fragment;return t===void 0?t=this.scheme:t===null&&(t=nt),i===void 0?i=this.authority:i===null&&(i=nt),n===void 0?n=this.path:n===null&&(n=nt),s===void 0?s=this.query:s===null&&(s=nt),o===void 0?o=this.fragment:o===null&&(o=nt),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&o===this.fragment?this:new Dc(t,i,n,s,o)},r.parse=function(e,t){t===void 0&&(t=!1);var i=Cse.exec(e);return i?new Dc(i[2]||nt,Jm(i[4]||nt),Jm(i[5]||nt),Jm(i[7]||nt),Jm(i[9]||nt),t):new Dc(nt,nt,nt,nt,nt)},r.file=function(e){var t=nt;if(_d&&(e=e.replace(/\\/g,xn)),e[0]===xn&&e[1]===xn){var i=e.indexOf(xn,2);i===-1?(t=e.substring(2),e=xn):(t=e.substring(2,i),e=e.substring(i)||xn)}return new Dc("file",t,e,nt,nt)},r.from=function(e){return new Dc(e.scheme,e.authority,e.path,e.query,e.fragment)},r.prototype.toString=function(e){return e===void 0&&(e=!1),HC(this,e)},r.prototype.toJSON=function(){return this},r.revive=function(e){if(e){if(e instanceof r)return e;var t=new Dc(e);return t._formatted=e.external,t._fsPath=e._sep===gN?e.fsPath:null,t}else return e},r}(),gN=_d?1:void 0,Dc=function(r){gse(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return Object.defineProperty(e.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=yN(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.toString=function(t){return t===void 0&&(t=!1),t?HC(this,!0):(this._formatted||(this._formatted=HC(this,!1)),this._formatted)},e.prototype.toJSON=function(){var t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=gN),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t},e}(B),vN=(At={},At[58]="%3A",At[47]="%2F",At[63]="%3F",At[35]="%23",At[91]="%5B",At[93]="%5D",At[64]="%40",At[33]="%21",At[36]="%24",At[38]="%26",At[39]="%27",At[40]="%28",At[41]="%29",At[42]="%2A",At[43]="%2B",At[44]="%2C",At[59]="%3B",At[61]="%3D",At[32]="%20",At);xN=/(%[0-9A-Za-z][0-9A-Za-z])+/g});var TN=x((awe,EN)=>{EN.exports=_N;_N.sync=Tse;var SN=require("fs");function Ese(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i<t.length;i++){var n=t[i].toLowerCase();if(n&&r.substr(-n.length).toLowerCase()===n)return!0}return!1}function CN(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:Ese(e,t)}function _N(r,e,t){SN.stat(r,function(i,n){t(i,i?!1:CN(n,r,e))})}function Tse(r,e){return CN(SN.statSync(r),r,e)}});var IN=x((lwe,kN)=>{kN.exports=RN;RN.sync=Dse;var DN=require("fs");function RN(r,e,t){DN.stat(r,function(i,n){t(i,i?!1:PN(n,e))})}function Dse(r,e){return PN(DN.statSync(r),e)}function PN(r,e){return r.isFile()&&Rse(r,e)}function Rse(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,f=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return f}});var LN=x((uwe,ON)=>{var cwe=require("fs"),Ym;process.platform==="win32"||global.TESTING_WINDOWS?Ym=TN():Ym=IN();ON.exports=WC;WC.sync=Pse;function WC(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){WC(r,e||{},function(s,o){s?n(s):i(o)})})}Ym(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function Pse(r,e){try{return Ym.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Ed=x((fwe,$N)=>{var Rc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",AN=require("path"),kse=Rc?";":":",FN=LN(),MN=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),NN=(r,e)=>{let t=e.colon||kse,i=r.match(/\//)||Rc&&r.match(/\\/)?[""]:[...Rc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=Rc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Rc?n.split(t):[""];return Rc&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},qN=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=NN(r,e),o=[],a=c=>new Promise((u,f)=>{if(c===i.length)return e.all&&o.length?u(o):f(MN(r));let d=i[c],h=/^".*"$/.test(d)?d.slice(1,-1):d,p=AN.join(h,r),g=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(g,c,0))}),l=(c,u,f)=>new Promise((d,h)=>{if(f===n.length)return d(a(u+1));let p=n[f];FN(c+p,{pathExt:s},(g,b)=>{if(!g&&b)if(e.all)o.push(c+p);else return d(c+p);return d(l(c,u,f+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},Ise=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=NN(r,e),s=[];for(let o=0;o<t.length;o++){let a=t[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=AN.join(l,r),u=!l&&/^\.[\\\/]/.test(r)?r.slice(0,2)+c:c;for(let f=0;f<i.length;f++){let d=u+i[f];try{if(FN.sync(d,{pathExt:n}))if(e.all)s.push(d);else return d}catch(h){}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw MN(r)};$N.exports=qN;qN.sync=Ise});var kc={};Bn(kc,{OS:()=>Bse,OperatingSystem:()=>Pc,Platform:()=>$a,globals:()=>$se,isLinux:()=>Ase,isMacintosh:()=>GC,isNative:()=>Fse,isWeb:()=>Mse,isWindows:()=>Ba,language:()=>Lse,platform:()=>Nse});var Xm,Zm,zC,VC,Ose,Lse,$a,Qm,Ba,GC,Ase,Fse,Mse,Nse,qse,$se,Pc,Bse,eg=R(()=>{Xm=!1,Zm=!1,zC=!1,VC=!1,Ose=!1,Lse="en";typeof process=="object"&&typeof process.nextTick=="function"&&typeof process.platform=="string"&&(Xm=process.platform==="win32",Zm=process.platform==="darwin",zC=process.platform==="linux",VC=!0);(function(n){n[n.Web=0]="Web",n[n.Mac=1]="Mac",n[n.Linux=2]="Linux",n[n.Windows=3]="Windows"})($a||($a={}));Qm=0;VC&&(Zm?Qm=1:Xm?Qm=3:zC&&(Qm=2));Ba=Xm,GC=Zm,Ase=zC,Fse=VC,Mse=Ose,Nse=Qm,qse=typeof self=="object"?self:typeof global=="object"?global:{},$se=qse;(function(i){i[i.Windows=1]="Windows",i[i.Macintosh=2]="Macintosh",i[i.Linux=3]="Linux"})(Pc||(Pc={}));Bse=Zm?2:Xm?1:3});function Td(r){return!!(ja.MarkupContent.is(r)&&r.kind==ja.MarkupKind.Markdown)}function bt(r){return new Promise(e=>{setTimeout(()=>{e(void 0)},r)})}function zN(r){return new Promise(e=>{process.nextTick(()=>{r(),e(void 0)})})}function tg(r,e,t,i){return r?(Ba&&!i&&!r.startsWith("jdt://")&&(r=KC.default.win32.normalize(r)),KC.default.isAbsolute(r)?B.file(r).toString():HN.default.isValid(r)?B.parse(r).toString():t!=""?`${t}:${e}`:`unknown:${e}`):`untitled:${e}`}function G(r){for(;r.length;){let e=r.pop();e&&e.dispose()}}function Dd(r){try{WN.default.sync(r)}catch(e){return!1}return!0}function Vn(r,e={},t){return Ba||(e.shell=e.shell||process.env.SHELL),e.maxBuffer=500*1024,new Promise((i,n)=>{let s;t&&(s=setTimeout(()=>{n(new Error(`timeout after ${t}s`))},t*1e3)),(0,BN.exec)(r,e,(o,a,l)=>{if(s&&clearTimeout(s),o){n(new Error(`exited with ${o.code}
${o}
${l}`));return}i(a)})})}function Ic(r,e){let t=(0,jN.default)(e,100);try{let i=UN.default.watch(r,{persistent:!0,recursive:!1,encoding:"utf8"},()=>{t()});return ja.Disposable.create(()=>{t.clear(),i.close()})}catch(i){return ja.Disposable.create(()=>{t.clear()})}}function VN(r){try{return process.kill(r,0)==!0}catch(e){return e.code==="EPERM"}}function JC(r){return r=="n"||r=="o"||r=="x"||r=="v"?"<C-U>":r=="i"?"<C-o>":r=="s"?"<Esc>":""}function Rd(r,e,t=3){if(r.length==0)return Promise.resolve();let i=0,n=r.length,s=r.slice();return new Promise(o=>{let a=l=>{let c=()=>{if(i=i+1,i==n)o();else if(s.length){let u=s.shift();a(u)}};e(l).then(c,c)};for(let l=0;l<Math.min(t,s.length);l++){let c=s.shift();a(c)}})}var BN,jN,UN,HN,KC,ja,WN,pwe,Is,de=R(()=>{BN=E(require("child_process")),jN=E(Ui()),UN=E(require("fs")),HN=E(UC()),KC=E(require("path")),ja=E(H());qe();WN=E(Ed());eg();pwe=U()("util-index"),Is="coc-settings.json"});function ig(r){return r&&typeof r.word=="string"}function Os(r){return typeof r=="boolean"}function Me(r){return typeof r=="string"}function rg(r){return typeof r=="number"}function _o(r){return typeof r=="function"}function Wt(r){return r!=null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function ng(r){if(!Wt(r))return!1;for(let e in r)if(jse.call(r,e))return!1;return!0}var jse,Wr=R(()=>{jse=Object.prototype.hasOwnProperty});function GN(r){return r?Array.isArray(r)?r.length==0:Object.keys(r).length==0:!0}function Ls(r){if(!r||typeof r!="object"||r instanceof RegExp)return r;let e=Array.isArray(r)?[]:{};return Object.keys(r).forEach(t=>{r[t]&&typeof r[t]=="object"?e[t]=Ls(r[t]):e[t]=r[t]}),e}function KN(r){if(!r||typeof r!="object")return r;let e=[r];for(;e.length>0;){let t=e.shift();Object.freeze(t);for(let i in t)if(Use.call(t,i)){let n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&e.push(n)}}return r}function YC(r,e,t=!0){return Wt(r)?(Wt(e)&&Object.keys(e).forEach(i=>{i in r?t&&(Wt(r[i])&&Wt(e[i])?YC(r[i],e[i],t):r[i]=e[i]):r[i]=e[i]}),r):e}function je(r,e){if(r===e)return!0;if(r==null||e===null||e===void 0||typeof r!=typeof e||typeof r!="object"||Array.isArray(r)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(t=0;t<r.length;t++)if(!je(r[t],e[t]))return!1}else{let n=[];for(i in r)n.push(i);n.sort();let s=[];for(i in e)s.push(i);if(s.sort(),!je(n,s))return!1;for(t=0;t<n.length;t++)if(!je(r[n[t]],e[n[t]]))return!1}return!0}var Use,ri=R(()=>{Wr();Use=Object.prototype.hasOwnProperty});var XC,JN,YN,O,_e=R(()=>{XC=E(H());de();ri();JN=U()("events"),YN=class{constructor(){this.handlers=new Map;this._lastChange=0;this._insertMode=!1;this._pumAlignTop=!1}get cursor(){return this._cursor}get pumAlignTop(){return this._pumAlignTop}get insertMode(){return this._insertMode}get lastChangeTs(){return this._lastChange}async fire(e,t){let i=this.handlers.get(e);if(e=="InsertEnter"?this._insertMode=!0:e=="InsertLeave"?this._insertMode=!1:!this._insertMode&&(e=="CursorHoldI"||e=="CursorMovedI")?(this._insertMode=!0,this.fire("InsertEnter",[t[0]])):this._insertMode&&(e=="CursorHold"||e=="CursorMoved")&&(this._insertMode=!1,this.fire("InsertLeave",[t[0]]).logError()),e=="MenuPopupChanged"&&(this._pumAlignTop=t[1]>t[0].row),e=="InsertCharPre"&&(this._latestInsert={bufnr:t[1],character:t[0],timestamp:Date.now()}),e=="TextChanged"&&(this._lastChange=Date.now()),(e=="TextChangedI"||e=="TextChangedP")&&(this._lastChange=Date.now(),this._latestInsert)){let n=this._latestInsert;if(this._latestInsert=void 0,n.bufnr==t[0]&&Date.now()-n.timestamp<200&&t[1].pre.length){let s=t[1].pre.slice(-1);process.nextTick(()=>{this.fire("TextInsert",[...t,s])})}}if(e=="CursorMoved"||e=="CursorMovedI"){let n={bufnr:t[0],lnum:t[1][0],col:t[1][1],insert:e=="CursorMovedI"};if(this._cursor&&je(this._cursor,n))return;this._cursor=n}if(i)try{await Promise.all(i.map(n=>n(t)))}catch(n){if(n.message&&n.message.indexOf("transport disconnected")==-1)return;JN.error(`Error on event: ${e}`,n.stack)}}on(e,t,i,n){if(Array.isArray(e)){let s=n||[];for(let o of e)this.on(o,t,i,s);return XC.Disposable.create(()=>{G(s)})}else{let s=this.handlers.get(e)||[],o=Error().stack,a=c=>new Promise((u,f)=>{let d;try{Promise.resolve(t.apply(i||null,c)).then(()=>{d&&clearTimeout(d),u(void 0)},h=>{d&&clearTimeout(d),f(h)}),d=setTimeout(()=>{JN.warn(`Handler of ${e} blocked more than 2s:`,o)},2e3)}catch(h){f(h)}});s.push(a),this.handlers.set(e,s);let l=XC.Disposable.create(()=>{let c=s.indexOf(a);c!==-1&&s.splice(c,1)});return n&&n.push(l),l}}},O=new YN});var Oc=x((Swe,ZC)=>{function XN(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Hse(r){ZC.exports.defaults=r}ZC.exports={defaults:XN(),getDefaults:XN,changeDefaults:Hse}});var Ua=x((Cwe,iq)=>{var Wse=/[&<>"']/,zse=/[&<>"']/g,Vse=/[<>"']|&(?!#?\w+;)/,Gse=/[<>"']|&(?!#?\w+;)/g,Kse={"&":"&","<":"<",">":">",'"':""","'":"'"},ZN=r=>Kse[r];function Jse(r,e){if(e){if(Wse.test(r))return r.replace(zse,ZN)}else if(Vse.test(r))return r.replace(Gse,ZN);return r}var Yse=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function QN(r){return r.replace(Yse,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}var Xse=/(^|[^\[])\^/g;function Zse(r,e){r=r.source||r,e=e||"";let t={replace:(i,n)=>(n=n.source||n,n=n.replace(Xse,"$1"),r=r.replace(i,n),t),getRegex:()=>new RegExp(r,e)};return t}var Qse=/[^\w:]/g,eoe=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function toe(r,e,t){if(r){let i;try{i=decodeURIComponent(QN(t)).replace(Qse,"").toLowerCase()}catch(n){return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!eoe.test(t)&&(t=eq(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch(i){return null}return t}var sg={},ioe=/^[^:]+:\/*[^/]*$/,roe=/^([^:]+:)[\s\S]*$/,noe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function eq(r,e){sg[" "+r]||(ioe.test(r)?sg[" "+r]=r+"/":sg[" "+r]=tq(r,"/",!0)),r=sg[" "+r];let t=r.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:r.replace(roe,"$1")+e:e.charAt(0)==="/"?t?e:r.replace(noe,"$1")+e:r+e}var soe={exec:function(){}};function ooe(r){let e=1,t,i;for(;e<arguments.length;e++){t=arguments[e];for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r}function aoe(r,e){let t=r.replace(/\|/g,(s,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=t.split(/ \|/),n=0;if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function tq(r,e,t){let i=r.length;if(i===0)return"";let n=0;for(;n<i;){let s=r.charAt(i-n-1);if(s===e&&!t)n++;else if(s!==e&&t)n++;else break}return r.substr(0,i-n)}function loe(r,e){if(r.indexOf(e[1])===-1)return-1;let t=r.length,i=0,n=0;for(;n<t;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])i++;else if(r[n]===e[1]&&(i--,i<0))return n;return-1}function coe(r){r&&r.sanitize&&!r.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function uoe(r,e){if(e<1)return"";let t="";for(;e>1;)e&1&&(t+=r),e>>=1,r+=r;return t+r}iq.exports={escape:Jse,unescape:QN,edit:Zse,cleanUrl:toe,resolveUrl:eq,noopTest:soe,merge:ooe,splitCells:aoe,rtrim:tq,findClosingBracket:loe,checkSanitizeDeprecation:coe,repeatString:uoe}});var QC=x((Ewe,nq)=>{var{defaults:foe}=Oc(),{rtrim:og,splitCells:ag,escape:zr,findClosingBracket:doe}=Ua();function rq(r,e,t){let i=e.href,n=e.title?zr(e.title):null,s=r[1].replace(/\\([\[\]])/g,"$1");return r[0].charAt(0)!=="!"?{type:"link",raw:t,href:i,title:n,text:s}:{type:"image",raw:t,href:i,title:n,text:zr(s)}}function hoe(r,e){let t=r.match(/^(\s+)(?:```)/);if(t===null)return e;let i=t[1];return e.split(`
`).map(n=>{let s=n.match(/^\s+/);if(s===null)return n;let[o]=s;return o.length>=i.length?n.slice(i.length):n}).join(`
`)}nq.exports=class{constructor(e){this.options=e||foe}space(e){let t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:`
`}}code(e){let t=this.rules.block.code.exec(e);if(t){let i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:og(i,`
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],n=hoe(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){let n=og(i,"#");(this.options.pedantic||!n||/ $/.test(n))&&(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i}}}nptable(e){let t=this.rules.block.nptable.exec(e);if(t){let i={type:"table",header:ag(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split(`
`):[],raw:t[0]};if(i.header.length===i.align.length){let n=i.align.length,s;for(s=0;s<n;s++)/^ *-+: *$/.test(i.align[s])?i.align[s]="right":/^ *:-+: *$/.test(i.align[s])?i.align[s]="center":/^ *:-+ *$/.test(i.align[s])?i.align[s]="left":i.align[s]=null;for(n=i.cells.length,s=0;s<n;s++)i.cells[s]=ag(i.cells[s],i.header.length);return i}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[0],n=t[2],s=n.length>1,o={type:"list",raw:i,ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]},a=t[0].match(this.rules.block.item),l=!1,c,u,f,d,h,p,g,b,y,S=a.length;f=this.rules.block.listItemStart.exec(a[0]);for(let w=0;w<S;w++){if(c=a[w],i=c,this.options.pedantic||(y=c.match(new RegExp("\\n\\s*\\n {0,"+(f[0].length-1)+"}\\S")),y&&(h=c.length-y.index+a.slice(w+1).join(`
`).length,o.raw=o.raw.substring(0,o.raw.length-h),c=c.substring(0,y.index),i=c,S=w+1)),w!==S-1){if(d=this.rules.block.listItemStart.exec(a[w+1]),this.options.pedantic?d[1].length>f[1].length:d[1].length>=f[0].length||d[1].length>3){a.splice(w,2,a[w]+(!this.options.pedantic&&d[1].length<f[0].length&&!a[w].match(/\n$/)?"":`
`)+a[w+1]),w--,S--;continue}else(!this.options.pedantic||this.options.smartLists?d[2][d[2].length-1]!==n[n.length-1]:s===(d[2].length===1))&&(h=a.slice(w+1).join(`
`).length,o.raw=o.raw.substring(0,o.raw.length-h),w=S-1);f=d}u=c.length,c=c.replace(/^ *([*+-]|\d+[.)]) ?/,""),~c.indexOf(`
`)&&(u-=c.length,c=this.options.pedantic?c.replace(/^ {1,4}/gm,""):c.replace(new RegExp("^ {1,"+u+"}","gm"),"")),c=og(c,`
`),w!==S-1&&(i=i+`
`),p=l||/\n\n(?!\s*$)/.test(i),w!==S-1&&(l=i.slice(-2)===`
`,p||(p=l)),p&&(o.loose=!0),this.options.gfm&&(g=/^\[[ xX]\] /.test(c),b=void 0,g&&(b=c[1]!==" ",c=c.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:i,task:g,checked:b,loose:p,text:c})}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):zr(t[0]):t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));let i=t[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:i,raw:t[0],href:t[2],title:t[3]}}}table(e){let t=this.rules.block.table.exec(e);if(t){let i={type:"table",header:ag(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split(`
`):[]};if(i.header.length===i.align.length){i.raw=t[0];let n=i.align.length,s;for(s=0;s<n;s++)/^ *-+: *$/.test(i.align[s])?i.align[s]="right":/^ *:-+: *$/.test(i.align[s])?i.align[s]="center":/^ *:-+ *$/.test(i.align[s])?i.align[s]="left":i.align[s]=null;for(n=i.cells.length,s=0;s<n;s++)i.cells[s]=ag(i.cells[s].replace(/^ *\| *| *\| *$/g,""),i.header.length);return i}}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1]}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1]}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0]}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:zr(t[1])}}tag(e,t,i){let n=this.rules.inline.tag.exec(e);if(n)return!t&&/^<a /i.test(n[0])?t=!0:t&&/^<\/a>/i.test(n[0])&&(t=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:t,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):zr(n[0]):n[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;let o=og(i.slice(0,-1),"\\");if((i.length-o.length)%2==0)return}else{let o=doe(t[2],"()");if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(this.options.pedantic&&!/>$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),rq(t,{href:n&&n.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},t[0])}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let n=(i[2]||i[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n||!n.href){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return rq(i,n,i[0])}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;let s=n[1]||n[2]||"";if(!s||s&&(i===""||this.rules.inline.punctuation.exec(i))){let o=n[0].length-1,a,l,c=o,u=0,f=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(n=f.exec(t))!=null;)if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!!a){if(l=a.length,n[3]||n[4]){c+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){u+=l;continue}if(c-=l,!(c>0))return l=Math.min(l,l+c+u),Math.min(o,l)%2?{type:"em",raw:e.slice(0,o+n.index+l+1),text:e.slice(1,o+n.index+l)}:{type:"strong",raw:e.slice(0,o+n.index+l+1),text:e.slice(2,o+n.index+l-1)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=zr(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){let i=this.rules.inline.autolink.exec(e);if(i){let n,s;return i[2]==="@"?(n=zr(this.options.mangle?t(i[1]):i[1]),s="mailto:"+n):(n=zr(i[1]),s=n),{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let n,s;if(i[2]==="@")n=zr(this.options.mangle?t(i[0]):i[0]),s="mailto:"+n;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);n=zr(i[0]),i[1]==="www."?s="http://"+n:s=n}return{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,t,i){let n=this.rules.inline.text.exec(e);if(n){let s;return t?s=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):zr(n[0]):n[0]:s=zr(this.options.smartypants?i(n[0]):n[0]),{type:"text",raw:n[0],text:s}}}}});var oq=x((Twe,sq)=>{var{noopTest:Pd,edit:st,merge:Ha}=Ua(),he={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Pd,table:Pd,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;he.def=st(he.def).replace("label",he._label).replace("title",he._title).getRegex();he.bullet=/(?:[*+-]|\d{1,9}[.)])/;he.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;he.item=st(he.item,"gm").replace(/bull/g,he.bullet).getRegex();he.listItemStart=st(/^( *)(bull) */).replace("bull",he.bullet).getRegex();he.list=st(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex();he._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";he._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;he.html=st(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();he.paragraph=st(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.blockquote=st(he.blockquote).replace("paragraph",he.paragraph).getRegex();he.normal=Ha({},he);he.gfm=Ha({},he.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});he.gfm.nptable=st(he.gfm.nptable).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.gfm.table=st(he.gfm.table).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.pedantic=Ha({},he.normal,{html:st(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Pd,paragraph:st(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pd,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Pd,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};te._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";te.punctuation=st(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/\\\*|\\_/g;te._comment=st(he._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=st(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=st(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=st(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;te.autolink=st(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=st(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=st(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=st(te.reflink).replace("label",te._label).getRegex();te.reflinkSearch=st(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal=Ha({},te);te.pedantic=Ha({},te.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:st(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:st(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()});te.gfm=Ha({},te.normal,{escape:st(te.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/});te.gfm.url=st(te.gfm.url,"i").replace("email",te.gfm._extended_email).getRegex();te.breaks=Ha({},te.gfm,{br:st(te.br).replace("{2,}","*").getRegex(),text:st(te.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});sq.exports={block:he,inline:te}});var uq=x((Dwe,cq)=>{var poe=QC(),{defaults:moe}=Oc(),{block:lg,inline:kd}=oq(),{repeatString:aq}=Ua();function goe(r){return r.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function lq(r){let e="",t,i,n=r.length;for(t=0;t<n;t++)i=r.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}cq.exports=class e0{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||moe,this.options.tokenizer=this.options.tokenizer||new poe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;let t={block:lg.normal,inline:kd.normal};this.options.pedantic?(t.block=lg.pedantic,t.inline=kd.pedantic):this.options.gfm&&(t.block=lg.gfm,this.options.breaks?t.inline=kd.breaks:t.inline=kd.gfm),this.tokenizer.rules=t}static get rules(){return{block:lg,inline:kd}}static lex(e,t){return new e0(t).lex(e)}static lexInline(e,t){return new e0(t).inlineTokens(e)}lex(e){return e=e.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],i=!0){this.options.pedantic&&(e=e.replace(/^ +$/gm,""));let n,s,o,a,l,c;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(u=>(n=u.call(this,e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.type&&t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),a=t[t.length-1],a&&a.type==="paragraph"?(a.raw+=`
`+n.raw,a.text+=`
`+n.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.nptable(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],i),t.push(n);continue}if(n=this.tokenizer.list(e)){for(e=e.substring(n.raw.length),o=n.items.length,s=0;s<o;s++)n.items[s].tokens=this.blockTokens(n.items[s].text,[],!1);t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(i&&(n=this.tokenizer.def(e))){e=e.substring(n.raw.length),this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(l=e,this.options.extensions&&this.options.extensions.startBlock){let u=1/0,f=e.slice(1),d;this.options.extensions.startBlock.forEach(function(h){d=h.call(this,f),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(i&&(n=this.tokenizer.paragraph(l))){a=t[t.length-1],c&&a.type==="paragraph"?(a.raw+=`
`+n.raw,a.text+=`
`+n.text):t.push(n),c=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),a=t[t.length-1],a&&a.type==="text"?(a.raw+=`
`+n.raw,a.text+=`
`+n.text):t.push(n);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}inline(e){let t,i,n,s,o,a,l=e.length;for(t=0;t<l;t++)switch(a=e[t],a.type){case"paragraph":case"text":case"heading":{a.tokens=[],this.inlineTokens(a.text,a.tokens);break}case"table":{for(a.tokens={header:[],cells:[]},s=a.header.length,i=0;i<s;i++)a.tokens.header[i]=[],this.inlineTokens(a.header[i],a.tokens.header[i]);for(s=a.cells.length,i=0;i<s;i++)for(o=a.cells[i],a.tokens.cells[i]=[],n=0;n<o.length;n++)a.tokens.cells[i][n]=[],this.inlineTokens(o[n],a.tokens.cells[i][n]);break}case"blockquote":{this.inline(a.tokens);break}case"list":{for(s=a.items.length,i=0;i<s;i++)this.inline(a.items[i].tokens);break}default:}return e}inlineTokens(e,t=[],i=!1,n=!1){let s,o,a,l=e,c,u,f;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)d.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,c.index)+"["+aq("a",c[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,c.index)+"["+aq("a",c[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(c=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,c.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(u||(f=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(s=d.call(this,e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e,i,n)){e=e.substring(s.raw.length),i=s.inLink,n=s.inRawBlock,o=t[t.length-1],o&&s.type==="text"&&o.type==="text"?(o.raw+=s.raw,o.text+=s.text):t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),s.type==="link"&&(s.tokens=this.inlineTokens(s.text,[],!0,n)),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),o=t[t.length-1],s.type==="link"?(s.tokens=this.inlineTokens(s.text,[],!0,n),t.push(s)):o&&s.type==="text"&&o.type==="text"?(o.raw+=s.raw,o.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,l,f)){e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,n),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,n),t.push(s);continue}if(s=this.tokenizer.autolink(e,lq)){e=e.substring(s.raw.length),t.push(s);continue}if(!i&&(s=this.tokenizer.url(e,lq))){e=e.substring(s.raw.length),t.push(s);continue}if(a=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0,h=e.slice(1),p;this.options.extensions.startInline.forEach(function(g){p=g.call(this,h),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(a=e.substring(0,d+1))}if(s=this.tokenizer.inlineText(a,n,goe)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(f=s.raw.slice(-1)),u=!0,o=t[t.length-1],o&&o.type==="text"?(o.raw+=s.raw,o.text+=s.text):t.push(s);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}});var t0=x((Pwe,dq)=>{var{defaults:voe}=Oc(),{cleanUrl:fq,escape:cg}=Ua();dq.exports=class{constructor(e){this.options=e||voe}code(e,t,i){let n=(t||"").match(/\S*/)[0];if(this.options.highlight){let s=this.options.highlight(e,n);s!=null&&s!==e&&(i=!0,e=s)}return e=e.replace(/\n$/,"")+`
`,n?'<pre><code class="'+this.options.langPrefix+cg(n,!0)+'">'+(i?e:cg(e,!0))+`</code></pre>
`:"<pre><code>"+(i?e:cg(e,!0))+`</code></pre>
`}blockquote(e){return`<blockquote>
`+e+`</blockquote>
`}html(e){return e}heading(e,t,i,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.slug(i)+'">'+e+"</h"+t+`>
`:"<h"+t+">"+e+"</h"+t+`>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(e,t,i){let n=t?"ol":"ul",s=t&&i!==1?' start="'+i+'"':"";return"<"+n+s+`>
`+e+"</"+n+`>
`}listitem(e){return"<li>"+e+`</li>
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+`</p>
`}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),`<table>
<thead>
`+e+`</thead>
`+t+`</table>
`}tablerow(e){return`<tr>
`+e+`</tr>
`}tablecell(e,t){let i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+`>
`}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,i){if(e=fq(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='<a href="'+cg(e)+'"';return t&&(n+=' title="'+t+'"'),n+=">"+i+"</a>",n}image(e,t,i){if(e=fq(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='<img src="'+e+'" alt="'+i+'"';return t&&(n+=' title="'+t+'"'),n+=this.options.xhtml?"/>":">",n}text(e){return e}}});var i0=x((Iwe,hq)=>{hq.exports=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}});var r0=x((Lwe,pq)=>{pq.exports=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do n++,i=e+"-"+n;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){let i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}});var gq=x((Awe,mq)=>{var boe=t0(),yoe=i0(),woe=r0(),{defaults:xoe}=Oc(),{unescape:Soe}=Ua();mq.exports=class n0{constructor(e){this.options=e||xoe,this.options.renderer=this.options.renderer||new boe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new yoe,this.slugger=new woe}static parse(e,t){return new n0(t).parse(e)}static parseInline(e,t){return new n0(t).parseInline(e)}parse(e,t=!0){let i="",n,s,o,a,l,c,u,f,d,h,p,g,b,y,S,w,_,L,$,I=e.length;for(n=0;n<I;n++){if(h=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&($=this.options.extensions.renderers[h.type].call(this,h),$!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){i+=$||"";continue}switch(h.type){case"space":continue;case"hr":{i+=this.renderer.hr();continue}case"heading":{i+=this.renderer.heading(this.parseInline(h.tokens),h.depth,Soe(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{i+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(f="",u="",a=h.header.length,s=0;s<a;s++)u+=this.renderer.tablecell(this.parseInline(h.tokens.header[s]),{header:!0,align:h.align[s]});for(f+=this.renderer.tablerow(u),d="",a=h.cells.length,s=0;s<a;s++){for(c=h.tokens.cells[s],u="",l=c.length,o=0;o<l;o++)u+=this.renderer.tablecell(this.parseInline(c[o]),{header:!1,align:h.align[o]});d+=this.renderer.tablerow(u)}i+=this.renderer.table(f,d);continue}case"blockquote":{d=this.parse(h.tokens),i+=this.renderer.blockquote(d);continue}case"list":{for(p=h.ordered,g=h.start,b=h.loose,a=h.items.length,d="",s=0;s<a;s++)S=h.items[s],w=S.checked,_=S.task,y="",S.task&&(L=this.renderer.checkbox(w),b?S.tokens.length>0&&S.tokens[0].type==="text"?(S.tokens[0].text=L+" "+S.tokens[0].text,S.tokens[0].tokens&&S.tokens[0].tokens.length>0&&S.tokens[0].tokens[0].type==="text"&&(S.tokens[0].tokens[0].text=L+" "+S.tokens[0].tokens[0].text)):S.tokens.unshift({type:"text",text:L}):y+=L),y+=this.parse(S.tokens,b),d+=this.renderer.listitem(y,_,w);i+=this.renderer.list(d,p,g);continue}case"html":{i+=this.renderer.html(h.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(d=h.tokens?this.parseInline(h.tokens):h.text;n+1<I&&e[n+1].type==="text";)h=e[++n],d+=`
`+(h.tokens?this.parseInline(h.tokens):h.text);i+=t?this.renderer.paragraph(d):d;continue}default:{let W='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(W);return}else throw new Error(W)}}}return i}parseInline(e,t){t=t||this.renderer;let i="",n,s,o,a=e.length;for(n=0;n<a;n++){if(s=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]&&(o=this.options.extensions.renderers[s.type].call(this,s),o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type))){i+=o||"";continue}switch(s.type){case"escape":{i+=t.text(s.text);break}case"html":{i+=t.html(s.text);break}case"link":{i+=t.link(s.href,s.title,this.parseInline(s.tokens,t));break}case"image":{i+=t.image(s.href,s.title,s.text);break}case"strong":{i+=t.strong(this.parseInline(s.tokens,t));break}case"em":{i+=t.em(this.parseInline(s.tokens,t));break}case"codespan":{i+=t.codespan(s.text);break}case"br":{i+=t.br();break}case"del":{i+=t.del(this.parseInline(s.tokens,t));break}case"text":{i+=t.text(s.text);break}default:{let l='Token with "'+s.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return i}}});var Sq=x((Fwe,xq)=>{var Id=uq(),Od=gq(),vq=QC(),bq=t0(),Coe=i0(),_oe=r0(),{merge:ug,checkSanitizeDeprecation:yq,escape:wq}=Ua(),{getDefaults:Eoe,changeDefaults:Toe,defaults:Doe}=Oc();function be(r,e,t){if(typeof r=="undefined"||r===null)throw new Error("marked(): input parameter is undefined or null");if(typeof r!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=ug({},be.defaults,e||{}),yq(e),t){let i=e.highlight,n;try{n=Id.lex(r,e)}catch(a){return t(a)}let s=function(a){let l;if(!a)try{e.walkTokens&&be.walkTokens(n,e.walkTokens),l=Od.parse(n,e)}catch(c){a=c}return e.highlight=i,a?t(a):t(null,l)};if(!i||i.length<3||(delete e.highlight,!n.length))return s();let o=0;be.walkTokens(n,function(a){a.type==="code"&&(o++,setTimeout(()=>{i(a.text,a.lang,function(l,c){if(l)return s(l);c!=null&&c!==a.text&&(a.text=c,a.escaped=!0),o--,o===0&&s()})},0))}),o===0&&s();return}try{let i=Id.lex(r,e);return e.walkTokens&&be.walkTokens(i,e.walkTokens),Od.parse(i,e)}catch(i){if(i.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+wq(i.message+"",!0)+"</pre>";throw i}}be.options=be.setOptions=function(r){return ug(be.defaults,r),Toe(be.defaults),be};be.getDefaults=Eoe;be.defaults=Doe;be.use=function(...r){let e=ug({},...r),t=be.defaults.extensions||{renderers:{},childTokens:{}},i;r.forEach(n=>{if(n.extensions&&(i=!0,n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){let o=t.renderers?t.renderers[s.name]:null;o?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[s.level]?t[s.level].unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}s.childTokens&&(t.childTokens[s.name]=s.childTokens)})),n.renderer){let s=be.defaults.renderer||new bq;for(let o in n.renderer){let a=s[o];s[o]=(...l)=>{let c=n.renderer[o].apply(s,l);return c===!1&&(c=a.apply(s,l)),c}}e.renderer=s}if(n.tokenizer){let s=be.defaults.tokenizer||new vq;for(let o in n.tokenizer){let a=s[o];s[o]=(...l)=>{let c=n.tokenizer[o].apply(s,l);return c===!1&&(c=a.apply(s,l)),c}}e.tokenizer=s}if(n.walkTokens){let s=be.defaults.walkTokens;e.walkTokens=o=>{n.walkTokens.call(this,o),s&&s(o)}}i&&(e.extensions=t),be.setOptions(e)})};be.walkTokens=function(r,e){for(let t of r)switch(e(t),t.type){case"table":{for(let i of t.tokens.header)be.walkTokens(i,e);for(let i of t.tokens.cells)for(let n of i)be.walkTokens(n,e);break}case"list":{be.walkTokens(t.items,e);break}default:be.defaults.extensions&&be.defaults.extensions.childTokens&&be.defaults.extensions.childTokens[t.type]?be.defaults.extensions.childTokens[t.type].forEach(function(i){be.walkTokens(t[i],e)}):t.tokens&&be.walkTokens(t.tokens,e)}};be.parseInline=function(r,e){if(typeof r=="undefined"||r===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof r!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected");e=ug({},be.defaults,e||{}),yq(e);try{let t=Id.lexInline(r,e);return e.walkTokens&&be.walkTokens(t,e.walkTokens),Od.parseInline(t,e)}catch(t){if(t.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+wq(t.message+"",!0)+"</pre>";throw t}};be.Parser=Od;be.parser=Od.parse;be.Renderer=bq;be.TextRenderer=Coe;be.Lexer=Id;be.lexer=Id.lex;be.Tokenizer=vq;be.Slugger=_oe;be.parse=be;xq.exports=be});var Tq=x((Mwe,Eq)=>{var Cq={};Eq.exports=Cq;var _q={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(_q).forEach(function(r){var e=_q[r],t=Cq[r]=[];t.open="["+e[0]+"m",t.close="["+e[1]+"m"})});var Rq=x((Nwe,Dq)=>{var Ld=process.argv;Dq.exports=function(){return Ld.indexOf("--no-color")!==-1||Ld.indexOf("--color=false")!==-1?!1:Ld.indexOf("--color")!==-1||Ld.indexOf("--color=true")!==-1||Ld.indexOf("--color=always")!==-1?!0:process.stdout&&!process.stdout.isTTY?!1:process.platform==="win32"||"COLORTERM"in process.env?!0:process.env.TERM==="dumb"?!1:!!/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)}()});var kq=x((qwe,Pq)=>{Pq.exports=function(e,t){var i="";e=e||"Run the trap, drop the bass",e=e.split("");var n={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(s){s=s.toLowerCase();var o=n[s]||[" "],a=Math.floor(Math.random()*o.length);typeof n[s]!="undefined"?i+=n[s][a]:i+=s}),i}});var Oq=x(($we,Iq)=>{Iq.exports=function(e,t){e=e||" he is here ";var i={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},n=[].concat(i.up,i.down,i.mid),s={};function o(c){var u=Math.floor(Math.random()*c);return u}function a(c){var u=!1;return n.filter(function(f){u=f===c}),u}function l(c,u){var f="",d,h;u=u||{},u.up=u.up||!0,u.mid=u.mid||!0,u.down=u.down||!0,u.size=u.size||"maxi",c=c.split("");for(h in c)if(!a(h)){switch(f=f+c[h],d={up:0,down:0,mid:0},u.size){case"mini":d.up=o(8),d.min=o(2),d.down=o(8);break;case"maxi":d.up=o(16)+3,d.min=o(4)+1,d.down=o(64)+3;break;default:d.up=o(8)+1,d.mid=o(6)/2,d.down=o(8)+1;break}var p=["up","mid","down"];for(var g in p)for(var b=p[g],y=0;y<=d[b];y++)u[b]&&(f=f+i[b][o(i[b].length)])}return f}return l(e)}});var Aq=x((Bwe,Lq)=>{var s0=Lc();Lq.exports=function(){return function(r,e,t){if(r===" ")return r;switch(e%3){case 0:return s0.red(r);case 1:return s0.white(r);case 2:return s0.blue(r)}}}()});var Mq=x((jwe,Fq)=>{var Roe=Lc();Fq.exports=function(r,e,t){return e%2==0?r:Roe.inverse(r)}});var qq=x((Uwe,Nq)=>{var Poe=Lc();Nq.exports=function(){var r=["red","yellow","green","blue","magenta"];return function(e,t,i){return e===" "?e:Poe[r[t++%r.length]](e)}}()});var Bq=x((Hwe,$q)=>{var koe=Lc();$q.exports=function(){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta"];return function(e,t,i){return e===" "?e:koe[r[Math.round(Math.random()*(r.length-1))]](e)}}()});var Lc=x((zwe,zq)=>{var et={};zq.exports=et;et.themes={};var Eo=et.styles=Tq(),jq=Object.defineProperties;et.supportsColor=Rq();typeof et.enabled=="undefined"&&(et.enabled=et.supportsColor);et.stripColors=et.strip=function(r){return(""+r).replace(/\x1B\[\d+m/g,"")};var Wwe=et.stylize=function(e,t){return Eo[t].open+e+Eo[t].close},Ioe=/[|\\{}()[\]^$+*?.]/g,Ooe=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(Ioe,"\\$&")};function Uq(r){var e=function t(){return Aoe.apply(t,arguments)};return e._styles=r,e.__proto__=Loe,e}var Hq=function(){var r={};return Eo.grey=Eo.gray,Object.keys(Eo).forEach(function(e){Eo[e].closeRe=new RegExp(Ooe(Eo[e].close),"g"),r[e]={get:function(){return Uq(this._styles.concat(e))}}}),r}(),Loe=jq(function(){},Hq);function Aoe(){var r=arguments,e=r.length,t=e!==0&&String(arguments[0]);if(e>1)for(var i=1;i<e;i++)t+=" "+r[i];if(!et.enabled||!t)return t;for(var n=this._styles,s=n.length;s--;){var o=Eo[n[s]];t=o.open+t.replace(o.closeRe,o.open)+o.close}return t}function Wq(r){for(var e in r)(function(t){et[t]=function(i){return et[r[t]](i)}})(e)}et.setTheme=function(r){if(typeof r=="string")try{return et.themes[r]=require(r),Wq(et.themes[r]),et.themes[r]}catch(e){return console.log(e),e}else Wq(r)};function Foe(){var r={};return Object.keys(Hq).forEach(function(e){r[e]={get:function(){return Uq([e])}}}),r}var Moe=function(e,t){var i=t.split(""),n=0;return i=i.map(e),i.join("")};et.trap=kq();et.zalgo=Oq();et.maps={};et.maps.america=Aq();et.maps.zebra=Mq();et.maps.rainbow=qq();et.maps.random=Bq();for(var Noe in et.maps)(function(r){et[r]=function(e){return Moe(et.maps[r],e)}})(Noe);jq(et,Foe())});var Gq=x((Vwe,Vq)=>{var qoe=Lc();Vq.exports=qoe});var Jq=x(Ac=>{Ac.repeat=function(r,e){return Array(e+1).join(r)};Ac.pad=function(r,e,t,i){if(e+1>=r.length)switch(i){case"left":r=Array(e+1-r.length).join(t)+r;break;case"both":var n=Math.ceil((padlen=e-r.length)/2),s=padlen-n;r=Array(s+1).join(t)+r+Array(n+1).join(t);break;default:r=r+Array(e+1-r.length).join(t)}return r};Ac.truncate=function(r,e,t){return t=t||"\u2026",r.length>=e?r.substr(0,e-t.length)+t:r};function Kq(r,e){for(var t in e)t==="__proto__"||t==="constructor"||t==="prototype"||(e[t]&&e[t].constructor&&e[t].constructor===Object?(r[t]=r[t]||{},Kq(r[t],e[t])):r[t]=e[t]);return r}Ac.options=Kq;Ac.strlen=function(r){var e=/\u001b\[(?:\d*;){0,5}\d*m/g,t=(""+r).replace(e,""),i=t.split(`
`);return i.reduce(function(n,s){return s.length>n?s.length:n},0)}});var Yq=x((Kwe,a0)=>{var $oe=Gq(),Wa=Jq(),o0=Wa.repeat,Boe=Wa.truncate,joe=Wa.pad;function Ad(r){this.options=Wa.options({chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],colAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]},r)}Ad.prototype.__proto__=Array.prototype;Ad.prototype.__defineGetter__("width",function(){var r=this.toString().split(`
`);return r.length?r[0].length:0});Ad.prototype.render;Ad.prototype.toString=function(){var r="",e=this.options,t=e.style,i=e.head,n=e.chars,s=e.truncate,o=e.colWidths||new Array(this.head.length),a=0;if(!i.length&&!this.length)return"";if(!o.length){var l=this.slice(0);i.length&&(l=l.concat([i])),l.forEach(function(y){if(typeof y=="object"&&y.length)c(y);else{var S=Object.keys(y)[0],w=y[S];o[0]=Math.max(o[0]||0,u(S)||0),typeof w=="object"&&w.length?c(w,1):o[1]=Math.max(o[1]||0,u(w)||0)}})}a=(o.length==1?o[0]:o.reduce(function(y,S){return y+S}))+o.length+1;function c(y,S){var S=S||0;y.forEach(function(w,_){o[_+S]=Math.max(o[_+S]||0,u(w)||0)})}function u(y){return typeof y=="object"&&y.width!=null?y.width:(typeof y=="object"?Wa.strlen(y.text):Wa.strlen(y))+(t["padding-left"]||0)+(t["padding-right"]||0)}function f(y,S,w,_){var L=0,y=S+o0(y,a-2)+w;return o.forEach(function($,I){I!=o.length-1&&(L+=$+1,y=y.substr(0,L)+_+y.substr(L+1))}),p(e.style.border,y)}function d(){var y=f(n.top,n["top-left"]||n.top,n["top-right"]||n.top,n["top-mid"]);y&&(r+=y+`
`)}function h(y,S){var w=[],_=0;if(!Array.isArray(y)&&typeof y=="object"){var L=Object.keys(y)[0],$=y[L],I=!0;Array.isArray($)?(y=$,y.unshift(L)):y=[L,$]}y.forEach(function(M,k){var F=M.toString().split(`
`).reduce(function(X,ae){return X.push(g(ae,k)),X},[]),j=F.length;j>_&&(_=j),w.push({contents:F,height:j})});var W=new Array(_);w.forEach(function(M,k){M.contents.forEach(function(X,ae){W[ae]||(W[ae]=[]),(S||I&&k===0&&e.style.head)&&(X=p(e.style.head,X)),W[ae].push(X)});for(var F=M.height,j=_;F<j;F++)W[F]||(W[F]=[]),W[F].push(g("",k))});var A="";return W.forEach(function(M,k){A.length>0&&(A+=`
`+p(e.style.border,n.left)),A+=M.join(p(e.style.border,n.middle))+p(e.style.border,n.right)}),p(e.style.border,n.left)+A}function p(y,S){return S?(y.forEach(function(w){S=$oe[w](S)}),S):""}function g(y,S){var y=String(typeof y=="object"&&y.text?y.text:y),w=Wa.strlen(y),_=o[S]-(t["padding-left"]||0)-(t["padding-right"]||0),L=e.colAligns[S]||"left";return o0(" ",t["padding-left"]||0)+(w==_?y:w<_?joe(y,_+(y.length-w)," ",L=="left"?"right":L=="middle"?"both":"left"):s?Boe(y,_,s):y)+o0(" ",t["padding-right"]||0)}i.length&&(d(),r+=h(i,t.head)+`
`),this.length&&this.forEach(function(y,S){if(!i.length&&S==0)d();else if(!t.compact||S<!!i.length?1:y.length==0){var w=f(n.mid,n["left-mid"],n["right-mid"],n["mid-mid"]);w&&(r+=w+`
`)}y.hasOwnProperty("length")&&!y.length||(r+=h(y)+`
`)});var b=f(n.bottom,n["bottom-left"]||n.bottom,n["bottom-right"]||n.bottom,n["bottom-mid"]);return b?r+=b:r=r.slice(0,-1),r};a0.exports=Ad;a0.exports.version="0.0.1"});var t$=x((Jwe,e$)=>{"use strict";var Xq=10,Zq=(r=0)=>e=>`[${38+r};5;${e}m`,Qq=(r=0)=>(e,t,i)=>`[${38+r};2;${e};${t};${i}m`;function Uoe(){let r=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,i]of Object.entries(e)){for(let[n,s]of Object.entries(i))e[n]={open:`[${s[0]}m`,close:`[${s[1]}m`},i[n]=e[n],r.set(s[0],s[1]);Object.defineProperty(e,t,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="[39m",e.bgColor.close="[49m",e.color.ansi256=Zq(),e.color.ansi16m=Qq(),e.bgColor.ansi256=Zq(Xq),e.bgColor.ansi16m=Qq(Xq),Object.defineProperties(e,{rgbToAnsi256:{value:(t,i,n)=>t===i&&i===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{let i=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!i)return[0,0,0];let{colorString:n}=i.groups;n.length===3&&(n=n.split("").map(o=>o+o).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1}}),e}Object.defineProperty(e$,"exports",{enumerable:!0,get:Uoe})});function i$(r){return`${di.default.gray.open}${r}${di.default.gray.close}`}function l0(r){return`${di.default.magenta.open}${r}${di.default.magenta.close}`}function r$(r){return`${di.default.bold.open}${r}${di.default.bold.close}`}function c0(r){return`${di.default.underline.open}${r}${di.default.underline.close}`}function n$(r){return`${di.default.strikethrough.open}${r}${di.default.strikethrough.close}`}function s$(r){return`${di.default.italic.open}${r}${di.default.italic.close}`}function o$(r){return`${di.default.yellow.open}${r}${di.default.yellow.close}`}function u0(r){return`${di.default.blue.open}${r}${di.default.blue.close}`}var di,a$=R(()=>{di=E(t$())});function d$(r,e){return e?r.replace(Voe,/\n/g):r}function Goe(r,e){return typeof r=="number"?new Array(r+1).join(" "):typeof r=="string"&&Koe(r)?r:new Array(e+1).join(" ")}function Koe(r){return zoe.some(function(e){return r.match("^("+e+")+$")})}function Joe(r,e){return e.replace(/(^|\n)(.+)/g,"$1"+r+"$2")}function Yoe(r,e){return e&&r+e.split(`
`).join(`
`+r)}function Qoe(r,e){let t=new RegExp("(\\S(?: | )?)((?:"+e+")+)("+h$+"(?:.*)+)$","gm");return r.replace(t,`$1
`+e+"$2$3")}function m$(r){return" ".repeat(r.length)}function eae(r,e){return p$(e,r)?e:m$(d0)+e}function tae(r,e){let t=eae.bind(null,e);return r.split(`
`).filter(Sn).map(t).join(`
`)}function iae(r,e,t){return p$(e,r)?{num:t+1,line:e.replace(d0,g$(t+1))}:{num:t,line:m$(g$(t))+e}}function rae(r,e){let t=iae.bind(null,e),i=0;return r.split(`
`).filter(Sn).map(n=>{let s=t(n,i);return i=s.num,s.line}).join(`
`)}function nae(r,e,t){return r=r.trim(),r=e?rae(r,t):tae(r,t),r}function Fd(r){return r+`
`}function sae(r){return r.replace(Woe,":")}function v$(r,e=null){if(!r)return[];e=e||Sn;let t=e(r).split(`
`),i=[];return t.forEach(function(n){if(!n)return;let s=n.replace(Hoe,"").split(c$);i.push(s.splice(0,s.length-1))}),i}function b$(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function oae(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Sn(r){return r}var l$,Zwe,c$,f0,Hoe,u$,Woe,zoe,Voe,f$,Xoe,Zoe,h$,p$,d0,g$,h0,y$,p0,w$=R(()=>{l$=E(Yq());a$();Zwe=U()("markdown-renderer"),c$="^*||*^",f0="*|*|*|*",Hoe=new RegExp(b$(f0),"g"),u$="*#COLON|*",Woe=new RegExp(b$(u$),"g"),zoe=[" "],Voe="\r",f$={code:Sn,blockquote:Sn,html:i$,heading:l0,firstHeading:l0,hr:Sn,listitem:Sn,list:nae,table:Sn,paragraph:Sn,strong:r$,em:s$,codespan:o$,del:n$,link:c0,href:c0,text:Sn,unescape:!0,emoji:!1,width:80,showSectionPrefix:!0,tab:2,tableOptions:{}};Xoe="\\*",Zoe="\\d+\\.",h$="(?:"+[Xoe,Zoe].join("|")+")";p$=function(r,e){return r.match("^(?:"+e+")*"+h$)};d0="* ";g$=function(r){return r+". "};h0=new Map,y$=class{constructor(e={},t={}){this.options=e;this.highlightOptions=t;this.o=Object.assign({},f$,e),this.tab=Goe(this.o.tab,f$.tab),this.tableSettings=this.o.tableOptions,this.unescape=this.o.unescape?oae:Sn,this.highlightOptions=t||{},this.transform=this.compose(sae,this.unescape)}textLength(e){return e.replace(/\u001b\[(?:\d{1,3})(?:;\d{1,3})*m/g,"").length}text(e){return this.o.text(e)}code(e,t,i){return"``` "+t+`
`+e+"\n```\n"}blockquote(e){return Fd(this.o.blockquote(Yoe(this.tab,e.trim())))}html(e){return this.o.html(e)}heading(e,t,i){return e=this.transform(e),e=(this.o.showSectionPrefix?new Array(t+1).join("#")+" ":"")+e,Fd(t===1?this.o.firstHeading(e):this.o.heading(e))}hr(){return`---
`}list(e,t){return e=this.o.list(e,t,this.tab),Fd(Qoe(Joe(this.tab,e),this.tab))}listitem(e){let t=this.compose(this.o.listitem,this.transform);return e.indexOf(`
`)!==-1&&(e=e.trim()),`
`+d0+t(e)}checkbox(e){return"["+(e?"X":" ")+"] "}paragraph(e){return e=this.compose(this.o.paragraph,this.transform)(e),Fd(e)}table(e,t){let i=new l$.default(Object.assign({},{head:v$(e)[0]},this.tableSettings));return v$(t,this.transform).forEach(function(n){i.push(n)}),Fd(this.o.table(i.toString()))}tablerow(e){return f0+e+f0+`
`}tablecell(e,t){return e+c$}strong(e){return this.o.strong(e)}em(e){return e=d$(e,this.o.reflowText),this.o.em(e)}codespan(e){return e=d$(e,this.o.reflowText),this.o.codespan(e.replace(/:/g,u$))}br(){return`
`}del(e){return this.o.del(e)}link(e,t,i){let n;if(this.options.sanitize){try{n=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(o){return""}if(n.startsWith("javascript:"))return""}if(i&&e&&i!=e&&h0.set(i,e),i&&i!=e)return u0(i);let s=this.o.href(e);return this.o.link(s)}image(e,t,i){if(typeof this.o.image=="function")return this.o.image(e,t,i);let n="!["+i;return t&&(n+=" \u2013 "+t),n+"]("+e+`)
`}compose(...e){return(...t)=>{for(let i=e.length;i-- >0;)t=[e[i].apply(this,t)];return t[0]}}static getLinks(){let e=[];for(let[t,i]of h0.entries())e.push(`${u0(t)}: ${i}`);return h0.clear(),e}},p0=y$});function x$(r,e){let{start:t,end:i}=e,n=r.split(/\r?\n/),s="",o="",a=n.length;for(let l=0;l<a;l++){let c=n[l];if(l<t.line){s+=c+`
`;continue}if(l>i.line){o+=c+(l==a-1?"":`
`);continue}l==t.line&&(s+=c.slice(0,t.character)),l==i.line&&(o+=c.slice(i.character)+(l==a-1?"":`
`))}return[s,o]}function re(r){return Buffer.byteLength(r)}function Fc(r){return r?r[0].toUpperCase()+r.slice(1):""}function Ci(r,e){let t=r.slice(0,e);return Buffer.byteLength(t)}function za(r,e){return Buffer.from(r,"utf8").slice(0,e).toString("utf8").length}function zt(r,e,t){return Buffer.from(r,"utf8").slice(e,t).toString("utf8")}function S$(r){let e=r.charCodeAt(0);return e>128?!1:e==95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}var yt=R(()=>{});function Mc(r,e=!1){let t=Md(r),i=[],n="";for(let s of t){if(!s.text)continue;let{foreground:o,background:a,bold:l,italic:c,underline:u}=s,f=re(n);if(o||a||l||c||u){let d=[f,f+re(s.text)],h="";o&&a?h=`CocList${Fc(o)}${Fc(a)}`:o?e?o=="yellow"?h="CocMarkdownCode":o=="blue"?h="CocMarkdownLink":o=="magenta"?h="CocMarkdownHeader":h=`CocListFg${Fc(o)}`:h=`CocListFg${Fc(o)}`:a?h=`CocListBg${Fc(a)}`:l?h="CocBold":c?h="CocItalic":u&&(h="CocUnderline"),i.push({span:d,hlGroup:h})}n=n+s.text}return{line:n,highlights:i}}function Md(r){let e=null,t=null,i="",n=[],s=[],o={},a;a=()=>{let l,c;i.length?i=i.substr(0,i.length-1):s.length&&(l=s.length-1,c=s[l].text,c.length===1?s.pop():s[l].text=c.substr(0,c.length-1))};for(let l=0;l<r.length;l++){if(e!=null){e==""&&r[l]=="["?(i&&(o.text=i,s.push(o),o={},i=""),i==""&&(r[l+1]=="m"||r[l+1]=="K")&&((o.foreground||o.background)&&(o.text="",s.push(o)),o={}),e=null,t=""):(i+=e+r[l],e=null);continue}else if(t!=null){r[l]==";"?(n.push(t),t=""):r[l]=="m"||r[l]=="K"?(n.push(t),t=null,i="",n.forEach(c=>{C$[c]?o.foreground=C$[c]:_$[c]?o.background=_$[c]:c==39?delete o.foreground:c==49?delete o.background:E$[c]?o[E$[c]]=!0:c==22?o.bold=!1:c==23?o.italic=!1:c==24&&(o.underline=!1)}),n=[]):t+=r[l];continue}r[l]==""?e=r[l]:r[l]=="\b"?a():i+=r[l]}return i&&(o.text=i+(e||""),s.push(o)),s}var C$,_$,E$,Nc=R(()=>{yt();C$={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white",90:"grey"},_$={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white"},E$={1:"bold",3:"italic",4:"underline"}});var D$=x((rxe,T$)=>{"use strict";T$.exports=({onlyFirst:r=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,r?void 0:"g")}});var m0=x((nxe,R$)=>{"use strict";var aae=D$();R$.exports=r=>typeof r=="string"?r.replace(aae(),""):r});function fg(r,e={}){let t=[],i=[],n=[],s=0;for(let o of r){let a=t.length,{content:l,filetype:c}=o;if(c=="markdown"){let u=uae(l,e);n.push(...u.codes.map(f=>(f.startLine=f.startLine+a,f.endLine=f.endLine+a,f))),i.push(...u.highlights.map(f=>(f.lnum=f.lnum+a,f))),t.push(...u.lines)}else{let u=l.trim().split(/\r?\n/);lae.includes(o.filetype)?n.push({hlGroup:`Coc${c}Float`,startLine:a,endLine:a+u.length}):n.push({filetype:o.filetype,startLine:a,endLine:a+u.length}),t.push(...u)}if(o.active){let u=cae(l,a,o.active);u.length&&i.push(...u)}s!=r.length-1&&t.push("\u2500"),s=s+1}return{lines:t,highlights:i,codes:n}}function cae(r,e,t){let i=[],[n,s]=t,o=r.split(/\r?\n/),a=0,l=!1;for(let c=0;c<o.length;c++){let u=o[c];if(l)if(a+u.length>s){let f=re(u.slice(0,s-a));i.push({colStart:0,colEnd:f,lnum:c+e,hlGroup:"CocUnderline"}),l=!1;break}else{let f=re(u);i.push({colStart:0,colEnd:f,lnum:c+e,hlGroup:"CocUnderline"})}else if(a+u.length>n){l=!0;let f=re(u.slice(0,n-a));if(a+u.length>s){let d=re(u.slice(0,s-a));l=!1,i.push({colStart:f,colEnd:d,lnum:c+e,hlGroup:"CocUnderline"});break}else{let d=re(u);i.push({colStart:f,colEnd:d,lnum:c+e,hlGroup:"CocUnderline"})}}a=a+u.length+1}return i}function uae(r,e){g0.default.setOptions({renderer:new p0,gfm:!0});let t=[],i=[],n=[],s=0,o=!1,a,l=0,c=(0,g0.default)(r),u=p0.getLinks();u.length&&(c=c+`
`+u.join(`
`)),c=c.replace(/\s*$/,"");let f=c.split(/\n/);for(let d=0;d<f.length;d++){let h=f[d];if(!h.length){let g=t[t.length-1];g&&g.length&&(t.push(h),s++);continue}if(e.excludeImages&&h.indexOf("![")!==-1&&(h=h.replace(/\s*!\[.*?\]\(.*?\)/g,""),!(0,P$.default)(h).trim().length))continue;if(/\s*```\s*([A-Za-z0-9_,]+)?$/.test(h)){if(o)o=!1,n.push({filetype:a,startLine:l,endLine:s});else{let g=f[d-1];g&&/^\s*```\s*/.test(g)&&(t.push(""),s++),o=!0,a=h.replace(/^\s*```\s*/,""),a=="js"&&(a="javascript"),a=="ts"&&(a="typescript"),a=="bash"&&(a="sh"),l=s}continue}if(o){t.push(h),s++;continue}let p=Mc(h,!0);if(p.highlights)for(let g of p.highlights){let{hlGroup:b,span:y}=g;i.push({hlGroup:b,lnum:s,colStart:y[0],colEnd:y[1]})}t.push(p.line),s++}return{lines:t,highlights:i,codes:n}}var g0,P$,lae,lxe,v0=R(()=>{g0=E(Sq());w$();Nc();yt();P$=E(m0()),lae=["Error","Warning","Info","Hint"],lxe=U()("markdown-index")});var hi,As=R(()=>{hi=class{constructor(){this.tasks=[];this.count=1}sched(){this.count>0&&this.tasks.length>0&&(this.count--,this.tasks.shift()())}get busy(){return this.count==0}acquire(){return new Promise(e=>{let t=()=>{let i=!1;e(()=>{i||(i=!0,this.count++,this.sched())})};this.tasks.push(t),process.nextTick(this.sched.bind(this))})}use(e){return this.acquire().then(t=>e().then(i=>(t(),i)).catch(i=>{throw t(),i}))}}});var k$,I$,fae,bxe,tr,Va=R(()=>{k$=E(Ui()),I$=E(H());_e();v0();de();As();ri();fae=process.env.VIM_NODE_RPC=="1",bxe=U()("model-float"),tr=class{constructor(e){this.nvim=e;this.winid=0;this._bufnr=0;this.mutex=new hi;this.disposables=[];this.onCursorMoved=(0,k$.default)(this._onCursorMoved.bind(this),100)}bindEvents(e,t){let i=["InsertLeave","InsertEnter","BufEnter"];for(let n of i)O.on(n,s=>{s!=this._bufnr&&this.close()},null,this.disposables);O.on("MenuPopupChanged",()=>{O.pumAlignTop==t&&this.close()},null,this.disposables),this.disposables.push(I$.Disposable.create(()=>{this.onCursorMoved.clear()})),O.on("CursorMoved",this.onCursorMoved.bind(this,e),this,this.disposables),O.on("CursorMovedI",this.onCursorMoved.bind(this,e),this,this.disposables)}unbind(){this.disposables.length&&(G(this.disposables),this.disposables=[])}_onCursorMoved(e,t,i){if(t!=this._bufnr&&!(t==this.targetBufnr&&je(i,this.cursor))&&(e||t!=this.targetBufnr||!O.insertMode)){this.close();return}}async create(e,t=!1,i=0){await this.show(e,{offsetX:i})}applyFloatConfig(e,t){for(let i of Object.keys(t)){if(i=="border"){t.border&&(e.border=[1,1,1,1]);continue}e[i]=t[i]}return e}async show(e,t={}){if(e.length==0||e.every(s=>s.content.length==0)){this.close();return}let i=Date.now(),n=await this.mutex.acquire();try{await this.createPopup(e,t,i),n()}catch(s){this.nvim.echoError(s),n()}}async createPopup(e,t,i){e=e.filter(g=>g.content.trim().length>0);let{lines:n,codes:s,highlights:o}=fg(e),a={pumAlignTop:O.pumAlignTop,preferTop:typeof t.preferTop=="boolean"?t.preferTop:!1,offsetX:t.offsetX||0,title:t.title||"",close:t.close?1:0,codes:s,highlights:o,modes:t.modes||["n","i","ic","s"]};fae||(typeof t.winblend=="number"&&(a.winblend=t.winblend),t.focusable!=null&&(a.focusable=t.focusable?1:0),t.shadow&&(a.shadow=1)),t.maxHeight&&(a.maxHeight=t.maxHeight),t.maxWidth&&(a.maxWidth=t.maxWidth),t.border&&!t.border.every(g=>g==0)&&(a.border=t.border),t.title&&!a.border&&(a.border=[1,1,1,1]),t.highlight&&(a.highlight=t.highlight),t.borderhighlight&&(a.borderhighlight=[t.borderhighlight]),t.cursorline&&(a.cursorline=1);let l=t.autoHide!=!1;l&&(a.autohide=1),this.unbind();let c=await this.nvim.call("coc#float#create_cursor_float",[this.winid,this._bufnr,n,a]);if(this.nvim.redrawVim(),!c||c.length==0||this.closeTs>i){let g=c&&c.length>0?c[2]:this.winid;g&&(this.winid=0,this.nvim.call("coc#float#close",[g],!0),this.nvim.redrawVim());return}let[u,f,d,h,p]=c;this.winid=d,this._bufnr=h,this.targetBufnr=u,this.cursor=f,this.bindEvents(l,p==1)}close(){let{winid:e,nvim:t}=this;this.closeTs=Date.now(),this.unbind(),e&&(this.winid=0,t.call("coc#float#close",[e],!0),t.redrawVim())}checkRetrigger(e){return!!(this.winid&&this.targetBufnr==e)}get bufnr(){return this._bufnr}get buffer(){return this.bufnr?this.nvim.createBuffer(this.bufnr):null}get window(){return this.winid?this.nvim.createWindow(this.winid):null}async activated(){return this.winid?await this.nvim.call("coc#float#valid",[this.winid])!=0:!1}dispose(){this.cursor=void 0,this.close()}}});function Cn(r,e){return Ft(r.start,e)===0&&Ft(r.end,e)===0}function dg(r,e){let{start:t,end:i}=r;return!(De(i,e.start)<=0||De(t,e.end)>=0)}function qc(r,e){return!!(Ft(r.start,e)==0||Ft(r.end,e)==0||Cn(e,r))}function O$(r,e){let{start:t,end:i}=e;return r>=t.line&&r<=i.line}function Fs(r){let{start:e,end:t}=r;return e.line==t.line&&e.character==t.character}function Ft(r,e){let{start:t,end:i}=e;return De(r,t)<0?-1:De(r,i)>0?1:0}function De(r,e){return r.line>e.line||e.line==r.line&&r.character>e.character?1:e.line==r.line&&r.character==e.character?0:-1}function b0(r){return r.start.line==r.end.line}function y0(r,e){let{range:t,newText:i}=e;if(De(t.end,r)<=0){let n=i.split(`
`),s=n.length-(t.end.line-t.start.line)-1,o=0;if(t.end.line==r.line){let a=b0(t)&&s==0,l=a?t.end.character-t.start.character:t.end.character;o=(a?i.length:n[n.length-1].length)-l}return{line:s,character:o}}return{line:0,character:0}}function L$(r,e){let{range:t,newText:i}=e;if(De(t.start,r)>1)return r;let{start:n,end:s}=t,o=i.split(`
`),a=s.line-n.line-o.length+1,l=o[o.length-1],c=r.line-a;if(r.line!=s.line)return{line:c,character:r.character};let u=o.length==1&&n.line!=s.line?n.character:0,f=n.line==s.line&&o.length==1?s.character-n.character:s.character,d=u+r.character+l.length-f;return{line:c,character:d}}function A$(r,e,t){let i=0;for(let n=0;n<=e;n++)n==e?i+=t:i+=r[n].length+1;return i}function F$(r,e,t){if(!Cn(t.range,r))return e;let{start:i,end:n}=t.range,s=e.split(`
`),o=i.line==r.start.line?i.character-r.start.character:i.character,a=A$(s,i.line-r.start.line,o);o=n.line==r.start.line?n.character-r.start.character:n.character;let l=A$(s,n.line-r.start.line,o);return`${e.slice(0,a)}${t.newText}${e.slice(l,e.length)}`}function $c(r,e){let t={line:0,character:0};for(let i of e){let n=y0(r,i);t={line:t.line+n.line,character:t.character+n.character}}return t.line==0&&t.character==0?null:t}var Vt=R(()=>{});var Sxe,hg,M$=R(()=>{de();Sxe=U()("outpubChannel"),hg=class{constructor(e,t,i){this.name=e;this.nvim=t;this.onDispose=i;this.lines=[""];this.disposables=[];this._disposed=!1;this.created=!1}get content(){return this.lines.join(`
`)}_append(e){let{nvim:t}=this,i=this.lines.length-1,n=e.split(/\r?\n/),s=this.lines[i]+n[0];this.lines[i]=s;let o=n.slice(1);this.lines=this.lines.concat(o),!!this.created&&(t.pauseNotification(),t.call("setbufline",[this.bufname,"$",s],!0),o.length&&t.call("appendbufline",[this.bufname,"$",o],!0),t.resumeNotification(!1,!0))}append(e){!this.validate()||this._append(e)}appendLine(e){!this.validate()||this._append(e+`
`)}clear(e){if(!this.validate())return;let{nvim:t}=this;this.lines=e?this.lines.slice(-e):[],!!this.created&&(t.pauseNotification(),t.call("deletebufline",[this.bufname,1,"$"],!0),this.lines.length&&t.call("appendbufline",[this.bufname,"$",this.lines],!0),t.resumeNotification(!1,!0))}hide(){this.created=!1,this.nvim.command(`exe 'silent! bd! '.fnameescape('${this.bufname}')`,!0)}get bufname(){return`output:///${this.name}`}show(e){let{nvim:t}=this;t.pauseNotification(),t.command(`exe 'vsplit '.fnameescape('${this.bufname}')`,!0),e&&t.command("wincmd p",!0),t.command("redraw",!0),t.resumeNotification(!1,!0),this.created=!0}validate(){return!this._disposed}dispose(){this.onDispose&&this.onDispose(),this._disposed=!0,this.hide(),this.lines=[],G(this.disposables)}}});var Txe,N$,Ga,w0=R(()=>{M$();_e();Txe=U()("channels"),N$=class{constructor(){this.outputChannels=new Map;this.bufnrs=new Map;this.disposable=O.on("BufUnload",e=>{let t=this.bufnrs.get(e);if(t){let i=this.outputChannels.get(t);i&&(i.created=!1)}})}getProvider(e){return{onDidChange:null,provideTextDocumentContent:async i=>{let n=this.get(i.path.slice(1));if(!n)return"";e.pauseNotification(),e.call("bufnr",["%"],!0),e.command("setlocal nospell nofoldenable nowrap noswapfile",!0),e.command("setlocal buftype=nofile bufhidden=hide",!0),e.command("setfiletype log",!0);let s=await e.resumeNotification();return s[1]||(this.bufnrs.set(s[0][0],n.name),n.created=!0),n.content}}}get names(){return Array.from(this.outputChannels.keys())}get(e){return this.outputChannels.get(e)}create(e,t){if(this.outputChannels.has(e))return this.outputChannels.get(e);if(!/^[\w\s-.]+$/.test(e))throw new Error(`Invalid channel name "${e}", only word characters and white space allowed.`);let i=new hg(e,t,()=>{this.outputChannels.delete(e)});return this.outputChannels.set(e,i),i}show(e,t){let i=this.outputChannels.get(e);!i||i.show(t)}dispose(){this.disposable.dispose();for(let e of this.outputChannels.values())e.dispose();this.outputChannels.clear()}},Ga=new N$});var kxe,pg,q$=R(()=>{_e();de();kxe=U()("model-dialog"),pg=class{constructor(e,t){this.nvim=e;this.config=t;this.disposables=[];O.on("BufWinLeave",i=>{i==this.bufnr&&(this.dispose(),t.callback&&t.callback(-1))},null,this.disposables),O.on("FloatBtnClick",(i,n)=>{if(i==this.bufnr){this.dispose();let s=t==null?void 0:t.buttons.filter(o=>o.disabled!=!0);t.callback&&t.callback(s[n].index)}},null,this.disposables)}get lines(){return[...this.config.content.split(/\r?\n/)]}async show(e){let{nvim:t}=this,{title:i,close:n,buttons:s}=this.config,o=this.config.borderhighlight||e.floatBorderHighlight,a=this.config.highlight||e.floatHighlight,l={maxwidth:e.maxWidth||80};i&&(l.title=i),(n||typeof n=="undefined")&&(l.close=1),e.maxHeight&&(l.maxHeight=e.maxHeight),e.maxWidth&&(l.maxWidth=e.maxWidth),a&&(l.highlight=a),o&&(l.borderhighlight=[o]),s&&(l.buttons=s.filter(u=>!u.disabled).map(u=>u.text));let c=await t.call("coc#float#create_dialog",[this.lines,l]);!c[1]||(this.bufnr=c[1],t.command("redraw",!0))}get winid(){return this.bufnr?this.nvim.call("bufwinid",[this.bufnr]):Promise.resolve(null)}dispose(){this.bufnr=void 0,G(this.disposables),this.disposables=[]}}});var mg,Bc,x0=R(()=>{mg=process.env.VIM_NODE_RPC=="1",Bc=class{constructor(e,t,i){this.nvim=e;this.winid=t;this.bufnr=i}get valid(){return this.nvim.call("coc#float#valid",[this.winid]).then(e=>!!e)}close(){this.nvim.call("coc#float#close",[this.winid],!0)}refreshScrollbar(){mg||this.nvim.call("coc#float#nvim_scrollbar",[this.winid],!0)}execute(e){this.nvim.call("coc#compat#execute",[this.winid,e],!0)}async scrollForward(){let{nvim:e,bufnr:t,winid:i}=this,s=await e.createBuffer(t).length,o;if(mg)o=await e.eval(`get(popup_getpos(${i}), 'lastline', 0)`);else{let a=await e.call("getwininfo",[i]);if(!a||!a.length)return;o=a[0].botline}o>=s||o==0||(e.pauseNotification(),this.setCursor(o-1),this.execute("silent! noa setl scrolloff=0"),this.execute(`normal! ${o}Gzt`),this.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))}async scrollBackward(){let{nvim:e,winid:t}=this,i;if(mg)i=await e.eval(`get(popup_getpos(${t}), 'firstline', 0)`);else{let n=await e.call("getwininfo",[t]);if(!n||!n.length)return;i=n[0].topline}i!=1&&(e.pauseNotification(),this.setCursor(i-1),this.execute(`normal! ${i}Gzb`),this.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))}setCursor(e){let{nvim:t,bufnr:i,winid:n}=this;mg?t.call("win_execute",[n,`exe ${e+1}`],!0):(t.createWindow(n).notify("nvim_win_set_cursor",[[e+1,0]]),t.command(`sign unplace 6 buffer=${i}`,!0),t.command(`sign place 6 line=${e+1} name=CocCurrentLine buffer=${i}`,!0))}}});var $$,dae,gg,B$=R(()=>{$$=E(H());_e();de();x0();dae=U()("model-menu"),gg=class{constructor(e,t,i){this.nvim=e;this.config=t;this.currIndex=0;this.disposables=[];this.keyMappings=new Map;this._onDidClose=new $$.Emitter;this.onDidClose=this._onDidClose.event;this.total=t.items.length,i&&i.onCancellationRequested(()=>{var n;(n=this.win)==null||n.close()}),this.disposables.push(this._onDidClose),this.addKeymappings()}attachEvents(){O.on("InputChar",this.onInputChar.bind(this),null,this.disposables),O.on("BufWinLeave",e=>{e==this.bufnr&&(this._onDidClose.fire(-1),this.bufnr=void 0,this.win=void 0,this.dispose())},null,this.disposables)}addKeymappings(){let{nvim:e}=this;this.addKeys(["<esc>","<C-c>"],()=>{this._onDidClose.fire(-1),this.dispose()}),this.addKeys(["\r","<cr>"],()=>{this._onDidClose.fire(this.currIndex),this.dispose()});let t=s=>{var o;!this.win||(e.pauseNotification(),this.setCursor(s),(o=this.win)==null||o.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))};this.addKeys("<C-f>",async()=>{var s;await((s=this.win)==null?void 0:s.scrollForward())}),this.addKeys("<C-b>",async()=>{var s;await((s=this.win)==null?void 0:s.scrollBackward())}),this.addKeys(["j","<down>","<tab>","<C-n>"],()=>{let s=this.currIndex==this.total-1?0:this.currIndex+1;t(s)}),this.addKeys(["k","<up>","<s-tab>","<C-p>"],()=>{let s=this.currIndex==0?this.total-1:this.currIndex-1;t(s)}),this.addKeys(["g"],()=>{t(0)}),this.addKeys(["G"],()=>{t(this.total-1)});let i,n;this.addKeys(["0","1","2","3","4","5","6","7","8","9"],s=>{i&&clearTimeout(i);let o=parseInt(s,10);if(!(isNaN(o)||o>this.total)&&!(n==null&&o==0)){if(n){let a=n*10+o;n=void 0,this._onDidClose.fire(a-1),this.dispose();return}if(this.total<10||o*10>this.total){this._onDidClose.fire(o-1),this.dispose();return}i=setTimeout(async()=>{this._onDidClose.fire(o-1),this.dispose()},200),n=o}})}async show(e={}){let{nvim:t}=this,{title:i,items:n}=this.config,s={};i&&(s.title=i),e.maxHeight&&(s.maxHeight=e.maxHeight),e.maxWidth&&(s.maxWidth=e.maxWidth),e.floatHighlight&&(s.highlight=e.floatHighlight),e.floatBorderHighlight&&(s.borderhighlight=[e.floatBorderHighlight]);let o=n.map((l,c)=>c<99?`${c+1}. ${l}`:l);e.confirmKey&&e.confirmKey!="<cr>"&&this.addKeys(e.confirmKey,()=>{this._onDidClose.fire(this.currIndex),this.dispose()});let a=await t.call("coc#float#create_menu",[o,s]);return this.win=new Bc(t,a[0],a[1]),this.bufnr=a[1],this.attachEvents(),t.call("coc#prompt#start_prompt",["menu"],!0),a[0]}get buffer(){return this.bufnr?this.nvim.createBuffer(this.bufnr):void 0}dispose(){var e;G(this.disposables),this.disposables=[],this.nvim.call("coc#prompt#stop_prompt",["menu"],!0),(e=this.win)==null||e.close(),this.win=void 0}async onInputChar(e,t){if(e!="menu"||!this.win)return;let i=this.keyMappings.get(t);i?await Promise.resolve(i(t)):dae.warn(`Ignored key press: ${t}`)}setCursor(e){!this.win||(this.currIndex=e,this.win.setCursor(e))}addKeys(e,t){if(Array.isArray(e))for(let i of e)this.keyMappings.set(i,t);else this.keyMappings.set(e,t)}}});var j$,Uxe,Ka,S0=R(()=>{_e();de();j$=process.env.VIM_NODE_RPC=="1",Uxe=U()("model-notification"),Ka=class{constructor(e,t,i=!0){this.nvim=e;this.config=t;this.disposables=[];this._disposed=!1;i&&(O.on("BufWinLeave",n=>{n==this.bufnr&&(this.dispose(),t.callback&&t.callback(-1))},null,this.disposables),O.on("FloatBtnClick",(n,s)=>{if(n==this.bufnr){this.dispose();let o=t==null?void 0:t.buttons.filter(a=>a.disabled!=!0);t.callback&&t.callback(o[s].index)}},null,this.disposables))}get lines(){return this.config.content.split(/\r?\n/)}async show(e){let{nvim:t}=this,{title:i,close:n,timeout:s,buttons:o,borderhighlight:a}=this.config,l=Object.assign({},e);l.close=n?1:0,i&&(l.title=i),a&&(l.borderhighlight=a),o&&(l.buttons=o.filter(u=>!u.disabled).map(u=>u.text)),s&&(l.timeout=s);let c=await t.call("coc#float#create_notification",[this.lines,l]);return c?(this._disposed?(this.nvim.call("coc#float#close",[c[0]],!0),j$&&this.nvim.command("redraw",!0)):(this._winid=c[0],this.bufnr=c[1]),this._winid!=null):!1}get winid(){return this._winid}dispose(){if(this._disposed)return;this._disposed=!0;let{winid:e}=this;e&&(this.nvim.call("coc#float#close",[e],!0),j$&&this.nvim.command("redraw",!0)),this.bufnr=void 0,this._winid=void 0,G(this.disposables),this.disposables=[]}}});var U$,hae,H$,vg,W$=R(()=>{U$=E(H());_e();de();yt();x0();hae=U()("model-dialog"),H$=process.env.VIM_NODE_RPC=="1",vg=class{constructor(e,t,i){this.nvim=e;this.config=t;this.picked=new Set;this.currIndex=0;this.disposables=[];this.keyMappings=new Map;this._onDidClose=new U$.Emitter;this.onDidClose=this._onDidClose.event;for(let n=0;n<t.items.length;n++)t.items[n].picked&&this.picked.add(n);this.total=t.items.length,i&&i.onCancellationRequested(()=>{var n;(n=this.win)==null||n.close()}),this.disposables.push(this._onDidClose),this.addKeymappings()}attachEvents(){O.on("InputChar",this.onInputChar.bind(this),null,this.disposables),O.on("BufWinLeave",e=>{e==this.bufnr&&(this._onDidClose.fire(void 0),this.bufnr=void 0,this.win=void 0,this.dispose())},null,this.disposables),O.on("FloatBtnClick",(e,t)=>{if(e==this.bufnr){if(t==0){let i=Array.from(this.picked);this._onDidClose.fire(i.length?i:void 0)}else this._onDidClose.fire(void 0);this.dispose()}},null,this.disposables)}addKeymappings(){let{nvim:e}=this,t=n=>{this.picked.has(n)?this.picked.delete(n):this.picked.add(n)};this.addKeys("<LeftRelease>",async()=>{if(H$||!this.win)return;let[n,s,o]=await e.eval("[v:mouse_winid,v:mouse_lnum,v:mouse_col]");if(global.hasOwnProperty("__TEST__")){let a=await e.getVar("mouse_position");n=a[0],s=a[1],o=a[2]}e.pauseNotification(),n==this.win.winid&&(o<=3?(t(s-1),this.changeLine(s-1)):this.setCursor(s-1)),e.call("win_gotoid",[n],!0),e.call("cursor",[s,o],!0),e.call("coc#float#nvim_float_click",[],!0),e.command("redraw",!0),await e.resumeNotification()}),this.addKeys(["<esc>","<C-c>"],()=>{this._onDidClose.fire(void 0),this.dispose()}),this.addKeys("<cr>",()=>{if(this.picked.size==0)this._onDidClose.fire(void 0);else{let n=Array.from(this.picked);this._onDidClose.fire(n)}this.dispose()});let i=n=>{e.pauseNotification(),this.setCursor(n),this.win.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0)};this.addKeys(["j","<down>","<tab>","<C-n>"],()=>{let n=this.currIndex==this.total-1?0:this.currIndex+1;i(n)}),this.addKeys(["k","<up>","<s-tab>","<C-p>"],()=>{let n=this.currIndex==0?this.total-1:this.currIndex-1;i(n)}),this.addKeys(["g"],()=>{i(0)}),this.addKeys(["G"],()=>{i(this.total-1)}),this.addKeys(" ",async()=>{let n=this.currIndex;t(n),e.pauseNotification(),this.changeLine(n),this.currIndex!=this.total-1&&this.setCursor(this.currIndex+1),e.command("redraw",!0),await e.resumeNotification()}),this.addKeys("<C-f>",async()=>{var n;await((n=this.win)==null?void 0:n.scrollForward())}),this.addKeys("<C-b>",async()=>{var n;await((n=this.win)==null?void 0:n.scrollBackward())})}async show(e={}){let{nvim:t}=this,{title:i,items:n}=this.config,s={close:1,cursorline:1};if(e.maxHeight&&(s.maxHeight=e.maxHeight),e.maxWidth&&(s.maxWidth=e.maxWidth),i&&(s.title=i),s.close=1,s.cursorline=1,e.floatHighlight&&(s.highlight=e.floatHighlight),e.floatBorderHighlight&&(s.borderhighlight=[e.floatBorderHighlight]),e.pickerButtons){let u=e.pickerButtonShortcut;s.buttons=["Submit"+(u?" <cr>":""),"Cancel"+(u?" <esc>":"")]}e.confirmKey&&e.confirmKey!="<cr>"&&this.addKeys(e.confirmKey,()=>{this._onDidClose.fire(void 0),this.dispose()});let o=[],a=[];for(let u=0;u<n.length;u++){let f=n[u],d=`[${f.picked?"x":" "}] ${f.label}`;a.push([u,re(d)]),f.description&&(d=d+` ${f.description}`),o.push(d)}let l=await t.call("coc#float#create_dialog",[o,s]);this.win=new Bc(t,l[0],l[1]),this.bufnr=l[1],this.attachEvents();let c=t.createBuffer(this.bufnr);t.pauseNotification();for(let u of a)c.addHighlight({hlGroup:"Comment",line:u[0],srcId:1,colStart:u[1],colEnd:-1});return t.command("redraw",!0),await t.resumeNotification(),t.call("coc#prompt#start_prompt",["picker"],!0),l[0]}get buffer(){return this.bufnr?this.nvim.createBuffer(this.bufnr):void 0}dispose(){var e;this.picked.clear(),this.keyMappings.clear(),G(this.disposables),this.nvim.call("coc#prompt#stop_prompt",["picker"],!0),(e=this.win)==null||e.close(),this.win=void 0}async onInputChar(e,t){if(e!="picker"||!this.win)return;let i=this.keyMappings.get(t);i?await Promise.resolve(i(t)):hae.warn(`Ignored key press: ${t}`)}changeLine(e){let{nvim:t}=this,i=this.config.items[e];if(!i)return;let n=`[${this.picked.has(e)?"x":" "}] ${i.label}`,s=re(n);i.description&&(n=n+` ${i.description}`),t.call("setbufline",[this.bufnr,e+1,n],!0),H$||t.createBuffer(this.bufnr).addHighlight({hlGroup:"Comment",line:e,srcId:1,colStart:s,colEnd:-1})}setCursor(e){!this.win||(this.currIndex=e,this.win.setCursor(e))}addKeys(e,t){if(Array.isArray(e))for(let i of e)this.keyMappings.set(i,t);else this.keyMappings.set(e,t)}}});var z$,bg,V$=R(()=>{S0();z$=E(H());_e();bg=class extends Ka{constructor(e,t){super(e,{content:`
`,close:t.cancellable==!0,title:t.title},!1);this.option=t;O.on("BufWinLeave",i=>{i==this.bufnr&&(this.tokenSource&&this.tokenSource.cancel(),this.dispose())},null,this.disposables)}async show(e){let{task:t}=this.option,i=this.tokenSource=new z$.CancellationTokenSource;this.disposables.push(i);let n=0;return await new Promise((o,a)=>{i.token.onCancellationRequested(()=>{o(void 0)}),super.show(Object.assign({minWidth:e.minProgressWidth||30,progress:1},e)).then(l=>{l||a(new Error("Failed to create float window"))}).catch(a),t({report:l=>{if(!this.bufnr)return;let c="";l.message&&(c+=l.message.replace(/\r?\n/g," ")),l.increment&&(n+=l.increment,c=c+(c.length?` ${n}%`:`${n}%`)),this.nvim.call("setbufline",[this.bufnr,2,c],!0)}},i.token).then(l=>{this._disposed||(setTimeout(()=>{this.dispose()},100),o(l))},l=>{this._disposed||(this.dispose(),l instanceof Error?a(l):o(void 0))})})}dispose(){super.dispose(),this.tokenSource=void 0}}});function Nd(){return G$.default.randomBytes(16)}var G$,C0=R(()=>{G$=E(require("crypto"))});function pae(r,e){var t=e||0,i=K$;return[i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]]].join("")}var K$,wg,_0=R(()=>{K$=[];for(var yg=0;yg<256;++yg)K$[yg]=(yg+256).toString(16).substr(1);wg=pae});function mae(r,e,t){var i=e&&t||0,n=e||[];r=r||{};var s=r.node||J$,o=r.clockseq!==void 0?r.clockseq:E0;if(s==null||o==null){var a=r.random||(r.rng||Nd)();s==null&&(s=J$=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=E0=(a[6]<<8|a[7])&16383)}var l=r.msecs!==void 0?r.msecs:new Date().getTime(),c=r.nsecs!==void 0?r.nsecs:D0+1,u=l-T0+(c-D0)/1e4;if(u<0&&r.clockseq===void 0&&(o=o+1&16383),(u<0||l>T0)&&r.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");T0=l,D0=c,E0=o,l+=122192928e5;var f=((l&268435455)*1e4+c)%4294967296;n[i++]=f>>>24&255,n[i++]=f>>>16&255,n[i++]=f>>>8&255,n[i++]=f&255;var d=l/4294967296*1e4&268435455;n[i++]=d>>>8&255,n[i++]=d&255,n[i++]=d>>>24&15|16,n[i++]=d>>>16&255,n[i++]=o>>>8|128,n[i++]=o&255;for(var h=0;h<6;++h)n[i+h]=s[h];return e||wg(n)}var J$,E0,T0,D0,Ms,Y$=R(()=>{C0();_0();T0=0,D0=0;Ms=mae});function gae(r,e,t){var i=e&&t||0;typeof r=="string"&&(e=r==="binary"?new Array(16):null,r=null),r=r||{};var n=r.random||(r.rng||Nd)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e)for(var s=0;s<16;++s)e[i+s]=n[s];return e||wg(n)}var ue,X$=R(()=>{C0();_0();ue=gae});var Ye=R(()=>{Y$();X$()});var mSe,R0,xg,P0=R(()=>{Ye();mSe=U()("model-status"),R0=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],xg=class{constructor(e){this.nvim=e;this.items=new Map;this.shownIds=new Set;this._text="";this.interval=setInterval(()=>{this.setStatusText().logError()},100)}dispose(){clearInterval(this.interval)}createStatusBarItem(e=0,t=!1){let i=Ms(),n={text:"",priority:e,isProgress:t,show:()=>{this.shownIds.add(i)},hide:()=>{this.shownIds.delete(i)},dispose:()=>{this.shownIds.delete(i),this.items.delete(i)}};return this.items.set(i,n),n}getText(){if(this.shownIds.size==0)return"";let e=new Date,t=Math.floor(e.getMilliseconds()/100),i="",n=[];for(let[s,o]of this.items)this.shownIds.has(s)&&n.push(o);n.sort((s,o)=>s.priority-o.priority);for(let s of n)s.isProgress?i=`${i} ${R0[t]} ${s.text}`:i=`${i} ${s.text}`;return i}async setStatusText(){let e=this.getText(),{nvim:t}=this;e!=this._text&&(this._text=e,t.pauseNotification(),this.nvim.setVar("coc_status",e,!0),this.nvim.call("coc#util#do_autocmd",["CocStatusChange"],!0),await t.resumeNotification(!1,!0))}}});var ir,Vr,_n,Ot,Ee,Gr,En=R(()=>{(function(i){i[i.Buffer=0]="Buffer",i[i.LanguageServer=1]="LanguageServer",i[i.Global=2]="Global"})(ir||(ir={}));(function(i){i[i.Native=0]="Native",i[i.Remote=1]="Remote",i[i.Service=2]="Service"})(Vr||(Vr={}));(function(i){i[i.More=0]="More",i[i.Warning=1]="Warning",i[i.Error=2]="Error"})(_n||(_n={}));(function(i){i[i.Global=0]="Global",i[i.User=1]="User",i[i.Workspace=2]="Workspace"})(Ot||(Ot={}));(function(o){o[o.Initial=0]="Initial",o[o.Starting=1]="Starting",o[o.StartFailed=2]="StartFailed",o[o.Running=3]="Running",o[o.Stopping=4]="Stopping",o[o.Stopped=5]="Stopped"})(Ee||(Ee={}));(function(n){n[n.Unknown=0]="Unknown",n[n.File=1]="File",n[n.Directory=2]="Directory",n[n.SymbolicLink=64]="SymbolicLink"})(Gr||(Gr={}))});var eB=x((bSe,Sg)=>{"use strict";Sg.exports=wae;Sg.exports.format=Z$;Sg.exports.parse=Q$;var vae=/\B(?=(\d{3})+(?!\d))/g,bae=/(?:\.0*|(\.[^0]+)0+)$/,To={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},yae=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function wae(r,e){return typeof r=="string"?Q$(r):typeof r=="number"?Z$(r,e):null}function Z$(r,e){if(!Number.isFinite(r))return null;var t=Math.abs(r),i=e&&e.thousandsSeparator||"",n=e&&e.unitSeparator||"",s=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,o=Boolean(e&&e.fixedDecimals),a=e&&e.unit||"";(!a||!To[a.toLowerCase()])&&(t>=To.pb?a="PB":t>=To.tb?a="TB":t>=To.gb?a="GB":t>=To.mb?a="MB":t>=To.kb?a="KB":a="B");var l=r/To[a.toLowerCase()],c=l.toFixed(s);return o||(c=c.replace(bae,"$1")),i&&(c=c.replace(vae,i)),c+n+a}function Q$(r){if(typeof r=="number"&&!isNaN(r))return r;if(typeof r!="string")return null;var e=yae.exec(r),t,i="b";return e?(t=parseFloat(e[1]),i=e[4].toLowerCase()):(t=parseInt(r,10),i="b"),Math.floor(To[i]*t)}});var jc=x((ySe,aB)=>{var Gn=-1,Tn=1,rr=0;function qd(r,e,t,i){if(r===e)return r?[[rr,r]]:[];if(t!=null){var n=Eae(r,e,t);if(n)return n}var s=k0(r,e),o=r.substring(0,s);r=r.substring(s),e=e.substring(s),s=I0(r,e);var a=r.substring(r.length-s);r=r.substring(0,r.length-s),e=e.substring(0,e.length-s);var l=xae(r,e);return o&&l.unshift([rr,o]),a&&l.push([rr,a]),iB(l,i),l}function xae(r,e){var t;if(!r)return[[Tn,e]];if(!e)return[[Gn,r]];var i=r.length>e.length?r:e,n=r.length>e.length?e:r,s=i.indexOf(n);if(s!==-1)return t=[[Tn,i.substring(0,s)],[rr,n],[Tn,i.substring(s+n.length)]],r.length>e.length&&(t[0][0]=t[2][0]=Gn),t;if(n.length===1)return[[Gn,r],[Tn,e]];var o=Cae(r,e);if(o){var a=o[0],l=o[1],c=o[2],u=o[3],f=o[4],d=qd(a,c),h=qd(l,u);return d.concat([[rr,f]],h)}return Sae(r,e)}function Sae(r,e){for(var t=r.length,i=e.length,n=Math.ceil((t+i)/2),s=n,o=2*n,a=new Array(o),l=new Array(o),c=0;c<o;c++)a[c]=-1,l[c]=-1;a[s+1]=0,l[s+1]=0;for(var u=t-i,f=u%2!=0,d=0,h=0,p=0,g=0,b=0;b<n;b++){for(var y=-b+d;y<=b-h;y+=2){var S=s+y,w;y===-b||y!==b&&a[S-1]<a[S+1]?w=a[S+1]:w=a[S-1]+1;for(var _=w-y;w<t&&_<i&&r.charAt(w)===e.charAt(_);)w++,_++;if(a[S]=w,w>t)h+=2;else if(_>i)d+=2;else if(f){var L=s+u-y;if(L>=0&&L<o&&l[L]!==-1){var $=t-l[L];if(w>=$)return tB(r,e,w,_)}}}for(var I=-b+p;I<=b-g;I+=2){var L=s+I,$;I===-b||I!==b&&l[L-1]<l[L+1]?$=l[L+1]:$=l[L-1]+1;for(var W=$-I;$<t&&W<i&&r.charAt(t-$-1)===e.charAt(i-W-1);)$++,W++;if(l[L]=$,$>t)g+=2;else if(W>i)p+=2;else if(!f){var S=s+u-I;if(S>=0&&S<o&&a[S]!==-1){var w=a[S],_=s+w-S;if($=t-$,w>=$)return tB(r,e,w,_)}}}}return[[Gn,r],[Tn,e]]}function tB(r,e,t,i){var n=r.substring(0,t),s=e.substring(0,i),o=r.substring(t),a=e.substring(i),l=qd(n,s),c=qd(o,a);return l.concat(c)}function k0(r,e){if(!r||!e||r.charAt(0)!==e.charAt(0))return 0;for(var t=0,i=Math.min(r.length,e.length),n=i,s=0;t<n;)r.substring(s,n)==e.substring(s,n)?(t=n,s=t):i=n,n=Math.floor((i-t)/2+t);return rB(r.charCodeAt(n-1))&&n--,n}function I0(r,e){if(!r||!e||r.slice(-1)!==e.slice(-1))return 0;for(var t=0,i=Math.min(r.length,e.length),n=i,s=0;t<n;)r.substring(r.length-n,r.length-s)==e.substring(e.length-n,e.length-s)?(t=n,s=t):i=n,n=Math.floor((i-t)/2+t);return nB(r.charCodeAt(r.length-n))&&n--,n}function Cae(r,e){var t=r.length>e.length?r:e,i=r.length>e.length?e:r;if(t.length<4||i.length*2<t.length)return null;function n(h,p,g){for(var b=h.substring(g,g+Math.floor(h.length/4)),y=-1,S="",w,_,L,$;(y=p.indexOf(b,y+1))!==-1;){var I=k0(h.substring(g),p.substring(y)),W=I0(h.substring(0,g),p.substring(0,y));S.length<W+I&&(S=p.substring(y-W,y)+p.substring(y,y+I),w=h.substring(0,g-W),_=h.substring(g+I),L=p.substring(0,y-W),$=p.substring(y+I))}return S.length*2>=h.length?[w,_,L,$,S]:null}var s=n(t,i,Math.ceil(t.length/4)),o=n(t,i,Math.ceil(t.length/2)),a;if(!s&&!o)return null;o?s?a=s[4].length>o[4].length?s:o:a=o:a=s;var l,c,u,f;r.length>e.length?(l=a[0],c=a[1],u=a[2],f=a[3]):(u=a[0],f=a[1],l=a[2],c=a[3]);var d=a[4];return[l,c,u,f,d]}function iB(r,e){r.push([rr,""]);for(var t=0,i=0,n=0,s="",o="",a;t<r.length;){if(t<r.length-1&&!r[t][1]){r.splice(t,1);continue}switch(r[t][0]){case Tn:n++,o+=r[t][1],t++;break;case Gn:i++,s+=r[t][1],t++;break;case rr:var l=t-n-i-1;if(e){if(l>=0&&oB(r[l][1])){var c=r[l][1].slice(-1);if(r[l][1]=r[l][1].slice(0,-1),s=c+s,o=c+o,!r[l][1]){r.splice(l,1),t--;var u=l-1;r[u]&&r[u][0]===Tn&&(n++,o=r[u][1]+o,u--),r[u]&&r[u][0]===Gn&&(i++,s=r[u][1]+s,u--),l=u}}if(sB(r[t][1])){var c=r[t][1].charAt(0);r[t][1]=r[t][1].slice(1),s+=c,o+=c}}if(t<r.length-1&&!r[t][1]){r.splice(t,1);break}if(s.length>0||o.length>0){s.length>0&&o.length>0&&(a=k0(o,s),a!==0&&(l>=0?r[l][1]+=o.substring(0,a):(r.splice(0,0,[rr,o.substring(0,a)]),t++),o=o.substring(a),s=s.substring(a)),a=I0(o,s),a!==0&&(r[t][1]=o.substring(o.length-a)+r[t][1],o=o.substring(0,o.length-a),s=s.substring(0,s.length-a)));var f=n+i;s.length===0&&o.length===0?(r.splice(t-f,f),t=t-f):s.length===0?(r.splice(t-f,f,[Tn,o]),t=t-f+1):o.length===0?(r.splice(t-f,f,[Gn,s]),t=t-f+1):(r.splice(t-f,f,[Gn,s],[Tn,o]),t=t-f+2)}t!==0&&r[t-1][0]===rr?(r[t-1][1]+=r[t][1],r.splice(t,1)):t++,n=0,i=0,s="",o="";break}}r[r.length-1][1]===""&&r.pop();var d=!1;for(t=1;t<r.length-1;)r[t-1][0]===rr&&r[t+1][0]===rr&&(r[t][1].substring(r[t][1].length-r[t-1][1].length)===r[t-1][1]?(r[t][1]=r[t-1][1]+r[t][1].substring(0,r[t][1].length-r[t-1][1].length),r[t+1][1]=r[t-1][1]+r[t+1][1],r.splice(t-1,1),d=!0):r[t][1].substring(0,r[t+1][1].length)==r[t+1][1]&&(r[t-1][1]+=r[t+1][1],r[t][1]=r[t][1].substring(r[t+1][1].length)+r[t+1][1],r.splice(t+1,1),d=!0)),t++;d&&iB(r,e)}function rB(r){return r>=55296&&r<=56319}function nB(r){return r>=56320&&r<=57343}function sB(r){return nB(r.charCodeAt(0))}function oB(r){return rB(r.charCodeAt(r.length-1))}function _ae(r){for(var e=[],t=0;t<r.length;t++)r[t][1].length>0&&e.push(r[t]);return e}function O0(r,e,t,i){return oB(r)||sB(i)?null:_ae([[rr,r],[Gn,e],[Tn,t],[rr,i]])}function Eae(r,e,t){var i=typeof t=="number"?{index:t,length:0}:t.oldRange,n=typeof t=="number"?null:t.newRange,s=r.length,o=e.length;if(i.length===0&&(n===null||n.length===0)){var a=i.index,l=r.slice(0,a),c=r.slice(a),u=n?n.index:null;e:{var f=a+o-s;if(u!==null&&u!==f||f<0||f>o)break e;var d=e.slice(0,f),h=e.slice(f);if(h!==c)break e;var p=Math.min(a,f),g=l.slice(0,p),b=d.slice(0,p);if(g!==b)break e;var y=l.slice(p),S=d.slice(p);return O0(g,y,S,c)}e:{if(u!==null&&u!==a)break e;var w=a,d=e.slice(0,w),h=e.slice(w);if(d!==l)break e;var _=Math.min(s-w,o-w),L=c.slice(c.length-_),$=h.slice(h.length-_);if(L!==$)break e;var y=c.slice(0,c.length-_),S=h.slice(0,h.length-_);return O0(l,y,S,L)}}if(i.length>0&&n&&n.length===0){e:{var g=r.slice(0,i.index),L=r.slice(i.index+i.length),p=g.length,_=L.length;if(o<p+_)break e;var b=e.slice(0,p),$=e.slice(o-_);if(g!==b||L!==$)break e;var y=r.slice(p,s-_),S=e.slice(p,o-_);return O0(g,y,S,L)}}return null}function Cg(r,e,t){return qd(r,e,t,!0)}Cg.INSERT=Tn;Cg.DELETE=Gn;Cg.EQUAL=rr;aB.exports=Cg});function L0(r,e){if(r.length<=1)return r;var t=r.length/2|0,i=r.slice(0,t),n=r.slice(t);L0(i,e),L0(n,e);for(var s=0,o=0,a=0;s<i.length&&o<n.length;){var l=e(i[s],n[o]);l<=0?r[a++]=i[s++]:r[a++]=n[o++]}for(;s<i.length;)r[a++]=i[s++];for(;o<n.length;)r[a++]=n[o++];return r}function cB(r,e,t){t===void 0&&(t=0);for(var i=e?[t]:[],n=0;n<r.length;n++){var s=r.charCodeAt(n);(s===13||s===10)&&(s===13&&n+1<r.length&&r.charCodeAt(n+1)===10&&n++,i.push(t+n+1))}return i}function uB(r){var e=r.start,t=r.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:r}function Tae(r){var e=uB(r.range);return e!==r.range?{newText:r.newText,range:e}:r}var lB,_i,Uc=R(()=>{"use strict";lB=function(){function r(e,t,i,n){this._uri=e,this._languageId=t,this._version=i,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(r.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),r.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content},r.prototype.update=function(e,t){for(var i=0,n=e;i<n.length;i++){var s=n[i];if(r.isIncremental(s)){var o=uB(s.range),a=this.offsetAt(o.start),l=this.offsetAt(o.end);this._content=this._content.substring(0,a)+s.text+this._content.substring(l,this._content.length);var c=Math.max(o.start.line,0),u=Math.max(o.end.line,0),f=this._lineOffsets,d=cB(s.text,!1,a);if(u-c===d.length)for(var h=0,p=d.length;h<p;h++)f[h+c+1]=d[h];else d.length<1e4?f.splice.apply(f,[c+1,u-c].concat(d)):this._lineOffsets=f=f.slice(0,c+1).concat(d,f.slice(u+1));var g=s.text.length-(l-a);if(g!==0)for(var h=c+1+d.length,p=f.length;h<p;h++)f[h]=f[h]+g}else if(r.isFull(s))this._content=s.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=t},r.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=cB(this._content,!0)),this._lineOffsets},r.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return{line:0,character:e};for(;i<n;){var s=Math.floor((i+n)/2);t[s]>e?n=s:i=s+1}var o=i-1;return{line:o,character:e-t[o]}},r.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var i=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,n),i)},Object.defineProperty(r.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),r.isIncremental=function(e){var t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")},r.isFull=function(e){var t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0},r}();(function(r){function e(n,s,o,a){return new lB(n,s,o,a)}r.create=e;function t(n,s,o){if(n instanceof lB)return n.update(s,o),n;throw new Error("TextDocument.update: document must be created by TextDocument.create")}r.update=t;function i(n,s){for(var o=n.getText(),a=L0(s.map(Tae),function(p,g){var b=p.range.start.line-g.range.start.line;return b===0?p.range.start.character-g.range.start.character:b}),l=0,c=[],u=0,f=a;u<f.length;u++){var d=f[u],h=n.offsetAt(d.range.start);if(h<l)throw new Error("Overlapping edit");h>l&&c.push(o.substring(l,h)),d.newText.length&&c.push(d.newText),l=n.offsetAt(d.range.end)}return c.push(o.substr(l)),c.join("")}r.applyEdits=i})(_i||(_i={}))});function $d(r,e){e===void 0&&(e=!1);var t=r.length,i=0,n="",s=0,o=16,a=0,l=0,c=0,u=0,f=0;function d(w,_){for(var L=0,$=0;L<w||!_;){var I=r.charCodeAt(i);if(I>=48&&I<=57)$=$*16+I-48;else if(I>=65&&I<=70)$=$*16+I-65+10;else if(I>=97&&I<=102)$=$*16+I-97+10;else break;i++,L++}return L<w&&($=-1),$}function h(w){i=w,n="",s=0,o=16,f=0}function p(){var w=i;if(r.charCodeAt(i)===48)i++;else for(i++;i<r.length&&Hc(r.charCodeAt(i));)i++;if(i<r.length&&r.charCodeAt(i)===46)if(i++,i<r.length&&Hc(r.charCodeAt(i)))for(i++;i<r.length&&Hc(r.charCodeAt(i));)i++;else return f=3,r.substring(w,i);var _=i;if(i<r.length&&(r.charCodeAt(i)===69||r.charCodeAt(i)===101))if(i++,(i<r.length&&r.charCodeAt(i)===43||r.charCodeAt(i)===45)&&i++,i<r.length&&Hc(r.charCodeAt(i))){for(i++;i<r.length&&Hc(r.charCodeAt(i));)i++;_=i}else f=3;return r.substring(w,_)}function g(){for(var w="",_=i;;){if(i>=t){w+=r.substring(_,i),f=2;break}var L=r.charCodeAt(i);if(L===34){w+=r.substring(_,i),i++;break}if(L===92){if(w+=r.substring(_,i),i++,i>=t){f=2;break}var $=r.charCodeAt(i++);switch($){case 34:w+='"';break;case 92:w+="\\";break;case 47:w+="/";break;case 98:w+="\b";break;case 102:w+="\f";break;case 110:w+=`
`;break;case 114:w+="\r";break;case 116:w+=" ";break;case 117:var I=d(4,!0);I>=0?w+=String.fromCharCode(I):f=4;break;default:f=5}_=i;continue}if(L>=0&&L<=31)if(Bd(L)){w+=r.substring(_,i),f=2;break}else f=6;i++}return w}function b(){if(n="",f=0,s=i,l=a,u=c,i>=t)return s=t,o=17;var w=r.charCodeAt(i);if(A0(w)){do i++,n+=String.fromCharCode(w),w=r.charCodeAt(i);while(A0(w));return o=15}if(Bd(w))return i++,n+=String.fromCharCode(w),w===13&&r.charCodeAt(i)===10&&(i++,n+=`
`),a++,c=i,o=14;switch(w){case 123:return i++,o=1;case 125:return i++,o=2;case 91:return i++,o=3;case 93:return i++,o=4;case 58:return i++,o=6;case 44:return i++,o=5;case 34:return i++,n=g(),o=10;case 47:var _=i-1;if(r.charCodeAt(i+1)===47){for(i+=2;i<t&&!Bd(r.charCodeAt(i));)i++;return n=r.substring(_,i),o=12}if(r.charCodeAt(i+1)===42){i+=2;for(var L=t-1,$=!1;i<L;){var I=r.charCodeAt(i);if(I===42&&r.charCodeAt(i+1)===47){i+=2,$=!0;break}i++,Bd(I)&&(I===13&&r.charCodeAt(i)===10&&i++,a++,c=i)}return $||(i++,f=1),n=r.substring(_,i),o=13}return n+=String.fromCharCode(w),i++,o=16;case 45:if(n+=String.fromCharCode(w),i++,i===t||!Hc(r.charCodeAt(i)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return n+=p(),o=11;default:for(;i<t&&y(w);)i++,w=r.charCodeAt(i);if(s!==i){switch(n=r.substring(s,i),n){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return n+=String.fromCharCode(w),i++,o=16}}function y(w){if(A0(w)||Bd(w))return!1;switch(w){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function S(){var w;do w=b();while(w>=12&&w<=15);return w}return{setPosition:h,getPosition:function(){return i},scan:e?S:b,getToken:function(){return o},getTokenValue:function(){return n},getTokenOffset:function(){return s},getTokenLength:function(){return i-s},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return s-u},getTokenError:function(){return f}}}function A0(r){return r===32||r===9||r===11||r===12||r===160||r===5760||r>=8192&&r<=8203||r===8239||r===8287||r===12288||r===65279}function Bd(r){return r===10||r===13||r===8232||r===8233}function Hc(r){return r>=48&&r<=57}var _g=R(()=>{"use strict"});function F0(r,e,t){var i,n,s,o,a;if(e){for(o=e.offset,a=o+e.length,s=o;s>0&&!jd(r,s-1);)s--;for(var l=a;l<r.length&&!jd(r,l);)l++;n=r.substring(s,l),i=Dae(n,t)}else n=r,i=0,s=0,o=0,a=r.length;var c=Rae(t,r),u=!1,f=0,d;t.insertSpaces?d=M0(" ",t.tabSize||4):d=" ";var h=$d(n,!1),p=!1;function g(){return c+M0(d,i+f)}function b(){var F=h.scan();for(u=!1;F===15||F===14;)u=u||F===14,F=h.scan();return p=F===16||h.getTokenError()!==0,F}var y=[];function S(F,j,X){!p&&(!e||j<a&&X>o)&&r.substring(j,X)!==F&&y.push({offset:j,length:X-j,content:F})}var w=b();if(w!==17){var _=h.getTokenOffset()+s,L=M0(d,i);S(L,s,_)}for(;w!==17;){for(var $=h.getTokenOffset()+h.getTokenLength()+s,I=b(),W="",A=!1;!u&&(I===12||I===13);){var M=h.getTokenOffset()+s;S(" ",$,M),$=h.getTokenOffset()+h.getTokenLength()+s,A=I===12,W=A?g():"",I=b()}if(I===2)w!==1&&(f--,W=g());else if(I===4)w!==3&&(f--,W=g());else{switch(w){case 3:case 1:f++,W=g();break;case 5:case 12:W=g();break;case 13:u?W=g():A||(W=" ");break;case 6:A||(W=" ");break;case 10:if(I===6){A||(W="");break}case 7:case 8:case 9:case 11:case 2:case 4:I===12||I===13?A||(W=" "):I!==5&&I!==17&&(p=!0);break;case 16:p=!0;break}u&&(I===12||I===13)&&(W=g())}I===17&&(W=t.insertFinalNewline?c:"");var k=h.getTokenOffset()+s;S(W,$,k),w=I}return y}function M0(r,e){for(var t="",i=0;i<e;i++)t+=r;return t}function Dae(r,e){for(var t=0,i=0,n=e.tabSize||4;t<r.length;){var s=r.charAt(t);if(s===" ")i++;else if(s===" ")i+=n;else break;t++}return Math.floor(i/n)}function Rae(r,e){for(var t=0;t<e.length;t++){var i=e.charAt(t);if(i==="\r")return t+1<e.length&&e.charAt(t+1)===`
`?`\r
`:"\r";if(i===`
`)return`
`}return r&&r.eol||`
`}function jd(r,e){return`\r
`.indexOf(r.charAt(e))!==-1}var N0=R(()=>{_g();"use strict"});function fB(r,e,t){e===void 0&&(e=[]),t===void 0&&(t=Ud.DEFAULT);var i=null,n=[],s=[];function o(l){Array.isArray(n)?n.push(l):i!==null&&(n[i]=l)}var a={onObjectBegin:function(){var l={};o(l),s.push(n),n=l,i=null},onObjectProperty:function(l){i=l},onObjectEnd:function(){n=s.pop()},onArrayBegin:function(){var l=[];o(l),s.push(n),n=l,i=null},onArrayEnd:function(){n=s.pop()},onLiteralValue:o,onError:function(l,c,u){e.push({error:l,offset:c,length:u})}};return $0(r,a,t),n[0]}function q0(r,e,t){e===void 0&&(e=[]),t===void 0&&(t=Ud.DEFAULT);var i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function n(l){i.type==="property"&&(i.length=l-i.offset,i=i.parent)}function s(l){return i.children.push(l),l}var o={onObjectBegin:function(l){i=s({type:"object",offset:l,length:-1,parent:i,children:[]})},onObjectProperty:function(l,c,u){i=s({type:"property",offset:c,length:-1,parent:i,children:[]}),i.children.push({type:"string",value:l,offset:c,length:u,parent:i})},onObjectEnd:function(l,c){n(l+c),i.length=l+c-i.offset,i=i.parent,n(l+c)},onArrayBegin:function(l,c){i=s({type:"array",offset:l,length:-1,parent:i,children:[]})},onArrayEnd:function(l,c){i.length=l+c-i.offset,i=i.parent,n(l+c)},onLiteralValue:function(l,c,u){s({type:Pae(l),offset:c,length:u,parent:i,value:l}),n(c+u)},onSeparator:function(l,c,u){i.type==="property"&&(l===":"?i.colonOffset=c:l===","&&n(c))},onError:function(l,c,u){e.push({error:l,offset:c,length:u})}};$0(r,o,t);var a=i.children[0];return a&&delete a.parent,a}function Eg(r,e){if(!!r){for(var t=r,i=0,n=e;i<n.length;i++){var s=n[i];if(typeof s=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;for(var o=!1,a=0,l=t.children;a<l.length;a++){var c=l[a];if(Array.isArray(c.children)&&c.children[0].value===s){t=c.children[1],o=!0;break}}if(!o)return}else{var u=s;if(t.type!=="array"||u<0||!Array.isArray(t.children)||u>=t.children.length)return;t=t.children[u]}}return t}}function $0(r,e,t){t===void 0&&(t=Ud.DEFAULT);var i=$d(r,!1);function n(A){return A?function(){return A(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}function s(A){return A?function(M){return A(M,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}var o=n(e.onObjectBegin),a=s(e.onObjectProperty),l=n(e.onObjectEnd),c=n(e.onArrayBegin),u=n(e.onArrayEnd),f=s(e.onLiteralValue),d=s(e.onSeparator),h=n(e.onComment),p=s(e.onError),g=t&&t.disallowComments,b=t&&t.allowTrailingComma;function y(){for(;;){var A=i.scan();switch(i.getTokenError()){case 4:S(14);break;case 5:S(15);break;case 3:S(13);break;case 1:g||S(11);break;case 2:S(12);break;case 6:S(16);break}switch(A){case 12:case 13:g?S(10):h();break;case 16:S(1);break;case 15:case 14:break;default:return A}}}function S(A,M,k){if(M===void 0&&(M=[]),k===void 0&&(k=[]),p(A),M.length+k.length>0)for(var F=i.getToken();F!==17;){if(M.indexOf(F)!==-1){y();break}else if(k.indexOf(F)!==-1)break;F=y()}}function w(A){var M=i.getTokenValue();return A?f(M):a(M),y(),!0}function _(){switch(i.getToken()){case 11:var A=i.getTokenValue(),M=Number(A);isNaN(M)&&(S(2),M=0),f(M);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return y(),!0}function L(){return i.getToken()!==10?(S(3,[],[2,5]),!1):(w(!1),i.getToken()===6?(d(":"),y(),W()||S(4,[],[2,5])):S(5,[],[2,5]),!0)}function $(){o(),y();for(var A=!1;i.getToken()!==2&&i.getToken()!==17;){if(i.getToken()===5){if(A||S(4,[],[]),d(","),y(),i.getToken()===2&&b)break}else A&&S(6,[],[]);L()||S(4,[],[2,5]),A=!0}return l(),i.getToken()!==2?S(7,[2],[]):y(),!0}function I(){c(),y();for(var A=!1;i.getToken()!==4&&i.getToken()!==17;){if(i.getToken()===5){if(A||S(4,[],[]),d(","),y(),i.getToken()===4&&b)break}else A&&S(6,[],[]);W()||S(4,[],[4,5]),A=!0}return u(),i.getToken()!==4?S(8,[4],[]):y(),!0}function W(){switch(i.getToken()){case 3:return I();case 1:return $();case 10:return w(!0);default:return _()}}return y(),i.getToken()===17?t.allowEmptyContent?!0:(S(4,[],[]),!1):W()?(i.getToken()!==17&&S(9,[],[]),!0):(S(4,[],[]),!1)}function Pae(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(r){if(Array.isArray(r))return"array"}else return"null";return"object"}default:return"null"}}var Ud,B0=R(()=>{_g();"use strict";(function(r){r.DEFAULT={allowTrailingComma:!1}})(Ud||(Ud={}))});function dB(r,e,t,i){for(var n,s=e.slice(),o=[],a=q0(r,o),l=void 0,c=void 0;s.length>0&&(c=s.pop(),l=Eg(a,s),l===void 0&&t!==void 0);)typeof c=="string"?t=(n={},n[c]=t,n):t=[t];if(l)if(l.type==="object"&&typeof c=="string"&&Array.isArray(l.children)){var u=Eg(l,[c]);if(u!==void 0)if(t===void 0){if(!u.parent)throw new Error("Malformed AST");var f=l.children.indexOf(u.parent),d=void 0,h=u.parent.offset+u.parent.length;if(f>0){var p=l.children[f-1];d=p.offset+p.length}else if(d=l.offset+1,l.children.length>1){var g=l.children[1];h=g.offset}return Ja(r,{offset:d,length:h-d,content:""},i)}else return Ja(r,{offset:u.offset,length:u.length,content:JSON.stringify(t)},i);else{if(t===void 0)return[];var b=JSON.stringify(c)+": "+JSON.stringify(t),y=i.getInsertionIndex?i.getInsertionIndex(l.children.map(function(A){return A.children[0].value})):l.children.length,S=void 0;if(y>0){var p=l.children[y-1];S={offset:p.offset+p.length,length:0,content:","+b}}else l.children.length===0?S={offset:l.offset+1,length:0,content:b}:S={offset:l.offset+1,length:0,content:b+","};return Ja(r,S,i)}}else if(l.type==="array"&&typeof c=="number"&&Array.isArray(l.children)){var w=c;if(w===-1){var b=""+JSON.stringify(t),S=void 0;if(l.children.length===0)S={offset:l.offset+1,length:0,content:b};else{var p=l.children[l.children.length-1];S={offset:p.offset+p.length,length:0,content:","+b}}return Ja(r,S,i)}else if(t===void 0&&l.children.length>=0){var _=c,L=l.children[_],S=void 0;if(l.children.length===1)S={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===_){var p=l.children[_-1],$=p.offset+p.length,I=l.offset+l.length;S={offset:$,length:I-2-$,content:""}}else S={offset:L.offset,length:l.children[_+1].offset-L.offset,content:""};return Ja(r,S,i)}else if(t!==void 0){var S=void 0,b=""+JSON.stringify(t);if(!i.isArrayInsertion&&l.children.length>c){var W=l.children[c];S={offset:W.offset,length:W.length,content:b}}else if(l.children.length===0||c===0)S={offset:l.offset+1,length:0,content:l.children.length===0?b:b+","};else{var y=c>l.children.length?l.children.length:c,p=l.children[y-1];S={offset:p.offset+p.length,length:0,content:","+b}}return Ja(r,S,i)}else throw new Error("Can not "+(t===void 0?"remove":i.isArrayInsertion?"insert":"modify")+" Array index "+w+" as length is not sufficient")}else throw new Error("Can not add "+(typeof c!="number"?"index":"property")+" to parent of type "+l.type);else{if(t===void 0)throw new Error("Can not delete in empty document");return Ja(r,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(t)},i)}}function Ja(r,e,t){if(!t.formattingOptions)return[e];var i=Tg(r,e),n=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;n>0&&!jd(i,n-1);)n--;for(;s<i.length&&!jd(i,s);)s++}for(var o=F0(i,{offset:n,length:s-n},t.formattingOptions),a=o.length-1;a>=0;a--){var l=o[a];i=Tg(i,l),n=Math.min(n,l.offset),s=Math.max(s,l.offset+l.length),s+=l.content.length-l.length}var c=r.length-(i.length-s)-n;return[{offset:n,length:c,content:i.substring(n,s)}]}function Tg(r,e){return r.substring(0,e.offset)+e.content+r.substring(e.offset+e.length)}var hB=R(()=>{N0();B0();"use strict"});function pB(r,e,t,i){return dB(r,e,t,i)}function mB(r,e){for(var t=e.length-1;t>=0;t--)r=Tg(r,e[t]);return r}var Wc,Hd=R(()=>{N0();hB();_g();B0();"use strict";Wc=fB});function vB(r,e){if(!r||!Wd.default.existsSync(r))return{contents:{}};let t,i=B.file(r).toString();try{t=Wd.default.readFileSync(r,"utf8")}catch(o){t=""}let[n,s]=Oae(t);return n&&n.length&&e(Lae(i,t,n)),{contents:s}}function Oae(r){if(r.length==0)return[[],{}];let e=[],t=Wc(r,e,{allowTrailingComma:!0});function i(s,o,a,l){if(a.length==0)s[o]=n(l);else{s[o]||(s[o]={});let c=s[o],u=a.shift();i(c,u,a,l)}}function n(s,o=!1){if(!Wt(s))return s;if(ng(s))return{};let a={};for(let l of Object.keys(s))if(o&&l.includes(".")){let c=l.split("."),u=c.shift();i(a,u,c,s[l])}else a[l]=n(s[l]);return a}return[e,n(t,!0)]}function Lae(r,e,t){let i=[],n=_i.create(r,"json",0,e);for(let s of t){let o="parse error";switch(s.error){case 2:o="invalid number";break;case 8:o="close brace expected";break;case 5:o="colon expected";break;case 6:o="comma expected";break;case 9:o="end of file expected";break;case 16:o="invaliad character";break;case 10:o="invalid commment token";break;case 15:o="invalid escape character";break;case 1:o="invalid symbol";break;case 14:o="invalid unicode";break;case 3:o="property name expected";break;case 13:o="unexpected end of number";break;case 12:o="unexpected end of string";break;case 11:o="unexpected end of comment";break;case 4:o="value expected";break;default:o="Unknwn error";break}let a={start:n.positionAt(s.offset),end:n.positionAt(s.offset+s.length)},l=gB.Location.create(r,a);i.push({location:l,message:o})}return i}function zd(r,e,t,i){let n=e.split("."),s=n.pop(),o=r;for(let a=0;a<n.length;a++){let l=n[a],c=o[l];switch(typeof c){case"function":{c=o[l]={};break}case"undefined":{c=o[l]={};break}case"object":break;default:i(`Ignoring ${e} as ${n.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}o=c}typeof o=="object"?o[s]=t:i(`Ignoring ${e} as ${n.join(".")} is ${JSON.stringify(o)}`)}function bB(r,e){let t=e.split(".");yB(r,t)}function yB(r,e){let t=e.shift();if(e.length===0){delete r[t];return}if(Object.keys(r).includes(t)){let i=r[t];typeof i=="object"&&!Array.isArray(i)&&(yB(i,e),Object.keys(i).length===0&&delete r[t])}}function Rg(r,e,t){function i(o,a){let l=o;for(let c=0;c<a.length;c++){if(typeof l!="object"||l===null)return;l=l[a[c]]}return l}let n=e.split("."),s=i(r,n);return typeof s=="undefined"?t:s}function wB(){let r=Dg.default.join(Iae,"data/schema.json");if(!Wd.default.existsSync(r))return console.error("schema.json not found, reinstall coc.nvim to fix this!"),{contents:{}};let e=Wd.default.readFileSync(r,"utf8"),{properties:t}=JSON.parse(e),i={};return Object.keys(t).forEach(n=>{let s=t[n].default;s!==void 0&&zd(i,n,s,o=>{kae.error(o)})}),{contents:i}}function j0(r,e){let t=[];for(let i of Object.keys(r)){let n=r[i],s=e?`${e}.${i}`:i;t.push(s),Wt(n)&&t.push(...j0(n,s))}return t}function xB(r,e){let t=[],i=j0(r),n=j0(e),s=n.filter(a=>!i.includes(a)),o=i.filter(a=>!n.includes(a));t.push(...s),t.push(...o);for(let a of i){if(!n.includes(a))continue;let l=Rg(r,a),c=Rg(e,a);je(l,c)||t.push(a)}return t}var gB,Wd,Dg,kae,Iae,U0=R(()=>{gB=E(H());Uc();Hd();Wr();ri();Wd=E(require("fs"));qe();Dg=E(require("path")),kae=U()("configuration-util"),Iae=(0,Dg.dirname)(__dirname)});var nr,H0=R(()=>{Wr();ri();U0();nr=class{constructor(e={}){this._contents=e}get contents(){return this._contents}clone(){return new nr(Ls(this._contents))}getValue(e){return e?Rg(this.contents,e):this.contents}merge(...e){let t=Ls(this.contents);for(let i of e)this.mergeContents(t,i.contents);return new nr(t)}freeze(){return Object.isFrozen(this._contents)||Object.freeze(this._contents),this}mergeContents(e,t){for(let i of Object.keys(t)){if(i in e&&Wt(e[i])&&Wt(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Ls(t[i])}}setValue(e,t){zd(this.contents,e,t,i=>{console.error(i)})}removeValue(e){bB(this.contents,e)}}});var Pg,SB=R(()=>{H0();Pg=class{constructor(e,t,i,n=new nr){this._defaultConfiguration=e;this._userConfiguration=t;this._workspaceConfiguration=i;this._memoryConfiguration=n}getConsolidateConfiguration(){return this._consolidateConfiguration||(this._consolidateConfiguration=this._defaultConfiguration.merge(this._userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._consolidateConfiguration=this._consolidateConfiguration.freeze()),this._consolidateConfiguration}getValue(e){return this.getConsolidateConfiguration().getValue(e)}inspect(e){let t=this.getConsolidateConfiguration(),{_workspaceConfiguration:i,_memoryConfiguration:n}=this;return{default:this._defaultConfiguration.freeze().getValue(e),user:this._userConfiguration.freeze().getValue(e),workspace:i.freeze().getValue(e),memory:n.freeze().getValue(e),value:t.getValue(e)}}get defaults(){return this._defaultConfiguration}get user(){return this._userConfiguration}get workspace(){return this._workspaceConfiguration}toData(){return{defaults:{contents:this._defaultConfiguration.contents},user:{contents:this._userConfiguration.contents},workspace:{contents:this._workspaceConfiguration.contents}}}}});var _B=x((eCe,CB)=>{CB.exports=function(r,e){for(var t=[],i=0;i<r.length;i++){var n=e(r[i],i);Aae(n)?t.push.apply(t,n):t.push(n)}return t};var Aae=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"}});var PB=x((tCe,RB)=>{"use strict";RB.exports=EB;function EB(r,e,t){r instanceof RegExp&&(r=TB(r,t)),e instanceof RegExp&&(e=TB(e,t));var i=DB(r,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+r.length,i[1]),post:t.slice(i[1]+e.length)}}function TB(r,e){var t=e.match(r);return t?t[0]:null}EB.range=DB;function DB(r,e,t){var i,n,s,o,a,l=t.indexOf(r),c=t.indexOf(e,l+1),u=l;if(l>=0&&c>0){if(r===e)return[l,c];for(i=[],s=t.length;u>=0&&!a;)u==l?(i.push(u),l=t.indexOf(r,u+1)):i.length==1?a=[i.pop(),c]:(n=i.pop(),n<s&&(s=n,o=c),c=t.indexOf(e,u+1)),u=l<c&&l>=0?l:c;i.length&&(a=[s,o])}return a}});var NB=x((iCe,MB)=>{var Fae=_B(),kB=PB();MB.exports=qae;var IB="\0SLASH"+Math.random()+"\0",OB="\0OPEN"+Math.random()+"\0",W0="\0CLOSE"+Math.random()+"\0",LB="\0COMMA"+Math.random()+"\0",AB="\0PERIOD"+Math.random()+"\0";function z0(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Mae(r){return r.split("\\\\").join(IB).split("\\{").join(OB).split("\\}").join(W0).split("\\,").join(LB).split("\\.").join(AB)}function Nae(r){return r.split(IB).join("\\").split(OB).join("{").split(W0).join("}").split(LB).join(",").split(AB).join(".")}function FB(r){if(!r)return[""];var e=[],t=kB("{","}",r);if(!t)return r.split(",");var i=t.pre,n=t.body,s=t.post,o=i.split(",");o[o.length-1]+="{"+n+"}";var a=FB(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function qae(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),zc(Mae(r),!0).map(Nae)):[]}function $ae(r){return"{"+r+"}"}function Bae(r){return/^-?0\d/.test(r)}function jae(r,e){return r<=e}function Uae(r,e){return r>=e}function zc(r,e){var t=[],i=kB("{","}",r);if(!i||/\$$/.test(i.pre))return[r];var n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),o=n||s,a=i.body.indexOf(",")>=0;if(!o&&!a)return i.post.match(/,.*\}/)?(r=i.pre+"{"+i.body+W0+i.post,zc(r)):[r];var l;if(o)l=i.body.split(/\.\./);else if(l=FB(i.body),l.length===1&&(l=zc(l[0],!1).map($ae),l.length===1)){var u=i.post.length?zc(i.post,!1):[""];return u.map(function(k){return i.pre+l[0]+k})}var c=i.pre,u=i.post.length?zc(i.post,!1):[""],f;if(o){var d=z0(l[0]),h=z0(l[1]),p=Math.max(l[0].length,l[1].length),g=l.length==3?Math.abs(z0(l[2])):1,b=jae,y=h<d;y&&(g*=-1,b=Uae);var S=l.some(Bae);f=[];for(var w=d;b(w,h);w+=g){var _;if(s)_=String.fromCharCode(w),_==="\\"&&(_="");else if(_=String(w),S){var L=p-_.length;if(L>0){var $=new Array(L+1).join("0");w<0?_="-"+$+_.slice(1):_=$+_}}f.push(_)}}else f=Fae(l,function(M){return zc(M,!1)});for(var I=0;I<f.length;I++)for(var W=0;W<u.length;W++){var A=c+f[I]+u[W];(!e||o||A)&&t.push(A)}return t}});var Do=x((rCe,HB)=>{HB.exports=Kr;Kr.Minimatch=ni;var Vd={sep:"/"};try{Vd=require("path")}catch(r){}var V0=Kr.GLOBSTAR=ni.GLOBSTAR={},Hae=NB(),qB={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},G0="[^/]",K0=G0+"*?",Wae="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",zae="(?:(?!(?:\\/|^)\\.).)*?",$B=Vae("().*{}+?[]^$\\!");function Vae(r){return r.split("").reduce(function(e,t){return e[t]=!0,e},{})}var BB=/\/+/;Kr.filter=Gae;function Gae(r,e){return e=e||{},function(t,i,n){return Kr(t,r,e)}}function jB(r,e){r=r||{},e=e||{};var t={};return Object.keys(e).forEach(function(i){t[i]=e[i]}),Object.keys(r).forEach(function(i){t[i]=r[i]}),t}Kr.defaults=function(r){if(!r||!Object.keys(r).length)return Kr;var e=Kr,t=function(n,s,o){return e.minimatch(n,s,jB(r,o))};return t.Minimatch=function(n,s){return new e.Minimatch(n,jB(r,s))},t};ni.defaults=function(r){return!r||!Object.keys(r).length?ni:Kr.defaults(r).Minimatch};function Kr(r,e,t){if(typeof e!="string")throw new TypeError("glob pattern string required");return t||(t={}),!t.nocomment&&e.charAt(0)==="#"?!1:e.trim()===""?r==="":new ni(e,t).match(r)}function ni(r,e){if(!(this instanceof ni))return new ni(r,e);if(typeof r!="string")throw new TypeError("glob pattern string required");e||(e={}),r=r.trim(),Vd.sep!=="/"&&(r=r.split(Vd.sep).join("/")),this.options=e,this.set=[],this.pattern=r,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}ni.prototype.debug=function(){};ni.prototype.make=Kae;function Kae(){if(!this._made){var r=this.pattern,e=this.options;if(!e.nocomment&&r.charAt(0)==="#"){this.comment=!0;return}if(!r){this.empty=!0;return}this.parseNegate();var t=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,t),t=this.globParts=t.map(function(i){return i.split(BB)}),this.debug(this.pattern,t),t=t.map(function(i,n,s){return i.map(this.parse,this)},this),this.debug(this.pattern,t),t=t.filter(function(i){return i.indexOf(!1)===-1}),this.debug(this.pattern,t),this.set=t}}ni.prototype.parseNegate=Jae;function Jae(){var r=this.pattern,e=!1,t=this.options,i=0;if(!t.nonegate){for(var n=0,s=r.length;n<s&&r.charAt(n)==="!";n++)e=!e,i++;i&&(this.pattern=r.substr(i)),this.negate=e}}Kr.braceExpand=function(r,e){return UB(r,e)};ni.prototype.braceExpand=UB;function UB(r,e){if(e||(this instanceof ni?e=this.options:e={}),r=typeof r=="undefined"?this.pattern:r,typeof r=="undefined")throw new TypeError("undefined pattern");return e.nobrace||!r.match(/\{.*\}/)?[r]:Hae(r)}ni.prototype.parse=Yae;var kg={};function Yae(r,e){if(r.length>1024*64)throw new TypeError("pattern is too long");var t=this.options;if(!t.noglobstar&&r==="**")return V0;if(r==="")return"";var i="",n=!!t.nocase,s=!1,o=[],a=[],l,c=!1,u=-1,f=-1,d=r.charAt(0)==="."?"":t.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",h=this;function p(){if(l){switch(l){case"*":i+=K0,n=!0;break;case"?":i+=G0,n=!0;break;default:i+="\\"+l;break}h.debug("clearStateChar %j %j",l,i),l=!1}}for(var g=0,b=r.length,y;g<b&&(y=r.charAt(g));g++){if(this.debug("%s %s %s %j",r,g,i,y),s&&$B[y]){i+="\\"+y,s=!1;continue}switch(y){case"/":return!1;case"\\":p(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",r,g,i,y),c){this.debug(" in class"),y==="!"&&g===f+1&&(y="^"),i+=y;continue}h.debug("call clearStateChar %j",l),p(),l=y,t.noext&&p();continue;case"(":if(c){i+="(";continue}if(!l){i+="\\(";continue}o.push({type:l,start:g-1,reStart:i.length,open:qB[l].open,close:qB[l].close}),i+=l==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",l,i),l=!1;continue;case")":if(c||!o.length){i+="\\)";continue}p(),n=!0;var S=o.pop();i+=S.close,S.type==="!"&&a.push(S),S.reEnd=i.length;continue;case"|":if(c||!o.length||s){i+="\\|",s=!1;continue}p(),i+="|";continue;case"[":if(p(),c){i+="\\"+y;continue}c=!0,f=g,u=i.length,i+=y;continue;case"]":if(g===f+1||!c){i+="\\"+y,s=!1;continue}if(c){var w=r.substring(f+1,g);try{RegExp("["+w+"]")}catch(bi){var _=this.parse(w,kg);i=i.substr(0,u)+"\\["+_[0]+"\\]",n=n||_[1],c=!1;continue}}n=!0,c=!1,i+=y;continue;default:p(),s?s=!1:$B[y]&&!(y==="^"&&c)&&(i+="\\"),i+=y}}for(c&&(w=r.substr(f+1),_=this.parse(w,kg),i=i.substr(0,u)+"\\["+_[0],n=n||_[1]),S=o.pop();S;S=o.pop()){var L=i.slice(S.reStart+S.open.length);this.debug("setting tail",i,S),L=L.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(bi,eo,ms){return ms||(ms="\\"),eo+eo+ms+"|"}),this.debug(`tail=%j
%s`,L,L,S,i);var $=S.type==="*"?K0:S.type==="?"?G0:"\\"+S.type;n=!0,i=i.slice(0,S.reStart)+$+"\\("+L}p(),s&&(i+="\\\\");var I=!1;switch(i.charAt(0)){case".":case"[":case"(":I=!0}for(var W=a.length-1;W>-1;W--){var A=a[W],M=i.slice(0,A.reStart),k=i.slice(A.reStart,A.reEnd-8),F=i.slice(A.reEnd-8,A.reEnd),j=i.slice(A.reEnd);F+=j;var X=M.split("(").length-1,ae=j;for(g=0;g<X;g++)ae=ae.replace(/\)[+*?]?/,"");j=ae;var Pe="";j===""&&e!==kg&&(Pe="$");var ke=M+k+j+Pe+F;i=ke}if(i!==""&&n&&(i="(?=.)"+i),I&&(i=d+i),e===kg)return[i,n];if(!n)return Qae(r);var Qe=t.nocase?"i":"";try{var St=new RegExp("^"+i+"$",Qe)}catch(bi){return new RegExp("$.")}return St._glob=r,St._src=i,St}Kr.makeRe=function(r,e){return new ni(r,e||{}).makeRe()};ni.prototype.makeRe=Xae;function Xae(){if(this.regexp||this.regexp===!1)return this.regexp;var r=this.set;if(!r.length)return this.regexp=!1,this.regexp;var e=this.options,t=e.noglobstar?K0:e.dot?Wae:zae,i=e.nocase?"i":"",n=r.map(function(s){return s.map(function(o){return o===V0?t:typeof o=="string"?ele(o):o._src}).join("\\/")}).join("|");n="^(?:"+n+")$",this.negate&&(n="^(?!"+n+").*$");try{this.regexp=new RegExp(n,i)}catch(s){this.regexp=!1}return this.regexp}Kr.match=function(r,e,t){t=t||{};var i=new ni(e,t);return r=r.filter(function(n){return i.match(n)}),i.options.nonull&&!r.length&&r.push(e),r};ni.prototype.match=Zae;function Zae(r,e){if(this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return r==="";if(r==="/"&&e)return!0;var t=this.options;Vd.sep!=="/"&&(r=r.split(Vd.sep).join("/")),r=r.split(BB),this.debug(this.pattern,"split",r);var i=this.set;this.debug(this.pattern,"set",i);var n,s;for(s=r.length-1;s>=0&&(n=r[s],!n);s--);for(s=0;s<i.length;s++){var o=i[s],a=r;t.matchBase&&o.length===1&&(a=[n]);var l=this.matchOne(a,o,e);if(l)return t.flipNegate?!0:!this.negate}return t.flipNegate?!1:this.negate}ni.prototype.matchOne=function(r,e,t){var i=this.options;this.debug("matchOne",{this:this,file:r,pattern:e}),this.debug("matchOne",r.length,e.length);for(var n=0,s=0,o=r.length,a=e.length;n<o&&s<a;n++,s++){this.debug("matchOne loop");var l=e[s],c=r[n];if(this.debug(e,l,c),l===!1)return!1;if(l===V0){this.debug("GLOBSTAR",[e,l,c]);var u=n,f=s+1;if(f===a){for(this.debug("** at the end");n<o;n++)if(r[n]==="."||r[n]===".."||!i.dot&&r[n].charAt(0)===".")return!1;return!0}for(;u<o;){var d=r[u];if(this.debug(`
globstar while`,r,u,e,f,d),this.matchOne(r.slice(u),e.slice(f),t))return this.debug("globstar found match!",u,o,d),!0;if(d==="."||d===".."||!i.dot&&d.charAt(0)==="."){this.debug("dot detected!",r,u,e,f);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(t&&(this.debug(`
>>> no match, partial?`,r,u,e,f),u===o))}var h;if(typeof l=="string"?(i.nocase?h=c.toLowerCase()===l.toLowerCase():h=c===l,this.debug("string match",l,c,h)):(h=c.match(l),this.debug("pattern match",l,c,h)),!h)return!1}if(n===o&&s===a)return!0;if(n===o)return t;if(s===a){var p=n===o-1&&r[n]==="";return p}throw new Error("wtf?")};function Qae(r){return r.replace(/\\(.)/g,"$1")}function ele(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});async function Mt(r){let e=null;try{e=await Jr.default.stat(r)}catch(t){}return e}function zB(r,e){return new Promise((t,i)=>{Jr.default.rename(r,e,n=>{if(n)return i(n);t()})})}function Gd(r,e,t,i=!1,n=!0){let s=J0.default.homedir(),o=Kd(r);if(lt(o,s,!0))return null;if(n&&t&<(t,o,!0)&&Ro(t,e))return t;let a=o.split(Cr.default.sep);if(i){for(;a.length>0;){let l=a.join(Cr.default.sep);if(l==s)break;if(l!=s&&Ro(l,e))return l;a.pop()}return null}else{let l=[a.shift()];for(let c of a){l.push(c);let u=l.join(Cr.default.sep);if(u!=s&&Ro(u,e))return u}return null}}function Ro(r,e){try{let t=Jr.default.readdirSync(r);for(let i of e)if(i.includes("*")?WB.default.match(t,i,{nobrace:!0,noext:!0,nocomment:!0,nonegate:!0,dot:!0}).length!==0:t.includes(i))return!0}catch(t){}return!1}function Vc(r,e){let t=Cr.default.parse(e).root,i=Array.isArray(r)?r:[r];for(;e&&e!==t;){if(Ro(e,i))for(let s of i){let o=Cr.default.join(e,s);if(Jr.default.existsSync(o))return o}e=Cr.default.dirname(e)}return null}function Gc(r,e){return new Promise((t,i)=>{Jr.default.readFile(r,e,(n,s)=>{n&&i(n),t(s)})})}function VB(r){let e,t=0;return new Promise((i,n)=>{Jr.default.createReadStream(r).on("error",s=>n(s)).on("data",s=>{for(e=0;e<s.length;++e)s[e]==10&&t++}).on("end",()=>i(t))})}function Ig(r,e,t){if(!Jr.default.existsSync(r))return Promise.reject(new Error(`file does not exist: ${r}`));let i=[],n=Y0.default.createInterface({input:Jr.default.createReadStream(r,{encoding:"utf8"}),crlfDelay:1/0,terminal:!1}),s=0;return new Promise((o,a)=>{n.on("line",l=>{s==0&&l.startsWith("\uFEFF")&&(l=l.slice(1)),s>=e&&s<=t&&i.push(l),s==t&&n.close(),s=s+1}),n.on("close",()=>{o(i)}),n.on("error",a)})}function GB(r,e){if(!Jr.default.existsSync(r))return Promise.reject(new Error(`file does not exist: ${r}`));let t=Y0.default.createInterface({input:Jr.default.createReadStream(r,{encoding:"utf8"}),crlfDelay:1/0,terminal:!1}),i=0;return new Promise((n,s)=>{t.on("line",o=>{if(i==e){i==0&&o.startsWith("\uFEFF")&&(o=o.slice(1)),t.close(),n(o);return}i=i+1}),t.on("error",s)})}async function KB(r,e){await Jr.default.writeFile(r,e,{encoding:"utf8"})}function Og(r){return r.startsWith("file:")}function lt(r,e,t=!1){let i=Kd(Cr.default.resolve(Cr.default.normalize(r))),n=Kd(Cr.default.resolve(Cr.default.normalize(e)));return i=="//"&&(i="/"),i==n?!!t:i.endsWith(Cr.default.sep)?n.startsWith(i):n.startsWith(i)&&n[i.length]==Cr.default.sep}function Kd(r){return J0.default.platform()!="win32"||r[1]!=":"?r:r[0].toUpperCase()+r.slice(1)}var tle,Jr,ile,J0,Cr,Y0,rle,WB,nCe,Nt=R(()=>{tle=E(require("child_process")),Jr=E(pn()),ile=E(require("net")),J0=E(require("os")),Cr=E(require("path")),Y0=E(require("readline")),rle=E(require("util")),WB=E(Do()),nCe=U()("util-fs")});function Q0(r,e){if(e){if(r&&r.hasOwnProperty(e))return r[e];let t=e.split("."),i=r;for(let n=0;i&&n<t.length;n++)i=i[t[n]];return i}return r}var X0,Po,Dn,Z0,nle,ko,JB=R(()=>{X0=E(require("os")),Po=E(require("fs")),Dn=E(require("path")),Z0=E(H());qe();En();ri();de();SB();H0();U0();Wr();Nt();nle=U()("configurations");ko=class{constructor(e,t){this.userConfigFile=e;this._proxy=t;this._errorItems=[];this._folderConfigurations=new Map;this._onError=new Z0.Emitter;this._onChange=new Z0.Emitter;this.disposables=[];this.onError=this._onError.event;this.onDidChange=this._onChange.event;let i=this.parseContentFromFile(e),n={defaults:wB(),user:i,workspace:{contents:{}}};this._configuration=ko.parse(n),this.watchFile(e,Ot.User);let s=Dn.default.join(process.cwd(),`.vim/${Is}`);s!=e&&Po.default.existsSync(s)&&this.addFolderFile(s)}parseContentFromFile(e){if(!e)return{contents:{}};let t=B.file(e).toString();this._errorItems=this._errorItems.filter(n=>n.location.uri!=t);let i=vB(e,n=>{this._errorItems.push(...n)});return this._onError.fire(this._errorItems),i}get errorItems(){return this._errorItems}get foldConfigurations(){return this._folderConfigurations}extendsDefaults(e){let{defaults:t}=this._configuration,{contents:i}=t;i=Ls(i),Object.keys(e).forEach(s=>{zd(i,s,e[s],o=>{nle.error(o)})});let n={defaults:{contents:i},user:this._configuration.user,workspace:this._configuration.workspace};this._configuration=ko.parse(n)}updateUserConfig(e){if(!e||Object.keys(e).length==0)return;let{user:t}=this._configuration,i=t.clone();Object.keys(e).forEach(n=>{let s=e[n];if(s===void 0)i.removeValue(n);else if(Wt(s))for(let o of Object.keys(s))i.setValue(`${n}.${o}`,s[o]);else i.setValue(n,s)}),this.changeConfiguration(Ot.User,i)}get defaults(){return this._configuration.defaults}get user(){return this._configuration.user}get workspace(){return this._configuration.workspace}addFolderFile(e){let{_folderConfigurations:t}=this;if(t.has(e)||Dn.default.resolve(e,"../..")==X0.default.homedir())return;let i=this.parseContentFromFile(e);this.watchFile(e,Ot.Workspace),this.changeConfiguration(Ot.Workspace,i,e)}watchFile(e,t){if(!Po.default.existsSync(e)||global.hasOwnProperty("__TEST__"))return;let i=Ic(e,()=>{let n=this.parseContentFromFile(e);this.changeConfiguration(t,n,e)});this.disposables.push(i)}changeConfiguration(e,t,i){let{defaults:n,user:s,workspace:o}=this._configuration,{workspaceConfigFile:a}=this,l={defaults:e==Ot.Global?t:n,user:e==Ot.User?t:s,workspace:e==Ot.Workspace?t:o},c=ko.parse(l),u=xB(this._configuration.getValue(),c.getValue());e==Ot.Workspace&&i&&(this._folderConfigurations.set(i,new nr(t.contents)),this.workspaceConfigFile=i),u.length!=0&&(this._configuration=c,this._onChange.fire({affectsConfiguration:(f,d)=>{if(!d||e!=Ot.Workspace)return u.includes(f);let h=B.parse(d);if(h.scheme!=="file")return u.includes(f);let p=h.fsPath,g=a?Dn.default.resolve(a,"../.."):"";return i&&!lt(g,p,!0)&&!lt(Dn.default.resolve(i,"../.."),p)?!1:u.includes(f)}}))}setFolderConfiguration(e){let t=B.parse(e);if(t.scheme!="file")return;let i=t.fsPath;for(let[n,s]of this.foldConfigurations){let o=Dn.default.resolve(n,"../..");if(lt(o,i,!0)&&this.workspaceConfigFile!=n){this.changeConfiguration(Ot.Workspace,s,n);break}}}hasFolderConfiguration(e){let{folders:t}=this;return t.findIndex(i=>lt(i,e,!0))!==-1}getConfigFile(e){return e==Ot.Global?null:e==Ot.User?this.userConfigFile:this.workspaceConfigFile}get folders(){let e=[],{_folderConfigurations:t}=this;for(let i of t.keys())e.push(Dn.default.resolve(i,"../.."));return e}get configuration(){return this._configuration}getConfiguration(e,t){let i;if(t){let{defaults:o,user:a}=this._configuration;i=new Pg(o,a,this.getFolderConfiguration(t))}else i=this._configuration;let n=Object.freeze(Q0(i.getValue(null),e)),s={has(o){return typeof Q0(n,o)!="undefined"},get:(o,a)=>{let l=Q0(n,o);return l==null?a:l},update:(o,a,l=!1)=>{let c=e?`${e}.${o}`:o,u=l?Ot.User:Ot.Workspace,f=u==Ot.User?this.user.clone():this.workspace.clone();if(a==null?f.removeValue(c):f.setValue(c,a),u==Ot.Workspace&&!this.workspaceConfigFile&&this._proxy){let d=this.workspaceConfigFile=this._proxy.workspaceConfigFile;if(!Po.default.existsSync(d)){let h=Dn.default.dirname(d);Po.default.existsSync(h)||Po.default.mkdirSync(h),Po.default.writeFileSync(d,"{}",{encoding:"utf8"})}}this.changeConfiguration(u,f,u==Ot.Workspace?this.workspaceConfigFile:this.userConfigFile),this._proxy&&!global.hasOwnProperty("__TEST__")&&(a==null?this._proxy.$removeConfigurationOption(u,c):this._proxy.$updateConfigurationOption(u,c,a))},inspect:o=>{o=e?`${e}.${o}`:o;let a=this._configuration.inspect(o);if(a)return{key:o,defaultValue:a.default,globalValue:a.user,workspaceValue:a.workspace}}};return Object.defineProperty(s,"has",{enumerable:!1}),Object.defineProperty(s,"get",{enumerable:!1}),Object.defineProperty(s,"update",{enumerable:!1}),Object.defineProperty(s,"inspect",{enumerable:!1}),typeof n=="object"&&YC(s,n,!1),KN(s)}getFolderConfiguration(e){let t=B.parse(e);if(t.scheme!="file")return new nr;let i=t.fsPath;for(let[n,s]of this.foldConfigurations){let o=Dn.default.resolve(n,"../..");if(lt(o,i,!0))return s}return new nr}checkFolderConfiguration(e){let t=B.parse(e);if(t.scheme!="file")return;let i=Dn.default.dirname(t.fsPath);if(this.hasFolderConfiguration(i))this.setFolderConfiguration(e);else{let n=Vc(".vim",i);if(n&&n!=X0.default.homedir()){let s=Dn.default.join(n,Is);Po.default.existsSync(s)&&this.addFolderFile(s)}}}static parse(e){let t=new nr(e.defaults.contents),i=new nr(e.user.contents),n=new nr(e.workspace.contents);return new Pg(t,i,n,new nr)}dispose(){G(this.disposables)}}});var e_,t_,RCe,Lg,YB=R(()=>{e_=E(require("fs"));Hd();t_=E(require("path"));qe();de();RCe=U()("configuration-shape"),Lg=class{constructor(e){this.workspace=e}get nvim(){return this.workspace.nvim}async modifyConfiguration(e,t,i){let{nvim:n,workspace:s}=this,o=s.getConfigFile(e);if(!o)return;let a={tabSize:2,insertSpaces:!0},l=e_.default.readFileSync(o,"utf8");i=i==null?void 0:i;let c=pB(l,[t],i,{formattingOptions:a});l=mB(l,c),e_.default.writeFileSync(o,l,"utf8"),s.getDocument(B.file(o).toString())&&n.command("checktime",!0)}get workspaceConfigFile(){let e=t_.default.join(this.workspace.root,".vim");return t_.default.join(e,Is)}$updateConfigurationOption(e,t,i){this.modifyConfiguration(e,t,i).logError()}$removeConfigurationOption(e,t){this.modifyConfiguration(e,t).logError()}}});var _r,i_,Kc,r_=R(()=>{_r=E(pn()),i_=E(require("path")),Kc=class{constructor(e){this.filepath=e}fetch(e){let t=this.load();if(!e)return t;let i=e.split(".");for(let n of i){if(typeof t[n]=="undefined")return;t=t[n]}return t}exists(e){let t=this.load(),i=e.split(".");for(let n of i){if(typeof t[n]=="undefined")return!1;t=t[n]}return!0}delete(e){let t=this.load(),i=t,n=e.split("."),s=n.length;for(let o=0;o<s&&typeof t[n[o]]!="undefined";o++){if(o==s-1){delete t[n[o]],_r.default.writeFileSync(this.filepath,JSON.stringify(i,null,2),"utf8");break}t=t[n[o]]}}push(e,t){let i=this.load()||{},n=i,s=e.split("."),o=s.length;if(n==null){let a=i_.default.dirname(this.filepath);_r.default.mkdirpSync(a),n=i}for(let a=0;a<o;a++){let l=s[a];if(a==o-1){n[l]=t,_r.default.writeFileSync(this.filepath,JSON.stringify(i,null,2));break}typeof n[l]=="undefined"&&(n[l]={}),n=n[l]}}load(){let e=i_.default.dirname(this.filepath),t=_r.default.statSync(e);if(!t||!t.isDirectory())return _r.default.mkdirpSync(e),_r.default.writeFileSync(this.filepath,"{}","utf8"),{};try{let i=_r.default.readFileSync(this.filepath,"utf8");return JSON.parse(i.trim())}catch(i){return _r.default.writeFileSync(this.filepath,"{}","utf8"),{}}}clear(){let e=_r.default.statSync(this.filepath);!e||!e.isFile()||_r.default.writeFileSync(this.filepath,"{}","utf8")}destroy(){_r.default.existsSync(this.filepath)&&_r.default.unlinkSync(this.filepath)}}});function XB(r,e,t){let i=0,n=0,s=r.slice(t+1);for(let l=0;l<Math.min(s.length,e.length)&&s[s.length-1-l]==e[e.length-1-l];l++)i=i+1;for(let l=0;l<=Math.min(t,e.length-1-i)&&r[l]==e[l];l++)n=n+1;let o=e.slice(n,e.length-i),a=r.length-i;if(a>n&&o.length){let l=0;for(let c=0;c<Math.min(o.length,a-n)&&o[c]==r[n+c];c++)l=l+1;if(l)return{start:n+l,end:a,replacement:o.slice(l)}}return{start:n,end:a,replacement:o}}function ZB(r,e,t){let i=r.length,n=e.length,s=Math.min(i,n),o="",a=0,l=-1,c=!1;for(let d=0;d<=s;d++){if(t!=null&&d==t){l=d,c=!0;break}if(r[i-d-1]!=e[n-d-1]){l=d;break}}if(l==-1)return null;let u=s-l;if(u==0)a=0;else for(let d=0;d<=u;d++)if(r[d]!=e[d]||d==u){a=d;break}if(u=u-a,c&&u>0){let d=l;for(let h=0;h<u;h++){let p=r[i-d-1-h],g=e[n-d-1-h];if(p==g)l=l+1;else break}}let f=i-l;if(i==n&&a==f)return null;if(o=e.slice(a,n-l),a==f){let d=a==0?"":e[a-1];if(d&&d!=`
`&&r[a]==`
`&&o.startsWith(`
`))return{start:a+1,end:f+1,newText:o.slice(1)+`
`}}return{start:a,end:f,newText:o}}function QB(r,e,t=" "){if(r==e)return e;let i=e.indexOf(r);if(i!==-1)return t.repeat(i)+r;let n=(0,Ag.default)(r,e),s="";for(let o of n){if(o[0]==Ag.default.DELETE)return e;o[0]==Ag.default.INSERT?s=s+t.repeat(re(o[1])):s=s+o[1]}return s}var Ag,OCe,n_=R(()=>{Ag=E(jc());yt();OCe=U()("util-diff")});var ACe,Yr,Jd,ej=R(()=>{ACe=U()("model-chars"),Yr=class{constructor(e,t){this.start=e,this.end=t||e}static fromKeywordOption(e){let t=e.split(","),i=[];for(let n of t)if(n=="@")i.push(new Yr(65,90)),i.push(new Yr(97,122));else if(n=="@-@")i.push(new Yr(64));else if(/^([A-Za-z])-([A-Za-z])$/.test(n)){let s=n.match(/^([A-Za-z])-([A-Za-z])$/);i.push(new Yr(s[1].charCodeAt(0),s[2].charCodeAt(0)))}else if(/^\d+-\d+$/.test(n)){let s=n.match(/^(\d+)-(\d+)$/);i.push(new Yr(Number(s[1]),Number(s[2])))}else if(/^\d+$/.test(n))i.push(new Yr(Number(n)));else{let s=n.charCodeAt(0);i.some(o=>o.contains(s))||i.push(new Yr(s))}return i}contains(e){return e>=this.start&&e<=this.end}},Jd=class{constructor(e){this.ranges=[];e&&(this.ranges=Yr.fromKeywordOption(e))}addKeyword(e){let t=e.charCodeAt(0),{ranges:i}=this;i.some(n=>n.contains(t))||i.push(new Yr(t))}clone(){let e=new Jd;return e.ranges=this.ranges.slice(),e}setKeywordOption(e){this.ranges=Yr.fromKeywordOption(e)}matchKeywords(e,t=3){let i=e.length;if(i==0)return[];let n=new Set,s="",o=0;for(let a=0;a<i;a++){let l=e[a],c=l.codePointAt(0);if(o==0&&c==45)continue;if(this.isKeywordCode(c)){if(o==48)continue;s=s+l,o=o+1}else o>=t&&o<48&&n.add(s),s="",o=0}return o!=0&&n.add(s),Array.from(n)}isKeywordCode(e){return e>255?!0:e<33?!1:this.ranges.some(t=>t.contains(e))}isKeywordChar(e){let{ranges:t}=this,i=e.charCodeAt(0);return i>255?!0:i<33?!1:t.some(n=>n.contains(i))}isKeyword(e){let{ranges:t}=this;for(let i=0,n=e.length;i<n;i++){let s=e.charCodeAt(i);if(s>255)return!1;if(!t.some(o=>o.contains(s)))return!1}return!0}}});function sle(r,e,t=0){let i=e?[t]:[];for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);(s===13||s===10)&&(s===13&&n+1<r.length&&r.charCodeAt(n+1)===10&&n++,i.push(t+n+1))}return i}var Yd,tj=R(()=>{Yd=class{constructor(e,t,i,n,s){this.uri=e;this.languageId=t;this.version=i;this.lines=n;this.eol=s}get _content(){return this.lines.join(`
`)+(this.eol?`
`:"")}get lineCount(){return this.lines.length+(this.eol?1:0)}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return{line:0,character:e};for(;i<n;){let o=Math.floor((i+n)/2);t[o]>e?n=o:i=o+1}let s=i-1;return{line:s,character:e-t[s]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,n),i)}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=sle(this._content,!0)),this._lineOffsets}}});var s_,Rn,XCe,Fg,ij=R(()=>{s_=E(Ui()),Rn=E(H());Uc();qe();_e();n_();de();ri();Vt();yt();ej();tj();XCe=U()("model-document"),Fg=class{constructor(e,t,i){this.buffer=e;this.env=t;this.maxFileSize=i;this.isIgnored=!1;this.size=0;this.eol=!0;this.lines=[];this._attached=!1;this._previewwindow=!1;this._winid=-1;this._words=[];this._onDocumentChange=new Rn.Emitter;this._onDocumentDetach=new Rn.Emitter;this.disposables=[];this.onDocumentChange=this._onDocumentChange.event;this.onDocumentDetach=this._onDocumentDetach.event;this.fireContentChanges=(0,s_.default)(()=>{this._fireContentChanges()},300),this.fetchContent=(0,s_.default)(()=>{this._fetchContent()},100)}get content(){return this.syncLines.join(`
`)+(this.eol?`
`:"")}get attached(){return this._attached}get bufnr(){return this.buffer.id}get filetype(){return this._filetype}get uri(){return this._uri}get shouldAttach(){let{buftype:e,maxFileSize:t}=this;return this.getVar("enabled",!0)?this.uri.endsWith("%5BCommand%20Line%5D")?!0:this.size==-2||t&&this.size>t?!1:e==""||e=="acwrite":!1}get isCommandLine(){return this.uri&&this.uri.endsWith("%5BCommand%20Line%5D")}get enabled(){return this.getVar("enabled",!0)}get words(){return this._words}convertFiletype(e){let t=this.env.filetypeMap;return e=="javascript.jsx"?"javascriptreact":e=="typescript.jsx"||e=="typescript.tsx"?"typescriptreact":t[e]||e}get changedtick(){return this._changedtick}get schema(){return B.parse(this.uri).scheme}get lineCount(){return this.lines.length}get winid(){return this._winid}get previewwindow(){return this._previewwindow}async init(e,t){this.nvim=e;let i=await e.call("coc#util#get_bufoptions",[this.bufnr,this.maxFileSize]);if(i==null)return!1;let n=this.buftype=i.buftype;if(this._previewwindow=i.previewwindow,this._winid=i.winid,this.size=typeof i.size=="number"?i.size:0,this.variables=i.variables||{},this._changedtick=i.changedtick,this.eol=i.eol==1,this._uri=tg(i.fullpath,this.bufnr,n,this.env.isCygwin),t.isCancellationRequested)return!1;if(this.shouldAttach){if(this.lines=i.lines,!await this.attach())return!1;this._attached=!0}return this._filetype=this.convertFiletype(i.filetype),this.setIskeyword(i.iskeyword),this.createTextDocument(1,this.lines),t.isCancellationRequested?(this.detach(),!1):!0}async attach(){if(!await this.buffer.attach(!0))return!1;let t=this.lines;return this.buffer.listen("lines",(i,n,s,o,a)=>{i.id!==this.bufnr||!this._attached||n==null||n>this._changedtick&&(this._changedtick=n,t=[...t.slice(0,s),...a,...t.slice(o)],this.lines=t,this.fireContentChanges())},this.disposables),this.buffer.listen("detach",async i=>{t=[],this._onDocumentDetach.fire(i.id)},this.disposables),!0}get dirty(){return this.lines===this.syncLines?!1:!je(this.lines,this.syncLines)}_fireContentChanges(){let{cursor:e}=O;if(!this.dirty)return;let t=this._textDocument,i=null;e&&e.bufnr==this.bufnr&&(i=this.getEndOffset(e.lnum,e.col,e.insert));let n=this.getDocumentContent(),s=ZB(t.getText(),n,i);if(s==null)return;let o=t.positionAt(s.start),a=t.positionAt(s.end),l=t.getText(Rn.Range.create(o,a));this.createTextDocument(this.version+1,this.lines);let c=[{range:{start:o,end:a},rangeLength:s.end-s.start,text:s.newText}];this._onDocumentChange.fire({bufnr:this.bufnr,original:l,originalLines:t.lines,textDocument:{version:this.version,uri:this.uri},contentChanges:c}),this._words=this.chars.matchKeywords(n)}async applyEdits(e){if(!Array.isArray(arguments[0])&&Array.isArray(arguments[1])&&(e=arguments[1]),e.length==0)return;let t=_i.create(this.uri,this.filetype,1,this.getDocumentContent()),i=_i.applyEdits(t,e),n;this.eol?i.endsWith(`\r
`)?n=i.slice(0,-2):n=i.endsWith(`
`)?i.slice(0,-1):i:n=i;let s=this.lines,o=n.split(/\r?\n/);if(!je(s,o)){let a=e.map(u=>u.range.start.line),l=XB(s,o,Math.min.apply(null,a)),c=s.slice(l.start,l.end);this.nvim.call("coc#util#set_lines",[this.bufnr,this._changedtick,c,l.replacement,l.start,l.end],!0),this.env.isVim&&this.nvim.command("redraw",!0),await zN(()=>{this.lines=o,this._forceSync()})}}async changeLines(e){let t=[],i=this.lines.slice();for(let[n,s]of e)i[n]!=s&&(t.push([n,s]),i[n]=s);!t.length||(this.nvim.call("coc#util#change_lines",[this.bufnr,t],!0),this.env.isVim&&this.nvim.command("redraw",!0),this.lines=i,this._forceSync())}_forceSync(){this.fireContentChanges.clear(),this._fireContentChanges()}forceSync(){global.hasOwnProperty("__TEST__")&&this._forceSync()}getOffset(e,t){return this.textDocument.offsetAt({line:e-1,character:t})}isWord(e){return this.chars.isKeyword(e)}getMoreWords(){let e=[],{words:t,chars:i}=this;if(!i.isKeywordChar("-"))return e;for(let n of t)if(n=n.replace(/^-+/,""),n.includes("-")){let s=n.split("-");for(let o of s)o.length>2&&!e.includes(o)&&!t.includes(o)&&e.push(o)}return e}getWordRangeAtPosition(e,t,i=!0){let n=this.chars.clone();if(t&&t.length)for(let l of t)n.addKeyword(l);let s=this.getline(e.line,i);if(s.length==0||e.character>=s.length||!n.isKeywordChar(s[e.character]))return null;let o=e.character,a=e.character+1;if(!n.isKeywordChar(s[o]))return Rn.Range.create(e,{line:e.line,character:e.character+1});for(;o>=0;){let l=s[o-1];if(!l||!n.isKeyword(l))break;o=o-1}for(;a<=s.length;){let l=s[a];if(!l||!n.isKeywordChar(l))break;a=a+1}return Rn.Range.create(e.line,o,e.line,a)}get textDocument(){return this._textDocument}get syncLines(){return this._textDocument.lines}get version(){return this._textDocument.version}createTextDocument(e,t){let{uri:i,filetype:n,eol:s}=this;this._textDocument=new Yd(i,n,e,t,s)}async _fetchContent(e){if(!this.env.isVim||!this._attached)return;let{nvim:t,bufnr:i,changedtick:n}=this,s=await t.call("coc#util#get_buf_lines",[i,n]);s&&(this._changedtick=s.changedtick,this.lines=s.lines,e?this._forceSync():this.fireContentChanges())}async patchChange(e){if(!!this._attached)if(this.env.isVim)if(e){let t=await this.nvim.call("coc#util#get_changeinfo",[]);if(t.changedtick<this._changedtick)return;let{lnum:i,line:n,changedtick:s}=t,o=this.lines.slice();if(this._changedtick=s,o[i-1]==n)return;o[i-1]=n,this.lines=o,this._forceSync()}else this.fetchContent.clear(),await this._fetchContent(!0);else this._changedtick=await this.buffer.getVar("changedtick"),this._forceSync()}getSymbolRanges(e){let{version:t,filetype:i,uri:n}=this,s=new Yd(n,i,t,this.lines,this.eol),o=[],a=s.getText(),l="";for(let c=0,u=a.length;c<u;c++){let f=a[c];if(f=="-"&&l.length==0)continue;let d=this.chars.isKeywordChar(f);d&&(l=l+f),l.length>0&&!d&&l==e&&o.push(Rn.Range.create(s.positionAt(c-l.length),s.positionAt(c))),d||(l="")}return o}fixStartcol(e,t){let i=this.getline(e.line);if(!i)return null;let{character:n}=e,s=i.slice(0,n),o=re(s),{chars:a}=this;for(let l=s.length-1;l>=0;l--){let c=s[l];if(c==" "||!a.isKeywordChar(c)&&!t.includes(c))break;o=o-re(c)}return o}addHighlights(e,t,i){let{start:n,end:s}=i;if(!Fs(i))for(let o=n.line;o<=s.line;o++){let a=this.getline(o,!1),l=o==n.line?Ci(a,n.character):0,c=o==s.line?Ci(a,s.character):global.Buffer.byteLength(a);l>=c||e.push({hlGroup:t,lnum:o,colStart:l,colEnd:c})}}getline(e,t=!0){return t?this.lines[e]||"":this.syncLines[e]||""}getLines(e,t){return this.lines.slice(e,t)}getDocumentContent(){let e=this.lines.join(`
`);return this.eol?e+`
`:e}getVar(e,t){let i=this.variables[`coc_${e}`];return i===void 0?t:i}getPosition(e,t){let i=this.getline(e-1);if(!i||t==0)return{line:e-1,character:0};let n=zt(i,0,t-1);return{line:e-1,character:n.length}}getEndOffset(e,t,i){let n=0,s=this.lines.length;for(let o=e-1;o<s;o++){let a=this.lines[o],l=a.length;if(o==e-1&&l!=0){let c=global.Buffer.from(a,"utf8");c.byteLength<=t-1||(n=n+c.slice(t-1,c.length).toString("utf8").length,i||(n=n-1))}else n=n+l;if(!this.eol&&o==s-1)break;n=n+1}return n}setFiletype(e){this._filetype=this.convertFiletype(e);let t=this._textDocument.lines;this._textDocument=new Yd(this.uri,this.filetype,1,t,this.eol)}setIskeyword(e){let t=this.chars=new Jd(e),i=this.getVar("additional_keywords",[]);if(i&&Array.isArray(i))for(let s of i)t.addKeyword(s);let n=this.lines.length>3e4?this.lines.slice(0,3e4):this.lines;this._words=this.chars.matchKeywords(n.join(`
`))}detach(){this._attached=!1,G(this.disposables),this.disposables=[],this.fetchContent.clear(),this.fireContentChanges.clear(),this._onDocumentChange.dispose(),this._onDocumentDetach.dispose()}async synchronize(){let{changedtick:e}=this;await this.patchChange(),e!=this.changedtick&&await bt(50)}getLocalifyBonus(e,t){let i=new Map,{chars:n}=this,s=Math.max(0,e.line-100),o=Math.min(this.lineCount,e.line+100),a=this.lines.slice(s,o).join(`
`);e=Rn.Position.create(e.line-s,e.character),t=Rn.Position.create(t.line-s,t.character);let l=_i.create(this.uri,this.filetype,1,a),c=l.offsetAt(e),u=a.length,f=u-l.offsetAt(t),d=0,h=!1;for(let p=0;p<c;p++){let g=n.isKeyword(a[p]);if(!h&&g)d=p;else if(h&&(!g||p==c-1)&&p-d>1){let b=a.slice(d,p);i.set(b,p/c)}h=g}d=u-f,h=!1;for(let p=d;p<a.length;p++){let g=n.isKeyword(a[p]);if(!h&&g)d=p;else if(h&&(!g||p==u-1)&&p-d>1){let b=p==u-1?p+1:p,y=a.slice(d,b),S=i.get(y)||0;i.set(y,Math.max(S,(u-p+(b-d))/f))}h=g}return i}}});function Mg(r,e){let t=[[],[]];for(let i of r)e(i)?t[0].push(i):t[1].push(i);return t}function rj(r,e){let t=r.length,i=[];for(let n=0;n<Math.ceil(t/e);n++)i.push(r.slice(n*e,(n+1)*e));return i}function Ng(r,e){if(!e)return r.filter((i,n)=>r.indexOf(i)===n);let t=Object.create(null);return r.filter(i=>{let n=e(i);return t[n]?!1:(t[n]=!0,!0)})}var Xd=R(()=>{});var Zd,nj,Jc,sj,qg,oj=R(()=>{Zd=E(H());qe();nj=E(Do()),Jc=E(require("path"));de();Xd();sj=U()("filesystem-watcher"),qg=class{constructor(e,t,i,n,s){this.globPattern=t;this.ignoreCreateEvents=i;this.ignoreChangeEvents=n;this.ignoreDeleteEvents=s;this._onDidCreate=new Zd.Emitter;this._onDidChange=new Zd.Emitter;this._onDidDelete=new Zd.Emitter;this._onDidRename=new Zd.Emitter;this.onDidCreate=this._onDidCreate.event;this.onDidChange=this._onDidChange.event;this.onDidDelete=this._onDidDelete.event;this.onDidRename=this._onDidRename.event;this.disposables=[];!e||e.then(o=>{if(o)return this.listen(o)}).catch(o=>{sj.error("watchman initialize failed"),sj.error(o.stack)})}async listen(e){let{globPattern:t,ignoreCreateEvents:i,ignoreChangeEvents:n,ignoreDeleteEvents:s}=this,o=await e.subscribe(t,a=>{let{root:l,files:c}=a;c=c.filter(u=>u.type=="f"&&(0,nj.default)(u.name,t,{dot:!0}));for(let u of c){let f=B.file(Jc.default.join(l,u.name));u.exists?u.new===!0?i||this._onDidCreate.fire(f):n||this._onDidChange.fire(f):s||this._onDidDelete.fire(f)}if(c.length==2&&!c[0].exists&&c[1].exists){let u=c[0],f=c[1];u.size==f.size&&this._onDidRename.fire({oldUri:B.file(Jc.default.join(l,u.name)),newUri:B.file(Jc.default.join(l,f.name))})}if(c.length>=2){let[u,f]=Mg(c,d=>d.exists===!1);if(u.length==f.length)for(let d of u){let h=f.find(p=>p.size==d.size&&p.mtime_ms==d.mtime_ms);h&&this._onDidRename.fire({oldUri:B.file(Jc.default.join(l,d.name)),newUri:B.file(Jc.default.join(l,h.name))})}}});return this.disposables.push(o),o}dispose(){G(this.disposables)}}});var o_,Io,Oo,$g=R(()=>{o_=E(require("path")),Io=E(pn()),Oo=class{constructor(e,t){this.name=e;this.file=o_.default.join(t||process.env.COC_DATA_HOME,e)}async load(){let e=o_.default.dirname(this.file);try{Io.default.mkdirpSync(e),Io.default.existsSync(this.file)||Io.default.writeFileSync(this.file,"","utf8");let t=await Io.default.readFile(this.file,"utf8");return t=t.trim(),t.length?t.trim().split(`
`):[]}catch(t){return[]}}async add(e){let t=await this.load(),i=t.indexOf(e);i!==-1&&t.splice(i,1),t.unshift(e),Io.default.writeFileSync(this.file,t.join(`
`),"utf8")}async remove(e){let t=await this.load(),i=t.indexOf(e);i!==-1&&(t.splice(i,1),Io.default.writeFileSync(this.file,t.join(`
`),"utf8"))}async clean(){try{await Io.default.unlink(this.file)}catch(e){}}}});function a_(r,e,t){let i=t.value;if(typeof i!="function")return;let n="$"+e;t.value=function(...s){return this.hasOwnProperty(n)?Promise.resolve(this[n]):new Promise((o,a)=>{Promise.resolve(i.apply(this,s)).then(l=>{this[n]=l,o(l)},l=>{a(l)})})}}var a0e,aj=R(()=>{a0e=U()("util-decorator")});var Yc,lj,l_,d0e,Xc,cj=R(()=>{Yc=E(require("path")),lj=E(require("fs"));de();Nt();aj();l_=E(m0()),d0e=U()("model-resolver"),Xc=class{get nodeFolder(){return Dd("npm")?Vn("npm --loglevel silent root -g",{},3e3).then(e=>(0,l_.default)(e).trim()):Promise.resolve("")}get yarnFolder(){return Dd("yarnpkg")?Vn("yarnpkg global dir",{},3e3).then(e=>{let t=Yc.default.join((0,l_.default)(e).trim(),"node_modules");return lj.default.existsSync(t)?t:""}):Promise.resolve("")}async resolveModule(e){let t=await this.nodeFolder,i=await this.yarnFolder;if(i){let n=await Mt(Yc.default.join(i,e,"package.json"));if(n&&n.isFile())return Yc.default.join(i,e)}if(t){let n=await Mt(Yc.default.join(t,e,"package.json"));if(n&&n.isFile())return Yc.default.join(t,e)}return null}};Nw([a_],Xc.prototype,"nodeFolder",1),Nw([a_],Xc.prototype,"yarnFolder",1)});var Bg,jg,uj=R(()=>{_e();Bg=E(H());de();jg=class{constructor(e,t){this.nvim=e;this.id=t;this.disposables=[];this._onExit=new Bg.Emitter;this._onStderr=new Bg.Emitter;this._onStdout=new Bg.Emitter;this.onExit=this._onExit.event;this.onStdout=this._onStdout.event;this.onStderr=this._onStderr.event;O.on("TaskExit",(s,o)=>{s==this.id&&this._onExit.fire(o)},null,this.disposables),O.on("TaskStderr",(s,o)=>{s==this.id&&this._onStderr.fire(o)},null,this.disposables);let i=[],n;O.on("TaskStdout",(s,o)=>{s==this.id&&(n&&clearTimeout(n),i.push(...o),n=setTimeout(()=>{this._onStdout.fire(i),i=[]},100))},null,this.disposables)}async start(e){let{nvim:t}=this;return await t.call("coc#task#start",[this.id,e])}async stop(){let{nvim:e}=this;await e.call("coc#task#stop",[this.id])}get running(){let{nvim:e}=this;return e.call("coc#task#running",[this.id])}dispose(){let{nvim:e}=this;e.call("coc#task#stop",[this.id],!0),this._onStdout.dispose(),this._onStderr.dispose(),this._onExit.dispose(),G(this.disposables)}}});var y0e,Ug,fj=R(()=>{y0e=U()("model-terminal"),Ug=class{constructor(e,t,i,n){this.cmd=e;this.args=t;this.nvim=i;this._name=n;this.pid=0}async start(e,t){let{nvim:i}=this,n=[this.cmd,...this.args],[s,o]=await i.call("coc#terminal#start",[n,e,t||{}]);this.bufnr=s,this.pid=o}get name(){return this._name||this.cmd}get processId(){return Promise.resolve(this.pid)}sendText(e,t=!0){!this.bufnr||this.nvim.call("coc#terminal#send",[this.bufnr,e,t],!0)}async show(e){let{bufnr:t,nvim:i}=this;if(!t)return;let[n,s,o]=await i.eval(`[bufloaded(${t}),bufwinid(${t}),win_getid()]`);return n?(o==s||(i.pauseNotification(),s==-1?(i.command(`below ${t}sb`,!0),i.command("resize 8",!0),i.call("coc#util#do_autocmd",["CocTerminalOpen"],!0)):i.call("win_gotoid",[s],!0),i.command("normal! G",!0),e&&i.command("wincmd p",!0),await i.resumeNotification()),!0):!1}async hide(){let{bufnr:e,nvim:t}=this;if(!e)return;let i=await t.call("bufwinnr",e);i!=-1&&await t.command(`${i}close!`)}dispose(){let{bufnr:e,nvim:t}=this;!e||t.call("coc#terminal#close",[e],!0)}}});var Hg,dj=R(()=>{de();Hg=class{constructor(e,t){this._create=e;this.workspace=t;this.disposables=[];this.itemsMap=new Map;let{disposables:i}=this;for(let n of t.documents)this.create(n);t.onDidOpenTextDocument(n=>{let s=t.getDocument(n.bufnr);s&&this.create(s)},null,i),t.onDidChangeTextDocument(n=>{this.onChange(n)},null,i),t.onDidCloseTextDocument(n=>{this.delete(n.bufnr)},null,i)}get items(){return Array.from(this.itemsMap.values()).map(e=>e.item)}getItem(e){var i;if(typeof e=="number")return(i=this.itemsMap.get(e))==null?void 0:i.item;let t=Array.from(this.itemsMap.values()).find(n=>n.uri==e);return t?t.item:void 0}create(e){if(!e||e.isCommandLine||!e.attached)return;let t=this.itemsMap.get(e.bufnr);t&&t.item.dispose();let i=this._create(e);i&&this.itemsMap.set(e.bufnr,{uri:e.uri,item:i})}onChange(e){let t=this.itemsMap.get(e.bufnr);t&&typeof t.item.onChange=="function"&&t.item.onChange(e)}delete(e){let t=this.itemsMap.get(e);t&&(this.itemsMap.delete(e),t.item.dispose())}reset(){for(let e of this.itemsMap.values())e.item.dispose();this.itemsMap.clear()}dispose(){G(this.disposables);for(let e of this.itemsMap.values())e.item.dispose();this.itemsMap.clear()}}});function Zc(r,e,t){if(Array.isArray(r)){let i=0;for(let n of r){let s=Zc(n,e,t);if(s===10)return s;s>i&&(i=s)}return i}else{if(typeof r=="string")return r==="*"?5:r===t?10:0;if(r){let i=B.parse(e),{language:n,pattern:s,scheme:o}=r,a=0;if(o)if(o===i.scheme)a=5;else if(o==="*")a=3;else return 0;if(n)if(n===t)a=10;else if(n==="*")a=Math.max(a,5);else return 0;if(s){let l=Ba||GC,c=l?s.toLowerCase():s,u=l?i.fsPath.toLowerCase():i.fsPath;if(c===u||(0,hj.default)(u,c,{dot:!0}))a=5;else return 0}return a}else return 0}}var hj,c_=R(()=>{hj=E(Do());qe();eg()});var gj=x((T0e,mj)=>{var u_=4294967296,pj=[];for(var Qd=0;Qd<256;Qd++)pj[Qd]=(Qd>15?"":"0")+Qd.toString(16);var eh=mj.exports=function(r,e){r instanceof Buffer?(this.buffer=r,this.offset=e||0):Object.prototype.toString.call(r)=="[object Uint8Array]"?(this.buffer=new Buffer(r),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};eh.MAX_INT=Math.pow(2,53);eh.MIN_INT=-Math.pow(2,53);eh.prototype={constructor:eh,_2scomp:function(){for(var r=this.buffer,e=this.offset,t=1,i=e+7;i>=e;i--){var n=(r[i]^255)+t;r[i]=n&255,t=n>>8}},setValue:function(r,e){var t=!1;if(arguments.length==1)if(typeof r=="number"){if(t=r<0,r=Math.abs(r),e=r%u_,r=r/u_,r>u_)throw new RangeError(r+" is outside Int64 range");r=r|0}else if(typeof r=="string")r=(r+"").replace(/^0x/,""),e=r.substr(-8),r=r.length>8?r.substr(0,r.length-8):"",r=parseInt(r,16),e=parseInt(e,16);else throw new Error(r+" must be a Number or String");for(var i=this.buffer,n=this.offset,s=7;s>=0;s--)i[n+s]=e&255,e=s==4?r:e>>>8;t&&this._2scomp()},toNumber:function(r){for(var e=this.buffer,t=this.offset,i=e[t]&128,n=0,s=1,o=7,a=1;o>=0;o--,a*=256){var l=e[t+o];i&&(l=(l^255)+s,s=l>>8,l=l&255),n+=l*a}return!r&&n>=eh.MAX_INT?i?-1/0:1/0:i?-n:n},valueOf:function(){return this.toNumber(!1)},toString:function(r){return this.valueOf().toString(r||10)},toOctetString:function(r){for(var e=new Array(8),t=this.buffer,i=this.offset,n=0;n<8;n++)e[n]=pj[t[i+n]];return e.join(r||"")},toBuffer:function(r){if(r&&this.offset===0)return this.buffer;var e=new Buffer(8);return this.buffer.copy(e,0,this.offset,this.offset+8),e},copy:function(r,e){this.buffer.copy(r,e||0,this.offset,this.offset+8)},compare:function(r){if((this.buffer[this.offset]&128)!=(r.buffer[r.offset]&128))return r.buffer[r.offset]-this.buffer[this.offset];for(var e=0;e<8;e++)if(this.buffer[this.offset+e]!==r.buffer[r.offset+e])return this.buffer[this.offset+e]-r.buffer[r.offset+e];return 0},equals:function(r){return this.compare(r)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var Dj=x(ih=>{var vj=require("events").EventEmitter,ole=require("util"),ale=require("os"),D0e=require("assert"),th=gj(),Lo=ale.endianness()=="BE";function bj(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function si(r){this.buf=Buffer.alloc(bj(r||8192)),this.readOffset=0,this.writeOffset=0}ih.Accumulator=si;si.prototype.writeAvail=function(){return this.buf.length-this.writeOffset};si.prototype.readAvail=function(){return this.writeOffset-this.readOffset};si.prototype.reserve=function(r){if(!(r<this.writeAvail())&&(this.readOffset>0&&(this.buf.copy(this.buf,0,this.readOffset,this.writeOffset),this.writeOffset-=this.readOffset,this.readOffset=0),!(r<this.writeAvail()))){var e=Buffer.alloc(bj(this.buf.length+r-this.writeAvail()));this.buf.copy(e),this.buf=e}};si.prototype.append=function(r){if(Buffer.isBuffer(r))this.reserve(r.length),r.copy(this.buf,this.writeOffset,0,r.length),this.writeOffset+=r.length;else{var e=Buffer.byteLength(r);this.reserve(e),this.buf.write(r,this.writeOffset),this.writeOffset+=e}};si.prototype.assertReadableSize=function(r){if(this.readAvail()<r)throw new Error("wanted to read "+r+" bytes but only have "+this.readAvail())};si.prototype.peekString=function(r){return this.assertReadableSize(r),this.buf.toString("utf-8",this.readOffset,this.readOffset+r)};si.prototype.readString=function(r){var e=this.peekString(r);return this.readOffset+=r,e};si.prototype.peekInt=function(r){switch(this.assertReadableSize(r),r){case 1:return this.buf.readInt8(this.readOffset,r);case 2:return Lo?this.buf.readInt16BE(this.readOffset,r):this.buf.readInt16LE(this.readOffset,r);case 4:return Lo?this.buf.readInt32BE(this.readOffset,r):this.buf.readInt32LE(this.readOffset,r);case 8:var e=this.buf.slice(this.readOffset,this.readOffset+8);return Lo?new th(e):new th(Ej(e));default:throw new Error("invalid integer size "+r)}};si.prototype.readInt=function(r){var e=this.peekInt(r);return e instanceof th&&isFinite(e.valueOf())&&(e=e.valueOf()),this.readOffset+=r,e};si.prototype.peekDouble=function(){return this.assertReadableSize(8),Lo?this.buf.readDoubleBE(this.readOffset):this.buf.readDoubleLE(this.readOffset)};si.prototype.readDouble=function(){var r=this.peekDouble();return this.readOffset+=8,r};si.prototype.readAdvance=function(r){if(r>0)this.assertReadableSize(r);else if(r<0&&this.readOffset+r<0)throw new Error("advance with negative offset "+r+" would seek off the start of the buffer");this.readOffset+=r};si.prototype.writeByte=function(r){this.reserve(1),this.buf.writeInt8(r,this.writeOffset),++this.writeOffset};si.prototype.writeInt=function(r,e){switch(this.reserve(e),e){case 1:this.buf.writeInt8(r,this.writeOffset);break;case 2:Lo?this.buf.writeInt16BE(r,this.writeOffset):this.buf.writeInt16LE(r,this.writeOffset);break;case 4:Lo?this.buf.writeInt32BE(r,this.writeOffset):this.buf.writeInt32LE(r,this.writeOffset);break;default:throw new Error("unsupported integer size "+e)}this.writeOffset+=e};si.prototype.writeDouble=function(r){this.reserve(8),Lo?this.buf.writeDoubleBE(r,this.writeOffset):this.buf.writeDoubleLE(r,this.writeOffset),this.writeOffset+=8};var f_=0,d_=1,h_=2,p_=3,m_=4,Wg=5,zg=6,yj=7,wj=8,xj=9,Sj=10,Cj=11,lle=12,g_=0,_j=1,cle=127,ule=32767,fle=2147483647;function sr(){vj.call(this),this.buf=new si,this.state=g_}ole.inherits(sr,vj);ih.BunserBuf=sr;sr.prototype.append=function(r,e){if(e)return this.buf.append(r),this.process(e);try{this.buf.append(r)}catch(t){this.emit("error",t);return}this.processLater()};sr.prototype.processLater=function(){var r=this;process.nextTick(function(){try{r.process(!1)}catch(e){r.emit("error",e)}})};sr.prototype.process=function(r){if(this.state==g_){if(this.buf.readAvail()<2)return;if(this.expectCode(0),this.expectCode(1),this.pduLen=this.decodeInt(!0),this.pduLen===!1){this.buf.readAdvance(-2);return}this.buf.reserve(this.pduLen),this.state=_j}if(this.state==_j){if(this.buf.readAvail()<this.pduLen)return;var e=this.decodeAny();if(r)return e;this.emit("value",e),this.state=g_}!r&&this.buf.readAvail()>0&&this.processLater()};sr.prototype.raise=function(r){throw new Error(r+", in Buffer of length "+this.buf.buf.length+" ("+this.buf.readAvail()+" readable) at offset "+this.buf.readOffset+" buffer: "+JSON.stringify(this.buf.buf.slice(this.buf.readOffset,this.buf.readOffset+32).toJSON()))};sr.prototype.expectCode=function(r){var e=this.buf.readInt(1);e!=r&&this.raise("expected bser opcode "+r+" but got "+e)};sr.prototype.decodeAny=function(){var r=this.buf.peekInt(1);switch(r){case p_:case m_:case Wg:case zg:return this.decodeInt();case yj:return this.buf.readAdvance(1),this.buf.readDouble();case wj:return this.buf.readAdvance(1),!0;case xj:return this.buf.readAdvance(1),!1;case Sj:return this.buf.readAdvance(1),null;case h_:return this.decodeString();case f_:return this.decodeArray();case d_:return this.decodeObject();case Cj:return this.decodeTemplate();default:this.raise("unhandled bser opcode "+r)}};sr.prototype.decodeArray=function(){this.expectCode(f_);for(var r=this.decodeInt(),e=[],t=0;t<r;++t)e.push(this.decodeAny());return e};sr.prototype.decodeObject=function(){this.expectCode(d_);for(var r=this.decodeInt(),e={},t=0;t<r;++t){var i=this.decodeString(),n=this.decodeAny();e[i]=n}return e};sr.prototype.decodeTemplate=function(){this.expectCode(Cj);for(var r=this.decodeArray(),e=this.decodeInt(),t=[],i=0;i<e;++i){for(var n={},s=0;s<r.length;++s){if(this.buf.peekInt(1)==lle){this.buf.readAdvance(1);continue}var o=this.decodeAny();n[r[s]]=o}t.push(n)}return t};sr.prototype.decodeString=function(){this.expectCode(h_);var r=this.decodeInt();return this.buf.readString(r)};sr.prototype.decodeInt=function(r){if(r&&this.buf.readAvail()<1)return!1;this.buf.assertReadableSize(1);var e=this.buf.peekInt(1),t=0;switch(e){case p_:t=1;break;case m_:t=2;break;case Wg:t=4;break;case zg:t=8;break;default:this.raise("invalid bser int encoding "+e)}return r&&this.buf.readAvail()<1+t?!1:(this.buf.readAdvance(1),this.buf.readInt(t))};function dle(r){var e=new sr,t=e.append(r,!0);if(e.buf.readAvail())throw Error("excess data found after input buffer, use BunserBuf instead");if(typeof t=="undefined")throw Error("no bser found in string and no error raised!?");return t}ih.loadFromBuffer=dle;function Ej(r){for(var e=Buffer.alloc(r.length),t=0;t<r.length;t++)e[t]=r[r.length-1-t];return e}function Tj(r,e){var t=e.toBuffer();if(Lo){r.writeByte(zg),r.append(t);return}var i=Ej(t);r.writeByte(zg),r.append(i)}function Vg(r,e){var t=Math.abs(e);t<=cle?(r.writeByte(p_),r.writeInt(e,1)):t<=ule?(r.writeByte(m_),r.writeInt(e,2)):t<=fle?(r.writeByte(Wg),r.writeInt(e,4)):Tj(r,new th(e))}function Gg(r,e){switch(typeof e){case"number":isFinite(e)&&Math.floor(e)===e?Vg(r,e):(r.writeByte(yj),r.writeDouble(e));return;case"string":r.writeByte(h_),Vg(r,Buffer.byteLength(e)),r.append(e);return;case"boolean":r.writeByte(e?wj:xj);return;case"object":if(e===null){r.writeByte(Sj);return}if(e instanceof th){Tj(r,e);return}if(Array.isArray(e)){r.writeByte(f_),Vg(r,e.length);for(var t=0;t<e.length;++t)Gg(r,e[t]);return}r.writeByte(d_);for(var i=Object.keys(e),n=i.length,t=0;t<i.length;++t){var s=i[t],o=e[s];typeof o=="undefined"&&n--}Vg(r,n);for(var t=0;t<i.length;++t){var s=i[t],o=e[s];if(typeof o!="undefined"){Gg(r,s);try{Gg(r,o)}catch(u){throw new Error(u.message+" (while serializing object property with name `"+s+"')")}}}return;default:throw new Error("cannot serialize type "+typeof e+" to BSER")}}function hle(r){var e=new si;e.writeByte(0),e.writeByte(1),e.writeByte(Wg),e.writeInt(0,4),Gg(e,r);var t=e.writeOffset,i=t-7;return e.writeOffset=3,e.writeInt(i,4),e.writeOffset=t,e.buf.slice(0,t)}ih.dumpToBuffer=hle});var Aj=x((P0e,Lj)=>{"use strict";var ple=require("net"),Rj=require("events").EventEmitter,mle=require("util"),gle=require("child_process"),Pj=Dj(),kj=["subscription","log"];function Ns(r){var e=this;Rj.call(this),this.watchmanBinaryPath="watchman",r&&r.watchmanBinaryPath&&(this.watchmanBinaryPath=r.watchmanBinaryPath.trim()),this.commands=[]}mle.inherits(Ns,Rj);Lj.exports.Client=Ns;Ns.prototype.sendNextCommand=function(){this.currentCommand||(this.currentCommand=this.commands.shift(),!!this.currentCommand&&this.socket.write(Pj.dumpToBuffer(this.currentCommand.cmd)))};Ns.prototype.cancelCommands=function(r){var e=new Error(r),t=this.commands;this.commands=[],this.currentCommand&&(t.unshift(this.currentCommand),this.currentCommand=null),t.forEach(function(i){i.cb(e)})};Ns.prototype.connect=function(){var r=this;function e(l){r.bunser=new Pj.BunserBuf,r.bunser.on("value",function(c){for(var u=!1,f=0;f<kj.length;f++){var d=kj[f];d in c&&(u=d)}if(u)r.emit(u,c);else if(r.currentCommand){var h=r.currentCommand;if(r.currentCommand=null,"error"in c){var p=new Error(c.error);p.watchmanResponse=c,h.cb(p)}else h.cb(null,c)}r.sendNextCommand()}),r.bunser.on("error",function(c){r.emit("error",c)}),r.socket=ple.createConnection(l),r.socket.on("connect",function(){r.connecting=!1,r.emit("connect"),r.sendNextCommand()}),r.socket.on("error",function(c){r.connecting=!1,r.emit("error",c)}),r.socket.on("data",function(c){r.bunser&&r.bunser.append(c)}),r.socket.on("end",function(){r.socket=null,r.bunser=null,r.cancelCommands("The watchman connection was closed"),r.emit("end")})}if(process.env.WATCHMAN_SOCK){e(process.env.WATCHMAN_SOCK);return}var t=["--no-pretty","get-sockname"],i=null,n=!1;function s(l){n||(n=!0,l.errno==="EACCES"?l.message="The Watchman CLI is installed but cannot be spawned because of a permission problem":l.errno==="ENOENT"&&(l.message="Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions"),console.error("Watchman: ",l.message),r.emit("error",l))}try{i=gle.spawn(this.watchmanBinaryPath,t,{stdio:["ignore","pipe","pipe"]})}catch(l){s(l);return}var o=[],a=[];i.stdout.on("data",function(l){o.push(l)}),i.stderr.on("data",function(l){l=l.toString("utf8"),a.push(l),console.error(l)}),i.on("error",function(l){s(l)}),i.on("close",function(l,c){if(l!==0){s(new Error(r.watchmanBinaryPath+" "+t.join(" ")+" returned with exit code="+l+", signal="+c+", stderr= "+a.join("")));return}try{var u=JSON.parse(o.join(""));if("error"in u){var f=new Error(u.error);f.watchmanResponse=u,r.emit("error",f);return}e(u.sockname)}catch(d){r.emit("error",d)}})};Ns.prototype.command=function(r,e){if(e=e||function(){},this.commands.push({cmd:r,cb:e}),!this.socket){if(!this.connecting){this.connecting=!0,this.connect();return}return}this.sendNextCommand()};var Ij={"cmd-watch-del-all":"3.1.1","cmd-watch-project":"3.1",relative_root:"3.3","term-dirname":"3.1","term-idirname":"3.1",wildmatch:"3.7"};function vle(r,e){r=r.split("."),e=e.split(".");for(var t=0;t<3;t++){var i=parseInt(r[t]||"0")-parseInt(e[t]||"0");if(i!=0)return i}return 0}function Oj(r,e){return e in Ij?vle(r,Ij[e])>=0:!1}Ns.prototype._synthesizeCapabilityCheck=function(r,e,t){r.capabilities={};var i=r.version;return e.forEach(function(n){r.capabilities[n]=Oj(i,n)}),t.forEach(function(n){var s=Oj(i,n);r.capabilities[n]=s,s||(r.error="client required capability `"+n+"` is not supported by this server")}),r};Ns.prototype.capabilityCheck=function(r,e){var t=r.optional||[],i=r.required||[],n=this;this.command(["version",{optional:t,required:i}],function(s,o){if(s){e(s);return}if(!("capabilities"in o)&&(o=n._synthesizeCapabilityCheck(o,t,i),o.error)){s=new Error(o.error),s.watchmanResponse=o,e(s);return}e(null,o)})};Ns.prototype.end=function(){this.cancelCommands("The client was ended"),this.socket&&(this.socket.end(),this.socket=null),this.bunser=null}});function yle(r){return!(r=="/"||r=="/tmp"||r=="/private/tmp"||r.toLowerCase()===v_.default.homedir().toLowerCase()||Kg.default.parse(r).base==r||r.startsWith("/tmp/")||r.startsWith("/private/tmp/")||lt(v_.default.tmpdir(),r,!0))}var Fj,v_,Kg,Mj,Nj,Jg,ble,b_,Pn,Yg=R(()=>{Fj=E(Aj()),v_=E(require("os")),Kg=E(require("path"));Ye();Mj=E(H()),Nj=E(Do());Nt();Jg=U()("watchman"),ble=["relative_root","cmd-watch-project","wildmatch","field-new"],b_=new Map,Pn=class{constructor(e,t){this.channel=t;this._disposed=!1;this.client=new Fj.default.Client({watchmanBinaryPath:e}),this.client.setMaxListeners(300)}checkCapability(){let{client:e}=this;return new Promise((t,i)=>{e.capabilityCheck({optional:[],required:ble},(n,s)=>{if(n)return i(n);let{capabilities:o}=s;for(let a of Object.keys(o))if(!o[a])return t(!1);t(!0)})})}async watchProject(e){try{let t=await this.command(["watch-project",e]),{watch:i,warning:n,relative_path:s}=t;n&&Jg.warn(n),this.watch=i,this.relative_path=s,Jg.info(`watchman watching project: ${e}`),this.appendOutput(`watchman watching project: ${e}`)}catch(t){return Jg.error(t),!1}return!0}command(e){return new Promise((t,i)=>{this.client.command(e,(n,s)=>{if(n)return i(n);t(s)})})}async subscribe(e,t){let{watch:i,relative_path:n}=this;if(!i)return this.appendOutput(`watchman not watching: ${i}`,"Error"),null;let{clock:s}=await this.command(["clock",i]),o=Ms(),a={expression:["allof",["match","**/*","wholename"]],fields:["name","size","new","exists","type","mtime_ms","ctime_ms"],since:s},l=i;n&&(a.relative_root=n,l=Kg.default.join(i,n));let{subscribe:c}=await this.command(["subscribe",i,o,a]);return global.hasOwnProperty("__TEST__")&&(global.subscribe=c),this.appendOutput(`subscribing "${e}" in ${l}`),this.client.on("subscription",u=>{if(!u||u.subscription!=o)return;let{files:f}=u;if(!f||(f=f.filter(h=>h.type=="f"&&(0,Nj.default)(h.name,e,{dot:!0})),!f.length))return;let d=Object.assign({},u);this.relative_path&&(d.root=Kg.default.resolve(u.root,this.relative_path)),this.appendOutput(`file change detected: ${JSON.stringify(d,null,2)}`),t(d)}),Mj.Disposable.create(()=>this.unsubscribe(c))}unsubscribe(e){if(this._disposed)return Promise.resolve();let{watch:t}=this;if(!!t)return this.appendOutput(`unsubscribe "${e}" in: ${t}`),this.command(["unsubscribe",t,e]).catch(i=>{Jg.error(i)})}dispose(){this._disposed||(this._disposed=!0,this.client.removeAllListeners(),this.client.end())}appendOutput(e,t="Info"){this.channel&&this.channel.appendLine(`[${t} - ${new Date().toLocaleTimeString()}] ${e}`)}static dispose(){for(let e of b_.values())e.then(t=>{t.dispose()},t=>{})}static createClient(e,t,i){if(!yle(t))return null;let n=b_.get(t);if(n)return n;let s=new Promise(async(o,a)=>{try{let l=new Pn(e,i);if(!await l.checkCapability()||!await l.watchProject(t))return o(null);o(l)}catch(l){a(l)}});return b_.set(t,s),s}}});var Xg,y_=R(()=>{Xg="0.0.80"});var qj,$j,Gt,kn,Ne,ne,Bj,jj,rh,Zg,xle,Uj,v,Y=R(()=>{qj=E(eB()),$j=E(jc()),Gt=E(pn()),kn=E(require("os")),Ne=E(require("path"));Ye();ne=E(H());qe();Bj=E(Ed());w0();JB();YB();_e();r_();ij();oj();$g();cj();uj();fj();dj();En();Xd();Nt();de();c_();Vt();yt();Yg();Te();y_();jj=10,rh=U()("workspace"),Zg=2e3,xle=["showMessage","runTerminalCommand","openTerminal","showQuickpick","menuPick","openLocalConfig","showPrompt","createStatusBarItem","createOutputChannel","showOutputChannel","requestInput","echoLines","getCursorPosition","moveTo","getOffset"],Uj=class{constructor(){this.keymaps=new Map;this.resolver=new Xc;this.rootPatterns=new Map;this._workspaceFolders=[];this._insertMode=!1;this._cwd=process.cwd();this._initialized=!1;this._attached=!1;this.buffers=new Map;this.autocmdMaxId=0;this.autocmds=new Map;this.terminals=new Map;this.creatingSources=new Map;this.schemeProviderMap=new Map;this.namespaceMap=new Map;this.disposables=[];this.watchedOptions=new Set;this._dynAutocmd=!1;this._disposed=!1;this._onDidOpenDocument=new ne.Emitter;this._onDidCloseDocument=new ne.Emitter;this._onDidChangeDocument=new ne.Emitter;this._onWillSaveDocument=new ne.Emitter;this._onDidSaveDocument=new ne.Emitter;this._onDidChangeWorkspaceFolders=new ne.Emitter;this._onDidChangeConfiguration=new ne.Emitter;this._onDidWorkspaceInitialized=new ne.Emitter;this._onDidOpenTerminal=new ne.Emitter;this._onDidCloseTerminal=new ne.Emitter;this._onDidRuntimePathChange=new ne.Emitter;this.onDidCloseTerminal=this._onDidCloseTerminal.event;this.onDidOpenTerminal=this._onDidOpenTerminal.event;this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event;this.onDidOpenTextDocument=this._onDidOpenDocument.event;this.onDidCloseTextDocument=this._onDidCloseDocument.event;this.onDidChangeTextDocument=this._onDidChangeDocument.event;this.onWillSaveTextDocument=this._onWillSaveDocument.event;this.onDidSaveTextDocument=this._onDidSaveDocument.event;this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this.onDidWorkspaceInitialized=this._onDidWorkspaceInitialized.event;this.onDidRuntimePathChange=this._onDidRuntimePathChange.event;this._onDidCreateFiles=new ne.Emitter;this._onDidRenameFiles=new ne.Emitter;this._onDidDeleteFiles=new ne.Emitter;this._onWillCreateFiles=new ne.Emitter;this._onWillRenameFiles=new ne.Emitter;this._onWillDeleteFiles=new ne.Emitter;this.onDidCreateFiles=this._onDidCreateFiles.event;this.onDidRenameFiles=this._onDidRenameFiles.event;this.onDidDeleteFiles=this._onDidDeleteFiles.event;this.onWillCreateFiles=this._onWillCreateFiles.event;this.onWillRenameFiles=this._onWillRenameFiles.event;this.onWillDeleteFiles=this._onWillDeleteFiles.event;this.version=Xg,this.configurations=this.createConfigurations();let e=process.cwd();e!=kn.default.homedir()&&Ro(e,[".vim"])&&this._workspaceFolders.push({uri:B.file(e).toString(),name:Ne.default.basename(e)})}async init(){let{nvim:e}=this;for(let n of xle)Object.defineProperty(this,n,{get:()=>(...s)=>D[n].apply(D,s)});this._env=await e.call("coc#util#vim_info"),this._env.apiversion!=jj&&(console.error(`API version ${this._env.apiversion} is not ${jj}, please build coc.nvim by 'yarn install' after pull source code.`),process.exit()),this._insertMode=this._env.mode.startsWith("insert"),this._env.workspaceFolders&&Array.isArray(this._env.workspaceFolders)&&(this._workspaceFolders=this._env.workspaceFolders.map(n=>({uri:B.file(n).toString(),name:Ne.default.dirname(n)}))),this.configurations.updateUserConfig(this._env.config);let i=this.getConfiguration("coc.preferences").get("maxFileSize","10MB");this.maxFileSize=qj.default.parse(i),O.on(["InsertEnter","CursorMovedI"],()=>{this._insertMode=!0},null,this.disposables),O.on(["InsertLeave","CursorMoved"],()=>{this._insertMode=!1},null,this.disposables),O.on("BufEnter",this.onBufEnter,this,this.disposables),O.on("CursorMoved",this.checkCurrentBuffer,this,this.disposables),O.on("CursorMovedI",this.checkCurrentBuffer,this,this.disposables),O.on("DirChanged",this.onDirChanged,this,this.disposables),O.on("BufCreate",this.onBufCreate,this,this.disposables),O.on("BufUnload",this.onBufUnload,this,this.disposables),O.on("TermOpen",this.onBufCreate,this,this.disposables),O.on("TermClose",this.onBufUnload,this,this.disposables),O.on("BufWritePost",this.onBufWritePost,this,this.disposables),O.on("BufWritePre",this.onBufWritePre,this,this.disposables),O.on("FileType",this.onFileTypeChange,this,this.disposables),O.on("CursorHold",this.checkCurrentBuffer,this,this.disposables),O.on("TextChanged",this.checkBuffer,this,this.disposables),O.on("BufReadCmd",this.onBufReadCmd,this,this.disposables),O.on("VimResized",(n,s)=>{Object.assign(this._env,{columns:n,lines:s})},null,this.disposables),await this.attach(),this.attachChangedEvents(),this.configurations.onDidChange(n=>{this._onDidChangeConfiguration.fire(n)},null,this.disposables),this.watchOption("runtimepath",(n,s)=>{let o=(0,$j.default)(n,s);for(let[a,l]of o)if(a==1){let c=l.replace(/,$/,"").split(",");this._onDidRuntimePathChange.fire(c)}this._env.runtimepath=s},this.disposables),this.watchGlobal("coc_sources_disable_map",async(n,s)=>{this.env.disabledSources=s}),this.disposables.push(this.registerTextDocumentContentProvider("output",Ga.getProvider(e)))}getConfigFile(e){return this.configurations.getConfigFile(e)}registerAutocmd(e){this.autocmdMaxId+=1;let t=this.autocmdMaxId;return this.autocmds.set(t,e),this.setupDynamicAutocmd(),ne.Disposable.create(()=>{this.autocmds.delete(t),this.setupDynamicAutocmd()})}watchOption(e,t,i){let n=this.watchedOptions.has(e);n||(this.watchedOptions.add(e),this.setupDynamicAutocmd());let s=O.on("OptionSet",async(o,a,l)=>{o==e&&t&&await Promise.resolve(t(a,l))});i&&i.push(ne.Disposable.create(()=>{s.dispose(),!n&&(this.watchedOptions.delete(e),this.setupDynamicAutocmd())}))}watchGlobal(e,t,i){let{nvim:n}=this;n.call("coc#_watch",e,!0);let s=O.on("GlobalChange",async(o,a,l)=>{o==e&&t&&await Promise.resolve(t(a,l))});i&&i.push(ne.Disposable.create(()=>{s.dispose(),n.call("coc#_unwatch",e,!0)}))}get cwd(){return this._cwd}get env(){return this._env}get root(){return this._root||this.cwd}get rootPath(){return this.root}get workspaceFolders(){return this._workspaceFolders}get uri(){let{bufnr:e}=this;if(e){let t=this.getDocument(e);if(t&&t.schema=="file")return t.uri}return null}get workspaceFolder(){let{rootPath:e}=this;return e==kn.default.homedir()?null:{uri:B.file(e).toString(),name:Ne.default.basename(e)}}get textDocuments(){let e=[];for(let t of this.buffers.values())e.push(t.textDocument);return e}get documents(){return Array.from(this.buffers.values())}createNameSpace(e=""){return this.namespaceMap.has(e)?this.namespaceMap.get(e):(Zg=Zg+1,this.namespaceMap.set(e,Zg),Zg)}get channelNames(){return Ga.names}get pluginRoot(){return Ne.default.dirname(__dirname)}get isVim(){return this._env.isVim}get isNvim(){return!this._env.isVim}get completeOpt(){return this._env.completeOpt}get initialized(){return this._initialized}get ready(){return this._initialized?Promise.resolve():new Promise(e=>{let t=this.onDidWorkspaceInitialized(()=>{t.dispose(),e()})})}get filetypes(){let e=new Set;for(let t of this.documents)e.add(t.filetype);return e}match(e,t){return Zc(e,t.uri,t.languageId)}async findUp(e){let{cwd:t}=this,i=await this.nvim.call("expand","%:p");i=Ne.default.normalize(i);let n=i&&Ne.default.isAbsolute(i);if(n&&!lt(t,i,!0))return Vc(e,Ne.default.dirname(i));let s=Vc(e,t);return s&&s!=kn.default.homedir()?s:n?Vc(e,Ne.default.dirname(i)):null}async resolveRootFolder(e,t){let{cwd:i}=this;if(e.scheme!="file")return i;let n=Ne.default.normalize(e.fsPath),s=Ne.default.dirname(n);return Gd(s,t)||s}createFileSystemWatcher(e,t,i,n){let s=global.hasOwnProperty("__TEST__")?null:this.getWatchmanPath(),o=s?D.createOutputChannel("watchman"):null,a=s?Pn.createClient(s,this.root,o):Promise.resolve(null);return new qg(a,e,!!t,!!i,!!n)}getWatchmanPath(){let t=this.getConfiguration("coc.preferences").get("watchmanPath","watchman");try{return Bj.default.sync(t)}catch(i){return null}}getConfiguration(e,t){return this.configurations.getConfiguration(e,t)}getDocument(e){if(typeof e=="number")return this.buffers.get(e);let t=kc.isWindows||kc.isMacintosh;e=B.parse(e).toString();for(let i of this.buffers.values())if(!!i&&(i.uri===e||Ne.default.resolve(i.uri)===Ne.default.resolve(e)||t&&i.uri.toLowerCase()===e.toLowerCase()))return i;return null}async applyEdit(e){let{nvim:t}=this,{documentChanges:i,changes:n}=e,[s,o]=await t.eval('[bufnr("%"),coc#cursor#position()]'),a=this.getDocument(s),l=a?a.uri:null,c=null,u=[],f=0,d=this.getConfiguration("coc.preferences"),h=!global.hasOwnProperty("__TEST__")&&d.get("promptWorkspaceEdit",!0),p=d.get("listOfWorkspaceEdit","quickfix");try{if(i&&i.length){let g=this.getChangedUris(i);if(f=g.length,h){let y=g.reduce((S,w)=>S+(this.getDocument(w)==null?1:0),0);if(y&&!await D.showPrompt(`${y} documents on disk would be loaded for change, confirm?`))return}let b=new Map;for(let y of i)if(ne.TextDocumentEdit.is(y)){let{textDocument:S,edits:w}=y,_=await this.loadFile(S.uri);S.uri==l&&(c=w),await _.applyEdits(w);for(let L of w)u.push({uri:_.uri,range:L.range})}else if(ne.CreateFile.is(y)){let S=B.parse(y.uri).fsPath;await this.createFile(S,y.options)}else ne.RenameFile.is(y)?(b.set(y.oldUri,y.newUri),await this.renameFile(B.parse(y.oldUri).fsPath,B.parse(y.newUri).fsPath,y.options)):ne.DeleteFile.is(y)&&await this.deleteFile(B.parse(y.uri).fsPath,y.options);b.size&&u.forEach(y=>{let S=b.get(y.uri);S&&(y.uri=S)})}else if(n){let g=Object.keys(n),b=g.filter(y=>this.getDocument(y)==null);if(b.length){if(h&&!await D.showPrompt(`${b.length} documents on disk would be loaded for change, confirm?`))return;await this.loadFiles(b)}for(let y of Object.keys(n)){let S=this.getDocument(y);B.parse(y).toString()==y&&(c=n[y]);let w=n[y];for(let _ of w)u.push({uri:S.uri,range:_.range});await S.applyEdits(w)}f=g.length}if(c){let g=$c({line:o[0],character:o[1]},c);g&&await D.moveTo({line:o[0]+g.line,character:o[1]+g.character})}if(u.length){let g=await Promise.all(u.map(y=>this.getQuickfixItem(y))),b=u.every(y=>y.uri==l);p=="quickfix"?(await this.nvim.call("setqflist",[g]),b||D.showMessage(`changed ${f} buffers, use :wa to save changes to disk and :copen to open quickfix list`,"more")):p=="location"&&(await t.setVar("coc_jump_locations",g),b||D.showMessage(`changed ${f} buffers, use :wa to save changes to disk and :CocList location to manage changed locations`,"more"))}}catch(g){return rh.error("Error on applyEdits:",e,g),D.showMessage(`Error on applyEdits: ${g.message}`,"error"),!1}return await bt(50),!0}async getQuickfixItem(e,t,i="",n){ne.LocationLink.is(e)&&(e=ne.Location.create(e.targetUri,e.targetRange));let s=this.getDocument(e.uri),{uri:o,range:a}=e,{line:l,character:c}=a.start,u=B.parse(o),f=s?s.bufnr:-1;!t&&u.scheme=="file"&&(t=await this.getLine(o,l),c=Ci(t,c));let d={uri:o,filename:u.scheme=="file"?u.fsPath:o,lnum:l+1,col:c+1,text:t||"",range:a};return n&&(d.module=n),i&&(d.type=i),f!=-1&&(d.bufnr=f),d}createMru(e){return new Oo(e)}async getSelectedRange(e,t){let{nvim:i}=this;if(e==="line"){let u=await i.call("line",["."]);return t.getline(u-1).length?ne.Range.create(u-1,0,u,0):null}if(e==="cursor"){let[u,f]=await i.eval("coc#cursor#position()");return ne.Range.create(u,f,u,f)}if(!["v","V","char","line",""].includes(e))throw new Error(`Mode '${e}' not supported`);let n=["v","V",""].includes(e),[,s,o]=await i.call("getpos",n?"'<":"'["),[,a,l]=await i.call("getpos",n?"'>":"']"),c=ne.Range.create(t.getPosition(s,o),t.getPosition(a,l));return(e=="v"||e=="")&&(c.end.character=c.end.character+1),c}async selectRange(e){let{nvim:t}=this,{start:i,end:n}=e,[s,o,a]=await t.eval("[bufnr('%'), &virtualedit, &selection]"),l=this.getDocument(s);if(!l||!l.attached)return;let c=l.getline(i.line),u=c?re(c.slice(0,i.character)):0,f=l.getline(n.line),d=f?re(f.slice(0,n.character)):0,h="",p=!1;h+="v",d=await t.eval(`virtcol([${n.line+1}, ${d}])`),a=="inclusive"?n.character==0?h+=`${n.line}G`:h+=`${n.line+1}G${d}|`:a=="old"?h+=`${n.line+1}G${d}|`:h+=`${n.line+1}G${d+1}|`,u=await t.eval(`virtcol([${i.line+1}, ${u}])`),h+=`o${i.line+1}G${u+1}|o`,t.pauseNotification(),o!="onemore"&&(p=!0,t.setOption("virtualedit","onemore",!0)),t.command(`noa call cursor(${i.line+1},${u+(h=="a"?0:1)})`,!0),t.command(`normal! ${h}`,!0),p&&t.setOption("virtualedit",o,!0),this.isVim&&t.command("redraw",!0),await t.resumeNotification()}async showLocations(e){let t=await Promise.all(e.map(s=>this.getQuickfixItem(s))),{nvim:i}=this;if(this.getConfiguration("coc.preferences").get("useQuickfixForLocations",!1)){let s=await i.getVar("coc_quickfix_open_command");typeof s!="string"&&(s=t.length<10?`copen ${t.length}`:"copen"),i.pauseNotification(),i.call("setqflist",[t],!0),i.command(s,!0),i.resumeNotification(!1,!0)}else await i.setVar("coc_jump_locations",t),this.env.locationlist?i.command("CocList --normal --auto-preview location",!0):i.call("coc#util#do_autocmd",["CocLocationsChange"],!0)}async getLine(e,t){let i=this.getDocument(e);if(i)return i.getline(t)||"";if(!e.startsWith("file:"))return"";let n=B.parse(e).fsPath;return Gt.default.existsSync(n)?await GB(n,t):""}getWorkspaceFolder(e){this.workspaceFolders.sort((i,n)=>n.uri.length-i.uri.length);let t=B.parse(e).fsPath;return this.workspaceFolders.find(i=>lt(B.parse(i.uri).fsPath,t,!0))}async readFile(e){let t=this.getDocument(e);if(t)return await t.patchChange(),t.content;let i=B.parse(e);return i.scheme!="file"?"":(await this.nvim.call("readfile",[i.fsPath])).join(`
`)+`
`}get document(){return new Promise((e,t)=>{this.nvim.buffer.then(i=>{let n=i.id;if(this.bufnr=n,this.buffers.has(n)){e(this.buffers.get(n));return}this.onBufCreate(n).catch(t);let s=this.onDidOpenTextDocument(o=>{s.dispose(),e(this.getDocument(o.uri))})},t)})}async getCurrentState(){let e=await this.document,t=await D.getCursorPosition();return{document:e.textDocument,position:t}}async getFormatOptions(e){let t;e&&(t=this.getDocument(e));let i=t?t.bufnr:0,[n,s]=await this.nvim.call("coc#util#get_format_opts",[i]);return{tabSize:n,insertSpaces:s==1}}async jumpTo(e,t,i){let n=this.getConfiguration("coc.preferences"),s=i||n.get("jumpCommand","edit"),{nvim:o}=this,a=this.getDocument(e),l=a?a.bufnr:-1;if(l!=-1&&s=="edit"){if(o.pauseNotification(),o.command("silent! normal! m'",!0),o.command(`buffer ${l}`,!0),t){let c=a.getline(t.line),u=re(c.slice(0,t.character))+1;o.call("cursor",[t.line+1,u],!0)}this.isVim&&o.command("redraw",!0),await o.resumeNotification()}else{let{fsPath:c,scheme:u}=B.parse(e),f=t==null?null:[t.line,t.character];if(u=="file"){let d=Kd(Ne.default.normalize(c));await this.nvim.call("coc#util#jump",[s,d,f])}else kn.default.platform()=="win32"&&(e=e.replace(/\/?/,"?")),await this.nvim.call("coc#util#jump",[s,e,f])}}async createFile(e,t={}){let i=await Mt(e);if(i&&!t.overwrite&&!t.ignoreIfExists){D.showMessage(`${e} already exists!`,"error");return}if(!i||t.overwrite)if(e.endsWith("/"))try{e=this.expand(e),await Gt.default.mkdirp(e)}catch(n){D.showMessage(`Can't create ${e}: ${n.message}`,"error")}else{let n=B.file(e).toString();if(this.getDocument(n))return;Gt.default.existsSync(Ne.default.dirname(e))||Gt.default.mkdirpSync(Ne.default.dirname(e)),Gt.default.writeFileSync(e,"","utf8"),await this.loadFile(n)}}async loadFile(e){let t=this.getDocument(e);if(t)return t;let{nvim:i}=this,n=e.startsWith("file")?B.parse(e).fsPath:e;return i.call("coc#util#open_files",[[n]],!0),await new Promise((s,o)=>{let a=this.onDidOpenTextDocument(c=>{let u=B.parse(c.uri).fsPath;(c.uri==e||u==n)&&(clearTimeout(l),a.dispose(),s(this.getDocument(e)))}),l=setTimeout(()=>{a.dispose(),o(new Error(`Create document ${e} timeout after 1s.`))},1e3)})}async loadFiles(e){if(e=e.filter(n=>this.getDocument(n)==null),!(!e.length||!(await this.nvim.call("coc#util#open_files",[e.map(n=>B.parse(n).fsPath)])).filter(n=>this.getDocument(n)==null).length))return new Promise((n,s)=>{let o=setTimeout(()=>{a.dispose(),s(new Error("Create document timeout after 2s."))},2e3),a=this.onDidOpenTextDocument(()=>{e.every(l=>this.getDocument(l)!=null)&&(clearTimeout(o),a.dispose(),n())})})}async renameFile(e,t,i={}){let{overwrite:n,ignoreIfExists:s}=i,{nvim:o}=this;try{let a=await Mt(t);if(a&&!n&&!s)throw new Error(`${t} already exists`);if(!a||n){let l=B.file(e).toString(),c=B.file(t).toString(),u=this.getDocument(l);if(u!=null){let f=u.bufnr==this.bufnr,d=this.getDocument(c);d&&await this.nvim.command(`silent ${d.bufnr}bwipeout!`);let h=u.getDocumentContent();if(await Gt.default.writeFile(t,h,"utf8"),!f)await o.call("coc#util#open_files",[[t]]),await o.command(`silent ${u.bufnr}bwipeout!`);else{let p=await o.call("winsaveview");o.pauseNotification(),o.call("coc#util#open_file",["keepalt edit",t],!0),o.command(`silent ${u.bufnr}bwipeout!`,!0),o.call("winrestview",[p],!0),await o.resumeNotification()}await Gt.default.unlink(e)}else await zB(e,t)}}catch(a){D.showMessage(`Rename error: ${a.message}`,"error")}}async deleteFile(e,t={}){let{ignoreIfNotExists:i,recursive:n}=t,s=await Mt(e.replace(/\/$/,"")),o=s&&s.isDirectory();if(e.endsWith("/")&&!o){D.showMessage(`${e} is not directory`,"error");return}if(!s&&!i){D.showMessage(`${e} not exists`,"error");return}if(s!=null){if(o&&!n){D.showMessage("Can't remove directory, recursive not set","error");return}try{if(o&&n?await Gt.default.remove(e):o?await Gt.default.rmdir(e):await Gt.default.unlink(e),!o){let a=B.file(e).toString(),l=this.getDocument(a);l&&await this.nvim.command(`silent! bwipeout! ${l.bufnr}`)}}catch(a){D.showMessage(`Error on delete ${e}: ${a.message}`,"error")}}}async openResource(e){let{nvim:t}=this;if(e.startsWith("http")){await t.call("coc#util#open_url",e);return}let i=await t.getOption("wildignore");await t.setOption("wildignore",""),await this.jumpTo(e),await t.setOption("wildignore",i)}async resolveModule(e){return await this.resolver.resolveModule(e)}async runCommand(e,t,i){return t=t||this.cwd,Vn(e,{cwd:t},i)}expand(e){if(!e)return e;if(e.startsWith("~")&&(e=kn.default.homedir()+e.slice(1)),e.includes("$")){let t=this.getDocument(this.bufnr),i=t?B.parse(t.uri).fsPath:"";e=e.replace(/\$\{(.*?)\}/g,(n,s)=>{if(s.startsWith("env:")){let o=s.split(":")[1];return o?process.env[o]:""}switch(s){case"workspace":case"workspaceRoot":case"workspaceFolder":return this.root;case"workspaceFolderBasename":return Ne.default.dirname(this.root);case"cwd":return this.cwd;case"file":return i;case"fileDirname":return i?Ne.default.dirname(i):"";case"fileExtname":return i?Ne.default.extname(i):"";case"fileBasename":return i?Ne.default.basename(i):"";case"fileBasenameNoExtension":{let o=i?Ne.default.basename(i):"";return o?o.slice(0,o.length-Ne.default.extname(o).length):""}default:return n}}),e=e.replace(/\$[\w]+/g,n=>n=="$HOME"?kn.default.homedir():process.env[n.slice(1)]||n)}return e}async createTerminal(e){let t=e.shellPath,i=e.shellArgs;t||(t=await this.nvim.getOption("shell"));let n=new Ug(t,i||[],this.nvim,e.name);return await n.start(e.cwd||this.cwd,e.env),this.terminals.set(n.bufnr,n),this._onDidOpenTerminal.fire(n),n}async callAsync(e,t){return this.isNvim?await this.nvim.call(e,t):await this.nvim.callAsync("coc#util#with_callback",[e,t])}registerTextDocumentContentProvider(e,t){this.schemeProviderMap.set(e,t),this.setupDynamicAutocmd();let i=[];return t.onDidChange&&t.onDidChange(async n=>{let s=this.getDocument(n.toString());if(s){let{buffer:o}=s,a=new ne.CancellationTokenSource,l=await Promise.resolve(t.provideTextDocumentContent(n,a.token));await o.setLines(l.split(/\r?\n/),{start:0,end:-1,strictIndexing:!1})}},null,i),ne.Disposable.create(()=>{this.schemeProviderMap.delete(e),G(i),this.setupDynamicAutocmd()})}registerKeymap(e,t,i,n={}){if(!t)throw new Error(`Invalid key ${t} of registerKeymap`);if(this.keymaps.has(t))throw new Error(`${t} already exists.`);n=Object.assign({sync:!0,cancel:!0,silent:!0,repeat:!1},n);let{nvim:s}=this;this.keymaps.set(t,[i,!!n.repeat]);let o=n.sync?"request":"notify",a=n.silent?"<silent>":"";for(let l of e)if(l=="i")s.command(`inoremap ${a}<expr> <Plug>(coc-${t}) coc#_insert_key('${o}', '${t}', ${n.cancel?1:0})`,!0);else{let c=JC(l);s.command(`${l}noremap ${a} <Plug>(coc-${t}) :${c}call coc#rpc#${o}('doKeymap', ['${t}'])<cr>`,!0)}return ne.Disposable.create(()=>{this.keymaps.delete(t);for(let l of e)s.command(`${l}unmap <Plug>(coc-${t})`,!0)})}registerExprKeymap(e,t,i,n=!1){if(!t)return;let s=`${e}${global.Buffer.from(t).toString("base64")}${n?"1":"0"}`,{nvim:o}=this;return this.keymaps.set(s,[i,!1]),e=="i"?o.command(`inoremap <silent><expr>${n?"<nowait><buffer>":""} ${t} coc#_insert_key('request', '${s}')`,!0):o.command(`${e}noremap <silent><expr>${n?"<nowait><buffer>":""} ${t} coc#rpc#request('doKeymap', ['${s}'])`,!0),ne.Disposable.create(()=>{this.keymaps.delete(s),o.command(`${e}unmap ${n?"<buffer>":""} ${t}`,!0)})}registerLocalKeymap(e,t,i,n=!1){let s=Ms(),{nvim:o,bufnr:a}=this;this.keymaps.set(s,[i,!1]);let l=n?"notify":"request",c=JC(e),u=t.startsWith("<")&&t.endsWith(">")?`{${t.slice(1,-1)}}`:t;if(this.isNvim&&!global.hasOwnProperty("__TEST__"))o.call("nvim_buf_set_keymap",[0,e,t,`:${c}call coc#rpc#${l}('doKeymap', ['${s}', '', '${u}'])<CR>`,{silent:!0,nowait:!0}],!0);else{let f=`${e}noremap <silent><nowait><buffer> ${t} :${c}call coc#rpc#${l}('doKeymap', ['${s}', '', '${u}'])<CR>`;o.command(f,!0)}return ne.Disposable.create(()=>{this.keymaps.delete(s),o.call("coc#compat#buf_del_keymap",[a,e,t],!0)})}createDatabase(e){let t;global.hasOwnProperty("__TEST__")?(t=Ne.default.join(kn.default.tmpdir(),`coc-${process.pid}`),Gt.default.mkdirpSync(t)):t=Ne.default.dirname(this.env.extensionRoot);let i=Ne.default.join(t,e+".json");return new Kc(i)}createTask(e){return new jg(this.nvim,e)}registerBufferSync(e){return new Hg(e,this)}setupDynamicAutocmd(e=!1){if(!e&&!this._dynAutocmd)return;this._dynAutocmd=!0;let t=this.schemeProviderMap.keys(),i=[];for(let s of t)i.push(`autocmd BufReadCmd,FileReadCmd,SourceCmd ${s}:/* call coc#rpc#request('CocAutocmd', ['BufReadCmd','${s}', expand('<amatch>')])`);for(let[s,o]of this.autocmds.entries()){let a=o.arglist&&o.arglist.length?", "+o.arglist.join(", "):"",l=Array.isArray(o.event)?o.event.join(","):o.event,c=o.pattern!=null?o.pattern:"*";/\buser\b/i.test(l)&&(c=""),i.push(`autocmd ${l} ${c} call coc#rpc#${o.request?"request":"notify"}('doAutocmd', [${s}${a}])`)}for(let s of this.watchedOptions)i.push(`autocmd OptionSet ${s} call coc#rpc#notify('OptionSet',[expand('<amatch>'), v:option_old, v:option_new])`);let n=`
augroup coc_dynamic_autocmd
autocmd!
${i.join(`
`)}
augroup end`;try{let s=Ne.default.join(process.env.TMPDIR,`coc.nvim-${process.pid}`);Gt.default.existsSync(s)||Gt.default.mkdirpSync(s);let o=Ne.default.join(s,`coc-${process.pid}.vim`);Gt.default.writeFileSync(o,n,"utf8");let a=`source ${o}`;this.env.isCygwin&&kc.isWindows&&(a=`execute "source" . substitute(system('cygpath ${o.replace(/\\/g,"/")}'), '\\n', '', 'g')`),this.nvim.command(a).logError()}catch(s){D.showMessage(`Can't create tmp file: ${s.message}`,"error")}}async onBufReadCmd(e,t){let i=this.schemeProviderMap.get(e);if(!i){D.showMessage(`Provider for ${e} not found`,"error");return}let n=new ne.CancellationTokenSource,s=await Promise.resolve(i.provideTextDocumentContent(B.parse(t),n.token)),o=await this.nvim.buffer;await o.setLines(s.split(/\r?\n/),{start:0,end:-1,strictIndexing:!1}),setTimeout(async()=>{await O.fire("BufCreate",[o.id])},30)}async attach(){if(this._attached)return;this._attached=!0;let[e,t,i]=await this.nvim.eval(`[map(getbufinfo({'bufloaded': 1}),'v:val["bufnr"]'),bufnr('%'),win_getid()]`);this.bufnr=t,await Promise.all(e.map(n=>this.onBufCreate(n))),this._initialized||(this._onDidWorkspaceInitialized.fire(void 0),this._initialized=!0),await O.fire("BufEnter",[t]),await O.fire("BufWinEnter",[t,i])}getChangedUris(e){let t=new Set,i=new Set;for(let n of e)if(ne.TextDocumentEdit.is(n)){let{textDocument:s}=n,{uri:o,version:a}=s;if(t.add(o),a!=null&&a>0){let l=this.getDocument(o);if(!l)throw new Error(`${o} not loaded`);if(l.version!=a)throw new Error(`${o} changed before apply edit`)}}else if(ne.CreateFile.is(n)||ne.DeleteFile.is(n)){if(!Og(n.uri))throw new Error(`change of scheme ${n.uri} not supported`);i.add(n.uri),t.add(n.uri)}else if(ne.RenameFile.is(n)){if(!Og(n.oldUri)||!Og(n.newUri))throw new Error(`change of scheme ${n.oldUri} not supported`);let s=B.parse(n.newUri).fsPath;if(Gt.default.existsSync(s))throw new Error(`file "${s}" already exists for rename`);t.add(n.oldUri)}else throw new Error(`Invalid document change: ${JSON.stringify(n,null,2)}`);return Array.from(t)}createConfigurations(){let e=Ne.default.normalize(process.env.COC_VIMCONFIG)||Ne.default.join(kn.default.homedir(),".vim"),t=Ne.default.join(e,Is);return new ko(t,new Lg(this))}attachChangedEvents(){if(this.isVim){let e=t=>{let i=this.getDocument(t);i&&i.attached&&i.fetchContent()};O.on("TextChangedP",e,null,this.disposables),O.on("TextChangedI",e,null,this.disposables),O.on("TextChanged",e,null,this.disposables)}}async onBufCreate(e){let t=typeof e=="number"?this.nvim.createBuffer(e):e,i=t.id;if(this.creatingSources.has(i))return;let n=this.getDocument(i),s=new ne.CancellationTokenSource;try{n&&this.onBufUnload(i,!0),n=new Fg(t,this._env,this.maxFileSize);let o=s.token;this.creatingSources.set(i,s),await n.init(this.nvim,o)||(n=null)}catch(o){rh.error("Error on create buffer:",o),n=null}if(this.creatingSources.get(i)==s&&(s.dispose(),this.creatingSources.delete(i)),!(!n||!n.textDocument)){if(this.buffers.set(i,n),n.attached&&n.onDocumentDetach(o=>{let a=this.getDocument(o);a&&this.onBufUnload(a.bufnr)}),n.buftype==""&&n.schema=="file"&&(this.configurations.checkFolderConfiguration(n.uri),!this.getConfiguration("workspace").get("ignoredFiletypes",[]).includes(n.filetype))){let l=this.resolveRoot(n);l&&(this.addWorkspaceFolder(l),this.bufnr==t.id&&(this._root=l))}if(n.enabled){let o=Object.assign(n.textDocument,{bufnr:i});this._onDidOpenDocument.fire(o),n.onDocumentChange(a=>this._onDidChangeDocument.fire(a))}rh.debug("buffer created",t.id)}}onBufEnter(e){this.bufnr=e;let t=this.getDocument(e);if(t){this.configurations.setFolderConfiguration(t.uri);let i=this.getWorkspaceFolder(t.uri);i&&(this._root=B.parse(i.uri).fsPath)}}async checkCurrentBuffer(e){this.bufnr=e,await this.checkBuffer(e)}onBufWritePost(e){let t=this.buffers.get(e);!t||this._onDidSaveDocument.fire(t.textDocument)}onBufUnload(e,t=!1){if(rh.debug("buffer unload",e),!t){let n=this.creatingSources.get(e);n&&(n.cancel(),this.creatingSources.delete(e))}if(this.terminals.has(e)){let n=this.terminals.get(e);this._onDidCloseTerminal.fire(n),this.terminals.delete(e)}let i=this.buffers.get(e);if(i){let n=Object.assign(i.textDocument,{bufnr:e});this._onDidCloseDocument.fire(n),this.buffers.delete(e),i.detach()}}async onBufWritePre(e){let t=this.buffers.get(e);if(!t||!t.attached)return;await t.synchronize();let i=!0,n=[],s={document:t.textDocument,reason:ne.TextDocumentSaveReason.Manual,waitUntil:a=>{i?n.push(a):(rh.error("Can't call waitUntil in async manner:",Error().stack),D.showMessage("waitUntil can't be used in async manner, check log for details","error"))}};this._onWillSaveDocument.fire(s),i=!1;let o=n.length;if(o){let l=await new Promise(c=>{let f=this.getConfiguration("coc.preferences").get("willSaveHandlerTimeout",500),d=setTimeout(()=>{D.showMessage(`Will save handler timeout after ${f}ms`,"warning"),c(void 0)},f),h=0,p=!1;for(let g of n){let b=y=>{p||(p=!0,clearTimeout(d),c(y))};g.then(y=>{if(Array.isArray(y)&&y.length&&ne.TextEdit.is(y[0]))return b(y);h=h+1,h==o&&b(void 0)},()=>{h=h+1,h==o&&b(void 0)})}});l&&await t.applyEdits(l)}}onDirChanged(e){e!=this._cwd&&(this._cwd=e)}onFileTypeChange(e,t){let i=this.getDocument(t);if(!i||i.convertFiletype(e)==i.filetype)return;let s=Object.assign(i.textDocument,{bufnr:t});this._onDidCloseDocument.fire(s),i.setFiletype(e),this._onDidOpenDocument.fire(Object.assign(i.textDocument,{bufnr:t}))}async checkBuffer(e){if(this._disposed||!e)return;!this.getDocument(e)&&!this.creatingSources.has(e)&&await this.onBufCreate(e)}resolveRoot(e){let t=[ir.Buffer,ir.LanguageServer,ir.Global],i=B.parse(e.uri),n=Ne.default.dirname(i.fsPath),{cwd:s}=this,o=this.getConfiguration("workspace"),a=o.get("bottomUpFiletypes",[]),l=o.get("workspaceFolderCheckCwd",!0);for(let c of t){let u=this.getRootPatterns(e,c);if(u&&u.length){let f=a.includes(e.filetype),d=Gd(n,u,s,f,l);if(d)return d}}return this.cwd!=kn.default.homedir()&<(this.cwd,n,!0)?this.cwd:null}getRootPatterns(e,t){let{uri:i}=e;return t==ir.Buffer?e.getVar("root_patterns",[])||[]:t==ir.LanguageServer?this.getServerRootPatterns(e.filetype):this.getConfiguration("coc.preferences",i).get("rootPatterns",[".git",".hg",".projections.json"]).slice()}async renameCurrent(){let{nvim:e}=this,t=await e.call("bufnr","%"),i=await e.call("getcwd"),n=this.getDocument(t);if(!n||n.buftype!=""||n.schema!="file"){e.errWriteLine("current buffer is not file.");return}let s=B.parse(n.uri).fsPath,o=await e.callAsync("coc#util#with_callback",["input",["New path: ",s,"file"]]);if(o=o?o.trim():null,o==s||!o)return;let a=await n.buffer.lines,l=Gt.default.existsSync(s);if(l){if(await e.eval("&modified")&&await e.command("noa w"),s.toLowerCase()!=o.toLowerCase()&&Gt.default.existsSync(o)){if(!await D.showPrompt(`${o} exists, overwrite?`))return;Gt.default.unlinkSync(o)}Gt.default.renameSync(s,o)}this._onWillRenameFiles.fire({files:[{newUri:B.parse(o),oldUri:B.parse(s)}],waitUntil:async f=>{let d=await Promise.resolve(f);d&&ne.WorkspaceEdit.is(d)&&await this.applyEdit(d)}}),this._onDidRenameFiles.fire({files:[{newUri:B.parse(o),oldUri:B.parse(s)}]});let c=lt(i,o)?Ne.default.relative(i,o):o,u=await e.call("winsaveview");e.pauseNotification(),s.toLowerCase()==o.toLowerCase()?(e.command(`keepalt ${t}bwipeout!`,!0),e.call("coc#util#open_file",["keepalt edit",c],!0)):(e.call("coc#util#open_file",["keepalt edit",c],!0),e.command(`${t}bwipeout!`,!0)),!l&&a.join(`
`)!=`
`&&(e.call("append",[0,a],!0),e.command("normal! Gdd",!0)),e.call("winrestview",[u],!0),await e.resumeNotification()}get folderPaths(){return this.workspaceFolders.map(e=>B.parse(e.uri).fsPath)}get floatSupported(){let{env:e}=this;return e.floating||e.textprop}removeWorkspaceFolder(e){let t=this._workspaceFolders.findIndex(i=>B.parse(i.uri).fsPath==e);if(t!=-1){let i=this._workspaceFolders[t];this._workspaceFolders.splice(t,1),this._onDidChangeWorkspaceFolders.fire({removed:[i],added:[]})}}renameWorkspaceFolder(e,t){let i=this._workspaceFolders.findIndex(o=>B.parse(o.uri).fsPath==e);if(i==-1)return;let n=this._workspaceFolders[i],s={uri:B.file(t).toString(),name:Ne.default.dirname(t)};this._workspaceFolders.splice(i,1),this._workspaceFolders.push(s),this._onDidChangeWorkspaceFolders.fire({removed:[n],added:[s]})}addRootPattern(e,t){let i=this.rootPatterns.get(e)||[];for(let n of t)i.includes(n)||i.push(n);this.rootPatterns.set(e,i)}get insertMode(){return this._insertMode}async detach(){if(!!this._attached){this._attached=!1,Ga.dispose();for(let e of this.buffers.keys())await O.fire("BufUnload",[e])}}dispose(){this._disposed=!0;for(let e of this.documents)e.detach();G(this.disposables),Pn.dispose(),this.configurations.dispose(),this.buffers.clear()}addWorkspaceFolder(e){if(e==kn.default.homedir())return;let{_workspaceFolders:t}=this,i=B.file(e).toString(),n={uri:i,name:Ne.default.basename(e)};return t.findIndex(s=>s.uri==i)==-1&&(t.push(n),this._initialized&&this._onDidChangeWorkspaceFolders.fire({added:[n],removed:[]})),n}getServerRootPatterns(e){let t=this.getConfiguration().get("languageserver",{}),i=[];for(let n of Object.keys(t)){let s=t[n],{filetypes:o,rootPatterns:a}=s;Array.isArray(o)&&a&&o.includes(e)&&i.push(...a)}return i=i.concat(this.rootPatterns.get(e)||[]),i.length?Ng(i):null}},v=new Uj});function kle(r){return r.toLowerCase()===r}function Ile(r){return r.toUpperCase()===r}function Ole(r){let e=r.length,t=new Array(e),i="/";for(let n=0;n<e;n++){let s=r[n];i==="/"?t[n]=Tle:i==="-"||i==="_"||i===" "?t[n]=Dle:i==="."?t[n]=Ple:kle(i)&&Ile(s)?t[n]=Rle:t[n]=0,i=s}return t}function Wj(r,e,t,i){let n=r.length,s=e.length,o=r.toLowerCase(),a=e.toLowerCase(),l=Ole(e);for(let c=0;c<n;c++){t[c]=new Array(s),i[c]=new Array(s);let u=Qc,f=c===n-1?_le:Ele;for(let d=0;d<s;d++)if(o[c]===a[d]){let h=Qc;c?d&&(h=Math.max(i[c-1][d-1]+l[d],t[c-1][d-1]+Hj)):h=d*Cle+l[d],t[c][d]=h,i[c][d]=u=Math.max(h,u+f)}else t[c][d]=Qc,i[c][d]=u=u+f}}function eu(r,e){let t=r.length,i=e.length;if(!t||!i)return Qc;if(t===i)return Sle;if(i>1024)return Qc;let n=new Array(t),s=new Array(t);return Wj(r,e,n,s),s[t-1][i-1]}function zj(r){let e=[];for(let t=0;t<r.length;t++){let i=e.length?e[e.length-1]:void 0,n=r[t];i&&n==i[1]?i[1]=n+1:e.push([n,n+1])}return e}function Qg(r,e){let t=r.length,i=e.length,n=new Array(t);if(!t||!i)return n;if(t===i){for(let l=0;l<t;l++)n[l]=l;return n}if(i>1024)return n;let s=new Array(t),o=new Array(t);Wj(r,e,s,o);let a=!1;for(let l=t-1,c=i-1;l>=0;l--)for(;c>=0;c--)if(s[l][c]!==Qc&&(a||s[l][c]===o[l][c])){a=l&&c&&o[l][c]===s[l-1][c-1]+Hj,n[l]=c--;break}return n}function ev(r,e){r=r.toLowerCase(),e=e.toLowerCase();let t=r.length;for(let i=0,n=0;i<t;i+=1)if(n=e.indexOf(r[i],n)+1,n===0)return!1;return!0}var Qc,Sle,Cle,_le,Ele,Hj,Tle,Dle,Rle,Ple,tv=R(()=>{Qc=-1/0,Sle=1/0,Cle=-.005,_le=-.005,Ele=-.01,Hj=1,Tle=.9,Dle=.8,Rle=.7,Ple=.6});var iv,tu,rv,Vj=R(()=>{_e();iv=E(H());de();tu="filter",rv=class{constructor(e,t){this.nvim=e;this._activated=!1;this.history=[];this.disposables=[];this._onDidUpdate=new iv.Emitter;this._onDidExit=new iv.Emitter;this._onDidKeyPress=new iv.Emitter;this.onDidKeyPress=this._onDidKeyPress.event;this.onDidUpdate=this._onDidUpdate.event;this.onDidExit=this._onDidExit.event;this.text="",O.on("InputChar",(i,n)=>{if(!(i!==tu||!this._activated)){if(!t.includes(n)){if(n.length==1){this.text=this.text+n,this._onDidUpdate.fire(this.text);return}if(n=="<bs>"){this.text=this.text.slice(0,-1),this._onDidUpdate.fire(this.text);return}if(n=="<C-u>"){this.text="",this._onDidUpdate.fire(this.text);return}if(n=="<C-n>"){let s=this.history.indexOf(this.text),o=this.history[s+1]||this.history[0];o&&(this.text=o,this._onDidUpdate.fire(this.text));return}if(n=="<C-p>"){let s=this.history.indexOf(this.text),o=this.history[s-1]||this.history[this.history.length-1];o&&(this.text=o,this._onDidUpdate.fire(this.text))}if(n=="<esc>"||n=="<C-o>"){this.deactivate();return}}this._onDidKeyPress.fire(n)}},null,this.disposables)}active(){this._activated||(this._activated=!0,this.text="",this.nvim.call("coc#prompt#start_prompt",[tu],!0))}deactivate(e){if(!this._activated)return;this.nvim.call("coc#prompt#stop_prompt",[tu],!0),this._activated=!1;let{text:t}=this;this.text="",this._onDidExit.fire(e),t&&!this.history.includes(t)&&this.history.push(t)}get activated(){return this._activated}dispose(){this.deactivate(),this.history=[],this._onDidKeyPress.dispose(),this._onDidUpdate.dispose(),this._onDidExit.dispose(),G(this.disposables)}}});var Gj,nh,$e,Kn,nv=R(()=>{qe();Gj=E(require("path"));(function(e){function r(t){return typeof t.label=="string"}e.is=r})(nh||(nh={}));(function(i){i[i.None=0]="None",i[i.Collapsed=1]="Collapsed",i[i.Expanded=2]="Expanded"})($e||($e={}));Kn=class{constructor(e,t=0){this.collapsibleState=t;B.isUri(e)?(this.resourceUri=e,this.label=Gj.default.basename(e.path),this.id=e.toString()):this.label=e}}});var Kj={};Bn(Kj,{default:()=>Ya});var or,w_,x_,S_,C_,Ya,sv=R(()=>{or=E(H());Ei();_e();Va();de();As();ri();yt();tv();Y();Te();Vj();nv();w_=U()("BasicTreeView"),x_="tree",S_=3e3,C_=1,Ya=class{constructor(e,t){this.viewId=e;this._selection=[];this._onDidExpandElement=new or.Emitter;this._onDidCollapseElement=new or.Emitter;this._onDidChangeSelection=new or.Emitter;this._onDidChangeVisibility=new or.Emitter;this.onDidExpandElement=this._onDidExpandElement.event;this.onDidCollapseElement=this._onDidCollapseElement.event;this.onDidChangeSelection=this._onDidChangeSelection.event;this.onDidChangeVisibility=this._onDidChangeVisibility.event;this.retryTimers=0;this.renderedItems=[];this.nodesMap=new Map;this.mutex=new hi;this.disposables=[];this.lineState={titleCount:0,messageCount:0};this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),t.enableFilter&&(this.filter=new rv(this.nvim,[this.keys.selectNext,this.keys.selectPrevious,this.keys.invoke])),this.tooltipFactory=new tr(v.nvim),this.canSelectMany=!!t.canSelectMany,this.provider=t.treeDataProvider,this.leafIndent=t.disableLeafIndent!==!0,this.winfixwidth=t.winfixwidth!==!1;let i;Object.defineProperty(this,"message",{set:a=>{i=a?a.replace(/\r?\n/g," "):void 0,this.updateHeadLines()},get:()=>i});let n=e.replace(/\r?\n/g," ");Object.defineProperty(this,"title",{set:a=>{n=a?a.replace(/\r?\n/g," "):void 0,this.updateHeadLines()},get:()=>n});let s;Object.defineProperty(this,"description",{set:a=>{s=a?a.replace(/\r?\n/g," "):void 0,this.updateHeadLines()},get:()=>s});let o;Object.defineProperty(this,"filterText",{set:a=>{let{titleCount:l,messageCount:c}=this.lineState,u=l+c;if(a!=null){let f=[{lnum:u,colStart:re(a),colEnd:re(a)+1,hlGroup:"Cursor"}];this.renderedItems=[],this.updateUI([a+" "],f,u,-1,!0),this.doFilter(a)}else o!=null&&this.updateUI([],[],u,u+1);o=a},get:()=>o}),this.provider.onDidChangeTreeData&&this.provider.onDidChangeTreeData(this.onDataChange,this,this.disposables),O.on("BufUnload",a=>{a==this.bufnr&&(this.winid=void 0,this.bufnr=void 0,this._onDidChangeVisibility.fire({visible:!1}),this.dispose())},null,this.disposables),O.on("CursorHold",async a=>{a==this.bufnr&&await this.onHover()},null,this.disposables),O.on(["CursorMoved","BufEnter"],()=>{this.cancelResolve()},null,this.disposables),O.on("WinEnter",a=>{var d;if(a!=this.windowId||!((d=this.filter)==null?void 0:d.activated))return;let l=this.nvim.createBuffer(this.bufnr),c=this.startLnum-1,u=this.filterText?this.filterText.length:0,f=or.Range.create(c,u,c,u+1);l.highlightRanges(x_,"Cursor",[f]),this.nvim.call("coc#prompt#start_prompt",[tu],!0),this.redraw()},null,this.disposables),O.on("WinLeave",a=>{var c;if(a!=this.windowId||!((c=this.filter)==null?void 0:c.activated))return;let l=this.nvim.createBuffer(this.bufnr);this.nvim.call("coc#prompt#stop_prompt",[tu],!0),l.clearNamespace(x_,this.startLnum-1,this.startLnum)},null,this.disposables),this.disposables.push(this._onDidChangeVisibility,this._onDidChangeSelection,this._onDidCollapseElement,this._onDidExpandElement),this.filter&&(this.filter.onDidExit(a=>{this.nodesMap.clear(),this.filterText=void 0,this.itemsToFilter=void 0,a&&typeof this.provider.getParent=="function"?(this.renderedItems=[],this.reveal(a,{focus:!0})):(this.clearSelection(),this.render())}),this.filter.onDidUpdate(a=>{this.filterText=a}),this.filter.onDidKeyPress(async a=>{var u,f;let l=this.renderedItems;if(!(l==null?void 0:l.length))return;let c=this.selection[0];if(a=="<up>"||a==this.keys.selectPrevious){let d=l.findIndex(g=>g.node==c),h=d==-1||d==0?l.length-1:d-1,p=(u=l[h])==null?void 0:u.node;p&&this.selectItem(p,!0)}if(a=="<down>"||a==this.keys.selectNext){let d=l.findIndex(g=>g.node==c),h=d==-1||d==l.length-1?0:d+1,p=(f=l[h])==null?void 0:f.node;p&&this.selectItem(p,!0)}if(a=="<cr>"||a==this.keys.invoke){if(!c)return;await this.invokeCommand(c),this.filter.deactivate(c)}}))}get windowId(){return this.winid}get startLnum(){let e=this.filterText==null?0:1;return this.lineState.messageCount+this.lineState.titleCount+e}get nvim(){return v.nvim}loadConfiguration(e){if(!e||e.affectsConfiguration("tree")){let t=v.getConfiguration("tree");this.config={openedIcon:t.get("openedIcon"," "),closedIcon:t.get("closedIcon"," ")},this.keys={close:t.get("key.close"),invoke:t.get("key.invoke"),toggle:t.get("key.toggle"),actions:t.get("key.actions"),collapseAll:t.get("key.collapseAll"),toggleSelection:t.get("key.toggleSelection"),activeFilter:t.get("key.activeFilter"),selectNext:t.get("key.selectNext"),selectPrevious:t.get("key.selectPrevious")},e&&this.render()}}async doFilter(e){let t=[],i=0,n=await this.mutex.acquire();try{if(!this.itemsToFilter){let l=[],c=async f=>{for(let d of f){l.push(d);let h=await Promise.resolve(this.provider.getChildren(d));(h==null?void 0:h.length)&&await c(h)}},u=await Promise.resolve(this.provider.getChildren());await c(u),this.itemsToFilter=l}for(let l of this.itemsToFilter){let c=await this.getTreeItem(l),u=nh.is(c.label)?c.label.label:c.label;if(!e||ev(e,u)){let f=e?Qg(e,u):[];c.collapsibleState=$e.None,c.label={label:u,highlights:e?zj(f):[]};let{line:d,highlights:h}=this.getRenderedLine(c,i,0);t.push({level:0,node:l,line:d,index:i,score:e?eu(e,u):0,highlights:h}),i+=1}}t.sort((l,c)=>l.score!=c.score?c.score-l.score:l.index-c.index);let s=this.startLnum,o=[],a=this.renderedItems=t.map((l,c)=>(o.push(...l.highlights.map(u=>(u.lnum=s+c,u))),delete l.index,delete l.score,delete l.highlights,l));this.updateUI(a.map(l=>l.line),o,s,-1,!0),a.length?this.selectItem(a[0].node,!0):this.clearSelection(),this.redraw(),n()}catch(s){n(),w_.error(`Error on tree filter: ${s.message}`,s)}}async onHover(){let{nvim:e}=this,t=await e.call("line",["."]),i=this.getElementByLnum(t-1);if(!i)return;let n=this.nodesMap.get(i);if(!n)return;let s=n.item;if(!n.resolved&&(s=await this.resolveItem(i,s),!s)||!s.tooltip||!this.bufnr)return;let a={filetype:or.MarkupContent.is(s.tooltip)&&s.tooltip.kind==or.MarkupKind.Markdown?"markdown":"txt",content:or.MarkupContent.is(s.tooltip)?s.tooltip.value:s.tooltip};await this.tooltipFactory.show([a],{modes:["n"]})}async onClick(e){let{nvim:t}=this,[i,n]=await t.eval("[getline('.'),col('.')]"),s=zt(i,0,n-1),o=i[s.length];if(!o)return;let{openedIcon:a,closedIcon:l}=this.config;/^\s*$/.test(s)&&[a,l].includes(o)?await this.toggleExpand(e):await this.invokeCommand(e)}async invokeCommand(e){let t=this.nodesMap.get(e);if(!t)return;this.selectItem(e);let i=t.item;if(!(!i.command&&(i=await this.resolveItem(e,i),!i))){if(!i.command)throw new Error("Failed to resolve command from TreeItem.");await se.execute(i.command)}}async invokeActions(e){if(this.selectItem(e),typeof this.provider.resolveActions!="function"){await D.showWarningMessage("No actions");return}let t=this.nodesMap.get(e),i=await Promise.resolve(this.provider.resolveActions(t.item,e));if(!i||i.length==0){await D.showWarningMessage("No actions available");return}let n=i.map(o=>o.title),s=await D.showMenuPicker(n,"Choose action");s!=-1&&await Promise.resolve(i[s].handler(e))}async onDataChange(e){var i;if((i=this.filter)==null?void 0:i.activated){this.itemsToFilter=void 0,await this.doFilter(this.filterText);return}if(this.clearSelection(),!e){await this.render();return}let t=await this.mutex.acquire();try{let n=this.renderedItems,s=n.findIndex(o=>o.node===e);if(s!=-1&&this.bufnr){let a=n[s].level,l=0;for(let d=s;d<n.length;d++){let h=n[d];(d==s||h&&h.level>a)&&(l+=1)}let c=[],u=[],f=s+this.startLnum;await this.appendTreeNode(e,a,f,c,u),n.splice(s,l,...c),this.updateUI(c.map(d=>d.line),u,f,f+l)}t()}catch(n){let s=`Error on tree refresh: ${n.message}`;w_.error(s,n),this.nvim.errWriteLine("[coc.nvim] "+s),t()}}async resolveItem(e,t){if(typeof this.provider.resolveTreeItem=="function"){let i=this.resolveTokenSource=new or.CancellationTokenSource,n=i.token;if(t=await Promise.resolve(this.provider.resolveTreeItem(t,e,n)),i.dispose(),this.resolveTokenSource=void 0,n.isCancellationRequested)return}return this.nodesMap.set(e,{item:t,resolved:!0}),t}get visible(){return this.winid!=null}get selection(){return this._selection.slice()}async checkLines(){if(!this.bufnr)return;let t=await this.nvim.createBuffer(this.bufnr).lines,{titleCount:i,messageCount:n}=this.lineState;t=t.slice(i+n);let s=this.renderedItems.map(o=>o.line);return je(t,s)}async toggleExpand(e){let t=this.nodesMap.get(e);if(!t)return;let i=t.item,n=this.getItemLnum(e),s=n-this.startLnum,o=this.renderedItems[s];if(!o||i.collapsibleState==$e.None){if(typeof this.provider.getParent=="function"){let u=await Promise.resolve(this.provider.getParent(e));u&&(await this.toggleExpand(u),this.focusItem(u))}return}let a=0;if(i.collapsibleState==$e.Expanded){let u=o.level;for(let f=s+1;f<this.renderedItems.length;f++){let d=this.renderedItems[f];if(!d||d.level<=u)break;a+=1}i.collapsibleState=$e.Collapsed}else i.collapsibleState==$e.Collapsed&&(i.collapsibleState=$e.Expanded);let l=[],c=[];await this.appendTreeNode(o.node,o.level,n,l,c),this.renderedItems.splice(s,a+1,...l),this.updateUI(l.map(u=>u.line),c,n,n+a+1),this.refreshSigns(),i.collapsibleState==$e.Collapsed?this._onDidCollapseElement.fire({element:e}):this._onDidExpandElement.fire({element:e})}toggleSelection(e){let t=this._selection.findIndex(i=>i===e);t!==-1?this.unselectItem(t):this.selectItem(e)}clearSelection(){if(!this.bufnr)return;this._selection=[],this.nvim.createBuffer(this.bufnr).unplaceSign({group:"CocTree"}),this._onDidChangeSelection.fire({selection:[]})}selectItem(e,t,i){let{nvim:n}=this;if(!this.bufnr||!v.env.sign)return;let s=this.getItemLnum(e);if(s==null)return;let o=n.createBuffer(this.bufnr),a=this._selection.includes(e);!this.canSelectMany||t?this._selection=[e]:a||this._selection.push(e),n.pauseNotification(),(!this.canSelectMany||t)&&o.unplaceSign({group:"CocTree"}),n.call("coc#compat#execute",[this.winid,`exe ${s+1}`],!0),o.placeSign({id:S_+s,lnum:s+1,name:"CocTreeSelected",group:"CocTree"}),i||this.redraw(),n.resumeNotification(!1,!0),a||this._onDidChangeSelection.fire({selection:this._selection})}unselectItem(e){let t=this._selection[e],i=this.getItemLnum(t);if(i==null||!this.bufnr||!v.env.sign)return;this._selection.splice(e,1),this.nvim.createBuffer(this.bufnr).unplaceSign({group:"CocTree",id:S_+i}),this._onDidChangeSelection.fire({selection:this._selection})}focusItem(e){if(!this.winid)return;let t=this.getItemLnum(e);t!=null&&this.nvim.call("coc#compat#execute",[this.winid,`exe ${t+1}`],!0)}getElementByLnum(e){let t=this.renderedItems[e-this.startLnum];return t?t.node:void 0}getItemLnum(e){let t=this.renderedItems.findIndex(i=>i.node===e);if(t!=-1)return this.startLnum+t}async getTreeItem(e){let t,i=!1,n=this.nodesMap.get(e);n!=null&&(t=n.item,i=n.resolved);let s=await Promise.resolve(this.provider.getTreeItem(e));if(s.id&&!t){for(let o of this.nodesMap.values())if(o.item.id===s.id){i=o.resolved,t=o.item;break}}return t&&t.collapsibleState!=$e.None&&s.collapsibleState!=$e.None&&(s.collapsibleState=t.collapsibleState),this.nodesMap.set(e,{item:s,resolved:i}),s}getRenderedLine(e,t,i){let{openedIcon:n,closedIcon:s}=this.config,o=[],{label:a,deprecated:l,description:c}=e,u=" ".repeat(i),f=(h,p)=>{let g=re(u);o.push({lnum:t,hlGroup:p,colStart:g,colEnd:g+re(h)})};switch(e.collapsibleState){case $e.Expanded:{f(n,"CocTreeOpenClose"),u+=n+" ";break}case $e.Collapsed:{f(s,"CocTreeOpenClose"),u+=s+" ";break}default:u+=this.leafIndent?" ":""}if(e.icon){let{text:h,hlGroup:p}=e.icon;f(h,p),u+=h+" "}if(nh.is(a)&&Array.isArray(a.highlights)){let h=re(u);for(let p of a.highlights)o.push({lnum:t,hlGroup:"Search",colStart:h+p[0],colEnd:h+p[1]})}let d=typeof a=="string"?a:a.label;return l&&f(d,"CocDeprecatedHighlight"),u+=d,c&&c.indexOf(`
`)==-1&&(u+=" ",f(c,"CocTreeDescription"),u+=c),{line:u,highlights:o}}async appendTreeNode(e,t,i,n,s){let o=1,a=await this.getTreeItem(e),l=this.getRenderedLine(a,i,t);if(s.push(...l.highlights),n.push({level:t,line:l.line,node:e}),a.collapsibleState==$e.Expanded){let c=t+1,u=await Promise.resolve(this.provider.getChildren(e))||[];for(let f of u){let d=await this.appendTreeNode(f,c,i+o,n,s);o=o+d}}return o}updateUI(e,t,i=0,n=-1,s=!1){if(!this.bufnr)return;let{nvim:o}=this,a=o.createBuffer(this.bufnr);if(o.pauseNotification(),a.setOption("modifiable",!0,!0),a.setLines(e,{start:i,end:n,strictIndexing:!1},!0),t.length){let l=n==-1?-1:i+e.length;o.call("coc#highlight#update_highlights",[this.bufnr,x_,t,i,l],!0)}a.setOption("modifiable",!1,!0),s||this.redraw(),o.resumeNotification(!1,!0)}async reveal(e,t={}){var l;if((l=this.filter)==null?void 0:l.activated)return;let i=this.getItemLnum(e)!=null,{select:n,focus:s,expand:o}=t,a=e;if(typeof this.provider.getParent!="function")throw new Error("missing getParent function from provider for reveal.");if(!i)for(;a;){let c=await Promise.resolve(this.provider.getParent(a));if(c){let u=await this.getTreeItem(c);u.collapsibleState=$e.Expanded,a=c}else break}if(o){let c=await this.getTreeItem(e);if(c.collapsibleState==$e.None)return;if(c.collapsibleState=$e.Expanded,typeof o=="number"&&o>1){let u=Math.min(o,2),f=await Promise.resolve(this.provider.getChildren(e));for(;(f==null?void 0:f.length)>0;){let d=[];for(let h of f){let p=await this.getTreeItem(h);if(p.collapsibleState!=$e.None&&(p.collapsibleState=$e.Expanded,u>1)){let g=await Promise.resolve(this.provider.getChildren(h));d.push(...g)}}f=d,u=u-1}}}(!i||o)&&await this.render(),n!==!1&&this.selectItem(e),s&&this.focusItem(e)}updateHeadLines(e=!1){let{titleCount:t,messageCount:i}=this.lineState,n=e?-1:t+i,s=[],o=[];try{if(this.message&&(o.push({hlGroup:"MoreMsg",colStart:0,colEnd:re(this.message),lnum:0}),s.push(this.message),s.push("")),this.title){if(o.push({hlGroup:"CocTreeTitle",colStart:0,colEnd:re(this.title),lnum:s.length}),this.description){let a=re(this.title)+1;o.push({hlGroup:"Comment",colStart:a,colEnd:a+re(this.description),lnum:s.length})}s.push(this.title+(this.description?" "+this.description:""))}this.lineState.messageCount=this.message?2:0,this.lineState.titleCount=this.title?1:0,this.updateUI(s,o,0,n),e||this.refreshSigns()}catch(a){this.nvim.errWriteLine("[coc.nvim] Error on update head lines:"+a.message),w_.error("Error on update head lines:",a)}}refreshSigns(){let{selection:e,nvim:t,bufnr:i}=this;if(!e.length||!i||!v.env.sign)return;let n=t.createBuffer(i);t.pauseNotification(),n.unplaceSign({group:"CocTree"});for(let s of e){let o=this.getItemLnum(s);o!=null&&n.placeSign({id:S_+o,lnum:o+1,name:"CocTreeSelected",group:"CocTree"})}t.resumeNotification(!1,!0)}async render(){if(!this.bufnr)return;let e=await this.mutex.acquire();try{let t=[],i=[],{startLnum:n}=this,s=await Promise.resolve(this.provider.getChildren()),o=0,a=n,l=[];if(!(s==null?void 0:s.length))this.message="No results";else for(let u of s)a+=await this.appendTreeNode(u,o,a,l,i);t.push(...l.map(u=>u.line)),this.renderedItems=l;let c=this.startLnum-n;c&&i.forEach(u=>u.lnum=u.lnum+c),this.updateUI(t,i,this.startLnum,-1),this.retryTimers=0,e()}catch(t){this.renderedItems=[],this.nodesMap.clear(),this.lineState={titleCount:0,messageCount:1},e();let i=`${t.message}`.replace(/\r?\n/g," ");if(this.updateUI([i],[{hlGroup:"WarningMsg",colStart:0,colEnd:re(i),lnum:0}]),this.retryTimers==5)return;this.timer=setTimeout(()=>{this.retryTimers=this.retryTimers+1,this.render()},500)}}async show(e="belowright 30vs"){if(this.bufnr||this._creating)return;this._creating=!0;let{nvim:t}=this;this.originalWin=await t.call("win_getid");let i=await t.call("coc#window#find",["cocViewId",this.viewId]),n=C_;C_=C_+1,t.pauseNotification(),i!=-1?(t.call("win_gotoid",[i],!0),t.command(`silent edit +setl\\ buftype=nofile CocTree${n}`,!0)):t.command(`silent keepalt ${e} +setl\\ buftype=nofile CocTree${n}`,!0),t.command("setl bufhidden=wipe nolist nonumber norelativenumber foldcolumn=0",!0),t.command(`setl signcolumn=${this.canSelectMany?"yes":"no"}${this.winfixwidth?" winfixwidth":""}`,!0),t.command("setl nocursorline nobuflisted wrap undolevels=-1 filetype=coctree nomodifiable noswapfile",!0),t.command(`let w:cocViewId = "${this.viewId.replace(/"/g,'\\"')}"`,!0),t.call("bufnr",["%"],!0),t.call("win_getid",[],!0);let s=await t.resumeNotification();if(s[1])throw new Error("Error on buffer create:"+JSON.stringify(s[1]));this._onDidChangeVisibility.fire({visible:!0}),this.registerKeymaps();let o=s[0];this.bufnr=o[o.length-2],this.winid=o[o.length-1],this._creating=!1,this.updateHeadLines(!0),this.render()}registerKeymaps(){let{toggleSelection:e,actions:t,close:i,invoke:n,toggle:s,collapseAll:o,activeFilter:a}=this.keys,{nvim:l}=this,c=(u,f,d,h=!1)=>{this.disposables.push(v.registerLocalKeymap(u,f,async()=>{let p=await l.call("line",["."]),g=this.getElementByLnum(p-1);g&&!this.nodesMap.has(g)||await Promise.resolve(d(g))},h))};this.disposables.push(v.registerLocalKeymap("n","<C-o>",()=>{l.call("win_gotoid",[this.originalWin],!0)},!0)),c("n","<LeftRelease>",async u=>{u&&await this.onClick(u)}),this.filter&&a&&c("n",a,async()=>{this.nvim.command(`exe ${this.startLnum}`,!0),this.filter.active(),this.filterText=""},!0),e&&c("n",e,async u=>{u&&this.toggleSelection(u)}),n&&c("n",n,async u=>{u&&await this.invokeCommand(u)},!0),t&&c("n",t,async u=>{u&&await this.invokeActions(u)},!0),s&&c("n",s,async u=>{u&&await this.toggleExpand(u)},!0),o&&c("n",o,async()=>{for(let u of this.nodesMap.values()){let f=u.item;f.collapsibleState==$e.Expanded&&(f.collapsibleState=$e.Collapsed)}await this.render()}),i&&c("n",i,async()=>{this.hide()},!0)}hide(){!this.bufnr||(this.nvim.command(`bd! ${this.bufnr}`,!0),this.redraw(),this._onDidChangeVisibility.fire({visible:!1}),this.bufnr=void 0,this.winid=void 0)}redraw(){var e;(v.isVim||((e=this.filter)==null?void 0:e.activated))&&this.nvim.command("redraw",!0)}cancelResolve(){this.resolveTokenSource&&(this.resolveTokenSource.cancel(),this.resolveTokenSource=void 0)}dispose(){var e;!this.provider||(this.timer&&(clearTimeout(this.timer),this.timer=void 0),(e=this.filter)==null||e.dispose(),this._selection=[],this.hide(),this.itemsToFilter=[],this.cancelResolve(),this.tooltipFactory.dispose(),this.renderedItems=[],this.nodesMap.clear(),this.provider=void 0,G(this.disposables))}}});var __,Jj,E_,Yj,iu,Xj,D,Te=R(()=>{__=E(require("fs")),Jj=E(require("os")),E_=E(require("path")),Yj=E(H());qe();w0();_e();q$();B$();S0();W$();V$();P0();En();de();As();eg();Y();iu=U()("window"),Xj=class{constructor(){this.mutex=new hi}get nvim(){return v.nvim}dispose(){var e;(e=this.statusLine)==null||e.dispose()}showMessage(e,t="more"){if(this.mutex.busy||!this.nvim)return;let{messageLevel:i}=this,n=process.env.VIM_NODE_RPC=="1"?"callTimer":"call";global.hasOwnProperty("__TEST__")&&iu.info(e);let s="Error",o=_n.Error;switch(t){case"more":o=_n.More,s="MoreMsg";break;case"warning":o=_n.Warning,s="WarningMsg";break}o>=i&&this.nvim[n]("coc#util#echo_messages",[s,("[coc.nvim] "+e).split(`
`)],!0)}async runTerminalCommand(e,t,i=!1){return t=t||v.cwd,await this.nvim.callAsync("coc#util#run_terminal",{cmd:e,cwd:t,keepfocus:i?1:0})}async openTerminal(e,t={}){return await this.nvim.call("coc#util#open_terminal",ut({cmd:e},t))}async showQuickpick(e,t="Choose by number"){let i=await this.mutex.acquire();try{let n=t+":";e=e.map((a,l)=>`${l+1}. ${a}`);let s=await this.nvim.callAsync("coc#util#quickpick",[n,e.map(a=>a.trim())]);i();let o=parseInt(s,10);return isNaN(o)||o<=0||o>e.length?-1:o-1}catch(n){return i(),-1}}async showMenuPicker(e,t,i){if(v.env.dialog){let n=await this.mutex.acquire();if(i&&i.isCancellationRequested)return n(),-1;try{let s=new gg(this.nvim,{items:e.map(l=>l.trim()),title:t},i),o=new Promise(l=>{s.onDidClose(c=>{l(c)})});await s.show(this.dialogPreference);let a=await o;return n(),a}catch(s){iu.error("Error on showMenuPicker:",s),n()}}return await this.showQuickpick(e)}async openLocalConfig(){let{root:e}=v;if(e==Jj.default.homedir()){this.showMessage("Can't create local config in home directory","warning");return}let t=E_.default.join(e,".vim");if(!__.default.existsSync(t)){if(!await this.showPrompt(`Would you like to create folder'${e}/.vim'?`))return;__.default.mkdirSync(t)}await v.jumpTo(B.file(E_.default.join(t,Is)).toString())}async showPrompt(e){let t=await this.mutex.acquire();try{let i=await this.nvim.callAsync("coc#float#prompt_confirm",[e]);return t(),i==1}catch(i){return t(),!1}}async showDialog(e){if(!this.checkDialog())return null;let t=new pg(this.nvim,e);return await t.show(this.dialogPreference),t}async requestInput(e,t){let{nvim:i}=this,n=v.getConfiguration("coc.preferences");if(v.env.dialog&&n.get("promptInput",!0)&&!Ba){let s=await this.mutex.acquire(),o=this.dialogPreference;try{let a={};o.floatHighlight&&(a.highlight=o.floatHighlight),o.floatBorderHighlight&&(a.borderhighlight=o.floatBorderHighlight);let l=await i.call("coc#float#create_prompt_win",[e,t||"",a]),[c,u]=l,f=await new Promise(d=>{let h=[];O.on("BufWinLeave",p=>{p==c&&(G(h),d(null))},null,h),O.on("PromptInsert",async p=>{G(h),await i.call("coc#float#close",[u]),p?d(p):(this.showMessage("Empty word, canceled","warning"),d(null))},null,h)});return s(),f}catch(a){iu.error("Error on requestInput:",a),s()}}else{let s=await v.callAsync("input",[e+": ",t||""]);return i.command("normal! :<C-u>",!0),s||(this.showMessage("Empty word, canceled","warning"),null)}}createStatusBarItem(e=0,t={}){if(!v.env){let i=()=>{};return{text:"",show:i,dispose:i,hide:i,priority:0,isProgress:!1}}return this.statusLine||(this.statusLine=new xg(this.nvim)),this.statusLine.createStatusBarItem(e,t.progress||!1)}createOutputChannel(e){return Ga.create(e,this.nvim)}showOutputChannel(e,t){Ga.show(e,t)}async echoLines(e,t=!1){let{nvim:i}=this,n=v.env.cmdheight;e.length>n&&t&&(e=e.slice(0,n));let s=v.env.columns-12;if(e=e.map(o=>(o=o.replace(/\n/g," "),t&&(o=o.slice(0,s)),o)),t&&e.length==n){let o=e[e.length-1];e[n-1]=`${o.length==s?o.slice(0,-4):o} ...`}await i.call("coc#util#echo_lines",[e])}async getCursorPosition(){let[e,t]=await this.nvim.eval("[line('.')-1, strpart(getline('.'), 0, col('.') - 1)]");return Yj.Position.create(e,t.length)}async moveTo(e){await this.nvim.call("coc#cursor#move_to",[e.line,e.character]),v.env.isVim&&this.nvim.command("redraw",!0)}async getOffset(){return await this.nvim.call("coc#cursor#char_offset")}async getCursorScreenPosition(){let[e,t]=await this.nvim.call("coc#cursor#screen_pos");return{row:e,col:t}}async showPickerDialog(e,t,i){if(!this.checkDialog())return;let n=await this.mutex.acquire();if(i&&i.isCancellationRequested){n();return}try{let s=typeof e[0]=="string",o=new vg(this.nvim,{title:t,items:s?e.map(u=>({label:u})):e},i),a=new Promise(u=>{o.onDidClose(f=>{u(f)})});await o.show(this.dialogPreference);let l=await a,c=l==null?void 0:e.filter((u,f)=>l.includes(f));return n(),c}catch(s){iu.error("Error on showPickerDialog:",s),n()}}async showInformationMessage(e,...t){if(!this.enableMessageDialog)return await this.showConfirm(e,t,"Info");let i=typeof t[0]=="string"?t:t.map(s=>s.title),n=await this.createNotification("CocInfoFloat",e,i);return n==-1?void 0:t[n]}async showWarningMessage(e,...t){if(!this.enableMessageDialog)return await this.showConfirm(e,t,"Warning");let i=typeof t[0]=="string"?t:t.map(s=>s.title),n=await this.createNotification("CocWarningFloat",e,i);return n==-1?void 0:t[n]}async showErrorMessage(e,...t){if(!this.enableMessageDialog)return await this.showConfirm(e,t,"Error");let i=typeof t[0]=="string"?t:t.map(s=>s.title),n=await this.createNotification("CocErrorFloat",e,i);return n==-1?void 0:t[n]}async showNotification(e){return this.checkDialog()?await new Ka(this.nvim,e).show(this.notificationPreference):!1}async showConfirm(e,t,i){if(!t||t.length==0){let a=i=="Info"?"more":i=="Error"?"error":"warning";this.showMessage(e,a);return}let s=(typeof t[0]=="string"?t.slice():t.map(a=>a.title)).map((a,l)=>`${l+1}${a}`),o=await this.nvim.callAsync("coc#util#with_callback",["confirm",[e,s.join(`
`),0,i]]);return t[o-1]}async withProgress(e,t){return this.checkDialog()?await new bg(this.nvim,{task:t,title:e.title,cancellable:e.cancellable}).show(this.notificationPreference):void 0}createTreeView(e,t){let i=(sv(),Kj).default;return new i(e,t)}createNotification(e,t,i){return new Promise(n=>{let s={content:t,borderhighlight:e,close:!0,buttons:i.map((a,l)=>({text:a,index:l})),callback:a=>{n(a)}};new Ka(this.nvim,s).show(this.notificationPreference).then(a=>{a||(iu.error("Unable to open notification window"),n(-1)),i.length||n(-1)},a=>{iu.error("Unable to open notification window",a),n(-1)})})}get dialogPreference(){let e=v.getConfiguration("dialog");return{maxWidth:e.get("maxWidth"),maxHeight:e.get("maxHeight"),floatHighlight:e.get("floatHighlight"),floatBorderHighlight:e.get("floatBorderHighlight"),pickerButtons:e.get("pickerButtons"),pickerButtonShortcut:e.get("pickerButtonShortcut"),confirmKey:e.get("confirmKey")}}get notificationPreference(){let e=v.getConfiguration("notification");return{top:e.get("marginTop"),right:e.get("marginRight"),maxWidth:e.get("maxWidth"),maxHeight:e.get("maxHeight"),highlight:e.get("highlightGroup"),minProgressWidth:e.get("minProgressWidth")}}checkDialog(){return v.env.dialog?!0:(this.showMessage("Dialog requires vim >= 8.2.0750 or neovim >= 0.4.0, please upgrade your vim","warning"),!1)}get enableMessageDialog(){return v.env.dialog?v.getConfiguration("coc.preferences").get("enableMessageDialog",!1):!1}get messageLevel(){switch(v.getConfiguration("coc.preferences").get("messageLevel","more")){case"error":return _n.Error;case"warning":return _n.Warning;default:return _n.More}}},D=new Xj});function sh(r){switch(r){case Ti.DiagnosticSeverity.Warning:return"Warning";case Ti.DiagnosticSeverity.Information:return"Information";case Ti.DiagnosticSeverity.Hint:return"Hint";default:return"Error"}}function Zj(r){switch(r){case Ti.DiagnosticSeverity.Warning:return"W";case Ti.DiagnosticSeverity.Information:return"I";case Ti.DiagnosticSeverity.Hint:return"I";default:return"E"}}function T_(r){switch(r){case"hint":return Ti.DiagnosticSeverity.Hint;case"information":return Ti.DiagnosticSeverity.Information;case"warning":return Ti.DiagnosticSeverity.Warning;case"error":return Ti.DiagnosticSeverity.Error;default:return Ti.DiagnosticSeverity.Hint}}function D_(r){switch(r){case Ti.DiagnosticSeverity.Error:return"CocError";case Ti.DiagnosticSeverity.Warning:return"CocWarning";case Ti.DiagnosticSeverity.Information:return"CocInfo";case Ti.DiagnosticSeverity.Hint:return"CocHint";default:return"CocError"}}function ov(r,e){let{start:t}=e.range,i=e.source||"coc.nvim",n=e.message.split(`
`)[0],s=sh(e.severity).slice(0,1).toUpperCase();return{bufnr:r,lnum:t.line+1,col:t.character+1,text:`[${i}${e.code?" "+e.code:""}] ${n} [${s}]`,type:s}}var Ti,R_=R(()=>{Ti=E(H())});function k_(r,e){if((r.severity||1)!=(e.severity||1))return(r.severity||1)-(e.severity||1);let t=De(r.range.start,e.range.start);return t!=0?t:r.source>e.source?1:-1}function Ale(r){let e=r.tags||[];if(e.includes(Jn.DiagnosticTag.Deprecated))return Ao.Deprecated;if(e.includes(Jn.DiagnosticTag.Unnecessary))return Ao.Unused;switch(r.severity){case Jn.DiagnosticSeverity.Warning:return Ao.Warning;case Jn.DiagnosticSeverity.Information:return Ao.Information;case Jn.DiagnosticSeverity.Hint:return Ao.Hint;default:return Ao.Error}}var Jn,Lle,$Ee,Qj,eU,tU,Ao,P_,iU=R(()=>{As();Jn=E(H());ri();Vt();Y();_e();R_();Lle=process.env.VIM_NODE_RPC=="1",$Ee=U()("diagnostic-buffer"),Qj="CocDiagnostic",eU="diagnostic",tU=["CocErrorHighlight","CocWarningHighlight","CocInfoHighlight","CocHintHighlight","CocDeprecatedHighlight","CocUnusedHighlight"];(function(o){o.Error="CocErrorHighlight",o.Warning="CocWarningHighlight",o.Information="CocInfoHighlight",o.Hint="CocHintHighlight",o.Deprecated="CocDeprecatedHighlight",o.Unused="CocUnusedHighlight"})(Ao||(Ao={}));P_=class{constructor(e,t,i,n,s){this.nvim=e;this.bufnr=t;this.uri=i;this.config=n;this.onRefresh=s;this.diagnosticsMap=new Map;this.mutex=new hi;this._disposed=!1}get displayByAle(){return this.config.displayByAle}clearHighlight(e){this.buffer.clearNamespace(eU+e)}clearSigns(e){this.buffer.unplaceSign({group:Qj+e})}get diagnostics(){let e=[];for(let t of this.diagnosticsMap.values())e.push(...t);return e}get buffer(){return this.nvim.createBuffer(this.bufnr)}refreshAle(e,t){let i=t.map(s=>{let o=s.range;return{text:s.message,code:s.code,lnum:o.start.line+1,col:o.start.character+1,end_lnum:o.end.line+1,end_col:o.end.character,type:Zj(s.severity)}}),n=global.hasOwnProperty("__TEST__")?"MockAleResults":"ale#other_source#ShowResults";this.nvim.call(n,[this.bufnr,"coc"+e,i],!0)}async refresh(e,t){let i=await this.mutex.acquire();try{await this._refresh(e,t===!0),i()}catch(n){i(),this.nvim.echoError(n)}}async _refresh(e,t){let{refreshOnInsertMode:i}=this.config,{nvim:n}=this,s=!this.displayByAle&&!i;if(O.insertMode&&s)return;let o=await n.call("coc#util#diagnostic_info",[this.bufnr,s]);if(!(!o||this._disposed)){if(this.displayByAle){n.pauseNotification();for(let[a,l]of Object.entries(e))this.diagnosticsMap.set(a,[]),this.refreshAle(a,l);await n.resumeNotification()}else{let a=!1,l=!1;n.pauseNotification();for(let[c,u]of Object.entries(e)){let f=this.diagnosticsMap.get(c)||[];this.diagnosticsMap.set(c,u),je(f,u)?f.length&&t&&(l=!0,this.updateHighlights(c,u)):(a=!0,l=!0,this.addSigns(c,u),this.updateHighlights(c,u))}a&&(this.showVirtualText(o.lnum,o.bufnr),this.updateLocationList(o.winid,o.locationlist),this.setDiagnosticInfo()),Lle&&l&&this.nvim.command("redraw",!0),await this.nvim.resumeNotification()}this.onRefresh(this.diagnostics)}}updateLocationList(e,t){if(!this.config.locationlistUpdate||e==-1||t!=="Diagnostics of coc")return;let i=[],{diagnostics:n}=this;n.sort(k_);for(let s of n){let o=ov(this.bufnr,s);i.push(o)}this.nvim.call("setloclist",[e,[],"r",{title:"Diagnostics of coc",items:i}],!0)}addSigns(e,t){if(!this.config.enableSign)return;let i=Qj+e;this.buffer.unplaceSign({group:i});let n=new Map;for(let s of t){let{range:o,severity:a}=s,l=o.start.line,c=n.get(l)||[];if(c.includes(a))continue;c.push(a),n.set(l,c);let u=this.config.signPriority+4-a,f=D_(a);this.buffer.placeSign({name:f,lnum:l+1,group:i,priority:u})}}setDiagnosticInfo(){let e=[0,0,0,0],t={error:0,warning:0,information:0,hint:0,lnums:e};for(let n of this.diagnosticsMap.values())for(let s of n){let o=s.range.start.line+1;switch(s.severity){case Jn.DiagnosticSeverity.Warning:t.warning=t.warning+1,e[1]=e[1]?Math.min(e[1],o):o;break;case Jn.DiagnosticSeverity.Information:t.information=t.information+1,e[2]=e[2]?Math.min(e[2],o):o;break;case Jn.DiagnosticSeverity.Hint:t.hint=t.hint+1,e[3]=e[3]?Math.min(e[3],o):o;break;default:e[0]=e[0]?Math.min(e[0],o):o,t.error=t.error+1}}this.nvim.createBuffer(this.bufnr).setVar("coc_diagnostic_info",t,!0),this.nvim.call("coc#util#do_autocmd",["CocDiagnosticChange"],!0)}showVirtualText(e,t){if(!this.config.virtualText)return;let{virtualTextSrcId:i,virtualTextPrefix:n,virtualTextCurrentLineOnly:s}=this.config,{diagnostics:o,buffer:a}=this;if(s){if(t&&this.bufnr!=t)return;o=o.filter(l=>{let{start:c,end:u}=l.range;return c.line<=e-1&&u.line>=e-1})}o.sort(k_),a.clearNamespace(i);for(let l=o.length-1;l>=0;l--){let c=o[l],{line:u}=c.range.start,f=D_(c.severity)+"VirtualText",d=c.message.split(/\n/).map(h=>h.trim()).filter(h=>h.length>0).slice(0,this.config.virtualTextLines).join(this.config.virtualTextLineSeparator);a.setVirtualText(i,u,[[n+d,f]],{})}}updateHighlights(e,t){if(!t.length)this.clearHighlight(e);else{let i=this.getHighlightItems(t);this.buffer.updateHighlights(eU+e,i)}}getHighlightItems(e){let t=v.getDocument(this.bufnr);if(!t)return[];let i=[];for(let n of e.slice(0,this.config.highlighLimit)){let s=Ale(n);t.addHighlights(i,s,n.range)}return i.sort((n,s)=>n.lnum!=s.lnum?n.lnum-s.lnum:n.colStart!=s.colStart?n.colStart-s.colStart:tU.indexOf(s.hlGroup)-tU.indexOf(n.hlGroup)),i}clear(){let{nvim:e}=this,t=Array.from(this.diagnosticsMap.keys());if(this.diagnosticsMap.clear(),this.displayByAle)for(let i of t){let n=global.hasOwnProperty("__TEST__")?"MockAleResults":"ale#other_source#ShowResults";this.nvim.call(n,[this.bufnr,i,[]],!0)}else{e.pauseNotification();for(let i of t)this.clearHighlight(i),this.clearSigns(i);this.config.virtualText&&this.buffer.clearNamespace(this.config.virtualTextSrcId),this.buffer.deleteVar("coc_diagnostic_info"),e.resumeNotification(!1,!0)}}getDiagnosticsAt(e,t){let i=[];for(let n of this.diagnosticsMap.values())t?i.push(...n.filter(s=>O$(e.line,s.range))):i.push(...n.filter(s=>Ft(e,s.range)==0));return i.sort(k_),i}async isEnabled(){return this._disposed?!1:await this.nvim.createBuffer(this.bufnr).getVar("coc_diagnostic_disable")!=1}dispose(){this._disposed=!0,this.clear()}}});var av,zEe,lv,rU=R(()=>{av=E(H());qe();Y();zEe=U()("diagnostic-collection"),lv=class{constructor(e,t){this.name=e;this.onDispose=t;this.diagnosticsMap=new Map;this._onDidDiagnosticsChange=new av.Emitter;this.onDidDiagnosticsChange=this._onDidDiagnosticsChange.event}set(e,t){let i=new Map;if(Array.isArray(e))for(let n of e){let[s,o]=n,a=v.getDocument(s);s=a?a.uri:s,o==null?o=[]:o=(i.get(s)||[]).concat(o),i.set(s,o)}else{let n=v.getDocument(e),s=n?n.uri:e;i.set(s,t||[])}for(let n of i){let[s,o]=n;s=B.parse(s).toString(),o.forEach(a=>{a.range=a.range||av.Range.create(0,0,0,0),a.message=a.message||"",a.source=a.source||this.name}),this.diagnosticsMap.set(s,o),this._onDidDiagnosticsChange.fire(s)}}delete(e){this.diagnosticsMap.delete(e),this._onDidDiagnosticsChange.fire(e)}clear(){let e=this.diagnosticsMap.keys();this.diagnosticsMap.clear();for(let t of e)this._onDidDiagnosticsChange.fire(t)}forEach(e,t){for(let i of this.diagnosticsMap.keys()){let n=this.diagnosticsMap.get(i);e.call(t,i,n,this)}}get(e){let t=this.diagnosticsMap.get(e);return t==null?[]:t}has(e){return this.diagnosticsMap.has(e)}dispose(){this.clear(),this.onDispose&&this.onDispose(),this._onDidDiagnosticsChange.dispose()}}});var nU,_t,oTe,sU,Lt,Xa=R(()=>{nU=E(Ui()),_t=E(H());qe();_e();Va();de();Vt();Te();Y();iU();rU();R_();oTe=U()("diagnostic-manager"),sU=class{constructor(){this.enabled=!0;this._onDidRefresh=new _t.Emitter;this.onDidRefresh=this._onDidRefresh.event;this.collections=[];this.disposables=[]}init(){this.setConfiguration(),v.onDidChangeConfiguration(s=>{this.setConfiguration(s)},null,this.disposables),this.floatFactory=new tr(this.nvim),this.buffers=v.registerBufferSync(s=>{if(s.buftype!=="")return;let o=new P_(this.nvim,s.bufnr,s.uri,this.config,l=>{this._onDidRefresh.fire({diagnostics:l,uri:o.uri,bufnr:o.bufnr}),!["never","jump"].includes(this.config.enableMessage)&&(O.insertMode||this.echoMessage(!0).logError())}),a=this.getCollections(s.uri);if(this.enabled&&a.length){let l=this.getDiagnostics(s.uri);o.refresh(l)}return o}),v.onDidCloseTextDocument(s=>{for(let o of this.collections)o.delete(s.uri)},null,this.disposables),O.on("CursorMoved",s=>{this.config.enableMessage=="always"&&(!this.buffers.getItem(s)||(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(async()=>{await this.echoMessage(!0)},this.config.messageDelay)))},null,this.disposables);let e=(0,nU.default)((s,o)=>{if(!this.config.virtualTextCurrentLineOnly)return;let a=this.buffers.getItem(s);a&&a.showVirtualText(o[0])},100);O.on("CursorMoved",e,null,this.disposables),this.disposables.push(_t.Disposable.create(()=>{e.clear()}));let t;O.on("InsertLeave",async s=>{if(this.config.refreshOnInsertMode||!this.autoRefresh)return;let o=v.getDocument(s);!(o==null?void 0:o.attached)||(o._forceSync(),t=setTimeout(()=>{if(!O.insertMode)for(let a of this.buffers.items)a.refresh(this.getDiagnostics(a.uri),!1)},Math.max(0,500-Date.now()+O.lastChangeTs)))},null,this.disposables);let i=()=>{t&&clearTimeout(t)};this.disposables.push({dispose:i}),O.on("InsertEnter",i,null,this.disposables),O.on("BufEnter",async()=>{this.timer&&clearTimeout(this.timer)},null,this.disposables);let n=v.configurations.errorItems;this.setConfigurationErrors(n),v.configurations.onError(s=>{this.setConfigurationErrors(s)},null,this.disposables)}defineSigns(){let{nvim:e}=this,{enableHighlightLineNumber:t,enableSign:i}=this.config;if(!!i){e.pauseNotification();for(let n of["Error","Warning","Info","Hint"]){let s=this.config[n.toLowerCase()+"Sign"],o=`sign define Coc${n} linehl=Coc${n}Line`;s&&(o+=` texthl=Coc${n}Sign text=${s}`),t&&(o+=` numhl=Coc${n}Sign`),e.command(o,!0)}e.resumeNotification(!1,!0)}}async setLocationlist(e){let t=this.buffers.getItem(e),i=t?this.getDiagnostics(t.uri):{},n=[];for(let a of Object.values(i))for(let l of a){let c=ov(e,l);n.push(c)}let s=await this.nvim.call("getloclist",[0,{title:1}]),o=s.title&&s.title.indexOf("Diagnostics of coc")!=-1?"r":" ";await this.nvim.call("setloclist",[0,[],o,{title:"Diagnostics of coc",items:n}])}setConfigurationErrors(e){let t=this.create("config");if(e==null?void 0:e.length){let i=new Map;for(let n of e){let{uri:s}=n.location,o=i.get(s)||[];o.push(_t.Diagnostic.create(n.location.range,n.message,_t.DiagnosticSeverity.Error)),i.set(s,o)}t.set(Array.from(i))}else t.clear()}create(e){let t=this.getCollectionByName(e);return t||(t=new lv(e,()=>{let i=this.collections.findIndex(n=>n==t);i!==-1&&this.collections.splice(i,1)}),this.collections.push(t),t.onDidDiagnosticsChange(i=>{let n=this.buffers.getItem(i);!this.autoRefresh||!n||O.insertMode&&!this.config.refreshOnInsertMode||n.refresh(this.getDiagnostics(i,e),!0)}),t)}getSortedRanges(e,t){let i=this.getCollections(e),n=[],s=t?T_(t):0;for(let o of i){let a=o.get(e);if(s)a=a.filter(c=>c.severity==s);else{let c=this.config.level;c&&c<_t.DiagnosticSeverity.Hint&&(a=a.filter(u=>!(u.severity&&u.severity>c)))}let l=a.map(c=>c.range);n.push(...l)}return n.sort((o,a)=>o.start.line!=a.start.line?o.start.line-a.start.line:o.start.character-a.start.character),n}getDiagnostics(e,t){let i={},n=t?[this.getCollectionByName(t)]:this.getCollections(e),{level:s,showUnused:o,showDeprecated:a}=this.config;for(let l of n){if(!l)continue;let c=l.get(e)||[];c.length&&(c=c.filter(u=>{var f,d;return!(s&&u.severity&&u.severity>s||!o&&((f=u.tags)==null?void 0:f.includes(_t.DiagnosticTag.Unnecessary))||!a&&((d=u.tags)==null?void 0:d.includes(_t.DiagnosticTag.Deprecated)))}),c.sort((u,f)=>De(u.range.start,f.range.start))),i[l.name]=c}return i}getDiagnosticsInRange(e,t){let i=this.getCollections(e.uri),n=[];for(let s of i){let o=s.get(e.uri);if(!!o)for(let a of o)qc(a.range,t)&&n.push(a)}return n}async preview(){let e=await this.getCurrentDiagnostics();if(e.length==0){this.nvim.command("pclose",!0);return}let t=[];for(let i of e){let{source:n,code:s,severity:o,message:a}=i,l=sh(o)[0];t.push(`[${n}${s?" "+s:""}] [${l}]`),t.push(...a.split(/\r?\n/)),t.push("")}this.nvim.call("coc#util#preview_info",[t,"txt"],!0)}async jumpPrevious(e){let t=await this.nvim.buffer,i=v.getDocument(t.id);if(!i)return;let n=await D.getCursorPosition(),s=this.getSortedRanges(i.uri,e),o;for(let a=s.length-1;a>=0;a--){let l=s[a].end;if(De(l,n)<0){o=s[a].start;break}else a==0&&await this.nvim.getOption("wrapscan")&&(o=s[s.length-1].start)}if(o){if(await D.moveTo(o),this.config.enableMessage=="never")return;await this.echoMessage(!1)}}async jumpNext(e){let t=await this.nvim.buffer,i=v.getDocument(t.id),n=await D.getCursorPosition(),s=this.getSortedRanges(i.uri,e),o;for(let a=0;a<=s.length-1;a++){let l=s[a].start;if(De(l,n)>0){o=s[a].start;break}else a==s.length-1&&await this.nvim.getOption("wrapscan")&&(o=s[0].start)}if(o){if(await D.moveTo(o),this.config.enableMessage=="never")return;await this.echoMessage(!1)}}getDiagnosticList(){let e=[],{level:t,showUnused:i,showDeprecated:n}=this.config;for(let s of this.collections)s.forEach((o,a)=>{var c,u;let l=B.parse(o).fsPath;for(let f of a){if(f.severity&&f.severity>t||!i&&((c=f.tags)==null?void 0:c.includes(_t.DiagnosticTag.Unnecessary))||!n&&((u=f.tags)==null?void 0:u.includes(_t.DiagnosticTag.Deprecated)))continue;let{start:d}=f.range,h={file:l,lnum:d.line+1,col:d.character+1,code:f.code,source:f.source||s.name,message:f.message,severity:sh(f.severity),level:f.severity||0,location:_t.Location.create(o,f.range)};e.push(h)}});return e.sort((s,o)=>s.level!==o.level?s.level-o.level:s.file!==o.file?s.file>o.file?1:-1:s.lnum!=o.lnum?s.lnum-o.lnum:s.col-o.col),e}getDiagnosticsAt(e,t,i=!1,n=!1){let s=this.buffers.getItem(e);if(!s)return[];let o=_t.Position.create(t[0],t[1]),a=s.getDiagnosticsAt(o,this.config.checkCurrentLine);return this.config.checkCurrentLine||a.length||i&&(o=_t.Position.create(t[0],t[1]+1),a=s.getDiagnosticsAt(o,!1),a.length)||n&&t[1]==0&&(o=_t.Position.create(t[0]+1,0),a=s.getDiagnosticsAt(o,!1)),a}async getCurrentDiagnostics(){let[e,t,i,n]=await this.nvim.eval(`[bufnr("%"),coc#cursor#position(),col('.')==col('$')-1,line('.')==line('$')]`);return this.getDiagnosticsAt(e,t,i==1,n==1)}async echoMessage(e=!1){let t=this.config;if(!this.enabled||t.displayByAle)return;this.timer&&clearTimeout(this.timer);let i=t.messageTarget=="float",[n,s]=await this.nvim.eval("[&filetype,mode()]");if(s!="n")return;let o=await this.getCurrentDiagnostics();if(o.length==0){i&&this.floatFactory.close();return}if(e&&v.insertMode)return;let a=[],l="";if(Object.keys(t.filetypeMap).length>0){let c=t.filetypeMap.default||"";l=t.filetypeMap[n]||(c=="bufferType"?n:c)}if(o.forEach(c=>{let{source:u,code:f,severity:d,message:h}=c,p=sh(d)[0],g=f?" "+f:"",b=t.format.replace("%source",u).replace("%code",g).replace("%severity",p).replace("%message",h),y="Error";if(l==="")switch(d){case _t.DiagnosticSeverity.Hint:y="Hint";break;case _t.DiagnosticSeverity.Warning:y="Warning";break;case _t.DiagnosticSeverity.Information:y="Info";break}else y=l;a.push({filetype:y,content:b})}),i){let c=this.floatFactory.applyFloatConfig({modes:["n"],maxWidth:80},this.config.floatConfig);await this.floatFactory.show(a,c)}else{let c=a.map(u=>u.content).join(`
`).split(/\r?\n/);c.length&&(await this.nvim.command('echo ""'),await D.echoLines(c,e))}}async jumpRelated(){let e=await this.getCurrentDiagnostics();if(!e)return;let t=e.find(n=>n.relatedInformation!=null);if(!t)return;let i=t.relatedInformation.map(n=>n.location);i.length==1?await v.jumpTo(i[0].uri,i[0].range.start):i.length>1&&await v.showLocations(i)}reset(){this.timer&&clearTimeout(this.timer),this.buffers.reset();for(let e of this.collections)e.dispose();this.collections=[]}dispose(){var e;this.buffers.dispose(),this.timer&&clearTimeout(this.timer);for(let t of this.collections)t.dispose();(e=this.floatFactory)==null||e.close(),this.collections=[],G(this.disposables)}get nvim(){return v.nvim}setConfiguration(e){if(e&&!e.affectsConfiguration("diagnostic"))return;let t=v.getConfiguration("diagnostic"),i=t.get("messageTarget","float");i=="float"&&!v.env.floating&&!v.env.textprop&&(i="echo");let n=t.get("enableHighlightLineNumber",!0);v.isNvim||(n=!1),this.config={floatConfig:t.get("floatConfig",{}),messageTarget:i,enableHighlightLineNumber:n,highlighLimit:t.get("highlighLimit",1e3),autoRefresh:t.get("autoRefresh",!0),virtualTextSrcId:v.createNameSpace("diagnostic-virtualText"),checkCurrentLine:t.get("checkCurrentLine",!1),enableSign:v.env.sign&&t.get("enableSign",!0),locationlistUpdate:t.get("locationlistUpdate",!0),enableMessage:t.get("enableMessage","always"),messageDelay:t.get("messageDelay",200),virtualText:t.get("virtualText",!1)&&this.nvim.hasFunction("nvim_buf_set_virtual_text"),virtualTextCurrentLineOnly:t.get("virtualTextCurrentLineOnly",!0),virtualTextPrefix:t.get("virtualTextPrefix"," "),virtualTextLineSeparator:t.get("virtualTextLineSeparator"," \\ "),virtualTextLines:t.get("virtualTextLines",3),displayByAle:t.get("displayByAle",!1),level:T_(t.get("level","hint")),signPriority:t.get("signPriority",10),errorSign:t.get("errorSign",">>"),warningSign:t.get("warningSign",">>"),infoSign:t.get("infoSign",">>"),hintSign:t.get("hintSign",">>"),refreshOnInsertMode:t.get("refreshOnInsertMode",!1),filetypeMap:t.get("filetypeMap",{}),showUnused:t.get("showUnused",!0),showDeprecated:t.get("showDeprecated",!0),format:t.get("format","[%source%code] [%severity] %message")},this.enabled=t.get("enable",!0),this.defineSigns()}getCollectionByName(e){return this.collections.find(t=>t.name==e)}getCollections(e){return this.collections.filter(t=>t.has(e))}toggleDiagnostic(){let{enabled:e}=this;this.enabled=!e;for(let t of this.buffers.items)this.enabled?this.refreshBuffer(t.uri,!0):t.clear()}async toggleDiagnosticBuffer(e){if(!this.enabled)return;let t=this.buffers.getItem(e);if(t){let i=await t.isEnabled();await this.nvim.call("setbufvar",[e,"coc_diagnostic_disable",i?1:0]),i?t.clear():this.refreshBuffer(e,!0)}}get autoRefresh(){return this.enabled&&this.config.autoRefresh}async refreshBuffer(e,t=!1){let i=this.buffers.getItem(e);return i?(await i.refresh(this.getDiagnostics(i.uri),t),!0):!1}refresh(e){if(e){let t=this.buffers.getItem(e);t&&this.refreshBuffer(t.uri,!0)}else for(let t of this.buffers.items)this.refreshBuffer(t.uri,!0)}},Lt=new sU});var qt,oU=R(()=>{(function(m){m[m.Null=0]="Null",m[m.Backspace=8]="Backspace",m[m.Tab=9]="Tab",m[m.LineFeed=10]="LineFeed",m[m.CarriageReturn=13]="CarriageReturn",m[m.Space=32]="Space",m[m.ExclamationMark=33]="ExclamationMark",m[m.DoubleQuote=34]="DoubleQuote",m[m.Hash=35]="Hash",m[m.DollarSign=36]="DollarSign",m[m.PercentSign=37]="PercentSign",m[m.Ampersand=38]="Ampersand",m[m.SingleQuote=39]="SingleQuote",m[m.OpenParen=40]="OpenParen",m[m.CloseParen=41]="CloseParen",m[m.Asterisk=42]="Asterisk",m[m.Plus=43]="Plus",m[m.Comma=44]="Comma",m[m.Dash=45]="Dash",m[m.Period=46]="Period",m[m.Slash=47]="Slash",m[m.Digit0=48]="Digit0",m[m.Digit1=49]="Digit1",m[m.Digit2=50]="Digit2",m[m.Digit3=51]="Digit3",m[m.Digit4=52]="Digit4",m[m.Digit5=53]="Digit5",m[m.Digit6=54]="Digit6",m[m.Digit7=55]="Digit7",m[m.Digit8=56]="Digit8",m[m.Digit9=57]="Digit9",m[m.Colon=58]="Colon",m[m.Semicolon=59]="Semicolon",m[m.LessThan=60]="LessThan",m[m.Equals=61]="Equals",m[m.GreaterThan=62]="GreaterThan",m[m.QuestionMark=63]="QuestionMark",m[m.AtSign=64]="AtSign",m[m.A=65]="A",m[m.B=66]="B",m[m.C=67]="C",m[m.D=68]="D",m[m.E=69]="E",m[m.F=70]="F",m[m.G=71]="G",m[m.H=72]="H",m[m.I=73]="I",m[m.J=74]="J",m[m.K=75]="K",m[m.L=76]="L",m[m.M=77]="M",m[m.N=78]="N",m[m.O=79]="O",m[m.P=80]="P",m[m.Q=81]="Q",m[m.R=82]="R",m[m.S=83]="S",m[m.T=84]="T",m[m.U=85]="U",m[m.V=86]="V",m[m.W=87]="W",m[m.X=88]="X",m[m.Y=89]="Y",m[m.Z=90]="Z",m[m.OpenSquareBracket=91]="OpenSquareBracket",m[m.Backslash=92]="Backslash",m[m.CloseSquareBracket=93]="CloseSquareBracket",m[m.Caret=94]="Caret",m[m.Underline=95]="Underline",m[m.BackTick=96]="BackTick",m[m.a=97]="a",m[m.b=98]="b",m[m.c=99]="c",m[m.d=100]="d",m[m.e=101]="e",m[m.f=102]="f",m[m.g=103]="g",m[m.h=104]="h",m[m.i=105]="i",m[m.j=106]="j",m[m.k=107]="k",m[m.l=108]="l",m[m.m=109]="m",m[m.n=110]="n",m[m.o=111]="o",m[m.p=112]="p",m[m.q=113]="q",m[m.r=114]="r",m[m.s=115]="s",m[m.t=116]="t",m[m.u=117]="u",m[m.v=118]="v",m[m.w=119]="w",m[m.x=120]="x",m[m.y=121]="y",m[m.z=122]="z",m[m.OpenCurlyBrace=123]="OpenCurlyBrace",m[m.Pipe=124]="Pipe",m[m.CloseCurlyBrace=125]="CloseCurlyBrace",m[m.Tilde=126]="Tilde",m[m.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",m[m.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",m[m.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",m[m.U_Combining_Tilde=771]="U_Combining_Tilde",m[m.U_Combining_Macron=772]="U_Combining_Macron",m[m.U_Combining_Overline=773]="U_Combining_Overline",m[m.U_Combining_Breve=774]="U_Combining_Breve",m[m.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",m[m.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",m[m.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",m[m.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",m[m.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",m[m.U_Combining_Caron=780]="U_Combining_Caron",m[m.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",m[m.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",m[m.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",m[m.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",m[m.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",m[m.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",m[m.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",m[m.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",m[m.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",m[m.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",m[m.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",m[m.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",m[m.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",m[m.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",m[m.U_Combining_Horn=795]="U_Combining_Horn",m[m.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",m[m.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",m[m.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",m[m.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",m[m.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",m[m.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",m[m.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",m[m.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",m[m.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",m[m.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",m[m.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",m[m.U_Combining_Cedilla=807]="U_Combining_Cedilla",m[m.U_Combining_Ogonek=808]="U_Combining_Ogonek",m[m.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",m[m.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",m[m.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",m[m.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",m[m.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",m[m.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",m[m.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",m[m.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",m[m.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",m[m.U_Combining_Low_Line=818]="U_Combining_Low_Line",m[m.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",m[m.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",m[m.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",m[m.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",m[m.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",m[m.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",m[m.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",m[m.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",m[m.U_Combining_Square_Below=827]="U_Combining_Square_Below",m[m.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",m[m.U_Combining_X_Above=829]="U_Combining_X_Above",m[m.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",m[m.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",m[m.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",m[m.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",m[m.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",m[m.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",m[m.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",m[m.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",m[m.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",m[m.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",m[m.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",m[m.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",m[m.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",m[m.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",m[m.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",m[m.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",m[m.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",m[m.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",m[m.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",m[m.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",m[m.U_Combining_Fermata=850]="U_Combining_Fermata",m[m.U_Combining_X_Below=851]="U_Combining_X_Below",m[m.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",m[m.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",m[m.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",m[m.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",m[m.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",m[m.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",m[m.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",m[m.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",m[m.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",m[m.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",m[m.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",m[m.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",m[m.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",m[m.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",m[m.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",m[m.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",m[m.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",m[m.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",m[m.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",m[m.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",m[m.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",m[m.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",m[m.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",m[m.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",m[m.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",m[m.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",m[m.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",m[m.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",m[m.LINE_SEPARATOR_2028=8232]="LINE_SEPARATOR_2028",m[m.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",m[m.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",m[m.U_DIAERESIS=168]="U_DIAERESIS",m[m.U_MACRON=175]="U_MACRON",m[m.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",m[m.U_CEDILLA=184]="U_CEDILLA",m[m.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",m[m.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",m[m.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",m[m.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",m[m.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",m[m.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",m[m.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",m[m.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",m[m.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",m[m.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",m[m.U_BREVE=728]="U_BREVE",m[m.U_DOT_ABOVE=729]="U_DOT_ABOVE",m[m.U_RING_ABOVE=730]="U_RING_ABOVE",m[m.U_OGONEK=731]="U_OGONEK",m[m.U_SMALL_TILDE=732]="U_SMALL_TILDE",m[m.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",m[m.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",m[m.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",m[m.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",m[m.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",m[m.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",m[m.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",m[m.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",m[m.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",m[m.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",m[m.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",m[m.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",m[m.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",m[m.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",m[m.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",m[m.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",m[m.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",m[m.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",m[m.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",m[m.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",m[m.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",m[m.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",m[m.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",m[m.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",m[m.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",m[m.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",m[m.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",m[m.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",m[m.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",m[m.U_GREEK_TONOS=900]="U_GREEK_TONOS",m[m.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",m[m.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",m[m.U_GREEK_PSILI=8127]="U_GREEK_PSILI",m[m.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",m[m.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",m[m.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",m[m.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",m[m.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",m[m.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",m[m.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",m[m.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",m[m.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",m[m.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",m[m.U_GREEK_VARIA=8175]="U_GREEK_VARIA",m[m.U_GREEK_OXIA=8189]="U_GREEK_OXIA",m[m.U_GREEK_DASIA=8190]="U_GREEK_DASIA",m[m.U_OVERLINE=8254]="U_OVERLINE",m[m.UTF8_BOM=65279]="UTF8_BOM"})(qt||(qt={}))});function aU(r,e){let t=[...r];for(;t.length>0;){let i=t.shift();if(!e(i))break;t.unshift(...i.children)}}var fTe,J,In,I_,Za,wt,O_,Er,oh,cv,Xr,Yn,ah,Fo,uv=R(()=>{oU();yt();fTe=U()("snippets-parser");(function(g){g[g.Dollar=0]="Dollar",g[g.Colon=1]="Colon",g[g.Comma=2]="Comma",g[g.CurlyOpen=3]="CurlyOpen",g[g.CurlyClose=4]="CurlyClose",g[g.Backslash=5]="Backslash",g[g.Forwardslash=6]="Forwardslash",g[g.Pipe=7]="Pipe",g[g.Int=8]="Int",g[g.VariableName=9]="VariableName",g[g.Format=10]="Format",g[g.Plus=11]="Plus",g[g.Dash=12]="Dash",g[g.QuestionMark=13]="QuestionMark",g[g.EOF=14]="EOF"})(J||(J={}));In=class{static isDigitCharacter(e){return e>=qt.Digit0&&e<=qt.Digit9}static isVariableCharacter(e){return e===qt.Underline||e>=qt.a&&e<=qt.z||e>=qt.A&&e<=qt.Z}constructor(){this.text("")}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e=this.pos,t=0,i=this.value.charCodeAt(e),n;if(n=In._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(In.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(In.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(In.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(In.isVariableCharacter(i)||In.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof In._table[i]=="undefined"&&!In.isDigitCharacter(i)&&!In.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}},I_=In;I_._table={[qt.DollarSign]:0,[qt.Colon]:1,[qt.Comma]:2,[qt.OpenCurlyBrace]:3,[qt.CloseCurlyBrace]:4,[qt.Backslash]:5,[qt.Slash]:6,[qt.Pipe]:7,[qt.Plus]:11,[qt.Dash]:12,[qt.QuestionMark]:13};Za=class{constructor(){this._children=[]}appendChild(e){return e instanceof wt&&this._children[this._children.length-1]instanceof wt?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}setOnlyChild(e){e.parent=this,this._children=[e]}replace(e,t){let{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,function o(a,l){for(let c of a)c.parent=l,o(c.children,c)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof ah)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}get next(){let{parent:e}=this,{children:t}=e,i=t.indexOf(this);return t[i+1]}},wt=class extends Za{constructor(e){super();this.value=e}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}toString(){return this.value}toTextmateString(){return wt.escape(this.value)}len(){return this.value.length}clone(){return new wt(this.value)}},O_=class extends Za{},Er=class extends O_{constructor(e){super();this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof oh?this._children[0]:void 0}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0?`\${${this.index}${e}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${e}}`:`\${${this.index}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){let e=new Er(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}},oh=class extends Za{constructor(){super(...arguments);this.options=[]}appendChild(e){return e instanceof wt&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}toTextmateString(){return this.options.map(e=>e.value.replace(/\||,/g,"\\$&")).join(",")}len(){return this.options[0].len()}clone(){let e=new oh;for(let t of this.options)e.appendChild(t);return e}},cv=class extends Za{resolve(e){let t=!1,i=e.replace(this.regexp,(...n)=>(t=!0,this._replace(n.slice(0,-2))));return!t&&this._children.some(n=>n instanceof Xr&&Boolean(n.elseValue))&&(i=this._replace([])),i}_replace(e){let t="";for(let i of this._children)if(i instanceof Xr){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}toTextmateString(){return`/${this.regexp.source}/${this.children.map(e=>e.toTextmateString())}/${(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")}`}clone(){let e=new cv;return e.regexp=new RegExp(this.regexp.source,""+(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}},Xr=class extends Za{constructor(e,t,i,n){super();this.index=e;this.shorthandName=t;this.ifValue=i;this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":Boolean(e)&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){let t=e.match(/[a-z]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}toTextmateString(){let e="${";return e+=this.index,this.shorthandName?e+=`:/${this.shorthandName}`:this.ifValue&&this.elseValue?e+=`:?${this.ifValue}:${this.elseValue}`:this.ifValue?e+=`:+${this.ifValue}`:this.elseValue&&(e+=`:-${this.elseValue}`),e+="}",e}clone(){return new Xr(this.index,this.shorthandName,this.ifValue,this.elseValue)}},Yn=class extends O_{constructor(e){super();this.name=e}async resolve(e){let t=await e.resolve(this);if(t&&t.includes(`
`)){let i="";this.snippet.walk(l=>{if(l==this)return!1;if(l instanceof wt){let c=l.toString().split(/\r?\n/);i=c[c.length-1].match(/^\s*/)[0]}return!0});let n=t.split(`
`),s=n.filter(l=>l.length>0).map(l=>l.match(/^\s*/)[0]),o=s.length==0?"":s.reduce((l,c)=>l.length<c.length?l:c);t=n.map((l,c)=>c==0||l.length==0||!l.startsWith(o)?l:i+l.slice(o.length)).join(`
`)}return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new wt(t)],!0):!1}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${e}}`:`\${${this.name}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){let e=new Yn(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}};ah=class extends Za{get placeholderInfo(){if(!this._placeholders){this._variables=[];let e=[],t;this.walk(i=>{if(i instanceof Er)e.push(i),t=!t||t.index<i.index?i:t;else if(i instanceof Yn){let n=i.name.charCodeAt(0);(n<65||n>90)&&this._variables.push(i)}return!0}),this._placeholders={all:e,last:t}}return this._placeholders}get variables(){return this._variables}get placeholders(){let{all:e}=this.placeholderInfo;return e}get maxIndexNumber(){let{placeholders:e}=this;return e.reduce((t,i)=>Math.max(t,i.index),0)}get minIndexNumber(){let{placeholders:e}=this,t=e.map(i=>i.index);return t.sort((i,n)=>i-n),t.length>1&&t[0]==0?t[1]:t[0]||0}insertSnippet(e,t,i){let n=this.placeholders[t];if(!n)return;let{index:s}=n,[o,a]=x$(n.toString(),i),l=new Fo().parse(e,!0),c=l.maxIndexNumber+1,u=[];for(let d of l.placeholders)d.isFinalTabstop?d.index=c+s:d.index=d.index+s,u.push(d.index);this.walk(d=>(d instanceof Er&&d.index>s&&(d.index=d.index+c),!0));let f=l.children;return o&&f.unshift(new wt(o)),a&&f.push(new wt(a)),this.replace(n,f),Math.min.apply(null,u)}updatePlaceholder(e,t){let i=this.placeholders[e];for(let n of this.placeholders)if(n.index==i.index){let s=n.children[0],o=n.transform?n.transform.resolve(t):t;s?n.setOnlyChild(new wt(o)):n.appendChild(new wt(o))}this._placeholders=void 0}updateVariable(e,t){let i=this.variables[e-this.maxIndexNumber-1];if(i){let n=this.variables.filter(s=>s.name==i.name);for(let s of n){let o=s.transform?s.transform.resolve(t):t;s.setOnlyChild(new wt(o))}}}getPlaceholderText(e,t){let i=this.placeholders[e];return i&&i.transform?i.transform.resolve(t):t}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return aU([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof Er&&t.push(i),i=i.parent;return t}async resolveVariables(e){let t=[];this.walk(i=>(i instanceof Yn&&t.push(i),!0)),await Promise.all(t.map(i=>i.resolve(e)))}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}toTextmateString(){return this.children.reduce((e,t)=>e+t.toTextmateString(),"")}clone(){let e=new ah;return this._children=this.children.map(t=>t.clone()),e}walk(e){aU(this.children,e)}},Fo=class{constructor(){this._scanner=new I_}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}text(e){return this.parse(e).toString()}parse(e,t){this._scanner.text(e),this._token=this._scanner.next();let i=new ah;for(;this._parse(i););let n=new Map,s=[];i.walk(o=>(o instanceof Er&&(o.isFinalTabstop?n.set(0,void 0):!n.has(o.index)&&o.children.length>0?n.set(o.index,o.children):s.push(o)),!0));for(let o of s)if(n.has(o.index)){let a=new Er(o.index);a.transform=o.transform;for(let l of n.get(o.index)){let c=l.clone();if(a.transform){if(c instanceof wt)c=new wt(a.transform.resolve(c.value));else for(let u of c.children)if(u instanceof wt){c.replace(u,[new wt(a.transform.resolve(u.value))]);break}}a.appendChild(c)}i.replace(o,[a])}return!n.has(0)&&t&&i.appendChild(new Er(0)),i}_accept(e,t){if(e===void 0||this._token.type===e){let i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){if(this._token.type===14)return!1;let t=this._token;for(;this._token.type!==e;)if(this._token=this._scanner.next(),this._token.type===14)return!1;let i=this._scanner.value.substring(t.pos,this._token.pos);return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new wt(t)),!0):!1}_parseTabstopOrVariableName(e){let t,i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Er(Number(t)):new Yn(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);let s=new Er(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new wt("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){let o=new oh;for(;;){if(this._parseChoiceElement(o)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(o),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){let t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new wt(i.join(""))),!0)}_parseComplexVariable(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);let s=new Yn(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new wt("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){let t=new cv,i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,t.appendChild(new wt(s));continue}if(this._parseFormatString(t)||this._parseAnything(t)){let o=t.children[0];o&&o.value&&o.value.includes("\\n")&&(o.value=o.value.replace(/\\n/g,`
`));continue}return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch(s){return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Xr(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Xr(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){let s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Xr(Number(n),s)),!0)}else if(this._accept(11)){let s=this._until(4);if(s)return e.appendChild(new Xr(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){let s=this._until(4);if(s)return e.appendChild(new Xr(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){let s=this._until(1);if(s){let o=this._until(4);if(o)return e.appendChild(new Xr(Number(n),void 0,s,o)),!0}}else{let s=this._until(4);if(s)return e.appendChild(new Xr(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){if(this._token.type!==14){let t=this._scanner.tokenText(this._token);return e.appendChild(new wt(t)),this._accept(void 0),!0}return!1}}});var lh=x((hTe,lU)=>{var Fle="2.0.0",Mle=256,Nle=Number.MAX_SAFE_INTEGER||9007199254740991,qle=16;lU.exports={SEMVER_SPEC_VERSION:Fle,MAX_LENGTH:Mle,MAX_SAFE_INTEGER:Nle,MAX_SAFE_COMPONENT_LENGTH:qle}});var ch=x((pTe,cU)=>{var $le=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};cU.exports=$le});var Qa=x((Mo,uU)=>{var{MAX_SAFE_COMPONENT_LENGTH:L_}=lh(),Ble=ch();Mo=uU.exports={};var jle=Mo.re=[],Z=Mo.src=[],Q=Mo.t={},Ule=0,xe=(r,e,t)=>{let i=Ule++;Ble(i,e),Q[r]=i,Z[i]=e,jle[i]=new RegExp(e,t?"g":void 0)};xe("NUMERICIDENTIFIER","0|[1-9]\\d*");xe("NUMERICIDENTIFIERLOOSE","[0-9]+");xe("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");xe("MAINVERSION",`(${Z[Q.NUMERICIDENTIFIER]})\\.(${Z[Q.NUMERICIDENTIFIER]})\\.(${Z[Q.NUMERICIDENTIFIER]})`);xe("MAINVERSIONLOOSE",`(${Z[Q.NUMERICIDENTIFIERLOOSE]})\\.(${Z[Q.NUMERICIDENTIFIERLOOSE]})\\.(${Z[Q.NUMERICIDENTIFIERLOOSE]})`);xe("PRERELEASEIDENTIFIER",`(?:${Z[Q.NUMERICIDENTIFIER]}|${Z[Q.NONNUMERICIDENTIFIER]})`);xe("PRERELEASEIDENTIFIERLOOSE",`(?:${Z[Q.NUMERICIDENTIFIERLOOSE]}|${Z[Q.NONNUMERICIDENTIFIER]})`);xe("PRERELEASE",`(?:-(${Z[Q.PRERELEASEIDENTIFIER]}(?:\\.${Z[Q.PRERELEASEIDENTIFIER]})*))`);xe("PRERELEASELOOSE",`(?:-?(${Z[Q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Z[Q.PRERELEASEIDENTIFIERLOOSE]})*))`);xe("BUILDIDENTIFIER","[0-9A-Za-z-]+");xe("BUILD",`(?:\\+(${Z[Q.BUILDIDENTIFIER]}(?:\\.${Z[Q.BUILDIDENTIFIER]})*))`);xe("FULLPLAIN",`v?${Z[Q.MAINVERSION]}${Z[Q.PRERELEASE]}?${Z[Q.BUILD]}?`);xe("FULL",`^${Z[Q.FULLPLAIN]}$`);xe("LOOSEPLAIN",`[v=\\s]*${Z[Q.MAINVERSIONLOOSE]}${Z[Q.PRERELEASELOOSE]}?${Z[Q.BUILD]}?`);xe("LOOSE",`^${Z[Q.LOOSEPLAIN]}$`);xe("GTLT","((?:<|>)?=?)");xe("XRANGEIDENTIFIERLOOSE",`${Z[Q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);xe("XRANGEIDENTIFIER",`${Z[Q.NUMERICIDENTIFIER]}|x|X|\\*`);xe("XRANGEPLAIN",`[v=\\s]*(${Z[Q.XRANGEIDENTIFIER]})(?:\\.(${Z[Q.XRANGEIDENTIFIER]})(?:\\.(${Z[Q.XRANGEIDENTIFIER]})(?:${Z[Q.PRERELEASE]})?${Z[Q.BUILD]}?)?)?`);xe("XRANGEPLAINLOOSE",`[v=\\s]*(${Z[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Z[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Z[Q.XRANGEIDENTIFIERLOOSE]})(?:${Z[Q.PRERELEASELOOSE]})?${Z[Q.BUILD]}?)?)?`);xe("XRANGE",`^${Z[Q.GTLT]}\\s*${Z[Q.XRANGEPLAIN]}$`);xe("XRANGELOOSE",`^${Z[Q.GTLT]}\\s*${Z[Q.XRANGEPLAINLOOSE]}$`);xe("COERCE",`(^|[^\\d])(\\d{1,${L_}})(?:\\.(\\d{1,${L_}}))?(?:\\.(\\d{1,${L_}}))?(?:$|[^\\d])`);xe("COERCERTL",Z[Q.COERCE],!0);xe("LONETILDE","(?:~>?)");xe("TILDETRIM",`(\\s*)${Z[Q.LONETILDE]}\\s+`,!0);Mo.tildeTrimReplace="$1~";xe("TILDE",`^${Z[Q.LONETILDE]}${Z[Q.XRANGEPLAIN]}$`);xe("TILDELOOSE",`^${Z[Q.LONETILDE]}${Z[Q.XRANGEPLAINLOOSE]}$`);xe("LONECARET","(?:\\^)");xe("CARETTRIM",`(\\s*)${Z[Q.LONECARET]}\\s+`,!0);Mo.caretTrimReplace="$1^";xe("CARET",`^${Z[Q.LONECARET]}${Z[Q.XRANGEPLAIN]}$`);xe("CARETLOOSE",`^${Z[Q.LONECARET]}${Z[Q.XRANGEPLAINLOOSE]}$`);xe("COMPARATORLOOSE",`^${Z[Q.GTLT]}\\s*(${Z[Q.LOOSEPLAIN]})$|^$`);xe("COMPARATOR",`^${Z[Q.GTLT]}\\s*(${Z[Q.FULLPLAIN]})$|^$`);xe("COMPARATORTRIM",`(\\s*)${Z[Q.GTLT]}\\s*(${Z[Q.LOOSEPLAIN]}|${Z[Q.XRANGEPLAIN]})`,!0);Mo.comparatorTrimReplace="$1$2$3";xe("HYPHENRANGE",`^\\s*(${Z[Q.XRANGEPLAIN]})\\s+-\\s+(${Z[Q.XRANGEPLAIN]})\\s*$`);xe("HYPHENRANGELOOSE",`^\\s*(${Z[Q.XRANGEPLAINLOOSE]})\\s+-\\s+(${Z[Q.XRANGEPLAINLOOSE]})\\s*$`);xe("STAR","(<|>)?=?\\s*\\*");xe("GTE0","^\\s*>=\\s*0.0.0\\s*$");xe("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")});var uh=x((mTe,fU)=>{var Hle=["includePrerelease","loose","rtl"],Wle=r=>r?typeof r!="object"?{loose:!0}:Hle.filter(e=>r[e]).reduce((e,t)=>(e[t]=!0,e),{}):{};fU.exports=Wle});var fv=x((gTe,pU)=>{var dU=/^[0-9]+$/,hU=(r,e)=>{let t=dU.test(r),i=dU.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:r<e?-1:1},zle=(r,e)=>hU(e,r);pU.exports={compareIdentifiers:hU,rcompareIdentifiers:zle}});var Di=x((vTe,bU)=>{var dv=ch(),{MAX_LENGTH:mU,MAX_SAFE_INTEGER:hv}=lh(),{re:gU,t:vU}=Qa(),Vle=uh(),{compareIdentifiers:fh}=fv(),Zr=class{constructor(e,t){if(t=Vle(t),e instanceof Zr){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>mU)throw new TypeError(`version is longer than ${mU} characters`);dv("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?gU[vU.LOOSE]:gU[vU.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hv||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hv||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hv||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<hv)return s}return n}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(dv("SemVer.compare",this.version,this.options,e),!(e instanceof Zr)){if(typeof e=="string"&&e===this.version)return 0;e=new Zr(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Zr||(e=new Zr(e,this.options)),fh(this.major,e.major)||fh(this.minor,e.minor)||fh(this.patch,e.patch)}comparePre(e){if(e instanceof Zr||(e=new Zr(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let i=this.prerelease[t],n=e.prerelease[t];if(dv("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return fh(i,n)}while(++t)}compareBuild(e){e instanceof Zr||(e=new Zr(e,this.options));let t=0;do{let i=this.build[t],n=e.build[t];if(dv("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return fh(i,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};bU.exports=Zr});var el=x((bTe,SU)=>{var{MAX_LENGTH:Gle}=lh(),{re:yU,t:wU}=Qa(),xU=Di(),Kle=uh(),Jle=(r,e)=>{if(e=Kle(e),r instanceof xU)return r;if(typeof r!="string"||r.length>Gle||!(e.loose?yU[wU.LOOSE]:yU[wU.FULL]).test(r))return null;try{return new xU(r,e)}catch(i){return null}};SU.exports=Jle});var _U=x((yTe,CU)=>{var Yle=el(),Xle=(r,e)=>{let t=Yle(r,e);return t?t.version:null};CU.exports=Xle});var TU=x((wTe,EU)=>{var Zle=el(),Qle=(r,e)=>{let t=Zle(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};EU.exports=Qle});var RU=x((xTe,DU)=>{var ece=Di(),tce=(r,e,t,i)=>{typeof t=="string"&&(i=t,t=void 0);try{return new ece(r,t).inc(e,i).version}catch(n){return null}};DU.exports=tce});var Qr=x((STe,kU)=>{var PU=Di(),ice=(r,e,t)=>new PU(r,t).compare(new PU(e,t));kU.exports=ice});var pv=x((CTe,IU)=>{var rce=Qr(),nce=(r,e,t)=>rce(r,e,t)===0;IU.exports=nce});var AU=x((_Te,LU)=>{var OU=el(),sce=pv(),oce=(r,e)=>{if(sce(r,e))return null;{let t=OU(r),i=OU(e),n=t.prerelease.length||i.prerelease.length,s=n?"pre":"",o=n?"prerelease":"";for(let a in t)if((a==="major"||a==="minor"||a==="patch")&&t[a]!==i[a])return s+a;return o}};LU.exports=oce});var MU=x((ETe,FU)=>{var ace=Di(),lce=(r,e)=>new ace(r,e).major;FU.exports=lce});var qU=x((TTe,NU)=>{var cce=Di(),uce=(r,e)=>new cce(r,e).minor;NU.exports=uce});var BU=x((DTe,$U)=>{var fce=Di(),dce=(r,e)=>new fce(r,e).patch;$U.exports=dce});var UU=x((RTe,jU)=>{var hce=el(),pce=(r,e)=>{let t=hce(r,e);return t&&t.prerelease.length?t.prerelease:null};jU.exports=pce});var WU=x((PTe,HU)=>{var mce=Qr(),gce=(r,e,t)=>mce(e,r,t);HU.exports=gce});var VU=x((kTe,zU)=>{var vce=Qr(),bce=(r,e)=>vce(r,e,!0);zU.exports=bce});var mv=x((ITe,KU)=>{var GU=Di(),yce=(r,e,t)=>{let i=new GU(r,t),n=new GU(e,t);return i.compare(n)||i.compareBuild(n)};KU.exports=yce});var YU=x((OTe,JU)=>{var wce=mv(),xce=(r,e)=>r.sort((t,i)=>wce(t,i,e));JU.exports=xce});var ZU=x((LTe,XU)=>{var Sce=mv(),Cce=(r,e)=>r.sort((t,i)=>Sce(i,t,e));XU.exports=Cce});var dh=x((ATe,QU)=>{var _ce=Qr(),Ece=(r,e,t)=>_ce(r,e,t)>0;QU.exports=Ece});var gv=x((FTe,eH)=>{var Tce=Qr(),Dce=(r,e,t)=>Tce(r,e,t)<0;eH.exports=Dce});var A_=x((MTe,tH)=>{var Rce=Qr(),Pce=(r,e,t)=>Rce(r,e,t)!==0;tH.exports=Pce});var vv=x((NTe,iH)=>{var kce=Qr(),Ice=(r,e,t)=>kce(r,e,t)>=0;iH.exports=Ice});var bv=x((qTe,rH)=>{var Oce=Qr(),Lce=(r,e,t)=>Oce(r,e,t)<=0;rH.exports=Lce});var F_=x(($Te,nH)=>{var Ace=pv(),Fce=A_(),Mce=dh(),Nce=vv(),qce=gv(),$ce=bv(),Bce=(r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Ace(r,t,i);case"!=":return Fce(r,t,i);case">":return Mce(r,t,i);case">=":return Nce(r,t,i);case"<":return qce(r,t,i);case"<=":return $ce(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}};nH.exports=Bce});var oH=x((BTe,sH)=>{var jce=Di(),Uce=el(),{re:yv,t:wv}=Qa(),Hce=(r,e)=>{if(r instanceof jce)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(yv[wv.COERCE]);else{let i;for(;(i=yv[wv.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||i.index+i[0].length!==t.index+t[0].length)&&(t=i),yv[wv.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;yv[wv.COERCERTL].lastIndex=-1}return t===null?null:Uce(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};sH.exports=Hce});var lH=x((jTe,aH)=>{"use strict";aH.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var hh=x((UTe,cH)=>{"use strict";cH.exports=Ue;Ue.Node=tl;Ue.create=Ue;function Ue(r){var e=this;if(e instanceof Ue||(e=new Ue),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t<i;t++)e.push(arguments[t]);return e}Ue.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};Ue.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};Ue.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};Ue.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)zce(this,arguments[r]);return this.length};Ue.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Vce(this,arguments[r]);return this.length};Ue.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};Ue.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};Ue.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,i=0;t!==null;i++)r.call(e,t.value,i,this),t=t.next};Ue.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,i=this.length-1;t!==null;i--)r.call(e,t.value,i,this),t=t.prev};Ue.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};Ue.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};Ue.prototype.map=function(r,e){e=e||this;for(var t=new Ue,i=this.head;i!==null;)t.push(r.call(e,i.value,this)),i=i.next;return t};Ue.prototype.mapReverse=function(r,e){e=e||this;for(var t=new Ue,i=this.tail;i!==null;)t.push(r.call(e,i.value,this)),i=i.prev;return t};Ue.prototype.reduce=function(r,e){var t,i=this.head;if(arguments.length>1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=r(t,i.value,n),i=i.next;return t};Ue.prototype.reduceReverse=function(r,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=r(t,i.value,n),i=i.prev;return t};Ue.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};Ue.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};Ue.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Ue;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&i<r;i++)n=n.next;for(;n!==null&&i<e;i++,n=n.next)t.push(n.value);return t};Ue.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Ue;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>r;i--,n=n.prev)t.push(n.value);return t};Ue.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,n=this.head;n!==null&&i<r;i++)n=n.next;for(var s=[],i=0;n&&i<e;i++)s.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var i=0;i<t.length;i++)n=Wce(this,n,t[i]);return s};Ue.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var i=t.prev;t.prev=t.next,t.next=i}return this.head=e,this.tail=r,this};function Wce(r,e,t){var i=e===r.head?new tl(t,null,e,r):new tl(t,e,e.next,r);return i.next===null&&(r.tail=i),i.prev===null&&(r.head=i),r.length++,i}function zce(r,e){r.tail=new tl(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Vce(r,e){r.head=new tl(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function tl(r,e,t,i){if(!(this instanceof tl))return new tl(r,e,t,i);this.list=i,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{lH()(Ue)}catch(r){}});var gH=x((HTe,mH)=>{"use strict";var Gce=hh(),il=Symbol("max"),qs=Symbol("length"),ru=Symbol("lengthCalculator"),ph=Symbol("allowStale"),rl=Symbol("maxAge"),$s=Symbol("dispose"),uH=Symbol("noDisposeOnSet"),oi=Symbol("lruList"),On=Symbol("cache"),fH=Symbol("updateAgeOnGet"),M_=()=>1,dH=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[il]=e.max||1/0,i=e.length||M_;if(this[ru]=typeof i!="function"?M_:i,this[ph]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[rl]=e.maxAge||0,this[$s]=e.dispose,this[uH]=e.noDisposeOnSet||!1,this[fH]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[il]=e||1/0,mh(this)}get max(){return this[il]}set allowStale(e){this[ph]=!!e}get allowStale(){return this[ph]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[rl]=e,mh(this)}get maxAge(){return this[rl]}set lengthCalculator(e){typeof e!="function"&&(e=M_),e!==this[ru]&&(this[ru]=e,this[qs]=0,this[oi].forEach(t=>{t.length=this[ru](t.value,t.key),this[qs]+=t.length})),mh(this)}get lengthCalculator(){return this[ru]}get length(){return this[qs]}get itemCount(){return this[oi].length}rforEach(e,t){t=t||this;for(let i=this[oi].tail;i!==null;){let n=i.prev;pH(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[oi].head;i!==null;){let n=i.next;pH(this,e,i,t),i=n}}keys(){return this[oi].toArray().map(e=>e.key)}values(){return this[oi].toArray().map(e=>e.value)}reset(){this[$s]&&this[oi]&&this[oi].length&&this[oi].forEach(e=>this[$s](e.key,e.value)),this[On]=new Map,this[oi]=new Gce,this[qs]=0}dump(){return this[oi].map(e=>xv(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[oi]}set(e,t,i){if(i=i||this[rl],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[ru](t,e);if(this[On].has(e)){if(s>this[il])return nu(this,this[On].get(e)),!1;let l=this[On].get(e).value;return this[$s]&&(this[uH]||this[$s](e,l.value)),l.now=n,l.maxAge=i,l.value=t,this[qs]+=s-l.length,l.length=s,this.get(e),mh(this),!0}let o=new hH(e,t,s,n,i);return o.length>this[il]?(this[$s]&&this[$s](e,t),!1):(this[qs]+=o.length,this[oi].unshift(o),this[On].set(e,this[oi].head),mh(this),!0)}has(e){if(!this[On].has(e))return!1;let t=this[On].get(e).value;return!xv(this,t)}get(e){return N_(this,e,!0)}peek(e){return N_(this,e,!1)}pop(){let e=this[oi].tail;return e?(nu(this,e),e.value):null}del(e){nu(this,this[On].get(e))}load(e){this.reset();let t=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let o=s-t;o>0&&this.set(n.k,n.v,o)}}}prune(){this[On].forEach((e,t)=>N_(this,t,!1))}},N_=(r,e,t)=>{let i=r[On].get(e);if(i){let n=i.value;if(xv(r,n)){if(nu(r,i),!r[ph])return}else t&&(r[fH]&&(i.value.now=Date.now()),r[oi].unshiftNode(i));return n.value}},xv=(r,e)=>{if(!e||!e.maxAge&&!r[rl])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:r[rl]&&t>r[rl]},mh=r=>{if(r[qs]>r[il])for(let e=r[oi].tail;r[qs]>r[il]&&e!==null;){let t=e.prev;nu(r,e),e=t}},nu=(r,e)=>{if(e){let t=e.value;r[$s]&&r[$s](t.key,t.value),r[qs]-=t.length,r[On].delete(t.key),r[oi].removeNode(e)}},hH=class{constructor(e,t,i,n,s){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=s||0}},pH=(r,e,t,i)=>{let n=t.value;xv(r,n)&&(nu(r,t),r[ph]||(n=void 0)),n&&e.call(i,n.value,n.key,r)};mH.exports=dH});var en=x((WTe,wH)=>{var su=class{constructor(e,t){if(t=Jce(t),e instanceof su)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new su(e.raw,t);if(e instanceof q_)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!bH(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&eue(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let i=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=vH.get(i);if(n)return n;let s=this.options.loose,o=s?Ri[pi.HYPHENRANGELOOSE]:Ri[pi.HYPHENRANGE];e=e.replace(o,uue(this.options.includePrerelease)),$t("hyphen replace",e),e=e.replace(Ri[pi.COMPARATORTRIM],Xce),$t("comparator trim",e,Ri[pi.COMPARATORTRIM]),e=e.replace(Ri[pi.TILDETRIM],Zce),e=e.replace(Ri[pi.CARETTRIM],Qce),e=e.split(/\s+/).join(" ");let a=s?Ri[pi.COMPARATORLOOSE]:Ri[pi.COMPARATOR],l=e.split(" ").map(d=>tue(d,this.options)).join(" ").split(/\s+/).map(d=>cue(d,this.options)).filter(this.options.loose?d=>!!d.match(a):()=>!0).map(d=>new q_(d,this.options)),c=l.length,u=new Map;for(let d of l){if(bH(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return vH.set(i,f),f}intersects(e,t){if(!(e instanceof su))throw new TypeError("a Range is required");return this.set.some(i=>yH(i,t)&&e.set.some(n=>yH(n,t)&&i.every(s=>n.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Yce(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(fue(this.set[t],e,this.options))return!0;return!1}};wH.exports=su;var Kce=gH(),vH=new Kce({max:1e3}),Jce=uh(),q_=gh(),$t=ch(),Yce=Di(),{re:Ri,t:pi,comparatorTrimReplace:Xce,tildeTrimReplace:Zce,caretTrimReplace:Qce}=Qa(),bH=r=>r.value==="<0.0.0-0",eue=r=>r.value==="",yH=(r,e)=>{let t=!0,i=r.slice(),n=i.pop();for(;t&&i.length;)t=i.every(s=>n.intersects(s,e)),n=i.pop();return t},tue=(r,e)=>($t("comp",r,e),r=nue(r,e),$t("caret",r),r=iue(r,e),$t("tildes",r),r=oue(r,e),$t("xrange",r),r=lue(r,e),$t("stars",r),r),Hi=r=>!r||r.toLowerCase()==="x"||r==="*",iue=(r,e)=>r.trim().split(/\s+/).map(t=>rue(t,e)).join(" "),rue=(r,e)=>{let t=e.loose?Ri[pi.TILDELOOSE]:Ri[pi.TILDE];return r.replace(t,(i,n,s,o,a)=>{$t("tilde",r,i,n,s,o,a);let l;return Hi(n)?l="":Hi(s)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:Hi(o)?l=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?($t("replaceTilde pr",a),l=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):l=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,$t("tilde return",l),l})},nue=(r,e)=>r.trim().split(/\s+/).map(t=>sue(t,e)).join(" "),sue=(r,e)=>{$t("caret",r,e);let t=e.loose?Ri[pi.CARETLOOSE]:Ri[pi.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(n,s,o,a,l)=>{$t("caret",r,n,s,o,a,l);let c;return Hi(s)?c="":Hi(o)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:Hi(a)?s==="0"?c=`>=${s}.${o}.0${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${i} <${+s+1}.0.0-0`:l?($t("replaceCaret pr",l),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${l} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${l} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${l} <${+s+1}.0.0-0`):($t("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${i} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),$t("caret return",c),c})},oue=(r,e)=>($t("replaceXRanges",r,e),r.split(/\s+/).map(t=>aue(t,e)).join(" ")),aue=(r,e)=>{r=r.trim();let t=e.loose?Ri[pi.XRANGELOOSE]:Ri[pi.XRANGE];return r.replace(t,(i,n,s,o,a,l)=>{$t("xRange",r,i,n,s,o,a,l);let c=Hi(s),u=c||Hi(o),f=u||Hi(a),d=f;return n==="="&&d&&(n=""),l=e.includePrerelease?"-0":"",c?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&d?(u&&(o=0),a=0,n===">"?(n=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",u?s=+s+1:o=+o+1),n==="<"&&(l="-0"),i=`${n+s}.${o}.${a}${l}`):u?i=`>=${s}.0.0${l} <${+s+1}.0.0-0`:f&&(i=`>=${s}.${o}.0${l} <${s}.${+o+1}.0-0`),$t("xRange return",i),i})},lue=(r,e)=>($t("replaceStars",r,e),r.trim().replace(Ri[pi.STAR],"")),cue=(r,e)=>($t("replaceGTE0",r,e),r.trim().replace(Ri[e.includePrerelease?pi.GTE0PRE:pi.GTE0],"")),uue=r=>(e,t,i,n,s,o,a,l,c,u,f,d,h)=>(Hi(i)?t="":Hi(n)?t=`>=${i}.0.0${r?"-0":""}`:Hi(s)?t=`>=${i}.${n}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,Hi(c)?l="":Hi(u)?l=`<${+c+1}.0.0-0`:Hi(f)?l=`<${c}.${+u+1}.0-0`:d?l=`<=${c}.${u}.${f}-${d}`:r?l=`<${c}.${u}.${+f+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),fue=(r,e,t)=>{for(let i=0;i<r.length;i++)if(!r[i].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let i=0;i<r.length;i++)if($t(r[i].semver),r[i].semver!==q_.ANY&&r[i].semver.prerelease.length>0){let n=r[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var gh=x((zTe,EH)=>{var vh=Symbol("SemVer ANY"),bh=class{static get ANY(){return vh}constructor(e,t){if(t=due(t),e instanceof bh){if(e.loose===!!t.loose)return e;e=e.value}B_("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===vh?this.value="":this.value=this.operator+this.semver.version,B_("comp",this)}parse(e){let t=this.options.loose?xH[SH.COMPARATORLOOSE]:xH[SH.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new CH(i[2],this.options.loose):this.semver=vh}toString(){return this.value}test(e){if(B_("Comparator.test",e,this.options.loose),this.semver===vh||e===vh)return!0;if(typeof e=="string")try{e=new CH(e,this.options)}catch(t){return!1}return $_(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof bh))throw new TypeError("a Comparator is required");if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new _H(e.value,t).test(this.value);if(e.operator==="")return e.value===""?!0:new _H(this.value,t).test(e.semver);let i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),s=this.semver.version===e.semver.version,o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=$_(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),l=$_(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||s&&o||a||l}};EH.exports=bh;var due=uh(),{re:xH,t:SH}=Qa(),$_=F_(),B_=ch(),CH=Di(),_H=en()});var yh=x((VTe,TH)=>{var hue=en(),pue=(r,e,t)=>{try{e=new hue(e,t)}catch(i){return!1}return e.test(r)};TH.exports=pue});var RH=x((GTe,DH)=>{var mue=en(),gue=(r,e)=>new mue(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" "));DH.exports=gue});var kH=x((KTe,PH)=>{var vue=Di(),bue=en(),yue=(r,e,t)=>{let i=null,n=null,s=null;try{s=new bue(e,t)}catch(o){return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===-1)&&(i=o,n=new vue(i,t))}),i};PH.exports=yue});var OH=x((JTe,IH)=>{var wue=Di(),xue=en(),Sue=(r,e,t)=>{let i=null,n=null,s=null;try{s=new xue(e,t)}catch(o){return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===1)&&(i=o,n=new wue(i,t))}),i};IH.exports=Sue});var FH=x((YTe,AH)=>{var j_=Di(),Cue=en(),LH=dh(),_ue=(r,e)=>{r=new Cue(r,e);let t=new j_("0.0.0");if(r.test(t)||(t=new j_("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i<r.set.length;++i){let n=r.set[i],s=null;n.forEach(o=>{let a=new j_(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||LH(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||LH(t,s))&&(t=s)}return t&&r.test(t)?t:null};AH.exports=_ue});var NH=x((XTe,MH)=>{var Eue=en(),Tue=(r,e)=>{try{return new Eue(r,e).range||"*"}catch(t){return null}};MH.exports=Tue});var Sv=x((ZTe,jH)=>{var Due=Di(),qH=gh(),{ANY:Rue}=qH,Pue=en(),kue=yh(),$H=dh(),BH=gv(),Iue=bv(),Oue=vv(),Lue=(r,e,t,i)=>{r=new Due(r,i),e=new Pue(e,i);let n,s,o,a,l;switch(t){case">":n=$H,s=Iue,o=BH,a=">",l=">=";break;case"<":n=BH,s=Oue,o=$H,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kue(r,e,i))return!1;for(let c=0;c<e.set.length;++c){let u=e.set[c],f=null,d=null;if(u.forEach(h=>{h.semver===Rue&&(h=new qH(">=0.0.0")),f=f||h,d=d||h,n(h.semver,f.semver,i)?f=h:o(h.semver,d.semver,i)&&(d=h)}),f.operator===a||f.operator===l||(!d.operator||d.operator===a)&&s(r,d.semver))return!1;if(d.operator===l&&o(r,d.semver))return!1}return!0};jH.exports=Lue});var HH=x((QTe,UH)=>{var Aue=Sv(),Fue=(r,e,t)=>Aue(r,e,">",t);UH.exports=Fue});var zH=x((eDe,WH)=>{var Mue=Sv(),Nue=(r,e,t)=>Mue(r,e,"<",t);WH.exports=Nue});var KH=x((tDe,GH)=>{var VH=en(),que=(r,e,t)=>(r=new VH(r,t),e=new VH(e,t),r.intersects(e));GH.exports=que});var YH=x((iDe,JH)=>{var $ue=yh(),Bue=Qr();JH.exports=(r,e,t)=>{let i=[],n=null,s=null,o=r.sort((u,f)=>Bue(u,f,t));for(let u of o)$ue(u,e,t)?(s=u,n||(n=u)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,f]of i)u===f?a.push(u):!f&&u===o[0]?a.push("*"):f?u===o[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let l=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length<c.length?l:e}});var tW=x((rDe,eW)=>{var XH=en(),Cv=gh(),{ANY:U_}=Cv,wh=yh(),H_=Qr(),jue=(r,e,t={})=>{if(r===e)return!0;r=new XH(r,t),e=new XH(e,t);let i=!1;e:for(let n of r.set){for(let s of e.set){let o=Uue(n,s,t);if(i=i||o!==null,o)continue e}if(i)return!1}return!0},Uue=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===U_){if(e.length===1&&e[0].semver===U_)return!0;t.includePrerelease?r=[new Cv(">=0.0.0-0")]:r=[new Cv(">=0.0.0")]}if(e.length===1&&e[0].semver===U_){if(t.includePrerelease)return!0;e=[new Cv(">=0.0.0")]}let i=new Set,n,s;for(let h of r)h.operator===">"||h.operator===">="?n=ZH(n,h,t):h.operator==="<"||h.operator==="<="?s=QH(s,h,t):i.add(h.semver);if(i.size>1)return null;let o;if(n&&s){if(o=H_(n.semver,s.semver,t),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let h of i){if(n&&!wh(h,String(n),t)||s&&!wh(h,String(s),t))return null;for(let p of e)if(!wh(h,String(p),t))return!1;return!0}let a,l,c,u,f=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",n){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator===">"||h.operator===">="){if(a=ZH(n,h,t),a===h&&a!==n)return!1}else if(n.operator===">="&&!wh(n.semver,String(h),t))return!1}if(s){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator==="<"||h.operator==="<="){if(l=QH(s,h,t),l===h&&l!==s)return!1}else if(s.operator==="<="&&!wh(s.semver,String(h),t))return!1}if(!h.operator&&(s||n)&&o!==0)return!1}return!(n&&c&&!s&&o!==0||s&&u&&!n&&o!==0||d||f)},ZH=(r,e,t)=>{if(!r)return e;let i=H_(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},QH=(r,e,t)=>{if(!r)return e;let i=H_(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r};eW.exports=jue});var _v=x((nDe,iW)=>{var W_=Qa();iW.exports={re:W_.re,src:W_.src,tokens:W_.t,SEMVER_SPEC_VERSION:lh().SEMVER_SPEC_VERSION,SemVer:Di(),compareIdentifiers:fv().compareIdentifiers,rcompareIdentifiers:fv().rcompareIdentifiers,parse:el(),valid:_U(),clean:TU(),inc:RU(),diff:AU(),major:MU(),minor:qU(),patch:BU(),prerelease:UU(),compare:Qr(),rcompare:WU(),compareLoose:VU(),compareBuild:mv(),sort:YU(),rsort:ZU(),gt:dh(),lt:gv(),eq:pv(),neq:A_(),gte:vv(),lte:bv(),cmp:F_(),coerce:oH(),Comparator:gh(),Range:en(),satisfies:yh(),toComparators:RH(),maxSatisfying:kH(),minSatisfying:OH(),minVersion:FH(),validRange:NH(),outside:Sv(),gtr:HH(),ltr:zH(),intersects:KH(),simplifyRange:YH(),subset:tW()}});var rW,oDe,Ln,xh,nW=R(()=>{rW=E(require("events"));P0();oDe=U()("model-installBuffer");(function(n){n[n.Waiting=0]="Waiting",n[n.Faild=1]="Faild",n[n.Progressing=2]="Progressing",n[n.Success=3]="Success"})(Ln||(Ln={}));xh=class extends rW.EventEmitter{constructor(e=!1,t=!1,i=void 0){super();this.isUpdate=e;this.isSync=t;this.channel=i;this.statMap=new Map;this.messagesMap=new Map;this.names=[]}setExtensions(e){this.statMap.clear(),this.names=e;for(let t of e)this.statMap.set(t,0)}addMessage(e,t,i=!1){if(i&&this.channel)return;let n=this.messagesMap.get(e)||[];this.messagesMap.set(e,n.concat(t.trim().split(/\r?\n/))),this.channel&&this.channel.appendLine(`[${e}] ${t}`)}startProgress(e){for(let t of e)this.statMap.set(t,2)}finishProgress(e,t=!0){this.channel&&(t?this.channel.appendLine(`[${e}] install succeed!`):this.channel.appendLine(`[${e}] install failed!`)),this.statMap.set(e,t?3:1)}get remains(){let e=0;for(let t of this.names){let i=this.statMap.get(t);[3,1].includes(i)||(e=e+1)}return e}getLines(){let e=[];for(let t of this.names){let i=this.statMap.get(t),n="*";switch(i){case 2:{let o=new Date,a=Math.floor(o.getMilliseconds()/100);n=R0[a];break}case 1:n="\u2717";break;case 3:n="\u2713";break}let s=this.messagesMap.get(t)||[];e.push(`- ${n} ${t} ${s.length?s[s.length-1]:""}`)}return e}getMessages(e){if(e<=1)return[];let t=this.names[e-2];return t?this.messagesMap.get(t):[]}draw(e,t){let{remains:i}=this,s=[i==0?`${this.isUpdate?"Update":"Install"} finished`:`Installing, ${i} remains...`,"",...this.getLines()];t.setLines(s,{start:0,end:-1,strictIndexing:!1},!0),i==0&&this.interval&&(clearInterval(this.interval),this.interval=null),process.env.VIM_NODE_RPC&&e.command("redraw",!0)}highlight(e){e.call("matchadd",["CocListFgCyan","^\\-\\s\\zs\\*"],!0),e.call("matchadd",["CocListFgGreen","^\\-\\s\\zs\u2713"],!0),e.call("matchadd",["CocListFgRed","^\\-\\s\\zs\u2717"],!0),e.call("matchadd",["CocListFgYellow","^-.\\{3\\}\\zs\\S\\+"],!0)}async show(e){let{isSync:t}=this;if(this.channel)return;e.pauseNotification(),e.command(t?"enew":"vs +enew",!0),e.call("bufnr",["%"],!0),e.command("setl buftype=nofile bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1",!0),t||e.command("nnoremap <silent><nowait><buffer> q :q<CR>",!0),this.highlight(e);let i=await e.resumeNotification(),n=i&&i[1]==null?i[0][1]:null;if(!n)return;this.bufnr=n;let s=e.createBuffer(n);this.interval=setInterval(()=>{this.draw(e,s)},100)}dispose(){this.interval&&clearInterval(this.interval)}}});var lW=x(nl=>{nl.parse=nl.decode=Hue;nl.stringify=nl.encode=sW;nl.safe=ou;nl.unsafe=Ev;var z_=typeof process!="undefined"&&process.platform==="win32"?`\r
`:`
`;function sW(r,e){var t=[],i="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var n=e.whitespace?" = ":"=";return Object.keys(r).forEach(function(s,o,a){var l=r[s];l&&Array.isArray(l)?l.forEach(function(c){i+=ou(s+"[]")+n+ou(c)+`
`}):l&&typeof l=="object"?t.push(s):i+=ou(s)+n+ou(l)+z_}),e.section&&i.length&&(i="["+ou(e.section)+"]"+z_+i),t.forEach(function(s,o,a){var l=oW(s).join("\\."),c=(e.section?e.section+".":"")+l,u=sW(r[s],{section:c,whitespace:e.whitespace});i.length&&u.length&&(i+=z_),i+=u}),i}function oW(r){return r.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Hue(r){var e={},t=e,i=null,n=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,s=r.split(/[\r\n]+/g);return s.forEach(function(o,a,l){if(!(!o||o.match(/^\s*[;#]/))){var c=o.match(n);if(!!c){if(c[1]!==void 0){if(i=Ev(c[1]),i==="__proto__"){t={};return}t=e[i]=e[i]||{};return}var u=Ev(c[2]);if(u!=="__proto__"){var f=c[3]?Ev(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(u.length>2&&u.slice(-2)==="[]"){if(u=u.substring(0,u.length-2),u==="__proto__")return;t[u]?Array.isArray(t[u])||(t[u]=[t[u]]):t[u]=[]}Array.isArray(t[u])?t[u].push(f):t[u]=f}}}}),Object.keys(e).filter(function(o,a,l){if(!e[o]||typeof e[o]!="object"||Array.isArray(e[o]))return!1;var c=oW(o),u=e,f=c.pop(),d=f.replace(/\\\./g,".");return c.forEach(function(h,p,g){h!=="__proto__"&&((!u[h]||typeof u[h]!="object")&&(u[h]={}),u=u[h])}),u===e&&d===f?!1:(u[d]=e[o],!0)}).forEach(function(o,a,l){delete e[o]}),e}function aW(r){return r.charAt(0)==='"'&&r.slice(-1)==='"'||r.charAt(0)==="'"&&r.slice(-1)==="'"}function ou(r){return typeof r!="string"||r.match(/[=\r\n]/)||r.match(/^\[/)||r.length>1&&aW(r)||r!==r.trim()?JSON.stringify(r):r.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Ev(r,e){if(r=(r||"").trim(),aW(r)){r.charAt(0)==="'"&&(r=r.substr(1,r.length-2));try{r=JSON.parse(r)}catch(a){}}else{for(var t=!1,i="",n=0,s=r.length;n<s;n++){var o=r.charAt(n);if(t)"\\;#".indexOf(o)!==-1?i+=o:i+="\\"+o,t=!1;else{if(";#".indexOf(o)!==-1)break;o==="\\"?t=!0:i+=o}}return t&&(i+="\\"),i.trim()}return r}});var fW=x((cDe,uW)=>{"use strict";var V_=1,cW=2;function Wue(){return""}function zue(r,e,t){return r.slice(e,t).replace(/\S/g," ")}uW.exports=function(r,e){e=e||{};for(var t,i,n=!1,s=!1,o=0,a="",l=e.whitespace===!1?Wue:zue,c=0;c<r.length;c++){if(t=r[c],i=r[c+1],!s&&t==='"'){var u=r[c-1]==="\\"&&r[c-2]!=="\\";u||(n=!n)}if(!n){if(!s&&t+i==="//")a+=r.slice(o,c),o=c,s=V_,c++;else if(s===V_&&t+i===`\r
`){c++,s=!1,a+=l(r,o,c),o=c;continue}else if(s===V_&&t===`
`)s=!1,a+=l(r,o,c),o=c;else if(!s&&t+i==="/*"){a+=r.slice(o,c),o=c,s=cW,c++;continue}else if(s===cW&&t+i==="*/"){c++,s=!1,a+=l(r,o,c+1),o=c+1;continue}}}return a+(s?l(r.substr(o)):r.substr(o))}});var hW=x(au=>{"use strict";var dW=require("fs"),Vue=lW(),Sh=require("path"),Gue=fW(),Kue=au.parse=function(r){return/^\s*{/.test(r)?JSON.parse(Gue(r)):Vue.parse(r)},Jue=au.file=function(){var r=[].slice.call(arguments).filter(function(n){return n!=null});for(var e in r)if(typeof r[e]!="string")return;var t=Sh.join.apply(null,r),i;try{return dW.readFileSync(t,"utf-8")}catch(n){return}},uDe=au.json=function(){var r=Jue.apply(null,arguments);return r?Kue(r):null},fDe=au.env=function(r,e){e=e||process.env;var t={},i=r.length;for(var n in e)if(n.toLowerCase().indexOf(r.toLowerCase())===0){for(var s=n.substring(i).split("__"),o;(o=s.indexOf(""))>-1;)s.splice(o,1);var a=t;s.forEach(function(c,u){!c||typeof a!="object"||(u===s.length-1&&(a[c]=e[n]),a[c]===void 0&&(a[c]={}),a=a[c])})}return t},dDe=au.find=function(){var r=Sh.join.apply(null,[].slice.call(arguments));function e(t,i){var n=Sh.join(t,i);try{return dW.statSync(n),n}catch(s){if(Sh.dirname(t)!==t)return e(Sh.dirname(t),i)}}return e(process.cwd(),r)}});var yW=x((pDe,bW)=>{"use strict";function pW(r){return r instanceof Buffer||r instanceof Date||r instanceof RegExp}function mW(r){if(r instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(r.length):new Buffer(r.length);return r.copy(e),e}else{if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r);throw new Error("Unexpected situation")}}function gW(r){var e=[];return r.forEach(function(t,i){typeof t=="object"&&t!==null?Array.isArray(t)?e[i]=gW(t):pW(t)?e[i]=mW(t):e[i]=G_({},t):e[i]=t}),e}function vW(r,e){return e==="__proto__"?void 0:r[e]}var G_=bW.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var r=arguments[0],e=Array.prototype.slice.call(arguments,1),t,i,n;return e.forEach(function(s){typeof s!="object"||s===null||Array.isArray(s)||Object.keys(s).forEach(function(o){if(i=vW(r,o),t=vW(s,o),t!==r)if(typeof t!="object"||t===null){r[o]=t;return}else if(Array.isArray(t)){r[o]=gW(t);return}else if(pW(t)){r[o]=mW(t);return}else if(typeof i!="object"||i===null||Array.isArray(i)){r[o]=G_({},t);return}else{r[o]=G_(i,t);return}})}),r}});var SW=x((mDe,xW)=>{xW.exports=function(r,e){e||(e={});var t={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(t.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?t.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(_){t.bools[_]=!0});var i={};Object.keys(e.alias||{}).forEach(function(_){i[_]=[].concat(e.alias[_]),i[_].forEach(function(L){i[L]=[_].concat(i[_].filter(function($){return L!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(_){t.strings[_]=!0,i[_]&&(t.strings[i[_]]=!0)});var n=e.default||{},s={_:[]};Object.keys(t.bools).forEach(function(_){l(_,n[_]===void 0?!1:n[_])});var o=[];r.indexOf("--")!==-1&&(o=r.slice(r.indexOf("--")+1),r=r.slice(0,r.indexOf("--")));function a(_,L){return t.allBools&&/^--[^=]+$/.test(L)||t.strings[_]||t.bools[_]||i[_]}function l(_,L,$){if(!($&&t.unknownFn&&!a(_,$)&&t.unknownFn($)===!1)){var I=!t.strings[_]&&wW(L)?Number(L):L;c(s,_.split("."),I),(i[_]||[]).forEach(function(W){c(s,W.split("."),I)})}}function c(_,L,$){for(var I=_,W=0;W<L.length-1;W++){var A=L[W];if(A==="__proto__")return;I[A]===void 0&&(I[A]={}),(I[A]===Object.prototype||I[A]===Number.prototype||I[A]===String.prototype)&&(I[A]={}),I[A]===Array.prototype&&(I[A]=[]),I=I[A]}var A=L[L.length-1];A!=="__proto__"&&((I===Object.prototype||I===Number.prototype||I===String.prototype)&&(I={}),I===Array.prototype&&(I=[]),I[A]===void 0||t.bools[A]||typeof I[A]=="boolean"?I[A]=$:Array.isArray(I[A])?I[A].push($):I[A]=[I[A],$])}function u(_){return i[_].some(function(L){return t.bools[L]})}for(var f=0;f<r.length;f++){var d=r[f];if(/^--.+=/.test(d)){var h=d.match(/^--([^=]+)=([\s\S]*)$/),p=h[1],g=h[2];t.bools[p]&&(g=g!=="false"),l(p,g,d)}else if(/^--no-.+/.test(d)){var p=d.match(/^--no-(.+)/)[1];l(p,!1,d)}else if(/^--.+/.test(d)){var p=d.match(/^--(.+)/)[1],b=r[f+1];b!==void 0&&!/^-/.test(b)&&!t.bools[p]&&!t.allBools&&(i[p]?!u(p):!0)?(l(p,b,d),f++):/^(true|false)$/.test(b)?(l(p,b==="true",d),f++):l(p,t.strings[p]?"":!0,d)}else if(/^-[^-]+/.test(d)){for(var y=d.slice(1,-1).split(""),S=!1,w=0;w<y.length;w++){var b=d.slice(w+2);if(b==="-"){l(y[w],b,d);continue}if(/[A-Za-z]/.test(y[w])&&/=/.test(b)){l(y[w],b.split("=")[1],d),S=!0;break}if(/[A-Za-z]/.test(y[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(b)){l(y[w],b,d),S=!0;break}if(y[w+1]&&y[w+1].match(/\W/)){l(y[w],d.slice(w+2),d),S=!0;break}else l(y[w],t.strings[y[w]]?"":!0,d)}var p=d.slice(-1)[0];!S&&p!=="-"&&(r[f+1]&&!/^(-|--)[^-]/.test(r[f+1])&&!t.bools[p]&&(i[p]?!u(p):!0)?(l(p,r[f+1],d),f++):r[f+1]&&/^(true|false)$/.test(r[f+1])?(l(p,r[f+1]==="true",d),f++):l(p,t.strings[p]?"":!0,d))}else if((!t.unknownFn||t.unknownFn(d)!==!1)&&s._.push(t.strings._||!wW(d)?d:Number(d)),e.stopEarly){s._.push.apply(s._,r.slice(f+1));break}}return Object.keys(n).forEach(function(_){Yue(s,_.split("."))||(c(s,_.split("."),n[_]),(i[_]||[]).forEach(function(L){c(s,L.split("."),n[_])}))}),e["--"]?(s["--"]=new Array,o.forEach(function(_){s["--"].push(_)})):o.forEach(function(_){s._.push(_)}),s};function Yue(r,e){var t=r;e.slice(0,-1).forEach(function(n){t=t[n]||{}});var i=e[e.length-1];return i in t}function wW(r){return typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}});var TW=x((gDe,EW)=>{var Ch=hW(),lu=require("path").join,Xue=yW(),CW="/etc",_W=process.platform==="win32",_h=_W?process.env.USERPROFILE:process.env.HOME;EW.exports=function(r,e,t,i){if(typeof r!="string")throw new Error("rc(name): name *must* be string");t||(t=SW()(process.argv.slice(2))),e=(typeof e=="string"?Ch.json(e):e)||{},i=i||Ch.parse;var n=Ch.env(r+"_"),s=[e],o=[];function a(l){if(!(o.indexOf(l)>=0)){var c=Ch.file(l);c&&(s.push(i(c)),o.push(l))}}return _W||[lu(CW,r,"config"),lu(CW,r+"rc")].forEach(a),_h&&[lu(_h,".config",r,"config"),lu(_h,".config",r),lu(_h,"."+r,"config"),lu(_h,"."+r+"rc")].forEach(a),a(Ch.find("."+r+"rc")),n.config&&a(n.config),t.config&&a(t.config),Xue.apply(null,s.concat([n,t,o.length?{configs:o,config:o[o.length-1]}:void 0]))}});var PW=x((K_,RW)=>{var Tv=require("buffer"),Bs=Tv.Buffer;function DW(r,e){for(var t in r)e[t]=r[t]}Bs.from&&Bs.alloc&&Bs.allocUnsafe&&Bs.allocUnsafeSlow?RW.exports=Tv:(DW(Tv,K_),K_.Buffer=cu);function cu(r,e,t){return Bs(r,e,t)}DW(Bs,cu);cu.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Bs(r,e,t)};cu.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=Bs(r);return e!==void 0?typeof t=="string"?i.fill(e,t):i.fill(e):i.fill(0),i};cu.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Bs(r)};cu.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Tv.SlowBuffer(r)}});var FW=x((vDe,J_)=>{"use strict";J_.exports=lfe;J_.exports.parse=dfe;var kW=require("path").basename,Zue=PW().Buffer,Que=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,efe=/%[0-9A-Fa-f]{2}/,tfe=/%([0-9A-Fa-f]{2})/g,IW=/[^\x20-\x7e\xa0-\xff]/g,ife=/\\([\u0000-\u007f])/g,rfe=/([\\"])/g,OW=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,nfe=/^[\x20-\x7e\x80-\xff]+$/,sfe=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,ofe=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,afe=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function lfe(r,e){var t=e||{},i=t.type||"attachment",n=cfe(r,t.fallback);return ufe(new AW(i,n))}function cfe(r,e){if(r!==void 0){var t={};if(typeof r!="string")throw new TypeError("filename must be a string");if(e===void 0&&(e=!0),typeof e!="string"&&typeof e!="boolean")throw new TypeError("fallback must be a string or boolean");if(typeof e=="string"&&IW.test(e))throw new TypeError("fallback must be ISO-8859-1 string");var i=kW(r),n=nfe.test(i),s=typeof e!="string"?e&&LW(i):kW(e),o=typeof s=="string"&&s!==i;return(o||!n||efe.test(i))&&(t["filename*"]=i),(n||o)&&(t.filename=o?s:i),t}}function ufe(r){var e=r.parameters,t=r.type;if(!t||typeof t!="string"||!sfe.test(t))throw new TypeError("invalid type");var i=String(t).toLowerCase();if(e&&typeof e=="object")for(var n,s=Object.keys(e).sort(),o=0;o<s.length;o++){n=s[o];var a=n.substr(-1)==="*"?gfe(e[n]):mfe(e[n]);i+="; "+n+"="+a}return i}function ffe(r){var e=ofe.exec(r);if(!e)throw new TypeError("invalid extended field value");var t=e[1].toLowerCase(),i=e[2],n,s=i.replace(tfe,hfe);switch(t){case"iso-8859-1":n=LW(s);break;case"utf-8":n=Zue.from(s,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return n}function LW(r){return String(r).replace(IW,"?")}function dfe(r){if(!r||typeof r!="string")throw new TypeError("argument string is required");var e=afe.exec(r);if(!e)throw new TypeError("invalid type format");var t=e[0].length,i=e[1].toLowerCase(),n,s=[],o={},a;for(t=OW.lastIndex=e[0].substr(-1)===";"?t-1:t;e=OW.exec(r);){if(e.index!==t)throw new TypeError("invalid parameter format");if(t+=e[0].length,n=e[1].toLowerCase(),a=e[2],s.indexOf(n)!==-1)throw new TypeError("invalid duplicate parameter");if(s.push(n),n.indexOf("*")+1===n.length){n=n.slice(0,-1),a=ffe(a),o[n]=a;continue}typeof o[n]!="string"&&(a[0]==='"'&&(a=a.substr(1,a.length-2).replace(ife,"$1")),o[n]=a)}if(t!==-1&&t!==r.length)throw new TypeError("invalid parameter format");return new AW(i,o)}function hfe(r,e){return String.fromCharCode(parseInt(e,16))}function pfe(r){return"%"+String(r).charCodeAt(0).toString(16).toUpperCase()}function mfe(r){var e=String(r);return'"'+e.replace(rfe,"\\$1")+'"'}function gfe(r){var e=String(r),t=encodeURIComponent(e).replace(Que,pfe);return"UTF-8''"+t}function AW(r,e){this.type=r,this.parameters=e}});var NW=x((bDe,MW)=>{var Dv;MW.exports=function(){if(!Dv)try{Dv=Bt()("follow-redirects")}catch(r){Dv=function(){}}Dv.apply(null,arguments)}});var eE=x((yDe,Q_)=>{var uu=require("url"),Y_=uu.URL,vfe=require("http"),bfe=require("https"),qW=require("stream").Writable,yfe=require("assert"),$W=NW(),sl=["abort","aborted","connect","error","socket","timeout"],X_=Object.create(null);sl.forEach(function(r){X_[r]=function(e,t,i){this._redirectable.emit(r,e,t,i)}});var wfe=Rv("ERR_FR_REDIRECTION_FAILURE",""),xfe=Rv("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Sfe=Rv("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Cfe=Rv("ERR_STREAM_WRITE_AFTER_END","write after end");function Tr(r,e){qW.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(i){t._processResponse(i)},this._performRequest()}Tr.prototype=Object.create(qW.prototype);Tr.prototype.abort=function(){UW(this._currentRequest),this.emit("abort")};Tr.prototype.write=function(r,e,t){if(this._ending)throw new Cfe;if(!(typeof r=="string"||typeof r=="object"&&"length"in r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(typeof e=="function"&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new Sfe),this.abort())};Tr.prototype.end=function(r,e,t){if(typeof r=="function"?(t=r,r=e=null):typeof e=="function"&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var i=this,n=this._currentRequest;this.write(r,e,function(){i._ended=!0,n.end(null,null,t)}),this._ending=!0}};Tr.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Tr.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Tr.prototype.setTimeout=function(r,e){var t=this;e&&this.on("timeout",e);function i(o){o.setTimeout(r),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function n(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),i(o)}function s(){clearTimeout(this._timeout),e&&t.removeListener("timeout",e),this.socket||t._currentRequest.removeListener("socket",n)}return this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",i),this.once("response",s),this.once("error",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Tr.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Tr.prototype,r,{get:function(){return this._currentRequest[r]}})});Tr.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Tr.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e){this.emit("error",new TypeError("Unsupported protocol "+r));return}if(this._options.agents){var t=r.substr(0,r.length-1);this._options.agent=this._options.agents[t]}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=uu.format(this._options),i._redirectable=this;for(var n=0;n<sl.length;n++)i.on(sl[n],X_[sl[n]]);if(this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function l(c){if(i===o._currentRequest)if(c)o.emit("error",c);else if(s<a.length){var u=a[s++];i.finished||i.write(u.data,u.encoding,l)}else o._ended&&i.end()})()}};Tr.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(t&&this._options.followRedirects!==!1&&e>=300&&e<400){if(UW(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new xfe);return}((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Z_(/^content-/i,this._options.headers));var i=Z_(/^host$/i,this._options.headers)||uu.parse(this._currentUrl).hostname,n=uu.resolve(this._currentUrl,t);$W("redirecting to",n),this._isRedirect=!0;var s=uu.parse(n);if(Object.assign(this._options,s),s.hostname!==i&&Z_(/^authorization$/i,this._options.headers),typeof this._options.beforeRedirect=="function"){var o={headers:r.headers};try{this._options.beforeRedirect.call(null,this._options,o)}catch(l){this.emit("error",l);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(l){var a=new wfe("Redirected request failed: "+l.message);a.cause=l,this.emit("error",a)}}else r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[]};function BW(r){var e={maxRedirects:21,maxBodyLength:10*1024*1024},t={};return Object.keys(r).forEach(function(i){var n=i+":",s=t[n]=r[i],o=e[i]=Object.create(s);function a(c,u,f){if(typeof c=="string"){var d=c;try{c=jW(new Y_(d))}catch(h){c=uu.parse(d)}}else Y_&&c instanceof Y_?c=jW(c):(f=u,u=c,c={protocol:n});return typeof u=="function"&&(f=u,u=null),u=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},c,u),u.nativeProtocols=t,yfe.equal(u.protocol,n,"protocol mismatch"),$W("options",u),new Tr(u,f)}function l(c,u,f){var d=o.request(c,u,f);return d.end(),d}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:l,configurable:!0,enumerable:!0,writable:!0}})}),e}function _fe(){}function jW(r){var e={protocol:r.protocol,hostname:r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,hash:r.hash,search:r.search,pathname:r.pathname,path:r.pathname+r.search,href:r.href};return r.port!==""&&(e.port=Number(r.port)),e}function Z_(r,e){var t;for(var i in e)r.test(i)&&(t=e[i],delete e[i]);return t}function Rv(r,e){function t(i){Error.captureStackTrace(this,this.constructor),this.message=i||e}return t.prototype=new Error,t.prototype.constructor=t,t.prototype.name="Error ["+r+"]",t.prototype.code=r,t}function UW(r){for(var e=0;e<sl.length;e++)r.removeListener(sl[e],X_[sl[e]]);r.on("error",_fe),r.abort()}Q_.exports=BW({http:vfe,https:bfe});Q_.exports.wrap=BW});var fu=x((wDe,WW)=>{"use strict";var HW=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);WW.exports=r=>r?Object.keys(r).map(e=>[HW.has(e)?HW.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var du=x((xDe,QW)=>{"use strict";var Efe=require("events"),zW=require("stream"),Eh=hh(),VW=require("string_decoder").StringDecoder,js=Symbol("EOF"),Th=Symbol("maybeEmitEnd"),No=Symbol("emittedEnd"),Pv=Symbol("emittingEnd"),kv=Symbol("closed"),GW=Symbol("read"),tE=Symbol("flush"),KW=Symbol("flushChunk"),ar=Symbol("encoding"),Us=Symbol("decoder"),Iv=Symbol("flowing"),Dh=Symbol("paused"),Rh=Symbol("resume"),Wi=Symbol("bufferLength"),JW=Symbol("bufferPush"),iE=Symbol("bufferShift"),Pi=Symbol("objectMode"),ki=Symbol("destroyed"),YW=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Tfe=YW&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Dfe=YW&&Symbol.iterator||Symbol("iterator not implemented"),XW=r=>r==="end"||r==="finish"||r==="prefinish",Rfe=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Pfe=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r);QW.exports=class ZW extends zW{constructor(e){super();this[Iv]=!1,this[Dh]=!1,this.pipes=new Eh,this.buffer=new Eh,this[Pi]=e&&e.objectMode||!1,this[Pi]?this[ar]=null:this[ar]=e&&e.encoding||null,this[ar]==="buffer"&&(this[ar]=null),this[Us]=this[ar]?new VW(this[ar]):null,this[js]=!1,this[No]=!1,this[Pv]=!1,this[kv]=!1,this.writable=!0,this.readable=!0,this[Wi]=0,this[ki]=!1}get bufferLength(){return this[Wi]}get encoding(){return this[ar]}set encoding(e){if(this[Pi])throw new Error("cannot set encoding in objectMode");if(this[ar]&&e!==this[ar]&&(this[Us]&&this[Us].lastNeed||this[Wi]))throw new Error("cannot change encoding");this[ar]!==e&&(this[Us]=e?new VW(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Us].write(t)))),this[ar]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Pi]}set objectMode(e){this[Pi]=this[Pi]||!!e}write(e,t,i){if(this[js])throw new Error("write after end");return this[ki]?(this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0):(typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8"),!this[Pi]&&!Buffer.isBuffer(e)&&(Pfe(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Rfe(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),!this.objectMode&&!e.length?(this[Wi]!==0&&this.emit("readable"),i&&i(),this.flowing):(typeof e=="string"&&!this[Pi]&&!(t===this[ar]&&!this[Us].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[ar]&&(e=this[Us].write(e)),this.flowing?(this[Wi]!==0&&this[tE](!0),this.emit("data",e)):this[JW](e),this[Wi]!==0&&this.emit("readable"),i&&i(),this.flowing))}read(e){if(this[ki])return null;try{return this[Wi]===0||e===0||e>this[Wi]?null:(this[Pi]&&(e=null),this.buffer.length>1&&!this[Pi]&&(this.encoding?this.buffer=new Eh([Array.from(this.buffer).join("")]):this.buffer=new Eh([Buffer.concat(Array.from(this.buffer),this[Wi])])),this[GW](e||null,this.buffer.head.value))}finally{this[Th]()}}[GW](e,t){return e===t.length||e===null?this[iE]():(this.buffer.head.value=t.slice(e),t=t.slice(0,e),this[Wi]-=e),this.emit("data",t),!this.buffer.length&&!this[js]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=null),typeof t=="function"&&(i=t,t="utf8"),e&&this.write(e,t),i&&this.once("end",i),this[js]=!0,this.writable=!1,(this.flowing||!this[Dh])&&this[Th](),this}[Rh](){this[ki]||(this[Dh]=!1,this[Iv]=!0,this.emit("resume"),this.buffer.length?this[tE]():this[js]?this[Th]():this.emit("drain"))}resume(){return this[Rh]()}pause(){this[Iv]=!1,this[Dh]=!0}get destroyed(){return this[ki]}get flowing(){return this[Iv]}get paused(){return this[Dh]}[JW](e){return this[Pi]?this[Wi]+=1:this[Wi]+=e.length,this.buffer.push(e)}[iE](){return this.buffer.length&&(this[Pi]?this[Wi]-=1:this[Wi]-=this.buffer.head.value.length),this.buffer.shift()}[tE](e){do;while(this[KW](this[iE]()));!e&&!this.buffer.length&&!this[js]&&this.emit("drain")}[KW](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[ki])return;let i=this[No];t=t||{},e===process.stdout||e===process.stderr?t.end=!1:t.end=t.end!==!1;let n={dest:e,opts:t,ondrain:s=>this[Rh]()};return this.pipes.push(n),e.on("drain",n.ondrain),this[Rh](),i&&n.opts.end&&n.dest.end(),e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{e==="data"&&!this.pipes.length&&!this.flowing?this[Rh]():XW(e)&&this[No]&&(super.emit(e),this.removeAllListeners(e))}}get emittedEnd(){return this[No]}[Th](){!this[Pv]&&!this[No]&&!this[ki]&&this.buffer.length===0&&this[js]&&(this[Pv]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[kv]&&this.emit("close"),this[Pv]=!1)}emit(e,t){if(e!=="error"&&e!=="close"&&e!==ki&&this[ki])return;if(e==="data"){if(!t)return;this.pipes.length&&this.pipes.forEach(n=>n.dest.write(t)===!1&&this.pause())}else if(e==="end"){if(this[No]===!0)return;this[No]=!0,this.readable=!1,this[Us]&&(t=this[Us].end(),t&&(this.pipes.forEach(n=>n.dest.write(t)),super.emit("data",t))),this.pipes.forEach(n=>{n.dest.removeListener("drain",n.ondrain),n.opts.end&&n.dest.end()})}else if(e==="close"&&(this[kv]=!0,!this[No]&&!this[ki]))return;let i=new Array(arguments.length);if(i[0]=e,i[1]=t,arguments.length>2)for(let n=2;n<arguments.length;n++)i[n]=arguments[n];try{return super.emit.apply(this,i)}finally{XW(e)?this.removeAllListeners(e):this[Th]()}}collect(){let e=[];this[Pi]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[Pi]||(e.dataLength+=i.length)}),t.then(()=>e)}concat(){return this[Pi]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Pi]?Promise.reject(new Error("cannot concat in objectMode")):this[ar]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(ki,()=>t(new Error("stream destroyed"))),this.on("end",()=>e()),this.on("error",i=>t(i))})}[Tfe](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[js])return Promise.resolve({done:!0});let i=null,n=null,s=c=>{this.removeListener("data",o),this.removeListener("end",a),n(c)},o=c=>{this.removeListener("error",s),this.removeListener("end",a),this.pause(),i({value:c,done:!!this[js]})},a=()=>{this.removeListener("error",s),this.removeListener("data",o),i({done:!0})},l=()=>s(new Error("stream destroyed"));return new Promise((c,u)=>{n=u,i=c,this.once(ki,l),this.once("error",s),this.once("end",a),this.once("data",o)})}}}[Dfe](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[ki]?(e?this.emit("error",e):this.emit(ki),this):(this[ki]=!0,this.buffer=new Eh,this[Wi]=0,typeof this.close=="function"&&!this[kv]&&this.close(),e?this.emit("error",e):this.emit(ki),this)}static isStream(e){return!!e&&(e instanceof ZW||e instanceof zW||e instanceof Efe&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var t2=x((SDe,e2)=>{var kfe=require("zlib").constants||{ZLIB_VERNUM:4736};e2.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},kfe))});var fE=x(Dr=>{"use strict";var rE=require("assert"),qo=require("buffer").Buffer,i2=require("zlib"),ol=Dr.constants=t2(),Ife=du(),r2=qo.concat,al=Symbol("_superWrite"),Ph=class extends Error{constructor(e){super("zlib: "+e.message);this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},Ofe=Symbol("opts"),kh=Symbol("flushFlag"),n2=Symbol("finishFlushFlag"),nE=Symbol("fullFlushFlag"),ct=Symbol("handle"),Ov=Symbol("onError"),hu=Symbol("sawError"),sE=Symbol("level"),oE=Symbol("strategy"),aE=Symbol("ended"),CDe=Symbol("_defaultFullFlush"),lE=class extends Ife{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e);this[hu]=!1,this[aE]=!1,this[Ofe]=e,this[kh]=e.flush,this[n2]=e.finishFlush;try{this[ct]=new i2[t](e)}catch(i){throw new Ph(i)}this[Ov]=i=>{this[hu]||(this[hu]=!0,this.close(),this.emit("error",i))},this[ct].on("error",i=>this[Ov](new Ph(i))),this.once("end",()=>this.close)}close(){this[ct]&&(this[ct].close(),this[ct]=null,this.emit("close"))}reset(){if(!this[hu])return rE(this[ct],"zlib binding closed"),this[ct].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[nE]),this.write(Object.assign(qo.alloc(0),{[kh]:e})))}end(e,t,i){return e&&this.write(e,t),this.flush(this[n2]),this[aE]=!0,super.end(null,null,i)}get ended(){return this[aE]}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=qo.from(e,t)),this[hu])return;rE(this[ct],"zlib binding closed");let n=this[ct]._handle,s=n.close;n.close=()=>{};let o=this[ct].close;this[ct].close=()=>{},qo.concat=c=>c;let a;try{let c=typeof e[kh]=="number"?e[kh]:this[kh];a=this[ct]._processChunk(e,c),qo.concat=r2}catch(c){qo.concat=r2,this[Ov](new Ph(c))}finally{this[ct]&&(this[ct]._handle=n,n.close=s,this[ct].close=o,this[ct].removeAllListeners("error"))}this[ct]&&this[ct].on("error",c=>this[Ov](new Ph(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[al](qo.from(a[0]));for(let c=1;c<a.length;c++)l=this[al](a[c])}else l=this[al](qo.from(a));return i&&i(),l}[al](e){return super.write(e)}},$o=class extends lE{constructor(e,t){e=e||{},e.flush=e.flush||ol.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ol.Z_FINISH,super(e,t),this[nE]=ol.Z_FULL_FLUSH,this[sE]=e.level,this[oE]=e.strategy}params(e,t){if(!this[hu]){if(!this[ct])throw new Error("cannot switch params when binding is closed");if(!this[ct].params)throw new Error("not supported in this implementation");if(this[sE]!==e||this[oE]!==t){this.flush(ol.Z_SYNC_FLUSH),rE(this[ct],"zlib binding closed");let i=this[ct].flush;this[ct].flush=(n,s)=>{this.flush(n),s()};try{this[ct].params(e,t)}finally{this[ct].flush=i}this[ct]&&(this[sE]=e,this[oE]=t)}}}},s2=class extends $o{constructor(e){super(e,"Deflate")}},o2=class extends $o{constructor(e){super(e,"Inflate")}},cE=Symbol("_portable"),a2=class extends $o{constructor(e){super(e,"Gzip");this[cE]=e&&!!e.portable}[al](e){return this[cE]?(this[cE]=!1,e[9]=255,super[al](e)):super[al](e)}},l2=class extends $o{constructor(e){super(e,"Gunzip")}},c2=class extends $o{constructor(e){super(e,"DeflateRaw")}},u2=class extends $o{constructor(e){super(e,"InflateRaw")}},f2=class extends $o{constructor(e){super(e,"Unzip")}},uE=class extends lE{constructor(e,t){e=e||{},e.flush=e.flush||ol.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ol.BROTLI_OPERATION_FINISH,super(e,t),this[nE]=ol.BROTLI_OPERATION_FLUSH}},d2=class extends uE{constructor(e){super(e,"BrotliCompress")}},h2=class extends uE{constructor(e){super(e,"BrotliDecompress")}};Dr.Deflate=s2;Dr.Inflate=o2;Dr.Gzip=a2;Dr.Gunzip=l2;Dr.DeflateRaw=c2;Dr.InflateRaw=u2;Dr.Unzip=f2;typeof i2.BrotliCompress=="function"?(Dr.BrotliCompress=d2,Dr.BrotliDecompress=h2):Dr.BrotliCompress=Dr.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var pu=x((EDe,p2)=>{var Lfe=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;p2.exports=Lfe!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var Lv=x((DDe,m2)=>{"use strict";var Afe=du(),dE=pu(),hE=Symbol("slurp");m2.exports=class extends Afe{constructor(e,t,i){super();switch(this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=dE(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=dE(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[hE](t),i&&this[hE](i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,n=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,n-t),this.ignore?!0:i>=t?super.write(e):super.write(e.slice(0,i))}[hE](e,t){for(let i in e)e[i]!==null&&e[i]!==void 0&&!(t&&i==="path")&&(this[i]=i==="path"||i==="linkpath"?dE(e[i]):e[i])}}});var pE=x(Av=>{"use strict";Av.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);Av.code=new Map(Array.from(Av.name).map(r=>[r[1],r[0]]))});var y2=x((PDe,b2)=>{"use strict";var Ffe=(r,e)=>{if(Number.isSafeInteger(r))r<0?Nfe(r,e):Mfe(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Mfe=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Nfe=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var i=e.length;i>1;i--){var n=r&255;r=Math.floor(r/256),t?e[i-1]=g2(n):n===0?e[i-1]=0:(t=!0,e[i-1]=v2(n))}},qfe=r=>{let e=r[0],t=e===128?Bfe(r.slice(1,r.length)):e===255?$fe(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},$fe=r=>{for(var e=r.length,t=0,i=!1,n=e-1;n>-1;n--){var s=r[n],o;i?o=g2(s):s===0?o=s:(i=!0,o=v2(s)),o!==0&&(t-=o*Math.pow(256,e-n-1))}return t},Bfe=r=>{for(var e=r.length,t=0,i=e-1;i>-1;i--){var n=r[i];n!==0&&(t+=n*Math.pow(256,e-i-1))}return t},g2=r=>(255^r)&255,v2=r=>(255^r)+1&255;b2.exports={encode:Ffe,parse:qfe}});var gu=x((kDe,S2)=>{"use strict";var mE=pE(),mu=require("path").posix,w2=y2(),gE=Symbol("slurp"),Rr=Symbol("type"),x2=class{constructor(e,t,i,n){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[Rr]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,i,n):e&&this.set(e)}decode(e,t,i,n){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=ll(e,t,100),this.mode=Bo(e,t+100,8),this.uid=Bo(e,t+108,8),this.gid=Bo(e,t+116,8),this.size=Bo(e,t+124,12),this.mtime=vE(e,t+136,12),this.cksum=Bo(e,t+148,12),this[gE](i),this[gE](n,!0),this[Rr]=ll(e,t+156,1),this[Rr]===""&&(this[Rr]="0"),this[Rr]==="0"&&this.path.substr(-1)==="/"&&(this[Rr]="5"),this[Rr]==="5"&&(this.size=0),this.linkpath=ll(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=ll(e,t+265,32),this.gname=ll(e,t+297,32),this.devmaj=Bo(e,t+329,8),this.devmin=Bo(e,t+337,8),e[t+475]!==0){let o=ll(e,t+345,155);this.path=o+"/"+this.path}else{let o=ll(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=vE(e,t+476,12),this.ctime=vE(e,t+488,12)}let s=8*32;for(let o=t;o<t+148;o++)s+=e[o];for(let o=t+156;o<t+512;o++)s+=e[o];this.cksumValid=s===this.cksum,this.cksum===null&&s===8*32&&(this.nullBlock=!0)}[gE](e,t){for(let i in e)e[i]!==null&&e[i]!==void 0&&!(t&&i==="path")&&(this[i]=e[i])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,n=jfe(this.path||"",i),s=n[0],o=n[1];this.needPax=n[2],this.needPax=cl(e,t,100,s)||this.needPax,this.needPax=jo(e,t+100,8,this.mode)||this.needPax,this.needPax=jo(e,t+108,8,this.uid)||this.needPax,this.needPax=jo(e,t+116,8,this.gid)||this.needPax,this.needPax=jo(e,t+124,12,this.size)||this.needPax,this.needPax=bE(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[Rr].charCodeAt(0),this.needPax=cl(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=cl(e,t+265,32,this.uname)||this.needPax,this.needPax=cl(e,t+297,32,this.gname)||this.needPax,this.needPax=jo(e,t+329,8,this.devmaj)||this.needPax,this.needPax=jo(e,t+337,8,this.devmin)||this.needPax,this.needPax=cl(e,t+345,i,o)||this.needPax,e[t+475]!==0?this.needPax=cl(e,t+345,155,o)||this.needPax:(this.needPax=cl(e,t+345,130,o)||this.needPax,this.needPax=bE(e,t+476,12,this.atime)||this.needPax,this.needPax=bE(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,jo(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return mE.name.get(this[Rr])||this[Rr]}get typeKey(){return this[Rr]}set type(e){mE.code.has(e)?this[Rr]=mE.code.get(e):this[Rr]=e}},jfe=(r,e)=>{let t=100,i=r,n="",s,o=mu.parse(r).root||".";if(Buffer.byteLength(i)<t)s=[i,n,!1];else{n=mu.dirname(i),i=mu.basename(i);do Buffer.byteLength(i)<=t&&Buffer.byteLength(n)<=e?s=[i,n,!1]:Buffer.byteLength(i)>t&&Buffer.byteLength(n)<=e?s=[i.substr(0,t-1),n,!0]:(i=mu.join(mu.basename(n),i),n=mu.dirname(n));while(n!==o&&!s);s||(s=[r.substr(0,t-1),"",!0])}return s},ll=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),vE=(r,e,t)=>Ufe(Bo(r,e,t)),Ufe=r=>r===null?null:new Date(r*1e3),Bo=(r,e,t)=>r[e]&128?w2.parse(r.slice(e,e+t)):Wfe(r,e,t),Hfe=r=>isNaN(r)?null:r,Wfe=(r,e,t)=>Hfe(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),zfe={12:8589934591,8:2097151},jo=(r,e,t,i)=>i===null?!1:i>zfe[t]||i<0?(w2.encode(i,r.slice(e,e+t)),!0):(Vfe(r,e,t,i),!1),Vfe=(r,e,t,i)=>r.write(Gfe(i,t),e,t,"ascii"),Gfe=(r,e)=>Kfe(Math.floor(r).toString(8),e),Kfe=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",bE=(r,e,t,i)=>i===null?!1:jo(r,e,t,i.getTime()/1e3),Jfe=new Array(156).join("\0"),cl=(r,e,t,i)=>i===null?!1:(r.write(i+Jfe,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t);S2.exports=x2});var Mv=x((IDe,C2)=>{"use strict";var Yfe=gu(),Xfe=require("path"),Fv=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),n=Buffer.allocUnsafe(i);for(let s=0;s<512;s++)n[s]=0;new Yfe({path:("PaxHeader/"+Xfe.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(n),n.write(e,512,t,"utf8");for(let s=t+512;s<n.length;s++)n[s]=0;return n}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],i=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
`,n=Buffer.byteLength(i),s=Math.floor(Math.log(n)/Math.log(10))+1;return n+s>=Math.pow(10,s)&&(s+=1),s+n+i}};Fv.parse=(r,e,t)=>new Fv(Zfe(Qfe(r),e),t);var Zfe=(r,e)=>e?Object.keys(r).reduce((t,i)=>(t[i]=r[i],t),e):r,Qfe=r=>r.replace(/\n$/,"").split(`
`).reduce(ede,Object.create(null)),ede=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.substr((t+" ").length);let i=e.split("="),n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return r;let s=i.join("=");return r[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,r};C2.exports=Fv});var vu=x((ODe,_2)=>{_2.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var Nv=x((LDe,E2)=>{"use strict";E2.exports=r=>class extends r{warn(e,t,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),this.emit("warn",i.tarCode,t,i)):t instanceof Error?this.emit("error",Object.assign(t,i)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),i))}}});var wE=x((ADe,T2)=>{"use strict";var qv=["|","<",">","?",":"],yE=qv.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),tde=new Map(qv.map((r,e)=>[r,yE[e]])),ide=new Map(yE.map((r,e)=>[r,qv[e]]));T2.exports={encode:r=>qv.reduce((e,t)=>e.split(t).join(tde.get(t)),r),decode:r=>yE.reduce((e,t)=>e.split(t).join(ide.get(t)),r)}});var xE=x((FDe,R2)=>{var{isAbsolute:rde,parse:D2}=require("path").win32;R2.exports=r=>{let e="",t=D2(r);for(;rde(r)||t.root;){let i=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.substr(i.length),e+=i,t=D2(r)}return[e,r]}});var k2=x((MDe,P2)=>{"use strict";P2.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&~18),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var kE=x(($De,z2)=>{"use strict";var I2=du(),O2=Mv(),L2=gu(),Xn=require("fs"),A2=require("path"),Zn=pu(),nde=vu(),F2=(r,e)=>e?(r=Zn(r).replace(/^\.(\/|$)/,""),nde(e)+"/"+r):Zn(r),sde=16*1024*1024,M2=Symbol("process"),N2=Symbol("file"),q2=Symbol("directory"),SE=Symbol("symlink"),$2=Symbol("hardlink"),Ih=Symbol("header"),$v=Symbol("read"),CE=Symbol("lstat"),Bv=Symbol("onlstat"),_E=Symbol("onread"),EE=Symbol("onreadlink"),TE=Symbol("openfile"),DE=Symbol("onopenfile"),Uo=Symbol("close"),jv=Symbol("mode"),RE=Symbol("awaitDrain"),PE=Symbol("ondrain"),Qn=Symbol("prefix"),B2=Symbol("hadError"),j2=Nv(),ode=wE(),U2=xE(),H2=k2(),Uv=j2(class extends I2{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=Zn(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||sde,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=Zn(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?Zn(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths){let[n,s]=U2(this.path);n&&(this.path=s,i=n)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=ode.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Zn(t.absolute||A2.resolve(this.cwd,e)),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[Bv](this.statCache.get(this.absolute)):this[CE]()}emit(e,...t){return e==="error"&&(this[B2]=!0),super.emit(e,...t)}[CE](){Xn.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Bv](t)})}[Bv](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=lde(e),this.emit("stat",e),this[M2]()}[M2](){switch(this.type){case"File":return this[N2]();case"Directory":return this[q2]();case"SymbolicLink":return this[SE]();default:return this.end()}}[jv](e){return H2(e,this.type==="Directory",this.portable)}[Qn](e){return F2(e,this.prefix)}[Ih](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new L2({path:this[Qn](this.path),linkpath:this.type==="Link"?this[Qn](this.linkpath):this.linkpath,mode:this[jv](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new O2({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[Qn](this.path),linkpath:this.type==="Link"?this[Qn](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[q2](){this.path.substr(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Ih](),this.end()}[SE](){Xn.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[EE](t)})}[EE](e){this.linkpath=Zn(e),this[Ih](),this.end()}[$2](e){this.type="Link",this.linkpath=Zn(A2.relative(this.cwd,e)),this.stat.size=0,this[Ih](),this.end()}[N2](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[$2](t)}this.linkCache.set(e,this.absolute)}if(this[Ih](),this.stat.size===0)return this.end();this[TE]()}[TE](){Xn.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[DE](t)})}[DE](e){if(this.fd=e,this[B2])return this[Uo]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[$v]()}[$v](){let{fd:e,buf:t,offset:i,length:n,pos:s}=this;Xn.read(e,t,i,n,s,(o,a)=>{if(o)return this[Uo](()=>this.emit("error",o));this[_E](a)})}[Uo](e){Xn.close(this.fd,e)}[_E](e){if(e<=0&&this.remain>0){let n=new Error("encountered unexpected EOF");return n.path=this.absolute,n.syscall="read",n.code="EOF",this[Uo](()=>this.emit("error",n))}if(e>this.remain){let n=new Error("did not encounter expected EOF");return n.path=this.absolute,n.syscall="read",n.code="EOF",this[Uo](()=>this.emit("error",n))}if(e===this.remain)for(let n=e;n<this.length&&e<this.blockRemain;n++)this.buf[n+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(t)?this[PE]():this[RE](()=>this[PE]())}[RE](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let t=new Error("writing more data than expected");return t.path=this.absolute,this.emit("error",t)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[PE](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Uo](e=>e?this.emit("error",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[$v]()}}),W2=class extends Uv{[CE](){this[Bv](Xn.lstatSync(this.absolute))}[SE](){this[EE](Xn.readlinkSync(this.absolute))}[TE](){this[DE](Xn.openSync(this.absolute,"r"))}[$v](){let e=!0;try{let{fd:t,buf:i,offset:n,length:s,pos:o}=this,a=Xn.readSync(t,i,n,s,o);this[_E](a),e=!1}finally{if(e)try{this[Uo](()=>{})}catch(t){}}}[RE](e){e()}[Uo](e){Xn.closeSync(this.fd),e()}},ade=j2(class extends I2{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=Zn(e.path),this.mode=this[jv](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=Zn(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths){let[n,s]=U2(this.path);n&&(this.path=s,i=n)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new L2({path:this[Qn](this.path),linkpath:this.type==="Link"?this[Qn](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.header.encode()&&!this.noPax&&super.write(new O2({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[Qn](this.path),linkpath:this.type==="Link"?this[Qn](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[Qn](e){return F2(e,this.prefix)}[jv](e){return H2(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});Uv.Sync=W2;Uv.Tar=ade;var lde=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";z2.exports=Uv});var Yv=x((jDe,Q2)=>{"use strict";var IE=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},cde=du(),ude=fE(),fde=Lv(),OE=kE(),dde=OE.Sync,hde=OE.Tar,pde=hh(),V2=Buffer.alloc(1024),Hv=Symbol("onStat"),Wv=Symbol("ended"),es=Symbol("queue"),bu=Symbol("current"),ul=Symbol("process"),zv=Symbol("processing"),G2=Symbol("processJob"),ts=Symbol("jobs"),LE=Symbol("jobDone"),Vv=Symbol("addFSEntry"),K2=Symbol("addTarEntry"),AE=Symbol("stat"),FE=Symbol("readdir"),Gv=Symbol("onreaddir"),Kv=Symbol("pipe"),J2=Symbol("entry"),ME=Symbol("entryOpt"),NE=Symbol("writeEntryClass"),Y2=Symbol("write"),qE=Symbol("ondrain"),Jv=require("fs"),X2=require("path"),mde=Nv(),$E=pu(),BE=mde(class extends cde{constructor(e){super(e);e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=$E(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[NE]=OE,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new ude.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[qE]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[qE]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[es]=new pde,this[ts]=0,this.jobs=+e.jobs||4,this[zv]=!1,this[Wv]=!1}[Y2](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[Wv]=!0,this[ul](),this}write(e){if(this[Wv])throw new Error("write after end");return e instanceof fde?this[K2](e):this[Vv](e),this.flowing}[K2](e){let t=$E(X2.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new IE(e.path,t,!1);i.entry=new hde(e,this[ME](i)),i.entry.on("end",n=>this[LE](i)),this[ts]+=1,this[es].push(i)}this[ul]()}[Vv](e){let t=$E(X2.resolve(this.cwd,e));this[es].push(new IE(e,t)),this[ul]()}[AE](e){e.pending=!0,this[ts]+=1;let t=this.follow?"stat":"lstat";Jv[t](e.absolute,(i,n)=>{e.pending=!1,this[ts]-=1,i?this.emit("error",i):this[Hv](e,n)})}[Hv](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[ul]()}[FE](e){e.pending=!0,this[ts]+=1,Jv.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[ts]-=1,t)return this.emit("error",t);this[Gv](e,i)})}[Gv](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[ul]()}[ul](){if(!this[zv]){this[zv]=!0;for(let e=this[es].head;e!==null&&this[ts]<this.jobs;e=e.next)if(this[G2](e.value),e.value.ignore){let t=e.next;this[es].removeNode(e),e.next=t}this[zv]=!1,this[Wv]&&!this[es].length&&this[ts]===0&&(this.zip?this.zip.end(V2):(super.write(V2),super.end()))}}get[bu](){return this[es]&&this[es].head&&this[es].head.value}[LE](e){this[es].shift(),this[ts]-=1,this[ul]()}[G2](e){if(!e.pending){if(e.entry){e===this[bu]&&!e.piped&&this[Kv](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[Hv](e,this.statCache.get(e.absolute)):this[AE](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[Gv](e,this.readdirCache.get(e.absolute)):this[FE](e),!e.readdir))){if(e.entry=this[J2](e),!e.entry){e.ignore=!0;return}e===this[bu]&&!e.piped&&this[Kv](e)}}}[ME](e){return{onwarn:(t,i,n)=>this.warn(t,i,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[J2](e){this[ts]+=1;try{return new this[NE](e.path,this[ME](e)).on("end",()=>this[LE](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[qE](){this[bu]&&this[bu].entry&&this[bu].entry.resume()}[Kv](e){e.piped=!0,e.readdir&&e.readdir.forEach(n=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[Vv](o+n)});let t=e.entry,i=this.zip;i?t.on("data",n=>{i.write(n)||t.pause()}):t.on("data",n=>{super.write(n)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),Z2=class extends BE{constructor(e){super(e);this[NE]=dde}pause(){}resume(){}[AE](e){let t=this.follow?"statSync":"lstatSync";this[Hv](e,Jv[t](e.absolute))}[FE](e,t){this[Gv](e,Jv.readdirSync(e.absolute))}[Kv](e){let t=e.entry,i=this.zip;e.readdir&&e.readdir.forEach(n=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[Vv](o+n)}),i?t.on("data",n=>{i.write(n)}):t.on("data",n=>{super[Y2](n)})}};BE.Sync=Z2;Q2.exports=BE});var Tu=x(Lh=>{"use strict";var gde=du(),vde=require("events").EventEmitter,lr=require("fs"),jE=lr.writev;if(!jE){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;jE=(t,i,n,s)=>{let o=(l,c)=>s(l,c,i),a=new e;a.oncomplete=o,r.writeBuffers(t,i,n,a)}}var yu=Symbol("_autoClose"),An=Symbol("_close"),Oh=Symbol("_ended"),tt=Symbol("_fd"),e3=Symbol("_finished"),Ho=Symbol("_flags"),UE=Symbol("_flush"),HE=Symbol("_handleChunk"),WE=Symbol("_makeBuf"),Xv=Symbol("_mode"),Zv=Symbol("_needDrain"),wu=Symbol("_onerror"),xu=Symbol("_onopen"),zE=Symbol("_onread"),Su=Symbol("_onwrite"),Wo=Symbol("_open"),Hs=Symbol("_path"),fl=Symbol("_pos"),is=Symbol("_queue"),Cu=Symbol("_read"),t3=Symbol("_readSize"),zo=Symbol("_reading"),Qv=Symbol("_remain"),i3=Symbol("_size"),eb=Symbol("_write"),_u=Symbol("_writing"),tb=Symbol("_defaultFlag"),Eu=Symbol("_errored"),VE=class extends gde{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Eu]=!1,this[tt]=typeof t.fd=="number"?t.fd:null,this[Hs]=e,this[t3]=t.readSize||16*1024*1024,this[zo]=!1,this[i3]=typeof t.size=="number"?t.size:1/0,this[Qv]=this[i3],this[yu]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[tt]=="number"?this[Cu]():this[Wo]()}get fd(){return this[tt]}get path(){return this[Hs]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Wo](){lr.open(this[Hs],"r",(e,t)=>this[xu](e,t))}[xu](e,t){e?this[wu](e):(this[tt]=t,this.emit("open",t),this[Cu]())}[WE](){return Buffer.allocUnsafe(Math.min(this[t3],this[Qv]))}[Cu](){if(!this[zo]){this[zo]=!0;let e=this[WE]();if(e.length===0)return process.nextTick(()=>this[zE](null,0,e));lr.read(this[tt],e,0,e.length,null,(t,i,n)=>this[zE](t,i,n))}}[zE](e,t,i){this[zo]=!1,e?this[wu](e):this[HE](t,i)&&this[Cu]()}[An](){if(this[yu]&&typeof this[tt]=="number"){let e=this[tt];this[tt]=null,lr.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[wu](e){this[zo]=!0,this[An](),this.emit("error",e)}[HE](e,t){let i=!1;return this[Qv]-=e,e>0&&(i=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Qv]<=0)&&(i=!1,this[An](),super.end()),i}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[tt]=="number"&&this[Cu]();break;case"error":return this[Eu]?void 0:(this[Eu]=!0,super.emit(e,t));default:return super.emit(e,t)}}},r3=class extends VE{[Wo](){let e=!0;try{this[xu](null,lr.openSync(this[Hs],"r")),e=!1}finally{e&&this[An]()}}[Cu](){let e=!0;try{if(!this[zo]){this[zo]=!0;do{let t=this[WE](),i=t.length===0?0:lr.readSync(this[tt],t,0,t.length,null);if(!this[HE](i,t))break}while(!0);this[zo]=!1}e=!1}finally{e&&this[An]()}}[An](){if(this[yu]&&typeof this[tt]=="number"){let e=this[tt];this[tt]=null,lr.closeSync(e),this.emit("close")}}},GE=class extends vde{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Eu]=!1,this[_u]=!1,this[Oh]=!1,this[Zv]=!1,this[is]=[],this[Hs]=e,this[tt]=typeof t.fd=="number"?t.fd:null,this[Xv]=t.mode===void 0?438:t.mode,this[fl]=typeof t.start=="number"?t.start:null,this[yu]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[fl]!==null?"r+":"w";this[tb]=t.flags===void 0,this[Ho]=this[tb]?i:t.flags,this[tt]===null&&this[Wo]()}emit(e,t){if(e==="error"){if(this[Eu])return;this[Eu]=!0}return super.emit(e,t)}get fd(){return this[tt]}get path(){return this[Hs]}[wu](e){this[An](),this[_u]=!0,this.emit("error",e)}[Wo](){lr.open(this[Hs],this[Ho],this[Xv],(e,t)=>this[xu](e,t))}[xu](e,t){this[tb]&&this[Ho]==="r+"&&e&&e.code==="ENOENT"?(this[Ho]="w",this[Wo]()):e?this[wu](e):(this[tt]=t,this.emit("open",t),this[UE]())}end(e,t){return e&&this.write(e,t),this[Oh]=!0,!this[_u]&&!this[is].length&&typeof this[tt]=="number"&&this[Su](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Oh]?(this.emit("error",new Error("write() after end()")),!1):this[tt]===null||this[_u]||this[is].length?(this[is].push(e),this[Zv]=!0,!1):(this[_u]=!0,this[eb](e),!0)}[eb](e){lr.write(this[tt],e,0,e.length,this[fl],(t,i)=>this[Su](t,i))}[Su](e,t){e?this[wu](e):(this[fl]!==null&&(this[fl]+=t),this[is].length?this[UE]():(this[_u]=!1,this[Oh]&&!this[e3]?(this[e3]=!0,this[An](),this.emit("finish")):this[Zv]&&(this[Zv]=!1,this.emit("drain"))))}[UE](){if(this[is].length===0)this[Oh]&&this[Su](null,0);else if(this[is].length===1)this[eb](this[is].pop());else{let e=this[is];this[is]=[],jE(this[tt],e,this[fl],(t,i)=>this[Su](t,i))}}[An](){if(this[yu]&&typeof this[tt]=="number"){let e=this[tt];this[tt]=null,lr.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},n3=class extends GE{[Wo](){let e;if(this[tb]&&this[Ho]==="r+")try{e=lr.openSync(this[Hs],this[Ho],this[Xv])}catch(t){if(t.code==="ENOENT")return this[Ho]="w",this[Wo]();throw t}else e=lr.openSync(this[Hs],this[Ho],this[Xv]);this[xu](null,e)}[An](){if(this[yu]&&typeof this[tt]=="number"){let e=this[tt];this[tt]=null,lr.closeSync(e),this.emit("close")}}[eb](e){let t=!0;try{this[Su](null,lr.writeSync(this[tt],e,0,e.length,this[fl])),t=!1}finally{if(t)try{this[An]()}catch(i){}}}};Lh.ReadStream=VE;Lh.ReadStreamSync=r3;Lh.WriteStream=GE;Lh.WriteStreamSync=n3});var lb=x((WDe,f3)=>{"use strict";var bde=Nv(),yde=gu(),wde=require("events"),xde=hh(),Sde=1024*1024,Cde=Lv(),s3=Mv(),_de=fE(),KE=Buffer.from([31,139]),tn=Symbol("state"),dl=Symbol("writeEntry"),Ws=Symbol("readEntry"),JE=Symbol("nextEntry"),o3=Symbol("processEntry"),rn=Symbol("extendedHeader"),Ah=Symbol("globalExtendedHeader"),Vo=Symbol("meta"),a3=Symbol("emitMeta"),dt=Symbol("buffer"),zs=Symbol("queue"),hl=Symbol("ended"),l3=Symbol("emittedEnd"),pl=Symbol("emit"),cr=Symbol("unzip"),ib=Symbol("consumeChunk"),rb=Symbol("consumeChunkSub"),YE=Symbol("consumeBody"),c3=Symbol("consumeMeta"),u3=Symbol("consumeHeader"),nb=Symbol("consuming"),XE=Symbol("bufferConcat"),ZE=Symbol("maybeEnd"),Fh=Symbol("writing"),Go=Symbol("aborted"),sb=Symbol("onDone"),ml=Symbol("sawValidEntry"),ob=Symbol("sawNullBlock"),ab=Symbol("sawEOF"),Ede=r=>!0;f3.exports=bde(class extends wde{constructor(e){e=e||{},super(e),this.file=e.file||"",this[ml]=null,this.on(sb,t=>{(this[tn]==="begin"||this[ml]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(sb,e.ondone):this.on(sb,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Sde,this.filter=typeof e.filter=="function"?e.filter:Ede,this.writable=!0,this.readable=!1,this[zs]=new xde,this[dt]=null,this[Ws]=null,this[dl]=null,this[tn]="begin",this[Vo]="",this[rn]=null,this[Ah]=null,this[hl]=!1,this[cr]=null,this[Go]=!1,this[ob]=!1,this[ab]=!1,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[u3](e,t){this[ml]===null&&(this[ml]=!1);let i;try{i=new yde(e,t,this[rn],this[Ah])}catch(n){return this.warn("TAR_ENTRY_INVALID",n)}if(i.nullBlock)this[ob]?(this[ab]=!0,this[tn]==="begin"&&(this[tn]="header"),this[pl]("eof")):(this[ob]=!0,this[pl]("nullBlock"));else if(this[ob]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let n=i.type;if(/^(Symbolic)?Link$/.test(n)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(n)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let s=this[dl]=new Cde(i,this[rn],this[Ah]);if(!this[ml])if(s.remain){let o=()=>{s.invalid||(this[ml]=!0)};s.on("end",o)}else this[ml]=!0;s.meta?s.size>this.maxMetaEntrySize?(s.ignore=!0,this[pl]("ignoredEntry",s),this[tn]="ignore",s.resume()):s.size>0&&(this[Vo]="",s.on("data",o=>this[Vo]+=o),this[tn]="meta"):(this[rn]=null,s.ignore=s.ignore||!this.filter(s.path,s),s.ignore?(this[pl]("ignoredEntry",s),this[tn]=s.remain?"ignore":"header",s.resume()):(s.remain?this[tn]="body":(this[tn]="header",s.end()),this[Ws]?this[zs].push(s):(this[zs].push(s),this[JE]())))}}}[o3](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Ws]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",i=>this[JE]()),t=!1)):(this[Ws]=null,t=!1),t}[JE](){do;while(this[o3](this[zs].shift()));if(!this[zs].length){let e=this[Ws];!e||e.flowing||e.size===e.remain?this[Fh]||this.emit("drain"):e.once("drain",i=>this.emit("drain"))}}[YE](e,t){let i=this[dl],n=i.blockRemain,s=n>=e.length&&t===0?e:e.slice(t,t+n);return i.write(s),i.blockRemain||(this[tn]="header",this[dl]=null,i.end()),s.length}[c3](e,t){let i=this[dl],n=this[YE](e,t);return this[dl]||this[a3](i),n}[pl](e,t,i){!this[zs].length&&!this[Ws]?this.emit(e,t,i):this[zs].push([e,t,i])}[a3](e){switch(this[pl]("meta",this[Vo]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[rn]=s3.parse(this[Vo],this[rn],!1);break;case"GlobalExtendedHeader":this[Ah]=s3.parse(this[Vo],this[Ah],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[rn]=this[rn]||Object.create(null),this[rn].path=this[Vo].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[rn]=this[rn]||Object.create(null),this[rn].linkpath=this[Vo].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Go]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[Go])return;if(this[cr]===null&&e){if(this[dt]&&(e=Buffer.concat([this[dt],e]),this[dt]=null),e.length<KE.length)return this[dt]=e,!0;for(let i=0;this[cr]===null&&i<KE.length;i++)e[i]!==KE[i]&&(this[cr]=!1);if(this[cr]===null){let i=this[hl];this[hl]=!1,this[cr]=new _de.Unzip,this[cr].on("data",s=>this[ib](s)),this[cr].on("error",s=>this.abort(s)),this[cr].on("end",s=>{this[hl]=!0,this[ib]()}),this[Fh]=!0;let n=this[cr][i?"end":"write"](e);return this[Fh]=!1,n}}this[Fh]=!0,this[cr]?this[cr].write(e):this[ib](e),this[Fh]=!1;let t=this[zs].length?!1:this[Ws]?this[Ws].flowing:!0;return!t&&!this[zs].length&&this[Ws].once("drain",i=>this.emit("drain")),t}[XE](e){e&&!this[Go]&&(this[dt]=this[dt]?Buffer.concat([this[dt],e]):e)}[ZE](){if(this[hl]&&!this[l3]&&!this[Go]&&!this[nb]){this[l3]=!0;let e=this[dl];if(e&&e.blockRemain){let t=this[dt]?this[dt].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[dt]&&e.write(this[dt]),e.end()}this[pl](sb)}}[ib](e){if(this[nb])this[XE](e);else if(!e&&!this[dt])this[ZE]();else{if(this[nb]=!0,this[dt]){this[XE](e);let t=this[dt];this[dt]=null,this[rb](t)}else this[rb](e);for(;this[dt]&&this[dt].length>=512&&!this[Go]&&!this[ab];){let t=this[dt];this[dt]=null,this[rb](t)}this[nb]=!1}(!this[dt]||this[hl])&&this[ZE]()}[rb](e){let t=0,i=e.length;for(;t+512<=i&&!this[Go]&&!this[ab];)switch(this[tn]){case"begin":case"header":this[u3](e,t),t+=512;break;case"ignore":case"body":t+=this[YE](e,t);break;case"meta":t+=this[c3](e,t);break;default:throw new Error("invalid state: "+this[tn])}t<i&&(this[dt]?this[dt]=Buffer.concat([e.slice(t),this[dt]]):this[dt]=e.slice(t))}end(e){this[Go]||(this[cr]?this[cr].end(e):(this[hl]=!0,this.write(e)))}})});var cb=x((zDe,m3)=>{"use strict";var Tde=fu(),d3=lb(),Du=require("fs"),Dde=Tu(),h3=require("path"),QE=vu();m3.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let i=Tde(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&Pde(i,e),i.noResume||Rde(i),i.file&&i.sync?kde(i):i.file?Ide(i,t):p3(i)};var Rde=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},Pde=(r,e)=>{let t=new Map(e.map(s=>[QE(s),!0])),i=r.filter,n=(s,o)=>{let a=o||h3.parse(s).root||".",l=s===a?!1:t.has(s)?t.get(s):n(h3.dirname(s),a);return t.set(s,l),l};r.filter=i?(s,o)=>i(s,o)&&n(QE(s)):s=>n(QE(s))},kde=r=>{let e=p3(r),t=r.file,i=!0,n;try{let s=Du.statSync(t),o=r.maxReadSize||16*1024*1024;if(s.size<o)e.end(Du.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(n=Du.openSync(t,"r");a<s.size;){let c=Du.readSync(n,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}i=!1}finally{if(i&&n)try{Du.closeSync(n)}catch(s){}}},Ide=(r,e)=>{let t=new d3(r),i=r.maxReadSize||16*1024*1024,n=r.file,s=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Du.stat(n,(l,c)=>{if(l)a(l);else{let u=new Dde.ReadStream(n,{readSize:i,size:c.size});u.on("error",a),u.pipe(t)}})});return e?s.then(e,e):s},p3=r=>new d3(r)});var x3=x((VDe,w3)=>{"use strict";var Ode=fu(),ub=Yv(),g3=Tu(),v3=cb(),b3=require("path");w3.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let i=Ode(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return i.file&&i.sync?Lde(i,e):i.file?Ade(i,e,t):i.sync?Fde(i,e):Mde(i,e)};var Lde=(r,e)=>{let t=new ub.Sync(r),i=new g3.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(i),y3(t,e)},Ade=(r,e,t)=>{let i=new ub(r),n=new g3.WriteStream(r.file,{mode:r.mode||438});i.pipe(n);let s=new Promise((o,a)=>{n.on("error",a),n.on("close",o),i.on("error",a)});return eT(i,e),t?s.then(t,t):s},y3=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?v3({file:b3.resolve(r.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:i=>r.add(i)}):r.add(t)}),r.end()},eT=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return v3({file:b3.resolve(r.cwd,t.substr(1)),noResume:!0,onentry:i=>r.add(i)}).then(i=>eT(r,e));r.add(t)}r.end()},Fde=(r,e)=>{let t=new ub.Sync(r);return y3(t,e),t},Mde=(r,e)=>{let t=new ub(r);return eT(t,e),t}});var tT=x((GDe,R3)=>{"use strict";var Nde=fu(),S3=Yv(),Pr=require("fs"),C3=Tu(),_3=cb(),E3=require("path"),T3=gu();R3.exports=(r,e,t)=>{let i=Nde(r);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),i.sync?qde(i,e):Bde(i,e,t)};var qde=(r,e)=>{let t=new S3.Sync(r),i=!0,n,s;try{try{n=Pr.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")n=Pr.openSync(r.file,"w+");else throw l}let o=Pr.fstatSync(n),a=Buffer.alloc(512);e:for(s=0;s<o.size;s+=512){for(let u=0,f=0;u<512;u+=f){if(f=Pr.readSync(n,a,u,a.length-u,s+u),s===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!f)break e}let l=new T3(a);if(!l.cksumValid)break;let c=512*Math.ceil(l.size/512);if(s+c+512>o.size)break;s+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}i=!1,$de(r,t,s,n,e)}finally{if(i)try{Pr.closeSync(n)}catch(o){}}},$de=(r,e,t,i,n)=>{let s=new C3.WriteStreamSync(r.file,{fd:i,start:t});e.pipe(s),jde(e,n)},Bde=(r,e,t)=>{e=Array.from(e);let i=new S3(r),n=(o,a,l)=>{let c=(p,g)=>{p?Pr.close(o,b=>l(p)):l(null,g)},u=0;if(a===0)return c(null,0);let f=0,d=Buffer.alloc(512),h=(p,g)=>{if(p)return c(p);if(f+=g,f<512&&g)return Pr.read(o,d,f,d.length-f,u+f,h);if(u===0&&d[0]===31&&d[1]===139)return c(new Error("cannot append to compressed archives"));if(f<512)return c(null,u);let b=new T3(d);if(!b.cksumValid)return c(null,u);let y=512*Math.ceil(b.size/512);if(u+y+512>a||(u+=y+512,u>=a))return c(null,u);r.mtimeCache&&r.mtimeCache.set(b.path,b.mtime),f=0,Pr.read(o,d,0,512,u,h)};Pr.read(o,d,0,512,u,h)},s=new Promise((o,a)=>{i.on("error",a);let l="r+",c=(u,f)=>{if(u&&u.code==="ENOENT"&&l==="r+")return l="w+",Pr.open(r.file,l,c);if(u)return a(u);Pr.fstat(f,(d,h)=>{if(d)return Pr.close(f,()=>a(d));n(f,h.size,(p,g)=>{if(p)return a(p);let b=new C3.WriteStream(r.file,{fd:f,start:g});i.pipe(b),b.on("error",a),b.on("close",o),D3(i,e)})})};Pr.open(r.file,l,c)});return t?s.then(t,t):s},jde=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?_3({file:E3.resolve(r.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:i=>r.add(i)}):r.add(t)}),r.end()},D3=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return _3({file:E3.resolve(r.cwd,t.substr(1)),noResume:!0,onentry:i=>r.add(i)}).then(i=>D3(r,e));r.add(t)}r.end()}});var k3=x((KDe,P3)=>{"use strict";var Ude=fu(),Hde=tT();P3.exports=(r,e,t)=>{let i=Ude(r);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),Wde(i),Hde(i,e,t)};var Wde=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,i)=>e(t,i)&&!(r.mtimeCache.get(t)>i.mtime):(t,i)=>!(r.mtimeCache.get(t)>i.mtime)}});var L3=x((JDe,O3)=>{var{promisify:I3}=require("util"),Ko=require("fs"),zde=r=>{if(!r)r={mode:511,fs:Ko};else if(typeof r=="object")r=ut({mode:511,fs:Ko},r);else if(typeof r=="number")r={mode:r,fs:Ko};else if(typeof r=="string")r={mode:parseInt(r,8),fs:Ko};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||Ko.mkdir,r.mkdirAsync=I3(r.mkdir),r.stat=r.stat||r.fs.stat||Ko.stat,r.statAsync=I3(r.stat),r.statSync=r.statSync||r.fs.statSync||Ko.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||Ko.mkdirSync,r};O3.exports=zde});var F3=x((YDe,A3)=>{var Vde=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Gde,parse:Kde}=require("path"),Jde=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=Gde(r),Vde==="win32"){let e=/[*|"<>?:]/,{root:t}=Kde(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};A3.exports=Jde});var B3=x((XDe,$3)=>{var{dirname:M3}=require("path"),N3=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(i=>i.isDirectory()?t:void 0,i=>i.code==="ENOENT"?N3(r,M3(e),e):void 0),q3=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(i){return i.code==="ENOENT"?q3(r,M3(e),e):void 0}};$3.exports={findMade:N3,findMadeSync:q3}});var nT=x((ZDe,U3)=>{var{dirname:j3}=require("path"),iT=(r,e,t)=>{e.recursive=!1;let i=j3(r);return i===r?e.mkdirAsync(r,e).catch(n=>{if(n.code!=="EISDIR")throw n}):e.mkdirAsync(r,e).then(()=>t||r,n=>{if(n.code==="ENOENT")return iT(i,e).then(s=>iT(r,e,s));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;return e.statAsync(r).then(s=>{if(s.isDirectory())return t;throw n},()=>{throw n})})},rT=(r,e,t)=>{let i=j3(r);if(e.recursive=!1,i===r)try{return e.mkdirSync(r,e)}catch(n){if(n.code!=="EISDIR")throw n;return}try{return e.mkdirSync(r,e),t||r}catch(n){if(n.code==="ENOENT")return rT(r,e,rT(i,e,t));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;try{if(!e.statSync(r).isDirectory())throw n}catch(s){throw n}}};U3.exports={mkdirpManual:iT,mkdirpManualSync:rT}});var z3=x((QDe,W3)=>{var{dirname:H3}=require("path"),{findMade:Yde,findMadeSync:Xde}=B3(),{mkdirpManual:Zde,mkdirpManualSync:Qde}=nT(),ehe=(r,e)=>(e.recursive=!0,H3(r)===r?e.mkdirAsync(r,e):Yde(e,r).then(i=>e.mkdirAsync(r,e).then(()=>i).catch(n=>{if(n.code==="ENOENT")return Zde(r,e);throw n}))),the=(r,e)=>{if(e.recursive=!0,H3(r)===r)return e.mkdirSync(r,e);let i=Xde(e,r);try{return e.mkdirSync(r,e),i}catch(n){if(n.code==="ENOENT")return Qde(r,e);throw n}};W3.exports={mkdirpNative:ehe,mkdirpNativeSync:the}});var J3=x((eRe,K3)=>{var V3=require("fs"),ihe=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,sT=ihe.replace(/^v/,"").split("."),G3=+sT[0]>10||+sT[0]==10&&+sT[1]>=12,rhe=G3?r=>r.mkdir===V3.mkdir:()=>!1,nhe=G3?r=>r.mkdirSync===V3.mkdirSync:()=>!1;K3.exports={useNative:rhe,useNativeSync:nhe}});var tz=x((tRe,ez)=>{var Ru=L3(),Pu=F3(),{mkdirpNative:Y3,mkdirpNativeSync:X3}=z3(),{mkdirpManual:Z3,mkdirpManualSync:Q3}=nT(),{useNative:she,useNativeSync:ohe}=J3(),ku=(r,e)=>(r=Pu(r),e=Ru(e),she(e)?Y3(r,e):Z3(r,e)),ahe=(r,e)=>(r=Pu(r),e=Ru(e),ohe(e)?X3(r,e):Q3(r,e));ku.sync=ahe;ku.native=(r,e)=>Y3(Pu(r),Ru(e));ku.manual=(r,e)=>Z3(Pu(r),Ru(e));ku.nativeSync=(r,e)=>X3(Pu(r),Ru(e));ku.manualSync=(r,e)=>Q3(Pu(r),Ru(e));ez.exports=ku});var lz=x((iRe,az)=>{"use strict";var nn=require("fs"),gl=require("path"),lhe=nn.lchown?"lchown":"chown",che=nn.lchownSync?"lchownSync":"chownSync",iz=nn.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),rz=(r,e,t)=>{try{return nn[che](r,e,t)}catch(i){if(i.code!=="ENOENT")throw i}},uhe=(r,e,t)=>{try{return nn.chownSync(r,e,t)}catch(i){if(i.code!=="ENOENT")throw i}},fhe=iz?(r,e,t,i)=>n=>{!n||n.code!=="EISDIR"?i(n):nn.chown(r,e,t,i)}:(r,e,t,i)=>i,oT=iz?(r,e,t)=>{try{return rz(r,e,t)}catch(i){if(i.code!=="EISDIR")throw i;uhe(r,e,t)}}:(r,e,t)=>rz(r,e,t),dhe=process.version,nz=(r,e,t)=>nn.readdir(r,e,t),hhe=(r,e)=>nn.readdirSync(r,e);/^v4\./.test(dhe)&&(nz=(r,e,t)=>nn.readdir(r,t));var fb=(r,e,t,i)=>{nn[lhe](r,e,t,fhe(r,e,t,n=>{i(n&&n.code!=="ENOENT"?n:null)}))},sz=(r,e,t,i,n)=>{if(typeof e=="string")return nn.lstat(gl.resolve(r,e),(s,o)=>{if(s)return n(s.code!=="ENOENT"?s:null);o.name=e,sz(r,o,t,i,n)});if(e.isDirectory())aT(gl.resolve(r,e.name),t,i,s=>{if(s)return n(s);let o=gl.resolve(r,e.name);fb(o,t,i,n)});else{let s=gl.resolve(r,e.name);fb(s,t,i,n)}},aT=(r,e,t,i)=>{nz(r,{withFileTypes:!0},(n,s)=>{if(n){if(n.code==="ENOENT")return i();if(n.code!=="ENOTDIR"&&n.code!=="ENOTSUP")return i(n)}if(n||!s.length)return fb(r,e,t,i);let o=s.length,a=null,l=c=>{if(!a){if(c)return i(a=c);if(--o==0)return fb(r,e,t,i)}};s.forEach(c=>sz(r,c,e,t,l))})},phe=(r,e,t,i)=>{if(typeof e=="string")try{let n=nn.lstatSync(gl.resolve(r,e));n.name=e,e=n}catch(n){if(n.code==="ENOENT")return;throw n}e.isDirectory()&&oz(gl.resolve(r,e.name),t,i),oT(gl.resolve(r,e.name),t,i)},oz=(r,e,t)=>{let i;try{i=hhe(r,{withFileTypes:!0})}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR"||n.code==="ENOTSUP")return oT(r,e,t);throw n}return i&&i.length&&i.forEach(n=>phe(r,n,e,t)),oT(r,e,t)};az.exports=aT;aT.sync=oz});var dz=x((rRe,uT)=>{"use strict";var cz=tz(),sn=require("fs"),db=require("path"),uz=lz(),Fn=pu(),lT=class extends Error{constructor(e,t){super("Cannot extract through symbolic link");this.path=t,this.symlink=e}get name(){return"SylinkError"}},cT=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'");this.path=e,this.code=t}get name(){return"CwdError"}},hb=(r,e)=>r.get(Fn(e)),Mh=(r,e,t)=>r.set(Fn(e),t),mhe=(r,e)=>{sn.stat(r,(t,i)=>{(t||!i.isDirectory())&&(t=new cT(r,t&&t.code||"ENOTDIR")),e(t)})};uT.exports=(r,e,t)=>{r=Fn(r);let i=e.umask,n=e.mode|448,s=(n&i)!=0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,u=e.unlink,f=e.cache,d=Fn(e.cwd),h=(b,y)=>{b?t(b):(Mh(f,r,!0),y&&l?uz(y,o,a,S=>h(S)):s?sn.chmod(r,n,t):t())};if(f&&hb(f,r)===!0)return h();if(r===d)return mhe(r,h);if(c)return cz(r,{mode:n}).then(b=>h(null,b),h);let g=Fn(db.relative(d,r)).split("/");pb(d,g,n,f,u,d,null,h)};var pb=(r,e,t,i,n,s,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=Fn(db.resolve(r+"/"+l));if(hb(i,c))return pb(c,e,t,i,n,s,o,a);sn.mkdir(c,t,fz(c,e,t,i,n,s,o,a))},fz=(r,e,t,i,n,s,o,a)=>l=>{l?sn.lstat(r,(c,u)=>{if(c)c.path=c.path&&Fn(c.path),a(c);else if(u.isDirectory())pb(r,e,t,i,n,s,o,a);else if(n)sn.unlink(r,f=>{if(f)return a(f);sn.mkdir(r,t,fz(r,e,t,i,n,s,o,a))});else{if(u.isSymbolicLink())return a(new lT(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,pb(r,e,t,i,n,s,o,a))},ghe=r=>{let e=!1,t="ENOTDIR";try{e=sn.statSync(r).isDirectory()}catch(i){t=i.code}finally{if(!e)throw new cT(r,t)}};uT.exports.sync=(r,e)=>{r=Fn(r);let t=e.umask,i=e.mode|448,n=(i&t)!=0,s=e.uid,o=e.gid,a=typeof s=="number"&&typeof o=="number"&&(s!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,u=e.cache,f=Fn(e.cwd),d=b=>{Mh(u,r,!0),b&&a&&uz.sync(b,s,o),n&&sn.chmodSync(r,i)};if(u&&hb(u,r)===!0)return d();if(r===f)return ghe(f),d();if(l)return d(cz.sync(r,i));let p=Fn(db.relative(f,r)).split("/"),g=null;for(let b=p.shift(),y=f;b&&(y+="/"+b);b=p.shift())if(y=Fn(db.resolve(y)),!hb(u,y))try{sn.mkdirSync(y,i),g=g||y,Mh(u,y,!0)}catch(S){let w=sn.lstatSync(y);if(w.isDirectory()){Mh(u,y,!0);continue}else if(c){sn.unlinkSync(y),sn.mkdirSync(y,i),g=g||y,Mh(u,y,!0);continue}else if(w.isSymbolicLink())return new lT(y,y+"/"+p.join("/"))}return d(g)}});var dT=x((nRe,hz)=>{var fT=Object.create(null),{hasOwnProperty:vhe}=Object.prototype;hz.exports=r=>(vhe.call(fT,r)||(fT[r]=r.normalize("NFKD")),fT[r])});var vz=x((sRe,gz)=>{var pz=require("assert"),bhe=dT(),yhe=vu(),{join:mz}=require("path"),whe=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,xhe=whe==="win32";gz.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((f,d)=>(f.length&&(d=mz(f[f.length-1],d)),f.push(d||"/"),f),[]),i=new Set,n=c=>{let u=e.get(c);if(!u)throw new Error("function does not have any path reservations");return{paths:u.paths.map(f=>r.get(f)),dirs:[...u.dirs].map(f=>r.get(f))}},s=c=>{let{paths:u,dirs:f}=n(c);return u.every(d=>d[0]===c)&&f.every(d=>d[0]instanceof Set&&d[0].has(c))},o=c=>i.has(c)||!s(c)?!1:(i.add(c),c(()=>a(c)),!0),a=c=>{if(!i.has(c))return!1;let{paths:u,dirs:f}=e.get(c),d=new Set;return u.forEach(h=>{let p=r.get(h);pz.equal(p[0],c),p.length===1?r.delete(h):(p.shift(),typeof p[0]=="function"?d.add(p[0]):p[0].forEach(g=>d.add(g)))}),f.forEach(h=>{let p=r.get(h);pz(p[0]instanceof Set),p[0].size===1&&p.length===1?r.delete(h):p[0].size===1?(p.shift(),d.add(p[0])):p[0].delete(c)}),i.delete(c),d.forEach(h=>o(h)),!0};return{check:s,reserve:(c,u)=>{c=xhe?["win32 parallelization disabled"]:c.map(d=>bhe(yhe(mz(d))).toLowerCase());let f=new Set(c.map(d=>t(d)).reduce((d,h)=>d.concat(h)));return e.set(u,{dirs:f,paths:c}),c.forEach(d=>{let h=r.get(d);h?h.push(u):r.set(d,[u])}),f.forEach(d=>{let h=r.get(d);h?h[h.length-1]instanceof Set?h[h.length-1].add(u):h.push(new Set([u])):r.set(d,[new Set([u])])}),o(u)}}}});var wz=x((oRe,yz)=>{var She=process.env.__FAKE_PLATFORM__||process.platform,Che=She==="win32",_he=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:Ehe,O_TRUNC:The,O_WRONLY:Dhe,UV_FS_O_FILEMAP:bz=0}=_he.constants,Rhe=Che&&!!bz,Phe=512*1024,khe=bz|The|Ehe|Dhe;yz.exports=Rhe?r=>r<Phe?khe:"w":()=>"w"});var wT=x((aRe,Fz)=>{"use strict";var Ihe=require("assert"),Ohe=lb(),He=require("fs"),Lhe=Tu(),Vs=require("path"),xz=dz(),Sz=wE(),Ahe=vz(),Fhe=xE(),kr=pu(),Mhe=vu(),Nhe=dT(),Cz=Symbol("onEntry"),hT=Symbol("checkFs"),_z=Symbol("checkFs2"),mb=Symbol("pruneCache"),pT=Symbol("isReusable"),on=Symbol("makeFs"),mT=Symbol("file"),gT=Symbol("directory"),gb=Symbol("link"),Ez=Symbol("symlink"),Tz=Symbol("hardlink"),Dz=Symbol("unsupported"),Rz=Symbol("checkPath"),Jo=Symbol("mkdir"),Ii=Symbol("onError"),vb=Symbol("pending"),Pz=Symbol("pend"),Iu=Symbol("unpend"),vT=Symbol("ended"),bT=Symbol("maybeClose"),yT=Symbol("skip"),Nh=Symbol("doChown"),qh=Symbol("uid"),$h=Symbol("gid"),Bh=Symbol("checkedCwd"),kz=require("crypto"),Iz=wz(),qhe=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,jh=qhe==="win32",$he=(r,e)=>{if(!jh)return He.unlink(r,e);let t=r+".DELETE."+kz.randomBytes(16).toString("hex");He.rename(r,t,i=>{if(i)return e(i);He.unlink(t,e)})},Bhe=r=>{if(!jh)return He.unlinkSync(r);let e=r+".DELETE."+kz.randomBytes(16).toString("hex");He.renameSync(r,e),He.unlinkSync(e)},Oz=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,Lz=r=>Nhe(Mhe(kr(r))).toLowerCase(),jhe=(r,e)=>{e=Lz(e);for(let t of r.keys()){let i=Lz(t);(i===e||i.indexOf(e+"/")===0)&&r.delete(t)}},Uhe=r=>{for(let e of r.keys())r.delete(e)},bb=class extends Ohe{constructor(e){if(e||(e={}),e.ondone=t=>{this[vT]=!0,this[bT]()},super(e),this[Bh]=!1,this.reservations=Ahe(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[vb]=0,this[vT]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||jh,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=kr(Vs.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Cz](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[bT](){this[vT]&&this[vb]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close"))}[Rz](e){if(this.strip){let t=kr(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let i=kr(e.linkpath).split("/");if(i.length>=this.strip)e.linkpath=i.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=kr(e.path),i=t.split("/");if(i.includes("..")||jh&&/^[a-z]:\.\.$/i.test(i[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[n,s]=Fhe(t);n&&(e.path=s,this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:e,path:t}))}if(Vs.isAbsolute(e.path)?e.absolute=kr(Vs.resolve(e.path)):e.absolute=kr(Vs.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:kr(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=Vs.win32.parse(e.absolute);e.absolute=t+Sz.encode(e.absolute.substr(t.length));let{root:i}=Vs.win32.parse(e.path);e.path=i+Sz.encode(e.path.substr(i.length))}return!0}[Cz](e){if(!this[Rz](e))return e.resume();switch(Ihe.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[hT](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Dz](e)}}[Ii](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[Iu](),t.resume())}[Jo](e,t,i){xz(kr(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},i)}[Nh](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[qh](e){return Oz(this.uid,e.uid,this.processUid)}[$h](e){return Oz(this.gid,e.gid,this.processGid)}[mT](e,t){let i=e.mode&4095||this.fmode,n=new Lhe.WriteStream(e.absolute,{flags:Iz(e.size),mode:i,autoClose:!1});n.on("error",l=>{n.fd&&He.close(n.fd,()=>{}),n.write=()=>!0,this[Ii](l,e),t()});let s=1,o=l=>{if(l){n.fd&&He.close(n.fd,()=>{}),this[Ii](l,e),t();return}--s==0&&He.close(n.fd,c=>{c?this[Ii](c,e):this[Iu](),t()})};n.on("finish",l=>{let c=e.absolute,u=n.fd;if(e.mtime&&!this.noMtime){s++;let f=e.atime||new Date,d=e.mtime;He.futimes(u,f,d,h=>h?He.utimes(c,f,d,p=>o(p&&h)):o())}if(this[Nh](e)){s++;let f=this[qh](e),d=this[$h](e);He.fchown(u,f,d,h=>h?He.chown(c,f,d,p=>o(p&&h)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[Ii](l,e),t()}),e.pipe(a)),a.pipe(n)}[gT](e,t){let i=e.mode&4095||this.dmode;this[Jo](e.absolute,i,n=>{if(n){this[Ii](n,e),t();return}let s=1,o=a=>{--s==0&&(t(),this[Iu](),e.resume())};e.mtime&&!this.noMtime&&(s++,He.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[Nh](e)&&(s++,He.chown(e.absolute,this[qh](e),this[$h](e),o)),o()})}[Dz](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Ez](e,t){this[gb](e,e.linkpath,"symlink",t)}[Tz](e,t){let i=kr(Vs.resolve(this.cwd,e.linkpath));this[gb](e,i,"link",t)}[Pz](){this[vb]++}[Iu](){this[vb]--,this[bT]()}[yT](e){this[Iu](),e.resume()}[pT](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!jh}[hT](e){this[Pz]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[_z](e,i))}[mb](e){e.type==="SymbolicLink"?Uhe(this.dirCache):e.type!=="Directory"&&jhe(this.dirCache,e.absolute)}[_z](e,t){this[mb](e);let i=a=>{this[mb](e),t(a)},n=()=>{this[Jo](this.cwd,this.dmode,a=>{if(a){this[Ii](a,e),i();return}this[Bh]=!0,s()})},s=()=>{if(e.absolute!==this.cwd){let a=kr(Vs.dirname(e.absolute));if(a!==this.cwd)return this[Jo](a,this.dmode,l=>{if(l){this[Ii](l,e),i();return}o()})}o()},o=()=>{He.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[yT](e),i();return}if(a||this[pT](e,l))return this[on](null,e,i);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,u=f=>this[on](f,e,i);return c?He.chmod(e.absolute,e.mode,u):u()}if(e.absolute!==this.cwd)return He.rmdir(e.absolute,c=>this[on](c,e,i))}if(e.absolute===this.cwd)return this[on](null,e,i);$he(e.absolute,c=>this[on](c,e,i))})};this[Bh]?s():n()}[on](e,t,i){if(e){this[Ii](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[mT](t,i);case"Link":return this[Tz](t,i);case"SymbolicLink":return this[Ez](t,i);case"Directory":case"GNUDumpDir":return this[gT](t,i)}}[gb](e,t,i,n){He[i](t,e.absolute,s=>{s?this[Ii](s,e):(this[Iu](),e.resume()),n()})}},yb=r=>{try{return[null,r()]}catch(e){return[e,null]}},Az=class extends bb{[on](e,t){return super[on](e,t,()=>{})}[hT](e){if(this[mb](e),!this[Bh]){let s=this[Jo](this.cwd,this.dmode);if(s)return this[Ii](s,e);this[Bh]=!0}if(e.absolute!==this.cwd){let s=kr(Vs.dirname(e.absolute));if(s!==this.cwd){let o=this[Jo](s,this.dmode);if(o)return this[Ii](o,e)}}let[t,i]=yb(()=>He.lstatSync(e.absolute));if(i&&(this.keep||this.newer&&i.mtime>e.mtime))return this[yT](e);if(t||this[pT](e,i))return this[on](null,e);if(i.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(i.mode&4095)!==e.mode,[a]=o?yb(()=>{He.chmodSync(e.absolute,e.mode)}):[];return this[on](a,e)}let[s]=yb(()=>He.rmdirSync(e.absolute));this[on](s,e)}let[n]=e.absolute===this.cwd?[]:yb(()=>Bhe(e.absolute));this[on](n,e)}[mT](e,t){let i=e.mode&4095||this.fmode,n=a=>{let l;try{He.closeSync(s)}catch(c){l=c}(a||l)&&this[Ii](a||l,e),t()},s;try{s=He.openSync(e.absolute,Iz(e.size),i)}catch(a){return n(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[Ii](a,e)),e.pipe(o)),o.on("data",a=>{try{He.writeSync(s,a,0,a.length)}catch(l){n(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,u=e.mtime;try{He.futimesSync(s,c,u)}catch(f){try{He.utimesSync(e.absolute,c,u)}catch(d){l=f}}}if(this[Nh](e)){let c=this[qh](e),u=this[$h](e);try{He.fchownSync(s,c,u)}catch(f){try{He.chownSync(e.absolute,c,u)}catch(d){l=l||f}}}n(l)})}[gT](e,t){let i=e.mode&4095||this.dmode,n=this[Jo](e.absolute,i);if(n){this[Ii](n,e),t();return}if(e.mtime&&!this.noMtime)try{He.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch(s){}if(this[Nh](e))try{He.chownSync(e.absolute,this[qh](e),this[$h](e))}catch(s){}t(),e.resume()}[Jo](e,t){try{return xz.sync(kr(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(i){return i}}[gb](e,t,i,n){try{He[i+"Sync"](t,e.absolute),n(),e.resume()}catch(s){return this[Ii](s,e)}}};bb.Sync=Az;Fz.exports=bb});var Bz=x((lRe,$z)=>{"use strict";var Hhe=fu(),wb=wT(),Mz=require("fs"),Nz=Tu(),qz=require("path"),xT=vu();$z.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let i=Hhe(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&Whe(i,e),i.file&&i.sync?zhe(i):i.file?Vhe(i,t):i.sync?Ghe(i):Khe(i)};var Whe=(r,e)=>{let t=new Map(e.map(s=>[xT(s),!0])),i=r.filter,n=(s,o)=>{let a=o||qz.parse(s).root||".",l=s===a?!1:t.has(s)?t.get(s):n(qz.dirname(s),a);return t.set(s,l),l};r.filter=i?(s,o)=>i(s,o)&&n(xT(s)):s=>n(xT(s))},zhe=r=>{let e=new wb.Sync(r),t=r.file,i=Mz.statSync(t),n=r.maxReadSize||16*1024*1024;new Nz.ReadStreamSync(t,{readSize:n,size:i.size}).pipe(e)},Vhe=(r,e)=>{let t=new wb(r),i=r.maxReadSize||16*1024*1024,n=r.file,s=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Mz.stat(n,(l,c)=>{if(l)a(l);else{let u=new Nz.ReadStream(n,{readSize:i,size:c.size});u.on("error",a),u.pipe(t)}})});return e?s.then(e,e):s},Ghe=r=>new wb.Sync(r),Khe=r=>new wb(r)});var jz=x(Zt=>{"use strict";Zt.c=Zt.create=x3();Zt.r=Zt.replace=tT();Zt.t=Zt.list=cb();Zt.u=Zt.update=k3();Zt.x=Zt.extract=Bz();Zt.Pack=Yv();Zt.Unpack=wT();Zt.Parse=lb();Zt.ReadEntry=Lv();Zt.WriteEntry=kE();Zt.Header=gu();Zt.Pax=Mv();Zt.types=pE()});var zz=x((uRe,Wz)=>{Wz.exports=Oi;function Oi(r){if(!(this instanceof Oi))return new Oi(r);this.value=r}Oi.prototype.get=function(r){for(var e=this.value,t=0;t<r.length;t++){var i=r[t];if(!Object.hasOwnProperty.call(e,i)){e=void 0;break}e=e[i]}return e};Oi.prototype.set=function(r,e){for(var t=this.value,i=0;i<r.length-1;i++){var n=r[i];Object.hasOwnProperty.call(t,n)||(t[n]={}),t=t[n]}return t[r[i]]=e,e};Oi.prototype.map=function(r){return Uz(this.value,r,!0)};Oi.prototype.forEach=function(r){return this.value=Uz(this.value,r,!1),this.value};Oi.prototype.reduce=function(r,e){var t=arguments.length===1,i=t?this.value:e;return this.forEach(function(n){(!this.isRoot||!t)&&(i=r.call(this,i,n))}),i};Oi.prototype.deepEqual=function(r){if(arguments.length!==1)throw new Error("deepEqual requires exactly one object to compare against");var e=!0,t=r;return this.forEach(function(i){var n=function(){e=!1}.bind(this);if(!this.isRoot){if(typeof t!="object")return n();t=t[this.key]}var s=t;this.post(function(){t=s});var o=function(f){return Object.prototype.toString.call(f)};if(this.circular)Oi(r).get(this.circular.path)!==s&&n();else if(typeof s!=typeof i)n();else if(s===null||i===null||s===void 0||i===void 0)s!==i&&n();else if(s.__proto__!==i.__proto__)n();else if(s!==i){if(typeof s=="function")s instanceof RegExp?s.toString()!=i.toString()&&n():s!==i&&n();else if(typeof s=="object")if(o(i)==="[object Arguments]"||o(s)==="[object Arguments]")o(s)!==o(i)&&n();else if(s instanceof Date||i instanceof Date)(!(s instanceof Date)||!(i instanceof Date)||s.getTime()!==i.getTime())&&n();else{var a=Object.keys(s),l=Object.keys(i);if(a.length!==l.length)return n();for(var c=0;c<a.length;c++){var u=a[c];Object.hasOwnProperty.call(i,u)||n()}}}}),e};Oi.prototype.paths=function(){var r=[];return this.forEach(function(e){r.push(this.path)}),r};Oi.prototype.nodes=function(){var r=[];return this.forEach(function(e){r.push(this.node)}),r};Oi.prototype.clone=function(){var r=[],e=[];return function t(i){for(var n=0;n<r.length;n++)if(r[n]===i)return e[n];if(typeof i=="object"&&i!==null){var s=Hz(i);return r.push(i),e.push(s),Object.keys(i).forEach(function(o){s[o]=t(i[o])}),r.pop(),e.pop(),s}else return i}(this.value)};function Uz(r,e,t){var i=[],n=[],s=!0;return function o(a){var l=t?Hz(a):a,c={},u={node:l,node_:a,path:[].concat(i),parent:n.slice(-1)[0],key:i.slice(-1)[0],isRoot:i.length===0,level:i.length,circular:null,update:function(p){u.isRoot||(u.parent.node[u.key]=p),u.node=p},delete:function(){delete u.parent.node[u.key]},remove:function(){Array.isArray(u.parent.node)?u.parent.node.splice(u.key,1):delete u.parent.node[u.key]},before:function(p){c.before=p},after:function(p){c.after=p},pre:function(p){c.pre=p},post:function(p){c.post=p},stop:function(){s=!1}};if(!s)return u;if(typeof l=="object"&&l!==null){u.isLeaf=Object.keys(l).length==0;for(var f=0;f<n.length;f++)if(n[f].node_===a){u.circular=n[f];break}}else u.isLeaf=!0;u.notLeaf=!u.isLeaf,u.notRoot=!u.isRoot;var d=e.call(u,u.node);if(d!==void 0&&u.update&&u.update(d),c.before&&c.before.call(u,u.node),typeof u.node=="object"&&u.node!==null&&!u.circular){n.push(u);var h=Object.keys(u.node);h.forEach(function(p,g){i.push(p),c.pre&&c.pre.call(u,u.node[p],p);var b=o(u.node[p]);t&&Object.hasOwnProperty.call(u.node,p)&&(u.node[p]=b.node),b.isLast=g==h.length-1,b.isFirst=g==0,c.post&&c.post.call(u,b),i.pop()}),n.pop()}return c.after&&c.after.call(u,u.node),u}(r).node}Object.keys(Oi.prototype).forEach(function(r){Oi[r]=function(e){var t=[].slice.call(arguments,1),i=Oi(e);return i[r].apply(i,t)}});function Hz(r){if(typeof r=="object"&&r!==null){var e;return Array.isArray(r)?e=[]:r instanceof Date?e=new Date(r):r instanceof Boolean?e=new Boolean(r):r instanceof Number?e=new Number(r):r instanceof String?e=new String(r):e=Object.create(Object.getPrototypeOf(r)),Object.keys(r).forEach(function(t){e[t]=r[t]}),e}else return r}});var Gz=x((fRe,Vz)=>{var Jhe=zz(),Yhe=require("events").EventEmitter;Vz.exports=Ou;function Ou(r){var e=Ou.saw(r,{}),t=r.call(e.handlers,e);return t!==void 0&&(e.handlers=t),e.record(),e.chain()}Ou.light=function(e){var t=Ou.saw(e,{}),i=e.call(t.handlers,t);return i!==void 0&&(t.handlers=i),t.chain()};Ou.saw=function(r,e){var t=new Yhe;return t.handlers=e,t.actions=[],t.chain=function(){var i=Jhe(t.handlers).map(function(n){if(this.isRoot)return n;var s=this.path;typeof n=="function"&&this.update(function(){return t.actions.push({path:s,args:[].slice.call(arguments)}),i})});return process.nextTick(function(){t.emit("begin"),t.next()}),i},t.pop=function(){return t.actions.shift()},t.next=function(){var i=t.pop();if(!i)t.emit("end");else if(!i.trap){var n=t.handlers;i.path.forEach(function(s){n=n[s]}),n.apply(t.handlers,i.args)}},t.nest=function(i){var n=[].slice.call(arguments,1),s=!0;if(typeof i=="boolean"){var s=i;i=n.shift()}var o=Ou.saw(r,{}),a=r.call(o.handlers,o);a!==void 0&&(o.handlers=a),typeof t.step!="undefined"&&o.record(),i.apply(o.chain(),n),s!==!1&&o.on("end",t.next)},t.record=function(){Xhe(t)},["trap","down","jump"].forEach(function(i){t[i]=function(){throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.")}}),t};function Xhe(r){r.step=0,r.pop=function(){return r.actions[r.step++]},r.trap=function(e,t){var i=Array.isArray(e)?e:[e];r.actions.push({path:i,step:r.step,cb:t,trap:!0})},r.down=function(e){var t=(Array.isArray(e)?e:[e]).join("/"),i=r.actions.slice(r.step).map(function(s){return s.trap&&s.step<=r.step?!1:s.path.join("/")==t}).indexOf(!0);i>=0?r.step+=i:r.step=r.actions.length;var n=r.actions[r.step-1];n&&n.trap?(r.step=n.step,n.cb()):r.next()},r.jump=function(e){r.step=e,r.next()}}});var Jz=x((dRe,Kz)=>{Kz.exports=zi;function zi(r){if(!(this instanceof zi))return new zi(r);this.buffers=r||[],this.length=this.buffers.reduce(function(e,t){return e+t.length},0)}zi.prototype.push=function(){for(var r=0;r<arguments.length;r++)if(!Buffer.isBuffer(arguments[r]))throw new TypeError("Tried to push a non-buffer");for(var r=0;r<arguments.length;r++){var e=arguments[r];this.buffers.push(e),this.length+=e.length}return this.length};zi.prototype.unshift=function(){for(var r=0;r<arguments.length;r++)if(!Buffer.isBuffer(arguments[r]))throw new TypeError("Tried to unshift a non-buffer");for(var r=0;r<arguments.length;r++){var e=arguments[r];this.buffers.unshift(e),this.length+=e.length}return this.length};zi.prototype.copy=function(r,e,t,i){return this.slice(t,i).copy(r,e,0,i-t)};zi.prototype.splice=function(r,e){var t=this.buffers,i=r>=0?r:this.length-r,n=[].slice.call(arguments,2);e===void 0?e=this.length-i:e>this.length-i&&(e=this.length-i);for(var r=0;r<n.length;r++)this.length+=n[r].length;for(var s=new zi,o=0,a=0,l=0;l<t.length&&a+t[l].length<i;l++)a+=t[l].length;if(i-a>0){var c=i-a;if(c+e<t[l].length){s.push(t[l].slice(c,c+e));for(var u=t[l],f=new Buffer(c),r=0;r<c;r++)f[r]=u[r];for(var d=new Buffer(u.length-c-e),r=c+e;r<u.length;r++)d[r-e-c]=u[r];if(n.length>0){var h=n.slice();h.unshift(f),h.push(d),t.splice.apply(t,[l,1].concat(h)),l+=h.length,n=[]}else t.splice(l,1,f,d),l+=2}else s.push(t[l].slice(c)),t[l]=t[l].slice(0,c),l++}for(n.length>0&&(t.splice.apply(t,[l,0].concat(n)),l+=n.length);s.length<e;){var p=t[l],g=p.length,b=Math.min(g,e-s.length);b===g?(s.push(p),t.splice(l,1)):(s.push(p.slice(0,b)),t[l]=t[l].slice(b))}return this.length-=s.length,s};zi.prototype.slice=function(r,e){var t=this.buffers;e===void 0&&(e=this.length),r===void 0&&(r=0),e>this.length&&(e=this.length);for(var i=0,n=0;n<t.length&&i+t[n].length<=r;n++)i+=t[n].length;for(var s=new Buffer(e-r),o=0,a=n;o<e-r&&a<t.length;a++){var l=t[a].length,c=o===0?r-i:0,u=o+l>=e-r?Math.min(c+(e-r)-o,l):l;t[a].copy(s,o,c,u),o+=u-c}return s};zi.prototype.pos=function(r){if(r<0||r>=this.length)throw new Error("oob");for(var e=r,t=0,i=null;;){if(i=this.buffers[t],e<i.length)return{buf:t,offset:e};e-=i.length,t++}};zi.prototype.get=function(e){var t=this.pos(e);return this.buffers[t.buf].get(t.offset)};zi.prototype.set=function(e,t){var i=this.pos(e);return this.buffers[i.buf].set(i.offset,t)};zi.prototype.indexOf=function(r,e){if(typeof r=="string")r=new Buffer(r);else if(!(r instanceof Buffer))throw new Error("Invalid type for a search string");if(!r.length)return 0;if(!this.length)return-1;var t=0,i=0,n=0,s,o=0;if(e){var a=this.pos(e);t=a.buf,i=a.offset,o=e}for(;;){for(;i>=this.buffers[t].length;)if(i=0,t++,t>=this.buffers.length)return-1;var l=this.buffers[t][i];if(l==r[n]){if(n==0&&(s={i:t,j:i,pos:o}),n++,n==r.length)return s.pos}else n!=0&&(t=s.i,i=s.j,o=s.pos,n=0);i++,o++}};zi.prototype.toBuffer=function(){return this.slice()};zi.prototype.toString=function(r,e,t){return this.slice(e,t).toString(r)}});var Xz=x((hRe,Yz)=>{Yz.exports=function(r){function e(i,n){var s=t.store,o=i.split(".");o.slice(0,-1).forEach(function(l){s[l]===void 0&&(s[l]={}),s=s[l]});var a=o[o.length-1];return arguments.length==1?s[a]:s[a]=n}var t={get:function(i){return e(i)},set:function(i,n){return e(i,n)},store:r||{}};return t}});var r4=x((vl,i4)=>{var Zhe=Gz(),Zz=require("events").EventEmitter,Qhe=Jz(),xb=Xz(),epe=require("stream").Stream;vl=i4.exports=function(r,e){if(Buffer.isBuffer(r))return vl.parse(r);var t=vl.stream();return r&&r.pipe?r.pipe(t):r&&(r.on(e||"data",function(i){t.write(i)}),r.on("end",function(){t.end()})),t};vl.stream=function(r){if(r)return vl.apply(null,arguments);var e=null;function t(f,d,h){e={bytes:f,skip:h,cb:function(p){e=null,d(p)}},n()}var i=null;function n(){if(!e){u&&(c=!0);return}if(typeof e=="function")e();else{var f=i+e.bytes;if(a.length>=f){var d;i==null?(d=a.splice(0,f),e.skip||(d=d.slice())):(e.skip||(d=a.slice(i,f)),i=f),e.skip?e.cb():e.cb(d)}}}function s(f){function d(){c||f.next()}var h=t4(function(p,g){return function(b){t(p,function(y){l.set(b,g(y)),d()})}});return h.tap=function(p){f.nest(p,l.store)},h.into=function(p,g){l.get(p)||l.set(p,{});var b=l;l=xb(b.get(p)),f.nest(function(){g.apply(this,arguments),this.tap(function(){l=b})},l.store)},h.flush=function(){l.store={},d()},h.loop=function(p){var g=!1;f.nest(!1,function b(){this.vars=l.store,p.call(this,function(){g=!0,d()},l.store),this.tap(function(){g?f.next():b.call(this)}.bind(this))},l.store)},h.buffer=function(p,g){typeof g=="string"&&(g=l.get(g)),t(g,function(b){l.set(p,b),d()})},h.skip=function(p){typeof p=="string"&&(p=l.get(p)),t(p,function(){d()})},h.scan=function(g,b){if(typeof b=="string")b=new Buffer(b);else if(!Buffer.isBuffer(b))throw new Error("search must be a Buffer or a string");var y=0;e=function(){var S=a.indexOf(b,i+y),w=S-i-y;S!==-1?(e=null,i!=null?(l.set(g,a.slice(i,i+y+w)),i+=y+w+b.length):(l.set(g,a.slice(0,y+w)),a.splice(0,y+w+b.length)),d(),n()):w=Math.max(a.length-b.length-i-y,0),y+=w},n()},h.peek=function(p){i=0,f.nest(function(){p.call(this,l.store),this.tap(function(){i=null})})},h}var o=Zhe.light(s);o.writable=!0;var a=Qhe();o.write=function(f){a.push(f),n()};var l=xb(),c=!1,u=!1;return o.end=function(){u=!0},o.pipe=epe.prototype.pipe,Object.getOwnPropertyNames(Zz.prototype).forEach(function(f){o[f]=Zz.prototype[f]}),o};vl.parse=function(e){var t=t4(function(s,o){return function(a){if(i+s<=e.length){var l=e.slice(i,i+s);i+=s,n.set(a,o(l))}else n.set(a,null);return t}}),i=0,n=xb();return t.vars=n.store,t.tap=function(s){return s.call(t,n.store),t},t.into=function(s,o){n.get(s)||n.set(s,{});var a=n;return n=xb(a.get(s)),o.call(t,n.store),n=a,t},t.loop=function(s){for(var o=!1,a=function(){o=!0};o===!1;)s.call(t,a,n.store);return t},t.buffer=function(s,o){typeof o=="string"&&(o=n.get(o));var a=e.slice(i,Math.min(e.length,i+o));return i+=o,n.set(s,a),t},t.skip=function(s){return typeof s=="string"&&(s=n.get(s)),i+=s,t},t.scan=function(s,o){if(typeof o=="string")o=new Buffer(o);else if(!Buffer.isBuffer(o))throw new Error("search must be a Buffer or a string");n.set(s,null);for(var a=0;a+i<=e.length-o.length+1;a++){for(var l=0;l<o.length&&e[i+a+l]===o[l];l++);if(l===o.length)break}return n.set(s,e.slice(i,i+a)),i+=a+o.length,t},t.peek=function(s){var o=i;return s.call(t,n.store),i=o,t},t.flush=function(){return n.store={},t},t.eof=function(){return i>=e.length},t};function Qz(r){for(var e=0,t=0;t<r.length;t++)e+=Math.pow(256,t)*r[t];return e}function e4(r){for(var e=0,t=0;t<r.length;t++)e+=Math.pow(256,r.length-t-1)*r[t];return e}function tpe(r){var e=e4(r);return(r[0]&128)==128&&(e-=Math.pow(256,r.length)),e}function ipe(r){var e=Qz(r);return(r[r.length-1]&128)==128&&(e-=Math.pow(256,r.length)),e}function t4(r){var e={};return[1,2,4,8].forEach(function(t){var i=t*8;e["word"+i+"le"]=e["word"+i+"lu"]=r(t,Qz),e["word"+i+"ls"]=r(t,ipe),e["word"+i+"be"]=e["word"+i+"bu"]=r(t,e4),e["word"+i+"bs"]=r(t,tpe)}),e.word8=e.word8u=e.word8be,e.word8s=e.word8bs,e}});var o4=x((pRe,s4)=>{var n4=require("stream").Transform,rpe=require("util");function bl(r,e){if(!(this instanceof bl))return new bl;n4.call(this);var t=typeof r=="object"?r.pattern:r;this.pattern=Buffer.isBuffer(t)?t:Buffer.from(t),this.requiredLength=this.pattern.length,r.requiredExtraSize&&(this.requiredLength+=r.requiredExtraSize),this.data=new Buffer(""),this.bytesSoFar=0,this.matchFn=e}rpe.inherits(bl,n4);bl.prototype.checkDataChunk=function(r){var e=this.data.length>=this.requiredLength;if(!!e){var t=this.data.indexOf(this.pattern,r?1:0);if(t>=0&&t+this.requiredLength>this.data.length){if(t>0){var i=this.data.slice(0,t);this.push(i),this.bytesSoFar+=t,this.data=this.data.slice(t)}return}if(t===-1){var n=this.data.length-this.requiredLength+1,i=this.data.slice(0,n);this.push(i),this.bytesSoFar+=n,this.data=this.data.slice(n);return}if(t>0){var i=this.data.slice(0,t);this.data=this.data.slice(t),this.push(i),this.bytesSoFar+=t}var s=this.matchFn?this.matchFn(this.data,this.bytesSoFar):!0;if(s){this.data=new Buffer("");return}return!0}};bl.prototype._transform=function(r,e,t){this.data=Buffer.concat([this.data,r]);for(var i=!0;this.checkDataChunk(!i);)i=!1;t()};bl.prototype._flush=function(r){if(this.data.length>0)for(var e=!0;this.checkDataChunk(!e);)e=!1;this.data.length>0&&(this.push(this.data),this.data=null),r()};s4.exports=bl});var l4=x((mRe,a4)=>{"use strict";var ST=require("stream"),npe=require("util").inherits;function Uh(){if(!(this instanceof Uh))return new Uh;ST.PassThrough.call(this),this.path=null,this.type=null,this.isDirectory=!1}npe(Uh,ST.PassThrough);Uh.prototype.autodrain=function(){return this.pipe(new ST.Transform({transform:function(r,e,t){t()}}))};a4.exports=Uh});var _T=x((gRe,u4)=>{"use strict";var Yo=r4(),CT=require("stream"),spe=require("util"),ope=require("zlib"),ape=o4(),c4=l4(),fe={STREAM_START:0,START:1,LOCAL_FILE_HEADER:2,LOCAL_FILE_HEADER_SUFFIX:3,FILE_DATA:4,FILE_DATA_END:5,DATA_DESCRIPTOR:6,CENTRAL_DIRECTORY_FILE_HEADER:7,CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:8,CDIR64_END:9,CDIR64_END_DATA_SECTOR:10,CDIR64_LOCATOR:11,CENTRAL_DIRECTORY_END:12,CENTRAL_DIRECTORY_END_COMMENT:13,TRAILING_JUNK:14,ERROR:99},Hh=4294967296,lpe=67324752,cpe=134695760,upe=33639248,fpe=101075792,dpe=117853008,hpe=101010256;function mi(r){if(!(this instanceof mi))return new mi(r);CT.Transform.call(this),this.options=r||{},this.data=new Buffer(""),this.state=fe.STREAM_START,this.skippedBytes=0,this.parsedEntity=null,this.outStreamInfo={}}spe.inherits(mi,CT.Transform);mi.prototype.processDataChunk=function(r){var e;switch(this.state){case fe.STREAM_START:case fe.START:e=4;break;case fe.LOCAL_FILE_HEADER:e=26;break;case fe.LOCAL_FILE_HEADER_SUFFIX:e=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength;break;case fe.DATA_DESCRIPTOR:e=12;break;case fe.CENTRAL_DIRECTORY_FILE_HEADER:e=42;break;case fe.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:e=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength+this.parsedEntity.fileCommentLength;break;case fe.CDIR64_END:e=52;break;case fe.CDIR64_END_DATA_SECTOR:e=this.parsedEntity.centralDirectoryRecordSize-44;break;case fe.CDIR64_LOCATOR:e=16;break;case fe.CENTRAL_DIRECTORY_END:e=18;break;case fe.CENTRAL_DIRECTORY_END_COMMENT:e=this.parsedEntity.commentLength;break;case fe.FILE_DATA:return 0;case fe.FILE_DATA_END:return 0;case fe.TRAILING_JUNK:return this.options.debug&&console.log("found",r.length,"bytes of TRAILING_JUNK"),r.length;default:return r.length}var t=r.length;if(t<e)return 0;switch(this.state){case fe.STREAM_START:case fe.START:var i=r.readUInt32LE(0);switch(i){case lpe:this.state=fe.LOCAL_FILE_HEADER;break;case upe:this.state=fe.CENTRAL_DIRECTORY_FILE_HEADER;break;case fpe:this.state=fe.CDIR64_END;break;case dpe:this.state=fe.CDIR64_LOCATOR;break;case hpe:this.state=fe.CENTRAL_DIRECTORY_END;break;default:var n=this.state===fe.STREAM_START;if(!n&&(i&65535)!=19280&&this.skippedBytes<26){for(var s=i,o=4,a=1;a<4&&s!==0;a++)if(s=s>>>8,(s&255)==80){o=a;break}return this.skippedBytes+=o,this.options.debug&&console.log("Skipped",this.skippedBytes,"bytes"),o}this.state=fe.ERROR;var l=n?"Not a valid zip file":"Invalid signature in zip file";if(this.options.debug){var c=r.readUInt32LE(0),u;try{u=r.slice(0,4).toString()}catch(_){}console.log("Unexpected signature in zip file: 0x"+c.toString(16),'"'+u+'", skipped',this.skippedBytes,"bytes")}return this.emit("error",new Error(l)),r.length}return this.skippedBytes=0,e;case fe.LOCAL_FILE_HEADER:return this.parsedEntity=this._readFile(r),this.state=fe.LOCAL_FILE_HEADER_SUFFIX,e;case fe.LOCAL_FILE_HEADER_SUFFIX:var f=new c4,d=(this.parsedEntity.flags&2048)!=0;f.path=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),d);var h=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),p=this._readExtraFields(h);if(p&&p.parsed&&(p.parsed.path&&!d&&(f.path=p.parsed.path),Number.isFinite(p.parsed.uncompressedSize)&&this.parsedEntity.uncompressedSize===Hh-1&&(this.parsedEntity.uncompressedSize=p.parsed.uncompressedSize),Number.isFinite(p.parsed.compressedSize)&&this.parsedEntity.compressedSize===Hh-1&&(this.parsedEntity.compressedSize=p.parsed.compressedSize)),this.parsedEntity.extra=p.parsed||{},this.options.debug){let _=Object.assign({},this.parsedEntity,{path:f.path,flags:"0x"+this.parsedEntity.flags.toString(16),extraFields:p&&p.debug});console.log("decoded LOCAL_FILE_HEADER:",JSON.stringify(_,null,2))}return this._prepareOutStream(this.parsedEntity,f),this.emit("entry",f),this.state=fe.FILE_DATA,e;case fe.CENTRAL_DIRECTORY_FILE_HEADER:return this.parsedEntity=this._readCentralDirectoryEntry(r),this.state=fe.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX,e;case fe.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:var d=(this.parsedEntity.flags&2048)!=0,g=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),d),h=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),p=this._readExtraFields(h);p&&p.parsed&&p.parsed.path&&!d&&(g=p.parsed.path),this.parsedEntity.extra=p.parsed;var b=(this.parsedEntity.versionMadeBy&65280)>>8==3,y,S;if(b){y=this.parsedEntity.externalFileAttributes>>>16;var w=y>>>12;S=(w&10)==10}if(this.options.debug){let _=Object.assign({},this.parsedEntity,{path:g,flags:"0x"+this.parsedEntity.flags.toString(16),unixAttrs:y&&"0"+y.toString(8),isSymlink:S,extraFields:p.debug});console.log("decoded CENTRAL_DIRECTORY_FILE_HEADER:",JSON.stringify(_,null,2))}return this.state=fe.START,e;case fe.CDIR64_END:return this.parsedEntity=this._readEndOfCentralDirectory64(r),this.options.debug&&console.log("decoded CDIR64_END_RECORD:",this.parsedEntity),this.state=fe.CDIR64_END_DATA_SECTOR,e;case fe.CDIR64_END_DATA_SECTOR:return this.state=fe.START,e;case fe.CDIR64_LOCATOR:return this.state=fe.START,e;case fe.CENTRAL_DIRECTORY_END:return this.parsedEntity=this._readEndOfCentralDirectory(r),this.options.debug&&console.log("decoded CENTRAL_DIRECTORY_END:",this.parsedEntity),this.state=fe.CENTRAL_DIRECTORY_END_COMMENT,e;case fe.CENTRAL_DIRECTORY_END_COMMENT:return this.options.debug&&console.log("decoded CENTRAL_DIRECTORY_END_COMMENT:",r.slice(0,e).toString()),this.state=fe.TRAILING_JUNK,e;case fe.ERROR:return r.length;default:return console.log("didn't handle state #",this.state,"discarding"),r.length}};mi.prototype._prepareOutStream=function(r,e){var t=this,i=r.uncompressedSize===0&&/[\/\\]$/.test(e.path);e.path=e.path.replace(/^([/\\]*[.]+[/\\]+)*[/\\]*/,""),e.type=i?"Directory":"File",e.isDirectory=i;var n=!(r.flags&8);n&&(e.size=r.uncompressedSize);var s=r.versionsNeededToExtract<=45;if(this.outStreamInfo={stream:null,limit:n?r.compressedSize:-1,written:0},n)this.outStreamInfo.stream=new CT.PassThrough;else{var o=new Buffer(4);o.writeUInt32LE(cpe,0);var a=r.extra.zip64Mode,l=a?20:12,c={pattern:o,requiredExtraSize:l},u=new ape(c,function(g,b){var y=t._readDataDescriptor(g,a),S=y.compressedSize===b;if(!a&&!S&&b>=Hh)for(var w=b-Hh;w>=0&&(S=y.compressedSize===w,!S);)w-=Hh;if(!!S){t.state=fe.FILE_DATA_END;var _=a?24:16;return t.data.length>0?t.data=Buffer.concat([g.slice(_),t.data]):t.data=g.slice(_),!0}});this.outStreamInfo.stream=u}var f=r.flags&1||r.flags&64;if(f||!s){var d=f?"Encrypted files are not supported!":"Zip version "+Math.floor(r.versionsNeededToExtract/10)+"."+r.versionsNeededToExtract%10+" is not supported";e.skip=!0,setImmediate(()=>{e.emit("error",new Error(d))}),this.outStreamInfo.stream.pipe(new c4().autodrain());return}var h=r.compressionMethod>0;if(h){var p=ope.createInflateRaw();p.on("error",function(g){t.state=fe.ERROR,t.emit("error",g)}),this.outStreamInfo.stream.pipe(p).pipe(e)}else this.outStreamInfo.stream.pipe(e);this._drainAllEntries&&e.autodrain()};mi.prototype._readFile=function(r){var e=Yo.parse(r).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;return e};mi.prototype._readExtraFields=function(r){var e={},t={parsed:e};this.options.debug&&(t.debug=[]);for(var i=0;i<r.length;){var n=Yo.parse(r).skip(i).word16lu("extraId").word16lu("extraSize").vars;i+=4;var s=void 0;switch(n.extraId){case 1:s="Zip64 extended information extra field";var o=Yo.parse(r.slice(i,i+n.extraSize)).word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offsetToLocalHeader").word32lu("diskStartNumber").vars;o.uncompressedSize!==null&&(e.uncompressedSize=o.uncompressedSize),o.compressedSize!==null&&(e.compressedSize=o.compressedSize),e.zip64Mode=!0;break;case 10:s="NTFS extra field";break;case 21589:s="extended timestamp";var a=r.readUInt8(i),l=1;n.extraSize>=l+4&&a&1&&(e.mtime=new Date(r.readUInt32LE(i+l)*1e3),l+=4),n.extraSize>=l+4&&a&2&&(e.atime=new Date(r.readUInt32LE(i+l)*1e3),l+=4),n.extraSize>=l+4&&a&4&&(e.ctime=new Date(r.readUInt32LE(i+l)*1e3));break;case 28789:s="Info-ZIP Unicode Path Extra Field";var c=r.readUInt8(i);if(c===1){var l=1,u=r.readUInt32LE(i+l);l+=4;var f=r.slice(i+l);e.path=f.toString()}break;case 13:case 22613:s=n.extraId===13?"PKWARE Unix":"Info-ZIP UNIX (type 1)";var l=0;if(n.extraSize>=8){var d=new Date(r.readUInt32LE(i+l)*1e3);l+=4;var h=new Date(r.readUInt32LE(i+l)*1e3);if(l+=4,e.atime=d,e.mtime=h,n.extraSize>=12){var p=r.readUInt16LE(i+l);l+=2;var g=r.readUInt16LE(i+l);l+=2,e.uid=p,e.gid=g}}break;case 30805:s="Info-ZIP UNIX (type 2)";var l=0;if(n.extraSize>=4){var p=r.readUInt16LE(i+l);l+=2;var g=r.readUInt16LE(i+l);l+=2,e.uid=p,e.gid=g}break;case 30837:s="Info-ZIP New Unix";var l=0,b=r.readUInt8(i);if(l+=1,b===1){var y=r.readUInt8(i+l);l+=1,y<=6&&(e.uid=r.readUIntLE(i+l,y)),l+=y;var S=r.readUInt8(i+l);l+=1,S<=6&&(e.gid=r.readUIntLE(i+l,S))}break;case 30062:s="ASi Unix";var l=0;if(n.extraSize>=14){var w=r.readUInt32LE(i+l);l+=4;var _=r.readUInt16LE(i+l);l+=2;var L=r.readUInt32LE(i+l);l+=4;var p=r.readUInt16LE(i+l);l+=2;var g=r.readUInt16LE(i+l);if(l+=2,e.mode=_,e.uid=p,e.gid=g,n.extraSize>14){var $=i+l,I=i+n.extraSize-14,W=this._decodeString(r.slice($,I));e.symlink=W}}break}this.options.debug&&t.debug.push({extraId:"0x"+n.extraId.toString(16),description:s,data:r.slice(i,i+n.extraSize).inspect()}),i+=n.extraSize}return t};mi.prototype._readDataDescriptor=function(r,e){if(e){var t=Yo.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars;return t}var t=Yo.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;return t};mi.prototype._readCentralDirectoryEntry=function(r){var e=Yo.parse(r).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;return e};mi.prototype._readEndOfCentralDirectory64=function(r){var e=Yo.parse(r).word64lu("centralDirectoryRecordSize").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskNumberWithCentralDirectoryStart").word64lu("centralDirectoryEntries").word64lu("totalCentralDirectoryEntries").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars;return e};mi.prototype._readEndOfCentralDirectory=function(r){var e=Yo.parse(r).word16lu("diskNumber").word16lu("diskStart").word16lu("centralDirectoryEntries").word16lu("totalCentralDirectoryEntries").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;return e};var ppe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ";mi.prototype._decodeString=function(r,e){if(e)return r.toString("utf8");if(this.options.decodeString)return this.options.decodeString(r);let t="";for(var i=0;i<r.length;i++)t+=ppe[r[i]];return t};mi.prototype._parseOrOutput=function(r,e){for(var t;(t=this.processDataChunk(this.data))>0&&(this.data=this.data.slice(t),this.data.length!==0););if(this.state===fe.FILE_DATA){if(this.outStreamInfo.limit>=0){var i=this.outStreamInfo.limit-this.outStreamInfo.written,n;i<this.data.length?(n=this.data.slice(0,i),this.data=this.data.slice(i)):(n=this.data,this.data=new Buffer("")),this.outStreamInfo.written+=n.length,this.outStreamInfo.limit===this.outStreamInfo.written?(this.state=fe.START,this.outStreamInfo.stream.end(n,r,e)):this.outStreamInfo.stream.write(n,r,e)}else{var n=this.data;this.data=new Buffer(""),this.outStreamInfo.written+=n.length;var s=this.outStreamInfo.stream;s.write(n,r,()=>{if(this.state===fe.FILE_DATA_END)return this.state=fe.START,s.end(e);e()})}return}e()};mi.prototype.drainAll=function(){this._drainAllEntries=!0};mi.prototype._transform=function(r,e,t){var i=this;i.data.length>0?i.data=Buffer.concat([i.data,r]):i.data=r;var n=i.data.length,s=function(){if(i.data.length>0&&i.data.length<n){n=i.data.length,i._parseOrOutput(e,s);return}t()};i._parseOrOutput(e,s)};mi.prototype._flush=function(r){var e=this;if(e.data.length>0){e._parseOrOutput("buffer",function(){if(e.data.length>0)return setImmediate(function(){e._flush(r)});r()});return}if(e.state===fe.FILE_DATA)return r(new Error("Stream finished in an invalid state, uncompression failed"));setImmediate(r)};u4.exports=mi});var d4=x((vRe,f4)=>{var Wh=require("stream").Transform,mpe=require("util"),gpe=_T();function Xo(r){if(!(this instanceof Xo))return new Xo(r);var e=r||{};Wh.call(this,{readableObjectMode:!0}),this.opts=r||{},this.unzipStream=new gpe(this.opts);var t=this;this.unzipStream.on("entry",function(i){t.push(i)}),this.unzipStream.on("error",function(i){t.emit("error",i)})}mpe.inherits(Xo,Wh);Xo.prototype._transform=function(r,e,t){this.unzipStream.write(r,e,t)};Xo.prototype._flush=function(r){var e=this;this.unzipStream.end(function(){process.nextTick(function(){e.emit("close")}),r()})};Xo.prototype.on=function(r,e){return r==="entry"?Wh.prototype.on.call(this,"data",e):Wh.prototype.on.call(this,r,e)};Xo.prototype.drainAll=function(){return this.unzipStream.drainAll(),this.pipe(new Wh({objectMode:!0,transform:function(r,e,t){t()}}))};f4.exports=Xo});var g4=x((bRe,m4)=>{var zh=require("path"),h4=require("fs"),p4=parseInt("0777",8);m4.exports=Lu.mkdirp=Lu.mkdirP=Lu;function Lu(r,e,t,i){typeof e=="function"?(t=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var n=e.mode,s=e.fs||h4;n===void 0&&(n=p4),i||(i=null);var o=t||function(){};r=zh.resolve(r),s.mkdir(r,n,function(a){if(!a)return i=i||r,o(null,i);switch(a.code){case"ENOENT":if(zh.dirname(r)===r)return o(a);Lu(zh.dirname(r),e,function(l,c){l?o(l,c):Lu(r,e,o,c)});break;default:s.stat(r,function(l,c){l||!c.isDirectory()?o(a,i):o(null,i)});break}})}Lu.sync=function r(e,t,i){(!t||typeof t!="object")&&(t={mode:t});var n=t.mode,s=t.fs||h4;n===void 0&&(n=p4),i||(i=null),e=zh.resolve(e);try{s.mkdirSync(e,n),i=i||e}catch(a){switch(a.code){case"ENOENT":i=r(zh.dirname(e),t,i),r(e,t,i);break;default:var o;try{o=s.statSync(e)}catch(l){throw a}if(!o.isDirectory())throw a;break}}return i}});var w4=x((yRe,y4)=>{var vpe=require("fs"),v4=require("path"),bpe=require("util"),ype=g4(),b4=require("stream").Transform,wpe=_T();function Zo(r){if(!(this instanceof Zo))return new Zo(r);b4.call(this),this.opts=r||{},this.unzipStream=new wpe(this.opts),this.unfinishedEntries=0,this.afterFlushWait=!1,this.createdDirectories={};var e=this;this.unzipStream.on("entry",this._processEntry.bind(this)),this.unzipStream.on("error",function(t){e.emit("error",t)})}bpe.inherits(Zo,b4);Zo.prototype._transform=function(r,e,t){this.unzipStream.write(r,e,t)};Zo.prototype._flush=function(r){var e=this,t=function(){process.nextTick(function(){e.emit("close")}),r()};this.unzipStream.end(function(){if(e.unfinishedEntries>0)return e.afterFlushWait=!0,e.on("await-finished",t);t()})};Zo.prototype._processEntry=function(r){var e=this,t=v4.join(this.opts.path,r.path),i=r.isDirectory?t:v4.dirname(t);this.unfinishedEntries++;var n=function(){var s=vpe.createWriteStream(t);s.on("close",function(){e.unfinishedEntries--,e._notifyAwaiter()}),s.on("error",function(o){e.emit("error",o)}),r.pipe(s)};if(this.createdDirectories[i]||i===".")return n();ype(i,function(s){if(s)return e.emit("error",s);if(e.createdDirectories[i]=!0,r.isDirectory){e.unfinishedEntries--,e._notifyAwaiter();return}n()})};Zo.prototype._notifyAwaiter=function(){this.afterFlushWait&&this.unfinishedEntries===0&&(this.emit("await-finished"),this.afterFlushWait=!1)};y4.exports=Zo});var x4=x(ET=>{"use strict";ET.Parse=d4();ET.Extract=w4()});var C4=x((xRe,S4)=>{"use strict";function xpe(){}function Sb(r,e){let t=Sb.spread(r,e),i=t.then(n=>n[0]);return i.cancel=t.cancel,i}(function(r){function e(t,i){let n=null,s=new Promise((o,a)=>{function l(){t.removeListener(i,c),t.removeListener("error",u),s.cancel=xpe}function c(...f){l(),o(f)}function u(f){l(),a(f)}n=l,t.on(i,c),t.on("error",u)});if(!n)throw new TypeError("Could not get `cancel()` function");return s.cancel=n,s}r.spread=e})(Sb||(Sb={}));S4.exports=Sb});var _4=x(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});function Spe(r){return function(e,t){return new Promise((i,n)=>{r.call(this,e,t,(s,o)=>{s?n(s):i(o)})})}}TT.default=Spe});var PT=x((RT,T4)=>{"use strict";var E4=RT&&RT.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},Cpe=require("events"),_pe=E4(Bt()),Epe=E4(_4()),Vh=_pe.default("agent-base");function Tpe(r){return Boolean(r)&&typeof r.addRequest=="function"}function DT(){let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Cb(r,e){return new Cb.Agent(r,e)}(function(r){class e extends Cpe.EventEmitter{constructor(i,n){super();let s=n;typeof i=="function"?this.callback=i:i&&(s=i),this.timeout=null,s&&typeof s.timeout=="number"&&(this.timeout=s.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:DT()?443:80}set defaultPort(i){this.explicitDefaultPort=i}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:DT()?"https:":"http:"}set protocol(i){this.explicitProtocol=i}callback(i,n,s){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(i,n){let s=Object.assign({},n);typeof s.secureEndpoint!="boolean"&&(s.secureEndpoint=DT()),s.host==null&&(s.host="localhost"),s.port==null&&(s.port=s.secureEndpoint?443:80),s.protocol==null&&(s.protocol=s.secureEndpoint?"https:":"http:"),s.host&&s.path&&delete s.path,delete s.agent,delete s.hostname,delete s._defaultAgent,delete s.defaultPort,delete s.createConnection,i._last=!0,i.shouldKeepAlive=!1;let o=!1,a=null,l=s.timeout||this.timeout,c=h=>{i._hadError||(i.emit("error",h),i._hadError=!0)},u=()=>{a=null,o=!0;let h=new Error(`A "socket" was not created for HTTP request before ${l}ms`);h.code="ETIMEOUT",c(h)},f=h=>{o||(a!==null&&(clearTimeout(a),a=null),c(h))},d=h=>{if(o)return;if(a!=null&&(clearTimeout(a),a=null),Tpe(h)){Vh("Callback returned another Agent instance %o",h.constructor.name),h.addRequest(i,s);return}if(h){h.once("free",()=>{this.freeSocket(h,s)}),i.onSocket(h);return}let p=new Error(`no Duplex stream was returned to agent-base for \`${i.method} ${i.path}\``);c(p)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(Vh("Converting legacy callback function to promise"),this.promisifiedCallback=Epe.default(this.callback)):this.promisifiedCallback=this.callback),typeof l=="number"&&l>0&&(a=setTimeout(u,l)),"port"in s&&typeof s.port!="number"&&(s.port=Number(s.port));try{Vh("Resolving socket for %o request: %o",s.protocol,`${i.method} ${i.path}`),Promise.resolve(this.promisifiedCallback(i,s)).then(d,f)}catch(h){Promise.reject(h).catch(f)}}freeSocket(i,n){Vh("Freeing socket %o %o",i.constructor.name,n),i.destroy()}destroy(){Vh("Destroying agent %o",this.constructor.name)}}r.Agent=e,r.prototype=r.Agent.prototype})(Cb||(Cb={}));T4.exports=Cb});var R4=x(yl=>{"use strict";var Dpe=yl&&yl.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(f){o(f)}}function l(u){try{c(i.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},Gh=yl&&yl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yl,"__esModule",{value:!0});var Rpe=Gh(require("net")),Ppe=Gh(require("tls")),kT=Gh(require("url")),kpe=Gh(Bt()),Ipe=Gh(C4()),Ope=PT(),Qo=kpe.default("http-proxy-agent");function Lpe(r){return typeof r=="string"?/^https:?$/i.test(r):!1}var D4=class extends Ope.Agent{constructor(e){let t;if(typeof e=="string"?t=kT.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Qo("Creating new HttpProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||Lpe(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(e,t){return Dpe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:n}=this,s=kT.default.parse(e.path);s.protocol||(s.protocol="http:"),s.hostname||(s.hostname=t.hostname||t.host||null),s.port==null&&typeof t.port&&(s.port=String(t.port)),s.port==="80"&&delete s.port,e.path=kT.default.format(s),i.auth&&e.setHeader("Proxy-Authorization",`Basic ${Buffer.from(i.auth).toString("base64")}`);let o;if(n?(Qo("Creating `tls.Socket`: %o",i),o=Ppe.default.connect(i)):(Qo("Creating `net.Socket`: %o",i),o=Rpe.default.connect(i)),e._header){let a,l;Qo("Regenerating stored HTTP header string for request"),e._header=null,e._implicitHeader(),e.output&&e.output.length>0?(Qo("Patching connection write() output buffer with updated header"),a=e.output[0],l=a.indexOf(`\r
\r
`)+4,e.output[0]=e._header+a.substring(l),Qo("Output buffer: %o",e.output)):e.outputData&&e.outputData.length>0&&(Qo("Patching connection write() output buffer with updated header"),a=e.outputData[0].data,l=a.indexOf(`\r
\r
`)+4,e.outputData[0].data=e._header+a.substring(l),Qo("Output buffer: %o",e.outputData[0].data))}return yield Ipe.default(o,"connect"),o})}};yl.default=D4});var k4=x((LT,P4)=>{"use strict";var Ape=LT&<.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},IT=Ape(R4());function OT(r){return new IT.default(r)}(function(r){r.HttpProxyAgent=IT.default,r.prototype=IT.default.prototype})(OT||(OT={}));P4.exports=OT});var I4=x(Jh=>{"use strict";var Fpe=Jh&&Jh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Jh,"__esModule",{value:!0});var Mpe=Fpe(Bt()),Kh=Mpe.default("https-proxy-agent:parse-proxy-response");function Npe(r){return new Promise((e,t)=>{let i=0,n=[];function s(){let f=r.read();f?u(f):r.once("readable",s)}function o(){r.removeListener("end",l),r.removeListener("error",c),r.removeListener("close",a),r.removeListener("readable",s)}function a(f){Kh("onclose had error %o",f)}function l(){Kh("onend")}function c(f){o(),Kh("onerror %o",f),t(f)}function u(f){n.push(f),i+=f.length;let d=Buffer.concat(n,i);if(d.indexOf(`\r
\r
`)===-1){Kh("have not received end of HTTP headers yet..."),s();return}let p=d.toString("ascii",0,d.indexOf(`\r
`)),g=+p.split(" ")[1];Kh("got proxy server response: %o",p),e({statusCode:g,buffered:d})}r.on("error",c),r.on("close",a),r.on("end",l),s()})}Jh.default=Npe});var F4=x(wl=>{"use strict";var qpe=wl&&wl.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(f){o(f)}}function l(u){try{c(i.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(a,l)}c((i=i.apply(r,e||[])).next())})},Au=wl&&wl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wl,"__esModule",{value:!0});var O4=Au(require("net")),L4=Au(require("tls")),$pe=Au(require("url")),Bpe=Au(require("assert")),jpe=Au(Bt()),Upe=PT(),Hpe=Au(I4()),Yh=jpe.default("https-proxy-agent:agent"),A4=class extends Upe.Agent{constructor(e){let t;if(typeof e=="string"?t=$pe.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Yh("creating new HttpsProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||Vpe(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in i)&&(i.ALPNProtocols=["http 1.1"]),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(e,t){return qpe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:n}=this,s;n?(Yh("Creating `tls.Socket`: %o",i),s=L4.default.connect(i)):(Yh("Creating `net.Socket`: %o",i),s=O4.default.connect(i));let o=Object.assign({},i.headers),l=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r
`;i.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(i.auth).toString("base64")}`);let{host:c,port:u,secureEndpoint:f}=t;zpe(u,f)||(c+=`:${u}`),o.Host=c,o.Connection="close";for(let b of Object.keys(o))l+=`${b}: ${o[b]}\r
`;let d=Hpe.default(s);s.write(`${l}\r
`);let{statusCode:h,buffered:p}=yield d;if(h===200){if(e.once("socket",Wpe),t.secureEndpoint){let b=t.servername||t.host;if(!b)throw new Error('Could not determine "servername"');return Yh("Upgrading socket connection to TLS"),L4.default.connect(Object.assign(Object.assign({},Gpe(t,"host","hostname","path","port")),{socket:s,servername:b}))}return s}s.destroy();let g=new O4.default.Socket;return g.readable=!0,e.once("socket",b=>{Yh("replaying proxy buffer for failed request"),Bpe.default(b.listenerCount("data")>0),b.push(p),b.push(null)}),g})}};wl.default=A4;function Wpe(r){r.resume()}function zpe(r,e){return Boolean(!e&&r===80||e&&r===443)}function Vpe(r){return typeof r=="string"?/^https:?$/i.test(r):!1}function Gpe(r,...e){let t={},i;for(i in r)e.includes(i)||(t[i]=r[i]);return t}});var N4=x((MT,M4)=>{"use strict";var Kpe=MT&&MT.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},AT=Kpe(F4());function FT(r){return new AT.default(r)}(function(r){r.HttpsProxyAgent=AT.default,r.prototype=AT.default.prototype})(FT||(FT={}));M4.exports=FT});var $4=x((TRe,q4)=>{"use strict";var Jpe=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];q4.exports=(r,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let t=new Set(Object.keys(r).concat(Jpe)),i={};for(let n of t)n in e||(i[n]={get(){let s=r[n];return typeof s=="function"?s.bind(r):s},set(s){r[n]=s},enumerable:!0,configurable:!1});return Object.defineProperties(e,i),r.once("aborted",()=>{e.destroy(),e.emit("aborted")}),r.once("close",()=>{r.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var j4=x((DRe,B4)=>{"use strict";var{Transform:Ype,PassThrough:Xpe}=require("stream"),NT=require("zlib"),Zpe=$4();B4.exports=r=>{let e=(r.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return r;let t=e==="br";if(t&&typeof NT.createBrotliDecompress!="function")return r.destroy(new Error("Brotli is not supported on Node.js < 12")),r;let i=!0,n=new Ype({transform(a,l,c){i=!1,c(null,a)},flush(a){a()}}),s=new Xpe({autoDestroy:!1,destroy(a,l){r.destroy(),l(a)}}),o=t?NT.createBrotliDecompress():NT.createUnzip();return o.once("error",a=>{if(i&&!r.readable){s.end();return}s.destroy(a)}),Zpe(r,s),r.pipe(n).pipe(o).pipe(s),s}});function Qpe(r){let e;r.protocol==="http:"?e=process.env.HTTP_PROXY||process.env.http_proxy||null:r.protocol==="https:"&&(e=process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null);let t=process.env.NO_PROXY||process.env.no_proxy;if(t==="*")e=null;else if(t){let i=r.hostname.replace(/^\.*/,".").toLowerCase(),n=r.port||r.protocol.startsWith("https")?"443":"80",s=t.split(",");for(let o=0,a=s.length;o<a;o++){let l=s[o].trim().toLowerCase();if(l.includes(":")){let c=l.split(":",2),u=c[0].replace(/^\.*/,"."),f=c[1];if(n===f&&i.endsWith(u)){e=null;break}}else if(l=l.replace(/^\.*/,"."),i.endsWith(l)){e=null;break}}}return e}function eme(r,e){let t=e.proxyUrl||Qpe(r);if(t){let i=(0,qT.parse)(t);if(!/^https?:$/.test(i.protocol))return null;let n={host:i.hostname,port:i.port?Number(i.port):i.protocol==="https"?"443":"80",auth:i.auth,rejectUnauthorized:typeof e.strictSSL=="boolean"?e.strictSSL:!0};return G4.info(`Using proxy ${t} from ${e.proxyUrl?"configuration":"system environment"} for ${r.hostname}:`),r.protocol==="http:"?(0,W4.default)(n):(0,z4.default)(n)}return null}function $T(r,e={}){let t=v.getConfiguration("http"),{data:i}=e,n=ime(i),s={proxyUrl:t.get("proxy",""),strictSSL:t.get("proxyStrictSSL",!0),proxyAuthorization:t.get("proxyAuthorization",null),proxyCA:t.get("proxyCA",null)};e.query&&!r.includes("?")&&(r=`${r}?${(0,H4.stringify)(e.query)}`);let o=Object.assign(e.headers||{},{"Proxy-Authorization":s.proxyAuthorization}),a=(0,qT.parse)(r),l=eme(a,s),c={method:e.method||"GET",hostname:a.hostname,port:a.port?parseInt(a.port,10):a.protocol==="https:"?443:80,path:a.path,agent:l,rejectUnauthorized:s.strictSSL,maxRedirects:3,headers:Object.assign({"User-Agent":"Mozilla/5.0 (X11; Linux x86_64)","Accept-Encoding":"gzip, deflate"},o)};return s.proxyCA&&(c.ca=U4.default.readFileSync(s.proxyCA)),n=="object"?c.headers["Content-Type"]="application/json":n=="string"&&(c.headers["Content-Type"]="text/plain"),e.user&&e.password&&(c.auth=e.user+":"+e.password),e.timeout&&(c.timeout=e.timeout),e.buffer&&(c.buffer=!0),c}function tme(r,e,t,i){let n=r.startsWith("https:")?_b.https:_b.http;return new Promise((s,o)=>{if(i){let l=i.onCancellationRequested(()=>{l.dispose(),a.destroy(new Error("request aborted"))})}let a=n.request(t,l=>{let c=l;if(l.statusCode>=200&&l.statusCode<300||l.statusCode===1223){let u=l.headers||{},f=[],d=u["content-type"]||"";c=(0,V4.default)(l),c.on("data",h=>{f.push(h)}),c.on("end",()=>{let h=Buffer.concat(f);if(!t.buffer&&(d.startsWith("application/json")||d.startsWith("text/"))){let p=d.match(/charset=(\S+)/),g=p?p[1]:"utf8",b=h.toString(g);if(!d.includes("application/json"))s(b);else try{let y=JSON.parse(b);s(y)}catch(y){o(new Error(`Parse response error: ${y}`))}}else s(h)}),c.on("error",h=>{o(new Error(`Unable to connect ${r}: ${h.message}`))})}else o(new Error(`Bad response from ${r}: ${l.statusCode}`))});a.on("error",o),a.on("timeout",()=>{a.destroy(new Error(`Request timeout after ${t.timeout}ms`))}),e&&(typeof e=="string"||Buffer.isBuffer(e)?a.write(e):a.write(JSON.stringify(e))),t.timeout&&a.setTimeout(t.timeout),a.end()})}function ime(r){return r===null?"null":r===void 0?"undefined":typeof r=="string"?"string":Buffer.isBuffer(r)?"buffer":Array.isArray(r)||Wt(r)?"object":"unknown"}function Fu(r,e={},t){let i=$T(r,e);return tme(r,e.data,i,t).catch(n=>{if(G4.error(`Fetch error for ${r}:`,i,n),i.agent&&i.agent.proxy){let{proxy:s}=i.agent;throw new Error(`Request failed using proxy ${s.host}: ${n.message}`)}else throw n})}var _b,qT,U4,H4,W4,z4,V4,G4,Eb=R(()=>{_b=E(eE()),qT=E(require("url")),U4=E(require("fs"));Wr();Y();H4=E(require("querystring")),W4=E(k4()),z4=E(N4()),V4=E(j4()),G4=U()("model-fetch")});function Zh(r,e,t){let{dest:i,onProgress:n,extract:s}=e;if(!i||!Xh.default.isAbsolute(i))throw new Error("Expect absolute file path for dest option.");let o;try{o=Db.default.statSync(i)}catch(u){Db.default.mkdirpSync(i)}if(o&&!o.isDirectory())throw new Error(`${i} exists, but not directory!`);let a=r.startsWith("https")?Tb.https:Tb.http,l=$T(r,e),c=Xh.default.extname(r);return new Promise((u,f)=>{if(t){let h=t.onCancellationRequested(()=>{h.dispose(),d.destroy(new Error("request aborted"))})}let d=a.request(l,h=>{var p,g;if(h.statusCode>=200&&h.statusCode<300||h.statusCode===1223){let b=h.headers||{},y=b["content-disposition"];if(!c&&y){let L=K4.default.parse(y);((p=L.parameters)==null?void 0:p.filename)&&(c=Xh.default.extname(L.parameters.filename))}if(s===!0)if(c===".zip"||b["content-type"]=="application/zip")s="unzip";else if(c==".tgz")s="untar";else{f(new Error(`Unable to extract for ${r}`));return}let S=Number(b["content-length"]),w=0;isNaN(S)||h.on("data",L=>{w+=L.length;let $=(w/S*100).toFixed(1);n?n($):BT.info(`Download ${r} progress ${$}%`)}),h.on("error",L=>{f(new Error(`Unable to connect ${r}: ${L.message}`))}),h.on("end",()=>{BT.info("Download completed:",r)});let _;s==="untar"?_=h.pipe(J4.default.x({strip:(g=e.strip)!=null?g:1,C:i})):s==="unzip"?_=h.pipe(Y4.default.Extract({path:i})):(i=Xh.default.join(i,`${Ms()}${c}`),_=h.pipe(Db.default.createWriteStream(i))),_.on("finish",()=>{BT.info(`Downloaded ${r} => ${i}`),setTimeout(()=>{u(i)},100)}),_.on("error",f)}else f(new Error(`Invalid response from ${r}: ${h.statusCode}`))});d.on("error",f),d.on("timeout",()=>{d.destroy(new Error(`request timeout after ${e.timeout}ms`))}),e.timeout&&d.setTimeout(e.timeout),d.end()})}var K4,Tb,Db,Xh,J4,Y4,BT,jT=R(()=>{K4=E(FW()),Tb=E(eE()),Db=E(pn()),Xh=E(require("path")),J4=E(jz()),Y4=E(x4());Ye();Eb();BT=U()("model-download")});function rme(r="coc.nvim"){let e=(0,t6.default)("npm",{registry:"https://registry.npmjs.org/"}),t=e[`${r}:registry`]||e.config_registry||e.registry;return t.endsWith("/")?t:t+"/"}function Pb(r,e){return t=>new r6(e,r,t)}var X4,Z4,Q4,Li,e6,rs,t6,Rb,i6,r6,n6=R(()=>{X4=E(require("events")),Z4=E(require("child_process"));Hd();Q4=E(require("readline")),Li=E(pn()),e6=E(require("os")),rs=E(require("path")),t6=E(TW()),Rb=E(_v());Y();jT();Eb();Nt();i6=U()("model-installer");r6=class extends X4.EventEmitter{constructor(e,t,i){super();this.root=e;this.npm=t;this.def=i;if(Li.default.existsSync(e)||Li.default.mkdirpSync(e),/^https?:/.test(i))this.url=i;else if(i.startsWith("@")){let n=i.indexOf("@",1);n>1?(this.name=i.substring(0,n),this.version=i.substring(n+1)):this.name=i}else if(i.includes("@")){let[n,s]=i.split("@",2);this.name=n,this.version=s}else this.name=i}get info(){return{name:this.name,version:this.version}}async install(){this.log(`Using npm from: ${this.npm}`);let e=await this.getInfo();i6.info(`Fetched info of ${this.def}`,e);let{name:t}=e,i=e["engines.coc"]?e["engines.coc"].replace(/^\^/,">="):"";if(i&&!Rb.default.satisfies(v.version,i))throw new Error(`${t} ${e.version} requires coc.nvim >= ${i}, please update coc.nvim.`);return await this.doInstall(e),t}async update(e){this.url=e;let t=rs.default.join(this.root,this.name);if((await Li.default.lstat(t)).isSymbolicLink()){this.log("Skipped update for symbol link");return}let n;if(Li.default.existsSync(rs.default.join(t,"package.json"))){let l=await Li.default.readFile(rs.default.join(t,"package.json"),"utf8");n=JSON.parse(l).version}this.log(`Using npm from: ${this.npm}`);let s=await this.getInfo();if(n&&s.version&&Rb.default.gte(n,s.version)){this.log(`Current version ${n} is up to date.`);return}let o=s["engines.coc"]?s["engines.coc"].replace(/^\^/,">="):"";if(o&&!Rb.default.satisfies(v.version,o))throw new Error(`${s.version} requires coc.nvim ${o}, please update coc.nvim.`);await this.doInstall(s);let a=rs.default.join(this.root,s.name,"package.json");if(Li.default.existsSync(a))return this.log(`Updated to v${s.version}`),rs.default.dirname(a);throw new Error(`Package.json not found: ${a}`)}async doInstall(e){let t=rs.default.join(this.root,e.name);if(Li.default.existsSync(t)&&!Li.default.statSync(t).isDirectory()){this.log(`${t} is not directory skipped install`);return}let i=await Li.default.mkdtemp(rs.default.join(e6.default.tmpdir(),`${e.name.replace("/","-")}-`)),n=e["dist.tarball"];this.log(`Downloading from ${n}`),await Zh(n,{dest:i,onProgress:d=>this.log(`Download progress ${d}%`,!0),extract:"untar"}),this.log(`Extension download at ${i}`);let s=await Li.default.readFile(rs.default.join(i,"package.json"),"utf8"),{dependencies:o}=JSON.parse(s);o&&Object.keys(o).length&&await new Promise((h,p)=>{let g=["install","--ignore-scripts","--no-lockfile","--production"];n.startsWith("https://github.com")&&(g=["install"]),(this.npm.endsWith("npm")||this.npm.endsWith("npm.CMD"))&&!this.npm.endsWith("pnpm")&&g.push("--legacy-peer-deps"),this.npm.endsWith("yarn")&&g.push("--ignore-engines"),this.log(`Installing dependencies by: ${this.npm} ${g.join(" ")}.`);let b=(0,Z4.spawn)(this.npm,g,{cwd:i});Q4.default.createInterface({input:b.stdout}).on("line",w=>{this.log(`[npm] ${w}`,!0)}),b.stderr.setEncoding("utf8"),b.stdout.setEncoding("utf8"),b.on("error",p);let S="";b.stderr.on("data",w=>{S+=w}),b.on("exit",w=>{if(w){S&&this.log(S),p(new Error(`${this.npm} install exited with ${w}`));return}h()})});let a=rs.default.resolve(this.root,global.hasOwnProperty("__TEST__")?"":"..","package.json"),l=[],c=Wc(Li.default.readFileSync(a,"utf8"),l,{allowTrailingComma:!0});if(l&&l.length>0)throw new Error(`Error on load ${a}`);c.dependencies=c.dependencies||{},this.url?c.dependencies[e.name]=this.url:c.dependencies[e.name]=">="+e.version;let u={dependencies:{}};Object.keys(c.dependencies).sort().forEach(d=>{u.dependencies[d]=c.dependencies[d]});let f=await Mt(t);f&&(f.isDirectory()?Li.default.removeSync(t):Li.default.unlinkSync(t)),await Li.default.move(i,t,{overwrite:!0}),await Li.default.writeFile(a,JSON.stringify(u,null,2),{encoding:"utf8"}),this.log(`Update package.json at ${a}`),this.log(`Installed extension ${this.name}@${e.version} at ${t}`)}async getInfo(){if(this.url)return await this.getInfoFromUri();let e=rme();this.log(`Get info from ${e}`);let t=await Fu(e+this.name,{timeout:1e4,buffer:!0}),i=JSON.parse(t.toString());this.version||(this.version=i["dist-tags"].latest);let n=i.versions[this.version];if(!n)throw new Error(`${this.def} doesn't exists in ${e}.`);let s=n.engines&&n.engines.coc;if(!s)throw new Error(`${this.def} is not valid coc extension, "engines" field with coc property required.`);return{"dist.tarball":n.dist.tarball,"engines.coc":s,version:n.version,name:i.name}}async getInfoFromUri(){let{url:e}=this;if(!e.includes("github.com"))throw new Error(`"${e}" is not supported, coc.nvim support github.com only`);e=e.replace(/\/$/,"");let t="master";if(e.includes("@")){let o=e.indexOf("@");t=e.substr(o+1),e=e.substring(0,o)}let i=e.replace("github.com","raw.githubusercontent.com")+`/${t}/package.json`;this.log(`Get info from ${i}`);let n=await Fu(i,{timeout:1e4}),s=typeof n=="string"?JSON.parse(n):n;return this.name=s.name,{"dist.tarball":`${e}/archive/${t}.tar.gz`,"engines.coc":s.engines?s.engines.coc:null,name:s.name,version:s.version}}log(e,t=!1){i6.info(e),this.emit("message",e,t)}}});var Mu,nme,kb,s6=R(()=>{Mu=E(require("fs"));ri();nme=U()("model-memos"),kb=class{constructor(e){this.filepath=e;Mu.default.existsSync(e)||Mu.default.writeFileSync(e,"{}","utf8")}fetchContent(e,t){try{let i=Mu.default.readFileSync(this.filepath,"utf8"),s=JSON.parse(i)[e];return s?s[t]:void 0}catch(i){return}}async update(e,t,i){let{filepath:n}=this;try{let s=Mu.default.readFileSync(n,"utf8"),o=s?JSON.parse(s):{};o[e]=o[e]||{},i!==void 0?o[e][t]=Ls(i):delete o[e][t],s=JSON.stringify(o,null,2),Mu.default.writeFileSync(n,s,"utf8")}catch(s){nme.error("Error on update memos:",s)}}createMemento(e){return{get:(t,i)=>{let n=this.fetchContent(e,t);return n===void 0?i:n},update:async(t,i)=>{await this.update(e,t,i)}}}}});function a6(r,...e){return r=Object(r),e.forEach(t=>{if(t!=null){t=Object(t);for(let i in t){let n=r[i];(n===void 0||n===o6[i]&&!sme.call(r,i))&&(r[i]=t[i])}}}),r}function ns(r,e){let t={};for(let i of Object.keys(r))e.includes(i)||(t[i]=r[i]);return t}var o6,sme,Nu=R(()=>{o6=Object.prototype,sme=o6.hasOwnProperty});function UT(r,e){let{range:t,uri:i}=e;r.find(n=>n.uri==i&&je(n.range,t))==null&&r.push(e)}var qu,ome,me,Et=R(()=>{qu=E(H());Y();ri();ome=U()("provider-manager"),me=class{constructor(){this.providers=new Set}hasProvider(e){return this.getProvider(e)!=null}getProvider(e){let t=0,i;for(let n of this.providers){let{selector:s,priority:o}=n,a=v.match(s,e);a!=0&&(typeof o=="number"&&(a=o),!(a<t)&&(t=a,i=n))}return i}getProviderById(e){let t=Array.from(this.providers).find(i=>i.id==e);return t?t.provider:null}getProviders(e){let t=Array.from(this.providers);return t=t.filter(i=>v.match(i.selector,e)>0),t.sort((i,n)=>v.match(n.selector,e)-v.match(i.selector,e))}toLocations(e){let t=[];for(let i of e)if(!!i)if(qu.Location.is(i))UT(t,i);else if(Array.isArray(i)){for(let n of i)if(qu.Location.is(n))UT(t,n);else if(qu.LocationLink.is(n)){let{targetUri:s,targetSelectionRange:o,targetRange:a}=n;UT(t,qu.Location.create(s,o||a))}}else ome.error("Bad definition",i);return t}}});var l6,Ib,c6=R(()=>{l6=E(H());Et();Ye();Ib=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),l6.Disposable.create(()=>{this.providers.delete(i)})}async prepareCallHierarchy(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return s.prepareCallHierarchy===null?null:await Promise.resolve(s.prepareCallHierarchy(e,t,i))}async provideCallHierarchyOutgoingCalls(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return s.provideCallHierarchyOutgoingCalls===null?null:await Promise.resolve(s.provideCallHierarchyOutgoingCalls(t,i))}async provideCallHierarchyIncomingCalls(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return s.provideCallHierarchyIncomingCalls(t,i)===null?null:await Promise.resolve(s.provideCallHierarchyIncomingCalls(t,i))}}});var Ob,yPe,Lb,u6=R(()=>{Ob=E(H());Et();Ye();yPe=U()("codeActionManager"),Lb=class extends me{constructor(){super(...arguments);this.providerMap=new WeakMap}register(e,t,i,n){let s={id:ue(),selector:e,provider:t,kinds:n,clientId:i};return this.providers.add(s),Ob.Disposable.create(()=>{this.providers.delete(s)})}async provideCodeActions(e,t,i,n){let s=this.getProviders(e);if(!s.length)return null;if(i.only){let{only:a}=i;s=s.filter(l=>!(l.kinds&&!l.kinds.some(c=>a.includes(c))))}let o=[];return await Promise.all(s.map(a=>{let{provider:l,id:c}=a;return Promise.resolve(l.provideCodeActions(e,t,i,n)).then(u=>{if(!(!u||u.length==0))for(let f of u)if(Ob.Command.is(f)){let d={title:f.title,command:f};o.push(d),this.providerMap.set(d,c)}else{if(i.only){if(!f.kind)continue;let h=!1;for(let p of i.only)if(f.kind.startsWith(p)){h=!0;break}if(!h)continue}o.findIndex(h=>h.title==f.title)==-1&&(this.providerMap.set(f,c),o.push(f))}})})),o}async resolveCodeAction(e,t){if(e.edit!=null)return e;let i=this.providerMap.get(e);if(!i)throw new Error("provider id not found from codeAction");let n=this.getProviderById(i);if(!n||typeof n.resolveCodeAction!="function")return e;let s=await Promise.resolve(n.resolveCodeAction(e,t));return s&&this.providerMap.set(s,i),s||e}}});var f6,Ab,d6=R(()=>{f6=E(H());Et();Ye();Nu();Ab=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),f6.Disposable.create(()=>{this.providers.delete(i)})}async provideCodeLenses(e,t){let i=this.getProviders(e);if(!i.length)return null;let n=await Promise.all(i.map(s=>{let{provider:o,id:a}=s;return Promise.resolve(o.provideCodeLenses(e,t)).then(l=>{if(Array.isArray(l))for(let c of l)c.source=a;return l})}));return[].concat(...n)}async resolveCodeLens(e,t){if(e.command)return e;let{source:i}=e,n=this.getProviderById(i);if(!n||typeof n.resolveCodeLens!="function")return e;let s=await Promise.resolve(n.resolveCodeLens(ns(e,["source"]),t));return Object.assign(e,s),e}}});var h6,NPe,Fb,p6=R(()=>{h6=E(H());Et();Ye();NPe=U()("definitionManager"),Fb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),h6.Disposable.create(()=>{this.providers.delete(i)})}async provideDeclaration(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return await Promise.resolve(s.provideDeclaration(e,t,i))}}});var Mb,JPe,Nb,m6=R(()=>{Mb=E(H());Et();Ye();ri();JPe=U()("definitionManager"),Nb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),Mb.Disposable.create(()=>{this.providers.delete(i)})}async getDefinitions(e,t,i){let n=this.getProviders(e);return n.length?await Promise.all(n.map(o=>{let{provider:a}=o;return Promise.resolve(a.provideDefinition(e,t,i))})):[]}async provideDefinition(e,t,i){let n=await this.getDefinitions(e,t,i);return this.toLocations(n)}async provideDefinitionLinks(e,t,i){let n=await this.getDefinitions(e,t,i),s=[];for(let o of n)if(!!Array.isArray(o))for(let a of o)Mb.LocationLink.is(a)&&s.findIndex(c=>c.targetUri==a.targetUri&&je(c.targetRange,a.targetRange))==-1&&s.push(a);return s}}});var g6,qb,v6=R(()=>{g6=E(H());Et();Ye();qb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),g6.Disposable.create(()=>{this.providers.delete(i)})}async provideDocumentColors(e,t){let i=this.getProvider(e);if(!i)return null;let{provider:n}=i;return await Promise.resolve(n.provideDocumentColors(e,t))}async provideColorPresentations(e,t,i){let{range:n,color:s}=e,o=this.getProvider(t);if(!o)return null;let{provider:a}=o;return await Promise.resolve(a.provideColorPresentations(s,{document:t,range:n},i))}}});var b6,$b,y6=R(()=>{b6=E(H());Et();Ye();$b=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),b6.Disposable.create(()=>{this.providers.delete(i)})}async provideDocumentHighlights(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return await Promise.resolve(s.provideDocumentHighlights(e,t,i))}}});var w6,Bb,x6=R(()=>{w6=E(H());Et();Ye();Bb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),w6.Disposable.create(()=>{this.providers.delete(i)})}async _provideDocumentLinks(e,t,i){let{provider:n,id:s}=e,o=await Promise.resolve(n.provideDocumentLinks(t,i));return!o||!o.length?[]:(o.forEach(a=>{a.data=a.data||{},a.data.source=s}),o)}async provideDocumentLinks(e,t){let i=this.getProviders(e);if(i.length==0)return[];let n=await Promise.all(i.map(s=>this._provideDocumentLinks(s,e,t)));return[].concat(...n)}async resolveDocumentLink(e,t){let{data:i}=e;if(!i||!i.source)return null;for(let n of this.providers)if(n.id==i.source){let{provider:s}=n;return e=await Promise.resolve(s.resolveDocumentLink(e,t)),e}return null}}});var S6,jb,C6=R(()=>{S6=E(H());Et();Ye();jb=class extends me{register(e,t,i){let n={id:ue(),displayName:i,selector:e,provider:t};return this.providers.add(n),S6.Disposable.create(()=>{this.providers.delete(n)})}async provideDocumentSymbols(e,t){let i=this.getProvider(e);if(!i)return null;let{provider:n}=i;return await Promise.resolve(n.provideDocumentSymbols(e,t))||[]}}});var _6,Ub,E6=R(()=>{_6=E(H());Et();Ye();Ub=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),_6.Disposable.create(()=>{this.providers.delete(i)})}async provideFoldingRanges(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return await Promise.resolve(s.provideFoldingRanges(e,t,i))||[]}}});var T6,Hb,D6=R(()=>{T6=E(H());Et();Ye();Hb=class extends me{register(e,t,i=0){let n={id:ue(),selector:e,priority:i,provider:t};return this.providers.add(n),T6.Disposable.create(()=>{this.providers.delete(n)})}handles(e){return this.getProvider(e)!=null}async provideDocumentFormattingEdits(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return await Promise.resolve(s.provideDocumentFormattingEdits(e,t,i))}}});var R6,Wb,P6=R(()=>{R6=E(H());Et();Ye();Wb=class extends me{register(e,t,i=0){let n={id:ue(),selector:e,provider:t,priority:i};return this.providers.add(n),R6.Disposable.create(()=>{this.providers.delete(n)})}async provideDocumentRangeFormattingEdits(e,t,i,n){let s=this.getProvider(e);if(!s)return null;let{provider:o}=s;return await Promise.resolve(o.provideDocumentRangeFormattingEdits(e,t,i,n))}}});var k6,zb,I6=R(()=>{k6=E(H());Et();Ye();zb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),k6.Disposable.create(()=>{this.providers.delete(i)})}async provideHover(e,t,i){let n=this.getProviders(e);if(n.length===0)return null;let s=[];for(let o=0,a=n.length;o<a;o+=1){let l=n[o],c=await Promise.resolve(l.provider.provideHover(e,t,i));c&&c.contents!=""&&s.push(c)}return s}}});var O6,Vb,L6=R(()=>{O6=E(H());Et();Ye();Vb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),O6.Disposable.create(()=>{this.providers.delete(i)})}async provideReferences(e,t,i){let n=this.getProviders(e);if(!n.length)return null;let s=await Promise.all(n.map(o=>{let{provider:a}=o;return Promise.resolve(a.provideImplementation(e,t,i))}));return this.toLocations(s)}}});var A6,xIe,Gb,F6=R(()=>{Ye();A6=E(H());Et();xIe=U()("linkedEditingManager"),Gb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),A6.Disposable.create(()=>{this.providers.delete(i)})}async provideLinkedEditingRanges(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return s.provideLinkedEditingRanges?await Promise.resolve(s.provideLinkedEditingRanges(e,t,i)):null}}});var M6,RIe,Kb,N6=R(()=>{M6=E(H());Y();RIe=U()("onTypeFormatManager"),Kb=class{constructor(){this.providers=new Set}register(e,t,i){let n={triggerCharacters:i,selector:e,provider:t};return this.providers.add(n),M6.Disposable.create(()=>{this.providers.delete(n)})}hasProvider(e){for(let t of this.providers){let{selector:i}=t;if(v.match(i,e)>0)return!0}return!1}getProvider(e,t){for(let i of this.providers){let{triggerCharacters:n,selector:s}=i;if(v.match(s,e)>0&&n.includes(t))return i.provider}return null}async onCharacterType(e,t,i,n){let s=this.getProvider(t,e);if(!s)return;let o=await v.getFormatOptions(t.uri);return await Promise.resolve(s.provideOnTypeFormattingEdits(t,i,e,o,n))}}});var q6,Jb,$6=R(()=>{q6=E(H());Et();Ye();Jb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),q6.Disposable.create(()=>{this.providers.delete(i)})}async provideReferences(e,t,i,n){let s=this.getProviders(e);if(!s.length)return null;let o=await Promise.all(s.map(a=>{let{provider:l}=a;return Promise.resolve(l.provideReferences(e,t,i,n))}));return this.toLocations(o)}}});var B6,Yb,j6=R(()=>{B6=E(H());Et();Ye();Yb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),B6.Disposable.create(()=>{this.providers.delete(i)})}async provideRenameEdits(e,t,i,n){let s=this.getProvider(e);if(!s)return null;let{provider:o}=s;return await Promise.resolve(o.provideRenameEdits(e,t,i,n))}async prepareRename(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;if(s.prepareRename==null)return null;let o=await Promise.resolve(s.prepareRename(e,t,i));return o==null?!1:o}}});var U6,Xb,H6=R(()=>{U6=E(H());Et();Ye();Xb=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),U6.Disposable.create(()=>{this.providers.delete(i)})}async provideSelectionRanges(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n,o=await Promise.resolve(s.provideSelectionRanges(e,t,i));if(!o||o.length==0)return[];for(let a=0;a<o.length-1;a++){let l=o[a];l.parent||(l.parent=o[a+1])}return o}}});var W6,lOe,Zb,z6=R(()=>{Ye();W6=E(H());Et();lOe=U()("semanticTokensManager"),Zb=class extends me{constructor(){super(...arguments);this.resolvedProvider=new Map}register(e,t,i,n){let s=ue(),o={id:s,selector:e,legend:i,provider:t};this.providers.add(o);let a;return typeof t.onDidChangeSemanticTokens=="function"&&(a=t.onDidChangeSemanticTokens(()=>{n()})),W6.Disposable.create(()=>{a==null||a.dispose();for(let[l,c]of this.resolvedProvider.entries())c==s&&this.resolvedProvider.delete(l);this.providers.delete(o)})}getLegend(e){let t=this.getProvider(e);if(!!t)return this.resolvedProvider.set(e.uri,t.id),t.legend}resolveProvider(e){var i;let t=this.resolvedProvider.get(e.uri);return t?this.getProviderById(t):(i=this.getProvider(e))==null?void 0:i.provider}hasSemanticTokensEdits(e){let t=this.resolveProvider(e);return t?typeof t.provideDocumentSemanticTokensEdits=="function":!1}async provideDocumentSemanticTokens(e,t){let i=this.resolveProvider(e);return!i||typeof i.provideDocumentSemanticTokens!="function"?null:await Promise.resolve(i.provideDocumentSemanticTokens(e,t))}async provideDocumentSemanticTokensEdits(e,t,i){let n=this.resolveProvider(e);return!n||typeof n.provideDocumentSemanticTokensEdits!="function"?null:await Promise.resolve(n.provideDocumentSemanticTokensEdits(e,t,i))}}});var V6,bOe,Qb,G6=R(()=>{Ye();V6=E(H());Et();bOe=U()("semanticTokensRangeManager"),Qb=class extends me{register(e,t,i){let n={id:ue(),selector:e,legend:i,provider:t};return this.providers.add(n),V6.Disposable.create(()=>{this.providers.delete(n)})}getLegend(e){let t=this.getProvider(e);if(!!t)return t.legend}async provideDocumentRangeSemanticTokens(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:s}=n;return s.provideDocumentRangeSemanticTokens===null?null:await Promise.resolve(s.provideDocumentRangeSemanticTokens(e,t,i))}}});var K6,ey,J6=R(()=>{K6=E(H());Et();Ye();ey=class extends me{register(e,t,i){let n=i.reduce((o,a)=>o.concat(a.length==1?[a]:a.split(/\s*/g)),[]),s={id:ue(),selector:e,provider:t,triggerCharacters:n};return this.providers.add(s),K6.Disposable.create(()=>{this.providers.delete(s)})}shouldTrigger(e,t){let i=this.getProvider(e);if(!i)return!1;let{triggerCharacters:n}=i;return n&&n.indexOf(t)!=-1}async provideSignatureHelp(e,t,i,n){let s=this.getProvider(e);if(!s)return null;let o=await Promise.resolve(s.provider.provideSignatureHelp(e,t,i,n));return o&&o.signatures&&o.signatures.length?o:null}}});var Y6,ty,X6=R(()=>{Y6=E(H());Et();Ye();ty=class extends me{register(e,t){let i={id:ue(),selector:e,provider:t};return this.providers.add(i),Y6.Disposable.create(()=>{this.providers.delete(i)})}async provideTypeDefinition(e,t,i){let n=this.getProviders(e);if(!n.length)return null;let s=await Promise.all(n.map(o=>{let{provider:a}=o;return Promise.resolve(a.provideTypeDefinition(e,t,i))}));return this.toLocations(s)}}});var Z6,iy,Q6=R(()=>{Ye();Z6=E(H()),iy=class{constructor(){this.providers=new Map}register(e){let t=ue();return this.providers.set(t,e),Z6.Disposable.create(()=>{this.providers.delete(t)})}async provideWorkspaceSymbols(e,t){let i=Array.from(this.providers.entries());if(!i.length)return[];let n=[];return await Promise.all(i.map(s=>{let[o,a]=s;return Promise.resolve(a.provideWorkspaceSymbols(e,t)).then(l=>{l&&n.push(...l.map(c=>Object.assign({source:o},c)))})})),n}async resolveWorkspaceSymbol(e,t){let i=this.providers.get(e.source);if(!!i)return typeof i.resolveWorkspaceSymbol!="function"?Promise.resolve(e):await Promise.resolve(i.resolveWorkspaceSymbol(e,t))}hasProvider(){return this.providers.size>0}}});var Gs,W1e,e8,N,Re=R(()=>{Gs=E(H());Xa();c6();u6();d6();p6();m6();v6();y6();x6();C6();E6();D6();P6();I6();L6();F6();N6();$6();j6();H6();z6();G6();J6();X6();Q6();W1e=U()("languages"),e8=class{constructor(){this._onDidSemanticTokensRefresh=new Gs.Emitter;this.onDidSemanticTokensRefresh=this._onDidSemanticTokensRefresh.event;this.onTypeFormatManager=new Kb;this.documentLinkManager=new Bb;this.documentColorManager=new qb;this.foldingRangeManager=new Ub;this.renameManager=new Yb;this.formatManager=new Hb;this.codeActionManager=new Lb;this.workspaceSymbolsManager=new iy;this.formatRangeManager=new Wb;this.hoverManager=new zb;this.signatureManager=new ey;this.documentSymbolManager=new jb;this.documentHighlightManager=new $b;this.definitionManager=new Nb;this.declarationManager=new Fb;this.typeDefinitionManager=new ty;this.referenceManager=new Jb;this.implementationManager=new Vb;this.codeLensManager=new Ab;this.selectionRangeManager=new Xb;this.callHierarchyManager=new Ib;this.semanticTokensManager=new Zb;this.semanticTokensRangeManager=new Qb;this.linkedEditingManager=new Gb;this.cancelTokenSource=new Gs.CancellationTokenSource}hasFormatProvider(e){return!!(this.formatManager.hasProvider(e)||this.formatRangeManager.hasProvider(e))}registerOnTypeFormattingEditProvider(e,t,i){return this.onTypeFormatManager.register(e,t,i)}registerCompletionItemProvider(e,t,i,n,s=[],o,a){return i=typeof i=="string"?[{language:i}]:i,(xl(),t8).default.createLanguageSource(e,t,i,n,s,o,a)}registerCodeActionProvider(e,t,i,n){return this.codeActionManager.register(e,t,i,n)}registerHoverProvider(e,t){return this.hoverManager.register(e,t)}registerSelectionRangeProvider(e,t){return this.selectionRangeManager.register(e,t)}registerSignatureHelpProvider(e,t,i){return this.signatureManager.register(e,t,i)}registerDocumentSymbolProvider(e,t,i){return this.documentSymbolManager.register(e,t,i==null?void 0:i.label)}registerFoldingRangeProvider(e,t){return this.foldingRangeManager.register(e,t)}registerDocumentHighlightProvider(e,t){return this.documentHighlightManager.register(e,t)}registerCodeLensProvider(e,t){return this.codeLensManager.register(e,t)}registerDocumentLinkProvider(e,t){return this.documentLinkManager.register(e,t)}registerDocumentColorProvider(e,t){return this.documentColorManager.register(e,t)}registerDefinitionProvider(e,t){return this.definitionManager.register(e,t)}registerDeclarationProvider(e,t){return this.declarationManager.register(e,t)}registerTypeDefinitionProvider(e,t){return this.typeDefinitionManager.register(e,t)}registerImplementationProvider(e,t){return this.implementationManager.register(e,t)}registerReferencesProvider(e,t){return this.referenceManager.register(e,t)}registerRenameProvider(e,t){return this.renameManager.register(e,t)}registerWorkspaceSymbolProvider(e){return arguments.length>1&&typeof arguments[1].provideWorkspaceSymbols=="function"&&(e=arguments[1]),this.workspaceSymbolsManager.register(e)}registerDocumentFormatProvider(e,t,i=0){return this.formatManager.register(e,t,i)}registerDocumentRangeFormatProvider(e,t,i=0){return this.formatRangeManager.register(e,t,i)}registerCallHierarchyProvider(e,t){return this.callHierarchyManager.register(e,t)}registerDocumentSemanticTokensProvider(e,t,i){return this._onDidSemanticTokensRefresh.fire(e),this.semanticTokensManager.register(e,t,i,()=>{this._onDidSemanticTokensRefresh.fire(e)})}registerDocumentRangeSemanticTokensProvider(e,t,i){return this._onDidSemanticTokensRefresh.fire(e),this.semanticTokensRangeManager.register(e,t,i)}registerLinkedEditingRangeProvider(e,t){return this.linkedEditingManager.register(e,t)}shouldTriggerSignatureHelp(e,t){return this.signatureManager.shouldTrigger(e,t)}async getHover(e,t,i){return await this.hoverManager.provideHover(e,t,i)}async getSignatureHelp(e,t,i,n){return await this.signatureManager.provideSignatureHelp(e,t,i,n)}async getDefinition(e,t,i){return this.definitionManager.hasProvider(e)?await this.definitionManager.provideDefinition(e,t,i):null}async getDefinitionLinks(e,t,i){return this.definitionManager.hasProvider(e)?await this.definitionManager.provideDefinitionLinks(e,t,i):null}async getDeclaration(e,t,i){return this.declarationManager.hasProvider(e)?await this.declarationManager.provideDeclaration(e,t,i):null}async getTypeDefinition(e,t,i){return this.typeDefinitionManager.hasProvider(e)?await this.typeDefinitionManager.provideTypeDefinition(e,t,i):null}async getImplementation(e,t,i){return this.implementationManager.hasProvider(e)?await this.implementationManager.provideReferences(e,t,i):null}async getReferences(e,t,i,n){return this.referenceManager.hasProvider(e)?await this.referenceManager.provideReferences(e,i,t,n):null}async getDocumentSymbol(e,t){return await this.documentSymbolManager.provideDocumentSymbols(e,t)}async getSelectionRanges(e,t,i){return await this.selectionRangeManager.provideSelectionRanges(e,t,i)}async getWorkspaceSymbols(e,t){return e=e||"",await this.workspaceSymbolsManager.provideWorkspaceSymbols(e,t)}async resolveWorkspaceSymbol(e,t){return await this.workspaceSymbolsManager.resolveWorkspaceSymbol(e,t)}async prepareRename(e,t,i){return await this.renameManager.prepareRename(e,t,i)}async provideRenameEdits(e,t,i,n){return await this.renameManager.provideRenameEdits(e,t,i,n)}async provideDocumentFormattingEdits(e,t,i){if(!this.formatManager.hasProvider(e)){if(!this.formatRangeManager.hasProvider(e))return null;let s=e.positionAt(e.getText().length),o=Gs.Range.create(Gs.Position.create(0,0),s);return await this.provideDocumentRangeFormattingEdits(e,o,t,i)}return await this.formatManager.provideDocumentFormattingEdits(e,t,i)}async provideDocumentRangeFormattingEdits(e,t,i,n){return this.formatRangeManager.hasProvider(e)?await this.formatRangeManager.provideDocumentRangeFormattingEdits(e,t,i,n):null}async getCodeActions(e,t,i,n){return await this.codeActionManager.provideCodeActions(e,t,i,n)}async getDocumentHighLight(e,t,i){return await this.documentHighlightManager.provideDocumentHighlights(e,t,i)}async getDocumentLinks(e,t){return this.documentLinkManager.hasProvider(e)?await this.documentLinkManager.provideDocumentLinks(e,t)||[]:null}async resolveDocumentLink(e){return await this.documentLinkManager.resolveDocumentLink(e,this.token)}async provideDocumentColors(e,t){return await this.documentColorManager.provideDocumentColors(e,t)}async provideFoldingRanges(e,t,i){return this.foldingRangeManager.hasProvider(e)?await this.foldingRangeManager.provideFoldingRanges(e,t,i):null}async provideColorPresentations(e,t,i){return await this.documentColorManager.provideColorPresentations(e,t,i)}async getCodeLens(e,t){return await this.codeLensManager.provideCodeLenses(e,t)}async resolveCodeLens(e,t){return e.command!=null?e:await this.codeLensManager.resolveCodeLens(e,t)}async resolveCodeAction(e,t){return await this.codeActionManager.resolveCodeAction(e,t)}async provideDocumentOnTypeEdits(e,t,i,n){return this.onTypeFormatManager.onCharacterType(e,t,i,n)}canFormatOnType(e,t){return this.onTypeFormatManager.getProvider(t,e)!=null}async prepareCallHierarchy(e,t,i){return this.callHierarchyManager.prepareCallHierarchy(e,t,i)}async provideIncomingCalls(e,t,i){return this.callHierarchyManager.provideCallHierarchyIncomingCalls(e,t,i)}async provideOutgoingCalls(e,t,i){return this.callHierarchyManager.provideCallHierarchyOutgoingCalls(e,t,i)}getLegend(e,t){return t?this.semanticTokensRangeManager.getLegend(e):this.semanticTokensManager.getLegend(e)}hasSemanticTokensEdits(e){return this.semanticTokensManager.hasSemanticTokensEdits(e)}async provideDocumentSemanticTokens(e,t){return this.semanticTokensManager.provideDocumentSemanticTokens(e,t)}async provideDocumentSemanticTokensEdits(e,t,i){return this.semanticTokensManager.provideDocumentSemanticTokensEdits(e,t,i)}async provideDocumentRangeSemanticTokens(e,t,i){return this.semanticTokensRangeManager.provideDocumentRangeSemanticTokens(e,t,i)}hasLinkedEditing(e){return this.linkedEditingManager.hasProvider(e)}async provideLinkedEdits(e,t,i){return this.linkedEditingManager.provideLinkedEditingRanges(e,t,i)}hasProvider(e,t){switch(e){case"formatOnType":return this.onTypeFormatManager.hasProvider(t);case"rename":return this.renameManager.hasProvider(t);case"onTypeEdit":return this.onTypeFormatManager.hasProvider(t);case"documentLink":return this.documentLinkManager.hasProvider(t);case"documentColor":return this.documentColorManager.hasProvider(t);case"foldingRange":return this.foldingRangeManager.hasProvider(t);case"format":return this.formatManager.hasProvider(t)||this.formatRangeManager.hasProvider(t);case"codeAction":return this.codeActionManager.hasProvider(t);case"workspaceSymbols":return this.workspaceSymbolsManager.hasProvider();case"formatRange":return this.formatRangeManager.hasProvider(t);case"hover":return this.hoverManager.hasProvider(t);case"signature":return this.signatureManager.hasProvider(t);case"documentSymbol":return this.documentSymbolManager.hasProvider(t);case"documentHighlight":return this.documentHighlightManager.hasProvider(t);case"definition":return this.definitionManager.hasProvider(t);case"declaration":return this.declarationManager.hasProvider(t);case"typeDefinition":return this.typeDefinitionManager.hasProvider(t);case"reference":return this.referenceManager.hasProvider(t);case"implementation":return this.implementationManager.hasProvider(t);case"codeLens":return this.codeLensManager.hasProvider(t);case"selectionRange":return this.selectionRangeManager.hasProvider(t);case"callHierarchy":return this.callHierarchyManager.hasProvider(t);case"semanticTokens":return this.semanticTokensManager.hasProvider(t);case"linkedEditing":return this.linkedEditingManager.hasProvider(t);default:throw new Error(`Invalid provider name: ${e}`)}}createDiagnosticCollection(e){return Lt.create(e)}get token(){return this.cancelTokenSource=new Gs.CancellationTokenSource,this.cancelTokenSource.token}},N=new e8});var an,$u=R(()=>{Nc();yt();an=class{constructor(){this.lines=[];this.highlights=[]}addLine(e,t){if(e.includes(`
`)){for(let i of e.split(/\r?\n/))this.addLine(i,t);return}if(t&&this.highlights.push({lnum:this.lines.length,colStart:e.match(/^\s*/)[0].length,colEnd:re(e),hlGroup:t}),e.includes("")){let i=Mc(e);for(let n of i.highlights){let{span:s,hlGroup:o}=n;s[0]!=s[1]&&this.highlights.push({lnum:this.lines.length,colStart:s[0],colEnd:s[1],hlGroup:o})}this.lines.push(i.line)}else this.lines.push(e)}addLines(e){this.lines.push(...e)}addTexts(e){this.addLines("");for(let t of e)this.addText(t.text,t.hlGroup)}addText(e,t){let{lines:i}=this,n=i[i.length-1]||"";if(t){let s=re(n);this.highlights.push({lnum:i.length?i.length-1:0,colStart:s,colEnd:s+re(e),hlGroup:t})}i.length?i[i.length-1]=`${n}${e}`:i.push(e)}get length(){return this.lines.length}getline(e){return this.lines[e]||""}render(e,t=0,i=-1){e.setLines(this.lines,{start:t,end:i,strictIndexing:!1},!0);for(let n of this.highlights)e.addHighlight({hlGroup:n.hlGroup,colStart:n.colStart,colEnd:n.colEnd==null?-1:n.colEnd,line:t+n.lnum,srcId:-1})}}});var r8=x((J1e,i8)=>{"use strict";i8.exports=H()});function s8(r,e){if(!r.killed)if(ame)try{let t={stdio:["pipe","pipe","ignore"]};return e&&(t.cwd=e),Qh.execFileSync("taskkill",["/T","/F","/PID",r.pid.toString()],t),!0}catch(t){return!1}else if(cme||lme)try{let t=(0,ry.join)(ume,"bin/terminateProcess.sh");return n8.default.existsSync(t)?!Qh.spawnSync(t,[r.pid.toString()]).error:(console.error(`"${t}" not found`),!1)}catch(t){return!1}else return r.kill("SIGKILL"),!0}var Qh,ry,n8,ame,lme,cme,ume,o8=R(()=>{Qh=E(require("child_process")),ry=E(require("path")),n8=E(require("fs")),ame=process.platform==="win32",lme=process.platform==="darwin",cme=process.platform==="linux",ume=(0,ry.dirname)(__dirname)});var a8,aLe,ep,HT=R(()=>{a8=E(H());de();Te();"use strict";aLe=U()("language-client-progressPart"),ep=class{constructor(e,t,i){this.client=e;this.token=t;this.disposables=[];this._cancelled=!1;this.statusBarItem=D.createStatusBarItem(99,{progress:!0}),this.disposables.push(e.onProgress(a8.WorkDoneProgress.type,this.token,n=>{switch(n.kind){case"begin":this.begin(n);break;case"report":this.report(n);break;case"end":this.done(n.message),i&&i(this);break}}))}begin(e){typeof this.title!="string"&&(this.title=e.title,this.report(e))}report(e){let t=this.statusBarItem,i=[];this.title&&i.push(this.title),typeof e.percentage=="number"&&i.push(e.percentage.toFixed(0)+"%"),e.message&&i.push(e.message),t.text=i.join(" "),t.show()}cancel(){this._cancelled||(this._cancelled=!0,G(this.disposables))}done(e){if(this._cancelled)return;let t=this.statusBarItem;t.text=`${this.title} ${e||"finished"}`,setTimeout(()=>{t.dispose()},300),this.cancel()}}});var WT,zT,l8=R(()=>{WT=E(H()),zT=class{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(i=>{this.onSuccess=i}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;let i=this.task();return this.task=void 0,i})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,WT.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}dispose(){this.cancelTimeout()}cancelTimeout(){this.timeout!==void 0&&((0,WT.RAL)().timer.clearTimeout(this.timeout),this.timeout=void 0)}}});function c8(r){return{uri:r.uri,languageId:r.languageId,version:r.version,text:r.getText()}}function u8(r){return{textDocument:{uri:r.uri}}}function f8(r){return{textDocument:{uri:r.uri,version:r.version},contentChanges:[{text:r.getText()}]}}function VT(r){return{textDocument:ny(r.document),reason:r.reason}}function ny(r){return{uri:r.uri,version:r.version}}function d8(r,e){let t={textDocument:ny(r)};return e&&(t.text=r.getText()),t}function tp(r){return r.toString()}function h8(r,e,t){return{textDocument:{uri:r.uri},position:e,context:ns(t,["option"])}}function ur(r,e){return{textDocument:{uri:r.uri},position:e}}function p8(r,e,t){return{textDocument:Sl(r),position:e,context:t}}function Sl(r){return{uri:r.uri}}function m8(r,e,t){return{textDocument:{uri:r.uri},position:e,context:{includeDeclaration:t.includeDeclaration}}}function g8(r){return{textDocument:{uri:r.uri}}}function v8(r){return{textDocument:{uri:r.uri}}}var ea=R(()=>{Nu()});function We(){return ue()}var sy=R(()=>{Ye()});function fme(r,e,t,i,n){let s=new y8,o=(0,C.createProtocolConnection)(r,e,s,n);return o.onError(l=>{t(l[0],l[1],l[2])}),o.onClose(i),{listen:()=>o.listen(),sendRequest:(l,...c)=>o.sendRequest(Me(l)?l:l.method,...c),onRequest:(l,c)=>o.onRequest(Me(l)?l:l.method,c),sendNotification:(l,c)=>o.sendNotification(Me(l)?l:l.method,c),onNotification:(l,c)=>o.onNotification(Me(l)?l:l.method,c),onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(l,c,u)=>{let f={sendNotification:!1,traceFormat:C.TraceFormat.Text};u===void 0?o.trace(l,c,f):(Os(u),o.trace(l,c,u))},initialize:l=>o.sendRequest(C.InitializeRequest.type,l),shutdown:()=>o.sendRequest(C.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(C.ExitNotification.type),onLogMessage:l=>o.onNotification(C.LogMessageNotification.type,l),onShowMessage:l=>o.onNotification(C.ShowMessageNotification.type,l),onTelemetry:l=>o.onNotification(C.TelemetryEventNotification.type,l),didChangeConfiguration:l=>o.sendNotification(C.DidChangeConfigurationNotification.type,l),didChangeWatchedFiles:l=>o.sendNotification(C.DidChangeWatchedFilesNotification.type,l),didOpenTextDocument:l=>o.sendNotification(C.DidOpenTextDocumentNotification.type,l),didChangeTextDocument:l=>o.sendNotification(C.DidChangeTextDocumentNotification.type,l),didCloseTextDocument:l=>o.sendNotification(C.DidCloseTextDocumentNotification.type,l),didSaveTextDocument:l=>o.sendNotification(C.DidSaveTextDocumentNotification.type,l),onDiagnostics:l=>o.onNotification(C.PublishDiagnosticsNotification.type,l),dispose:()=>o.dispose()}}function ie(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var GT,C,b8,ta,y8,KT,Cl,ss,w8,fr,dr,ye,x8,dme,S8,JT,os,C8,_8,E8,T8,D8,R8,P8,Fe,k8,I8,O8,L8,A8,F8,M8,N8,q8,$8,B8,j8,U8,H8,W8,z8,V8,G8,Bu,YT,XT,ln=R(()=>{GT=E(require("path")),C=E(H());qe();Ei();Re();Nt();Wr();Nu();Te();Y();xl();HT();l8();b8=E(require("os"));ea();sy();ta=U()("language-client-client"),y8=class{error(e){ta.error(e)}warn(e){ta.warn(e)}info(e){ta.info(e)}log(e){ta.log(e)}},KT=class{error(e){}warn(e){}info(e){}log(e){}};(function(t){t[t.Continue=1]="Continue",t[t.Shutdown=2]="Shutdown"})(Cl||(Cl={}));(function(t){t[t.DoNotRestart=1]="DoNotRestart",t[t.Restart=2]="Restart"})(ss||(ss={}));w8=class{constructor(e,t){this.name=e;this.maxRestartCount=t;this.restarts=[]}error(e,t,i){return i&&i<=3?1:2}closed(){return this.restarts.push(Date.now()),this.restarts.length<this.maxRestartCount?2:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?(D.showMessage(`The "${this.name}" server crashed ${this.maxRestartCount} times in the last 3 minutes. The server will not be restarted.`,"error"),1):(this.restarts.shift(),2)}};(function(n){n[n.Info=1]="Info",n[n.Warn=2]="Warn",n[n.Error=3]="Error",n[n.Never=4]="Never"})(fr||(fr={}));(function(i){i[i.Stopped=1]="Stopped",i[i.Running=2]="Running",i[i.Starting=3]="Starting"})(dr||(dr={}));(function(o){o[o.Initial=0]="Initial",o[o.Starting=1]="Starting",o[o.StartFailed=2]="StartFailed",o[o.Running=3]="Running",o[o.Stopping=4]="Stopping",o[o.Stopped=5]="Stopped"})(ye||(ye={}));x8=[C.SymbolKind.File,C.SymbolKind.Module,C.SymbolKind.Namespace,C.SymbolKind.Package,C.SymbolKind.Class,C.SymbolKind.Method,C.SymbolKind.Property,C.SymbolKind.Field,C.SymbolKind.Constructor,C.SymbolKind.Enum,C.SymbolKind.Interface,C.SymbolKind.Function,C.SymbolKind.Variable,C.SymbolKind.Constant,C.SymbolKind.String,C.SymbolKind.Number,C.SymbolKind.Boolean,C.SymbolKind.Array,C.SymbolKind.Object,C.SymbolKind.Key,C.SymbolKind.Null,C.SymbolKind.EnumMember,C.SymbolKind.Struct,C.SymbolKind.Event,C.SymbolKind.Operator,C.SymbolKind.TypeParameter],dme=[C.CompletionItemKind.Text,C.CompletionItemKind.Method,C.CompletionItemKind.Function,C.CompletionItemKind.Constructor,C.CompletionItemKind.Field,C.CompletionItemKind.Variable,C.CompletionItemKind.Class,C.CompletionItemKind.Interface,C.CompletionItemKind.Module,C.CompletionItemKind.Property,C.CompletionItemKind.Unit,C.CompletionItemKind.Value,C.CompletionItemKind.Enum,C.CompletionItemKind.Keyword,C.CompletionItemKind.Snippet,C.CompletionItemKind.Color,C.CompletionItemKind.File,C.CompletionItemKind.Reference,C.CompletionItemKind.Folder,C.CompletionItemKind.EnumMember,C.CompletionItemKind.Constant,C.CompletionItemKind.Struct,C.CompletionItemKind.Event,C.CompletionItemKind.Operator,C.CompletionItemKind.TypeParameter],S8=[C.SymbolTag.Deprecated];(function(e){function r(t){let i=t;return i&&_o(i.register)&&_o(i.unregister)&&_o(i.dispose)&&i.registrationType!==void 0}e.is=r})(JT||(JT={}));os=class{constructor(e,t,i,n,s,o){this._client=e;this._event=t;this._type=i;this._middleware=n;this._createParams=s;this._selectorFilter=o;this._selectors=new Map}static textDocumentFilter(e,t){for(let i of e)if(v.match(i,t)>0)return!0;return!1}register(e){!e.registerOptions.documentSelector||(this._listener||(this._listener=this._event(this.callback,this)),this._selectors.set(e.id,e.registerOptions.documentSelector))}callback(e){(!this._selectorFilter||this._selectorFilter(this._selectors.values(),e))&&(this._middleware?this._middleware(e,t=>this._client.sendNotification(this._type,this._createParams(t))):this._client.sendNotification(this._type,this._createParams(e)),this.notificationSent(e))}notificationSent(e){}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(let t of this._selectors.values())if(v.match(t,e))return{send:i=>{this.callback(i)}}}},C8=class extends os{constructor(e,t){super(e,v.onDidOpenTextDocument,C.DidOpenTextDocumentNotification.type,e.clientOptions.middleware.didOpen,i=>({textDocument:c8(i)}),os.textDocumentFilter);this._syncedDocuments=t}get registrationType(){return C.DidOpenTextDocumentNotification.type}fillClientCapabilities(e){ie(ie(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:We(),registerOptions:{documentSelector:t}})}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;let t=e.registerOptions.documentSelector;v.textDocuments.forEach(i=>{let n=i.uri.toString();if(!this._syncedDocuments.has(n)&&v.match(t,i)>0){let s=this._client.clientOptions.middleware,o=a=>{this._client.sendNotification(this._type,this._createParams(a))};s.didOpen?s.didOpen(i,o):o(i),this._syncedDocuments.set(n,i)}})}notificationSent(e){super.notificationSent(e),this._syncedDocuments.set(e.uri.toString(),e)}},_8=class extends os{constructor(e,t){super(e,v.onDidCloseTextDocument,C.DidCloseTextDocumentNotification.type,e.clientOptions.middleware.didClose,i=>u8(i),os.textDocumentFilter);this._syncedDocuments=t}get registrationType(){return C.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){ie(ie(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:We(),registerOptions:{documentSelector:t}})}notificationSent(e){super.notificationSent(e),this._syncedDocuments.delete(e.uri.toString())}unregister(e){let t=this._selectors.get(e);super.unregister(e);let i=this._selectors.values();this._syncedDocuments.forEach(n=>{if(v.match(t,n)>0&&!this._selectorFilter(i,n)){let s=this._client.clientOptions.middleware,o=a=>{this._client.sendNotification(this._type,this._createParams(a))};this._syncedDocuments.delete(n.uri.toString()),s.didClose?s.didClose(n,o):o(n)}})}},E8=class{constructor(e){this._client=e;this._changeData=new Map}get registrationType(){return C.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){ie(ie(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==C.TextDocumentSyncKind.None&&this.register({id:We(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){!e.registerOptions.documentSelector||(this._listener||(this._listener=v.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{documentSelector:e.registerOptions.documentSelector,syncKind:e.registerOptions.syncKind}))}callback(e){if(e.contentChanges.length===0)return;let t=v.getDocument(e.textDocument.uri);if(!t)return;let{textDocument:i}=t;for(let n of this._changeData.values())if(v.match(n.documentSelector,i)>0){let s=this._client.clientOptions.middleware;if(n.syncKind===C.TextDocumentSyncKind.Incremental)s.didChange?s.didChange(e,()=>this._client.sendNotification(C.DidChangeTextDocumentNotification.type,ns(e,["bufnr","original"]))):this._client.sendNotification(C.DidChangeTextDocumentNotification.type,ns(e,["bufnr","original"]));else if(n.syncKind===C.TextDocumentSyncKind.Full){let o=a=>{let{textDocument:l}=v.getDocument(a.textDocument.uri);this._client.sendNotification(C.DidChangeTextDocumentNotification.type,f8(l))};s.didChange?s.didChange(e,o):o(e)}}}unregister(e){this._changeData.delete(e),this._changeData.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._changeData.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(let t of this._changeData.values())if(v.match(t.documentSelector,e))return{send:i=>{this.callback(i)}}}},T8=class extends os{constructor(e){super(e,v.onWillSaveTextDocument,C.WillSaveTextDocumentNotification.type,e.clientOptions.middleware.willSave,t=>VT(t),(t,i)=>os.textDocumentFilter(t,i.document))}get registrationType(){return C.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:We(),registerOptions:{documentSelector:t}})}},D8=class{constructor(e){this._client=e;this._selectors=new Map}get registrationType(){return C.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:We(),registerOptions:{documentSelector:t}})}register(e){!e.registerOptions.documentSelector||(this._listener||(this._listener=v.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,e.registerOptions.documentSelector))}callback(e){if(os.textDocumentFilter(this._selectors.values(),e.document)){let t=this._client.clientOptions.middleware,i=n=>this._client.sendRequest(C.WillSaveTextDocumentWaitUntilRequest.type,VT(n)).then(s=>s||[],s=>(D.showMessage(`Error on willSaveWaitUntil: ${s}`,"error"),ta.error(s),[]));e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,i):i(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}},R8=class extends os{constructor(e){super(e,v.onDidSaveTextDocument,C.DidSaveTextDocumentNotification.type,e.clientOptions.middleware.didSave,t=>d8(t,this._includeText),os.textDocumentFilter);this._includeText=!1}get registrationType(){return C.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){ie(ie(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;if(t&&i&&i.save){let n=typeof i.save=="boolean"?{includeText:!1}:{includeText:!!i.save.includeText};this.register({id:We(),registerOptions:Object.assign({},{documentSelector:t},n)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}},P8=class{constructor(e,t){this._notifyFileEvent=t;this._watchers=new Map}get registrationType(){return C.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){ie(ie(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;let t=[];for(let i of e.registerOptions.watchers){if(!Me(i.globPattern))continue;let n=!0,s=!0,o=!0;i.kind!=null&&(n=(i.kind&C.WatchKind.Create)!=0,s=(i.kind&C.WatchKind.Change)!=0,o=(i.kind&C.WatchKind.Delete)!=0);let a=v.createFileSystemWatcher(i.globPattern,!n,!s,!o);this.hookListeners(a,n,s,o,t),t.push(a)}this._watchers.set(e.id,t)}registerRaw(e,t){let i=[];for(let n of t)i.push(n),this.hookListeners(n,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,n,s){t&&e.onDidCreate(o=>this._notifyFileEvent({uri:tp(o),type:C.FileChangeType.Created}),null,s),i&&e.onDidChange(o=>this._notifyFileEvent({uri:tp(o),type:C.FileChangeType.Changed}),null,s),n&&e.onDidDelete(o=>this._notifyFileEvent({uri:tp(o),type:C.FileChangeType.Deleted}),null,s)}unregister(e){let t=this._watchers.get(e);if(t)for(let i of t)i.dispose()}dispose(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}},Fe=class{constructor(e,t){this._client=e;this._registrationType=t;this._registrations=new Map}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t&&t.disposable.dispose()}dispose(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(C.TextDocumentRegistrationOptions.is(t)){let i=C.StaticRegistrationOptions.hasId(t)?t.id:We(),n=t.documentSelector||e;if(n)return[i,Object.assign({},t,{documentSelector:n})]}else if(Os(t)&&t===!0||C.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];let i=Os(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[We(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Os(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(let t of this._registrations.values()){let i=t.data.registerOptions.documentSelector;if(i!==null&&v.match(i,e)>0)return t.provider}}getAllProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}},k8=class{constructor(e,t){this._client=e;this._registrationType=t;this._registrations=new Map}get registrationType(){return this._registrationType}register(e){let t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t&&t.disposable.dispose()}dispose(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}},I8=class extends Fe{constructor(e){super(e,C.CompletionRequest.type)}fillClientCapabilities(e){let t=this._client.clientOptions.disableSnippetCompletion!==!0,i=ie(ie(e,"textDocument"),"completion");i.dynamicRegistration=!0,i.contextSupport=!0,i.completionItem={snippetSupport:t,commitCharactersSupport:!0,documentationFormat:this._client.supporedMarkupKind,deprecatedSupport:!0,preselectSupport:!0,insertReplaceSupport:!0,tagSupport:{valueSet:[C.CompletionItemTag.Deprecated]},resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[C.InsertTextMode.asIs,C.InsertTextMode.adjustIndentation]}},i.completionItemKind={valueSet:dme}}initialize(e,t){this.index=0;let i=this.getRegistrationOptions(t,e.completionProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t=e.triggerCharacters||[],i=e.allCommitCharacters||[],n=e.priority,s={provideCompletionItems:(l,c,u,f)=>{let d=this._client,h=this._client.clientOptions.middleware,p=(g,b,y,S)=>d.sendRequest(C.CompletionRequest.type,h8(g,b,y),S).then(w=>w,w=>d.handleFailedRequest(C.CompletionRequest.type,S,w,null));return h.provideCompletionItem?h.provideCompletionItem(l,c,f,u,p):p(l,c,f,u)},resolveCompletionItem:e.resolveProvider?(l,c)=>{let u=this._client,f=this._client.clientOptions.middleware,d=(h,p)=>u.sendRequest(C.CompletionResolveRequest.type,h,p).then(g=>g,g=>u.handleFailedRequest(C.CompletionResolveRequest.type,p,g,h));return f.resolveCompletionItem?f.resolveCompletionItem(l,c,d):d(l,c)}:void 0},o=this._client.id+(this.index?"-"+this.index:"");ht.removeSource(o);let a=N.registerCompletionItemProvider(o,"LS",e.documentSelector||this._client.clientOptions.documentSelector,s,t,n,i);return this.index=this.index+1,[a,s]}},O8=class extends Fe{constructor(e){super(e,C.HoverRequest.type)}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=this._client.supporedMarkupKind}initialize(e,t){let i=this.getRegistrationOptions(t,e.hoverProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideHover:(i,n,s)=>{let o=this._client,a=(c,u,f)=>o.sendRequest(C.HoverRequest.type,ur(c,u),f).then(d=>d,d=>o.handleFailedRequest(C.HoverRequest.type,f,d,null)),l=o.clientOptions.middleware;return l.provideHover?l.provideHover(i,n,s,a):a(i,n,s)}};return[N.registerHoverProvider(e.documentSelector,t),t]}},L8=class extends Fe{constructor(e){super(e,C.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.contextSupport=!0,t.signatureInformation={documentationFormat:this._client.supporedMarkupKind,activeParameterSupport:!0,parameterInformation:{labelOffsetSupport:!0}}}initialize(e,t){let i=this.getRegistrationOptions(t,e.signatureHelpProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideSignatureHelp:(s,o,a,l)=>{let c=this._client,u=(d,h,p,g)=>c.sendRequest(C.SignatureHelpRequest.type,p8(d,h,p),g).then(b=>b,b=>c.handleFailedRequest(C.SignatureHelpRequest.type,g,b,null)),f=c.clientOptions.middleware;return f.provideSignatureHelp?f.provideSignatureHelp(s,o,l,a,u):u(s,o,l,a)}},i=e.triggerCharacters||[];return[N.registerSignatureHelpProvider(e.documentSelector,t,i),t]}},A8=class extends Fe{constructor(e){super(e,C.DefinitionRequest.type)}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"definition");t.dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.definitionProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideDefinition:(i,n,s)=>{let o=this._client,a=(c,u,f)=>o.sendRequest(C.DefinitionRequest.type,ur(c,u),f).then(d=>d,d=>o.handleFailedRequest(C.DefinitionRequest.type,f,d,null)),l=o.clientOptions.middleware;return l.provideDefinition?l.provideDefinition(i,n,s,a):a(i,n,s)}};return[N.registerDefinitionProvider(e.documentSelector,t),t]}},F8=class extends Fe{constructor(e){super(e,C.ReferencesRequest.type)}fillClientCapabilities(e){ie(ie(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.referencesProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideReferences:(i,n,s,o)=>{let a=this._client,l=(u,f,d,h)=>a.sendRequest(C.ReferencesRequest.type,m8(u,f,d),h).then(p=>p,p=>a.handleFailedRequest(C.ReferencesRequest.type,h,p,null)),c=a.clientOptions.middleware;return c.provideReferences?c.provideReferences(i,n,s,o,l):l(i,n,s,o)}};return[N.registerReferencesProvider(e.documentSelector,t),t]}},M8=class extends Fe{constructor(e){super(e,C.DocumentHighlightRequest.type)}fillClientCapabilities(e){ie(ie(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentHighlightProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentHighlights:(i,n,s)=>{let o=this._client,a=(c,u,f)=>o.sendRequest(C.DocumentHighlightRequest.type,ur(c,u),f).then(d=>d,d=>o.handleFailedRequest(C.DocumentHighlightRequest.type,f,d,null)),l=o.clientOptions.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(i,n,s,a):a(i,n,s)}};return[N.registerDocumentHighlightProvider(e.documentSelector,t),t]}},N8=class extends Fe{constructor(e){super(e,C.DocumentSymbolRequest.type)}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"documentSymbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:x8},t.hierarchicalDocumentSymbolSupport=!0,t.tagSupport={valueSet:S8}}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentSymbolProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentSymbols:(n,s)=>{let o=this._client,a=(c,u)=>o.sendRequest(C.DocumentSymbolRequest.type,g8(c),u).then(f=>{if(f!==null){if(f.length===0)return[];{let d=f[0];return C.DocumentSymbol.is(d),f}}},f=>o.handleFailedRequest(C.DocumentSymbolRequest.type,u,f,null)),l=o.clientOptions.middleware;return l.provideDocumentSymbols?l.provideDocumentSymbols(n,s,a):a(n,s)}},i=e.label?{label:e.label}:void 0;return[N.registerDocumentSymbolProvider(e.documentSelector,t,i),t]}},q8=class extends k8{constructor(e){super(e,C.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=ie(ie(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:x8},t.tagSupport={valueSet:S8}}initialize(e){!e.workspaceSymbolProvider||this.register({id:We(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){let t={provideWorkspaceSymbols:(i,n)=>{let s=this._client,o=(l,c)=>s.sendRequest(C.WorkspaceSymbolRequest.type,{query:l},c).then(u=>u,u=>s.handleFailedRequest(C.WorkspaceSymbolRequest.type,c,u,null)),a=s.clientOptions.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,n,o):o(i,n)}};return[N.registerWorkspaceSymbolProvider(t),t]}},$8=class extends Fe{constructor(e){super(e,C.CodeActionRequest.type);this.disposables=[]}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.honorsChangeAnnotations=!1,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[C.CodeActionKind.Empty,C.CodeActionKind.QuickFix,C.CodeActionKind.Refactor,C.CodeActionKind.RefactorExtract,C.CodeActionKind.RefactorInline,C.CodeActionKind.RefactorRewrite,C.CodeActionKind.Source,C.CodeActionKind.SourceOrganizeImports]}}}initialize(e,t){let i=this.getRegistrationOptions(t,e.codeActionProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t=n=>{if(se.has(n))return;let s=this._client,o=(l,c)=>{let u={command:l,arguments:c};return s.sendRequest(C.ExecuteCommandRequest.type,u).then(void 0,f=>{throw s.handleFailedRequest(C.ExecuteCommandRequest.type,void 0,f,void 0),f})},a=s.clientOptions.middleware;this.disposables.push(se.registerCommand(n,(...l)=>a.executeCommand?a.executeCommand(n,l,o):o(n,l),null,!0))},i={provideCodeActions:(n,s,o,a)=>{let l=this._client,c=(f,d,h,p)=>{let g={textDocument:{uri:f.uri},range:d,context:h};return l.sendRequest(C.CodeActionRequest.type,g,p).then(b=>{if(b!==null)return b.forEach(y=>{var w;let S=C.Command.is(y)?y.command:(w=y.command)==null?void 0:w.command;S&&!se.has(S)&&t(S)}),b},b=>l.handleFailedRequest(C.CodeActionRequest.type,p,b,null))},u=l.clientOptions.middleware;return u.provideCodeActions?u.provideCodeActions(n,s,o,a,c):c(n,s,o,a)},resolveCodeAction:e.resolveProvider?(n,s)=>{let o=this._client,a=this._client.clientOptions.middleware,l=(c,u)=>o.sendRequest(C.CodeActionResolveRequest.type,c,u).then(f=>f,f=>o.handleFailedRequest(C.CodeActionResolveRequest.type,u,f,c));return a.resolveCodeAction?a.resolveCodeAction(n,s,l):l(n,s)}:void 0};return[N.registerCodeActionProvider(e.documentSelector,i,this._client.id,e.codeActionKinds),i]}dispose(){this.disposables.forEach(e=>{e.dispose()}),this.disposables=[],super.dispose()}},B8=class extends Fe{constructor(e){super(e,C.CodeLensRequest.type)}fillClientCapabilities(e){ie(ie(e,"textDocument"),"codeLens").dynamicRegistration=!0,ie(ie(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(C.CodeLensRefreshRequest.type,async()=>{for(let s of this.getAllProviders())s.onDidChangeCodeLensEmitter.fire()});let n=this.getRegistrationOptions(t,e.codeLensProvider);!n||this.register({id:We(),registerOptions:n})}registerLanguageProvider(e){let t=new C.Emitter,i={onDidChangeCodeLenses:t.event,provideCodeLenses:(n,s)=>{let o=this._client,a=(c,u)=>o.sendRequest(C.CodeLensRequest.type,v8(c),u).then(f=>f,f=>o.handleFailedRequest(C.CodeLensRequest.type,u,f,null)),l=o.clientOptions.middleware;return l.provideCodeLenses?l.provideCodeLenses(n,s,a):a(n,s)},resolveCodeLens:e.resolveProvider?(n,s)=>{let o=this._client,a=(c,u)=>o.sendRequest(C.CodeLensResolveRequest.type,c,u).then(f=>f,f=>o.handleFailedRequest(C.CodeLensResolveRequest.type,u,f,c)),l=o.clientOptions.middleware;return l.resolveCodeLens?l.resolveCodeLens(n,s,a):a(n,s)}:void 0};return[N.registerCodeLensProvider(e.documentSelector,i),{provider:i,onDidChangeCodeLensEmitter:t}]}},j8=class extends Fe{constructor(e){super(e,C.DocumentFormattingRequest.type)}fillClientCapabilities(e){ie(ie(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentFormattingProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentFormattingEdits:(i,n,s)=>{let o=this._client,a=(c,u,f)=>{let d={textDocument:{uri:c.uri},options:u};return o.sendRequest(C.DocumentFormattingRequest.type,d,f).then(h=>h,h=>o.handleFailedRequest(C.DocumentFormattingRequest.type,f,h,null))},l=o.clientOptions.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(i,n,s,a):a(i,n,s)}};return[N.registerDocumentFormatProvider(e.documentSelector,t,this._client.clientOptions.formatterPriority),t]}},U8=class extends Fe{constructor(e){super(e,C.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){ie(ie(e,"textDocument"),"rangeFormatting").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentRangeFormattingEdits:(i,n,s,o)=>{let a=this._client,l=(u,f,d,h)=>{let p={textDocument:{uri:u.uri},range:f,options:d};return a.sendRequest(C.DocumentRangeFormattingRequest.type,p,h).then(g=>g,g=>a.handleFailedRequest(C.DocumentRangeFormattingRequest.type,h,g,null))},c=a.clientOptions.middleware;return c.provideDocumentRangeFormattingEdits?c.provideDocumentRangeFormattingEdits(i,n,s,o,l):l(i,n,s,o)}};return[N.registerDocumentRangeFormatProvider(e.documentSelector,t),t]}},H8=class extends Fe{constructor(e){super(e,C.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){ie(ie(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideOnTypeFormattingEdits:(s,o,a,l,c)=>{let u=this._client,f=(h,p,g,b,y)=>{let S={textDocument:ny(h),position:p,ch:g,options:b};return u.sendRequest(C.DocumentOnTypeFormattingRequest.type,S,y).then(w=>w,w=>u.handleFailedRequest(C.DocumentOnTypeFormattingRequest.type,y,w,null))},d=u.clientOptions.middleware;return d.provideOnTypeFormattingEdits?d.provideOnTypeFormattingEdits(s,o,a,l,c,f):f(s,o,a,l,c)}},i=e.moreTriggerCharacter||[],n=[e.firstTriggerCharacter,...i];return[N.registerOnTypeFormattingEditProvider(e.documentSelector,t,n),t]}},W8=class extends Fe{constructor(e){super(e,C.RenameRequest.type)}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.renameProvider);!i||(Os(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:We(),registerOptions:i}))}registerLanguageProvider(e){let t={provideRenameEdits:(i,n,s,o)=>{let a=this._client,l=(u,f,d,h)=>{let p={textDocument:{uri:u.uri},position:f,newName:d};return a.sendRequest(C.RenameRequest.type,p,h).then(g=>g,g=>a.handleFailedRequest(C.RenameRequest.type,h,g,null))},c=a.clientOptions.middleware;return c.provideRenameEdits?c.provideRenameEdits(i,n,s,o,l):l(i,n,s,o)},prepareRename:e.prepareProvider?(i,n,s)=>{let o=this._client,a=(c,u,f)=>{let d={textDocument:Sl(c),position:u};return o.sendRequest(C.PrepareRenameRequest.type,d,f).then(h=>C.Range.is(h)?h:this.isDefaultBehavior(h)?h.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):h&&C.Range.is(h.range)?{range:h.range,placeholder:h.placeholder}:Promise.reject(new Error("The element can't be renamed.")),h=>o.handleFailedRequest(C.PrepareRenameRequest.type,f,h,void 0))},l=o.clientOptions.middleware;return l.prepareRename?l.prepareRename(i,n,s,a):a(i,n,s)}:void 0};return[N.registerRenameProvider(e.documentSelector,t),t]}isDefaultBehavior(e){let t=e;return t&&Os(t.defaultBehavior)}},z8=class extends Fe{constructor(e){super(e,C.DocumentLinkRequest.type)}fillClientCapabilities(e){let t=ie(ie(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentLinkProvider);!i||this.register({id:We(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentLinks:(i,n)=>{let s=this._client,o=(l,c)=>s.sendRequest(C.DocumentLinkRequest.type,{textDocument:{uri:l.uri}},c).then(u=>u,u=>s.handleFailedRequest(C.DocumentLinkRequest.type,c,u,null)),a=s.clientOptions.middleware;return a.provideDocumentLinks?a.provideDocumentLinks(i,n,o):o(i,n)},resolveDocumentLink:e.resolveProvider?(i,n)=>{let s=this._client,o=(l,c)=>s.sendRequest(C.DocumentLinkResolveRequest.type,l,c).then(u=>u,u=>s.handleFailedRequest(C.DocumentLinkResolveRequest.type,c,u,l)),a=s.clientOptions.middleware;return a.resolveDocumentLink?a.resolveDocumentLink(i,n,o):o(i,n)}:void 0};return[N.registerDocumentLinkProvider(e.documentSelector,t),t]}},V8=class{constructor(e){this._client=e;this._listeners=new Map}get registrationType(){return C.DidChangeConfigurationNotification.type}fillClientCapabilities(e){ie(ie(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){var t;let e=(t=this._client.clientOptions.synchronize)==null?void 0:t.configurationSection;e!==void 0&&this.register({id:We(),registerOptions:{section:e}})}register(e){let{section:t}=e.registerOptions,i=v.onDidChangeConfiguration(n=>{typeof t=="string"&&!n.affectsConfiguration(t)||Array.isArray(t)&&!t.some(s=>n.affectsConfiguration(s))||t!=null&&this.onDidChangeConfiguration(e.registerOptions.section)});if(this._listeners.set(e.id,i),Me(t)&&t.endsWith(".settings")){let n=this.getConfiguredSettings(t);if(!n||ng(n))return}t!=null&&this.onDidChangeConfiguration(e.registerOptions.section)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}onDidChangeConfiguration(e){let t=typeof e=="string"&&e.startsWith("languageserver."),i;Me(e)?i=[e]:i=e;let n=o=>{if(o===void 0){this._client.sendNotification(C.DidChangeConfigurationNotification.type,{settings:null});return}this._client.sendNotification(C.DidChangeConfigurationNotification.type,{settings:t?this.getConfiguredSettings(o[0]):this.extractSettingsInformation(o)})},s=this.getMiddleware();s?s(i,n):n(i)}getConfiguredSettings(e){let t=".settings".length;return v.getConfiguration(e.slice(0,-t)).get("settings",{})}extractSettingsInformation(e){function t(n,s){let o=n;for(let a=0;a<s.length-1;a++){let l=o[s[a]];l||(l=Object.create(null),o[s[a]]=l),o=l}return o}let i=Object.create(null);for(let n=0;n<e.length;n++){let s=e[n],o=s.indexOf("."),a=null;if(o>=0?a=v.getConfiguration(s.substr(0,o)).get(s.substr(o+1)):a=v.getConfiguration(s),a){let l=e[n].split(".");t(i,l)[l[l.length-1]]=a}}return i}getMiddleware(){let e=this._client.clientOptions.middleware;if(e.workspace&&e.workspace.didChangeConfiguration)return e.workspace.didChangeConfiguration}},G8=class{constructor(e){this._client=e;this._commands=new Map}get registrationType(){return C.ExecuteCommandRequest.type}fillClientCapabilities(e){ie(ie(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){!e.executeCommandProvider||this.register({id:We(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){let t=this._client,i=t.clientOptions.middleware,n=(s,o)=>{let a={command:s,arguments:o};return t.sendRequest(C.ExecuteCommandRequest.type,a).then(void 0,l=>{throw t.handleFailedRequest(C.ExecuteCommandRequest.type,void 0,l,void 0),l})};if(e.registerOptions.commands){let s=[];for(let o of e.registerOptions.commands)s.push(se.registerCommand(o,(...a)=>i.executeCommand?i.executeCommand(o,a,n):n(o,a),null,!0));this._commands.set(e.id,s)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(i=>i.dispose())}dispose(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}};(function(e){function r(t){return t&&C.MessageReader.is(t.reader)&&C.MessageWriter.is(t.writer)}e.is=r})(Bu||(Bu={}));YT=class{constructor(e,t){this._resolve=e;this._reject=t;this._used=!1}get isUsed(){return this._used}resolve(){this._used=!0,this._resolve()}reject(e){this._used=!0,this._reject(e)}},XT=class{constructor(e,t,i){this._features=[];this._dynamicFeatures=new Map;var l;this._id=e,this._name=t,i.outputChannel?this._outputChannel=i.outputChannel:this._outputChannel=void 0;let n=!1;(v.getConfiguration("suggest").get("snippetsSupport",!0)===!1||i.disableSnippetCompletion)&&(n=!0);let o={isTrusted:!1};i.markdown!==void 0&&i.markdown.isTrusted===!0&&(o.isTrusted=!0),this._clientOptions={disableWorkspaceFolders:i.disableWorkspaceFolders,disableSnippetCompletion:n,disableDynamicRegister:i.disableDynamicRegister,disableDiagnostics:i.disableDiagnostics,disableCompletion:i.disableCompletion,formatterPriority:i.formatterPriority,ignoredRootPaths:i.ignoredRootPaths,documentSelector:i.documentSelector||[],synchronize:i.synchronize||{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName||this._id,revealOutputChannelOn:i.revealOutputChannelOn||4,stdioEncoding:i.stdioEncoding||"utf8",initializationOptions:i.initializationOptions,initializationFailedHandler:i.initializationFailedHandler,progressOnInitialization:!!i.progressOnInitialization,errorHandler:i.errorHandler||this.createDefaultErrorHandler((l=i.connectionOptions)==null?void 0:l.maxRestartCount),middleware:i.middleware||{},workspaceFolder:i.workspaceFolder,connectionOptions:i.connectionOptions,markdown:o},this.state=0,this._connectionPromise=void 0,this._resolvedConnection=void 0,this._initializeResult=void 0,this._listeners=void 0,this._providers=void 0,this._diagnostics=void 0,this._fileEvents=[],this._fileEventDelayer=new zT(250),this._onReady=new Promise((c,u)=>{this._onReadyCallbacks=new YT(c,u)}),this._onStop=void 0,this._stateChangeEmitter=new C.Emitter,this._trace=C.Trace.Off,this._tracer={log:(c,u)=>{Me(c)?this.logTrace(c,u):this.logObjectTrace(c)}},this._syncedDocuments=new Map;let a=v.getConfiguration("coc.preferences");this._markdownSupport=a.get("enableMarkdown",!0),this.registerBuiltinFeatures()}get supporedMarkupKind(){return this._markdownSupport?[C.MarkupKind.Markdown,C.MarkupKind.PlainText]:[C.MarkupKind.PlainText]}get state(){return this._state}get id(){return this._id}get name(){return this._name}set state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}getPublicState(){return this.state===3?2:this.state===1?3:1}get initializeResult(){return this._initializeResult}sendRequest(e,...t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{return this._resolvedConnection.sendRequest(e,...t)}catch(i){throw this.error(`Sending request ${Me(e)?e:e.method} failed.`,i),i}}onRequest(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{return this._resolvedConnection.onRequest(e,t)}catch(i){throw this.error(`Registering request handler ${Me(e)?e:e.method} failed.`,i),i}}sendNotification(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.sendNotification(e,t)}catch(i){throw this.error(`Sending notification ${Me(e)?e:e.method} failed.`,i),i}}onNotification(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{return this._resolvedConnection.onNotification(e,t)}catch(i){throw this.error(`Registering notification handler ${Me(e)?e:e.method} failed.`,i),i}}onProgress(e,t,i){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{if(e==C.WorkDoneProgress.type){let n=this._clientOptions.middleware.handleWorkDoneProgress;if(n!==void 0)return this._resolvedConnection.onProgress(e,t,s=>{n(t,s,()=>i(s))})}return this._resolvedConnection.onProgress(e,t,i)}catch(n){throw this.error(`Registering progress handler for token ${t} failed.`,n),n}}sendProgress(e,t,i){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.sendProgress(e,t,i)}catch(n){throw this.error(`Sending progress for token ${t} failed.`,n),n}}get clientOptions(){return this._clientOptions}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){if(!this._outputChannel){let{outputChannelName:e}=this._clientOptions;this._outputChannel=D.createOutputChannel(e||this._name)}return this._outputChannel}get diagnostics(){return this._diagnostics}createDefaultErrorHandler(e){return new w8(this._id,e!=null?e:4)}set trace(e){this._trace=e,this.onReady().then(()=>{this.resolveConnection().then(t=>{t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})})},()=>{})}logObjectTrace(e){e.isLSPMessage&&e.type?this.outputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.outputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.outputChannel.appendLine(`${JSON.stringify(e)}`)}data2String(e){if(e instanceof C.ResponseError){let t=e;return` Message: ${t.message}
Code: ${t.code} ${t.data?`
`+t.data.toString():""}`}return e instanceof Error?Me(e.stack)?e.stack:e.message:Me(e)?e:e.toString()}_appendOutput(e,t,i){let n=3;switch(e){case"Info":n=1;break;case"Warn":n=2;break}this.outputChannel.appendLine(`[${e} - ${new Date().toLocaleTimeString()}] ${t}`);let s;i&&(s=this.data2String(i),this.outputChannel.appendLine(s)),this._clientOptions.revealOutputChannelOn<=n&&this.outputChannel.show(!0)}info(e,t){this._appendOutput("Info",e,t)}warn(e,t){this._appendOutput("Warn",e,t)}error(e,t){this._appendOutput("Error",e,t)}logTrace(e,t){this.outputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.outputChannel.appendLine(this.data2String(t))}needsStart(){return this.state===0||this.state===4||this.state===5}needsStop(){return this.state===1||this.state===3}onReady(){return this._onReady}get started(){return this.state!=0}isConnectionActive(){return this.state===3&&!!this._resolvedConnection}start(){if(this._onReadyCallbacks.isUsed&&(this._onReady=new Promise((e,t)=>{this._onReadyCallbacks=new YT(e,t)})),this._listeners=[],this._providers=[],!this._diagnostics){let e=this._clientOptions,t=e.diagnosticCollectionName?e.diagnosticCollectionName:this._id;this._diagnostics=N.createDiagnosticCollection(t)}return this.state=1,this.resolveConnection().then(e=>(e.onLogMessage(t=>{let i;switch(t.type){case C.MessageType.Error:i="error",this.error(t.message);break;case C.MessageType.Warning:i="warning",this.warn(t.message);break;case C.MessageType.Info:i="info",this.info(t.message);break;default:i="log",this.outputChannel.appendLine(t.message)}if(global.hasOwnProperty("__TEST__")){console.log(`[${i}] ${t.message}`);return}}),e.onShowMessage(t=>{switch(t.type){case C.MessageType.Error:D.showErrorMessage(t.message);break;case C.MessageType.Warning:D.showWarningMessage(t.message);break;case C.MessageType.Info:D.showInformationMessage(t.message);break;default:D.showInformationMessage(t.message)}}),e.onRequest(C.ShowMessageRequest.type,t=>{let i;switch(t.type){case C.MessageType.Error:i=D.showErrorMessage.bind(D);break;case C.MessageType.Warning:i=D.showWarningMessage.bind(D);break;case C.MessageType.Info:i=D.showInformationMessage.bind(D);break;default:i=D.showInformationMessage.bind(D)}let n=t.actions||[];return i(t.message,...n)}),e.onRequest(C.ShowDocumentRequest.type,async t=>{var s;let i=async o=>{var a;try{return o.external===!0?(await v.openResource(o.uri),{success:!0}):(o.selection&&o.selection.start,await v.jumpTo(o.uri,(a=o.selection)==null?void 0:a.start),{success:!0})}catch(l){return{success:!0}}},n=(s=this._clientOptions.middleware.window)==null?void 0:s.showDocument;return n!==void 0?n(t,i):i(t)}),e.onTelemetry(t=>{}),e.listen(),this.initialize(e))).then(void 0,e=>{this.state=2,this._onReadyCallbacks.reject(e),this.error("Starting client failed ",e)}),C.Disposable.create(()=>{this.needsStop()&&this.stop()})}resolveConnection(){return this._connectionPromise||(this._connectionPromise=this.createConnection()),this._connectionPromise}resolveRootPath(){if(this._clientOptions.workspaceFolder)return B.parse(this._clientOptions.workspaceFolder.uri).fsPath;let{ignoredRootPaths:e}=this._clientOptions,t=v.getConfiguration(this.id),i=t.get("rootPatterns",[]),n=t.get("requireRootPattern",!1),s;if(i&&i.length){let a=v.getDocument(v.bufnr);if(a&&a.schema=="file"){let l=GT.default.dirname(B.parse(a.uri).fsPath);s=Gd(l,i,v.cwd)}}if(n&&!s)return!1;let o=s||v.rootPath||v.cwd;return o===b8.default.homedir()||e&&e.includes(o)?(this.warn(`Ignored rootPath ${o} of client "${this._id}"`),null):o}initialize(e){this.refreshTrace(e,!1);let{initializationOptions:t,progressOnInitialization:i}=this._clientOptions,n=this.resolveRootPath();if(n===!1){console.warn("required root pattern not found, server not started.");return}let s={processId:process.pid,rootPath:n||null,rootUri:n?tp(B.file(n)):null,capabilities:this.computeClientCapabilities(),initializationOptions:_o(t)?t():t,trace:C.Trace.toString(this._trace),workspaceFolders:null,locale:this.getLocale(),clientInfo:{name:"coc.nvim",version:v.version}};if(this.fillInitializeParams(s),i){let o=We();s.workDoneToken=o;let a=new ep(e,o);return a.begin({title:`initializing ${this.id}`,kind:"begin"}),this.doInitialize(e,s).then(l=>(a.done(),l),l=>{throw a.cancel(),l})}else return this.doInitialize(e,s)}doInitialize(e,t){return e.initialize(t).then(i=>{this._resolvedConnection=e,this._initializeResult=i,this.state=3;let n;return rg(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===C.TextDocumentSyncKind.None?n={openClose:!1,change:C.TextDocumentSyncKind.None,save:void 0}:n={openClose:!0,change:i.capabilities.textDocumentSync,save:{includeText:!1}}:i.capabilities.textDocumentSync!=null&&i.capabilities.textDocumentSync!==void 0&&(n=i.capabilities.textDocumentSync),this._capabilities=Object.assign({},i.capabilities,{resolvedTextDocumentSync:n}),this._clientOptions.disableDiagnostics||e.onDiagnostics(s=>this.handleDiagnostics(s)),e.onRequest(C.RegistrationRequest.type,s=>this.handleRegistrationRequest(s)),e.onRequest("client/registerFeature",s=>this.handleRegistrationRequest(s)),e.onRequest(C.UnregistrationRequest.type,s=>this.handleUnregistrationRequest(s)),e.onRequest("client/unregisterFeature",s=>this.handleUnregistrationRequest(s)),e.onRequest(C.ApplyWorkspaceEditRequest.type,s=>this.handleApplyWorkspaceEdit(s)),e.sendNotification(C.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),this._onReadyCallbacks.resolve(),i}).then(void 0,i=>{throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(i)?this.initialize(e):(this.stop(),this._onReadyCallbacks.reject(i)):i instanceof C.ResponseError&&i.data&&i.data.retry?D.showPrompt(i.message+" Retry?").then(n=>{n?this.initialize(e):(this.stop(),this._onReadyCallbacks.reject(i))}):(i&&i.message&&D.showMessage(i.message,"error"),this.error("Server initialization failed.",i),this.stop(),this._onReadyCallbacks.reject(i)),i})}stop(){return this._initializeResult=void 0,this._connectionPromise?this.state===4&&this._onStop?this._onStop:(this.state=4,this.cleanUp(),this._onStop=this.resolveConnection().then(e=>e.shutdown().then(()=>{e.exit(),e.dispose(),this.state=5,this.cleanUpChannel(),this._onStop=void 0,this._connectionPromise=void 0,this._resolvedConnection=void 0})).catch(e=>{ta.error("Error on stop languageserver:",e),this.state=5,this.cleanUpChannel(),this._onStop=void 0,this._connectionPromise=void 0,this._resolvedConnection=void 0})):(this.state=5,Promise.resolve())}cleanUp(e=!0,t=!0){this._listeners&&(this._listeners.forEach(i=>i.dispose()),this._listeners=void 0),this._providers&&(this._providers.forEach(i=>i.dispose()),this._providers=void 0);for(let i of this._features.values())typeof i.dispose=="function"?i.dispose():ta.error("Feature can't be disposed",i);this._syncedDocuments&&this._syncedDocuments.clear(),e&&this.cleanUpChannel(),this._diagnostics&&(t?(this._diagnostics.dispose(),this._diagnostics=void 0):this._diagnostics.clear())}cleanUpChannel(){this._outputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){var s;let t=this;function i(o){t._fileEvents.push(o),t._fileEventDelayer.trigger(()=>{t.onReady().then(()=>{t.resolveConnection().then(a=>{t.isConnectionActive()&&a.didChangeWatchedFiles({changes:t._fileEvents}),t._fileEvents=[]})},a=>{t.error("Notify file events failed.",a)})})}let n=(s=this.clientOptions.middleware)==null?void 0:s.workspace;(n==null?void 0:n.didChangeWatchedFile)?n.didChangeWatchedFile(e,i):i(e)}handleDiagnostics(e){if(!this._diagnostics)return;let{uri:t,diagnostics:i}=e,n=this.clientOptions.middleware.handleDiagnostics;n?n(t,i,(s,o)=>this.setDiagnostics(s,o)):this.setDiagnostics(t,i)}setDiagnostics(e,t){var n;if(!this._diagnostics)return;if(v.getConfiguration("diagnostic").get("separateRelatedInformationAsDiagnostics")&&t.length>0){let s=new Map;s.set(e,t);for(let o of t){if((n=o.relatedInformation)==null?void 0:n.length){let a=`${o.message}
Related diagnostics:
`;for(let l of o.relatedInformation){let c=GT.default.basename(B.parse(l.location.uri).fsPath),u=l.location.range.start.line;a=`${a}
${c}(line ${u+1}): ${l.message}`;let f=s.get(l.location.uri)||[];f.push(C.Diagnostic.create(l.location.range,l.message,C.DiagnosticSeverity.Hint,o.code,o.source)),s.set(l.location.uri,f)}o.message=a}this._diagnostics.set(Array.from(s))}}else this._diagnostics.set(e,t)}createConnection(){let e=(i,n,s)=>{ta.error("connection error:",i,n),this.handleConnectionError(i,n,s)},t=()=>{this.handleConnectionClosed()};return this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8").then(i=>fme(i.reader,i.writer,e,t,this._clientOptions.connectionOptions))}handleConnectionClosed(){if(this.state===5)return;try{this._resolvedConnection&&this._resolvedConnection.dispose()}catch(t){}let e=1;if(this.state!==4)try{e=this._clientOptions.errorHandler.closed()}catch(t){}this._connectionPromise=void 0,this._resolvedConnection=void 0,e===1?(this.error("Connection to server got closed. Server will not be restarted."),this.state===1?(this._onReadyCallbacks.reject(new Error("Connection to server got closed. Server will not be restarted.")),this.state=2):this.state=5,this.cleanUp(!1,!0)):e===2&&(this.info("Connection to server got closed. Server will restart."),this.cleanUp(!1,!0),this.state=0,this.start())}restart(){this.cleanUp(!0,!1),this.start()}handleConnectionError(e,t,i){this._clientOptions.errorHandler.error(e,t,i)===2&&(this.error("Connection to server is erroring. Shutting down server."),this.stop())}hookConfigurationChanged(e){v.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)})}refreshTrace(e,t=!1){let i=v.getConfiguration(this._id),n=C.Trace.Off,s=C.TraceFormat.Text;if(i){let o=i.get("trace.server","off");typeof o=="string"?n=C.Trace.fromString(o):(n=C.Trace.fromString(i.get("trace.server.verbosity","off")),s=C.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=n,this._traceFormat=s,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;Array.isArray(t)?i=t:i=[t],!!i&&this._dynamicFeatures.get(C.DidChangeWatchedFilesNotification.type.method).registerRaw(We(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),JT.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}registerBuiltinFeatures(){this.registerFeature(new V8(this)),this.registerFeature(new C8(this,this._syncedDocuments)),this.registerFeature(new E8(this)),this.registerFeature(new T8(this)),this.registerFeature(new D8(this)),this.registerFeature(new R8(this)),this.registerFeature(new _8(this,this._syncedDocuments)),this.registerFeature(new P8(this,e=>this.notifyFileEvent(e))),this._clientOptions.disableCompletion||this.registerFeature(new I8(this)),this.registerFeature(new O8(this)),this.registerFeature(new L8(this)),this.registerFeature(new A8(this)),this.registerFeature(new F8(this)),this.registerFeature(new M8(this)),this.registerFeature(new N8(this)),this.registerFeature(new q8(this)),this.registerFeature(new $8(this)),this.registerFeature(new B8(this)),this.registerFeature(new j8(this)),this.registerFeature(new U8(this)),this.registerFeature(new H8(this)),this.registerFeature(new W8(this)),this.registerFeature(new z8(this)),this.registerFeature(new G8(this))}fillInitializeParams(e){for(let t of this._features)_o(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};ie(e,"workspace").applyEdit=!0;let t=ie(ie(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[C.ResourceOperationKind.Create,C.ResourceOperationKind.Rename,C.ResourceOperationKind.Delete],t.failureHandling=C.FailureHandlingKind.TextOnlyTransactional;let i=ie(ie(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[C.DiagnosticTag.Unnecessary,C.DiagnosticTag.Deprecated]};let n=ie(e,"window"),s=ie(n,"showMessage");s.messageActionItem={additionalPropertiesSupport:!1};let o=ie(n,"showDocument");o.support=!1;let a=ie(e,"general");a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"};for(let l of this._features)l.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let i of this._features)i.initialize(this._capabilities,t)}handleRegistrationRequest(e){return this.clientOptions.disableDynamicRegister?Promise.resolve():new Promise((t,i)=>{for(let n of e.registrations){let s=this._dynamicFeatures.get(n.method);if(!s){i(new Error(`No feature implementation for ${n.method} found. Registration failed.`));return}let o=n.registerOptions||{};o.documentSelector=o.documentSelector||this._clientOptions.documentSelector;let a={id:n.id,registerOptions:o};try{s.register(a)}catch(l){i(l);return}}t()})}handleUnregistrationRequest(e){return new Promise((t,i)=>{for(let n of e.unregisterations){let s=this._dynamicFeatures.get(n.method);if(!s){i(new Error(`No feature implementation for ${n.method} found. Unregistration failed.`));return}s.unregister(n.id)}t()})}handleApplyWorkspaceEdit(e){let t=e.edit,i=new Map;v.textDocuments.forEach(s=>i.set(s.uri.toString(),s));let n=!1;if(t.documentChanges){for(let s of t.documentChanges)if(C.TextDocumentEdit.is(s)&&s.textDocument.version&&s.textDocument.version>=0){let o=i.get(s.textDocument.uri);if(o&&o.version!==s.textDocument.version){n=!0;break}}}return n?Promise.resolve({applied:!1}):v.applyEdit(e.edit).then(s=>({applied:s}))}getLocale(){let e=process.env.LANG;return e?e.split(".")[0]:"en"}handleFailedRequest(e,t,i,n){if(i instanceof C.ResponseError){if(i.code===C.LSPErrorCodes.RequestCancelled){if(t!==void 0&&t.isCancellationRequested)return n}else if(i.code===C.LSPErrorCodes.ContentModified)return n}this.error(`Request ${e.method} failed.`,i)}logFailedRequest(e,t){t instanceof C.ResponseError&&t.code===C.LSPErrorCodes.RequestCancelled||this.error(`Request ${e.method} failed.`,t)}}});function K8(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var _l,ZT,J8=R(()=>{_l=E(H());Re();ln();"use strict";ZT=class extends Fe{constructor(e){super(e,_l.DocumentColorRequest.type)}fillClientCapabilities(e){K8(K8(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.colorProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideColorPresentations:(i,n,s)=>{let o=this._client,a=(c,u,f)=>{let d={color:c,textDocument:{uri:u.document.uri},range:u.range};return o.sendRequest(_l.ColorPresentationRequest.type,d,f).then(h=>h,h=>o.handleFailedRequest(_l.ColorPresentationRequest.type,f,h,null))},l=o.clientOptions.middleware;return l.provideColorPresentations?l.provideColorPresentations(i,n,s,a):a(i,n,s)},provideDocumentColors:(i,n)=>{let s=this._client,o=(l,c)=>{let u={textDocument:{uri:l.uri}};return s.sendRequest(_l.DocumentColorRequest.type,u,c).then(f=>f,f=>s.handleFailedRequest(_l.ColorPresentationRequest.type,c,f,null))},a=s.clientOptions.middleware;return a.provideDocumentColors?a.provideDocumentColors(i,n,o):o(i,n)}};return[N.registerDocumentColorProvider(e.documentSelector,t),t]}}});function ip(r){if(r){if(Array.isArray(r))return r.map(ip);if(typeof r=="object"){let e=Object.create(null);for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=ip(r[t]));return e}}return r}var Y8,hMe,QT,X8=R(()=>{Y8=E(H());Y();hMe=U()("languageclient-configuration"),QT=class{constructor(e){this._client=e;var i;let t=(i=this._client.clientOptions.synchronize)==null?void 0:i.configurationSection;typeof t=="string"&&t.startsWith("languageserver.")&&(this.languageserverSection=t)}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(Y8.ConfigurationRequest.type,(t,i)=>{let n=o=>{let a=[];for(let l of o.items)a.push(this.getConfiguration(l.scopeUri,l.section));return a},s=e.clientOptions.middleware.workspace;return s&&s.configuration?s.configuration(t,i,n):n(t,i)})}getConfiguration(e,t){let i=null;if(t){this.languageserverSection&&(t=`${this.languageserverSection}.${t}`);let n=t.lastIndexOf(".");if(n===-1)i=ip(v.getConfiguration(void 0,e).get(t));else{let s=v.getConfiguration(t.substr(0,n),e);s&&(i=ip(s.get(t.substr(n+1))))}}else{let n=v.getConfiguration(this.languageserverSection,e);i={};for(let s of Object.keys(n))n.has(s)&&(i[s]=ip(n.get(s)))}return i}dispose(){}}});function Z8(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var oy,eD,Q8=R(()=>{oy=E(H());Re();ln();ea();"use strict";eD=class extends Fe{constructor(e){super(e,oy.DeclarationRequest.type)}fillClientCapabilities(e){let t=Z8(Z8(e,"textDocument"),"declaration");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.declarationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideDeclaration:(i,n,s)=>{let o=this._client,a=(c,u,f)=>o.sendRequest(oy.DeclarationRequest.type,ur(c,u),f).then(d=>d,d=>o.handleFailedRequest(oy.DeclarationRequest.type,f,d,null)),l=o.clientOptions.middleware;return l.provideDeclaration?l.provideDeclaration(i,n,s,a):a(i,n,s)}};return[N.registerDeclarationProvider(e.documentSelector,t),t]}}});function eV(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var ay,tD,tV=R(()=>{ay=E(H());Re();ln();"use strict";tD=class extends Fe{constructor(e){super(e,ay.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=eV(eV(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.foldingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideFoldingRanges:(i,n,s)=>{let o=this._client,a=(c,u,f)=>{let d={textDocument:{uri:c.uri}};return o.sendRequest(ay.FoldingRangeRequest.type,d,f).then(h=>h,h=>o.handleFailedRequest(ay.FoldingRangeRequest.type,f,h,null))},l=o.clientOptions.middleware;return l.provideFoldingRanges?l.provideFoldingRanges(i,n,s,a):a(i,n,s)}};return[N.registerFoldingRangeProvider(e.documentSelector,t),t]}}});function iV(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var ly,iD,rV=R(()=>{ly=E(H());Re();ln();ea();iD=class extends Fe{constructor(e){super(e,ly.ImplementationRequest.type)}fillClientCapabilities(e){let t=iV(iV(e,"textDocument"),"implementation");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.implementationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideImplementation:(i,n,s)=>{let o=this._client,a=(c,u,f)=>o.sendRequest(ly.ImplementationRequest.type,ur(c,u),f).then(d=>d,d=>o.handleFailedRequest(ly.ImplementationRequest.type,f,d,null)),l=o.clientOptions.middleware;return l.provideImplementation?l.provideImplementation(i,n,s,a):a(i,n,s)}};return[N.registerImplementationProvider(e.documentSelector,t),t]}}});function hme(r,e){return r[e]===void 0&&(r[e]=Object.create(null)),r[e]}var nV,rD,sV=R(()=>{nV=E(H());HT();"use strict";rD=class{constructor(e){this._client=e;this.activeParts=new Set}fillClientCapabilities(e){hme(e,"window").workDoneProgress=!0}initialize(){let e=this._client,t=n=>{this.activeParts.delete(n)},i=n=>{this.activeParts.add(new ep(this._client,n.token,t))};e.onRequest(nV.WorkDoneProgressCreateRequest.type,i)}dispose(){for(let e of this.activeParts)e.done();this.activeParts.clear()}}});function oV(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var cy,nD,aV=R(()=>{cy=E(H());Re();ln();ea();nD=class extends Fe{constructor(e){super(e,cy.TypeDefinitionRequest.type)}fillClientCapabilities(e){let t=oV(oV(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.typeDefinitionProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideTypeDefinition:(i,n,s)=>{let o=this._client,a=(c,u,f)=>o.sendRequest(cy.TypeDefinitionRequest.type,ur(c,u),f).then(d=>d,d=>o.handleFailedRequest(cy.TypeDefinitionRequest.type,f,d,null)),l=o.clientOptions.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(i,n,s,a):a(i,n,s)}};return[N.registerTypeDefinitionProvider(e.documentSelector,t),t]}}});function sD(r,e){if(r!==void 0)return r[e]}function cV(r,e){return r.filter(t=>!e.includes(t))}var rp,lV,FNe,oD,uV=R(()=>{rp=E(H());Y();lV=E(require("os"));sy();qe();"use strict";FNe=U()("language-client-workspaceFolder");oD=class{constructor(e){this._client=e;this._listeners=new Map}get registrationType(){return rp.DidChangeWorkspaceFoldersNotification.type}getValidWorkspaceFolders(){let{workspaceFolders:e}=v;if(!e||e.length==0)return;let t=lV.default.homedir(),{ignoredRootPaths:i}=this._client.clientOptions;Array.isArray(i)||(i=[]);let n=e.filter(s=>{let o=B.parse(s.uri).fsPath;return o!=t&&!i.includes(o)});return n.length?n:void 0}asProtocol(e){return e===void 0?null:{uri:e.uri,name:e.name}}fillInitializeParams(e){let t=this.getValidWorkspaceFolders();this._initialFolders=t,t==null?e.workspaceFolders=null:e.workspaceFolders=t.map(i=>this.asProtocol(i))}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let t=this._client;t.onRequest(rp.WorkspaceFoldersRequest.type,s=>{let o=()=>{let l=this.getValidWorkspaceFolders();return l===void 0?null:l.map(u=>this.asProtocol(u))},a=t.clientOptions.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(s,o):o(s)});let i=sD(sD(sD(e,"workspace"),"workspaceFolders"),"changeNotifications"),n;typeof i=="string"?n=i:i===!0&&(n=We()),n&&this.register({id:n,registerOptions:void 0})}doSendEvent(e,t){let i={event:{added:e.map(n=>this.asProtocol(n)),removed:t.map(n=>this.asProtocol(n))}};this._client.sendNotification(rp.DidChangeWorkspaceFoldersNotification.type,i)}sendInitialEvent(e){if(this._initialFolders&&e){let t=cV(this._initialFolders,e),i=cV(e,this._initialFolders);(i.length>0||t.length>0)&&this.doSendEvent(i,t)}else this._initialFolders?this.doSendEvent([],this._initialFolders):e&&this.doSendEvent(e,[])}register(e){let t=e.id,i=this._client,n=v.onDidChangeWorkspaceFolders(o=>{let a=c=>{this.doSendEvent(c.added,c.removed)},l=i.clientOptions.middleware.workspace;l&&l.didChangeWorkspaceFolders?l.didChangeWorkspaceFolders(o,a):a(o)});this._listeners.set(t,n);let s=this.getValidWorkspaceFolders();this.sendInitialEvent(s)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}}});function fV(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var uy,aD,dV=R(()=>{uy=E(H());Re();ln();"use strict";aD=class extends Fe{constructor(e){super(e,uy.SelectionRangeRequest.type)}fillClientCapabilities(e){let t=fV(fV(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.selectionRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideSelectionRanges:(i,n,s)=>{let o=this._client,a=(c,u,f)=>{let d={textDocument:{uri:c.uri},positions:u};return o.sendRequest(uy.SelectionRangeRequest.type,d,f).then(h=>h,h=>o.handleFailedRequest(uy.SelectionRangeRequest.type,f,h,null))},l=o.clientOptions.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(i,n,s,a):a(i,n,s)}};return[N.registerSelectionRangeProvider(e.documentSelector,t),t]}}});function hV(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var as,lD,pV=R(()=>{as=E(H());Re();ln();ea();"use strict";lD=class extends Fe{constructor(e){super(e,as.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){let i=hV(hV(e,"textDocument"),"callHierarchy");i.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.callHierarchyProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={prepareCallHierarchy:(i,n,s)=>{let o=this._client,a=(c,u,f)=>{let d=ur(c,u);return o.sendRequest(as.CallHierarchyPrepareRequest.type,d,f).then(h=>h,h=>o.handleFailedRequest(as.CallHierarchyPrepareRequest.type,f,h,null))},l=o.clientOptions.middleware;return l.prepareCallHierarchy?l.prepareCallHierarchy(i,n,s,a):a(i,n,s)},provideCallHierarchyIncomingCalls:(i,n)=>{let s=this._client,o=(l,c)=>s.sendRequest(as.CallHierarchyIncomingCallsRequest.type,{item:l},c).then(u=>u,u=>s.handleFailedRequest(as.CallHierarchyIncomingCallsRequest.type,c,u,null)),a=s.clientOptions.middleware;return a.provideCallHierarchyIncomingCalls?a.provideCallHierarchyIncomingCalls(i,n,o):o(i,n)},provideCallHierarchyOutgoingCalls:(i,n)=>{let s=this._client,o=(l,c)=>s.sendRequest(as.CallHierarchyOutgoingCallsRequest.type,{item:l},c).then(u=>u,u=>s.handleFailedRequest(as.CallHierarchyOutgoingCallsRequest.type,c,u,null)),a=s.clientOptions.middleware;return a.provideCallHierarchyOutgoingCalls?a.provideCallHierarchyOutgoingCalls(i,n,o):o(i,n)}};return[N.registerCallHierarchyProvider(e.documentSelector,t),t]}}});function fy(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var le,Aqe,cD,mV=R(()=>{le=E(H());Re();ea();Wr();ln();"use strict";Aqe=U()("languageclient-semanticTokens");cD=class extends Fe{constructor(e){super(e,le.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){let t=fy(fy(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[le.SemanticTokenTypes.namespace,le.SemanticTokenTypes.type,le.SemanticTokenTypes.class,le.SemanticTokenTypes.enum,le.SemanticTokenTypes.interface,le.SemanticTokenTypes.struct,le.SemanticTokenTypes.typeParameter,le.SemanticTokenTypes.parameter,le.SemanticTokenTypes.variable,le.SemanticTokenTypes.property,le.SemanticTokenTypes.enumMember,le.SemanticTokenTypes.event,le.SemanticTokenTypes.function,le.SemanticTokenTypes.method,le.SemanticTokenTypes.macro,le.SemanticTokenTypes.keyword,le.SemanticTokenTypes.modifier,le.SemanticTokenTypes.comment,le.SemanticTokenTypes.string,le.SemanticTokenTypes.number,le.SemanticTokenTypes.regexp,le.SemanticTokenTypes.operator],t.tokenModifiers=[le.SemanticTokenModifiers.declaration,le.SemanticTokenModifiers.definition,le.SemanticTokenModifiers.readonly,le.SemanticTokenModifiers.static,le.SemanticTokenModifiers.deprecated,le.SemanticTokenModifiers.abstract,le.SemanticTokenModifiers.async,le.SemanticTokenModifiers.modification,le.SemanticTokenModifiers.documentation,le.SemanticTokenModifiers.defaultLibrary],t.formats=[le.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,fy(fy(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(le.SemanticTokensRefreshRequest.type,async()=>{for(let o of this.getAllProviders())o.onDidChangeSemanticTokensEmitter.fire()});let[n,s]=this.getRegistration(t,e.semanticTokensProvider);!n||!s||this.register({id:n,registerOptions:s})}registerLanguageProvider(e){let t=Os(e.full)?e.full:e.full!==void 0,i=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,n=new le.Emitter,s=t?{onDidChangeSemanticTokens:n.event,provideDocumentSemanticTokens:(c,u)=>{let f=this._client,d=f.clientOptions.middleware,h=(p,g)=>{let b={textDocument:Sl(p)};return f.sendRequest(le.SemanticTokensRequest.type,b,g).then(y=>y,y=>f.handleFailedRequest(le.SemanticTokensRequest.type,g,y,null))};return d.provideDocumentSemanticTokens?d.provideDocumentSemanticTokens(c,u,h):h(c,u)},provideDocumentSemanticTokensEdits:i?(c,u,f)=>{let d=this._client,h=d.clientOptions.middleware,p=(g,b,y)=>{let S={textDocument:Sl(g),previousResultId:b};return d.sendRequest(le.SemanticTokensDeltaRequest.type,S,y).then(w=>w,w=>d.handleFailedRequest(le.SemanticTokensDeltaRequest.type,y,w,null))};return h.provideDocumentSemanticTokensEdits?h.provideDocumentSemanticTokensEdits(c,u,f,p):p(c,u,f)}:void 0}:void 0,a=e.range===!0?{provideDocumentRangeSemanticTokens:(c,u,f)=>{let d=this._client,h=d.clientOptions.middleware,p=(g,b,y)=>{let S={textDocument:Sl(g),range:b};return d.sendRequest(le.SemanticTokensRangeRequest.type,S,y).then(w=>w,w=>d.handleFailedRequest(le.SemanticTokensRangeRequest.type,y,w,null))};return h.provideDocumentRangeSemanticTokens?h.provideDocumentRangeSemanticTokens(c,u,f,p):p(c,u,f)}}:void 0,l=[];return s!==void 0&&l.push(N.registerDocumentSemanticTokensProvider(e.documentSelector,s,e.legend)),a!==void 0&&l.push(N.registerDocumentRangeSemanticTokensProvider(e.documentSelector,a,e.legend)),[le.Disposable.create(()=>l.forEach(c=>c.dispose())),{range:a,full:s,onDidChangeSemanticTokensEmitter:n}]}}});function gV(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var dy,Jqe,uD,vV=R(()=>{dy=E(H());Re();ln();ea();Jqe=U()("languageclient-linkedEditingRange");uD=class extends Fe{constructor(e){super(e,dy.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){let t=gV(gV(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.linkedEditingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideLinkedEditingRanges:(i,n,s)=>{let o=this._client,a=(c,u,f)=>{let d=ur(c,u);return o.sendRequest(dy.LinkedEditingRangeRequest.type,d,f).then(h=>h,h=>o.handleFailedRequest(dy.LinkedEditingRangeRequest.type,f,h,null))},l=o.clientOptions.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(i,n,s,a):a(i,n,s)}};return[N.registerLinkedEditingRangeProvider(e.documentSelector,t),t]}}});function yV(r,e){return r[e]===void 0&&(r[e]={}),r[e]}function pme(r,e){return r[e]}function wV(r,e,t){r[e]=t}function hy(r){return{files:r.files.map(e=>({uri:e.toString()}))}}function xV(r){return{files:r.files.map(e=>({oldUri:e.oldUri.toString(),newUri:e.newUri.toString()}))}}var bV,Ai,S$e,El,py,fD,dD,hD,my,pD,mD,gD,SV=R(()=>{bV=E(Do()),Ai=E(H());En();Nt();Y();sy();S$e=U()("language-client-fileOperations");El=class{constructor(e,t,i,n,s){this._filters=new Map;this._client=e,this._event=t,this._registrationType=i,this._clientCapability=n,this._serverCapability=s}get registrationType(){return this._registrationType}fillClientCapabilities(e){let t=yV(yV(e,"workspace"),"fileOperations");wV(t,"dynamicRegistration",!0),wV(t,this._clientCapability,!0)}initialize(e){var n;let t=(n=e.workspace)==null?void 0:n.fileOperations,i=t!==void 0?pme(t,this._serverCapability):void 0;if((i==null?void 0:i.filters)!==void 0)try{this.register({id:We(),registerOptions:{filters:i.filters}})}catch(s){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${s}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));let t=e.registerOptions.filters.map(i=>{let n=new bV.Minimatch(i.pattern.glob,El.asMinimatchOptions(i.pattern.options));if(!n.makeRe())throw new Error(`Invalid pattern ${i.pattern.glob}!`);return{scheme:i.scheme,matcher:n,kind:i.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}async filter(e,t){let i=await Promise.all(e.files.map(async s=>{let o=t(s),a=o.fsPath.replace(/\\/g,"/");for(let l of this._filters.values())for(let c of l)if(!(c.scheme!==void 0&&c.scheme!==o.scheme)){if(c.matcher.match(a)){if(c.kind===void 0)return!0;let u=await El.getFileType(o);if(u===void 0)return this._client.error(`Failed to determine file type for ${o.toString()}.`),!0;if(u===Gr.File&&c.kind===Ai.FileOperationPatternKind.file||u===Gr.Directory&&c.kind===Ai.FileOperationPatternKind.folder)return!0}else if(c.kind===Ai.FileOperationPatternKind.folder&&await El.getFileType(o)===Gr.Directory&&c.matcher.match(`${a}/`))return!0}return!1})),n=e.files.filter((s,o)=>i[o]);return ff(ut({},e),{files:n})}static async getFileType(e){try{let t=await Mt(e.fsPath);return t.isFile()?Gr.File:t.isDirectory()?Gr.Directory:t.isSymbolicLink()?Gr.SymbolicLink:Gr.Unknown}catch(t){return}}static asMinimatchOptions(e){if(e!==void 0&&e.ignoreCase===!0)return{nocase:!0}}},py=class extends El{constructor(e,t,i,n,s,o,a){super(e,t,i,n,s);this._notificationType=i,this._accessUri=o,this._createParams=a}async send(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let i=async n=>{this._client.sendNotification(this._notificationType,this._createParams(n))};this.doSend(t,i)}}},fD=class extends py{constructor(e){super(e,v.onDidCreateFiles,Ai.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,t=>hy(t))}doSend(e,t){var n;let i=(n=this._client.clientOptions.middleware)==null?void 0:n.workspace;return(i==null?void 0:i.didCreateFiles)?i.didCreateFiles(e,t):t(e)}},dD=class extends py{constructor(e){super(e,v.onDidRenameFiles,Ai.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,t=>xV(t))}doSend(e,t){var n;let i=(n=this._client.clientOptions.middleware)==null?void 0:n.workspace;return(i==null?void 0:i.didRenameFiles)?i.didRenameFiles(e,t):t(e)}},hD=class extends py{constructor(e){super(e,v.onDidDeleteFiles,Ai.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,t=>hy(t))}doSend(e,t){var n;let i=(n=this._client.clientOptions.middleware)==null?void 0:n.workspace;return(i==null?void 0:i.didDeleteFiles)?i.didDeleteFiles(e,t):t(e)}},my=class extends El{constructor(e,t,i,n,s,o,a){super(e,t,i,n,s);this._requestType=i,this._accessUri=o,this._createParams=a}async send(e){let t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let i=n=>this._client.sendRequest(this._requestType,this._createParams(n));return this.doSend(t,i)}else return}},pD=class extends my{constructor(e){super(e,v.onWillCreateFiles,Ai.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,t=>hy(t))}doSend(e,t){var n;let i=(n=this._client.clientOptions.middleware)==null?void 0:n.workspace;return(i==null?void 0:i.willCreateFiles)?i.willCreateFiles(e,t):t(e)}},mD=class extends my{constructor(e){super(e,v.onWillRenameFiles,Ai.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,t=>xV(t))}doSend(e,t){var n;let i=(n=this._client.clientOptions.middleware)==null?void 0:n.workspace;return(i==null?void 0:i.willRenameFiles)?i.willRenameFiles(e,t):t(e)}},gD=class extends my{constructor(e){super(e,v.onWillDeleteFiles,Ai.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,t=>hy(t))}doSend(e,t){var n;let i=(n=this._client.clientOptions.middleware)==null?void 0:n.workspace;return(i==null?void 0:i.willDeleteFiles)?i.willDeleteFiles(e,t):t(e)}}});var Ks,gy,ju,ot,H$e,vD,bD,pt,Uu,yD,wD,xD,np,SD,CD,_D=R(()=>{Ks=E(require("child_process")),gy=E(require("fs")),ju=E(require("path")),ot=E(r8());En();de();Wr();o8();Y();ln();J8();X8();Q8();tV();rV();sV();aV();uV();dV();pV();mV();vV();SV();ln();H$e=Ks.default.ChildProcess,vD=U()("language-client-index");(function(e){function r(t){return Me(t.command)}e.is=r})(bD||(bD={}));(function(n){n[n.stdio=0]="stdio",n[n.ipc=1]="ipc",n[n.pipe=2]="pipe",n[n.socket=3]="socket"})(pt||(pt={}));(function(e){function r(t){let i=t;return i&&i.kind===3&&rg(i.port)}e.isSocket=r})(Uu||(Uu={}));(function(e){function r(t){return Me(t.module)}e.is=r})(yD||(yD={}));(function(e){function r(t){let i=t;return i&&i.writer!==void 0&&i.reader!==void 0}e.is=r})(wD||(wD={}));(function(e){function r(t){let i=t;return i&&i.process!==void 0&&typeof i.detached=="boolean"}e.is=r})(xD||(xD={}));np=class extends XT{constructor(e,t,i,n,s){let o,a,l,c,u;Me(t)?(o=e,a=t,l=i,c=n,u=!!s):(o=e.toLowerCase(),a=e,l=t,c=i,u=n),u===void 0&&(u=!1),super(o,a,c),this._serverOptions=l,this._forceDebug=u,this.registerProposedFeatures()}stop(){return super.stop().then(()=>{if(this._serverProcess){let e=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(e),this._isDetached=void 0}})}get serviceState(){let e=this._state;switch(e){case ye.Initial:return Ee.Initial;case ye.Running:return Ee.Running;case ye.StartFailed:return Ee.StartFailed;case ye.Starting:return Ee.Starting;case ye.Stopped:return Ee.Stopped;case ye.Stopping:return Ee.Stopping;default:return vD.error(`Unknown state: ${e}`),Ee.Stopped}}static stateName(e){switch(e){case ye.Initial:return"Initial";case ye.Running:return"Running";case ye.StartFailed:return"StartFailed";case ye.Starting:return"Starting";case ye.Stopped:return"Stopped";case ye.Stopping:return"Stopping";default:return"Unknonw"}}checkProcessDied(e){if(!(!e||global.hasOwnProperty("__TEST__"))){if(global.hasOwnProperty("__TEST__")){process.kill(e.pid,0);return}setTimeout(()=>{try{process.kill(e.pid,0),s8(e)}catch(t){}},2e3)}}handleConnectionClosed(){this._serverProcess=void 0,super.handleConnectionClosed()}createMessageTransports(e){function t(u,f){if(!u&&!f)return;let d=Object.create(null);return Object.keys(process.env).forEach(h=>d[h]=process.env[h]),u&&Object.keys(u).forEach(h=>d[h]=u[h]),d}let i=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],n=["--debug","--debug-brk","--inspect","--inspect-brk"];function s(){let u=process.execArgv;return u?u.some(f=>i.some(d=>f.startsWith(d))||n.some(d=>f===d)):!1}function o(u){if(u.stdin===null||u.stdout===null||u.stderr===null)throw new Error("Process created without stdio streams")}let a=this._serverOptions;if(_o(a))return a().then(u=>{if(Bu.is(u))return this._isDetached=!!u.detached,u;if(wD.is(u))return this._isDetached=!!u.detached,{reader:new ot.StreamMessageReader(u.reader),writer:new ot.StreamMessageWriter(u.writer)};{let f;return xD.is(u)?(f=u.process,this._isDetached=u.detached):(f=u,this._isDetached=!1),f.stderr.on("data",d=>this.outputChannel.append(Me(d)?d:d.toString(e))),{reader:new ot.StreamMessageReader(f.stdout),writer:new ot.StreamMessageWriter(f.stdin)}}});let l,c=a;return c.run||c.debug?typeof v8debug=="object"||this._forceDebug||s()?l=c.debug:l=c.run:l=a,this._getServerWorkingDir(l.options).then(u=>{if(yD.is(l)&&l.module){let f=l,d=f.transport||0;if(f.runtime){let h=[],p=f.options||Object.create(null);p.execArgv&&p.execArgv.forEach(S=>h.push(S)),h.push(f.module),f.args&&f.args.forEach(S=>h.push(S));let g=Object.create(null);g.cwd=u,g.env=t(p.env,!1);let b=this._getRuntimePath(f.runtime,u),y;if(d===1?(g.stdio=[null,null,null,"ipc"],h.push("--node-ipc")):d===0?h.push("--stdio"):d===2?(y=(0,ot.generateRandomPipeName)(),h.push(`--pipe=${y}`)):Uu.isSocket(d)&&h.push(`--socket=${d.port}`),h.push(`--clientProcessId=${process.pid.toString()}`),d===1||d===0){let S=Ks.default.spawn(b,h,g);return!S||!S.pid?Promise.reject(`Launching server using runtime ${b} failed.`):(this._serverProcess=S,S.stderr.on("data",w=>this.outputChannel.append(Me(w)?w:w.toString(e))),d===1?(S.stdout.on("data",w=>this.outputChannel.append(Me(w)?w:w.toString(e))),Promise.resolve({reader:new ot.IPCMessageReader(S),writer:new ot.IPCMessageWriter(S)})):Promise.resolve({reader:new ot.StreamMessageReader(S.stdout),writer:new ot.StreamMessageWriter(S.stdin)}))}else{if(d===2)return(0,ot.createClientPipeTransport)(y).then(S=>{let w=Ks.default.spawn(b,h,g);return!w||!w.pid?Promise.reject(`Launching server using runtime ${b} failed.`):(this._serverProcess=w,w.stderr.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),w.stdout.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),S.onConnected().then(_=>({reader:_[0],writer:_[1]})))});if(Uu.isSocket(d))return(0,ot.createClientSocketTransport)(d.port).then(S=>{let w=Ks.default.spawn(b,h,g);return!w||!w.pid?Promise.reject(`Launching server using runtime ${b} failed.`):(this._serverProcess=w,w.stderr.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),w.stdout.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),S.onConnected().then(_=>({reader:_[0],writer:_[1]})))})}}else{let h;return new Promise((p,g)=>{let b=f.args&&f.args.slice()||[];d===1?b.push("--node-ipc"):d===0?b.push("--stdio"):d===2?(h=(0,ot.generateRandomPipeName)(),b.push(`--pipe=${h}`)):Uu.isSocket(d)&&b.push(`--socket=${d.port}`),b.push(`--clientProcessId=${process.pid.toString()}`);let y=f.options||Object.create(null);if(y.env=t(y.env,!0),y.execArgv=y.execArgv||[],y.cwd=u,y.silent=!0,d===1||d===0){let S=Ks.default.fork(f.module,b||[],y);o(S),this._serverProcess=S,S.stderr.on("data",w=>this.outputChannel.append(Me(w)?w:w.toString(e))),d===1?(S.stdout.on("data",w=>this.outputChannel.append(Me(w)?w:w.toString(e))),p({reader:new ot.IPCMessageReader(this._serverProcess),writer:new ot.IPCMessageWriter(this._serverProcess)})):p({reader:new ot.StreamMessageReader(S.stdout),writer:new ot.StreamMessageWriter(S.stdin)})}else d===2?(0,ot.createClientPipeTransport)(h).then(S=>{let w=Ks.default.fork(f.module,b||[],y);o(w),this._serverProcess=w,w.stderr.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),w.stdout.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),S.onConnected().then(_=>{p({reader:_[0],writer:_[1]})})}):Uu.isSocket(d)&&(0,ot.createClientSocketTransport)(d.port).then(S=>{let w=Ks.default.fork(f.module,b||[],y);o(w),this._serverProcess=w,w.stderr.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),w.stdout.on("data",_=>this.outputChannel.append(Me(_)?_:_.toString(e))),S.onConnected().then(_=>{p({reader:_[0],writer:_[1]})})})})}}else if(bD.is(l)&&l.command){let f=l,d=f.args||[],h=Object.assign({},f.options);h.env=h.env?Object.assign({},process.env,h.env):process.env,h.cwd=h.cwd||u;let p=v.expand(l.command),g=Ks.default.spawn(p,d,h);return g.on("error",b=>{this.error(b.message),vD.error(b)}),!g||!g.pid?Promise.reject(`Launching server "${this.id}" using command ${f.command} failed.`):(vD.info(`Language server "${this.id}" started with ${g.pid}`),g.on("exit",b=>{b!=0&&this.error(`${f.command} exited with code: ${b}`)}),g.stderr.on("data",b=>this.outputChannel.append(Me(b)?b:b.toString(e))),this._serverProcess=g,this._isDetached=!!h.detached,Promise.resolve({reader:new ot.StreamMessageReader(g.stdout),writer:new ot.StreamMessageWriter(g.stdin)}))}return Promise.reject(`Unsupported server configuration ${JSON.stringify(a,null,2)}`)})}_getRuntimePath(e,t){if(ju.default.isAbsolute(e))return e;let i=this._mainGetRootPath();if(i!==void 0){let n=ju.default.join(i,e);if(gy.default.existsSync(n))return n}if(t!==void 0){let n=ju.default.join(t,e);if(gy.default.existsSync(n))return n}return e}_mainGetRootPath(){let e=v.workspaceFolders;return!e||e.length===0?void 0:e[0].uri}registerProposedFeatures(){this.registerFeatures(CD.createAll(this))}registerBuiltinFeatures(){super.registerBuiltinFeatures(),this.registerFeature(new QT(this)),this.registerFeature(new nD(this)),this.registerFeature(new iD(this)),this.registerFeature(new eD(this)),this.registerFeature(new ZT(this)),this.registerFeature(new tD(this)),this.registerFeature(new aD(this)),this.registerFeature(new rD(this)),this.registerFeature(new lD(this)),(v.isNvim||v.isVim&&v.env.textprop)&&v.getConfiguration("coc.preferences").get("semanticTokensHighlights",!0)&&this.registerFeature(new cD(this)),this.registerFeature(new uD(this)),this.registerFeature(new fD(this)),this.registerFeature(new dD(this)),this.registerFeature(new hD(this)),this.registerFeature(new pD(this)),this.registerFeature(new mD(this)),this.registerFeature(new gD(this)),this.clientOptions.disableWorkspaceFolders||this.registerFeature(new oD(this))}_getServerWorkingDir(e){let t=e&&e.cwd;return t&&!ju.default.isAbsolute(t)&&(t=ju.default.join(v.cwd,t)),t||(t=v.cwd),t?new Promise(i=>{gy.default.lstat(t,(n,s)=>{i(!n&&s.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}appendOutput(e,t){let i=Me(e)?e:e.toString(t);this.outputChannel.append(i.endsWith(`
`)?i:i+`
`)}},SD=class{constructor(e,t){this._client=e;this._setting=t;this._listeners=[]}start(){return v.onDidChangeConfiguration(e=>{e.affectsConfiguration(this._setting)&&this.onDidChangeConfiguration()},null,this._listeners),this.onDidChangeConfiguration(),{dispose:()=>{G(this._listeners),this._client.needsStop()&&this._client.stop()}}}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,i=e>=0?this._setting.substr(e+1):void 0,n=i?v.getConfiguration(t).get(i,!0):v.getConfiguration(t);n&&this._client.needsStart()?this._client.start():!n&&this._client.needsStop()&&this._client.stop()}};(function(e){function r(t){return[]}e.createAll=r})(CD||(CD={}))});function mme(r){switch(r){case Ee.Initial:return"init";case Ee.Running:return"running";case Ee.Starting:return"starting";case Ee.StartFailed:return"startFailed";case Ee.Stopping:return"stopping";case Ee.Stopped:return"stopped";default:return"unknown"}}function gme(r){let e=r.map(t=>typeof t=="string"?t:t.language);return e=e.filter(t=>typeof t=="string"),Array.from(new Set(e))}function vme(r,e,t){let{command:i,module:n,port:s,args:o,filetypes:a}=t;if(o=o||[],!a)return D.showMessage(`Wrong configuration of LS "${e}", filetypes not found`,"error"),null;if(!i&&!n&&!s)return D.showMessage(`Wrong configuration of LS "${e}", no command or module specified.`,"error"),null;let l;if(n){if(n=v.expand(n),!_V.default.existsSync(n))return D.showMessage(`Module file "${n}" not found for LS "${e}"`,"error"),null;l={module:n,runtime:t.runtime||process.execPath,args:o,transport:yme(t),options:wme(t)}}else i?l={command:i,args:o,options:xme(t)}:s&&(l=()=>new Promise((h,p)=>{let g=new EV.default.Socket,b=t.host||"127.0.0.1";Tl.info(`languageserver "${r}" connecting to ${b}:${s}`),g.connect(s,b,()=>{h({reader:g,writer:g})}),g.on("error",y=>{p(new Error(`Connection error for ${r}: ${y.message}`))})}));let c=!!t.disableWorkspaceFolders,u=!!t.disableSnippetCompletion;return[{ignoredRootPaths:(t.ignoredRootPaths||[]).map(h=>v.expand(h)),disableWorkspaceFolders:c,disableSnippetCompletion:u,disableDynamicRegister:!!t.disableDynamicRegister,disableCompletion:!!t.disableCompletion,disableDiagnostics:!!t.disableDiagnostics,formatterPriority:t.formatterPriority||0,documentSelector:DV(t.filetypes,t.additionalSchemes),revealOutputChannelOn:bme(t.revealOutputChannelOn),synchronize:{configurationSection:`${r}.settings`},diagnosticCollectionName:e,outputChannelName:r,stdioEncoding:t.stdioEncoding||"utf8",progressOnInitialization:t.progressOnInitialization!==!1,initializationOptions:t.initializationOptions||{}},l]}function bme(r){switch(r){case"info":return fr.Info;case"warn":return fr.Warn;case"error":return fr.Error;case"never":return fr.Never;default:return fr.Never}}function DV(r,e){let t=[],i=["file","untitled"].concat(e||[]);return r?(r.forEach(n=>{t.push(...i.map(s=>({language:n,scheme:s})))}),t):i.map(n=>({scheme:n}))}function yme(r){let{transport:e,transportPort:t}=r;return!e||e=="ipc"?pt.ipc:e=="stdio"?pt.stdio:e=="pipe"?pt.pipe:{kind:pt.socket,port:t}}function wme(r){return{cwd:r.cwd,execArgv:r.execArgv||[],env:r.env||void 0}}function xme(r){return{cwd:r.cwd,detached:!!r.detached,shell:!!r.shell,env:r.env||void 0}}function RV(r){switch(r){case dr.Running:return"running";case dr.Starting:return"starting";case dr.Stopped:return"stopped";default:return"unknown"}}var CV,_V,EV,Hu,Tl,TV,Fi,sp=R(()=>{CV=E(require("events")),_V=E(require("fs")),EV=E(require("net")),Hu=E(H());_D();En();de();Y();Te();Tl=U()("services");TV=class extends CV.EventEmitter{constructor(){super(...arguments);this.registered=new Map;this.disposables=[]}init(){v.onDidOpenTextDocument(e=>{this.start(e)},null,this.disposables),v.onDidChangeConfiguration(e=>{e.affectsConfiguration("languageserver")&&this.createCustomServices()},null,this.disposables),this.createCustomServices()}dispose(){this.removeAllListeners(),G(this.disposables);for(let e of this.registered.values())e.dispose()}regist(e){let{id:t}=e;if(t||Tl.error("invalid service configuration. ",e.name),!this.registered.get(t))return this.registered.set(t,e),Tl.info(`registered service "${t}"`),this.shouldStart(e)&&e.start(),e.state==Ee.Running&&this.emit("ready",t),e.onServiceReady(()=>{Tl.info(`service ${t} started`),this.emit("ready",t)},null,this.disposables),Hu.Disposable.create(()=>{e.stop(),e.dispose(),this.registered.delete(t)})}getService(e){let t=this.registered.get(e);return t||(t=this.registered.get(`languageserver.${e}`)),t}shouldStart(e){if(e.state!=Ee.Initial)return!1;let t=e.selector;for(let i of v.documents)if(v.match(t,i.textDocument))return!0;return!1}start(e){let t=this.getServices(e);for(let i of t)i.state==Ee.Initial&&i.start()}getServices(e){let t=[];for(let i of this.registered.values())v.match(i.selector,e)>0&&t.push(i);return t}stop(e){let t=this.registered.get(e);if(!t){D.showMessage(`Service ${e} not found`,"error");return}return Promise.resolve(t.stop())}stopAll(){for(let e of this.registered.values())e.stop()}async toggle(e){let t=this.registered.get(e);if(!t){D.showMessage(`Service ${e} not found`,"error");return}let{state:i}=t;try{i==Ee.Running?await Promise.resolve(t.stop()):i==Ee.Initial?await t.start():i==Ee.Stopped&&await t.restart()}catch(n){D.showMessage(`Service error: ${n.message}`,"error")}}getServiceStats(){let e=[];for(let[t,i]of this.registered)e.push({id:t,languageIds:gme(i.selector),state:mme(i.state)});return e}createCustomServices(){let e=v.getConfiguration().get("languageserver",{});for(let t of Object.keys(e)){let i=e[t];!this.validServerConfig(t,i)||this.registLanguageClient(t,i)}}validServerConfig(e,t){let i=[];return t.module!=null&&typeof t.module!="string"&&i.push(`"module" field of languageserver ${e} should be string`),t.command!=null&&typeof t.command!="string"&&i.push(`"command" field of languageserver ${e} should be string`),t.transport!=null&&typeof t.transport!="string"&&i.push(`"transport" field of languageserver ${e} should be string`),t.transportPort!=null&&typeof t.transportPort!="number"&&i.push(`"transportPort" field of languageserver ${e} should be string`),(!Array.isArray(t.filetypes)||!t.filetypes.every(n=>typeof n=="string"))&&i.push(`"filetypes" field of languageserver ${e} should be array of string`),t.additionalSchemes&&(!Array.isArray(t.additionalSchemes)||t.additionalSchemes.some(n=>typeof n!="string"))&&i.push(`"additionalSchemes" field of languageserver ${e} should be array of string`),i.length?(D.showMessage(i.join(`
`),"error"),!1):!0}waitClient(e){let t=this.getService(e);return t&&t.state==Ee.Running?Promise.resolve():t?new Promise(i=>{t.onServiceReady(()=>{i()})}):new Promise(i=>{let n=s=>{(s==e||s==`languageserver.${e}`)&&(this.off("ready",n),i())};this.on("ready",n)})}async registNotification(e,t){await this.waitClient(e);let i=this.getService(e);if(!i.client){D.showMessage(`Not a language client: ${e}`,"error");return}i.client.onNotification(t,async s=>{await v.nvim.call("coc#do_notify",[e,t,s])})}async sendNotification(e,t,i){if(!t)throw new Error("method required for ontification");let n=this.getService(e);if(!n||!n.client)throw new Error(`Language server ${e} not found`);if(n.state==Ee.Starting&&await n.client.onReady(),n.state!=Ee.Running)throw new Error(`Language server ${e} not running`);await Promise.resolve(n.client.sendNotification(t,i))}async sendRequest(e,t,i,n){if(!t)throw new Error("method required for sendRequest");let s=this.getService(e);if(s||await bt(100),s=this.getService(e),!s||!s.client)throw new Error(`Language server ${e} not found`);if(s.state==Ee.Starting&&await s.client.onReady(),s.state!=Ee.Running)throw new Error(`Language server ${e} not running`);return n||(n=new Hu.CancellationTokenSource().token),await Promise.resolve(s.client.sendRequest(t,i,n))}registLanguageClient(e,t){let i=typeof e=="string"?`languageserver.${e}`:e.id,n=[],s=new Hu.Emitter,o=typeof e=="string"?null:e;if(this.registered.has(i))return;let a=!1,l={id:i,client:o,name:typeof e=="string"?e:e.name,selector:typeof e=="string"?DV(t.filetypes,t.additionalSchemes):e.clientOptions.documentSelector,state:Ee.Initial,onServiceReady:s.event,start:()=>{if(l.state==Ee.Starting||l.state==Ee.Running||o&&!o.needsStart())return;if(a&&o)return o.restart(),Promise.resolve();if(!a){if(typeof e=="string"&&!o){let u=v.getConfiguration().get("languageserver",{})[e];if(!u||u.enable===!1)return;let f=vme(i,e,u);if(!f)return;o=new np(i,e,f[1],f[0]),l.selector=f[0].documentSelector,l.client=o}o.onDidChangeState(u=>{let{oldState:f,newState:d}=u;d==dr.Starting?l.state=Ee.Starting:d==dr.Running?l.state=Ee.Running:d==dr.Stopped&&(l.state=Ee.Stopped);let h=RV(f),p=RV(d);Tl.info(`${o.name} state change: ${h} => ${p}`)},null,n),a=!0}l.state=Ee.Starting,Tl.debug(`starting service: ${i}`);let c=o.start();return n.push(c),new Promise(u=>{o.onReady().then(()=>{s.fire(void 0),u()},f=>{D.showMessage(`Server ${i} failed to start: ${f}`,"error"),Tl.error(`Server ${i} failed to start:`,f),l.state=Ee.StartFailed,u()})})},dispose:async()=>{s.dispose(),G(n)},stop:async()=>{!o||!o.needsStop()||await Promise.resolve(o.stop())},restart:async()=>{o?(l.state=Ee.Starting,o.restart()):await l.start()}};return this.regist(l)}};Fi=new TV});var PV,Dl,Wu,vy=R(()=>{Y();Te();PV=E(require("events")),Dl=["<esc>","<space>","<tab>","<s-tab>","<bs>","<right>","<left>","<up>","<down>","<home>","<end>","<cr>","<FocusGained>","<FocusLost>","<ScrollWheelUp>","<ScrollWheelDown>","<LeftMouse>","<LeftDrag>","<LeftRelease>","<2-LeftMouse>","<C-a>","<C-b>","<C-c>","<C-d>","<C-e>","<C-f>","<C-g>","<C-h>","<C-i>","<C-j>","<C-k>","<C-l>","<C-m>","<C-n>","<C-o>","<C-p>","<C-q>","<C-r>","<C-s>","<C-t>","<C-u>","<C-v>","<C-w>","<C-x>","<C-y>","<C-z>","<A-a>","<A-b>","<A-c>","<A-d>","<A-e>","<A-f>","<A-g>","<A-h>","<A-i>","<A-j>","<A-k>","<A-l>","<A-m>","<A-n>","<A-o>","<A-p>","<A-q>","<A-r>","<A-s>","<A-t>","<A-u>","<A-v>","<A-w>","<A-x>","<A-y>","<A-z>"],Wu=class extends PV.EventEmitter{constructor(){super();this.configuration=v.getConfiguration("list"),this.disposable=v.onDidChangeConfiguration(e=>{e.affectsConfiguration("list")&&(this.configuration=v.getConfiguration("list"),this.emit("change"))})}get(e,t){return this.configuration.get(e,t)}get previousKey(){return this.fixKey(this.configuration.get("previousKeymap","<C-j>"))}get nextKey(){return this.fixKey(this.configuration.get("nextKeymap","<C-k>"))}dispose(){this.disposable.dispose(),this.removeAllListeners()}fixKey(e){if(Dl.includes(e))return e;let t=Dl.find(i=>i.toLowerCase()==e.toLowerCase());return t||(D.showMessage(`Configured key "${e}" not supported.`,"error"),null)}}});var hBe,vBe,by,kV=R(()=>{hBe=E(dm());Te();vy();vBe=U()("list-mappings"),by=class{constructor(e,t,i){this.manager=e;this.nvim=t;this.config=i;this.insertMappings=new Map;this.normalMappings=new Map;this.userInsertMappings=new Map;this.userNormalMappings=new Map;let{prompt:n}=e;this.add("insert","<C-n>",()=>{var s;(s=e.session)==null||s.history.next()}),this.add("insert","<C-p>",()=>{var s;(s=e.session)==null||s.history.previous()}),this.add("insert","<C-v>",async()=>{await n.paste()}),this.add("insert","<C-s>",()=>e.switchMatcher()),this.add("insert",["<C-m>","<cr>"],async()=>{await e.doAction()}),this.add("insert",["<tab>","<C-i>"," "],()=>e.chooseAction()),this.add("insert","<C-o>",()=>{e.toggleMode()}),this.add("insert","<C-c>",()=>{e.stop()}),this.add("insert","<C-l>",async()=>{var s;await((s=e.session)==null?void 0:s.reloadItems())}),this.add("insert","<left>",()=>{n.moveLeft()}),this.add("insert","<right>",()=>{n.moveRight()}),this.add("insert",["<end>","<C-e>"],()=>{n.moveToEnd()}),this.add("insert",["<home>","<C-a>"],()=>{n.moveToStart()}),this.add("insert",["<C-h>","<bs>","<backspace>"],()=>{n.onBackspace()}),this.add("insert","<C-w>",()=>{n.removeWord()}),this.add("insert","<C-u>",()=>{n.removeAhead()}),this.add("insert","<C-r>",()=>n.insertRegister()),this.add("insert","<C-d>",()=>e.feedkeys("<C-d>",!1)),this.add("insert","<PageUp>",()=>e.feedkeys("<PageUp>",!1)),this.add("insert","<PageDown>",()=>e.feedkeys("<PageDown>",!1)),this.add("insert","<down>",()=>e.normal("j")),this.add("insert","<up>",()=>e.normal("k")),this.add("insert",["<ScrollWheelUp>"],this.doScroll.bind(this,"<ScrollWheelUp>")),this.add("insert",["<ScrollWheelDown>"],this.doScroll.bind(this,"<ScrollWheelDown>")),this.add("insert",["<C-f>"],this.doScroll.bind(this,"<C-f>")),this.add("insert",["<C-b>"],this.doScroll.bind(this,"<C-b>")),this.add("normal","t",()=>e.doAction("tabe")),this.add("normal","s",()=>e.doAction("split")),this.add("normal","d",()=>e.doAction("drop")),this.add("normal",["<cr>","<C-m>","\r"],()=>e.doAction()),this.add("normal","<C-a>",()=>{var s;return(s=e.session)==null?void 0:s.ui.selectAll()}),this.add("normal"," ",()=>{var s;return(s=e.session)==null?void 0:s.ui.toggleSelection()}),this.add("normal","p",()=>e.togglePreview()),this.add("normal",["<tab>"," ","<C-i>"],()=>e.chooseAction()),this.add("normal","<C-c>",()=>{e.stop()}),this.add("normal","<C-l>",()=>{var s;return(s=e.session)==null?void 0:s.reloadItems()}),this.add("normal","<C-o>",()=>{var s;return(s=e.session)==null?void 0:s.jumpBack()}),this.add("normal","<C-e>",()=>this.scrollPreview("down")),this.add("normal","<C-y>",()=>this.scrollPreview("up")),this.add("normal",["i","I","o","O","a","A"],()=>e.toggleMode()),this.add("normal","?",()=>{var s;return(s=e.session)==null?void 0:s.showHelp()}),this.add("normal",":",async()=>{await e.cancel(!1),await t.eval('feedkeys(":")')}),this.add("normal",["<ScrollWheelUp>"],this.doScroll.bind(this,"<ScrollWheelUp>")),this.add("normal",["<ScrollWheelDown>"],this.doScroll.bind(this,"<ScrollWheelDown>")),this.createMappings(),i.on("change",()=>{this.createMappings()})}createMappings(){let e=this.config.get("insertMappings",{});this.userInsertMappings=this.fixUserMappings(e);let t=this.config.get("normalMappings",{});this.userNormalMappings=this.fixUserMappings(t)}fixUserMappings(e){let t=new Map;for(let[i,n]of Object.entries(e))if(i.length==1)t.set(i,n);else if(i.startsWith("<")&&i.endsWith(">"))if(i.toLowerCase()=="<space>")t.set(" ",n);else if(i.toLowerCase()=="<backspace>")t.set("<bs>",n);else if(Dl.includes(i))t.set(i,n);else{let s=!1;for(let o=0;o<Dl.length;o++)if(Dl[o].toLowerCase()==i.toLowerCase()){s=!0,t.set(Dl[o],n);break}s||D.showMessage(`Invalid list mappings key configuration: "${i}"`,"warning")}else D.showMessage(`Invalid list mappings key configuration: "${i}"`,"warning");return t}async doInsertKeymap(e){let t=this.config.nextKey,i=this.config.previousKey,{session:n}=this.manager;if(!n)return;if(e==t)return n.ui.index=n.ui.index+1,!0;if(e==i)return n.ui.index=n.ui.index-1,!0;let s=this.userInsertMappings.get(e);if(s)return await this.evalExpression(s,"insert"),!0;if(this.insertMappings.has(e)){let o=this.insertMappings.get(e);return await Promise.resolve(o()),!0}return!1}async doNormalKeymap(e){let t=this.userNormalMappings.get(e);if(t)return await this.evalExpression(t,"normal"),!0;if(this.normalMappings.has(e)){let i=this.normalMappings.get(e);return await Promise.resolve(i()),!0}return!1}add(e,t,i){let n=e=="insert"?this.insertMappings:this.normalMappings;if(Array.isArray(t))for(let s of t)n.set(s,i);else n.set(t,i)}async onError(e){let{nvim:t}=this;await t.call("coc#prompt#stop_prompt",["list"]),D.showMessage(e,"error")}async evalExpression(e,t){var a,l,c,u,f,d,h;if(typeof e!="string"||!e.includes(":")){await this.onError(`Invalid list mapping expression: ${e}`);return}let{manager:i}=this,{prompt:n}=i,[s,o]=e.split(":",2);if(s=="do")switch(o.toLowerCase()){case"switch":i.switchMatcher();return;case"selectall":await((a=i.session)==null?void 0:a.ui.selectAll());return;case"help":await((l=i.session)==null?void 0:l.showHelp());return;case"refresh":await((c=i.session)==null?void 0:c.reloadItems());return;case"exit":await i.cancel();return;case"stop":i.stop();return;case"cancel":await i.cancel(!1);return;case"toggle":await((u=i.session)==null?void 0:u.ui.toggleSelection());return;case"jumpback":(f=i.session)==null||f.jumpBack();return;case"previous":await i.normal("k");return;case"next":await i.normal("j");return;case"defaultaction":await i.doAction();return;case"togglemode":return i.toggleMode();case"previewtoggle":return i.togglePreview();case"previewup":return this.scrollPreview("up");case"previewdown":return this.scrollPreview("down");default:await this.onError(`'${o}' not supported`)}else if(s=="prompt")switch(o){case"previous":(d=i.session)==null||d.history.previous();return;case"next":(h=i.session)==null||h.history.next();return;case"start":return n.moveToStart();case"end":return n.moveToEnd();case"left":return n.moveLeft();case"right":return n.moveRight();case"deleteforward":return n.onBackspace();case"deletebackward":return n.removeNext();case"removetail":return n.removeTail();case"removeahead":return n.removeAhead();case"insertregister":n.insertRegister();return;case"paste":await n.paste();return;default:await this.onError(`prompt '${o}' not supported`)}else if(s=="eval")await n.eval(o);else if(s=="command")await i.command(o);else if(s=="action")await i.doAction(o);else if(s=="feedkeys")await i.feedkeys(o);else if(s=="normal")await i.normal(o,!1);else if(s=="normal!")await i.normal(o,!0);else if(s=="call")await i.call(o);else if(s=="expr"){let p=await i.call(o);p&&await i.doAction(p)}else await this.onError(`Invalid expression ${e}`)}async doScroll(e){await this.manager.feedkeys(e)}scrollPreview(e){let{nvim:t}=this;t.pauseNotification(),t.call("coc#list#scroll_preview",[e],!0),t.command("redraw",!0),t.resumeNotification(!1,!0)}}});var IV,wBe,yy,OV=R(()=>{IV=E(H()),wBe=U()("list-prompt"),yy=class{constructor(e,t){this.nvim=e;this.config=t;this.cusorIndex=0;this._input="";this._mode="insert";this.interactive=!1;this.requestInput=!1;this._onDidChangeInput=new IV.Emitter;this.onDidChangeInput=this._onDidChangeInput.event}get input(){return this._input}set input(e){this._input!=e&&(this.cusorIndex=e.length,this._input=e,this.drawPrompt(),this._onDidChangeInput.fire(this._input))}get mode(){return this._mode}set mode(e){e!=this._mode&&(this._mode=e,this.drawPrompt())}set matcher(e){this._matcher=e,this.drawPrompt()}start(e){e&&(this.interactive=e.interactive,this.cusorIndex=e.input.length,this._input=e.input,this._mode=e.mode,this._matcher=e.interactive?"":e.matcher),this.nvim.call("coc#prompt#start_prompt",["list"],!0),this.drawPrompt()}cancel(){let{nvim:e}=this;e.call("coc#prompt#stop_prompt",["list"],!0)}reset(){this._input="",this.cusorIndex=0}drawPrompt(){let e=this.config.get("indicator",">"),{cusorIndex:t,interactive:i,input:n,_matcher:s}=this,o=['echo ""'];if(this.mode=="insert")if(i?o.push("echohl MoreMsg | echon 'INTERACTIVE ' | echohl None"):s&&o.push(`echohl MoreMsg | echon '${s.toUpperCase()} ' | echohl None`),o.push(`echohl Special | echon '${e} ' | echohl None`),t==n.length)o.push(`echon '${n.replace(/'/g,"''")}'`),o.push("echohl Cursor | echon ' ' | echohl None");else{let l=n.slice(0,t);l&&o.push(`echon '${l.replace(/'/g,"''")}'`),o.push(`echohl Cursor | echon '${n[t].replace(/'/,"''")}' | echohl None`);let c=n.slice(t+1);o.push(`echon '${c.replace(/'/g,"''")}'`)}else o.push('echohl MoreMsg | echo "" | echohl None');o.push("redraw");let a=o.join("|");this.nvim.command(a,!0)}moveLeft(){this.cusorIndex!=0&&(this.cusorIndex=this.cusorIndex-1,this.drawPrompt())}moveRight(){this.cusorIndex!=this._input.length&&(this.cusorIndex=this.cusorIndex+1,this.drawPrompt())}moveToEnd(){this.cusorIndex!=this._input.length&&(this.cusorIndex=this._input.length,this.drawPrompt())}moveToStart(){this.cusorIndex!=0&&(this.cusorIndex=0,this.drawPrompt())}onBackspace(){let{cusorIndex:e,input:t}=this;if(e==0)return;let i=t.slice(0,e),n=t.slice(e);this.cusorIndex=e-1,this._input=`${i.slice(0,i.length-1)}${n}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeNext(){let{cusorIndex:e,input:t}=this;if(e==t.length-1)return;let i=t.slice(0,e),n=t.slice(e+1);this._input=`${i}${n}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeWord(){let{cusorIndex:e,input:t}=this;if(e==0)return;let i=t.slice(0,e),n=t.slice(e),s=i.replace(/[\w$]+([^\w$]+)?$/,"");this.cusorIndex=e-(i.length-s.length),this._input=`${s}${n}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeTail(){let{cusorIndex:e,input:t}=this;if(e==t.length)return;let i=t.slice(0,e);this._input=i,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeAhead(){let{cusorIndex:e,input:t}=this;if(e==0)return;let i=t.slice(e);this.cusorIndex=0,this._input=i,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}async acceptCharacter(e){if(this.requestInput){if(this.requestInput=!1,/^[0-9a-z"%#*+/:\-.]$/.test(e)){let t=await this.nvim.call("getreg",e);t=t.replace(/\n/g," "),this.addText(t)}}else this.addText(e)}insertRegister(){this.requestInput=!0}async paste(){let e=await this.nvim.eval("@*");e=e.replace(/\n/g,""),!!e&&this.addText(e)}async eval(e){let t=await this.nvim.call("eval",[e]);t=t.replace(/\n/g,""),this.addText(t)}addText(e){let{cusorIndex:t,input:i}=this;this.cusorIndex=t+e.length;let n=i.slice(0,t),s=i.slice(t);this._input=`${n}${e}${s}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}}});function Js(r){let e=[];for(let t=0,i=r.length;t<i;t++)e.push(r.charCodeAt(t));return e}function op(r){return r>=97&&r<=122||r>=65&&r<=90}function Mn(r,e){return r==e||r>=97&&r<=122&&e+32===r}function ap(r,e){let t=r.charCodeAt(0),i=e.charCodeAt(0);return t===i||t>=97&&t<=122&&i+32===t}function zu(r,e){let t=r.length;if(r.length>e.length)return!1;let i=0;for(let n=0;n<e.length&&i!==t;n++){let s=e.charCodeAt(n),o=r[i];if(s===o){i=i+1;continue}if(o>=97&&o<=122&&s+32===o){i=i+1;continue}}return i===t}var Vu=R(()=>{});var EBe,wy,LV=R(()=>{Vu();Y();EBe=U()("list-history"),wy=class{constructor(e,t){this.prompt=e;this.name=t;this.index=-1;this.loaded=[];this.current=[];this.db=v.createDatabase(`list-${t}-history`),this.key=Buffer.from(v.cwd).toString("base64")}filter(){let{input:e}=this.prompt;if(e==this.curr)return;this.historyInput="";let t=Js(e);this.current=this.loaded.filter(i=>zu(t,i)),this.index=-1}get curr(){return this.index==-1?null:this.current[this.index]}load(e){let{db:t}=this;e=e||"";let i=t.fetch(this.key);!i||!Array.isArray(i)?this.loaded=[]:this.loaded=i,this.index=-1,this.current=this.loaded.filter(n=>n.startsWith(e))}add(){let{loaded:e,db:t,prompt:i}=this,{input:n}=i;if(!n||n.length<2||n==this.historyInput)return;let s=e.indexOf(n);s!=-1&&e.splice(s,1),e.push(n),e.length>200&&(e=e.slice(-200)),t.push(this.key,e)}previous(){let{current:e,index:t}=this;!e||!e.length||(t<=0?this.index=e.length-1:this.index=t-1,this.historyInput=this.prompt.input=e[this.index]||"")}next(){let{current:e,index:t}=this;!e||!e.length||(t==e.length-1?this.index=0:this.index=t+1,this.historyInput=this.prompt.input=e[this.index]||"")}}});var AV,Gu,OBe,xy,FV=R(()=>{AV=E(Ui()),Gu=E(H());_e();de();Y();OBe=U()("list-ui"),xy=class{constructor(e,t,i,n){this.nvim=e;this.name=t;this.listOptions=i;this.config=n;this.newTab=!1;this.currIndex=0;this.items=[];this.disposables=[];this.selected=new Set;this._onDidChangeLine=new Gu.Emitter;this._onDidOpen=new Gu.Emitter;this._onDidClose=new Gu.Emitter;this._onDidLineChange=new Gu.Emitter;this._onDoubleClick=new Gu.Emitter;this.onDidChangeLine=this._onDidChangeLine.event;this.onDidLineChange=this._onDidLineChange.event;this.onDidOpen=this._onDidOpen.event;this.onDidClose=this._onDidClose.event;this.onDidDoubleClick=this._onDoubleClick.event;this.signOffset=n.get("signOffset"),this.matchHighlightGroup=n.get("matchHighlightGroup","Search"),this.newTab=i.position=="tab",O.on("BufWinLeave",async o=>{o!=this.bufnr||this.window==null||(this.window=null,this._onDidClose.fire(o))},null,this.disposables),O.on("CursorMoved",async(o,a)=>{o==this.bufnr&&this.onLineChange(a[0]-1)},null,this.disposables);let s=(0,AV.default)(async o=>{if(o!=this.bufnr)return;let[a,l,c]=await e.eval('[win_getid(),line("w0"),line("w$")]');c<300||a!=this.winid||(e.pauseNotification(),this.doHighlight(l-1,c),e.command("redraw",!0),e.resumeNotification(!1,!0))},100);this.disposables.push({dispose:()=>{s.clear()}}),O.on("CursorMoved",s,null,this.disposables)}get bufnr(){var e;return(e=this.buffer)==null?void 0:e.id}get winid(){var e;return(e=this.window)==null?void 0:e.id}get limitLines(){return this.config.get("limitLines",3e4)}onLineChange(e){this.currIndex!=e&&(this.currIndex=e,this._onDidChangeLine.fire(e))}set index(e){if(e<0||e>=this.items.length)return;let{nvim:t}=this;t.pauseNotification(),this.setCursor(e+1,0),t.command("redraw",!0),t.resumeNotification(!1,!0)}get index(){return this.currIndex}getItem(e){return this.items[e]}get item(){let{window:e}=this;return e?e.cursor.then(t=>(this.currIndex=t[0]-1,this.items[this.currIndex])):Promise.resolve(null)}async echoMessage(e){let{items:t}=this,n=`[${t.indexOf(e)+1}/${t.length}] ${e.label||""}`;this.nvim.callTimer("coc#util#echo_lines",[[n]],!0)}async updateItem(e,t){if(!this.bufnr)return;let i=Object.assign({resolved:!0},e);if(t<this.length){this.items[t]=i;let{nvim:n}=this;n.pauseNotification(),this.buffer.setOption("modifiable",!0,!0),n.call("setbufline",[this.bufnr,t+1,i.label],!0),this.buffer.setOption("modifiable",!1,!0),await n.resumeNotification()}}async getItems(){if(this.length==0||!this.window)return[];let e=await this.nvim.call("mode");if(e=="v"||e=="V"){let[n,s]=await this.getSelectedRange(),o=[];for(let a=n;a<=s;a++){let l=this.items[a-1];l&&o.push(l)}return o}let{selectedItems:t}=this;if(t.length)return t;let i=await this.item;return i==null?[]:[i]}async onMouse(e){let{nvim:t,window:i}=this;if(!i)return;let[n,s,o]=await t.eval("[v:mouse_winid,v:mouse_lnum,v:mouse_col]");if(e=="mouseDown"){this.mouseDown={winid:n,lnum:s,col:o,current:n==i.id};return}let a=n==i.id;if(a&&e=="doubleClick"&&(this.setCursor(s,0),this._onDoubleClick.fire()),a&&e=="mouseDrag"){if(!this.mouseDown)return;await this.selectLines(this.mouseDown.lnum,s)}else if(a&&e=="mouseUp"){if(!this.mouseDown)return;this.mouseDown.lnum==s?(this.setCursor(s,0),t.command("redraw",!0)):await this.selectLines(this.mouseDown.lnum,s)}else!a&&e=="mouseUp"&&(t.pauseNotification(),t.call("win_gotoid",n,!0),t.call("cursor",[s,o],!0),t.command("redraw",!0),t.resumeNotification(!1,!0))}async resume(){var n;let{items:e,selected:t,nvim:i}=this;if(await this.drawItems(e,this.height,!0),!!t.size){i.pauseNotification();for(let s of t)(n=this.buffer)==null||n.placeSign({lnum:s,id:this.signOffset+s,name:"CocSelected",group:"coc-list"});i.command("redraw",!0),i.resumeNotification(!1,!0)}}async toggleSelection(){let{nvim:e}=this;await e.call("win_gotoid",[this.winid]);let t=await e.call("line","."),i=await e.call("mode");if(i=="v"||i=="V"){let[n,s]=await this.getSelectedRange();n>s&&([n,s]=[s,n]);for(let a=n;a<=s;a++)this.toggleLine(a);this.setCursor(s,0),e.command("redraw",!0),await e.resumeNotification();return}e.pauseNotification(),this.toggleLine(t),this.setCursor(t+1,0),e.command("redraw",!0),await e.resumeNotification()}toggleLine(e){let{selected:t,buffer:i,signOffset:n}=this;t.has(e)?(t.delete(e),i.unplaceSign({id:n+e,group:"coc-list"})):(t.add(e),i.placeSign({lnum:e,id:n+e,name:"CocSelected",group:"coc-list"}))}async selectLines(e,t){let{nvim:i,signOffset:n,buffer:s,length:o}=this;this.clearSelection();let{selected:a}=this;i.pauseNotification(),e>t&&([e,t]=[t,e]);for(let c=e;c<=t&&!(c>o);c++)a.add(c),s.placeSign({lnum:c,id:n+c,name:"CocSelected",group:"coc-list"});this.setCursor(t,0),i.command("redraw",!0),await i.resumeNotification()}async selectAll(){let{length:e}=this;e!=0&&await this.selectLines(1,e)}clearSelection(){let{selected:e,signOffset:t,buffer:i}=this;if(e.size>0){let n=[];for(let s of e)n.push(t+s);i==null||i.unplaceSign({group:"coc-list"}),this.selected.clear()}}get ready(){return this.window?Promise.resolve():new Promise(e=>{let t=this.onDidLineChange(()=>{t.dispose(),e()})})}async drawItems(e,t,i=!1){let{nvim:n,name:s,listOptions:o}=this;if(this.items=e.length>this.limitLines?e.slice(0,this.limitLines):e,!this.window){let{position:c,numberSelect:u}=o,[f,d]=await n.call("coc#list#create",[c,t,s,u]);this.height=t,this.buffer=n.createBuffer(f);let h=this.window=n.createWindow(d),p=this.config.get("statusLineSegments");p&&h.setOption("statusline",p.join(" "),!0),this._onDidOpen.fire(this.bufnr)}let a=this.items.map(c=>c.label),l=i?this.currIndex:0;this.setLines(a,!1,l),this._onDidLineChange.fire(this.currIndex+1)}appendItems(e){let t=this.items.length;if(t>=this.limitLines)return;let i=this.limitLines-t,n=e.slice(0,i);this.items=this.items.concat(n),this.setLines(n.map(s=>s.label),t>0,this.currIndex)}setLines(e,t=!1,i){let{nvim:n,buffer:s,window:o}=this;if(!(!s||!o)){if(n.pauseNotification(),t||(n.call("coc#compat#clear_matches",[o.id],!0),e.length||(e=["No results, press ? on normal mode to get help."],n.call("coc#compat#matchaddpos",["Comment",[[1]],99,o.id],!0))),s.setOption("modifiable",!0,!0),s.setLines(e,{start:t?-1:0,end:-1,strictIndexing:!1},!0),s.setOption("modifiable",!1,!0),!t&&i==0)this.doHighlight(0,299);else{let a=this.newTab?v.env.lines:this.height;this.doHighlight(Math.max(0,i-a),Math.min(i+a+1,this.length-1))}t||(this.currIndex=i,o.setCursor([i+1,0],!0)),n.command("redraws",!0),n.resumeNotification(!1,!0)}}restoreWindow(){if(this.newTab)return;let{winid:e,height:t}=this;e&&t&&this.nvim.call("coc#list#restore",[e,t],!0)}get length(){return this.items.length}get selectedItems(){let{selected:e,items:t}=this,i=[];for(let n of e)t[n-1]&&i.push(t[n-1]);return i}doHighlight(e,t){let{items:i}=this,n=[];for(let s=e;s<=Math.min(t,i.length-1);s++){let{ansiHighlights:o,highlights:a}=i[s];if(o)for(let l of o){let{span:c,hlGroup:u}=l;n.push({hlGroup:u,priority:9,pos:[s+1,c[0]+1,c[1]-c[0]]})}if(a&&Array.isArray(a.spans)){let{spans:l,hlGroup:c}=a;for(let u of l)n.push({hlGroup:c||this.matchHighlightGroup,priority:11,pos:[s+1,u[0]+1,u[1]-u[0]]})}}this.nvim.call("coc#compat#matchaddgroups",[this.window.id,n],!0)}setCursor(e,t){var s;let{items:i}=this,n=i.length==0?1:i.length;e>n||(this.onLineChange(e-1),(s=this.window)==null||s.setCursor([e,t],!0))}async getSelectedRange(){let{nvim:e}=this;await e.call("coc#prompt#stop_prompt",["list"]),await e.eval('feedkeys("\\<esc>", "in")');let[,t]=await e.call("getpos","'<"),[,i]=await e.call("getpos","'>");return this.nvim.call("coc#prompt#start_prompt",["list"],!0),[t,i]}reset(){this.window&&(this.window=null,this.buffer=null)}dispose(){G(this.disposables),this.nvim.call("coc#window#close",[this.winid||-1],!0),this.window=null,this.buffer=null,this.items=[],this._onDidChangeLine.dispose(),this._onDidOpen.dispose(),this._onDidClose.dispose(),this._onDidLineChange.dispose(),this._onDoubleClick.dispose()}}});function MV(r,e,t=""){if(!r)return{score:0};if(!e)return{score:1};let i=[],n=Js(e),s=t?r.indexOf(t):-1,o=s!=-1&&zu(n,t),a=0,l=e[0],c=0;if(o){if(t.startsWith(l))a=a+2,c=s+1,i.push(s);else if(t[0].toLowerCase()==l)a=a+1.5,c=s+1,i.push(s);else for(let u=1;u<t.length;u++)if(ap(l,t[u])){a=a+1,c=s+u+1,i.push(s+u);break}}else if(r.startsWith(l))a=a+1,i.push(0),c=1;else{for(let u=1;u<r.length;u++)if(r[u-1]==ED.sep&&r[u]==l){a=a+1,i.push(u),c=u+1;break}if(c==0){for(let u=0;u<r.length;u++)if(ap(l,r[u])){a=a+.5,i.push(u),c=u+1;break}}}return c==0?{score:0}:n.length==1?{score:a,matches:i}:NV(n.slice(1),r,c,{score:a,matches:i})}function NV(r,e,t,i){let{score:n,matches:s}=i,o=[],a=r[0],l=r.slice(1),c;function u(d){if(!!c){if(l.length==0)o.push(c);else if(c){let h=NV(l,e,d,c);h&&o.push(h)}}}let f=t<e.length?e[t].charCodeAt(0):null;if(!f)return null;if(f==a?(c={score:n+1,matches:s.concat([t])},u(t+1)):Mn(a,f)&&(c={score:n+.5,matches:s.concat([t])},u(t+1)),t+1<e.length){for(let d=t+1;d<e.length;d++){let h=e[d].charCodeAt(0);if(e[d-1]==ED.sep&&Mn(a,h)){let p=a==h?1:.5;c={score:n+p,matches:s.concat([d])},u(d+1);break}}for(let d=t+1;d<e.length;d++){let h=e[d].charCodeAt(0);if(Mn(a,h)){let p=a==h?.5:.2;c={score:n+p,matches:s.concat([d])},u(d+1);break}}}return o.length?Sme(o):null}function Sme(r){let e=r[0];for(let t=1;t<r.length;t++)r[t].score>e.score&&(e=r[t]);return e}var ED,qV=R(()=>{ED=E(require("path"));Vu()});function Cy(r){return r.filterText!=null?QB(r.filterText,r.label):r.label}function Eme(r){let e=[],t=0,i=0,n="";for(;i<r.length;i++){let s=r[i];s.charCodeAt(0)===32&&n&&n!="\\"&&t!=i&&(e.push(r.slice(t,i)),t=i+1),n=s}return t!=r.length&&e.push(r.slice(t,r.length)),e.map(s=>s.replace(/\\\s/g," ").trim()).filter(s=>s.length>0)}var lp,Cme,_me,Sy,$V=R(()=>{lp=E(H());Nc();n_();tv();qV();yt();Te();Y();Cme=U()("list-worker"),_me="",Sy=class{constructor(e,t,i,n,s){this.nvim=e;this.list=t;this.prompt=i;this.listOptions=n;this.config=s;this._loading=!1;this.totalItems=[];this._onDidChangeItems=new lp.Emitter;this._onDidChangeLoading=new lp.Emitter;this.onDidChangeItems=this._onDidChangeItems.event;this.onDidChangeLoading=this._onDidChangeLoading.event}set loading(e){this._loading!=e&&(this._loading=e,this._onDidChangeLoading.fire(e))}get isLoading(){return this._loading}async loadItems(e,t=!1){let{list:i,listOptions:n}=this;this.loading=!0;let{interactive:s}=n;this.tokenSource=new lp.CancellationTokenSource;let o=this.tokenSource.token,a=await i.loadItems(e,o);if(!o.isCancellationRequested)if(!a||Array.isArray(a)){this.tokenSource=null,a=a||[],this.totalItems=a.map(c=>(c.label=this.fixLabel(c.label),this.parseListItemAnsi(c),c)),this.loading=!1;let l;s?l=this.convertToHighlightItems(a):l=this.filterItems(a),this._onDidChangeItems.fire({items:l,reload:t,finished:!0})}else{let l=a,c=this.totalItems=[],u=0,f=e.input,d,h,p=y=>{if(h=Date.now(),u>=c.length)return;let S=this.input!=f;if(!(s&&S))if(u==0||S){f=this.input,u=c.length;let w;s?w=this.convertToHighlightItems(c):w=this.filterItems(c),this._onDidChangeItems.fire({items:w,reload:t,append:!1,finished:y})}else{let w=c.slice(u);u=c.length;let _;s?_=this.convertToHighlightItems(w):_=this.filterItems(w),this._onDidChangeItems.fire({items:_,append:!0,finished:y})}};l.on("data",y=>{d&&clearTimeout(d),!o.isCancellationRequested&&(s&&this.input!=f||(y.label=this.fixLabel(y.label),this.parseListItemAnsi(y),c.push(y),!h&&c.length==500||Date.now()-h>200?p():d=setTimeout(()=>p(),50)))});let g=()=>{l!=null&&(this.tokenSource=null,l=null,this.loading=!1,b.dispose(),d&&clearTimeout(d),c.length==0?this._onDidChangeItems.fire({items:[],finished:!0}):p(!0))},b=o.onCancellationRequested(()=>{l&&(l.dispose(),g())});l.on("error",async y=>{l!=null&&(l=null,this.tokenSource=null,this.loading=!1,b.dispose(),d&&clearTimeout(d),this.nvim.call("coc#prompt#stop_prompt",["list"],!0),D.showMessage(`Task error: ${y.toString()}`,"error"),Cme.error(y))}),l.on("end",g)}}drawItems(){let{totalItems:e}=this,t;t=this.filterItems(e),this._onDidChangeItems.fire({items:t,finished:!0})}stop(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null),this.loading=!1}get length(){return this.totalItems.length}get input(){return this.prompt.input}convertToHighlightItems(e){let{input:t}=this;return t?e.map(i=>{let n=Cy(i),s=MV(n,t);if(!(s==null?void 0:s.score))return i;let o=this.getHighlights(n,s.matches);return Object.assign({},i,{highlights:o})}):[]}filterItems(e){let{input:t}=this,{sort:i,matcher:n,ignorecase:s}=this.listOptions,o=this.config.extendedSearchMode?Eme(t):[t];if(t.length==0||o.length==0)return e;if(n=="strict"){let c=[];for(let u of e){let f=[],d=Cy(u),h=!0;for(let p of o){let g=s?d.toLowerCase().indexOf(p.toLowerCase()):d.indexOf(p);if(g==-1){h=!1;break}f.push([Ci(d,g),Ci(d,g+re(p))])}h&&c.push(Object.assign({},u,{highlights:{spans:f}}))}return c}if(n=="regex"){let c=[],u=s?"iu":"u",f=o.reduce((d,h)=>{try{let p=new RegExp(h,u);d.push(p)}catch(p){}return d},[]);for(let d of e){let h=[],p=Cy(d),g=!0;for(let b of f){let y=p.match(b);if(y==null){g=!1;break}h.push([Ci(p,y.index),Ci(p,y.index+re(y[0]))])}g&&c.push(Object.assign({},d,{highlights:{spans:h}}))}return c}let a=[],l=0;for(let c of e){let u=c.filterText||c.label,f=0,d=[],h=Cy(c),p=!0;for(let b of o){if(!ev(b,u)){p=!1;break}d.push(...Qg(b,h)),i&&(f+=eu(b,u))}if(!p)continue;let g=Object.assign({},c,{sortText:typeof c.sortText=="string"?c.sortText:String.fromCharCode(l),score:f,highlights:this.getHighlights(h,d)});a.push(g),l=l+1}return i&&a.length&&a.sort((c,u)=>c.score!=u.score?u.score-c.score:c.sortText>u.sortText?1:-1),a}getHighlights(e,t){let i=[];if(t&&t.length){let n=t.shift(),s=t.shift(),o=n;for(;s;){if(s==o+1){o=s,s=t.shift();continue}i.push([Ci(e,n),Ci(e,o)+1]),n=s,o=n,s=t.shift()}i.push([Ci(e,n),Ci(e,o)+1])}return{spans:i}}parseListItemAnsi(e){let{label:t}=e;if(e.ansiHighlights||!t.includes(_me))return;let{line:i,highlights:n}=Mc(t);e.label=i,e.ansiHighlights=n}fixLabel(e){let{columns:t}=v.env;return e=e.split(`
`).join(" "),e.slice(0,t*2)}dispose(){this.stop()}}});var TD,Tme,Dme,_y,BV=R(()=>{TD=E(Ui());As();ia();$u();de();Y();Te();LV();FV();$V();Tme=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Dme=U()("list-session"),_y=class{constructor(e,t,i,n,s=[],o){this.nvim=e;this.prompt=t;this.list=i;this.listOptions=n;this.listArgs=s;this.config=o;this.loadingFrame="";this.hidden=!1;this.disposables=[];this.mutex=new hi;this.args=[];this.ui=new xy(e,i.name,n,o),this.history=new wy(t,i.name),this.worker=new Sy(e,i,t,n,{interactiveDebounceTime:o.get("interactiveDebounceTime",100),extendedSearchMode:o.get("extendedSearchMode",!0)}),this.interactiveDebounceTime=o.get("interactiveDebounceTime",100);let a=(0,TD.default)(async()=>{let[c,u,f]=await e.eval('[coc#list#has_preview(),win_getid(),line(".")]');c&&u==this.winid&&await this.doPreview(f-1)},50);this.disposables.push({dispose:()=>{a.clear()}}),this.ui.onDidChangeLine(a,null,this.disposables),this.ui.onDidChangeLine(this.resolveItem,this,this.disposables),this.ui.onDidLineChange(this.resolveItem,this,this.disposables);let l=(0,TD.default)(async()=>{let{autoPreview:c}=this.listOptions;if(!c){let[u,f]=await e.eval("[coc#list#has_preview(),mode()]");if(!u||f!="n")return}await this.doAction("preview")},50);this.disposables.push({dispose:()=>{l.clear()}}),this.ui.onDidLineChange(l,null,this.disposables),this.ui.onDidLineChange(()=>{this.updateStatus()},null,this.disposables),this.ui.onDidOpen(async()=>{typeof this.list.doHighlight=="function"&&this.list.doHighlight(),this.listOptions.first&&await this.doAction()},null,this.disposables),this.ui.onDidClose(async()=>{await this.hide()},null,this.disposables),this.ui.onDidDoubleClick(async()=>{await this.doAction()},null,this.disposables),this.worker.onDidChangeItems(async({items:c,reload:u,append:f,finished:d})=>{let h=await this.mutex.acquire();if(!this.hidden)try{if(f)this.ui.appendItems(c);else{let p=this.config.get("height",10);d&&!n.interactive&&n.input.length==0&&(p=Math.min(c.length,p)),await this.ui.drawItems(c,Math.max(1,p),u)}}catch(p){e.echoError(p)}h()},null,this.disposables),this.worker.onDidChangeLoading(c=>{this.hidden||(c?this.interval=setInterval(()=>{let u=Math.floor(new Date().getMilliseconds()/100);this.loadingFrame=Tme[u],this.updateStatus()},100):(this.interval&&(this.loadingFrame="",clearInterval(this.interval),this.interval=null),this.updateStatus()))},null,this.disposables)}async start(e){this.args=e,this.cwd=v.cwd,this.hidden=!1;let{listOptions:t,listArgs:i}=this,n=await this.nvim.eval('[win_getid(),bufnr("%"),winheight("%")]');this.listArgs=i,this.history.load(t.input||""),this.window=this.nvim.createWindow(n[0]),this.buffer=this.nvim.createBuffer(n[1]),this.savedHeight=n[2],await this.worker.loadItems(this.context)}async reloadItems(){if(!this.window)return;let e=await this.nvim.call("winbufnr",[this.window.id]);e!=-1&&(this.buffer=this.nvim.createBuffer(e),await this.worker.loadItems(this.context,!0))}async call(e){var s,o;await this.nvim.call("coc#prompt#stop_prompt",["list"]);let t=await this.ui.getItems(),i={name:this.name,args:this.listArgs,input:this.prompt.input,winid:(s=this.window)==null?void 0:s.id,bufnr:(o=this.buffer)==null?void 0:o.id,targets:t},n=await this.nvim.call(e,[i]);return this.prompt.start(),n}async chooseAction(){let{nvim:e}=this,{actions:t,defaultAction:i}=this.list,n=t.map(u=>u.name),s=n.indexOf(i);s!=-1&&(n.splice(s,1),n.unshift(i));let o=new Set,a=[],l=[];for(let u of n){let f=0;for(let d of u){if(!o.has(d)){o.add(d),a.push(`${u.slice(0,f)}&${u.slice(f)}`);break}f++}f==u.length&&l.push(u)}l.length&&(n=n.filter(u=>!l.includes(u))),await e.call("coc#prompt#stop_prompt",["list"]);let c=await e.call("confirm",["Choose action:",a.join(`
`)]);await bt(10),this.prompt.start(),c&&await this.doAction(n[c-1]),l.length&&e.echoError(`Can't create shortcut for actions: ${l.join(",")} of "${this.name}" list`)}async doAction(e){let{list:t}=this;e=e||t.defaultAction;let i=t.actions.find(s=>s.name==e);if(!i){D.showMessage(`Action ${e} not found`,"error");return}let n;if(e=="preview"){let s=await this.ui.item;n=s?[s]:[]}else n=await this.ui.getItems();n.length&&await this.doItemAction(n,i)}async doPreview(e){let t=this.ui.getItem(e),i=this.list.actions.find(n=>n.name=="preview");!t||!i||await this.doItemAction([t],i)}async first(){await this.doDefaultAction(0)}async last(){await this.doDefaultAction(this.ui.length-1)}async previous(){await this.doDefaultAction(this.ui.index-1)}async next(){await this.doDefaultAction(this.ui.index+1)}async doDefaultAction(e){let{ui:t}=this,i=t.getItem(e);!i||(t.index=e,await this.doItemAction([i],this.defaultAction),await t.echoMessage(i))}get name(){return this.list.name}get winid(){return this.ui.winid}get length(){return this.ui.length}get defaultAction(){let{defaultAction:e,actions:t}=this.list,i=t.find(n=>n.name==e);if(!i)throw new Error(`default action "${e}" not found`);return i}async hide(){if(this.hidden)return;let{nvim:e,interval:t}=this;t&&clearInterval(t),this.hidden=!0,this.worker.stop(),this.history.add();let{winid:i}=this.ui;this.ui.reset(),this.window&&i&&(await e.call("coc#list#hide",[this.window.id,this.savedHeight,i]),v.isVim&&(e.command("redraw",!0),await bt(10))),e.call("coc#prompt#stop_prompt",["list"],!0)}toggleMode(){let e=this.prompt.mode=="normal"?"insert":"normal";this.prompt.mode=e,this.listOptions.mode=e,this.updateStatus()}stop(){this.worker.stop()}async resolveItem(){let e=this.ui.index,t=this.ui.getItem(e);if(!t||t.resolved)return;let{list:i}=this;if(typeof i.resolveItem=="function"){let n=await Promise.resolve(i.resolveItem(t));n&&e==this.ui.index&&await this.ui.updateItem(n,e)}}async showHelp(){await this.hide();let{list:e,nvim:t}=this;if(!e)return;t.pauseNotification(),t.command("tabe +setl\\ previewwindow [LIST HELP]",!0),t.command("setl nobuflisted noswapfile buftype=nofile bufhidden=wipe",!0),await t.resumeNotification();let i=e.options&&e.options.length,n=await t.buffer,s=new an;if(s.addLine("NAME","Label"),s.addLine(` ${e.name} - ${e.description||""}
`),s.addLine("SYNOPSIS","Label"),s.addLine(` :CocList [LIST OPTIONS] ${e.name}${i?" [ARGUMENTS]":""}
`),e.detail){s.addLine("DESCRIPTION","Label");let a=e.detail.split(`
`).map(l=>" "+l);s.addLine(a.join(`
`)+`
`)}if(i){s.addLine("ARGUMENTS","Label"),s.addLine("");for(let a of e.options)s.addLine(a.name,"Special"),s.addLine(` ${a.description}`),s.addLine("");s.addLine("")}let o=v.getConfiguration(`list.source.${e.name}`);if(Object.keys(o).length){s.addLine("CONFIGURATIONS","Label"),s.addLine("");let a={};we.all.forEach(l=>{let{packageJSON:c}=l,{contributes:u}=c;if(!u)return;let{configuration:f}=u;if(f){let{properties:d}=f;if(d)for(let h of Object.keys(d))a[h]=d[h]}});for(let l of Object.keys(o)){let c=o[l],u=`list.source.${e.name}.${l}`,f=a[u]&&a[u].description?a[u].description:l;s.addLine(` "${u}"`,"MoreMsg"),s.addText(` - ${f}, current value: `),s.addText(JSON.stringify(c),"Special")}s.addLine("")}s.addLine("ACTIONS","Label"),s.addLine(` ${e.actions.map(a=>a.name).join(", ")}`),s.addLine(""),s.addLine("see ':h coc-list-options' for available list options.","Comment"),t.pauseNotification(),s.render(n,0,-1),t.command("setl nomod",!0),t.command("setl nomodifiable",!0),t.command("normal! gg",!0),t.command("nnoremap <buffer> q :bd!<CR>",!0),await t.resumeNotification()}switchMatcher(){let{matcher:e,interactive:t}=this.listOptions;if(t)return;let i=["fuzzy","strict","regex"],n=i.indexOf(e)+1;n>=i.length&&(n=0),this.listOptions.matcher=i[n],this.prompt.matcher=i[n],this.worker.drawItems()}updateStatus(){let{ui:e,list:t,nvim:i}=this;if(!e.winid)return;let n=i.createBuffer(e.bufnr),s={mode:this.prompt.mode.toUpperCase(),args:this.args.join(" "),name:t.name,cwd:this.cwd,loading:this.loadingFrame,total:this.worker.length};i.pauseNotification(),n.setVar("list_status",s,!0),i.command("redraws",!0),i.resumeNotification(!1,!0).logError()}get context(){let{winid:e}=this.ui;return{options:this.listOptions,args:this.listArgs,input:this.prompt.input,cwd:v.cwd,window:this.window,buffer:this.buffer,listWindow:e?this.nvim.createWindow(e):void 0}}onMouseEvent(e){switch(e){case"<LeftMouse>":return this.ui.onMouse("mouseDown");case"<LeftDrag>":return this.ui.onMouse("mouseDrag");case"<LeftRelease>":return this.ui.onMouse("mouseUp");case"<2-LeftMouse>":return this.ui.onMouse("doubleClick")}}async doNumberSelect(e){if(!this.listOptions.numberSelect)return!1;let t=e.charCodeAt(0);if(t>=48&&t<=57){let i=Number(e);if(i==0&&(i=10),this.ui.length>=i)return this.nvim.pauseNotification(),this.ui.setCursor(i,0),await this.nvim.resumeNotification(),await this.doAction(),!0}return!1}jumpBack(){let{window:e,nvim:t}=this;e&&(t.pauseNotification(),t.call("coc#prompt#stop_prompt",["list"],!0),this.nvim.call("win_gotoid",[e.id],!0),t.resumeNotification(!1,!0).logError())}async resume(){this.winid&&await this.hide();let e=await this.nvim.eval('[win_getid(),bufnr("%"),winheight("%")]');this.hidden=!1,this.window=this.nvim.createWindow(e[0]),this.buffer=this.nvim.createBuffer(e[1]),this.savedHeight=e[2],this.prompt.start(),await this.ui.resume(),this.listOptions.autoPreview&&await this.doAction("preview")}async doItemAction(e,t){let{noQuit:i}=this.listOptions,{nvim:n}=this,s=t.persist===!0||t.name=="preview",o=this.winid&&(s||i);try{if(o?s||(n.pauseNotification(),n.call("coc#prompt#stop_prompt",["list"],!0),n.call("win_gotoid",[this.context.window.id],!0),await n.resumeNotification()):await this.hide(),t.multiple)await Promise.resolve(t.execute(e,this.context));else if(t.parallel)await Promise.all(e.map(a=>Promise.resolve(t.execute(a,this.context))));else for(let a of e)await Promise.resolve(t.execute(a,this.context));o&&this.ui.restoreWindow(),t.reload&&o&&await this.worker.loadItems(this.context,!0)}catch(a){D.showMessage(a.message,"error"),Dme.error(`Error on action "${t.name}"`,a)}}onInputChange(){this.timer&&clearTimeout(this.timer);let e=this.worker.length;if(this.listOptions.input=this.prompt.input,this.listOptions.interactive)this.worker.stop(),this.timer=setTimeout(async()=>{await this.worker.loadItems(this.context)},this.interactiveDebounceTime);else if(e){let t=Math.max(Math.min(Math.floor(e/200),300),50);this.timer=setTimeout(()=>{this.worker.drawItems()},t)}}dispose(){if(!this.hidden){this.hidden=!0;let{winid:e}=this.ui;this.ui.reset(),this.window&&e&&this.nvim.call("coc#list#hide",[this.window.id,this.savedHeight,e],!0)}this.interval&&clearInterval(this.interval),this.timer&&clearTimeout(this.timer),G(this.disposables),this.worker.dispose(),this.ui.dispose()}}});var jV,UV,HV,Rme,Ey,WV=R(()=>{jV=E(require("child_process")),UV=E(require("events")),HV=E(require("readline"));de();Rme=U()("list-commandTask"),Ey=class extends UV.EventEmitter{constructor(e){super();this.opt=e;this.disposables=[];this.start()}start(){let{cmd:e,args:t,cwd:i,onLine:n}=this.opt,s=(0,jV.spawn)(e,t,{cwd:i,windowsHide:!0});this.disposables.push({dispose:()=>{s.kill()}}),s.on("error",a=>{this.emit("error",a.message)}),s.stderr.on("data",a=>{Rme.error(`[${e} Error]`,a.toString("utf8"))});let o=HV.default.createInterface(s.stdout);o.on("line",a=>{let l=n(a);l&&this.emit("data",l)}),o.on("close",()=>{this.emit("end")})}dispose(){G(this.disposables)}}});function Pme(r){return r=="javascriptreact"?"javascript":r=="typescriptreact"?"typescript":r.indexOf(".")!==-1?r.split(".")[0]:r}var zV,DD,VV,hr,hje,Kt,ls=R(()=>{zV=E(require("fs")),DD=E(require("path")),VV=E(require("readline")),hr=E(H());qe();de();Nt();Vt();Y();WV();vy();hje=U()("list-basic"),Kt=class{constructor(e){this.nvim=e;this.defaultAction="open";this.actions=[];this.options=[];this.disposables=[];this.config=new Wu}get alignColumns(){return this.config.get("alignColumns",!1)}get hlGroup(){return this.config.get("previewHighlightGroup","Search")}get previewHeight(){return this.config.get("maxPreviewHeight",12)}get splitRight(){return this.config.get("previewSplitRight",!1)}parseArguments(e){if(!this.optionMap){this.optionMap=new Map;for(let i of this.options){let n=i.name.split(/,\s*/g).map(o=>o.replace(/\s+.*/g,"")),s=i.key?i.key:n[n.length-1].replace(/^-/,"");for(let o of n)this.optionMap.set(o,{name:s,hasValue:i.hasValue})}}let t={};for(let i=0;i<e.length;i++){let n=e[i],s=this.optionMap.get(n);if(!s)continue;let o=!0;s.hasValue&&(o=e[i+1]||"",i=i+1),t[s.name]=o}return t}getConfig(){return v.getConfiguration(`list.source.${this.name}`)}addAction(e,t,i){this.createAction(Object.assign({name:e,execute:t},i||{}))}addMultipleAction(e,t,i){this.createAction(Object.assign({name:e,multiple:!0,execute:t},i||{}))}createCommandTask(e){return new Ey(e)}addLocationActions(){this.createAction({name:"preview",execute:async(t,i)=>{let n=await this.convertLocation(t.location);await this.previewLocation(n,i)}});let{nvim:e}=this;this.createAction({name:"quickfix",multiple:!0,execute:async t=>{let i=await Promise.all(t.map(s=>this.convertLocation(s.location).then(o=>v.getQuickfixItem(o))));await e.call("setqflist",[i]);let n=await e.getVar("coc_quickfix_open_command");e.command(typeof n=="string"?n:"copen",!0)}});for(let t of["open","tabe","drop","vsplit","split"])this.createAction({name:t,execute:async i=>{await this.jumpTo(i.location,t=="open"?null:t)}})}async convertLocation(e){if(typeof e=="string")return hr.Location.create(e,hr.Range.create(0,0,0,0));if(hr.Location.is(e))return e;let t=B.parse(e.uri);if(t.scheme!="file")return hr.Location.create(e.uri,hr.Range.create(0,0,0,0));let i=VV.default.createInterface({input:zV.default.createReadStream(t.fsPath,{encoding:"utf8"})}),n=e.line,s=0,o=!1,a=await new Promise(l=>{i.on("line",c=>{if(!o){if(c.includes(n)){i.removeAllListeners(),i.close(),o=!0,l(c);return}s=s+1}}),i.on("error",c=>{this.nvim.errWriteLine(`Read ${t.fsPath} error: ${c.message}`),l(null)})});if(a!=null){let l=e.text?a.indexOf(e.text):0;l==0&&(l=a.match(/^\s*/)[0].length);let c=hr.Position.create(s,l+(e.text?e.text.length:0));return hr.Location.create(e.uri,hr.Range.create(hr.Position.create(s,l),c))}return hr.Location.create(e.uri,hr.Range.create(0,0,0,0))}async jumpTo(e,t){if(typeof e=="string"){await v.jumpTo(e,null,t);return}let{range:i,uri:n}=await this.convertLocation(e),s=i.start;s.line==0&&s.character==0&&De(s,i.end)==0&&(s=null),await v.jumpTo(n,s,t)}createAction(e){let{name:t}=e,i=this.actions.findIndex(n=>n.name==t);i!==-1&&this.actions.splice(i,1),this.actions.push(e)}async previewLocation(e,t){if(!t.listWindow)return;let{nvim:i}=this,{uri:n,range:s}=e,o=v.getDocument(e.uri),a=B.parse(n),l=[];if(o)l=o.getLines();else if(a.scheme=="file")try{l=(await Gc(a.fsPath,"utf8")).split(/\r?\n/)}catch(u){""+a.fsPath,u.message}let c={winid:t.window.id,range:Fs(s)?null:s,lnum:s.start.line+1,name:a.scheme=="file"?a.fsPath:n,filetype:o?o.filetype:this.getFiletype(a.fsPath),position:t.options.position,maxHeight:this.previewHeight,splitRight:this.splitRight,hlGroup:this.hlGroup,scheme:a.scheme};await i.call("coc#list#preview",[l,c]),v.isVim&&i.command("redraw",!0)}async preview(e,t){let{nvim:i}=this,{bufname:n,filetype:s,range:o,lines:a,lnum:l}=e,c={winid:t.window.id,lnum:o?o.start.line+1:l||1,filetype:s||"txt",position:t.options.position,maxHeight:this.previewHeight,splitRight:this.splitRight,hlGroup:this.hlGroup};n&&(c.name=n),o&&(c.range=o),await i.call("coc#list#preview",[a,c]),v.isVim&&i.command("redraw",!0)}doHighlight(){}dispose(){G(this.disposables)}getFiletype(e){let t=DD.default.extname(e);if(!t)return"";for(let i of v.documents){let n=B.parse(i.uri).fsPath;if(DD.default.extname(n)==t)return Pme(i.filetype)}return""}}});function pr(r,e){if(e.length===0)return[];let t=[];if(r){let i=Array(Math.min(...e.map(n=>n.label.length))).fill(0);for(let n of e)for(let s=0;s<i.length;s++)i[s]=Math.max(i[s],n.label[s].length);t=e.map(n=>ff(ut({},n),{label:n.label.map((s,o)=>s.padEnd(i[o])).join(" ")}))}else t=e.map(i=>ff(ut({},i),{label:i.label.join(" ")}));return t}function GV(r,e){var t;if(r==="hidden")return"";if(r==="full")return e;if(r==="short"){let i=e.split(Ty.default.sep);return i.length<2?e:[...i.slice(0,i.length-2).filter(s=>s.length>0).map(s=>s[0]),i[i.length-1]].join(Ty.default.sep)}else{let i=e.split(Ty.default.sep);return(t=i[i.length-1])!=null?t:""}}var Ty,ra=R(()=>{Ty=E(require("path"))});function kme(r,e){let t=r.indexOf(e);return t==-1?-1:r.length-t}var Dy,KV=R(()=>{Ei();_e();Y();ls();ra();Dy=class extends Kt{constructor(e){super(e);this.defaultAction="run";this.description="registered commands of coc.nvim";this.name="commands";this.mru=v.createMru("commands"),this.addAction("run",async t=>{let{cmd:i}=t.data;await O.fire("Command",[i]),se.executeCommand(i).logError(),await se.addRecent(i)}),this.addAction("append",async t=>{let{cmd:i}=t.data;await e.feedKeys(`:CocCommand ${i} `,"n",!1)})}async loadItems(e){let t=[],i=await this.mru.load(),{commandList:n,onCommandList:s,titles:o}=se,a=n.map(l=>l.id).concat(s);for(let l of[...new Set(a)])t.push({label:[l,...o.get(l)?[o.get(l)]:[]],filterText:l,data:{cmd:l,score:kme(i,l)}});return t.sort((l,c)=>c.data.score-l.data.score),pr(this.alignColumns,t)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocCommandsTitle /\\t.*$/ contained containedin=CocCommandsLine",!0),e.command("highlight default link CocCommandsTitle Comment",!0),e.resumeNotification(!1,!0)}}});var cp,Pje,cs,up=R(()=>{Ps();cp=E(require("path"));ls();Y();qe();Nt();yt();Pje=U()("list-location"),cs=class extends Kt{constructor(e){super(e);this.defaultAction="open";this.description="show locations saved by g:coc_jump_locations variable";this.name="location";this.addLocationActions()}async loadItems(e,t){let i=await this.nvim.getVar("coc_jump_locations");if(t.isCancellationRequested)return[];i=i||[],i.forEach(a=>{if(!a.uri){let l=cp.default.isAbsolute(a.filename)?a.filename:cp.default.join(e.cwd,a.filename);a.uri=B.file(l).toString()}if(!a.bufnr&&v.getDocument(a.uri)!=null&&(a.bufnr=v.getDocument(a.uri).bufnr),a.range)a.lnum=a.lnum||a.range.start.line+1,a.col=a.col||a.range.start.character+1;else{let{lnum:l,col:c}=a;a.range=Ae.create(l-1,c-1,l-1,c-1)}});let n=e.buffer.id,s=i.every(a=>a.bufnr&&n&&a.bufnr==n);return i.map(a=>{let l=s?"":a.filename,c=`${l}${a.text.trim()}`;cp.default.isAbsolute(l)&&(l=lt(e.cwd,l)?cp.default.relative(e.cwd,l):l);let u=`${l} |${a.type?a.type+" ":""}${a.lnum} col ${a.col}| `,f;if(a.range&&a.range.start.line==a.range.end.line){let h=re(u)+re(a.text.slice(0,a.range.start.character)),p=re(u)+re(a.text.slice(0,a.range.end.character));f={hlGroup:"Search",span:[h,p]}}return{label:u+a.text,location:er.create(a.uri,a.range),filterText:c,ansiHighlights:f?[f]:void 0}})}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocLocationName /\\v^[^|]+/ contained containedin=CocLocationLine",!0),e.command("syntax match CocLocationPosition /\\v\\|\\w*\\s?\\d+\\scol\\s\\d+\\|/ contained containedin=CocLocationLine",!0),e.command("syntax match CocLocationError /Error/ contained containedin=CocLocationPosition",!0),e.command("syntax match CocLocationWarning /Warning/ contained containedin=CocLocationPosition",!0),e.command("highlight default link CocLocationName Directory",!0),e.command("highlight default link CocLocationPosition LineNr",!0),e.command("highlight default link CocLocationError Error",!0),e.command("highlight default link CocLocationWarning WarningMsg",!0),e.resumeNotification().catch(t=>{})}}});var JV,Nje,Ry,YV=R(()=>{JV=E(require("path"));Xa();up();Nt();ra();Nje=U()("list-symbols"),Ry=class extends cs{constructor(){super(...arguments);this.defaultAction="open";this.description="diagnostics of current workspace";this.name="diagnostics"}async loadItems(e){let t=Lt.getDiagnosticList(),{cwd:i}=e,n=this.getConfig(),s=n.get("includeCode",!0),o=n.get("pathFormat","full"),a=t.map(l=>{let c=lt(i,l.file)?JV.default.relative(i,l.file):l.file,u=GV(o,c),f=o!=="hidden"?[`${u}:${l.lnum}`]:[],d=s?[`[${l.source}${l.code?"":"]"}`,l.code?`${l.code}]`:""]:[];return{label:[...f,...d,l.severity,l.message],location:l.location}});return pr(this.alignColumns,a)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocDiagnosticsFile /\\v^\\s*\\S+/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsError /\\tError\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsWarning /\\tWarning\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsInfo /\\tInformation\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsHint /\\tHint\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("highlight default link CocDiagnosticsFile Comment",!0),e.command("highlight default link CocDiagnosticsError CocErrorSign",!0),e.command("highlight default link CocDiagnosticsWarning CocWarningSign",!0),e.command("highlight default link CocDiagnosticsInfo CocInfoSign",!0),e.command("highlight default link CocDiagnosticsHint CocHintSign",!0),e.resumeNotification(!1,!0)}}});function Ome(r){switch(r){case"unknown":return 2;case"activated":return 1;case"disabled":return-1;default:return 0}}var Ku,XV,Py,Ime,ky,ZV=R(()=>{Ku=E(pn()),XV=E(require("os")),Py=E(require("path"));qe();ia();de();Y();Te();ls();ra();Ime=U()("list-extensions"),ky=class extends Kt{constructor(e){super(e);this.defaultAction="toggle";this.description="manage coc extensions";this.name="extensions";this.addAction("toggle",async t=>{let{id:i,state:n}=t.data;n!="disabled"&&(n=="activated"?await we.deactivate(i):await we.activate(i),await bt(100))},{persist:!0,reload:!0,parallel:!0}),this.addAction("configuration",async t=>{let{root:i}=t.data,n=Py.default.join(i,"package.json");if(Ku.default.existsSync(n)){let o=Ku.default.readFileSync(n,"utf8").split(/\r?\n/).findIndex(a=>a.includes('"contributes"'));await v.jumpTo(B.file(n).toString(),{line:o==-1?0:o,character:0})}}),this.addAction("open",async t=>{let{root:i}=t.data;v.env.isiTerm?e.call("coc#util#iterm_open",[i],!0):e.call("coc#util#open_url",[i],!0)}),this.addAction("disable",async t=>{let{id:i,state:n}=t.data;n!=="disabled"&&await we.toggleExtension(i)},{persist:!0,reload:!0,parallel:!0}),this.addAction("enable",async t=>{let{id:i,state:n}=t.data;n=="disabled"&&await we.toggleExtension(i)},{persist:!0,reload:!0,parallel:!0}),this.addAction("lock",async t=>{let{id:i}=t.data;await we.toggleLock(i)},{persist:!0,reload:!0}),this.addAction("help",async t=>{let{root:i}=t.data,s=(await Ku.default.readdir(i)).find(o=>/^readme/i.test(o));s&&await v.callAsync("coc#util#jump",["edit",Py.default.join(i,s)])}),this.addAction("reload",async t=>{let{id:i}=t.data;await we.reloadExtension(i)},{persist:!0,reload:!0}),this.addAction("fix",async t=>{let{root:i,isLocal:n}=t.data,{npm:s}=we;if(n){D.showMessage("Can't fix for local extension.","warning");return}if(!s)return;let o=Py.default.join(i,"node_modules");Ku.default.existsSync(o)&&Ku.default.removeSync(o);let a=await v.createTerminal({cwd:i});!await a.show(!1)||(v.nvim.command("startinsert",!0),a.sendText(`${s} install --production --ignore-scripts --no-lockfile`,!0))}),this.addMultipleAction("uninstall",async t=>{let i=[];for(let n of t)n.data.isLocal||i.push(n.data.id);we.uninstallExtension(i).catch(n=>{Ime.error(n)})})}async loadItems(e){let t=[],i=await we.getExtensionStates(),n=await we.getLockedList();for(let s of i){let o="+";s.state=="disabled"?o="-":s.state=="activated"?o="*":s.state=="unknown"&&(o="?");let a=await this.nvim.call("resolve",s.root),l=n.includes(s.id);t.push({label:[`${o} ${s.id}${l?" \uE0A2":""}`,...s.isLocal?["[RTP]"]:[],s.version,a.replace(XV.default.homedir(),"~")],filterText:s.id,data:{id:s.id,root:a,state:s.state,isLocal:s.isLocal,priority:Ome(s.state)}})}return t.sort((s,o)=>s.data.priority!=o.data.priority?o.data.priority-s.data.priority:o.data.id-s.data.id?1:-1),pr(this.alignColumns,t)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocExtensionsActivited /\\v^\\*/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsLoaded /\\v^\\+/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsDisabled /\\v^-/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsName /\\v%3c\\S+/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsRoot /\\v\\t[^\\t]*$/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsLocal /\\v\\[RTP\\]/ contained containedin=CocExtensionsLine",!0),e.command("highlight default link CocExtensionsActivited Special",!0),e.command("highlight default link CocExtensionsLoaded Normal",!0),e.command("highlight default link CocExtensionsDisabled Comment",!0),e.command("highlight default link CocExtensionsName String",!0),e.command("highlight default link CocExtensionsLocal MoreMsg",!0),e.command("highlight default link CocExtensionsRoot Comment",!0),e.resumeNotification().catch(t=>{})}}});var QV,e5,Iy,t5=R(()=>{QV=E(require("path"));qe();e5=E(pn());Nt();Y();Te();ls();Iy=class extends Kt{constructor(e){super(e);this.defaultAction="edit";this.description="list of current workspace folders";this.name="folders";this.addAction("edit",async t=>{let i=await e.call("input",["Folder: ",t.label,"dir"]),n=await Mt(i);if(!n||!n.isDirectory()){D.showMessage(`invalid path: ${i}`,"error");return}v.renameWorkspaceFolder(t.label,i)}),this.addAction("delete",async t=>{v.removeWorkspaceFolder(t.label)},{reload:!0,persist:!0}),this.addAction("newfile",async t=>{let i=await D.requestInput("File name",t.label+"/"),n=QV.default.dirname(i),s=await Mt(n);(!s||!s.isDirectory())&&e5.default.mkdirpSync(n),await v.createFile(i,{overwrite:!1,ignoreIfExists:!0}),await this.jumpTo(B.file(i).toString())})}async loadItems(e){return v.folderPaths.map(t=>({label:t}))}}});function r5(r){if(!r.startsWith("file:"))return r;let e=B.parse(r).fsPath;return lt(v.cwd,e)?i5.default.relative(v.cwd,e):e}var i5,Oy,n5=R(()=>{Re();Y();i5=E(require("path"));ls();Ps();qe();Nt();Oy=class extends Kt{constructor(e){super(e);this.defaultAction="open";this.description="links of current buffer";this.name="links";this.addAction("open",async t=>{let{target:i}=t.data;B.parse(i).scheme.startsWith("http")?await e.call("coc#util#open_url",i):await v.jumpTo(i)}),this.addAction("jump",async t=>{let{location:i}=t.data;await v.jumpTo(i.uri,i.range.start)})}async loadItems(e,t){let i=await e.window.buffer,n=v.getDocument(i.id);if(!n)return null;let s=[],o=await N.getDocumentLinks(n.textDocument,t);if(o==null)throw new Error("Links provider not found.");let a=[];for(let l of o)l.target?s.push({label:r5(l.target),data:{target:l.target,location:er.create(n.uri,l.range)}}):(l=await N.resolveDocumentLink(l),l.target&&s.push({label:r5(l.target),data:{target:l.target,location:er.create(n.uri,l.range)}}),a.push(l));return s}}});function Lme(r,e){let t=r.indexOf(e);return t==-1?-1:r.length-t}var Ly,s5=R(()=>{ls();$g();ra();Ly=class extends Kt{constructor(e,t){super(e);this.listMap=t;this.name="lists";this.defaultAction="open";this.description="registered lists of coc.nvim";this.mru=new Oo("lists");this.addAction("open",async i=>{let{name:n}=i.data;await this.mru.add(n),await e.command(`CocList ${n}`)})}async loadItems(e){let t=[],i=await this.mru.load();for(let n of this.listMap.values())n.name!="lists"&&t.push({label:[n.name,...n.description?[n.description]:[]],data:{name:n.name,interactive:n.interactive,score:Lme(i,n.name)}});return t.sort((n,s)=>s.data.score-n.data.score),pr(this.alignColumns,t)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocListsDesc /\\t.*$/ contained containedin=CocListsLine",!0),e.command("highlight default link CocListsDesc Comment",!0),e.resumeNotification().catch(t=>{})}}});function us(r){switch(r){case at.SymbolKind.File:return"File";case at.SymbolKind.Module:return"Module";case at.SymbolKind.Namespace:return"Namespace";case at.SymbolKind.Package:return"Package";case at.SymbolKind.Class:return"Class";case at.SymbolKind.Method:return"Method";case at.SymbolKind.Property:return"Property";case at.SymbolKind.Field:return"Field";case at.SymbolKind.Constructor:return"Constructor";case at.SymbolKind.Enum:return"Enum";case at.SymbolKind.Interface:return"Interface";case at.SymbolKind.Function:return"Function";case at.SymbolKind.Variable:return"Variable";case at.SymbolKind.Constant:return"Constant";case at.SymbolKind.String:return"String";case at.SymbolKind.Number:return"Number";case at.SymbolKind.Boolean:return"Boolean";case at.SymbolKind.Array:return"Array";case at.SymbolKind.Object:return"Object";case at.SymbolKind.Key:return"Key";case at.SymbolKind.Null:return"Null";case at.SymbolKind.EnumMember:return"EnumMember";case at.SymbolKind.Struct:return"Struct";case at.SymbolKind.Event:return"Event";case at.SymbolKind.Operator:return"Operator";case at.SymbolKind.TypeParameter:return"TypeParameter";default:return"Unknown"}}var at,fp=R(()=>{at=E(H())});function l5(r,e){return`${r.name}${e?` ${e}`:""}`}function Ame(r,e){let t=r.selectionRange,i=e.selectionRange;return t.start.line!=i.start.line?t.start.line-i.start.line:t.start.character-i.start.character}var o5,a5,TUe,Ay,c5=R(()=>{o5=E(require("path"));Ps();qe();a5=E(Ed());Re();de();Nt();Y();up();fp();ra();TUe=U()("list-symbols");Ay=class extends cs{constructor(){super(...arguments);this.description="symbols of current document";this.name="outline";this.options=[{name:"-k, -kind KIND",hasValue:!0,description:"filters also by kind"}]}async loadItems(e,t){let i=await e.window.buffer,n=v.getDocument(i.id);if(!n)return null;let o=this.getConfig().get("ctagsFilestypes",[]),a,l=this.parseArguments(e.args);if(o.includes(n.filetype)||(a=await N.getDocumentSymbol(n.textDocument,t)),t.isCancellationRequested)return[];if(!a)return await this.loadCtagsSymbols(n);if(a.length==0)return[];let c=l.kind?l.kind.toLowerCase():null,u=[];if(!a[0].hasOwnProperty("location")){let d=function(h,p=0){h.sort(Ame);for(let g of h){let b=us(g.kind),y=er.create(n.uri,g.selectionRange);u.push({label:[`${"| ".repeat(p)}${g.name}`,`[${b}]`,`${g.range.start.line+1}`],filterText:l5(g,l.kind==""?b:null),location:y,data:{kind:b}}),g.children&&g.children.length&&d(g.children,p+1)}};d(a),c&&(u=u.filter(h=>h.data.kind.toLowerCase().indexOf(c)==0))}else{a.sort((d,h)=>{let p=d.location.range.start,g=h.location.range.start,b=p.line-g.line;return b==0?p.character-g.character:b});for(let d of a){let h=us(d.kind);d.name.endsWith(") callback")||c&&!h.toLowerCase().startsWith(c)||(d.location.uri===void 0&&(d.location.uri=n.uri),u.push({label:[d.name,`[${h}]`,`${d.location.range.start.line+1}`],filterText:l5(d,l.kind==""?h:null),location:d.location}))}}return pr(this.alignColumns,u)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocOutlineName /\\v\\s?[^\\t]+\\s/ contained containedin=CocOutlineLine",!0),e.command("syntax match CocOutlineIndentLine /\\v\\|/ contained containedin=CocOutlineLine,CocOutlineName",!0),e.command("syntax match CocOutlineKind /\\[\\w\\+\\]/ contained containedin=CocOutlineLine",!0),e.command("syntax match CocOutlineLine /\\d\\+$/ contained containedin=CocOutlineLine",!0),e.command("highlight default link CocOutlineName Normal",!0),e.command("highlight default link CocOutlineIndentLine Comment",!0),e.command("highlight default link CocOutlineKind Typedef",!0),e.command("highlight default link CocOutlineLine Comment",!0),e.resumeNotification(!1,!0).logError()}async loadCtagsSymbols(e){if(!a5.default.sync("ctags",{nothrow:!0}))return[];let t=B.parse(e.uri),i=o5.default.extname(t.fsPath),n="",o=`${await this.nvim.call("tempname")}.${i}`,a=await this.nvim.call("fnameescape",o);await KB(a,e.getDocumentContent());try{n=await Vn(`ctags -f - --excmd=number --language-force=${e.filetype} ${a}`)}catch(u){}if(n.trim().length||(n=await Vn(`ctags -f - --excmd=number ${a}`)),n=n.trim(),!n)return[];let l=n.split(/\r?\n/),c=[];for(let u of l){let f=u.split(" ");if(f.length<4)continue;let d=Number(f[2].replace(/;"$/,"")),h=e.getline(d-1);if(!h)continue;let p=h.indexOf(f[0]),g=p==-1?0:p,b=Ae.create(d-1,g,d-1,g+f[0].length);c.push({label:`${f[0]} [${f[3]}] ${d}`,filterText:f[0],location:er.create(e.uri,b),data:{line:d}})}return c.sort((u,f)=>u.data.line-f.data.line),c}}});var Fy,u5=R(()=>{sp();ls();de();ra();Fy=class extends Kt{constructor(e){super(e);this.defaultAction="toggle";this.description="registered services of coc.nvim";this.name="services";this.addAction("toggle",async t=>{let{id:i}=t.data;await Fi.toggle(i),await bt(100)},{persist:!0,reload:!0})}async loadItems(e){let t=Fi.getServiceStats();return t.sort((i,n)=>i.id>n.id?-1:1),pr(this.alignColumns,t.map(i=>({label:[i.state=="running"?"*":" ",i.id,`[${i.state}]`,i.languageIds.join(", ")],data:{id:i.id}})))}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocServicesPrefix /\\v^./ contained containedin=CocServicesLine",!0),e.command("syntax match CocServicesName /\\v%3c\\S+/ contained containedin=CocServicesLine",!0),e.command("syntax match CocServicesStat /\\v\\t\\[\\w+\\]/ contained containedin=CocServicesLine",!0),e.command("syntax match CocServicesLanguages /\\v(\\])@<=.*$/ contained containedin=CocServicesLine",!0),e.command("highlight default link CocServicesPrefix Special",!0),e.command("highlight default link CocServicesName Type",!0),e.command("highlight default link CocServicesStat Statement",!0),e.command("highlight default link CocServicesLanguages Comment",!0),e.resumeNotification().catch(t=>{})}}});function Ny(r,e){return r.length>e?r.slice(0,e-1)+".":r+" ".repeat(e-r.length)}var qUe,My,f5=R(()=>{Ps();qe();xl();Y();ls();qUe=U()("list-sources"),My=class extends Kt{constructor(e){super(e);this.defaultAction="toggle";this.description="registered completion sources";this.name="sources";this.addAction("toggle",async t=>{let{name:i}=t.data;ht.toggleSource(i)},{persist:!0,reload:!0}),this.addAction("refresh",async t=>{let{name:i}=t.data;await ht.refresh(i)},{persist:!0,reload:!0}),this.addAction("open",async t=>{let{location:i}=t;i&&await this.jumpTo(i)})}async loadItems(e){let t=ht.sourceStats(),i=await e.buffer.getOption("filetype"),n=v.env.disabledSources,s=n?n[i]||[]:[];return t.sort((o,a)=>o.type!=a.type?o.type<a.type?1:-1:o.name>a.name?-1:1),t.map(o=>{let a=o.disabled?" ":"*";s&&s.includes(o.name)&&(a="-");let l;return o.filepath&&(l=er.create(B.file(o.filepath).toString(),Ae.create(0,0,0,0))),{label:`${a} ${Ny(o.name,22)} ${Ny("["+o.shortcut+"]",10)} ${Ny(o.triggerCharacters.join(""),10)} ${Ny(o.priority.toString(),3)} ${o.filetypes.join(",")}`,location:l,data:{name:o.name}}})}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocSourcesPrefix /\\v^./ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesName /\\v%3c\\S+/ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesType /\\v%25v.*%36v/ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesPriority /\\v%46v.*%50v/ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesFileTypes /\\v\\S+$/ contained containedin=CocSourcesLine",!0),e.command("highlight default link CocSourcesPrefix Special",!0),e.command("highlight default link CocSourcesName Type",!0),e.command("highlight default link CocSourcesPriority Number",!0),e.command("highlight default link CocSourcesFileTypes Comment",!0),e.command("highlight default link CocSourcesType Statement",!0),e.resumeNotification(!1,!0)}}});var RD,d5,h5,YUe,qy,p5=R(()=>{RD=E(require("path")),d5=E(Do());qe();Re();Y();up();fp();Nt();tv();h5=E(H());ra();YUe=U()("list-symbols"),qy=class extends cs{constructor(){super(...arguments);this.interactive=!0;this.description="search workspace symbols";this.detail="Symbols list is provided by server, it works on interactive mode only.";this.name="symbols";this.options=[{name:"-k, -kind KIND",description:"Filter symbols by kind.",hasValue:!0}]}async loadItems(e,t){let{input:i}=e;this.cwd=e.cwd;let n=this.parseArguments(e.args),s=n.kind?n.kind.toLowerCase():"";if(!e.options.interactive)throw new Error("Symbols only works on interactive mode");let o=await N.getWorkspaceSymbols(i,t);if(!o)throw new Error("No workspace symbols provider registered");let l=this.getConfig().get("excludes",[]),c=[];for(let u of o){let f=us(u.kind);if(s&&f.toLowerCase()!=s)continue;let d=B.parse(u.location.uri).fsPath;lt(v.cwd,d)&&(d=RD.default.relative(v.cwd,d)),!l.some(h=>(0,d5.default)(d,h))&&c.push({label:[u.name,`[${f}]`,d],filterText:`${u.name}`,location:u.location,data:{original:u,kind:u.kind,file:d,score:eu(i,u.name)}})}return c.sort((u,f)=>u.data.score!=f.data.score?f.data.score-u.data.score:u.data.kind!=f.data.kind?u.data.kind-f.data.kind:u.data.file.length-f.data.file.length),pr(this.alignColumns,c)}async resolveItem(e){let t=e.data.original;if(!t)return null;let i=new h5.CancellationTokenSource,n=await N.resolveWorkspaceSymbol(t,i.token);if(!n)return null;let s=us(n.kind),o=B.parse(n.location.uri).fsPath;return lt(this.cwd,o)&&(o=RD.default.relative(this.cwd,o)),{label:`${t.name} [${s}] ${o}`,filterText:`${t.name}`,location:t.location}}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocSymbolsName /\\v^\\s*\\S+/ contained containedin=CocSymbolsLine",!0),e.command("syntax match CocSymbolsKind /\\[\\w\\+\\]\\s*\\t/ contained containedin=CocSymbolsLine",!0),e.command("syntax match CocSymbolsFile /\\S\\+$/ contained containedin=CocSymbolsLine",!0),e.command("highlight default link CocSymbolsName Normal",!0),e.command("highlight default link CocSymbolsKind Typedef",!0),e.command("highlight default link CocSymbolsFile Comment",!0),e.resumeNotification().catch(t=>{})}}});var m5,$y,Fme,g5,v5,gi,By=R(()=>{m5=E(Ui()),$y=E(H());_e();ia();de();Y();Te();vy();kV();OV();BV();KV();YV();ZV();t5();n5();s5();up();c5();u5();f5();p5();Fme=U()("list-manager"),g5=["<LeftMouse>","<LeftDrag>","<LeftRelease>","<2-LeftMouse>"],v5=class{constructor(){this.plugTs=0;this.sessionsMap=new Map;this.disposables=[];this.listMap=new Map}init(e){this.nvim=e,this.config=new Wu,this.prompt=new yy(e,this.config),this.mappings=new by(this,e,this.config);let t=this.config.get("selectedSignText","*");e.command(`sign define CocSelected text=${t} texthl=CocSelectedText linehl=CocSelectedLine`,!0),O.on("InputChar",this.onInputChar,this,this.disposables);let i=(0,m5.default)(async()=>{await this.getCurrentSession()&&this.prompt.drawPrompt()},100);O.on("FocusGained",i,null,this.disposables),O.on("WinEnter",n=>{let s=this.getSessionByWinid(n);s&&this.prompt.start(s.listOptions)},null,this.disposables),O.on("WinLeave",n=>{this.getSessionByWinid(n)&&this.prompt.cancel()},null,this.disposables),this.disposables.push({dispose:()=>{i.clear()}}),this.prompt.onDidChangeInput(()=>{let{session:n}=this;!n||(n.onInputChange(),n.history.filter())}),this.registerList(new Oy(e)),this.registerList(new cs(e)),this.registerList(new qy(e)),this.registerList(new Ay(e)),this.registerList(new Dy(e)),this.registerList(new ky(e)),this.registerList(new Ry(e)),this.registerList(new My(e)),this.registerList(new Fy(e)),this.registerList(new Ly(e,this.listMap)),this.registerList(new Iy(e))}async start(e){let t=this.parseArgs(e);if(!t)return;let{name:i}=t.list,n=this.sessionsMap.get(i);n&&n.dispose(),this.prompt.start(t.options);let s=new _y(this.nvim,this.prompt,t.list,t.options,t.listArgs,this.config);this.sessionsMap.set(i,s),this.lastSession=s;try{await s.start(e)}catch(o){this.nvim.call("coc#prompt#stop_prompt",["list"],!0);let a=o instanceof Error?o.message:o.toString();D.showMessage(`Error on "CocList ${i}": ${a}`,"error"),Fme.error(o)}}getSessionByWinid(e){for(let t of this.sessionsMap.values())if(t&&t.winid==e)return this.lastSession=t,t;return null}async getCurrentSession(){let{id:e}=await this.nvim.window;for(let t of this.sessionsMap.values())if(t&&t.winid==e)return this.lastSession=t,t;return null}async resume(e){var t;if(!e)await((t=this.session)==null?void 0:t.resume());else{let i=this.sessionsMap.get(e);if(!i){D.showMessage(`Can't find exists ${e} list`);return}await i.resume()}}async doAction(e){let t=this.lastSession;!t||await t.doAction(e)}async first(e){let t=this.getSession(e);t&&await t.first()}async last(e){let t=this.getSession(e);t&&await t.last()}async previous(e){let t=this.getSession(e);t&&await t.previous()}async next(e){let t=this.getSession(e);t&&await t.next()}getSession(e){return e?this.sessionsMap.get(e):this.session}async cancel(e=!0){this.prompt.cancel(),!!e&&this.session&&await this.session.hide()}reset(){this.prompt.cancel(),this.lastSession=void 0;for(let e of this.sessionsMap.values())e.dispose();this.sessionsMap.clear(),this.nvim.call("coc#prompt#stop_prompt",["list"],!0)}switchMatcher(){var e;(e=this.session)==null||e.switchMatcher()}async togglePreview(){let{nvim:e}=this,t=await e.call("coc#list#get_preview",[0]);t!=-1?(await e.call("coc#window#close",[t]),await e.command("redraw")):await this.doAction("preview")}async chooseAction(){let{lastSession:e}=this;e&&await e.chooseAction()}parseArgs(e){let t=[],i=!1,n=!1,s=!1,o=!1,a=!1,l,c="",u="fuzzy",f="bottom",d=[],h=[];for(let b of e)if(!l&&b.startsWith("-"))h.push(b);else if(l)d.push(b);else{if(!/^\w+$/.test(b))return D.showMessage(`Invalid list option: "${b}"`,"error"),null;l=b}l=l||"lists";let p=v.getConfiguration(`list.source.${l}`);!h.length&&!d.length&&(h=p.get("defaultOptions",[])),d.length||(d=p.get("defaultArgs",[]));for(let b of h)if(b.startsWith("--input"))c=b.slice(8);else if(b=="--number-select"||b=="-N")s=!0;else if(b=="--auto-preview"||b=="-A")n=!0;else if(b=="--regex"||b=="-R")u="regex";else if(b=="--strict"||b=="-S")u="strict";else if(b=="--interactive"||b=="-I")i=!0;else if(b=="--top")f="top";else if(b=="--tab")f="tab";else if(b=="--ignore-case"||b=="--normal"||b=="--no-sort")t.push(b.slice(2));else if(b=="--first")a=!0;else if(b=="--no-quit")o=!0;else return D.showMessage(`Invalid option "${b}" of list`,"error"),null;let g=this.listMap.get(l);return g?i&&!g.interactive?(D.showMessage(`Interactive mode of "${l}" list not supported`,"error"),null):{list:g,listArgs:d,options:{numberSelect:s,autoPreview:n,noQuit:o,first:a,input:c,interactive:i,matcher:u,position:f,ignorecase:!!t.includes("ignore-case"),mode:t.includes("normal")?"normal":"insert",sort:!t.includes("no-sort")}}:(D.showMessage(`List ${l} not found`,"error"),null)}async onInputChar(e,t,i){if(e!="list")return;let{mode:n}=this.prompt,s=Date.now();if(t=="<plug>"||this.plugTs&&s-this.plugTs<20){this.plugTs=s;return}if(!!t){if(t=="<esc>"){await this.cancel();return}n=="insert"?await this.onInsertInput(t,i):await this.onNormalInput(t,i)}}async onInsertInput(e,t){let{session:i}=this;if(!i)return;if(g5.includes(e)){await this.onMouseEvent(e);return}if(!(await i.doNumberSelect(e)||await this.mappings.doInsertKeymap(e)||t)&&!(e.startsWith("<")&&e.endsWith(">")))for(let o of e){let a=o.codePointAt(0);if(a==65533||a<32||a>=127&&a<=159)return;await this.prompt.acceptCharacter(o)}}async onNormalInput(e,t){if(g5.includes(e)){await this.onMouseEvent(e);return}await this.mappings.doNormalKeymap(e)||await this.feedkeys(e)}onMouseEvent(e){if(this.session)return this.session.onMouseEvent(e)}async feedkeys(e,t=!0){let{nvim:i}=this;e=e.startsWith("<")&&e.endsWith(">")?`\\${e}`:e,await i.call("coc#prompt#stop_prompt",["list"]),await i.call("eval",[`feedkeys("${e}", "${t?"i":"in"}")`]),this.prompt.start()}async command(e){let{nvim:t}=this;await t.call("coc#prompt#stop_prompt",["list"]),await t.command(e),this.prompt.start()}async normal(e,t=!0){let{nvim:i}=this;await i.call("coc#prompt#stop_prompt",["list"]),await i.command(`normal${t?"!":""} ${e}`),this.prompt.start()}async call(e){if(this.session)return await this.session.call(e)}get session(){return this.lastSession}registerList(e){let{name:t}=e,i=this.listMap.get(t);this.listMap.has(t)&&(i&&(typeof i.dispose=="function"&&i.dispose(),this.listMap.delete(t)),D.showMessage(`list "${t}" recreated.`)),this.listMap.set(t,e);let s=v.getConfiguration(`list.source.${t}`).get("defaultAction");return s&&e.actions.find(o=>o.name==s)&&(e.defaultAction=s),we.addSchemeProperty(`list.source.${t}.defaultAction`,{type:"string",default:null,description:`Default default action of "${t}" list.`}),we.addSchemeProperty(`list.source.${t}.defaultOptions`,{type:"array",default:e.interactive?["--interactive"]:[],description:`Default list options of "${t}" list, only used when both list option and argument are empty.`,uniqueItems:!0,items:{type:"string",enum:["--top","--normal","--no-sort","--input","--tab","--strict","--regex","--ignore-case","--number-select","--interactive","--auto-preview","--first","--no-quit"]}}),we.addSchemeProperty(`list.source.${t}.defaultArgs`,{type:"array",default:[],description:`Default argument list of "${t}" list, only used when list argument is empty.`,uniqueItems:!0,items:{type:"string"}}),$y.Disposable.create(()=>{typeof e.dispose=="function"&&e.dispose(),this.listMap.delete(t)})}get names(){return Array.from(this.listMap.keys())}get descriptions(){let e={};for(let t of this.listMap.keys()){let i=this.listMap.get(t);e[t]=i.description}return e}async loadItems(e){let t=[e],i=this.parseArgs(t);if(!i)return;let{list:n,options:s,listArgs:o}=i,l=new $y.CancellationTokenSource().token,c=await this.nvim.eval('[win_getid(),bufnr("%")]');return await n.loadItems({options:s,args:o,input:"",cwd:v.cwd,window:this.nvim.createWindow(c[0]),buffer:this.nvim.createBuffer(c[1]),listWindow:null},l)}toggleMode(){let e=this.lastSession;e&&e.toggleMode()}get isActivated(){var e;return((e=this.session)==null?void 0:e.winid)!=null}stop(){let e=this.lastSession;e&&e.stop()}dispose(){for(let e of this.sessionsMap.values())e.dispose();this.sessionsMap.clear(),this.config&&this.config.dispose(),this.lastSession=void 0,G(this.disposables)}},gi=new v5});var Nn,PD=R(()=>{Nn=class{constructor(e){this._tabstop=1;this.value=e||""}static isSnippetString(e){return e instanceof Nn?!0:e?typeof e.value=="string":!1}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}appendText(e){return this.value+=Nn._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if(typeof e=="function"){let i=new Nn;i._tabstop=this._tabstop,e(i),this._tabstop=i._tabstop,e=i.value}else e=Nn._escape(e);return this.value+="${",this.value+=t,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,t=this._tabstop++){let i=e.map(n=>n.replace(/\$|}|\\|,/g,"\\$&")).join(",");return this.value+="${",this.value+=t,this.value+="|",this.value+=i,this.value+="|}",this}appendVariable(e,t){if(typeof t=="function"){let i=new Nn;i._tabstop=this._tabstop,t(i),this._tabstop=i._tabstop,t=i.value}else typeof t=="string"&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}}});var kD=R(()=>{nv()});var b5={};Bn(b5,{BasicList:()=>Kt,Buffer:()=>Ju.Buffer,CancellationToken:()=>oe.CancellationToken,CancellationTokenSource:()=>oe.CancellationTokenSource,ClientState:()=>ye,CloseAction:()=>ss,CodeActionKind:()=>oe.CodeActionKind,CompletionItemKind:()=>oe.CompletionItemKind,CompletionTriggerKind:()=>oe.CompletionTriggerKind,ConfigurationTarget:()=>Ot,Diagnostic:()=>oe.Diagnostic,DiagnosticSeverity:()=>oe.DiagnosticSeverity,DiagnosticTag:()=>oe.DiagnosticTag,Disposable:()=>oe.Disposable,DocumentHighlightKind:()=>oe.DocumentHighlightKind,Emitter:()=>oe.Emitter,ErrorAction:()=>Cl,Event:()=>oe.Event,FileChangeType:()=>oe.FileChangeType,FileType:()=>Gr,FloatFactory:()=>tr,Highligher:()=>an,InsertTextFormat:()=>oe.InsertTextFormat,LanguageClient:()=>np,Location:()=>oe.Location,LocationLink:()=>oe.LocationLink,MarkupKind:()=>oe.MarkupKind,MessageLevel:()=>_n,MessageTransports:()=>Bu,Mru:()=>Oo,Mutex:()=>hi,Neovim:()=>Ju.Neovim,NotificationType:()=>oe.NotificationType,NotificationType0:()=>oe.NotificationType0,NullLogger:()=>KT,PatternType:()=>ir,Position:()=>oe.Position,ProgressType:()=>oe.ProgressType,Range:()=>oe.Range,RequestType:()=>oe.RequestType,RequestType0:()=>oe.RequestType0,RevealOutputChannelOn:()=>fr,ServiceStat:()=>Ee,SettingMonitor:()=>SD,SignatureHelpTriggerKind:()=>oe.SignatureHelpTriggerKind,SnippetString:()=>Nn,SourceType:()=>Vr,State:()=>dr,SymbolKind:()=>oe.SymbolKind,TextDocumentFeature:()=>Fe,TextEdit:()=>oe.TextEdit,TransportKind:()=>pt,TreeItem:()=>Kn,TreeItemCollapsibleState:()=>$e,Uri:()=>B,Watchman:()=>Pn,Window:()=>Ju.Window,ansiparse:()=>Md,commands:()=>se,concurrent:()=>Rd,diagnosticManager:()=>Lt,disposeAll:()=>G,download:()=>Zh,events:()=>O,executable:()=>Dd,extensions:()=>we,fetch:()=>Fu,isRunning:()=>VN,languages:()=>N,listManager:()=>gi,runCommand:()=>Vn,services:()=>Fi,snippetManager:()=>vi,sources:()=>ht,wait:()=>bt,watchFile:()=>Ic,window:()=>D,workspace:()=>v});var Ju,oe,y5=R(()=>{Ei();_e();Re();$g();Va();Eb();jT();$u();sp();xl();Y();Te();ia();By();Yu();PD();Xa();Nc();Yg();ls();As();qe();Ju=E(ES()),oe=E(H());En();_D();de();kD()});function Nme(r){return()=>{throw new Error(`process.${r}() is not allowed in extension sandbox`)}}function qme(){let r=e=>e==="coc.nvim"?(y5(),b5):this.require(e);return r.resolve=e=>fs._resolveFilename(e,this),r.main=process.mainModule,r.extensions=fs._extensions,r.cache=fs._cache,r}function $me(r){return function(e,t){let i=qme.call(this),n=x5.default.dirname(t),s=e.replace(/^\#\!.*/,""),o=fs.wrap(s),a=jy.runInContext(o,r,{filename:t}),l=[this.exports,i,this,t,n];return a.apply(this.exports,l)}}function Bme(r,e){let t=new fs(r);t.paths=fs._nodeModulePaths(r);let i=jy.createContext({module:t,Buffer,console:{debug:(...n)=>{e.debug.apply(e,n)},log:(...n)=>{e.info.apply(e,n)},error:(...n)=>{e.error.apply(e,n)},info:(...n)=>{e.info.apply(e,n)},warn:(...n)=>{e.warn.apply(e,n)}}});a6(i,global),i.Reflect=Reflect,i.require=function(s){let o=fs.prototype._compile;fs.prototype._compile=$me(i);let a=i.module.require(s);return fs.prototype._compile=o,a},i.process=new process.constructor;for(let n of Object.keys(process))i.process[n]=process[n];return Mme.forEach(n=>{i.process[n]=Nme(n)}),i.process.chdir=()=>{},i.process.umask=n=>{if(typeof n!="undefined")throw new Error("Cannot use process.umask() to change mask (read-only)");return process.umask()},i}function C5(r,e,t=!1){if(t||!w5.default.existsSync(e))return{activate:()=>{},deactivate:null};let i=Bme(e,S5(`extension:${r}`));delete fs._cache[require.resolve(e)];let n=i.require(e),s=n&&n.activate||n;return typeof s!="function"?{activate:()=>{},deactivate:null}:{activate:s,deactivate:typeof n.deactivate=="function"?n.deactivate:null}}var w5,x5,jy,S5,YHe,fs,Mme,_5=R(()=>{w5=E(require("fs")),x5=E(require("path")),jy=E(require("vm"));Nu();S5=U(),YHe=S5("util-factoroy"),fs=require("module"),Mme=["reallyExit","abort","umask","setuid","setgid","setgroups","_fatalException","exit","kill"]});var E5,Tt,T5,Be,D5,Uy,R5,dWe,P5,Vi,qn,k5,we,ia=R(()=>{E5=E(Ui());Hd();Tt=E(pn()),T5=E(UC()),Be=E(require("path")),D5=E(_v()),Uy=E(H());qe();R5=E(Ed());Ei();_e();r_();Va();nW();n6();s6();de();Xd();dWe=E(dm());_5();Nt();Wr();Yg();Y();Te();P5=U(),Vi=P5("extensions");(function(n){n[n.Global=0]="Global",n[n.Local=1]="Local",n[n.SingleFile=2]="SingleFile",n[n.Internal=3]="Internal"})(qn||(qn={}));k5=class{constructor(){this.extensions=new Map;this.disabled=new Set;this._onDidLoadExtension=new Uy.Emitter;this._onDidActiveExtension=new Uy.Emitter;this._onDidUnloadExtension=new Uy.Emitter;this._additionalSchemes={};this.activated=!1;this.disposables=[];this.ready=!0;this.onDidLoadExtension=this._onDidLoadExtension.event;this.onDidActiveExtension=this._onDidActiveExtension.event;this.onDidUnloadExtension=this._onDidUnloadExtension.event;let e=global.hasOwnProperty("__TEST__")?Be.default.join(__dirname,"__tests__"):process.env.COC_DATA_HOME,t=this.root=Be.default.join(e,"extensions");Tt.default.existsSync(t)||Tt.default.mkdirpSync(t);let i=Be.default.join(t,"package.json");Tt.default.existsSync(i)||Tt.default.writeFileSync(i,'{"dependencies":{}}',"utf8");let n=Be.default.join(t,"db.json");this.db=new Kc(n)}get outputChannel(){return this._outputChannel?this._outputChannel:(this._outputChannel=D.createOutputChannel("extensions"),this._outputChannel)}async init(){let e=this.db.fetch("extension")||{},t=Object.keys(e);for(let s of t)e[s].disabled==!0&&this.disabled.add(s);if(process.env.COC_NO_PLUGINS)return;let i=await this.globalExtensionStats(),n=await this.localExtensionStats(i.map(s=>s.id));i=i.concat(n),this.memos=new kb(Be.default.resolve(this.root,"../memos.json")),i.map(s=>{let o=s.isLocal?1:0;try{this.createExtension(s.root,s.packageJSON,o)}catch(a){Vi.error(`Error on create ${s.root}:`,a)}}),await this.loadFileExtensions(),se.register({id:"extensions.forceUpdateAll",execute:async()=>{let s=await this.cleanExtensions();Vi.info(`Force update extensions: ${s}`),await this.installExtensions(s)}},!1,"remove all global extensions and install them"),v.onDidRuntimePathChange(async s=>{for(let o of s)o&&this.checkDirectory(o)===!0&&await this.loadExtension(o)},null,this.disposables)}activateExtensions(){this.activated=!0;for(let s of this.extensions.values()){let{id:o,packageJSON:a}=s.extension;this.setupActiveEvents(o,a).logError()}let e=new tr(v.nvim);if(O.on("CursorMoved",(0,E5.debounce)(async s=>{if(this.installBuffer&&s==this.installBuffer.bufnr){let o=await v.nvim.call("line",["."]),a=this.installBuffer.getMessages(o-1),l=a&&a.length?[{content:a.join(`
`),filetype:"txt"}]:[];await e.show(l,{modes:["n"]})}},500)),global.hasOwnProperty("__TEST__"))return;this.checkExtensions().logError();let t=v.getConfiguration("coc.preferences"),i=t.get("extensionUpdateCheck","never"),n=t.get("silentAutoupdate",!0);if(i!="never"){let s=new Date,o=new Date(s.getFullYear(),s.getMonth(),s.getDate()-(i=="daily"?0:7)),a=this.db.fetch("lastUpdate");if(a&&Number(a)>o.getTime())return;this.outputChannel.appendLine("Start auto update..."),this.updateExtensions(!1,n).logError()}}async updateExtensions(e,t=!1){if(!this.npm)return;let i=await this.getLockedList(),n=await this.globalExtensionStats();n=n.filter(l=>![...i,...this.disabled].includes(l.id)),this.db.push("lastUpdate",Date.now()),t&&D.showMessage("Updating extensions, checkout output:///extensions for details.","more");let s=this.installBuffer=new xh(!0,e,t?this.outputChannel:void 0);s.setExtensions(n.map(l=>l.id)),await s.show(v.nvim);let o=Pb(this.npm,this.modulesFolder);await Rd(n,l=>{let{id:c}=l;s.startProgress([c]);let u=l.exotic?l.uri:null,f=o(c);return f.on("message",(d,h)=>{s.addMessage(c,d,h)}),f.update(u).then(d=>{s.finishProgress(c,!0),d&&this.loadExtension(d).logError()},d=>{s.addMessage(c,d.message),s.finishProgress(c,!1)})},t?1:3)}async checkExtensions(){let{globalExtensions:e}=v.env;if(e&&e.length){let t=this.filterGlobalExtensions(e);this.installExtensions(t).logError()}}get installer(){return Pb(this.npm,this.modulesFolder)}async installExtensions(e=[]){let{npm:t}=this;if(!t||!e.length)return;e=Ng(e);let i=this.installBuffer=new xh;i.setExtensions(e),await i.show(v.nvim);let n=Pb(this.npm,this.modulesFolder);await Rd(e,o=>{i.startProgress([o]);let a=n(o);return a.on("message",(l,c)=>{i.addMessage(o,l,c)}),a.install().then(l=>{i.finishProgress(o,!0);let c=Be.default.join(this.modulesFolder,l);this.loadExtension(c).logError()},l=>{i.addMessage(o,l.message),i.finishProgress(o,!1),Vi.error(`Error on install ${o}`,l)})})}getMissingExtensions(){let e=this.loadJson()||{dependencies:{}},t=[];for(let i of Object.keys(e.dependencies)){let n=Be.default.join(this.modulesFolder,i);if(!Tt.default.existsSync(n)){let s=e.dependencies[i];s.startsWith("http")?t.push(s):t.push(i)}}return t}get npm(){let e=v.getConfiguration("npm").get("binPath","npm");e=v.expand(e);for(let t of[e,"yarnpkg","yarn","npm"])try{return R5.default.sync(t)}catch(i){continue}return D.showMessage("Can't find npm or yarn in your $PATH","error"),null}get all(){return Array.from(this.extensions.values()).map(e=>e.extension).filter(e=>!this.isDisabled(e.id))}getExtension(e){return this.extensions.get(e)}getExtensionState(e){if(this.isDisabled(e))return"disabled";let i=this.extensions.get(e);if(!i)return"unknown";let{extension:n}=i;return n.isActive?"activated":"loaded"}async getExtensionStates(){let e=await this.localExtensionStats([]),t=await this.globalExtensionStats();return e.concat(t.filter(i=>e.find(n=>n.id==i.id)==null))}async getLockedList(){let e=await this.db.fetch("extension");return e=e||{},Object.keys(e).filter(t=>e[t].locked===!0)}async toggleLock(e){let t=`extension.${e}.locked`;await this.db.fetch(t)?this.db.delete(t):this.db.push(t,!0)}async toggleExtension(e){let t=this.getExtensionState(e);if(t==null)return;t=="activated"&&await this.deactivate(e);let i=`extension.${e}.disabled`;if(this.db.push(i,t!="disabled"),t!="disabled")this.disabled.add(e),await this.unloadExtension(e);else{this.disabled.delete(e);let n=Be.default.join(this.modulesFolder,e);Tt.default.existsSync(n)&&await this.loadExtension(n)}await bt(200)}async reloadExtension(e){let t=this.extensions.get(e);if(!t){D.showMessage(`Extension ${e} not registered`,"error");return}if(t.type==3){D.showMessage(`Can't reload internal extension "${t.id}"`,"warning");return}t.type==2?await this.loadExtensionFile(t.filepath):t.directory?await this.loadExtension(t.directory):D.showMessage(`Can't reload extension ${t.id}`,"warning")}async cleanExtensions(){let e=this.modulesFolder;if(!Tt.default.existsSync(e))return[];let t=this.globalExtensions,i=[];for(let n of t){let s=Be.default.join(e,n),o=await Tt.default.lstat(s);!o||o&&o.isSymbolicLink()||(await this.unloadExtension(n),await Tt.default.remove(s),i.push(n))}return i}async uninstallExtension(e){try{if(!e.length)return;let[t,i]=Mg(e,a=>this.globalExtensions.includes(a));i.length&&D.showMessage(`Extensions ${i} not global extensions, can't uninstall!`,"warning");let n=this.loadJson()||{dependencies:{}};for(let a of t){await this.unloadExtension(a),delete n.dependencies[a];let l=Be.default.join(this.modulesFolder,a);Tt.default.existsSync(l)&&await Tt.default.remove(l)}let s={dependencies:{}};Object.keys(n.dependencies).sort().forEach(a=>{s.dependencies[a]=n.dependencies[a]});let o=Be.default.join(this.root,"package.json");Tt.default.writeFileSync(o,JSON.stringify(s,null,2),{encoding:"utf8"}),D.showMessage(`Removed: ${t.join(" ")}`)}catch(t){D.showMessage(`Uninstall failed: ${t.message}`,"error")}}isDisabled(e){return this.disabled.has(e)}has(e){return this.extensions.has(e)}isActivated(e){let t=this.extensions.get(e);return!!(t&&t.extension.isActive)}async loadExtension(e){try{let t=Be.default.dirname(e),i=Be.default.normalize(t)!=Be.default.normalize(this.modulesFolder),n=Be.default.join(e,"package.json"),s=JSON.parse(Tt.default.readFileSync(n,"utf8")),{name:o}=s;return this.isDisabled(o)?!1:(await this.unloadExtension(o),this.createExtension(e,Object.freeze(s),i?1:0),!0)}catch(t){return D.showMessage(`Error on load extension from "${e}": ${t.message}`,"error"),Vi.error(`Error on load extension from ${e}`,t),!1}}async loadFileExtensions(){if(!process.env.COC_VIMCONFIG)return;let e=Be.default.join(process.env.COC_VIMCONFIG,"coc-extensions");if(!Tt.default.existsSync(e))return;let t=await Tt.default.readdir(e);t=t.filter(i=>i.endsWith(".js"));for(let i of t)await this.loadExtensionFile(Be.default.join(e,i))}loadedExtensions(){return Array.from(this.extensions.keys())}async watchExtension(e){let t=this.extensions.get(e);if(!t){D.showMessage(`extension ${e} not found`,"error");return}if(e.startsWith("single-"))D.showMessage(`watching ${t.filepath}`),this.disposables.push(Ic(t.filepath,async()=>{await this.loadExtensionFile(t.filepath),D.showMessage(`reloaded ${e}`)}));else{let i=v.getWatchmanPath();if(!i){D.showMessage("watchman not found","error");return}let n=await Pn.createClient(i,t.directory);if(!n){D.showMessage("Can't create watchman client, check output:///watchman");return}D.showMessage(`watching ${t.directory}`),this.disposables.push(n),n.subscribe("**/*.js",async()=>{await this.reloadExtension(e),D.showMessage(`reloaded ${e}`)}).then(s=>{this.disposables.push(s)},s=>{Vi.error(s)})}}async loadExtensionFile(e){let t=Be.default.basename(e),i=Be.default.basename(e,".js"),n="single-"+i;if(this.isDisabled(n))return;let s=Be.default.dirname(e),o={name:n,main:t,engines:{coc:"^0.0.79"}},a=Be.default.join(s,i+".json"),l=await Mt(a);if(l&&l.isFile()){let c=await Gc(a,"utf8"),u=JSON.parse(c);if(u){let f=["activationEvents","contributes"];for(let d of f)u[d]&&(o[d]=u[d])}}await this.unloadExtension(n),this.createExtension(s,o,2)}async activate(e){if(this.isDisabled(e))throw new Error(`Extension ${e} is disabled!`);let t=this.extensions.get(e);if(!t)throw new Error(`Extension ${e} not registered!`);let{extension:i}=t;return i.isActive?!0:(await Promise.resolve(i.activate()),i.isActive?(this._onDidActiveExtension.fire(i),!0):!1)}async deactivate(e){let t=this.extensions.get(e);return t?(await Promise.resolve(t.deactivate()),!0):!1}async call(e,t,i){let n=this.extensions.get(e);if(!n)throw new Error(`extension ${e} not registered`);let{extension:s}=n;s.isActive||await this.activate(e);let{exports:o}=s;if(!o||!o.hasOwnProperty(t))throw new Error(`method ${t} not found on extension ${e}`);return await Promise.resolve(o[t].apply(null,i))}getExtensionApi(e){let t=this.extensions.get(e);if(!t)return null;let{extension:i}=t;return i.isActive?i.exports:null}registerExtension(e,t){let{id:i,packageJSON:n}=e;this.extensions.set(i,{id:i,type:3,extension:e,deactivate:t,isLocal:!0});let{contributes:s}=n;if(s){let{configuration:o}=s;if(o&&o.properties){let{properties:a}=o,l={};for(let c of Object.keys(a)){let u=a[c].default;u!=null&&(l[c]=u)}v.configurations.extendsDefaults(l)}}this._onDidLoadExtension.fire(e),this.setupActiveEvents(i,n).logError()}get globalExtensions(){let e=this.loadJson();return!e||!e.dependencies?[]:Object.keys(e.dependencies)}async globalExtensionStats(){let e=this.loadJson();if(!e||!e.dependencies)return[];let{modulesFolder:t}=this;return(await Promise.all(Object.keys(e.dependencies).map(n=>new Promise(async s=>{try{let o=e.dependencies[n],a=Be.default.join(t,n),l=this.checkDirectory(a);if(l instanceof Error)return D.showMessage(`Unable to load global extension at ${a}: ${l.message}`,"error"),Vi.error(`Error on load ${a}`,l),s(null);let c=await Gc(Be.default.join(a,"package.json"),"utf8");a=await Tt.default.realpath(a);let u=JSON.parse(c),f=u&&u.version||"",d=u&&u.description||"",h=T5.default.isValid(o)?o:"";s({id:n,isLocal:!1,version:f,description:d,exotic:/^https?:/.test(o),uri:h.replace(/\.git(#master)?$/,""),root:a,state:this.getExtensionState(n),packageJSON:Object.freeze(u)})}catch(o){Vi.error(o),s(null)}})))).filter(n=>n!=null)}async localExtensionStats(e){let i=(await v.nvim.eval("&runtimepath")).split(",");return(await Promise.all(i.map(s=>new Promise(async o=>{try{if(this.checkDirectory(s)!==!0)return o(null);let l=Be.default.join(s,"package.json"),c=await Gc(l,"utf8"),u=JSON.parse(c),f=this.extensions.get(u.name);if(f&&!f.isLocal)return Vi.info(`Extension "${u.name}" in runtimepath already loaded.`),o(null);if(e.includes(u.name))return Vi.info(`Skipped load vim plugin from "${s}", "${u.name}" already global extension.`),o(null);let d=u&&u.version||"",h=u&&u.description||"";o({id:u.name,isLocal:!0,version:d,description:h,exotic:!1,root:s,state:this.getExtensionState(u.name),packageJSON:Object.freeze(u)})}catch(a){Vi.error(a),o(null)}})))).filter(s=>s!=null)}loadJson(){let{root:e}=this,t=Be.default.join(e,"package.json");if(!Tt.default.existsSync(t))return null;let i=[],n=Tt.default.readFileSync(t,"utf8"),s=Wc(n,i,{allowTrailingComma:!0});return i&&i.length>0&&(D.showMessage(`Error on parse ${t}`,"error"),v.nvim.call("coc#util#open_file",["edit",t],!0)),s}get schemes(){return this._additionalSchemes}addSchemeProperty(e,t){this._additionalSchemes[e]=t,v.configurations.extendsDefaults({[e]:t.default})}async setupActiveEvents(e,t){let{activationEvents:i}=t;if(!this.canActivate(e))return;if(!i||Array.isArray(i)&&i.includes("*")){await this.activate(e).catch(o=>{D.showMessage(`Error on activate extension ${e}: ${o.message}`),this.outputChannel.appendLine(`Error on activate extension ${e}.
${o.message}
${o.stack}`)});return}let n=[],s=()=>(G(n),new Promise(o=>{if(!this.canActivate(e))return this.outputChannel.appendLine(`Extension ${e} is disabled or not loaded.`),o();let a=setTimeout(()=>{this.outputChannel.appendLine(`Extension ${e} activate cost more than 1s`),o()},1e3);this.activate(e).then(()=>{clearTimeout(a),o()},l=>{clearTimeout(a),D.showMessage(`Error on activate extension ${e}: ${l.message}`),this.outputChannel.appendLine(`Error on activate extension ${e}:${l.message}
${l.stack}`),o()})}));for(let o of i){let a=o.split(":"),l=a[0];if(l=="onLanguage"){if(v.filetypes.has(a[1])){await s();return}v.onDidOpenTextDocument(c=>{c.languageId==a[1]&&s()},null,n)}else if(l=="onCommand")se.onCommandList.push(a[1]),O.on("Command",async c=>{c==a[1]&&(await s(),await bt(500))},null,n);else if(l=="workspaceContains"){let c=async()=>{let f=v.workspaceFolders.map(d=>B.parse(d.uri).fsPath);for(let d of f)if(Ro(d,a[1].split(/\s+/)))return await s(),!0};if(await c())return;v.onDidChangeWorkspaceFolders(c,null,n)}else if(l=="onFileSystem"){for(let c of v.documents)if(B.parse(c.uri).scheme==a[1]){await s();return}v.onDidOpenTextDocument(c=>{B.parse(c.uri).scheme==a[1]&&s()},null,n)}else D.showMessage(`Unsupported event ${o} of ${e}`,"error")}}createExtension(e,t,i){let n=t.name,s=!1,o,a=Be.default.join(e,t.main||"index.js"),l,c=[],u,f={activate:()=>{if(o)return o;let h={subscriptions:c,extensionPath:e,globalState:this.memos.createMemento(`${n}|global`),workspaceState:this.memos.createMemento(`${n}|${v.rootPath}`),asAbsolutePath:p=>Be.default.join(e,p),storagePath:Be.default.join(this.root,`${n}-data`),logger:P5(n)};if(!l)try{let p=!(t.engines||{}).hasOwnProperty("coc");l=C5(n,a,p)}catch(p){Vi.error(`Error on createExtension ${n} from ${a}`,p);return}return o=new Promise((p,g)=>{try{Promise.resolve(l.activate(h)).then(b=>{s=!0,u=b,p(b)},b=>{Vi.error(`Error on active extension ${n}: ${b.message}`,b),g(b)})}catch(b){Vi.error(`Error on active extension ${n}: ${b.stack}`,b),g(b)}}),o}};Object.defineProperties(f,{id:{get:()=>n,enumerable:!0},packageJSON:{get:()=>t,enumerable:!0},extensionPath:{get:()=>e,enumerable:!0},isActive:{get:()=>s,enumerable:!0},exports:{get:()=>{if(!s)throw new Error(`Invalid access to exports, extension "${n}" not activated`);return u},enumerable:!0}}),this.extensions.set(n,{id:n,type:i,isLocal:i==1,extension:f,directory:e,filepath:a,deactivate:()=>{if(!!s&&(o=void 0,u=void 0,s=!1,G(c),c.splice(0,c.length),c=[],l&&l.deactivate))try{return Promise.resolve(l.deactivate()).catch(h=>{Vi.error(`Error on ${n} deactivate: `,h)})}catch(h){Vi.error(`Error on ${n} deactivate: `,h)}}});let{contributes:d}=t;if(d){let{configuration:h,rootPatterns:p,commands:g}=d;if(h&&h.properties){let{properties:b}=h,y={};for(let S of Object.keys(b)){let w=b[S].default;w!=null&&(y[S]=w)}v.configurations.extendsDefaults(y)}if(p&&p.length)for(let b of p)v.addRootPattern(b.filetype,b.patterns);if(g&&g.length)for(let b of g)se.titles.set(b.command,b.title)}this._onDidLoadExtension.fire(f),this.activated&&this.setupActiveEvents(n,t).logError()}filterGlobalExtensions(e){let t=new Map;e.forEach(o=>{let a=this.getExtensionName(o);a&&t.set(a,o)});let i=this.loadJson(),n=[],s=[];if(i&&i.dependencies)for(let o of Object.keys(i.dependencies)){let a=i.dependencies[o];typeof a=="string"&&Tt.default.existsSync(Be.default.join(this.modulesFolder,o,"package.json"))&&(s.push(o),/^https?:/.test(a)&&n.push(a))}for(let o of t.keys()){if(this.disabled.has(o)||this.extensions.has(o)){t.delete(o);continue}(/^https?:/.test(o)&&n.some(a=>a.startsWith(o))||s.includes(o))&&t.delete(o)}return Array.from(t.values())}getExtensionName(e){return/^https?:/.test(e)||!e.includes("@")?e:e.replace(/@[\d.]+$/,"")}get modulesFolder(){return Be.default.join(this.root,global.hasOwnProperty("__TEST__")?"":"node_modules")}canActivate(e){return!this.disabled.has(e)&&this.extensions.has(e)}async unloadExtension(e){this.extensions.get(e)&&(await this.deactivate(e),this.extensions.delete(e),this._onDidUnloadExtension.fire(e))}checkDirectory(e){try{let t=Be.default.join(e,"package.json");if(!Tt.default.existsSync(t))throw new Error("package.json not found");let i=JSON.parse(Tt.default.readFileSync(t,"utf8")),{name:n,engines:s,main:o}=i;if(!n||!s)throw new Error("can't find name & engines in package.json");if(!s||!Wt(s))throw new Error(`invalid engines in ${t}`);if(o&&!Tt.default.existsSync(Be.default.join(e,o)))throw new Error(`main file ${o} not found, you may need to build the project.`);let a=Object.keys(s);if(!a.includes("coc")&&!a.includes("vscode"))throw new Error("Engines in package.json doesn't have coc or vscode");if(a.includes("coc")){let l=s.coc.replace(/^\^/,">=");if(!D5.default.satisfies(v.version,l))throw new Error(`Please update coc.nvim, ${i.name} requires coc.nvim ${s.coc}`)}return!0}catch(t){return t}}dispose(){G(this.disposables)}},we=new k5});var PWe,cn,Xu=R(()=>{En();yt();Y();PWe=U()("sources-source"),cn=class{constructor(e){this._disabled=!1;this.nvim=v.nvim,this.name=e.name,this.filepath=e.filepath||"",this.sourceType=e.sourceType||Vr.Native,this.isSnippet=!!e.isSnippet,this.defaults=e}get priority(){return this.getConfig("priority",1)}get triggerOnly(){let e=this.defaults.triggerOnly;return typeof e=="boolean"?e:!this.triggerCharacters&&!this.triggerPatterns?!1:Array.isArray(this.triggerPatterns)&&this.triggerPatterns.length!=0}get triggerCharacters(){return this.getConfig("triggerCharacters",null)}get optionalFns(){return this.defaults.optionalFns||[]}get triggerPatterns(){let e=this.getConfig("triggerPatterns",null);return!e||e.length==0?null:e.map(t=>typeof t=="string"?new RegExp(t+"$"):t)}get shortcut(){let e=this.getConfig("shortcut","");return e||this.name.slice(0,3)}get enable(){return this._disabled?!1:this.getConfig("enable",!0)}get filetypes(){return this.getConfig("filetypes",null)}get disableSyntaxes(){return this.getConfig("disableSyntaxes",[])}getConfig(e,t){let i=v.getConfiguration(`coc.source.${this.name}`);return t=this.defaults.hasOwnProperty(e)?this.defaults[e]:t,i.get(e,t)}toggle(){this._disabled=!this._disabled}get firstMatch(){return this.getConfig("firstMatch",!0)}get menu(){let{shortcut:e}=this;return e?`[${e}]`:""}filterWords(e,t){let{firstMatch:i}=this,n=[],{input:s}=t,o=t.word;if(!s.length)return[];let a=s[0];for(let l of e)!l||l.length<3||i&&a!=l[0]||!i&&a.toLowerCase()!=l[0].toLowerCase()||l==o||l==s||n.push(l);return n}fixStartcol(e,t){let{col:i,input:n,line:s,bufnr:o}=e,a=zt(s,0,i),l=v.getDocument(o);if(!l)return i;let{chars:c}=l;for(let u=a.length-1;u>=0;u--){let f=a[u];if(!c.isKeywordChar(f)&&!t.includes(f))break;n=`${f}${n}`,i=i-1}return e.col=i,e.input=n,i}async shouldComplete(e){let{disableSyntaxes:t}=this;if(e.synname&&t&&t.length){let n=(e.synname||"").toLowerCase();if(t.findIndex(s=>n.includes(s.toLowerCase()))!==-1)return!1}let i=this.defaults.shouldComplete;return typeof i=="function"?await Promise.resolve(i.call(this,e)):!0}async refresh(){let e=this.defaults.refresh;typeof e=="function"&&await Promise.resolve(e.call(this))}async onCompleteDone(e,t){let i=this.defaults.onCompleteDone;typeof i=="function"&&await Promise.resolve(i.call(this,e,t))}async doComplete(e,t){let i=this.defaults.doComplete;return typeof i=="function"?await Promise.resolve(i.call(this,e,t)):null}}});function jme(r,e){let t=e[0];if(!t.textEdit)return null;let i=xt.InsertReplaceEdit.is(t.textEdit)?t.textEdit.replace:t.textEdit.range,{character:n}=i.start;for(let s=1;s<Math.min(10,e.length);s++){let o=e[s];if(!o.textEdit||(xt.InsertReplaceEdit.is(o.textEdit)?o.textEdit.replace:o.textEdit.range).start.character!==n)return null}return Ci(r,n)}function Ume(r,e,t=""){return e.get(r)||t}function Hme(r,e,t){let{label:i,data:n,insertTextFormat:s,insertText:o,textEdit:a}=r,l,c;if(n&&typeof n.word=="string")return n.word;if(a){let u=xt.InsertReplaceEdit.is(a)?a.replace:a.range;if(c=a.newText,u&&u.start.line==u.end.line){let{line:f,col:d,colnr:h}=e,p=za(f,d);if(u.start.character>p)c=f.slice(p,u.start.character)+c;else{let g=f.slice(u.start.character,p);g.length&&c.startsWith(g)&&(c=c.slice(g.length))}if(p=za(f,h-1),u.end.character>p){let g=f.slice(p,u.end.character);c.endsWith(g)&&(c=c.slice(0,-g.length))}}}else c=o;if(s==xt.InsertTextFormat.Snippet&&c&&c.includes("$")){let f=new Fo().text(c);l=f?I5(f,t):i}else l=I5(c,t)||i;return l||""}function I5(r,e){if(!r)return"";if(!e.length)return r;for(let t=0;t<r.length;t++){let i=r[t];if(e.includes(i))return r.slice(0,t)}return r}var xt,Hy,Wy,O5=R(()=>{xt=E(H());Ei();Yu();uv();Vt();yt();Te();Y();Hy=U()("source-language"),Wy=class{constructor(e,t,i,n,s,o,a,l){this.name=e;this.shortcut=t;this.provider=i;this.documentSelector=n;this.triggerCharacters=s;this.allCommitCharacters=o;this.completeConfig=l;this._enabled=!0;this.resolvedIndexes=new Set;this.completeItems=[];this.priority=typeof a=="number"?a:l.priority}get enable(){return this._enabled}toggle(){this._enabled=!this._enabled}shouldCommit(e,t){let i=this.completeItems[e.index];return i?[...this.allCommitCharacters,...i.commitCharacters||[]].includes(t):!1}async doComplete(e,t){let{provider:i,name:n}=this,{triggerCharacter:s,bufnr:o}=e;this.filetype=e.filetype,this.resolvedIndexes.clear(),this.completeItems=[];let a=this.getTriggerKind(e),l=this.getPosition(e),c={triggerKind:a,option:e};a==xt.CompletionTriggerKind.TriggerCharacter&&(c.triggerCharacter=s);let u;try{let y=v.getDocument(o);u=await Promise.resolve(i.provideCompletionItems(y.textDocument,l,t,c))}catch(y){return Hy.error(`Complete "${n}" error:`,y),null}if(!u||t.isCancellationRequested)return null;let f=Array.isArray(u)?u:u.items;if(!f||f.length==0)return null;this.completeItems=f;let d=jme(e.line,f),h=Object.assign({},e),p;d!=null&&(d<h.col&&(p=zt(e.line,d,h.col)),h.col=d);let g=f.map((y,S)=>{let w=this.convertVimCompleteItem(y,this.shortcut,h,p);return w.index=S,w}),b=typeof u.isIncomplete=="boolean"?u.isIncomplete:!1;return{startcol:d,isIncomplete:b,items:g}}async onCompleteResolve(e,t){let{index:i}=e,n=this.completeItems[i];if(!n||this.resolvedIndexes.has(i))return;if(typeof this.provider.resolveCompletionItem=="function"){this.resolvedIndexes.add(i);try{let o=await Promise.resolve(this.provider.resolveCompletionItem(Object.assign({},n),t));!o||t.isCancellationRequested?this.resolvedIndexes.delete(i):o!==n&&Object.assign(n,o)}catch(o){this.resolvedIndexes.delete(i),Hy.error(`Error on complete resolve: ${o.message}`,o.stack)}}if(typeof e.documentation=="undefined"){let{documentation:o,detail:a}=n;if(!o&&!a)return;let l=[];if(a&&!e.detailShown&&a!=e.word&&(a=a.replace(/\n\s*/g," "),a.length)){let c=/^[\w-\s.,\t\n]+$/.test(a);l.push({filetype:c?"txt":this.filetype,content:a})}o&&(typeof o=="string"?l.push({filetype:"markdown",content:o}):o.value&&l.push({filetype:o.kind=="markdown"?"markdown":"txt",content:o.value})),e.documentation=l}}async onCompleteDone(e,t){let i=this.completeItems[e.index];if(!i)return;let n=t.linenr-1;i.insertText!=null&&!i.textEdit&&(i.textEdit={range:xt.Range.create(n,t.col,n,t.colnr-1),newText:i.insertText}),e.line&&Object.assign(t,{line:e.line});try{let s=await this.applyTextEdit(i,e.word,t),{additionalTextEdits:o}=i;if(o&&i.textEdit){let a=xt.InsertReplaceEdit.is(i.textEdit)?i.textEdit.replace:i.textEdit.range;o=o.filter(l=>{let c=xt.InsertReplaceEdit.is(l)?l.replace:l.range;return dg(a,c)?(Hy.error("Filtered overlap additionalTextEdit:",l),!1):!0})}await this.applyAdditionalEdits(o,t.bufnr,s),s&&await vi.selectCurrentPlaceholder(),i.command&&se.has(i.command.command)&&se.execute(i.command)}catch(s){Hy.error("Error on CompleteDone:",s)}}async applyTextEdit(e,t,i){let{nvim:n}=v,{textEdit:s}=e;if(!s)return!1;let{line:o,bufnr:a,linenr:l}=i,c=v.getDocument(a);if(!c)return!1;let u=s.newText,f=xt.InsertReplaceEdit.is(s)?s.replace:s.range,d=e.insertTextFormat===xt.InsertTextFormat.Snippet,h=o.substr(0,f.start.character),p=o.substr(f.end.character);if(d&&this.completeConfig.snippetsSupport===!1&&(d=!1,u=t),d){let y=c.getline(l-1).length-p.length,S=xt.Range.create(l-1,f.start.character,l-1,y);return await vi.insertSnippet(u,!1,S,e.insertTextMode)}let g=`${h}${u}${p}`.split(/\r?\n/);if(g.length==1)await n.call("coc#util#setline",[l,g[0]]),await D.moveTo(xt.Position.create(l-1,(h+u).length));else{await n.createBuffer(a).setLines(g,{start:l-1,end:l,strictIndexing:!1});let y=l-1+g.length-1,S=g[g.length-1].length-p.length;await D.moveTo({line:y,character:S})}return!1}getTriggerKind(e){let{triggerCharacters:t}=this,i=t.includes(e.triggerCharacter),n=xt.CompletionTriggerKind.Invoked;return e.triggerForInComplete?n=xt.CompletionTriggerKind.TriggerForIncompleteCompletions:i&&(n=xt.CompletionTriggerKind.TriggerCharacter),n}async applyAdditionalEdits(e,t,i){if(!e||e.length==0)return;let n=v.getDocument(t);if(!n)return;await n.patchChange(!0);let s=null,o=await D.getCursorPosition();i||(s=$c(o,e)),await n.applyEdits(e),s&&await D.moveTo(xt.Position.create(o.line+s.line,o.character+s.character))}convertVimCompleteItem(e,t,i,n){var g;let{echodocSupport:s,detailMaxLength:o,invalidInsertCharacters:a,detailField:l,labels:c,defaultKindText:u}=this.completeConfig,f=e.additionalTextEdits&&e.additionalTextEdits.length>0,d=e.insertTextFormat===xt.InsertTextFormat.Snippet||f,h=e.label.trim(),p={word:Hme(e,i,a),abbr:h,menu:`[${t}]`,kind:Ume(e.kind,c,u),sortText:e.sortText||null,sourceScore:e.score||null,filterText:e.filterText||h,isSnippet:d,dup:e.data&&e.data.dup==0?0:1};if(n&&(p.filterText.startsWith(n)||e.textEdit&&e.textEdit.newText.startsWith(n)&&(p.filterText=e.textEdit.newText.split(/\r?\n/)[0]),!e.textEdit&&!p.word.startsWith(n)&&(p.word=`${n}${p.word}`)),e&&e.detail&&l!="preview"){let b=e.detail.replace(/\n\s*/g," ");re(b)<o&&(l=="menu"?p.menu=`${b} ${p.menu}`:l=="abbr"&&(p.abbr=`${p.abbr} - ${b}`),p.detailShown=1)}if(e.documentation?p.info=typeof e.documentation=="string"?e.documentation:e.documentation.value:p.info="",p.word==""&&(p.empty=1),e.textEdit&&(p.line=i.line),e.kind==xt.CompletionItemKind.Folder&&!p.abbr.endsWith("/")&&(p.abbr=p.abbr+"/"),s&&e.kind>=2&&e.kind<=4){let b=[e.detail||"",p.abbr,p.word];for(let y of b)if(y.includes("(")){p.signature=y;break}}return e.preselect&&(p.preselect=!0),((g=e.data)==null?void 0:g.optional)&&(p.abbr=p.abbr+"?"),p}getPosition(e){let{line:t,linenr:i,colnr:n}=e,s=zt(t,0,n-1);return{line:i-1,character:s.length}}}});var JWe,zy,L5=R(()=>{Vu();yt();Y();Te();Xu();JWe=U()("sources-source-vim"),zy=class extends cn{async callOptinalFunc(e,t){if(!this.optionalFns.includes(e))return null;let n=`coc#source#${this.name}#${e}`,s;try{s=await this.nvim.call(n,t)}catch(o){return D.showMessage(`Vim error from source ${this.name}: ${o.message}`,"error"),null}return s}async shouldComplete(e){return await super.shouldComplete(e)?this.optionalFns.includes("should_complete")?!!await this.callOptinalFunc("should_complete",[e]):!0:!1}async refresh(){await this.callOptinalFunc("refresh",[])}async onCompleteDone(e,t){!this.optionalFns.includes("on_complete")||await this.callOptinalFunc("on_complete",[e])}onEnter(e){if(!this.optionalFns.includes("on_enter"))return;let t=v.getDocument(e);if(!t)return;let{filetypes:i}=this;i&&!i.includes(t.filetype)||this.callOptinalFunc("on_enter",[{bufnr:e,uri:t.uri,languageId:t.filetype}]).logError()}async doComplete(e,t){let{col:i,input:n,line:s,colnr:o}=e,a=await this.callOptinalFunc("get_startcol",[e]);if(t.isCancellationRequested)return;if(a){if(a<0)return null;a=Number(a),(isNaN(a)||a<0)&&(a=i),a!==i&&(n=zt(s,a,o-1),e=Object.assign({},e,{col:a,changed:i-a,input:n}))}let l=await this.nvim.callAsync("coc#util#do_complete",[this.name,e]);if(!l||l.length==0||t.isCancellationRequested)return null;if(this.firstMatch&&n.length){let u=n[0];l=l.filter(f=>{let d=f.filterText?f.filterText[0]:f.word[0];return ap(u,d)})}l=l.map(u=>{if(typeof u=="string")return{word:u,menu:this.menu,isSnippet:this.isSnippet};let f=u.menu?u.menu+" ":"";return u.menu=`${f}${this.menu}`,u.isSnippet=this.isSnippet,delete u.user_data,u});let c={items:l};return a&&(c.startcol=a),c}}});var F5={};Bn(F5,{default:()=>Vy,regist:()=>Wme});function Wme(r){return r.set("around",new Vy),A5.Disposable.create(()=>{r.delete("around")})}var A5,QWe,Vy,M5=R(()=>{A5=E(H());Xu();Y();QWe=U()("sources-around"),Vy=class extends cn{constructor(){super({name:"around",filepath:__filename})}doComplete(e){let{bufnr:t,input:i}=e;if(i.length===0)return null;let n=v.getDocument(t);if(!n)return null;let s=n.words,o=n.getMoreWords();return s.push(...o),s=this.filterWords(s,e),Promise.resolve({items:s.map(a=>({word:a,menu:this.menu}))})}}});var q5={};Bn(q5,{default:()=>Gy,regist:()=>zme});function zme(r){return r.set("buffer",new Gy),N5.Disposable.create(()=>{r.delete("buffer")})}var N5,i2e,Gy,$5=R(()=>{N5=E(H());Xu();Y();i2e=U()("sources-buffer"),Gy=class extends cn{constructor(){super({name:"buffer",filepath:__filename})}get ignoreGitignore(){return this.getConfig("ignoreGitignore",!0)}getWords(e){let{ignoreGitignore:t}=this,i=[];return v.documents.forEach(n=>{if(n.bufnr!=e&&!(t&&n.isIgnored))for(let s of n.words)i.includes(s)||i.push(s)}),i}doComplete(e){let{bufnr:t,input:i}=e;if(i.length==0)return null;let n=this.getWords(t);return n=this.filterWords(n,e),Promise.resolve({items:n.map(s=>({word:s,menu:this.menu}))})}}});var H5={};Bn(H5,{default:()=>Jy,regist:()=>Kme});function Kme(r){return r.set("file",new Jy),U5.Disposable.create(()=>{r.delete("file")})}var Ky,B5,Ir,j5,U5,Vme,Gme,Jy,W5=R(()=>{Ky=E(require("fs")),B5=E(Do()),Ir=E(require("path")),j5=E(require("util")),U5=E(H());Xu();Nt();yt();Y();Vme=U()("sources-file"),Gme=/(?:\.{0,2}|~|\$HOME|([\w]+)|[a-zA-Z]:|)(\/|\\)(?:[\w.@()-]+(\/|\\))*(?:[\w.@()-])*$/,Jy=class extends cn{constructor(){super({name:"file",filepath:__filename})}resolveEnvVariables(e){let t=e;return t=t.replace(/%([^%]+)%/g,(i,n)=>process.env[n]),t=t.replace(/\$([A-Z_]+[A-Z0-9_]*)|\${([A-Z0-9_]*)}/gi,(i,n,s)=>process.env[n||s]),t}getPathOption(e){let{line:t,colnr:i}=e,n=zt(t,0,i-1);if(n=this.resolveEnvVariables(n),!n||n.endsWith("//"))return null;let s=n.match(Gme);if(s&&s.length){let o=v.expand(s[0]),a=s[0].match(/[^/\\]*$/)[0];return{pathstr:o,part:s[1],startcol:i-a.length-1,input:a}}return null}async getFileItem(e,t){let i=Ir.default.join(e,t),n=await Mt(i);if(n){let s=n.isDirectory()?t+"/":t;return{word:t,abbr:s}}return null}filterFiles(e){let t=this.getConfig("ignoreHidden",!0),i=this.getConfig("ignorePatterns",[]);return e.filter(n=>{if(n==null||t&&n.startsWith("."))return!1;for(let s of i)if((0,B5.default)(n,s,{dot:!0}))return!1;return!0})}async getItemsFromRoot(e,t){let i=[],n=e.endsWith("/")?e:Ir.default.dirname(e),s=Ir.default.isAbsolute(e)?n:Ir.default.join(t,n);try{let o=await Mt(s);if(o&&o.isDirectory()){let a=await j5.default.promisify(Ky.default.readdir)(s);a=this.filterFiles(a);let l=await Promise.all(a.map(c=>this.getFileItem(s,c)));i=i.concat(l)}return i=i.filter(a=>a!=null),i}catch(o){return Vme.error("Error on list files:",o),i}}get trimSameExts(){return this.getConfig("trimSameExts",[])}async doComplete(e){let{col:t,filepath:i}=e,n=this.getPathOption(e);if(!n)return null;let{pathstr:s,part:o,startcol:a,input:l}=n;if(a<e.col)return null;let c=e.col==a?"":zt(e.line,e.col,a),u=Ir.default.dirname(i),f=Ir.default.extname(Ir.default.basename(i)),d=await this.nvim.call("getcwd",[]),h;if(s.startsWith(".")?h=i?Ir.default.dirname(i):d:s.startsWith("/")?h=s.endsWith("/")?s:Ir.default.dirname(s):o?Ky.default.existsSync(Ir.default.join(u,o))?h=u:Ky.default.existsSync(Ir.default.join(d,o))&&(h=d):h=d,!h)return null;let p=await this.getItemsFromRoot(s,h),g=this.trimSameExts.includes(f),b=l[0];return b&&t==a&&(p=p.filter(y=>y.word[0]===b)),{items:p.map(y=>{let S=Ir.default.extname(y.word);return y.word=g&&S===f?y.word.replace(f,""):y.word,{word:`${c}${y.word}`,abbr:`${c}${y.abbr}`,menu:this.menu}})}}}});var t8={};Bn(t8,{Sources:()=>ID,default:()=>ht});var z5,V5,Yy,G5,it,K5,ID,ht,xl=R(()=>{z5=E(jc()),V5=E(require("fs")),Yy=E(require("path")),G5=E(require("util")),it=E(H());_e();ia();En();de();Nt();c_();ri();yt();Te();Y();Xu();O5();L5();K5=U()("sources"),ID=class{constructor(){this.sourceMap=new Map;this.disposables=[];this.remoteSourcePaths=[]}init(){this.loadCompleteConfig(),v.onDidChangeConfiguration(e=>{e.affectsConfiguration("suggest")&&this.loadCompleteConfig()},null,this.disposables),this.createNativeSources(),this.createRemoteSources(),O.on("BufEnter",this.onDocumentEnter,this,this.disposables),v.watchOption("runtimepath",async(e,t)=>{let i=(0,z5.default)(e,t);for(let[n,s]of i)if(n==1){let o=s.replace(/,$/,"").split(",");for(let a of o)a&&await this.createVimSources(a)}},this.disposables)}loadCompleteConfig(){let e=v.getConfiguration("suggest"),t=e.get("completionItemKindLabels",{}),i=new Map([[it.CompletionItemKind.Text,t.text||"v"],[it.CompletionItemKind.Method,t.method||"f"],[it.CompletionItemKind.Function,t.function||"f"],[it.CompletionItemKind.Constructor,typeof t.constructor=="function"?"f":t["constructor"]],[it.CompletionItemKind.Field,t.field||"m"],[it.CompletionItemKind.Variable,t.variable||"v"],[it.CompletionItemKind.Class,t.class||"C"],[it.CompletionItemKind.Interface,t.interface||"I"],[it.CompletionItemKind.Module,t.module||"M"],[it.CompletionItemKind.Property,t.property||"m"],[it.CompletionItemKind.Unit,t.unit||"U"],[it.CompletionItemKind.Value,t.value||"v"],[it.CompletionItemKind.Enum,t.enum||"E"],[it.CompletionItemKind.Keyword,t.keyword||"k"],[it.CompletionItemKind.Snippet,t.snippet||"S"],[it.CompletionItemKind.Color,t.color||"v"],[it.CompletionItemKind.File,t.file||"F"],[it.CompletionItemKind.Reference,t.reference||"r"],[it.CompletionItemKind.Folder,t.folder||"F"],[it.CompletionItemKind.EnumMember,t.enumMember||"m"],[it.CompletionItemKind.Constant,t.constant||"v"],[it.CompletionItemKind.Struct,t.struct||"S"],[it.CompletionItemKind.Event,t.event||"E"],[it.CompletionItemKind.Operator,t.operator||"O"],[it.CompletionItemKind.TypeParameter,t.typeParameter||"T"]]),n=e.get("floatEnable",!0),s=e.get("detailField","preview");s=="preview"&&(!n||!v.floatSupported)&&(s="menu"),this.completeConfig=Object.assign(this.completeConfig||{},{labels:i,floatEnable:n,detailField:s,defaultKindText:t.default||"",priority:e.get("languageSourcePriority",99),echodocSupport:e.get("echodocSupport",!1),snippetsSupport:e.get("snippetsSupport",!0),detailMaxLength:e.get("detailMaxLength",100),invalidInsertCharacters:e.get("invalidInsertCharacters",["(","<","{","[","\r",`
`])})}get nvim(){return v.nvim}createNativeSources(){try{this.disposables.push((M5(),F5).regist(this.sourceMap)),this.disposables.push(($5(),q5).regist(this.sourceMap)),this.disposables.push((W5(),H5).regist(this.sourceMap))}catch(e){console.error("Create source error:"+e.message)}}createLanguageSource(e,t,i,n,s,o,a){let l=new Wy(e,t,n,i,s||[],a||[],o,this.completeConfig);return K5.debug("created service source",e),this.sourceMap.set(e,l),{dispose:()=>{this.sourceMap.delete(e)}}}async createVimSourceExtension(e,t){let i=Yy.default.basename(t,".vim");try{await e.command(`source ${t}`);let n=await e.call("coc#util#remote_fns",i);for(let u of["init","complete"])if(!n.includes(u))return D.showMessage(`${u} not found for source ${i}`,"error"),null;let s=await e.call(`coc#source#${i}#init`,[]),o={name:`coc-source-${i}`,engines:{coc:">= 0.0.1"},activationEvents:s.filetypes?s.filetypes.map(u=>`onLanguage:${u}`):["*"],contributes:{configuration:{properties:{[`coc.source.${i}.enable`]:{type:"boolean",default:!0},[`coc.source.${i}.firstMatch`]:{type:"boolean",default:!!s.firstMatch},[`coc.source.${i}.triggerCharacters`]:{type:"number",default:s.triggerCharacters||[]},[`coc.source.${i}.priority`]:{type:"number",default:s.priority||9},[`coc.source.${i}.shortcut`]:{type:"string",default:s.shortcut||i.slice(0,3).toUpperCase(),description:"Shortcut text shown in complete menu."},[`coc.source.${i}.disableSyntaxes`]:{type:"array",default:[],items:{type:"string"}},[`coc.source.${i}.filetypes`]:{type:"array",default:s.filetypes||null,description:"Enabled filetypes.",items:{type:"string"}}}}}},a=new zy({name:i,filepath:t,sourceType:Vr.Remote,optionalFns:n.filter(u=>!["init","complete"].includes(u))}),l=!1,c={id:o.name,packageJSON:o,exports:void 0,extensionPath:t,activate:()=>(l=!0,this.addSource(a),Promise.resolve())};Object.defineProperty(c,"isActive",{get:()=>l}),we.registerExtension(c,()=>{l=!1,this.removeSource(a)})}catch(n){D.showMessage(`Error on create vim source ${i}: ${n.message}`,"error")}}createRemoteSources(){let{runtimepath:e}=v.env,t=e.split(",");for(let i of t)this.createVimSources(i).logError()}async createVimSources(e){if(this.remoteSourcePaths.includes(e))return;this.remoteSourcePaths.push(e);let t=Yy.default.join(e,"autoload/coc/source"),i=await Mt(t);if(i&&i.isDirectory()){let n=await G5.default.promisify(V5.default.readdir)(t);n=n.filter(o=>o.endsWith(".vim"));let s=n.map(o=>Yy.default.join(t,o));if(s.length==0)return;await Promise.all(s.map(o=>this.createVimSourceExtension(this.nvim,o)))}}get names(){return Array.from(this.sourceMap.keys())}get sources(){return Array.from(this.sourceMap.values())}has(e){return this.names.findIndex(t=>t==e)!=-1}getSource(e){return e&&this.sourceMap.get(e)||null}shouldCommit(e,t){if(!e||!e.source)return!1;let i=this.getSource(e.source);return i&&i.sourceType==Vr.Service&&typeof i.shouldCommit=="function"?i.shouldCommit(e,t):!1}getCompleteSources(e){let{filetype:t}=e,i=zt(e.line,0,e.colnr-1),n=e.input==""&&!!e.triggerCharacter,s=tg(e.filepath,e.bufnr,"",v.env.isCygwin);return n?this.getTriggerSources(i,t,s):this.getNormalSources(e.filetype,s)}getNormalSources(e,t){return this.sources.filter(i=>{let{filetypes:n,triggerOnly:s,documentSelector:o,enable:a}=i;return!(!a||s||n&&!n.includes(e)||o&&Zc(o,t,e)==0||this.disabledByLanguageId(i,e))})}checkTrigger(e,t,i){let{triggerCharacters:n,triggerPatterns:s}=e;return!n&&!s?!1:!!(i&&n&&n.includes(i)||s&&s.findIndex(o=>o.test(t))!==-1)}shouldTrigger(e,t,i){return this.getTriggerSources(e,t,i).length>0}getTriggerSources(e,t,i){let n=e.length?e[e.length-1]:"";return n?this.sources.filter(s=>{let{filetypes:o,enable:a,documentSelector:l}=s;return!a||o&&!o.includes(t)||l&&Zc(l,i,t)==0||this.disabledByLanguageId(s,t)?!1:this.checkTrigger(s,e,n)}):[]}addSource(e){let{name:t}=e;return this.names.includes(t)&&K5.warn(`Recreate source ${t}`),this.sourceMap.set(t,e),it.Disposable.create(()=>{this.sourceMap.delete(t)})}removeSource(e){let t=typeof e=="string"?e:e.name;this.sourceMap.delete(t)}async refresh(e){for(let t of this.sources)(!e||t.name==e)&&typeof t.refresh=="function"&&await Promise.resolve(t.refresh())}toggleSource(e){if(!e)return;let t=this.getSource(e);!t||typeof t.toggle=="function"&&t.toggle()}sourceStats(){let e=[],t=this.sources;for(let i of t)e.push({name:i.name,priority:i.priority,triggerCharacters:i.triggerCharacters||[],shortcut:i.shortcut||"",filetypes:i.filetypes||[],filepath:i.filepath||"",type:i.sourceType==Vr.Native?"native":i.sourceType==Vr.Remote?"remote":"service",disabled:!i.enable});return e}onDocumentEnter(e){let{sources:t}=this;for(let i of t)i.enable&&typeof i.onEnter=="function"&&i.onEnter(e)}createSource(e){if(!e.name||!e.doComplete)throw new Error("name and doComplete required for createSource");let t=new cn(Object.assign({sourceType:Vr.Service},e));return this.addSource(t)}disabledByLanguageId(e,t){let i=v.env.disabledSources;if(GN(i))return!1;let n=i?i[t]:[];return Array.isArray(n)&&n.includes(e.name)}dispose(){G(this.disposables)}},ht=new ID});function J5(r=0,e){for(let t=r;t<e.length;t++)if(X5(t,e))return t;return-1}function Y5(r){return r>=65&&r<=90}function X5(r,e){if(r==0)return!0;let t=e[r];if(!op(t))return!1;let i=e[r-1];return!!(!op(i)||Y5(t)&&!Y5(i))}function Z5(r,e){if(e.length==0||r.length<e.length)return 0;let t=Js(r),i=t[0],n=0,s=e[0],o=1,a=!0;if(Mn(s,i))n=s==i?5:2.5,o=1;else{let c=J5(1,t);if(c!=-1&&Mn(s,t[c])&&(n=s==t[c]?2.5:2,o=c+1),n==0)for(let u=1;u<t.length;u++)Mn(s,t[u])&&(n=s==t[u]?1:.5,o=u+1,a=!1)}if(e.length==1||n==0)return n;let l=dp(t,o,e.slice(1),a);return l==0?0:n+l}function dp(r,e,t,i=!0){if(e>=r.length)return 0;let n=[],s=t[0],o=r.length,a=t.length==1;if(!op(s)){for(let u=e;u<o;u++)if(r[u]==s){if(a)return 1;let f=dp(r,u+1,t.slice(1),i);return f==0?0:1+f}return 0}let l=r[e],c=Mn(s,l);if(c){let u=s==l?1:.5;if(!a){let f=dp(r,e+1,t.slice(1),i);u=f==0?0:u+f}n.push(u)}if(op(s)&&!X5(e,r)){let u=J5(e+1,r);if(u!==-1){let f=r[u];if(Mn(s,f)){let d=s==f?1:.75;if(!a){let h=dp(r,u+1,t.slice(1),i);d=h==0?0:d+h}n.push(d)}}}if(!c&&i)for(let u=e+1;u<o;u++){let f=r[u];if(Mn(s,f)){let d=s==f?.1:.05;if(!a){let h=dp(r,u+1,t.slice(1),!1);d=h==0?0:d+h}n.push(d)}}return n.length?Math.max(...n):0}var Q5=R(()=>{Vu()});var Rl,Xy,Jme,Zy,eG=R(()=>{Rl=E(H());Vu();yt();Q5();Xy=U()("completion-complete"),Jme=500,Zy=class{constructor(e,t,i,n,s){this.option=e;this.document=t;this.config=i;this.sources=n;this.nvim=s;this.results=[];this.completing=new Set;this._canceled=!1;this.tokenSources=new Map;this._onDidComplete=new Rl.Emitter;this.onDidComplete=this._onDidComplete.event}get isCompleting(){return this.completing.size>0}get isCanceled(){return this._canceled}get isEmpty(){return this.results.length==0}get startcol(){return this.option.col||0}get input(){return this.option.input}get isIncomplete(){return this.results.findIndex(e=>e.isIncomplete)!==-1}async completeSource(e){let{col:t}=this.option,i=Object.assign({},this.option),n=this.config.timeout;n=Math.max(Math.min(n,15e3),500);try{if(typeof e.shouldComplete=="function"&&!await Promise.resolve(e.shouldComplete(i)))return null;let s=Date.now(),o=this.tokenSources.get(e.name);o&&o.cancel();let a=new Rl.CancellationTokenSource;this.tokenSources.set(e.name,a),await new Promise((l,c)=>{let{name:u}=e,f=setTimeout(()=>{this.nvim.command(`echohl WarningMsg| echom 'source ${e.name} timeout after ${n}ms'|echohl None`,!0),a.cancel()},n),d=!1,h=!1,p=!1,g=setTimeout(()=>{h||(p=!0,l(void 0))},Jme),b=()=>{h||(h=!0,y.dispose(),clearTimeout(g),clearTimeout(f),this.tokenSources.delete(u))},y=a.token.onCancellationRequested(()=>{y.dispose(),this.completing.delete(u),d=!0,b(),Xy.debug(`Source "${u}" cancelled`),l(void 0)});this.completing.add(u),Promise.resolve(e.doComplete(i,a.token)).then(S=>{if(this.completing.delete(u),d)return;b();let w=Date.now()-s;if(Xy.debug(`Source "${u}" takes ${w}ms`),S&&S.items&&S.items.length){if(S.priority=e.priority,S.source=u,p&&S.startcol&&S.startcol!=t)this.results=[S];else{let{results:_}=this,L=_.findIndex($=>$.source==u);L!=-1?_.splice(L,1,S):_.push(S)}p&&this._onDidComplete.fire(),l(void 0)}else{let{results:_}=this;this.results=_.filter(L=>L.source!=u),l(void 0)}},S=>{this.completing.delete(u),b(),c(S)})})}catch(s){this.nvim.command(`echoerr 'Complete ${e.name} error: ${s.message.replace(/'/g,"''")}'`,!0),Xy.error("Complete error:",e.name,s)}}async completeInComplete(e){let{results:t,document:i}=this;t.filter(f=>!f.isIncomplete).forEach(f=>{f.items.forEach(d=>delete d.user_data)});let o=t.filter(f=>f.isIncomplete).map(f=>f.source),{input:a,colnr:l,linenr:c}=this.option;Object.assign(this.option,{input:e,line:i.getline(c-1),colnr:l+(e.length-a.length),triggerCharacter:null,triggerForInComplete:!0});let u=this.sources.filter(f=>o.includes(f.name));return await Promise.all(u.map(f=>this.completeSource(f))),this.filterResults(e,Math.floor(Date.now()/1e3))}filterResults(e,t=0){let{results:i}=this;i.sort((d,h)=>d.source=="tabnine"?1:h.source=="tabnine"?-1:h.priority-d.priority);let{snippetIndicator:n,removeDuplicateItems:s,fixInsertedWord:o,asciiCharactersOnly:a}=this.config,l=!o||t==0?"":this.getFollowPart();if(i.length==0)return[];let c=[],u=Js(e),f=new Set;for(let d=0,h=i.length;d<h;d++){let p=i[d],{items:g,source:b,priority:y}=p;for(let S=0;S<g.length;S++){let w=g[S];if(!w||typeof w.word!="string")continue;let{word:_}=w;if(a&&!/^[\x00-\x7F]*$/.test(_)||!w.dup&&f.has(_)||s&&!w.isSnippet&&f.has(_)&&w.line==null)continue;let L=w.filterText||w.word;if(w.filterText=L,L.length<e.length)continue;let $=w.kind&&L==e?64:Z5(L,u);if(!(e.length&&$==0)){if(l.length&&!w.isSnippet&&w.word.endsWith(l)){let{word:I}=w;w.word=w.word.slice(0,-l.length),w.abbr=w.abbr||I}if(!w.user_data){let I={cid:t,source:b};I.index=w.index||S,w.isSnippet&&((w.abbr||w.word).endsWith(n)||(w.abbr=`${w.abbr||w.word}${n}`)),w.signature&&(I.signature=w.signature),w.user_data=JSON.stringify(I),w.source=b}w.priority=y,w.abbr=w.abbr||w.word,w.score=e.length?$*(w.sourceScore||1):0,w.localBonus=this.localBonus&&this.localBonus.get(L)||0,f.add(_),w.isSnippet&&e.length&&w.word==e&&(w.preselect=!0),c.push(w)}}}return c.sort((d,h)=>{let p=d.sortText,g=h.sortText,b=d.filterText,y=h.filterText;if(d.score!=h.score)return h.score-d.score;if(d.priority!=h.priority)return h.priority-d.priority;if(p&&g&&p!=g)return p<g?-1:1;if(d.localBonus!=h.localBonus){if(d.localBonus&&h.localBonus&&b!=y){if(b.startsWith(y))return 1;if(y.startsWith(b))return-1}return h.localBonus-d.localBonus}switch(this.config.defaultSortMethod){case"none":return 0;case"alphabetical":return d.filterText.localeCompare(h.filterText);case"length":default:return d.filterText.length-h.filterText.length}}),this.limitCompleteItems(c.slice(0,this.config.maxItemCount))}limitCompleteItems(e){let{highPrioritySourceLimit:t,lowPrioritySourceLimit:i}=this.config;if(!t&&!i)return e;let n=new Map;return e.filter(s=>{let{priority:o,source:a}=s,l=o<90,c=n.get(a)||0;return i&&l&&c==i||t&&!l&&c==t?!1:(n.set(a,c+1),!0)})}hasMatch(e){let{results:t}=this;if(!t)return!1;let i=Js(e);for(let n=0,s=t.length;n<s;n++)if(t[n].items.findIndex(l=>zu(i,l.filterText||l.word))!==-1)return!0;return!1}async doComplete(){let e=this.option,{line:t,colnr:i,linenr:n,col:s}=this.option;if(this.config.localityBonus){let l=n-1;this.localBonus=this.document.getLocalifyBonus(Rl.Position.create(l,e.col-1),Rl.Position.create(l,i))}else this.localBonus=new Map;await Promise.all(this.sources.map(l=>this.completeSource(l)));let{results:o}=this;if(o.length==0)return[];let a=o.find(l=>l.startcol!=null&&l.startcol!=s);if(a){let{startcol:l}=a;e.col=l,e.input=zt(t,l,i-1),this.results=[a]}return Xy.info(`Results from: ${this.results.map(l=>l.source).join(",")}`),this.filterResults(e.input,Math.floor(Date.now()/1e3))}resolveCompletionItem(e){let{results:t}=this;if(!t)return null;try{if(e.user_data){let{source:i}=JSON.parse(e.user_data);return t.find(s=>s.source==i).items.find(s=>s.user_data==e.user_data)}for(let i of t){let n=i.items.find(s=>s.abbr==e.abbr&&s.info==e.info);if(n)return n}return null}catch(i){return null}}getFollowPart(){let{colnr:e,line:t}=this.option,i=za(t,e-1);return i==t.length?"":t.slice(i-t.length).match(/^\S?[\w-]*/)[0]}dispose(){if(!this._canceled){this._onDidComplete.dispose(),this._canceled=!0;for(let e of this.tokenSources.values())e.cancel();this.tokenSources.clear(),this.sources=[],this.results=[]}}}});var M2e,Qy,tG=R(()=>{v0();M2e=U()("floating"),Qy=class{constructor(e,t){this.nvim=e;this.isVim=t;this.winid=0;this.bufnr=0}async show(e,t,i,n){let{nvim:s}=this;e=e.filter(f=>f.content.trim().length>0);let{lines:o,codes:a,highlights:l}=fg(e,{excludeImages:i.excludeImages});if(o.length==0){this.close();return}let c={codes:a,highlights:l,maxWidth:i.maxWidth||80,pumbounding:t};i.border&&(c.border=[1,1,1,1]),i.highlight&&(c.highlight=i.highlight),i.borderhighlight&&(c.borderhighlight=i.borderhighlight),this.isVim||(typeof i.winblend=="number"&&(c.winblend=i.winblend),c.focusable=i.focusable===!0?1:0,i.shadow&&(c.shadow=1));let u=await s.call("coc#float#create_pum_float",[this.winid,this.bufnr,o,c]);if(this.isVim&&s.command("redraw",!0),!(!u||u.length==0)&&(this.winid=u[0],this.bufnr=u[1],n.isCancellationRequested)){this.close();return}}close(){let{winid:e,nvim:t}=this;this.winid=0,!!e&&(t.call("coc#float#close",[e],!0),this.isVim&&t.command("redraw",!0))}}});var ew,iG,na,Yme,rG,sa,OD=R(()=>{ew=E(H());_e();xl();de();Wr();Y();eG();tG();iG=E(Ui());yt();ri();na=U()("completion"),Yme=["abbr","menu","info","kind","icase","dup","empty","user_data"],rG=class{constructor(){this.activated=!1;this.disposables=[];this.complete=null;this.changedTick=0;this.insertCharTs=0;this.insertLeaveTs=0}init(){this.config=this.getCompleteConfig(),v.onDidChangeConfiguration(t=>{t.affectsConfiguration("suggest")&&(this.config=this.getCompleteConfig())},null,this.disposables),v.watchOption("completeopt",async(t,i)=>{if(v.env.completeOpt=i,!!this.isActivated&&this.config.autoTrigger==="always"){let s=(await this.nvim.call("execute",["verbose set completeopt"])).split(/\r?\n/);console.error(`Some plugin change completeopt during completion: ${s[s.length-1].trim()}!`)}},this.disposables),this.excludeImages=v.getConfiguration("coc.preferences").get("excludeImageLinksInMarkdownDocument"),this.floating=new Qy(v.nvim,v.env.isVim),O.on(["InsertCharPre","MenuPopupChanged","TextChangedI","CursorMovedI","InsertLeave"],()=>{this.triggerTimer&&(clearTimeout(this.triggerTimer),this.triggerTimer=null)},this,this.disposables),O.on("InsertCharPre",this.onInsertCharPre,this,this.disposables),O.on("InsertLeave",this.onInsertLeave,this,this.disposables),O.on("InsertEnter",this.onInsertEnter,this,this.disposables),O.on("TextChangedP",this.onTextChangedP,this,this.disposables),O.on("TextChangedI",this.onTextChangedI,this,this.disposables);let e=(0,iG.default)(this.onPumChange.bind(this),20);this.disposables.push({dispose:()=>{e.clear()}}),O.on("CompleteDone",async t=>{this.popupEvent=null,!!this.activated&&(e.clear(),this.cancelResolve(),this.floating.close(),await this.onCompleteDone(t))},this,this.disposables),this.cancelResolve(),O.on("MenuPopupChanged",t=>{!this.activated||this.isCommandLine||je(this.popupEvent,t)||(this.cancelResolve(),this.popupEvent=t,e())},this,this.disposables)}get nvim(){return v.nvim}get option(){return this.complete?this.complete.option:null}get selectedItem(){if(!this.popupEvent)return null;let{completed_item:e}=this.popupEvent;return ig(e)?e:null}get isCommandLine(){var e;return(e=this.document)==null?void 0:e.uri.endsWith("%5BCommand%20Line%5D")}get isActivated(){return this.activated}get document(){return this.option?v.getDocument(this.option.bufnr):null}getCompleteConfig(){let e=v.getConfiguration("suggest");function t(a,l){return e.get(a,l)}let i=t("keepCompleteopt",!1),n=t("autoTrigger","always");if(i&&n!="none"){let{completeOpt:a}=v;!a.includes("noinsert")&&!a.includes("noselect")&&(n="none")}let s=v.floatSupported&&t("floatEnable",!0),o=v.env.pumevent&&t("acceptSuggestionOnCommitCharacter",!1);return{autoTrigger:n,floatEnable:s,keepCompleteopt:i,floatConfig:t("floatConfig",{}),defaultSortMethod:t("defaultSortMethod","length"),removeDuplicateItems:t("removeDuplicateItems",!1),disableMenuShortcut:t("disableMenuShortcut",!1),acceptSuggestionOnCommitCharacter:o,disableKind:t("disableKind",!1),disableMenu:t("disableMenu",!1),previewIsKeyword:t("previewIsKeyword","@,48-57,_192-255"),enablePreview:t("enablePreview",!1),enablePreselect:t("enablePreselect",!1),triggerCompletionWait:t("triggerCompletionWait",100),labelMaxLength:t("labelMaxLength",200),triggerAfterInsertEnter:t("triggerAfterInsertEnter",!1),noselect:t("noselect",!0),numberSelect:t("numberSelect",!1),maxItemCount:t("maxCompleteItemCount",50),timeout:t("timeout",500),minTriggerInputLength:t("minTriggerInputLength",1),snippetIndicator:t("snippetIndicator","~"),fixInsertedWord:t("fixInsertedWord",!0),localityBonus:t("localityBonus",!0),highPrioritySourceLimit:t("highPrioritySourceLimit",null),lowPrioritySourceLimit:t("lowPrioritySourceLimit",null),asciiCharactersOnly:t("asciiCharactersOnly",!1)}}async startCompletion(e){this.pretext=zt(e.line,0,e.colnr-1);try{await this._doComplete(e)}catch(t){this.stop(),na.error("Complete error:",t.stack)}}async resumeCompletion(e=!1){let{document:t,complete:i}=this;if(!t||i.isCanceled||!i.results||i.results.length==0)return;let n=this.getResumeInput();if(n==this.input&&!e)return;if(!n||n.endsWith(" ")||!n.startsWith(i.input)){this.stop();return}this.input=n;let s=[];if(i.isIncomplete){await t.patchChange(!0);let{changedtick:o}=t;if(s=await i.completeInComplete(n),i.isCanceled||t.changedtick!=o)return}else s=i.filterResults(n);if(!i.isCompleting&&s.length===0){this.stop();return}await this.showCompletion(i.option.col,s)}hasSelected(){return v.env.pumevent?this.selectedItem!=null:!this.config.noselect}async showCompletion(e,t){let{nvim:i,document:n,option:s}=this,{numberSelect:o,disableKind:a,labelMaxLength:l,disableMenuShortcut:c,disableMenu:u}=this.config,f=this.config.enablePreselect?t.findIndex(p=>p.preselect):-1;o&&s.input.length&&!/^\d/.test(s.input)&&(t=t.map((p,g)=>{let b=g+1;return g<9?Object.assign({},p,{abbr:p.abbr?`${b} ${p.abbr}`:`${b} ${p.word}`}):p}),i.call("coc#_map",[],!0)),this.changedTick=n.changedtick;let d=Yme.slice();a&&(d=d.filter(p=>p!="kind")),u&&(d=d.filter(p=>p!="menu"));let h=t.map(p=>{let g={word:p.word,equal:1};for(let b of d)p.hasOwnProperty(b)&&(c&&b=="menu"?g[b]=p[b].replace(/\[.+\]$/,""):b=="abbr"&&p[b].length>l?g[b]=p[b].slice(0,l):g[b]=p[b]);return g});i.call("coc#_do_complete",[e,h,f],!0)}async _doComplete(e){let{source:t}=e,{nvim:i,config:n}=this,s=v.getDocument(e.bufnr);if(!s||!s.attached)return;e.filetype=s.filetype,this.input=e.input;let o=[];if(t==null)o=ht.getCompleteSources(e);else{let c=ht.getSource(t);c&&o.push(c)}if(!o.length||(await s.patchChange(),s.changedtick!=e.changedtick))return;let a=new Zy(e,s,n,o,i);this.start(a);let l=await this.complete.doComplete();if(!a.isCanceled){if(l.length==0&&!a.isCompleting){this.stop();return}a.onDidComplete(async()=>{if(this.selectedItem!=null)return;let c=this.getResumeInput();if(a.isCanceled||c==null)return;let{input:u}=this.option;if(c==u){let f=a.filterResults(c,Math.floor(Date.now()/1e3));await this.showCompletion(e.col,f)}else await this.resumeCompletion()}),l.length&&(this.getResumeInput()==e.input?await this.showCompletion(e.col,l):await this.resumeCompletion(!0))}}async onTextChangedP(e,t){let{option:i,document:n}=this,s=this.pretext=t.pre;if(!i||i.bufnr!=e||t.changedtick==this.changedTick)return;let o=this.latestInsert!=null;if(this.lastInsert=null,t.pre.match(/^\s*/)[0]!==i.line.match(/^\s*/)[0]){na.warn("Complete stopped by indent change."),this.stop(!1);return}!o||!s||(ht.shouldTrigger(s,n.filetype,n.uri)?await this.triggerCompletion(n,s):await this.resumeCompletion())}async onTextChangedI(e,t){let{nvim:i,latestInsertChar:n,option:s}=this,o=this.pretext==t.pre,a=this.pretext=t.pre;this.lastInsert=null;let l=v.getDocument(e);if(!!l){if(!this.activated){if(!n)return;if(ht.getTriggerSources(a,l.filetype,l.uri).length){await this.triggerCompletion(l,this.pretext);return}this.triggerTimer=setTimeout(async()=>{await this.triggerCompletion(l,a)},this.config.triggerCompletionWait);return}if(!(!s||e!=s.bufnr)){if(s.linenr!=t.lnum||s.col>=t.col-1){this.stop();return}if(o&&!n){this.stop(!1);return}if(a&&this.selectedItem&&this.config.acceptSuggestionOnCommitCharacter&&n){let c=this.getCompleteItem(this.selectedItem),u=a[a.length-1];if(ht.shouldCommit(c,u)){let{linenr:f,col:d,line:h,colnr:p}=this.option;this.stop();let{word:g}=c,b=`${h.slice(0,d)}${g}${n}${h.slice(p-1)}`;await i.call("coc#util#setline",[f,b]);let y=d+g.length+2;await i.call("cursor",[f,y]),await l.patchChange();return}}ht.shouldTrigger(a,l.filetype,l.uri)?await this.triggerCompletion(l,a):await this.resumeCompletion()}}}async triggerCompletion(e,t){if(!e||!e.attached){na.warn("Document not attached, suggest disabled.");return}if(!this.shouldTrigger(e,t))return;if(e.getVar("suggest_disable")){na.warn("Suggest disabled by b:coc_suggest_disable");return}await e.patchChange();let[n,s]=await this.nvim.eval('[get(b:,"coc_suggest_disable",0),coc#util#get_complete_option()]');if(n==1){na.warn("Suggest disabled by b:coc_suggest_disable");return}if(s.blacklist&&s.blacklist.includes(s.input)){na.warn("Suggest disabled by b:coc_suggest_blacklist",s.blacklist);return}t.length&&(s.triggerCharacter=t.slice(-1)),na.debug("trigger completion with",s),await this.startCompletion(s)}async onCompleteDone(e){let{document:t,isActivated:i}=this;if(!i||!t||!ig(e))return;let n=Object.assign({},this.option),s=this.getCompleteItem(e);if(this.stop(),!s)return;let o=this.insertCharTs,a=this.insertLeaveTs,l=new ew.CancellationTokenSource;if(await this.doCompleteResolve(s,l.token),l.dispose(),await bt(50),this.insertCharTs!=o||this.insertLeaveTs!=a)return;let[c,u,f]=await this.nvim.eval("[pumvisible(),line('.'),strpart(getline('.'), 0, col('.') - 1)]");c||u!=n.linenr||this.activated||!f.endsWith(s.word)||(await t.patchChange(!0),await this.doCompleteDone(s,n))}async doCompleteResolve(e,t){let i=ht.getSource(e.source);if(i&&typeof i.onCompleteResolve=="function")try{await Promise.resolve(i.onCompleteResolve(e,t))}catch(n){na.error("Error on complete resolve:",n.stack)}}async doCompleteDone(e,t){let i=JSON.parse(e.user_data),n=ht.getSource(i.source);n&&typeof n.onCompleteDone=="function"&&await Promise.resolve(n.onCompleteDone(e,t))}async onInsertLeave(){this.insertLeaveTs=Date.now(),this.stop(!1)}async onInsertEnter(e){if(!this.config.triggerAfterInsertEnter||this.config.autoTrigger!=="always")return;let t=v.getDocument(e);if(!t)return;let i=await this.nvim.eval("strpart(getline('.'), 0, col('.') - 1)");!i||await this.triggerCompletion(t,i)}async onInsertCharPre(e){this.lastInsert={character:e,timestamp:Date.now()},this.insertCharTs=this.lastInsert.timestamp}get latestInsert(){let{lastInsert:e}=this;return!e||Date.now()-e.timestamp>500?null:e}get latestInsertChar(){let{latestInsert:e}=this;return e?e.character:""}shouldTrigger(e,t){let i=this.config.autoTrigger;if(i=="none")return!1;if(ht.shouldTrigger(t,e.filetype,e.uri))return!0;if(i!=="always"||this.isActivated)return!1;let n=t.slice(-1);if(n&&(e.isWord(t.slice(-1))||n.codePointAt(0)>255)){let s=this.config.minTriggerInputLength;return s==1?!0:this.getInput(e,t).length>=s}return!1}async onPumChange(){if(!this.popupEvent)return;let{col:e,row:t,height:i,width:n,scrollbar:s}=this.popupEvent,o={col:e,row:t,height:i,width:n,scrollbar:s},a=this.getCompleteItem(this.selectedItem);if(!a){this.floating.close();return}let l=this.resolveTokenSource=new ew.CancellationTokenSource,{token:c}=l;if(await this.doCompleteResolve(a,c),this.resolveTokenSource==l&&(this.resolveTokenSource=null),l.dispose(),c.isCancellationRequested)return;let u=a.documentation;if(!u&&a.info){let{info:f}=a;u=[{filetype:/^[\w-\s.,\t]+$/.test(f)?"txt":this.document.filetype,content:f}]}if(!u||u.length==0)this.floating.close();else{if(this.config.floatEnable){let f=new ew.CancellationTokenSource;await this.floating.show(u,o,Object.assign({},this.config.floatConfig,{excludeImages:this.excludeImages}),f.token)}this.isActivated||this.floating.close()}}start(e){let{activated:t}=this;this.activated=!0,t&&this.complete.dispose(),this.complete=e,this.config.keepCompleteopt||this.nvim.command(`noa set completeopt=${this.completeOpt}`,!0)}cancelResolve(){this.resolveTokenSource&&(this.resolveTokenSource.cancel(),this.resolveTokenSource=null)}stop(e=!0){let{nvim:t}=this;!this.activated||(this.cancelResolve(),this.floating.close(),this.activated=!1,this.complete&&(this.complete.dispose(),this.complete=null),t.pauseNotification(),e&&t.call("coc#_hide",[],!0),this.config.numberSelect&&t.call("coc#_unmap",[],!0),this.config.keepCompleteopt||t.command(`noa set completeopt=${v.completeOpt}`,!0),t.command("let g:coc#_context = {'start': 0, 'preselect': -1,'candidates': []}",!0),t.resumeNotification(!1,!0))}getInput(e,t){let i="";for(let n=t.length-1;n>=0;n--){let s=n==0?null:t[n-1];if(!s||!e.isWord(s)){i=t.slice(n,t.length);break}}return i}getResumeInput(){let{option:e,pretext:t}=this;if(!e)return null;let i=Buffer.from(t,"utf8");if(i.length<e.col)return null;let n=i.slice(e.col).toString("utf8");return e.blacklist&&e.blacklist.includes(n)?null:n}get completeOpt(){let{noselect:e,enablePreview:t}=this.config,i=t&&!v.env.pumevent?",preview":"";return e?`noselect,menuone${i}`:`noinsert,menuone${i}`}getCompleteItem(e){return!this.complete||!ig(e)?null:this.complete.resolveCompletionItem(e)}dispose(){this.resolveTokenSource=null,G(this.disposables)}},sa=new rG});var Ys,s3e,LD,nG=R(()=>{Ys=E(H());Uc();Vt();uv();yt();s3e=U()("snippets-snipet"),LD=class{constructor(e,t,i){this._snippetString=e;this.position=t;this._variableResolver=i;this._parser=new Fo}async init(){let e=this._parser.parse(this._snippetString,!0),{_variableResolver:t}=this;t&&await e.resolveVariables(t),this.tmSnippet=e,this.update()}adjustPosition(e,t){let{line:i,character:n}=this.position;this.position={line:i+t,character:n+e},this.update()}adjustTextEdit(e){let{range:t,newText:i}=e;if(De(this.range.start,t.end)<0||!i.includes(`
`)&&De(t.start,t.end)==0&&De(this.range.start,t.start)==0&&this._placeholders.findIndex(o=>De(o.range.start,t.start)==0)!==-1)return!1;let n=y0(this.range.start,e);return n.line==0&&n.character==0||this.adjustPosition(n.character,n.line),!0}get isPlainText(){return this._placeholders.length>1?!1:this._placeholders.every(e=>e.value=="")}get finalCount(){return this._placeholders.filter(e=>e.isFinalTabstop).length}toString(){return this.tmSnippet.toString()}get range(){let{position:e}=this,t=this.tmSnippet.toString(),n=_i.create("untitled:/1","snippet",0,t).positionAt(t.length),s=n.line==0?e.character+n.character:n.character;return Ys.Range.create(e,Ys.Position.create(e.line+n.line,s))}get firstPlaceholder(){let e=0;for(let t of this._placeholders)t.index!=0&&(e==0||t.index<e)&&(e=t.index);return this.getPlaceholder(e)}get lastPlaceholder(){let e=0;for(let t of this._placeholders)(e==0||t.index>e)&&(e=t.index);return this.getPlaceholder(e)}getPlaceholderById(e){return this._placeholders.find(t=>t.id==e)}getPlaceholder(e){let t=this._placeholders.filter(n=>n.index==e),i=t.filter(n=>!n.transform);return i.length?i[0]:t[0]}getPrevPlaceholder(e){if(e==0)return this.lastPlaceholder;let t=this.getPlaceholder(e-1);return t||this.getPrevPlaceholder(e-1)}getNextPlaceholder(e){let t=this._placeholders.map(s=>s.index),i=Math.max.apply(null,t);if(e>=i)return this.finalPlaceholder;let n=this.getPlaceholder(e+1);return n||this.getNextPlaceholder(e+1)}get finalPlaceholder(){return this._placeholders.find(e=>e.isFinalTabstop)}getPlaceholderByRange(e){return this._placeholders.find(t=>Cn(e,t.range))}insertSnippet(e,t,i){let{start:n}=e.range,s=Ys.Position.create(i.start.line-n.line,i.start.line==n.line?i.start.character-n.character:i.start.character),o=Ys.Position.create(i.end.line-n.line,i.end.line==n.line?i.end.character-n.character:i.end.character),a=Ys.Range.create(s,o),l=this.tmSnippet.insertSnippet(t,e.id,a);return this.update(),l}updatePlaceholder(e,t){let{range:i}=this,{value:n,id:s,index:o}=e,a=F$(e.range,n,t),l=0;if(!a.includes(`
`)){for(let f of this._placeholders)if(f.index==o&&f.id<s&&f.line==e.range.start.line){let d=this.tmSnippet.getPlaceholderText(f.id,a);l=l+re(d)-re(f.value)}}e.isVariable?this.tmSnippet.updateVariable(s,a):this.tmSnippet.updatePlaceholder(s,a);let c=L$(i.end,t),u={range:Ys.Range.create(i.start,c),newText:this.tmSnippet.toString()};return this.update(),{edits:[u],delta:l}}update(){let e=this.tmSnippet,{line:t,character:i}=this.position,n=_i.create("untitled:/1","snippet",0,e.toString()),{placeholders:s,variables:o,maxIndexNumber:a}=e,l=new Map,c=a+1;this._placeholders=[...s,...o].map((u,f)=>{let d=e.offset(u),h=n.positionAt(d),p={line:t+h.line,character:h.line==0?i+h.character:h.character},g;if(u instanceof Yn){let w=u.name;l.has(w)?g=l.get(w):(l.set(w,c),g=c,c=c+1)}else g=u.index;let b=u.toString(),y=b.split(/\r?\n/),S={range:Ys.Range.create(p,{line:p.line+y.length-1,character:y.length==1?p.character+b.length:y[y.length-1].length}),transform:u.transform!=null,line:p.line,id:f,index:g,value:b,isVariable:u instanceof Yn,isFinalTabstop:u.index===0};if(Object.defineProperty(S,"snippet",{enumerable:!1}),u instanceof Er&&u.choice){let{options:w}=u.choice;w&&w.length&&(S.choice=w.map(_=>_.value))}return S})}}});var hp,l3e,pp,AD=R(()=>{hp=E(require("path"));Te();l3e=U()("snippets-variable"),pp=class{constructor(){this._variableToValue={};let e=new Date;Object.assign(this._variableToValue,{CURRENT_YEAR:e.getFullYear().toString(),CURRENT_YEAR_SHORT:e.getFullYear().toString().slice(-2),CURRENT_MONTH:(e.getMonth()+1).toString(),CURRENT_DATE:e.getDate().toString(),CURRENT_HOUR:e.getHours().toString(),CURRENT_MINUTE:e.getMinutes().toString(),CURRENT_SECOND:e.getSeconds().toString(),CURRENT_DAY_NAME:e.toLocaleString("en-US",{weekday:"long"}),CURRENT_DAY_NAME_SHORT:e.toLocaleString("en-US",{weekday:"short"}),CURRENT_MONTH_NAME:e.toLocaleString("en-US",{month:"long"}),CURRENT_MONTH_NAME_SHORT:e.toLocaleString("en-US",{month:"short"}),TM_FILENAME:null,TM_FILENAME_BASE:null,TM_DIRECTORY:null,TM_FILEPATH:null,YANK:null,TM_LINE_INDEX:null,TM_LINE_NUMBER:null,TM_CURRENT_LINE:null,TM_CURRENT_WORD:null,TM_SELECTED_TEXT:null,CLIPBOARD:null})}async resolveValue(e){let{nvim:t}=D;if(["TM_FILENAME","TM_FILENAME_BASE","TM_DIRECTORY","TM_FILEPATH"].includes(e)){let i=await t.eval('expand("%:p")');if(e=="TM_FILENAME")return hp.default.basename(i);if(e=="TM_FILENAME_BASE")return hp.default.basename(i,hp.default.extname(i));if(e=="TM_DIRECTORY")return hp.default.dirname(i);if(e=="TM_FILEPATH")return i}if(e=="YANK")return await t.call("getreg",['""']);if(e=="TM_LINE_INDEX")return(await t.call("line",["."])-1).toString();if(e=="TM_LINE_NUMBER")return(await t.call("line",["."])).toString();if(e=="TM_CURRENT_LINE")return await t.call("getline",["."]);if(e=="TM_CURRENT_WORD")return await t.eval("expand('<cword>')");if(e=="TM_SELECTED_TEXT")return await t.eval("get(g:,'coc_selected_text', '')");if(e=="CLIPBOARD")return await t.eval("@*")}async resolve(e){let t=e.name,i=this._variableToValue[t];if(i!=null)return i.toString();let n=await this.resolveValue(t);return n||(e.children&&e.children.length?e.toString():this._variableToValue.hasOwnProperty(t)?"":t)}}});function sG(r){let{range:e,newText:t}=r;return e.start.line==e.end.line&&t.indexOf(`
`)==-1}var oG=R(()=>{});function Xme(r,e,t){let i=r.split(/\r?\n/),n=t.insertSpaces?" ".repeat(t.tabSize):" ",s=t.tabSize||2;return i=i.map((o,a)=>{let l=o.match(/^\s*/)[0],c=l,u=l.startsWith(" ");return u&&t.insertSpaces?c=n.repeat(l.length):!u&&!t.insertSpaces&&(c=n.repeat(l.length/s)),(a==0||o.length==0?"":e)+c+o.slice(l.length)}),i.join(`
`)}var Xs,Zu,FD,aG=R(()=>{Xs=E(H());OD();Vt();yt();Y();Te();_e();nG();AD();oG();Zu=U()("snippets-session"),FD=class{constructor(e,t){this.nvim=e;this.bufnr=t;this._isActive=!1;this._currId=0;this.applying=!1;this.preferComplete=!1;this._snippet=null;this._onCancelEvent=new Xs.Emitter;this.onCancel=this._onCancelEvent.event;let i=v.getConfiguration("suggest");this.preferComplete=i.get("preferCompleteThanJumpPlaceholder",!1)}async start(e,t=!0,i,n){let{document:s}=this;if(!s||!s.attached)return!1;if(O.fire("InsertSnippet",[]),!i){let p=await D.getCursorPosition();i=Xs.Range.create(p,p)}let o=i.start,a=await v.getFormatOptions(this.document.uri);await s.patchChange(!0);let l=s.getline(o.line),c=l.match(/^\s*/)[0],u="";n===Xs.InsertTextMode.asIs?u=e:u=Xme(e,c,a);let f=new pp,d=new LD(u,o,f);await d.init();let h=Xs.TextEdit.replace(i,d.toString());if(e.endsWith(`
`)&&l.slice(o.character).length&&(h.newText=h.newText+c,u=u+c),this.applying=!0,await s.applyEdits([h]),this.applying=!1,this._isActive){let p=this.findPlaceholder(i);if(p&&!p.isFinalTabstop){let g=this.snippet.insertSnippet(p,u,i),b=this.snippet.getPlaceholder(g);return this._currId=b.id,t&&await this.selectPlaceholder(b),!0}}if(d.isPlainText){this.deactivate();let p=d.finalPlaceholder;return await D.moveTo(p.range.start),!1}return this._snippet=d,this._currId=d.firstPlaceholder.id,t&&await this.selectPlaceholder(d.firstPlaceholder),this.activate(),!0}activate(){this._isActive||(this._isActive=!0,this.nvim.call("coc#snippet#enable",[],!0))}deactivate(){this._isActive&&(this._isActive=!1,this._snippet=null,this.nvim.call("coc#snippet#disable",[],!0),Zu.debug("[SnippetManager::cancel]")),this._onCancelEvent.fire(void 0),this._onCancelEvent.dispose()}get isActive(){return this._isActive}async nextPlaceholder(){if(!this.isActive)return;await this.document.patchChange();let e=this.placeholder,t=this.snippet.getNextPlaceholder(e.index);await this.selectPlaceholder(t)}async previousPlaceholder(){if(!this.isActive)return;await this.document.patchChange();let e=this.placeholder,t=this.snippet.getPrevPlaceholder(e.index);await this.selectPlaceholder(t)}async synchronizeUpdatedPlaceholders(e,t){if(!this.isActive||!this.document||this.applying)return;let i={range:e.range,newText:e.text},{snippet:n}=this;if(n.adjustTextEdit(i))return;let o=this.placeholder.range;if(t!=null&&sG(i)&&!Cn(i.range,o)&&b0(o)&&t.slice(o.start.character,o.end.character)==this.placeholder.value&&O.cursor&&O.cursor.bufnr==this.bufnr&&O.cursor.lnum==i.range.start.line+1){let u=O.cursor.col,f=t.slice(0,o.start.character),d=t.slice(o.end.character),h=this.document.getline(i.range.start.line);if(h.startsWith(f)&&h.endsWith(d)){let p=h.length-d.length,g=za(h,u-1);if(g>=f.length&&g<=p){let b=h.slice(f.length,p);i=Xs.TextEdit.replace(o,b)}}}if(De(i.range.start,n.range.end)>0){if(!i.newText)return;Zu.info("Content change after snippet, cancelling snippet session"),this.deactivate();return}let a=this.findPlaceholder(i.range);if(!a){Zu.info("Change outside placeholder, cancelling snippet session"),this.deactivate();return}if(a.isFinalTabstop&&n.finalCount<=1){Zu.info("Change final placeholder, cancelling snippet session"),this.deactivate();return}this._currId=a.id;let{edits:l,delta:c}=n.updatePlaceholder(a,i);!l.length||(this.applying=!0,await this.document.applyEdits(l),this.applying=!1,c&&await this.nvim.call("coc#cursor#move_by_col",c))}async selectCurrentPlaceholder(e=!0){let t=this.snippet.getPlaceholderById(this._currId);t&&await this.selectPlaceholder(t,e)}async selectPlaceholder(e,t=!0){let{nvim:i,document:n}=this;if(!n||!e)return;let{start:s,end:o}=e.range,a=o.character-s.character,l=re(n.getline(s.line).slice(0,s.character))+1;this._currId=e.id,e.choice?(await i.call("coc#snippet#show_choices",[s.line+1,l,a,e.choice]),t&&i.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0)):await this.select(e,t)}async select(e,t=!0){let{range:i,value:n,isFinalTabstop:s}=e,{document:o,nvim:a}=this,{start:l,end:c}=i,{textDocument:u}=o,f=u.offsetAt(c)-u.offsetAt(l),d=o.getline(l.line),h=d?re(d.slice(0,l.character)):0,p=o.getline(c.line),g=p?re(p.slice(0,c.character)):0;a.setVar("coc_last_placeholder",{bufnr:o.bufnr,current_text:n,start:{line:l.line,col:h,character:l.character},end:{line:c.line,col:g,character:c.character}},!0);let[b,y,S,w]=await a.eval("[&virtualedit, &selection, pumvisible(), mode()]"),_="";if(S&&this.preferComplete){let L=sa.hasSelected()?"":"\\<C-n>";await a.eval(`feedkeys("${L}\\<C-y>", 'in')`);return}w!="n"&&(_+="\\<Esc>"),f==0?h==0||!w.startsWith("i")&&h<re(d)?_+="i":_+="a":(_+="v",g=await this.getVirtualCol(c.line+1,g),y=="inclusive"?c.character==0?_+=`${c.line}G`:_+=`${c.line+1}G${g}|`:y=="old"?_+=`${c.line+1}G${g}|`:_+=`${c.line+1}G${g+1}|`,h=await this.getVirtualCol(l.line+1,h),_+=`o${l.line+1}G${h+1}|o\\<c-g>`),w=="i"&&_=="\\<Esc>a"&&(_=""),a.pauseNotification(),a.setOption("virtualedit","onemore",!0),a.call("cursor",[l.line+1,h+(_=="a"?0:1)],!0),_&&a.call("eval",[`feedkeys("${_}", 'in')`],!0),w=="i"&&a.call("coc#_cancel",[],!0),a.setOption("virtualedit",b,!0),s&&(this.snippet.finalCount==1?(Zu.info("Jump to final placeholder, cancelling snippet session"),this.deactivate()):a.call("coc#snippet#disable",[],!0)),v.env.isVim&&a.command("redraw",!0),await a.resumeNotification(),t&&a.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0)}async getVirtualCol(e,t){let{nvim:i}=this;return await i.eval(`virtcol([${e}, ${t}])`)}async checkPosition(){if(!this.isActive)return;let e=await D.getCursorPosition();this.snippet&&Ft(e,this.snippet.range)!=0&&(Zu.info("Cursor insert out of range, cancelling snippet session"),this.deactivate())}findPlaceholder(e){if(!this.snippet)return null;let{placeholder:t}=this;return t&&Cn(e,t.range)?t:this.snippet.getPlaceholderByRange(e)||null}get placeholder(){return this.snippet?this.snippet.getPlaceholderById(this._currId):null}get snippet(){return this._snippet}get document(){return v.getDocument(this.bufnr)}}});var I3e,lG,vi,Yu=R(()=>{_e();Y();Te();uv();aG();AD();PD();I3e=U()("snippets-manager"),lG=class{constructor(){this.sessionMap=new Map;this.disposables=[];v.onDidChangeTextDocument(async e=>{let t=this.getSession(e.bufnr);if(t){let i=e.originalLines[e.contentChanges[0].range.start.line]||"";await t.synchronizeUpdatedPlaceholders(e.contentChanges[0],i)}},null,this.disposables),v.onDidCloseTextDocument(e=>{let t=v.getDocument(e.uri);if(!t)return;let i=this.getSession(t.bufnr);i&&i.deactivate()},null,this.disposables),O.on("BufEnter",async e=>{let t=this.getSession(e);!this.statusItem||(t&&t.isActive?this.statusItem.show():this.statusItem.hide())},null,this.disposables),O.on("InsertEnter",async()=>{let{session:e}=this;!e||await e.checkPosition()},null,this.disposables)}init(){let e=v.getConfiguration("coc.preferences");this.statusItem=D.createStatusBarItem(0),this.statusItem.text=e.get("snippetStatusText","SNIP")}async insertSnippet(e,t=!0,i,n){let{bufnr:s}=v,o=this.getSession(s);o||(o=new FD(v.nvim,s),this.sessionMap.set(s,o),o.onCancel(()=>{this.sessionMap.delete(s),v.bufnr==s&&this.statusItem.hide()}));let a=Nn.isSnippetString(e)?e.value:e,l=await o.start(a,t,i,n);return l&&this.statusItem.show(),l}async selectCurrentPlaceholder(e=!0){let{session:t}=this;if(t)return await t.selectCurrentPlaceholder(e)}async nextPlaceholder(){let{session:e}=this;return e?await e.nextPlaceholder():(v.nvim.call("coc#snippet#disable",[],!0),this.statusItem.hide()),""}async previousPlaceholder(){let{session:e}=this;return e?await e.previousPlaceholder():(v.nvim.call("coc#snippet#disable",[],!0),this.statusItem.hide()),""}cancel(){let e=this.getSession(v.bufnr);if(e)return e.deactivate();v.nvim.call("coc#snippet#disable",[],!0),this.statusItem&&this.statusItem.hide()}get session(){let e=this.getSession(v.bufnr);return e&&e.isActive?e:null}isActived(e){let t=this.getSession(e);return!!(t&&t.isActive)}jumpable(){let{session:e}=this;if(!e)return!1;let t=e.placeholder;return!!(t&&!t.isFinalTabstop)}getSession(e){return this.sessionMap.get(e)}async resolveSnippet(e){let i=new Fo().parse(e,!0),n=new pp;return await i.resolveVariables(n),i}dispose(){this.cancel();for(let e of this.disposables)e.dispose()}},vi=new lG});var tw,z3e,cG,uG,se,Ei=R(()=>{tw=E(H());qe();Xa();Yu();de();Y();Te();z3e=U()("commands"),cG=class{constructor(e,t,i,n=!1){this.id=e;this.impl=t;this.thisArg=i;this.internal=n}execute(...e){let{impl:t,thisArg:i}=this;return t.apply(i,e||[])}dispose(){this.thisArg=null,this.impl=null}},uG=class{constructor(){this.commands=new Map;this.titles=new Map;this.onCommandList=[]}init(e,t){this.mru=v.createMru("commands"),this.register({id:"vscode.open",execute:async i=>{e.call("coc#util#open_url",i.toString(),!0)}},!0),this.register({id:"workbench.action.reloadWindow",execute:async()=>{await e.command("edit")}},!0),this.register({id:"editor.action.insertSnippet",execute:async i=>(e.call("coc#_cancel",[],!0),await vi.insertSnippet(i.newText,!0,i.range))},!0),this.register({id:"editor.action.doCodeAction",execute:async i=>{await t.cocAction("doCodeAction",i)}},!0),this.register({id:"editor.action.triggerSuggest",execute:async()=>{await bt(60),e.call("coc#start",[],!0)}},!0),this.register({id:"editor.action.triggerParameterHints",execute:async()=>{await bt(60),await t.cocAction("showSignatureHelp")}},!0),this.register({id:"editor.action.addRanges",execute:async i=>{await t.cocAction("addRanges",i)}},!0),this.register({id:"editor.action.restart",execute:async()=>{await bt(30),e.command("CocRestart",!0)}},!0),this.register({id:"editor.action.showReferences",execute:async(i,n,s)=>{await v.showLocations(s)}},!0),this.register({id:"editor.action.rename",execute:async(i,n)=>{await v.jumpTo(i,n),await t.cocAction("rename")}},!0),this.register({id:"editor.action.format",execute:async()=>{await t.cocAction("format")}},!0),this.register({id:"workspace.clearWatchman",execute:async()=>{(await D.runTerminalCommand("watchman watch-del-all")).success&&D.showMessage("Cleared watchman watching directories.")}},!1,"run watch-del-all for watchman to free up memory."),this.register({id:"workspace.workspaceFolders",execute:async()=>{let n=v.workspaceFolders.map(s=>B.parse(s.uri).fsPath);await D.echoLines(n)}},!1,"show opened workspaceFolders."),this.register({id:"workspace.renameCurrentFile",execute:async()=>{await v.renameCurrent()}},!1,"change current filename to a new name and reload it."),this.register({id:"extensions.toggleAutoUpdate",execute:async()=>{let i=v.getConfiguration("coc.preferences");i.get("extensionUpdateCheck","daily")=="never"?(i.update("extensionUpdateCheck","daily",!0),D.showMessage("Extension auto update enabled.","more")):(i.update("extensionUpdateCheck","never",!0),D.showMessage("Extension auto update disabled.","more"))}},!1,"toggle auto update of extensions."),this.register({id:"workspace.diagnosticRelated",execute:()=>Lt.jumpRelated()},!1,"jump to related locations of current diagnostic."),this.register({id:"workspace.showOutput",execute:async i=>{if(i)D.showOutputChannel(i);else{let n=v.channelNames;if(n.length==0)return;if(n.length==1)D.showOutputChannel(n[0]);else{let s=await D.showQuickpick(n);if(s==-1)return;let o=n[s];D.showOutputChannel(o)}}}},!1,"open output buffer to show output from languageservers or extensions."),this.register({id:"document.showIncomingCalls",execute:async()=>{await t.cocAction("showIncomingCalls")}},!1,"show incoming calls in tree view."),this.register({id:"document.showOutgoingCalls",execute:async()=>{await t.cocAction("showOutgoingCalls")}},!1,"show outgoing calls in tree view."),this.register({id:"document.echoFiletype",execute:async()=>{let i=await e.call("bufnr","%"),n=v.getDocument(i);!n||await D.echoLines([n.filetype])}},!1,"echo the mapped filetype of the current buffer"),this.register({id:"document.renameCurrentWord",execute:async()=>{let i=await e.call("bufnr","%"),n=v.getDocument(i);if(!n)return;let s=await t.cocAction("getWordEdit");if(!s){D.showMessage("Invalid position","warning");return}let o=[],{changes:a,documentChanges:l}=s;if(a){let c=a[n.uri];c&&(o=c.map(u=>u.range))}else if(l)for(let c of l)tw.TextDocumentEdit.is(c)&&c.textDocument.uri==n.uri&&(o=c.edits.map(u=>u.range));o.length&&await t.cocAction("addRanges",o)}},!1,"rename word under cursor in current buffer by use multiple cursors."),this.register({id:"document.jumpToNextSymbol",execute:async()=>{let i=await v.document;if(!i)return;let n=await t.cocAction("symbolRanges");if(!n)return;let{textDocument:s}=i,o=await D.getOffset();n.sort((a,l)=>a.start.line!=l.start.line?a.start.line-l.start.line:a.start.character-l.start.character);for(let a=0;a<=n.length-1;a++)if(s.offsetAt(n[a].start)>o){await D.moveTo(n[a].start);return}await D.moveTo(n[0].start)}},!1,"Jump to next symbol highlight position."),this.register({id:"workspace.openLocation",execute:async(i,n,s)=>{i&&await e.call("win_gotoid",[i]),await v.jumpTo(n.uri,n.range.start,s)}},!0),this.register({id:"document.jumpToPrevSymbol",execute:async()=>{let i=await v.document;if(!i)return;let n=await t.cocAction("symbolRanges");if(!n)return;let{textDocument:s}=i,o=await D.getOffset();n.sort((a,l)=>a.start.line!=l.start.line?a.start.line-l.start.line:a.start.character-l.start.character);for(let a=n.length-1;a>=0;a--)if(s.offsetAt(n[a].end)<o){await D.moveTo(n[a].start);return}await D.moveTo(n[n.length-1].start)}},!1,"Jump to previous symbol highlight position.")}get commandList(){let e=[];for(let t of this.commands.values())t.internal||e.push(t);return e}dispose(){for(let e of this.commands.values())e.dispose();this.commands.clear()}execute(e){let t=[e.command],i=e.arguments;return i&&t.push(...i),this.executeCommand.apply(this,t)}register(e,t=!1,i){for(let n of Array.isArray(e.id)?e.id:[e.id])this.registerCommand(n,e.execute,e,t),i&&this.titles.set(n,i);return e}has(e){return this.commands.has(e)}unregister(e){let t=this.commands.get(e);!t||(t.dispose(),this.commands.delete(e))}registerCommand(e,t,i,n=!1){return e.startsWith("_")&&(n=!0),this.commands.set(e,new cG(e,t,i,n)),tw.Disposable.create(()=>{this.commands.delete(e)})}executeCommand(e,...t){let i=this.commands.get(e);if(!i)throw new Error(`Command: ${e} not found`);return Promise.resolve(i.execute.apply(i,t))}async addRecent(e){await this.mru.add(e),await v.nvim.command('silent! call repeat#set("\\<Plug>(coc-command-repeat)", -1)')}async repeatCommand(){let t=(await this.mru.load())[0];t&&(await this.executeCommand(t),await v.nvim.command('silent! call repeat#set("\\<Plug>(coc-command-repeat)", -1)'))}},se=new uG});var Y3e,mp,fG=R(()=>{Ps();Vt();Y3e=U()("cursors-range"),mp=class{constructor(e,t,i,n,s){this.line=e;this.start=t;this.end=i;this.text=n;this.preCount=s;this.currStart=t,this.currEnd=i}add(e,t){let{text:i,preCount:n}=this,s=e==0?"":i.slice(0,e),o=i.slice(e);this.text=`${s}${t}${o}`,this.currStart=this.currStart+n*t.length,this.currEnd=this.currEnd+(n+1)*t.length}replace(e,t,i=""){let{text:n,preCount:s}=this,o=e==0?"":n.slice(0,e),a=n.slice(t);this.text=o+i+a;let l=t-e-i.length;this.currStart=this.currStart-s*l,this.currEnd=this.currEnd-(s+1)*l}get range(){return Ae.create(this.line,this.start,this.line,this.end)}get currRange(){return Ae.create(this.line,this.currStart,this.line,this.currEnd)}applyEdit(e){let{range:t,newText:i}=e,n=t.start.character,s=t.end.character;n==s?this.add(n-this.currStart,i):this.replace(n-this.currStart,s-this.currStart,i)}adjustFromEdit(e){let{range:t,newText:i}=e;if(De(t.start,Sr.create(this.line,this.currEnd))>0)return;let n=i.split(`
`),s=n.length-(t.end.line-t.start.line+1);if(this.line=this.line+s,t.end.line==this.line){let o=t.start.line==t.end.line?t.end.character-t.start.character:t.end.character;n.length>1&&t.start.line==t.end.line&&(o=o+t.start.character);let a=0;n.length>1?a=n[n.length-1].length:t.start.line==t.end.line?a=i.length:a=t.start.character+i.length;let l=a-o;for(let c of["start","end","currStart","currEnd"])this[c]+=l}}sync(){this.start=this.currStart,this.end=this.currEnd}get textEdit(){return{range:this.range,newText:this.text}}}});function MD(r,e){let t=[];for(let i=e.start.line;i<=e.end.line;i++){let n=r.getline(i)||"",s=i==e.start.line?e.start.character:0,o=i==e.end.line?e.end.character:n.length;s!=o&&t.push(gp.Range.create(i,s,i,o))}return t}function dG(r,e){let{start:t,end:i}=e;t.line>i.line&&([t,i]=[i,t]);let n=t.character<i.character?t.character:i.character,s=t.character<i.character?i.character:t.character,o=[];for(let a=t.line;a<=i.line;a++){let l=r.getline(a);o.push(gp.Range.create(a,n,a,Math.min(l.length,s)))}return o}function ND(r,e){let{line:t,character:i}=e;return gp.Position.create(r.line+t,t==0?r.character+i:i)}function hG(r,e){if(r.newText.length!=e.newText.length)return!1;let{range:t}=r;return t.end.character-t.start.character==e.range.end.character-e.range.start.character}var gp,qD=R(()=>{gp=E(H())});var Qu,ef,uze,iw,pG=R(()=>{Qu=E(jc()),ef=E(H());Uc();_e();Vt();Te();Y();fG();qD();uze=U()("cursors-session"),iw=class{constructor(e,t,i){this.nvim=e;this.doc=t;this.config=i;this._onDidCancel=new ef.Emitter;this.onDidCancel=this._onDidCancel.event;this.disposables=[];this.ranges=[];this.activated=!0;this.changing=!1;this.changed=!1;this.textDocument=this.doc.textDocument,this.buffer.setVar("coc_cursors_activated",1,!0);let{cancelKey:n,nextKey:s,previousKey:o}=this.config;this.disposables.push(v.registerLocalKeymap("n",n,()=>{this.cancel()},!0)),this.disposables.push(v.registerLocalKeymap("n",s,async()=>{if(!this.activated)return;let a=this.ranges.map(c=>c.currRange),l=await D.getCursorPosition();for(let c of a)if(De(c.start,l)>0){await D.moveTo(c.start);return}a.length&&await D.moveTo(a[0].start)},!0)),this.disposables.push(v.registerLocalKeymap("n",o,async()=>{if(!this.activated)return;let a=this.ranges.map(c=>c.currRange);a.reverse();let l=await D.getCursorPosition();for(let c of a)if(De(c.end,l)<0){await D.moveTo(c.start);return}a.length&&await D.moveTo(a[a.length-1].start)},!0)),this.doc.onDocumentChange(this.onChange,this,this.disposables)}async onChange(e){if(!this.activated||this.ranges.length==0||this.changing)return;let t=e.contentChanges[0],{text:i,range:n}=t,s=this.ranges.some(l=>qc(n,l.currRange)),o=this.ranges[0].currRange.start;if(i.endsWith(`
`)&&De(o,n.end)==0&&(s=!1),!s){this.ranges.forEach(l=>{l.adjustFromEdit({range:n,newText:i})}),this.doHighlights(),this.textDocument=this.doc.textDocument;return}this.changed=!0;let a=this.getTextRange(n,i);a?await this.applySingleEdit(a,{range:n,newText:i}):(this.applyComposedEdit(e.original,{range:n,newText:i}),this.activated&&(this.ranges.forEach(l=>{l.sync()}),this.textDocument=this.doc.textDocument))}doHighlights(){let{nvim:e,buffer:t,ranges:i}=this;t.clearNamespace("cursors");let n=i.map(s=>s.currRange);t.highlightRanges("cursors","CocCursorRange",n),e.command("redraw",!0)}addRanges(e){let{nvim:t,doc:i}=this;if(this.changed)return D.showMessage("Can't add ranges after range change."),!1;this.ranges=this.ranges.filter(a=>{let{currRange:l}=a;return!e.some(c=>dg(c,l))});let{textDocument:n}=i;for(let a of e){let{line:l}=a.start,c=new mp(l,a.start.character,a.end.character,n.getText(a),0);this.ranges.push(c)}this.ranges.sort((a,l)=>De(a.range.start,l.range.start));let s=0,o=-1;for(let a of this.ranges){let{line:l}=a;l!=o&&(s=0),a.preCount=s,s=s+1,o=l}return t.pauseNotification(),this.doHighlights(),t.resumeNotification(!1,!0),!0}cancel(){if(!this.activated)return;let{nvim:e}=this;this.activated=!1;let{cancelKey:t,nextKey:i,previousKey:n}=this.config;e.pauseNotification(),this.buffer.clearNamespace("cursors"),this.buffer.setVar("coc_cursors_activated",0,!0),e.command("redraw",!0),e.resumeNotification(!1,!0),this._onDidCancel.fire()}dispose(){if(!!this.doc){this._onDidCancel.dispose();for(let e of this.disposables)e.dispose();this.ranges=[],this.doc=null,this.textDocument=null}}get buffer(){return this.nvim.createBuffer(this.doc.bufnr)}getTextRange(e,t){let{ranges:i}=this;if(t.indexOf(`
`)!==-1||e.start.line!=e.end.line)return null;i.sort((n,s)=>n.line!=s.line?n.line-s.line:n.currRange.start.character-s.currRange.start.character);for(let n=0;n<i.length;n++){let s=i[n];if(Cn(e,s.currRange))return s;if(s.line==e.start.line&&t.length&&e.start.character==s.currRange.end.character){let o=i[n+1];return o&&Ft(o.currRange.start,e)?null:s}}return null}adjustRanges(e,t,i){let{ranges:n}=this;if(t.start.character==t.end.character)if(e.currRange.end.character==t.start.character)n.forEach(o=>{o.add(o.text.length,i)});else{let o=t.start.character-e.currRange.start.character;n.forEach(a=>{a.add(Math.min(a.text.length,o),i)})}else{let s=t.end.character-t.start.character;if(e.currRange.end.character==t.end.character)if(e.currRange.start.character==t.start.character)if(i.includes(e.text)){let a=i.indexOf(e.text),l=a==0?"":i.slice(0,a),c=i.slice(a+e.text.length);l&&n.forEach(u=>u.add(0,l)),c&&n.forEach(u=>u.add(u.text.length,c))}else if(e.text.includes(i)){let a=e.text.indexOf(i),l=e.text.length-(a+i.length);a!=0&&n.forEach(c=>c.replace(0,a)),l>0&&n.forEach(c=>c.replace(c.text.length-l,c.text.length))}else this.cancel();else n.forEach(a=>{let l=a.text.length;a.replace(Math.max(0,l-s),l,i)});else{let a=t.start.character-e.currRange.start.character;n.forEach(l=>{let c=l.text.length;l.replace(a,Math.min(a+s,c),i)})}}}addRange(e,t){if(this.changed){D.showMessage("Can't add range after range change.");return}let{ranges:i}=this,n=i.findIndex(s=>qc(s.range,e));if(n!==-1){i.splice(n,1);for(let s of i)s.line==e.start.line&&s.start>e.start.character&&(s.preCount=s.preCount-1)}else{let s=0,o=0,{line:a}=e.start;for(let c of i){if(c.line>a||c.line==a&&c.start>e.end.character)break;c.line==a&&s++,o++}let l=new mp(a,e.start.character,e.end.character,t,s);i.splice(o,0,l);for(let c of i)c.line==e.start.line&&c.start>e.start.character&&(c.preCount=c.preCount+1)}this.ranges.length==0?this.cancel():this.doHighlights()}async applySingleEdit(e,t){let{range:i,newText:n}=t,{doc:s}=this;if(this.adjustRanges(e,i,n),this.ranges.length==1){this.doHighlights();return}let o=this.ranges.map(h=>h.textEdit),l=_i.applyEdits(this.textDocument,o).split(`
`),c=new Set,u=[];for(let h of this.ranges)c.has(h.line)||(c.add(h.line),u.push([h.line,l[h.line]]));let{nvim:f}=this;this.changing=!0,await s.changeLines(u),this.changing=!1,this.activated&&(this.ranges.forEach(h=>{h.sync()}),this.textDocument=this.doc.textDocument),f.pauseNotification();let{cursor:d}=O;if(e.preCount>0&&d.bufnr==s.bufnr&&e.line+1==d.lnum){let h=e.preCount*(n.length-(i.end.character-i.start.character));f.call("cursor",[d.lnum,d.col+h],!0)}this.doHighlights(),f.resumeNotification(!1,!0)}applyComposedEdit(e,t){let{range:i,newText:n}=t,{ranges:s}=this,o=_i.create("file:///1","",0,e),a=[],l=(0,Qu.default)(e,n),c=0;for(let u=0;u<l.length;u++){let f=l[u],d=ND(i.start,o.positionAt(c));if(f[0]==Qu.default.EQUAL)c=c+f[1].length;else if(f[0]==Qu.default.DELETE){let h=ND(i.start,o.positionAt(c+f[1].length));l[u+1]&&l[u+1][0]==Qu.default.INSERT?(a.push({range:ef.Range.create(d,h),newText:l[u+1][1]}),u=u+1):a.push({range:ef.Range.create(d,h),newText:""}),c=c+f[1].length}else f[0]==Qu.default.INSERT&&a.push({range:ef.Range.create(d,d),newText:f[1]})}if(a.some(u=>u.newText.includes(`
`)||u.range.start.line!=u.range.end.line)){this.cancel();return}if(a.length==s.length){let u;for(let f=0;f<a.length;f++){let d=a[f],h=this.ranges[f];if(!qc(h.currRange,d.range)){this.cancel();return}if(u&&!hG(d,u)){this.cancel();return}h.applyEdit(d),u=d}}else if(a.length==s.length*2)for(let u=0;u<a.length-1;u=u+2){let f=a[u],d=a[u+1];if(f.newText.length==0&&d.newText.length==0){let h=this.ranges[u/2];if(De(h.currRange.end,d.range.end)!=0){this.cancel();return}let p=f.range.start.character-h.currRange.start.character;h.replace(p,f.range.end.character-f.range.start.character,"");let g=d.range.end.character-d.range.start.character,b=h.text.length;h.replace(b-g,b)}else if(Fs(f.range)&&Fs(d.range)){let h=this.ranges[u/2];if(De(h.currRange.end,d.range.start)!=0){this.cancel();return}let p=f.range.start.character-h.currRange.start.character;h.add(p,f.newText);let g=h.text.length;h.add(g,d.newText)}else{this.cancel();return}}else{this.cancel();return}this.doHighlights()}}});var yze,rw,mG=R(()=>{Ps();_e();Vt();Te();Y();pG();qD();yze=U()("cursors"),rw=class{constructor(e){this.nvim=e;this.sessionsMap=new Map;this.disposables=[];this.loadConfig(),v.onDidChangeConfiguration(t=>{t.affectsConfiguration("cursors")&&this.loadConfig()},null,this.disposables),O.on("BufUnload",t=>{let i=this.getSession(t);!i||(i.dispose(),this.sessionsMap.delete(t))},null,this.disposables)}loadConfig(){let e=v.getConfiguration("cursors");this.config={nextKey:e.get("nextKey","<C-n>"),previousKey:e.get("previousKey","<C-p>"),cancelKey:e.get("cancelKey","<esc>")}}getSession(e){return this.sessionsMap.get(e)}async isActivated(){let e=await this.nvim.call("bufnr",["%"]);return this.sessionsMap.get(e)!=null}async select(e,t,i){let n=v.getDocument(e);if(!n||!n.attached){D.showMessage(`buffer ${e} not attached.`);return}let{nvim:s}=this,o=this.createSession(n),a=await D.getCursorPosition(),l;if(t=="operator"){await s.command(`normal! ${i=="line"?"'[":"`["}`);let c=await D.getCursorPosition();await s.command(`normal! ${i=="line"?"']":"`]"}`);let u=await D.getCursorPosition();await D.moveTo(a);let f=De(c,u);if(f==0)return;f>=0&&([c,u]=[u,c]);let d=n.getline(u.line);u.character<d.length&&(u.character=u.character+1);let h=MD(n,Ae.create(c,u));for(let p of h){let g=n.textDocument.getText(p);o.addRange(p,g)}}else if(t=="word"){if(l=n.getWordRangeAtPosition(a),!l){let f=n.getline(a.line);a.character==f.length?l=Ae.create(a.line,Math.max(0,f.length-1),a.line,f.length):l=Ae.create(a.line,a.character,a.line,a.character+1)}let u=n.getline(a.line).slice(l.start.character,l.end.character);o.addRange(l,u)}else if(t=="position"){let c=n.getline(a.line);a.character>=c.length?l=Ae.create(a.line,c.length-1,a.line,c.length):l=Ae.create(a.line,a.character,a.line,a.character+1),o.addRange(l,c.slice(l.start.character,l.end.character))}else if(t=="range"){await s.call("eval",'feedkeys("\\<esc>", "in")');let c=await v.getSelectedRange(i,n);if(!c||De(c.start,c.end)==0)return;let u=i==""?dG(n,c):MD(n,c);for(let f of u){let d=n.textDocument.getText(f);o.addRange(f,d)}}else{D.showMessage(`${t} not supported`,"error");return}(t=="word"||t=="position")&&await s.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}createSession(e){let t=this.getSession(e.bufnr);return t||(t=new iw(this.nvim,e,this.config),this.sessionsMap.set(e.bufnr,t),t.onDidCancel(()=>{t.dispose(),this.sessionsMap.delete(e.bufnr)}),t)}async addRanges(e){let{nvim:t}=this,i=await t.call("bufnr",["%"]),n=v.getDocument(i);return!n||!n.attached?(D.showMessage("Document not attached","error"),!1):this.createSession(n).addRanges(e)}reset(){for(let e of this.sessionsMap.values())e.cancel();this.sessionsMap.clear()}dispose(){for(let e of this.sessionsMap.values())e.dispose();this.sessionsMap.clear();for(let e of this.disposables)e.dispose()}}});var tf,Rze,nw,gG=R(()=>{Xa();tf=E(H());Ei();Y();Te();Re();Rze=U()("handler-codeActions"),nw=class{constructor(e,t){this.nvim=e;this.handler=t;t.addDisposable(se.registerCommand("editor.action.organizeImport",async i=>{await this.organizeImport(i)})),se.titles.set("editor.action.organizeImport","run organize import code action.")}async codeActionRange(e,t,i){let{doc:n}=await this.handler.getCurrentState();await n.synchronize();let s=n.getline(t-1),o=tf.Range.create(e-1,0,t-1,s.length),a=await this.getCodeActions(n,o,i?[i]:null);if(!a||a.length==0){D.showMessage(`No${i?" "+i:""} code action available`,"warning");return}let l=await D.showMenuPicker(a.map(u=>u.title),"Choose action"),c=a[l];c&&await this.applyCodeAction(c)}async organizeImport(e){let{doc:t}=await this.handler.getCurrentState();if(e&&t.bufnr!=e)return;await t.synchronize();let i=await this.getCodeActions(t,void 0,[tf.CodeActionKind.SourceOrganizeImports]);if(i&&i.length){await this.applyCodeAction(i[0]);return}throw new Error("Organize import action not found.")}async getCodeActions(e,t,i){t=t||tf.Range.create(0,0,e.lineCount,0);let s={diagnostics:Lt.getDiagnosticsInRange(e.textDocument,t)};i&&Array.isArray(i)&&(s.only=i);let o=await this.handler.withRequestToken("code action",a=>N.getCodeActions(e.textDocument,t,s,a));return!o||o.length==0?[]:(o=o.filter(a=>!a.disabled),o.sort((a,l)=>a.isPreferred&&!l.isPreferred?-1:l.isPreferred&&!a.isPreferred?1:0),o)}get floatActions(){return v.floatSupported?v.getConfiguration("coc.preferences").get("floatActions",!0):!1}async doCodeAction(e,t){let{doc:i}=await this.handler.getCurrentState(),n;e&&(n=await v.getSelectedRange(e,i)),await i.synchronize();let s=await this.getCodeActions(i,n,Array.isArray(t)?t:null);if(typeof t=="string"?s=s.filter(l=>l.title==t||l.command&&l.command.title==t):Array.isArray(t)&&(s=s.filter(l=>t.some(c=>l.kind&&l.kind.startsWith(c)))),!s||s.length==0){D.showMessage(`No${t?" "+t:""} code action available`,"warning");return}if(t&&s.length==1){await this.applyCodeAction(s[0]);return}let o=this.floatActions?await D.showMenuPicker(s.map(l=>l.title),"Choose action"):await D.showQuickpick(s.map(l=>l.title)),a=s[o];a&&await this.applyCodeAction(a)}async getCurrentCodeActions(e,t){let{doc:i}=await this.handler.getCurrentState(),n;return e&&(n=await v.getSelectedRange(e,i)),await this.getCodeActions(i,n,t)}async doQuickfix(){let e=await this.getCurrentCodeActions("line",[tf.CodeActionKind.QuickFix]);if(!e||e.length==0)throw new Error("No quickfix action available");await this.applyCodeAction(e[0]),this.nvim.command('silent! call repeat#set("\\<Plug>(coc-fix-current)", -1)',!0)}async applyCodeAction(e){if(e.disabled)throw new Error(`Action "${e.title}" is disabled: ${e.disabled.reason}`);e=await this.handler.withRequestToken("resolve codeAction",n=>N.resolveCodeAction(e,n));let{edit:t,command:i}=e;t&&await v.applyEdit(t),i&&await se.execute(i)}}});var $D,BD,Mze,sw,vG=R(()=>{$D=E(Ui()),BD=E(H());Ei();Re();Te();Y();Mze=U()("codelens-buffer"),sw=class{constructor(e,t,i){this.nvim=e;this.bufnr=t;this.config=i;this.fetchCodelenses=(0,$D.default)(()=>{this._fetchCodeLenses()},200),this.resolveCodeLens=(0,$D.default)(()=>{this._resolveCodeLenses()},200),this.fetchCodelenses()}currentCodeLens(){var e;return(e=this.codeLenses)==null?void 0:e.codeLenses}get enabled(){return this.textDocument&&this.config.enabled&&N.hasProvider("codeLens",this.textDocument)}async forceFetch(){this.fetchCodelenses.clear(),await this._fetchCodeLenses()}get textDocument(){var e;return(e=v.getDocument(this.bufnr))==null?void 0:e.textDocument}async _fetchCodeLenses(){var i,n;if(!this.enabled)return;if(this.cancel(),!(!this.isChanged&&!((i=this.codeLenses)==null?void 0:i.hasError))){let{textDocument:s}=this,o=s.version,l=(this.tokenSource=new BD.CancellationTokenSource).token,c=await N.getCodeLens(s,l);if(this.tokenSource=void 0,l.isCancellationRequested||!Array.isArray(c)||c.length==0)return;let u=c.some(f=>f==null);this.codeLenses={version:o,codeLenses:c.filter(f=>f!=null),hasError:u}}let t=(n=this.codeLenses)==null?void 0:n.codeLenses;(t==null?void 0:t.length)&&await this._resolveCodeLenses()}async _resolveCodeLenses(){if(!this.enabled||!this.codeLenses||this.isChanged)return;let{codeLenses:e}=this.codeLenses,[t,i,n]=await this.nvim.eval("[bufnr('%'),line('w0'),line('w$')]");if(!(this.isChanged||t!=this.bufnr)){if(this.resolveTokenSource&&this.resolveTokenSource.cancel(),e=e.filter(s=>{let o=s.range.start.line+1;return o>=i&&o<=n}),e.length){let o=(this.resolveTokenSource=new BD.CancellationTokenSource).token;if(await Promise.all(e.map(a=>N.resolveCodeLens(a,o))),this.resolveTokenSource=void 0,o.isCancellationRequested||this.isChanged)return}this.srcId||(this.srcId=await this.nvim.createNamespace("coc-codelens")),this.nvim.pauseNotification(),this.clear(i-1,n),this.setVirtualText(e),await this.nvim.resumeNotification()}}get isChanged(){if(!this.textDocument||!this.codeLenses)return!0;let{version:e}=this.codeLenses;return this.textDocument.version!==e}setVirtualText(e){if(e.length==0)return;let t=new Map;for(let i of e){let{range:n,command:s}=i;if(!s)continue;let{line:o}=n.start;t.has(o)?t.get(o).push(i):t.set(o,[i])}for(let i of t.keys()){let s=t.get(i).map(l=>l.command);s=s.filter(l=>l&&l.title);let o=[],a=s.length;for(let l=0;l<a;l++){let c=s[l];o.push([c.title.replace(/(\r\n|\r|\n|\s)+/g," "),"CocCodeLens"]),l!=a-1&&o.push([this.config.subseparator,"CocCodeLens"])}o.unshift([`${this.config.separator} `,"CocCodeLens"]),this.nvim.call("nvim_buf_set_virtual_text",[this.bufnr,this.srcId,i,o,{}],!0)}}clear(e=0,t=-1){if(!this.srcId)return;this.nvim.createBuffer(this.bufnr).clearNamespace(this.srcId,e,t)}cleanUp(){this.clear(),this.codeLenses=void 0}getCodelenses(){var e;return(e=this.codeLenses)==null?void 0:e.codeLenses}async doAction(e){var n;let{codeLenses:t}=(n=this.codeLenses)!=null?n:{};if(!(t==null?void 0:t.length))return;let i=[];for(let s of t){let{range:o,command:a}=s;!a||!o||e==o.start.line&&i.push(a)}if(!!i.length)if(i.length==1)await se.execute(i[0]);else{let s=await D.showMenuPicker(i.map(o=>o.title));if(s==-1)return;await se.execute(i[s])}}cancel(){this.resolveCodeLens.clear(),this.fetchCodelenses.clear(),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose(),this.tokenSource=null)}onChange(){this.cancel(),this.fetchCodelenses()}dispose(){this.clear(),this.cancel(),this.codeLenses=void 0}}});var Hze,ow,bG=R(()=>{_e();de();Y();vG();Hze=U()("codelens"),ow=class{constructor(e){this.nvim=e;this.disposables=[];this.setConfiguration(),!!v.isNvim&&(v.onDidChangeConfiguration(t=>{this.setConfiguration(t)}),this.buffers=v.registerBufferSync(t=>{if(t.buftype=="")return new sw(e,t.bufnr,this.config)}),this.listen())}listen(){O.on("CursorMoved",e=>{let t=this.buffers.getItem(e);t&&t.resolveCodeLens()},null,this.disposables),O.on("CursorHold",async e=>{let t=this.buffers.getItem(e);t&&await t.forceFetch()},this,this.disposables)}async checkProvider(){for(let e of this.buffers.items)await e.forceFetch()}setConfiguration(e){if(e&&!e.affectsConfiguration("codeLens"))return;let t=v.getConfiguration("codeLens"),i=this.nvim.hasFunction("nvim_buf_set_virtual_text")&&t.get("enable",!1);if(e&&i!=this.config.enabled){i?this.listen():G(this.disposables);for(let n of this.buffers.items)i?n.fetchCodelenses():n.cleanUp()}this.config=Object.assign(this.config||{},{enabled:i,separator:t.get("separator","\u2023"),subseparator:t.get("subseparator"," ")})}async doAction(){let[e,t]=await this.nvim.eval('[bufnr("%"),line(".")-1]'),i=this.buffers.getItem(e);await(i==null?void 0:i.doAction(t))}dispose(){this.buffers.dispose(),G(this.disposables)}}});function jD(r){return r.length==1?`0${r}`:r}function vp(r){let e=aw(r);return`${jD(e.red.toString(16))}${jD(e.green.toString(16))}${jD(e.blue.toString(16))}`}function aw(r){let{red:e,green:t,blue:i}=r;return{red:Math.round(e*255),green:Math.round(t*255),blue:Math.round(i*255)}}function yG(r){let e=[r.red,r.green,r.blue],t=[];for(let n=0;n<e.length;n++){let s=e[n];t[n]=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)}return .2126*t[0]+.7152*t[1]+.0722*t[2]<=.5}var UD=R(()=>{});var wG,xG,Zme,lw,SG=R(()=>{wG=E(Ui()),xG=E(H());Re();Xd();ri();Vt();UD();Y();Zme=U()("colors-buffer"),lw=class{constructor(e,t,i,n){this.nvim=e;this.bufnr=t;this.enabled=i;this.usedColors=n;this._colors=[];this.highlight=(0,wG.default)(()=>{this.doHighlight()},global.hasOwnProperty("__TEST__")?10:500)}onChange(){this.cancel(),this.highlight()}get buffer(){return this.nvim.createBuffer(this.bufnr)}get colors(){return this._colors}hasColor(){return this._colors.length>0}setState(e){this.enabled=e,e?this.highlight():this.clearHighlight()}async doHighlight(){let e=v.getDocument(this.bufnr);if(!(!e||!this.enabled))try{this.tokenSource=new xG.CancellationTokenSource;let{token:t}=this.tokenSource;if(this.version&&e.version==this.version)return;let{version:i}=e,n;if(n=await N.provideDocumentColors(e.textDocument,t),n=n||[],t.isCancellationRequested)return;this.version=i,await this.addHighlight(n)}catch(t){Zme.error("Error on highlight:",t)}}async addHighlight(e){if(e=e||[],je(this._colors,e))return;let{nvim:t}=this;this._colors=e;let i=rj(e,100);t.pauseNotification(),this.buffer.clearNamespace("color"),this.defineColors(e),t.resumeNotification(!1,!0);for(let n of i){t.pauseNotification();let s=this.getColorRanges(n);for(let o of s)this.highlightColor(o.ranges,o.color);t.resumeNotification(!1,!0)}v.isVim&&this.nvim.command("redraw",!0)}highlightColor(e,t){let i=`BG${vp(t)}`;this.buffer.highlightRanges("color",i,e)}defineColors(e){for(let t of e){let i=vp(t.color);this.usedColors.has(i)||(this.nvim.command(`hi BG${i} guibg=#${i} guifg=#${yG(t.color)?"ffffff":"000000"}`,!0),this.usedColors.add(i))}}getColorRanges(e){let t=[];for(let i of e){let{color:n,range:s}=i,o=t.findIndex(a=>je(aw(a.color),aw(n)));o==-1?t.push({color:n,ranges:[s]}):t[o].ranges.push(s)}return t}clearHighlight(){this.highlight.clear(),this._colors=[],this.version=null,this.buffer.clearNamespace("color")}hasColorAtPosition(e){let{colors:t}=this;return t.some(i=>Ft(e,i.range)==0)}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}dispose(){this.highlight.clear(),this.cancel()}}});var CG,m4e,cw,_G=R(()=>{CG=E(H());Ei();ia();Re();de();UD();Te();Y();SG();m4e=U()("colors-index"),cw=class{constructor(e,t){this.nvim=e;this.handler=t;this._enabled=!0;this.disposables=[];let i=v.getConfiguration("coc.preferences");this._enabled=i.get("colorSupport",!0);let n=new Set;this.highlighters=v.registerBufferSync(s=>{let o=new lw(this.nvim,s.bufnr,this._enabled,n);return o.highlight(),o}),we.onDidActiveExtension(()=>{this.highlightAll()},null,this.disposables),v.onDidChangeConfiguration(async s=>{if(s.affectsConfiguration("coc.preferences.colorSupport")){let a=v.getConfiguration("coc.preferences").get("colorSupport",!0);this._enabled=a;for(let l of this.highlighters.items)l.setState(a)}},null,this.disposables),this.disposables.push(se.registerCommand("editor.action.pickColor",()=>this.pickColor())),se.titles.set("editor.action.pickColor","pick color from system color picker when possible."),this.disposables.push(se.registerCommand("editor.action.colorPresentation",()=>this.pickPresentation())),se.titles.set("editor.action.colorPresentation","change color presentation.")}async pickPresentation(){let{doc:e}=await this.handler.getCurrentState();this.handler.checkProvier("documentColor",e.textDocument);let t=await this.getColorInformation(e.bufnr);if(!t)return D.showMessage("Color not found at current position","warning");let i=await v.document,n=new CG.CancellationTokenSource,s=await N.provideColorPresentations(t,i.textDocument,n.token);if(!(s==null?void 0:s.length))return;let o=await D.showMenuPicker(s.map(f=>f.label),"choose color:");if(o==-1)return;let a=s[o],{textEdit:l,additionalTextEdits:c,label:u}=a;l||(l={range:t.range,newText:u}),await i.applyEdits([l]),c&&await i.applyEdits(c)}async pickColor(){let{doc:e}=await this.handler.getCurrentState();this.handler.checkProvier("documentColor",e.textDocument);let t=await this.getColorInformation(e.bufnr);if(!t)return D.showMessage("Color not found at current position","warning");let{color:i}=t,n=[(i.red*255).toFixed(0),(i.green*255).toFixed(0),(i.blue*255).toFixed(0)],s=await this.nvim.call("coc#util#pick_color",[n]);if(!s)return;let o=vp({red:s[0]/65535,green:s[1]/65535,blue:s[2]/65535,alpha:1});await(await v.document).applyEdits([{range:t.range,newText:`#${o}`}])}get enabled(){return this._enabled}clearHighlight(e){let t=this.highlighters.getItem(e);!t||t.clearHighlight()}hasColor(e){let t=this.highlighters.getItem(e);return t?t.hasColor():!1}hasColorAtPosition(e,t){let i=this.highlighters.getItem(e);return i?i.hasColorAtPosition(t):!1}highlightAll(){for(let e of this.highlighters.items)e.highlight()}async doHighlight(e){let t=this.highlighters.getItem(e);t&&await t.doHighlight()}async getColorInformation(e){let t=this.highlighters.getItem(e);if(!t)return null;let i=await D.getCursorPosition();for(let n of t.colors){let{range:s}=n,{start:o,end:a}=s;if(i.line==o.line&&i.character>=o.character&&i.character<=a.character)return n}return null}dispose(){this.highlighters.dispose(),G(this.disposables)}}});var w4e,Qme,uw,EG=R(()=>{Ei();_e();By();w4e=U()("handler-commands"),Qme=process.env.VIM_NODE_RPC=="1",uw=class{constructor(e,t){this.nvim=e;this.env=t;for(let i of t.vimCommands)this.addVimCommand(i)}addVimCommand(e){let t=`vim.${e.id}`;se.registerCommand(t,()=>{this.nvim.command(e.cmd,!0),Qme&&this.nvim.command("redraw",!0)}),e.title&&se.titles.set(t,e.title)}getCommandList(){return se.commandList.map(e=>e.id)}async repeat(){await se.repeatCommand()}async runCommand(e,...t){if(e){await O.fire("Command",[e]);let i=await se.executeCommand(e,...t);return t.length==0&&await se.addRecent(e),i}else await gi.start(["commands"])}getCommands(){let e=se.commandList,t=[],{titles:i}=se;for(let n of e)t.push({id:n.id,title:i.get(n.id)||""});return t}}});var fw,TG=R(()=>{Re();Y();fw=class{constructor(e,t){this.nvim=e;this.handler=t}async fold(e){let{doc:t,winid:i}=await this.handler.getCurrentState();this.handler.checkProvier("foldingRange",t.textDocument),await t.synchronize();let n=this.nvim.createWindow(i),s=await this.nvim.eval("&foldlevel"),o=await this.handler.withRequestToken("foldingrange",a=>N.provideFoldingRanges(t.textDocument,{},a),!0);if(!o||!o.length)return!1;e&&(o=o.filter(a=>a.kind==e)),o.sort((a,l)=>l.startLine-a.startLine),this.nvim.pauseNotification(),n.setOption("foldmethod","manual",!0),this.nvim.command("normal! zE",!0);for(let a of o){let{startLine:l,endLine:c}=a,u=`${l+1}, ${c+1}fold`;this.nvim.command(u,!0)}return n.setOption("foldenable",!0,!0),n.setOption("foldlevel",s,!0),v.isVim&&this.nvim.command("redraw",!0),await this.nvim.resumeNotification(),!0}}});var ds,dw,DG,hw,RG=R(()=>{ds=E(H());_e();Re();Yu();Vt();yt();Te();Y();dw=U()("handler-format"),DG=new Map([["<",">"],[">","<"],["{","}"],["[","]"],["(",")"]]),hw=class{constructor(e,t){this.nvim=e;this.handler=t;this.loadPreferences(),t.addDisposable(v.onDidChangeConfiguration(this.loadPreferences,this)),t.addDisposable(v.onWillSaveTextDocument(c=>{let{languageId:u}=c.document,f=this.preferences.formatOnSaveFiletypes;if(f.includes(u)||f.includes("*")){let d=async()=>{if(!N.hasFormatProvider(c.document)){dw.warn(`Format provider not found for ${c.document.uri}`);return}let h=await v.getFormatOptions(c.document.uri),p=new ds.CancellationTokenSource,g=setTimeout(()=>{dw.warn(`Format on save ${c.document.uri} timeout after 0.5s`),p.cancel()},500),b=await N.provideDocumentFormattingEdits(c.document,h,p.token);return clearTimeout(g),!b&&!p.token.isCancellationRequested&&dw.want(`Format on save ${c.document.uri} get undefined result.`),b};c.waitUntil(d())}}));let i,n;t.addDisposable(O.on("Enter",async c=>{i=Date.now(),n=c})),t.addDisposable(O.on("CursorMovedI",async c=>{c==n&&Date.now()-i<100&&await this.handleEnter(c)}));let s,o;t.addDisposable(O.on("InsertCharPre",async()=>{o=Date.now()})),t.addDisposable(O.on("TextChangedI",async(c,u)=>{if(s=Date.now(),!o||s-o>300)return;o=null;let f=u.pre[u.pre.length-1];f&&await this.tryFormatOnType(f,c)}));let a,l;t.addDisposable(O.on("InsertEnter",c=>{a=c,l=Date.now()})),t.addDisposable(O.on("TextChangedI",async(c,u)=>{!this.preferences.formatOnType&&!/^\s*$/.test(u.pre)||a!=c||!l||Date.now()-l>30||(a=void 0,await this.tryFormatOnType(`
`,c,!0))}))}loadPreferences(e){if(!e||e.affectsConfiguration("coc.preferences")){let t=v.getConfiguration("coc.preferences");this.preferences={formatOnType:t.get("formatOnType",!1),formatOnSaveFiletypes:t.get("formatOnSaveFiletypes",[]),formatOnTypeFiletypes:t.get("formatOnTypeFiletypes",[]),bracketEnterImprove:t.get("bracketEnterImprove",!0)}}}async tryFormatOnType(e,t,i=!1){if(!e||S$(e)||!this.preferences.formatOnType||vi.getSession(t)!=null)return;let n=v.getDocument(t);if(!n||!n.attached||n.isCommandLine)return;let s=this.preferences.formatOnTypeFiletypes;if(s.length&&!s.includes(n.filetype)&&!s.includes("*"))return;if(!N.hasProvider("formatOnType",n.textDocument)){dw.warn(`Format on type provider not found for buffer: ${n.uri}`);return}if(!N.canFormatOnType(e,n.textDocument))return;let o,a=await this.handler.withRequestToken("Format on type",async u=>{o=await D.getCursorPosition();let f=n.getline(o.line-1);if(i&&/^\s*$/.test(f))return;let d=i?{line:o.line-1,character:f.length}:o;return await n.synchronize(),await N.provideDocumentOnTypeEdits(e,n.textDocument,d,u)});if(!a||!a.length)return;let l=$c(o,a);await n.applyEdits(a);let c=l?ds.Position.create(o.line+l.line,o.character+l.character):null;c&&!i&&await D.moveTo(c)}async formatCurrentBuffer(){let{doc:e}=await this.handler.getCurrentState();return await this.documentFormat(e)}async formatCurrentRange(e){let{doc:t}=await this.handler.getCurrentState();return await this.documentRangeFormat(t,e)}async documentFormat(e){if(await e.synchronize(),!N.hasFormatProvider(e.textDocument))throw new Error(`Format provider not found for buffer: ${e.bufnr}`);let t=await v.getFormatOptions(e.uri),i=await this.handler.withRequestToken("format",n=>N.provideDocumentFormattingEdits(e.textDocument,t,n));return i&&i.length>0?(await e.applyEdits(i),!0):!1}async handleEnter(e){let{nvim:t}=this,{bracketEnterImprove:i}=this.preferences;if(await this.tryFormatOnType(`
`,e),i){let n=await t.call("line",".")-1,s=v.getDocument(e);if(!s)return;await s.patchChange();let o=s.getline(n-1),a=s.getline(n),l=o[o.length-1];if(l&&DG.has(l)){let c=a.trim()[0];if(c&&DG.get(l)==c){let u=[],f=await v.getFormatOptions(s.uri),d=f.insertSpaces?" ".repeat(f.tabSize):" ",h=a.match(/^\s*/)[0],p=ds.Position.create(n-1,o.length);if(s.filetype=="vim"){let g=`
`+h+d;u.push({range:ds.Range.create(n,h.length,n,h.length),newText:" \\ "}),g=g+"\\ ",u.push({range:ds.Range.create(p,p),newText:g}),await s.applyEdits(u),await D.moveTo(ds.Position.create(n,g.length-1))}else await t.eval(`feedkeys("\\<Esc>O", 'in')`)}}}}async documentRangeFormat(e,t){this.handler.checkProvier("formatRange",e.textDocument),await e.synchronize();let i;if(t){if(i=await v.getSelectedRange(t,e),!i)return-1}else{let[o,a,l]=await this.nvim.eval("[v:lnum,v:count,mode()]");if(a==0||l=="i"||l=="R")return-1;i=ds.Range.create(o-1,0,o-1+a,0)}let n=await v.getFormatOptions(e.uri),s=await this.handler.withRequestToken("Format range",o=>N.provideDocumentRangeFormattingEdits(e.textDocument,i,n,o));return s&&s.length>0?(await e.applyEdits(s),0):-1}}});var Pl,j4e,pw,PG=R(()=>{Pl=E(H());_e();Re();de();Y();j4e=U()("documentHighlight"),pw=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.highlights=new Map;O.on(["CursorMoved","CursorMovedI"],()=>{this.cancel(),this.clearHighlights()},null,this.disposables)}clearHighlights(){if(this.highlights.size!=0){for(let e of this.highlights.keys())this.nvim.createWindow(e).clearMatchGroup("^CocHighlight");this.highlights.clear()}}async highlight(){let{nvim:e}=this;this.cancel();let[t,i,n,s]=await e.eval(`[bufnr("%"),win_getid(),coc#cursor#position(),get(b:,'coc_cursors_activated',0)]`),o=v.getDocument(t);if(!o||!o.attached||s||!N.hasProvider("documentHighlight",o.textDocument))return;let a=await this.getHighlights(o,Pl.Position.create(n[0],n[1]));if(!a)return;let l={};for(let u of a){if(!u.range)continue;let f=u.kind==Pl.DocumentHighlightKind.Text?"CocHighlightText":u.kind==Pl.DocumentHighlightKind.Read?"CocHighlightRead":"CocHighlightWrite";l[f]=l[f]||[],l[f].push(u.range)}let c=e.createWindow(i);e.pauseNotification(),c.clearMatchGroup("^CocHighlight");for(let u of Object.keys(l))c.highlightRanges(u,l[u],-1,!0);v.isVim&&e.command("redraw",!0),e.resumeNotification(!1,!0),this.highlights.set(i,a)}async getSymbolsRanges(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("documentHighlight",e.textDocument);let i=await this.getHighlights(e,t);return i?i.map(n=>n.range):null}hasHighlights(e){return this.highlights.get(e)!=null}async getHighlights(e,t){let n=e.getline(t.line)[t.character];if(!n||!e.isWord(n))return null;await e.synchronize(),this.tokenSource=new Pl.CancellationTokenSource;let s=this.tokenSource,o=await N.getDocumentHighLight(e.textDocument,t,s.token);return s==this.tokenSource&&(s.dispose(),this.tokenSource=null),s.token.isCancellationRequested?null:o}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose(),this.tokenSource=null)}dispose(){this.highlights.clear(),this.cancel(),G(this.disposables)}}});function bp(r,e,t,i=!1){let n=e.trim();!n.length||(i&&t!=="markdown"&&(n="``` "+t+`
`+n+"\n```"),r.push({content:n,filetype:t}))}function ege(r){return r?typeof r.filetype=="string"&&typeof r.content=="string":!1}async function tge(r,e,t){let i=v.getDocument(r);if(i)return i.getLines(e,t+1);let n=B.parse(r).fsPath;return kG.default.existsSync(n)?await Ig(n,e,t):[]}var kG,Zs,Z4e,mw,IG=R(()=>{kG=E(require("fs")),Zs=E(H());qe();Re();Va();de();Nt();Y();Z4e=U()("handler-hover"),mw=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.documentLines=[];this.hasProvider=!1;this.excludeImages=!0;this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),this.hoverFactory=new tr(e),this.disposables.push(this.hoverFactory)}registerProvider(){if(this.hasProvider)return;this.hasProvider=!0;let{nvim:e}=this,t={onDidChange:null,provideTextDocumentContent:async()=>(e.pauseNotification(),e.command("setlocal conceallevel=2 nospell nofoldenable wrap",!0),e.command("setlocal bufhidden=wipe nobuflisted",!0),e.command("setfiletype markdown",!0),e.command(`if winnr('j') != winnr('k') | exe "normal! z${Math.min(this.documentLines.length,this.config.previewMaxHeight)}\\<cr> | endif"`,!0),await e.resumeNotification(),this.documentLines.join(`
`))};this.disposables.push(v.registerTextDocumentContentProvider("coc",t))}loadConfiguration(e){if(!e||e.affectsConfiguration("hover")){let t=v.getConfiguration("hover"),i=t.get("target","float");this.config={floatConfig:t.get("floatConfig",{}),autoHide:t.get("autoHide",!0),target:i=="float"&&!v.floatSupported?"preview":i,previewMaxHeight:t.get("previewMaxHeight",12)},this.config.target=="preview"&&this.registerProvider();let n=v.getConfiguration("coc.preferences");this.excludeImages=n.get("excludeImageLinksInMarkdownDocument",!0)}}async onHover(e){let{doc:t,position:i,winid:n}=await this.handler.getCurrentState();e=="preview"&&this.registerProvider(),this.handler.checkProvier("hover",t.textDocument),await t.synchronize();let s=await this.handler.withRequestToken("hover",a=>N.getHover(t.textDocument,i,a),!0);if(s==null||!s.length)return!1;let o=s.find(a=>Zs.Range.is(a.range));if(o==null?void 0:o.range){let a=this.nvim.createWindow(n);a.highlightRanges("CocHoverRange",[o.range],99,!0),this.timer=setTimeout(()=>{a.clearMatchGroup("CocHoverRange"),v.isVim&&this.nvim.command("redraw",!0)},500)}return await this.previewHover(s,e),!0}async definitionHover(e){let{doc:t,position:i}=await this.handler.getCurrentState();e=="preview"&&this.registerProvider(),this.handler.checkProvier("hover",t.textDocument),await t.synchronize();let n=await this.handler.withRequestToken("hover",o=>N.getHover(t.textDocument,i,o),!0);if(!(n==null?void 0:n.length))return!1;let s=await this.handler.withRequestToken("definitionHover",o=>N.getDefinitionLinks(t.textDocument,i,o),!1);if(s==null?void 0:s.length)for(let o of s){if(!o.targetRange)continue;let{start:a,end:l}=o.targetRange,c=l.line-a.line>=100?a.line+100:l.character==0?l.line-1:l.line,u=await tge(o.targetUri,a.line,c);if(u.length){let f=u[0].match(/^\s*/)[0];f&&(u=u.map(d=>d.startsWith(f)?d.substring(f.length):d)),n.push({content:u.join(`
`),filetype:t.filetype})}}return await this.previewHover(n,e),!0}async previewHover(e,t){let i=[];t=t||this.config.target;let n=t==="preview";for(let o of e){if(ege(o)){i.push(o);continue}let{contents:a}=o;if(Array.isArray(a))for(let l of a)typeof l=="string"?bp(i,l,"markdown",n):bp(i,l.value,l.language,n);else Zs.MarkedString.is(a)?typeof a=="string"?bp(i,a,"markdown",n):bp(i,a.value,a.language,n):Zs.MarkupContent.is(a)&&bp(i,a.value,Td(a)?"markdown":"txt",n)}if(t=="float"){let o=this.hoverFactory.applyFloatConfig({modes:["n"],autoHide:this.config.autoHide,excludeImages:this.excludeImages,maxWidth:80},this.config.floatConfig);await this.hoverFactory.show(i,o);return}let s=i.reduce((o,a)=>{let l=a.content.split(/\r?\n/);return o.length>0&&o.push(""),o.push(...l),o},[]);if(t=="echo"){let o=s.join(`
`).trim();await this.nvim.call("coc#util#echo_hover",[o])}else this.documentLines=s,await this.nvim.command("noswapfile pedit coc://document")}async getHover(){let e=[],{doc:t,position:i}=await this.handler.getCurrentState();this.handler.checkProvier("hover",t.textDocument),await t.synchronize();let n=new Zs.CancellationTokenSource,s=await N.getHover(t.textDocument,i,n.token);if(Array.isArray(s))for(let o of s){let{contents:a}=o;Array.isArray(a)?a.forEach(l=>{e.push(typeof l=="string"?l:l.value)}):Zs.MarkupContent.is(a)?e.push(a.value):e.push(typeof a=="string"?a:a.value)}return e=e.filter(o=>o!=null&&o.length>0),e}dispose(){this.timer&&clearTimeout(this.timer),G(this.disposables)}}});var OG,gw,LG=R(()=>{OG=E(H());Re();Vt();Y();gw=class{constructor(e,t){this.nvim=e;this.handler=t}async getLinks(){let{doc:e}=await this.handler.getCurrentState();return this.handler.checkProvier("documentLink",e.textDocument),await this.handler.withRequestToken("links",i=>N.getDocumentLinks(e.textDocument,i))||[]}async openLink(e){if(!e.target&&(e=await N.resolveDocumentLink(e),!e.target))throw new Error("Failed to resolve link target");await v.openResource(e.target)}async openCurrentLink(){let[e,t]=await this.nvim.call("coc#cursor#position"),i=await this.getLinks();if(!i||i.length==0)return!1;let n=OG.Position.create(e,t);for(let s of i)if(Ft(n,s.range)==0)return await this.openLink(s),!0;return!1}}});var $n,h6e,vw,AG=R(()=>{$n=E(H());qe();Re();sp();Y();h6e=U()("handler-hover"),vw=class{constructor(e,t){this.nvim=e;this.handler=t}async request(e,t){let{doc:i,position:n}=await this.handler.getCurrentState();return this.handler.checkProvier(e,i.textDocument),await i.synchronize(),await this.handler.withRequestToken(e,s=>t(i.textDocument,n,s),!0)}async definitions(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("definition",e.textDocument),await e.synchronize();let i=new $n.CancellationTokenSource;return N.getDefinition(e.textDocument,t,i.token)}async declarations(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("declaration",e.textDocument),await e.synchronize();let i=new $n.CancellationTokenSource;return N.getDeclaration(e.textDocument,t,i.token)}async typeDefinitions(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("typeDefinition",e.textDocument),await e.synchronize();let i=new $n.CancellationTokenSource;return N.getTypeDefinition(e.textDocument,t,i.token)}async implementations(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("implementation",e.textDocument),await e.synchronize();let i=new $n.CancellationTokenSource;return N.getImplementation(e.textDocument,t,i.token)}async references(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("reference",e.textDocument),await e.synchronize();let i=new $n.CancellationTokenSource;return N.getReferences(e.textDocument,{includeDeclaration:!0},t,i.token)}async gotoDefinition(e){let t=await this.request("definition",(i,n,s)=>N.getDefinition(i,n,s));return await this.handleLocations(t,e),t?t.length>0:!1}async gotoDeclaration(e){let t=await this.request("declaration",(i,n,s)=>N.getDeclaration(i,n,s));return await this.handleLocations(t,e),t?Array.isArray(t)?t.length>0:!0:!1}async gotoTypeDefinition(e){let t=await this.request("typeDefinition",(i,n,s)=>N.getTypeDefinition(i,n,s));return await this.handleLocations(t,e),t?t.length>0:!1}async gotoImplementation(e){let t=await this.request("implementation",(i,n,s)=>N.getImplementation(i,n,s));return await this.handleLocations(t,e),t?t.length>0:!1}async gotoReferences(e,t=!0){let i=await this.request("reference",(n,s,o)=>N.getReferences(n,{includeDeclaration:t},s,o));return await this.handleLocations(i,e),i?i.length>0:!1}async getTagList(){let{doc:e,position:t}=await this.handler.getCurrentState(),i=await this.nvim.call("expand","<cword>");if(!i||!N.hasProvider("definition",e.textDocument))return null;let n=new $n.CancellationTokenSource,s=await N.getDefinition(e.textDocument,t,n.token);return!s||!s.length?null:s.map(o=>{let a=B.parse(o.uri),l=a.scheme=="file"?a.fsPath:a.toString();return{name:i,cmd:`keepjumps ${o.range.start.line+1} | normal ${o.range.start.character+1}|`,filename:l}})}async findLocations(e,t,i,n){let{doc:s,position:o}=await this.handler.getCurrentState();i=i||{},Object.assign(i,{textDocument:{uri:s.uri},position:o});let a=await Fi.sendRequest(e,t,i);a=a||[];let l=[];if(Array.isArray(a))l=a;else if(a.hasOwnProperty("location")&&a.hasOwnProperty("children")){let c=u=>{if(l.push(u.location),u.children&&u.children.length)for(let f of u.children)c(f)};c(a)}await this.handleLocations(l,n)}async handleLocations(e,t){if(!e)return;let i=Array.isArray(e)?e:[e];i=i.map(s=>$n.LocationLink.is(s)?$n.Location.create(s.targetUri,s.targetRange):s);let n=i.length;if(n!=0)if(n==1&&t!==!1){let{uri:s,range:o}=i[0];await v.jumpTo(s,o.start,t)}else await v.showLocations(i)}dispose(){}}});function sge(r){if(r.length<2)return;let e=r.length;if(!r[e-1].startsWith("-")&&!r[e-2].startsWith("-"))return r[e-1]}var FG,MG,HD,NG,ige,rge,nge,qG,bw,$G=R(()=>{As();FG=E(require("child_process")),MG=E(require("events")),HD=E(require("path")),NG=E(require("readline"));Ps();$u();Nc();Te();ige=U()("handler-search"),rge=["--color","ansi","--colors","path:fg:black","--colors","line:fg:green","--colors","match:fg:red","--no-messages","--heading","-n"],nge="",qG=class extends MG.EventEmitter{start(e,t,i){this.process=(0,FG.spawn)(e,t,{cwd:i}),this.process.on("error",u=>{this.emit("error",u.message)});let n=NG.default.createInterface(this.process.stdout),s,o,a=[],l=[],c=!0;n.on("line",u=>{if(u.includes(nge)){let f=Md(u);if(f[0].foreground=="black"){o={filepath:HD.default.join(i,f[0].text),ranges:[]};return}if(f[0].foreground=="green"){let h=parseInt(f[0].text,10)-1,p=f[0].text.length+1;c&&(s=h,c=!1);let g="";for(let y of f){if(y.foreground=="red"){let S=h-s,w=g.length-p;l.push(Ae.create(S,w,S,w+y.text.length))}g+=y.text}let b=g.slice(p);a.push(b)}}else{let f=u.trim().length==0;if(o&&(f||u.trim()=="--")){let d={lines:a,highlights:l,start:s,end:s+a.length};o.ranges.push(d)}f&&(this.emit("item",o),o=null),a=[],l=[],c=!0}}),n.on("close",()=>{if(o){if(a.length){let u={lines:a,highlights:l,start:s,end:s+a.length};o.ranges.push(u)}this.emit("item",o)}a=l=o=null,this.emit("end")})}dispose(){this.process&&this.process.kill()}},bw=class{constructor(e,t="rg"){this.nvim=e;this.cmd=t}run(e,t,i){let{nvim:n,cmd:s}=this,{afterContext:o,beforeContext:a}=i.config,l=["-A",o.toString(),"-B",a.toString()].concat(rge,e),c=sge(e);c&&l.pop(),l.push("--",c?HD.default.isAbsolute(c)?c:`./${c.replace(/^\.\//,"")}`:"./"),this.task=new qG,this.task.start(s,l,t);let u=new hi,f=0,d=0,h=Date.now(),p=[],g=async()=>{if(p.length==0)return;let b=p.slice();p=[];let y=await u.acquire();try{await i.addFileItems(b)}catch(S){ige.error(S)}y()};return new Promise((b,y)=>{let S=setInterval(g,300);this.task.on("item",async w=>{f++,d=d+w.ranges.reduce((_,L)=>_+L.highlights.length,0),p.push(w)}),this.task.on("error",w=>{clearInterval(S),D.showMessage(`Error on command "${s}": ${w}`,"error"),this.task=null,y(new Error(w))}),this.task.on("end",async()=>{clearInterval(S);try{await g(),(await u.acquire())(),this.task.removeAllListeners(),this.task=null;let _=i.buffer;if(_){if(n.pauseNotification(),f==0)_.setLines(["No match found"],{start:1,end:2,strictIndexing:!1},!0),_.addHighlight({line:1,srcId:-1,colEnd:-1,colStart:0,hlGroup:"Error"}).logError(),_.setOption("modified",!1,!0);else{let L=new an;L.addText("Files","MoreMsg"),L.addText(": "),L.addText(`${f} `,"Number"),L.addText("Matches","MoreMsg"),L.addText(": "),L.addText(`${d} `,"Number"),L.addText("Duration","MoreMsg"),L.addText(": "),L.addText(`${Date.now()-h}ms`,"Number"),L.render(_,1,2)}_.setOption("modified",!1,!0),await n.resumeNotification(!1,!0)}}catch(w){y(w);return}b()})})}abort(){var e;(e=this.task)==null||e.dispose()}}});function oge(r,e){let{start:t,end:i}=r;return yw.Range.create(t.line-e,t.character,i.line-e,i.character)}var rf,yp,yw,BG,nf,ww,jG=R(()=>{rf=E(jc()),yp=E(require("path")),yw=E(H());Uc();qe();Ei();$u();de();Nt();As();ri();yt();Te();Y();BG=U()("handler-refactorBuffer"),nf="\u3000",ww=class{constructor(e,t,i,n,s){this.bufnr=e;this.srcId=t;this.nvim=i;this.config=n;this.opts=s;this.mutex=new hi;this._disposed=!1;this.disposables=[];this._fileItems=[];this.matchIds=new Set;this.changing=!1;this.disposables.push(v.registerLocalKeymap("n","<CR>",this.splitOpen.bind(this),!0)),v.onDidChangeTextDocument(this.onDocumentChange,this,this.disposables)}get fileItems(){return this._fileItems}onChange(e){if(this.changing)return;let t=this.document,{nvim:i,_fileItems:n}=this;if(!n.length)return;let s=e.contentChanges[0];if(!("range"in s))return;let{original:o}=e;if(s.range.end.line<2)return;t.buffer.setOption("modified",!0,!0);let{range:a,text:l}=s,u=l.split(`
`).length-(a.end.line-a.start.line)-1;if(u==0)return;let f=[];if(l.includes("\u3000")){let h=a.start.line,p=(0,rf.default)(o,l),g=0,b=_i.create("file:///1","",0,o);for(let y=0;y<p.length;y++){let S=p[y],w=b.positionAt(g);if(S[0]==rf.default.EQUAL)g=g+S[1].length;else if(S[0]==rf.default.DELETE){let _=b.positionAt(g+S[1].length);if(p[y+1]&&p[y+1][0]==rf.default.INSERT){let L=p[y+1][1].split(`
`).length-(_.line-w.line)-1;L!=0&&f.push({delta:L,lnum:w.line+h}),y=y+1}else{let L=-(_.line-w.line);L!=0&&f.push({delta:L,lnum:w.line+h})}g=g+S[1].length}else if(S[0]==rf.default.INSERT){let _=S[1].split(`
`).length-1;_!=0&&f.push({delta:_,lnum:w.line+h})}}}else f=[{delta:u,lnum:a.start.line}];let d=!1;for(let h of n)for(let p of h.ranges){let g=f.filter(b=>b.lnum<p.lnum-1);if(g.length){let b=g.reduce((y,S)=>y+S.delta,0);p.lnum=p.lnum+b,d=!0}}!d||(i.pauseNotification(),this.highlightLineNr(),i.resumeNotification().then(h=>{Array.isArray(h)&&h[1]!=null&&BG.error("Error on highlightLineNr:",h[1])}).logError())}async onDocumentChange(e){if(e.bufnr==this.bufnr||this.changing)return;let{uri:t}=e.textDocument,{range:i,text:n}=e.contentChanges[0],s=B.parse(t).fsPath,o=this._fileItems.find(c=>c.filepath==s);if(!o)return;let a=n.split(`
`).length-(i.end.line-i.start.line)-1,l=[];for(let c=0;c<o.ranges.length;c++){let u=o.ranges[c];if(!(i.start.line>=u.end))if(i.end.line<u.start){if(a==0)continue;u.start=u.start+a,u.end=u.end+a}else{let d=v.getDocument(t).getLines(u.start,u.end);d.length?(u.end=u.start+d.length,l.push({range:this.getFileRangeRange(u,!0),newText:d.join(`
`)+`
`})):(o.ranges.splice(c,1),l.push({range:this.getFileRangeRange(u,!1),newText:""}))}}this._fileItems=this._fileItems.filter(c=>c.ranges&&c.ranges.length>0),l.length&&(this.changing=!0,await this.document.applyEdits(l),this.changing=!1),this.nvim.pauseNotification(),this.highlightLineNr(),this.buffer.setOption("modified",!1,!0),await this.nvim.resumeNotification()}async getFileChanges(){if(this._disposed)return[];let e=[],t=await this.buffer.lines;t.push(nf);let i=[],n,s;for(let o=0;o<t.length;o++){let a=t[o];if(a.startsWith(nf)){if(n&&(e.push({filepath:n,lines:i.slice(),lnum:s}),n=void 0,i=[]),a.length>1){let l=a.match(/^\u3000(.*)/);l&&(n=this.getAbsolutePath(l[1].replace(/\s+$/,"")),s=o+1,i=[])}}else i.push(a)}return e}async splitOpen(){let{nvim:e}=this,i=await e.createWindow(this.opts.fromWinid).valid,n=await e.eval('getline(1,line("."))'),s=n.length;for(let o=0;o<s;o++){let l=n[s-o-1].match(/^\u3000(.+)/);if(l){let c=l[1].trim(),u=this.getLinesRange(s-o);if(!u)return;let f=u[0]+o-1,d=this.getAbsolutePath(c);e.pauseNotification(),i?(e.call("win_gotoid",[this.opts.fromWinid],!0),this.nvim.call("coc#util#jump",["edit",d,[f,1]],!0)):this.nvim.call("coc#util#jump",["belowright vs",d,[f,1]],!0),e.command("normal! zz",!0);let[,h]=await e.resumeNotification();h&&D.showMessage(`Error on open ${c}: ${h}`,"error"),i||(this.opts.fromWinid=await e.call("win_getid"));break}}}async addFileItems(e){if(this._disposed)return;let{cwd:t}=this.opts,{document:i}=this,n=await this.mutex.acquire();try{await i.synchronize();for(let f of e){let d=this._fileItems.find(h=>h.filepath==f.filepath);d?d.ranges.push(...f.ranges):this._fileItems.push(f)}let s=i.lineCount,o=new an,a=[];for(let f of e)for(let d of f.ranges){o.addLine(nf),o.addLine(nf),d.lnum=s+o.length,o.addText(`${lt(t,f.filepath)?yp.default.relative(t,f.filepath):f.filepath}`);let h=String(d.start+1).length+String(d.end).length+4;this.srcId||o.addText(" ".repeat(h));let p=0-o.length-s;d.highlights&&a.push(...d.highlights.map(b=>oge(b,p)));let{lines:g}=d;g||(g=await this.getLines(f.filepath,d.start,d.end),d.lines=g),o.addLines(g)}let{nvim:l,buffer:c}=this;if(this.changing=!0,l.pauseNotification(),o.render(c,s),this.highlightLineNr(),c.setOption("modified",!1,!0),c.setOption("undolevels",1e3,!0),s==2&&a.length){let f=a[0].start;l.call("coc#cursor#move_to",[f.line,f.character],!0)}v.isVim&&l.command("redraw",!0);let[,u]=await l.resumeNotification();if(u)throw new Error(u[2]);await i.patchChange(),this.changing=!1,await se.executeCommand("editor.action.addRanges",a)}catch(s){this.changing=!1,BG.error("Error on add file item:",s)}n()}async save(){let{nvim:e}=this,t=this.document,{buffer:i}=t;await t.patchChange();let n=await this.getFileChanges();if(!n)return;n.sort((l,c)=>l.lnum-c.lnum);let s=[],o=new Map;for(let l=0;l<n.length;l++){let c=n[l],{filepath:u,lnum:f}=c,d=o.get(u)||0,h=this._fileItems.find(g=>g.filepath==u),p=h?h.ranges.find(g=>g.lnum==f):null;if(!p||je(p.lines,c.lines)){s.push(l),d&&p&&(p.start=p.start+d,p.end=p.end+d);continue}if(c.start=p.start,c.end=p.end,d!=0&&(p.start=p.start+d),c.lines.length!=p.lines.length){let b=c.lines.length-p.lines.length+d;o.set(u,b),p.end=p.end+b}else p.end=p.end+d;p.lines=c.lines}if(s.length&&(n=n.filter((l,c)=>!s.includes(c))),n.length==0)return D.showMessage("No change.","more"),await i.setOption("modified",!1),!1;let a={};for(let l of n){let c=B.file(l.filepath).toString(),u=a[c]||[];u.push({range:yw.Range.create(l.start,0,l.end,0),newText:l.lines.join(`
`)+`
`}),a[c]=u}return this.changing=!0,await v.applyEdit({changes:a}),this.changing=!1,e.pauseNotification(),i.setOption("modified",!1,!0),this.config.saveToFile&&e.command("silent noa wa",!0),this.highlightLineNr(),await e.resumeNotification(),!0}getFileRange(e){for(let t of this._fileItems)for(let i of t.ranges)if(i.lnum==e)return i}getLinesRange(e){for(let t of this._fileItems)for(let i of t.ranges)if(i.lnum==e)return[i.start,i.end]}async getLines(e,t,i){let n=B.file(e).toString(),s=v.getDocument(n);return s?s.getLines(t,i):await Ig(e,t,i-1)}getAbsolutePath(e){return yp.default.isAbsolute(e)?e:yp.default.join(this.opts.cwd,e)}getFileRangeRange(e,t=!0){let{document:i}=this;if(!i)return null;let{lnum:n}=e;if(!i.getline(n-1).startsWith("\u3000"))return null;let o=t?n:n-1,a=i.lineCount;for(let l=n;l<i.lineCount;l++)if(i.getline(l).startsWith("\u3000")){a=t?l:l+1;break}return yw.Range.create(o,0,a,0)}highlightLineNr(){let{_fileItems:e,nvim:t,srcId:i,bufnr:n}=this,{winid:s,cwd:o}=this.opts,a={};if(i){t.call("nvim_buf_clear_namespace",[n,i,0,-1],!0);for(let l of e)for(let c of l.ranges){let u=`${c.start+1}:${c.end}`;a[c.lnum]=[c.start+1,c.end],t.call("nvim_buf_set_virtual_text",[n,i,c.lnum-1,[[u,"LineNr"]],{}],!0)}}else{this.matchIds.size&&(t.call("coc#highlight#clear_matches",[s,Array.from(this.matchIds)],!0),this.matchIds.clear());let l=2e3;for(let c of e){let u=`${o?yp.default.relative(o,c.filepath):c.filepath}`,f=re(u)+1;for(let d of c.ranges){let h=`:${d.start+1}:${d.end}`;for(let p=0;p<h.length;p++){let g=h[p];this.matchIds.add(l),a[d.lnum]=[d.start+1,d.end],t.call("matchaddpos",["Conceal",[[d.lnum,f+p]],99,l,{conceal:g,window:s}],!0),l++}}}}this.buffer.setVar("line_infos",a,!0)}get valid(){return this.buffer.valid}get buffer(){return this.nvim.createBuffer(this.bufnr)}get document(){return this._disposed?null:v.getDocument(this.bufnr)}dispose(){this._disposed=!0,G(this.disposables)}}});function UG(r,e){let{start:t,end:i}=r;return sf.Range.create(t.line-e,t.character,i.line-e,i.character)}function cge(r){let{changes:e,documentChanges:t}=r;return!(t&&t.length||e&&Object.keys(e).length)}var sf,X6e,age,lge,xw,HG=R(()=>{sf=E(H());qe();Re();de();Nt();Y();$G();jG();X6e=U()("handler-refactor"),age="__coc_refactor__",lge=0,xw=class{constructor(e,t){this.nvim=e;this.handler=t;this.buffers=new Map;this.disposables=[];this._onCreate=new sf.Emitter;this.onCreate=this._onCreate.event;v.isNvim&&this.nvim.hasFunction("nvim_buf_set_virtual_text")&&(this.srcId=v.createNameSpace("coc-refactor")),this.setConfiguration(),v.onDidChangeConfiguration(this.setConfiguration,this,this.disposables),v.onDidCloseTextDocument(i=>{let n=this.buffers.get(i.bufnr);n&&(n.dispose(),this.buffers.delete(i.bufnr))},null,this.disposables),v.onDidChangeTextDocument(i=>{let n=this.buffers.get(i.bufnr);n&&n.onChange(i)},null,this.disposables)}setConfiguration(e){if(e&&!e.affectsConfiguration("refactor"))return;let t=v.getConfiguration("refactor");this.config=Object.assign(this.config||{},{afterContext:t.get("afterContext",3),beforeContext:t.get("beforeContext",3),openCommand:t.get("openCommand","edit"),saveToFile:t.get("saveToFile",!0)})}async doRefactor(){let{doc:e,position:t}=await this.handler.getCurrentState();if(!N.hasProvider("rename",e.textDocument))throw new Error("Rename provider not found for current buffer");await e.synchronize();let i=await this.handler.withRequestToken("refactor",async n=>{let s=await N.prepareRename(e.textDocument,t,n);if(n.isCancellationRequested)return null;if(s===!1)throw new Error("Provider returns null on prepare, unable to rename at current position");let o=await N.provideRenameEdits(e.textDocument,t,"NewName",n);if(n.isCancellationRequested)return null;if(!o)throw new Error("Provider returns null for rename edits.");return o});i&&await this.fromWorkspaceEdit(i,e.filetype)}async search(e){let t=await this.createRefactorBuffer();if(!t)return;let i=await this.nvim.call("getcwd",[]);await new bw(this.nvim).run(e,i,t)}async save(e){let t=this.buffers.get(e);if(t)return await t.save()}getBuffer(e){return this.buffers.get(e)}async createRefactorBuffer(e){let{nvim:t}=this,[i,n]=await t.eval("[win_getid(),getcwd()]"),{openCommand:s}=this.config;t.pauseNotification(),t.command(`${s} ${age}${lge++}`,!0),t.command("setl buftype=acwrite nobuflisted bufhidden=wipe nofen wrap conceallevel=2 concealcursor=n",!0),t.command("setl undolevels=-1 nolist nospell noswapfile foldmethod=expr foldexpr=coc#util#refactor_foldlevel(v:lnum)",!0),t.command("setl foldtext=coc#util#refactor_fold_text(v:foldstart)",!0),t.call("setline",[1,["Save current buffer to make changes",nf]],!0),t.call("matchadd",["Comment","\\%1l"],!0),t.call("matchadd",["Conceal","^\\%u3000"],!0),t.call("matchadd",["Label","^\\%u3000\\zs\\S\\+"],!0),t.command("setl nomod",!0),e&&t.command(`runtime! syntax/${e}.vim`,!0),t.call("coc#util#do_autocmd",["CocRefactorOpen"],!0);let[,o]=await t.resumeNotification();if(o)return;let[a,l]=await t.eval('[bufnr("%"),win_getid()]'),c={fromWinid:i,winid:l,cwd:n};await v.document;let u=new ww(a,this.srcId,this.nvim,this.config,c);return this.buffers.set(a,u),u}async fromLines(e){let t=await this.createRefactorBuffer();return t&&await t.buffer.setLines(e,{start:0,end:-1,strictIndexing:!1}),t}async fromLocations(e,t){if(!e||e.length==0)return null;let i={},n={changes:i};for(let s of e){let o=i[s.uri]||[];o.push({range:s.range,newText:""}),i[s.uri]=o}return await this.fromWorkspaceEdit(n,t)}async fromWorkspaceEdit(e,t){if(!e||cge(e))return;let i=[],{beforeContext:n,afterContext:s}=this.config,{changes:o,documentChanges:a}=e;if(!o){o={};for(let c of a||[])if(sf.TextDocumentEdit.is(c)){let{textDocument:u,edits:f}=c;u.uri.startsWith("file:")&&(o[u.uri]=f)}}for(let c of Object.keys(o)){let u=await this.getLineCount(c),f=o[c],d=[],h=null,p=null,g=[];f.sort((b,y)=>b.range.start.line-y.range.start.line);for(let b of f){let{line:y}=b.range.start,S=Math.max(0,y-n);h!=null&&S<p?(p=Math.min(u,y+s+1),g.push(UG(b.range,h))):(h!=null&&d.push({start:h,end:p,highlights:g}),h=S,p=Math.min(u,y+s+1),g=[UG(b.range,h)])}h!=null&&d.push({start:h,end:p,highlights:g}),i.push({ranges:d,filepath:B.parse(c).fsPath})}let l=await this.createRefactorBuffer(t);return await l.addFileItems(i),l}async getLineCount(e){let t=v.getDocument(e);return t?t.lineCount:await VB(B.parse(e).fsPath)}reset(){this.timer&&clearTimeout(this.timer);for(let e of this.buffers.values())e.dispose();this.buffers.clear()}dispose(){this.timer&&clearTimeout(this.timer),this._onCreate.dispose();for(let e of this.buffers.values())e.dispose();this.buffers.clear(),G(this.disposables)}}});var wp,n8e,Sw,WG=R(()=>{wp=E(H());Re();Vt();Te();Y();n8e=U()("handler-rename"),Sw=class{constructor(e,t){this.nvim=e;this.handler=t}async getWordEdit(){let{doc:e,position:t}=await this.handler.getCurrentState(),i=e.getWordRangeAtPosition(t);if(!i||Fs(i))return null;let n=e.textDocument.getText(i);if(N.hasProvider("rename",e.textDocument)){await e.synchronize();let o=new wp.CancellationTokenSource;if(await N.prepareRename(e.textDocument,t,o.token)===!1)return null;let l=await N.provideRenameEdits(e.textDocument,t,n,o.token);if(l)return l}D.showMessage("Rename provider not found, extract word ranges from current buffer","more");let s=e.getSymbolRanges(n);return{changes:{[e.uri]:s.map(o=>({range:o,newText:n}))}}}async rename(e){let{doc:t,position:i}=await this.handler.getCurrentState();this.handler.checkProvier("rename",t.textDocument),await t.synchronize();let n=new wp.CancellationTokenSource().token,s=await N.prepareRename(t.textDocument,i,n);if(s===!1)return D.showMessage("Invalid position for rename","warning"),!1;let o;if(e||(wp.Range.is(s)?(o=t.textDocument.getText(s),await D.moveTo(s.start)):s&&typeof s.placeholder=="string"?o=s.placeholder:o=await this.nvim.eval('expand("<cword>")'),e=await D.requestInput("New name",o)),!e)return!1;let a=await N.provideRenameEdits(t.textDocument,i,e,n);return n.isCancellationRequested||!a?!1:(await v.applyEdit(a),v.isVim&&this.nvim.command("redraw",!0),!0)}}});var WD,Cw,zG=R(()=>{WD=E(H());Re();ri();Vt();Te();Y();Cw=class{constructor(e,t){this.nvim=e;this.handler=t;this.selectionRange=null}async getSelectionRanges(){let{doc:e,position:t}=await this.handler.getCurrentState();return this.handler.checkProvier("selectionRange",e.textDocument),await e.synchronize(),await this.handler.withRequestToken("selection ranges",n=>N.getSelectionRanges(e.textDocument,[t],n))}async selectRange(e,t){let{nvim:i}=this,{doc:n}=await this.handler.getCurrentState();this.handler.checkProvier("selectionRange",n.textDocument);let s=[];if(!t&&(!this.selectionRange||!e))return;if(e){let c=await v.getSelectedRange(e,n);s.push(c.start,c.end)}else{let c=await D.getCursorPosition();s.push(c)}if(!t){let c=WD.Range.create(s[0],s[1]),{selectionRange:u}=this;for(;u&&u.parent&&!je(u.parent.range,c);)u=u.parent;u&&u.parent&&await v.selectRange(u.range);return}await n.synchronize();let o=await this.handler.withRequestToken("selection ranges",c=>N.getSelectionRanges(n.textDocument,s,c));if(!o||o.length==0)return;await i.eval("mode()")!="n"&&await i.eval(`feedkeys("\\<Esc>", 'in')`);let l;if(o.length==1)l=o[0];else{let c=s[1]||s[0],u=WD.Range.create(s[0],c);for(l=o[0];l;){if(je(u,l.range)){l=l.parent;continue}if(Ft(s[0],l.range)==0&&Ft(c,l.range)==0)break;l=l.parent}}!l||(this.selectionRange=o[0],await v.selectRange(l.range))}}});function uge(r){return!!(r&&r.name&&r.kind&&Qs.Range.is(r.range)&&r.uri)}var VG,Qs,k8e,hs,of,GG=R(()=>{VG=E(require("path")),Qs=E(H());qe();Ei();_e();Re();kD();sv();de();Nu();Y();k8e=U()("Handler-callHierarchy");hs=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.highlightWinids=new Set;this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),this.disposables.push(se.registerCommand(hs.commandId,async(i,n,s)=>{var l;let{nvim:o}=this;await o.call("win_gotoid",[i]),await v.jumpTo(n.uri,n.selectionRange.start,s);let a=await o.window;if(a.clearMatchGroup(hs.rangesHighlight),a.highlightRanges(hs.rangesHighlight,[n.selectionRange],10,!0),!!((l=n.ranges)==null?void 0:l.length)){if(n.sourceUri){let c=v.getDocument(n.sourceUri);if(!c)return;let u=await o.call("coc#compat#buf_win_id",[c.bufnr]);if(u==-1)return;u!=a.id&&(a=o.createWindow(u),a.clearMatchGroup(hs.rangesHighlight))}a.highlightRanges(hs.rangesHighlight,n.ranges,100,!0),this.highlightWinids.add(a.id)}},null,!0)),O.on("BufWinEnter",(i,n)=>{this.highlightWinids.has(n)&&(this.highlightWinids.delete(n),e.createWindow(n).clearMatchGroup(hs.rangesHighlight))},null,this.disposables)}loadConfiguration(e){if(!e||e.affectsConfiguration("callHierarchy")){let t=v.getConfiguration("callHierarchy");this.config={splitCommand:t.get("splitCommand"),openCommand:t.get("openCommand"),enableTooltip:t.get("enableTooltip")}}}createProvider(e,t,i,n){let s=new Qs.Emitter,o,a,l=()=>{o&&(o.cancel(),o.dispose(),o=null)},c=(f,d)=>{let h=f.children;if(!Array.isArray(h))return;if(h.find(g=>g==d))return f;for(let g of h){let b=c(g,d);if(b)return b}},u={kind:n,onDidChangeTreeData:s.event,getTreeItem:f=>{var h;let d=new Kn(f.name,f.children?$e.Expanded:$e.Collapsed);return this.config.enableTooltip&&(d.tooltip=VG.default.relative(v.cwd,B.parse(f.uri).fsPath)),d.description=f.detail,d.deprecated=(h=f.tags)==null?void 0:h.includes(Qs.SymbolTag.Deprecated),d.icon=this.handler.getIcon(f.kind),d.command={command:hs.commandId,title:"open location",arguments:[t,f,this.config.openCommand]},d},getChildren:async f=>{l(),o=new Qs.CancellationTokenSource;let{token:d}=o;if(!f){if(!a&&(a=await this.prepare(e,i,d),!(a==null?void 0:a.length)))return;for(let p of a){let g=await this.getChildren(e,p,u.kind,d);if(d.isCancellationRequested)break;Array.isArray(g)&&(p.children=g)}return a}if(f.children)return f.children;let h=await this.getChildren(e,f,u.kind,d);return o=null,d.isCancellationRequested?[]:(f.children=h,h)},resolveActions:()=>[{title:"Open in new tab",handler:async f=>{await se.executeCommand(hs.commandId,t,f,"tabe")}},{title:"Show Incoming Calls",handler:f=>{a=[ns(f,["children","ranges","sourceUri"])],u.kind="incoming",s.fire(void 0)}},{title:"Show Outgoing Calls",handler:f=>{a=[ns(f,["children","ranges","sourceUri"])],u.kind="outgoing",s.fire(void 0)}},{title:"Dismiss",handler:async f=>{let d;for(let p of a)if(d=c(p,f),d)break;if(!d)return;let h=d.children.findIndex(p=>p===f);d.children.splice(h,1),s.fire(d)}}],dispose:()=>{l(),s.dispose(),a=void 0,s=void 0}};return u}async getChildren(e,t,i,n){let s=[];if(i=="incoming"){let o=await N.provideIncomingCalls(e,t,n);o&&(s=o.map(a=>Object.assign(a.from,{ranges:a.fromRanges})))}else{let o=await N.provideOutgoingCalls(e,t,n);o&&(s=o.map(a=>Object.assign(a.to,{ranges:a.fromRanges,sourceUri:t.uri})))}return s}async prepare(e,t,i){this.handler.checkProvier("callHierarchy",e);let n=await N.prepareCallHierarchy(e,t,i);return uge(n)?[n]:n}async getCallHierarchyItems(e,t){let{doc:i,position:n}=await this.handler.getCurrentState(),s=new Qs.CancellationTokenSource;if(!e){await i.synchronize();let a=await this.prepare(i.textDocument,n,s.token);if(e=a?a[0]:void 0,!a)return}let o=t=="incoming"?"provideIncomingCalls":"provideOutgoingCalls";return await N[o](i.textDocument,e,s.token)}async getIncoming(e){return await this.getCallHierarchyItems(e,"incoming")}async getOutgoing(e){return await this.getCallHierarchyItems(e,"outgoing")}async showCallHierarchyTree(e){let{doc:t,position:i,winid:n}=await this.handler.getCurrentState();await t.synchronize();let s=this.createProvider(t.textDocument,n,i,e),o=new Ya("calls",{treeDataProvider:s});o.title=`${e.toUpperCase()} CALLS`,s.onDidChangeTreeData(a=>{a||(o.title=`${s.kind.toUpperCase()} CALLS`)}),o.onDidChangeVisibility(a=>{a.visible||s.dispose()}),this.disposables.push(o),await o.show(this.config.splitCommand)}dispose(){this.highlightWinids.clear(),G(this.disposables)}},of=hs;of.commandId="callHierarchy.reveal",of.rangesHighlight="CocSelectedRange"});var KG,af,fge,dge,oa,_w,JG=R(()=>{KG=E(Ui()),af=E(H());Re();Y();fge=U()("semanticTokens-buffer"),dge="CocSem_",oa="semanticTokens",_w=class{constructor(e,t,i){this.nvim=e;this.bufnr=t;this.config=i;this.highlight=(0,KG.default)(()=>{this.doHighlight().catch(n=>{fge.error("Error on semanticTokens highlight:",n.stack)})},global.hasOwnProperty("__TEST__")?10:2e3),this.highlight()}onChange(){this.cancel(),this.highlight()}async forceHighlight(){this.cancel(),this.highlight.clear(),await this.doHighlight()}get highlights(){return this._highlights}get enabled(){if(!this.config.enabled)return!1;let e=v.getDocument(this.bufnr);return!e||!e.attached?!1:N.hasProvider("semanticTokens",e.textDocument)}get previousVersion(){if(!!this.previousResults)return this.previousResults.version}get buffer(){return this.nvim.createBuffer(this.bufnr)}checkState(){if(!this.config.enabled)throw new Error("SemanticTokens highlights disabled by configuration");let e=v.getDocument(this.bufnr);if(!e||!e.attached)throw new Error("Document not attached");if(!N.hasProvider("semanticTokens",e.textDocument))throw new Error("SemanticTokens provider not found, your languageserver may not support it")}setState(e){e?this.highlight():(this.highlight.clear(),this.clearHighlight())}async doHighlight(){if(!this.enabled)return;let e=v.getDocument(this.bufnr),{nvim:t}=this;if(await t.call("bufwinid",[this.bufnr])==-1)return;let n=await this.requestHighlights(e);if(!n)return;if(!n.length){this.clearHighlight();return}let s=[];v.env.updateHighlight&&(s=await t.call("coc#highlight#get_highlights",[this.bufnr,oa]));let{highlights:o,lines:a}=this.calculateHighlightUpdates(s,n);if(t.pauseNotification(),!v.env.updateHighlight)this.buffer.clearNamespace(oa,0,-1);else for(let c of a)this.buffer.clearNamespace(oa,c,c+1);let l={};if(o.length)for(let c of o){let u=af.Range.create(c.lnum,c.colStart,c.lnum,c.colEnd);l[c.hlGroup]=l[c.hlGroup]||[],l[c.hlGroup].push(u)}for(let c of Object.keys(l))this.buffer.highlightRanges(oa,c,l[c]);t.resumeNotification(!1,!0),v.isVim&&t.command("redraw",!0)}calculateHighlightUpdates(e,t){let i=Intl.Collator("en").compare;function n(u,f){return u.lnum-f.lnum||u.colStart-f.colStart||u.colEnd-f.colEnd||i(u.hlGroup,f.hlGroup)}e=e.slice().sort(n),t=t.slice().sort(n);let s=new Map;for(let u of e)s.has(u.lnum)||s.set(u.lnum,[]),s.get(u.lnum).push(u);let o=new Map;for(let u of t)o.has(u.lnum)||o.set(u.lnum,[]),o.get(u.lnum).push(u);let a=Math.max((e[e.length-1]||{lnum:0}).lnum,(t[t.length-1]||{lnum:0}).lnum),l=new Set;for(let u=0;u<=a;u++){let f=s.has(u),d=o.has(u);if(f!==d){l.add(u);continue}else if(!f&&!d)continue;let h=s.get(u),p=o.get(u);if(h.length!==p.length){l.add(u);continue}for(let g=0;g<h.length;g++)if(n(h[g],p[g])!==0){l.add(u);continue}}let c=[];for(let u of l)c=c.concat(o.get(u)||[]);return{highlights:c,lines:l}}async requestHighlights(e,t){let i=N.getLegend(e.textDocument);if(!i)return;this.cancel(),this.tokenSource=new af.CancellationTokenSource;let{token:n}=this.tokenSource,s=N.hasSemanticTokensEdits(e.textDocument),o=t?null:this.previousResults,a,l=e.textDocument.version;if(s&&(o==null?void 0:o.resultId)?a=await N.provideDocumentSemanticTokensEdits(e.textDocument,o.resultId,n):a=await N.provideDocumentSemanticTokens(e.textDocument,n),this.tokenSource=null,n.isCancellationRequested||!a)return;let c=[];af.SemanticTokens.is(a)?c=a.data:(c=o.tokens,a.edits.forEach(p=>{p.deleteCount>0?c.splice(p.start,p.deleteCount,...p.data):c.splice(p.start,0,...p.data)})),this.previousResults={resultId:a.resultId,tokens:c,version:l};let u=[];for(let p=0;p<c.length;p+=5){let g=c[p],b=c[p+1],y=c[p+2],S=c[p+3],w=dge+i.tokenTypes[S];u.push({group:w,deltaLine:g,deltaStartCharacter:b,length:y})}let f=[],d=0,h=0;for(let{group:p,deltaLine:g,deltaStartCharacter:b,length:y}of u){let S=d+g,w=g===0?h+b:b,_=w+y;d=S,h=w,f.push({hlGroup:p,lnum:S,colStart:w,colEnd:_})}return this._highlights=f,f}clearHighlight(){this.buffer.clearNamespace(oa)}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}dispose(){this.highlight.clear(),this.previousResults=void 0,this.cancel()}}});var hge,Ew,Tw,YG=R(()=>{Ei();_e();Re();$u();de();Te();Y();JG();hge=U()("semanticTokens"),Ew="Statement",Tw=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),se.register({id:"semanticTokens.checkCurrent",execute:async()=>{try{(await this.getCurrentItem()).checkState()}catch(i){D.showMessage(i.message,"error");return}D.showMessage("Semantic tokens provider found for current buffer","more")}},!1,"check semantic tokens provider for current buffer"),se.register({id:"semanticTokens.clearCurrent",execute:async()=>{(await e.buffer).clearNamespace(oa,0,-1)}},!1,"clear semantic tokens highlights of current buffer"),se.register({id:"semanticTokens.clearAll",execute:async()=>{let i=await e.buffers;for(let n of i)n.clearNamespace(oa,0,-1)}},!1,"clear semantic tokens highlights of all buffers"),this.disposables.push({dispose:()=>{se.unregister("semanticTokens.checkCurrentBuffer")}}),O.on("BufEnter",i=>{let n=this.highlighters.getItem(i);if(!n)return;let s=v.getDocument(i);!s||s.textDocument.version==n.previousVersion||n.forceHighlight().catch(o=>{hge.error("Error on semantic highlighters:",o)})},null,this.disposables),this.highlighters=v.registerBufferSync(i=>new _w(this.nvim,i.bufnr,this.config)),N.onDidSemanticTokensRefresh(i=>{for(let n of this.highlighters.items){let s=v.getDocument(n.bufnr);s&&v.match(i,s.textDocument)&&n.highlight()}},null,this.disposables)}loadConfiguration(e){if(!e||e.affectsConfiguration("coc.preferences")){let i=v.getConfiguration("coc.preferences").get("semanticTokensHighlights",!0);if(v.isVim&&!v.env.textprop&&(i=!1),this.config&&i!=this.config.enabled&&this.highlighters)for(let n of this.highlighters.items)n.setState(i);this.config?this.config.enabled=i:this.config={enabled:i}}}async getCurrentItem(){let e=await this.nvim.buffer,t=this.highlighters.getItem(e.id);if(!t)throw new Error("current buffer not attached");return t}async highlightCurrent(){let e=await this.getCurrentItem();e.checkState(),await e.forceHighlight()}async showHiglightInfo(){if(!this.config.enabled)throw new Error("Semantic highlights is disabled by configuration.");let e=await this.getCurrentItem();e.checkState();let t=e.highlights||[],i=new an,{nvim:n}=this;n.pauseNotification(),n.command(`vs +setl\\ buftype=nofile __coc_semantic_highlights_${e.bufnr}__`,!0),n.command("setl bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1",!0),n.call("bufnr",["%"],!0);let s=await n.resumeNotification();if(s[1])throw new Error(`Error on buffer create: ${s[1]}`);let o=s[0][2];i.addLine("Semantic highlights info",Ew),i.addLine(""),i.addLine("The number of semantic tokens: "),i.addText(String(t.length),"Number"),i.addLine(""),i.addLine("Semantic highlight groups used by current buffer",Ew),i.addLine("");let a=[...new Set(t.map(({hlGroup:u})=>u))];for(let u of a)i.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:u,hlGroup:u}]),i.addLine("");i.addLine("Tokens types that current Language Server supported:",Ew),i.addLine("");let l=v.getDocument(e.bufnr),c=N.getLegend(l.textDocument);if(c==null?void 0:c.tokenTypes.length)for(let u of[...new Set(c.tokenTypes)])i.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:`CocSem_${u}`,hlGroup:`CocSem_${u}`}]),i.addLine("");else i.addLine("No token types supported","Comment");if(i.addLine("Tokens modifiers that current Language Server supported:",Ew),i.addLine(""),c==null?void 0:c.tokenModifiers.length)for(let u of[...new Set(c.tokenModifiers)])i.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:`CocSem_${u}`,hlGroup:`CocSem_${u}`}]),i.addLine("");else i.addLine("No token modifiers supported","Comment");n.pauseNotification(),i.render(n.createBuffer(o)),n.resumeNotification(!1,!0)}dispose(){this.highlighters.dispose(),G(this.disposables)}}});var kl,iVe,Dw,XG=R(()=>{kl=E(H());_e();Re();Va();de();yt();Y();iVe=U()("handler-signature"),Dw=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.signatureFactory=new tr(e),this.loadConfiguration(),this.disposables.push(this.signatureFactory),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),O.on("CursorMovedI",async(i,n)=>{let s=this.lastPosition;!s||s.bufnr==i&&s.lnum==n[0]&&s.col<=n[1]||this.signatureFactory.close()},null,this.disposables),O.on(["InsertLeave","BufEnter"],()=>{var i;(i=this.tokenSource)==null||i.cancel()},null,this.disposables),O.on("TextChangedI",()=>{this.config.hideOnChange&&this.signatureFactory.close()},null,this.disposables),O.on("TextInsert",async(i,n,s)=>{if(!this.config.trigger)return;let o=this.getTextDocument(i);!o||!N.shouldTriggerSignatureHelp(o.textDocument,s)||await this._triggerSignatureHelp(o,{line:n.lnum-1,character:n.pre.length},!1)},null,this.disposables)}getTextDocument(e){let t=v.getDocument(e);if(!(!t||t.isCommandLine||!t.attached))return t}loadConfiguration(e){if(!e||e.affectsConfiguration("signature")){let t=v.getConfiguration("signature"),i=t.get("target","float");i=="float"&&!v.floatSupported&&(i="echo"),this.config={target:i,floatConfig:t.get("floatConfig",{}),trigger:t.get("enable",!0),wait:Math.max(t.get("triggerSignatureWait",500),200),preferAbove:t.get("preferShownAbove",!0),hideOnChange:t.get("hideOnTextChange",!1)}}}async triggerSignatureHelp(){let{doc:e,position:t,mode:i}=await this.handler.getCurrentState();if(!N.hasProvider("signature",e.textDocument))return!1;let n=0,s=t.character;if(i=="s"){let o=await this.nvim.getVar("coc_last_placeholder");if(o){let{start:a,end:l,bufnr:c}=o;c==e.bufnr&&a.line==l.line&&a.line==t.line&&(t=kl.Position.create(a.line,a.character),n=s-t.character)}}return await this._triggerSignatureHelp(e,t,!0,n)}async _triggerSignatureHelp(e,t,i=!0,n=0){var d;(d=this.tokenSource)==null||d.cancel();let s=this.tokenSource=new kl.CancellationTokenSource,o=s.token;o.onCancellationRequested(()=>{s.dispose(),this.tokenSource=void 0});let{target:a}=this.config,l=this.timer=setTimeout(()=>{s.cancel()},this.config.wait);await e.patchChange(!0);let c=await N.getSignatureHelp(e.textDocument,t,o,{isRetrigger:this.signatureFactory.checkRetrigger(e.bufnr),triggerKind:i?kl.SignatureHelpTriggerKind.Invoked:kl.SignatureHelpTriggerKind.TriggerCharacter});if(clearTimeout(l),o.isCancellationRequested)return!1;if(!c||c.signatures.length==0)return this.signatureFactory.close(),!1;let{activeSignature:u,signatures:f}=c;if(u){let[h]=f.splice(u,1);h&&f.unshift(h)}return a=="echo"?this.echoSignature(c):await this.showSignatureHelp(e,t,c,n),!0}async showSignatureHelp(e,t,i,n){let{signatures:s,activeParameter:o}=i,a=null,l=n,c=s.reduce((h,p,g)=>{var S;let b=null,y=p.label.indexOf("(");if(g==0&&o!=null){let w=(S=p.parameters)==null?void 0:S[o];if(w){let _=p.label.slice(y==-1?0:y);if(a=w.documentation,typeof w.label=="string"){let L=_.slice(0),$=L.match(new RegExp("\\b"+w.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b")),I=$?$.index:L.indexOf(w.label);I!=-1&&(b=[I+y,I+w.label.length+y])}else b=w.label}}if(b==null&&(b=[y+1,y+1]),n==l&&(n=n+b[0]+1),h.push({content:p.label,filetype:e.filetype,active:b}),a){let w=typeof a=="string"?a:a.value;w.trim().length&&h.push({content:w,filetype:Td(p.documentation)?"markdown":"txt"})}if(g==0&&p.documentation){let{documentation:w}=p,_=typeof w=="string"?w:w.value;_.trim().length&&h.push({content:_,filetype:Td(p.documentation)?"markdown":"txt"})}return h},[]),u=e.getline(t.line,!1).slice(0,t.character);this.lastPosition={bufnr:e.bufnr,lnum:t.line+1,col:re(u)+1};let f=v.getConfiguration("coc.preferences").get("excludeImageLinksInMarkdownDocument"),d=this.signatureFactory.applyFloatConfig({preferTop:this.config.preferAbove,autoHide:!1,offsetX:n,modes:["i","ic","s"],excludeImages:f},this.config.floatConfig);await this.signatureFactory.show(c,d)}echoSignature(e){var o;let{signatures:t,activeParameter:i}=e,n=v.env.columns;t=t.slice(0,v.env.cmdheight);let s=[];for(let a of t){let l=[],{label:c}=a;c=c.replace(/\n/g," "),c.length>=n-16&&(c=c.slice(0,n-16)+"...");let u=c.indexOf("(");if(u==-1)l=[{text:c,type:"Normal"}];else{l.push({text:c.slice(0,u),type:"Label"});let f=c.slice(u);if(s.length==0&&i!=null){let d=(o=a.parameters)==null?void 0:o[i];if(d){let h,p;if(typeof d.label=="string"){let g=f.slice(0),b=g.match(new RegExp("\\b"+d.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b")),y=b?b.index:g.indexOf(d.label);y==-1?l.push({text:f,type:"Normal"}):(h=y,p=y+d.label.length)}else[h,p]=d.label,h=h-u,p=p-u;h!=null&&p!=null&&(l.push({text:f.slice(0,h),type:"Normal"}),l.push({text:f.slice(h,p),type:"MoreMsg"}),l.push({text:f.slice(p),type:"Normal"}))}}else l.push({text:f,type:"Normal"})}s.push(l)}this.nvim.callTimer("coc#util#echo_signatures",[s],!0)}dispose(){G(this.disposables),this.timer&&clearTimeout(this.timer)}}});function ZG(r){let e=[],t=r.slice();return t.sort(QG),t.forEach(i=>e9(e,i,0)),e}function QG(r,e){let t=r.selectionRange,i=e.selectionRange;return De(t.start,i.start)}function e9(r,e,t){let{name:i,selectionRange:n,kind:s,children:o,range:a}=e,{start:l}=n||a;if(r.push({col:l.character+1,lnum:l.line+1,text:i,level:t,kind:us(s),range:a,selectionRange:n}),o&&o.length){o.sort(QG);for(let c of o)e9(r,c,t+1)}}function pge(r){return r&&!r.hasOwnProperty("location")}function t9(r){return pge(r[0])}var zD=R(()=>{fp();Vt()});var i9,aa,Rw,r9=R(()=>{i9=E(Ui()),aa=E(H());Re();de();Y();zD();Rw=class{constructor(e){this.bufnr=e;this.disposables=[];this.autoUpdate=!1;this._onDidUpdate=new aa.Emitter;this.onDidUpdate=this._onDidUpdate.event;this.fetchSymbols=(0,i9.default)(()=>{this._fetchSymbols().logError()},global.hasOwnProperty("__TEST__")?10:500)}async getSymbols(){var t;let e=v.getDocument(this.bufnr);return e?(await e.patchChange(),this.autoUpdate=!0,e.version==this.version&&((t=this.symbols)==null?void 0:t.length)?this.symbols:(this.cancel(),await this._fetchSymbols(),this.symbols)):[]}onChange(){this.cancel(),this.autoUpdate&&this.fetchSymbols()}get textDocument(){var e;return(e=v.getDocument(this.bufnr))==null?void 0:e.textDocument}async _fetchSymbols(){let{textDocument:e}=this;if(!e)return;let{version:t}=e,i=this.tokenSource=new aa.CancellationTokenSource,{token:n}=i,s=await N.getDocumentSymbol(e,n);if(this.tokenSource=void 0,s==null||n.isCancellationRequested)return;let o;t9(s)?o=s:o=s.map(a=>{let l=aa.DocumentSymbol.create(a.name,"",a.kind,a.location.range,a.location.range);return a.deprecated&&(l.tags=[aa.SymbolTag.Deprecated]),l}),this.version=t,this.symbols=o,this._onDidUpdate.fire(o)}cancel(){this.fetchSymbols.clear(),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose(),this.tokenSource=null)}dispose(){this.cancel(),this.symbols=void 0,this._onDidUpdate.dispose(),G(this.disposables)}}});function mge(r){return r?typeof r.text=="string"&&typeof r.hlGroup=="string":!1}function gge(r,e){return r.label===e.label&&r.deprecated===e.deprecated&&r.key===e.key}function vge(r,e){return r.length!==e.length?!1:r.every((t,i)=>gge(t,e[i]))}var n9,Pw,s9=R(()=>{Ye();n9=E(H());Ei();de();nv();Pw=class{constructor(e){this.opts=e;this.disposables=[];this._onDidChangeTreeData=new n9.Emitter;this.onDidChangeTreeData=this._onDidChangeTreeData.event;this.invokeCommand=`_invoke_${ue()}`,this.disposables.push(se.registerCommand(this.invokeCommand,async t=>{typeof e.handleClick=="function"?await e.handleClick(t):console.error("Handler not found")},null,!0)),typeof e.resolveActions=="function"&&(this.resolveActions=e.resolveActions.bind(this))}iterate(e,t,i,n){let s=n(e,t,i);if(s===!1)return!1;if(Array.isArray(e.children)){for(let o of e.children)if(this.iterate(o,e,i+1,n)===!1)return!1}return s}updateNodes(e,t,i,n=!0){let s=vge(e,t),o=(a,l,c)=>{var f,d,h,p,g,b;let u=!1;for(let y of Object.keys(l))["children","key"].includes(y)||(a[y]=l[y]);if(((f=a.children)==null?void 0:f.length)&&!((d=l.children)==null?void 0:d.length)&&(delete a.children,u=!0),!((h=a.children)==null?void 0:h.length)&&((p=l.children)==null?void 0:p.length)&&(a.children=l.children,u=!0),u){c&&this._onDidChangeTreeData.fire(a);return}((g=a.children)==null?void 0:g.length)&&((b=l.children)==null?void 0:b.length)&&this.updateNodes(a.children,l.children,a,c)};if(s)for(let a=0;a<e.length;a++)o(e[a],t[a],n);else{let a=e.splice(0,e.length),l=new Set;for(let c=0;c<t.length;c++){let u=t[c],f;if(u.key?f=a.findIndex((d,h)=>!l.has(h)&&d.key==u.key):f=a.findIndex((d,h)=>!l.has(h)&&d.label==u.label),f===-1)e[c]=u;else{l.add(f);let d=a[f];o(d,u,!1),e[c]=d}}n&&this._onDidChangeTreeData.fire(i)}}update(e,t){if(!!this.data)return t?(this.data=e||[],this._onDidChangeTreeData.fire(void 0)):this.updateNodes(this.data,e||[],void 0),this.data}getTreeItem(e){var s;let t=e.label,{expandLevel:i}=this.opts,n;if(!((s=e.children)==null?void 0:s.length))n=new Kn(t);else if(i&&i>0){let o=this.getLevel(e),a=o&&o<=i?$e.Expanded:$e.Collapsed;n=new Kn(t,a)}else n=new Kn(t,$e.Collapsed);if(n.description=e.description,e.deprecated&&(n.deprecated=!0),e.tooltip&&(n.tooltip=e.tooltip),mge(e.icon))n.icon=e.icon;else if(typeof this.opts.resolveIcon=="function"){let o=this.opts.resolveIcon(e);o&&(n.icon=o)}return n}async getChildren(e){if(e)return e.children||[];if(this.data)return this.data;let t=await Promise.resolve(this.opts.provideData());if(!Array.isArray(t))throw new Error("Unable to fetch data");return this.data=t,t}getParent(e){if(!this.data)return;let t;for(let i of this.data)if(this.iterate(i,null,0,(s,o)=>{if(s===e)return t=o,!1})===!1)break;return t}getLevel(e){if(!this.data)return;let t=0;for(let i of this.data)if(this.iterate(i,null,1,(s,o,a)=>{if(s===e)return t=a,!1})===!1)break;return t}async resolveTreeItem(e,t,i){if(typeof this.opts.resolveItem=="function"){let n=await Promise.resolve(this.opts.resolveItem(e,t,i));n&&Object.assign(e,n)}return e.command||(e.command={title:`invoke ${t.label}`,command:this.invokeCommand,arguments:[t]}),e}dispose(){this.data=[],this._onDidChangeTreeData.dispose(),typeof this.opts.onDispose=="function"&&this.opts.onDispose(),G(this.disposables)}}});var o9,a9,BVe,kw,l9=R(()=>{o9=E(Ui()),a9=E(H());_e();Re();s9();sv();de();Vt();Te();Y();BVe=U()("symbols-outline"),kw=class{constructor(e,t,i){this.nvim=e;this.buffers=t;this.handler=i;this.providersMap=new Map;this.treeViews=new WeakMap;this.originalWins=new WeakMap;this.disposables=[];this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),O.on("BufUnload",async n=>{let s=this.providersMap.get(n);if(!s)return;this.providersMap.delete(n),s.dispose();let o=this.treeViews.get(s);this.treeViews.delete(s);for(let a of o){if(!a.visible)continue;let l=this.originalWins.get(a);if(l&&this.config.checkBufferSwitch&&await e.call("win_id2win",[l])){e.createWindow(a.windowId).setVar("target_bufnr",-1,!0);let f=setTimeout(()=>{a.visible&&a.dispose()},200);this.disposables.push({dispose:()=>{clearTimeout(f)}});continue}a.dispose()}},null,this.disposables),O.on("BufEnter",(0,o9.default)(()=>{this._onBufEnter()},global.hasOwnProperty("__TEST__")?100:300),null,this.disposables),O.on("CursorHold",async n=>{if(!this.config.followCursor)return;let s=this.providersMap.get(n);if(!s)return;let o=this.treeViews.get(s);if(!o||!o.length)return;let a=await this.nvim.call("coc#window#find",["cocViewId","OUTLINE"]);if(a==-1)return;let l=o.find(h=>h.windowId==a);if(!l)return;let c=await D.getCursorPosition(),u,f=h=>{if(Ft(c,h.range)!=0)return!1;if(u=h,Array.isArray(h.children)){for(let p of h.children)if(f(p))break}return!0},d=await Promise.resolve(s.getChildren());for(let h of d)if(f(h))break;u&&await l.reveal(u)},null,this.disposables)}async _onBufEnter(){if(!this.config.checkBufferSwitch)return;let[e,t,i]=await this.nvim.eval("[win_getid(),bufnr('%'),coc#window#find('cocViewId', 'OUTLINE')]");e==i||i==-1||!this.buffers.getItem(t)||await this.nvim.createWindow(i).getVar("target_bufnr")==t||await this.show(1)}loadConfiguration(e){if(!e||e.affectsConfiguration("outline")){let t=v.getConfiguration("outline");this.config={splitCommand:t.get("splitCommand"),followCursor:t.get("followCursor"),keepWindow:t.get("keepWindow"),expandLevel:t.get("expandLevel"),checkBufferSwitch:t.get("checkBufferSwitch"),sortBy:t.get("sortBy"),showLineNumber:t.get("showLineNumber"),codeActionKinds:t.get("codeActionKinds")}}}convertSymbolToNode(e,t){var i;return{label:e.name,tooltip:e.detail,description:this.config.showLineNumber?`${e.selectionRange.start.line+1}`:void 0,icon:this.handler.getIcon(e.kind),deprecated:(i=e.tags)==null?void 0:i.includes(a9.SymbolTag.Deprecated),kind:e.kind,range:e.range,selectRange:e.selectionRange,children:Array.isArray(e.children)?e.children.map(n=>this.convertSymbolToNode(n,t)).sort(t):void 0}}setMessage(e,t){let i=this.treeViews.get(e);i&&i.forEach(n=>{n.message=t})}createProvider(e){let{bufnr:t}=e,{sortBy:i}=this.config,{nvim:n}=this,s=(c,u)=>i==="name"?c.label<u.label?-1:1:i==="category"?c.kind==u.kind?c.label<u.label?-1:1:c.kind-u.kind:De(c.selectRange.start,u.selectRange.start),o=c=>c.map(u=>this.convertSymbolToNode(u,s)).sort(s),a,l=new Pw({expandLevel:this.config.expandLevel,provideData:async()=>{let c=v.getDocument(t);if(!N.hasProvider("documentSymbol",c.textDocument))throw new Error("Document symbol provider not found");this.setMessage(l,"Loading document symbols");let u=await e.getSymbols();if(!u||u.length==0)throw new Error("Empty symbols returned from language server. ");return a=e.onDidUpdate(f=>{l.update(o(f))}),this.setMessage(l,void 0),o(u)},handleClick:async c=>{let u=await n.call("bufwinnr",[t]);if(u==-1)return;n.pauseNotification(),n.command(`${u}wincmd w`,!0);let f=c.selectRange.start;n.call("coc#cursor#move_to",[f.line,f.character],!0),n.command("normal! zz",!0);let d=n.createBuffer(t);d.highlightRanges("outline-hover","CocHoverRange",[c.selectRange]),n.command("redraw",!0),await n.resumeNotification(),setTimeout(()=>{d.clearNamespace("outline-hover"),n.command("redraw",!0)},global.hasOwnProperty("__TEST__")?10:300)},resolveActions:async(c,u)=>{let f=await n.call("bufwinnr",[t]);if(f==-1)return;let d=v.getDocument(t);return[...(await this.handler.getCodeActions(d,u.range,this.config.codeActionKinds)).map(g=>({title:g.title,handler:async()=>{let b=u.range.start;await n.command(`${f}wincmd w`),await this.nvim.call("coc#cursor#move_to",[b.line,b.character]),await this.handler.applyCodeAction(g)}})),{title:"Visual Select",handler:async g=>{await n.command(`${f}wincmd w`),await v.selectRange(g.range)}}]},onDispose:()=>{this.providersMap.delete(e.bufnr),a&&a.dispose()}});return l}async show(e){await v.document;let[t,i]=await this.nvim.eval('[bufnr("%"),win_getid()]'),n=this.buffers.getItem(t);if(!n)throw new Error("Document not attached");let s=this.providersMap.get(t);s||(s=this.createProvider(n),this.providersMap.set(t,s));let o=new Ya("OUTLINE",{enableFilter:!0,treeDataProvider:s});this.originalWins.set(o,i);let a=this.treeViews.get(s)||[];a.push(o),this.treeViews.set(s,a),o.onDidChangeVisibility(({visible:l})=>{if(l||!this.treeViews.has(s))return;let c=this.treeViews.get(s)||[];if(c=c.filter(u=>u!==o),this.originalWins.delete(o),c.length){this.treeViews.set(s,c);return}s.dispose(),this.treeViews.delete(s)}),await o.show(this.config.splitCommand),o.windowId&&this.nvim.createWindow(o.windowId).setVar("target_bufnr",t,!0),(e==1||e===void 0&&this.config.keepWindow)&&await this.nvim.command("wincmd p")}has(e){return this.providersMap.has(e)}async hide(){let e=await this.nvim.call("coc#window#find",["cocViewId","OUTLINE"]);e!=-1&&await this.nvim.call("coc#window#close",[e])}dispose(){for(let e of this.providersMap.values()){e.dispose();for(let t of this.treeViews.get(e))t.dispose()}this.providersMap.clear(),G(this.disposables)}}});var lf,Iw,c9=R(()=>{lf=E(H());_e();Re();de();ri();Vt();Te();Y();r9();l9();zD();Iw=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.buffers=v.registerBufferSync(i=>{if(i.buftype=="")return new Rw(i.bufnr)}),this.outline=new kw(e,this.buffers,t),O.on("CursorHold",async i=>{!this.functionUpdate||!this.buffers.getItem(i)||await this.getCurrentFunctionSymbol(i)},null,this.disposables),O.on("InsertEnter",i=>{let n=this.buffers.getItem(i);n&&n.cancel()},null,this.disposables)}get functionUpdate(){return v.getConfiguration("coc.preferences").get("currentFunctionSymbolAutoUpdate",!1)}get labels(){return v.getConfiguration("suggest").get("completionItemKindLabels",{})}async getWorkspaceSymbols(e){this.handler.checkProvier("workspaceSymbols",null);let t=new lf.CancellationTokenSource;return await N.getWorkspaceSymbols(e,t.token)}async resolveWorkspaceSymbol(e){var i;if((i=e.location)==null?void 0:i.uri)return e;let t=new lf.CancellationTokenSource;return await N.resolveWorkspaceSymbol(e,t.token)}async getDocumentSymbols(e){let t=this.buffers.getItem(e);if(!t)return;let i=await t.getSymbols();return i?ZG(i):void 0}async getCurrentFunctionSymbol(e){e||(e=await this.nvim.call("bufnr",["%"]));let t=v.getDocument(e);if(!t||!t.attached||!N.hasProvider("documentSymbol",t.textDocument))return;let i=await D.getCursorPosition(),n=await this.getDocumentSymbols(e),s=this.nvim.createBuffer(e);if(!n||n.length===0)return s.setVar("coc_current_function","",!0),this.nvim.call("coc#util#do_autocmd",["CocStatusChange"],!0),"";n=n.filter(a=>["Class","Method","Function","Struct"].includes(a.kind));let o="";for(let a of n.reverse())if(a.range&&Ft(i,a.range)==0&&!a.text.endsWith(") callback")){o=a.text;let l=this.labels[a.kind.toLowerCase()];l&&(o=`${l} ${o}`);break}return this.functionUpdate&&(s.setVar("coc_current_function",o,!0),this.nvim.call("coc#util#do_autocmd",["CocStatusChange"],!0)),o}async selectSymbolRange(e,t,i){let{doc:n}=await this.handler.getCurrentState();this.handler.checkProvier("documentSymbol",n.textDocument);let s;if(t)s=await v.getSelectedRange(t,n);else{let l=await D.getCursorPosition();s=lf.Range.create(l,l)}let o=await this.getDocumentSymbols(n.bufnr);if(!o||o.length===0){D.showMessage("No symbols found","warning");return}o=o.filter(l=>i.includes(l.kind));let a;for(let l of o.reverse())if(l.range&&!je(l.range,s)&&Cn(s,l.range)){a=l.range;break}if(e&&a){let{start:l,end:c}=a,u=n.getline(l.line+1),f=n.getline(c.line-1);a=lf.Range.create(l.line+1,u.match(/^\s*/)[0].length,c.line-1,f.length)}a?await v.selectRange(a):["v","V",""].includes(t)&&await this.nvim.command("normal! gv")}async showOutline(e){await this.outline.show(e)}async hideOutline(){await this.outline.hide()}hasOutline(e){return this.outline.has(e)}dispose(){this.outline.dispose(),this.buffers.dispose(),G(this.disposables)}}});var Ow,bge,Lw,u9=R(()=>{Ow=E(H());_e();Re();de();Te();Y();gG();bG();_G();EG();TG();RG();PG();IG();LG();AG();HG();WG();zG();GG();YG();XG();c9();fp();bge=U()("Handler"),Lw=class{constructor(e){this.nvim=e;this.disposables=[];this.requestStatusItem=D.createStatusBarItem(0,{progress:!0}),O.on(["CursorMoved","CursorMovedI","InsertEnter","InsertSnippet","InsertLeave"],()=>{this.requestTokenSource&&(this.requestTokenSource.cancel(),this.requestTokenSource=null)},null,this.disposables),this.labels=v.getConfiguration("suggest").get("completionItemKindLabels",{}),this.fold=new fw(e,this),this.links=new gw(e,this),this.codeLens=new ow(e),this.colors=new cw(e,this),this.format=new hw(e,this),this.symbols=new Iw(e,this),this.refactor=new xw(e,this),this.hover=new mw(e,this),this.locations=new vw(e,this),this.signature=new Dw(e,this),this.rename=new Sw(e,this),this.codeActions=new nw(e,this),this.commands=new uw(e,v.env),this.callHierarchy=new of(e,this),this.documentHighlighter=new pw(e,this),this.semanticHighlighter=new Tw(e,this),this.selectionRange=new Cw(e,this),this.disposables.push({dispose:()=>{this.callHierarchy.dispose(),this.codeLens.dispose(),this.refactor.dispose(),this.signature.dispose(),this.symbols.dispose(),this.hover.dispose(),this.locations.dispose(),this.colors.dispose(),this.documentHighlighter.dispose(),this.semanticHighlighter.dispose()}})}async getCurrentState(){let{nvim:e}=this,[t,[i,n],s,o]=await e.eval("[bufnr('%'),coc#cursor#position(),win_getid(),mode()]"),a=v.getDocument(t);if(!a||!a.attached)throw new Error(`current buffer ${t} not attached`);return{doc:a,mode:o,position:Ow.Position.create(i,n),winid:s}}addDisposable(e){this.disposables.push(e)}checkProvier(e,t){if(!N.hasProvider(e,t))throw new Error(`${e} provider not found for current buffer, your language server doesn't support it.`)}async withRequestToken(e,t,i){this.requestTokenSource&&(this.requestTokenSource.cancel(),this.requestTokenSource.dispose()),this.requestTimer&&clearTimeout(this.requestTimer);let n=this.requestStatusItem;this.requestTokenSource=new Ow.CancellationTokenSource;let{token:s}=this.requestTokenSource;s.onCancellationRequested(()=>{n.text=`${e} request canceled`,n.isProgress=!1,this.requestTimer=setTimeout(()=>{n.hide()},500)}),n.isProgress=!0,n.text=`requesting ${e}`,n.show();let o;try{o=await Promise.resolve(t(s))}catch(a){D.showMessage(a.message,"error"),bge.error(`Error on ${e}`,a)}return this.requestTokenSource&&(this.requestTokenSource.dispose(),this.requestTokenSource=void 0),s.isCancellationRequested?null:(n.hide(),i&&(!o||Array.isArray(o)&&o.length==0)?(D.showMessage(`${e} not found`,"warning"),null):o)}getIcon(e){let{labels:t}=this,i=us(e),n=typeof t.default=="string"?t.default:i[0].toLowerCase(),s=i=="Unknown"?"":t[i[0].toLowerCase()+i.slice(1)];return(!s||typeof s!="string")&&(s=n),{text:s,hlGroup:i=="Unknown"?"CocSymbolDefault":`CocSymbol${i}`}}async getCodeActions(e,t,i){return await this.codeActions.getCodeActions(e,t,i)}async applyCodeAction(e){await this.codeActions.applyCodeAction(e)}async hasProvider(e){let t=await this.nvim.call("bufnr","%"),i=v.getDocument(t);return i?N.hasProvider(e,i.textDocument):!1}dispose(){this.requestTimer&&clearTimeout(this.requestTimer),G(this.disposables)}}});var f9,VD,d9,GD,cf,Aw,h9=R(()=>{f9=E(require("events")),VD=E(require("fs")),d9=E(require("path")),GD=E(H());qe();Ei();OD();mG();Xa();_e();ia();u9();By();sp();Yu();xl();En();Te();Y();cf=U()("plugin"),Aw=class extends f9.EventEmitter{constructor(e){super();this.nvim=e;this._ready=!1;this.actions=new Map;Object.defineProperty(v,"nvim",{get:()=>this.nvim}),v.onDidChangeWorkspaceFolders(()=>{e.setVar("WorkspaceFolders",v.folderPaths,!0)}),this.cursors=new rw(e),se.init(e,this),this.addAction("checkJsonExtension",()=>{we.has("coc-json")||D.showMessage("Run :CocInstall coc-json for json intellisense","more")}),this.addAction("rootPatterns",i=>{let n=v.getDocument(i);return n?{buffer:v.getRootPatterns(n,ir.Buffer),server:v.getRootPatterns(n,ir.LanguageServer),global:v.getRootPatterns(n,ir.Global)}:null}),this.addAction("getConfig",async i=>{let n=await v.document;return v.getConfiguration(i,n?n.uri:void 0)}),this.addAction("doAutocmd",async(i,...n)=>{let s=v.autocmds.get(i);if(s)try{await Promise.resolve(s.callback.apply(s.thisArg,n))}catch(o){cf.error(`Error on autocmd ${s.event}`,o),D.showMessage(`Error on autocmd ${s.event}: ${o.message}`)}}),this.addAction("openLog",async()=>{let i=cf.getLogFile();await v.jumpTo(B.file(i).toString())}),this.addAction("attach",()=>v.attach()),this.addAction("detach",()=>v.detach()),this.addAction("doKeymap",async(i,n="",s)=>{let o=v.keymaps.get(i);if(!o)return cf.error(`keymap for ${i} not found`),this.nvim.command(`silent! unmap <buffer> ${s.startsWith("{")&&s.endsWith("}")?`<${s.slice(1,-1)}>`:s}`,!0),n;let[a,l]=o,c=await Promise.resolve(a());return l&&await e.command(`silent! call repeat#set("\\<Plug>(coc-${i})", -1)`),c!=null?c:n}),this.addAction("registExtensions",async(...i)=>{for(let n of i)await we.loadExtension(n)}),this.addAction("snippetCheck",async(i,n)=>{if(i&&!we.has("coc-snippets"))return console.error("coc-snippets required for check expand status!"),!1;if(n&&vi.jumpable())return!0;if(i){let s=we.getExtensionApi("coc-snippets");if(s&&s.hasOwnProperty("expandable")&&await Promise.resolve(s.expandable()))return!0}return!1}),this.addAction("snippetNext",()=>vi.nextPlaceholder()),this.addAction("snippetPrev",()=>vi.previousPlaceholder()),this.addAction("snippetCancel",()=>vi.cancel()),this.addAction("openLocalConfig",()=>D.openLocalConfig()),this.addAction("showInfo",async()=>{this.infoChannel?this.infoChannel.clear():this.infoChannel=D.createOutputChannel("info");let i=this.infoChannel;i.appendLine("## versions"),i.appendLine("");let s=(await this.nvim.call("execute",["version"])).trim().split(/\r?\n/,2)[0].replace(/\(.*\)/,"").trim();i.appendLine("vim version: "+s+`${v.isVim?" "+v.env.version:""}`),i.appendLine("node version: "+process.version),i.appendLine("coc.nvim version: "+this.version),i.appendLine("coc.nvim directory: "+d9.default.dirname(__dirname)),i.appendLine("term: "+(process.env.TERM_PROGRAM||process.env.TERM)),i.appendLine("platform: "+process.platform),i.appendLine(""),i.appendLine("## Log of coc.nvim"),i.appendLine("");let o=cf.getLogFile();if(VD.default.existsSync(o)){let a=VD.default.readFileSync(o,{encoding:"utf8"});i.appendLine(a)}i.show()}),this.addAction("findLocations",(i,n,s,o)=>this.handler.locations.findLocations(i,n,s,o)),this.addAction("hasProvider",i=>this.handler.hasProvider(i)),this.addAction("getTagList",()=>this.handler.locations.getTagList()),this.addAction("hasSelected",()=>sa.hasSelected()),this.addAction("listNames",()=>gi.names),this.addAction("listDescriptions",()=>gi.descriptions),this.addAction("listLoadItems",i=>gi.loadItems(i)),this.addAction("search",(...i)=>this.handler.refactor.search(i)),this.addAction("cursorsSelect",(i,n,s)=>this.cursors.select(i,n,s)),this.addAction("fillDiagnostics",i=>Lt.setLocationlist(i)),this.addAction("saveRefactor",i=>this.handler.refactor.save(i)),this.addAction("commandList",()=>this.handler.commands.getCommandList()),this.addAction("selectSymbolRange",(i,n,s)=>this.handler.symbols.selectSymbolRange(i,n,s)),this.addAction("openList",(...i)=>gi.start(i)),this.addAction("listResume",i=>gi.resume(i)),this.addAction("listCancel",()=>gi.cancel(!0)),this.addAction("listPrev",i=>gi.previous(i)),this.addAction("listNext",i=>gi.next(i)),this.addAction("listFirst",i=>gi.first(i)),this.addAction("listLast",i=>gi.last(i)),this.addAction("sendRequest",(i,n,s)=>Fi.sendRequest(i,n,s)),this.addAction("sendNotification",(i,n,s)=>Fi.sendNotification(i,n,s)),this.addAction("registNotification",(i,n)=>Fi.registNotification(i,n)),this.addAction("updateConfig",(i,n)=>v.configurations.updateUserConfig({[i]:n})),this.addAction("links",()=>this.handler.links.getLinks()),this.addAction("openLink",()=>this.handler.links.openCurrentLink()),this.addAction("pickColor",()=>this.handler.colors.pickColor()),this.addAction("colorPresentation",()=>this.handler.colors.pickPresentation()),this.addAction("highlight",()=>this.handler.documentHighlighter.highlight()),this.addAction("fold",i=>this.handler.fold.fold(i)),this.addAction("startCompletion",i=>sa.startCompletion(i)),this.addAction("stopCompletion",()=>sa.stop(!1)),this.addAction("sourceStat",()=>ht.sourceStats()),this.addAction("refreshSource",i=>ht.refresh(i)),this.addAction("toggleSource",i=>ht.toggleSource(i)),this.addAction("diagnosticRefresh",i=>Lt.refresh(i)),this.addAction("diagnosticInfo",()=>Lt.echoMessage()),this.addAction("diagnosticToggle",()=>Lt.toggleDiagnostic()),this.addAction("diagnosticToggleBuffer",async i=>(i||(i=await e.call("bufnr",["%"])),Lt.toggleDiagnosticBuffer(i))),this.addAction("diagnosticNext",i=>Lt.jumpNext(i)),this.addAction("diagnosticPrevious",i=>Lt.jumpPrevious(i)),this.addAction("diagnosticPreview",()=>Lt.preview()),this.addAction("diagnosticList",()=>Lt.getDiagnosticList()),this.addAction("jumpDefinition",i=>this.handler.locations.gotoDefinition(i)),this.addAction("definitions",()=>this.handler.locations.definitions()),this.addAction("jumpDeclaration",i=>this.handler.locations.gotoDeclaration(i)),this.addAction("declarations",()=>this.handler.locations.declarations()),this.addAction("jumpImplementation",i=>this.handler.locations.gotoImplementation(i)),this.addAction("implementations",()=>this.handler.locations.implementations()),this.addAction("jumpTypeDefinition",i=>this.handler.locations.gotoTypeDefinition(i)),this.addAction("typeDefinitions",()=>this.handler.locations.typeDefinitions()),this.addAction("jumpReferences",i=>this.handler.locations.gotoReferences(i)),this.addAction("references",()=>this.handler.locations.references()),this.addAction("jumpUsed",i=>this.handler.locations.gotoReferences(i,!1)),this.addAction("doHover",i=>this.handler.hover.onHover(i)),this.addAction("definitionHover",i=>this.handler.hover.definitionHover(i)),this.addAction("getHover",()=>this.handler.hover.getHover()),this.addAction("showSignatureHelp",()=>this.handler.signature.triggerSignatureHelp()),this.addAction("documentSymbols",async i=>(i||(i=(await v.document).bufnr),await this.handler.symbols.getDocumentSymbols(i))),this.addAction("ensureDocument",async()=>{let i=await v.document;return i&&i.attached}),this.addAction("symbolRanges",()=>this.handler.documentHighlighter.getSymbolsRanges()),this.addAction("selectionRanges",()=>this.handler.selectionRange.getSelectionRanges()),this.addAction("rangeSelect",(i,n)=>this.handler.selectionRange.selectRange(i,n)),this.addAction("rename",i=>this.handler.rename.rename(i)),this.addAction("getWorkspaceSymbols",i=>this.handler.symbols.getWorkspaceSymbols(i)),this.addAction("resolveWorkspaceSymbol",i=>this.handler.symbols.resolveWorkspaceSymbol(i)),this.addAction("formatSelected",i=>this.handler.format.formatCurrentRange(i)),this.addAction("format",()=>this.handler.format.formatCurrentBuffer()),this.addAction("commands",()=>this.handler.commands.getCommands()),this.addAction("services",()=>Fi.getServiceStats()),this.addAction("toggleService",i=>Fi.toggle(i)),this.addAction("codeAction",(i,n)=>this.handler.codeActions.doCodeAction(i,n)),this.addAction("organizeImport",()=>this.handler.codeActions.organizeImport()),this.addAction("fixAll",()=>this.handler.codeActions.doCodeAction(null,[GD.CodeActionKind.SourceFixAll]));let t=[];this.addAction("doCodeAction",i=>{if(i.index==null)throw new Error("index should exists with codeAction");let n=t[i.index];if(!n)throw new Error(`invalid codeAction index: ${i.index}`);return this.handler.codeActions.applyCodeAction(n)}),this.addAction("codeActions",async(i,n)=>(t=await this.handler.codeActions.getCurrentCodeActions(i,n),t.map((s,o)=>Object.assign({index:o},s)))),this.addAction("quickfixes",async i=>(t=await this.handler.codeActions.getCurrentCodeActions(i,[GD.CodeActionKind.QuickFix]),t.map((n,s)=>Object.assign({index:s},n)))),this.addAction("codeLensAction",()=>this.handler.codeLens.doAction()),this.addAction("runCommand",(...i)=>this.handler.commands.runCommand(...i)),this.addAction("doQuickfix",()=>this.handler.codeActions.doQuickfix()),this.addAction("refactor",()=>this.handler.refactor.doRefactor()),this.addAction("repeatCommand",()=>this.handler.commands.repeat()),this.addAction("installExtensions",(...i)=>we.installExtensions(i)),this.addAction("updateExtensions",i=>we.updateExtensions(i)),this.addAction("extensionStats",()=>we.getExtensionStates()),this.addAction("loadedExtensions",()=>we.loadedExtensions()),this.addAction("watchExtension",i=>we.watchExtension(i)),this.addAction("activeExtension",i=>we.activate(i)),this.addAction("deactivateExtension",i=>we.deactivate(i)),this.addAction("reloadExtension",i=>we.reloadExtension(i)),this.addAction("toggleExtension",i=>we.toggleExtension(i)),this.addAction("uninstallExtension",(...i)=>we.uninstallExtension(i)),this.addAction("getCurrentFunctionSymbol",()=>this.handler.symbols.getCurrentFunctionSymbol()),this.addAction("showOutline",i=>this.handler.symbols.showOutline(i)),this.addAction("hideOutline",()=>this.handler.symbols.hideOutline()),this.addAction("getWordEdit",()=>this.handler.rename.getWordEdit()),this.addAction("addCommand",i=>this.handler.commands.addVimCommand(i)),this.addAction("addRanges",i=>this.cursors.addRanges(i)),this.addAction("currentWorkspacePath",()=>v.rootPath),this.addAction("selectCurrentPlaceholder",i=>vi.selectCurrentPlaceholder(!!i)),this.addAction("codeActionRange",(i,n,s)=>this.handler.codeActions.codeActionRange(i,n,s)),this.addAction("incomingCalls",i=>this.handler.callHierarchy.getIncoming(i)),this.addAction("outgoingCalls",i=>this.handler.callHierarchy.getOutgoing(i)),this.addAction("showIncomingCalls",()=>this.handler.callHierarchy.showCallHierarchyTree("incoming")),this.addAction("showOutgoingCalls",()=>this.handler.callHierarchy.showCallHierarchyTree("outgoing")),this.addAction("semanticHighlight",()=>this.handler.semanticHighlighter.highlightCurrent()),this.addAction("showSemanticHighlightInfo",()=>this.handler.semanticHighlighter.showHiglightInfo())}addAction(e,t){if(this.actions.has(e))throw new Error(`Action ${e} already exists`);this.actions.set(e,t)}async init(){let{nvim:e}=this,t=Date.now();try{await we.init(),await v.init(),vi.init(),sa.init(),Lt.init(),gi.init(e),ht.init(),this.handler=new Lw(e),Fi.init(),we.activateExtensions(),v.setupDynamicAutocmd(!0),e.pauseNotification(),e.setVar("WorkspaceFolders",v.folderPaths,!0),e.setVar("coc_service_initialized",1,!0),e.call("coc#util#do_autocmd",["CocNvimInit"],!0),e.resumeNotification(!1,!0),this._ready=!0,await O.fire("ready",[]),cf.info(`coc.nvim ${this.version} initialized with node: ${process.version} after ${Date.now()-t}ms`),this.emit("ready")}catch(i){e.echoError(i)}}get isReady(){return this._ready}get ready(){return this._ready?Promise.resolve():new Promise(e=>{this.once("ready",()=>{e()})})}get version(){return v.version+"-03c9add7cd"}hasAction(e){return this.actions.has(e)}async cocAction(e,...t){let i=this.actions.get(e);if(!i)throw new Error(`Action "${e}" not exists`);let n=Date.now(),s=await Promise.resolve(i.apply(null,t)),o=Date.now()-n;return o>500&&cf.warn(`Slow action "${e}" cost ${o}ms`),s}getHandler(){return this.handler}dispose(){this.removeAllListeners(),we.dispose(),gi.dispose(),v.dispose(),D.dispose(),ht.dispose(),Fi.stopAll(),Fi.dispose(),this.handler&&this.handler.dispose(),vi.dispose(),se.dispose(),sa.dispose(),Lt.dispose()}}});var v9={};Bn(v9,{default:()=>xge});var p9,m9,g9,ps,yge,wge,xge,b9=R(()=>{p9=E(ES()),m9=E(Cx());_e();h9();g9=E(_v());Wr();qe();y_();ps=U()("attach"),yge=global.hasOwnProperty("__TEST__"),wge=["installExtensions","updateExtensions"],xge=(r,e=!0)=>{let t=(0,p9.attach)(r,m9.default.getLogger("node-client"),e);global.hasOwnProperty("__TEST__")||t.call("coc#util#path_replace_patterns").then(o=>{if(Wt(o)){let a=B.file;B.file=l=>(l=l.replace(/\\/g,"/"),Object.keys(o).forEach(c=>l=l.replace(new RegExp("^"+c),o[c])),a(l))}}).logError(),t.setVar("coc_process_pid",process.pid,!0);let i=new Aw(t),n=!1,s=!1;return t.on("notification",async(o,a)=>{switch(o){case"VimEnter":{!s&&n&&(s=!0,await i.init());break}case"Log":{ps.debug(...a);break}case"TaskExit":case"TaskStderr":case"TaskStdout":case"GlobalChange":case"PromptInsert":case"InputChar":case"MenuInput":case"OptionSet":case"FloatBtnClick":await O.fire(o,a);break;case"CocAutocmd":ps.trace("Notification autocmd:",...a),await O.fire(a[0],a.slice(1));break;default:{if(!i.hasAction(o)){if(global.hasOwnProperty("__TEST__"))return;console.error(`action "${o}" not exists`);return}try{i.isReady?ps.info("receive notification:",o,a):ps.warn(`Plugin not ready when received "${o}"`,a),await i.ready,await i.cocAction(o,...a)}catch(c){console.error(`Error on "${o}": ${c.message||c.toString()}`),ps.error("Notification error:",o,a,c)}}}}),t.on("request",async(o,a,l)=>{if(o=="redraw"){l.send();return}let c=setTimeout(()=>{ps.error("Request cost more than 3s",o,a)},3e3);try{if(o=="CocAutocmd")ps.trace("Request autocmd:",...a),await O.fire(a[0],a.slice(1)),l.send(void 0);else{if(!i.isReady&&!wge.includes(o)){ps.warn(`Plugin not ready on request "${o}"`,a),l.send("Plugin not ready",!0);return}ps.info("Request action:",o,a);let u=await i.cocAction(o,...a);l.send(u)}clearTimeout(c)}catch(u){clearTimeout(c),l.send(u.message||u.toString(),!0),ps.error("Request error:",o,a,u)}}),t.channelId.then(async o=>{n=!0,yge&&t.command(`let g:coc_node_channel_id = ${o}`,!0);let{major:a,minor:l,patch:c}=g9.default.parse(Xg);t.setClientInfo("coc",{major:a,minor:l,patch:c},"remote",{},{}),await t.getVvar("vim_did_enter")&&!s&&(s=!0,await i.init())}).catch(o=>{console.error(`Channel create error: ${o.message}`)}),i}});dm();Object.defineProperty(console,"log",{value(){KD.info(...arguments)}});var KD=U()("server"),Sge=(b9(),v9).default;Sge({reader:process.stdin,writer:process.stdout});process.on("uncaughtException",function(r){let e="Uncaught exception: "+r.message;console.error(e),KD.error("uncaughtException",r.stack)});process.on("unhandledRejection",function(r,e){r instanceof Error?console.error("UnhandledRejection: "+r.message+`
`+r.stack):console.error("UnhandledRejection: "+r),KD.error("unhandledRejection ",e,r)});
/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
* @license MIT
*
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*!
* ISC License
*
* Copyright (c) 2018, Andrea Giammarchi, @WebReflection
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*/
/*!
* content-disposition
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
/**
* event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped)
*
* @copyright Yusuke Kawasaki
* @license MIT
* @constructor
* @see https://github.com/kawanet/event-lite
* @see http://kawanet.github.io/event-lite/EventLite.html
* @example
* var EventLite = require("event-lite");
*
* function MyClass() {...} // your class
*
* EventLite.mixin(MyClass.prototype); // import event methods
*
* var obj = new MyClass();
* obj.on("foo", function() {...}); // add event listener
* obj.once("bar", function() {...}); // add one-time event listener
* obj.emit("foo"); // dispatch event
* obj.emit("bar"); // dispatch another event
* obj.off("foo"); // remove event listener
*/