diff --git a/copilot/dist/agent.js b/copilot/dist/agent.js index 80d6bbd3..5579037f 100644 --- a/copilot/dist/agent.js +++ b/copilot/dist/agent.js @@ -5,5 +5,5 @@ || ${a} === "boolean" || ${o} === null`).assign(c,s._`[${o}]`)}}r.else(),f(e),r.endIf(),r.if(s._`${c} !== undefined`,(()=>{r.assign(o,c),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${n}]`,r)))}(e,c)}))}(e,t,a):f(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=c.Correct){const o=r===c.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return r===c.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,n?s._`isFinite(${t})`:s.nil)}}function p(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,d(e,t,n,r));return o}t.checkDataType=d,t.checkDataTypes=p;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:n,schema:r}=e,o=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}(e);(0,i.reportError)(t,h)}t.reportTypeError=f},1481:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(5669),o=n(8936);function i(e,t,n){const{gen:i,compositeRule:s,data:a,opts:c}=e;if(void 0===n)return;const l=r._`${a}${(0,r.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${l}`);let u=r._`${l} === undefined`;"empty"===c.useDefaults&&(u=r._`${u} || ${l} === null || ${l} === ""`),i.if(u,r._`${l} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)i(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>i(e,n,t.default)))}},1686:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(2171),o=n(7332),i=n(9073),s=n(7332),a=n(1481),c=n(5782),l=n(8878),u=n(5669),d=n(7250),p=n(6696),h=n(8936),f=n(6930);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},i){o.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,o)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,o),e.code(i)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,r.$async,(()=>e.code(g(n,o)).code(i)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function _({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function v(e){(0,h.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function b(e,t){if(e.opts.jtd)return x(e,[],!1,t);const n=(0,o.getSchemaTypes)(e.schema);x(e,n,!(0,o.coerceAndCheckDataType)(e,n),t)}function w({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const i=n.$comment;if(!0===o.$comment)e.code(u._`${d.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const n=u.str`${r}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${i}, ${n}, ${o}.schema)`)}}function x(e,t,n,r){const{gen:o,schema:a,data:c,allErrors:l,opts:p,self:f}=e,{RULES:m}=f;function g(h){(0,i.shouldUseGroup)(a,h)&&(h.type?(o.if((0,s.checkDataType)(h.type,c,p.strictNumbers)),T(e,h),1===t.length&&t[0]===h.type&&n&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):T(e,h),l||o.if(u._`${d.default.errors} === ${r||0}`))}!a.$ref||!p.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(a,m)?(p.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{E(e.dataTypes,t)||C(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>E(t,e)))):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&C(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const r in n){const o=n[r];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:n}=o.definition;n.length&&!n.some((e=>{return r=e,(n=t).includes(r)||"number"===r&&n.includes("integer");var n,r}))&&C(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):o.block((()=>k(e,"$ref",m.all.$ref.definition)))}function T(e,t){const{gen:n,schema:r,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,i.shouldUseRule)(r,n)&&k(e,n.keyword,n.definition,t.type)}))}function E(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function C(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){y(e)&&(v(e),_(e))?function(e){const{schema:t,opts:n,gen:r}=e;m(e,(()=>{n.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(d.default.vErrors,null),r.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),b(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:i}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${o}(${d.default.vErrors})`))):(t.assign(u._`${r}.errors`,d.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),r instanceof u.Name&&e.assign(u._`${t}.items`,r)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class S{constructor(e,t,n){if((0,c.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",R(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,u.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=u.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:o,def:i}=this;n.if((0,u.or)(u._`${r} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(o.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,u.or)(function(){if(n.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return u._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return u.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(n,this.it,e),(0,l.extendSubschemaMode)(n,e);const o={...this.it,...n,items:void 0,props:void 0};return function(e,t){y(e)&&(v(e),_(e))?function(e,t){const{schema:n,gen:r,opts:o}=e;o.$comment&&n.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,p.resolveUrl)(e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=r.const("_errs",d.default.errors);b(e,i),r.var(t,u._`${i} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=h.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=h.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function k(e,t,n,r){const o=new S(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,c.funcKeywordCode)(o,n):"macro"in n?(0,c.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(o,n)}t.KeywordCxt=S;const P=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,i;if(""===e)return d.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=d.default.rootData}else{const s=I.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return r[t-a]}if(a>t)throw new Error(c("data",a));if(i=n[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=u._`${i}${(0,u.getProperty)((0,h.unescapeJsonPointer)(e))}`,s=u._`${s} && ${i}`);return s;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=R},5782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(5669),o=n(7250),i=n(3499),s=n(6930);function a(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,(()=>t.assign(n,r._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:o,schema:i,parentSchema:s,it:a}=e,l=t.macro.call(a.self,i,s,a),u=c(n,o,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const d=n.name("valid");e.subschema({schema:l,schemaPath:r.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:l,keyword:u,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const m=!h&&t.compile?t.compile.call(f.self,d,p,f):t.validate,g=c(l,u,m),_=l.let("valid");function y(n=(t.async?r._`await `:r.nil)){const s=f.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!h||!1===t.schema);l.assign(_,r._`${n}${(0,i.callValidateCode)(e,g,s,a)}`,t.modifying)}function v(e){var n;l.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:_),e)}e.block$data(_,(function(){if(!1===t.errors)y(),t.modifying&&a(e),v((()=>e.error()));else{const n=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>y(r._`await `)),(t=>l.assign(_,!1).if(r._`${t} instanceof ${f.ValidationError}`,(()=>l.assign(e,r._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=r._`${g}.errors`;return l.assign(e,null),y(r.nil),e}();t.modifying&&a(e),v((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,r._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:_)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},8878:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(5669),o=n(8936);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===n?{schema:i,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(n)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==n){const{errorPath:s,dataPathArr:a,opts:c}=t;u(l.let("data",r._`${t.data}${(0,r.getProperty)(n)}`,!0)),e.errorPath=r.str`${s}${(0,o.getErrorPath)(n,i,c.jsPropertySyntax)}`,e.parentDataProperty=r._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==s&&(u(s instanceof r.Name?s:l.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:i}){void 0!==r&&(e.compositeRule=r),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}},8355:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=n(1686);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var o=n(5669);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=n(6448),s=n(1578),a=n(2881),c=n(7382),l=n(5669),u=n(6696),d=n(7332),p=n(8936),h=n(1143),f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,n,r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w,x;const T=e.strict,E=null===(t=e.code)||void 0===t?void 0:t.optimize,C=!0===E||void 0===E?1:E||0;return{strictSchema:null===(r=null!==(n=e.strictSchema)&&void 0!==n?n:T)||void 0===r||r,strictNumbers:null===(i=null!==(o=e.strictNumbers)&&void 0!==o?o:T)||void 0===i||i,strictTypes:null!==(a=null!==(s=e.strictTypes)&&void 0!==s?s:T)&&void 0!==a?a:"log",strictTuples:null!==(l=null!==(c=e.strictTuples)&&void 0!==c?c:T)&&void 0!==l?l:"log",strictRequired:null!==(d=null!==(u=e.strictRequired)&&void 0!==u?u:T)&&void 0!==d&&d,code:e.code?{...e.code,optimize:C}:{optimize:C},loopRequired:null!==(p=e.loopRequired)&&void 0!==p?p:200,loopEnum:null!==(h=e.loopEnum)&&void 0!==h?h:200,meta:null===(f=e.meta)||void 0===f||f,messages:null===(m=e.messages)||void 0===m||m,inlineRefs:null===(g=e.inlineRefs)||void 0===g||g,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(y=e.addUsedSchema)||void 0===y||y,validateSchema:null===(v=e.validateSchema)||void 0===v||v,validateFormats:null===(b=e.validateFormats)||void 0===b||b,unicodeRegExp:null===(w=e.unicodeRegExp)||void 0===w||w,int32range:null===(x=e.int32range)||void 0===x||x}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:m,es5:t,lines:n}),this.logger=function(e){if(!1===e)return S;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,"NOT SUPPORTED"),b.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=C.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),x.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=h;"id"===n&&(r={...h},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await o.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||i.call(this,n)}async function o(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const n=await l.call(this,e);this.refs[e]||await o.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=w.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new c.SchemaEnv({schema:{},schemaId:n});if(t=c.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=w.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,u.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(P.call(this,n,t),!t)return(0,p.eachItem)(n,(e=>I.call(this,e))),this;O.call(this,t);const r={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,p.eachItem)(n,0===r.type.length?e=>I.call(this,e,r):e=>r.type.forEach((t=>I.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,i=o[e];r&&i&&(o[e]=N(i))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,u.normalizeId)(i||n);const l=u.getSchemaRefs.call(this,e,n);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:l}),this._cache.set(a.schema,a),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),r&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,n,r="error"){for(const o in e){const i=o;i in t&&this.logger[r](`${n}: option ${o}. ${e[i]}`)}}function w(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function x(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function T(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function C(){const e={...this.opts};for(const t of f)delete e[t];return e}t.default=v,v.ValidationError=i.default,v.MissingRefError=s.default;const S={log(){},warn(){},error(){}},k=/^[a-z_$][a-z0-9_$:-]*$/i;function P(e,t){const{RULES:n}=this;if((0,p.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function I(e,t,n){var r;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find((({type:e})=>e===n));if(s||(s={type:n,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?R.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function R(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function O(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const A={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,A]}}},4285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6471);r.code='require("ajv/dist/runtime/equal").default',t.default=r},9161:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,o=0;for(;o=55296&&n<=56319&&o{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},8891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(5669),o=n(8936),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?s(e,r):(0,o.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:n,schema:i,data:s,keyword:a,it:c}=e;c.items=!0;const l=n.const("len",r._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(c,i)){const i=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(i),(()=>function(i){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),c.allErrors||n.if((0,r.not)(i),(()=>n.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},4943:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(7250),s=n(8936),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:c,errsCount:l,it:u}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,s.alwaysValidSchema)(u,n))return;const h=(0,r.allSchemaProperties)(a.properties),f=(0,r.allSchemaProperties)(a.patternProperties);function m(e){t.code(o._`delete ${c}[${e}]`)}function g(r){if("all"===p.removeAdditional||p.removeAdditional&&!1===n)m(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,s.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===p.removeAdditional?(_(r,n,!1),t.if((0,o.not)(n),(()=>{e.reset(),m(r)}))):(_(r,n),d||t.if((0,o.not)(n),(()=>t.break())))}}}function _(t,n,r){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===r&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",c,(n=>{h.length||f.length?t.if(function(n){let i;if(h.length>8){const e=(0,s.schemaRefOrVal)(u,a.properties,"properties");i=(0,r.isOwnProperty)(t,e,n)}else i=h.length?(0,o.or)(...h.map((e=>o._`${n} === ${e}`))):o.nil;return f.length&&(i=(0,o.or)(i,...f.map((t=>o._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,o.not)(i)}(n),(()=>g(n))):g(n)})),e.ok(o._`${l} === ${i.default.errors}`)}};t.default=a},2609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:n},i);e.ok(i),e.mergeEvaluated(s)}))}};t.default=o},4279:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(3499).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},5609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?r.str`must contain at least ${e} valid item(s)`:r.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:i,data:s,it:a}=e;let c,l;const{minContains:u,maxContains:d}=i;a.opts.next?(c=void 0===u?1:u,l=d):c=1;const p=t.const("len",r._`${s}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,n)){let t=r._`${p} >= ${c}`;return void 0!==l&&(t=r._`${t} && ${p} <= ${l}`),void e.pass(t)}a.items=!0;const h=t.name("valid");if(void 0===l&&1===c)f(h,(()=>t.if(h,(()=>t.break()))));else{t.let(h,!1);const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===l?t.if(r._`${e} >= ${c}`,(()=>t.assign(h,!0).break())):(t.if(r._`${e} > ${l}`,(()=>t.assign(h,!1).break())),1===c?t.assign(h,!0):t.if(r._`${e} >= ${c}`,(()=>t.assign(h,!0))))}(n)))))}function f(n,r){t.forRange("i",0,p,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},n),r()}))}e.result(h,(()=>e.reset()))}};t.default=i},5463:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(5669),o=n(8936),i=n(3499);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const o=1===t?"property":"properties";return r.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:o}})=>r._`{property: ${e}, missingProperty: ${o}, depsCount: ${t}, - deps: ${n}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,i.propertyInData)(n,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?n.if(u,(()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,i.checkMissingProp)(e,l,a)})`),(0,i.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:s,it:a}=e,c=n.name("valid");for(const l in t)(0,o.alwaysValidSchema)(a,t[l])||(n.if((0,i.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},76:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:i}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else a?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,o){return()=>{const i=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(i,l),o?t.assign(o,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!(0,o.alwaysValidSchema)(e,n)}t.default=i},6951:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8891),o=n(1162),i=n(8634),s=n(5151),a=n(5609),c=n(5463),l=n(3021),u=n(4943),d=n(4243),p=n(8103),h=n(2869),f=n(4279),m=n(4880),g=n(2609),_=n(76),y=n(5316);t.default=function(e=!1){const t=[h.default,f.default,m.default,g.default,_.default,y.default,l.default,u.default,c.default,d.default,p.default];return e?t.push(o.default,s.default):t.push(r.default,i.default),t.push(a.default),t}},8634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(5669),o=n(8936),i=n(3499),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,o.alwaysValidSchema)(n,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:i}=l,s=n.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(l,e,r.strictTuples)}}(s),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(i,n.length,l.items));const u=i.name("valid"),d=i.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,o.alwaysValidSchema)(l,t)||(i.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=a,t.default=s},5151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(3499),s=n(8891),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,o.alwaysValidSchema)(r,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},2869:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,r.alwaysValidSchema)(o,n))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},4880:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=n,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,i)=>{let a;(0,o.alwaysValidSchema)(s,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${i}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,i),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},8103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s=n(8936),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,r.allSchemaProperties)(n),p=d.filter((e=>(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length||p.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const h=u.strictSchema&&!u.allowMatchingProperties&&c.properties,f=t.name("valid");!0===l.props||l.props instanceof o.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:m}=l;function g(e){for(const t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function _(n){t.forIn("key",a,(i=>{t.if(o._`${(0,r.usePattern)(e,n)}.test(${i})`,(()=>{const r=p.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:i,dataPropType:s.Type.Str},f),l.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):r||l.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of d)h&&g(e),l.allErrors?_(e):(t.var(f,!0),_(e),t.if(f))}()}};t.default=a},1162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8634),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=o},4243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1686),o=n(3499),i=n(8936),s=n(4943),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new r.KeywordCxt(l,s.default,"additionalProperties"));const u=(0,o.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),l.props));const d=u.filter((e=>!(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const p=t.name("valid");for(const n of d)h(n)?f(n):(t.if((0,o.propertyInData)(t,c,n,l.opts.ownProperties)),f(n),l.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(p);function h(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}};t.default=a},3021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,n))return;const a=t.name("valid");t.forIn("key",i,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},5316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=o},3499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(5669),o=n(8936),i=n(7250);function s(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return r._`${s(e)}.call(${t}, ${n})`}function c(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} === undefined`;return o?(0,r.or)(i,(0,r.not)(a(e,t,n))):i}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:o,it:i}=e;n.if(c(n,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},o,i){return(0,r.or)(...o.map((o=>(0,r.and)(c(e,t,o,n.ownProperties),r._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=s,t.isOwnProperty=a,t.propertyInData=function(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return o?r._`${i} && ${a(e,t,n)}`:i},t.noPropertyInData=c,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((n=>!(0,o.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},l,u,d){const p=d?r._`${e}, ${t}, ${o}${s}`:t,h=[[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=r._`${p}, ${n.object(...h)}`;return u!==r.nil?r._`${l}.call(${u}, ${f})`:r._`${l}(${f})`},t.usePattern=function({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,o),code:r._`new RegExp(${n}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:i,dataProp:n,dataPropType:o.Type.Num},a),t.if((0,r.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},1018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},2101:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1018),o=n(1939),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default];t.default=i},1939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(1578),o=n(3499),i=n(5669),s=n(7250),a=n(7382),c=n(8936),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:p,self:h}=o,{root:f}=c;if(("#"===n||"#/"===n)&&s===f.baseId)return function(){if(c===f)return d(e,l,c,c.$async);const n=t.scopeValue("root",{ref:f});return d(e,i._`${n}.validate`,f,f.$async)}();const m=a.resolveRef.call(h,f,s,n);if(void 0===m)throw new r.default(s,n);return m instanceof a.SchemaEnv?function(t){const n=u(e,t);d(e,n,t,t.$async)}(m):function(r){const o=t.scopeValue("schema",!0===p.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),s=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:n},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):i._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:d,opts:p}=l,h=p.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=c.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",i._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,i.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=c.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",i._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,i.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,h)}`),m(t),u||a.assign(n,!0)}),(e=>{a.if(i._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),f(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,o.callValidateCode)(e,t,h),(()=>m(t)),(()=>f(t)))}t.getValidate=u,t.callRef=d,t.default=l},2:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(7421),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:i,parentSchema:s,it:a}=e,{oneOf:c}=s;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),d=t.const("tag",r._`${n}${(0,r.getProperty)(l)}`);function p(n){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:n},o);return e.mergeEvaluated(i,r.Name),o}t.if(r._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=o(s);let r=!0;for(let t=0;te.error(!1,{discrError:o.DiscrError.Tag,tag:d,tagName:l}))),e.ok(u)}};t.default=i},7421:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(n=t.DiscrError||(t.DiscrError={})).Tag="tag",n.Mapping="mapping"},5671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2101),o=n(7499),i=n(6951),s=n(4480),a=n(2480),c=[r.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},3599:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=c;l.validateFormats&&(i?function(){const i=n.scopeValue("formats",{ref:p.formats,code:l.code.formats}),s=n.const("fDef",r._`${i}[${a}]`),c=n.let("fType"),u=n.let("format");n.if(r._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>n.assign(c,r._`${s}.type || "string"`).assign(u,r._`${s}.validate`)),(()=>n.assign(c,r._`"string"`).assign(u,s))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${u}`,function(){const e=d.$async?r._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:r._`${u}(${o})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const i=p.formats[s];if(!i)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}p.logger.warn(e())}();if(!0===i)return;const[a,c,h]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(s)}`:void 0,o=n.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,r._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${h}(${o})`}return"function"==typeof c?r._`${h}(${o})`:r._`${h}.test(${o})`}())}())}};t.default=o},4480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(3599).default];t.default=r},2480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},6577:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(r._`!${(0,o.useFunc)(t,i.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=s},9450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum,d=(0,o.useFunc)(t,i.default);let p;if(u||s)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(r._`${d}(${n}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,r.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?r._`${d}(${n}, ${e}[${t}])`:r._`${n} === ${o}`}(e,o))))}e.pass(p)}};t.default=s},7499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1337),o=n(9706),i=n(9507),s=n(1216),a=n(34),c=n(6962),l=n(1135),u=n(194),d=n(6577),p=n(9450),h=[r.default,o.default,i.default,s.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default];t.default=h},1135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${i} ${o}`)}};t.default=o},9507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(9161),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,o.useFunc)(e.gen,i.default)}(${n})`;e.fail$data(r._`${l} ${c} ${s}`)}};t.default=s},1337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=r.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>r.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data(r._`${n} ${i[t].fail} ${o} || isNaN(${n})`)}};t.default=a},34:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${i} ${o}`)}};t.default=o},9706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};t.default=o},1216:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?o._`(new RegExp(${s}, ${c}))`:(0,r.usePattern)(e,i);e.fail$data(o._`!${l}.test(${t})`)}};t.default=i},6962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:s,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===n.length)return;const d=n.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)e.block$data(o.nil,p);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,i){e.setParams({missingProperty:n}),t.forOf(n,s,(()=>{t.assign(i,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,i)),(0,r.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function p(){t.forOf("prop",s,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,u.ownProperties),(()=>e.error()))}))}}};t.default=s},194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7332),o=n(5669),i=n(8936),s=n(4285),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!a&&!c)return;const p=t.let("valid"),h=l.items?(0,r.getSchemaTypes)(l.items):[];function f(i,s){const a=t.name("item"),c=(0,r.checkDataTypes)(h,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${n}[${i}]`),t.if(c,o._`continue`),h.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,o._`${l}[${a}]`),e.error(),t.assign(p,!1).break()})).code(o._`${l}[${a}] = ${i}`)}))}function m(r,a){const c=(0,i.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(o._`;${r}--;`,(()=>t.for(o._`${a} = ${r}; ${a}--;`,(()=>t.if(o._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(p,!1).break(l)}))))))}e.block$data(p,(function(){const r=t.let("i",o._`${n}.length`),i=t.let("j");e.setParams({i:r,j:i}),t.assign(p,!0),t.if(o._`${r} > 1`,(()=>(h.length>0&&!h.some((e=>"object"===e||"array"===e))?f:m)(r,i)))}),o._`${u} === false`),e.ok(p)}};t.default=a},3245:(e,t,n)=>{"use strict";var r=n(1767),o=function(){function e(t){if(e.INSTANCE)throw new Error("Console logging adapter tracking should be configured from the applicationInsights object");this._client=t,e.INSTANCE=this}return e.prototype.enable=function(e,t){r.IsInitialized&&(n(2469).wp(e&&t,this._client),n(3805).wp(e,this._client),n(7916).wp(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1,!1)},e._methodNames=["debug","info","log","warn","error"],e}();e.exports=o},6751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2010),o=n(1767),i=function(){function e(){}return e.getCurrentContext=function(){if(!e.enabled)return null;var t=e.session.get(e.CONTEXT_NAME);return void 0===t?null:t},e.generateContextObject=function(e,t,n,r,o,i){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t,traceparent:o,tracestate:i},customProperties:new s(r)}:null},e.runWithContext=function(t,n){return e.enabled?e.session.bind(n,((r={})[e.CONTEXT_NAME]=t,r))():n();var r},e.wrapEmitter=function(t){e.enabled&&e.session.bindEmitter(t)},e.wrapCallback=function(t){return e.enabled?e.session.bind(t):t},e.enable=function(t){this.enabled||(this.isNodeVersionCompatible()?(e.hasEverEnabled||(this.forceClsHooked=t,this.hasEverEnabled=!0,void 0===this.cls&&(!0===e.forceClsHooked||void 0===e.forceClsHooked&&e.shouldUseClsHooked()?this.cls=n(9172):this.cls=n(2611)),e.session=this.cls.createNamespace("AI-CLS-Session"),o.registerContextPreservation((function(t){return e.session.bind(t)}))),this.enabled=!0):this.enabled=!1)},e.disable=function(){this.enabled=!1},e.reset=function(){e.hasEverEnabled&&(e.session=null,e.session=this.cls.createNamespace("AI-CLS-Session"))},e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},e.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},e.canUseClsHooked=function(){var e=process.versions.node.split("."),t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r},e.enabled=!1,e.hasEverEnabled=!1,e.forceClsHooked=void 0,e.CONTEXT_NAME="ApplicationInsights-Context",e}();t.CorrelationContextManager=i;var s=function(){function e(e){this.props=[],this.addHeaderData(e)}return e.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map((function(e){var t=e.split("=");return{key:t[0],value:t[1]}})).concat(this.props)},e.prototype.serializeToHeader=function(){return this.props.map((function(e){return e.key+"="+e.value})).join(", ")},e.prototype.getProperty=function(e){for(var t=0;t0&&process.once("uncaughtException",(function(){e.post.call(l,p,!0),s.delete(h),e.destroy.call(null,p)}))}e.post.call(l,p,!1),u=null,(a||d)&&(d=!1,s.delete(h),e.destroy.call(null,p))},h=c.apply(r,n),s.set(h,p),h},r[o]=function(t){if(u===t&&null!==t)d=!0;else if(s.has(t)){const n=s.get(t);s.delete(t),e.destroy.call(null,n)}l.apply(r,arguments)}}e.exports=function(){p(this._hooks,this._state,"setTimeout","clearTimeout",o,a,!0),p(this._hooks,this._state,"setInterval","clearInterval",i,c,!1),p(this._hooks,this._state,"setImmediate","clearImmediate",s,l,!0),global.setTimeout=r.setTimeout,global.setInterval=r.setInterval,global.setImmediate=r.setImmediate,global.clearTimeout=r.clearTimeout,global.clearInterval=r.clearInterval,global.clearImmediate=r.clearImmediate}},7600:e=>{"use strict";e.exports=(e,t)=>class extends e{constructor(e){var n,r;super((function(e,i){n=this,r=[function(n){return t(o,!1),e(n)},function(e){return t(o,!1),i(e)}]}));var o=this;try{e.apply(n,r)}catch(e){r[1](e)}return o}}},1747:(e,t,n)=>{var r,o,i=n(4403).wrap,s=[],a=0,c=!1,l=[];function u(e,t){var n=e.length,r=t.length,o=[];if(0===n&&0===r)return o;for(var i=0;i0&&(s=l.pop()),d=void 0,n&&!c},o=function(e,t,n){var r=[];c=!0;for(var o=0;o0&&t[o].before(this,r[t[o].uid]);c=!1;var i=e.apply(this,arguments);for(c=!0,o=0;o0&&t[o].after(this,r[t[o].uid]);return c=!1,s=l.pop(),d=void 0,i}},i(process,"_fatalException",(function(e){return function(t){return r(t)||e(t)}}))}else{var h=!1;r=function(e){if(h)throw e;for(var t=!1,n=s.length,r=0;r0&&t[p].before(this,o[t[p].uid]);c=!1;try{i=e.apply(this,arguments)}catch(e){for(a=!0,p=0;p0&&t[p].after(this,o[t[p].uid]);c=!1}s=l.pop()}return i}},process.addListener("uncaughtException",r)}function f(e,t){"function"==typeof e.create&&(this.create=e.create,this.flags|=1),"function"==typeof e.before&&(this.before=e.before,this.flags|=2),"function"==typeof e.after&&(this.after=e.after,this.flags|=4),"function"==typeof e.error&&(this.error=e.error,this.flags|=8),this.uid=++a,this.data=void 0===t?null:t}function m(e,t){if("object"!=typeof e||!e)throw new TypeError("callbacks argument must be an object");return e instanceof f?e:new f(e,t)}f.prototype.create=void 0,f.prototype.before=void 0,f.prototype.after=void 0,f.prototype.error=void 0,f.prototype.data=void 0,f.prototype.uid=0,f.prototype.flags=0,process.createAsyncListener=m,process.addAsyncListener=function(e,t){var n;n=e instanceof f?e:m(e,t);for(var r=!1,o=0;o0)return o(e,n,t);return function(e,t,n){c=!0;for(var r=0;r{"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(4403),o=n(3341),i=r.wrap,s=r.massWrap,a=n(1747),c=n(3837),l=o.gte(process.version,"6.0.0"),u=o.gte(process.version,"7.0.0"),d=o.gte(process.version,"8.0.0"),p=o.gte(process.version,"11.0.0"),h=n(1808);function f(e){return function(){this.on("connection",(function(e){e._handle&&(e._handle.onread=a(e._handle.onread))}));try{return e.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=a(this._handle.onconnection))}}}function m(e){if(e&&e._handle){var t=e._handle;t._originalOnread||(t._originalOnread=t.onread),t.onread=a(t._originalOnread)}}u&&!h._normalizeArgs?h._normalizeArgs=function(e){if(0===e.length)return[{},null];var t,n,r=e[0],o={};"object"==typeof r&&null!==r?o=r:"string"==typeof(t=r)&&!1===(n=t,(n=Number(n))>=0&&n)?o.path=r:(o.port=r,e.length>1&&"string"==typeof e[1]&&(o.host=e[1]));var i=e[e.length-1];return"function"!=typeof i?[o,null]:[o,i]}:u||h._normalizeConnectArgs||(h._normalizeConnectArgs=function(e){var t,n={};"object"==typeof e[0]&&null!==e[0]?n=e[0]:"string"==typeof e[0]&&!1===(t=e[0],(t=Number(t))>=0&&t)?n.path=e[0]:(n.port=e[0],"string"==typeof e[1]&&(n.host=e[1]));var r=e[e.length-1];return"function"==typeof r?[n,r]:[n]}),"_setUpListenHandle"in h.Server.prototype?i(h.Server.prototype,"_setUpListenHandle",f):i(h.Server.prototype,"_listen2",f),i(h.Socket.prototype,"connect",(function(e){return function(){var t;(t=d&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?arguments[0]:u?h._normalizeArgs(arguments):h._normalizeConnectArgs(arguments))[1]&&(t[1]=a(t[1]));var n=e.apply(this,t);return m(this),n}}));var g=n(3685);i(g.Agent.prototype,"addRequest",(function(e){return function(t){var n=t.onSocket;return t.onSocket=a((function(e){return m(e),n.apply(this,arguments)})),e.apply(this,arguments)}}));var _=n(2081);function y(e){Array.isArray(e.stdio)&&e.stdio.forEach((function(e){e&&e._handle&&(e._handle.onread=a(e._handle.onread),i(e._handle,"close",A))})),e._handle&&(e._handle.onexit=a(e._handle.onexit))}_.ChildProcess?i(_.ChildProcess.prototype,"spawn",(function(e){return function(){var t=e.apply(this,arguments);return y(this),t}})):s(_,["execFile","fork","spawn"],(function(e){return function(){var t=e.apply(this,arguments);return y(t),t}})),process._fatalException||(process._originalNextTick=process.nextTick);var v=[];process._nextDomainTick&&v.push("_nextDomainTick"),process._tickDomainCallback&&v.push("_tickDomainCallback"),s(process,v,O),i(process,"nextTick",A);var b=["setTimeout","setInterval"];global.setImmediate&&b.push("setImmediate");var w=n(9512),x=global.setTimeout===w.setTimeout;s(w,b,A),x&&s(global,b,A);var T=n(9523);s(T,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],O),T.resolveNaptr&&i(T,"resolveNaptr",O);var E,C,S=n(7147);s(S,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],O),S.lchown&&i(S,"lchown",O),S.lchmod&&i(S,"lchmod",O),S.ftruncate&&i(S,"ftruncate",O);try{E=n(9796)}catch(e){}if(E&&E.Deflate&&E.Deflate.prototype){var k=Object.getPrototypeOf(E.Deflate.prototype);k._transform?i(k,"_transform",O):k.write&&k.flush&&k.end&&s(k,["write","flush","end"],O)}try{C=n(6113)}catch(e){}if(C){var P=["pbkdf2","randomBytes"];p||P.push("pseudoRandomBytes"),s(C,P,O)}var I=!!global.Promise&&"function Promise() { [native code] }"===Promise.toString()&&"function toString() { [native code] }"===Promise.toString.toString();if(I){var R=process.addAsyncListener({create:function(){I=!1}});global.Promise.resolve(!0).then((function(){I=!1})),process.removeAsyncListener(R)}function O(e){var t=function(){var t,n=arguments.length-1;if("function"==typeof arguments[n]){t=Array(arguments.length);for(var r=0;r{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var L=s++;i[L]="^"+i[D]+i[C]+"$";var $=s++;i[$]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var U=s++;i[U]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[$]:o[L];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2172:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(632),a="error@context",c=[];for(let e in s.providers)c[s.providers[e]]=e;const l=process.env.DEBUG_CLS_HOOKED;let u=-1;function d(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}function p(e){return process.namespaces[e]}function h(e){let t=p(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function f(e){process.env.DEBUG&&process._rawDebug(e)}function m(e){return e?"function"==typeof e?e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]:e.constructor&&e.constructor.name?e.constructor.name:void 0:e}if(e.exports={getNamespace:p,createNamespace:function(e){o.ok(e,"namespace must be given a name."),l&&f("CREATING NAMESPACE "+e);let t=new d(e);return t.id=u,s.addHooks({init(n,o,i,s,a){u=n,s?(t._contexts.set(n,t._contexts.get(s)),l&&f("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+i)):t._contexts.set(u,t.active),l&&f("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+c[i]+" active:"+r.inspect(t.active,!0))},pre(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" PRE "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.enter(i)):l&&f(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},post(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" POST "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.exit(i)):l&&f(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},destroy(n){u=n,l&&f("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(u))+" active:"+r.inspect(t.active,!0)),t._contexts.delete(n)}}),process.namespaces[e]=t,t},destroyNamespace:h,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){h(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},d.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return l&&f(" SETTING KEY:"+e+"="+t+" in ns:"+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e]=t,t},d.prototype.get=function(e){if(this.active)return l&&f(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e];l&&f(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0))},d.prototype.createContext=function(){l&&f(" CREATING Context: "+this.name+" uid:"+u+" len:"+this._set.length+" active:"+r.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=u,l&&f(" CREATED Context: "+this.name+" uid:"+u+" len:"+this._set.length+" context:"+r.inspect(e,!0,2,!0)),e},d.prototype.run=function(e){let t=this.createContext();this.enter(t);try{return l&&f(" BEFORE RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),e(t),t}catch(e){throw e&&(e[a]=t),e}finally{l&&f(" AFTER RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t)}},d.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},d.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return l&&f(" BEFORE runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},d.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},d.prototype.enter=function(e){o.ok(e,"context must be provided for entering"),l&&f(" ENTER "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this._set.push(this.active),this.active=e},d.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),l&&f(" EXIT "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(l&&f("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},d.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},d.prototype.fromException=function(e){return e[a]},process.namespaces={},s._state&&!s._state.enabled&&s.enable(),l){var g=n(6818);for(var _ in g.filter._modifiers)g.filter.deattach(_)}},8423:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(852),a="error@context",c=process.env.DEBUG_CLS_HOOKED;let l=-1;function u(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}function d(e){return process.namespaces[e]}function p(e){let t=d(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function h(...e){c&&process._rawDebug(`${r.format(...e)}`)}e.exports={getNamespace:d,createNamespace:function(e){o.ok(e,"namespace must be given a name."),c&&h(`NS-CREATING NAMESPACE (${e})`);let t=new u(e);return t.id=l,s.createHook({init(n,o,i,a){if(l=s.executionAsyncId(),t.active){if(t._contexts.set(n,t.active),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(0===l){const i=s.triggerAsyncId(),u=t._contexts.get(i);if(u){if(t._contexts.set(n,u),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT USING CONTEXT FROM TRIGGERID [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT MISSING CONTEXT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}if(c&&"PROMISE"===o){h(r.inspect(a,{showHidden:!0}));const s=a.parentId;h(`${" ".repeat(t._indent<0?0:t._indent)}INIT RESOURCE-PROMISE [${o}] (${e}) parentId:${s} asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}},before(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`),t._indent+=2}t.enter(o)}else if(c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${r.inspect(t._contexts,{showHidden:!0,depth:2,colors:!0})}`),t._indent+=2}},after(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}t.exit(o)}else if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}},destroy(n){if(l=s.executionAsyncId(),c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}DESTROY (${e}) currentUid:${l} asyncId:${n} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(t._contexts.get(l))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t},destroyNamespace:p,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){p(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},u.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,c&&h(" ".repeat(this._indent<0?0:this._indent)+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),t},u.prototype.get=function(e){if(this.active){if(c){const t=s.executionAsyncId(),n=s.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);h(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),h(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]}if(c){const t=s.currentId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}},u.prototype.createContext=function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=l,c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-CREATED Context: (${this.name}) currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},u.prototype.run=function(e){let t=this.createContext();this.enter(t);try{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}return e(t),t}catch(e){throw e&&(e[a]=t),e}finally{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN END: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}},u.prototype.runAndReturn=function(e){let t;return this.run((function(n){t=e(n)})),t},u.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return c&&h("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(c&&h("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,c&&h("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},u.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},u.prototype.enter=function(e){if(o.ok(e,"context must be provided for entering"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-ENTER: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active),this.active=e},u.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-EXIT: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(c&&h("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},u.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},u.prototype.fromException=function(e){return e[a]},process.namespaces={}},9172:(e,t,n)=>{"use strict";const r=n(2173);process&&r.gte(process.versions.node,"8.0.0")?e.exports=n(8423):e.exports=n(2172)},2173:(e,t)=>{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var L=s++;i[L]="^"+i[D]+i[C]+"$";var $=s++;i[$]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var U=s++;i[U]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[$]:o[L];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2611:(e,t,n)=>{"use strict";var r=n(9491),o=n(7267),i="error@context";function s(e){this.name=e,this.active=null,this._set=[],this.id=null}function a(e){return process.namespaces[e]}function c(e){var t=a(e);r.ok(t,"can't delete nonexistent namespace!"),r.ok(t.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(t.id),process.namespaces[e]=null}function l(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){c(e)})),process.namespaces=Object.create(null)}process.addAsyncListener||n(1274),s.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,t},s.prototype.get=function(e){if(this.active)return this.active[e]},s.prototype.createContext=function(){return Object.create(this.active)},s.prototype.run=function(e){var t=this.createContext();this.enter(t);try{return e(t),t}catch(e){throw e&&(e[i]=t),e}finally{this.exit(t)}},s.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},s.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());var n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[i]=t),e}finally{n.exit(t)}}},s.prototype.enter=function(e){r.ok(e,"context must be provided for entering"),this._set.push(this.active),this.active=e},s.prototype.exit=function(e){if(r.ok(e,"context must be provided for exiting"),this.active===e)return r.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());var t=this._set.lastIndexOf(e);r.ok(t>=0,"context not currently entered; can't exit"),r.ok(t,"can't remove top context"),this._set.splice(t,1)},s.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this,n="context@"+this.name;o(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;var t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){var r=n[e];t=r.namespace.bind(t,r.context)})),t}))},s.prototype.fromException=function(e){return e[i]},process.namespaces||l(),e.exports={getNamespace:a,createNamespace:function(e){r.ok(e,"namespace must be given a name!");var t=new s(e);return t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){n&&t.enter(n)},after:function(e,n){n&&t.exit(n)},error:function(e){e&&t.exit(e)}}),process.namespaces[e]=t,t},destroyNamespace:c,reset:l}},6725:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],s=[],a=[],c=[],l=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,o[n]=f,i[f]=n;var m=e[n],g=e[m],_=e[g],y=257*e[f]^16843008*f;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*_^65537*g^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=m^e[e[e[_^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],s=0;s6&&s%n==4&&(l=o[l>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l]):(l=o[(l=l<<8|l>>>24)>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l],l^=f[s/n|0]<<24),i[s]=i[s-n]^l);for(var a=this._invKeySchedule=[],c=0;c>>24]]^d[o[l>>>16&255]]^p[o[l>>>8&255]]^h[o[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,l,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,s,a){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f>>24]^o[u>>>16&255]^i[d>>>8&255]^s[255&p]^n[h++],g=r[u>>>24]^o[d>>>16&255]^i[p>>>8&255]^s[255&l]^n[h++],_=r[d>>>24]^o[p>>>16&255]^i[l>>>8&255]^s[255&u]^n[h++],y=r[p>>>24]^o[l>>>16&255]^i[u>>>8&255]^s[255&d]^n[h++];l=m,u=g,d=_,p=y}m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^n[h++],g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&l])^n[h++],_=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^n[h++],y=(a[p>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],e[t]=m,e[t+1]=g,e[t+2]=_,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)},8976:function(e,t,n){var r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w;e.exports=(r=n(8112),n(6165),void(r.lib.Cipher||(o=r,i=o.lib,s=i.Base,a=i.WordArray,c=i.BufferedBlockAlgorithm,l=o.enc,l.Utf8,u=l.Base64,d=o.algo.EvpKDF,p=i.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?w:v}return function(t){return{encrypt:function(n,r,o){return e(r).encrypt(t,n,r,o)},decrypt:function(n,r,o){return e(r).decrypt(t,n,r,o)}}}}()}),i.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),h=o.mode={},f=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=h.CBC=function(){var e=f.extend();function t(e,t,n){var r,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var i=0;i>>2];e.sigBytes-=t}},i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:m,padding:g}),reset:function(){var e;p.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),_=i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(o.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?a.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),_.create({ciphertext:n,salt:t})}},v=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r),i=o.finalize(t),s=o.cfg;return _.create({ciphertext:i,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(o.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var o=d.create({keySize:t+n}).compute(e,r),i=a.create(o.words.slice(t),4*n);return o.sigBytes=4*t,_.create({key:o,iv:i,salt:r})}},w=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:b}),encrypt:function(e,t,n,r){var o=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=o.iv;var i=v.encrypt.call(this,e,t,o.key,r);return i.mixIn(o),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var o=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=o.iv,v.decrypt.call(this,e,t,o.key,r)}}))))},8112:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r)try{r=n(6113)}catch(e){}var o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(i=0;i>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},p=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},h=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*c,i);if(c){for(var d=0;d>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},8559:function(e,t,n){var r;e.exports=(r=n(8112),function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(r,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(r,2*n)}}}(),r.enc.Utf16)},6165:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(1284),n(3456),i=(o=(r=u).lib).Base,s=o.WordArray,c=(a=r.algo).MD5,l=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),i=s.create(),a=i.words,c=r.keySize,l=r.iterations;a.lengthr&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,l=0;l>>2]|=e[o]<<24-o%4*8;t.call(this,r,n)}else t.apply(this,arguments)};n.prototype=e}}(),r.lib.WordArray)},4678:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,s=e[t+0],c=e[t+1],h=e[t+2],f=e[t+3],m=e[t+4],g=e[t+5],_=e[t+6],y=e[t+7],v=e[t+8],b=e[t+9],w=e[t+10],x=e[t+11],T=e[t+12],E=e[t+13],C=e[t+14],S=e[t+15],k=i[0],P=i[1],I=i[2],R=i[3];k=l(k,P,I,R,s,7,a[0]),R=l(R,k,P,I,c,12,a[1]),I=l(I,R,k,P,h,17,a[2]),P=l(P,I,R,k,f,22,a[3]),k=l(k,P,I,R,m,7,a[4]),R=l(R,k,P,I,g,12,a[5]),I=l(I,R,k,P,_,17,a[6]),P=l(P,I,R,k,y,22,a[7]),k=l(k,P,I,R,v,7,a[8]),R=l(R,k,P,I,b,12,a[9]),I=l(I,R,k,P,w,17,a[10]),P=l(P,I,R,k,x,22,a[11]),k=l(k,P,I,R,T,7,a[12]),R=l(R,k,P,I,E,12,a[13]),I=l(I,R,k,P,C,17,a[14]),k=u(k,P=l(P,I,R,k,S,22,a[15]),I,R,c,5,a[16]),R=u(R,k,P,I,_,9,a[17]),I=u(I,R,k,P,x,14,a[18]),P=u(P,I,R,k,s,20,a[19]),k=u(k,P,I,R,g,5,a[20]),R=u(R,k,P,I,w,9,a[21]),I=u(I,R,k,P,S,14,a[22]),P=u(P,I,R,k,m,20,a[23]),k=u(k,P,I,R,b,5,a[24]),R=u(R,k,P,I,C,9,a[25]),I=u(I,R,k,P,f,14,a[26]),P=u(P,I,R,k,v,20,a[27]),k=u(k,P,I,R,E,5,a[28]),R=u(R,k,P,I,h,9,a[29]),I=u(I,R,k,P,y,14,a[30]),k=d(k,P=u(P,I,R,k,T,20,a[31]),I,R,g,4,a[32]),R=d(R,k,P,I,v,11,a[33]),I=d(I,R,k,P,x,16,a[34]),P=d(P,I,R,k,C,23,a[35]),k=d(k,P,I,R,c,4,a[36]),R=d(R,k,P,I,m,11,a[37]),I=d(I,R,k,P,y,16,a[38]),P=d(P,I,R,k,w,23,a[39]),k=d(k,P,I,R,E,4,a[40]),R=d(R,k,P,I,s,11,a[41]),I=d(I,R,k,P,f,16,a[42]),P=d(P,I,R,k,_,23,a[43]),k=d(k,P,I,R,b,4,a[44]),R=d(R,k,P,I,T,11,a[45]),I=d(I,R,k,P,S,16,a[46]),k=p(k,P=d(P,I,R,k,h,23,a[47]),I,R,s,6,a[48]),R=p(R,k,P,I,y,10,a[49]),I=p(I,R,k,P,C,15,a[50]),P=p(P,I,R,k,g,21,a[51]),k=p(k,P,I,R,T,6,a[52]),R=p(R,k,P,I,f,10,a[53]),I=p(I,R,k,P,w,15,a[54]),P=p(P,I,R,k,c,21,a[55]),k=p(k,P,I,R,v,6,a[56]),R=p(R,k,P,I,S,10,a[57]),I=p(I,R,k,P,_,15,a[58]),P=p(P,I,R,k,E,21,a[59]),k=p(k,P,I,R,m,6,a[60]),R=p(R,k,P,I,x,10,a[61]),I=p(I,R,k,P,h,15,a[62]),P=p(P,I,R,k,b,21,a[63]),i[0]=i[0]+k|0,i[1]=i[1]+P|0,i[2]=i[2]+I|0,i[3]=i[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),s=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,o,i,s){var a=e+(t&n|~t&r)+o+s;return(a<>>32-i)+t}function u(e,t,n,r,o,i,s){var a=e+(t&r|n&~r)+o+s;return(a<>>32-i)+t}function d(e,t,n,r,o,i,s){var a=e+(t^n^r)+o+s;return(a<>>32-i)+t}function p(e,t,n,r,o,i,s){var a=e+(n^(t|~r))+o+s;return(a<>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)},8581:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,n,r){var o,i=this._iv;i?(o=i.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var s=0;s>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var a=s.slice(0);r.encryptBlock(a,0);for(var c=0;c>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)},7051:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(o-1)).concat(r.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)},6863:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)},6261:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},2864:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},r.pad.ZeroPadding)},9220:function(e,t,n){var r,o,i,s,a,c,l,u,d;e.exports=(d=n(8112),n(1284),n(3456),i=(o=(r=d).lib).Base,s=o.WordArray,c=(a=r.algo).SHA1,l=a.HMAC,u=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=l.create(n.hasher,e),o=s.create(),i=s.create([1]),a=o.words,c=i.words,u=n.keySize,d=n.iterations;a.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)r[o]^=n[o+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=p,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),r.RabbitLegacy)},5129:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],a=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)o[n]^=r[n+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(o[0]^=l,o[1]^=d,o[2]^=u,o[3]^=p,o[4]^=l,o[5]^=d,o[6]^=u,o[7]^=p,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),r.Rabbit)},3954:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var i=0;o<256;o++){var s=o%n,a=t[s>>>2]>>>24-s%4*8&255;i=(i+r[o]+a)%256;var c=r[o];r[o]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}e.RC4=t._createHelper(o);var s=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(),r.RC4)},3787:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=o.create([0,1518500249,1859775393,2400959708,2840853838]),p=o.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=i.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i,s,h,b,w,x,T,E,C,S,k,P=this._hash.words,I=d.words,R=p.words,O=a.words,A=c.words,N=l.words,D=u.words;for(x=i=P[0],T=s=P[1],E=h=P[2],C=b=P[3],S=w=P[4],n=0;n<80;n+=1)k=i+e[t+O[n]]|0,k+=n<16?f(s,h,b)+I[0]:n<32?m(s,h,b)+I[1]:n<48?g(s,h,b)+I[2]:n<64?_(s,h,b)+I[3]:y(s,h,b)+I[4],k=(k=v(k|=0,N[n]))+w|0,i=w,w=b,b=v(h,10),h=s,s=k,k=x+e[t+A[n]]|0,k+=n<16?y(T,E,C)+R[0]:n<32?_(T,E,C)+R[1]:n<48?g(T,E,C)+R[2]:n<64?m(T,E,C)+R[3]:f(T,E,C)+R[4],k=(k=v(k|=0,D[n]))+S|0,x=S,S=C,C=v(E,10),E=T,T=k;k=P[1]+h+C|0,P[1]=P[2]+b+S|0,P[2]=P[3]+w+x|0,P[3]=P[4]+i+T|0,P[4]=P[0]+s+E|0,P[0]=k},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,i=o.words,s=0;s<5;s++){var a=i[s];i[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function v(e,t){return e<>>32-t}t.RIPEMD160=i._createHelper(h),t.HmacRIPEMD160=i._createHmacHelper(h)}(Math),r.RIPEMD160)},1284:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(o=(r=u=n(8112)).lib,i=o.WordArray,s=o.Hasher,a=r.algo,c=[],l=a.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],l=0;l<80;l++){if(l<16)c[l]=0|e[t+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+a+c[l];d+=l<20?1518500249+(o&i|~o&s):l<40?1859775393+(o^i^s):l<60?(o&i|o&s|i&s)-1894007588:(o^i^s)-899497514,a=s,s=i,i=o<<30|o>>>2,o=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=s._createHelper(l),r.HmacSHA1=s._createHmacHelper(l),u.SHA1)},3816:function(e,t,n){var r,o,i,s,a,c;e.exports=(c=n(8112),n(2232),o=(r=c).lib.WordArray,i=r.algo,s=i.SHA256,a=i.SHA224=s.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=s._createHelper(a),r.HmacSHA224=s._createHmacHelper(a),c.SHA224)},2232:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(a[o]=n(e.pow(r,.5))),c[o]=n(e.pow(r,1/3)),o++),r++}();var l=[],u=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=0;h<64;h++){if(h<16)l[h]=0|e[t+h];else{var f=l[h-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,g=l[h-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+_+l[h-16]}var y=r&o^r&i^o&i,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&d)+c[h]+l[h];p=d,d=u,u=a,a=s+b|0,s=i,i=o,o=r,r=b+(v+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(u),t.HmacSHA256=i._createHmacHelper(u)}(Math),r.SHA256)},1455:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.x64.Word,a=t.algo,c=[],l=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var a=0,d=0,p=0;p<7;p++){if(1&o){var h=(1<>>24)|4278255360&(i<<24|i>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(P=n[o]).high^=s,P.low^=i}for(var a=0;a<24;a++){for(var p=0;p<5;p++){for(var h=0,f=0,m=0;m<5;m++)h^=(P=n[p+5*m]).high,f^=P.low;var g=d[p];g.high=h,g.low=f}for(p=0;p<5;p++){var _=d[(p+4)%5],y=d[(p+1)%5],v=y.high,b=y.low;for(h=_.high^(v<<1|b>>>31),f=_.low^(b<<1|v>>>31),m=0;m<5;m++)(P=n[p+5*m]).high^=h,P.low^=f}for(var w=1;w<25;w++){var x=(P=n[w]).high,T=P.low,E=c[w];E<32?(h=x<>>32-E,f=T<>>32-E):(h=T<>>64-E,f=x<>>64-E);var C=d[l[w]];C.high=h,C.low=f}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,p=0;p<5;p++)for(m=0;m<5;m++){var P=n[w=p+5*m],I=d[w],R=d[(p+1)%5+5*m],O=d[(p+2)%5+5*m];P.high=I.high^~R.high&O.high,P.low=I.low^~R.low&O.low}P=n[0];var A=u[a];P.high^=A.high,P.low^=A.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,l=[],u=0;u>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(p)}return new o.init(l,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=i._createHelper(p),t.HmacSHA3=i._createHmacHelper(p)}(Math),r.SHA3)},1007:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(8400),n(9039),o=(r=u).x64,i=o.Word,s=o.WordArray,a=r.algo,c=a.SHA512,l=a.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},9039:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,s=e.algo;function a(){return o.create.apply(o,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=a()}();var u=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=r.high,f=r.low,m=o.high,g=o.low,_=i.high,y=i.low,v=s.high,b=s.low,w=a.high,x=a.low,T=u.high,E=u.low,C=d.high,S=d.low,k=p.high,P=p.low,I=h,R=f,O=m,A=g,N=_,D=y,M=v,L=b,$=w,j=x,F=T,q=E,B=C,U=S,H=k,W=P,z=0;z<80;z++){var K,V,G=l[z];if(z<16)V=G.high=0|e[t+2*z],K=G.low=0|e[t+2*z+1];else{var J=l[z-15],X=J.high,Q=J.low,Y=(X>>>1|Q<<31)^(X>>>8|Q<<24)^X>>>7,Z=(Q>>>1|X<<31)^(Q>>>8|X<<24)^(Q>>>7|X<<25),ee=l[z-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,oe=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=l[z-7],se=ie.high,ae=ie.low,ce=l[z-16],le=ce.high,ue=ce.low;V=(V=(V=Y+se+((K=Z+ae)>>>0>>0?1:0))+re+((K+=oe)>>>0>>0?1:0))+le+((K+=ue)>>>0>>0?1:0),G.high=V,G.low=K}var de,pe=$&F^~$&B,he=j&q^~j&U,fe=I&O^I&N^O&N,me=R&A^R&D^A&D,ge=(I>>>28|R<<4)^(I<<30|R>>>2)^(I<<25|R>>>7),_e=(R>>>28|I<<4)^(R<<30|I>>>2)^(R<<25|I>>>7),ye=($>>>14|j<<18)^($>>>18|j<<14)^($<<23|j>>>9),ve=(j>>>14|$<<18)^(j>>>18|$<<14)^(j<<23|$>>>9),be=c[z],we=be.high,xe=be.low,Te=H+ye+((de=W+ve)>>>0>>0?1:0),Ee=_e+me;H=B,W=U,B=F,U=q,F=$,q=j,$=M+(Te=(Te=(Te=Te+pe+((de+=he)>>>0>>0?1:0))+we+((de+=xe)>>>0>>0?1:0))+V+((de+=K)>>>0>>0?1:0))+((j=L+de|0)>>>0>>0?1:0)|0,M=N,L=D,N=O,D=A,O=I,A=R,I=Te+(ge+fe+(Ee>>>0<_e>>>0?1:0))+((R=de+Ee|0)>>>0>>0?1:0)|0}f=r.low=f+R,r.high=h+I+(f>>>0>>0?1:0),g=o.low=g+A,o.high=m+O+(g>>>0>>0?1:0),y=i.low=y+D,i.high=_+N+(y>>>0>>0?1:0),b=s.low=b+L,s.high=v+M+(b>>>0>>0?1:0),x=a.low=x+j,a.high=w+$+(x>>>0>>0?1:0),E=u.low=E+q,u.high=T+F+(E>>>0>>0?1:0),S=d.low=S+U,d.high=C+B+(S>>>0>>0?1:0),P=p.low=P+W,p.high=k+H+(P>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},9708:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=s[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var l=o[i]=[],u=c[i];for(n=0;n<24;n++)l[n/6|0]|=t[(a[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(a[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var d=this._invSubKeys=[];for(n=0;n<16;n++)d[n]=o[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),p.call(this,1,1431655765);for(var r=0;r<16;r++){for(var o=n[r],i=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=l[c][((s^o[c])&u[c])>>>0];this._lBlock=s,this._rBlock=i^a}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,p.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(f)}(),r.TripleDES)},8400:function(e,t,n){var r,o,i,s,a,c;e.exports=(r=n(8112),i=(o=r).lib,s=i.Base,a=i.WordArray,(c=o.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=n(9374)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},9374:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(6292):e.exports=n(4428)},4428:(e,t,n)=>{const r=n(6224),o=n(3837);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(6974);e&&(e.stderr||e).level>=2&&(t.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(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=n(9374)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},1321:e=>{"use strict";e.exports=(e,t,n)=>{const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}},2784:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 1.0.0 < 2.0.0",patch:function(e){try{var s=new(0,n(8028).BasicTracer)(o.channel.spanContextPropagator?{scopeManager:o.channel.spanContextPropagator}:void 0),a=s.startSpan;s.startSpan=function(e,t){if(!t||!t.parent){var n=s.getCurrentSpan();n&&n.operation&&n.operation.traceparent&&(t=r({},t,{parent:{traceId:n.operation.traceparent.traceId,spanId:n.operation.traceparent.spanId}}))}var o=a.call(this,e,t);return o.addEvent("Application Insights Integration enabled"),o},s.addSpanProcessor(new i),s[t.AzureMonitorSymbol]=!0,e.setTracer(s)}catch(e){}return e}},t.enable=function(){o.channel.registerMonkeyPatch("@azure/core-tracing",t.azureCoreTracing)}},248:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:function(e){var t=e.prototype._emit;return e.prototype._emit=function(e,n){var o=t.apply(this,arguments);if(!n){var i=o;i||(i=t.call(this,e,!0)),r.channel.publish("bunyan",{level:e.level,result:i})}return o},e}},t.enable=function(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}},8159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2781);t.console={versionSpecifier:">= 4.0.0",patch:function(e){var t=new o.Writable,n=new o.Writable;t.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t}),!0},n.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t,stderr:!0}),!0};for(var i=new e.Console(t,n),s=function(t){var n=e[t];n&&(e[t]=function(){if(i[t])try{i[t].apply(i,arguments)}catch(e){}return n.apply(e,arguments)})},a=0,c=["log","info","warn","error","dir","time","timeEnd","trace","assert"];a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2784);t.azuresdk=r;var o=n(248);t.bunyan=o;var i=n(8159);t.console=i;var s=n(7834);t.mongodbCore=s;var a=n(4826);t.mongodb=a;var c=n(5856);t.mysql=c;var l=n(8345);t.pgPool=l;var u=n(7726);t.pg=u;var d=n(4765);t.redis=d;var p=n(1624);t.tedious=p;var h=n(8041);t.winston=h,t.enable=function(){o.enable(),i.enable(),s.enable(),a.enable(),c.enable(),u.enable(),l.enable(),d.enable(),h.enable(),r.enable(),p.enable()}},7834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.Server.prototype.connect;return e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.pool.write;this.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=r.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var o=this.s.pool.logout;return this.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=r.channel.bindToContext(arguments[1])),o.apply(this,arguments)},e},e}},t.enable=function(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore)}},4826:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 2.0.0 <= 3.0.5",patch:function(e){var t=e.instrument({operationIdGenerator:{next:function(){return o.channel.bindToContext((function(e){return e()}))}}}),n={};return t.on("started",(function(e){n[e.requestId]||(n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),e}},t.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:function(e){var t=e.instrument(),n={},i={};return t.on("started",(function(e){n[e.requestId]||(i[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete i[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete i[e.requestId])})),e}},t.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:function(e){!function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.coreTopology.s.pool.write;this.s.coreTopology.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=o.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var r=this.s.coreTopology.s.pool.logout;return this.s.coreTopology.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=o.channel.bindToContext(arguments[1])),r.apply(this,arguments)},e}}(e);var t=e.instrument(),n={},r={};return t.on("started",(function(e){n[e.requestId]||(r[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=e)})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete r[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete r[e.requestId])})),e}},t.enable=function(){o.channel.registerMonkeyPatch("mongodb",t.mongo2),o.channel.registerMonkeyPatch("mongodb",t.mongo3),o.channel.registerMonkeyPatch("mongodb",t.mongo330)}},5856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(1017);t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:function(e,t){var i=function(e,t){return function(t,n){var o=e[t];o&&(e[t]=function(){for(var e=arguments.length-1,t=arguments.length-1;t>=0;--t){if("function"==typeof arguments[t]){e=t;break}if(void 0!==arguments[t])break}var i=arguments[e],s={result:null,startTime:null,startDate:null};"function"==typeof i&&(n?(s.startTime=process.hrtime(),s.startDate=new Date,arguments[e]=r.channel.bindToContext(n(s,i))):arguments[e]=r.channel.bindToContext(i));var a=o.apply(this,arguments);return s.result=a,a})}},s=function(e,t){return i(e.prototype)},a=n(1055)(o.dirname(t)+"/lib/Connection");["connect","changeUser","ping","statistics","end"].forEach((function(e){return s(a)(e)})),i(a)("createQuery",(function(e,t){return function(n){var o=process.hrtime(e.startTime),i=1e3*o[0]+o[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:i,time:e.startDate}),t.apply(this,arguments)}}));var c=n(6990)(o.dirname(t)+"/lib/Pool");return["_enqueueCallback"].forEach((function(e){return s(c)(e)})),e}},t.enable=function(){r.channel.registerMonkeyPatch("mysql",t.mysql)}},8345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:function(e){var t=e.prototype.connect;return e.prototype.connect=function(e){return e&&(arguments[0]=r.channel.bindToContext(e)),t.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}},7726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2361);t.postgres6={versionSpecifier:"6.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},l=process.hrtime();function u(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(l);if(c.result=n&&{rowCount:n.rowCount,command:n.command},c.error=t,c.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",c),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(c.query.preparable={text:e,args:t},s=u(s)):(c.query.text=e,s?s=u(s):t=u(t)):("string"==typeof e.name?c.query.plan=e.name:e.values instanceof Array?c.query.preparable={text:e.text,args:e.values}:c.query.text=e.text,s?s=u(s):t?t=u(t):e.callback=u(e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments)},e}},t.postgres7={versionSpecifier:">=7.* <=8.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c=this,l=!!s,u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime();function p(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(d);if(u.result=n&&{rowCount:n.rowCount,command:n.command},u.error=t,u.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",u),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(u.query.preparable={text:e,args:t},s=(l="function"==typeof s)?p(s):s):(u.query.text=e,s?s=(l="function"==typeof s)?p(s):s:t=(l="function"==typeof t)?p(t):t):("string"==typeof e.name?u.query.plan=e.name:e.values instanceof Array?u.query.preparable={text:e.text,args:e.values}:u.query.text=e.text,s?(l="function"==typeof s,s=p(s)):t?t=(l="function"==typeof t)?p(t):t:(l="function"==typeof e.callback,e.callback=l?p(e.callback):e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments),l?a:a.then((function(e){return p()(void 0,e),new c._Promise((function(t,n){t(e)}))})).catch((function(e){return p()(e,void 0),new c._Promise((function(t,n){n(e)}))}))},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg",t.postgres6),r.channel.registerMonkeyPatch("pg",t.postgres7)}},4765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.RedisClient.prototype.internal_send_command;return e.RedisClient.prototype.internal_send_command=function(e){if(e){var n=e.callback;if(!n||!n.pubsubBound){var o=this.address,i=process.hrtime(),s=new Date;e.callback=r.channel.bindToContext((function(t,a){var c=process.hrtime(i),l=1e3*c[0]+c[1]/1e6|0;r.channel.publish("redis",{duration:l,address:o,commandObj:e,err:t,result:a,time:s}),"function"==typeof n&&n.apply(this,arguments)})),e.callback.pubsubBound=!0}}return t.call(this,e)},e}},t.enable=function(){r.channel.registerMonkeyPatch("redis",t.redis)}},1624:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 6.0.0 < 9.0.0",patch:function(e){var t=e.Connection.prototype.makeRequest;return e.Connection.prototype.makeRequest=function(){function e(e){var t=process.hrtime(),n={query:{},database:{host:null,port:null},result:null,error:null,duration:0};return o.channel.bindToContext((function(i,s,a){var c=process.hrtime(t);n=r({},n,{database:{host:this.connection.config.server,port:this.connection.config.options.port},result:!i&&{rowCount:s,rows:a},query:{text:this.parametersByName.statement.value},error:i,duration:Math.ceil(1e3*c[0]+c[1]/1e6)}),o.channel.publish("tedious",n),e.call(this,i,s,a)}))}var n=arguments[0];arguments[0].callback=e(n.callback),t.apply(this,arguments)},e}},t.enable=function(){o.channel.registerMonkeyPatch("tedious",t.tedious)}},8041:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);or[n]?o:n);this.add(new t(e,{level:n}))}var r=e.createLogger;e.createLogger=function(){var o,i=arguments[0].levels||e.config.npm.levels;for(var s in i)i.hasOwnProperty(s)&&(o=void 0===o||i[s]>i[o]?s:o);var a=r.apply(this,arguments);a.add(new t(e,{level:o}));var c=a.configure;return a.configure=function(){c.apply(this,arguments),n.apply(this,arguments)},a};var a=e.createLogger;return e.configure=function(){a.apply(this,arguments),n.apply(this,arguments)},e.add(new t(e)),e}},t.winston2={versionSpecifier:"2.x",patch:function(e){var t,n=e.Logger.prototype.log,r=function(n,r,o){var i;return i=t===e.config.npm.levels?"npm":t===e.config.syslog.levels?"syslog":"unknown",s.channel.publish("winston",{level:n,message:r,meta:o,levelKind:i}),r};return e.Logger.prototype.log=function(){return t=this.levels,this.filters&&0!==this.filters.length?this.filters[this.filters.length-1]!==r&&(this.filters=this.filters.filter((function(e){return e!==r})),this.filters.push(r)):this.filters=[r],n.apply(this,arguments)},e}},t.enable=function(){s.channel.registerMonkeyPatch("winston",t.winston2),s.channel.registerMonkeyPatch("winston",t.winston3)}},1055:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=1055,e.exports=t},6990:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=6990,e.exports=t},6932:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8497),o=n(8497);t.makePatchingRequire=o.makePatchingRequire;var i=function(e){return!0},s=function(){function e(){this.version=n(9674).i8,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.currentlyPublishing=!1}return e.prototype.shouldPublish=function(e){var t=this.subscribers[e];return!!t&&t.some((function(e){var t=e.filter;return!t||t(!1)}))},e.prototype.publish=function(e,t){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=!0,n.forEach((function(e){var t=e.listener,n=e.filter;try{n&&n(!0)&&t(r)}catch(e){}})),this.currentlyPublishing=!1}}},e.prototype.subscribe=function(e,t,n){void 0===n&&(n=i),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:t,filter:n})},e.prototype.unsubscribe=function(e,t,n){void 0===n&&(n=i);var r=this.subscribers[e];if(r)for(var o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1017),o=n(6190),i=n(8188),s=Object.keys(process.binding("natives")),a=i.prototype.require;t.makePatchingRequire=function(e){var t={};return function(n){var c=a.apply(this,arguments);if(e[n]){var l=i._resolveFilename(n,this);if(t.hasOwnProperty(l))return t[l];var u=void 0;if(s.indexOf(n)<0)try{u=a.call(this,r.join(n,"package.json")).version}catch(e){return c}else u=process.version.substring(1);var d=u.indexOf("-");d>=0&&(u=u.substring(0,d));for(var p=c,h=0,f=e[n];h{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var L=s++;i[L]="^"+i[D]+i[C]+"$";var $=s++;i[$]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var U=s++;i[U]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[$]:o[L];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},7267:(e,t,n)=>{"use strict";var r=n(4403),o=r.wrap,i=r.unwrap,s="wrap@before";function a(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function c(e,t){var n;return n=e._events&&e._events[t],Array.isArray(n)||(n=n?[n]:[]),n}function l(e,t){if(e){var n=e;if("function"==typeof e)n=t(e);else if(Array.isArray(e)){n=[];for(var r=0;r0&&function(e,t){for(var n=t.length,r=0;r{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},7418:(e,t,n)=>{"use strict";var r=n(1320),o=n(8049);e.exports=function(e){var t=r(e);return t.token="","x-oauth-basic"===t.password?t.token=t.user:"x-token-auth"===t.user&&(t.token=t.password),o(t.protocols)||0===t.protocols.length&&o(e)?t.protocol="ssh":t.protocols.length?t.protocol=t.protocols[0]:(t.protocol="file",t.protocols=["file"]),t.href=t.href.replace(/\/$/,""),t}},6314:(e,t,n)=>{"use strict";var r=n(7418);function o(e){if("string"!=typeof e)throw new Error("The url must be a string.");/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i.test(e)&&(e="https://github.com/"+e);var t=r(e),n=t.resource.split("."),i=null;switch(t.toString=function(e){return o.stringify(this,e)},t.source=n.length>2?n.slice(1-n.length).join("."):t.source=t.resource,t.git_suffix=/\.git$/.test(t.pathname),t.name=decodeURIComponent((t.pathname||t.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),t.owner=decodeURIComponent(t.user),t.source){case"git.cloudforge.com":t.owner=t.user,t.organization=n[0],t.source="cloudforge.com";break;case"visualstudio.com":if("vs-ssh.visualstudio.com"===t.resource){4===(i=t.name.split("/")).length&&(t.organization=i[1],t.owner=i[2],t.name=i[3],t.full_name=i[2]+"/"+i[3]);break}2===(i=t.name.split("/")).length?(t.owner=i[1],t.name=i[1],t.full_name="_git/"+t.name):3===i.length?(t.name=i[2],"DefaultCollection"===i[0]?(t.owner=i[2],t.organization=i[0],t.full_name=t.organization+"/_git/"+t.name):(t.owner=i[0],t.full_name=t.owner+"/_git/"+t.name)):4===i.length&&(t.organization=i[0],t.owner=i[1],t.name=i[3],t.full_name=t.organization+"/"+t.owner+"/_git/"+t.name);break;case"dev.azure.com":case"azure.com":if("ssh.dev.azure.com"===t.resource){4===(i=t.name.split("/")).length&&(t.organization=i[1],t.owner=i[2],t.name=i[3]);break}5===(i=t.name.split("/")).length?(t.organization=i[0],t.owner=i[1],t.name=i[4],t.full_name="_git/"+t.name):3===i.length?(t.name=i[2],"DefaultCollection"===i[0]?(t.owner=i[2],t.organization=i[0],t.full_name=t.organization+"/_git/"+t.name):(t.owner=i[0],t.full_name=t.owner+"/_git/"+t.name)):4===i.length&&(t.organization=i[0],t.owner=i[1],t.name=i[3],t.full_name=t.organization+"/"+t.owner+"/_git/"+t.name),t.query&&t.query.path&&(t.filepath=t.query.path.replace(/^\/+/g,"")),t.query&&t.query.version&&(t.ref=t.query.version.replace(/^GB/,""));break;default:var s=(i=t.name.split("/")).length-1;if(i.length>=2){var a=i.indexOf("-",2),c=i.indexOf("blob",2),l=i.indexOf("tree",2),u=i.indexOf("commit",2),d=i.indexOf("src",2),p=i.indexOf("raw",2),h=i.indexOf("edit",2);s=a>0?a-1:c>0?c-1:l>0?l-1:u>0?u-1:d>0?d-1:p>0?p-1:h>0?h-1:s,t.owner=i.slice(0,s).join("/"),t.name=i[s],u&&(t.commit=i[s+2])}t.ref="",t.filepathtype="",t.filepath="";var f=i.length>s&&"-"===i[s+1]?s+1:s;i.length>f+2&&["raw","src","blob","tree","edit"].indexOf(i[f+1])>=0&&(t.filepathtype=i[f+1],t.ref=i[f+2],i.length>f+3&&(t.filepath=i.slice(f+3).join("/"))),t.organization=t.owner}t.full_name||(t.full_name=t.owner,t.name&&(t.full_name&&(t.full_name+="/"),t.full_name+=t.name)),t.owner.startsWith("scm/")&&(t.source="bitbucket-server",t.owner=t.owner.replace("scm/",""),t.organization=t.owner,t.full_name=t.owner+"/"+t.name);var m=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/.exec(t.pathname);return null!=m&&(t.source="bitbucket-server","users"===m[1]?t.owner="~"+m[2]:t.owner=m[2],t.organization=t.owner,t.name=m[3],(i=m[4].split("/")).length>1&&(["raw","browse"].indexOf(i[1])>=0?(t.filepathtype=i[1],i.length>2&&(t.filepath=i.slice(2).join("/"))):"commits"===i[1]&&i.length>2&&(t.commit=i[2])),t.full_name=t.owner+"/"+t.name,t.query.at?t.ref=t.query.at:t.ref=""),t}o.stringify=function(e,t){t=t||(e.protocols&&e.protocols.length?e.protocols.join("+"):e.protocol);var n=e.port?":"+e.port:"",r=e.user||"git",o=e.git_suffix?".git":"";switch(t){case"ssh":return n?"ssh://"+r+"@"+e.resource+n+"/"+e.full_name+o:r+"@"+e.resource+":"+e.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return t+"://"+r+"@"+e.resource+n+"/"+e.full_name+o;case"http":case"https":return t+"://"+(e.token?function(e){return"bitbucket.org"===e.source?"x-token-auth:"+e.token+"@":e.token+"@"}(e):e.user&&(e.protocols.includes("http")||e.protocols.includes("https"))?e.user+"@":"")+e.resource+n+"/"+function(e){return"bitbucket-server"===e.source?"scm/"+e.full_name:""+e.full_name}(e)+o;default:return e.href}},e.exports=o},1875:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return-1!==r&&(-1===o||r{"use strict";const t=new Set([200,203,204,206,300,301,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),r=new Set([500,502,503,504]),o={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},i={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function s(e){const t=parseInt(e,10);return isFinite(t)?t:0}function a(e){const t={};if(!e)return t;const n=e.trim().split(/\s*,\s*/);for(const e of n){const[n,r]=e.split(/\s*=\s*/,2);t[n]=void 0===r||r.replace(/^"|"$/g,"")}return t}function c(e){let t=[];for(const n in e){const r=e[n];t.push(!0===r?n:n+"="+r)}if(t.length)return t.join(", ")}e.exports=class{constructor(e,t,{shared:n,cacheHeuristic:r,immutableMinTimeToLive:o,ignoreCargoCult:i,_fromObject:s}={}){if(s)this._fromObject(s);else{if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=!1!==n,this._cacheHeuristic=void 0!==r?r:.1,this._immutableMinTtl=void 0!==o?o:864e5,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=a(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=a(e.headers["cache-control"]),i&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!n.has(this._status)||this._rescc["no-store"]||this._isShared&&this._rescc.private||this._isShared&&!this._noAuthorization&&!this._allowsStoringAuthenticated()||!(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=a(e.headers["cache-control"]);return!t["no-cache"]&&!/no-cache/.test(e.headers.pragma)&&(!(t["max-age"]&&this.age()>t["max-age"])&&(!(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"])&&(!(this.stale()&&(!t["max-stale"]||this._rescc["must-revalidate"]||!(!0===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge())))&&this._requestMatches(e,!1))))}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){const t={};for(const n in e)o[n]||(t[n]=e[n]);if(e.connection){const n=e.connection.trim().split(/\s*,\s*/);for(const e of n)delete t[e]}if(t.warning){const e=t.warning.split(/,/).filter((e=>!/^\s*1[0-9][0-9]/.test(e)));e.length?t.warning=e.join(",").trim():delete t.warning}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){const e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return s(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"])return 0;if(this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)return 0;if("*"===this._resHeaders.vary)return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return s(this._rescc["s-maxage"])}if(this._rescc["max-age"])return s(this._rescc["max-age"]);const e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){const n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){const e=this.maxAge()-this.age(),t=e+s(this._rescc["stale-if-error"]),n=e+s(this._rescc["stale-while-revalidate"]);return 1e3*Math.max(0,e,t,n)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+s(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+s(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||1!==e.v)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=void 0!==e.imm?e.imm:864e5,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete t["if-modified-since"],t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter((e=>!/^\s*W\//.test(e)));e.length?t["if-none-match"]=e.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&function(e){return!e||r.has(e.status)}(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let n=!1;if(void 0!==t.status&&304!=t.status?n=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===t.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||t.headers.etag||t.headers["last-modified"]||(n=!0),!n)return{policy:new this.constructor(e,t),modified:304!=t.status,matches:!1};const o={};for(const e in this._resHeaders)o[e]=e in t.headers&&!i[e]?t.headers[e]:this._resHeaders[e];const s=Object.assign({},t,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}},7546:(e,t,n)=>{"use strict";const r=n(7147);let o;e.exports=()=>(void 0===o&&(o=function(){try{return r.statSync("/.dockerenv"),!0}catch(e){return!1}}()||function(){try{return r.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return!1}}()),o)},8049:(e,t,n)=>{"use strict";var r=n(8173);e.exports=function e(t){if(Array.isArray(t))return-1!==t.indexOf("ssh")||-1!==t.indexOf("rsync");if("string"!=typeof t)return!1;var n=r(t);if(t=t.substring(t.indexOf("://")+3),e(n))return!0;var o=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(o)&&t.indexOf("@"){"use strict";const r=n(2037),o=n(7147),i=n(7546),s=()=>{if("linux"!==process.platform)return!1;if(r.release().toLowerCase().includes("microsoft"))return!i();try{return!!o.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!i()}catch(e){return!1}};process.env.__IS_WSL_TEST__?e.exports=s:e.exports=s()},5127:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,o,i,s,a,c,l,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in r(i,s,a,c,l,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in t.arrayKeywords)for(var f=0;f{var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,s){s=s||{};var a,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=o?i(a,c,o,"day"):c>=r?i(a,c,r,"hour"):c>=n?i(a,c,n,"minute"):c>=t?i(a,c,t,"second"):a+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},1814:(e,t,n)=>{const r=n(1017),o=n(2081),{promises:i,constants:s}=n(7147),a=n(7684),c=n(7546),l=n(1321),u=r.join(__dirname,"xdg-open"),{platform:d,arch:p}=process,h=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await i.access(n,s.F_OK),r=!0}catch{}if(!r)return e;const o=await i.readFile(n,{encoding:"utf8"}),a=/(?.*)/g.exec(o);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),f=async(e,t)=>{let n;for(const r of e)try{return await t(r)}catch(e){n=e}throw n},m=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return f(e.app,(t=>m({...e,app:t})));let t,{name:n,arguments:r=[]}=e.app||{};if(r=[...r],Array.isArray(n))return f(n,(t=>m({...e,app:{name:t,arguments:r}})));const l=[],p={};if("darwin"===d)t="open",e.wait&&l.push("--wait-apps"),e.background&&l.push("--background"),e.newInstance&&l.push("--new"),n&&l.push("-a",n);else if("win32"===d||a&&!c()){const o=await h();t=a?`${o}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,l.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),a||(p.windowsVerbatimArguments=!0);const i=["Start"];e.wait&&i.push("-Wait"),n?(i.push(`"\`"${n}\`""`,"-ArgumentList"),e.target&&r.unshift(e.target)):e.target&&i.push(`"${e.target}"`),r.length>0&&(r=r.map((e=>`"\`"${e}\`""`)),i.push(r.join(","))),e.target=Buffer.from(i.join(" "),"utf16le").toString("base64")}else{if(n)t=n;else{const e="/"===__dirname;let n=!1;try{await i.access(u,s.X_OK),n=!0}catch{}t=process.versions.electron||"android"===d||e||!n?"xdg-open":u}r.length>0&&l.push(...r),e.wait||(p.stdio="ignore",p.detached=!0)}e.target&&l.push(e.target),"darwin"===d&&r.length>0&&l.push("--args",...r);const g=o.spawn(t,l,p);return e.wait?new Promise(((t,n)=>{g.once("error",n),g.once("close",(r=>{e.allowNonzeroExitCode&&r>0?n(new Error(`Exited with code ${r}`)):t(g)}))})):(g.unref(),g)},g=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return m({...t,target:e})};function _(e){if("string"==typeof e||Array.isArray(e))return e;const{[p]:t}=e;if(!t)throw new Error(`${p} is not supported`);return t}function y({[d]:e},{wsl:t}){if(t&&a)return _(t);if(!e)throw new Error(`${d} is not supported`);return _(e)}const v={};l(v,"chrome",(()=>y({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}))),l(v,"firefox",(()=>y({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}))),l(v,"edge",(()=>y({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}))),g.apps=v,g.openApp=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `name`");const{arguments:n=[]}=t||{};if(null!=n&&!Array.isArray(n))throw new TypeError("Expected `appArguments` as Array type");return m({...t,app:{name:e,arguments:n}})},e.exports=g},1756:(e,t,n)=>{"use strict";var r=n(8173);e.exports=function(e){var t={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:e,query:{},parse_failed:!1};try{var n=new URL(e);t.protocols=r(n),t.protocol=t.protocols[0],t.port=n.port,t.resource=n.hostname,t.host=n.host,t.user=n.username||"",t.password=n.password||"",t.pathname=n.pathname,t.hash=n.hash.slice(1),t.search=n.search.slice(1),t.href=n.href,t.query=Object.fromEntries(n.searchParams)}catch(n){t.protocols=["file"],t.protocol=t.protocols[0],t.port="",t.resource="",t.user="",t.pathname="",t.hash="",t.search="",t.href=e,t.query={},t.parse_failed=!0}return t}},1320:(e,t,n)=>{"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(n(1756));const i=(e,t)=>t.some((t=>t instanceof RegExp?t.test(e):t===e));const s=(e,t=!1)=>{const n=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/,r=t=>{const n=new Error(t);throw n.subject_url=e,n};"string"==typeof e&&e.trim()||r("Invalid url."),e.length>s.MAX_INPUT_LENGTH&&r("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),t&&("object"!=typeof t&&(t={stripHash:!1}),e=function(e,t){if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...t},e=e.trim(),/^data:/i.test(e))return((e,{stripHash:t})=>{const n=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!n)throw new Error(`Invalid URL: ${e}`);let{type:r,data:o,hash:i}=n.groups;const s=r.split(";");i=t?"":i;let a=!1;"base64"===s[s.length-1]&&(s.pop(),a=!0);const c=(s.shift()||"").toLowerCase(),l=[...s.map((e=>{let[t,n=""]=e.split("=").map((e=>e.trim()));return"charset"===t&&(n=n.toLowerCase(),"us-ascii"===n)?"":`${t}${n?`=${n}`:""}`})).filter(Boolean)];return a&&l.push("base64"),(l.length>0||c&&"text/plain"!==c)&&l.unshift(c),`data:${l.join(";")},${a?o.trim():o}${i?`#${i}`:""}`})(e,t);if(/^view-source:/i.test(e))throw new Error("`view-source:` is not supported as it is a non-standard protocol");const n=e.startsWith("//");!n&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));const r=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&"https:"===r.protocol&&(r.protocol="http:"),t.forceHttps&&"http:"===r.protocol&&(r.protocol="https:"),t.stripAuthentication&&(r.username="",r.password=""),t.stripHash?r.hash="":t.stripTextFragment&&(r.hash=r.hash.replace(/#?:~:text.*?$/i,"")),r.pathname){const e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let t=0,n="";for(;;){const o=e.exec(r.pathname);if(!o)break;const i=o[0],s=o.index;n+=r.pathname.slice(t,s).replace(/\/{2,}/g,"/"),n+=i,t=s+i.length}n+=r.pathname.slice(t,r.pathname.length).replace(/\/{2,}/g,"/"),r.pathname=n}if(r.pathname)try{r.pathname=decodeURI(r.pathname)}catch{}if(!0===t.removeDirectoryIndex&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=r.pathname.split("/");const n=e[e.length-1];i(n,t.removeDirectoryIndex)&&(e=e.slice(0,-1),r.pathname=e.slice(1).join("/")+"/")}if(r.hostname&&(r.hostname=r.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname)&&(r.hostname=r.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(const e of[...r.searchParams.keys()])i(e,t.removeQueryParameters)&&r.searchParams.delete(e);if(!0===t.removeQueryParameters&&(r.search=""),t.sortQueryParameters){r.searchParams.sort();try{r.search=decodeURIComponent(r.search)}catch{}}t.removeTrailingSlash&&(r.pathname=r.pathname.replace(/\/$/,""));const o=e;return e=r.toString(),t.removeSingleSlash||"/"!==r.pathname||o.endsWith("/")||""!==r.hash||(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||"/"===r.pathname)&&""===r.hash&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),n&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}(e,t));const a=o.default(e);if(a.parse_failed){const e=a.href.match(n);e?(a.protocols=["ssh"],a.protocol="ssh",a.resource=e[2],a.host=e[2],a.user=e[1],a.pathname=`/${e[3]}`,a.parse_failed=!1):r("URL parsing failed.")}return a};s.MAX_INPUT_LENGTH=2048,e.exports=s},8173:e=>{"use strict";e.exports=function(e,t){!0===t&&(t=0);var n="";if("string"==typeof e)try{n=new URL(e).protocol}catch(e){}else e&&e.constructor===URL&&(n=e.protocol);var r=n.split(/\:|\+/).filter(Boolean);return"number"==typeof t?r[t]:r}},4403:e=>{"use strict";function t(e){return"function"==typeof e}var n=console.error.bind(console);function r(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function o(e){e&&e.logger&&(t(e.logger)?n=e.logger:n("new logger isn't a function, not replacing"))}function i(e,o,i){if(e&&e[o]){if(!i)return n("no wrapper function"),void n((new Error).stack);if(t(e[o])&&t(i)){var s=e[o],a=i(s,o);return r(a,"__original",s),r(a,"__unwrap",(function(){e[o]===a&&r(e,o,s)})),r(a,"__wrapped",!0),r(e,o,a),a}n("original object and wrapper must be functions")}else n("no original function "+o+" to wrap")}function s(e,t){return e&&e[t]?e[t].__unwrap?e[t].__unwrap():void n("no original to unwrap to -- has "+t+" already been unwrapped?"):(n("no function to unwrap."),void n((new Error).stack))}o.wrap=i,o.massWrap=function(e,t,r){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){i(e,t,r)}))})):n("must provide one or more functions to wrap on modules")},o.unwrap=s,o.massUnwrap=function(e,t){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){s(e,t)}))})):n("must provide one or more functions to unwrap on modules")},e.exports=o},3031:e=>{e.exports=function(e,t){var n=[];n.push(function(e){try{return Error.prototype.toString.call(e)}catch(e){try{return""}catch(e){return""}}}(e));for(var r=0;r"}catch(e){o=""}}n.push(" at "+o)}return n.join("\n")}},6818:(e,t,n)=>{if(global._stackChain){if(global._stackChain.version!==n(735).i8)throw new Error("Conflicting version of stack-chain found");e.exports=global._stackChain}else e.exports=global._stackChain=n(2396)},2396:(e,t,n)=>{var r=n(3031);function o(){this.extend=new a,this.filter=new a,this.format=new c,this.version=n(735).i8}var i=!1;o.prototype.callSite=function e(t){t||(t={}),i=!0;var n={};Error.captureStackTrace(n,e);var r=n.stack;return i=!1,r=r.slice(t.slice||0),t.extend&&(r=this.extend._modify(n,r)),t.filter&&(r=this.filter._modify(n,r)),r};var s=new o;function a(){this._modifiers=[]}function c(){this._formater=r,this._previous=void 0}a.prototype._modify=function(e,t){for(var n=0,r=this._modifiers.length;n{"use strict";const r=n(2037),o=n(1875),i=process.env;let s;function a(e){const t=function(e){if(!1===s)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!e.isTTY&&!0!==s)return 0;const t=s?1:0;if("win32"===process.platform){const e=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||"codeship"===i.CI_NAME?1:t;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}o("no-color")||o("no-colors")||o("color=false")?s=!1:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(s=!0),"FORCE_COLOR"in i&&(s=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},3406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GitHubDeviceFlow=void 0;const r=n(9800),o=n(39),i="Iv1.b507a08c87ecfe98";async function s(e,t){const n={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4};return e.get(o.Fetcher).fetch("https://github.com/login/oauth/access_token",n).then((e=>e.json()))}async function a(e,t){return e.get(o.Fetcher).fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}}).then((e=>e.json()))}t.GitHubDeviceFlow=class{async getToken(e){const t=await async function(e){const t={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,scope:"read:user"},timeout:3e4},n=e.get(o.Fetcher).fetch("https://github.com/login/device/code",t);return(await n).json()}(e),n=new Promise((async(n,r)=>{let o,i=t.expires_in;for(;i>0;){const r=await s(e,t.device_code);if(i-=t.interval,await new Promise((e=>setTimeout(e,1e3*t.interval))),o=r.access_token,o)return void n({user:(await a(e,o)).login,oauth_token:o})}r("Timed out waiting for login to complete")}));return{...t,waitForAuth:n}}}},9321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestContext=t.AuthManager=void 0;const r=n(5765),o=n(150),i=n(5611),s=n(5381);class a{constructor(e,t){this.persistenceManager=e,this.mkTokenManager=t,this._pendingSignIn=void 0}getCopilotTokenManager(){return this._copilotTokenManager}setPendingSignIn(e){this._pendingSignIn=e}getPendingSignIn(){return this._pendingSignIn}async checkAndUpdateStatus(e,t){var n;const r=null!==(n=null==t?void 0:t.localChecksOnly)&&void 0!==n&&n;let o;if("true"===process.env.CODESPACES&&process.env.GITHUB_TOKEN&&(o={user:process.env.GITHUB_USER||"codespace-user",oauth_token:process.env.GITHUB_TOKEN}),void 0===o&&(o=await this.getAuthRecord()),void 0===o)return this._copilotTokenManager=void 0,{status:"NotSignedIn"};if(r)return{status:"MaybeOK",user:o.user};const i={token:o.oauth_token};o.dev_override&&(i.devOverride={copilotTokenUrl:o.dev_override.copilot_token_url,notificationUrl:o.dev_override.notification_url});const s=this.mkTokenManager(i),a=await s.checkCopilotToken(e);return"status"in a?"unconfigured"===a.telemetry&&!1===await this.getTelemetryConsent(o.user)?(this._copilotTokenManager=void 0,{status:"NoTelemetryConsent",user:o.user}):(this._copilotTokenManager=s,{status:"OK",user:o.user}):(this._copilotTokenManager=void 0,{status:"HTTP401"===a.reason?"NotSignedIn":a.reason,user:o.user})}async getAuthRecord(){return await this.persistenceManager.read("hosts","github.com")}async setAuthRecord(e){await this.persistenceManager.update("hosts","github.com",e)}async deleteAuthRecord(){await this.persistenceManager.delete("hosts","github.com")}async getTelemetryConsent(e){const t=await this.persistenceManager.read("terms",e);return!(!(null==t?void 0:t.version)||t.version!==o.LAST_TELEMETRY_TERMS_UPDATE)}async recordTelemetryConsent(e){await this.persistenceManager.update("terms",e,{version:o.LAST_TELEMETRY_TERMS_UPDATE})}}t.AuthManager=a,t.createRequestContext=async function(e,t){let n=t;if(void 0===n&&(n=e.get(a).getCopilotTokenManager()),void 0===n){const t=await e.get(a).checkAndUpdateStatus(e);if("OK"!==t.status)return{code:s.ErrorCode.NoCopilotToken,message:`Not authenticated: ${t.status}`};if(n=e.get(a).getCopilotTokenManager(),void 0===n)return{code:s.ErrorCode.InternalError,message:"Unexpected missing Copilot token"}}const o=new i.Context(e);return o.set(r.CopilotTokenManager,n),o}},9582:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.MergedToken=void 0;const n=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}})),r=Object.freeze({isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),o=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n});class i{constructor(){this._isCancelled=!1,this.handlers=[]}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}get isCancellationRequested(){return this._isCancelled}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}dispose(){this.handlers=[]}}t.MergedToken=class{constructor(e){this.tokens=[],this.handlers=[],this._isCancelled=!1,this.tokens=e,this._isCancelled=e.some((e=>e.isCancellationRequested)),e.forEach((e=>{e.onCancellationRequested(this.cancel,this)}))}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}dispose(){this.tokens=[]}get isCancellationRequested(){return this.tokens.some((e=>e.isCancellationRequested))}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}},t.CancellationTokenSource=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new i),this._token}cancel(){this._token?this._token instanceof i&&this._token.cancel():this._token=o}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof i&&this._token.dispose():this._token=r}}},8212:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.extensions=t.workspace=t.env=t.UIKind=t.EndOfLine=void 0,(r=t.EndOfLine||(t.EndOfLine={}))[r.LF=1]="LF",r[r.CRLF=2]="CRLF",function(e){e[e.Web=0]="Web",e[e.Desktop=1]="Desktop"}(n=t.UIKind||(t.UIKind={})),t.env={isTelemetryEnabled:!0,uiKind:n.Desktop,appRoot:"/non-existent-path"},t.workspace={onDidChangeConfiguration:()=>{},getConfiguration:()=>({})},t.extensions={getExtension:e=>{}}},3895:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentEditorInfo=t.AgentConfigProvider=void 0;const r=n(9800);class o extends r.InMemoryConfigProvider{constructor(){super(new r.DefaultsOnlyConfigProvider,new Map)}getOptionalConfig(e){if(!Array.isArray(e)||"editor"!=e[0]||this.isDefaultSettingOverwritten(e))return super.getConfig(e)}}t.AgentConfigProvider=o;class i extends r.EditorAndPluginInfo{setEditorAndPluginInfo(e,t){this._editorInfo=e,this._editorPluginInfo=t}getEditorInfo(e){return this._editorInfo?this._editorInfo:{name:"unknown-editor",version:"0"}}getEditorPluginInfo(e){return this._editorPluginInfo?this._editorPluginInfo:{name:"unknown-editor-plugin",version:"0"}}}t.AgentEditorInfo=i},3007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotCompletionCache=void 0;const r=n(140);class o extends r.LRUCache{constructor(e=100){super(e)}}t.CopilotCompletionCache=o},4445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugServer=void 0;const r=n(2361),o=n(7147),i=n(3685),s=n(1017),a=n(2781);function c(e,t){e.write("data: "+t.toString().replace(/\n/g,"\ndata: ")+"\n\n")}t.DebugServer=class{constructor(e){this.port=e,this.stdoutEmitter=new r.EventEmitter,this.server=i.createServer(((e,t)=>{if(e.headers.accept&&"text/event-stream"==e.headers.accept)switch(t.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),e.url){case"/stdin":return void process.stdin.on("data",(e=>{c(t,e)}));case"/stdout":return void this.stdoutEmitter.on("data",(e=>{c(t,e)}));default:return t.writeHead(404),void t.end()}t.writeHead(200,{"Content-Type":"text/html"});let n,r=__dirname;"dist"===s.basename(__dirname)&&(r=s.dirname(__dirname));try{n=o.readFileSync(s.join(r,"dist","debugServer.html"))}catch(e){n=e.toString()}t.write(n),t.end()}))}wrapStdout(e){return new a.Writable({write:(t,n,r)=>(this.stdoutEmitter.emit("data",t),e.write(t,n,r))})}listen(){return this.server.listen(this.port),this}}},9841:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationLogger=void 0;const r=n(7089),o=n(5798),i=n(7214);class s extends o.LogTarget{constructor(e){super(),this.debugMode=e}logIt(e,t,n,...s){const a={level:t,message:`${n} ${s.map(o.toPlainText)}`,metadataStr:n,extra:s.map(o.toPlainText)};e.get(i.AgentNotificationSender).sendNotification(new r.NotificationType("LogMessage"),a)}shouldLog(e,t){return!!this.debugMode||t>o.LogLevel.DEBUG}}t.NotificationLogger=s},1926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationStatusReporter=void 0;const r=n(7089),o=n(7214);t.NotificationStatusReporter=class{constructor(e){this.ctx=e,this.notificationEndpoint="statusNotification",this.status="Normal"}setProgress(){"Error"!==this.status&&(this.status="InProgress",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"InProgress",message:""}))}removeProgress(){"Error"!==this.status&&"Warning"!==this.status&&(this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""}))}forceNormal(){this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""})}setWarning(){"Error"!==this.status&&(this.status="Warning",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Warning",message:""}))}setError(e){this.status="Error";const t={status:"Error",message:e};this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),t)}}},6021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.agentFileSystem=void 0;const r=n(7147);t.agentFileSystem={readFile:function(e){return r.promises.readFile(e)},mtime:async function(e){return(await r.promises.stat(e)).mtimeMs},stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},9729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sessionId=t.getMachineId=void 0;const r=n(6113),o=n(2037),i=n(7057),s=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function a(e){const t=e.replace(/-/g,":").toLowerCase();return!s.has(t)}let c;t.getMachineId=function(){if(!c){const e=function(){try{const e=function(){const e=(0,o.networkInterfaces)();for(const t in e){const n=e[t];if(n)for(const{mac:e}of n)if(a(e))return e}throw new Error("Unable to retrieve mac address (unexpected format)")}();return r.createHash("sha256").update(e,"utf8").digest("hex")}catch(e){return}}();c=e||i.v4()}return c},t.sessionId=i.v4()+Date.now()},6995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.initializeLateDependencies=t.init=void 0;const r=n(4617),o=n(5765),i=n(2137),s=n(9800),a=n(5611),c=n(446),l=n(6905),u=n(6046),d=n(6817),p=n(4619),h=n(5798),f=n(39),m=n(598),g=n(5489),_=n(913),y=n(2369),v=n(4567),b=n(3406),w=n(9321),x=n(3895),T=n(3007),E=n(6021),C=n(9729),S=n(5332),k=n(585),P=n(2401);t.init=function(){const e=new a.Context;e.set(i.Clock,new i.Clock),e.set(s.ConfigProvider,new x.AgentConfigProvider),e.set(s.BuildInfo,new s.BuildInfo),function(e){e.set(_.RuntimeMode,_.RuntimeMode.fromEnvironment(!1)),e.set(h.LogVerbose,new h.LogVerbose((0,_.isVerboseLoggingEnabled)(e))),e.set(h.LogTarget,new h.ConsoleLog(console))}(e),t.logger.debug(e,"Initializing agent"),e.set(u.ExpConfigMaker,new u.ExpConfigNone);const n=(0,k.makeXdgPersistenceManager)();e.set(k.PersistenceManager,n);const I=new w.AuthManager(n,(e=>new o.CopilotTokenManagerFromGitHubToken(e)));e.set(b.GitHubDeviceFlow,new b.GitHubDeviceFlow),e.set(w.AuthManager,I);const R=new s.VscInfo(C.sessionId,(0,C.getMachineId)(),(0,s.getVersion)(e));return e.set(s.VscInfo,R),e.set(s.EditorAndPluginInfo,new x.AgentEditorInfo),e.set(p.GhostTextDebounceManager,new p.GhostTextDebounceManager),e.set(d.ContextualFilterManager,new d.ContextualFilterManager),e.set(f.Fetcher,new f.HelixFetcher(e)),e.set(m.OpenAIFetcher,new m.LiveOpenAIFetcher),e.set(v.UrlOpener,new v.RealUrlOpener),e.set(s.BlockModeConfig,new s.ConfigBlockModeConfig),e.set(S.MethodHandlers,(0,S.getAllMethods)()),e.set(S.NotificationHandlers,(0,S.getAllNotifications)()),e.set(T.CopilotCompletionCache,new T.CopilotCompletionCache),e.set(y.LocationFactory,new P.AgentLocationFactory),e.set(l.Features,new l.Features(e)),e.set(r.FileSystem,E.agentFileSystem),e.set(g.TelemetryReporters,(0,g.setupEmptyReporters)()),(0,f.init)((0,s.getVersion)(e)),(0,c.registerDefaultHandlers)(e,"agent"),process.on("exit",(()=>{try{t.logger.debug(e,"Shutting down agent"),e.get(g.TelemetryReporters).deactivate()}catch(e){}})),e},t.initializeLateDependencies=function(e){e.set(g.TelemetryEndpointUrlOverride,g.telemetryEndpointUrlOverride),(0,g.setupStandardReporters)(e,"agent"),t.logger.debug(e,"Telemetry initialized")},t.logger=new h.Logger(h.LogLevel.DEBUG,"agent")},6934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(6159),c=r.Type.Object({options:r.Type.Optional(r.Type.Intersect([r.Type.Object({localChecksOnly:r.Type.Optional(r.Type.Boolean())}),a.TestingOptions]))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){var r;if(!l(n)){const e=(0,s.extractAjvErrors)(l.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,a.getTestingContext)(n.options.testingCtx)),[await e.get(i.AuthManager).checkAndUpdateStatus(e,n.options),null]}},3340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetCompletionsCycling=t.handleGetCompletions=void 0;const r=n(892),o=n(6236),i=n(7057),s=n(6630),a=n(5611),c=n(3993),l=n(702),u=n(1749),d=n(5489),p=n(2369),h=n(9321),f=n(9582),m=n(3007),g=n(5381),_=n(7838),y=n(6159),v=n(2401),b=n(2930),w=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),insertSpaces:r.Type.Optional(r.Type.Boolean()),tabSize:r.Type.Optional(r.Type.Number()),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),options:r.Type.Optional(y.TestingOptions)}),x=(new o.default).compile(r.Type.Strict(w));let T;async function E(e,t,n,r,o){var w;const E=d.TelemetryData.createAndMarkAsIssued();T&&(T.cancel(),T.dispose()),T=new f.CancellationTokenSource;const C=new f.MergedToken([t,T.token]);if(!x(n)){const e=(0,g.extractAjvErrors)(x.errors);return[null,{code:g.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let S;void 0!==(null===(w=n.options)||void 0===w?void 0:w.testingCtx)&&(e=(0,y.getTestingContext)(n.options.testingCtx));try{S=e.get(b.CompletionDocuments)}catch(e){}if(S){const e=o?3:1;return[{completions:S.documents.slice(0,e).map((e=>{const{cursorLine:t,lines:r,start:o,end:s}=(0,_.parseChallengeDoc)(e,n.doc.position),a=[t.slice(Math.min(o.character,n.doc.position.character))].concat(r.slice(n.doc.position.line+1)).join("\n");return{uuid:i.v4(),text:a,displayText:a,position:n.doc.position,range:{start:o,end:s}}}))},null]}const k=await(0,h.createRequestContext)(e,r);if(!(k instanceof a.Context))return[null,k];const P=s.URI.parse(n.doc.uri);let I;try{I=await(0,v.getTextDocumentChecked)(e,P,n.doc)}catch(e){return[null,{code:g.ErrorCode.InvalidParams,message:e.message}]}const R=I.offsetAt(k.get(p.LocationFactory).position(n.doc.position.line,n.doc.position.character)),O=I.positionAt(R),A=await(0,l.getGhostText)(k,I,O,o,E,C),N=await(0,u.handleGhostTextResultTelemetry)(e,A);if(!N)return[{completions:[]},null];const[D,M]=N,L=(0,c.completionsFromGhostTextResults)(e,D,M,I,O,n.doc),$=e.get(m.CopilotCompletionCache);for(const e of L)$.put(e.uuid,e);return[{completions:L.map((e=>({uuid:e.uuid,text:e.text,range:e.range,displayText:e.displayText,position:e.position})))},null]}t.handleGetCompletions=async function(e,t,n,r){return E(e,t,n,r,!1)},t.handleGetCompletionsCycling=async function(e,t,n,r){return E(e,t,n,r,!0)}},9638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetPanelCompletions=void 0;const r=n(892),o=n(6236),i=n(6679),s=n(7057),a=n(5809),c=n(6630),l=n(9800),u=n(5611),d=n(5680),p=n(6317),h=n(5489),f=n(2369),m=n(9321),g=n(9582),_=n(7214),y=n(5381),v=n(7838),b=n(6159),w=n(2401),x=n(8730),T=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),panelId:r.Type.String(),options:r.Type.Optional(b.TestingOptions)}),E=(new o.default).compile(r.Type.Strict(T));class C{constructor(e,t,n,r,o){this.textDocument=e,this.startPosition=t,this.completionContext=n,this.solutionCountTarget=r,this.cancellationToken=o,this.savedTelemetryData=h.TelemetryData.createAndMarkAsIssued()}reportCancelled(){}getCancellationToken(){return this.cancellationToken}async getDocument(){return this.textDocument}}async function S(e,t,n,r,o){const s=await r;switch(s.status){case"Solution":n.sendNotification(new a.NotificationType("PanelSolution"),function(e,t,n){const r=(0,p.normalizeCompletionText)(n.completionText);return{panelId:e,range:t,completionText:n.completionText,displayText:n.displayText,score:n.meanProb,solutionId:(0,i.SHA256)(r).toString()}}(e,t,s.solution)),await S(e,t,n,s.next,o);break;case"FinishedNormally":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:e}),o();break;case"FinishedWithError":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"Error",message:s.error,panelId:e}),o()}}let k;t.handleGetPanelCompletions=async function(e,t,n,r,o){var i;k&&(k.cancel(),k.dispose()),k=new g.CancellationTokenSource;const a=new g.MergedToken([t,k.token]);if(!E(n)){const e=(0,y.extractAjvErrors)(E.errors);return[null,{code:y.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let h,T;void 0!==(null===(i=n.options)||void 0===i?void 0:i.testingCtx)&&(e=(0,b.getTestingContext)(n.options.testingCtx));const P=(0,l.getConfig)(e,l.ConfigKey.ListCount);let I;try{I=e.get(x.PanelCompletionDocuments)}catch(e){}if(I){const e=s.v4(),t=I.documents,r=async o=>{if(o>=P||o>=t.length)return{status:"FinishedNormally"};const{text:i,score:a}=t[o],{cursorLine:c,lines:l,start:u}=(0,v.parseChallengeDoc)(i,n.doc.position),d=[c.slice(Math.min(u.character,n.doc.position.character))].concat(l.slice(n.doc.position.line+1)).join("\n");return{status:"Solution",solution:{requestId:{headerRequestId:e,completionId:s.v4(),created:0,serverExperiments:"",deploymentId:""},completionText:d,displayText:d,meanProb:a,meanLogProb:-1,choiceIndex:o,prependToCompletion:""},next:r(o+1)}};T=n.doc.position,h=r(0)}else{const t=await(0,m.createRequestContext)(e,r);if(!(t instanceof u.Context))return[null,t];const o=c.URI.parse(n.doc.uri);let i;try{i=await(0,w.getTextDocumentChecked)(e,o,n.doc)}catch(e){return[null,{code:y.ErrorCode.InvalidParams,message:e.message}]}const s=i.offsetAt(t.get(f.LocationFactory).position(n.doc.position.line,n.doc.position.character));T=i.positionAt(s);const l=(0,d.completionContextForDocument)(e,i,T),g=new C(i,T,l,P,a);h=(0,p.launchSolutions)(t,g),e=t}return setImmediate((()=>S(n.panelId,e.get(f.LocationFactory).range(T,T),e.get(_.AgentNotificationSender),h,null!=o?o:()=>{}))),[{solutionCountTarget:P},null]}},1025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9800),s=n(5381),a=r.Type.Object({}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[{version:(0,i.getVersion)(e)},null]}},2389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(39),s=n(5381),a=r.Type.Object({url:r.Type.String(),method:r.Type.Optional(r.Type.String()),headers:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String())),body:r.Type.Optional(r.Type.String()),json:r.Type.Optional(r.Type.Any()),timeout:r.Type.Optional(r.Type.Number())}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r={};"method"in n&&(r.method=n.method),"body"in n&&(r.body=n.body),"json"in n&&(r.json=n.json);const o=n.timeout;null!=o&&(r.timeout=o),n.headers&&(r.headers=n.headers);try{const t=await e.get(i.Fetcher).fetch(n.url,r),o=await t.text();return[{status:t.status,statusText:t.statusText,headers:Object.fromEntries(t.headers),body:o},null]}catch(e){return[null,{code:s.ErrorCode.InternalError,message:e.message}]}}},5332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAllNotifications=t.NotificationHandlers=t.getAllMethods=t.MethodHandlers=void 0;const r=n(6934),o=n(3340),i=n(9638),s=n(1025),a=n(2389),c=n(5581),l=n(1382),u=n(1300),d=n(4885),p=n(9629),h=n(4489),f=n(1451),m=n(6656),g=n(1620),_=n(2530),y=n(8269),v=n(7803),b=n(2930),w=n(8730),x=n(2043),T=n(2229),E=n(8127);class C{constructor(e){this.handlers=e}}t.MethodHandlers=C,t.getAllMethods=function(){const e=new Map;return e.set("getCompletions",o.handleGetCompletions),e.set("getCompletionsCycling",o.handleGetCompletionsCycling),e.set("getPanelCompletions",i.handleGetPanelCompletions),e.set("httpRequest",a.default),e.set("getVersion",s.default),e.set("setEditorInfo",p.handleSetEditorInfo),e.set("checkStatus",r.default),e.set("signInInitiate",f.default),e.set("signInConfirm",h.default),e.set("signOut",m.default),e.set("recordTelemetryConsent",d.default),e.set("notifyShown",u.notifyShown),e.set("notifyAccepted",c.notifyAccepted),e.set("notifyRejected",l.notifyRejected),e.set("telemetry/exception",g.telemetryExceptionMethod),e.set("testing/createContext",y.default),e.set("testing/alwaysAuth",_.default),e.set("testing/neverAuth",v.default),e.set("testing/useTestingToken",T.default),e.set("testing/setCompletionDocuments",b.default),e.set("testing/setPanelCompletionDocuments",w.default),e.set("testing/triggerShowMessageRequest",x.default),e.set("debug/verifyState",E.handleVerifyState),e.set("debug/verifyWorkspaceState",E.handleVerifyWorkspaceState),new C(e)};class S{constructor(e){this.handlers=e}}t.NotificationHandlers=S,t.getAllNotifications=function(){const e=new Map;return new S(e)}},5581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyAccepted=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyAccepted=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=o.get(n.uuid);return l&&(o.deleteKey(n.uuid),(0,i.postInsertionTasks)(e,"ghostText",l.text,l.offset,l.file,l.telemetry)),["OK",null]}},4340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyNetworkProxyConfiguration=t.applySettingsToConfiguration=t.notifyChangeConfiguration=t.EditorConfigurationSettings=t.NetworkProxy=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(39),a=n(5381),c=n(6159);t.NetworkProxy=r.Type.Object({host:r.Type.String(),port:r.Type.Number(),username:r.Type.Optional(r.Type.String()),password:r.Type.Optional(r.Type.String())}),t.EditorConfigurationSettings=r.Type.Object({showEditorCompletions:r.Type.Optional(r.Type.Boolean()),enableAutoCompletions:r.Type.Optional(r.Type.Boolean()),delayCompletions:r.Type.Optional(r.Type.Boolean()),filterCompletions:r.Type.Optional(r.Type.Boolean()),disabledLanguages:r.Type.Optional(r.Type.Array(r.Type.Object({languageId:r.Type.String()})))});const l=r.Type.Object({settings:r.Type.Optional(t.EditorConfigurationSettings),networkProxy:r.Type.Optional(r.Type.Union([t.NetworkProxy,r.Type.Null()])),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));function d(e,t){const n=e.get(i.ConfigProvider);if(n.setConfig(i.ConfigKey.ShowEditorCompletions,t.showEditorCompletions),n.setConfig(i.ConfigKey.DelayCompletions,t.delayCompletions),n.setConfig(i.ConfigKey.EnableAutoCompletions,t.enableAutoCompletions),n.setConfig(i.ConfigKey.FilterCompletions,t.filterCompletions),t.disabledLanguages)for(const e of t.disabledLanguages)n.setLanguageEnablement(e.languageId,!1)}function p(e,t){if(!t)return void(e.get(s.Fetcher).proxySettings=void 0);let n;t.username&&(n=t.password?t.username+":"+t.password:t.username);const r=n?n+"@":"";process.env.http_proxy=`http://${r}${t.host}:${t.port}`,process.env.https_proxy=`http://${r}${t.host}:${t.port}`,e.get(s.Fetcher).proxySettings={host:t.host,port:t.port,proxyAuth:n,headers:{}}}t.notifyChangeConfiguration=function(e,t){var n;if(!u(t)){const e=(0,a.extractAjvErrors)(u.errors);throw new Error(`Invalid params: ${e.join(", ")}`)}void 0!==(null===(n=t.options)||void 0===n?void 0:n.testingCtx)&&(e=(0,c.getTestingContext)(t.options.testingCtx)),t.settings&&d(e,t.settings),void 0!==t.networkProxy&&p(e,t.networkProxy)},t.applySettingsToConfiguration=d,t.applyNetworkProxyConfiguration=p},1382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyRejected=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuids:r.Type.Array(r.Type.String()),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyRejected=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=n.uuids.flatMap((e=>{var t;return null!==(t=o.get(e))&&void 0!==t?t:[]}));if(l.length>0){const t=l[0];for(const e of n.uuids)o.deleteKey(e);const r=l.map((e=>({completionText:e.displayText,completionTelemetryData:e.telemetry})));(0,i.postRejectionTasks)(e,"ghostText",t.offset,t.file,r)}return["OK",null]}},1300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyShown=void 0;const r=n(892),o=n(6236),i=n(702),s=n(1749),a=n(3007),c=n(5381),l=n(6159),u=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(l.TestingOptions)}),d=(new o.default).compile(r.Type.Strict(u));t.notifyShown=async function(e,t,n){var r;if(!d(n)){const e=(0,c.extractAjvErrors)(d.errors);return[null,{code:c.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,l.getTestingContext)(n.options.testingCtx));const o=e.get(a.CopilotCompletionCache).get(n.uuid);if(o){const t=!(o.resultType===i.ResultType.Network);(0,s.telemetryShown)(e,"ghostText",o.telemetry,t)}return["OK",null]}},4885:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(i.AuthManager).getAuthRecord();return r?(e.get(i.AuthManager).recordTelemetryConsent(r.user),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]):[null,{code:s.ErrorCode.InvalidRequest,message:"Trying to record telemetry consent but the user is not signed in"}]}},9629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSetEditorInfo=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(6995),a=n(5381),c=n(4340),l=r.Type.Object({name:r.Type.String(),version:r.Type.String()}),u=r.Type.Object({editorInfo:l,editorPluginInfo:l,editorConfiguration:r.Type.Optional(c.EditorConfigurationSettings),networkProxy:r.Type.Optional(c.NetworkProxy),options:r.Type.Optional(r.Type.Object({}))}),d=(new o.default).compile(r.Type.Strict(u));t.handleSetEditorInfo=async function(e,t,n){if(!d(n)){const e=(0,a.extractAjvErrors)(d.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return e.get(i.EditorAndPluginInfo).setEditorAndPluginInfo(n.editorInfo,n.editorPluginInfo),n.editorConfiguration&&(0,c.applySettingsToConfiguration)(e,n.editorConfiguration),n.networkProxy&&(0,c.applyNetworkProxyConfiguration)(e,n.networkProxy),(0,s.initializeLateDependencies)(e),["OK",null]}},4489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(i.AuthManager).getPendingSignIn();if(void 0===r)return[null,{code:s.ErrorCode.InvalidRequest,message:"No pending sign in"}];let o;try{return o=await r,[o,null]}catch(e){return[null,{code:s.ErrorCode.DeviceFlowFailed,message:e.toString()}]}finally{e.get(i.AuthManager).setPendingSignIn(void 0)}}},1451:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(3406),s=n(9321),a=n(5381),c=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(s.AuthManager).checkAndUpdateStatus(e);if("OK"===r.status)return[{status:"AlreadySignedIn",user:r.user},null];const o=await e.get(i.GitHubDeviceFlow).getToken(e),c=o.waitForAuth.then((async t=>(await e.get(s.AuthManager).setAuthRecord(t),await e.get(s.AuthManager).checkAndUpdateStatus(e))));return e.get(s.AuthManager).setPendingSignIn(c),[{status:"PromptUserDeviceFlow",userCode:o.user_code,verificationUri:o.verification_uri,expiresIn:o.expires_in,interval:o.interval},null]}},6656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return await e.get(i.AuthManager).deleteAuthRecord(),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]}},1620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryExceptionMethod=void 0;const r=n(892),o=n(6236),i=n(5489),s=n(5381),a=r.Type.Object({origin:r.Type.String(),stacktrace:r.Type.Optional(r.Type.String()),properties:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String()))}),c=(new o.default).compile(r.Type.Strict(a));t.telemetryExceptionMethod=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=new Error("Original stacktrace: "+n.stacktrace);r.stack="";const o=n.properties||{};return await(0,i.telemetryException)(e,r,n.origin,o),["OK",null]}},2530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.AlwaysAuthManager),["OK",null]}},8269:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[(0,s.newTestingContext)(e),null]}},7803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.NotAuthManager),["OK",null]}},2930:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(r.Type.String()),options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));class l{constructor(e){this.documents=e}}t.CompletionDocuments=l,t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(l,new l(n.documents)),["OK",null]}},8730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PanelCompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({text:r.Type.String(),score:r.Type.Number()}),c=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(a),options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));class u{constructor(e){this.documents=e}}t.PanelCompletionDocuments=u,t.default=async function(e,t,n){if(!l(n)){const e=(0,i.extractAjvErrors)(l.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(u,new u(n.documents)),["OK",null]}},2043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5798),s=n(7214),a=n(5381),c=r.Type.Object({}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t){if(!l(t)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const n=e.get(s.AgentNotificationSender),r=e.get(i.LogTarget);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).catch((e=>o(i.LogLevel.ERROR,"error sending show message request",e))).then((e=>o(i.LogLevel.INFO,"response from message request",e.title))),["OK",null];async function o(t,n,o){return r.logIt(e,t,n+" ("+o+")",o)}}},2229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FakeAuthManager=void 0;const r=n(892),o=n(6236),i=n(5922),s=n(9321),a=n(5381),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));class d extends s.AuthManager{constructor(e){super(void 0,(t=>e)),this.tokenManager=e,this.user="user"}getCopilotTokenManager(){return this.tokenManager}async checkAndUpdateStatus(e,t){const n=await this.tokenManager.checkCopilotToken(e);return"status"in n?{status:"OK",user:this.user}:{status:"HTTP401"===n.reason?"NotSignedIn":n.reason,user:this.user}}}t.FakeAuthManager=d,t.default=async function(e,t,n){if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=(0,i.makeTestingCopilotTokenManager)();return(0,c.getTestingContext)(n.testingCtx).forceSet(s.AuthManager,new d(r)),["OK",null]}},8127:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleVerifyWorkspaceState=t.handleVerifyState=void 0;const r=n(892),o=n(6236),i=n(6630),s=n(819),a=n(5381),c=r.Type.Object({source:r.Type.String(),languageId:r.Type.String(),version:r.Type.Number(),uri:r.Type.String()}),l=(new o.default).compile(r.Type.Strict(c));t.handleVerifyState=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(s.TextDocumentManager),o=await r.getTextDocument(i.URI.parse(n.uri));return o?o.languageId!==n.languageId?[{status:!1,message:`Language id mismatch: [State] ${o.languageId} !== [Request] ${n.languageId}`},null]:o.getText()!==n.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${n.source}`},null]:o.version!==n.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${n.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: "${i.URI.parse(n.uri)}" (given by the editor: "${n.uri}")`},null]},t.handleVerifyWorkspaceState=async function(e,t,n){return[e.get(s.TextDocumentManager).workspaceFolders,null]}},7214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionNotificationSender=t.AgentNotificationSender=void 0;const r=n(9035);class o extends r.NotificationSender{}t.AgentNotificationSender=o,t.ConnectionNotificationSender=class extends o{constructor(e){super(),this.connection=e}sendNotification(e,t){this.connection.sendNotification(e,t)}showWarningMessage(e,...t){return this.connection.window.showWarningMessage(e,...t)}}},585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeXdgPersistenceManager=t.PersistenceManager=void 0;const r=n(7147),o=n(2037),i=n(7282);class s{constructor(e){this.directory=e}async read(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"});return JSON.parse(e)[t]}catch(e){return}}async update(e,t,n){await r.promises.mkdir(this.directory,{recursive:!0,mode:448});const o=`${this.directory}/${e}.json`;let i={};try{const e=await r.promises.readFile(o,{encoding:"utf8"});i=JSON.parse(e)}catch(e){}i[t]=n,await r.promises.writeFile(o,JSON.stringify(i)+"\n",{encoding:"utf8"})}async delete(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"}),o=JSON.parse(e);delete o[t],await r.promises.writeFile(n,JSON.stringify(o)+"\n",{encoding:"utf8"})}catch(e){}}}t.PersistenceManager=s,t.makeXdgPersistenceManager=function(){return new s(i.env.XDG_CONFIG_HOME?i.env.XDG_CONFIG_HOME+"/github-copilot":"win32"===(0,o.platform)()?i.env.USERPROFILE+"\\AppData\\Local\\github-copilot":i.env.HOME+"/.config/github-copilot")}},5381:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.extractAjvErrors=t.ErrorCode=void 0,(n=t.ErrorCode||(t.ErrorCode={}))[n.ParseError=-32700]="ParseError",n[n.InvalidRequest=-32600]="InvalidRequest",n[n.MethodNotFound=-32601]="MethodNotFound",n[n.InvalidParams=-32602]="InvalidParams",n[n.InternalError=-32603]="InternalError",n[n.NoCopilotToken=1e3]="NoCopilotToken",n[n.DeviceFlowFailed=1001]="DeviceFlowFailed",n[n.ContextNotInitialized=1002]="ContextNotInitialized",t.extractAjvErrors=function(e){return e.map((e=>`${e.instancePath} ${e.message}`))}},2879:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWrappedConnection=t.CopilotService=void 0;const r=n(7147),o=n(2781),i=n(7089),s=n(6630),a=n(5611),c=n(5225),l=n(5798),u=n(9035),d=n(6635),p=n(913),h=n(819),f=n(4445),m=n(9841),g=n(1926),_=n(5332),y=n(4340),v=n(7214),b=n(5381),w=n(540);t.CopilotService=class{constructor(e,t){this.connection=t,this.initialized=!1,this.ctx=new a.Context(e);const n=new v.ConnectionNotificationSender(t);this.ctx.set(u.NotificationSender,n),this.ctx.set(v.AgentNotificationSender,n),this.ctx.set(d.StatusReporter,new g.NotificationStatusReporter(this.ctx));const r=new l.MultiLog([this.ctx.get(l.LogTarget),new m.NotificationLogger((0,p.isDebugEnabled)(this.ctx))]);this.ctx.forceSet(l.LogTarget,r),new l.Logger(l.LogLevel.DEBUG,"agent").debug(this.ctx,"Agent service starting"),t.onRequest(this.messageHandler.bind(this)),t.onNotification(this.notificationHandler.bind(this)),t.onInitialize((async e=>{var n,r,o,a;const l=null!==(r=null===(n=e.capabilities.workspace)||void 0===n?void 0:n.workspaceFolders)&&void 0!==r&&r;return this.ctx.set(h.TextDocumentManager,new w.AgentTextDocumentManager(t,null!==(a=null===(o=e.workspaceFolders)||void 0===o?void 0:o.map((e=>s.URI.parse(e.uri))))&&void 0!==a?a:[],!(0,p.isRunningInTest)(this.ctx)&&l)),(0,c.registerDocumentTracker)(this.ctx),this.initialized=!0,{capabilities:{textDocumentSync:{openClose:!0,change:i.TextDocumentSyncKind.Incremental},workspace:{workspaceFolders:{supported:l,changeNotifications:l}}}}})),t.onDidChangeConfiguration((async e=>{(0,y.notifyChangeConfiguration)(this.ctx,e)}))}async messageHandler(e,t,n){const r=this.ctx.get(_.MethodHandlers).handlers.get(e);if(!r)return new i.ResponseError(b.ErrorCode.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new i.ResponseError(b.ErrorCode.ContextNotInitialized,"Agent service not initialized.");Array.isArray(t)&&(t=t[0]);const[o,s]=await r(this.ctx,n,t);return s?new i.ResponseError(s.code,s.message,s.data):o}async notificationHandler(e,t){const n=this.ctx.get(_.NotificationHandlers).handlers.get(e);n&&(Array.isArray(t)&&(t=t[0]),await n(this.ctx,t))}listen(){this.connection.listen()}dispose(){this.connection.dispose()}},t.createWrappedConnection=function(e,t,n){let s=n;const a=parseInt(process.env.GH_COPILOT_DEBUG_UI_PORT);if(!isNaN(a))try{s=new f.DebugServer(a).listen().wrapStdout(n)}catch(t){new l.Logger(l.LogLevel.WARN,"agent").error(e,`Failed to start debug server on port ${a} (maybe it's in use?)`,t)}if(e.get(p.RuntimeMode).flags.recordInput){const e=Date.now().toString(),n=`stdin${e}.log`;t.on("data",(e=>{(0,r.appendFile)(n,e,(e=>{e&&console.error(e)}))}));const i=`stdout${e}.log`;c=s,u=e=>{(0,r.appendFile)(i,e,(e=>{e&&console.error(e)}))},s=new o.Writable({write:(e,t,n)=>(u(e.toString()),c.write(e,t,n))})}var c,u;return(0,i.createConnection)(i.ProposedFeatures.all,new i.StreamMessageReader(t),new i.StreamMessageWriter(s))}},1728:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlwaysAuthManager=t.NotAuthManager=void 0;const r=n(5765),o=n(9321);class i extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"NotSignedIn"}}}t.NotAuthManager=i;class s extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"OK",user:"user"}}getCopilotTokenManager(){return new r.FixedCopilotTokenManager({token:"tid=valid-copilot-token",telemetry:"enabled"})}}t.AlwaysAuthManager=s},7838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseChallengeDoc=void 0,t.parseChallengeDoc=function(e,t){const n=e.split("\n");let r=t,o=t,i=n[t.line];const s=i.indexOf("%");-1!==s&&(i=i.substring(0,s)+i.substring(s+1),r={line:t.line,character:s});const a=i.indexOf("^");if(-1!==a){const e=i.indexOf("^",a+1);if(-1===e)throw new Error("Challenge document must contain zero or two ^ characters.");i=i.substring(0,a)+i.substring(a+1,e)+i.substring(e+1),r={line:t.line,character:t.character},o={line:t.line,character:t.character+e-a-1}}return{cursorLine:i,lines:n,start:r,end:o}}},6159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAgentTestingContext=t.setAgentTestEditorInfo=t.TestTextDocumentManager=t.getTestingContext=t.newTestingContext=t.TestingOptions=void 0;const r=n(4617),o=n(892),i=n(9800),s=n(5611),a=n(4630),c=n(2369),l=n(819),u=n(3895),d=n(3007),p=n(6021),h=n(2401),f=new Map;let m=0;t.TestingOptions=o.Type.Object({testingCtx:o.Type.Optional(o.Type.Number())}),t.newTestingContext=function(e){const t=m,n=new s.Context(e);return f.set(t,n),m++,t},t.getTestingContext=function(e){const t=f.get(e);if(void 0===t)throw new Error(`Testing context ${e} not found`);return t};class g extends l.TextDocumentManager{constructor(){super(...arguments),this._textDocuments=[],this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.onDidChangeTextDocument=()=>({dispose:()=>{}})}get textDocuments(){return this._textDocuments}async getTextDocument(e){return this.textDocuments.find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){}setTextDocument(e,t,n){this._textDocuments.push(new h.AgentTextDocument(e,t,0,n))}findNotebook(e){}}function _(e){const t=new u.AgentEditorInfo;t.setEditorAndPluginInfo({name:"agent-tests",version:"0"},{name:"agent-tests",version:"0"}),e.set(i.EditorAndPluginInfo,t)}t.TestTextDocumentManager=g,t.setAgentTestEditorInfo=_,t.createAgentTestingContext=function(){const e=new s.Context;e.set(i.ConfigProvider,new u.AgentConfigProvider),(0,a.setupTestingContext)(e),_(e),e.set(d.CopilotCompletionCache,new d.CopilotCompletionCache),e.set(c.LocationFactory,new h.AgentLocationFactory),e.set(l.TextDocumentManager,new g),e.set(i.BlockModeConfig,new i.ConfigBlockModeConfig);const t=new i.VscInfo("TestSessionId","TestMachineId","TestVscVersion");return e.set(i.VscInfo,t),e.set(r.FileSystem,p.agentFileSystem),e}},2401:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocument=t.getTextDocumentChecked=t.AgentLocationFactory=void 0;const r=n(6813),o=n(1674),i=n(2369),s=n(819);class a extends i.LocationFactory{range(e,t,n,r){return void 0!==n&&void 0!==r?o.Range.create(e,t,n,r):o.Range.create(e,t)}position(e,t){return o.Position.create(e,t)}}t.AgentLocationFactory=a,t.getTextDocumentChecked=async function(e,t,n){if(n&&n.source&&n.languageId){const e=new c(t,n.languageId,0,n.source);return n.relativePath&&(e.relativePath=n.relativePath),e}const r=e.get(s.TextDocumentManager);return await r.getTextDocument(t).then((e=>{if(!e){const e=r.textDocuments.map((e=>e.uri)).join(", ");throw new Error(`Couldn't find document for uri: ${t}, known document uris are: ${e}`)}return e}))};class c{constructor(e,t,n,o){this._uri=e,this._textDocument=r.TextDocument.create(e.toString(),t,n,o)}get uri(){return this._uri}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}get relativePath(){return this._relativePath}set relativePath(e){this._relativePath=e}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r=o.Range.create(o.Position.create(t,0),o.Position.create(t,n.length)),i=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:i}}getWordRangeAtPosition(e){}update(e,t){r.TextDocument.update(this._textDocument,e,t)}}t.AgentTextDocument=c},540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocumentManager=void 0;const r=n(2361),o=n(1017),i=n(5809),s=n(6630),a=n(819),c=n(2401);class l{constructor(){this.emitter=new r}create(e,t,n,r){return new c.AgentTextDocument(s.URI.parse(e),t,n,r)}update(e,t,n){const r=[];for(const n of t)if(i.TextDocumentContentChangeEvent.isIncremental(n)){const t={range:n.range,rangeOffset:e.offsetAt(n.range.start),rangeLength:e.offsetAt(n.range.end)-e.offsetAt(n.range.start),text:n.text};r.push(t)}const o={document:e,contentChanges:r};return this.emitter.emit("change",o),e.update(t,n),e}}class u extends a.TextDocumentManager{constructor(e,t,n){super(),this.connection=e,this.workspaceFolders=t,this.onDidChangeTextDocument=(e,t,n)=>{const r=e.bind(t);return this._textDocumentConfiguration.emitter.on("change",r),{dispose:()=>{this._textDocumentConfiguration.emitter.removeListener("change",r)}}},this.onDidFocusTextDocument=(e,t,n)=>(this.connection.onNotification("textDocument/didFocus",(n=>{const r=s.URI.parse(n.uri);e.call(t,{document:{uri:r}})})),{dispose:()=>{}}),this._textDocumentConfiguration=new l,this._textDocumentListener=new i.TextDocuments(this._textDocumentConfiguration),this._textDocumentListener.listen(e),n&&this.connection.workspace.onDidChangeWorkspaceFolders((e=>{e.added.forEach((e=>this.registerWorkspaceFolder(e))),e.removed.forEach((e=>this.unregisterWorkspaceFolder(e)))})),this.connection.onNotification("vs/didAddWorkspaceFolder",(e=>this.registerWorkspaceFolder(e))),this.connection.onNotification("vs/didRemoveWorkspaceFolder",(e=>this.unregisterWorkspaceFolder(e)))}unregisterWorkspaceFolder(e){const t=this.workspaceFolders.findIndex((t=>t.toString()===s.URI.parse(e.uri).toString()));t>=0&&this.workspaceFolders.splice(t,1)}registerWorkspaceFolder(e){this.workspaceFolders.push(s.URI.parse(e.uri))}get textDocuments(){return this._textDocumentListener.all()}async getTextDocument(e){return this._textDocumentListener.all().find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){var t,n;const r=e;return r.relativePath?r.relativePath:null!==(n=(0,a.getRelativePath)(null!==(t=this.workspaceFolders)&&void 0!==t?t:[],e.fileName))&&void 0!==n?n:o.basename(e.fileName)}findNotebook(e){}}t.AgentTextDocumentManager=u},5765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshToken=t.CopilotTokenManagerFromGitHubToken=t.FixedCopilotTokenManager=t.CopilotTokenManager=t.setTelemetryConfigFromTokenInfo=t.extractTrackingIdFromToken=t.authFromGitHubToken=t.nowSeconds=void 0;const r=n(9800),o=n(5798),i=n(39),s=n(9035),a=n(5489),c=n(4567),l=new o.Logger(o.LogLevel.INFO,"auth");let u=0;function d(){return Math.floor(Date.now()/1e3)}async function p(e,t){var n,o;(0,a.telemetry)(e,"auth.new_login");const s=null!==(o=null===(n=t.devOverride)||void 0===n?void 0:n.copilotTokenUrl)&&void 0!==o?o:"https://api.github.com/copilot_internal/v2/token",c=await e.get(i.Fetcher).fetch(s,{headers:{Authorization:`token ${t.token}`,...(0,r.editorVersionHeaders)(e)}});if(!c)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_failed"),{kind:"failure",reason:"FailedToGetToken"};const u=await c.json();if(!u)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_read_failed"),{kind:"failure",reason:"FailedToGetToken"};if(f(e,u.user_notification,t),401===c.status)return l.info(e,"Failed to get copilot token due to 401 status"),(0,a.telemetryError)(e,"auth.unknown_401"),{kind:"failure",reason:"HTTP401"};if(!c.ok||!u.token){l.info(e,`Invalid copilot token: missing token: ${c.status} ${c.statusText}`),(0,a.telemetryError)(e,"auth.invalid_token",a.TelemetryData.createAndMarkAsIssued({status:c.status.toString(),status_text:c.statusText}));const n=u.error_details;return f(e,n,t),{kind:"failure",reason:"NotAuthorized",...n}}const p=u.expires_at;return u.expires_at=d()+u.refresh_in+60,e.get(a.TelemetryReporters).setToken(u),g(u),(0,a.telemetry)(e,"auth.new_token",a.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:u.expires_at,expires_at:p,current_time:d()})),{kind:"success",...u}}t.nowSeconds=d,t.authFromGitHubToken=p;const h=new Map;function f(e,t,n){if(!t)return;const o=d();h.get(t.message)||(h.set(t.message,o),e.get(s.NotificationSender).showWarningMessage(t.message,{title:t.title},{title:"Dismiss"}).catch((t=>{console.error(t),l.error(e,`Error while sending notification: ${t.message}`)})).then((async o=>{const s=(null==o?void 0:o.title)===t.title,a=s||"Dismiss"===(null==o?void 0:o.title);if(s){const n=e.get(r.EditorAndPluginInfo).getEditorPluginInfo(e),o=t.url.replace("{EDITOR}",encodeURIComponent(n.name+"_"+n.version));await e.get(c.UrlOpener).open(o)}"notification_id"in t&&a&&await async function(e,t,n){var o,s;const a=null!==(s=null===(o=n.devOverride)||void 0===o?void 0:o.notificationUrl)&&void 0!==s?s:"https://api.github.com/copilot_internal/notification",c=await e.get(i.Fetcher).fetch(a,{headers:{Authorization:`token ${n.token}`,...(0,r.editorVersionHeaders)(e)},method:"POST",body:JSON.stringify({notification_id:t})});c&&c.ok||l.error(e,`Failed to send notification result to GitHub: ${null==c?void 0:c.status} ${null==c?void 0:c.statusText}`)}(e,t.notification_id,n)})))}function m(e){const t=null==e?void 0:e.split(":")[0],n=null==t?void 0:t.split(";");for(const e of n){const[t,n]=e.split("=");if("tid"===t)return n}}function g(e){const t=m(e.token);void 0!==t&&(0,a.setTelemetryConfig)({trackingId:t,optedIn:"enabled"===e.telemetry||"unconfigured"===e.telemetry})}t.extractTrackingIdFromToken=m,t.setTelemetryConfigFromTokenInfo=g;class _{}function y(e,t,n){const r=d();u>0||(u++,setTimeout((async()=>{let n,o="";try{u--,await t.getCopilotToken(e,!0),n="success"}catch(e){n="failure",o=e.toString()}const i=a.TelemetryData.createAndMarkAsIssued({result:n},{time_taken:d()-r,refresh_count:u});o&&(i.properties.reason=o),(0,a.telemetry)(e,"auth.token_refresh",i)}),1e3*n))}t.CopilotTokenManager=_,t.FixedCopilotTokenManager=class extends _{constructor(e){super(),this.tokenInfo=e,this.wasReset=!1,g(e)}async getCopilotToken(e,t){return this.tokenInfo.token}resetCopilotToken(e,t){this.wasReset=!0}async checkCopilotToken(e){return{status:"OK",telemetry:this.tokenInfo.telemetry}}},t.CopilotTokenManagerFromGitHubToken=class extends _{constructor(e){super(),this.githubToken=e,this.copilotToken=void 0}async getCopilotToken(e,t){var n;if(!this.copilotToken||this.copilotToken.expires_at{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TELEMETRY_TERMS_URL=t.LAST_TELEMETRY_TERMS_UPDATE=void 0,t.LAST_TELEMETRY_TERMS_UPDATE="2021-10-14",t.TELEMETRY_TERMS_URL="https://github.co/copilot-telemetry-terms"},5135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeTracker=void 0;const r=n(819);t.ChangeTracker=class{constructor(e,t,n){this._referenceCount=0,this._isDisposed=!1,this._offset=n;const o=e.get(r.TextDocumentManager);this._tracker=o.onDidChangeTextDocument((async e=>{if(e.document.uri===t)for(const t of e.contentChanges)if(t.rangeOffset+t.rangeLength<=this.offset){const e=t.text.length-t.rangeLength;this._offset=this._offset+e}}))}get offset(){return this._offset}push(e,t){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout((()=>{e(),this._referenceCount--,0===this._referenceCount&&(this._tracker.dispose(),this._isDisposed=!0)}),t)}}},2137:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Clock=void 0,t.Clock=class{now(){return new Date}}},140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.keyForPrompt=void 0;const r=n(6679);t.keyForPrompt=function(e){return(0,r.SHA256)(e.prefix+e.suffix).toString()},t.LRUCache=class{constructor(e=10){this.values=new Map,this.lruKeys=[],this.size=e}removeKeyFromLRU(e){const t=this.lruKeys.indexOf(e);-1!==t&&this.lruKeys.splice(t,1)}touchKeyInLRU(e){this.removeKeyFromLRU(e),this.lruKeys.push(e)}clear(){this.values.clear(),this.lruKeys=[]}deleteKey(e){this.removeKeyFromLRU(e),void 0!==this.values.get(e)&&this.values.delete(e)}get(e){if(this.values.has(e)){const t=this.values.get(e);return this.touchKeyInLRU(e),t}}put(e,t){let n=[];this.values.has(e)?n=[e]:this.lruKeys.length>=this.size&&(n=this.lruKeys.splice(0,1));for(const e of n)this.deleteKey(e);this.values.set(e,t),this.touchKeyInLRU(e)}}},3940:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=t.Debouncer=void 0,t.Debouncer=class{async debounce(e){return this.state&&(clearTimeout(this.state.timer),this.state.reject(),this.state=void 0),new Promise(((t,n)=>{this.state={timer:setTimeout((()=>t()),e),reject:n}}))}},t.debounce=function(e,t){let n;return(...r)=>(n&&clearTimeout(n),new Promise((o=>{n=setTimeout((()=>{const e=t(...r);o(e)}),e)})))}},1661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncIterableFromArray=t.asyncIterableMapFilter=t.asyncIterableFilter=t.asyncIterableMap=void 0,t.asyncIterableMap=async function*(e,t){for await(const n of e)yield t(n)},t.asyncIterableFilter=async function*(e,t){for await(const n of e)await t(n)&&(yield n)},t.asyncIterableMapFilter=async function*(e,t){for await(const n of e){const e=await t(n);void 0!==e&&(yield e)}},t.asyncIterableFromArray=async function*(e){for(const t of e)yield t}},9800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorVersionHeaders=t.EditorAndPluginInfo=t.formatNameAndVersion=t.getTestVscInfo=t.VscInfo=t.getVersion=t.getBuild=t.getBuildType=t.isProduction=t.BuildInfo=t.suffixMatchThreshold=t.suffixPercent=t.getEnabledConfig=t.getLanguageConfig=t.dumpConfig=t.getHiddenConfig=t.isDefaultSettingOverwritten=t.getConfig=t.getConfigDefaultForObjectKey=t.getConfigDefaultForKey=t.InMemoryConfigProvider=t.DefaultsOnlyConfigProvider=t.ConfigProvider=t.ConfigBlockModeConfig=t.BlockModeConfig=t.BuildType=t.shouldDoServerTrimming=t.shouldDoParsingTrimming=t.BlockMode=t.ConfigKey=void 0;const r=n(4617),o=n(8139),i=n(6905),s=n(9876);var a,c;t.ConfigKey={Enable:"enable",InlineSuggestEnable:"inlineSuggest.enable",ShowEditorCompletions:["editor","showEditorCompletions"],EnableAutoCompletions:["editor","enableAutoCompletions"],DelayCompletions:["editor","delayCompletions"],FilterCompletions:["editor","filterCompletions"],DisplayStyle:["advanced","displayStyle"],SecretKey:["advanced","secret_key"],SolutionLength:["advanced","length"],Stops:["advanced","stops"],Temperature:["advanced","temperature"],TopP:["advanced","top_p"],IndentationMode:["advanced","indentationMode"],InlineSuggestCount:["advanced","inlineSuggestCount"],ListCount:["advanced","listCount"],DebugOverrideProxyUrl:["advanced","debug.overrideProxyUrl"],DebugTestOverrideProxyUrl:["advanced","debug.testOverrideProxyUrl"],DebugOverrideEngine:["advanced","debug.overrideEngine"],DebugShowScores:["advanced","debug.showScores"],DebugOverrideLogLevels:["advanced","debug.overrideLogLevels"],DebugFilterLogCategories:["advanced","debug.filterLogCategories"],DebugUseSuffix:["advanced","debug.useSuffix"],DebugAcceptSelfSignedCertificate:["advanced","debug.acceptSelfSignedCertificate"]},function(e){e.Parsing="parsing",e.Server="server",e.ParsingAndServer="parsingandserver"}(a=t.BlockMode||(t.BlockMode={})),t.shouldDoParsingTrimming=function(e){return[a.Parsing,a.ParsingAndServer].includes(e)},t.shouldDoServerTrimming=function(e){return[a.Server,a.ParsingAndServer].includes(e)},(c=t.BuildType||(t.BuildType={})).DEV="dev",c.PROD="prod",c.NIGHTLY="nightly";class l{}t.BlockModeConfig=l,t.ConfigBlockModeConfig=class extends l{async forLanguage(e,n){if(e.get(u).isDefaultSettingOverwritten(t.ConfigKey.IndentationMode))switch(e.get(u).getLanguageConfig(t.ConfigKey.IndentationMode,n)){case"client":case!0:case"server":return a.Server;case"clientandserver":return(0,r.isSupportedLanguageId)(n)?a.ParsingAndServer:a.Server;default:return a.Parsing}return await e.get(i.Features).overrideBlockMode()||((0,r.isSupportedLanguageId)(n)?a.Parsing:a.Server)}};class u{}function d(e){try{const t=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].default;if(void 0===t)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return t}catch(t){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}: ${t}`)}}function p(e,t){try{const n=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].properties[t].default;if(void 0===n)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return n}catch(n){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}.${t}: ${n}`)}}function h(e,t){return e.get(u).getConfig(t)}function f(e,t){return e.get(u).isDefaultSettingOverwritten(t)}function m(e,t,n){return f(e,t)?h(e,t):n.default}function g(e,t,n){return e.get(u).getLanguageConfig(t,n)}t.ConfigProvider=u,t.DefaultsOnlyConfigProvider=class extends u{getConfig(e){return Array.isArray(e)?p(e[0],e[1]):d(e)}isDefaultSettingOverwritten(e){return!1}dumpConfig(){return{}}getLanguageConfig(e,t){const n=this.getConfig(e);return t&&t in n?n[t]:n["*"]}},t.InMemoryConfigProvider=class{constructor(e,t){this.baseConfigProvider=e,this.overrides=t}getConfig(e){const t=this.overrides.get(e);return void 0!==t?t:this.baseConfigProvider.getConfig(e)}setConfig(e,t){void 0!==t?this.overrides.set(e,t):this.overrides.delete(e)}setLanguageEnablement(e,n){this.overrides.set(t.ConfigKey.Enable,{[e]:n})}isDefaultSettingOverwritten(e){return!!this.overrides.has(e)||this.baseConfigProvider.isDefaultSettingOverwritten(e)}keyAsString(e){return Array.isArray(e)?e.join("."):e}dumpConfig(){const e=this.baseConfigProvider.dumpConfig();return this.overrides.forEach(((t,n)=>{e[this.keyAsString(n)]=JSON.stringify(t)})),e}getLanguageConfig(e,t){const n=this.overrides.get(e);return void 0!==n?void 0!==t?n[t]:n["*"]:this.baseConfigProvider.getLanguageConfig(e,t)}},t.getConfigDefaultForKey=d,t.getConfigDefaultForObjectKey=p,t.getConfig=h,t.isDefaultSettingOverwritten=f,t.getHiddenConfig=m,t.dumpConfig=function(e){return e.get(u).dumpConfig()},t.getLanguageConfig=g,t.getEnabledConfig=function(e,n){return g(e,t.ConfigKey.Enable,n)},t.suffixPercent=async function(e,n,r){return m(e,t.ConfigKey.DebugUseSuffix,{default:!1})?15:e.get(i.Features).suffixPercent(n,r)},t.suffixMatchThreshold=async function(e,n,r){return m(e,t.ConfigKey.DebugUseSuffix,{default:!1})?20:e.get(i.Features).suffixMatchThreshold(n,r)};class _{constructor(){this.packageJson=s}isProduction(){return"dev"!=this.getBuildType()}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}}t.BuildInfo=_,t.isProduction=function(e){return e.get(_).isProduction()},t.getBuildType=function(e){return e.get(_).getBuildType()},t.getBuild=function(e){return e.get(_).getBuild()},t.getVersion=function(e){return e.get(_).getVersion()};class y{constructor(e,t,n){this.sessionId=e,this.machineId=t,this.vsCodeVersion=n}}function v({name:e,version:t}){return`${e}/${t}`}t.VscInfo=y,t.getTestVscInfo=function(){return new y("test-session-id","test-machine-id","test-vscode-version")},t.formatNameAndVersion=v;class b{}t.EditorAndPluginInfo=b,t.editorVersionHeaders=function(e){const t=e.get(b);return{"Editor-Version":v(t.getEditorInfo(e)),"Editor-Plugin-Version":v(t.getEditorPluginInfo(e))}}},8139:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotScheme=t.CopilotConfigPrefix=void 0,t.CopilotConfigPrefix="github.copilot",t.CopilotScheme="copilot"},5611:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0,t.Context=class{constructor(e){var t;this.baseContext=e,this.constructionStack=[],this.instances=new Map;const n=null===(t=(new Error).stack)||void 0===t?void 0:t.split("\n");n&&this.constructionStack.push(...n.slice(1))}get(e){const t=this.tryGet(e);if(t)return t;throw new Error(`No instance of ${e.name} has been registered.\n${this}`)}tryGet(e){return this.instances.get(e)||(this.baseContext?this.baseContext.tryGet(e):void 0)}set(e,t){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.instances.set(e,t)}forceSet(e,t){this.instances.set(e,t)}toString(){var e,t;let n=" Context created at:\n";for(const e of this.constructionStack||[])n+=` ${e}\n`;return n+=null!==(t=null===(e=this.baseContext)||void 0===e?void 0:e.toString())&&void 0!==t?t:"",n}get debug(){const e={};for(const[t,n]of this.instances)e[t.name]=n;return e}}},5680:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeLocation=t.encodeLocation=t.completionContextForDocument=t.CompletionContext=t.completionTypeToString=t.CompletionType=void 0;const r=n(6630),o=n(2369),i=n(8139);var s;!function(e){e[e.OPEN_COPILOT=2]="OPEN_COPILOT",e[e.TODO_QUICK_FIX=3]="TODO_QUICK_FIX",e[e.UNKNOWN_FUNCTION_QUICK_FIX=4]="UNKNOWN_FUNCTION_QUICK_FIX"}(s=t.CompletionType||(t.CompletionType={})),t.completionTypeToString=function(e){switch(e){case s.OPEN_COPILOT:return"open copilot";case s.TODO_QUICK_FIX:return"todo quick fix";case s.UNKNOWN_FUNCTION_QUICK_FIX:return"unknown function quick fix";default:return"unknown"}};class a{constructor(e,t,n){this.prependToCompletion="",this.appendToCompletion="",this.indentation=null,this.completionType=s.OPEN_COPILOT,this.insertPosition=e.get(o.LocationFactory).position(t.line,t.character),this.completionType=n}static fromJSONParse(e,t){const n=e.get(o.LocationFactory).position(t.insertPosition.line,t.insertPosition.character),r=new a(e,n,t.completionType);return r.prependToCompletion=t.prependToCompletion,r.appendToCompletion=t.appendToCompletion,r.indentation=t.indentation,r}}t.CompletionContext=a,t.completionContextForDocument=function(e,t,n){let r=n;const o=t.lineAt(n.line);return o.isEmptyOrWhitespace||(r=o.range.end),new a(e,r,s.OPEN_COPILOT)};let c=0;t.encodeLocation=function(e,t){const n=e.toString().split("#"),o=n.length>1?n[1]:"",s=JSON.stringify([n[0],t,o]);return r.URI.parse(`${i.CopilotScheme}:GitHub%20Copilot?${s}#${c++}`)},t.decodeLocation=function(e,t){const[n,o,i]=JSON.parse(t.query);return[r.URI.parse(i.length>0?n+"#"+i:n),a.fromJSONParse(e,o)]}},6317:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSolutions=t.normalizeCompletionText=void 0;const r=n(7057),o=n(1661),i=n(9800),s=n(5680),a=n(5798),c=n(7553),l=n(598),u=n(6635),d=n(7917),p=n(4090),h=n(2273),f=n(3591),m=n(3883),g=n(5489),_=n(2369),y=new a.Logger(a.LogLevel.INFO,"solutions");function v(e,t,n,r){return async o=>{if(r instanceof Array){const[i,s]=r;return(0,d.isBlockBodyFinishedWithPrefix)(e,t,n,o,s)}return(0,d.isBlockBodyFinished)(e,t,n,o)}}async function b(e,t,n){if(t.isCancellationRequested)return e.removeProgress(),{status:"FinishedWithError",error:"Cancelled"};const r=await n.next();return!0===r.done?(e.removeProgress(),{status:"FinishedNormally"}):{status:"Solution",solution:r.value,next:b(e,t,n)}}t.normalizeCompletionText=function(e){return e.replace(/\s+/g,"")},t.launchSolutions=async function(e,t){var n,a,w;const x=t.completionContext.insertPosition,T=t.completionContext.prependToCompletion,E=t.completionContext.indentation,C=e.get(_.LocationFactory),S=await t.getDocument(),k=await(0,p.extractPrompt)(e,S,x);if("contextTooShort"===k.type)return t.reportCancelled(),{status:"FinishedWithError",error:"Context too short"};const P=k.prompt,I=k.trailingWs;I.length>0&&(t.startPosition=C.position(t.startPosition.line,t.startPosition.character-I.length));const R=t.getCancellationToken(),O=r.v4();if(t.savedTelemetryData=g.TelemetryData.createAndMarkAsIssued({headerRequestId:O,languageId:S.languageId,source:(0,s.completionTypeToString)(t.completionContext.completionType)},{...(0,g.telemetrizePromptLength)(P),solutionCount:t.solutionCountTarget,promptEndPos:S.offsetAt(x)}),t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){const e=P.prefix.split("\n"),t=e.pop(),n=e.pop();if(n){const r=/^\W+(todo:?\s+)/i.exec(n);if(r){const o=r[1],i=n.replace(o,"");P.prefix=e.join("\n")+"\n"+i+"\n"+t}}}t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX&&(P.prefix+=t.completionContext.prependToCompletion),y.info(e,`prompt: ${JSON.stringify(P)}`),y.debug(e,`prependToCompletion: ${T}`),(0,g.telemetry)(e,"solution.requested",t.savedTelemetryData);const A=await e.get(i.BlockModeConfig).forLanguage(e,S.languageId),N=(0,h.isSupportedLanguageId)(S.languageId),D=(0,d.contextIndentation)(S,x),M={stream:!0,extra:{language:S.languageId,next_indent:null!==(n=D.next)&&void 0!==n?n:0}};"parsing"!==A||N||(M.stop=["\n\n","\r\n\r\n"]);const L=(0,f.extractRepoInfoInBackground)(e,S.fileName),$={prompt:P,languageId:S.languageId,repoInfo:L,ourRequestId:O,engineUrl:await(0,c.getEngineURL)(e,(0,f.tryGetGitHubNWO)(L),S.languageId,(0,f.getDogFood)(L),(0,f.getUserKind)(e),t.savedTelemetryData),count:t.solutionCountTarget,uiKind:l.CopilotUiKind.Panel,postOptions:M,requestLogProbs:!0};let j;const F=t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX?[s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX,t.completionContext.prependToCompletion]:t.completionContext.completionType;switch(A){case i.BlockMode.Server:j=async e=>{},M.extra.force_indent=null!==(a=D.prev)&&void 0!==a?a:-1;break;case i.BlockMode.ParsingAndServer:j=N?v(e,S,t.startPosition,F):async e=>{},M.extra.force_indent=null!==(w=D.prev)&&void 0!==w?w:-1;break;case i.BlockMode.Parsing:default:j=N?v(e,S,t.startPosition,F):async e=>{}}e.get(u.StatusReporter).setProgress();const q=await e.get(l.OpenAIFetcher).fetchAndStreamCompletions(e,$,g.TelemetryData.createAndMarkAsIssued(),j,R);if("failed"===q.type||"canceled"===q.type)return t.reportCancelled(),e.get(u.StatusReporter).removeProgress(),{status:"FinishedWithError",error:`${q.type}: ${q.reason}`};let B=q.choices;B=async function*(e,t){for await(const n of e){const e={...n};e.completionText=t+e.completionText.trimRight(),yield e}}(B,T),null!==E&&(B=(0,l.cleanupIndentChoices)(B,E)),B=(0,o.asyncIterableMapFilter)(B,(async t=>(0,m.postProcessChoice)(e,"solution",S,x,t,!1,y)));const U=(0,o.asyncIterableMapFilter)(B,(async n=>{let r=n.completionText;if(y.info(e,`Open Copilot completion: [${n.completionText}]`),t.completionContext.completionType===s.CompletionType.OPEN_COPILOT||t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){let t="";const o=await(0,d.getNodeStart)(e,S,x,n.completionText);if(o)[t]=(0,p.trimLastLine)(S.getText(C.range(C.position(o.line,o.character),x)));else{const e=C.position(x.line,0);t=S.getText(C.range(e,x))}r=t+r}let o=n.completionText;t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX&&(S.lineAt(x.line).isEmptyOrWhitespace||(o+="\n")),I.length>0&&o.startsWith(I)&&(o=o.substring(I.length));const i=n.meanLogProb;return{displayText:r,meanProb:void 0!==i?Math.exp(i):0,meanLogProb:i||0,completionText:o,requestId:n.requestId,choiceIndex:n.choiceIndex,prependToCompletion:T}}));return b(e.get(u.StatusReporter),R,U[Symbol.asyncIterator]())}},446:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDefaultHandlers=void 0;const r=n(39),o=n(5489);t.registerDefaultHandlers=function(e,t){process.addListener("uncaughtException",(t=>{console.error("uncaughtException",t),o.telemetryException(e,t,"uncaughtException")}));let n=!1;process.addListener("unhandledRejection",((i,s)=>{if(n)return;if(n=!0,"vscode"===t&&!i)return;if("aborted"===i.type||(0,r.isAbortError)(i))return;if("vscode"===t&&["ENOTFOUND","ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENETDOWN","ENETUNREACH","EADDRNOTAVAIL"].includes(i.code))return;if("ENOENT"==i.code)return;let a="";try{a=`${i.message} (${i.code})`,a=JSON.stringify(i)}catch(e){a="[actual reason JSON was cyclic]"}"vscode"===t&&"{}"===a||(console.error("unhandledRejection",a),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:"Unhandled rejection logged to restricted telemetry"}),!1),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:a}),!0),n=!1)}))}},5225:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDocumentTracker=t.sortByAccessTimes=void 0;const r=n(819),o=new Map;t.sortByAccessTimes=function(e){return[...e].sort(((e,t)=>{var n,r;const i=null!==(n=o.get(e.uri.toString()))&&void 0!==n?n:0;return(null!==(r=o.get(t.uri.toString()))&&void 0!==r?r:0)-i}))},t.registerDocumentTracker=e=>e.get(r.TextDocumentManager).onDidFocusTextDocument((e=>{e&&o.set(e.document.uri.toString(),Date.now())}))},5917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfig=t.ExpTreatmentVariables=void 0;const r=n(5489),o=n(4914);var i;(i=t.ExpTreatmentVariables||(t.ExpTreatmentVariables={})).AA="copilotaa",i.CustomEngine="copilotcustomengine",i.Fetcher="copilotfetcher",i.OverrideBlockMode="copilotoverrideblockmode",i.OverrideNumGhostCompletions="copilotoverridednumghostcompletions",i.SuffixPercent="CopilotSuffixPercent",i.BeforeRequestWaitMs="copilotlms",i.NeighboringTabsOption="copilotneighboringtabs",i.DebounceMs="copilotdebouncems",i.DebouncePredict="copilotdebouncepredict",i.ContextualFilterAcceptThreshold="copilotcontextualfilteracceptthreshold",i.disableLogProb="copilotLogProb",i.GranularityTimePeriodSizeInH="copilottimeperiodsizeinh",i.GranularityByCallBuckets="copilotbycallbuckets",i.SuffixStartMode="copilotsuffixstartmode",i.SuffixMatchThreshold="copilotsuffixmatchthreshold",i.MultiLogitBias="copilotlbeot";class s{constructor(e,t,n){this.variables=e,this.assignmentContext=t,this.features=n}static createFallbackConfig(e,t){return(0,r.telemetryExpProblem)(e,{reason:t}),this.createEmptyConfig()}static createEmptyConfig(){return new s({},"","")}addToTelemetry(e){e.properties[o.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features,e.properties[o.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName]=this.assignmentContext}}t.ExpConfig=s},6905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Features=t.Task=void 0;const r=n(4617),o=n(2137),i=n(140),s=n(5917),a=n(6046),c=n(2249),l=n(8495);class u{constructor(e){this.ctx=e,this.cache=new i.LRUCache(200)}async fetchExpConfig(e){let t=this.cache.get(e.stringify());return t||(t=new d((()=>this.ctx.get(a.ExpConfigMaker).fetchExperiments(this.ctx,e.toHeaders())),36e5),this.cache.put(e.stringify(),t)),t.run()}getCachedExpConfig(e){const t=this.cache.get(e.stringify());return null==t?void 0:t.value()}}class d{constructor(e,t=1/0){this.producer=e,this.expirationMs=t}async run(){return void 0===this.promise&&(this.promise=this.producer(),this.storeResult(this.promise).then((()=>{this.expirationMs<1/0&&void 0!==this.promise&&setTimeout((()=>this.promise=void 0),this.expirationMs)}))),this.promise}async storeResult(e){try{this.result=await e}finally{void 0===this.result&&(this.promise=void 0)}}value(){return this.result}}t.Task=d;class p{constructor(e){this.ctx=e,this.staticFilters={},this.dynamicFilters={},this.upcomingDynamicFilters={},this.assignments=new u(this.ctx),this.granularityDirectory=new l.GranularityDirectory("unspecified",e.get(o.Clock))}setPrefix(e){this.granularityDirectory=new l.GranularityDirectory(e,this.ctx.get(o.Clock))}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,t){this.dynamicFilters[e]=t}getDynamicFilterValues(){const e={};for(const[t,n]of Object.entries(this.dynamicFilters))e[t]=n();return e}registerUpcomingDynamicFilter(e,t){this.upcomingDynamicFilters[e]=t}async getAssignment(e,t={},n){var r,o;const i=this.makeFilterSettings(t),a=this.granularityDirectory.extendFilters(i),c=await this.getExpConfig(a.newFilterSettings);this.granularityDirectory.update(i,+(null!==(r=c.variables[s.ExpTreatmentVariables.GranularityByCallBuckets])&&void 0!==r?r:NaN),+(null!==(o=c.variables[s.ExpTreatmentVariables.GranularityTimePeriodSizeInH])&&void 0!==o?o:NaN));const l=this.granularityDirectory.extendFilters(i),u=l.newFilterSettings,d=await this.getExpConfig(u);let h=new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs)));for(const e of l.otherFilterSettingsToPrefetch)h=h.then((async()=>{await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e)}));return this.prepareForUpcomingFilters(u),n&&(n.filtersAndExp={exp:d,filters:u}),d.variables[e]}makeFilterSettings(e){return new c.FilterSettings({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e){try{return this.assignments.fetchExpConfig(e)}catch(e){return s.ExpConfig.createFallbackConfig(this.ctx,`Error fetching ExP config: ${e}`)}}async prepareForUpcomingFilters(e){if(!((new Date).getMinutes()<60-p.upcomingTimeBucketMinutes))for(const[t,n]of Object.entries(this.upcomingDynamicFilters))await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e.withChange(t,n()))}stringify(){var e;const t=this.assignments.getCachedExpConfig(new c.FilterSettings({}));return JSON.stringify(null!==(e=null==t?void 0:t.variables)&&void 0!==e?e:{})}async customEngine(e,t,n,r,o){var i;const a={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t,[c.Filter.CopilotDogfood]:n,[c.Filter.CopilotUserKind]:r};return null!==(i=await this.getAssignment(s.ExpTreatmentVariables.CustomEngine,a,o))&&void 0!==i?i:""}async beforeRequestWaitMs(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.BeforeRequestWaitMs,o,n))&&void 0!==r?r:0}async multiLogitBias(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.MultiLogitBias,o,n))&&void 0!==r&&r}async debounceMs(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.DebounceMs))&&void 0!==e?e:0}async debouncePredict(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.DebouncePredict))&&void 0!==e&&e}async contextualFilterAcceptThreshold(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.ContextualFilterAcceptThreshold))&&void 0!==e?e:void 0}async disableLogProb(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.disableLogProb))&&void 0!==e&&e}async overrideBlockMode(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideBlockMode)}async overrideNumGhostCompletions(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideNumGhostCompletions)}async suffixPercent(e,t){var n;const r={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(s.ExpTreatmentVariables.SuffixPercent,r))&&void 0!==n?n:0}async suffixMatchThreshold(e,t){var n;const r={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(s.ExpTreatmentVariables.SuffixMatchThreshold,r))&&void 0!==n?n:0}async suffixStartMode(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.SuffixStartMode,n)){default:return r.SuffixStartMode.Cursor;case"cursortrimstart":return r.SuffixStartMode.CursorTrimStart;case"siblingblock":return r.SuffixStartMode.SiblingBlock;case"siblingblocktrimstart":return r.SuffixStartMode.SiblingBlockTrimStart}}async neighboringTabsOption(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.NeighboringTabsOption,n)){case"none":return r.NeighboringTabsOption.None;case"conservative":return r.NeighboringTabsOption.Conservative;case"medium":return r.NeighboringTabsOption.Medium;default:return r.NeighboringTabsOption.Eager;case"eagerbutlittle":return r.NeighboringTabsOption.EagerButLittle}}async addExpAndFilterToTelemetry(e){const t=this.makeFilterSettings({});e.filtersAndExp={filters:t,exp:await this.getExpConfig(t)}}}t.Features=p,p.upcomingDynamicFilterCheckDelayMs=20,p.upcomingTimeBucketMinutes=5+Math.floor(11*Math.random())},6046:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfigNone=t.ExpConfigFromTAS=t.ExpConfigMaker=void 0;const r=n(39),o=n(5917);class i{}t.ExpConfigMaker=i,t.ExpConfigFromTAS=class extends i{async fetchExperiments(e,t){var n;const i=e.get(r.Fetcher);let s;try{s=await i.fetch("https://default.exp-tas.com/vscode/ab",{method:"GET",headers:t})}catch(t){return o.ExpConfig.createFallbackConfig(e,`Error fetching ExP config: ${t}`)}if(!s.ok)return o.ExpConfig.createFallbackConfig(e,`ExP responded with ${s.status}`);const a=await s.json(),c=null!==(n=a.Configs.find((e=>"vscode"===e.Id)))&&void 0!==n?n:{Id:"vscode",Parameters:{}},l=Object.entries(c.Parameters).map((([e,t])=>e+(t?"":"cf")));return new o.ExpConfig(c.Parameters,a.AssignmentContext,l.join(";"))}},t.ExpConfigNone=class extends i{async fetchExperiments(e,t){return o.ExpConfig.createEmptyConfig()}}},2249:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.FilterSettings=t.telmetryNames=t.TargetPopulation=t.Filter=void 0,function(e){e.Market="X-MSEdge-Market",e.CorpNet="X-FD-Corpnet",e.ApplicationVersion="X-VSCode-AppVersion",e.Build="X-VSCode-Build",e.ClientId="X-MSEdge-ClientId",e.ExtensionName="X-VSCode-ExtensionName",e.ExtensionVersion="X-VSCode-ExtensionVersion",e.Language="X-VSCode-Language",e.TargetPopulation="X-VSCode-TargetPopulation",e.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",e.CopilotOverrideEngine="X-Copilot-OverrideEngine",e.CopilotRepository="X-Copilot-Repository",e.CopilotFileType="X-Copilot-FileType",e.CopilotUserKind="X-Copilot-UserKind",e.CopilotDogfood="X-Copilot-Dogfood"}(n=t.Filter||(t.Filter={})),(r=t.TargetPopulation||(t.TargetPopulation={})).Team="team",r.Internal="internal",r.Insiders="insider",r.Public="public",t.telmetryNames={[n.CopilotClientTimeBucket]:"timeBucket",[n.CopilotOverrideEngine]:"engine",[n.CopilotRepository]:"repo",[n.CopilotFileType]:"fileType",[n.CopilotUserKind]:"userKind"};class o{constructor(e){this.filters=e;for(const[e,t]of Object.entries(this.filters))""===t&&delete this.filters[e]}extends(e){for(const[t,n]of Object.entries(e.filters))if(this.filters[t]!==n)return!1;return!0}addToTelemetry(e){for(const[n,r]of Object.entries(this.filters)){const o=t.telmetryNames[n];void 0!==o&&(e.properties[o]=r)}}stringify(){const e=Object.keys(this.filters);return e.sort(),e.map((e=>`${e}:${this.filters[e]}`)).join(";")}toHeaders(){return{...this.filters}}withChange(e,t){return new o({...this.filters,[e]:t})}}t.FilterSettings=o},8495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GranularityDirectory=void 0;const r=n(2249),o=n(2505),i=r.Filter.CopilotClientTimeBucket;t.GranularityDirectory=class{constructor(e,t){this.specs=new Map,this.prefix=e,this.clock=t,this.defaultGranularity=(0,o.DEFAULT_GRANULARITY)(e)}selectGranularity(e){for(const[t,n]of this.specs.entries())if(e.extends(t))return n;return this.defaultGranularity}update(e,t,n){if(t=t>1?t:NaN,n=n>0?n:NaN,isNaN(t)&&isNaN(n))this.specs.delete(e);else{const r=new o.TimeBucketGranularity(this.prefix);isNaN(t)||r.setByCallBuckets(t),isNaN(n)||r.setTimePeriod(3600*n*1e3),this.specs.set(e,r)}}extendFilters(e){const t=this.selectGranularity(e),[n,r]=t.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(i,n),otherFilterSettingsToPrefetch:r.map((t=>e.withChange(i,t)))}}}},2505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBucketGranularity=t.DEFAULT_GRANULARITY=t.GranularityImplementation=void 0;class n{constructor(e){this.prefix=e}getCurrentAndUpComingValues(e){return[this.getValue(e),this.getUpcomingValues(e)]}}t.GranularityImplementation=n;class r extends n{getValue(e){return this.prefix}getUpcomingValues(e){return[]}}t.DEFAULT_GRANULARITY=e=>new r(e),t.TimeBucketGranularity=class extends n{constructor(e,t=.5,n=(new Date).setUTCHours(0,0,0,0)){super(e),this.prefix=e,this.fetchBeforeFactor=t,this.anchor=n}setTimePeriod(e){isNaN(e)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=e}setByCallBuckets(e){isNaN(e)?this.numByCallBuckets=void 0:this.numByCallBuckets=e}getValue(e){return this.prefix+this.getTimePeriodBucketString(e)+(this.numByCallBuckets?this.timeHash(e):"")}getTimePeriodBucketString(e){return this.timePeriodLengthMs?this.dateToTimePartString(e):""}getUpcomingValues(e){const t=[],n=this.getUpcomingTimePeriodBucketStrings(e),r=this.getUpcomingByCallBucketStrings();for(const e of n)for(const n of r)t.push(this.prefix+e+n);return t}getUpcomingTimePeriodBucketStrings(e){if(void 0===this.timePeriodLengthMs)return[""];if((e.getTime()-this.anchor)%this.timePeriodLengthMse.toString()))}timeHash(e){return null==this.numByCallBuckets?0:e.getTime()%this.numByCallBuckets*7883%this.numByCallBuckets}dateToTimePartString(e){return null==this.timePeriodLengthMs?"":Math.floor((e.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}}},4914:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpServiceTelemetryNames=void 0,(n=t.ExpServiceTelemetryNames||(t.ExpServiceTelemetryNames={})).featuresTelemetryPropertyName="VSCode.ABExp.Features",n.assignmentContextTelemetryPropertyName="abexp.assignmentcontext"},6817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterScore=t.getLastLineLength=t.ContextualFilterManager=void 0;const r=n(187);class o{constructor(){this.previousLabel=0,this.previousLabelTimestamp=Date.now()-3600,this.probabilityAccept=0}}function i(e){const t=e.split("\n");return t[t.length-1].length}t.ContextualFilterManager=o,t.getLastLineLength=i,t.contextualFilterScore=function(e,t,n){const s=e.get(o),a=s.previousLabel;let c=0;"afterCursorWhitespace"in t.properties&&"true"===t.properties.afterCursorWhitespace&&(c=1);const l=(Date.now()-s.previousLabelTimestamp)/1e3,u=Math.log(1+l);let d=0,p=0;const h=n.prefix;if(h){d=Math.log(1+i(h));const e=h.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(p=r.contextualFilterCharacterMap[e])}let f=0,m=0;const g=h.trimEnd();if(g){f=Math.log(1+i(g));const e=g.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(m=r.contextualFilterCharacterMap[e])}let _=0;if("documentLength"in t.measurements){const e=t.measurements.documentLength;_=Math.log(1+e)}let y=0;if("promptEndPos"in t.measurements){const e=t.measurements.promptEndPos;y=Math.log(1+e)}let v=0;if("promptEndPos"in t.measurements&&"documentLength"in t.measurements){const e=t.measurements.documentLength;v=(t.measurements.promptEndPos+.5)/(1+e)}let b=0;void 0!==r.contextualFilterLanguageMap[t.properties.languageId]&&(b=r.contextualFilterLanguageMap[t.properties.languageId]);let w=r.contextualFilterIntercept;w+=r.contextualFilterWeights[0]*a,w+=r.contextualFilterWeights[1]*c,w+=r.contextualFilterWeights[2]*u,w+=r.contextualFilterWeights[3]*d,w+=r.contextualFilterWeights[4]*f,w+=r.contextualFilterWeights[5]*_,w+=r.contextualFilterWeights[6]*y,w+=r.contextualFilterWeights[7]*v,w+=r.contextualFilterWeights[8+b],w+=r.contextualFilterWeights[29+p],w+=r.contextualFilterWeights[125+m];const x=1/(1+Math.exp(-w));return e.get(o).probabilityAccept=x,x}},187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterCharacterMap=t.contextualFilterLanguageMap=t.contextualFilterWeights=t.contextualFilterIntercept=void 0,t.contextualFilterIntercept=-.3043572714994554,t.contextualFilterWeights=[.9978708359643611,.7001905605239328,-.1736749244124868,-.22994157947320112,.13406692641682572,-.007751370662011853,.0057783222035240715,.41910878254476003,-.1621657125711092,.13770814958908187,-.06036011308184006,-.07351180985800129,0,-.05584878151248109,.30618794079412015,-.1282197982598485,.10951859303997555,.1700461782788777,-.3346057842644757,.22497985923128136,0,-.44038101825774356,-.6540115939236782,.16595600081341702,.20733910722385135,-.1337033766105696,-.06923072125290894,-.05806684191976292,.3583334671633344,-.47357732824944315,.17810871365594377,.42268219963946685,0,0,-.16379620467004602,-.43893868831061167,0,.11570094006709251,.9326431262654882,-.9990110509203912,-.44125275652726503,-.15840786997162004,-.4600396256644451,-.018814811994044403,.09230944537175266,.025814790934742798,-1.0940162204190154,-.9407503631235489,-.9854303778694269,-1.1045822488262245,-1.1417299456573262,-1.5623704405345513,-.4157473855795939,-1.0244257735561713,-.7477401944601753,-1.1275109699068402,-.0714715633552533,-1.1408628006786907,-1.0409898655074672,-.2288889836518878,-.5469549893760344,-.181946611106845,.1264329316374918,0,0,.312206968554707,-.3656436392517924,.23655650686038968,.1014912419901576,0,.06287549221765308,0,0,.19027065218932154,-.8519502045974378,0,.23753599905971923,.2488809322489166,.019969251907983224,0,.06916505526229488,.29053356359188204,-.14484456555431657,.014768129429370188,-.15051464926341374,.07614835502776021,-.3317489901313935,0,0,.04921938684669103,-.28248576768353445,-.9708816204525345,-1.3560464522265527,.014165375212383239,-.23924166472544983,.10006595730248855,.09867233147279562,.32330430333220644,-.058625706114180595,.17149853105783947,.4436484054395367,.047189049576707255,.16832520944790552,.1117259900942179,-.35469010329927253,0,-.1528189124465582,-.3804848349564939,.07278077320753953,.13263786480064088,.22920682659292527,1.1512955314336537,0,.016939862282340023,.4242994650403408,.12759835577444986,-.5577261135825583,-.19764560943067672,-.4042102444736004,.12063461617733708,-.2933966817484834,.2715683893968593,0,-.7138548251238751,0,-.023066228703035277,0,-.06383043976746139,.09683723720709651,-.7337151424080791,0,-.27191370124625525,.2819781269656171,-.08711496549050252,.11048604909969338,-.0934849550450534,.0721001250772912,.2589126797890794,.6729582659532254,-.21921032738244908,-.21535277468651456,-.45474006124091354,-.05861820126419139,-.007875306207720204,-.056661261678809284,.17727881404222662,.23603713348534658,.17485861412377932,-.5737483768696752,-.38220029570342745,-.5202722985519168,-.37187947527657256,.47155277792990113,-.12077912346691123,.47825628981545326,.4736704404000214,-.1615218651546898,.18362447973513005,0,0,-.18183417425866824,0,0,-.2538532305733833,-.1303692690676528,-.4073577969188216,.04172985870928789,-.1704527388573901,0,0,.7536858953385828,-.44703159588787644,0,-.7246484085580873,-.21378128540782063,0,.037461090552656146,-.16205852364367032,-.10973952064404884,.017468043407647377,-.1288980387397392,0,0,0,-1.218692715379445,.05536949662193305,-.3763799844799116,-.1845001725624579,-.1615576298149558,0,-.15373262203249874,-.04603412604270418,0,-.3068149681460828,.09412352468269412,0,.09116543650609721,.06065865264082559,.05688267379386188,-.05873945477722306,0,.14532465133322153,.1870857769705463,.36304258043185555,.1411392422180405,.0630388629716367,0,-1.1170522012450395,.16133697772771127,.15908534390781448,-.23485453704002232,-.1419980841417892,.21909510179526218,.39948420260153766,.40802294284289187,.15403767653746853,0,.19764784115096676,.584914157527457,0,-.4573883817015294],t.contextualFilterLanguageMap={javascript:1,typescript:2,typescriptreact:3,python:4,vue:5,php:6,dart:7,javascriptreact:8,go:9,css:10,cpp:11,html:12,scss:13,markdown:14,csharp:15,java:16,json:17,rust:18,ruby:19,c:20},t.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}},3993:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.completionsFromGhostTextResults=void 0;const r=n(7057),o=n(2369),i=n(702),s=n(5034);t.completionsFromGhostTextResults=function(e,t,n,a,c,l,u){const d=e.get(o.LocationFactory),p=a.lineAt(c);let h=t.map((e=>{let t,o="";if(l&&(e.completion=(0,s.normalizeIndentCharacter)(l,e.completion,p.isEmptyOrWhitespace)),e.completion.displayNeedsWsOffset&&p.isEmptyOrWhitespace)t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else if(p.isEmptyOrWhitespace&&e.completion.completionText.startsWith(p.text))t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else{const n=a.getWordRangeAtPosition(c);if(e.isMiddleOfTheLine){const n=a.lineAt(c),r=d.range(d.position(c.line,0),c),i=a.getText(r);t=e.coversSuffix?n.range:r,o=i+e.completion.displayText}else if(n){const r=a.getText(n);t=d.range(n.start,c),o=r+e.completion.completionText}else{const n=d.range(d.position(c.line,0),c);t=n,o=a.getText(n)+e.completion.displayText}}return{uuid:(0,r.v4)(),text:o,range:t,file:a.uri,index:e.completion.completionIndex,telemetry:e.telemetry,displayText:e.completion.displayText,position:c,offset:a.offsetAt(c),resultType:n}}));if(n===i.ResultType.TypingAsSuggested&&void 0!==u){const e=h.find((e=>e.index===u));if(e){const t=h.filter((e=>e.index!==u));h=[e,...t]}}return h}},4619:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDebounceLimit=t.GhostTextDebounceManager=void 0;const r=n(6905);class o{constructor(e){this.forceDelayMs=e,this.extraDebounceMs=0}}t.GhostTextDebounceManager=o,t.getDebounceLimit=async function(e,t){let n;if(await e.get(r.Features).debouncePredict()&&t.measurements.contextualFilterScore){const e=t.measurements.contextualFilterScore,r=.275,o=6;n=25+250/(1+Math.pow(e/r,o))}else n=await e.get(r.Features).debounceMs();return(n>0?n:75)+e.get(o).extraDebounceMs}},702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGhostText=t.completionCache=t.ResultType=t.ghostTextLogger=void 0;const r=n(4617),o=n(7057),i=n(140),s=n(3940),a=n(1661),c=n(9800),l=n(6905),u=n(5798),d=n(39),p=n(7553),h=n(2031),f=n(598),m=n(6635),g=n(7917),_=n(4090),y=n(3591),v=n(1153),b=n(3883),w=n(5489),x=n(913),T=n(2369),E=n(6817),C=n(4619),S=n(1749);var k;let P,I;async function R(e,n,r,o,i,s,a){var u,p,m;t.ghostTextLogger.debug(e,`Getting ${s} from network`),r=r.extendedBy();const g=await async function(e,t){const n=await e.get(l.Features).overrideNumGhostCompletions();return n?t.isCycling?Math.max(0,3-n):n:(0,c.shouldDoParsingTrimming)(t.blockMode)&&t.multiline?(0,c.getConfig)(e,c.ConfigKey.InlineSuggestCount):t.isCycling?2:1}(e,n),_=(0,f.getTemperatureForSamples)(e,g),y={stream:!0,n:g,temperature:_,extra:{language:n.languageId,next_indent:null!==(u=n.indentation.next)&&void 0!==u?u:0}};n.multiline||(y.stop=["\n"]),n.multiline&&n.multiLogitBias&&(y.logit_bias={50256:-100});const v=Date.now(),b={endpoint:"completions",uiKind:h.CopilotUiKind.GhostText,isCycling:JSON.stringify(n.isCycling),temperature:JSON.stringify(_),n:JSON.stringify(g),stop:null!==(p=JSON.stringify(y.stop))&&void 0!==p?p:"unset",logit_bias:JSON.stringify(null!==(m=y.logit_bias)&&void 0!==m?m:null)},T=(0,w.telemetrizePromptLength)(n.prompt);Object.assign(r.properties,b),Object.assign(r.measurements,T);try{const s={prompt:n.prompt,languageId:n.languageId,repoInfo:n.repoInfo,ourRequestId:n.ourRequestId,engineUrl:n.engineURL,count:g,uiKind:h.CopilotUiKind.GhostText,postOptions:y};n.delayMs>0&&await new Promise((e=>setTimeout(e,n.delayMs)));const c=await e.get(h.OpenAIFetcher).fetchAndStreamCompletions(e,s,r,i,o);return"failed"===c.type?{type:"failed",reason:c.reason,telemetryData:(0,S.mkBasicResultTelemetry)(r)}:"canceled"===c.type?(t.ghostTextLogger.debug(e,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:c.reason,telemetryData:(0,S.mkCanceledResultTelemetry)(r)}):a(g,v,c.getProcessingTime(),c.choices)}catch(n){if((0,d.isAbortError)(n))return{type:"canceled",reason:"network request aborted",telemetryData:(0,S.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(t.ghostTextLogger.error(e,`Error on ghost text request ${n}`),(0,x.shouldFailForDebugPurposes)(e))throw n;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,S.mkBasicResultTelemetry)(r)}}}function O(e,t){const n={...e};return n.completionText=e.completionText.trimEnd(),t.forceSingleLine&&(n.completionText=n.completionText.split("\n")[0]),n}t.ghostTextLogger=new u.Logger(u.LogLevel.INFO,"ghostText"),function(e){e[e.Network=0]="Network",e[e.Cache=1]="Cache",e[e.TypingAsSuggested=2]="TypingAsSuggested",e[e.Cycling=3]="Cycling"}(k=t.ResultType||(t.ResultType={})),t.completionCache=new i.LRUCache(100);const A=new s.Debouncer;function N(e,t){P=e,I=t}function D(e,n,r){const o=(0,i.keyForPrompt)(n.prompt),s=t.completionCache.get(o);s&&s.multiline===r.multiline?t.completionCache.put(o,{multiline:s.multiline,choices:s.choices.concat(r.choices)}):t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Appended cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}function M(e,n){const r=t.completionCache.get(e);if(r&&(!n||r.multiline))return r.choices}function L(e,t,n){if(n.length>0){if(t.startsWith(n))return{completionIndex:e,completionText:t,displayText:t.substr(n.length),displayNeedsWsOffset:!1};{const r=t.substr(0,t.length-t.trimLeft().length);return n.startsWith(r)?{completionIndex:e,completionText:t,displayText:t.trimLeft(),displayNeedsWsOffset:!0}:{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}}return{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}function $(e,n){const r=n.requestId,o={choiceIndex:n.choiceIndex.toString()},i={numTokens:n.numTokens,compCharLen:n.completionText.length,numLines:n.completionText.split("\n").length};n.meanLogProb&&(i.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(i.meanAlternativeLogProb=n.meanAlternativeLogProb);const s=n.telemetryData.extendedBy(o,i);return s.extendWithRequestId(r),s.measurements.confidence=(0,v.ghostTextScoreConfidence)(e,s),s.measurements.quantile=(0,v.ghostTextScoreQuantile)(e,s),t.ghostTextLogger.debug(e,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${s.measurements.confidence} (expected as good or better than about ${s.measurements.quantile} of all suggestions)`),s}function j(e,t,n,r,o){const i=Date.now()-r,s=i-o,a=n.telemetryData.extendedBy({},{completionCharLen:n.completionText.length,requestTimeMs:i,processingTimeMs:o,deltaMs:s,meanLogProb:n.meanLogProb||NaN,meanAlternativeLogProb:n.meanAlternativeLogProb||NaN,numTokens:n.numTokens});a.extendWithRequestId(n.requestId),(0,w.telemetry)(e,`ghostText.${t}`,a)}t.getGhostText=async function(e,n,s,u,d,f){var v,F;const q=await(0,_.extractPrompt)(e,n,s);if("contextTooShort"===q.type)return t.ghostTextLogger.debug(e,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context"};if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled after extractPrompt"};const B=function(e,t){const n=(o=t,0!=e.lineAt(o).text.substr(o.character).trim().length),r=function(e,t){const n=t.lineAt(e).text.substr(e.character).trim();return/^\s*[)}\]"'`]*\s*[:{;,]?\s*$/.test(n)}(t,e);var o;if(!n||r)return n&&r}(n,s);if(void 0===B)return t.ghostTextLogger.debug(e,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line"};const U=e.get(m.StatusReporter),H=e.get(T.LocationFactory),W=await async function(e,t,n,o,i,s){const a=await e.get(c.BlockModeConfig).forLanguage(e,t.languageId);switch(a){case c.BlockMode.Server:return{blockMode:c.BlockMode.Server,requestMultiline:!0,isCyclingRequest:i,finishedCb:async e=>{}};case c.BlockMode.Parsing:case c.BlockMode.ParsingAndServer:default:{const c=await async function(e,t,n,o){if(t.lineCount>=8e3)(0,w.telemetry)(e,"ghostText.longFileMultilineSkip",w.TelemetryData.createAndMarkAsIssued({languageId:t.languageId,lineCount:String(t.lineCount),currentLine:String(n.line)}));else{if(!o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n);if(o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n)||await(0,g.isEmptyBlockStart)(t,t.lineAt(n).range.end)}return!1}(e,t,n,s);return c?{blockMode:a,requestMultiline:!0,isCyclingRequest:!1,finishedCb:async r=>{let i;return i=o.trailingWs.length>0&&!o.prompt.prefix.endsWith(o.trailingWs)?e.get(T.LocationFactory).position(n.line,Math.max(n.character-o.trailingWs.length,0)):n,(0,g.isBlockBodyFinished)(e,t,i,r)}}:{blockMode:a,requestMultiline:!1,isCyclingRequest:i,finishedCb:async e=>{}}}}}(e,n,s,q,u,B);if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after requestMultiline"),{type:"abortedBeforeIssued",reason:"Cancelled after requestMultiline"};const[z]=(0,_.trimLastLine)(n.getText(H.range(H.position(0,0),s)));let K=function(e,n,r,o){const s=function(e,n,r){if(!P||!I||!n.startsWith(P))return;const o=M(I,r);if(!o)return;const i=n.substring(P.length);t.ghostTextLogger.debug(e,`Getting completions for user-typing flow - remaining prefix: ${i}`);const s=[];return o.forEach((e=>{const t=O(e,{forceSingleLine:!1});t.completionText.startsWith(i)&&(t.completionText=t.completionText.substring(i.length),s.push(t))})),s}(e,n,o);if(s&&s.length>0)return[s,k.TypingAsSuggested];const a=function(e,n,r,o){const s=(0,i.keyForPrompt)(r);t.ghostTextLogger.debug(e,`Trying to get completions from cache for key: ${s}`);const a=M(s,o);if(a){t.ghostTextLogger.debug(e,`Got completions from cache for key: ${s}`);const r=[];a.forEach((e=>{const t=O(e,{forceSingleLine:!o});r.push(t)}));const i=r.filter((e=>e.completionText));return i.length>0&&N(n,s),i}}(e,n,r,o);return a&&a.length>0?[a,k.Cache]:void 0}(e,z,q.prompt,W.requestMultiline);const V=o.v4(),G=(0,y.extractRepoInfoInBackground)(e,n.fileName),J=await(0,p.getEngineURL)(e,(0,y.tryGetGitHubNWO)(G),n.languageId,(0,y.getDogFood)(G),(0,y.getUserKind)(e),d),X=await e.get(l.Features).beforeRequestWaitMs((0,y.tryGetGitHubNWO)(G)||"",n.languageId),Q=await e.get(l.Features).multiLogitBias((0,y.tryGetGitHubNWO)(G)||"",n.languageId),Y={blockMode:W.blockMode,languageId:n.languageId,repoInfo:G,engineURL:J,ourRequestId:V,prefix:z,prompt:q.prompt,multiline:W.requestMultiline,indentation:(0,g.contextIndentation)(n,s),isCycling:u,delayMs:X,multiLogitBias:Q},Z=await e.get(l.Features).debouncePredict(),ee=await e.get(l.Features).contextualFilterAcceptThreshold();let te=!1;(Z||"number"==typeof ee)&&(te=!0);const ne=function(e,t,n,r,o,i,s){const a=e.get(T.LocationFactory),c=t.lineAt(r.line),l=t.getText(a.range(c.range.start,r)),u=t.getText(a.range(r,c.range.end)),d={languageId:t.languageId,beforeCursorWhitespace:JSON.stringify(""===l.trim()),afterCursorWhitespace:JSON.stringify(""===u.trim())},p={...(0,w.telemetrizePromptLength)(o.prompt),promptEndPos:t.offsetAt(r),documentLength:t.getText().length,delayMs:n.delayMs},f=i.extendedBy(d,p);f.properties.promptChoices=JSON.stringify(o.promptChoices,((e,t)=>t instanceof Map?Array.from(t.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{}):t)),f.properties.promptBackground=JSON.stringify(o.promptBackground,((e,t)=>t instanceof Map?Array.from(t.values()):t)),f.measurements.promptComputeTimeMs=o.computeTimeMs,s&&(f.measurements.contextualFilterScore=(0,E.contextualFilterScore)(e,f,o.prompt));const m=n.repoInfo;return f.properties.gitRepoInformation=void 0===m?"unavailable":m===y.ComputationStatus.PENDING?"pending":"available",void 0!==m&&m!==y.ComputationStatus.PENDING&&(f.properties.gitRepoUrl=m.url,f.properties.gitRepoHost=m.hostname,f.properties.gitRepoOwner=m.owner,f.properties.gitRepoName=m.repo,f.properties.gitRepoPath=m.pathname),f.properties.engineName=(0,h.extractEngineName)(e,n.engineURL),f.properties.isMultiline=JSON.stringify(n.multiline),f.properties.blockMode=n.blockMode,f.properties.isCycling=JSON.stringify(n.isCycling),f.properties.headerRequestId=n.ourRequestId,(0,w.telemetry)(e,"ghostText.issued",f),f}(e,n,Y,s,q,d,te);if(W.isCyclingRequest&&(null!==(v=null==K?void 0:K[0].length)&&void 0!==v?v:0)>1||!W.isCyclingRequest&&void 0!==K)t.ghostTextLogger.info(e,"Found inline suggestions locally");else{if(null==U||U.setProgress(),W.isCyclingRequest){const n=await async function(e,n,r,o,i){return R(e,n,r,o,i,"all completions",(async(i,s,a,c)=>{const l=[];for await(const n of c){if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,S.mkCanceledResultTelemetry)(r)};if(n.completionText.trimEnd()){if(-1!==l.findIndex((e=>e.completionText.trim()===n.completionText.trim())))continue;l.push(n)}}return l.length>0&&(D(e,n,{multiline:n.multiline,choices:l}),j(e,"cyclingPerformance",l[0],s,a)),{type:"success",value:l,telemetryData:(0,S.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,f,W.finishedCb);if("success"===n.type){const e=null!==(F=null==K?void 0:K[0])&&void 0!==F?F:[];n.value.forEach((t=>{-1===e.findIndex((e=>e.completionText.trim()===t.completionText.trim()))&&e.push(t)})),K=[e,k.Cycling]}else if(void 0===K)return null==U||U.removeProgress(),n}else{const n=await(0,C.getDebounceLimit)(e,ne);try{await A.debounce(n)}catch{return{type:"canceled",reason:"by debouncer",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)}}if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled during debounce"),{type:"canceled",reason:"during debounce",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)};if(ee&&ne.measurements.contextualFilterScore&&ne.measurements.contextualFilterScore{const u=l[Symbol.asyncIterator](),d=await u.next();if(d.done)return t.ghostTextLogger.debug(e,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,S.mkBasicResultTelemetry)(r)};if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,S.mkCanceledResultTelemetry)(r)};const p=d.value;if(void 0===p)return t.ghostTextLogger.debug(e,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,S.mkBasicResultTelemetry)(r)};j(e,"performance",p,a,c);const h=s-1;t.ghostTextLogger.debug(e,`Awaited first result, id: ${p.choiceIndex}`),function(e,n,r){const o=(0,i.keyForPrompt)(n.prompt);N(n.prefix,o),t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}(e,n,{multiline:n.multiline,choices:[p]});const f=[];for(let e=0;e{t.ghostTextLogger.debug(e,`Awaited remaining results, number of results: ${r.length}`);const o=[];for(const n of r){const r=n.value;if(void 0!==r&&(t.ghostTextLogger.info(e,`GhostText later completion: [${r.completionText}]`),r.completionText.trimEnd())){if(-1!==o.findIndex((e=>e.completionText.trim()===r.completionText.trim())))continue;if(r.completionText.trim()===p.completionText.trim())continue;o.push(r)}}o.length>0&&D(e,n,{multiline:n.multiline,choices:o})}));return(0,x.isRunningInTest)(e)&&await m,{type:"success",value:O(d.value,{forceSingleLine:!1}),telemetryData:(0,S.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,f,W.finishedCb);if("success"!==r.type)return null==U||U.removeProgress(),r;K=[[r.value],k.Network]}null==U||U.removeProgress()}if(void 0===K)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,S.mkBasicResultTelemetry)(ne)};const[re,oe]=K,ie=(0,a.asyncIterableMapFilter)((0,a.asyncIterableFromArray)(re),(async r=>(0,b.postProcessChoice)(e,"ghostText",n,s,r,B,t.ghostTextLogger))),se=[];for await(const r of ie){const o=B&&(0,b.checkSuffix)(n,s,r);if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after post processing completions"),{type:"canceled",reason:"after post processing completions",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)};const i=$(e,r),a={completion:L(r.choiceIndex,r.completionText,q.trailingWs),telemetry:i,isMiddleOfTheLine:B,coversSuffix:o};se.push(a)}return{type:"success",value:[se,oe],telemetryData:(0,S.mkBasicResultTelemetry)(ne),telemetryBlob:ne}}},5034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeIndentCharacter=void 0,t.normalizeIndentCharacter=function(e,t,n){function r(e,t,n){const r=new RegExp(`^(${t})+`,"g");return e.split("\n").map((e=>{const t=e.replace(r,""),o=e.length-t.length;return n(o)+t})).join("\n")}let o;if(o=void 0===e.tabSize||"string"==typeof e.tabSize?4:e.tabSize,!1===e.insertSpaces){const e=e=>r(e," ",(e=>"\t".repeat(Math.floor(e/o))+" ".repeat(e%o)));t.displayText=e(t.displayText),t.completionText=e(t.completionText)}else if(!0===e.insertSpaces){const e=e=>r(e,"\t",(e=>" ".repeat(e*o)));if(t.displayText=e(t.displayText),t.completionText=e(t.completionText),n){const e=e=>{const t=e.length-e.trimLeft().length,n=t%o;return 0!==n&&t>0?r(e," ".repeat(n),(e=>" ".repeat((Math.floor(e/o)+1)*o))):e};t.displayText=e(t.displayText),t.completionText=e(t.completionText)}}return t}},1749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGhostTextResultTelemetry=t.mkBasicResultTelemetry=t.mkCanceledResultTelemetry=t.telemetryRejected=t.telemetryAccepted=t.telemetryShown=void 0;const r=n(5489),o=n(6817);t.telemetryShown=function(e,t,n,o){n.markAsDisplayed();const i=o?`${t}.shownFromCache`:`${t}.shown`;(0,r.telemetry)(e,i,n)},t.telemetryAccepted=function(e,t,n){const i=t+".accepted",s=e.get(o.ContextualFilterManager);s.previousLabel=1,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.telemetryRejected=function(e,t,n){const i=t+".rejected",s=e.get(o.ContextualFilterManager);s.previousLabel=0,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.mkCanceledResultTelemetry=function(e,t={}){return{...t,telemetryBlob:e}},t.mkBasicResultTelemetry=function(e){return{headerRequestId:e.properties.headerRequestId,copilot_trackingId:e.properties.copilot_trackingId}},t.handleGhostTextResultTelemetry=async function(e,t){if("success"===t.type)return(0,r.telemetryRaw)(e,"ghostText.produced",t.telemetryData,{}),t.value;"abortedBeforeIssued"!==t.type&&("canceled"!==t.type?(0,r.telemetryRaw)(e,`ghostText.${t.type}`,{...t.telemetryData,reason:t.reason},{}):(0,r.telemetry)(e,"ghostText.canceled",t.telemetryData.telemetryBlob.extendedBy({reason:t.reason,cancelledNetworkRequest:t.telemetryData.cancelledNetworkRequest?"true":"false"})))}},5798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.toPlainText=t.Logger=t.MultiLog=t.OutputChannelLog=t.ConsoleLog=t.LogTarget=t.verboseLogging=t.LogVerbose=t.LogLevel=void 0;const r=n(2137),o=n(9800),i=n(5489);var s;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(s=t.LogLevel||(t.LogLevel={}));class a{constructor(e){this.logVerbose=e}}function c(e){return e.get(a).logVerbose}t.LogVerbose=a,t.verboseLogging=c;class l{shouldLog(e,t){}}t.LogTarget=l,t.ConsoleLog=class extends l{constructor(e){super(),this.console=e}logIt(e,t,n,...r){c(e)||t==s.ERROR?this.console.error(n,...r):t==s.WARN&&this.console.warn(n,...r)}},t.OutputChannelLog=class extends l{constructor(e){super(),this.output=e}logIt(e,t,n,...r){this.output.appendLine(`${n} ${r.map(d)}`)}},t.MultiLog=class extends l{constructor(e){super(),this.targets=e}logIt(e,t,n,...r){this.targets.forEach((o=>o.logIt(e,t,n,...r)))}};class u{constructor(e,t){this.minLoggedLevel=e,this.context=t}setLevel(e){this.minLoggedLevel=e}stringToLevel(e){return s[e]}log(e,t,n,...o){const a=s[t];t==s.ERROR&&(0,i.telemetryError)(e,"log",i.TelemetryData.createAndMarkAsIssued({context:this.context,level:a,message:o.length>0?JSON.stringify(o):"no msg"}),n);const c=e.get(l),u=c.shouldLog(e,t);if(!1===u)return;if(void 0===u&&!this.shouldLog(e,t,this.context))return;const d=e.get(r.Clock).now().toISOString(),p=`[${a}] [${this.context}] [${d}]`;c.logIt(e,t,p,...o)}shouldLog(e,t,n){var r,i;if(c(e))return!0;const s=(0,o.getConfig)(e,o.ConfigKey.DebugFilterLogCategories);if(s.length>0&&!s.includes(n))return!1;if((0,o.isProduction)(e))return t>=this.minLoggedLevel;const a=(0,o.getConfig)(e,o.ConfigKey.DebugOverrideLogLevels);return t>=(null!==(i=null!==(r=this.stringToLevel(a["*"]))&&void 0!==r?r:this.stringToLevel(a[this.context]))&&void 0!==i?i:this.minLoggedLevel)}debug(e,...t){this.log(e,s.DEBUG,!1,...t)}info(e,...t){this.log(e,s.INFO,!1,...t)}warn(e,...t){this.log(e,s.WARN,!1,...t)}error(e,...t){this.log(e,s.ERROR,!1,...t)}secureError(e,t,...n){this.log(e,s.ERROR,!1,t),this.log(e,s.ERROR,!0,t,...n)}}function d(e){return"object"==typeof e?JSON.stringify(e):String(e)}t.Logger=u,t.toPlainText=d,t.logger=new u(s.INFO,"default")},39:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postRequest=t.Response=t.HelixFetcher=t.isAbortError=t.Fetcher=t.init=void 0;const r=n(8606),o=n(3582),i=n(3837),s=n(9800),a=n(4619),c=n(5489);let l,u=!1;t.init=function(e){if(u){if(e!==l)throw new Error(`Networking re-initialized with mismatched version (old: ${l}, new: ${e})`)}else l=e,u=!0};class d{}t.Fetcher=d,t.isAbortError=function(e){return e instanceof r.AbortError},t.HelixFetcher=class extends d{constructor(e){super(),this.ctx=e,this.createSocketFactory=e=>{const t=o.httpOverHttp({proxy:e});return e=>new Promise((n=>{t.createSocket(e,(e=>{n(e)}))}))},this.fetchApi=this.createFetchApi(e)}set proxySettings(e){this._proxySettings=e,this.fetchApi=this.createFetchApi(this.ctx)}get proxySettings(){return this._proxySettings}createFetchApi(e){const t=e.get(s.BuildInfo),n=t.getBuildType()===s.BuildType.DEV,o=t.getBuildType()===s.BuildType.NIGHTLY,i=(0,s.getHiddenConfig)(e,s.ConfigKey.DebugAcceptSelfSignedCertificate,{default:!1})&&(n||o);return r.context({userAgent:`GithubCopilot/${t.getVersion()}`,rejectUnauthorized:!i,socketFactory:this._proxySettings?this.createSocketFactory(this._proxySettings):void 0})}async fetch(e,t){const n={...t,body:t.body?t.body:t.json,signal:t.signal},r=await this.fetchApi.fetch(e,n);return new p(r.status,r.statusText,r.headers,(()=>r.text()),(()=>r.json()),(async()=>r.body))}disconnectAll(){return this.fetchApi.reset()}makeAbortController(){return new r.AbortController}};class p{constructor(e,t,n,r,o,i){this.status=e,this.statusText=t,this.headers=n,this.getText=r,this.getJson=o,this.getBody=i,this.ok=this.status>=200&&this.status<300}async text(){return this.getText()}async json(){return this.getJson()}async body(){return this.getBody()}}t.Response=p,t.postRequest=function(e,t,n,r,o,l,p){if(!u)throw new Error("Networking must be initialized before being used");const h={Authorization:i.format("Bearer %s",n),"X-Request-Id":o,"Openai-Organization":"github-copilot","VScode-SessionId":e.get(s.VscInfo).sessionId,"VScode-MachineId":e.get(s.VscInfo).machineId,...(0,s.editorVersionHeaders)(e)};r&&(h["OpenAI-Intent"]=r);const f=e.get(a.GhostTextDebounceManager).forceDelayMs;f&&(h["X-Copilot-Force-Delay"]=f.toString());const m={method:"POST",headers:h,json:l,timeout:3e4},g=e.get(d);if(p){const t=g.makeAbortController();p.onCancellationRequested((()=>{(0,c.telemetry)(e,"networking.cancelRequest",c.TelemetryData.createAndMarkAsIssued({headerRequestId:o})),t.abort()})),m.signal=t.signal}return g.fetch(t,m).catch((n=>{if("ECONNRESET"==n.code||"ETIMEDOUT"==n.code||"ERR_HTTP2_INVALID_SESSION"==n.code||"ERR_HTTP2_GOAWAY_SESSION"==n.message)return(0,c.telemetry)(e,"networking.disconnectAll"),g.disconnectAll().then((()=>g.fetch(t,m)));throw n}))}},9035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationSender=void 0,t.NotificationSender=class{}},7553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEngineURL=t.TEST_ENGINE_PATHS=t.OPENAI_PROXY_HOST=void 0;const r=n(9800),o=n(6905),i=n(3591),s=n(913);t.OPENAI_PROXY_HOST="https://copilot-proxy.githubusercontent.com";const a="/v1/engines/copilot-codex";t.TEST_ENGINE_PATHS=[a],t.getEngineURL=async function(e,n="",c,l="",u=i.UserKind.UNKNOWN,d){return function(e,n){let o=function(e){return(0,s.isRunningInTest)(e)?(0,r.getConfig)(e,r.ConfigKey.DebugTestOverrideProxyUrl):(0,r.getConfig)(e,r.ConfigKey.DebugOverrideProxyUrl)}(e);return 0==o.length&&(o=t.OPENAI_PROXY_HOST),`${o}${n}`}(e,await async function(e,t,n,i,s,c){const l=(0,r.getConfig)(e,r.ConfigKey.DebugOverrideEngine);if(l)return`/v1/engines/${l}`;const u=await e.get(o.Features).customEngine(t,n,i,s,c);return""!==u?`/v1/engines/${u}`:a}(e,n,c,l,u,d))}},2031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveOpenAIFetcher=t.postProcessChoices=t.OpenAIFetcher=t.extractEngineName=t.getProcessingTime=t.getRequestId=t.CopilotUiKind=void 0;const r=n(3837),o=n(5765),i=n(1661),s=n(9800),a=n(6905),c=n(4619),l=n(5798),u=n(39),d=n(6635),p=n(3591),h=n(5489),f=n(598),m=n(4586),g=new l.Logger(l.LogLevel.INFO,"fetch");var _;function y(e,t){return{headerRequestId:e.headers.get("x-request-id")||"",completionId:t&&t.id?t.id:"",created:t&&t.created?t.created:0,serverExperiments:e.headers.get("X-Copilot-Experiment")||"",deploymentId:e.headers.get("azureml-model-deployment")||""}}function v(e){const t=e.headers.get("openai-processing-ms");return t?parseInt(t,10):0}function b(e,t){return t.split("/").pop()||(g.error(e,"Malformed engine URL: "+t),t)}!function(e){e.GhostText="ghostText",e.Panel="synthesize"}(_=t.CopilotUiKind||(t.CopilotUiKind={})),t.getRequestId=y,t.getProcessingTime=v,t.extractEngineName=b;class w{}function x(e,t){return null!=t&&t?e:(0,i.asyncIterableFilter)(e,(async e=>e.completionText.trim().length>0))}t.OpenAIFetcher=w,t.postProcessChoices=x,t.LiveOpenAIFetcher=class extends w{async fetchAndStreamCompletions(e,t,n,r,o){const s=e.get(d.StatusReporter),a="completions",c=await this.fetchWithParameters(e,a,t,o);if("not-sent"===c)return{type:"canceled",reason:"before fetch request"};if(null==o?void 0:o.isCancellationRequested){const t=await c.body();try{t.destroy()}catch(t){l.logger.error(e,`Error destroying stream: ${t}`)}return{type:"canceled",reason:"after fetch request"}}if(void 0===c){const n=this.createTelemetryData(a,e,t);return s.setWarning(),n.properties.error="Response was undefined",(0,h.telemetry)(e,"request.shownWarning",n),{type:"failed",reason:"fetch response was undefined"}}if(200!==c.status){const n=this.createTelemetryData(a,e,t);return this.handleError(e,s,n,c)}return{type:"success",choices:x((0,i.asyncIterableMap)((0,m.processSSE)(e,c,r,o),(async t=>(0,m.prepareSolutionForReturn)(e,t,n))),t.allowEmptyChoices),getProcessingTime:()=>v(c)}}createTelemetryData(e,t,n){return h.TelemetryData.createAndMarkAsIssued({endpoint:e,engineName:b(t,n.engineUrl),uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,t,n,i){const m=(0,s.getLanguageConfig)(e,s.ConfigKey.Stops),g=await e.get(a.Features).disableLogProb(),v={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:(0,s.getConfig)(e,s.ConfigKey.SolutionLength),temperature:(0,f.getTemperatureForSamples)(e,n.count),top_p:(0,s.getConfig)(e,s.ConfigKey.TopP),n:n.count,stop:m};!n.requestLogProbs&&g||(v.logprobs=2);const w=(0,p.tryGetGitHubNWO)(n.repoInfo);return void 0!==w&&(v.nwo=w),(0,s.shouldDoServerTrimming)(await e.get(s.BlockModeConfig).forLanguage(e,n.languageId))&&(v.feature_flags=["trim_to_block"]),n.postOptions&&Object.assign(v,n.postOptions),(null==i?void 0:i.isCancellationRequested)?"not-sent":(l.logger.info(e,`[fetchCompletions] engine ${n.engineUrl}`),await function(e,t,n,o,i,s,a,p,f){var m;const g=e.get(d.StatusReporter),v=r.format("%s/%s",n,o);if(!a)return void l.logger.error(e,`Failed to send request to ${v} due to missing key`);const w=h.TelemetryData.createAndMarkAsIssued({endpoint:o,engineName:b(e,n),uiKind:p},(0,h.telemetrizePromptLength)(t));for(const[e,t]of Object.entries(s))"prompt"!=e&&"suffix"!=e&&(w.properties[`request.option.${e}`]=null!==(m=JSON.stringify(t))&&void 0!==m?m:"undefined");w.properties.headerRequestId=i,(0,h.telemetry)(e,"request.sent",w);const x=(0,h.now)(),T=function(e){switch(e){case _.GhostText:return"copilot-ghost";case _.Panel:return"copilot-panel"}}(p);return(0,u.postRequest)(e,v,a,T,i,s,f).then((n=>{const r=y(n,void 0);w.extendWithRequestId(r);const o=(0,h.now)()-x;w.measurements.totalTimeMs=o,l.logger.info(e,`request.response: [${v}] took ${o} ms`),l.logger.debug(e,"request.response properties",w.properties),l.logger.debug(e,"request.response measurements",w.measurements),l.logger.debug(e,`prompt: ${JSON.stringify(t)}`),(0,h.telemetry)(e,"request.response",w);const i=n.headers.get("x-copilot-delay"),s=i?parseInt(i,10):0;return e.get(c.GhostTextDebounceManager).extraDebounceMs=s,n})).catch((t=>{var n,r,o,i;if((0,u.isAbortError)(t))throw t;g.setWarning();const s=w.extendedBy({error:"Network exception"});(0,h.telemetry)(e,"request.shownWarning",s),w.properties.code=String(null!==(n=t.code)&&void 0!==n?n:""),w.properties.errno=String(null!==(r=t.errno)&&void 0!==r?r:""),w.properties.message=String(null!==(o=t.message)&&void 0!==o?o:""),w.properties.type=String(null!==(i=t.type)&&void 0!==i?i:"");const a=(0,h.now)()-x;throw w.measurements.totalTimeMs=a,l.logger.debug(e,`request.response: [${v}] took ${a} ms`),l.logger.debug(e,"request.error properties",w.properties),l.logger.debug(e,"request.error measurements",w.measurements),l.logger.error(e,`Request Error: ${t.message}`),(0,h.telemetry)(e,"request.error",w),t})).finally((()=>{(0,h.logEnginePrompt)(e,t,w)}))}(e,n.prompt,n.engineUrl,t,n.ourRequestId,v,await e.get(o.CopilotTokenManager).getCopilotToken(e),n.uiKind,i))}async handleError(e,t,n,r){if(t.setWarning(),n.properties.error=`Response status was ${r.status}`,n.properties.status=String(r.status),(0,h.telemetry)(e,"request.shownWarning",n),401===r.status||403===r.status)return e.get(o.CopilotTokenManager).resetCopilotToken(e,r.status),{type:"failed",reason:`token expired or invalid: ${r.status}`};if(499===r.status)return g.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"};const i=await r.text();return 466===r.status?(t.setError(i),g.info(e,i),{type:"failed",reason:`client not supported: ${i}`}):(g.error(e,"Unhandled status from server:",r.status,i),{type:"failed",reason:`unhandled status from server: ${r.status} ${i}`})}}},598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTemperatureForSamples=t.calculateMeanAlternativeLogProb=t.calculateMeanLogProb=t.cleanupIndentChoices=t.convertToAPIChoice=t.DEFAULT_CHARACTER_MULTIPLIER=t.MAX_PROMPT_LENGTH=t.OpenAIFetcher=t.LiveOpenAIFetcher=t.getRequestId=t.CopilotUiKind=void 0;const r=n(9800),o=n(5798),i=n(5489),s=n(913);var a=n(2031);function c(e,t){if(t.logprobs.token_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--)e+=t.logprobs.token_logprobs[o],n+=1;return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}function l(e,t){if(t.logprobs.top_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--){const r={...t.logprobs.top_logprobs[o]};delete r[t.logprobs.tokens[o]],e+=Math.max(...Object.values(r)),n+=1}return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}Object.defineProperty(t,"CopilotUiKind",{enumerable:!0,get:function(){return a.CopilotUiKind}}),Object.defineProperty(t,"getRequestId",{enumerable:!0,get:function(){return a.getRequestId}}),Object.defineProperty(t,"LiveOpenAIFetcher",{enumerable:!0,get:function(){return a.LiveOpenAIFetcher}}),Object.defineProperty(t,"OpenAIFetcher",{enumerable:!0,get:function(){return a.OpenAIFetcher}}),t.MAX_PROMPT_LENGTH=1500,t.DEFAULT_CHARACTER_MULTIPLIER=3,t.convertToAPIChoice=function(e,t,n,r,o,s,a,u){return(0,i.logEngineCompletion)(e,t,n,o,r),{completionText:t,meanLogProb:c(e,n),meanAlternativeLogProb:l(e,n),choiceIndex:r,requestId:o,modelInfo:u,blockFinished:s,tokens:n.logprobs.tokens,numTokens:n.logprobs.tokens.length,telemetryData:a}},t.cleanupIndentChoices=async function*(e,t){for await(const n of e){const e={...n},r=e.completionText.split("\n");for(let e=0;e=0&&n<=1?n:t<=1?0:t<10?.2:t<20?.4:.8}},4586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareSolutionForReturn=t.processSSE=t.splitChunk=void 0;const r=n(5798),o=n(598),i=new r.Logger(r.LogLevel.INFO,"streamChoices");function s(e){const t=e.split("\n"),n=t.pop();return[t.filter((e=>""!=e)),n]}t.splitChunk=s,t.processSSE=async function*(e,t,n,r){var a,c,l,u,d,p,h,f;const m=await t.body();m.setEncoding("utf8");let g=(0,o.getRequestId)(t);i.debug(e,`requestId: ${g.headerRequestId}`);const _={};let y="";for await(const v of m){if(null==r?void 0:r.isCancellationRequested)return i.info(e,"Cancelled after awaiting body chunk"),void m.destroy();i.debug(e,"chunk",v.toString());const[b,w]=s(y+v.toString());y=w;for(const s of b){const y=s.slice("data:".length).trim();if("[DONE]"==y){for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"DONE",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding on DONE"),void m.destroy()}return}let v;try{v=JSON.parse(y)}catch(t){i.error(e,"Error parsing JSON stream data",s);continue}if(void 0!==v.choices||void 0===v.error){0==g.created&&(g=(0,o.getRequestId)(t,v),0==g.created&&i.error(e,`Request id invalid, should have "completionId" and "created": ${g}`,g));for(let t=0;t-1)&&(y=await n(s.text.join("")),null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after awaiting finishedCb"),void m.destroy();if(o.finish_reason||void 0!==y){if(yield{solution:s,finishOffset:y,reason:JSON.stringify(o.finish_reason),requestId:g,index:o.index},null==r?void 0:r.isCancellationRequested)return i.debug(e,"Cancelled after yielding finished choice"),void m.destroy();_[o.index]=null}}}else i.error(e,"Error in response:",v.error.message)}}for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"Iteration Done",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding after iteration done"),void m.destroy()}if(y.length>0)try{const t=JSON.parse(y);void 0!==t.error&&i.error(e,`Error in response: ${t.error.message}`,t.error)}catch(t){i.error(e,`Error parsing extraData: ${y}`)}},t.prepareSolutionForReturn=function(e,t,n){let r=t.solution.text.join(""),s=!1;void 0!==t.finishOffset&&(i.debug(e,`solution ${t.index}: early finish at offset ${t.finishOffset}`),r=r.substring(0,t.finishOffset),s=!0),i.info(e,`solution ${t.index} returned. finish reason: [${t.reason}] finishOffset: [${t.finishOffset}] completionId: [{${t.requestId.completionId}}] created: [{${t.requestId.created}}]`);const a={text:(c=t.solution).text.join(""),logprobs:{token_logprobs:c.logprobs.reduce(((e,t)=>e.concat(t)),[]),top_logprobs:c.top_logprobs.reduce(((e,t)=>e.concat(t)),[]),text_offset:c.text_offset.reduce(((e,t)=>e.concat(t)),[]),tokens:c.tokens.reduce(((e,t)=>e.concat(t)),[])}};var c;return(0,o.convertToAPIChoice)(e,r,a,t.index,t.requestId,s,n)}},3402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postInsertionTasks=t.postRejectionTasks=t.captureCode=void 0;const r=n(5135),o=n(1749),i=n(5798),s=n(7917),a=n(4090),c=n(9558),l=n(5489),u=n(819),d=new i.Logger(i.LogLevel.INFO,"post-insertion"),p=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}];async function h(e,t,n){const r=await e.get(u.TextDocumentManager).getTextDocument(t);if(!r)return d.info(e,`Could not get document for ${t.fsPath}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1,promptElementRanges:[]},capturedCode:"",terminationOffset:0};const o=r.getText(),i=o.substring(0,n),c=r.positionAt(n),l=await(0,a.extractPrompt)(e,r,c),p="prompt"===l.type?l.prompt:{prefix:i,suffix:"",isFimEnabled:!1,promptElementRanges:[]},h=o.substring(n),f=(0,s.contextIndentationFromText)(i,n,r.languageId),m=(0,s.indentationBlockFinished)(f,void 0),g=await m(h),_=Math.min(o.length,n+(g?2*g:500));return{prompt:p,capturedCode:o.substring(n,_),terminationOffset:null!=g?g:-1}}function f(e,t,n,r){const o=e.substring(Math.max(0,r-n),Math.min(e.length,r+t.length+n)),i=(0,c.lexEditDistance)(o,t),s=i.lexDistance/i.needleLexLength,{distance:a}=(0,c.editDistance)(o.substring(i.startOffset,i.endOffset),t);return{relativeLexEditDistance:s,charEditDistance:a,completionLexLength:i.needleLexLength,foundOffset:i.startOffset+Math.max(0,r-n),lexEditDistance:i.lexDistance,stillInCodeHeuristic:s<=.5?1:0}}t.captureCode=h,t.postRejectionTasks=function(e,t,n,i,s){s.forEach((({completionText:n,completionTelemetryData:r})=>{d.debug(e,`${t}.rejected choiceIndex: ${r.properties.choiceIndex}`),(0,o.telemetryRejected)(e,t,r)}));const a=new r.ChangeTracker(e,i,n);p.filter((e=>e.captureRejection)).map((r=>{a.push((async()=>{d.debug(e,`Original offset: ${n}, Tracked offset: ${a.offset}`);const{completionTelemetryData:o}=s[0],{prompt:c,capturedCode:u,terminationOffset:p}=await h(e,i,a.offset);let f;f=c.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(c.prefix),hypotheticalPromptSuffixJson:JSON.stringify(c.suffix)}:{hypotheticalPromptJson:JSON.stringify(c.prefix)};const m=o.extendedBy({...f,capturedCodeJson:JSON.stringify(u)},{timeout:r.seconds,insertionOffset:n,trackedOffset:a.offset,terminationOffsetInCapturedCode:p});d.debug(e,`${t}.capturedAfterRejected choiceIndex: ${o.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterRejected",m,!0)}),1e3*r.seconds)}))},t.postInsertionTasks=async function(e,t,n,i,s,a){d.debug(e,`${t}.accepted choiceIndex: ${a.properties.choiceIndex}`),(0,o.telemetryAccepted)(e,t,a);const c=new r.ChangeTracker(e,s,i),m=n.trim();p.map((n=>c.push((()=>async function(e,t,n,r,o,i,s,a){const c=await e.get(u.TextDocumentManager).getTextDocument(o);if(c){const u=c.getText();let p=f(u,n,50,a.offset);p.stillInCodeHeuristic||(p=f(u,n,1500,a.offset)),d.debug(e,`stillInCode: ${p.stillInCodeHeuristic?"Found":"Not found"}! Completion '${n}' in file ${o.fsPath}. lexEditDistance fraction was ${p.relativeLexEditDistance}. Char edit distance was ${p.charEditDistance}. Inserted at ${r}, tracked at ${a.offset}, found at ${p.foundOffset}. choiceIndex: ${s.properties.choiceIndex}`);const m=s.extendedBy({},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset}).extendedBy({},p);if((0,l.telemetry)(e,t+".stillInCode",m),i.captureCode){const{prompt:n,capturedCode:c,terminationOffset:u}=await h(e,o,a.offset);let p;p=n.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(n.prefix),hypotheticalPromptSuffixJson:JSON.stringify(n.suffix)}:{hypotheticalPromptJson:JSON.stringify(n.prefix)};const f=s.extendedBy({...p,capturedCodeJson:JSON.stringify(c)},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset,terminationOffsetInCapturedCode:u});d.debug(e,`${t}.capturedAfterAccepted choiceIndex: ${s.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterAccepted",f,!0)}}}(e,t,m,i,s,n,a,c)),1e3*n.seconds)))}},6635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpStatusReporter=t.StatusReporter=void 0;class n{}t.StatusReporter=n,t.NoOpStatusReporter=class extends n{setProgress(){}removeProgress(){}setWarning(){}setError(e){}forceNormal(){}}},7917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indentationBlockFinished=t.completionCutOrContinue=t.contextIndentationFromText=t.contextIndentation=t.getNodeStart=t.isBlockBodyFinishedWithPrefix=t.isBlockBodyFinished=t.isEmptyBlockStart=void 0;const r=n(2369),o=n(2273);t.isEmptyBlockStart=function(e,t){return o.isEmptyBlockStart(e.languageId,e.getText(),e.offsetAt(t))},t.isBlockBodyFinished=function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n)),c=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,a,i,c)},t.isBlockBodyFinishedWithPrefix=function(e,t,n,i,s){const a=e.get(r.LocationFactory),c=t.getText(a.range(a.position(0,0),n)),l=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,c+s,i,l+s.length)},t.getNodeStart=async function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n))+i,c=await o.getNodeStart(t.languageId,a,t.offsetAt(n));if(c)return t.positionAt(c)};const i=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map((e=>e+"\\b"))),s=new RegExp(`^(${i.join("|")})`);function a(e){return s.test(e.trimLeft().toLowerCase())}function c(e){const t=/^(\s*)([^]*)$/.exec(e);return t&&t[2]&&t[2].length>0?t[1].length:void 0}function l(e,t,n){const r=e.slice(0,t).split("\n"),o=e.slice(t).split("\n");function i(e,t,r){let o,i,s=t;for(;void 0===o&&s>=0&&s=0&&!e[s].trim().startsWith('"""');)s--;if(s>=0)for(o=void 0,s--;void 0===o&&s>=0;)o=c(e[s]),i=s,s--}}return[o,i]}const[s,a]=i(r,r.length-1,-1),l=(()=>{if(void 0!==s&&void 0!==a)for(let e=a-1;e>=0;e--){const t=c(r[e]);if(void 0!==t&&t{const r=u(n,e,t);return"continue"===r?void 0:r}}},4090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractPrompt=t.trimLastLine=t._contextTooShort=t.MIN_PROMPT_CHARS=void 0;const r=n(4617),o=n(9800),i=n(5225),s=n(6905),a=n(819),c=n(2273),l=n(3591);function u(e){const t=e.split("\n"),n=t[t.length-1],r=n.length-n.trimRight().length,o=e.slice(0,e.length-r),i=e.substr(o.length);return[n.length==r?o:e,i]}async function d(e,n,d,p,h,f){var m;const g=null!==(m=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,h.toString())))&&void 0!==m?m:"",_=await(0,o.suffixPercent)(e,g,f);if((_>0?n.length:d)20||s+i.getText().length>2e5)break;"file"==i.uri.scheme&&i.fileName!==t&&i.languageId===n&&(r.push({uri:i.uri.toString(),relativePath:await e.get(a.TextDocumentManager).getRelativePath(i),languageId:i.languageId,source:i.getText()}),s+=i.getText().length)}return r}(e,d.fsPath,p);const m={uri:d.toString(),source:t,offset:n,relativePath:u,languageId:p},g=null!==(h=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,d.toString())))&&void 0!==h?h:"";let _={maxPromptLength:2048-(0,o.getConfig)(e,o.ConfigKey.SolutionLength),neighboringTabs:await e.get(s.Features).neighboringTabsOption(g,p),suffixStartMode:await e.get(s.Features).suffixStartMode(g,p)};const y=await(0,o.suffixPercent)(e,g,p),v=await(0,o.suffixMatchThreshold)(e,g,p);y>0&&(_={..._,includeSiblingFunctions:r.SiblingOption.NoSiblings,suffixPercent:y,suffixMatchThreshold:v});const b=e.get(r.FileSystem);return await(0,c.getPrompt)(b,m,_,f)}(e,n,d,p,h,f),[E,C]=u(v),S=Date.now();return{type:"prompt",prompt:{prefix:E,suffix:b,isFimEnabled:_>0,promptElementRanges:T.ranges},trailingWs:C,promptChoices:w,computeTimeMs:S-y,promptBackground:x}}async function p(e,t,n){const r=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,t.getText(),t.offsetAt(n),r,t.uri,t.languageId)}t.MIN_PROMPT_CHARS=10,t._contextTooShort={type:"contextTooShort"},t.trimLastLine=u,t.extractPrompt=function(e,t,n){const r=e.get(a.TextDocumentManager).findNotebook(t);return void 0===r?p(e,t,n):async function(e,t,n,r){const o=n.getCells().find((e=>e.document.uri===t.uri));if(o){const i=n.getCells().filter((e=>e.index0?i.map((e=>e.document.getText())).join("\n\n")+"\n\n":"",c=s+t.getText(),l=s.length+t.offsetAt(r),u=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,c,l,u,t.uri,o.document.languageId)}return p(e,t,r)}(e,t,r,n)}},2273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsesWithoutError=t.getPrompt=t.getNodeStart=t.getFunctionPositions=t.getBlockCloseToken=t.isSupportedLanguageId=t.isBlockBodyFinished=t.isEmptyBlockStart=t.terminate=t.init=void 0;const r=n(4617);let o=null;const i=new Map;let s=0;t.init=function(t,u,d){if(!u){const t=n(3094);for(const n of[...a,...c])e.exports[n]=t[n];return}for(const n of a)e.exports[n]=l(t,d,n);e.exports.getPrompt=function(e,t){return function(n,...r){const a=s++;return new Promise(((n,s)=>{i.set(a,{resolve:n,reject:s}),t.debug(e,`Proxy getPrompt - ${a}`),null==o||o.postMessage({id:a,fn:"getPrompt",args:r})}))}}(t,d),o=r.createWorker(),i.clear(),s=0;const p=t.get(r.FileSystem);function h(e){d.error(t,e);for(const t of i.values())t.reject(e);i.clear()}o.on("message",(({id:e,err:n,res:r})=>{const o=i.get(e);d.debug(t,`Response ${e} - ${r}, ${n}`),o&&(i.delete(e),n?o.reject(n):o.resolve(r))})),o.on("error",h),o.on("exit",(e=>{0!==e&&h(new Error(`Worker thread exited with code ${e}.`))})),o.on("readFileReq",(e=>{d.debug(t,`READ_FILE_REQ - ${e}`),p.readFile(e).then((e=>{null==o||o.emit("readFileRes",e)})).catch(h)})),o.on("mtimeRes",(e=>{d.debug(t,`mTime_REQ - ${e}`),p.mtime(e).then((e=>{null==o||o.emit("mtimeRes",e)})).catch(h)}))},t.terminate=function(){o&&(o.removeAllListeners(),o.terminate(),o=null,i.clear())};const a=["getFunctionPositions","isEmptyBlockStart","isBlockBodyFinished","getNodeStart","parsesWithoutError"],c=["isSupportedLanguageId","getBlockCloseToken"];function l(e,t,n){return function(...r){const a=s++;return new Promise(((s,c)=>{i.set(a,{resolve:s,reject:c}),t.debug(e,`Proxy ${n}`),null==o||o.postMessage({id:a,fn:n,args:r})}))}}t.isEmptyBlockStart=r.isEmptyBlockStart,t.isBlockBodyFinished=r.isBlockBodyFinished,t.isSupportedLanguageId=r.isSupportedLanguageId,t.getBlockCloseToken=r.getBlockCloseToken,t.getFunctionPositions=r.getFunctionPositions,t.getNodeStart=r.getNodeStart,t.getPrompt=r.getPrompt,t.parsesWithoutError=r.parsesWithoutError},3591:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputationStatus=t.getRepoUrlFromConfigText=t.parseRepoUrl=t.extractRepoInfoInBackground=t.tryGetGitHubNWO=t.getDogFood=t.Dogfood=t.getUserKind=t.UserKind=void 0;const r=n(4617),o=n(6314),i=n(1017),s=n(140),a=n(5489);var c,l;function u(e){if(void 0!==e&&e!==f.PENDING)return"github.com"===e.hostname?e.owner+"/"+e.repo:void 0}!function(e){e.GITHUB="github",e.MICROSOFT="microsoft",e.UNKNOWN="unknown"}(c=t.UserKind||(t.UserKind={})),t.getUserKind=function(e){var t,n;return void 0===e.get(a.TelemetryReporters).token?c.UNKNOWN:(null===(n=null===(t=e.get(a.TelemetryReporters).token)||void 0===t?void 0:t.organization_list)||void 0===n?void 0:n.includes("a5db0bcaae94032fe715fb34a5e4bce2"))?c.MICROSOFT:c.UNKNOWN},function(e){e.GITHUB="github",e.MICROSOFT="microsoft",e.UNKNOWN=""}(l=t.Dogfood||(t.Dogfood={})),t.getDogFood=function(e){return void 0===e||e===f.PENDING?l.UNKNOWN:"github/github"===u(e)?l.GITHUB:"ssh.dev.azure.com"===e.hostname||"vs-ssh.visualstudio.com"===e.hostname||"dev.azure.com"===e.hostname||"domoreexp.visualstudio.com"===e.hostname||"office.visualstudio.com"===e.hostname?l.MICROSOFT:l.UNKNOWN},t.tryGetGitHubNWO=u,t.extractRepoInfoInBackground=function(e,t){if(!t)return;const n=(0,i.dirname)(t);return d(e,n)};const d=function(e,t){const n=new s.LRUCache(1e4),o=new Set;return(e,...t)=>{const s=JSON.stringify(t),a=n.get(s);if(a)return a.result;if(o.has(s))return f.PENDING;const c=async function(e,t){var n;const o=await async function(e,t){let n=t+"_add_to_make_longer";const o=e.get(r.FileSystem);for(;t.length>1&&t.length!0),(()=>!1)))return t;n=t,t=(0,i.dirname)(t)}}(e,t);if(!o)return;const s=e.get(r.FileSystem),a=(0,i.join)(o,".git","config"),c=(await s.readFile(a)).toString(),l=null!==(n=h(c))&&void 0!==n?n:"",u=p(l);return void 0===u?{baseFolder:o,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:o,url:l,...u}}(e,...t);return o.add(s),c.then((e=>{n.put(s,new m(e)),o.delete(s)})),f.PENDING}}();function p(e){let t={};try{if(t=o(e),""==t.host||""==t.owner||""==t.name||""==t.pathname)return}catch(e){return}return{hostname:t.host,owner:t.owner,repo:t.name,pathname:t.pathname}}function h(e){var t;const n=/^\s*\[\s*remote\s+"((\\\\|\\"|[^\\"])+)"/,r=/^\s*\[remote.([^"\s]+)/,o=/^\s*url\s*=\s*([^\s#;]+)/,i=/^\s*\[/;let s,a,c=!1;for(const l of e.split("\n"))if(c&&void 0!==s){if(s+=l,l.endsWith("\\"))s=s.substring(0,s.length-1);else if(c=!1,"origin"===a)return s}else{const e=null!==(t=l.match(n))&&void 0!==t?t:l.match(r);if(e)a=e[1];else if(l.match(i))a=void 0;else{if(s&&"origin"!==a)continue;{const e=l.match(o);if(e)if(s=e[1],s.endsWith("\\"))s=s.substring(0,s.length-1),c=!0;else if("origin"===a)return s}}}return s}var f;t.parseRepoUrl=p,t.getRepoUrlFromConfigText=h,function(e){e[e.PENDING=0]="PENDING"}(f=t.ComputationStatus||(t.ComputationStatus={}));class m{constructor(e){this.result=e}}},4604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRepetitive=void 0;const n=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function r(e){const t=function(e){const t=Array(e.length).fill(0);t[0]=-1;let n=-1;for(let r=1;r=0&&e[n+1]!==e[r];)n=t[n];e[n+1]===e[r]&&n++,t[r]=n}return t}(e);for(const r of n)if(!(e.lengthe.trim().length>0)))}},9558:(e,t)=>{"use strict";function n(e,t,n=((e,t)=>e===t?0:1)){if(0===t.length||0===e.length)return{distance:t.length,startOffset:0,endOffset:0};let r=new Array(t.length+1).fill(0),o=new Array(t.length+1).fill(0),i=new Array(e.length+1).fill(0),s=new Array(e.length+1).fill(0),a=t[0];for(let t=0;t0?t-1:0;for(let c=1;c0&&(yield n),n=o,r=e)}n.length>0&&(yield n)}function s(e,t,n,r){const o=[];let i=0;for(const s of n(e))r(s)&&(t.has(s)||t.set(s,t.size),o.push([t.get(s),i])),i+=s.length;return[o,t]}function a(e){return" "!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.lexEditDistance=t.lexicalAnalyzer=t.lexGeneratorWords=t.reverseLexDictionary=t.emptyLexDictionary=t.editDistance=void 0,t.editDistance=n,t.emptyLexDictionary=r,t.reverseLexDictionary=o,t.lexGeneratorWords=i,t.lexicalAnalyzer=s,t.lexEditDistance=function(e,t,c=i){const[l,u]=s(e,r(),c,a),[d,p]=s(t,u,c,a);if(0===d.length||0===l.length)return{lexDistance:d.length,startOffset:0,endOffset:0,haystackLexLength:l.length,needleLexLength:d.length};const h=o(p),f=d.length,m=h[d[0][0]],g=h[d[f-1][0]],_=n(l.map((e=>e[0])),d.map((e=>e[0])),(function(e,t,n,r){if(0===r||r===f-1){const e=h[l[n][0]];return 0==r&&e.endsWith(m)||r==f-1&&e.startsWith(g)?0:1}return e===t?0:1})),y=l[_.startOffset][1];let v=_.endOffset0&&" "===e[v-1]&&--v,{lexDistance:_.distance,startOffset:y,endOffset:v,haystackLexLength:l.length,needleLexLength:d.length}}},1523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextDisplayQuantiles=t.ghostTextDisplayLanguageParameters=t.ghostTextDisplayMeanAlternativeLogProbParameter=t.ghostTextDisplayMeanLogProbParameter=t.ghostTextDisplayLog1pcompCharLenParameter=t.ghostTextDisplayInterceptParameter=void 0,t.ghostTextDisplayInterceptParameter=2.98410452738298,t.ghostTextDisplayLog1pcompCharLenParameter=-.838732736843507,t.ghostTextDisplayMeanLogProbParameter=1.50314646255716,t.ghostTextDisplayMeanAlternativeLogProbParameter=-.237798634012662,t.ghostTextDisplayLanguageParameters={python:.314368072478742},t.ghostTextDisplayQuantiles={.01:.225800751784931,.02:.290204307767402,.03:.333153496466045,.05:.404516749849559,.1:.513216040545626,.2:.626904979128674,.3:.694880719658273,.4:.743100684947291,.5:.782524520571946,.6:.816856186092243,.7:.84922977716585,.8:.883694877241999,.9:.921859050950077,.95:.944571268106974,.99:.969535563141733}},1153:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextScoreQuantile=t.ghostTextScoreConfidence=void 0;const r=n(5798),o=n(1523),i=(new r.Logger(r.LogLevel.INFO,"restraint"),{link:e=>Math.exp(e)/(1+Math.exp(e)),unlink:e=>Math.log(e/(1-e))});class s{constructor(e,t,n){this.name=e,this.coefficient=t,this.transformation=n||(e=>e)}contribution(e){return this.coefficient*this.transformation(e)}}const a=new class{constructor(e,t,n){if(this.link=i,this.intercept=e,this.coefficients=t,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(const e in n)this.logitsToQuantiles.set(n[e],Number(e))}predict(e,t){let n=this.intercept;for(const e of this.coefficients){const r=t[e.name];if(void 0===r)return NaN;n+=e.contribution(r)}return this.link.link(n)}quantile(e,t){return function(e,t){const n=Math.min(...Array.from(t.keys()).filter((t=>t>=e))),r=Math.max(...Array.from(t.keys()).filter((t=>tMath.log(1+e))),new s("meanLogProb",o.ghostTextDisplayMeanLogProbParameter),new s("meanAlternativeLogProb",o.ghostTextDisplayMeanAlternativeLogProbParameter)].concat(Object.entries(o.ghostTextDisplayLanguageParameters).map((e=>new s(e[0],e[1])))),o.ghostTextDisplayQuantiles);t.ghostTextScoreConfidence=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.predict(e,n)},t.ghostTextScoreQuantile=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.quantile(e,n)}},3883:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkSuffix=t.postProcessChoice=void 0;const r=n(2273),o=n(5489),i=n(913),s=n(4604);t.postProcessChoice=async function(e,t,n,a,c,l,u){if((0,s.isRepetitive)(c.tokens)){const t=o.TelemetryData.createAndMarkAsIssued();return t.extendWithRequestId(c.requestId),(0,o.telemetry)(e,"repetition.detected",t,!0),void u.info(e,"Filtered out repetitive solution")}const d={...c};if(function(e,t,n){let r="",o=t.line+1;for(;""===r&&o1);return o}(e,n,a,d.completionText,l),d.completionText?d:void 0},t.checkSuffix=function(e,t,n){const r=e.lineAt(t.line).text.substring(t.character);if(r.length>0){if(-1!==n.completionText.indexOf(r))return!0;{let e=0;for(const t of r){const r=n.completionText.indexOf(t,e+1);if(!(r>e)){e=-1;break}e=r}return-1!==e}}return!1}},5489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forceSendingTelemetry=t.dropTelemetryConfig=t.setTelemetryConfig=t.logEnginePrompt=t.logEngineCompletion=t.telemetryError=t.telemetryException=t.telemetryRaw=t.telemetryExpProblem=t.telemetry=t.configureReporter=t.telemetryEndpointUrlOverride=t.noTelemetryEndpointUrlOverride=t.TelemetryEndpointUrlOverride=t.now=t.telemetrizePromptLength=t.TelemetryData=t.setupEmptyReporters=t.setupStandardReporters=t.TelemetryReporters=t.APP_INSIGHTS_KEY_SECURE=t.APP_INSIGHTS_KEY=void 0;const r=n(6236),o=n(9929),i=n(9800),s=n(6905),a=n(4914),c=n(913),l=n(9591);t.APP_INSIGHTS_KEY="7d7048df-6dd0-4048-bb23-b716c1461f8f",t.APP_INSIGHTS_KEY_SECURE="3fdd7f28-937a-48c8-9a21-ba337db23bd1";class u{constructor(e,t){this.reporter=e,this.reporterSecure=t}getReporter(e){return this.reporter}getSecureReporter(e){if(y())return this.reporterSecure;if((0,c.shouldFailForDebugPurposes)(e))throw new Error("Internal error: telemetry opt-out")}setReporter(e){this.reporter=e}setSecureReporter(e){this.reporterSecure=e}async deactivate(){let e=Promise.resolve();this.reporter&&(e=this.reporter.dispose(),this.reporter=void 0);let t=Promise.resolve();this.reporterSecure&&(t=this.reporterSecure.dispose(),this.reporterSecure=void 0),await Promise.all([e,t])}hackOptOutListener(){this.reporter.optOutListener={dispose(){}},this.reporterSecure.optOutListener={dispose(){}}}setToken(e){this.reporter&&this.configureToken(this.reporter,e),this.reporterSecure&&this.configureToken(this.reporterSecure,e)}configureToken(e,t){const n=e;n&&n.appInsightsClient&&(n.appInsightsClient.context.tags.github_telemetry_token=t.token)}}let d;function p(e,t,n,r){const i=new o.default(t,n,r);return _(e,i),i}t.TelemetryReporters=u,t.setupStandardReporters=function(e,n){const r=(0,i.getVersion)(e),o=p(e,n,r,t.APP_INSIGHTS_KEY),s=p(e,n,r,t.APP_INSIGHTS_KEY_SECURE),a=e.get(u);return a.setReporter(o),a.setSecureReporter(s),a},t.setupEmptyReporters=function(){return new u};class h{constructor(e,t,n){this.properties=e,this.measurements=t,this.issuedTime=n}static createAndMarkAsIssued(e,t){return new h(e||{},t||{},m())}extendedBy(e,t){const n={...this.properties,...e},r={...this.measurements,...t},o=new h(n,r,this.issuedTime);return o.displayedTime=this.displayedTime,o.filtersAndExp=this.filtersAndExp,o}markAsDisplayed(){void 0===this.displayedTime&&(this.displayedTime=m())}async extendWithExpTelemetry(e){this.filtersAndExp||await e.get(s.Features).addExpAndFilterToTelemetry(this),this.filtersAndExp.exp.addToTelemetry(this),this.filtersAndExp.filters.addToTelemetry(this)}extendWithEditorAgnosticFields(e){this.properties.editor_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorInfo(e)),this.properties.editor_plugin_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e));const t=e.get(i.VscInfo);this.properties.client_machineid=t.machineId,this.properties.client_sessionid=t.sessionId,this.properties.copilot_version=`copilot/${(0,i.getVersion)(e)}`,this.properties.common_extname=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).name,this.properties.common_extversion=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).version}extendWithConfigProperties(e){const t=(0,i.dumpConfig)(e);try{t["copilot.build"]=(0,i.getBuild)(e),t["copilot.buildType"]=(0,i.getBuildType)(e)}catch(e){}d&&(t["copilot.trackingId"]=d.trackingId),this.properties={...this.properties,...t}}extendWithRequestId(e){const t={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...t}}static maybeRemoveRepoInfoFromPropertiesHack(e,t){if(e)return t;const n={};for(const e in t)h.keysToRemoveFromStandardTelemetryHack.includes(e)||(n[e]=t[e]);return n}sanitizeKeys(){this.properties=h.sanitizeKeys(this.properties),this.measurements=h.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};const t={};for(const n in e)t[h.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_")]=e[n];return t}updateTimeSinceIssuedAndDisplayed(){const e=m()-this.issuedTime;if(this.measurements.timeSinceIssuedMs=e,void 0!==this.displayedTime){const e=m()-this.displayedTime;this.measurements.timeSinceDisplayedMs=e}}validateData(e,t){var n;let r;if(h.validateTelemetryProperties(this.properties)||(r={problem:"properties",error:JSON.stringify(h.validateTelemetryProperties.errors)}),!h.validateTelemetryMeasurements(this.measurements)){const e=JSON.stringify(h.validateTelemetryMeasurements.errors);void 0===r?r={problem:"measurements",error:e}:(r.problem="both",r.error+=`; ${e}`)}if(void 0===r)return!0;if((0,c.shouldFailForDebugPurposes)(e))throw new Error(`Invalid telemetry data: ${r.problem} ${r.error} properties=${JSON.stringify(this.properties)} measurements=${JSON.stringify(this.measurements)}`);return b(e,"invalidTelemetryData",h.createAndMarkAsIssued({properties:JSON.stringify(this.properties),measurements:JSON.stringify(this.measurements),problem:r.problem,validationError:r.error}),t),t&&b(e,"invalidTelemetryData_in_secure",h.createAndMarkAsIssued({problem:r.problem,requestId:null!==(n=this.properties.requestId)&&void 0!==n?n:"unknown"}),!1),!1}async makeReadyForSending(e,t,n){this.extendWithConfigProperties(e),this.extendWithEditorAgnosticFields(e),this.sanitizeKeys(),"IncludeExp"===n&&await this.extendWithExpTelemetry(e),this.updateTimeSinceIssuedAndDisplayed(),this.validateData(e,t)||(this.properties.telemetry_failed_validation="true")}}function f(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}function m(){return(new Date).getTime()}t.TelemetryData=h,h.ajv=new r.default({strictNumbers:!1}),h.validateTelemetryProperties=h.ajv.compile({type:"object",additionalProperties:{type:"string"},required:[]}),h.validateTelemetryMeasurements=h.ajv.compile({type:"object",properties:{meanLogProb:{type:"number",nullable:!0},meanAlternativeLogProb:{type:"number",nullable:!0}},additionalProperties:{type:"number"},required:[]}),h.keysExemptedFromSanitization=[a.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName,a.ExpServiceTelemetryNames.featuresTelemetryPropertyName],h.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo"],t.telemetrizePromptLength=function(e){return e.isFimEnabled?{promptPrefixCharLen:e.prefix.length,promptSuffixCharLen:e.suffix.length}:{promptCharLen:e.prefix.length}},t.now=m;class g{constructor(e){this.url=e}getUrl(){return this.url}}function _(e,t){const n=t;if(n.appInsightsClient){const t=n.appInsightsClient.commonProperties,r=h.sanitizeKeys(t);n.appInsightsClient.commonProperties=r,n.appInsightsClient.context.tags[n.appInsightsClient.context.keys.cloudRoleInstance]="REDACTED";const o=e.get(g).getUrl();void 0!==o&&(n.appInsightsClient.config.endpointUrl=o)}}function y(){var e;return null!==(e=null==d?void 0:d.optedIn)&&void 0!==e&&e}async function v(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),f(e,null!=r&&r,t,o)}async function b(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),function(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryErrorEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}(e,null!=r&&r,t,o)}t.TelemetryEndpointUrlOverride=g,t.noTelemetryEndpointUrlOverride=new g,t.telemetryEndpointUrlOverride=new g("https://copilot-telemetry.githubusercontent.com/telemetry"),t.configureReporter=_,t.telemetry=v,t.telemetryExpProblem=async function(e,t){const n=h.createAndMarkAsIssued(t,{});await n.makeReadyForSending(e,!1,"SkipExp"),f(e,!1,"expProblem",n)},t.telemetryRaw=async function(e,t,n,r){f(e,!1,t,{properties:n,measurements:r})},t.telemetryException=async function(e,t,n,r){const o=t instanceof Error?t:new Error("Non-error thrown: "+t),i=y(),s=h.createAndMarkAsIssued({origin:(0,l.redactPaths)(n),reason:i?"Exception logged to restricted telemetry":"Exception, not logged due to opt-out",...r});if(await s.makeReadyForSending(e,!1,"IncludeExp"),f(e,!1,"exception",s),!i)return;const a=h.createAndMarkAsIssued({origin:n,...r});await a.makeReadyForSending(e,!0,"IncludeExp"),function(e,t,n,r){const o=e.get(u).getSecureReporter(e);o&&o.sendTelemetryException(n,h.maybeRemoveRepoInfoFromPropertiesHack(true,r.properties),r.measurements)}(e,0,o,a)},t.telemetryError=b,t.logEngineCompletion=async function(e,t,n,r,o){var i;const s=h.createAndMarkAsIssued({completionTextJson:JSON.stringify(t),choiceIndex:o.toString()});for(const[e,t]of Object.entries(n.logprobs))s.properties["logprobs_"+e]=null!==(i=JSON.stringify(t))&&void 0!==i?i:"unset";s.extendWithRequestId(r),await v(e,"engine.completion",s,!0)},t.logEnginePrompt=async function(e,t,n){let r;r=t.isFimEnabled?{promptPrefixJson:JSON.stringify(t.prefix),promptSuffixJson:JSON.stringify(t.suffix),promptElementRanges:JSON.stringify(t.promptElementRanges)}:{promptJson:JSON.stringify(t.prefix),promptElementRanges:JSON.stringify(t.promptElementRanges)};const o=n.extendedBy(r);await v(e,"engine.prompt",o,!0)},t.setTelemetryConfig=function(e){d=e},t.dropTelemetryConfig=function(){d=void 0},t.forceSendingTelemetry=function(e,n){const r=n.getReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY),_(e,r)}try{const r=n.getSecureReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY_SECURE),_(e,r)}}catch(e){}}},4630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LibTestsEditorInfo=t.createLibTestingContext=t.setupTestingContext=t.setupTestingContextNoTelemetry=t.setupTestingContextNoTelemetryNoLog=t.setupTestingContextNoTelemetryNoLogNoNotifications=void 0;const r=n(4617),o=n(7147),i=n(2137),s=n(9800),a=n(5611),c=n(6905),l=n(6046),u=n(6817),d=n(4619),p=n(5798),h=n(39),f=n(9035),m=n(5489),g=n(2369),_=n(819),y=n(4567),v=n(913),b=n(6584),w=n(751);function x(e){e.set(s.BuildInfo,new s.BuildInfo),e.set(v.RuntimeMode,v.RuntimeMode.fromEnvironment(!0)),e.set(h.Fetcher,new h.HelixFetcher(e)),e.set(p.LogVerbose,new p.LogVerbose(!1)),e.set(i.Clock,new i.Clock),e.set(l.ExpConfigMaker,new l.ExpConfigNone),e.set(d.GhostTextDebounceManager,new d.GhostTextDebounceManager),e.set(u.ContextualFilterManager,new u.ContextualFilterManager)}function T(e){x(e),e.set(f.NotificationSender,new b.TestNotificationSender),e.set(y.UrlOpener,new b.TestUrlOpener)}function E(e){T(e),e.set(p.LogTarget,new p.ConsoleLog(console))}function C(e){E(e),e.set(m.TelemetryEndpointUrlOverride,m.noTelemetryEndpointUrlOverride),e.set(m.TelemetryReporters,(0,m.setupEmptyReporters)()),(0,m.setupStandardReporters)(e,"copilot-test"),e.set(c.Features,new c.Features(e))}t.setupTestingContextNoTelemetryNoLogNoNotifications=x,t.setupTestingContextNoTelemetryNoLog=T,t.setupTestingContextNoTelemetry=E,t.setupTestingContext=C,t.createLibTestingContext=function(){const e=new a.Context;return e.set(s.ConfigProvider,new s.DefaultsOnlyConfigProvider),C(e),e.set(s.EditorAndPluginInfo,new S),e.set(r.FileSystem,k),e.set(_.TextDocumentManager,new w.TestTextDocumentManager),e.set(g.LocationFactory,new w.TestLocationFactory),e};class S extends s.EditorAndPluginInfo{getEditorInfo(e){return{name:"lib-tests-editor",version:"1"}}getEditorPluginInfo(e){return{name:"lib-tests-plugin",version:"2"}}}t.LibTestsEditorInfo=S;const k={readFile:function(e){return o.promises.readFile(e)},mtime:async function(e){return(await o.promises.stat(e)).mtimeMs},stat:async function(e){const t=await o.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},5922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readTestingGitHubToken=t.makeTestingCopilotTokenManager=void 0;const r=n(7147),o=n(5765);function i(){const e=`${process.env.HOME}/.copilot-testing-gh-token`;if(r.existsSync(e))return r.readFileSync(e).toString();throw new Error(`Tests: either GH_COPILOT_TOKEN, or GITHUB_TOKEN, must be set, or there must be a GitHub token from an app with access to Copilot in ${e}. Run "npm run get_token" to get one.`)}t.makeTestingCopilotTokenManager=function(){if(process.env.GH_COPILOT_TOKEN)return new o.FixedCopilotTokenManager({token:process.env.GH_COPILOT_TOKEN,telemetry:"enabled"});if(process.env.GITHUB_TOKEN)return new o.CopilotTokenManagerFromGitHubToken({token:process.env.GITHUB_TOKEN});const e=i();return process.env.GITHUB_TOKEN=e,new o.CopilotTokenManagerFromGitHubToken({token:e})},t.readTestingGitHubToken=i},913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVerboseLoggingEnabled=t.isDebugEnabled=t.shouldFailForDebugPurposes=t.isRunningInTest=t.RuntimeMode=void 0;class n{constructor(e){this.flags=e}static fromEnvironment(e){return new n({debug:(t=process.argv,r=process.env,t.includes("--debug")||"true"===(null===(s=r.GITHUB_COPILOT_DEBUG)||void 0===s?void 0:s.toLowerCase())),verboseLogging:o(process.env),testMode:e,recordInput:i(process.argv,process.env)});var t,r,s}}function r(e){return e.get(n).flags.testMode}function o(e){if("COPILOT_AGENT_VERBOSE"in e){const t=e.COPILOT_AGENT_VERBOSE;return"1"===t||"true"===t}return!1}function i(e,t){var n;return e.includes("--record")||"true"===(null===(n=t.GITHUB_COPILOT_RECORD)||void 0===n?void 0:n.toLowerCase())}t.RuntimeMode=n,t.isRunningInTest=r,t.shouldFailForDebugPurposes=function(e){return r(e)},t.isDebugEnabled=function(e){return e.get(n).flags.debug},t.isVerboseLoggingEnabled=function(e){return e.get(n).flags.verboseLogging}},6584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestNotificationSender=t.TestUrlOpener=t.rangeToString=t.positionToString=void 0;const r=n(9035);function o(e){return`${e.line}:${e.character}`}t.positionToString=o,t.rangeToString=function(e){return`[${o(e.start)}--${o(e.end)}]`},t.TestUrlOpener=class{constructor(){this.openedUrls=[]}open(e){this.openedUrls.push(e)}};class i extends r.NotificationSender{constructor(){super(),this.sentMessages=[]}showWarningMessage(e,...t){return this.sentMessages.push(e),t?Promise.resolve(t[0]):Promise.resolve(void 0)}}t.TestNotificationSender=i},751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestLocationFactory=t.TestTextDocumentManager=t.InMemoryTextDocument=void 0;const r=n(4086);t.InMemoryTextDocument=class{constructor(e,t,n,o,i){this._uri=e,this._textDocument=r.TextDocument.create(e.toString(),t,n,o),this._relativePath=i}get uri(){return this._uri}get relativePath(){return this._relativePath}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r={start:{line:t,character:0},end:{line:t,character:n.length}},o=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:o}}getWordRangeAtPosition(e){}update(e,t){r.TextDocument.update(this._textDocument,e,t)}},t.TestTextDocumentManager=class{constructor(){this.onDidChangeTextDocument=()=>({dispose:()=>{}}),this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.textDocuments=[]}async getTextDocument(e){}async getRelativePath(e){}findNotebook(e){}},t.TestLocationFactory=class{position(e,t){return{line:e,character:t}}range(e,t,n,r){return"number"==typeof e?{start:{line:e,character:t},end:{line:n,character:r}}:{start:e,end:t}}}},2369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocationFactory=void 0,t.LocationFactory=class{}},819:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocumentManager=t.getRelativePath=void 0;const r=n(1017);t.getRelativePath=function(e,t){for(const n of e){const e=n.fsPath;if(t.startsWith(e+r.sep))return r.relative(e,t)}},t.TextDocumentManager=class{}},4567:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealUrlOpener=t.UrlOpener=void 0;const r=n(1814);t.UrlOpener=class{},t.RealUrlOpener=class{async open(e){await r(e)}}},9591:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactPaths=void 0,t.redactPaths=function(e){return e.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}},5614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(7147);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},4990:(e,t)=>{"use strict";function n(e){return"virtual"===e.type}function r(e){return"top"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.duplicateTree=t.cutTreeAfterLine=t.isTop=t.isVirtual=t.isLine=t.isBlank=t.topNode=t.blankNode=t.lineNode=t.virtualNode=void 0,t.virtualNode=function(e,t,n){return{type:"virtual",indentation:e,subs:t,label:n}},t.lineNode=function(e,t,n,r,o){if(""===n)throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:e,lineNumber:t,sourceLine:n,subs:r,label:o}},t.blankNode=function(e){return{type:"blank",lineNumber:e,subs:[]}},t.topNode=function(e){return{type:"top",indentation:-1,subs:null!=e?e:[]}},t.isBlank=function(e){return"blank"===e.type},t.isLine=function(e){return"line"===e.type},t.isVirtual=n,t.isTop=r,t.cutTreeAfterLine=function(e,t){!function e(o){if(!n(o)&&!r(o)&&o.lineNumber===t)return o.subs=[],!0;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rebuildTree=t.foldTree=t.visitTreeConditionally=t.visitTree=t.resetLineNumbers=t.mapLabels=t.clearLabelsIf=t.clearLabels=void 0;const r=n(4990);function o(e,t,n){!function e(r){"topDown"===n&&t(r),r.subs.forEach((t=>{e(t)})),"bottomUp"===n&&t(r)}(e)}t.clearLabels=function(e){return o(e,(e=>{e.label=void 0}),"bottomUp"),e},t.clearLabelsIf=function(e,t){return o(e,(e=>{e.label=e.label?t(e.label)?void 0:e.label:void 0}),"bottomUp"),e},t.mapLabels=function e(t,n){switch(t.type){case"line":case"virtual":const r=t.subs.map((t=>e(t,n)));return{...t,subs:r,label:t.label?n(t.label):void 0};case"blank":return{...t,label:t.label?n(t.label):void 0};case"top":return{...t,subs:t.subs.map((t=>e(t,n))),label:t.label?n(t.label):void 0}}},t.resetLineNumbers=function(e){let t=0;o(e,(function(e){(0,r.isVirtual)(e)||(0,r.isTop)(e)||(e.lineNumber=t,t++)}),"topDown")},t.visitTree=o,t.visitTreeConditionally=function(e,t,n){!function e(r){if("topDown"===n&&!t(r))return!1;let o=!0;return r.subs.forEach((t=>{o=o&&e(t)})),"bottomUp"===n&&(o=o&&t(r)),o}(e)},t.foldTree=function(e,t,n,r){let i=t;return o(e,(function(e){i=n(e,i)}),r),i},t.rebuildTree=function(e,t,n){const o=e=>{if(void 0!==n&&n(e))return e;{const n=e.subs.map(o).filter((e=>void 0!==e));return e.subs=n,t(e)}},i=o(e);return void 0!==i?i:(0,r.topNode)()}},2563:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTree=t.registerLanguageSpecificParser=t.flattenVirtual=t.groupBlocks=t.combineClosersAndOpeners=t.buildLabelRules=t.labelVirtualInherited=t.labelLines=t.parseRaw=void 0;const r=n(4990),o=n(2890);function i(e){const t=e.split("\n"),n=t.map((e=>e.match(/^\s*/)[0].length)),o=t.map((e=>e.trimLeft()));function i(e){const[t,i]=s(e+1,n[e]);return[(0,r.lineNode)(n[e],e,o[e],t),i]}function s(e,t){let s;const a=[];let c,l=e;for(;lt);)if(""===o[l])void 0===c&&(c=l),l+=1;else{if(void 0!==c){for(let e=c;et.matches(e.sourceLine)));n&&(e.label=n.label)}}),"bottomUp")}function a(e){return Object.keys(e).map((t=>{let n;return n=e[t].test?n=>e[t].test(n):e[t],{matches:n,label:t}}))}function c(e){const t=(0,o.rebuildTree)(e,(function(e){if(0===e.subs.length||-1===e.subs.findIndex((e=>"closer"===e.label||"opener"===e.label)))return e;const t=[];let n;for(let o=0;os.subs.push(e))),i.subs=[];else if("closer"===i.label&&void 0!==n&&((0,r.isLine)(i)||(0,r.isVirtual)(i))&&i.indentation>=n.indentation){let e=t.length-1;for(;e>0&&(0,r.isBlank)(t[e]);)e-=1;if(n.subs.push(...t.splice(e+1)),i.subs.length>0){const e=n.subs.findIndex((e=>"newVirtual"!==e.label)),t=n.subs.slice(0,e),o=n.subs.slice(e),s=o.length>0?[(0,r.virtualNode)(i.indentation,o,"newVirtual")]:[];n.subs=[...t,...s,i]}else n.subs.push(i)}else t.push(i),(0,r.isBlank)(i)||(n=i)}return e.subs=t,e}));return(0,o.clearLabelsIf)(e,(e=>"newVirtual"===e)),t}t.parseRaw=i,t.labelLines=s,t.labelVirtualInherited=function(e){(0,o.visitTree)(e,(function(e){if((0,r.isVirtual)(e)&&void 0===e.label){const t=e.subs.filter((e=>!(0,r.isBlank)(e)));1===t.length&&(e.label=t[0].label)}}),"bottomUp")},t.buildLabelRules=a,t.combineClosersAndOpeners=c,t.groupBlocks=function(e,t=r.isBlank,n){return(0,o.rebuildTree)(e,(function(e){if(e.subs.length<=1)return e;const o=[];let i,s=[],a=!1;function c(e=!1){if(void 0!==i&&(o.length>0||!e)){const e=(0,r.virtualNode)(i,s,n);o.push(e)}else s.forEach((e=>o.push(e)))}for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowsDelineations=void 0;const r=n(2563),o=n(2890);t.getWindowsDelineations=function(e,t,n,i){if(e.length{if("blank"===e.type)return void(e.label={totalLength:1,firstLineAfter:e.lineNumber+1});let t="line"===e.type?1:0,r="line"===e.type?e.lineNumber+1:NaN;function o(n){return-1==n?r-t:e.subs[n].label.firstLineAfter-e.subs[n].label.totalLength}function a(t,n){return 0==t?n+1:e.subs[t-1].label.firstLineAfter}let c="line"===e.type?-1:0,l="line"===e.type?1:0,u=0;for(let d=0;d=0&&ci){const t=o(c),r=a(d,t),p=u==d?r:a(u,t);for(n<=r-t&&s.push([t,p]);l>i;)l-=-1==c?"line"==e.type?1:0:e.subs[c].label.totalLength,c++}}if(ce[0]-t[0]||e[1]-t[1])).filter(((e,t,n)=>0==t||e[0]!=n[t-1][0]||e[1]!=n[t-1][1]))}},3272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},haskell:{start:"--",end:""},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},ql:{start:"//",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},verilog:{start:"//",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(1017),o=n(2133);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===(0,r.extname)(o))o+=".ts";else if(".ts"!==(0,r.extname)(o))return null;return(0,r.join)((0,r.dirname)(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=(0,o.getFirstPrecedingComment)(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=(0,o.getFirstPrecedingComment)(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await(0,o.parseTree)(t,s);for(let e of(0,o.queryExports)(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await(0,o.parseTree)(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},2133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(1017),o=n(7908),i=n(7908);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=(0,r.resolve)(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},4343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(2133);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await(0,r.parseTree)(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!(0,r.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[(0,r.languageIdToWasmLanguage)(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!(0,r.isSupportedLanguageId)(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if((0,r.isSupportedLanguageId)(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if((0,r.isSupportedLanguageId)(e))return d(e).getNodeStart(t,n)}},8684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(5037),o=n(3272),i=n(1986),s=n(7289),a=n(1729),c=n(5037),l=n(7503),u=n(6885);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`)}}t.PromptOptions=x;const T={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function E(e){var t;return e=e.toLowerCase(),null!==(t=T[e])&&void 0!==t?t:e}function C(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=E,t.newLineEnded=C,t.getPrompt=async function(e,n,y={},w=[]){var T;const S=new x(e,y);let k=!1;const{source:P,offset:I}=n;if(I<0||I>P.length)throw new Error(`Offset ${I} is out of range.`);n.languageId=E(n.languageId);const R=new l.Priorities,O=R.justBelow(l.Priorities.TOP),A=S.pathMarker==h.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),N=S.languageMarker==p.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),D=S.includeSiblingFunctions==f.ContextOverSiblings?R.justBelow(O):R.justAbove(O),M=R.justBelow(O,D),L=R.justBelow(M),$=new l.PromptWishlist(S.lineEnding);let j,F;if(S.languageMarker!=p.NoMarker){const e=C((0,o.getLanguageMarker)(n));j=$.append(e,l.PromptElementKind.LanguageMarker,N)}if(S.pathMarker!=h.NoMarker){const e=C((0,o.getPathMarker)(n));F=$.append(e,l.PromptElementKind.PathMarker,A)}if(S.localImportContext!=_.NoContext)for(const e of await(0,i.extractLocalImportContext)(n,S.fs))$.append(C(e),l.PromptElementKind.ImportedFile,M);const q=S.neighboringTabs==m.None||0==w.length?[]:await(0,s.getNeighborSnippets)(n,w,S.neighboringTabs,S.neighboringTabsMinLength,S.neighboringTabsMaxLength);function B(){q.forEach((e=>$.append(e.snippet,l.PromptElementKind.SimilarFile,L,(0,c.tokenLength)(e.snippet),e.score)))}S.neighboringTabsPosition==g.TopOfText&&B();const U=[];let H;if(S.includeSiblingFunctions==f.NoSiblings)H=P.substring(0,I);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await(0,a.getSiblingFunctions)(n);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));let o=D;e.forEach((e=>{$.append(e,l.PromptElementKind.AfterCursor,o),o=R.justBelow(o)})),S.neighboringTabsPosition==g.AfterSiblings&&B(),H=r}if(S.neighboringTabsPosition==g.DirectlyAboveCursor){const e=H.lastIndexOf("\n")+1,t=H.substring(0,e),n=H.substring(e);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e))),B(),n.length>0&&(U.push($.append(n,l.PromptElementKind.AfterCursor,O)),U.length>1&&$.require(U[U.length-2],U[U.length-1]))}else $.appendLineForLine(H,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));if(p.Top==S.languageMarker&&U.length>0&&void 0!==j&&$.require(j,U[0]),h.Top==S.pathMarker&&U.length>0&&void 0!==F&&(j?$.require(F,j):$.require(F,U[0])),0==S.suffixPercent)return $.fulfill(S.maxPromptLength);{let e=n.offset;S.suffixStartMode!==b.Cursor&&S.suffixStartMode!==b.CursorTrimStart&&(e=await(0,a.getSiblingFunctionStart)(n));const o=S.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-S.suffixPercent)/100),s=$.fulfill(i);const l=o-s.prefixLength;let p=P.slice(e);S.suffixStartMode!=b.SiblingBlockTrimStart&&S.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=(0,r.takeFirstTokens)(p,l),f=(0,c.tokenLength)(h);f<=l-3&&(i=o-f,s=$.fulfill(i));const m=h.length,g=(0,c.tokenLength)(d);if(S.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(S.suffixMatchCriteria==v.Levenshtein){const e=null===(T=(0,u.findEditDistanceScore)(h,d))||void 0===T?void 0:T.score;m>0&&S.suffixMatchThreshold>0&&100*e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(8684),o=n(2133);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if((0,o.isSupportedLanguageId)(n)){const u=await(0,o.parseTree)(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=(0,o.getAncestorWithSiblingFunctions)(n,p);if(h){const u=(0,o.getFirstPrecedingComment)(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if((0,o.isFunctionDefinition)(n,i)){const n=(0,o.getFirstPrecedingComment)(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=(0,o.getAncestorWithSiblingFunctions)(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if((0,o.isFunctionDefinition)(n,e)){const n=(0,o.getFirstPrecedingComment)(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},1186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentationBasedJaccardMatcher=t.FixedWindowSizeJaccardMatcher=void 0;const r=n(4505),o=n(1864);class i extends o.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e({to:t=>new i(t,e)});class s extends o.WindowedMatcher{constructor(e,t,n){super(e),this.minLength=t,this.maxLength=n,this.languageId=e.languageId}id(){return`indent:${this.minLength}:${this.maxLength}:${this.languageId}`}getWindowsDelineations(e){return(0,r.getWindowsDelineations)(e,this.languageId,this.minLength,this.maxLength)}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.maxLength).join("\n")}similarityScore(e,t){return a(e,t)}}function a(e,t){const n=new Set;return e.forEach((e=>{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}t.IndentationBasedJaccardMatcher=s,s.FACTORY=(e,t)=>({to:n=>new s(n,e,t)})},7289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=t.neighborOptionToSelection=void 0;const r=n(3272),o=n(1186);function i(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.neighborOptionToSelection={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}},t.getNeighborSnippets=async function(e,n,s,a,c){const l=t.neighborOptionToSelection[s],u=function(e,n,r,i){const s={...t.neighborOptionToSelection[n]};return void 0!==r&&void 0!==i&&(s.matcherFactory=o.IndentationBasedJaccardMatcher.FACTORY(r,i)),s.matcherFactory.to(e)}(e,s,a,c);return n.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...u.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>l.threshold)).sort(((e,t)=>e.score-t.score)).slice(-l.numberOfNeighbors).map((t=>({score:t.score,snippet:i(t).map((t=>(0,r.comment)(t,e.languageId)+"\n")).join(""),startLine:t.startLine,endLine:t.endLine})))}},1864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},6885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(8684),o=n(5037);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=(0,o.tokenLength)(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=(0,o.tokenLength)(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{e.exports=n(1193)},1193:(e,t,n)=>{"use strict";n(1808);var r,o=n(4404),i=n(3685),s=n(5687),a=n(2361),c=(n(9491),n(3837));function l(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||i.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,n,r,o){for(var i=d(n,r,o),s=0,a=t.requests.length;s=this.maxSockets?o.requests.push(i):o.createSocket(i,(function(t){function n(){o.emit("free",t,i)}function r(e){o.removeSocket(t),t.removeListener("free",n),t.removeListener("close",r),t.removeListener("agentRemove",r)}t.on("free",n),t.on("close",r),t.on("agentRemove",r),e.onSocket(t)}))},l.prototype.createSocket=function(e,t){var n=this,o={};n.sockets.push(o);var i=p({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),r("making CONNECT request");var s=n.request(i);function a(i,a,c){var l;return s.removeAllListeners(),a.removeAllListeners(),200!==i.statusCode?(r("tunneling socket could not be established, statusCode=%d",i.statusCode),a.destroy(),(l=new Error("tunneling socket could not be established, statusCode="+i.statusCode)).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):c.length>0?(r("got illegal response body from proxy"),a.destroy(),(l=new Error("got illegal response body from proxy")).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):(r("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=a,t(a))}s.useChunkedEncodingByDefault=!1,s.once("response",(function(e){e.upgrade=!0})),s.once("upgrade",(function(e,t,n){process.nextTick((function(){a(e,t,n)}))})),s.once("connect",a),s.once("error",(function(t){s.removeAllListeners(),r("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, cause="+t.message);i.code="ECONNRESET",e.request.emit("error",i),n.removeSocket(o)})),s.end()},l.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var n=this.requests.shift();n&&this.createSocket(n,(function(e){n.request.onSocket(e)}))}},r=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},t.debug=r},2371:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),n=0;n1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,o=1;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function _(e){throw new RangeError(f[e])}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(h,".")).split("."),t).join(".")}function v(e){for(var t=[],n=0,r=e.length;n=55296&&o<=56319&&n>1,e+=m(e/t);e>455;r+=u)e=m(e/35);return m(r+36*e/(e+38))},x=function(e){var t,n=[],r=e.length,o=0,i=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c=128&&_("not-basic"),n.push(e.charCodeAt(c));for(var d=a>0?a+1:0;d=r&&_("invalid-input");var g=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(g>=u||g>m((l-o)/h))&&_("overflow"),o+=g*h;var y=f<=s?1:f>=s+26?26:f-s;if(gm(l/v)&&_("overflow"),h*=v}var b=n.length+1;s=w(o-p,b,0==p),m(o/b)>l-i&&_("overflow"),i+=m(o/b),o%=b,n.splice(o++,0,i)}return String.fromCodePoint.apply(String,n)},T=function(e){var t=[],n=(e=v(e)).length,r=128,o=0,i=72,s=!0,a=!1,c=void 0;try{for(var d,p=e[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;h<128&&t.push(g(h))}}catch(e){a=!0,c=e}finally{try{!s&&p.return&&p.return()}finally{if(a)throw c}}var f=t.length,y=f;for(f&&t.push("-");y=r&&Pm((l-o)/I)&&_("overflow"),o+=(x-r)*I,r=x;var R=!0,O=!1,A=void 0;try{for(var N,D=e[Symbol.iterator]();!(R=(N=D.next()).done);R=!0){var M=N.value;if(Ml&&_("overflow"),M==r){for(var L=o,$=u;;$+=u){var j=$<=i?1:$>=i+26?26:$-i;if(L>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function P(e){for(var t="",n=0,r=e.length;n=194&&o<224){if(r-n>=6){var i=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&o)<<6|63&i)}else t+=e.substr(n,6);n+=6}else if(o>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function I(e,t){function n(e){var n=P(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,k).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,k).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,k).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,k).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,k).replace(t.PCT_ENCODED,o)),e}function R(e){return e.replace(/^0*(.*)/,"$1")||"0"}function O(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=c(n,2)[1];return r?r.split(".").map(R).join("."):e}function A(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=c(n,3),o=r[1],i=r[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),a=c(s,2),l=a[0],u=a[1],d=u?u.split(":").map(R):[],p=l.split(":").map(R),h=t.IPV4ADDRESS.test(p[p.length-1]),f=h?7:8,m=p.length-f,g=Array(f),_=0;_1){var b=g.slice(0,y.index),w=g.slice(y.index+y.length);v=b.join(":")+"::"+w.join(":")}else v=g.join(":");return i&&(v+="%"+i),v}return e}var N=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,D=void 0==="".match(/(){0}/)[1];function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(N);if(o){D?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||void 0,n.userinfo=-1!==e.indexOf("@")?o[3]:void 0,n.host=-1!==e.indexOf("//")?o[4]:void 0,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:void 0,n.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),n.host&&(n.host=A(O(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var i=S[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)I(n,r);else{if(n.host&&(t.domainHost||i&&i.domainHost))try{n.host=E(n.host.replace(r.PCT_ENCODED,P).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}I(n,s)}i&&i.parse&&i.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function L(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(A(O(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}var $=/^\.\.?\//,j=/^\/\.(\/|$)/,F=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function B(e){for(var t=[];e.length;)if(e.match($))e=e.replace($,"");else if(e.match(j))e=e.replace(j,"/");else if(e.match(F))e=e.replace(F,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(q);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],o=S[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?C(e.host):E(e.host.replace(n.PCT_ENCODED,P).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}I(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var i=L(e,t);if(void 0!==i&&("suffix"!==t.reference&&r.push("//"),r.push(i),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||o&&o.absolutePath||(c=B(c)),void 0===i&&(c=c.replace(/^\/\//,"/%2F")),r.push(c)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=M(U(e,n),n),t=M(U(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=B(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=B(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function W(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,P)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},K={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function V(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var G={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=V(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(V(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=c(n,2),o=r[0],i=r[1];e.path=o&&"/"!==o?o:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:G.domainHost,parse:G.parse,serialize:G.serialize},X={},Q="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",Z=n(n("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+n("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Q,"g"),ne=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),oe=new RegExp(t("[^]",Q,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=oe;function se(e){var t=P(e);return t.match(te)?t:e}var ae={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var o=!1,i={},s=n.query.split("&"),a=0,c=s.length;a{"use strict";n.r(t),n.d(t,{NIL:()=>x,parse:()=>_,stringify:()=>d,v1:()=>g,v3:()=>v,v4:()=>b,v5:()=>w,validate:()=>l,version:()=>T});var r=n(6113),o=n.n(r);const i=new Uint8Array(256);let s=i.length;function a(){return s>i.length-16&&(o().randomFillSync(i),s=0),i.slice(s,s+=16)}const c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&c.test(e)},u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).substr(1));const d=function(e,t=0){const n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};let p,h,f=0,m=0;const g=function(e,t,n){let r=t&&n||0;const o=t||new Array(16);let i=(e=e||{}).node||p,s=void 0!==e.clockseq?e.clockseq:h;if(null==i||null==s){const t=e.random||(e.rng||a)();null==i&&(i=p=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=h=16383&(t[6]<<8|t[7]))}let c=void 0!==e.msecs?e.msecs:Date.now(),l=void 0!==e.nsecs?e.nsecs:m+1;const u=c-f+(l-m)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||c>f)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=c,m=l,h=s,c+=122192928e5;const g=(1e4*(268435455&c)+l)%4294967296;o[r++]=g>>>24&255,o[r++]=g>>>16&255,o[r++]=g>>>8&255,o[r++]=255&g;const _=c/4294967296*1e4&268435455;o[r++]=_>>>8&255,o[r++]=255&_,o[r++]=_>>>24&15|16,o[r++]=_>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(let e=0;e<6;++e)o[r+e]=i[e];return t||d(o)},_=function(e){if(!l(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function y(e,t,n){function r(e,r,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=!0;var r=n(7147),o=n(2037),i=n(1017),s=n(8212),a=n(8144),c=function(){function e(e,t,n,o){var a=this;this.extensionId=e,this.extensionVersion=t,this.firstParty=!1,this.userOptIn=!1,this.firstParty=!!o;var c=process.env.VSCODE_LOGS||"";c&&e&&"trace"===process.env.VSCODE_LOG_LEVEL&&(c=i.join(c,e+".txt"),this.logStream=r.createWriteStream(c,{flags:"a",encoding:"utf8",autoClose:!0})),this.updateUserOptIn(n),void 0!==s.env.onDidChangeTelemetryEnabled?this.optOutListener=s.env.onDidChangeTelemetryEnabled((function(){return a.updateUserOptIn(n)})):this.optOutListener=s.workspace.onDidChangeConfiguration((function(){return a.updateUserOptIn(n)}))}return e.prototype.updateUserOptIn=function(t){var n=s.workspace.getConfiguration(e.TELEMETRY_CONFIG_ID),r=void 0===s.env.isTelemetryEnabled?n.get(e.TELEMETRY_CONFIG_ENABLED_ID,!0):s.env.isTelemetryEnabled;this.userOptIn!==r&&(this.userOptIn=r,this.userOptIn?this.createAppInsightsClient(t):this.dispose())},e.prototype.createAppInsightsClient=function(e){a.defaultClient?(this.appInsightsClient=new a.TelemetryClient(e),this.appInsightsClient.channel.setUseDiskRetryCaching(!0)):(a.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0).start(),this.appInsightsClient=a.defaultClient),this.appInsightsClient.commonProperties=this.getCommonProperties(),s&&s.env&&(this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.userId]=s.env.machineId,this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.sessionId]=s.env.sessionId),e&&0===e.indexOf("AIF-")&&(this.appInsightsClient.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1",this.firstParty=!0)},e.prototype.getCommonProperties=function(){var e=Object.create(null);if(e["common.os"]=o.platform(),e["common.platformversion"]=(o.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),e["common.extname"]=this.extensionId,e["common.extversion"]=this.extensionVersion,s&&s.env){switch(e["common.vscodemachineid"]=s.env.machineId,e["common.vscodesessionid"]=s.env.sessionId,e["common.vscodeversion"]=s.version,e["common.isnewappinstall"]=s.env.isNewAppInstall,s.env.uiKind){case s.UIKind.Web:e["common.uikind"]="web";break;case s.UIKind.Desktop:e["common.uikind"]="desktop";break;default:e["common.uikind"]="unknown"}e["common.remotename"]=this.cleanRemoteName(s.env.remoteName)}return e},e.prototype.cleanRemoteName=function(e){if(!e)return"none";var t="other";return["ssh-remote","dev-container","attached-container","wsl"].forEach((function(n){0===e.indexOf(n+"+")&&(t=n)})),t},e.prototype.shouldSendErrorTelemetry=function(){return!this.firstParty||"other"!==this.cleanRemoteName(s.env.remoteName)||void 0!==this.extension&&this.extension.extensionKind!==s.ExtensionKind.Workspace&&s.env.uiKind!==s.UIKind.Web},Object.defineProperty(e.prototype,"extension",{get:function(){return void 0===this._extension&&(this._extension=s.extensions.getExtension(this.extensionId)),this._extension},enumerable:!1,configurable:!0}),e.prototype.cloneAndChange=function(e,t){if(null===e||"object"!=typeof e)return e;if("function"!=typeof t)return e;var n={};for(var r in e)n[r]=t(r,e[r]);return n},e.prototype.anonymizeFilePaths=function(e,t){if(null==e)return"";var n=[new RegExp(s.env.appRoot.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi")];this.extension&&n.push(new RegExp(this.extension.extensionPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"));var r=e;if(t){for(var o=[],i=0,a=n;i=r}))&&(r+=e.substring(p,t.index)+"",p=d.lastIndex)};"break"!==h(););p{"use strict";var r;n.r(t),n.d(t,{URI:()=>o,Utils:()=>i}),r=(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",o=0):o=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",o=0,i=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s;i>=0?s=arguments[i]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,o=47===s.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;ol){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>l&&(47===e.charCodeAt(o+d)?u=d:0===d&&(u=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(u=d)}var h="";for(d=o+u+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,i=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(l===n.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){o=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!i){r=a+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),i=47===o;i?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==d&&(d=1):-1!==s&&(d=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===d||1===d&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},447:(e,t,n)=>{var r;if(n.r(t),n.d(t,{URI:()=>f,Utils:()=>C}),"object"==typeof process)r="win32"===process.platform;else if("object"==typeof navigator){var o=navigator.userAgent;r=o.indexOf("Windows")>=0}var i,s,a=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=/^\w[\w\d+.-]*$/,l=/^\//,u=/^\/\//,d="",p="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function e(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||d,this.authority=e.authority||d,this.path=e.path||d,this.query=e.query||d,this.fragment=e.fragment||d):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||d,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==p&&(t=p+t):t=p}return t}(this.scheme,n||d),this.query=r||d,this.fragment=o||d,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!c.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!l.test(e.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(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,i))}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString},Object.defineProperty(e.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,o=e.query,i=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=d),void 0===n?n=this.authority:null===n&&(n=d),void 0===r?r=this.path:null===r&&(r=d),void 0===o?o=this.query:null===o&&(o=d),void 0===i?i=this.fragment:null===i&&(i=d),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new g(t,n,r,o,i)},e.parse=function(e,t){void 0===t&&(t=!1);var n=h.exec(e);return n?new g(n[2]||d,E(n[4]||d),E(n[5]||d),E(n[7]||d),E(n[9]||d),t):new g(d,d,d,d,d)},e.file=function(e){var t=d;if(r&&(e=e.replace(/\\/g,p)),e[0]===p&&e[1]===p){var n=e.indexOf(p,2);-1===n?(t=e.substring(2),e=p):(t=e.substring(2,n),e=e.substring(n)||p)}return new g("file",t,e,d,d)},e.from=function(e){return new g(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new g(t);return n._formatted=t.external,n._fsPath=t._sep===m?t.fsPath:null,n}return t},e}(),m=r?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return a(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),_=((s={})[58]="%3A",s[47]="%2F",s[63]="%3F",s[35]="%23",s[91]="%5B",s[93]="%5D",s[64]="%40",s[33]="%21",s[36]="%24",s[38]="%26",s[39]="%27",s[40]="%28",s[41]="%29",s[42]="%2A",s[43]="%2B",s[44]="%2C",s[59]="%3B",s[61]="%3D",s[32]="%20",s);function y(e,t){for(var n=void 0,r=-1,o=0;o=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||45===i||46===i||95===i||126===i||t&&47===i)-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=_[i];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),n+=s):-1===r&&(r=o)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function v(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,r&&(n=n.replace(/\//g,"\\")),n}function w(e,t){var n=t?v:y,r="",o=e.scheme,i=e.authority,s=e.path,a=e.query,c=e.fragment;if(o&&(r+=o,r+=":"),(i||"file"===o)&&(r+=p,r+=p),i){var l=i.indexOf("@");if(-1!==l){var u=i.substr(0,l);i=i.substr(l+1),-1===(l=u.indexOf(":"))?r+=n(u,!1):(r+=n(u.substr(0,l),!1),r+=":",r+=n(u.substr(l+1),!1)),r+="@"}-1===(l=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,l),!1),r+=i.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(d=s.charCodeAt(1))>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var d;(d=s.charCodeAt(0))>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function x(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+x(e.substr(3)):e}}var T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(T)?e.replace(T,(function(e){return x(e)})):e}var C,S=n(470),k=function(){for(var e=0,t=0,n=arguments.length;t{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(447)})();const{URI:o,Utils:i}=r},7908:(e,t,n)=>{var r,o=void 0!==o?o:{};void 0===(r=function(){var t,r={};for(t in o)o.hasOwnProperty(t)&&(r[t]=o[t]);var i,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,i="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!i&&!d;var p,h,f,m,g,_="";i?(_=d?n(1017).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(7147)),g||(g=n(1017)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=o,l=function(e){process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),o.print||console.log.bind(console);var y=o.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(o[t]=r[t]);r=null,o.arguments&&(a=o.arguments),o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":L[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[e>>2]=pe[0],L[e+4>>2]=pe[1];break;case"float":$[e>>2]=t;break;case"double":j[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return L[e>>2];case"float":return $[e>>2];case"double":return j[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,L,$,j,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function U(e,t){return e?B(D,e,t):""}function H(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return H(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return H(e,N,n,t),n}function V(e){A=e,o.HEAP8=N=new Int8Array(e),o.HEAP16=M=new Int16Array(e),o.HEAP32=L=new Int32Array(e),o.HEAPU8=D=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=new Uint32Array(e),o.HEAPF32=$=new Float32Array(e),o.HEAPF64=j=new Float64Array(e)}var G=o.INITIAL_MEMORY||33554432;(S=o.wasmMemory?o.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,o.monitorRunDependencies&&o.monitorRunDependencies(te)}function ie(e){if(te--,o.monitorRunDependencies&&o.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw o.onAbort&&o.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}o.preloadedImages={},o.preloadedAudios={},o.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=o.locateFile?o.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(o)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}function we(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function xe(e,t){for(var n in e)if(e.hasOwnProperty(n)){Be.hasOwnProperty(n)||(Be[n]=e[n]);var r=we(n);o.hasOwnProperty(r)||(o[r]=e[n])}}var Te={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function Ee(e,t,n){return e.includes("j")?function(e,t,n){var r=o["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Ce=5250816;function Se(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function ke(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Se(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Pe(e,t){var n,r;return t&&(n=Be["orig$"+e]),n||(n=Be[e]),n||(n=o[we(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return Ee(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Ie(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return Ue(e);var t=Ce,n=t+e+15&-16;return Ce=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return L[t>>2]=n/1e3|0,L[t+4>>2]=n%1e3*1e3*1e3|0,0}function $e(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function je(e){Qe(e)}function Fe(e){E(e)}Le.sig="iii",je.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Ce,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:Le,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),$e(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:je,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=U(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},Ue=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=ke(n,1024),o.asm=n;var r,i=ye(t);i.neededDynlibs&&(C=i.neededDynlibs.concat(C)),xe(n),r=o.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.__wasm_call_ctors).apply(null,arguments)},o._malloc=function(){return(Ue=o._malloc=o.asm.malloc).apply(null,arguments)}),He=(o._ts_language_symbol_count=function(){return(o._ts_language_symbol_count=o.asm.ts_language_symbol_count).apply(null,arguments)},o._ts_language_version=function(){return(o._ts_language_version=o.asm.ts_language_version).apply(null,arguments)},o._ts_language_field_count=function(){return(o._ts_language_field_count=o.asm.ts_language_field_count).apply(null,arguments)},o._ts_language_symbol_name=function(){return(o._ts_language_symbol_name=o.asm.ts_language_symbol_name).apply(null,arguments)},o._ts_language_symbol_for_name=function(){return(o._ts_language_symbol_for_name=o.asm.ts_language_symbol_for_name).apply(null,arguments)},o._ts_language_symbol_type=function(){return(o._ts_language_symbol_type=o.asm.ts_language_symbol_type).apply(null,arguments)},o._ts_language_field_name_for_id=function(){return(o._ts_language_field_name_for_id=o.asm.ts_language_field_name_for_id).apply(null,arguments)},o._memcpy=function(){return(o._memcpy=o.asm.memcpy).apply(null,arguments)},o._free=function(){return(o._free=o.asm.free).apply(null,arguments)},o._calloc=function(){return(o._calloc=o.asm.calloc).apply(null,arguments)},o._ts_parser_delete=function(){return(o._ts_parser_delete=o.asm.ts_parser_delete).apply(null,arguments)},o._ts_parser_reset=function(){return(o._ts_parser_reset=o.asm.ts_parser_reset).apply(null,arguments)},o._ts_parser_set_language=function(){return(o._ts_parser_set_language=o.asm.ts_parser_set_language).apply(null,arguments)},o._ts_parser_timeout_micros=function(){return(o._ts_parser_timeout_micros=o.asm.ts_parser_timeout_micros).apply(null,arguments)},o._ts_parser_set_timeout_micros=function(){return(o._ts_parser_set_timeout_micros=o.asm.ts_parser_set_timeout_micros).apply(null,arguments)},o._memcmp=function(){return(o._memcmp=o.asm.memcmp).apply(null,arguments)},o._ts_query_new=function(){return(o._ts_query_new=o.asm.ts_query_new).apply(null,arguments)},o._ts_query_delete=function(){return(o._ts_query_delete=o.asm.ts_query_delete).apply(null,arguments)},o._iswspace=function(){return(o._iswspace=o.asm.iswspace).apply(null,arguments)},o._iswalnum=function(){return(o._iswalnum=o.asm.iswalnum).apply(null,arguments)},o._ts_query_pattern_count=function(){return(o._ts_query_pattern_count=o.asm.ts_query_pattern_count).apply(null,arguments)},o._ts_query_capture_count=function(){return(o._ts_query_capture_count=o.asm.ts_query_capture_count).apply(null,arguments)},o._ts_query_string_count=function(){return(o._ts_query_string_count=o.asm.ts_query_string_count).apply(null,arguments)},o._ts_query_capture_name_for_id=function(){return(o._ts_query_capture_name_for_id=o.asm.ts_query_capture_name_for_id).apply(null,arguments)},o._ts_query_string_value_for_id=function(){return(o._ts_query_string_value_for_id=o.asm.ts_query_string_value_for_id).apply(null,arguments)},o._ts_query_predicates_for_pattern=function(){return(o._ts_query_predicates_for_pattern=o.asm.ts_query_predicates_for_pattern).apply(null,arguments)},o._ts_tree_copy=function(){return(o._ts_tree_copy=o.asm.ts_tree_copy).apply(null,arguments)},o._ts_tree_delete=function(){return(o._ts_tree_delete=o.asm.ts_tree_delete).apply(null,arguments)},o._ts_init=function(){return(o._ts_init=o.asm.ts_init).apply(null,arguments)},o._ts_parser_new_wasm=function(){return(o._ts_parser_new_wasm=o.asm.ts_parser_new_wasm).apply(null,arguments)},o._ts_parser_enable_logger_wasm=function(){return(o._ts_parser_enable_logger_wasm=o.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},o._ts_parser_parse_wasm=function(){return(o._ts_parser_parse_wasm=o.asm.ts_parser_parse_wasm).apply(null,arguments)},o._ts_language_type_is_named_wasm=function(){return(o._ts_language_type_is_named_wasm=o.asm.ts_language_type_is_named_wasm).apply(null,arguments)},o._ts_language_type_is_visible_wasm=function(){return(o._ts_language_type_is_visible_wasm=o.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},o._ts_tree_root_node_wasm=function(){return(o._ts_tree_root_node_wasm=o.asm.ts_tree_root_node_wasm).apply(null,arguments)},o._ts_tree_edit_wasm=function(){return(o._ts_tree_edit_wasm=o.asm.ts_tree_edit_wasm).apply(null,arguments)},o._ts_tree_get_changed_ranges_wasm=function(){return(o._ts_tree_get_changed_ranges_wasm=o.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},o._ts_tree_cursor_new_wasm=function(){return(o._ts_tree_cursor_new_wasm=o.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},o._ts_tree_cursor_delete_wasm=function(){return(o._ts_tree_cursor_delete_wasm=o.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},o._ts_tree_cursor_reset_wasm=function(){return(o._ts_tree_cursor_reset_wasm=o.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_first_child_wasm=function(){return(o._ts_tree_cursor_goto_first_child_wasm=o.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_next_sibling_wasm=function(){return(o._ts_tree_cursor_goto_next_sibling_wasm=o.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_parent_wasm=function(){return(o._ts_tree_cursor_goto_parent_wasm=o.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_type_id_wasm=function(){return(o._ts_tree_cursor_current_node_type_id_wasm=o.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_named_wasm=function(){return(o._ts_tree_cursor_current_node_is_named_wasm=o.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_missing_wasm=function(){return(o._ts_tree_cursor_current_node_is_missing_wasm=o.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_id_wasm=function(){return(o._ts_tree_cursor_current_node_id_wasm=o.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},o._ts_tree_cursor_start_position_wasm=function(){return(o._ts_tree_cursor_start_position_wasm=o.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},o._ts_tree_cursor_end_position_wasm=function(){return(o._ts_tree_cursor_end_position_wasm=o.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},o._ts_tree_cursor_start_index_wasm=function(){return(o._ts_tree_cursor_start_index_wasm=o.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},o._ts_tree_cursor_end_index_wasm=function(){return(o._ts_tree_cursor_end_index_wasm=o.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},o._ts_tree_cursor_current_field_id_wasm=function(){return(o._ts_tree_cursor_current_field_id_wasm=o.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_wasm=function(){return(o._ts_tree_cursor_current_node_wasm=o.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},o._ts_node_symbol_wasm=function(){return(o._ts_node_symbol_wasm=o.asm.ts_node_symbol_wasm).apply(null,arguments)},o._ts_node_child_count_wasm=function(){return(o._ts_node_child_count_wasm=o.asm.ts_node_child_count_wasm).apply(null,arguments)},o._ts_node_named_child_count_wasm=function(){return(o._ts_node_named_child_count_wasm=o.asm.ts_node_named_child_count_wasm).apply(null,arguments)},o._ts_node_child_wasm=function(){return(o._ts_node_child_wasm=o.asm.ts_node_child_wasm).apply(null,arguments)},o._ts_node_named_child_wasm=function(){return(o._ts_node_named_child_wasm=o.asm.ts_node_named_child_wasm).apply(null,arguments)},o._ts_node_child_by_field_id_wasm=function(){return(o._ts_node_child_by_field_id_wasm=o.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},o._ts_node_next_sibling_wasm=function(){return(o._ts_node_next_sibling_wasm=o.asm.ts_node_next_sibling_wasm).apply(null,arguments)},o._ts_node_prev_sibling_wasm=function(){return(o._ts_node_prev_sibling_wasm=o.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},o._ts_node_next_named_sibling_wasm=function(){return(o._ts_node_next_named_sibling_wasm=o.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},o._ts_node_prev_named_sibling_wasm=function(){return(o._ts_node_prev_named_sibling_wasm=o.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},o._ts_node_parent_wasm=function(){return(o._ts_node_parent_wasm=o.asm.ts_node_parent_wasm).apply(null,arguments)},o._ts_node_descendant_for_index_wasm=function(){return(o._ts_node_descendant_for_index_wasm=o.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_index_wasm=function(){return(o._ts_node_named_descendant_for_index_wasm=o.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_descendant_for_position_wasm=function(){return(o._ts_node_descendant_for_position_wasm=o.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_position_wasm=function(){return(o._ts_node_named_descendant_for_position_wasm=o.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_start_point_wasm=function(){return(o._ts_node_start_point_wasm=o.asm.ts_node_start_point_wasm).apply(null,arguments)},o._ts_node_end_point_wasm=function(){return(o._ts_node_end_point_wasm=o.asm.ts_node_end_point_wasm).apply(null,arguments)},o._ts_node_start_index_wasm=function(){return(o._ts_node_start_index_wasm=o.asm.ts_node_start_index_wasm).apply(null,arguments)},o._ts_node_end_index_wasm=function(){return(o._ts_node_end_index_wasm=o.asm.ts_node_end_index_wasm).apply(null,arguments)},o._ts_node_to_string_wasm=function(){return(o._ts_node_to_string_wasm=o.asm.ts_node_to_string_wasm).apply(null,arguments)},o._ts_node_children_wasm=function(){return(o._ts_node_children_wasm=o.asm.ts_node_children_wasm).apply(null,arguments)},o._ts_node_named_children_wasm=function(){return(o._ts_node_named_children_wasm=o.asm.ts_node_named_children_wasm).apply(null,arguments)},o._ts_node_descendants_of_type_wasm=function(){return(o._ts_node_descendants_of_type_wasm=o.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},o._ts_node_is_named_wasm=function(){return(o._ts_node_is_named_wasm=o.asm.ts_node_is_named_wasm).apply(null,arguments)},o._ts_node_has_changes_wasm=function(){return(o._ts_node_has_changes_wasm=o.asm.ts_node_has_changes_wasm).apply(null,arguments)},o._ts_node_has_error_wasm=function(){return(o._ts_node_has_error_wasm=o.asm.ts_node_has_error_wasm).apply(null,arguments)},o._ts_node_is_missing_wasm=function(){return(o._ts_node_is_missing_wasm=o.asm.ts_node_is_missing_wasm).apply(null,arguments)},o._ts_query_matches_wasm=function(){return(o._ts_query_matches_wasm=o.asm.ts_query_matches_wasm).apply(null,arguments)},o._ts_query_captures_wasm=function(){return(o._ts_query_captures_wasm=o.asm.ts_query_captures_wasm).apply(null,arguments)},o._iswdigit=function(){return(o._iswdigit=o.asm.iswdigit).apply(null,arguments)},o._iswalpha=function(){return(o._iswalpha=o.asm.iswalpha).apply(null,arguments)},o._iswlower=function(){return(o._iswlower=o.asm.iswlower).apply(null,arguments)},o._towupper=function(){return(o._towupper=o.asm.towupper).apply(null,arguments)},o.___errno_location=function(){return(He=o.___errno_location=o.asm.__errno_location).apply(null,arguments)}),We=(o._memchr=function(){return(o._memchr=o.asm.memchr).apply(null,arguments)},o._strlen=function(){return(o._strlen=o.asm.strlen).apply(null,arguments)},o.stackSave=function(){return(We=o.stackSave=o.asm.stackSave).apply(null,arguments)}),ze=o.stackRestore=function(){return(ze=o.stackRestore=o.asm.stackRestore).apply(null,arguments)},Ke=o.stackAlloc=function(){return(Ke=o.stackAlloc=o.asm.stackAlloc).apply(null,arguments)},Ve=o._setThrew=function(){return(Ve=o._setThrew=o.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=o.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},o.__Znwm=function(){return(o.__Znwm=o.asm._Znwm).apply(null,arguments)},o.__ZdlPv=function(){return(o.__ZdlPv=o.asm._ZdlPv).apply(null,arguments)},o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=o.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},o._orig$ts_parser_timeout_micros=function(){return(o._orig$ts_parser_timeout_micros=o.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},o._orig$ts_parser_set_timeout_micros=function(){return(o._orig$ts_parser_set_timeout_micros=o.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},o.allocate=function(e,t){var n;return n=t==F?Ke(e.length):Ue(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,o.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Ye&&function(e){var t=o._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));L[r>>2]=K(c);for(var i=1;i>2)+i]=K(e[i-1]);L[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(o.onExit&&o.onExit(e),R=!0),l(e,new Ge(e)))}if(o.run=Xe,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Ye=!0;o.noInitialRun&&(Ye=!1),Xe();const Ze=o,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{o.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(7147);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Ie;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{var r,o,i;r={271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(747);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},876:(e,t)=>{"use strict";function n(e){return"virtual"===e.type}function r(e){return"top"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.duplicateTree=t.cutTreeAfterLine=t.isTop=t.isVirtual=t.isLine=t.isBlank=t.topNode=t.blankNode=t.lineNode=t.virtualNode=void 0,t.virtualNode=function(e,t,n){return{type:"virtual",indentation:e,subs:t,label:n}},t.lineNode=function(e,t,n,r,o){if(""===n)throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:e,lineNumber:t,sourceLine:n,subs:r,label:o}},t.blankNode=function(e){return{type:"blank",lineNumber:e,subs:[]}},t.topNode=function(e){return{type:"top",indentation:-1,subs:null!=e?e:[]}},t.isBlank=function(e){return"blank"===e.type},t.isLine=function(e){return"line"===e.type},t.isVirtual=n,t.isTop=r,t.cutTreeAfterLine=function(e,t){!function e(o){if(!n(o)&&!r(o)&&o.lineNumber===t)return o.subs=[],!0;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rebuildTree=t.foldTree=t.visitTreeConditionally=t.visitTree=t.resetLineNumbers=t.mapLabels=t.clearLabelsIf=t.clearLabels=void 0;const r=n(876);function o(e,t,n){!function e(r){"topDown"===n&&t(r),r.subs.forEach((t=>{e(t)})),"bottomUp"===n&&t(r)}(e)}t.clearLabels=function(e){return o(e,(e=>{e.label=void 0}),"bottomUp"),e},t.clearLabelsIf=function(e,t){return o(e,(e=>{e.label=e.label?t(e.label)?void 0:e.label:void 0}),"bottomUp"),e},t.mapLabels=function e(t,n){switch(t.type){case"line":case"virtual":const r=t.subs.map((t=>e(t,n)));return{...t,subs:r,label:t.label?n(t.label):void 0};case"blank":return{...t,label:t.label?n(t.label):void 0};case"top":return{...t,subs:t.subs.map((t=>e(t,n))),label:t.label?n(t.label):void 0}}},t.resetLineNumbers=function(e){let t=0;o(e,(function(e){r.isVirtual(e)||r.isTop(e)||(e.lineNumber=t,t++)}),"topDown")},t.visitTree=o,t.visitTreeConditionally=function(e,t,n){!function e(r){if("topDown"===n&&!t(r))return!1;let o=!0;return r.subs.forEach((t=>{o=o&&e(t)})),"bottomUp"===n&&(o=o&&t(r)),o}(e)},t.foldTree=function(e,t,n,r){let i=t;return o(e,(function(e){i=n(e,i)}),r),i},t.rebuildTree=function(e,t,n){const o=e=>{if(void 0!==n&&n(e))return e;{const n=e.subs.map(o).filter((e=>void 0!==e));return e.subs=n,t(e)}},i=o(e);return void 0!==i?i:r.topNode()}},469:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTree=t.registerLanguageSpecificParser=t.flattenVirtual=t.groupBlocks=t.combineClosersAndOpeners=t.buildLabelRules=t.labelVirtualInherited=t.labelLines=t.parseRaw=void 0;const r=n(876),o=n(617);function i(e){const t=e.split("\n"),n=t.map((e=>e.match(/^\s*/)[0].length)),o=t.map((e=>e.trimLeft()));function i(e){const[t,i]=s(e+1,n[e]);return[r.lineNode(n[e],e,o[e],t),i]}function s(e,t){let s;const a=[];let c,l=e;for(;lt);)if(""===o[l])void 0===c&&(c=l),l+=1;else{if(void 0!==c){for(let e=c;et.matches(e.sourceLine)));n&&(e.label=n.label)}}),"bottomUp")}function a(e){return Object.keys(e).map((t=>{let n;return n=e[t].test?n=>e[t].test(n):e[t],{matches:n,label:t}}))}function c(e){const t=o.rebuildTree(e,(function(e){if(0===e.subs.length||-1===e.subs.findIndex((e=>"closer"===e.label||"opener"===e.label)))return e;const t=[];let n;for(let o=0;os.subs.push(e))),i.subs=[];else if("closer"===i.label&&void 0!==n&&(r.isLine(i)||r.isVirtual(i))&&i.indentation>=n.indentation){let e=t.length-1;for(;e>0&&r.isBlank(t[e]);)e-=1;if(n.subs.push(...t.splice(e+1)),i.subs.length>0){const e=n.subs.findIndex((e=>"newVirtual"!==e.label)),t=n.subs.slice(0,e),o=n.subs.slice(e),s=o.length>0?[r.virtualNode(i.indentation,o,"newVirtual")]:[];n.subs=[...t,...s,i]}else n.subs.push(i)}else t.push(i),r.isBlank(i)||(n=i)}return e.subs=t,e}));return o.clearLabelsIf(e,(e=>"newVirtual"===e)),t}t.parseRaw=i,t.labelLines=s,t.labelVirtualInherited=function(e){o.visitTree(e,(function(e){if(r.isVirtual(e)&&void 0===e.label){const t=e.subs.filter((e=>!r.isBlank(e)));1===t.length&&(e.label=t[0].label)}}),"bottomUp")},t.buildLabelRules=a,t.combineClosersAndOpeners=c,t.groupBlocks=function(e,t=r.isBlank,n){return o.rebuildTree(e,(function(e){if(e.subs.length<=1)return e;const o=[];let i,s=[],a=!1;function c(e=!1){if(void 0!==i&&(o.length>0||!e)){const e=r.virtualNode(i,s,n);o.push(e)}else s.forEach((e=>o.push(e)))}for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowsDelineations=void 0;const r=n(469),o=n(617);t.getWindowsDelineations=function(e,t,n,i){if(e.length{if("blank"===e.type)return void(e.label={totalLength:1,firstLineAfter:e.lineNumber+1});let t="line"===e.type?1:0,r="line"===e.type?e.lineNumber+1:NaN;function o(n){return-1==n?r-t:e.subs[n].label.firstLineAfter-e.subs[n].label.totalLength}function a(t,n){return 0==t?n+1:e.subs[t-1].label.firstLineAfter}let c="line"===e.type?-1:0,l="line"===e.type?1:0,u=0;for(let d=0;d=0&&ci){const t=o(c),r=a(d,t),p=u==d?r:a(u,t);for(n<=r-t&&s.push([t,p]);l>i;)l-=-1==c?"line"==e.type?1:0:e.subs[c].label.totalLength,c++}}if(ce[0]-t[0]||e[1]-t[1])).filter(((e,t,n)=>0==t||e[0]!=n[t-1][0]||e[1]!=n[t-1][1]))}},417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},haskell:{start:"--",end:""},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},ql:{start:"//",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},verilog:{start:"//",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(622),o=n(306);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===r.extname(o))o+=".ts";else if(".ts"!==r.extname(o))return null;return r.join(r.dirname(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=o.getFirstPrecedingComment(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=o.getFirstPrecedingComment(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await o.parseTree(t,s);for(let e of o.queryExports(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await o.parseTree(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(622),o=n(87),i=n(87);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=r.resolve(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(306);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await r.parseTree(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!r.queryPythonIsDocstring(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[r.languageIdToWasmLanguage(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!r.isSupportedLanguageId(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if(r.isSupportedLanguageId(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if(r.isSupportedLanguageId(e))return d(e).getNodeStart(t,n)}},312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(94),o=n(417),i=n(179),s=n(125),a=n(670),c=n(94),l=n(456),u=n(395);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`)}}t.PromptOptions=x;const T={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function E(e){var t;return e=e.toLowerCase(),null!==(t=T[e])&&void 0!==t?t:e}function C(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=E,t.newLineEnded=C,t.getPrompt=async function(e,n,y={},w=[]){var T;const S=new x(e,y);let k=!1;const{source:P,offset:I}=n;if(I<0||I>P.length)throw new Error(`Offset ${I} is out of range.`);n.languageId=E(n.languageId);const R=new l.Priorities,O=R.justBelow(l.Priorities.TOP),A=S.pathMarker==h.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),N=S.languageMarker==p.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),D=S.includeSiblingFunctions==f.ContextOverSiblings?R.justBelow(O):R.justAbove(O),M=R.justBelow(O,D),L=R.justBelow(M),$=new l.PromptWishlist(S.lineEnding);let j,F;if(S.languageMarker!=p.NoMarker){const e=C(o.getLanguageMarker(n));j=$.append(e,l.PromptElementKind.LanguageMarker,N)}if(S.pathMarker!=h.NoMarker){const e=C(o.getPathMarker(n));F=$.append(e,l.PromptElementKind.PathMarker,A)}if(S.localImportContext!=_.NoContext)for(const e of await i.extractLocalImportContext(n,S.fs))$.append(C(e),l.PromptElementKind.ImportedFile,M);const q=S.neighboringTabs==m.None||0==w.length?[]:await s.getNeighborSnippets(n,w,S.neighboringTabs,S.neighboringTabsMinLength,S.neighboringTabsMaxLength);function B(){q.forEach((e=>$.append(e.snippet,l.PromptElementKind.SimilarFile,L,c.tokenLength(e.snippet),e.score)))}S.neighboringTabsPosition==g.TopOfText&&B();const U=[];let H;if(S.includeSiblingFunctions==f.NoSiblings)H=P.substring(0,I);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await a.getSiblingFunctions(n);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));let o=D;e.forEach((e=>{$.append(e,l.PromptElementKind.AfterCursor,o),o=R.justBelow(o)})),S.neighboringTabsPosition==g.AfterSiblings&&B(),H=r}if(S.neighboringTabsPosition==g.DirectlyAboveCursor){const e=H.lastIndexOf("\n")+1,t=H.substring(0,e),n=H.substring(e);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e))),B(),n.length>0&&(U.push($.append(n,l.PromptElementKind.AfterCursor,O)),U.length>1&&$.require(U[U.length-2],U[U.length-1]))}else $.appendLineForLine(H,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));if(p.Top==S.languageMarker&&U.length>0&&void 0!==j&&$.require(j,U[0]),h.Top==S.pathMarker&&U.length>0&&void 0!==F&&(j?$.require(F,j):$.require(F,U[0])),0==S.suffixPercent)return $.fulfill(S.maxPromptLength);{let e=n.offset;S.suffixStartMode!==b.Cursor&&S.suffixStartMode!==b.CursorTrimStart&&(e=await a.getSiblingFunctionStart(n));const o=S.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-S.suffixPercent)/100),s=$.fulfill(i);const l=o-s.prefixLength;let p=P.slice(e);S.suffixStartMode!=b.SiblingBlockTrimStart&&S.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=r.takeFirstTokens(p,l),f=c.tokenLength(h);f<=l-3&&(i=o-f,s=$.fulfill(i));const m=h.length,g=c.tokenLength(d);if(S.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(S.suffixMatchCriteria==v.Levenshtein){const e=null===(T=u.findEditDistanceScore(h,d))||void 0===T?void 0:T.score;m>0&&S.suffixMatchThreshold>0&&100*e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(312),o=n(306);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if(o.isSupportedLanguageId(n)){const u=await o.parseTree(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=o.getAncestorWithSiblingFunctions(n,p);if(h){const u=o.getFirstPrecedingComment(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if(o.isFunctionDefinition(n,i)){const n=o.getFirstPrecedingComment(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=o.getAncestorWithSiblingFunctions(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if(o.isFunctionDefinition(n,e)){const n=o.getFirstPrecedingComment(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},404:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentationBasedJaccardMatcher=t.FixedWindowSizeJaccardMatcher=void 0;const r=n(250),o=n(467);class i extends o.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e({to:t=>new i(t,e)});class s extends o.WindowedMatcher{constructor(e,t,n){super(e),this.minLength=t,this.maxLength=n,this.languageId=e.languageId}id(){return`indent:${this.minLength}:${this.maxLength}:${this.languageId}`}getWindowsDelineations(e){return r.getWindowsDelineations(e,this.languageId,this.minLength,this.maxLength)}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.maxLength).join("\n")}similarityScore(e,t){return a(e,t)}}function a(e,t){const n=new Set;return e.forEach((e=>{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}t.IndentationBasedJaccardMatcher=s,s.FACTORY=(e,t)=>({to:n=>new s(n,e,t)})},125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=t.neighborOptionToSelection=void 0;const r=n(417),o=n(404);function i(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.neighborOptionToSelection={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}},t.getNeighborSnippets=async function(e,n,s,a,c){const l=t.neighborOptionToSelection[s],u=function(e,n,r,i){const s={...t.neighborOptionToSelection[n]};return void 0!==r&&void 0!==i&&(s.matcherFactory=o.IndentationBasedJaccardMatcher.FACTORY(r,i)),s.matcherFactory.to(e)}(e,s,a,c);return n.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...u.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>l.threshold)).sort(((e,t)=>e.score-t.score)).slice(-l.numberOfNeighbors).map((t=>({score:t.score,snippet:i(t).map((t=>r.comment(t,e.languageId)+"\n")).join(""),startLine:t.startLine,endLine:t.endLine})))}},467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(312),o=n(94);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=o.tokenLength(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=o.tokenLength(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{var r,o,i=void 0!==i?i:{};void 0===(o="function"==typeof(r=function(){var t,r={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t]);var o,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!o&&!d;var p,h,f,m,g,_="";o?(_=d?n(622).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(747)),g||(g=n(622)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=i,l=function(e){process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),i.print||console.log.bind(console);var y=i.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);r=null,i.arguments&&(a=i.arguments),i.thisProgram&&(c=i.thisProgram),i.quit&&(l=i.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":L[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[e>>2]=pe[0],L[e+4>>2]=pe[1];break;case"float":$[e>>2]=t;break;case"double":j[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return L[e>>2];case"float":return $[e>>2];case"double":return j[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,L,$,j,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function U(e,t){return e?B(D,e,t):""}function H(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return H(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return H(e,N,n,t),n}function V(e){A=e,i.HEAP8=N=new Int8Array(e),i.HEAP16=M=new Int16Array(e),i.HEAP32=L=new Int32Array(e),i.HEAPU8=D=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=$=new Float32Array(e),i.HEAPF64=j=new Float64Array(e)}var G=i.INITIAL_MEMORY||33554432;(S=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,i.monitorRunDependencies&&i.monitorRunDependencies(te)}function ie(e){if(te--,i.monitorRunDependencies&&i.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw i.onAbort&&i.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}i.preloadedImages={},i.preloadedAudios={},i.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=i.locateFile?i.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(i)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}var we={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function xe(e,t,n){return e.includes("j")?function(e,t,n){var r=i["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Te=5250832;function Ee(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function Ce(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Ee(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Se(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function ke(e,t){var n,r;return t&&(n=i.asm["orig$"+e]),n||(n=i.asm[e]),!n&&t&&(n=i["_orig$"+e]),n||(n=i[Se(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return xe(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Pe(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return Ue(e);var t=Te,n=t+e+15&-16;return Te=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return L[t>>2]=n/1e3|0,L[t+4>>2]=n%1e3*1e3*1e3|0,0}function $e(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function je(e){Qe(e)}function Fe(e){E(e)}Le.sig="iii",je.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Te,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:Le,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),$e(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:je,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=U(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},Ue=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=Ce(n,1024),i.asm=n;var r,o=ye(t);o.neededDynlibs&&(C=o.neededDynlibs.concat(C)),r=i.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.__wasm_call_ctors).apply(null,arguments)},i._malloc=function(){return(Ue=i._malloc=i.asm.malloc).apply(null,arguments)}),He=(i._ts_language_symbol_count=function(){return(i._ts_language_symbol_count=i.asm.ts_language_symbol_count).apply(null,arguments)},i._ts_language_version=function(){return(i._ts_language_version=i.asm.ts_language_version).apply(null,arguments)},i._ts_language_field_count=function(){return(i._ts_language_field_count=i.asm.ts_language_field_count).apply(null,arguments)},i._ts_language_symbol_name=function(){return(i._ts_language_symbol_name=i.asm.ts_language_symbol_name).apply(null,arguments)},i._ts_language_symbol_for_name=function(){return(i._ts_language_symbol_for_name=i.asm.ts_language_symbol_for_name).apply(null,arguments)},i._ts_language_symbol_type=function(){return(i._ts_language_symbol_type=i.asm.ts_language_symbol_type).apply(null,arguments)},i._ts_language_field_name_for_id=function(){return(i._ts_language_field_name_for_id=i.asm.ts_language_field_name_for_id).apply(null,arguments)},i._memcpy=function(){return(i._memcpy=i.asm.memcpy).apply(null,arguments)},i._free=function(){return(i._free=i.asm.free).apply(null,arguments)},i._calloc=function(){return(i._calloc=i.asm.calloc).apply(null,arguments)},i._ts_parser_delete=function(){return(i._ts_parser_delete=i.asm.ts_parser_delete).apply(null,arguments)},i._ts_parser_reset=function(){return(i._ts_parser_reset=i.asm.ts_parser_reset).apply(null,arguments)},i._ts_parser_set_language=function(){return(i._ts_parser_set_language=i.asm.ts_parser_set_language).apply(null,arguments)},i._ts_parser_timeout_micros=function(){return(i._ts_parser_timeout_micros=i.asm.ts_parser_timeout_micros).apply(null,arguments)},i._ts_parser_set_timeout_micros=function(){return(i._ts_parser_set_timeout_micros=i.asm.ts_parser_set_timeout_micros).apply(null,arguments)},i._memcmp=function(){return(i._memcmp=i.asm.memcmp).apply(null,arguments)},i._ts_query_new=function(){return(i._ts_query_new=i.asm.ts_query_new).apply(null,arguments)},i._ts_query_delete=function(){return(i._ts_query_delete=i.asm.ts_query_delete).apply(null,arguments)},i._iswspace=function(){return(i._iswspace=i.asm.iswspace).apply(null,arguments)},i._iswalnum=function(){return(i._iswalnum=i.asm.iswalnum).apply(null,arguments)},i._ts_query_pattern_count=function(){return(i._ts_query_pattern_count=i.asm.ts_query_pattern_count).apply(null,arguments)},i._ts_query_capture_count=function(){return(i._ts_query_capture_count=i.asm.ts_query_capture_count).apply(null,arguments)},i._ts_query_string_count=function(){return(i._ts_query_string_count=i.asm.ts_query_string_count).apply(null,arguments)},i._ts_query_capture_name_for_id=function(){return(i._ts_query_capture_name_for_id=i.asm.ts_query_capture_name_for_id).apply(null,arguments)},i._ts_query_string_value_for_id=function(){return(i._ts_query_string_value_for_id=i.asm.ts_query_string_value_for_id).apply(null,arguments)},i._ts_query_predicates_for_pattern=function(){return(i._ts_query_predicates_for_pattern=i.asm.ts_query_predicates_for_pattern).apply(null,arguments)},i._ts_tree_copy=function(){return(i._ts_tree_copy=i.asm.ts_tree_copy).apply(null,arguments)},i._ts_tree_delete=function(){return(i._ts_tree_delete=i.asm.ts_tree_delete).apply(null,arguments)},i._ts_init=function(){return(i._ts_init=i.asm.ts_init).apply(null,arguments)},i._ts_parser_new_wasm=function(){return(i._ts_parser_new_wasm=i.asm.ts_parser_new_wasm).apply(null,arguments)},i._ts_parser_enable_logger_wasm=function(){return(i._ts_parser_enable_logger_wasm=i.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},i._ts_parser_parse_wasm=function(){return(i._ts_parser_parse_wasm=i.asm.ts_parser_parse_wasm).apply(null,arguments)},i._ts_language_type_is_named_wasm=function(){return(i._ts_language_type_is_named_wasm=i.asm.ts_language_type_is_named_wasm).apply(null,arguments)},i._ts_language_type_is_visible_wasm=function(){return(i._ts_language_type_is_visible_wasm=i.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},i._ts_tree_root_node_wasm=function(){return(i._ts_tree_root_node_wasm=i.asm.ts_tree_root_node_wasm).apply(null,arguments)},i._ts_tree_edit_wasm=function(){return(i._ts_tree_edit_wasm=i.asm.ts_tree_edit_wasm).apply(null,arguments)},i._ts_tree_get_changed_ranges_wasm=function(){return(i._ts_tree_get_changed_ranges_wasm=i.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},i._ts_tree_cursor_new_wasm=function(){return(i._ts_tree_cursor_new_wasm=i.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},i._ts_tree_cursor_delete_wasm=function(){return(i._ts_tree_cursor_delete_wasm=i.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},i._ts_tree_cursor_reset_wasm=function(){return(i._ts_tree_cursor_reset_wasm=i.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_first_child_wasm=function(){return(i._ts_tree_cursor_goto_first_child_wasm=i.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_next_sibling_wasm=function(){return(i._ts_tree_cursor_goto_next_sibling_wasm=i.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_parent_wasm=function(){return(i._ts_tree_cursor_goto_parent_wasm=i.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_type_id_wasm=function(){return(i._ts_tree_cursor_current_node_type_id_wasm=i.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_named_wasm=function(){return(i._ts_tree_cursor_current_node_is_named_wasm=i.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_missing_wasm=function(){return(i._ts_tree_cursor_current_node_is_missing_wasm=i.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_id_wasm=function(){return(i._ts_tree_cursor_current_node_id_wasm=i.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},i._ts_tree_cursor_start_position_wasm=function(){return(i._ts_tree_cursor_start_position_wasm=i.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},i._ts_tree_cursor_end_position_wasm=function(){return(i._ts_tree_cursor_end_position_wasm=i.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},i._ts_tree_cursor_start_index_wasm=function(){return(i._ts_tree_cursor_start_index_wasm=i.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},i._ts_tree_cursor_end_index_wasm=function(){return(i._ts_tree_cursor_end_index_wasm=i.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},i._ts_tree_cursor_current_field_id_wasm=function(){return(i._ts_tree_cursor_current_field_id_wasm=i.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_wasm=function(){return(i._ts_tree_cursor_current_node_wasm=i.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},i._ts_node_symbol_wasm=function(){return(i._ts_node_symbol_wasm=i.asm.ts_node_symbol_wasm).apply(null,arguments)},i._ts_node_child_count_wasm=function(){return(i._ts_node_child_count_wasm=i.asm.ts_node_child_count_wasm).apply(null,arguments)},i._ts_node_named_child_count_wasm=function(){return(i._ts_node_named_child_count_wasm=i.asm.ts_node_named_child_count_wasm).apply(null,arguments)},i._ts_node_child_wasm=function(){return(i._ts_node_child_wasm=i.asm.ts_node_child_wasm).apply(null,arguments)},i._ts_node_named_child_wasm=function(){return(i._ts_node_named_child_wasm=i.asm.ts_node_named_child_wasm).apply(null,arguments)},i._ts_node_child_by_field_id_wasm=function(){return(i._ts_node_child_by_field_id_wasm=i.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},i._ts_node_next_sibling_wasm=function(){return(i._ts_node_next_sibling_wasm=i.asm.ts_node_next_sibling_wasm).apply(null,arguments)},i._ts_node_prev_sibling_wasm=function(){return(i._ts_node_prev_sibling_wasm=i.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},i._ts_node_next_named_sibling_wasm=function(){return(i._ts_node_next_named_sibling_wasm=i.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},i._ts_node_prev_named_sibling_wasm=function(){return(i._ts_node_prev_named_sibling_wasm=i.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},i._ts_node_parent_wasm=function(){return(i._ts_node_parent_wasm=i.asm.ts_node_parent_wasm).apply(null,arguments)},i._ts_node_descendant_for_index_wasm=function(){return(i._ts_node_descendant_for_index_wasm=i.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_index_wasm=function(){return(i._ts_node_named_descendant_for_index_wasm=i.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_descendant_for_position_wasm=function(){return(i._ts_node_descendant_for_position_wasm=i.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_position_wasm=function(){return(i._ts_node_named_descendant_for_position_wasm=i.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_start_point_wasm=function(){return(i._ts_node_start_point_wasm=i.asm.ts_node_start_point_wasm).apply(null,arguments)},i._ts_node_end_point_wasm=function(){return(i._ts_node_end_point_wasm=i.asm.ts_node_end_point_wasm).apply(null,arguments)},i._ts_node_start_index_wasm=function(){return(i._ts_node_start_index_wasm=i.asm.ts_node_start_index_wasm).apply(null,arguments)},i._ts_node_end_index_wasm=function(){return(i._ts_node_end_index_wasm=i.asm.ts_node_end_index_wasm).apply(null,arguments)},i._ts_node_to_string_wasm=function(){return(i._ts_node_to_string_wasm=i.asm.ts_node_to_string_wasm).apply(null,arguments)},i._ts_node_children_wasm=function(){return(i._ts_node_children_wasm=i.asm.ts_node_children_wasm).apply(null,arguments)},i._ts_node_named_children_wasm=function(){return(i._ts_node_named_children_wasm=i.asm.ts_node_named_children_wasm).apply(null,arguments)},i._ts_node_descendants_of_type_wasm=function(){return(i._ts_node_descendants_of_type_wasm=i.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},i._ts_node_is_named_wasm=function(){return(i._ts_node_is_named_wasm=i.asm.ts_node_is_named_wasm).apply(null,arguments)},i._ts_node_has_changes_wasm=function(){return(i._ts_node_has_changes_wasm=i.asm.ts_node_has_changes_wasm).apply(null,arguments)},i._ts_node_has_error_wasm=function(){return(i._ts_node_has_error_wasm=i.asm.ts_node_has_error_wasm).apply(null,arguments)},i._ts_node_is_missing_wasm=function(){return(i._ts_node_is_missing_wasm=i.asm.ts_node_is_missing_wasm).apply(null,arguments)},i._ts_query_matches_wasm=function(){return(i._ts_query_matches_wasm=i.asm.ts_query_matches_wasm).apply(null,arguments)},i._ts_query_captures_wasm=function(){return(i._ts_query_captures_wasm=i.asm.ts_query_captures_wasm).apply(null,arguments)},i._iswalpha=function(){return(i._iswalpha=i.asm.iswalpha).apply(null,arguments)},i._iswdigit=function(){return(i._iswdigit=i.asm.iswdigit).apply(null,arguments)},i._iswlower=function(){return(i._iswlower=i.asm.iswlower).apply(null,arguments)},i._towupper=function(){return(i._towupper=i.asm.towupper).apply(null,arguments)},i._memchr=function(){return(i._memchr=i.asm.memchr).apply(null,arguments)},i.___errno_location=function(){return(He=i.___errno_location=i.asm.__errno_location).apply(null,arguments)}),We=(i._strlen=function(){return(i._strlen=i.asm.strlen).apply(null,arguments)},i.stackSave=function(){return(We=i.stackSave=i.asm.stackSave).apply(null,arguments)}),ze=i.stackRestore=function(){return(ze=i.stackRestore=i.asm.stackRestore).apply(null,arguments)},Ke=i.stackAlloc=function(){return(Ke=i.stackAlloc=i.asm.stackAlloc).apply(null,arguments)},Ve=i._setThrew=function(){return(Ve=i._setThrew=i.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=i.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=i.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},i.__Znwm=function(){return(i.__Znwm=i.asm._Znwm).apply(null,arguments)},i.__ZdlPv=function(){return(i.__ZdlPv=i.asm._ZdlPv).apply(null,arguments)},i._orig$ts_parser_timeout_micros=function(){return(i._orig$ts_parser_timeout_micros=i.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},i._orig$ts_parser_set_timeout_micros=function(){return(i._orig$ts_parser_set_timeout_micros=i.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},i._TRANSFER_BUFFER=7296,i.___THREW__=7932,i.___threwValue=7936,i.___cxa_new_handler=7928,i.allocate=function(e,t){var n;return n=t==F?Ke(e.length):Ue(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,i.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Ye&&function(e){var t=i._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));L[r>>2]=K(c);for(var o=1;o>2)+o]=K(e[o-1]);L[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(i.onExit&&i.onExit(e),R=!0),l(e,new Ge(e)))}if(i.run=Xe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Ye=!0;i.noInitialRun&&(Ye=!1),Xe();const Ze=i,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{i.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(747);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Pe;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{const r=n(747),o=n(622),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=n(7147)},622:e=>{"use strict";e.exports=n(1017)},13:e=>{"use strict";e.exports=n(1267)}},o={},i=function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(563),e.exports=i},5037:(e,t,n)=>{const r=n(7147),o=n(1017),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=require("@opentelemetry/tracing")},9166:e=>{"use strict";e.exports=require("applicationinsights-native-metrics")},9491:e=>{"use strict";e.exports=require("assert")},852:e=>{"use strict";e.exports=require("async_hooks")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6206:e=>{"use strict";e.exports=require("console")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5158:e=>{"use strict";e.exports=require("http2")},5687:e=>{"use strict";e.exports=require("https")},8188:e=>{"use strict";e.exports=require("module")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},2781:e=>{"use strict";e.exports=require("stream")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},9796:e=>{"use strict";e.exports=require("zlib")},3180:e=>{"use strict";e.exports=JSON.parse('{"name":"@adobe/helix-fetch","version":"3.1.1","description":"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2","main":"src/index.js","scripts":{"test":"nyc mocha","lint":"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},"mocha":{"timeout":"5000","recursive":"true","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"engines":{"node":">=12.0"},"types":"src/index.d.ts","exports":{"import":"./src/index.mjs","require":"./src/index.js"},"repository":{"type":"git","url":"https://github.com/adobe/helix-fetch"},"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/adobe/helix-fetch/issues"},"homepage":"https://github.com/adobe/helix-fetch#readme","keywords":["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],"dependencies":{"debug":"4.3.4","http-cache-semantics":"4.1.0","lru-cache":"7.13.1"},"devDependencies":{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2","eslint":"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3","mocha":"10.0.0","mocha-multi-reporters":"1.5.1","nock":"13.2.9","nyc":"15.1.0","parse-cache-control":"1.0.1","pem":"1.14.6","proxy":"^1.0.2","semantic-release":"19.0.3","sinon":"14.0.0","stream-buffers":"3.0.2","tunnel":"^0.0.6"},"lint-staged":{"*.js":"eslint"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"ghooks":{"pre-commit":"npx lint-staged"}}}')},1143:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3186:e=>{"use strict";e.exports={i8:"1.7.6"}},9674:e=>{"use strict";e.exports={i8:"0.2.0"}},735:e=>{"use strict";e.exports={i8:"1.3.7"}},9876:e=>{"use strict";e.exports=JSON.parse('{"name":"copilot","displayName":"GitHub Copilot","description":"Your AI pair programmer","version":"1.50.0","build":"dev","buildType":"dev","publisher":"GitHub","preview":false,"homepage":"https://github.com/features/copilot","bugs":{"url":"https://github.com/community/community/discussions/categories/copilot"},"qna":"https://github.com/github-community/community/discussions/categories/copilot","icon":"assets/Copilot-App-Icon.png","engines":{"vscode":"^1.68.0","npm":">=7.0.0"},"categories":["Other"],"badges":[{"url":"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange","href":"https://github.com/github-copilot/signup","description":"Sign up for GitHub Copilot"}],"activationEvents":["onStartupFinished"],"main":"./dist/extension","enabledApiProposals":["inlineCompletionsAdditions"],"contributes":{"commands":[{"command":"github.copilot.generate","title":"Open GitHub Copilot"},{"command":"github.copilot.toggleCopilot","title":"GitHub Copilot: Configure Enabled/Disabled"},{"command":"github.copilot.sendFeedback","title":"GitHub Copilot: Send Feedback"}],"keybindings":[{"command":"github.copilot.generate","key":"ctrl+enter","mac":"ctrl+enter","when":"editorTextFocus && github.copilot.activated"},{"command":"editor.action.inlineSuggest.trigger","key":"alt+\\\\","when":"editorTextFocus && !editorHasSelection && config.github.copilot.inlineSuggest.enable && !inlineSuggestionsVisible"}],"menus":{"editor/inlineCompletions/actions":[{"command":"github.copilot.generate","when":"github.copilot.activated"}],"commandPalette":[{"command":"github.copilot.generate","when":"github.copilot.activated"},{"command":"github.copilot.toggleCopilot","when":"github.copilot.activated"},{"command":"github.copilot.sendFeedback","when":"github.copilot.activated"}]},"configuration":[{"title":"Copilot","properties":{"github.copilot.advanced":{"type":"object","title":"Advanced Settings","properties":{"secret_key":{"type":"string","default":"","description":"Secret API key"},"length":{"type":"integer","default":500,"description":"Length of code to generate in tokens"},"temperature":{"type":"string","default":"","description":"Override sampling temperature (range 0.0 - 1.0)"},"top_p":{"type":"number","default":1,"description":"Top probability mass to consider"},"stops":{"type":"object","default":{"*":["\\n\\n\\n"],"python":["\\ndef ","\\nclass ","\\nif ","\\n\\n#"]},"description":"Configure per-language stop sequences"},"indentationMode":{"type":"object","default":{"python":false,"javascript":false,"javascriptreact":false,"jsx":false,"typescript":false,"typescriptreact":false,"go":false,"ruby":false,"*":true},"markdownDescription":"Enable or disable indentation block termination for specified [languages](https://code.visualstudio.com/docs/languages/identifiers). Set to \'clientandserver\' to run both parser-based and indent-based termination."},"inlineSuggestCount":{"type":"integer","default":3,"description":"Number of inline suggestions to fetch"},"listCount":{"type":"integer","default":10,"description":"Number of solutions to list in Open GitHub Copilot"},"debug.showScores":{"type":"boolean","default":false,"description":"Show scores in sorted solutions"},"debug.overrideEngine":{"type":"string","default":"","description":"Override engine name"},"debug.overrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy full URL"},"debug.testOverrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy URL when running tests"},"debug.overrideLogLevels":{"type":"object","default":{},"description":"Override what the minimum logged level is per logger (or \'*\' for all loggers). Levels are \'DEBUG\', \'INFO\', \'WARN\', \'ERROR\'. Ex: `{\\"default\\": \\"DEBUG\\"}` to see all things logged to the \'default\' logger."},"debug.filterLogCategories":{"type":"array","default":[],"description":"Show only log categories listed in this setting. If an array is empty, show all loggers"}}},"github.copilot.enable":{"type":"object","default":{"*":true,"yaml":false,"plaintext":false,"markdown":false},"markdownDescription":"Enable or disable Copilot for specified [languages](https://code.visualstudio.com/docs/languages/identifiers)"},"github.copilot.inlineSuggest.enable":{"type":"boolean","default":true,"description":"Show inline suggestions"}}}],"icons":{"copilot-logo":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0041"}},"copilot-warning":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0042"}},"copilot-notconnected":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0043"}}},"iconFonts":[{"id":"copilot-font","src":[{"path":"assets/copilot.woff","format":"woff"}]}]},"scripts":{"postinstall":"npx vscode-dts dev && mv vscode.proposed.*.ts extension/src","vscode:prepublish":"npm-run-all build:extension","build":"npm-run-all build:*","build:agent":"cd agent && npm run build","build:agent-no-pkg":"cd agent && npm run build-no-pkg","build:extension":"webpack --mode production","build:lib":"cd lib && npm run build","compile":"npm-run-all compile:*","compile:agent":"cd agent && npm run compile","compile:extension":"webpack --mode development","compile:lib":"cd lib && npm run compile","watch":"npm-run-all -p watch:*","watch:agent":"cd agent && npm run watch","watch:extension":"webpack --mode development --watch","watch:lib":"cd lib && npm run watch","lint":"eslint lib extension agent --ext ts","check_deps":"depcruise -c .dependency-cruiser.js .","test":"npm-run-all test:*","test:agent":"cd agent && npm run test","test:extension":"cd extension && ts-node ./test/runTest.ts","test:prompt":"cd prompt && npm install && npm run test","test:lib":"cd lib && npm run test","test:lsp-client":"cd lsp-client && npm run smokeTest","build_test":"tsc extension/test/run.ts","get_token":"ts-node script/getToken.ts"},"devDependencies":{"@github/prettier-config":"0.0.4","@types/crypto-js":"^4.0.1","@types/mocha":"^5.2.6","@types/node":"^13.11.0","@types/tunnel":"^0.0.3","@types/uuid":"^8.3.1","@types/vscode":"^1.68.0","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","dependency-cruiser":"^9.26.1","eslint":"^7.29.0","eslint-plugin-no-only-tests":"^2.6.0","fantasticon":"^1.2.2","get-port":"^5.1.1","mocha":"^6.1.4","npm-run-all":"^4.1.5","prettier":"2.5.1","prettier-plugin-organize-imports":"^2.3.4","ts-dedent":"^2.2.0","ts-loader":"^8.0.11","ts-node":"^9.0.0","typescript":"^4.4.3","vsce":"1.91.0","vscode-dts":"^0.3.2","vscode-test":"^1.3.0","webpack":"^5.54.0","webpack-cli":"^4.2.0","zlib":"^1.0.5"},"dependencies":{"@adobe/helix-fetch":"github:bmuskalla/helix-fetch#4e33e47bf6e64b637d5d713558fde504bf71c947","@github/copilot-promptlib":"file:prompt","@sinclair/typebox":"^0.23.4","@types/git-url-parse":"^9.0.1","ajv":"^8.6.3","ajv-errors":"^3.0.0","crypto-js":"^4.0.0","git-url-parse":"^13.1.0","open":"^8.4.0","source-map-support":"^0.5.19","tunnel":"^0.0.6","uuid":"^8.3.2","vscode-extension-telemetry":"^0.1.6","vscode-uri":"^3.0.2"}}')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});const t=n(6995),o=n(2879);!async function(){const e=(0,t.init)(),n=(0,o.createWrappedConnection)(e,process.stdin,process.stdout);new o.CopilotService(e,n).listen()}()})(),module.exports=r})(); + deps: ${n}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,i.propertyInData)(n,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?n.if(u,(()=>{for(const t of l)(0,i.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,i.checkMissingProp)(e,l,a)})`),(0,i.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:s,it:a}=e,c=n.name("valid");for(const l in t)(0,o.alwaysValidSchema)(a,t[l])||(n.if((0,i.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},76:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:i}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else a?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,o){return()=>{const i=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(i,l),o?t.assign(o,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!(0,o.alwaysValidSchema)(e,n)}t.default=i},6951:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8891),o=n(1162),i=n(8634),s=n(5151),a=n(5609),c=n(5463),l=n(3021),u=n(4943),d=n(4243),p=n(8103),h=n(2869),f=n(4279),m=n(4880),g=n(2609),_=n(76),y=n(5316);t.default=function(e=!1){const t=[h.default,f.default,m.default,g.default,_.default,y.default,l.default,u.default,c.default,d.default,p.default];return e?t.push(o.default,s.default):t.push(r.default,i.default),t.push(a.default),t}},8634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(5669),o=n(8936),i=n(3499),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,o.alwaysValidSchema)(n,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:i}=l,s=n.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(l,e,r.strictTuples)}}(s),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(i,n.length,l.items));const u=i.name("valid"),d=i.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,o.alwaysValidSchema)(l,t)||(i.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=a,t.default=s},5151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(3499),s=n(8891),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,o.alwaysValidSchema)(r,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},2869:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,r.alwaysValidSchema)(o,n))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},4880:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=n,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,i)=>{let a;(0,o.alwaysValidSchema)(s,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${i}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,i),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},8103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s=n(8936),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,r.allSchemaProperties)(n),p=d.filter((e=>(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length||p.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const h=u.strictSchema&&!u.allowMatchingProperties&&c.properties,f=t.name("valid");!0===l.props||l.props instanceof o.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:m}=l;function g(e){for(const t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function _(n){t.forIn("key",a,(i=>{t.if(o._`${(0,r.usePattern)(e,n)}.test(${i})`,(()=>{const r=p.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:i,dataPropType:s.Type.Str},f),l.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):r||l.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of d)h&&g(e),l.allErrors?_(e):(t.var(f,!0),_(e),t.if(f))}()}};t.default=a},1162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8634),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=o},4243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1686),o=n(3499),i=n(8936),s=n(4943),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new r.KeywordCxt(l,s.default,"additionalProperties"));const u=(0,o.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),l.props));const d=u.filter((e=>!(0,i.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const p=t.name("valid");for(const n of d)h(n)?f(n):(t.if((0,o.propertyInData)(t,c,n,l.opts.ownProperties)),f(n),l.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(p);function h(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}};t.default=a},3021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,n))return;const a=t.name("valid");t.forIn("key",i,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},5316:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8936),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=o},3499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(5669),o=n(8936),i=n(7250);function s(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return r._`${s(e)}.call(${t}, ${n})`}function c(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} === undefined`;return o?(0,r.or)(i,(0,r.not)(a(e,t,n))):i}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:o,it:i}=e;n.if(c(n,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},o,i){return(0,r.or)(...o.map((o=>(0,r.and)(c(e,t,o,n.ownProperties),r._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=s,t.isOwnProperty=a,t.propertyInData=function(e,t,n,o){const i=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return o?r._`${i} && ${a(e,t,n)}`:i},t.noPropertyInData=c,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((n=>!(0,o.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},l,u,d){const p=d?r._`${e}, ${t}, ${o}${s}`:t,h=[[i.default.instancePath,(0,r.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=r._`${p}, ${n.object(...h)}`;return u!==r.nil?r._`${l}.call(${u}, ${f})`:r._`${l}(${f})`},t.usePattern=function({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,o),code:r._`new RegExp(${n}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:i,dataProp:n,dataPropType:o.Type.Num},a),t.if((0,r.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:i,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},1018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},2101:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1018),o=n(1939),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default];t.default=i},1939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(1578),o=n(3499),i=n(5669),s=n(7250),a=n(7382),c=n(8936),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:s,schemaEnv:c,validateName:l,opts:p,self:h}=o,{root:f}=c;if(("#"===n||"#/"===n)&&s===f.baseId)return function(){if(c===f)return d(e,l,c,c.$async);const n=t.scopeValue("root",{ref:f});return d(e,i._`${n}.validate`,f,f.$async)}();const m=a.resolveRef.call(h,f,s,n);if(void 0===m)throw new r.default(s,n);return m instanceof a.SchemaEnv?function(t){const n=u(e,t);d(e,n,t,t.$async)}(m):function(r){const o=t.scopeValue("schema",!0===p.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),s=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:n},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):i._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:d,opts:p}=l,h=p.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=c.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",i._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,i.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=c.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",i._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,i.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,h)}`),m(t),u||a.assign(n,!0)}),(e=>{a.if(i._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),f(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,o.callValidateCode)(e,t,h),(()=>m(t)),(()=>f(t)))}t.getValidate=u,t.callRef=d,t.default=l},2:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(7421),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:i,parentSchema:s,it:a}=e,{oneOf:c}=s;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=i.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");const u=t.let("valid",!1),d=t.const("tag",r._`${n}${(0,r.getProperty)(l)}`);function p(n){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:n},o);return e.mergeEvaluated(i,r.Name),o}t.if(r._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=o(s);let r=!0;for(let t=0;te.error(!1,{discrError:o.DiscrError.Tag,tag:d,tagName:l}))),e.ok(u)}};t.default=i},7421:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(n=t.DiscrError||(t.DiscrError={})).Tag="tag",n.Mapping="mapping"},5671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2101),o=n(7499),i=n(6951),s=n(4480),a=n(2480),c=[r.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},3599:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=c;l.validateFormats&&(i?function(){const i=n.scopeValue("formats",{ref:p.formats,code:l.code.formats}),s=n.const("fDef",r._`${i}[${a}]`),c=n.let("fType"),u=n.let("format");n.if(r._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>n.assign(c,r._`${s}.type || "string"`).assign(u,r._`${s}.validate`)),(()=>n.assign(c,r._`"string"`).assign(u,s))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${u}`,function(){const e=d.$async?r._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:r._`${u}(${o})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const i=p.formats[s];if(!i)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}p.logger.warn(e())}();if(!0===i)return;const[a,c,h]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(s)}`:void 0,o=n.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,r._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${h}(${o})`}return"function"==typeof c?r._`${h}(${o})`:r._`${h}.test(${o})`}())}())}};t.default=o},4480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(3599).default];t.default=r},2480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},6577:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(r._`!${(0,o.useFunc)(t,i.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=s},9450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(4285),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum,d=(0,o.useFunc)(t,i.default);let p;if(u||s)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(r._`${d}(${n}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,r.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?r._`${d}(${n}, ${e}[${t}])`:r._`${n} === ${o}`}(e,o))))}e.pass(p)}};t.default=s},7499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1337),o=n(9706),i=n(9507),s=n(1216),a=n(34),c=n(6962),l=n(1135),u=n(194),d=n(6577),p=n(9450),h=[r.default,o.default,i.default,s.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default];t.default=h},1135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${i} ${o}`)}};t.default=o},9507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=n(8936),i=n(9161),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,o.useFunc)(e.gen,i.default)}(${n})`;e.fail$data(r._`${l} ${c} ${s}`)}};t.default=s},1337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o=r.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>r.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data(r._`${n} ${i[t].fail} ${o} || isNaN(${n})`)}};t.default=a},34:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o}=e,i="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${i} ${o}`)}};t.default=o},9706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5669),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};t.default=o},1216:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?o._`(new RegExp(${s}, ${c}))`:(0,r.usePattern)(e,i);e.fail$data(o._`!${l}.test(${t})`)}};t.default=i},6962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3499),o=n(5669),i=n(8936),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:s,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===n.length)return;const d=n.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)e.block$data(o.nil,p);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,i){e.setParams({missingProperty:n}),t.forOf(n,s,(()=>{t.assign(i,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,i)),(0,r.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(l,t,l.opts.strictRequired)}}function p(){t.forOf("prop",s,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,u.ownProperties),(()=>e.error()))}))}}};t.default=s},194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7332),o=n(5669),i=n(8936),s=n(4285),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!a&&!c)return;const p=t.let("valid"),h=l.items?(0,r.getSchemaTypes)(l.items):[];function f(i,s){const a=t.name("item"),c=(0,r.checkDataTypes)(h,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${n}[${i}]`),t.if(c,o._`continue`),h.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(s,o._`${l}[${a}]`),e.error(),t.assign(p,!1).break()})).code(o._`${l}[${a}] = ${i}`)}))}function m(r,a){const c=(0,i.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(o._`;${r}--;`,(()=>t.for(o._`${a} = ${r}; ${a}--;`,(()=>t.if(o._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(p,!1).break(l)}))))))}e.block$data(p,(function(){const r=t.let("i",o._`${n}.length`),i=t.let("j");e.setParams({i:r,j:i}),t.assign(p,!0),t.if(o._`${r} > 1`,(()=>(h.length>0&&!h.some((e=>"object"===e||"array"===e))?f:m)(r,i)))}),o._`${u} === false`),e.ok(p)}};t.default=a},3245:(e,t,n)=>{"use strict";var r=n(1767),o=function(){function e(t){if(e.INSTANCE)throw new Error("Console logging adapter tracking should be configured from the applicationInsights object");this._client=t,e.INSTANCE=this}return e.prototype.enable=function(e,t){r.IsInitialized&&(n(2469).wp(e&&t,this._client),n(3805).wp(e,this._client),n(7916).wp(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1,!1)},e._methodNames=["debug","info","log","warn","error"],e}();e.exports=o},6751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2010),o=n(1767),i=function(){function e(){}return e.getCurrentContext=function(){if(!e.enabled)return null;var t=e.session.get(e.CONTEXT_NAME);return void 0===t?null:t},e.generateContextObject=function(e,t,n,r,o,i){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t,traceparent:o,tracestate:i},customProperties:new s(r)}:null},e.runWithContext=function(t,n){return e.enabled?e.session.bind(n,((r={})[e.CONTEXT_NAME]=t,r))():n();var r},e.wrapEmitter=function(t){e.enabled&&e.session.bindEmitter(t)},e.wrapCallback=function(t){return e.enabled?e.session.bind(t):t},e.enable=function(t){this.enabled||(this.isNodeVersionCompatible()?(e.hasEverEnabled||(this.forceClsHooked=t,this.hasEverEnabled=!0,void 0===this.cls&&(!0===e.forceClsHooked||void 0===e.forceClsHooked&&e.shouldUseClsHooked()?this.cls=n(9172):this.cls=n(2611)),e.session=this.cls.createNamespace("AI-CLS-Session"),o.registerContextPreservation((function(t){return e.session.bind(t)}))),this.enabled=!0):this.enabled=!1)},e.disable=function(){this.enabled=!1},e.reset=function(){e.hasEverEnabled&&(e.session=null,e.session=this.cls.createNamespace("AI-CLS-Session"))},e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},e.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},e.canUseClsHooked=function(){var e=process.versions.node.split("."),t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r},e.enabled=!1,e.hasEverEnabled=!1,e.forceClsHooked=void 0,e.CONTEXT_NAME="ApplicationInsights-Context",e}();t.CorrelationContextManager=i;var s=function(){function e(e){this.props=[],this.addHeaderData(e)}return e.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map((function(e){var t=e.split("=");return{key:t[0],value:t[1]}})).concat(this.props)},e.prototype.serializeToHeader=function(){return this.props.map((function(e){return e.key+"="+e.value})).join(", ")},e.prototype.getProperty=function(e){for(var t=0;t0&&process.once("uncaughtException",(function(){e.post.call(l,p,!0),s.delete(h),e.destroy.call(null,p)}))}e.post.call(l,p,!1),u=null,(a||d)&&(d=!1,s.delete(h),e.destroy.call(null,p))},h=c.apply(r,n),s.set(h,p),h},r[o]=function(t){if(u===t&&null!==t)d=!0;else if(s.has(t)){const n=s.get(t);s.delete(t),e.destroy.call(null,n)}l.apply(r,arguments)}}e.exports=function(){p(this._hooks,this._state,"setTimeout","clearTimeout",o,a,!0),p(this._hooks,this._state,"setInterval","clearInterval",i,c,!1),p(this._hooks,this._state,"setImmediate","clearImmediate",s,l,!0),global.setTimeout=r.setTimeout,global.setInterval=r.setInterval,global.setImmediate=r.setImmediate,global.clearTimeout=r.clearTimeout,global.clearInterval=r.clearInterval,global.clearImmediate=r.clearImmediate}},7600:e=>{"use strict";e.exports=(e,t)=>class extends e{constructor(e){var n,r;super((function(e,i){n=this,r=[function(n){return t(o,!1),e(n)},function(e){return t(o,!1),i(e)}]}));var o=this;try{e.apply(n,r)}catch(e){r[1](e)}return o}}},1747:(e,t,n)=>{var r,o,i=n(4403).wrap,s=[],a=0,c=!1,l=[];function u(e,t){var n=e.length,r=t.length,o=[];if(0===n&&0===r)return o;for(var i=0;i0&&(s=l.pop()),d=void 0,n&&!c},o=function(e,t,n){var r=[];c=!0;for(var o=0;o0&&t[o].before(this,r[t[o].uid]);c=!1;var i=e.apply(this,arguments);for(c=!0,o=0;o0&&t[o].after(this,r[t[o].uid]);return c=!1,s=l.pop(),d=void 0,i}},i(process,"_fatalException",(function(e){return function(t){return r(t)||e(t)}}))}else{var h=!1;r=function(e){if(h)throw e;for(var t=!1,n=s.length,r=0;r0&&t[p].before(this,o[t[p].uid]);c=!1;try{i=e.apply(this,arguments)}catch(e){for(a=!0,p=0;p0&&t[p].after(this,o[t[p].uid]);c=!1}s=l.pop()}return i}},process.addListener("uncaughtException",r)}function f(e,t){"function"==typeof e.create&&(this.create=e.create,this.flags|=1),"function"==typeof e.before&&(this.before=e.before,this.flags|=2),"function"==typeof e.after&&(this.after=e.after,this.flags|=4),"function"==typeof e.error&&(this.error=e.error,this.flags|=8),this.uid=++a,this.data=void 0===t?null:t}function m(e,t){if("object"!=typeof e||!e)throw new TypeError("callbacks argument must be an object");return e instanceof f?e:new f(e,t)}f.prototype.create=void 0,f.prototype.before=void 0,f.prototype.after=void 0,f.prototype.error=void 0,f.prototype.data=void 0,f.prototype.uid=0,f.prototype.flags=0,process.createAsyncListener=m,process.addAsyncListener=function(e,t){var n;n=e instanceof f?e:m(e,t);for(var r=!1,o=0;o0)return o(e,n,t);return function(e,t,n){c=!0;for(var r=0;r{"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(4403),o=n(3341),i=r.wrap,s=r.massWrap,a=n(1747),c=n(3837),l=o.gte(process.version,"6.0.0"),u=o.gte(process.version,"7.0.0"),d=o.gte(process.version,"8.0.0"),p=o.gte(process.version,"11.0.0"),h=n(1808);function f(e){return function(){this.on("connection",(function(e){e._handle&&(e._handle.onread=a(e._handle.onread))}));try{return e.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=a(this._handle.onconnection))}}}function m(e){if(e&&e._handle){var t=e._handle;t._originalOnread||(t._originalOnread=t.onread),t.onread=a(t._originalOnread)}}u&&!h._normalizeArgs?h._normalizeArgs=function(e){if(0===e.length)return[{},null];var t,n,r=e[0],o={};"object"==typeof r&&null!==r?o=r:"string"==typeof(t=r)&&!1===(n=t,(n=Number(n))>=0&&n)?o.path=r:(o.port=r,e.length>1&&"string"==typeof e[1]&&(o.host=e[1]));var i=e[e.length-1];return"function"!=typeof i?[o,null]:[o,i]}:u||h._normalizeConnectArgs||(h._normalizeConnectArgs=function(e){var t,n={};"object"==typeof e[0]&&null!==e[0]?n=e[0]:"string"==typeof e[0]&&!1===(t=e[0],(t=Number(t))>=0&&t)?n.path=e[0]:(n.port=e[0],"string"==typeof e[1]&&(n.host=e[1]));var r=e[e.length-1];return"function"==typeof r?[n,r]:[n]}),"_setUpListenHandle"in h.Server.prototype?i(h.Server.prototype,"_setUpListenHandle",f):i(h.Server.prototype,"_listen2",f),i(h.Socket.prototype,"connect",(function(e){return function(){var t;(t=d&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?arguments[0]:u?h._normalizeArgs(arguments):h._normalizeConnectArgs(arguments))[1]&&(t[1]=a(t[1]));var n=e.apply(this,t);return m(this),n}}));var g=n(3685);i(g.Agent.prototype,"addRequest",(function(e){return function(t){var n=t.onSocket;return t.onSocket=a((function(e){return m(e),n.apply(this,arguments)})),e.apply(this,arguments)}}));var _=n(2081);function y(e){Array.isArray(e.stdio)&&e.stdio.forEach((function(e){e&&e._handle&&(e._handle.onread=a(e._handle.onread),i(e._handle,"close",A))})),e._handle&&(e._handle.onexit=a(e._handle.onexit))}_.ChildProcess?i(_.ChildProcess.prototype,"spawn",(function(e){return function(){var t=e.apply(this,arguments);return y(this),t}})):s(_,["execFile","fork","spawn"],(function(e){return function(){var t=e.apply(this,arguments);return y(t),t}})),process._fatalException||(process._originalNextTick=process.nextTick);var v=[];process._nextDomainTick&&v.push("_nextDomainTick"),process._tickDomainCallback&&v.push("_tickDomainCallback"),s(process,v,O),i(process,"nextTick",A);var b=["setTimeout","setInterval"];global.setImmediate&&b.push("setImmediate");var w=n(9512),x=global.setTimeout===w.setTimeout;s(w,b,A),x&&s(global,b,A);var T=n(9523);s(T,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],O),T.resolveNaptr&&i(T,"resolveNaptr",O);var E,C,S=n(7147);s(S,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],O),S.lchown&&i(S,"lchown",O),S.lchmod&&i(S,"lchmod",O),S.ftruncate&&i(S,"ftruncate",O);try{E=n(9796)}catch(e){}if(E&&E.Deflate&&E.Deflate.prototype){var k=Object.getPrototypeOf(E.Deflate.prototype);k._transform?i(k,"_transform",O):k.write&&k.flush&&k.end&&s(k,["write","flush","end"],O)}try{C=n(6113)}catch(e){}if(C){var P=["pbkdf2","randomBytes"];p||P.push("pseudoRandomBytes"),s(C,P,O)}var I=!!global.Promise&&"function Promise() { [native code] }"===Promise.toString()&&"function toString() { [native code] }"===Promise.toString.toString();if(I){var R=process.addAsyncListener({create:function(){I=!1}});global.Promise.resolve(!0).then((function(){I=!1})),process.removeAsyncListener(R)}function O(e){var t=function(){var t,n=arguments.length-1;if("function"==typeof arguments[n]){t=Array(arguments.length);for(var r=0;r{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var L=s++;i[L]="^"+i[D]+i[C]+"$";var $=s++;i[$]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var U=s++;i[U]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[$]:o[L];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2172:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(632),a="error@context",c=[];for(let e in s.providers)c[s.providers[e]]=e;const l=process.env.DEBUG_CLS_HOOKED;let u=-1;function d(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}function p(e){return process.namespaces[e]}function h(e){let t=p(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function f(e){process.env.DEBUG&&process._rawDebug(e)}function m(e){return e?"function"==typeof e?e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]:e.constructor&&e.constructor.name?e.constructor.name:void 0:e}if(e.exports={getNamespace:p,createNamespace:function(e){o.ok(e,"namespace must be given a name."),l&&f("CREATING NAMESPACE "+e);let t=new d(e);return t.id=u,s.addHooks({init(n,o,i,s,a){u=n,s?(t._contexts.set(n,t._contexts.get(s)),l&&f("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+i)):t._contexts.set(u,t.active),l&&f("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+c[i]+" active:"+r.inspect(t.active,!0))},pre(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" PRE "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.enter(i)):l&&f(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},post(n,o){u=n;let i=t._contexts.get(n);i?(l&&f(" POST "+e+" uid:"+n+" handle:"+m(o)+" context:"+r.inspect(i)),t.exit(i)):l&&f(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(o))},destroy(n){u=n,l&&f("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(u))+" active:"+r.inspect(t.active,!0)),t._contexts.delete(n)}}),process.namespaces[e]=t,t},destroyNamespace:h,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){h(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},d.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return l&&f(" SETTING KEY:"+e+"="+t+" in ns:"+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e]=t,t},d.prototype.get=function(e){if(this.active)return l&&f(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0)),this.active[e];l&&f(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+u+" active:"+r.inspect(this.active,!0))},d.prototype.createContext=function(){l&&f(" CREATING Context: "+this.name+" uid:"+u+" len:"+this._set.length+" active:"+r.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=u,l&&f(" CREATED Context: "+this.name+" uid:"+u+" len:"+this._set.length+" context:"+r.inspect(e,!0,2,!0)),e},d.prototype.run=function(e){let t=this.createContext();this.enter(t);try{return l&&f(" BEFORE RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),e(t),t}catch(e){throw e&&(e[a]=t),e}finally{l&&f(" AFTER RUN: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t)}},d.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},d.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return l&&f(" BEFORE runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,l&&f(" AFTER runPromise: "+this.name+" uid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},d.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},d.prototype.enter=function(e){o.ok(e,"context must be provided for entering"),l&&f(" ENTER "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this._set.push(this.active),this.active=e},d.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),l&&f(" EXIT "+this.name+" uid:"+u+" len:"+this._set.length+" context: "+r.inspect(e)),this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(l&&f("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},d.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},d.prototype.fromException=function(e){return e[a]},process.namespaces={},s._state&&!s._state.enabled&&s.enable(),l){var g=n(6818);for(var _ in g.filter._modifiers)g.filter.deattach(_)}},8423:(e,t,n)=>{"use strict";const r=n(3837),o=n(9491),i=n(7267),s=n(852),a="error@context",c=process.env.DEBUG_CLS_HOOKED;let l=-1;function u(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}function d(e){return process.namespaces[e]}function p(e){let t=d(e);o.ok(t,"can't delete nonexistent namespace! \""+e+'"'),o.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function h(...e){c&&process._rawDebug(`${r.format(...e)}`)}e.exports={getNamespace:d,createNamespace:function(e){o.ok(e,"namespace must be given a name."),c&&h(`NS-CREATING NAMESPACE (${e})`);let t=new u(e);return t.id=l,s.createHook({init(n,o,i,a){if(l=s.executionAsyncId(),t.active){if(t._contexts.set(n,t.active),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(0===l){const i=s.triggerAsyncId(),u=t._contexts.get(i);if(u){if(t._contexts.set(n,u),c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT USING CONTEXT FROM TRIGGERID [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}else if(c){h(`${" ".repeat(t._indent<0?0:t._indent)}INIT MISSING CONTEXT [${o}] (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}}if(c&&"PROMISE"===o){h(r.inspect(a,{showHidden:!0}));const s=a.parentId;h(`${" ".repeat(t._indent<0?0:t._indent)}INIT RESOURCE-PROMISE [${o}] (${e}) parentId:${s} asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} resource:${a}`)}},before(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`),t._indent+=2}t.enter(o)}else if(c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${r.inspect(t._contexts,{showHidden:!0,depth:2,colors:!0})}`),t._indent+=2}},after(n){let o;if(l=s.executionAsyncId(),o=t._contexts.get(n)||t._contexts.get(l),o){if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}t.exit(o)}else if(c){const i=s.triggerAsyncId();t._indent-=2;h(`${" ".repeat(t._indent<0?0:t._indent)}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${l} triggerId:${i} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(o)}`)}},destroy(n){if(l=s.executionAsyncId(),c){const o=s.triggerAsyncId();h(`${" ".repeat(t._indent<0?0:t._indent)}DESTROY (${e}) currentUid:${l} asyncId:${n} triggerId:${o} active:${r.inspect(t.active,{showHidden:!0,depth:2,colors:!0})} context:${r.inspect(t._contexts.get(l))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t},destroyNamespace:p,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){p(e)})),process.namespaces=Object.create(null)},ERROR_SYMBOL:a},u.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,c&&h(" ".repeat(this._indent<0?0:this._indent)+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),t},u.prototype.get=function(e){if(this.active){if(c){const t=s.executionAsyncId(),n=s.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);h(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+l+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),h(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]}if(c){const t=s.currentId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}},u.prototype.createContext=function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=l,c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-CREATED Context: (${this.name}) currentUid:${l} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},u.prototype.run=function(e){let t=this.createContext();this.enter(t);try{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}return e(t),t}catch(e){throw e&&(e[a]=t),e}finally{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN END: (${this.name}) currentUid:${l} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}},u.prototype.runAndReturn=function(e){let t;return this.run((function(n){t=e(n)})),t},u.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return c&&h("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(c&&h("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,c&&h("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},u.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},u.prototype.enter=function(e){if(o.ok(e,"context must be provided for entering"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-ENTER: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active),this.active=e},u.prototype.exit=function(e){if(o.ok(e,"context must be provided for exiting"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();h(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-EXIT: (${this.name}) currentUid:${l} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e)return o.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(c&&h("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),o.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(o.ok(t,"can't remove top context"),this._set.splice(t,1))},u.prototype.bindEmitter=function(e){o.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},u.prototype.fromException=function(e){return e[a]},process.namespaces={}},9172:(e,t,n)=>{"use strict";const r=n(2173);process&&r.gte(process.versions.node,"8.0.0")?e.exports=n(8423):e.exports=n(2172)},2173:(e,t)=>{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var L=s++;i[L]="^"+i[D]+i[C]+"$";var $=s++;i[$]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var U=s++;i[U]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[$]:o[L];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},2611:(e,t,n)=>{"use strict";var r=n(9491),o=n(7267),i="error@context";function s(e){this.name=e,this.active=null,this._set=[],this.id=null}function a(e){return process.namespaces[e]}function c(e){var t=a(e);r.ok(t,"can't delete nonexistent namespace!"),r.ok(t.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(t.id),process.namespaces[e]=null}function l(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){c(e)})),process.namespaces=Object.create(null)}process.addAsyncListener||n(1274),s.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,t},s.prototype.get=function(e){if(this.active)return this.active[e]},s.prototype.createContext=function(){return Object.create(this.active)},s.prototype.run=function(e){var t=this.createContext();this.enter(t);try{return e(t),t}catch(e){throw e&&(e[i]=t),e}finally{this.exit(t)}},s.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},s.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());var n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[i]=t),e}finally{n.exit(t)}}},s.prototype.enter=function(e){r.ok(e,"context must be provided for entering"),this._set.push(this.active),this.active=e},s.prototype.exit=function(e){if(r.ok(e,"context must be provided for exiting"),this.active===e)return r.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());var t=this._set.lastIndexOf(e);r.ok(t>=0,"context not currently entered; can't exit"),r.ok(t,"can't remove top context"),this._set.splice(t,1)},s.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this,n="context@"+this.name;o(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;var t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){var r=n[e];t=r.namespace.bind(t,r.context)})),t}))},s.prototype.fromException=function(e){return e[i]},process.namespaces||l(),e.exports={getNamespace:a,createNamespace:function(e){r.ok(e,"namespace must be given a name!");var t=new s(e);return t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){n&&t.enter(n)},after:function(e,n){n&&t.exit(n)},error:function(e){e&&t.exit(e)}}),process.namespaces[e]=t,t},destroyNamespace:c,reset:l}},6725:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],s=[],a=[],c=[],l=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,o[n]=f,i[f]=n;var m=e[n],g=e[m],_=e[g],y=257*e[f]^16843008*f;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*_^65537*g^257*m^16843008*n,u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=m^e[e[e[_^m]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],s=0;s6&&s%n==4&&(l=o[l>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l]):(l=o[(l=l<<8|l>>>24)>>>24]<<24|o[l>>>16&255]<<16|o[l>>>8&255]<<8|o[255&l],l^=f[s/n|0]<<24),i[s]=i[s-n]^l);for(var a=this._invKeySchedule=[],c=0;c>>24]]^d[o[l>>>16&255]]^p[o[l>>>8&255]]^h[o[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,l,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,s,a){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f>>24]^o[u>>>16&255]^i[d>>>8&255]^s[255&p]^n[h++],g=r[u>>>24]^o[d>>>16&255]^i[p>>>8&255]^s[255&l]^n[h++],_=r[d>>>24]^o[p>>>16&255]^i[l>>>8&255]^s[255&u]^n[h++],y=r[p>>>24]^o[l>>>16&255]^i[u>>>8&255]^s[255&d]^n[h++];l=m,u=g,d=_,p=y}m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^n[h++],g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&l])^n[h++],_=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^n[h++],y=(a[p>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],e[t]=m,e[t+1]=g,e[t+2]=_,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)},8976:function(e,t,n){var r,o,i,s,a,c,l,u,d,p,h,f,m,g,_,y,v,b,w;e.exports=(r=n(8112),n(6165),void(r.lib.Cipher||(o=r,i=o.lib,s=i.Base,a=i.WordArray,c=i.BufferedBlockAlgorithm,l=o.enc,l.Utf8,u=l.Base64,d=o.algo.EvpKDF,p=i.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?w:v}return function(t){return{encrypt:function(n,r,o){return e(r).encrypt(t,n,r,o)},decrypt:function(n,r,o){return e(r).decrypt(t,n,r,o)}}}}()}),i.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),h=o.mode={},f=i.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=h.CBC=function(){var e=f.extend();function t(e,t,n){var r,o=this._iv;o?(r=o,this._iv=void 0):r=this._prevBlock;for(var i=0;i>>2];e.sigBytes-=t}},i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:m,padding:g}),reset:function(){var e;p.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),_=i.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(o.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?a.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),_.create({ciphertext:n,salt:t})}},v=i.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r),i=o.finalize(t),s=o.cfg;return _.create({ciphertext:i,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(o.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var o=d.create({keySize:t+n}).compute(e,r),i=a.create(o.words.slice(t),4*n);return o.sigBytes=4*t,_.create({key:o,iv:i,salt:r})}},w=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:b}),encrypt:function(e,t,n,r){var o=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=o.iv;var i=v.encrypt.call(this,e,t,o.key,r);return i.mixIn(o),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var o=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=o.iv,v.decrypt.call(this,e,t,o.key,r)}}))))},8112:function(e,t,n){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r)try{r=n(6113)}catch(e){}var o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},a=s.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(i=0;i>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},p=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},h=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,u=e.min(4*c,i);if(c){for(var d=0;d>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},8559:function(e,t,n){var r;e.exports=(r=n(8112),function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(r,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(r,2*n)}}}(),r.enc.Utf16)},6165:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(1284),n(3456),i=(o=(r=u).lib).Base,s=o.WordArray,c=(a=r.algo).MD5,l=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),i=s.create(),a=i.words,c=r.keySize,l=r.iterations;a.lengthr&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,l=0;l>>2]|=e[o]<<24-o%4*8;t.call(this,r,n)}else t.apply(this,arguments)};n.prototype=e}}(),r.lib.WordArray)},4678:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,s=e[t+0],c=e[t+1],h=e[t+2],f=e[t+3],m=e[t+4],g=e[t+5],_=e[t+6],y=e[t+7],v=e[t+8],b=e[t+9],w=e[t+10],x=e[t+11],T=e[t+12],E=e[t+13],C=e[t+14],S=e[t+15],k=i[0],P=i[1],I=i[2],R=i[3];k=l(k,P,I,R,s,7,a[0]),R=l(R,k,P,I,c,12,a[1]),I=l(I,R,k,P,h,17,a[2]),P=l(P,I,R,k,f,22,a[3]),k=l(k,P,I,R,m,7,a[4]),R=l(R,k,P,I,g,12,a[5]),I=l(I,R,k,P,_,17,a[6]),P=l(P,I,R,k,y,22,a[7]),k=l(k,P,I,R,v,7,a[8]),R=l(R,k,P,I,b,12,a[9]),I=l(I,R,k,P,w,17,a[10]),P=l(P,I,R,k,x,22,a[11]),k=l(k,P,I,R,T,7,a[12]),R=l(R,k,P,I,E,12,a[13]),I=l(I,R,k,P,C,17,a[14]),k=u(k,P=l(P,I,R,k,S,22,a[15]),I,R,c,5,a[16]),R=u(R,k,P,I,_,9,a[17]),I=u(I,R,k,P,x,14,a[18]),P=u(P,I,R,k,s,20,a[19]),k=u(k,P,I,R,g,5,a[20]),R=u(R,k,P,I,w,9,a[21]),I=u(I,R,k,P,S,14,a[22]),P=u(P,I,R,k,m,20,a[23]),k=u(k,P,I,R,b,5,a[24]),R=u(R,k,P,I,C,9,a[25]),I=u(I,R,k,P,f,14,a[26]),P=u(P,I,R,k,v,20,a[27]),k=u(k,P,I,R,E,5,a[28]),R=u(R,k,P,I,h,9,a[29]),I=u(I,R,k,P,y,14,a[30]),k=d(k,P=u(P,I,R,k,T,20,a[31]),I,R,g,4,a[32]),R=d(R,k,P,I,v,11,a[33]),I=d(I,R,k,P,x,16,a[34]),P=d(P,I,R,k,C,23,a[35]),k=d(k,P,I,R,c,4,a[36]),R=d(R,k,P,I,m,11,a[37]),I=d(I,R,k,P,y,16,a[38]),P=d(P,I,R,k,w,23,a[39]),k=d(k,P,I,R,E,4,a[40]),R=d(R,k,P,I,s,11,a[41]),I=d(I,R,k,P,f,16,a[42]),P=d(P,I,R,k,_,23,a[43]),k=d(k,P,I,R,b,4,a[44]),R=d(R,k,P,I,T,11,a[45]),I=d(I,R,k,P,S,16,a[46]),k=p(k,P=d(P,I,R,k,h,23,a[47]),I,R,s,6,a[48]),R=p(R,k,P,I,y,10,a[49]),I=p(I,R,k,P,C,15,a[50]),P=p(P,I,R,k,g,21,a[51]),k=p(k,P,I,R,T,6,a[52]),R=p(R,k,P,I,f,10,a[53]),I=p(I,R,k,P,w,15,a[54]),P=p(P,I,R,k,c,21,a[55]),k=p(k,P,I,R,v,6,a[56]),R=p(R,k,P,I,S,10,a[57]),I=p(I,R,k,P,_,15,a[58]),P=p(P,I,R,k,E,21,a[59]),k=p(k,P,I,R,m,6,a[60]),R=p(R,k,P,I,x,10,a[61]),I=p(I,R,k,P,h,15,a[62]),P=p(P,I,R,k,b,21,a[63]),i[0]=i[0]+k|0,i[1]=i[1]+P|0,i[2]=i[2]+I|0,i[3]=i[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),s=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,o,i,s){var a=e+(t&n|~t&r)+o+s;return(a<>>32-i)+t}function u(e,t,n,r,o,i,s){var a=e+(t&r|n&~r)+o+s;return(a<>>32-i)+t}function d(e,t,n,r,o,i,s){var a=e+(t^n^r)+o+s;return(a<>>32-i)+t}function p(e,t,n,r,o,i,s){var a=e+(n^(t|~r))+o+s;return(a<>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)},8581:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,n,r){var o,i=this._iv;i?(o=i.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(var s=0;s>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,o=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var a=s.slice(0);r.encryptBlock(a,0);for(var c=0;c>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)},7051:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(o-1)).concat(r.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)},6863:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)},6261:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},2864:function(e,t,n){var r;e.exports=(r=n(8112),n(8976),r.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},r.pad.ZeroPadding)},9220:function(e,t,n){var r,o,i,s,a,c,l,u,d;e.exports=(d=n(8112),n(1284),n(3456),i=(o=(r=d).lib).Base,s=o.WordArray,c=(a=r.algo).SHA1,l=a.HMAC,u=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=l.create(n.hasher,e),o=s.create(),i=s.create([1]),a=o.words,c=i.words,u=n.keySize,d=n.iterations;a.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)r[o]^=n[o+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=p,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=p,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(a)}(),r.RabbitLegacy)},5129:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],a=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)o[n]^=r[n+4&7];if(t){var i=t.words,s=i[0],a=i[1],l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),d=l>>>16|4294901760&u,p=u<<16|65535&l;for(o[0]^=l,o[1]^=d,o[2]^=u,o[3]^=p,o[4]^=l,o[5]^=d,o[6]^=u,o[7]^=p,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)o[r]=16711935&(o[r]<<8|o[r]>>>24)|4278255360&(o[r]<<24|o[r]>>>8),e[t+r]^=o[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,a=r>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,l=((4294901760&r)*r|0)+((65535&r)*r|0);s[n]=c^l}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(a)}(),r.Rabbit)},3954:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;o=0;for(var i=0;o<256;o++){var s=o%n,a=t[s>>>2]>>>24-s%4*8&255;i=(i+r[o]+a)%256;var c=r[o];r[o]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){n=(n+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}e.RC4=t._createHelper(o);var s=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(),r.RC4)},3787:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=o.create([0,1518500249,1859775393,2400959708,2840853838]),p=o.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=i.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,o=e[r];e[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i,s,h,b,w,x,T,E,C,S,k,P=this._hash.words,I=d.words,R=p.words,O=a.words,A=c.words,N=l.words,D=u.words;for(x=i=P[0],T=s=P[1],E=h=P[2],C=b=P[3],S=w=P[4],n=0;n<80;n+=1)k=i+e[t+O[n]]|0,k+=n<16?f(s,h,b)+I[0]:n<32?m(s,h,b)+I[1]:n<48?g(s,h,b)+I[2]:n<64?_(s,h,b)+I[3]:y(s,h,b)+I[4],k=(k=v(k|=0,N[n]))+w|0,i=w,w=b,b=v(h,10),h=s,s=k,k=x+e[t+A[n]]|0,k+=n<16?y(T,E,C)+R[0]:n<32?_(T,E,C)+R[1]:n<48?g(T,E,C)+R[2]:n<64?m(T,E,C)+R[3]:f(T,E,C)+R[4],k=(k=v(k|=0,D[n]))+S|0,x=S,S=C,C=v(E,10),E=T,T=k;k=P[1]+h+C|0,P[1]=P[2]+b+S|0,P[2]=P[3]+w+x|0,P[3]=P[4]+i+T|0,P[4]=P[0]+s+E|0,P[0]=k},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,i=o.words,s=0;s<5;s++){var a=i[s];i[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,n){return e^t^n}function m(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function v(e,t){return e<>>32-t}t.RIPEMD160=i._createHelper(h),t.HmacRIPEMD160=i._createHmacHelper(h)}(Math),r.RIPEMD160)},1284:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(o=(r=u=n(8112)).lib,i=o.WordArray,s=o.Hasher,a=r.algo,c=[],l=a.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],l=0;l<80;l++){if(l<16)c[l]=0|e[t+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+a+c[l];d+=l<20?1518500249+(o&i|~o&s):l<40?1859775393+(o^i^s):l<60?(o&i|o&s|i&s)-1894007588:(o^i^s)-899497514,a=s,s=i,i=o<<30|o>>>2,o=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=s._createHelper(l),r.HmacSHA1=s._createHmacHelper(l),u.SHA1)},3816:function(e,t,n){var r,o,i,s,a,c;e.exports=(c=n(8112),n(2232),o=(r=c).lib.WordArray,i=r.algo,s=i.SHA256,a=i.SHA224=s.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=s._createHelper(a),r.HmacSHA224=s._createHmacHelper(a),c.SHA224)},2232:function(e,t,n){var r;e.exports=(r=n(8112),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(a[o]=n(e.pow(r,.5))),c[o]=n(e.pow(r,1/3)),o++),r++}();var l=[],u=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=0;h<64;h++){if(h<16)l[h]=0|e[t+h];else{var f=l[h-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,g=l[h-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+_+l[h-16]}var y=r&o^r&i^o&i,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&d)+c[h]+l[h];p=d,d=u,u=a,a=s+b|0,s=i,i=o,o=r,r=b+(v+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(u),t.HmacSHA256=i._createHmacHelper(u)}(Math),r.SHA256)},1455:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.x64.Word,a=t.algo,c=[],l=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var a=0,d=0,p=0;p<7;p++){if(1&o){var h=(1<>>24)|4278255360&(i<<24|i>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(P=n[o]).high^=s,P.low^=i}for(var a=0;a<24;a++){for(var p=0;p<5;p++){for(var h=0,f=0,m=0;m<5;m++)h^=(P=n[p+5*m]).high,f^=P.low;var g=d[p];g.high=h,g.low=f}for(p=0;p<5;p++){var _=d[(p+4)%5],y=d[(p+1)%5],v=y.high,b=y.low;for(h=_.high^(v<<1|b>>>31),f=_.low^(b<<1|v>>>31),m=0;m<5;m++)(P=n[p+5*m]).high^=h,P.low^=f}for(var w=1;w<25;w++){var x=(P=n[w]).high,T=P.low,E=c[w];E<32?(h=x<>>32-E,f=T<>>32-E):(h=T<>>64-E,f=x<>>64-E);var C=d[l[w]];C.high=h,C.low=f}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,p=0;p<5;p++)for(m=0;m<5;m++){var P=n[w=p+5*m],I=d[w],R=d[(p+1)%5+5*m],O=d[(p+2)%5+5*m];P.high=I.high^~R.high&O.high,P.low=I.low^~R.low&O.low}P=n[0];var A=u[a];P.high^=A.high,P.low^=A.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,l=[],u=0;u>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(p)}return new o.init(l,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=i._createHelper(p),t.HmacSHA3=i._createHmacHelper(p)}(Math),r.SHA3)},1007:function(e,t,n){var r,o,i,s,a,c,l,u;e.exports=(u=n(8112),n(8400),n(9039),o=(r=u).x64,i=o.Word,s=o.WordArray,a=r.algo,c=a.SHA512,l=a.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},9039:function(e,t,n){var r;e.exports=(r=n(8112),n(8400),function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,s=e.algo;function a(){return o.create.apply(o,arguments)}var c=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=a()}();var u=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],u=n[5],d=n[6],p=n[7],h=r.high,f=r.low,m=o.high,g=o.low,_=i.high,y=i.low,v=s.high,b=s.low,w=a.high,x=a.low,T=u.high,E=u.low,C=d.high,S=d.low,k=p.high,P=p.low,I=h,R=f,O=m,A=g,N=_,D=y,M=v,L=b,$=w,j=x,F=T,q=E,B=C,U=S,H=k,W=P,z=0;z<80;z++){var K,V,G=l[z];if(z<16)V=G.high=0|e[t+2*z],K=G.low=0|e[t+2*z+1];else{var J=l[z-15],X=J.high,Q=J.low,Y=(X>>>1|Q<<31)^(X>>>8|Q<<24)^X>>>7,Z=(Q>>>1|X<<31)^(Q>>>8|X<<24)^(Q>>>7|X<<25),ee=l[z-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,oe=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=l[z-7],se=ie.high,ae=ie.low,ce=l[z-16],le=ce.high,ue=ce.low;V=(V=(V=Y+se+((K=Z+ae)>>>0>>0?1:0))+re+((K+=oe)>>>0>>0?1:0))+le+((K+=ue)>>>0>>0?1:0),G.high=V,G.low=K}var de,pe=$&F^~$&B,he=j&q^~j&U,fe=I&O^I&N^O&N,me=R&A^R&D^A&D,ge=(I>>>28|R<<4)^(I<<30|R>>>2)^(I<<25|R>>>7),_e=(R>>>28|I<<4)^(R<<30|I>>>2)^(R<<25|I>>>7),ye=($>>>14|j<<18)^($>>>18|j<<14)^($<<23|j>>>9),ve=(j>>>14|$<<18)^(j>>>18|$<<14)^(j<<23|$>>>9),be=c[z],we=be.high,xe=be.low,Te=H+ye+((de=W+ve)>>>0>>0?1:0),Ee=_e+me;H=B,W=U,B=F,U=q,F=$,q=j,$=M+(Te=(Te=(Te=Te+pe+((de+=he)>>>0>>0?1:0))+we+((de+=xe)>>>0>>0?1:0))+V+((de+=K)>>>0>>0?1:0))+((j=L+de|0)>>>0>>0?1:0)|0,M=N,L=D,N=O,D=A,O=I,A=R,I=Te+(ge+fe+(Ee>>>0<_e>>>0?1:0))+((R=de+Ee|0)>>>0>>0?1:0)|0}f=r.low=f+R,r.high=h+I+(f>>>0>>0?1:0),g=o.low=g+A,o.high=m+O+(g>>>0>>0?1:0),y=i.low=y+D,i.high=_+N+(y>>>0>>0?1:0),b=s.low=b+L,s.high=v+M+(b>>>0>>0?1:0),x=a.low=x+j,a.high=w+$+(x>>>0>>0?1:0),E=u.low=E+q,u.high=T+F+(E>>>0>>0?1:0),S=d.low=S+U,d.high=C+B+(S>>>0>>0?1:0),P=p.low=P+W,p.high=k+H+(P>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},9708:function(e,t,n){var r;e.exports=(r=n(8112),n(8885),n(4678),n(6165),n(8976),function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=s[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var l=o[i]=[],u=c[i];for(n=0;n<24;n++)l[n/6|0]|=t[(a[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(a[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var d=this._invSubKeys=[];for(n=0;n<16;n++)d[n]=o[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),p.call(this,1,1431655765);for(var r=0;r<16;r++){for(var o=n[r],i=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=l[c][((s^o[c])&u[c])>>>0];this._lBlock=s,this._rBlock=i^a}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,p.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(f)}(),r.TripleDES)},8400:function(e,t,n){var r,o,i,s,a,c;e.exports=(r=n(8112),i=(o=r).lib,s=i.Base,a=i.WordArray,(c=o.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=n(9374)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},9374:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(6292):e.exports=n(4428)},4428:(e,t,n)=>{const r=n(6224),o=n(3837);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(6974);e&&(e.stderr||e).level>=2&&(t.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(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=n(9374)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},1321:e=>{"use strict";e.exports=(e,t,n)=>{const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}},2784:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 1.0.0 < 2.0.0",patch:function(e){try{var s=new(0,n(8028).BasicTracer)(o.channel.spanContextPropagator?{scopeManager:o.channel.spanContextPropagator}:void 0),a=s.startSpan;s.startSpan=function(e,t){if(!t||!t.parent){var n=s.getCurrentSpan();n&&n.operation&&n.operation.traceparent&&(t=r({},t,{parent:{traceId:n.operation.traceparent.traceId,spanId:n.operation.traceparent.spanId}}))}var o=a.call(this,e,t);return o.addEvent("Application Insights Integration enabled"),o},s.addSpanProcessor(new i),s[t.AzureMonitorSymbol]=!0,e.setTracer(s)}catch(e){}return e}},t.enable=function(){o.channel.registerMonkeyPatch("@azure/core-tracing",t.azureCoreTracing)}},248:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:function(e){var t=e.prototype._emit;return e.prototype._emit=function(e,n){var o=t.apply(this,arguments);if(!n){var i=o;i||(i=t.call(this,e,!0)),r.channel.publish("bunyan",{level:e.level,result:i})}return o},e}},t.enable=function(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}},8159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2781);t.console={versionSpecifier:">= 4.0.0",patch:function(e){var t=new o.Writable,n=new o.Writable;t.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t}),!0},n.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t,stderr:!0}),!0};for(var i=new e.Console(t,n),s=function(t){var n=e[t];n&&(e[t]=function(){if(i[t])try{i[t].apply(i,arguments)}catch(e){}return n.apply(e,arguments)})},a=0,c=["log","info","warn","error","dir","time","timeEnd","trace","assert"];a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2784);t.azuresdk=r;var o=n(248);t.bunyan=o;var i=n(8159);t.console=i;var s=n(7834);t.mongodbCore=s;var a=n(4826);t.mongodb=a;var c=n(5856);t.mysql=c;var l=n(8345);t.pgPool=l;var u=n(7726);t.pg=u;var d=n(4765);t.redis=d;var p=n(1624);t.tedious=p;var h=n(8041);t.winston=h,t.enable=function(){o.enable(),i.enable(),s.enable(),a.enable(),c.enable(),u.enable(),l.enable(),d.enable(),h.enable(),r.enable(),p.enable()}},7834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.Server.prototype.connect;return e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.pool.write;this.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=r.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var o=this.s.pool.logout;return this.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=r.channel.bindToContext(arguments[1])),o.apply(this,arguments)},e},e}},t.enable=function(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore)}},4826:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 2.0.0 <= 3.0.5",patch:function(e){var t=e.instrument({operationIdGenerator:{next:function(){return o.channel.bindToContext((function(e){return e()}))}}}),n={};return t.on("started",(function(e){n[e.requestId]||(n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})):o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),e}},t.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:function(e){var t=e.instrument(),n={},i={};return t.on("started",(function(e){n[e.requestId]||(i[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete i[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof i[e.requestId]&&(i[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete i[e.requestId])})),e}},t.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:function(e){!function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.coreTopology.s.pool.write;this.s.coreTopology.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=o.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var r=this.s.coreTopology.s.pool.logout;return this.s.coreTopology.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=o.channel.bindToContext(arguments[1])),r.apply(this,arguments)},e}}(e);var t=e.instrument(),n={},r={};return t.on("started",(function(e){n[e.requestId]||(r[e.requestId]=o.channel.bindToContext((function(e){return e()})),n[e.requestId]=e)})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete r[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return o.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete r[e.requestId])})),e}},t.enable=function(){o.channel.registerMonkeyPatch("mongodb",t.mongo2),o.channel.registerMonkeyPatch("mongodb",t.mongo3),o.channel.registerMonkeyPatch("mongodb",t.mongo330)}},5856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(1017);t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:function(e,t){var i=function(e,t){return function(t,n){var o=e[t];o&&(e[t]=function(){for(var e=arguments.length-1,t=arguments.length-1;t>=0;--t){if("function"==typeof arguments[t]){e=t;break}if(void 0!==arguments[t])break}var i=arguments[e],s={result:null,startTime:null,startDate:null};"function"==typeof i&&(n?(s.startTime=process.hrtime(),s.startDate=new Date,arguments[e]=r.channel.bindToContext(n(s,i))):arguments[e]=r.channel.bindToContext(i));var a=o.apply(this,arguments);return s.result=a,a})}},s=function(e,t){return i(e.prototype)},a=n(1055)(o.dirname(t)+"/lib/Connection");["connect","changeUser","ping","statistics","end"].forEach((function(e){return s(a)(e)})),i(a)("createQuery",(function(e,t){return function(n){var o=process.hrtime(e.startTime),i=1e3*o[0]+o[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:i,time:e.startDate}),t.apply(this,arguments)}}));var c=n(6990)(o.dirname(t)+"/lib/Pool");return["_enqueueCallback"].forEach((function(e){return s(c)(e)})),e}},t.enable=function(){r.channel.registerMonkeyPatch("mysql",t.mysql)}},8345:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:function(e){var t=e.prototype.connect;return e.prototype.connect=function(e){return e&&(arguments[0]=r.channel.bindToContext(e)),t.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}},7726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932),o=n(2361);t.postgres6={versionSpecifier:"6.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},l=process.hrtime();function u(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(l);if(c.result=n&&{rowCount:n.rowCount,command:n.command},c.error=t,c.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",c),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(c.query.preparable={text:e,args:t},s=u(s)):(c.query.text=e,s?s=u(s):t=u(t)):("string"==typeof e.name?c.query.plan=e.name:e.values instanceof Array?c.query.preparable={text:e.text,args:e.values}:c.query.text=e.text,s?s=u(s):t?t=u(t):e.callback=u(e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments)},e}},t.postgres7={versionSpecifier:">=7.* <=8.*",patch:function(e,t){var n=e.Client.prototype.query,i="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c=this,l=!!s,u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime();function p(e){e&&e[i]&&(e=e[i]);var t=r.channel.bindToContext((function(t,n){var i=process.hrtime(d);if(u.result=n&&{rowCount:n.rowCount,command:n.command},u.error=t,u.duration=Math.ceil(1e3*i[0]+i[1]/1e6),r.channel.publish("postgres",u),t){if(e)return e.apply(this,arguments);a&&a instanceof o.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)}));try{return Object.defineProperty(t,i,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(u.query.preparable={text:e,args:t},s=(l="function"==typeof s)?p(s):s):(u.query.text=e,s?s=(l="function"==typeof s)?p(s):s:t=(l="function"==typeof t)?p(t):t):("string"==typeof e.name?u.query.plan=e.name:e.values instanceof Array?u.query.preparable={text:e.text,args:e.values}:u.query.text=e.text,s?(l="function"==typeof s,s=p(s)):t?t=(l="function"==typeof t)?p(t):t:(l="function"==typeof e.callback,e.callback=l?p(e.callback):e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments),l?a:a.then((function(e){return p()(void 0,e),new c._Promise((function(t,n){t(e)}))})).catch((function(e){return p()(e,void 0),new c._Promise((function(t,n){n(e)}))}))},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg",t.postgres6),r.channel.registerMonkeyPatch("pg",t.postgres7)}},4765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6932);t.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:function(e){var t=e.RedisClient.prototype.internal_send_command;return e.RedisClient.prototype.internal_send_command=function(e){if(e){var n=e.callback;if(!n||!n.pubsubBound){var o=this.address,i=process.hrtime(),s=new Date;e.callback=r.channel.bindToContext((function(t,a){var c=process.hrtime(i),l=1e3*c[0]+c[1]/1e6|0;r.channel.publish("redis",{duration:l,address:o,commandObj:e,err:t,result:a,time:s}),"function"==typeof n&&n.apply(this,arguments)})),e.callback.pubsubBound=!0}}return t.call(this,e)},e}},t.enable=function(){r.channel.registerMonkeyPatch("redis",t.redis)}},1624:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 6.0.0 < 9.0.0",patch:function(e){var t=e.Connection.prototype.makeRequest;return e.Connection.prototype.makeRequest=function(){function e(e){var t=process.hrtime(),n={query:{},database:{host:null,port:null},result:null,error:null,duration:0};return o.channel.bindToContext((function(i,s,a){var c=process.hrtime(t);n=r({},n,{database:{host:this.connection.config.server,port:this.connection.config.options.port},result:!i&&{rowCount:s,rows:a},query:{text:this.parametersByName.statement.value},error:i,duration:Math.ceil(1e3*c[0]+c[1]/1e6)}),o.channel.publish("tedious",n),e.call(this,i,s,a)}))}var n=arguments[0];arguments[0].callback=e(n.callback),t.apply(this,arguments)},e}},t.enable=function(){o.channel.registerMonkeyPatch("tedious",t.tedious)}},8041:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);or[n]?o:n);this.add(new t(e,{level:n}))}var r=e.createLogger;e.createLogger=function(){var o,i=arguments[0].levels||e.config.npm.levels;for(var s in i)i.hasOwnProperty(s)&&(o=void 0===o||i[s]>i[o]?s:o);var a=r.apply(this,arguments);a.add(new t(e,{level:o}));var c=a.configure;return a.configure=function(){c.apply(this,arguments),n.apply(this,arguments)},a};var a=e.createLogger;return e.configure=function(){a.apply(this,arguments),n.apply(this,arguments)},e.add(new t(e)),e}},t.winston2={versionSpecifier:"2.x",patch:function(e){var t,n=e.Logger.prototype.log,r=function(n,r,o){var i;return i=t===e.config.npm.levels?"npm":t===e.config.syslog.levels?"syslog":"unknown",s.channel.publish("winston",{level:n,message:r,meta:o,levelKind:i}),r};return e.Logger.prototype.log=function(){return t=this.levels,this.filters&&0!==this.filters.length?this.filters[this.filters.length-1]!==r&&(this.filters=this.filters.filter((function(e){return e!==r})),this.filters.push(r)):this.filters=[r],n.apply(this,arguments)},e}},t.enable=function(){s.channel.registerMonkeyPatch("winston",t.winston2),s.channel.registerMonkeyPatch("winston",t.winston3)}},1055:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=1055,e.exports=t},6990:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=6990,e.exports=t},6932:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8497),o=n(8497);t.makePatchingRequire=o.makePatchingRequire;var i=function(e){return!0},s=function(){function e(){this.version=n(9674).i8,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.currentlyPublishing=!1}return e.prototype.shouldPublish=function(e){var t=this.subscribers[e];return!!t&&t.some((function(e){var t=e.filter;return!t||t(!1)}))},e.prototype.publish=function(e,t){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=!0,n.forEach((function(e){var t=e.listener,n=e.filter;try{n&&n(!0)&&t(r)}catch(e){}})),this.currentlyPublishing=!1}}},e.prototype.subscribe=function(e,t,n){void 0===n&&(n=i),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:t,filter:n})},e.prototype.unsubscribe=function(e,t,n){void 0===n&&(n=i);var r=this.subscribers[e];if(r)for(var o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1017),o=n(6190),i=n(8188),s=Object.keys(process.binding("natives")),a=i.prototype.require;t.makePatchingRequire=function(e){var t={};return function(n){var c=a.apply(this,arguments);if(e[n]){var l=i._resolveFilename(n,this);if(t.hasOwnProperty(l))return t[l];var u=void 0;if(s.indexOf(n)<0)try{u=a.call(this,r.join(n,"package.json")).version}catch(e){return c}else u=process.version.substring(1);var d=u.indexOf("-");d>=0&&(u=u.substring(0,d));for(var p=c,h=0,f=e[n];h{var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],i=t.src=[],s=0,a=s++;i[a]="0|[1-9]\\d*";var c=s++;i[c]="[0-9]+";var l=s++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[a]+")\\.("+i[a]+")\\.("+i[a]+")";var d=s++;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var p=s++;i[p]="(?:"+i[a]+"|"+i[l]+")";var h=s++;i[h]="(?:"+i[c]+"|"+i[l]+")";var f=s++;i[f]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var m=s++;i[m]="(?:-?("+i[h]+"(?:\\."+i[h]+")*))";var g=s++;i[g]="[0-9A-Za-z-]+";var _=s++;i[_]="(?:\\+("+i[g]+"(?:\\."+i[g]+")*))";var y=s++,v="v?"+i[u]+i[f]+"?"+i[_]+"?";i[y]="^"+v+"$";var b="[v=\\s]*"+i[d]+i[m]+"?"+i[_]+"?",w=s++;i[w]="^"+b+"$";var x=s++;i[x]="((?:<|>)?=?)";var T=s++;i[T]=i[c]+"|x|X|\\*";var E=s++;i[E]=i[a]+"|x|X|\\*";var C=s++;i[C]="[v=\\s]*("+i[E]+")(?:\\.("+i[E]+")(?:\\.("+i[E]+")(?:"+i[f]+")?"+i[_]+"?)?)?";var S=s++;i[S]="[v=\\s]*("+i[T]+")(?:\\.("+i[T]+")(?:\\.("+i[T]+")(?:"+i[m]+")?"+i[_]+"?)?)?";var k=s++;i[k]="^"+i[x]+"\\s*"+i[C]+"$";var P=s++;i[P]="^"+i[x]+"\\s*"+i[S]+"$";var I=s++;i[I]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=s++;i[R]="(?:~>?)";var O=s++;i[O]="(\\s*)"+i[R]+"\\s+",o[O]=new RegExp(i[O],"g");var A=s++;i[A]="^"+i[R]+i[C]+"$";var N=s++;i[N]="^"+i[R]+i[S]+"$";var D=s++;i[D]="(?:\\^)";var M=s++;i[M]="(\\s*)"+i[D]+"\\s+",o[M]=new RegExp(i[M],"g");var L=s++;i[L]="^"+i[D]+i[C]+"$";var $=s++;i[$]="^"+i[D]+i[S]+"$";var j=s++;i[j]="^"+i[x]+"\\s*("+b+")$|^$";var F=s++;i[F]="^"+i[x]+"\\s*("+v+")$|^$";var q=s++;i[q]="(\\s*)"+i[x]+"\\s*("+b+"|"+i[C]+")",o[q]=new RegExp(i[q],"g");var B=s++;i[B]="^\\s*("+i[C]+")\\s+-\\s+("+i[C]+")\\s*$";var U=s++;i[U]="^\\s*("+i[S]+")\\s+-\\s+("+i[S]+")\\s*$";var H=s++;i[H]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)n(W,i[W]),o[W]||(o[W]=new RegExp(i[W]));function z(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?o[w]:o[y]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?o[w]:o[y]);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>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&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},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var n=z(e),r=z(t),o="";if(n.prerelease.length||r.prerelease.length){o="pre";var i="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==r[s])return o+s;return i},t.compareIdentifiers=G;var V=/^[0-9]+$/;function G(e,t){var n=V.test(e),r=V.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return J(e,t,n)<0}function Y(e,t,n){return 0===J(e,t,n)}function Z(e,t,n){return 0!==J(e,t,n)}function ee(e,t,n){return J(e,t,n)>=0}function te(e,t,n){return J(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Y(e,n,r);case"!=":return Z(e,n,r);case">":return X(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===oe?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return G(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var oe={};function ie(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ie)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ie(e.raw,t);if(e instanceof re)return new ie(e.value,t);if(!(this instanceof ie))return new ie(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function se(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,o,i,s,a,c,l,u,d,p){return((t=se(n)?"":se(r)?">="+n+".0.0":se(o)?">="+n+"."+r+".0":">="+t)+" "+(a=se(c)?"":se(l)?"<"+(+c+1)+".0.0":se(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function ce(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new ie(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var o,i,s,a,c;switch(e=new K(e,r),t=new ie(t,r),n){case">":o=X,i=te,s=Q,a=">",c=">=";break;case"<":o=Q,i=ee,s=X,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,r)?d=e:s(e.semver,p.semver,r)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?o[j]:o[F],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=oe},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===oe||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new ie(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new ie(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&s||a||c},t.Range=ie,ie.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},ie.prototype.toString=function(){return this.range},ie.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[U]:o[B];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(o[q],"$1$2$3"),n("comparator trim",e,o[q]),e=(e=(e=e.replace(o[O],"$1~")).replace(o[M],"$1^")).split(/\s+/).join(" ");var i=t?o[j]:o[F],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[$]:o[L];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?o[N]:o[A];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),se(r)?a="":se(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":se(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?o[P]:o[k];return e.replace(r,(function(t,r,o,i,s,a){n("xRange",e,t,r,o,i,s,a);var c=se(o),l=c||se(i),u=l||se(s);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(i=0),s=0,">"===r?(r=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),t=r+o+"."+i+"."+s):l?t=">="+o+".0.0 <"+(+o+1)+".0.0":u&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[H],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(i)}))),s.map((function(e){return new re(e,this.options)}),this)},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new ie(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},ie.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!X(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new ie(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=z(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new ie(e,n),t=new ie(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(o[I]);return null==t?null:z(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},7267:(e,t,n)=>{"use strict";var r=n(4403),o=r.wrap,i=r.unwrap,s="wrap@before";function a(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function c(e,t){var n;return n=e._events&&e._events[t],Array.isArray(n)||(n=n?[n]:[]),n}function l(e,t){if(e){var n=e;if("function"==typeof e)n=t(e);else if(Array.isArray(e)){n=[];for(var r=0;r0&&function(e,t){for(var n=t.length,r=0;r{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},7418:(e,t,n)=>{"use strict";var r=n(1320),o=n(8049);e.exports=function(e){var t=r(e);return t.token="","x-oauth-basic"===t.password?t.token=t.user:"x-token-auth"===t.user&&(t.token=t.password),o(t.protocols)||0===t.protocols.length&&o(e)?t.protocol="ssh":t.protocols.length?t.protocol=t.protocols[0]:(t.protocol="file",t.protocols=["file"]),t.href=t.href.replace(/\/$/,""),t}},6314:(e,t,n)=>{"use strict";var r=n(7418);function o(e){if("string"!=typeof e)throw new Error("The url must be a string.");/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i.test(e)&&(e="https://github.com/"+e);var t=r(e),n=t.resource.split("."),i=null;switch(t.toString=function(e){return o.stringify(this,e)},t.source=n.length>2?n.slice(1-n.length).join("."):t.source=t.resource,t.git_suffix=/\.git$/.test(t.pathname),t.name=decodeURIComponent((t.pathname||t.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),t.owner=decodeURIComponent(t.user),t.source){case"git.cloudforge.com":t.owner=t.user,t.organization=n[0],t.source="cloudforge.com";break;case"visualstudio.com":if("vs-ssh.visualstudio.com"===t.resource){4===(i=t.name.split("/")).length&&(t.organization=i[1],t.owner=i[2],t.name=i[3],t.full_name=i[2]+"/"+i[3]);break}2===(i=t.name.split("/")).length?(t.owner=i[1],t.name=i[1],t.full_name="_git/"+t.name):3===i.length?(t.name=i[2],"DefaultCollection"===i[0]?(t.owner=i[2],t.organization=i[0],t.full_name=t.organization+"/_git/"+t.name):(t.owner=i[0],t.full_name=t.owner+"/_git/"+t.name)):4===i.length&&(t.organization=i[0],t.owner=i[1],t.name=i[3],t.full_name=t.organization+"/"+t.owner+"/_git/"+t.name);break;case"dev.azure.com":case"azure.com":if("ssh.dev.azure.com"===t.resource){4===(i=t.name.split("/")).length&&(t.organization=i[1],t.owner=i[2],t.name=i[3]);break}5===(i=t.name.split("/")).length?(t.organization=i[0],t.owner=i[1],t.name=i[4],t.full_name="_git/"+t.name):3===i.length?(t.name=i[2],"DefaultCollection"===i[0]?(t.owner=i[2],t.organization=i[0],t.full_name=t.organization+"/_git/"+t.name):(t.owner=i[0],t.full_name=t.owner+"/_git/"+t.name)):4===i.length&&(t.organization=i[0],t.owner=i[1],t.name=i[3],t.full_name=t.organization+"/"+t.owner+"/_git/"+t.name),t.query&&t.query.path&&(t.filepath=t.query.path.replace(/^\/+/g,"")),t.query&&t.query.version&&(t.ref=t.query.version.replace(/^GB/,""));break;default:var s=(i=t.name.split("/")).length-1;if(i.length>=2){var a=i.indexOf("-",2),c=i.indexOf("blob",2),l=i.indexOf("tree",2),u=i.indexOf("commit",2),d=i.indexOf("src",2),p=i.indexOf("raw",2),h=i.indexOf("edit",2);s=a>0?a-1:c>0?c-1:l>0?l-1:u>0?u-1:d>0?d-1:p>0?p-1:h>0?h-1:s,t.owner=i.slice(0,s).join("/"),t.name=i[s],u&&(t.commit=i[s+2])}t.ref="",t.filepathtype="",t.filepath="";var f=i.length>s&&"-"===i[s+1]?s+1:s;i.length>f+2&&["raw","src","blob","tree","edit"].indexOf(i[f+1])>=0&&(t.filepathtype=i[f+1],t.ref=i[f+2],i.length>f+3&&(t.filepath=i.slice(f+3).join("/"))),t.organization=t.owner}t.full_name||(t.full_name=t.owner,t.name&&(t.full_name&&(t.full_name+="/"),t.full_name+=t.name)),t.owner.startsWith("scm/")&&(t.source="bitbucket-server",t.owner=t.owner.replace("scm/",""),t.organization=t.owner,t.full_name=t.owner+"/"+t.name);var m=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/.exec(t.pathname);return null!=m&&(t.source="bitbucket-server","users"===m[1]?t.owner="~"+m[2]:t.owner=m[2],t.organization=t.owner,t.name=m[3],(i=m[4].split("/")).length>1&&(["raw","browse"].indexOf(i[1])>=0?(t.filepathtype=i[1],i.length>2&&(t.filepath=i.slice(2).join("/"))):"commits"===i[1]&&i.length>2&&(t.commit=i[2])),t.full_name=t.owner+"/"+t.name,t.query.at?t.ref=t.query.at:t.ref=""),t}o.stringify=function(e,t){t=t||(e.protocols&&e.protocols.length?e.protocols.join("+"):e.protocol);var n=e.port?":"+e.port:"",r=e.user||"git",o=e.git_suffix?".git":"";switch(t){case"ssh":return n?"ssh://"+r+"@"+e.resource+n+"/"+e.full_name+o:r+"@"+e.resource+":"+e.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return t+"://"+r+"@"+e.resource+n+"/"+e.full_name+o;case"http":case"https":return t+"://"+(e.token?function(e){return"bitbucket.org"===e.source?"x-token-auth:"+e.token+"@":e.token+"@"}(e):e.user&&(e.protocols.includes("http")||e.protocols.includes("https"))?e.user+"@":"")+e.resource+n+"/"+function(e){return"bitbucket-server"===e.source?"scm/"+e.full_name:""+e.full_name}(e)+o;default:return e.href}},e.exports=o},1875:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return-1!==r&&(-1===o||r{"use strict";const t=new Set([200,203,204,206,300,301,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),r=new Set([500,502,503,504]),o={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},i={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function s(e){const t=parseInt(e,10);return isFinite(t)?t:0}function a(e){const t={};if(!e)return t;const n=e.trim().split(/\s*,\s*/);for(const e of n){const[n,r]=e.split(/\s*=\s*/,2);t[n]=void 0===r||r.replace(/^"|"$/g,"")}return t}function c(e){let t=[];for(const n in e){const r=e[n];t.push(!0===r?n:n+"="+r)}if(t.length)return t.join(", ")}e.exports=class{constructor(e,t,{shared:n,cacheHeuristic:r,immutableMinTimeToLive:o,ignoreCargoCult:i,_fromObject:s}={}){if(s)this._fromObject(s);else{if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=!1!==n,this._cacheHeuristic=void 0!==r?r:.1,this._immutableMinTtl=void 0!==o?o:864e5,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=a(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=a(e.headers["cache-control"]),i&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!n.has(this._status)||this._rescc["no-store"]||this._isShared&&this._rescc.private||this._isShared&&!this._noAuthorization&&!this._allowsStoringAuthenticated()||!(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=a(e.headers["cache-control"]);return!t["no-cache"]&&!/no-cache/.test(e.headers.pragma)&&(!(t["max-age"]&&this.age()>t["max-age"])&&(!(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"])&&(!(this.stale()&&(!t["max-stale"]||this._rescc["must-revalidate"]||!(!0===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge())))&&this._requestMatches(e,!1))))}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){const t={};for(const n in e)o[n]||(t[n]=e[n]);if(e.connection){const n=e.connection.trim().split(/\s*,\s*/);for(const e of n)delete t[e]}if(t.warning){const e=t.warning.split(/,/).filter((e=>!/^\s*1[0-9][0-9]/.test(e)));e.length?t.warning=e.join(",").trim():delete t.warning}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){const e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return s(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"])return 0;if(this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)return 0;if("*"===this._resHeaders.vary)return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return s(this._rescc["s-maxage"])}if(this._rescc["max-age"])return s(this._rescc["max-age"]);const e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){const n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){const e=this.maxAge()-this.age(),t=e+s(this._rescc["stale-if-error"]),n=e+s(this._rescc["stale-while-revalidate"]);return 1e3*Math.max(0,e,t,n)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+s(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+s(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||1!==e.v)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=void 0!==e.imm?e.imm:864e5,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete t["if-modified-since"],t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter((e=>!/^\s*W\//.test(e)));e.length?t["if-none-match"]=e.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&function(e){return!e||r.has(e.status)}(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let n=!1;if(void 0!==t.status&&304!=t.status?n=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===t.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||t.headers.etag||t.headers["last-modified"]||(n=!0),!n)return{policy:new this.constructor(e,t),modified:304!=t.status,matches:!1};const o={};for(const e in this._resHeaders)o[e]=e in t.headers&&!i[e]?t.headers[e]:this._resHeaders[e];const s=Object.assign({},t,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}},7546:(e,t,n)=>{"use strict";const r=n(7147);let o;e.exports=()=>(void 0===o&&(o=function(){try{return r.statSync("/.dockerenv"),!0}catch(e){return!1}}()||function(){try{return r.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return!1}}()),o)},8049:(e,t,n)=>{"use strict";var r=n(8173);e.exports=function e(t){if(Array.isArray(t))return-1!==t.indexOf("ssh")||-1!==t.indexOf("rsync");if("string"!=typeof t)return!1;var n=r(t);if(t=t.substring(t.indexOf("://")+3),e(n))return!0;var o=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(o)&&t.indexOf("@"){"use strict";const r=n(2037),o=n(7147),i=n(7546),s=()=>{if("linux"!==process.platform)return!1;if(r.release().toLowerCase().includes("microsoft"))return!i();try{return!!o.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!i()}catch(e){return!1}};process.env.__IS_WSL_TEST__?e.exports=s:e.exports=s()},5127:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,o,i,s,a,c,l,u,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in r(i,s,a,c,l,u,d),i){var h=i[p];if(Array.isArray(h)){if(p in t.arrayKeywords)for(var f=0;f{var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,s){s=s||{};var a,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=o?i(a,c,o,"day"):c>=r?i(a,c,r,"hour"):c>=n?i(a,c,n,"minute"):c>=t?i(a,c,t,"second"):a+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},1814:(e,t,n)=>{const r=n(1017),o=n(2081),{promises:i,constants:s}=n(7147),a=n(7684),c=n(7546),l=n(1321),u=r.join(__dirname,"xdg-open"),{platform:d,arch:p}=process,h=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await i.access(n,s.F_OK),r=!0}catch{}if(!r)return e;const o=await i.readFile(n,{encoding:"utf8"}),a=/(?.*)/g.exec(o);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),f=async(e,t)=>{let n;for(const r of e)try{return await t(r)}catch(e){n=e}throw n},m=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return f(e.app,(t=>m({...e,app:t})));let t,{name:n,arguments:r=[]}=e.app||{};if(r=[...r],Array.isArray(n))return f(n,(t=>m({...e,app:{name:t,arguments:r}})));const l=[],p={};if("darwin"===d)t="open",e.wait&&l.push("--wait-apps"),e.background&&l.push("--background"),e.newInstance&&l.push("--new"),n&&l.push("-a",n);else if("win32"===d||a&&!c()){const o=await h();t=a?`${o}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,l.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),a||(p.windowsVerbatimArguments=!0);const i=["Start"];e.wait&&i.push("-Wait"),n?(i.push(`"\`"${n}\`""`,"-ArgumentList"),e.target&&r.unshift(e.target)):e.target&&i.push(`"${e.target}"`),r.length>0&&(r=r.map((e=>`"\`"${e}\`""`)),i.push(r.join(","))),e.target=Buffer.from(i.join(" "),"utf16le").toString("base64")}else{if(n)t=n;else{const e="/"===__dirname;let n=!1;try{await i.access(u,s.X_OK),n=!0}catch{}t=process.versions.electron||"android"===d||e||!n?"xdg-open":u}r.length>0&&l.push(...r),e.wait||(p.stdio="ignore",p.detached=!0)}e.target&&l.push(e.target),"darwin"===d&&r.length>0&&l.push("--args",...r);const g=o.spawn(t,l,p);return e.wait?new Promise(((t,n)=>{g.once("error",n),g.once("close",(r=>{e.allowNonzeroExitCode&&r>0?n(new Error(`Exited with code ${r}`)):t(g)}))})):(g.unref(),g)},g=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return m({...t,target:e})};function _(e){if("string"==typeof e||Array.isArray(e))return e;const{[p]:t}=e;if(!t)throw new Error(`${p} is not supported`);return t}function y({[d]:e},{wsl:t}){if(t&&a)return _(t);if(!e)throw new Error(`${d} is not supported`);return _(e)}const v={};l(v,"chrome",(()=>y({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}))),l(v,"firefox",(()=>y({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}))),l(v,"edge",(()=>y({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}))),g.apps=v,g.openApp=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `name`");const{arguments:n=[]}=t||{};if(null!=n&&!Array.isArray(n))throw new TypeError("Expected `appArguments` as Array type");return m({...t,app:{name:e,arguments:n}})},e.exports=g},1756:(e,t,n)=>{"use strict";var r=n(8173);e.exports=function(e){var t={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:e,query:{},parse_failed:!1};try{var n=new URL(e);t.protocols=r(n),t.protocol=t.protocols[0],t.port=n.port,t.resource=n.hostname,t.host=n.host,t.user=n.username||"",t.password=n.password||"",t.pathname=n.pathname,t.hash=n.hash.slice(1),t.search=n.search.slice(1),t.href=n.href,t.query=Object.fromEntries(n.searchParams)}catch(n){t.protocols=["file"],t.protocol=t.protocols[0],t.port="",t.resource="",t.user="",t.pathname="",t.hash="",t.search="",t.href=e,t.query={},t.parse_failed=!0}return t}},1320:(e,t,n)=>{"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(n(1756));const i=(e,t)=>t.some((t=>t instanceof RegExp?t.test(e):t===e));const s=(e,t=!1)=>{const n=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/,r=t=>{const n=new Error(t);throw n.subject_url=e,n};"string"==typeof e&&e.trim()||r("Invalid url."),e.length>s.MAX_INPUT_LENGTH&&r("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),t&&("object"!=typeof t&&(t={stripHash:!1}),e=function(e,t){if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...t},e=e.trim(),/^data:/i.test(e))return((e,{stripHash:t})=>{const n=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!n)throw new Error(`Invalid URL: ${e}`);let{type:r,data:o,hash:i}=n.groups;const s=r.split(";");i=t?"":i;let a=!1;"base64"===s[s.length-1]&&(s.pop(),a=!0);const c=(s.shift()||"").toLowerCase(),l=[...s.map((e=>{let[t,n=""]=e.split("=").map((e=>e.trim()));return"charset"===t&&(n=n.toLowerCase(),"us-ascii"===n)?"":`${t}${n?`=${n}`:""}`})).filter(Boolean)];return a&&l.push("base64"),(l.length>0||c&&"text/plain"!==c)&&l.unshift(c),`data:${l.join(";")},${a?o.trim():o}${i?`#${i}`:""}`})(e,t);if(/^view-source:/i.test(e))throw new Error("`view-source:` is not supported as it is a non-standard protocol");const n=e.startsWith("//");!n&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));const r=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&"https:"===r.protocol&&(r.protocol="http:"),t.forceHttps&&"http:"===r.protocol&&(r.protocol="https:"),t.stripAuthentication&&(r.username="",r.password=""),t.stripHash?r.hash="":t.stripTextFragment&&(r.hash=r.hash.replace(/#?:~:text.*?$/i,"")),r.pathname){const e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let t=0,n="";for(;;){const o=e.exec(r.pathname);if(!o)break;const i=o[0],s=o.index;n+=r.pathname.slice(t,s).replace(/\/{2,}/g,"/"),n+=i,t=s+i.length}n+=r.pathname.slice(t,r.pathname.length).replace(/\/{2,}/g,"/"),r.pathname=n}if(r.pathname)try{r.pathname=decodeURI(r.pathname)}catch{}if(!0===t.removeDirectoryIndex&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=r.pathname.split("/");const n=e[e.length-1];i(n,t.removeDirectoryIndex)&&(e=e.slice(0,-1),r.pathname=e.slice(1).join("/")+"/")}if(r.hostname&&(r.hostname=r.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname)&&(r.hostname=r.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(const e of[...r.searchParams.keys()])i(e,t.removeQueryParameters)&&r.searchParams.delete(e);if(!0===t.removeQueryParameters&&(r.search=""),t.sortQueryParameters){r.searchParams.sort();try{r.search=decodeURIComponent(r.search)}catch{}}t.removeTrailingSlash&&(r.pathname=r.pathname.replace(/\/$/,""));const o=e;return e=r.toString(),t.removeSingleSlash||"/"!==r.pathname||o.endsWith("/")||""!==r.hash||(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||"/"===r.pathname)&&""===r.hash&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),n&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}(e,t));const a=o.default(e);if(a.parse_failed){const e=a.href.match(n);e?(a.protocols=["ssh"],a.protocol="ssh",a.resource=e[2],a.host=e[2],a.user=e[1],a.pathname=`/${e[3]}`,a.parse_failed=!1):r("URL parsing failed.")}return a};s.MAX_INPUT_LENGTH=2048,e.exports=s},8173:e=>{"use strict";e.exports=function(e,t){!0===t&&(t=0);var n="";if("string"==typeof e)try{n=new URL(e).protocol}catch(e){}else e&&e.constructor===URL&&(n=e.protocol);var r=n.split(/\:|\+/).filter(Boolean);return"number"==typeof t?r[t]:r}},4403:e=>{"use strict";function t(e){return"function"==typeof e}var n=console.error.bind(console);function r(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function o(e){e&&e.logger&&(t(e.logger)?n=e.logger:n("new logger isn't a function, not replacing"))}function i(e,o,i){if(e&&e[o]){if(!i)return n("no wrapper function"),void n((new Error).stack);if(t(e[o])&&t(i)){var s=e[o],a=i(s,o);return r(a,"__original",s),r(a,"__unwrap",(function(){e[o]===a&&r(e,o,s)})),r(a,"__wrapped",!0),r(e,o,a),a}n("original object and wrapper must be functions")}else n("no original function "+o+" to wrap")}function s(e,t){return e&&e[t]?e[t].__unwrap?e[t].__unwrap():void n("no original to unwrap to -- has "+t+" already been unwrapped?"):(n("no function to unwrap."),void n((new Error).stack))}o.wrap=i,o.massWrap=function(e,t,r){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){i(e,t,r)}))})):n("must provide one or more functions to wrap on modules")},o.unwrap=s,o.massUnwrap=function(e,t){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){s(e,t)}))})):n("must provide one or more functions to unwrap on modules")},e.exports=o},3031:e=>{e.exports=function(e,t){var n=[];n.push(function(e){try{return Error.prototype.toString.call(e)}catch(e){try{return""}catch(e){return""}}}(e));for(var r=0;r"}catch(e){o=""}}n.push(" at "+o)}return n.join("\n")}},6818:(e,t,n)=>{if(global._stackChain){if(global._stackChain.version!==n(735).i8)throw new Error("Conflicting version of stack-chain found");e.exports=global._stackChain}else e.exports=global._stackChain=n(2396)},2396:(e,t,n)=>{var r=n(3031);function o(){this.extend=new a,this.filter=new a,this.format=new c,this.version=n(735).i8}var i=!1;o.prototype.callSite=function e(t){t||(t={}),i=!0;var n={};Error.captureStackTrace(n,e);var r=n.stack;return i=!1,r=r.slice(t.slice||0),t.extend&&(r=this.extend._modify(n,r)),t.filter&&(r=this.filter._modify(n,r)),r};var s=new o;function a(){this._modifiers=[]}function c(){this._formater=r,this._previous=void 0}a.prototype._modify=function(e,t){for(var n=0,r=this._modifiers.length;n{"use strict";const r=n(2037),o=n(1875),i=process.env;let s;function a(e){const t=function(e){if(!1===s)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!e.isTTY&&!0!==s)return 0;const t=s?1:0;if("win32"===process.platform){const e=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||"codeship"===i.CI_NAME?1:t;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}o("no-color")||o("no-colors")||o("color=false")?s=!1:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(s=!0),"FORCE_COLOR"in i&&(s=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},3406:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GitHubDeviceFlow=void 0;const r=n(9800),o=n(39),i="Iv1.b507a08c87ecfe98";async function s(e,t){const n={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4};return e.get(o.Fetcher).fetch("https://github.com/login/oauth/access_token",n).then((e=>e.json()))}async function a(e,t){return e.get(o.Fetcher).fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}}).then((e=>e.json()))}t.GitHubDeviceFlow=class{async getToken(e){const t=await async function(e){const t={method:"POST",headers:{Accept:"application/json",...(0,r.editorVersionHeaders)(e)},json:{client_id:i,scope:"read:user"},timeout:3e4},n=e.get(o.Fetcher).fetch("https://github.com/login/device/code",t);return(await n).json()}(e),n=new Promise((async(n,r)=>{let o,i=t.expires_in;for(;i>0;){const r=await s(e,t.device_code);if(i-=t.interval,await new Promise((e=>setTimeout(e,1e3*t.interval))),o=r.access_token,o)return void n({user:(await a(e,o)).login,oauth_token:o})}r("Timed out waiting for login to complete")}));return{...t,waitForAuth:n}}}},9321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestContext=t.AuthManager=void 0;const r=n(5765),o=n(150),i=n(5611),s=n(5381);class a{constructor(e,t){this.persistenceManager=e,this.mkTokenManager=t,this._pendingSignIn=void 0}getCopilotTokenManager(){return this._copilotTokenManager}setPendingSignIn(e){this._pendingSignIn=e}getPendingSignIn(){return this._pendingSignIn}async checkAndUpdateStatus(e,t){var n;const r=null!==(n=null==t?void 0:t.localChecksOnly)&&void 0!==n&&n;let o;if("true"===process.env.CODESPACES&&process.env.GITHUB_TOKEN&&(o={user:process.env.GITHUB_USER||"codespace-user",oauth_token:process.env.GITHUB_TOKEN}),void 0===o&&(o=await this.getAuthRecord()),void 0===o)return this._copilotTokenManager=void 0,{status:"NotSignedIn"};if(r)return{status:"MaybeOK",user:o.user};const i={token:o.oauth_token};o.dev_override&&(i.devOverride={copilotTokenUrl:o.dev_override.copilot_token_url,notificationUrl:o.dev_override.notification_url});const s=this.mkTokenManager(i),a=await s.checkCopilotToken(e);return"status"in a?"unconfigured"===a.telemetry&&!1===await this.getTelemetryConsent(o.user)?(this._copilotTokenManager=void 0,{status:"NoTelemetryConsent",user:o.user}):(this._copilotTokenManager=s,{status:"OK",user:o.user}):(this._copilotTokenManager=void 0,{status:"HTTP401"===a.reason?"NotSignedIn":a.reason,user:o.user})}async getAuthRecord(){return await this.persistenceManager.read("hosts","github.com")}async setAuthRecord(e){await this.persistenceManager.update("hosts","github.com",e)}async deleteAuthRecord(){await this.persistenceManager.delete("hosts","github.com")}async getTelemetryConsent(e){const t=await this.persistenceManager.read("terms",e);return!(!(null==t?void 0:t.version)||t.version!==o.LAST_TELEMETRY_TERMS_UPDATE)}async recordTelemetryConsent(e){await this.persistenceManager.update("terms",e,{version:o.LAST_TELEMETRY_TERMS_UPDATE})}}t.AuthManager=a,t.createRequestContext=async function(e,t){let n=t;if(void 0===n&&(n=e.get(a).getCopilotTokenManager()),void 0===n){const t=await e.get(a).checkAndUpdateStatus(e);if("OK"!==t.status)return{code:s.ErrorCode.NoCopilotToken,message:`Not authenticated: ${t.status}`};if(n=e.get(a).getCopilotTokenManager(),void 0===n)return{code:s.ErrorCode.InternalError,message:"Unexpected missing Copilot token"}}const o=new i.Context(e);return o.set(r.CopilotTokenManager,n),o}},9582:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.MergedToken=void 0;const n=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}})),r=Object.freeze({isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),o=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n});class i{constructor(){this._isCancelled=!1,this.handlers=[]}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}get isCancellationRequested(){return this._isCancelled}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}dispose(){this.handlers=[]}}t.MergedToken=class{constructor(e){this.tokens=[],this.handlers=[],this._isCancelled=!1,this.tokens=e,this._isCancelled=e.some((e=>e.isCancellationRequested)),e.forEach((e=>{e.onCancellationRequested(this.cancel,this)}))}cancel(){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach((e=>e(void 0))))}dispose(){this.tokens=[]}get isCancellationRequested(){return this.tokens.some((e=>e.isCancellationRequested))}onCancellationRequested(e,t,r){return this._isCancelled?n(e,t):(this.handlers.push(e.bind(t)),{dispose:()=>{}})}},t.CancellationTokenSource=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new i),this._token}cancel(){this._token?this._token instanceof i&&this._token.cancel():this._token=o}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof i&&this._token.dispose():this._token=r}}},8212:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.extensions=t.workspace=t.env=t.UIKind=t.EndOfLine=void 0,(r=t.EndOfLine||(t.EndOfLine={}))[r.LF=1]="LF",r[r.CRLF=2]="CRLF",function(e){e[e.Web=0]="Web",e[e.Desktop=1]="Desktop"}(n=t.UIKind||(t.UIKind={})),t.env={isTelemetryEnabled:!0,uiKind:n.Desktop,appRoot:"/non-existent-path"},t.workspace={onDidChangeConfiguration:()=>{},getConfiguration:()=>({})},t.extensions={getExtension:e=>{}}},3895:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentEditorInfo=t.AgentConfigProvider=void 0;const r=n(9800);class o extends r.InMemoryConfigProvider{constructor(){super(new r.DefaultsOnlyConfigProvider,new Map)}getOptionalConfig(e){if(!Array.isArray(e)||"editor"!=e[0]||this.isDefaultSettingOverwritten(e))return super.getConfig(e)}}t.AgentConfigProvider=o;class i extends r.EditorAndPluginInfo{setEditorAndPluginInfo(e,t){this._editorInfo=e,this._editorPluginInfo=t}getEditorInfo(e){return this._editorInfo?this._editorInfo:{name:"unknown-editor",version:"0"}}getEditorPluginInfo(e){return this._editorPluginInfo?this._editorPluginInfo:{name:"unknown-editor-plugin",version:"0"}}}t.AgentEditorInfo=i},3007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotCompletionCache=void 0;const r=n(140);class o extends r.LRUCache{constructor(e=100){super(e)}}t.CopilotCompletionCache=o},4445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugServer=void 0;const r=n(2361),o=n(7147),i=n(3685),s=n(1017),a=n(2781);function c(e,t){e.write("data: "+t.toString().replace(/\n/g,"\ndata: ")+"\n\n")}t.DebugServer=class{constructor(e){this.port=e,this.stdoutEmitter=new r.EventEmitter,this.server=i.createServer(((e,t)=>{if(e.headers.accept&&"text/event-stream"==e.headers.accept)switch(t.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),e.url){case"/stdin":return void process.stdin.on("data",(e=>{c(t,e)}));case"/stdout":return void this.stdoutEmitter.on("data",(e=>{c(t,e)}));default:return t.writeHead(404),void t.end()}t.writeHead(200,{"Content-Type":"text/html"});let n,r=__dirname;"dist"===s.basename(__dirname)&&(r=s.dirname(__dirname));try{n=o.readFileSync(s.join(r,"dist","debugServer.html"))}catch(e){n=e.toString()}t.write(n),t.end()}))}wrapStdout(e){return new a.Writable({write:(t,n,r)=>(this.stdoutEmitter.emit("data",t),e.write(t,n,r))})}listen(){return this.server.listen(this.port),this}}},9841:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationLogger=void 0;const r=n(7089),o=n(5798),i=n(7214);class s extends o.LogTarget{constructor(e){super(),this.debugMode=e}logIt(e,t,n,...s){const a={level:t,message:`${n} ${s.map(o.toPlainText)}`,metadataStr:n,extra:s.map(o.toPlainText)};e.get(i.AgentNotificationSender).sendNotification(new r.NotificationType("LogMessage"),a)}shouldLog(e,t){return!!this.debugMode||t>o.LogLevel.DEBUG}}t.NotificationLogger=s},1926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationStatusReporter=void 0;const r=n(7089),o=n(7214);t.NotificationStatusReporter=class{constructor(e){this.ctx=e,this.notificationEndpoint="statusNotification",this.status="Normal"}setProgress(){"Error"!==this.status&&(this.status="InProgress",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"InProgress",message:""}))}removeProgress(){"Error"!==this.status&&"Warning"!==this.status&&(this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""}))}forceNormal(){this.status="Normal",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Normal",message:""})}setWarning(){"Error"!==this.status&&(this.status="Warning",this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),{status:"Warning",message:""}))}setError(e){this.status="Error";const t={status:"Error",message:e};this.ctx.get(o.AgentNotificationSender).sendNotification(new r.NotificationType(this.notificationEndpoint),t)}}},6021:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.agentFileSystem=void 0;const r=n(7147);t.agentFileSystem={readFile:function(e){return r.promises.readFile(e)},mtime:async function(e){return(await r.promises.stat(e)).mtimeMs},stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},9729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sessionId=t.getMachineId=void 0;const r=n(6113),o=n(2037),i=n(7057),s=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function a(e){const t=e.replace(/-/g,":").toLowerCase();return!s.has(t)}let c;t.getMachineId=function(){if(!c){const e=function(){try{const e=function(){const e=(0,o.networkInterfaces)();for(const t in e){const n=e[t];if(n)for(const{mac:e}of n)if(a(e))return e}throw new Error("Unable to retrieve mac address (unexpected format)")}();return r.createHash("sha256").update(e,"utf8").digest("hex")}catch(e){return}}();c=e||i.v4()}return c},t.sessionId=i.v4()+Date.now()},6995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.initializeLateDependencies=t.init=void 0;const r=n(4617),o=n(5765),i=n(2137),s=n(9800),a=n(5611),c=n(446),l=n(6905),u=n(6046),d=n(6817),p=n(4619),h=n(5798),f=n(39),m=n(598),g=n(5489),_=n(913),y=n(2369),v=n(4567),b=n(3406),w=n(9321),x=n(3895),T=n(3007),E=n(6021),C=n(9729),S=n(5332),k=n(585),P=n(2401);t.init=function(){const e=new a.Context;e.set(i.Clock,new i.Clock),e.set(s.ConfigProvider,new x.AgentConfigProvider),e.set(s.BuildInfo,new s.BuildInfo),function(e){e.set(_.RuntimeMode,_.RuntimeMode.fromEnvironment(!1)),e.set(h.LogVerbose,new h.LogVerbose((0,_.isVerboseLoggingEnabled)(e))),e.set(h.LogTarget,new h.ConsoleLog(console))}(e),t.logger.debug(e,"Initializing agent"),e.set(u.ExpConfigMaker,new u.ExpConfigNone);const n=(0,k.makeXdgPersistenceManager)();e.set(k.PersistenceManager,n);const I=new w.AuthManager(n,(e=>new o.CopilotTokenManagerFromGitHubToken(e)));e.set(b.GitHubDeviceFlow,new b.GitHubDeviceFlow),e.set(w.AuthManager,I);const R=new s.VscInfo(C.sessionId,(0,C.getMachineId)(),(0,s.getVersion)(e));return e.set(s.VscInfo,R),e.set(s.EditorAndPluginInfo,new x.AgentEditorInfo),e.set(p.GhostTextDebounceManager,new p.GhostTextDebounceManager),e.set(d.ContextualFilterManager,new d.ContextualFilterManager),e.set(f.Fetcher,new f.HelixFetcher(e)),e.set(m.OpenAIFetcher,new m.LiveOpenAIFetcher),e.set(v.UrlOpener,new v.RealUrlOpener),e.set(s.BlockModeConfig,new s.ConfigBlockModeConfig),e.set(S.MethodHandlers,(0,S.getAllMethods)()),e.set(S.NotificationHandlers,(0,S.getAllNotifications)()),e.set(T.CopilotCompletionCache,new T.CopilotCompletionCache),e.set(y.LocationFactory,new P.AgentLocationFactory),e.set(l.Features,new l.Features(e)),e.set(r.FileSystem,E.agentFileSystem),e.set(g.TelemetryReporters,(0,g.setupEmptyReporters)()),(0,f.init)((0,s.getVersion)(e)),(0,c.registerDefaultHandlers)(e,"agent"),process.on("exit",(()=>{try{t.logger.debug(e,"Shutting down agent"),e.get(g.TelemetryReporters).deactivate()}catch(e){}})),e},t.initializeLateDependencies=function(e){e.set(g.TelemetryEndpointUrlOverride,g.telemetryEndpointUrlOverride),(0,g.setupStandardReporters)(e,"agent"),t.logger.debug(e,"Telemetry initialized")},t.logger=new h.Logger(h.LogLevel.DEBUG,"agent")},6934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(6159),c=r.Type.Object({options:r.Type.Optional(r.Type.Intersect([r.Type.Object({localChecksOnly:r.Type.Optional(r.Type.Boolean())}),a.TestingOptions]))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){var r;if(!l(n)){const e=(0,s.extractAjvErrors)(l.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,a.getTestingContext)(n.options.testingCtx)),[await e.get(i.AuthManager).checkAndUpdateStatus(e,n.options),null]}},3340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetCompletionsCycling=t.handleGetCompletions=void 0;const r=n(892),o=n(6236),i=n(7057),s=n(6630),a=n(5611),c=n(3993),l=n(702),u=n(1749),d=n(5489),p=n(2369),h=n(9321),f=n(9582),m=n(3007),g=n(5381),_=n(7838),y=n(6159),v=n(2401),b=n(2930),w=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),insertSpaces:r.Type.Optional(r.Type.Boolean()),tabSize:r.Type.Optional(r.Type.Number()),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),options:r.Type.Optional(y.TestingOptions)}),x=(new o.default).compile(r.Type.Strict(w));let T;async function E(e,t,n,r,o){var w;const E=d.TelemetryData.createAndMarkAsIssued();T&&(T.cancel(),T.dispose()),T=new f.CancellationTokenSource;const C=new f.MergedToken([t,T.token]);if(!x(n)){const e=(0,g.extractAjvErrors)(x.errors);return[null,{code:g.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let S;void 0!==(null===(w=n.options)||void 0===w?void 0:w.testingCtx)&&(e=(0,y.getTestingContext)(n.options.testingCtx));try{S=e.get(b.CompletionDocuments)}catch(e){}if(S){const e=o?3:1;return[{completions:S.documents.slice(0,e).map((e=>{const{cursorLine:t,lines:r,start:o,end:s}=(0,_.parseChallengeDoc)(e,n.doc.position),a=[t.slice(Math.min(o.character,n.doc.position.character))].concat(r.slice(n.doc.position.line+1)).join("\n");return{uuid:i.v4(),text:a,displayText:a,position:n.doc.position,range:{start:o,end:s}}}))},null]}const k=await(0,h.createRequestContext)(e,r);if(!(k instanceof a.Context))return[null,k];const P=s.URI.parse(n.doc.uri);let I;try{I=await(0,v.getTextDocumentChecked)(e,P,n.doc)}catch(e){return[null,{code:g.ErrorCode.InvalidParams,message:e.message}]}const R=I.offsetAt(k.get(p.LocationFactory).position(n.doc.position.line,n.doc.position.character)),O=I.positionAt(R),A=await(0,l.getGhostText)(k,I,O,o,E,C),N=await(0,u.handleGhostTextResultTelemetry)(e,A);if(!N)return[{completions:[]},null];const[D,M]=N,L=(0,c.completionsFromGhostTextResults)(e,D,M,I,O,n.doc),$=e.get(m.CopilotCompletionCache);for(const e of L)$.put(e.uuid,e);return[{completions:L.map((e=>({uuid:e.uuid,text:e.text,range:e.range,displayText:e.displayText,position:e.position})))},null]}t.handleGetCompletions=async function(e,t,n,r){return E(e,t,n,r,!1)},t.handleGetCompletionsCycling=async function(e,t,n,r){return E(e,t,n,r,!0)}},9638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGetPanelCompletions=void 0;const r=n(892),o=n(6236),i=n(6679),s=n(7057),a=n(5809),c=n(6630),l=n(9800),u=n(5611),d=n(5680),p=n(6317),h=n(5489),f=n(2369),m=n(9321),g=n(9582),_=n(7214),y=n(5381),v=n(7838),b=n(6159),w=n(2401),x=n(8730),T=r.Type.Object({doc:r.Type.Object({position:r.Type.Object({line:r.Type.Number({minimum:0}),character:r.Type.Number({minimum:0})}),uri:r.Type.String(),source:r.Type.Optional(r.Type.String()),languageId:r.Type.Optional(r.Type.String()),relativePath:r.Type.Optional(r.Type.String())}),panelId:r.Type.String(),options:r.Type.Optional(b.TestingOptions)}),E=(new o.default).compile(r.Type.Strict(T));class C{constructor(e,t,n,r,o){this.textDocument=e,this.startPosition=t,this.completionContext=n,this.solutionCountTarget=r,this.cancellationToken=o,this.savedTelemetryData=h.TelemetryData.createAndMarkAsIssued()}reportCancelled(){}getCancellationToken(){return this.cancellationToken}async getDocument(){return this.textDocument}}async function S(e,t,n,r,o){const s=await r;switch(s.status){case"Solution":n.sendNotification(new a.NotificationType("PanelSolution"),function(e,t,n){const r=(0,p.normalizeCompletionText)(n.completionText);return{panelId:e,range:t,completionText:n.completionText,displayText:n.displayText,score:n.meanProb,solutionId:(0,i.SHA256)(r).toString()}}(e,t,s.solution)),await S(e,t,n,s.next,o);break;case"FinishedNormally":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:e}),o();break;case"FinishedWithError":n.sendNotification(new a.NotificationType("PanelSolutionsDone"),{status:"Error",message:s.error,panelId:e}),o()}}let k;t.handleGetPanelCompletions=async function(e,t,n,r,o){var i;k&&(k.cancel(),k.dispose()),k=new g.CancellationTokenSource;const a=new g.MergedToken([t,k.token]);if(!E(n)){const e=(0,y.extractAjvErrors)(E.errors);return[null,{code:y.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}let h,T;void 0!==(null===(i=n.options)||void 0===i?void 0:i.testingCtx)&&(e=(0,b.getTestingContext)(n.options.testingCtx));const P=(0,l.getConfig)(e,l.ConfigKey.ListCount);let I;try{I=e.get(x.PanelCompletionDocuments)}catch(e){}if(I){const e=s.v4(),t=I.documents,r=async o=>{if(o>=P||o>=t.length)return{status:"FinishedNormally"};const{text:i,score:a}=t[o],{cursorLine:c,lines:l,start:u}=(0,v.parseChallengeDoc)(i,n.doc.position),d=[c.slice(Math.min(u.character,n.doc.position.character))].concat(l.slice(n.doc.position.line+1)).join("\n");return{status:"Solution",solution:{requestId:{headerRequestId:e,completionId:s.v4(),created:0,serverExperiments:"",deploymentId:""},completionText:d,displayText:d,meanProb:a,meanLogProb:-1,choiceIndex:o,prependToCompletion:""},next:r(o+1)}};T=n.doc.position,h=r(0)}else{const t=await(0,m.createRequestContext)(e,r);if(!(t instanceof u.Context))return[null,t];const o=c.URI.parse(n.doc.uri);let i;try{i=await(0,w.getTextDocumentChecked)(e,o,n.doc)}catch(e){return[null,{code:y.ErrorCode.InvalidParams,message:e.message}]}const s=i.offsetAt(t.get(f.LocationFactory).position(n.doc.position.line,n.doc.position.character));T=i.positionAt(s);const l=(0,d.completionContextForDocument)(e,i,T),g=new C(i,T,l,P,a);h=(0,p.launchSolutions)(t,g),e=t}return setImmediate((()=>S(n.panelId,e.get(f.LocationFactory).range(T,T),e.get(_.AgentNotificationSender),h,null!=o?o:()=>{}))),[{solutionCountTarget:P},null]}},1025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9800),s=n(5381),a=r.Type.Object({}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[{version:(0,i.getVersion)(e)},null]}},2389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(39),s=n(5381),a=r.Type.Object({url:r.Type.String(),method:r.Type.Optional(r.Type.String()),headers:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String())),body:r.Type.Optional(r.Type.String()),json:r.Type.Optional(r.Type.Any()),timeout:r.Type.Optional(r.Type.Number())}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r={};"method"in n&&(r.method=n.method),"body"in n&&(r.body=n.body),"json"in n&&(r.json=n.json);const o=n.timeout;null!=o&&(r.timeout=o),n.headers&&(r.headers=n.headers);try{const t=await e.get(i.Fetcher).fetch(n.url,r),o=await t.text();return[{status:t.status,statusText:t.statusText,headers:Object.fromEntries(t.headers),body:o},null]}catch(e){return[null,{code:s.ErrorCode.InternalError,message:e.message}]}}},5332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAllNotifications=t.NotificationHandlers=t.getAllMethods=t.MethodHandlers=void 0;const r=n(6934),o=n(3340),i=n(9638),s=n(1025),a=n(2389),c=n(5581),l=n(1382),u=n(1300),d=n(4885),p=n(9629),h=n(4489),f=n(1451),m=n(6656),g=n(1620),_=n(2530),y=n(8269),v=n(7803),b=n(2930),w=n(8730),x=n(2043),T=n(2229),E=n(8127);class C{constructor(e){this.handlers=e}}t.MethodHandlers=C,t.getAllMethods=function(){const e=new Map;return e.set("getCompletions",o.handleGetCompletions),e.set("getCompletionsCycling",o.handleGetCompletionsCycling),e.set("getPanelCompletions",i.handleGetPanelCompletions),e.set("httpRequest",a.default),e.set("getVersion",s.default),e.set("setEditorInfo",p.handleSetEditorInfo),e.set("checkStatus",r.default),e.set("signInInitiate",f.default),e.set("signInConfirm",h.default),e.set("signOut",m.default),e.set("recordTelemetryConsent",d.default),e.set("notifyShown",u.notifyShown),e.set("notifyAccepted",c.notifyAccepted),e.set("notifyRejected",l.notifyRejected),e.set("telemetry/exception",g.telemetryExceptionMethod),e.set("testing/createContext",y.default),e.set("testing/alwaysAuth",_.default),e.set("testing/neverAuth",v.default),e.set("testing/useTestingToken",T.default),e.set("testing/setCompletionDocuments",b.default),e.set("testing/setPanelCompletionDocuments",w.default),e.set("testing/triggerShowMessageRequest",x.default),e.set("debug/verifyState",E.handleVerifyState),e.set("debug/verifyWorkspaceState",E.handleVerifyWorkspaceState),new C(e)};class S{constructor(e){this.handlers=e}}t.NotificationHandlers=S,t.getAllNotifications=function(){const e=new Map;return new S(e)}},5581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyAccepted=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyAccepted=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=o.get(n.uuid);return l&&(o.deleteKey(n.uuid),(0,i.postInsertionTasks)(e,"ghostText",l.text,l.offset,l.file,l.telemetry)),["OK",null]}},4340:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyNetworkProxyConfiguration=t.applySettingsToConfiguration=t.notifyChangeConfiguration=t.EditorConfigurationSettings=t.NetworkProxy=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(39),a=n(5381),c=n(6159);t.NetworkProxy=r.Type.Object({host:r.Type.String(),port:r.Type.Number(),username:r.Type.Optional(r.Type.String()),password:r.Type.Optional(r.Type.String())}),t.EditorConfigurationSettings=r.Type.Object({showEditorCompletions:r.Type.Optional(r.Type.Boolean()),enableAutoCompletions:r.Type.Optional(r.Type.Boolean()),delayCompletions:r.Type.Optional(r.Type.Boolean()),filterCompletions:r.Type.Optional(r.Type.Boolean()),disabledLanguages:r.Type.Optional(r.Type.Array(r.Type.Object({languageId:r.Type.String()})))});const l=r.Type.Object({settings:r.Type.Optional(t.EditorConfigurationSettings),networkProxy:r.Type.Optional(r.Type.Union([t.NetworkProxy,r.Type.Null()])),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));function d(e,t){const n=e.get(i.ConfigProvider);if(n.setConfig(i.ConfigKey.ShowEditorCompletions,t.showEditorCompletions),n.setConfig(i.ConfigKey.DelayCompletions,t.delayCompletions),n.setConfig(i.ConfigKey.EnableAutoCompletions,t.enableAutoCompletions),n.setConfig(i.ConfigKey.FilterCompletions,t.filterCompletions),t.disabledLanguages)for(const e of t.disabledLanguages)n.setLanguageEnablement(e.languageId,!1)}function p(e,t){if(!t)return void(e.get(s.Fetcher).proxySettings=void 0);let n;t.username&&(n=t.password?t.username+":"+t.password:t.username);const r=n?n+"@":"";process.env.http_proxy=`http://${r}${t.host}:${t.port}`,process.env.https_proxy=`http://${r}${t.host}:${t.port}`,e.get(s.Fetcher).proxySettings={host:t.host,port:t.port,proxyAuth:n,headers:{}}}t.notifyChangeConfiguration=function(e,t){var n;if(!u(t)){const e=(0,a.extractAjvErrors)(u.errors);throw new Error(`Invalid params: ${e.join(", ")}`)}void 0!==(null===(n=t.options)||void 0===n?void 0:n.testingCtx)&&(e=(0,c.getTestingContext)(t.options.testingCtx)),t.settings&&d(e,t.settings),void 0!==t.networkProxy&&p(e,t.networkProxy)},t.applySettingsToConfiguration=d,t.applyNetworkProxyConfiguration=p},1382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyRejected=void 0;const r=n(892),o=n(6236),i=n(3402),s=n(3007),a=n(5381),c=n(6159),l=r.Type.Object({uuids:r.Type.Array(r.Type.String()),options:r.Type.Optional(c.TestingOptions)}),u=(new o.default).compile(r.Type.Strict(l));t.notifyRejected=async function(e,t,n){var r;if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,c.getTestingContext)(n.options.testingCtx));const o=e.get(s.CopilotCompletionCache),l=n.uuids.flatMap((e=>{var t;return null!==(t=o.get(e))&&void 0!==t?t:[]}));if(l.length>0){const t=l[0];for(const e of n.uuids)o.deleteKey(e);const r=l.map((e=>({completionText:e.displayText,completionTelemetryData:e.telemetry})));(0,i.postRejectionTasks)(e,"ghostText",t.offset,t.file,r)}return["OK",null]}},1300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyShown=void 0;const r=n(892),o=n(6236),i=n(702),s=n(1749),a=n(3007),c=n(5381),l=n(6159),u=r.Type.Object({uuid:r.Type.String({minLength:1}),options:r.Type.Optional(l.TestingOptions)}),d=(new o.default).compile(r.Type.Strict(u));t.notifyShown=async function(e,t,n){var r;if(!d(n)){const e=(0,c.extractAjvErrors)(d.errors);return[null,{code:c.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}void 0!==(null===(r=n.options)||void 0===r?void 0:r.testingCtx)&&(e=(0,l.getTestingContext)(n.options.testingCtx));const o=e.get(a.CopilotCompletionCache).get(n.uuid);if(o){const t=!(o.resultType===i.ResultType.Network);(0,s.telemetryShown)(e,"ghostText",o.telemetry,t)}return["OK",null]}},4885:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(i.AuthManager).getAuthRecord();return r?(e.get(i.AuthManager).recordTelemetryConsent(r.user),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]):[null,{code:s.ErrorCode.InvalidRequest,message:"Trying to record telemetry consent but the user is not signed in"}]}},9629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleSetEditorInfo=void 0;const r=n(892),o=n(6236),i=n(9800),s=n(6995),a=n(5381),c=n(4340),l=r.Type.Object({name:r.Type.String(),version:r.Type.String()}),u=r.Type.Object({editorInfo:l,editorPluginInfo:l,editorConfiguration:r.Type.Optional(c.EditorConfigurationSettings),networkProxy:r.Type.Optional(c.NetworkProxy),options:r.Type.Optional(r.Type.Object({}))}),d=(new o.default).compile(r.Type.Strict(u));t.handleSetEditorInfo=async function(e,t,n){if(!d(n)){const e=(0,a.extractAjvErrors)(d.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return e.get(i.EditorAndPluginInfo).setEditorAndPluginInfo(n.editorInfo,n.editorPluginInfo),n.editorConfiguration&&(0,c.applySettingsToConfiguration)(e,n.editorConfiguration),n.networkProxy&&(0,c.applyNetworkProxyConfiguration)(e,n.networkProxy),(0,s.initializeLateDependencies)(e),["OK",null]}},4489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(i.AuthManager).getPendingSignIn();if(void 0===r)return[null,{code:s.ErrorCode.InvalidRequest,message:"No pending sign in"}];let o;try{return o=await r,[o,null]}catch(e){return[null,{code:s.ErrorCode.DeviceFlowFailed,message:e.toString()}]}finally{e.get(i.AuthManager).setPendingSignIn(void 0)}}},1451:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(3406),s=n(9321),a=n(5381),c=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=await e.get(s.AuthManager).checkAndUpdateStatus(e);if("OK"===r.status)return[{status:"AlreadySignedIn",user:r.user},null];const o=await e.get(i.GitHubDeviceFlow).getToken(e),c=o.waitForAuth.then((async t=>(await e.get(s.AuthManager).setAuthRecord(t),await e.get(s.AuthManager).checkAndUpdateStatus(e))));return e.get(s.AuthManager).setPendingSignIn(c),[{status:"PromptUserDeviceFlow",userCode:o.user_code,verificationUri:o.verification_uri,expiresIn:o.expires_in,interval:o.interval},null]}},6656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return await e.get(i.AuthManager).deleteAuthRecord(),[await e.get(i.AuthManager).checkAndUpdateStatus(e),null]}},1620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryExceptionMethod=void 0;const r=n(892),o=n(6236),i=n(5489),s=n(5381),a=r.Type.Object({origin:r.Type.String(),stacktrace:r.Type.Optional(r.Type.String()),properties:r.Type.Optional(r.Type.Record(r.Type.String(),r.Type.String()))}),c=(new o.default).compile(r.Type.Strict(a));t.telemetryExceptionMethod=async function(e,t,n){if(!c(n)){const e=(0,s.extractAjvErrors)(c.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=new Error("Original stacktrace: "+n.stacktrace);r.stack="";const o=n.properties||{};return await(0,i.telemetryException)(e,r,n.origin,o),["OK",null]}},2530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.AlwaysAuthManager),["OK",null]}},8269:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return[(0,s.newTestingContext)(e),null]}},7803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(9321),s=n(5381),a=n(1728),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));t.default=async function(e,t,n){if(!u(n)){const e=(0,s.extractAjvErrors)(u.errors);return[null,{code:s.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,c.getTestingContext)(n.testingCtx).forceSet(i.AuthManager,new a.NotAuthManager),["OK",null]}},2930:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(r.Type.String()),options:r.Type.Optional(r.Type.Object({}))}),c=(new o.default).compile(r.Type.Strict(a));class l{constructor(e){this.documents=e}}t.CompletionDocuments=l,t.default=async function(e,t,n){if(!c(n)){const e=(0,i.extractAjvErrors)(c.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(l,new l(n.documents)),["OK",null]}},8730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PanelCompletionDocuments=void 0;const r=n(892),o=n(6236),i=n(5381),s=n(6159),a=r.Type.Object({text:r.Type.String(),score:r.Type.Number()}),c=r.Type.Object({testingCtx:r.Type.Number(),documents:r.Type.Array(a),options:r.Type.Optional(r.Type.Object({}))}),l=(new o.default).compile(r.Type.Strict(c));class u{constructor(e){this.documents=e}}t.PanelCompletionDocuments=u,t.default=async function(e,t,n){if(!l(n)){const e=(0,i.extractAjvErrors)(l.errors);return[null,{code:i.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}return(0,s.getTestingContext)(n.testingCtx).forceSet(u,new u(n.documents)),["OK",null]}},2043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(892),o=n(6236),i=n(5798),s=n(7214),a=n(5381),c=r.Type.Object({}),l=(new o.default).compile(r.Type.Strict(c));t.default=async function(e,t){if(!l(t)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const n=e.get(s.AgentNotificationSender),r=e.get(i.LogTarget);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).catch((e=>o(i.LogLevel.ERROR,"error sending show message request",e))).then((e=>o(i.LogLevel.INFO,"response from message request",e.title))),["OK",null];async function o(t,n,o){return r.logIt(e,t,n+" ("+o+")",o)}}},2229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FakeAuthManager=void 0;const r=n(892),o=n(6236),i=n(5922),s=n(9321),a=n(5381),c=n(6159),l=r.Type.Object({testingCtx:r.Type.Number(),options:r.Type.Optional(r.Type.Object({}))}),u=(new o.default).compile(r.Type.Strict(l));class d extends s.AuthManager{constructor(e){super(void 0,(t=>e)),this.tokenManager=e,this.user="user"}getCopilotTokenManager(){return this.tokenManager}async checkAndUpdateStatus(e,t){const n=await this.tokenManager.checkCopilotToken(e);return"status"in n?{status:"OK",user:this.user}:{status:"HTTP401"===n.reason?"NotSignedIn":n.reason,user:this.user}}}t.FakeAuthManager=d,t.default=async function(e,t,n){if(!u(n)){const e=(0,a.extractAjvErrors)(u.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=(0,i.makeTestingCopilotTokenManager)();return(0,c.getTestingContext)(n.testingCtx).forceSet(s.AuthManager,new d(r)),["OK",null]}},8127:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleVerifyWorkspaceState=t.handleVerifyState=void 0;const r=n(892),o=n(6236),i=n(6630),s=n(819),a=n(5381),c=r.Type.Object({source:r.Type.String(),languageId:r.Type.String(),version:r.Type.Number(),uri:r.Type.String()}),l=(new o.default).compile(r.Type.Strict(c));t.handleVerifyState=async function(e,t,n){if(!l(n)){const e=(0,a.extractAjvErrors)(l.errors);return[null,{code:a.ErrorCode.InvalidParams,message:"Invalid params: "+e.join(";")}]}const r=e.get(s.TextDocumentManager),o=await r.getTextDocument(i.URI.parse(n.uri));return o?o.languageId!==n.languageId?[{status:!1,message:`Language id mismatch: [State] ${o.languageId} !== [Request] ${n.languageId}`},null]:o.getText()!==n.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${n.source}`},null]:o.version!==n.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${n.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: "${i.URI.parse(n.uri)}" (given by the editor: "${n.uri}")`},null]},t.handleVerifyWorkspaceState=async function(e,t,n){return[e.get(s.TextDocumentManager).workspaceFolders,null]}},7214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionNotificationSender=t.AgentNotificationSender=void 0;const r=n(9035);class o extends r.NotificationSender{}t.AgentNotificationSender=o,t.ConnectionNotificationSender=class extends o{constructor(e){super(),this.connection=e}sendNotification(e,t){this.connection.sendNotification(e,t)}showWarningMessage(e,...t){return this.connection.window.showWarningMessage(e,...t)}}},585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeXdgPersistenceManager=t.PersistenceManager=void 0;const r=n(7147),o=n(2037),i=n(7282);class s{constructor(e){this.directory=e}async read(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"});return JSON.parse(e)[t]}catch(e){return}}async update(e,t,n){await r.promises.mkdir(this.directory,{recursive:!0,mode:448});const o=`${this.directory}/${e}.json`;let i={};try{const e=await r.promises.readFile(o,{encoding:"utf8"});i=JSON.parse(e)}catch(e){}i[t]=n,await r.promises.writeFile(o,JSON.stringify(i)+"\n",{encoding:"utf8"})}async delete(e,t){const n=`${this.directory}/${e}.json`;try{const e=await r.promises.readFile(n,{encoding:"utf8"}),o=JSON.parse(e);delete o[t],await r.promises.writeFile(n,JSON.stringify(o)+"\n",{encoding:"utf8"})}catch(e){}}}t.PersistenceManager=s,t.makeXdgPersistenceManager=function(){return new s(i.env.XDG_CONFIG_HOME?i.env.XDG_CONFIG_HOME+"/github-copilot":"win32"===(0,o.platform)()?i.env.USERPROFILE+"\\AppData\\Local\\github-copilot":i.env.HOME+"/.config/github-copilot")}},5381:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.extractAjvErrors=t.ErrorCode=void 0,(n=t.ErrorCode||(t.ErrorCode={}))[n.ParseError=-32700]="ParseError",n[n.InvalidRequest=-32600]="InvalidRequest",n[n.MethodNotFound=-32601]="MethodNotFound",n[n.InvalidParams=-32602]="InvalidParams",n[n.InternalError=-32603]="InternalError",n[n.NoCopilotToken=1e3]="NoCopilotToken",n[n.DeviceFlowFailed=1001]="DeviceFlowFailed",n[n.ContextNotInitialized=1002]="ContextNotInitialized",t.extractAjvErrors=function(e){return e.map((e=>`${e.instancePath} ${e.message}`))}},2879:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createWrappedConnection=t.CopilotService=void 0;const r=n(7147),o=n(2781),i=n(7089),s=n(6630),a=n(5611),c=n(5225),l=n(5798),u=n(9035),d=n(6635),p=n(913),h=n(819),f=n(4445),m=n(9841),g=n(1926),_=n(5332),y=n(4340),v=n(7214),b=n(5381),w=n(540);t.CopilotService=class{constructor(e,t){this.connection=t,this.initialized=!1,this.ctx=new a.Context(e);const n=new v.ConnectionNotificationSender(t);this.ctx.set(u.NotificationSender,n),this.ctx.set(v.AgentNotificationSender,n),this.ctx.set(d.StatusReporter,new g.NotificationStatusReporter(this.ctx));const r=new l.MultiLog([this.ctx.get(l.LogTarget),new m.NotificationLogger((0,p.isDebugEnabled)(this.ctx))]);this.ctx.forceSet(l.LogTarget,r),new l.Logger(l.LogLevel.DEBUG,"agent").debug(this.ctx,"Agent service starting"),t.onRequest(this.messageHandler.bind(this)),t.onNotification(this.notificationHandler.bind(this)),t.onInitialize((async e=>{var n,r,o,a;const l=null!==(r=null===(n=e.capabilities.workspace)||void 0===n?void 0:n.workspaceFolders)&&void 0!==r&&r;return this.ctx.set(h.TextDocumentManager,new w.AgentTextDocumentManager(t,null!==(a=null===(o=e.workspaceFolders)||void 0===o?void 0:o.map((e=>s.URI.parse(e.uri))))&&void 0!==a?a:[],!(0,p.isRunningInTest)(this.ctx)&&l)),(0,c.registerDocumentTracker)(this.ctx),this.initialized=!0,{capabilities:{textDocumentSync:{openClose:!0,change:i.TextDocumentSyncKind.Incremental},workspace:{workspaceFolders:{supported:l,changeNotifications:l}}}}})),t.onDidChangeConfiguration((async e=>{(0,y.notifyChangeConfiguration)(this.ctx,e)}))}async messageHandler(e,t,n){const r=this.ctx.get(_.MethodHandlers).handlers.get(e);if(!r)return new i.ResponseError(b.ErrorCode.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new i.ResponseError(b.ErrorCode.ContextNotInitialized,"Agent service not initialized.");Array.isArray(t)&&(t=t[0]);const[o,s]=await r(this.ctx,n,t);return s?new i.ResponseError(s.code,s.message,s.data):o}async notificationHandler(e,t){const n=this.ctx.get(_.NotificationHandlers).handlers.get(e);n&&(Array.isArray(t)&&(t=t[0]),await n(this.ctx,t))}listen(){this.connection.listen()}dispose(){this.connection.dispose()}},t.createWrappedConnection=function(e,t,n){let s=n;const a=parseInt(process.env.GH_COPILOT_DEBUG_UI_PORT);if(!isNaN(a))try{s=new f.DebugServer(a).listen().wrapStdout(n)}catch(t){new l.Logger(l.LogLevel.WARN,"agent").error(e,`Failed to start debug server on port ${a} (maybe it's in use?)`,t)}if(e.get(p.RuntimeMode).flags.recordInput){const e=Date.now().toString(),n=`stdin${e}.log`;t.on("data",(e=>{(0,r.appendFile)(n,e,(e=>{e&&console.error(e)}))}));const i=`stdout${e}.log`;c=s,u=e=>{(0,r.appendFile)(i,e,(e=>{e&&console.error(e)}))},s=new o.Writable({write:(e,t,n)=>(u(e.toString()),c.write(e,t,n))})}var c,u;return(0,i.createConnection)(i.ProposedFeatures.all,new i.StreamMessageReader(t),new i.StreamMessageWriter(s))}},1728:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlwaysAuthManager=t.NotAuthManager=void 0;const r=n(5765),o=n(9321);class i extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"NotSignedIn"}}}t.NotAuthManager=i;class s extends o.AuthManager{constructor(){super(null,(()=>null))}async checkAndUpdateStatus(e,t){return{status:"OK",user:"user"}}getCopilotTokenManager(){return new r.FixedCopilotTokenManager({token:"tid=valid-copilot-token",telemetry:"enabled"})}}t.AlwaysAuthManager=s},7838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseChallengeDoc=void 0,t.parseChallengeDoc=function(e,t){const n=e.split("\n");let r=t,o=t,i=n[t.line];const s=i.indexOf("%");-1!==s&&(i=i.substring(0,s)+i.substring(s+1),r={line:t.line,character:s});const a=i.indexOf("^");if(-1!==a){const e=i.indexOf("^",a+1);if(-1===e)throw new Error("Challenge document must contain zero or two ^ characters.");i=i.substring(0,a)+i.substring(a+1,e)+i.substring(e+1),r={line:t.line,character:t.character},o={line:t.line,character:t.character+e-a-1}}return{cursorLine:i,lines:n,start:r,end:o}}},6159:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAgentTestingContext=t.setAgentTestEditorInfo=t.TestTextDocumentManager=t.getTestingContext=t.newTestingContext=t.TestingOptions=void 0;const r=n(4617),o=n(892),i=n(9800),s=n(5611),a=n(4630),c=n(2369),l=n(819),u=n(3895),d=n(3007),p=n(6021),h=n(2401),f=new Map;let m=0;t.TestingOptions=o.Type.Object({testingCtx:o.Type.Optional(o.Type.Number())}),t.newTestingContext=function(e){const t=m,n=new s.Context(e);return f.set(t,n),m++,t},t.getTestingContext=function(e){const t=f.get(e);if(void 0===t)throw new Error(`Testing context ${e} not found`);return t};class g extends l.TextDocumentManager{constructor(){super(...arguments),this._textDocuments=[],this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.onDidChangeTextDocument=()=>({dispose:()=>{}})}get textDocuments(){return this._textDocuments}async getTextDocument(e){return this.textDocuments.find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){}setTextDocument(e,t,n){this._textDocuments.push(new h.AgentTextDocument(e,t,0,n))}findNotebook(e){}}function _(e){const t=new u.AgentEditorInfo;t.setEditorAndPluginInfo({name:"agent-tests",version:"0"},{name:"agent-tests",version:"0"}),e.set(i.EditorAndPluginInfo,t)}t.TestTextDocumentManager=g,t.setAgentTestEditorInfo=_,t.createAgentTestingContext=function(){const e=new s.Context;e.set(i.ConfigProvider,new u.AgentConfigProvider),(0,a.setupTestingContext)(e),_(e),e.set(d.CopilotCompletionCache,new d.CopilotCompletionCache),e.set(c.LocationFactory,new h.AgentLocationFactory),e.set(l.TextDocumentManager,new g),e.set(i.BlockModeConfig,new i.ConfigBlockModeConfig);const t=new i.VscInfo("TestSessionId","TestMachineId","TestVscVersion");return e.set(i.VscInfo,t),e.set(r.FileSystem,p.agentFileSystem),e}},2401:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocument=t.getTextDocumentChecked=t.AgentLocationFactory=void 0;const r=n(6813),o=n(1674),i=n(2369),s=n(819);class a extends i.LocationFactory{range(e,t,n,r){return void 0!==n&&void 0!==r?o.Range.create(e,t,n,r):o.Range.create(e,t)}position(e,t){return o.Position.create(e,t)}}t.AgentLocationFactory=a,t.getTextDocumentChecked=async function(e,t,n){if(n&&n.source&&n.languageId){const e=new c(t,n.languageId,0,n.source);return n.relativePath&&(e.relativePath=n.relativePath),e}const r=e.get(s.TextDocumentManager);return await r.getTextDocument(t).then((e=>{if(!e){const e=r.textDocuments.map((e=>e.uri)).join(", ");throw new Error(`Couldn't find document for uri: ${t}, known document uris are: ${e}`)}return e}))};class c{constructor(e,t,n,o){this._uri=e,this._textDocument=r.TextDocument.create(e.toString(),t,n,o)}get uri(){return this._uri}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}get relativePath(){return this._relativePath}set relativePath(e){this._relativePath=e}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r=o.Range.create(o.Position.create(t,0),o.Position.create(t,n.length)),i=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:i}}getWordRangeAtPosition(e){}update(e,t){r.TextDocument.update(this._textDocument,e,t)}}t.AgentTextDocument=c},540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentTextDocumentManager=void 0;const r=n(2361),o=n(1017),i=n(5809),s=n(6630),a=n(819),c=n(2401);class l{constructor(){this.emitter=new r}create(e,t,n,r){return new c.AgentTextDocument(s.URI.parse(e),t,n,r)}update(e,t,n){const r=[];for(const n of t)if(i.TextDocumentContentChangeEvent.isIncremental(n)){const t={range:n.range,rangeOffset:e.offsetAt(n.range.start),rangeLength:e.offsetAt(n.range.end)-e.offsetAt(n.range.start),text:n.text};r.push(t)}const o={document:e,contentChanges:r};return this.emitter.emit("change",o),e.update(t,n),e}}class u extends a.TextDocumentManager{constructor(e,t,n){super(),this.connection=e,this.workspaceFolders=t,this.onDidChangeTextDocument=(e,t,n)=>{const r=e.bind(t);return this._textDocumentConfiguration.emitter.on("change",r),{dispose:()=>{this._textDocumentConfiguration.emitter.removeListener("change",r)}}},this.onDidFocusTextDocument=(e,t,n)=>(this.connection.onNotification("textDocument/didFocus",(n=>{const r=s.URI.parse(n.uri);e.call(t,{document:{uri:r}})})),{dispose:()=>{}}),this._textDocumentConfiguration=new l,this._textDocumentListener=new i.TextDocuments(this._textDocumentConfiguration),this._textDocumentListener.listen(e),n&&this.connection.workspace.onDidChangeWorkspaceFolders((e=>{e.added.forEach((e=>this.registerWorkspaceFolder(e))),e.removed.forEach((e=>this.unregisterWorkspaceFolder(e)))})),this.connection.onNotification("vs/didAddWorkspaceFolder",(e=>this.registerWorkspaceFolder(e))),this.connection.onNotification("vs/didRemoveWorkspaceFolder",(e=>this.unregisterWorkspaceFolder(e)))}unregisterWorkspaceFolder(e){const t=this.workspaceFolders.findIndex((t=>t.toString()===s.URI.parse(e.uri).toString()));t>=0&&this.workspaceFolders.splice(t,1)}registerWorkspaceFolder(e){this.workspaceFolders.push(s.URI.parse(e.uri))}get textDocuments(){return this._textDocumentListener.all()}async getTextDocument(e){return this._textDocumentListener.all().find((t=>t.uri.toString()==e.toString()))}async getRelativePath(e){var t,n;const r=e;return r.relativePath?r.relativePath:null!==(n=(0,a.getRelativePath)(null!==(t=this.workspaceFolders)&&void 0!==t?t:[],e.fileName))&&void 0!==n?n:o.basename(e.fileName)}findNotebook(e){}}t.AgentTextDocumentManager=u},5765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshToken=t.CopilotTokenManagerFromGitHubToken=t.FixedCopilotTokenManager=t.CopilotTokenManager=t.setTelemetryConfigFromTokenInfo=t.extractTrackingIdFromToken=t.authFromGitHubToken=t.nowSeconds=void 0;const r=n(9800),o=n(5798),i=n(39),s=n(9035),a=n(5489),c=n(4567),l=new o.Logger(o.LogLevel.INFO,"auth");let u=0;function d(){return Math.floor(Date.now()/1e3)}async function p(e,t){var n,o;(0,a.telemetry)(e,"auth.new_login");const s=null!==(o=null===(n=t.devOverride)||void 0===n?void 0:n.copilotTokenUrl)&&void 0!==o?o:"http://localhost:5001/copilot_internal/v2/token",c=await e.get(i.Fetcher).fetch(s,{headers:{Authorization:`token ${t.token}`,...(0,r.editorVersionHeaders)(e)}});if(!c)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_failed"),{kind:"failure",reason:"FailedToGetToken"};const u=await c.json();if(!u)return l.info(e,"Failed to get copilot token"),(0,a.telemetryError)(e,"auth.request_read_failed"),{kind:"failure",reason:"FailedToGetToken"};if(f(e,u.user_notification,t),401===c.status)return l.info(e,"Failed to get copilot token due to 401 status"),(0,a.telemetryError)(e,"auth.unknown_401"),{kind:"failure",reason:"HTTP401"};if(!c.ok||!u.token){l.info(e,`Invalid copilot token: missing token: ${c.status} ${c.statusText}`),(0,a.telemetryError)(e,"auth.invalid_token",a.TelemetryData.createAndMarkAsIssued({status:c.status.toString(),status_text:c.statusText}));const n=u.error_details;return f(e,n,t),{kind:"failure",reason:"NotAuthorized",...n}}const p=u.expires_at;return u.expires_at=d()+u.refresh_in+60,e.get(a.TelemetryReporters).setToken(u),g(u),(0,a.telemetry)(e,"auth.new_token",a.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:u.expires_at,expires_at:p,current_time:d()})),{kind:"success",...u}}t.nowSeconds=d,t.authFromGitHubToken=p;const h=new Map;function f(e,t,n){if(!t)return;const o=d();h.get(t.message)||(h.set(t.message,o),e.get(s.NotificationSender).showWarningMessage(t.message,{title:t.title},{title:"Dismiss"}).catch((t=>{console.error(t),l.error(e,`Error while sending notification: ${t.message}`)})).then((async o=>{const s=(null==o?void 0:o.title)===t.title,a=s||"Dismiss"===(null==o?void 0:o.title);if(s){const n=e.get(r.EditorAndPluginInfo).getEditorPluginInfo(e),o=t.url.replace("{EDITOR}",encodeURIComponent(n.name+"_"+n.version));await e.get(c.UrlOpener).open(o)}"notification_id"in t&&a&&await async function(e,t,n){var o,s;const a=null!==(s=null===(o=n.devOverride)||void 0===o?void 0:o.notificationUrl)&&void 0!==s?s:"http://localhost:5001/copilot_internal/notification",c=await e.get(i.Fetcher).fetch(a,{headers:{Authorization:`token ${n.token}`,...(0,r.editorVersionHeaders)(e)},method:"POST",body:JSON.stringify({notification_id:t})});c&&c.ok||l.error(e,`Failed to send notification result to GitHub: ${null==c?void 0:c.status} ${null==c?void 0:c.statusText}`)}(e,t.notification_id,n)})))}function m(e){const t=null==e?void 0:e.split(":")[0],n=null==t?void 0:t.split(";");for(const e of n){const[t,n]=e.split("=");if("tid"===t)return n}}function g(e){const t=m(e.token);void 0!==t&&(0,a.setTelemetryConfig)({trackingId:t,optedIn:"enabled"===e.telemetry||"unconfigured"===e.telemetry})}t.extractTrackingIdFromToken=m,t.setTelemetryConfigFromTokenInfo=g;class _{}function y(e,t,n){const r=d();u>0||(u++,setTimeout((async()=>{let n,o="";try{u--,await t.getCopilotToken(e,!0),n="success"}catch(e){n="failure",o=e.toString()}const i=a.TelemetryData.createAndMarkAsIssued({result:n},{time_taken:d()-r,refresh_count:u});o&&(i.properties.reason=o),(0,a.telemetry)(e,"auth.token_refresh",i)}),1e3*n))}t.CopilotTokenManager=_,t.FixedCopilotTokenManager=class extends _{constructor(e){super(),this.tokenInfo=e,this.wasReset=!1,g(e)}async getCopilotToken(e,t){return this.tokenInfo.token}resetCopilotToken(e,t){this.wasReset=!0}async checkCopilotToken(e){return{status:"OK",telemetry:this.tokenInfo.telemetry}}},t.CopilotTokenManagerFromGitHubToken=class extends _{constructor(e){super(),this.githubToken=e,this.copilotToken=void 0}async getCopilotToken(e,t){var n;if(!this.copilotToken||this.copilotToken.expires_at{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TELEMETRY_TERMS_URL=t.LAST_TELEMETRY_TERMS_UPDATE=void 0,t.LAST_TELEMETRY_TERMS_UPDATE="2021-10-14",t.TELEMETRY_TERMS_URL="https://github.co/copilot-telemetry-terms"},5135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeTracker=void 0;const r=n(819);t.ChangeTracker=class{constructor(e,t,n){this._referenceCount=0,this._isDisposed=!1,this._offset=n;const o=e.get(r.TextDocumentManager);this._tracker=o.onDidChangeTextDocument((async e=>{if(e.document.uri===t)for(const t of e.contentChanges)if(t.rangeOffset+t.rangeLength<=this.offset){const e=t.text.length-t.rangeLength;this._offset=this._offset+e}}))}get offset(){return this._offset}push(e,t){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout((()=>{e(),this._referenceCount--,0===this._referenceCount&&(this._tracker.dispose(),this._isDisposed=!0)}),t)}}},2137:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Clock=void 0,t.Clock=class{now(){return new Date}}},140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.keyForPrompt=void 0;const r=n(6679);t.keyForPrompt=function(e){return(0,r.SHA256)(e.prefix+e.suffix).toString()},t.LRUCache=class{constructor(e=10){this.values=new Map,this.lruKeys=[],this.size=e}removeKeyFromLRU(e){const t=this.lruKeys.indexOf(e);-1!==t&&this.lruKeys.splice(t,1)}touchKeyInLRU(e){this.removeKeyFromLRU(e),this.lruKeys.push(e)}clear(){this.values.clear(),this.lruKeys=[]}deleteKey(e){this.removeKeyFromLRU(e),void 0!==this.values.get(e)&&this.values.delete(e)}get(e){if(this.values.has(e)){const t=this.values.get(e);return this.touchKeyInLRU(e),t}}put(e,t){let n=[];this.values.has(e)?n=[e]:this.lruKeys.length>=this.size&&(n=this.lruKeys.splice(0,1));for(const e of n)this.deleteKey(e);this.values.set(e,t),this.touchKeyInLRU(e)}}},3940:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=t.Debouncer=void 0,t.Debouncer=class{async debounce(e){return this.state&&(clearTimeout(this.state.timer),this.state.reject(),this.state=void 0),new Promise(((t,n)=>{this.state={timer:setTimeout((()=>t()),e),reject:n}}))}},t.debounce=function(e,t){let n;return(...r)=>(n&&clearTimeout(n),new Promise((o=>{n=setTimeout((()=>{const e=t(...r);o(e)}),e)})))}},1661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncIterableFromArray=t.asyncIterableMapFilter=t.asyncIterableFilter=t.asyncIterableMap=void 0,t.asyncIterableMap=async function*(e,t){for await(const n of e)yield t(n)},t.asyncIterableFilter=async function*(e,t){for await(const n of e)await t(n)&&(yield n)},t.asyncIterableMapFilter=async function*(e,t){for await(const n of e){const e=await t(n);void 0!==e&&(yield e)}},t.asyncIterableFromArray=async function*(e){for(const t of e)yield t}},9800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorVersionHeaders=t.EditorAndPluginInfo=t.formatNameAndVersion=t.getTestVscInfo=t.VscInfo=t.getVersion=t.getBuild=t.getBuildType=t.isProduction=t.BuildInfo=t.suffixMatchThreshold=t.suffixPercent=t.getEnabledConfig=t.getLanguageConfig=t.dumpConfig=t.getHiddenConfig=t.isDefaultSettingOverwritten=t.getConfig=t.getConfigDefaultForObjectKey=t.getConfigDefaultForKey=t.InMemoryConfigProvider=t.DefaultsOnlyConfigProvider=t.ConfigProvider=t.ConfigBlockModeConfig=t.BlockModeConfig=t.BuildType=t.shouldDoServerTrimming=t.shouldDoParsingTrimming=t.BlockMode=t.ConfigKey=void 0;const r=n(4617),o=n(8139),i=n(6905),s=n(9876);var a,c;t.ConfigKey={Enable:"enable",InlineSuggestEnable:"inlineSuggest.enable",ShowEditorCompletions:["editor","showEditorCompletions"],EnableAutoCompletions:["editor","enableAutoCompletions"],DelayCompletions:["editor","delayCompletions"],FilterCompletions:["editor","filterCompletions"],DisplayStyle:["advanced","displayStyle"],SecretKey:["advanced","secret_key"],SolutionLength:["advanced","length"],Stops:["advanced","stops"],Temperature:["advanced","temperature"],TopP:["advanced","top_p"],IndentationMode:["advanced","indentationMode"],InlineSuggestCount:["advanced","inlineSuggestCount"],ListCount:["advanced","listCount"],DebugOverrideProxyUrl:["advanced","debug.overrideProxyUrl"],DebugTestOverrideProxyUrl:["advanced","debug.testOverrideProxyUrl"],DebugOverrideEngine:["advanced","debug.overrideEngine"],DebugShowScores:["advanced","debug.showScores"],DebugOverrideLogLevels:["advanced","debug.overrideLogLevels"],DebugFilterLogCategories:["advanced","debug.filterLogCategories"],DebugUseSuffix:["advanced","debug.useSuffix"],DebugAcceptSelfSignedCertificate:["advanced","debug.acceptSelfSignedCertificate"]},function(e){e.Parsing="parsing",e.Server="server",e.ParsingAndServer="parsingandserver"}(a=t.BlockMode||(t.BlockMode={})),t.shouldDoParsingTrimming=function(e){return[a.Parsing,a.ParsingAndServer].includes(e)},t.shouldDoServerTrimming=function(e){return[a.Server,a.ParsingAndServer].includes(e)},(c=t.BuildType||(t.BuildType={})).DEV="dev",c.PROD="prod",c.NIGHTLY="nightly";class l{}t.BlockModeConfig=l,t.ConfigBlockModeConfig=class extends l{async forLanguage(e,n){if(e.get(u).isDefaultSettingOverwritten(t.ConfigKey.IndentationMode))switch(e.get(u).getLanguageConfig(t.ConfigKey.IndentationMode,n)){case"client":case!0:case"server":return a.Server;case"clientandserver":return(0,r.isSupportedLanguageId)(n)?a.ParsingAndServer:a.Server;default:return a.Parsing}return await e.get(i.Features).overrideBlockMode()||((0,r.isSupportedLanguageId)(n)?a.Parsing:a.Server)}};class u{}function d(e){try{const t=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].default;if(void 0===t)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return t}catch(t){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}: ${t}`)}}function p(e,t){try{const n=s.contributes.configuration[0].properties[`${o.CopilotConfigPrefix}.${e}`].properties[t].default;if(void 0===n)throw new Error(`Missing config default value: ${o.CopilotConfigPrefix}.${e}`);return n}catch(n){throw new Error(`Error inspecting config default value ${o.CopilotConfigPrefix}.${e}.${t}: ${n}`)}}function h(e,t){return e.get(u).getConfig(t)}function f(e,t){return e.get(u).isDefaultSettingOverwritten(t)}function m(e,t,n){return f(e,t)?h(e,t):n.default}function g(e,t,n){return e.get(u).getLanguageConfig(t,n)}t.ConfigProvider=u,t.DefaultsOnlyConfigProvider=class extends u{getConfig(e){return Array.isArray(e)?p(e[0],e[1]):d(e)}isDefaultSettingOverwritten(e){return!1}dumpConfig(){return{}}getLanguageConfig(e,t){const n=this.getConfig(e);return t&&t in n?n[t]:n["*"]}},t.InMemoryConfigProvider=class{constructor(e,t){this.baseConfigProvider=e,this.overrides=t}getConfig(e){const t=this.overrides.get(e);return void 0!==t?t:this.baseConfigProvider.getConfig(e)}setConfig(e,t){void 0!==t?this.overrides.set(e,t):this.overrides.delete(e)}setLanguageEnablement(e,n){this.overrides.set(t.ConfigKey.Enable,{[e]:n})}isDefaultSettingOverwritten(e){return!!this.overrides.has(e)||this.baseConfigProvider.isDefaultSettingOverwritten(e)}keyAsString(e){return Array.isArray(e)?e.join("."):e}dumpConfig(){const e=this.baseConfigProvider.dumpConfig();return this.overrides.forEach(((t,n)=>{e[this.keyAsString(n)]=JSON.stringify(t)})),e}getLanguageConfig(e,t){const n=this.overrides.get(e);return void 0!==n?void 0!==t?n[t]:n["*"]:this.baseConfigProvider.getLanguageConfig(e,t)}},t.getConfigDefaultForKey=d,t.getConfigDefaultForObjectKey=p,t.getConfig=h,t.isDefaultSettingOverwritten=f,t.getHiddenConfig=m,t.dumpConfig=function(e){return e.get(u).dumpConfig()},t.getLanguageConfig=g,t.getEnabledConfig=function(e,n){return g(e,t.ConfigKey.Enable,n)},t.suffixPercent=async function(e,n,r){return m(e,t.ConfigKey.DebugUseSuffix,{default:!1})?15:e.get(i.Features).suffixPercent(n,r)},t.suffixMatchThreshold=async function(e,n,r){return m(e,t.ConfigKey.DebugUseSuffix,{default:!1})?20:e.get(i.Features).suffixMatchThreshold(n,r)};class _{constructor(){this.packageJson=s}isProduction(){return"dev"!=this.getBuildType()}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}}t.BuildInfo=_,t.isProduction=function(e){return e.get(_).isProduction()},t.getBuildType=function(e){return e.get(_).getBuildType()},t.getBuild=function(e){return e.get(_).getBuild()},t.getVersion=function(e){return e.get(_).getVersion()};class y{constructor(e,t,n){this.sessionId=e,this.machineId=t,this.vsCodeVersion=n}}function v({name:e,version:t}){return`${e}/${t}`}t.VscInfo=y,t.getTestVscInfo=function(){return new y("test-session-id","test-machine-id","test-vscode-version")},t.formatNameAndVersion=v;class b{}t.EditorAndPluginInfo=b,t.editorVersionHeaders=function(e){const t=e.get(b);return{"Editor-Version":v(t.getEditorInfo(e)),"Editor-Plugin-Version":v(t.getEditorPluginInfo(e))}}},8139:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopilotScheme=t.CopilotConfigPrefix=void 0,t.CopilotConfigPrefix="github.copilot",t.CopilotScheme="copilot"},5611:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0,t.Context=class{constructor(e){var t;this.baseContext=e,this.constructionStack=[],this.instances=new Map;const n=null===(t=(new Error).stack)||void 0===t?void 0:t.split("\n");n&&this.constructionStack.push(...n.slice(1))}get(e){const t=this.tryGet(e);if(t)return t;throw new Error(`No instance of ${e.name} has been registered.\n${this}`)}tryGet(e){return this.instances.get(e)||(this.baseContext?this.baseContext.tryGet(e):void 0)}set(e,t){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.instances.set(e,t)}forceSet(e,t){this.instances.set(e,t)}toString(){var e,t;let n=" Context created at:\n";for(const e of this.constructionStack||[])n+=` ${e}\n`;return n+=null!==(t=null===(e=this.baseContext)||void 0===e?void 0:e.toString())&&void 0!==t?t:"",n}get debug(){const e={};for(const[t,n]of this.instances)e[t.name]=n;return e}}},5680:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeLocation=t.encodeLocation=t.completionContextForDocument=t.CompletionContext=t.completionTypeToString=t.CompletionType=void 0;const r=n(6630),o=n(2369),i=n(8139);var s;!function(e){e[e.OPEN_COPILOT=2]="OPEN_COPILOT",e[e.TODO_QUICK_FIX=3]="TODO_QUICK_FIX",e[e.UNKNOWN_FUNCTION_QUICK_FIX=4]="UNKNOWN_FUNCTION_QUICK_FIX"}(s=t.CompletionType||(t.CompletionType={})),t.completionTypeToString=function(e){switch(e){case s.OPEN_COPILOT:return"open copilot";case s.TODO_QUICK_FIX:return"todo quick fix";case s.UNKNOWN_FUNCTION_QUICK_FIX:return"unknown function quick fix";default:return"unknown"}};class a{constructor(e,t,n){this.prependToCompletion="",this.appendToCompletion="",this.indentation=null,this.completionType=s.OPEN_COPILOT,this.insertPosition=e.get(o.LocationFactory).position(t.line,t.character),this.completionType=n}static fromJSONParse(e,t){const n=e.get(o.LocationFactory).position(t.insertPosition.line,t.insertPosition.character),r=new a(e,n,t.completionType);return r.prependToCompletion=t.prependToCompletion,r.appendToCompletion=t.appendToCompletion,r.indentation=t.indentation,r}}t.CompletionContext=a,t.completionContextForDocument=function(e,t,n){let r=n;const o=t.lineAt(n.line);return o.isEmptyOrWhitespace||(r=o.range.end),new a(e,r,s.OPEN_COPILOT)};let c=0;t.encodeLocation=function(e,t){const n=e.toString().split("#"),o=n.length>1?n[1]:"",s=JSON.stringify([n[0],t,o]);return r.URI.parse(`${i.CopilotScheme}:GitHub%20Copilot?${s}#${c++}`)},t.decodeLocation=function(e,t){const[n,o,i]=JSON.parse(t.query);return[r.URI.parse(i.length>0?n+"#"+i:n),a.fromJSONParse(e,o)]}},6317:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSolutions=t.normalizeCompletionText=void 0;const r=n(7057),o=n(1661),i=n(9800),s=n(5680),a=n(5798),c=n(7553),l=n(598),u=n(6635),d=n(7917),p=n(4090),h=n(2273),f=n(3591),m=n(3883),g=n(5489),_=n(2369),y=new a.Logger(a.LogLevel.INFO,"solutions");function v(e,t,n,r){return async o=>{if(r instanceof Array){const[i,s]=r;return(0,d.isBlockBodyFinishedWithPrefix)(e,t,n,o,s)}return(0,d.isBlockBodyFinished)(e,t,n,o)}}async function b(e,t,n){if(t.isCancellationRequested)return e.removeProgress(),{status:"FinishedWithError",error:"Cancelled"};const r=await n.next();return!0===r.done?(e.removeProgress(),{status:"FinishedNormally"}):{status:"Solution",solution:r.value,next:b(e,t,n)}}t.normalizeCompletionText=function(e){return e.replace(/\s+/g,"")},t.launchSolutions=async function(e,t){var n,a,w;const x=t.completionContext.insertPosition,T=t.completionContext.prependToCompletion,E=t.completionContext.indentation,C=e.get(_.LocationFactory),S=await t.getDocument(),k=await(0,p.extractPrompt)(e,S,x);if("contextTooShort"===k.type)return t.reportCancelled(),{status:"FinishedWithError",error:"Context too short"};const P=k.prompt,I=k.trailingWs;I.length>0&&(t.startPosition=C.position(t.startPosition.line,t.startPosition.character-I.length));const R=t.getCancellationToken(),O=r.v4();if(t.savedTelemetryData=g.TelemetryData.createAndMarkAsIssued({headerRequestId:O,languageId:S.languageId,source:(0,s.completionTypeToString)(t.completionContext.completionType)},{...(0,g.telemetrizePromptLength)(P),solutionCount:t.solutionCountTarget,promptEndPos:S.offsetAt(x)}),t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){const e=P.prefix.split("\n"),t=e.pop(),n=e.pop();if(n){const r=/^\W+(todo:?\s+)/i.exec(n);if(r){const o=r[1],i=n.replace(o,"");P.prefix=e.join("\n")+"\n"+i+"\n"+t}}}t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX&&(P.prefix+=t.completionContext.prependToCompletion),y.info(e,`prompt: ${JSON.stringify(P)}`),y.debug(e,`prependToCompletion: ${T}`),(0,g.telemetry)(e,"solution.requested",t.savedTelemetryData);const A=await e.get(i.BlockModeConfig).forLanguage(e,S.languageId),N=(0,h.isSupportedLanguageId)(S.languageId),D=(0,d.contextIndentation)(S,x),M={stream:!0,extra:{language:S.languageId,next_indent:null!==(n=D.next)&&void 0!==n?n:0}};"parsing"!==A||N||(M.stop=["\n\n","\r\n\r\n"]);const L=(0,f.extractRepoInfoInBackground)(e,S.fileName),$={prompt:P,languageId:S.languageId,repoInfo:L,ourRequestId:O,engineUrl:await(0,c.getEngineURL)(e,(0,f.tryGetGitHubNWO)(L),S.languageId,(0,f.getDogFood)(L),(0,f.getUserKind)(e),t.savedTelemetryData),count:t.solutionCountTarget,uiKind:l.CopilotUiKind.Panel,postOptions:M,requestLogProbs:!0};let j;const F=t.completionContext.completionType===s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX?[s.CompletionType.UNKNOWN_FUNCTION_QUICK_FIX,t.completionContext.prependToCompletion]:t.completionContext.completionType;switch(A){case i.BlockMode.Server:j=async e=>{},M.extra.force_indent=null!==(a=D.prev)&&void 0!==a?a:-1;break;case i.BlockMode.ParsingAndServer:j=N?v(e,S,t.startPosition,F):async e=>{},M.extra.force_indent=null!==(w=D.prev)&&void 0!==w?w:-1;break;case i.BlockMode.Parsing:default:j=N?v(e,S,t.startPosition,F):async e=>{}}e.get(u.StatusReporter).setProgress();const q=await e.get(l.OpenAIFetcher).fetchAndStreamCompletions(e,$,g.TelemetryData.createAndMarkAsIssued(),j,R);if("failed"===q.type||"canceled"===q.type)return t.reportCancelled(),e.get(u.StatusReporter).removeProgress(),{status:"FinishedWithError",error:`${q.type}: ${q.reason}`};let B=q.choices;B=async function*(e,t){for await(const n of e){const e={...n};e.completionText=t+e.completionText.trimRight(),yield e}}(B,T),null!==E&&(B=(0,l.cleanupIndentChoices)(B,E)),B=(0,o.asyncIterableMapFilter)(B,(async t=>(0,m.postProcessChoice)(e,"solution",S,x,t,!1,y)));const U=(0,o.asyncIterableMapFilter)(B,(async n=>{let r=n.completionText;if(y.info(e,`Open Copilot completion: [${n.completionText}]`),t.completionContext.completionType===s.CompletionType.OPEN_COPILOT||t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX){let t="";const o=await(0,d.getNodeStart)(e,S,x,n.completionText);if(o)[t]=(0,p.trimLastLine)(S.getText(C.range(C.position(o.line,o.character),x)));else{const e=C.position(x.line,0);t=S.getText(C.range(e,x))}r=t+r}let o=n.completionText;t.completionContext.completionType===s.CompletionType.TODO_QUICK_FIX&&(S.lineAt(x.line).isEmptyOrWhitespace||(o+="\n")),I.length>0&&o.startsWith(I)&&(o=o.substring(I.length));const i=n.meanLogProb;return{displayText:r,meanProb:void 0!==i?Math.exp(i):0,meanLogProb:i||0,completionText:o,requestId:n.requestId,choiceIndex:n.choiceIndex,prependToCompletion:T}}));return b(e.get(u.StatusReporter),R,U[Symbol.asyncIterator]())}},446:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDefaultHandlers=void 0;const r=n(39),o=n(5489);t.registerDefaultHandlers=function(e,t){process.addListener("uncaughtException",(t=>{console.error("uncaughtException",t),o.telemetryException(e,t,"uncaughtException")}));let n=!1;process.addListener("unhandledRejection",((i,s)=>{if(n)return;if(n=!0,"vscode"===t&&!i)return;if("aborted"===i.type||(0,r.isAbortError)(i))return;if("vscode"===t&&["ENOTFOUND","ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENETDOWN","ENETUNREACH","EADDRNOTAVAIL"].includes(i.code))return;if("ENOENT"==i.code)return;let a="";try{a=`${i.message} (${i.code})`,a=JSON.stringify(i)}catch(e){a="[actual reason JSON was cyclic]"}"vscode"===t&&"{}"===a||(console.error("unhandledRejection",a),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:"Unhandled rejection logged to restricted telemetry"}),!1),o.telemetryError(e,"unhandledRejection",o.TelemetryData.createAndMarkAsIssued({origin:"unhandledRejection",reason:a}),!0),n=!1)}))}},5225:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDocumentTracker=t.sortByAccessTimes=void 0;const r=n(819),o=new Map;t.sortByAccessTimes=function(e){return[...e].sort(((e,t)=>{var n,r;const i=null!==(n=o.get(e.uri.toString()))&&void 0!==n?n:0;return(null!==(r=o.get(t.uri.toString()))&&void 0!==r?r:0)-i}))},t.registerDocumentTracker=e=>e.get(r.TextDocumentManager).onDidFocusTextDocument((e=>{e&&o.set(e.document.uri.toString(),Date.now())}))},5917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfig=t.ExpTreatmentVariables=void 0;const r=n(5489),o=n(4914);var i;(i=t.ExpTreatmentVariables||(t.ExpTreatmentVariables={})).AA="copilotaa",i.CustomEngine="copilotcustomengine",i.Fetcher="copilotfetcher",i.OverrideBlockMode="copilotoverrideblockmode",i.OverrideNumGhostCompletions="copilotoverridednumghostcompletions",i.SuffixPercent="CopilotSuffixPercent",i.BeforeRequestWaitMs="copilotlms",i.NeighboringTabsOption="copilotneighboringtabs",i.DebounceMs="copilotdebouncems",i.DebouncePredict="copilotdebouncepredict",i.ContextualFilterAcceptThreshold="copilotcontextualfilteracceptthreshold",i.disableLogProb="copilotLogProb",i.GranularityTimePeriodSizeInH="copilottimeperiodsizeinh",i.GranularityByCallBuckets="copilotbycallbuckets",i.SuffixStartMode="copilotsuffixstartmode",i.SuffixMatchThreshold="copilotsuffixmatchthreshold",i.MultiLogitBias="copilotlbeot";class s{constructor(e,t,n){this.variables=e,this.assignmentContext=t,this.features=n}static createFallbackConfig(e,t){return(0,r.telemetryExpProblem)(e,{reason:t}),this.createEmptyConfig()}static createEmptyConfig(){return new s({},"","")}addToTelemetry(e){e.properties[o.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features,e.properties[o.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName]=this.assignmentContext}}t.ExpConfig=s},6905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Features=t.Task=void 0;const r=n(4617),o=n(2137),i=n(140),s=n(5917),a=n(6046),c=n(2249),l=n(8495);class u{constructor(e){this.ctx=e,this.cache=new i.LRUCache(200)}async fetchExpConfig(e){let t=this.cache.get(e.stringify());return t||(t=new d((()=>this.ctx.get(a.ExpConfigMaker).fetchExperiments(this.ctx,e.toHeaders())),36e5),this.cache.put(e.stringify(),t)),t.run()}getCachedExpConfig(e){const t=this.cache.get(e.stringify());return null==t?void 0:t.value()}}class d{constructor(e,t=1/0){this.producer=e,this.expirationMs=t}async run(){return void 0===this.promise&&(this.promise=this.producer(),this.storeResult(this.promise).then((()=>{this.expirationMs<1/0&&void 0!==this.promise&&setTimeout((()=>this.promise=void 0),this.expirationMs)}))),this.promise}async storeResult(e){try{this.result=await e}finally{void 0===this.result&&(this.promise=void 0)}}value(){return this.result}}t.Task=d;class p{constructor(e){this.ctx=e,this.staticFilters={},this.dynamicFilters={},this.upcomingDynamicFilters={},this.assignments=new u(this.ctx),this.granularityDirectory=new l.GranularityDirectory("unspecified",e.get(o.Clock))}setPrefix(e){this.granularityDirectory=new l.GranularityDirectory(e,this.ctx.get(o.Clock))}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,t){this.dynamicFilters[e]=t}getDynamicFilterValues(){const e={};for(const[t,n]of Object.entries(this.dynamicFilters))e[t]=n();return e}registerUpcomingDynamicFilter(e,t){this.upcomingDynamicFilters[e]=t}async getAssignment(e,t={},n){var r,o;const i=this.makeFilterSettings(t),a=this.granularityDirectory.extendFilters(i),c=await this.getExpConfig(a.newFilterSettings);this.granularityDirectory.update(i,+(null!==(r=c.variables[s.ExpTreatmentVariables.GranularityByCallBuckets])&&void 0!==r?r:NaN),+(null!==(o=c.variables[s.ExpTreatmentVariables.GranularityTimePeriodSizeInH])&&void 0!==o?o:NaN));const l=this.granularityDirectory.extendFilters(i),u=l.newFilterSettings,d=await this.getExpConfig(u);let h=new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs)));for(const e of l.otherFilterSettingsToPrefetch)h=h.then((async()=>{await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e)}));return this.prepareForUpcomingFilters(u),n&&(n.filtersAndExp={exp:d,filters:u}),d.variables[e]}makeFilterSettings(e){return new c.FilterSettings({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e){try{return this.assignments.fetchExpConfig(e)}catch(e){return s.ExpConfig.createFallbackConfig(this.ctx,`Error fetching ExP config: ${e}`)}}async prepareForUpcomingFilters(e){if(!((new Date).getMinutes()<60-p.upcomingTimeBucketMinutes))for(const[t,n]of Object.entries(this.upcomingDynamicFilters))await new Promise((e=>setTimeout(e,p.upcomingDynamicFilterCheckDelayMs))),this.getExpConfig(e.withChange(t,n()))}stringify(){var e;const t=this.assignments.getCachedExpConfig(new c.FilterSettings({}));return JSON.stringify(null!==(e=null==t?void 0:t.variables)&&void 0!==e?e:{})}async customEngine(e,t,n,r,o){var i;const a={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t,[c.Filter.CopilotDogfood]:n,[c.Filter.CopilotUserKind]:r};return null!==(i=await this.getAssignment(s.ExpTreatmentVariables.CustomEngine,a,o))&&void 0!==i?i:""}async beforeRequestWaitMs(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.BeforeRequestWaitMs,o,n))&&void 0!==r?r:0}async multiLogitBias(e,t,n){var r;const o={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(r=await this.getAssignment(s.ExpTreatmentVariables.MultiLogitBias,o,n))&&void 0!==r&&r}async debounceMs(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.DebounceMs))&&void 0!==e?e:0}async debouncePredict(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.DebouncePredict))&&void 0!==e&&e}async contextualFilterAcceptThreshold(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.ContextualFilterAcceptThreshold))&&void 0!==e?e:void 0}async disableLogProb(){var e;return null!==(e=await this.getAssignment(s.ExpTreatmentVariables.disableLogProb))&&void 0!==e&&e}async overrideBlockMode(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideBlockMode)}async overrideNumGhostCompletions(){return await this.getAssignment(s.ExpTreatmentVariables.OverrideNumGhostCompletions)}async suffixPercent(e,t){var n;const r={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(s.ExpTreatmentVariables.SuffixPercent,r))&&void 0!==n?n:0}async suffixMatchThreshold(e,t){var n;const r={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};return null!==(n=await this.getAssignment(s.ExpTreatmentVariables.SuffixMatchThreshold,r))&&void 0!==n?n:0}async suffixStartMode(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.SuffixStartMode,n)){default:return r.SuffixStartMode.Cursor;case"cursortrimstart":return r.SuffixStartMode.CursorTrimStart;case"siblingblock":return r.SuffixStartMode.SiblingBlock;case"siblingblocktrimstart":return r.SuffixStartMode.SiblingBlockTrimStart}}async neighboringTabsOption(e,t){const n={[c.Filter.CopilotRepository]:e,[c.Filter.CopilotFileType]:t};switch(await this.getAssignment(s.ExpTreatmentVariables.NeighboringTabsOption,n)){case"none":return r.NeighboringTabsOption.None;case"conservative":return r.NeighboringTabsOption.Conservative;case"medium":return r.NeighboringTabsOption.Medium;default:return r.NeighboringTabsOption.Eager;case"eagerbutlittle":return r.NeighboringTabsOption.EagerButLittle}}async addExpAndFilterToTelemetry(e){const t=this.makeFilterSettings({});e.filtersAndExp={filters:t,exp:await this.getExpConfig(t)}}}t.Features=p,p.upcomingDynamicFilterCheckDelayMs=20,p.upcomingTimeBucketMinutes=5+Math.floor(11*Math.random())},6046:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpConfigNone=t.ExpConfigFromTAS=t.ExpConfigMaker=void 0;const r=n(39),o=n(5917);class i{}t.ExpConfigMaker=i,t.ExpConfigFromTAS=class extends i{async fetchExperiments(e,t){var n;const i=e.get(r.Fetcher);let s;try{s=await i.fetch("https://default.exp-tas.com/vscode/ab",{method:"GET",headers:t})}catch(t){return o.ExpConfig.createFallbackConfig(e,`Error fetching ExP config: ${t}`)}if(!s.ok)return o.ExpConfig.createFallbackConfig(e,`ExP responded with ${s.status}`);const a=await s.json(),c=null!==(n=a.Configs.find((e=>"vscode"===e.Id)))&&void 0!==n?n:{Id:"vscode",Parameters:{}},l=Object.entries(c.Parameters).map((([e,t])=>e+(t?"":"cf")));return new o.ExpConfig(c.Parameters,a.AssignmentContext,l.join(";"))}},t.ExpConfigNone=class extends i{async fetchExperiments(e,t){return o.ExpConfig.createEmptyConfig()}}},2249:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.FilterSettings=t.telmetryNames=t.TargetPopulation=t.Filter=void 0,function(e){e.Market="X-MSEdge-Market",e.CorpNet="X-FD-Corpnet",e.ApplicationVersion="X-VSCode-AppVersion",e.Build="X-VSCode-Build",e.ClientId="X-MSEdge-ClientId",e.ExtensionName="X-VSCode-ExtensionName",e.ExtensionVersion="X-VSCode-ExtensionVersion",e.Language="X-VSCode-Language",e.TargetPopulation="X-VSCode-TargetPopulation",e.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",e.CopilotOverrideEngine="X-Copilot-OverrideEngine",e.CopilotRepository="X-Copilot-Repository",e.CopilotFileType="X-Copilot-FileType",e.CopilotUserKind="X-Copilot-UserKind",e.CopilotDogfood="X-Copilot-Dogfood"}(n=t.Filter||(t.Filter={})),(r=t.TargetPopulation||(t.TargetPopulation={})).Team="team",r.Internal="internal",r.Insiders="insider",r.Public="public",t.telmetryNames={[n.CopilotClientTimeBucket]:"timeBucket",[n.CopilotOverrideEngine]:"engine",[n.CopilotRepository]:"repo",[n.CopilotFileType]:"fileType",[n.CopilotUserKind]:"userKind"};class o{constructor(e){this.filters=e;for(const[e,t]of Object.entries(this.filters))""===t&&delete this.filters[e]}extends(e){for(const[t,n]of Object.entries(e.filters))if(this.filters[t]!==n)return!1;return!0}addToTelemetry(e){for(const[n,r]of Object.entries(this.filters)){const o=t.telmetryNames[n];void 0!==o&&(e.properties[o]=r)}}stringify(){const e=Object.keys(this.filters);return e.sort(),e.map((e=>`${e}:${this.filters[e]}`)).join(";")}toHeaders(){return{...this.filters}}withChange(e,t){return new o({...this.filters,[e]:t})}}t.FilterSettings=o},8495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GranularityDirectory=void 0;const r=n(2249),o=n(2505),i=r.Filter.CopilotClientTimeBucket;t.GranularityDirectory=class{constructor(e,t){this.specs=new Map,this.prefix=e,this.clock=t,this.defaultGranularity=(0,o.DEFAULT_GRANULARITY)(e)}selectGranularity(e){for(const[t,n]of this.specs.entries())if(e.extends(t))return n;return this.defaultGranularity}update(e,t,n){if(t=t>1?t:NaN,n=n>0?n:NaN,isNaN(t)&&isNaN(n))this.specs.delete(e);else{const r=new o.TimeBucketGranularity(this.prefix);isNaN(t)||r.setByCallBuckets(t),isNaN(n)||r.setTimePeriod(3600*n*1e3),this.specs.set(e,r)}}extendFilters(e){const t=this.selectGranularity(e),[n,r]=t.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(i,n),otherFilterSettingsToPrefetch:r.map((t=>e.withChange(i,t)))}}}},2505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBucketGranularity=t.DEFAULT_GRANULARITY=t.GranularityImplementation=void 0;class n{constructor(e){this.prefix=e}getCurrentAndUpComingValues(e){return[this.getValue(e),this.getUpcomingValues(e)]}}t.GranularityImplementation=n;class r extends n{getValue(e){return this.prefix}getUpcomingValues(e){return[]}}t.DEFAULT_GRANULARITY=e=>new r(e),t.TimeBucketGranularity=class extends n{constructor(e,t=.5,n=(new Date).setUTCHours(0,0,0,0)){super(e),this.prefix=e,this.fetchBeforeFactor=t,this.anchor=n}setTimePeriod(e){isNaN(e)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=e}setByCallBuckets(e){isNaN(e)?this.numByCallBuckets=void 0:this.numByCallBuckets=e}getValue(e){return this.prefix+this.getTimePeriodBucketString(e)+(this.numByCallBuckets?this.timeHash(e):"")}getTimePeriodBucketString(e){return this.timePeriodLengthMs?this.dateToTimePartString(e):""}getUpcomingValues(e){const t=[],n=this.getUpcomingTimePeriodBucketStrings(e),r=this.getUpcomingByCallBucketStrings();for(const e of n)for(const n of r)t.push(this.prefix+e+n);return t}getUpcomingTimePeriodBucketStrings(e){if(void 0===this.timePeriodLengthMs)return[""];if((e.getTime()-this.anchor)%this.timePeriodLengthMse.toString()))}timeHash(e){return null==this.numByCallBuckets?0:e.getTime()%this.numByCallBuckets*7883%this.numByCallBuckets}dateToTimePartString(e){return null==this.timePeriodLengthMs?"":Math.floor((e.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}}},4914:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpServiceTelemetryNames=void 0,(n=t.ExpServiceTelemetryNames||(t.ExpServiceTelemetryNames={})).featuresTelemetryPropertyName="VSCode.ABExp.Features",n.assignmentContextTelemetryPropertyName="abexp.assignmentcontext"},6817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterScore=t.getLastLineLength=t.ContextualFilterManager=void 0;const r=n(187);class o{constructor(){this.previousLabel=0,this.previousLabelTimestamp=Date.now()-3600,this.probabilityAccept=0}}function i(e){const t=e.split("\n");return t[t.length-1].length}t.ContextualFilterManager=o,t.getLastLineLength=i,t.contextualFilterScore=function(e,t,n){const s=e.get(o),a=s.previousLabel;let c=0;"afterCursorWhitespace"in t.properties&&"true"===t.properties.afterCursorWhitespace&&(c=1);const l=(Date.now()-s.previousLabelTimestamp)/1e3,u=Math.log(1+l);let d=0,p=0;const h=n.prefix;if(h){d=Math.log(1+i(h));const e=h.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(p=r.contextualFilterCharacterMap[e])}let f=0,m=0;const g=h.trimEnd();if(g){f=Math.log(1+i(g));const e=g.slice(-1);void 0!==r.contextualFilterCharacterMap[e]&&(m=r.contextualFilterCharacterMap[e])}let _=0;if("documentLength"in t.measurements){const e=t.measurements.documentLength;_=Math.log(1+e)}let y=0;if("promptEndPos"in t.measurements){const e=t.measurements.promptEndPos;y=Math.log(1+e)}let v=0;if("promptEndPos"in t.measurements&&"documentLength"in t.measurements){const e=t.measurements.documentLength;v=(t.measurements.promptEndPos+.5)/(1+e)}let b=0;void 0!==r.contextualFilterLanguageMap[t.properties.languageId]&&(b=r.contextualFilterLanguageMap[t.properties.languageId]);let w=r.contextualFilterIntercept;w+=r.contextualFilterWeights[0]*a,w+=r.contextualFilterWeights[1]*c,w+=r.contextualFilterWeights[2]*u,w+=r.contextualFilterWeights[3]*d,w+=r.contextualFilterWeights[4]*f,w+=r.contextualFilterWeights[5]*_,w+=r.contextualFilterWeights[6]*y,w+=r.contextualFilterWeights[7]*v,w+=r.contextualFilterWeights[8+b],w+=r.contextualFilterWeights[29+p],w+=r.contextualFilterWeights[125+m];const x=1/(1+Math.exp(-w));return e.get(o).probabilityAccept=x,x}},187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextualFilterCharacterMap=t.contextualFilterLanguageMap=t.contextualFilterWeights=t.contextualFilterIntercept=void 0,t.contextualFilterIntercept=-.3043572714994554,t.contextualFilterWeights=[.9978708359643611,.7001905605239328,-.1736749244124868,-.22994157947320112,.13406692641682572,-.007751370662011853,.0057783222035240715,.41910878254476003,-.1621657125711092,.13770814958908187,-.06036011308184006,-.07351180985800129,0,-.05584878151248109,.30618794079412015,-.1282197982598485,.10951859303997555,.1700461782788777,-.3346057842644757,.22497985923128136,0,-.44038101825774356,-.6540115939236782,.16595600081341702,.20733910722385135,-.1337033766105696,-.06923072125290894,-.05806684191976292,.3583334671633344,-.47357732824944315,.17810871365594377,.42268219963946685,0,0,-.16379620467004602,-.43893868831061167,0,.11570094006709251,.9326431262654882,-.9990110509203912,-.44125275652726503,-.15840786997162004,-.4600396256644451,-.018814811994044403,.09230944537175266,.025814790934742798,-1.0940162204190154,-.9407503631235489,-.9854303778694269,-1.1045822488262245,-1.1417299456573262,-1.5623704405345513,-.4157473855795939,-1.0244257735561713,-.7477401944601753,-1.1275109699068402,-.0714715633552533,-1.1408628006786907,-1.0409898655074672,-.2288889836518878,-.5469549893760344,-.181946611106845,.1264329316374918,0,0,.312206968554707,-.3656436392517924,.23655650686038968,.1014912419901576,0,.06287549221765308,0,0,.19027065218932154,-.8519502045974378,0,.23753599905971923,.2488809322489166,.019969251907983224,0,.06916505526229488,.29053356359188204,-.14484456555431657,.014768129429370188,-.15051464926341374,.07614835502776021,-.3317489901313935,0,0,.04921938684669103,-.28248576768353445,-.9708816204525345,-1.3560464522265527,.014165375212383239,-.23924166472544983,.10006595730248855,.09867233147279562,.32330430333220644,-.058625706114180595,.17149853105783947,.4436484054395367,.047189049576707255,.16832520944790552,.1117259900942179,-.35469010329927253,0,-.1528189124465582,-.3804848349564939,.07278077320753953,.13263786480064088,.22920682659292527,1.1512955314336537,0,.016939862282340023,.4242994650403408,.12759835577444986,-.5577261135825583,-.19764560943067672,-.4042102444736004,.12063461617733708,-.2933966817484834,.2715683893968593,0,-.7138548251238751,0,-.023066228703035277,0,-.06383043976746139,.09683723720709651,-.7337151424080791,0,-.27191370124625525,.2819781269656171,-.08711496549050252,.11048604909969338,-.0934849550450534,.0721001250772912,.2589126797890794,.6729582659532254,-.21921032738244908,-.21535277468651456,-.45474006124091354,-.05861820126419139,-.007875306207720204,-.056661261678809284,.17727881404222662,.23603713348534658,.17485861412377932,-.5737483768696752,-.38220029570342745,-.5202722985519168,-.37187947527657256,.47155277792990113,-.12077912346691123,.47825628981545326,.4736704404000214,-.1615218651546898,.18362447973513005,0,0,-.18183417425866824,0,0,-.2538532305733833,-.1303692690676528,-.4073577969188216,.04172985870928789,-.1704527388573901,0,0,.7536858953385828,-.44703159588787644,0,-.7246484085580873,-.21378128540782063,0,.037461090552656146,-.16205852364367032,-.10973952064404884,.017468043407647377,-.1288980387397392,0,0,0,-1.218692715379445,.05536949662193305,-.3763799844799116,-.1845001725624579,-.1615576298149558,0,-.15373262203249874,-.04603412604270418,0,-.3068149681460828,.09412352468269412,0,.09116543650609721,.06065865264082559,.05688267379386188,-.05873945477722306,0,.14532465133322153,.1870857769705463,.36304258043185555,.1411392422180405,.0630388629716367,0,-1.1170522012450395,.16133697772771127,.15908534390781448,-.23485453704002232,-.1419980841417892,.21909510179526218,.39948420260153766,.40802294284289187,.15403767653746853,0,.19764784115096676,.584914157527457,0,-.4573883817015294],t.contextualFilterLanguageMap={javascript:1,typescript:2,typescriptreact:3,python:4,vue:5,php:6,dart:7,javascriptreact:8,go:9,css:10,cpp:11,html:12,scss:13,markdown:14,csharp:15,java:16,json:17,rust:18,ruby:19,c:20},t.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}},3993:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.completionsFromGhostTextResults=void 0;const r=n(7057),o=n(2369),i=n(702),s=n(5034);t.completionsFromGhostTextResults=function(e,t,n,a,c,l,u){const d=e.get(o.LocationFactory),p=a.lineAt(c);let h=t.map((e=>{let t,o="";if(l&&(e.completion=(0,s.normalizeIndentCharacter)(l,e.completion,p.isEmptyOrWhitespace)),e.completion.displayNeedsWsOffset&&p.isEmptyOrWhitespace)t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else if(p.isEmptyOrWhitespace&&e.completion.completionText.startsWith(p.text))t=d.range(d.position(c.line,0),c),o=e.completion.completionText;else{const n=a.getWordRangeAtPosition(c);if(e.isMiddleOfTheLine){const n=a.lineAt(c),r=d.range(d.position(c.line,0),c),i=a.getText(r);t=e.coversSuffix?n.range:r,o=i+e.completion.displayText}else if(n){const r=a.getText(n);t=d.range(n.start,c),o=r+e.completion.completionText}else{const n=d.range(d.position(c.line,0),c);t=n,o=a.getText(n)+e.completion.displayText}}return{uuid:(0,r.v4)(),text:o,range:t,file:a.uri,index:e.completion.completionIndex,telemetry:e.telemetry,displayText:e.completion.displayText,position:c,offset:a.offsetAt(c),resultType:n}}));if(n===i.ResultType.TypingAsSuggested&&void 0!==u){const e=h.find((e=>e.index===u));if(e){const t=h.filter((e=>e.index!==u));h=[e,...t]}}return h}},4619:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDebounceLimit=t.GhostTextDebounceManager=void 0;const r=n(6905);class o{constructor(e){this.forceDelayMs=e,this.extraDebounceMs=0}}t.GhostTextDebounceManager=o,t.getDebounceLimit=async function(e,t){let n;if(await e.get(r.Features).debouncePredict()&&t.measurements.contextualFilterScore){const e=t.measurements.contextualFilterScore,r=.275,o=6;n=25+250/(1+Math.pow(e/r,o))}else n=await e.get(r.Features).debounceMs();return(n>0?n:75)+e.get(o).extraDebounceMs}},702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGhostText=t.completionCache=t.ResultType=t.ghostTextLogger=void 0;const r=n(4617),o=n(7057),i=n(140),s=n(3940),a=n(1661),c=n(9800),l=n(6905),u=n(5798),d=n(39),p=n(7553),h=n(2031),f=n(598),m=n(6635),g=n(7917),_=n(4090),y=n(3591),v=n(1153),b=n(3883),w=n(5489),x=n(913),T=n(2369),E=n(6817),C=n(4619),S=n(1749);var k;let P,I;async function R(e,n,r,o,i,s,a){var u,p,m;t.ghostTextLogger.debug(e,`Getting ${s} from network`),r=r.extendedBy();const g=await async function(e,t){const n=await e.get(l.Features).overrideNumGhostCompletions();return n?t.isCycling?Math.max(0,3-n):n:(0,c.shouldDoParsingTrimming)(t.blockMode)&&t.multiline?(0,c.getConfig)(e,c.ConfigKey.InlineSuggestCount):t.isCycling?2:1}(e,n),_=(0,f.getTemperatureForSamples)(e,g),y={stream:!0,n:g,temperature:_,extra:{language:n.languageId,next_indent:null!==(u=n.indentation.next)&&void 0!==u?u:0}};n.multiline||(y.stop=["\n"]),n.multiline&&n.multiLogitBias&&(y.logit_bias={50256:-100});const v=Date.now(),b={endpoint:"completions",uiKind:h.CopilotUiKind.GhostText,isCycling:JSON.stringify(n.isCycling),temperature:JSON.stringify(_),n:JSON.stringify(g),stop:null!==(p=JSON.stringify(y.stop))&&void 0!==p?p:"unset",logit_bias:JSON.stringify(null!==(m=y.logit_bias)&&void 0!==m?m:null)},T=(0,w.telemetrizePromptLength)(n.prompt);Object.assign(r.properties,b),Object.assign(r.measurements,T);try{const s={prompt:n.prompt,languageId:n.languageId,repoInfo:n.repoInfo,ourRequestId:n.ourRequestId,engineUrl:n.engineURL,count:g,uiKind:h.CopilotUiKind.GhostText,postOptions:y};n.delayMs>0&&await new Promise((e=>setTimeout(e,n.delayMs)));const c=await e.get(h.OpenAIFetcher).fetchAndStreamCompletions(e,s,r,i,o);return"failed"===c.type?{type:"failed",reason:c.reason,telemetryData:(0,S.mkBasicResultTelemetry)(r)}:"canceled"===c.type?(t.ghostTextLogger.debug(e,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:c.reason,telemetryData:(0,S.mkCanceledResultTelemetry)(r)}):a(g,v,c.getProcessingTime(),c.choices)}catch(n){if((0,d.isAbortError)(n))return{type:"canceled",reason:"network request aborted",telemetryData:(0,S.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(t.ghostTextLogger.error(e,`Error on ghost text request ${n}`),(0,x.shouldFailForDebugPurposes)(e))throw n;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,S.mkBasicResultTelemetry)(r)}}}function O(e,t){const n={...e};return n.completionText=e.completionText.trimEnd(),t.forceSingleLine&&(n.completionText=n.completionText.split("\n")[0]),n}t.ghostTextLogger=new u.Logger(u.LogLevel.INFO,"ghostText"),function(e){e[e.Network=0]="Network",e[e.Cache=1]="Cache",e[e.TypingAsSuggested=2]="TypingAsSuggested",e[e.Cycling=3]="Cycling"}(k=t.ResultType||(t.ResultType={})),t.completionCache=new i.LRUCache(100);const A=new s.Debouncer;function N(e,t){P=e,I=t}function D(e,n,r){const o=(0,i.keyForPrompt)(n.prompt),s=t.completionCache.get(o);s&&s.multiline===r.multiline?t.completionCache.put(o,{multiline:s.multiline,choices:s.choices.concat(r.choices)}):t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Appended cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}function M(e,n){const r=t.completionCache.get(e);if(r&&(!n||r.multiline))return r.choices}function L(e,t,n){if(n.length>0){if(t.startsWith(n))return{completionIndex:e,completionText:t,displayText:t.substr(n.length),displayNeedsWsOffset:!1};{const r=t.substr(0,t.length-t.trimLeft().length);return n.startsWith(r)?{completionIndex:e,completionText:t,displayText:t.trimLeft(),displayNeedsWsOffset:!0}:{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}}return{completionIndex:e,completionText:t,displayText:t,displayNeedsWsOffset:!1}}function $(e,n){const r=n.requestId,o={choiceIndex:n.choiceIndex.toString()},i={numTokens:n.numTokens,compCharLen:n.completionText.length,numLines:n.completionText.split("\n").length};n.meanLogProb&&(i.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(i.meanAlternativeLogProb=n.meanAlternativeLogProb);const s=n.telemetryData.extendedBy(o,i);return s.extendWithRequestId(r),s.measurements.confidence=(0,v.ghostTextScoreConfidence)(e,s),s.measurements.quantile=(0,v.ghostTextScoreQuantile)(e,s),t.ghostTextLogger.debug(e,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${s.measurements.confidence} (expected as good or better than about ${s.measurements.quantile} of all suggestions)`),s}function j(e,t,n,r,o){const i=Date.now()-r,s=i-o,a=n.telemetryData.extendedBy({},{completionCharLen:n.completionText.length,requestTimeMs:i,processingTimeMs:o,deltaMs:s,meanLogProb:n.meanLogProb||NaN,meanAlternativeLogProb:n.meanAlternativeLogProb||NaN,numTokens:n.numTokens});a.extendWithRequestId(n.requestId),(0,w.telemetry)(e,`ghostText.${t}`,a)}t.getGhostText=async function(e,n,s,u,d,f){var v,F;const q=await(0,_.extractPrompt)(e,n,s);if("contextTooShort"===q.type)return t.ghostTextLogger.debug(e,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context"};if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled after extractPrompt"};const B=function(e,t){const n=(o=t,0!=e.lineAt(o).text.substr(o.character).trim().length),r=function(e,t){const n=t.lineAt(e).text.substr(e.character).trim();return/^\s*[)}\]"'`]*\s*[:{;,]?\s*$/.test(n)}(t,e);var o;if(!n||r)return n&&r}(n,s);if(void 0===B)return t.ghostTextLogger.debug(e,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line"};const U=e.get(m.StatusReporter),H=e.get(T.LocationFactory),W=await async function(e,t,n,o,i,s){const a=await e.get(c.BlockModeConfig).forLanguage(e,t.languageId);switch(a){case c.BlockMode.Server:return{blockMode:c.BlockMode.Server,requestMultiline:!0,isCyclingRequest:i,finishedCb:async e=>{}};case c.BlockMode.Parsing:case c.BlockMode.ParsingAndServer:default:{const c=await async function(e,t,n,o){if(t.lineCount>=8e3)(0,w.telemetry)(e,"ghostText.longFileMultilineSkip",w.TelemetryData.createAndMarkAsIssued({languageId:t.languageId,lineCount:String(t.lineCount),currentLine:String(n.line)}));else{if(!o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n);if(o&&(0,r.isSupportedLanguageId)(t.languageId))return await(0,g.isEmptyBlockStart)(t,n)||await(0,g.isEmptyBlockStart)(t,t.lineAt(n).range.end)}return!1}(e,t,n,s);return c?{blockMode:a,requestMultiline:!0,isCyclingRequest:!1,finishedCb:async r=>{let i;return i=o.trailingWs.length>0&&!o.prompt.prefix.endsWith(o.trailingWs)?e.get(T.LocationFactory).position(n.line,Math.max(n.character-o.trailingWs.length,0)):n,(0,g.isBlockBodyFinished)(e,t,i,r)}}:{blockMode:a,requestMultiline:!1,isCyclingRequest:i,finishedCb:async e=>{}}}}}(e,n,s,q,u,B);if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after requestMultiline"),{type:"abortedBeforeIssued",reason:"Cancelled after requestMultiline"};const[z]=(0,_.trimLastLine)(n.getText(H.range(H.position(0,0),s)));let K=function(e,n,r,o){const s=function(e,n,r){if(!P||!I||!n.startsWith(P))return;const o=M(I,r);if(!o)return;const i=n.substring(P.length);t.ghostTextLogger.debug(e,`Getting completions for user-typing flow - remaining prefix: ${i}`);const s=[];return o.forEach((e=>{const t=O(e,{forceSingleLine:!1});t.completionText.startsWith(i)&&(t.completionText=t.completionText.substring(i.length),s.push(t))})),s}(e,n,o);if(s&&s.length>0)return[s,k.TypingAsSuggested];const a=function(e,n,r,o){const s=(0,i.keyForPrompt)(r);t.ghostTextLogger.debug(e,`Trying to get completions from cache for key: ${s}`);const a=M(s,o);if(a){t.ghostTextLogger.debug(e,`Got completions from cache for key: ${s}`);const r=[];a.forEach((e=>{const t=O(e,{forceSingleLine:!o});r.push(t)}));const i=r.filter((e=>e.completionText));return i.length>0&&N(n,s),i}}(e,n,r,o);return a&&a.length>0?[a,k.Cache]:void 0}(e,z,q.prompt,W.requestMultiline);const V=o.v4(),G=(0,y.extractRepoInfoInBackground)(e,n.fileName),J=await(0,p.getEngineURL)(e,(0,y.tryGetGitHubNWO)(G),n.languageId,(0,y.getDogFood)(G),(0,y.getUserKind)(e),d),X=await e.get(l.Features).beforeRequestWaitMs((0,y.tryGetGitHubNWO)(G)||"",n.languageId),Q=await e.get(l.Features).multiLogitBias((0,y.tryGetGitHubNWO)(G)||"",n.languageId),Y={blockMode:W.blockMode,languageId:n.languageId,repoInfo:G,engineURL:J,ourRequestId:V,prefix:z,prompt:q.prompt,multiline:W.requestMultiline,indentation:(0,g.contextIndentation)(n,s),isCycling:u,delayMs:X,multiLogitBias:Q},Z=await e.get(l.Features).debouncePredict(),ee=await e.get(l.Features).contextualFilterAcceptThreshold();let te=!1;(Z||"number"==typeof ee)&&(te=!0);const ne=function(e,t,n,r,o,i,s){const a=e.get(T.LocationFactory),c=t.lineAt(r.line),l=t.getText(a.range(c.range.start,r)),u=t.getText(a.range(r,c.range.end)),d={languageId:t.languageId,beforeCursorWhitespace:JSON.stringify(""===l.trim()),afterCursorWhitespace:JSON.stringify(""===u.trim())},p={...(0,w.telemetrizePromptLength)(o.prompt),promptEndPos:t.offsetAt(r),documentLength:t.getText().length,delayMs:n.delayMs},f=i.extendedBy(d,p);f.properties.promptChoices=JSON.stringify(o.promptChoices,((e,t)=>t instanceof Map?Array.from(t.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{}):t)),f.properties.promptBackground=JSON.stringify(o.promptBackground,((e,t)=>t instanceof Map?Array.from(t.values()):t)),f.measurements.promptComputeTimeMs=o.computeTimeMs,s&&(f.measurements.contextualFilterScore=(0,E.contextualFilterScore)(e,f,o.prompt));const m=n.repoInfo;return f.properties.gitRepoInformation=void 0===m?"unavailable":m===y.ComputationStatus.PENDING?"pending":"available",void 0!==m&&m!==y.ComputationStatus.PENDING&&(f.properties.gitRepoUrl=m.url,f.properties.gitRepoHost=m.hostname,f.properties.gitRepoOwner=m.owner,f.properties.gitRepoName=m.repo,f.properties.gitRepoPath=m.pathname),f.properties.engineName=(0,h.extractEngineName)(e,n.engineURL),f.properties.isMultiline=JSON.stringify(n.multiline),f.properties.blockMode=n.blockMode,f.properties.isCycling=JSON.stringify(n.isCycling),f.properties.headerRequestId=n.ourRequestId,(0,w.telemetry)(e,"ghostText.issued",f),f}(e,n,Y,s,q,d,te);if(W.isCyclingRequest&&(null!==(v=null==K?void 0:K[0].length)&&void 0!==v?v:0)>1||!W.isCyclingRequest&&void 0!==K)t.ghostTextLogger.info(e,"Found inline suggestions locally");else{if(null==U||U.setProgress(),W.isCyclingRequest){const n=await async function(e,n,r,o,i){return R(e,n,r,o,i,"all completions",(async(i,s,a,c)=>{const l=[];for await(const n of c){if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,S.mkCanceledResultTelemetry)(r)};if(n.completionText.trimEnd()){if(-1!==l.findIndex((e=>e.completionText.trim()===n.completionText.trim())))continue;l.push(n)}}return l.length>0&&(D(e,n,{multiline:n.multiline,choices:l}),j(e,"cyclingPerformance",l[0],s,a)),{type:"success",value:l,telemetryData:(0,S.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,f,W.finishedCb);if("success"===n.type){const e=null!==(F=null==K?void 0:K[0])&&void 0!==F?F:[];n.value.forEach((t=>{-1===e.findIndex((e=>e.completionText.trim()===t.completionText.trim()))&&e.push(t)})),K=[e,k.Cycling]}else if(void 0===K)return null==U||U.removeProgress(),n}else{const n=await(0,C.getDebounceLimit)(e,ne);try{await A.debounce(n)}catch{return{type:"canceled",reason:"by debouncer",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)}}if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled during debounce"),{type:"canceled",reason:"during debounce",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)};if(ee&&ne.measurements.contextualFilterScore&&ne.measurements.contextualFilterScore{const u=l[Symbol.asyncIterator](),d=await u.next();if(d.done)return t.ghostTextLogger.debug(e,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,S.mkBasicResultTelemetry)(r)};if(null==o?void 0:o.isCancellationRequested)return t.ghostTextLogger.debug(e,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,S.mkCanceledResultTelemetry)(r)};const p=d.value;if(void 0===p)return t.ghostTextLogger.debug(e,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,S.mkBasicResultTelemetry)(r)};j(e,"performance",p,a,c);const h=s-1;t.ghostTextLogger.debug(e,`Awaited first result, id: ${p.choiceIndex}`),function(e,n,r){const o=(0,i.keyForPrompt)(n.prompt);N(n.prefix,o),t.completionCache.put(o,r),t.ghostTextLogger.debug(e,`Cached ghost text for key: ${o}, multiline: ${r.multiline}, number of suggestions: ${r.choices.length}`)}(e,n,{multiline:n.multiline,choices:[p]});const f=[];for(let e=0;e{t.ghostTextLogger.debug(e,`Awaited remaining results, number of results: ${r.length}`);const o=[];for(const n of r){const r=n.value;if(void 0!==r&&(t.ghostTextLogger.info(e,`GhostText later completion: [${r.completionText}]`),r.completionText.trimEnd())){if(-1!==o.findIndex((e=>e.completionText.trim()===r.completionText.trim())))continue;if(r.completionText.trim()===p.completionText.trim())continue;o.push(r)}}o.length>0&&D(e,n,{multiline:n.multiline,choices:o})}));return(0,x.isRunningInTest)(e)&&await m,{type:"success",value:O(d.value,{forceSingleLine:!1}),telemetryData:(0,S.mkBasicResultTelemetry)(r),telemetryBlob:r}}))}(e,Y,ne,f,W.finishedCb);if("success"!==r.type)return null==U||U.removeProgress(),r;K=[[r.value],k.Network]}null==U||U.removeProgress()}if(void 0===K)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,S.mkBasicResultTelemetry)(ne)};const[re,oe]=K,ie=(0,a.asyncIterableMapFilter)((0,a.asyncIterableFromArray)(re),(async r=>(0,b.postProcessChoice)(e,"ghostText",n,s,r,B,t.ghostTextLogger))),se=[];for await(const r of ie){const o=B&&(0,b.checkSuffix)(n,s,r);if(null==f?void 0:f.isCancellationRequested)return t.ghostTextLogger.info(e,"Cancelled after post processing completions"),{type:"canceled",reason:"after post processing completions",telemetryData:(0,S.mkCanceledResultTelemetry)(ne)};const i=$(e,r),a={completion:L(r.choiceIndex,r.completionText,q.trailingWs),telemetry:i,isMiddleOfTheLine:B,coversSuffix:o};se.push(a)}return{type:"success",value:[se,oe],telemetryData:(0,S.mkBasicResultTelemetry)(ne),telemetryBlob:ne}}},5034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeIndentCharacter=void 0,t.normalizeIndentCharacter=function(e,t,n){function r(e,t,n){const r=new RegExp(`^(${t})+`,"g");return e.split("\n").map((e=>{const t=e.replace(r,""),o=e.length-t.length;return n(o)+t})).join("\n")}let o;if(o=void 0===e.tabSize||"string"==typeof e.tabSize?4:e.tabSize,!1===e.insertSpaces){const e=e=>r(e," ",(e=>"\t".repeat(Math.floor(e/o))+" ".repeat(e%o)));t.displayText=e(t.displayText),t.completionText=e(t.completionText)}else if(!0===e.insertSpaces){const e=e=>r(e,"\t",(e=>" ".repeat(e*o)));if(t.displayText=e(t.displayText),t.completionText=e(t.completionText),n){const e=e=>{const t=e.length-e.trimLeft().length,n=t%o;return 0!==n&&t>0?r(e," ".repeat(n),(e=>" ".repeat((Math.floor(e/o)+1)*o))):e};t.displayText=e(t.displayText),t.completionText=e(t.completionText)}}return t}},1749:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGhostTextResultTelemetry=t.mkBasicResultTelemetry=t.mkCanceledResultTelemetry=t.telemetryRejected=t.telemetryAccepted=t.telemetryShown=void 0;const r=n(5489),o=n(6817);t.telemetryShown=function(e,t,n,o){n.markAsDisplayed();const i=o?`${t}.shownFromCache`:`${t}.shown`;(0,r.telemetry)(e,i,n)},t.telemetryAccepted=function(e,t,n){const i=t+".accepted",s=e.get(o.ContextualFilterManager);s.previousLabel=1,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.telemetryRejected=function(e,t,n){const i=t+".rejected",s=e.get(o.ContextualFilterManager);s.previousLabel=0,s.previousLabelTimestamp=Date.now(),(0,r.telemetry)(e,i,n)},t.mkCanceledResultTelemetry=function(e,t={}){return{...t,telemetryBlob:e}},t.mkBasicResultTelemetry=function(e){return{headerRequestId:e.properties.headerRequestId,copilot_trackingId:e.properties.copilot_trackingId}},t.handleGhostTextResultTelemetry=async function(e,t){if("success"===t.type)return(0,r.telemetryRaw)(e,"ghostText.produced",t.telemetryData,{}),t.value;"abortedBeforeIssued"!==t.type&&("canceled"!==t.type?(0,r.telemetryRaw)(e,`ghostText.${t.type}`,{...t.telemetryData,reason:t.reason},{}):(0,r.telemetry)(e,"ghostText.canceled",t.telemetryData.telemetryBlob.extendedBy({reason:t.reason,cancelledNetworkRequest:t.telemetryData.cancelledNetworkRequest?"true":"false"})))}},5798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.toPlainText=t.Logger=t.MultiLog=t.OutputChannelLog=t.ConsoleLog=t.LogTarget=t.verboseLogging=t.LogVerbose=t.LogLevel=void 0;const r=n(2137),o=n(9800),i=n(5489);var s;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(s=t.LogLevel||(t.LogLevel={}));class a{constructor(e){this.logVerbose=e}}function c(e){return e.get(a).logVerbose}t.LogVerbose=a,t.verboseLogging=c;class l{shouldLog(e,t){}}t.LogTarget=l,t.ConsoleLog=class extends l{constructor(e){super(),this.console=e}logIt(e,t,n,...r){c(e)||t==s.ERROR?this.console.error(n,...r):t==s.WARN&&this.console.warn(n,...r)}},t.OutputChannelLog=class extends l{constructor(e){super(),this.output=e}logIt(e,t,n,...r){this.output.appendLine(`${n} ${r.map(d)}`)}},t.MultiLog=class extends l{constructor(e){super(),this.targets=e}logIt(e,t,n,...r){this.targets.forEach((o=>o.logIt(e,t,n,...r)))}};class u{constructor(e,t){this.minLoggedLevel=e,this.context=t}setLevel(e){this.minLoggedLevel=e}stringToLevel(e){return s[e]}log(e,t,n,...o){const a=s[t];t==s.ERROR&&(0,i.telemetryError)(e,"log",i.TelemetryData.createAndMarkAsIssued({context:this.context,level:a,message:o.length>0?JSON.stringify(o):"no msg"}),n);const c=e.get(l),u=c.shouldLog(e,t);if(!1===u)return;if(void 0===u&&!this.shouldLog(e,t,this.context))return;const d=e.get(r.Clock).now().toISOString(),p=`[${a}] [${this.context}] [${d}]`;c.logIt(e,t,p,...o)}shouldLog(e,t,n){var r,i;if(c(e))return!0;const s=(0,o.getConfig)(e,o.ConfigKey.DebugFilterLogCategories);if(s.length>0&&!s.includes(n))return!1;if((0,o.isProduction)(e))return t>=this.minLoggedLevel;const a=(0,o.getConfig)(e,o.ConfigKey.DebugOverrideLogLevels);return t>=(null!==(i=null!==(r=this.stringToLevel(a["*"]))&&void 0!==r?r:this.stringToLevel(a[this.context]))&&void 0!==i?i:this.minLoggedLevel)}debug(e,...t){this.log(e,s.DEBUG,!1,...t)}info(e,...t){this.log(e,s.INFO,!1,...t)}warn(e,...t){this.log(e,s.WARN,!1,...t)}error(e,...t){this.log(e,s.ERROR,!1,...t)}secureError(e,t,...n){this.log(e,s.ERROR,!1,t),this.log(e,s.ERROR,!0,t,...n)}}function d(e){return"object"==typeof e?JSON.stringify(e):String(e)}t.Logger=u,t.toPlainText=d,t.logger=new u(s.INFO,"default")},39:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postRequest=t.Response=t.HelixFetcher=t.isAbortError=t.Fetcher=t.init=void 0;const r=n(8606),o=n(3582),i=n(3837),s=n(9800),a=n(4619),c=n(5489);let l,u=!1;t.init=function(e){if(u){if(e!==l)throw new Error(`Networking re-initialized with mismatched version (old: ${l}, new: ${e})`)}else l=e,u=!0};class d{}t.Fetcher=d,t.isAbortError=function(e){return e instanceof r.AbortError},t.HelixFetcher=class extends d{constructor(e){super(),this.ctx=e,this.createSocketFactory=e=>{const t=o.httpOverHttp({proxy:e});return e=>new Promise((n=>{t.createSocket(e,(e=>{n(e)}))}))},this.fetchApi=this.createFetchApi(e)}set proxySettings(e){this._proxySettings=e,this.fetchApi=this.createFetchApi(this.ctx)}get proxySettings(){return this._proxySettings}createFetchApi(e){const t=e.get(s.BuildInfo),n=t.getBuildType()===s.BuildType.DEV,o=t.getBuildType()===s.BuildType.NIGHTLY,i=(0,s.getHiddenConfig)(e,s.ConfigKey.DebugAcceptSelfSignedCertificate,{default:!1})&&(n||o);return r.context({userAgent:`GithubCopilot/${t.getVersion()}`,rejectUnauthorized:!i,socketFactory:this._proxySettings?this.createSocketFactory(this._proxySettings):void 0})}async fetch(e,t){const n={...t,body:t.body?t.body:t.json,signal:t.signal},r=await this.fetchApi.fetch(e,n);return new p(r.status,r.statusText,r.headers,(()=>r.text()),(()=>r.json()),(async()=>r.body))}disconnectAll(){return this.fetchApi.reset()}makeAbortController(){return new r.AbortController}};class p{constructor(e,t,n,r,o,i){this.status=e,this.statusText=t,this.headers=n,this.getText=r,this.getJson=o,this.getBody=i,this.ok=this.status>=200&&this.status<300}async text(){return this.getText()}async json(){return this.getJson()}async body(){return this.getBody()}}t.Response=p,t.postRequest=function(e,t,n,r,o,l,p){if(!u)throw new Error("Networking must be initialized before being used");const h={Authorization:i.format("Bearer %s",n),"X-Request-Id":o,"Openai-Organization":"github-copilot","VScode-SessionId":e.get(s.VscInfo).sessionId,"VScode-MachineId":e.get(s.VscInfo).machineId,...(0,s.editorVersionHeaders)(e)};r&&(h["OpenAI-Intent"]=r);const f=e.get(a.GhostTextDebounceManager).forceDelayMs;f&&(h["X-Copilot-Force-Delay"]=f.toString());const m={method:"POST",headers:h,json:l,timeout:3e4},g=e.get(d);if(p){const t=g.makeAbortController();p.onCancellationRequested((()=>{(0,c.telemetry)(e,"networking.cancelRequest",c.TelemetryData.createAndMarkAsIssued({headerRequestId:o})),t.abort()})),m.signal=t.signal}return g.fetch(t,m).catch((n=>{if("ECONNRESET"==n.code||"ETIMEDOUT"==n.code||"ERR_HTTP2_INVALID_SESSION"==n.code||"ERR_HTTP2_GOAWAY_SESSION"==n.message)return(0,c.telemetry)(e,"networking.disconnectAll"),g.disconnectAll().then((()=>g.fetch(t,m)));throw n}))}},9035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationSender=void 0,t.NotificationSender=class{}},7553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEngineURL=t.TEST_ENGINE_PATHS=t.OPENAI_PROXY_HOST=void 0;const r=n(9800),o=n(6905),i=n(3591),s=n(913);t.OPENAI_PROXY_HOST="http://localhost:5000";const a="/v1/engines/codegen";t.TEST_ENGINE_PATHS=[a],t.getEngineURL=async function(e,n="",c,l="",u=i.UserKind.UNKNOWN,d){return function(e,n){let o=function(e){return(0,s.isRunningInTest)(e)?(0,r.getConfig)(e,r.ConfigKey.DebugTestOverrideProxyUrl):(0,r.getConfig)(e,r.ConfigKey.DebugOverrideProxyUrl)}(e);return 0==o.length&&(o=t.OPENAI_PROXY_HOST),`${o}${n}`}(e,await async function(e,t,n,i,s,c){const l=(0,r.getConfig)(e,r.ConfigKey.DebugOverrideEngine);if(l)return`/v1/engines/${l}`;const u=await e.get(o.Features).customEngine(t,n,i,s,c);return""!==u?`/v1/engines/${u}`:a}(e,n,c,l,u,d))}},2031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiveOpenAIFetcher=t.postProcessChoices=t.OpenAIFetcher=t.extractEngineName=t.getProcessingTime=t.getRequestId=t.CopilotUiKind=void 0;const r=n(3837),o=n(5765),i=n(1661),s=n(9800),a=n(6905),c=n(4619),l=n(5798),u=n(39),d=n(6635),p=n(3591),h=n(5489),f=n(598),m=n(4586),g=new l.Logger(l.LogLevel.INFO,"fetch");var _;function y(e,t){return{headerRequestId:e.headers.get("x-request-id")||"",completionId:t&&t.id?t.id:"",created:t&&t.created?t.created:0,serverExperiments:e.headers.get("X-Copilot-Experiment")||"",deploymentId:e.headers.get("azureml-model-deployment")||""}}function v(e){const t=e.headers.get("openai-processing-ms");return t?parseInt(t,10):0}function b(e,t){return t.split("/").pop()||(g.error(e,"Malformed engine URL: "+t),t)}!function(e){e.GhostText="ghostText",e.Panel="synthesize"}(_=t.CopilotUiKind||(t.CopilotUiKind={})),t.getRequestId=y,t.getProcessingTime=v,t.extractEngineName=b;class w{}function x(e,t){return null!=t&&t?e:(0,i.asyncIterableFilter)(e,(async e=>e.completionText.trim().length>0))}t.OpenAIFetcher=w,t.postProcessChoices=x,t.LiveOpenAIFetcher=class extends w{async fetchAndStreamCompletions(e,t,n,r,o){const s=e.get(d.StatusReporter),a="completions",c=await this.fetchWithParameters(e,a,t,o);if("not-sent"===c)return{type:"canceled",reason:"before fetch request"};if(null==o?void 0:o.isCancellationRequested){const t=await c.body();try{t.destroy()}catch(t){l.logger.error(e,`Error destroying stream: ${t}`)}return{type:"canceled",reason:"after fetch request"}}if(void 0===c){const n=this.createTelemetryData(a,e,t);return s.setWarning(),n.properties.error="Response was undefined",(0,h.telemetry)(e,"request.shownWarning",n),{type:"failed",reason:"fetch response was undefined"}}if(200!==c.status){const n=this.createTelemetryData(a,e,t);return this.handleError(e,s,n,c)}return{type:"success",choices:x((0,i.asyncIterableMap)((0,m.processSSE)(e,c,r,o),(async t=>(0,m.prepareSolutionForReturn)(e,t,n))),t.allowEmptyChoices),getProcessingTime:()=>v(c)}}createTelemetryData(e,t,n){return h.TelemetryData.createAndMarkAsIssued({endpoint:e,engineName:b(t,n.engineUrl),uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,t,n,i){const m=(0,s.getLanguageConfig)(e,s.ConfigKey.Stops),g=await e.get(a.Features).disableLogProb(),v={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:(0,s.getConfig)(e,s.ConfigKey.SolutionLength),temperature:(0,f.getTemperatureForSamples)(e,n.count),top_p:(0,s.getConfig)(e,s.ConfigKey.TopP),n:n.count,stop:m};!n.requestLogProbs&&g||(v.logprobs=2);const w=(0,p.tryGetGitHubNWO)(n.repoInfo);return void 0!==w&&(v.nwo=w),(0,s.shouldDoServerTrimming)(await e.get(s.BlockModeConfig).forLanguage(e,n.languageId))&&(v.feature_flags=["trim_to_block"]),n.postOptions&&Object.assign(v,n.postOptions),(null==i?void 0:i.isCancellationRequested)?"not-sent":(l.logger.info(e,`[fetchCompletions] engine ${n.engineUrl}`),await function(e,t,n,o,i,s,a,p,f){var m;const g=e.get(d.StatusReporter),v=r.format("%s/%s",n,o);if(!a)return void l.logger.error(e,`Failed to send request to ${v} due to missing key`);const w=h.TelemetryData.createAndMarkAsIssued({endpoint:o,engineName:b(e,n),uiKind:p},(0,h.telemetrizePromptLength)(t));for(const[e,t]of Object.entries(s))"prompt"!=e&&"suffix"!=e&&(w.properties[`request.option.${e}`]=null!==(m=JSON.stringify(t))&&void 0!==m?m:"undefined");w.properties.headerRequestId=i,(0,h.telemetry)(e,"request.sent",w);const x=(0,h.now)(),T=function(e){switch(e){case _.GhostText:return"copilot-ghost";case _.Panel:return"copilot-panel"}}(p);return(0,u.postRequest)(e,v,a,T,i,s,f).then((n=>{const r=y(n,void 0);w.extendWithRequestId(r);const o=(0,h.now)()-x;w.measurements.totalTimeMs=o,l.logger.info(e,`request.response: [${v}] took ${o} ms`),l.logger.debug(e,"request.response properties",w.properties),l.logger.debug(e,"request.response measurements",w.measurements),l.logger.debug(e,`prompt: ${JSON.stringify(t)}`),(0,h.telemetry)(e,"request.response",w);const i=n.headers.get("x-copilot-delay"),s=i?parseInt(i,10):0;return e.get(c.GhostTextDebounceManager).extraDebounceMs=s,n})).catch((t=>{var n,r,o,i;if((0,u.isAbortError)(t))throw t;g.setWarning();const s=w.extendedBy({error:"Network exception"});(0,h.telemetry)(e,"request.shownWarning",s),w.properties.code=String(null!==(n=t.code)&&void 0!==n?n:""),w.properties.errno=String(null!==(r=t.errno)&&void 0!==r?r:""),w.properties.message=String(null!==(o=t.message)&&void 0!==o?o:""),w.properties.type=String(null!==(i=t.type)&&void 0!==i?i:"");const a=(0,h.now)()-x;throw w.measurements.totalTimeMs=a,l.logger.debug(e,`request.response: [${v}] took ${a} ms`),l.logger.debug(e,"request.error properties",w.properties),l.logger.debug(e,"request.error measurements",w.measurements),l.logger.error(e,`Request Error: ${t.message}`),(0,h.telemetry)(e,"request.error",w),t})).finally((()=>{(0,h.logEnginePrompt)(e,t,w)}))}(e,n.prompt,n.engineUrl,t,n.ourRequestId,v,await e.get(o.CopilotTokenManager).getCopilotToken(e),n.uiKind,i))}async handleError(e,t,n,r){if(t.setWarning(),n.properties.error=`Response status was ${r.status}`,n.properties.status=String(r.status),(0,h.telemetry)(e,"request.shownWarning",n),401===r.status||403===r.status)return e.get(o.CopilotTokenManager).resetCopilotToken(e,r.status),{type:"failed",reason:`token expired or invalid: ${r.status}`};if(499===r.status)return g.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"};const i=await r.text();return 466===r.status?(t.setError(i),g.info(e,i),{type:"failed",reason:`client not supported: ${i}`}):(g.error(e,"Unhandled status from server:",r.status,i),{type:"failed",reason:`unhandled status from server: ${r.status} ${i}`})}}},598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTemperatureForSamples=t.calculateMeanAlternativeLogProb=t.calculateMeanLogProb=t.cleanupIndentChoices=t.convertToAPIChoice=t.DEFAULT_CHARACTER_MULTIPLIER=t.MAX_PROMPT_LENGTH=t.OpenAIFetcher=t.LiveOpenAIFetcher=t.getRequestId=t.CopilotUiKind=void 0;const r=n(9800),o=n(5798),i=n(5489),s=n(913);var a=n(2031);function c(e,t){if(t.logprobs.token_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--)e+=t.logprobs.token_logprobs[o],n+=1;return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}function l(e,t){if(t.logprobs.top_logprobs)try{let e=0,n=0,r=50;for(let o=0;o0;o++,r--){const r={...t.logprobs.top_logprobs[o]};delete r[t.logprobs.tokens[o]],e+=Math.max(...Object.values(r)),n+=1}return n>0?e/n:void 0}catch(t){o.logger.error(e,`Error calculating mean prob: ${t}`)}}Object.defineProperty(t,"CopilotUiKind",{enumerable:!0,get:function(){return a.CopilotUiKind}}),Object.defineProperty(t,"getRequestId",{enumerable:!0,get:function(){return a.getRequestId}}),Object.defineProperty(t,"LiveOpenAIFetcher",{enumerable:!0,get:function(){return a.LiveOpenAIFetcher}}),Object.defineProperty(t,"OpenAIFetcher",{enumerable:!0,get:function(){return a.OpenAIFetcher}}),t.MAX_PROMPT_LENGTH=1500,t.DEFAULT_CHARACTER_MULTIPLIER=3,t.convertToAPIChoice=function(e,t,n,r,o,s,a,u){return(0,i.logEngineCompletion)(e,t,n,o,r),{completionText:t,meanLogProb:c(e,n),meanAlternativeLogProb:l(e,n),choiceIndex:r,requestId:o,modelInfo:u,blockFinished:s,tokens:n.logprobs.tokens,numTokens:n.logprobs.tokens.length,telemetryData:a}},t.cleanupIndentChoices=async function*(e,t){for await(const n of e){const e={...n},r=e.completionText.split("\n");for(let e=0;e=0&&n<=1?n:t<=1?0:t<10?.2:t<20?.4:.8}},4586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareSolutionForReturn=t.processSSE=t.splitChunk=void 0;const r=n(5798),o=n(598),i=new r.Logger(r.LogLevel.INFO,"streamChoices");function s(e){const t=e.split("\n"),n=t.pop();return[t.filter((e=>""!=e)),n]}t.splitChunk=s,t.processSSE=async function*(e,t,n,r){var a,c,l,u,d,p,h,f;const m=await t.body();m.setEncoding("utf8");let g=(0,o.getRequestId)(t);i.debug(e,`requestId: ${g.headerRequestId}`);const _={};let y="";for await(const v of m){if(null==r?void 0:r.isCancellationRequested)return i.info(e,"Cancelled after awaiting body chunk"),void m.destroy();i.debug(e,"chunk",v.toString());const[b,w]=s(y+v.toString());y=w;for(const s of b){const y=s.slice("data:".length).trim();if("[DONE]"==y){for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"DONE",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding on DONE"),void m.destroy()}return}let v;try{v=JSON.parse(y)}catch(t){i.error(e,"Error parsing JSON stream data",s);continue}if(void 0!==v.choices||void 0===v.error){0==g.created&&(g=(0,o.getRequestId)(t,v),0==g.created&&i.error(e,`Request id invalid, should have "completionId" and "created": ${g}`,g));for(let t=0;t-1)&&(y=await n(s.text.join("")),null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after awaiting finishedCb"),void m.destroy();if(o.finish_reason||void 0!==y){if(yield{solution:s,finishOffset:y,reason:JSON.stringify(o.finish_reason),requestId:g,index:o.index},null==r?void 0:r.isCancellationRequested)return i.debug(e,"Cancelled after yielding finished choice"),void m.destroy();_[o.index]=null}}}else i.error(e,"Error in response:",v.error.message)}}for(const[t,n]of Object.entries(_)){const o=Number(t);if(null!=n&&(yield{solution:n,finishOffset:void 0,reason:"Iteration Done",requestId:g,index:o},null==r?void 0:r.isCancellationRequested))return i.debug(e,"Cancelled after yielding after iteration done"),void m.destroy()}if(y.length>0)try{const t=JSON.parse(y);void 0!==t.error&&i.error(e,`Error in response: ${t.error.message}`,t.error)}catch(t){i.error(e,`Error parsing extraData: ${y}`)}},t.prepareSolutionForReturn=function(e,t,n){let r=t.solution.text.join(""),s=!1;void 0!==t.finishOffset&&(i.debug(e,`solution ${t.index}: early finish at offset ${t.finishOffset}`),r=r.substring(0,t.finishOffset),s=!0),i.info(e,`solution ${t.index} returned. finish reason: [${t.reason}] finishOffset: [${t.finishOffset}] completionId: [{${t.requestId.completionId}}] created: [{${t.requestId.created}}]`);const a={text:(c=t.solution).text.join(""),logprobs:{token_logprobs:c.logprobs.reduce(((e,t)=>e.concat(t)),[]),top_logprobs:c.top_logprobs.reduce(((e,t)=>e.concat(t)),[]),text_offset:c.text_offset.reduce(((e,t)=>e.concat(t)),[]),tokens:c.tokens.reduce(((e,t)=>e.concat(t)),[])}};var c;return(0,o.convertToAPIChoice)(e,r,a,t.index,t.requestId,s,n)}},3402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postInsertionTasks=t.postRejectionTasks=t.captureCode=void 0;const r=n(5135),o=n(1749),i=n(5798),s=n(7917),a=n(4090),c=n(9558),l=n(5489),u=n(819),d=new i.Logger(i.LogLevel.INFO,"post-insertion"),p=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}];async function h(e,t,n){const r=await e.get(u.TextDocumentManager).getTextDocument(t);if(!r)return d.info(e,`Could not get document for ${t.fsPath}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1,promptElementRanges:[]},capturedCode:"",terminationOffset:0};const o=r.getText(),i=o.substring(0,n),c=r.positionAt(n),l=await(0,a.extractPrompt)(e,r,c),p="prompt"===l.type?l.prompt:{prefix:i,suffix:"",isFimEnabled:!1,promptElementRanges:[]},h=o.substring(n),f=(0,s.contextIndentationFromText)(i,n,r.languageId),m=(0,s.indentationBlockFinished)(f,void 0),g=await m(h),_=Math.min(o.length,n+(g?2*g:500));return{prompt:p,capturedCode:o.substring(n,_),terminationOffset:null!=g?g:-1}}function f(e,t,n,r){const o=e.substring(Math.max(0,r-n),Math.min(e.length,r+t.length+n)),i=(0,c.lexEditDistance)(o,t),s=i.lexDistance/i.needleLexLength,{distance:a}=(0,c.editDistance)(o.substring(i.startOffset,i.endOffset),t);return{relativeLexEditDistance:s,charEditDistance:a,completionLexLength:i.needleLexLength,foundOffset:i.startOffset+Math.max(0,r-n),lexEditDistance:i.lexDistance,stillInCodeHeuristic:s<=.5?1:0}}t.captureCode=h,t.postRejectionTasks=function(e,t,n,i,s){s.forEach((({completionText:n,completionTelemetryData:r})=>{d.debug(e,`${t}.rejected choiceIndex: ${r.properties.choiceIndex}`),(0,o.telemetryRejected)(e,t,r)}));const a=new r.ChangeTracker(e,i,n);p.filter((e=>e.captureRejection)).map((r=>{a.push((async()=>{d.debug(e,`Original offset: ${n}, Tracked offset: ${a.offset}`);const{completionTelemetryData:o}=s[0],{prompt:c,capturedCode:u,terminationOffset:p}=await h(e,i,a.offset);let f;f=c.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(c.prefix),hypotheticalPromptSuffixJson:JSON.stringify(c.suffix)}:{hypotheticalPromptJson:JSON.stringify(c.prefix)};const m=o.extendedBy({...f,capturedCodeJson:JSON.stringify(u)},{timeout:r.seconds,insertionOffset:n,trackedOffset:a.offset,terminationOffsetInCapturedCode:p});d.debug(e,`${t}.capturedAfterRejected choiceIndex: ${o.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterRejected",m,!0)}),1e3*r.seconds)}))},t.postInsertionTasks=async function(e,t,n,i,s,a){d.debug(e,`${t}.accepted choiceIndex: ${a.properties.choiceIndex}`),(0,o.telemetryAccepted)(e,t,a);const c=new r.ChangeTracker(e,s,i),m=n.trim();p.map((n=>c.push((()=>async function(e,t,n,r,o,i,s,a){const c=await e.get(u.TextDocumentManager).getTextDocument(o);if(c){const u=c.getText();let p=f(u,n,50,a.offset);p.stillInCodeHeuristic||(p=f(u,n,1500,a.offset)),d.debug(e,`stillInCode: ${p.stillInCodeHeuristic?"Found":"Not found"}! Completion '${n}' in file ${o.fsPath}. lexEditDistance fraction was ${p.relativeLexEditDistance}. Char edit distance was ${p.charEditDistance}. Inserted at ${r}, tracked at ${a.offset}, found at ${p.foundOffset}. choiceIndex: ${s.properties.choiceIndex}`);const m=s.extendedBy({},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset}).extendedBy({},p);if((0,l.telemetry)(e,t+".stillInCode",m),i.captureCode){const{prompt:n,capturedCode:c,terminationOffset:u}=await h(e,o,a.offset);let p;p=n.isFimEnabled?{hypotheticalPromptPrefixJson:JSON.stringify(n.prefix),hypotheticalPromptSuffixJson:JSON.stringify(n.suffix)}:{hypotheticalPromptJson:JSON.stringify(n.prefix)};const f=s.extendedBy({...p,capturedCodeJson:JSON.stringify(c)},{timeout:i.seconds,insertionOffset:r,trackedOffset:a.offset,terminationOffsetInCapturedCode:u});d.debug(e,`${t}.capturedAfterAccepted choiceIndex: ${s.properties.choiceIndex}`,m),(0,l.telemetry)(e,t+".capturedAfterAccepted",f,!0)}}}(e,t,m,i,s,n,a,c)),1e3*n.seconds)))}},6635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpStatusReporter=t.StatusReporter=void 0;class n{}t.StatusReporter=n,t.NoOpStatusReporter=class extends n{setProgress(){}removeProgress(){}setWarning(){}setError(e){}forceNormal(){}}},7917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.indentationBlockFinished=t.completionCutOrContinue=t.contextIndentationFromText=t.contextIndentation=t.getNodeStart=t.isBlockBodyFinishedWithPrefix=t.isBlockBodyFinished=t.isEmptyBlockStart=void 0;const r=n(2369),o=n(2273);t.isEmptyBlockStart=function(e,t){return o.isEmptyBlockStart(e.languageId,e.getText(),e.offsetAt(t))},t.isBlockBodyFinished=function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n)),c=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,a,i,c)},t.isBlockBodyFinishedWithPrefix=function(e,t,n,i,s){const a=e.get(r.LocationFactory),c=t.getText(a.range(a.position(0,0),n)),l=t.offsetAt(n);return o.isBlockBodyFinished(t.languageId,c+s,i,l+s.length)},t.getNodeStart=async function(e,t,n,i){const s=e.get(r.LocationFactory),a=t.getText(s.range(s.position(0,0),n))+i,c=await o.getNodeStart(t.languageId,a,t.offsetAt(n));if(c)return t.positionAt(c)};const i=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map((e=>e+"\\b"))),s=new RegExp(`^(${i.join("|")})`);function a(e){return s.test(e.trimLeft().toLowerCase())}function c(e){const t=/^(\s*)([^]*)$/.exec(e);return t&&t[2]&&t[2].length>0?t[1].length:void 0}function l(e,t,n){const r=e.slice(0,t).split("\n"),o=e.slice(t).split("\n");function i(e,t,r){let o,i,s=t;for(;void 0===o&&s>=0&&s=0&&!e[s].trim().startsWith('"""');)s--;if(s>=0)for(o=void 0,s--;void 0===o&&s>=0;)o=c(e[s]),i=s,s--}}return[o,i]}const[s,a]=i(r,r.length-1,-1),l=(()=>{if(void 0!==s&&void 0!==a)for(let e=a-1;e>=0;e--){const t=c(r[e]);if(void 0!==t&&t{const r=u(n,e,t);return"continue"===r?void 0:r}}},4090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractPrompt=t.trimLastLine=t._contextTooShort=t.MIN_PROMPT_CHARS=void 0;const r=n(4617),o=n(9800),i=n(5225),s=n(6905),a=n(819),c=n(2273),l=n(3591);function u(e){const t=e.split("\n"),n=t[t.length-1],r=n.length-n.trimRight().length,o=e.slice(0,e.length-r),i=e.substr(o.length);return[n.length==r?o:e,i]}async function d(e,n,d,p,h,f){var m;const g=null!==(m=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,h.toString())))&&void 0!==m?m:"",_=await(0,o.suffixPercent)(e,g,f);if((_>0?n.length:d)20||s+i.getText().length>2e5)break;"file"==i.uri.scheme&&i.fileName!==t&&i.languageId===n&&(r.push({uri:i.uri.toString(),relativePath:await e.get(a.TextDocumentManager).getRelativePath(i),languageId:i.languageId,source:i.getText()}),s+=i.getText().length)}return r}(e,d.fsPath,p);const m={uri:d.toString(),source:t,offset:n,relativePath:u,languageId:p},g=null!==(h=(0,l.tryGetGitHubNWO)((0,l.extractRepoInfoInBackground)(e,d.toString())))&&void 0!==h?h:"";let _={maxPromptLength:2048-(0,o.getConfig)(e,o.ConfigKey.SolutionLength),neighboringTabs:await e.get(s.Features).neighboringTabsOption(g,p),suffixStartMode:await e.get(s.Features).suffixStartMode(g,p)};const y=await(0,o.suffixPercent)(e,g,p),v=await(0,o.suffixMatchThreshold)(e,g,p);y>0&&(_={..._,includeSiblingFunctions:r.SiblingOption.NoSiblings,suffixPercent:y,suffixMatchThreshold:v});const b=e.get(r.FileSystem);return await(0,c.getPrompt)(b,m,_,f)}(e,n,d,p,h,f),[E,C]=u(v),S=Date.now();return{type:"prompt",prompt:{prefix:E,suffix:b,isFimEnabled:_>0,promptElementRanges:T.ranges},trailingWs:C,promptChoices:w,computeTimeMs:S-y,promptBackground:x}}async function p(e,t,n){const r=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,t.getText(),t.offsetAt(n),r,t.uri,t.languageId)}t.MIN_PROMPT_CHARS=10,t._contextTooShort={type:"contextTooShort"},t.trimLastLine=u,t.extractPrompt=function(e,t,n){const r=e.get(a.TextDocumentManager).findNotebook(t);return void 0===r?p(e,t,n):async function(e,t,n,r){const o=n.getCells().find((e=>e.document.uri===t.uri));if(o){const i=n.getCells().filter((e=>e.index0?i.map((e=>e.document.getText())).join("\n\n")+"\n\n":"",c=s+t.getText(),l=s.length+t.offsetAt(r),u=await e.get(a.TextDocumentManager).getRelativePath(t);return d(e,c,l,u,t.uri,o.document.languageId)}return p(e,t,r)}(e,t,r,n)}},2273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsesWithoutError=t.getPrompt=t.getNodeStart=t.getFunctionPositions=t.getBlockCloseToken=t.isSupportedLanguageId=t.isBlockBodyFinished=t.isEmptyBlockStart=t.terminate=t.init=void 0;const r=n(4617);let o=null;const i=new Map;let s=0;t.init=function(t,u,d){if(!u){const t=n(3094);for(const n of[...a,...c])e.exports[n]=t[n];return}for(const n of a)e.exports[n]=l(t,d,n);e.exports.getPrompt=function(e,t){return function(n,...r){const a=s++;return new Promise(((n,s)=>{i.set(a,{resolve:n,reject:s}),t.debug(e,`Proxy getPrompt - ${a}`),null==o||o.postMessage({id:a,fn:"getPrompt",args:r})}))}}(t,d),o=r.createWorker(),i.clear(),s=0;const p=t.get(r.FileSystem);function h(e){d.error(t,e);for(const t of i.values())t.reject(e);i.clear()}o.on("message",(({id:e,err:n,res:r})=>{const o=i.get(e);d.debug(t,`Response ${e} - ${r}, ${n}`),o&&(i.delete(e),n?o.reject(n):o.resolve(r))})),o.on("error",h),o.on("exit",(e=>{0!==e&&h(new Error(`Worker thread exited with code ${e}.`))})),o.on("readFileReq",(e=>{d.debug(t,`READ_FILE_REQ - ${e}`),p.readFile(e).then((e=>{null==o||o.emit("readFileRes",e)})).catch(h)})),o.on("mtimeRes",(e=>{d.debug(t,`mTime_REQ - ${e}`),p.mtime(e).then((e=>{null==o||o.emit("mtimeRes",e)})).catch(h)}))},t.terminate=function(){o&&(o.removeAllListeners(),o.terminate(),o=null,i.clear())};const a=["getFunctionPositions","isEmptyBlockStart","isBlockBodyFinished","getNodeStart","parsesWithoutError"],c=["isSupportedLanguageId","getBlockCloseToken"];function l(e,t,n){return function(...r){const a=s++;return new Promise(((s,c)=>{i.set(a,{resolve:s,reject:c}),t.debug(e,`Proxy ${n}`),null==o||o.postMessage({id:a,fn:n,args:r})}))}}t.isEmptyBlockStart=r.isEmptyBlockStart,t.isBlockBodyFinished=r.isBlockBodyFinished,t.isSupportedLanguageId=r.isSupportedLanguageId,t.getBlockCloseToken=r.getBlockCloseToken,t.getFunctionPositions=r.getFunctionPositions,t.getNodeStart=r.getNodeStart,t.getPrompt=r.getPrompt,t.parsesWithoutError=r.parsesWithoutError},3591:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputationStatus=t.getRepoUrlFromConfigText=t.parseRepoUrl=t.extractRepoInfoInBackground=t.tryGetGitHubNWO=t.getDogFood=t.Dogfood=t.getUserKind=t.UserKind=void 0;const r=n(4617),o=n(6314),i=n(1017),s=n(140),a=n(5489);var c,l;function u(e){if(void 0!==e&&e!==f.PENDING)return"github.com"===e.hostname?e.owner+"/"+e.repo:void 0}!function(e){e.GITHUB="github",e.MICROSOFT="microsoft",e.UNKNOWN="unknown"}(c=t.UserKind||(t.UserKind={})),t.getUserKind=function(e){var t,n;return void 0===e.get(a.TelemetryReporters).token?c.UNKNOWN:(null===(n=null===(t=e.get(a.TelemetryReporters).token)||void 0===t?void 0:t.organization_list)||void 0===n?void 0:n.includes("a5db0bcaae94032fe715fb34a5e4bce2"))?c.MICROSOFT:c.UNKNOWN},function(e){e.GITHUB="github",e.MICROSOFT="microsoft",e.UNKNOWN=""}(l=t.Dogfood||(t.Dogfood={})),t.getDogFood=function(e){return void 0===e||e===f.PENDING?l.UNKNOWN:"github/github"===u(e)?l.GITHUB:"ssh.dev.azure.com"===e.hostname||"vs-ssh.visualstudio.com"===e.hostname||"dev.azure.com"===e.hostname||"domoreexp.visualstudio.com"===e.hostname||"office.visualstudio.com"===e.hostname?l.MICROSOFT:l.UNKNOWN},t.tryGetGitHubNWO=u,t.extractRepoInfoInBackground=function(e,t){if(!t)return;const n=(0,i.dirname)(t);return d(e,n)};const d=function(e,t){const n=new s.LRUCache(1e4),o=new Set;return(e,...t)=>{const s=JSON.stringify(t),a=n.get(s);if(a)return a.result;if(o.has(s))return f.PENDING;const c=async function(e,t){var n;const o=await async function(e,t){let n=t+"_add_to_make_longer";const o=e.get(r.FileSystem);for(;t.length>1&&t.length!0),(()=>!1)))return t;n=t,t=(0,i.dirname)(t)}}(e,t);if(!o)return;const s=e.get(r.FileSystem),a=(0,i.join)(o,".git","config"),c=(await s.readFile(a)).toString(),l=null!==(n=h(c))&&void 0!==n?n:"",u=p(l);return void 0===u?{baseFolder:o,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:o,url:l,...u}}(e,...t);return o.add(s),c.then((e=>{n.put(s,new m(e)),o.delete(s)})),f.PENDING}}();function p(e){let t={};try{if(t=o(e),""==t.host||""==t.owner||""==t.name||""==t.pathname)return}catch(e){return}return{hostname:t.host,owner:t.owner,repo:t.name,pathname:t.pathname}}function h(e){var t;const n=/^\s*\[\s*remote\s+"((\\\\|\\"|[^\\"])+)"/,r=/^\s*\[remote.([^"\s]+)/,o=/^\s*url\s*=\s*([^\s#;]+)/,i=/^\s*\[/;let s,a,c=!1;for(const l of e.split("\n"))if(c&&void 0!==s){if(s+=l,l.endsWith("\\"))s=s.substring(0,s.length-1);else if(c=!1,"origin"===a)return s}else{const e=null!==(t=l.match(n))&&void 0!==t?t:l.match(r);if(e)a=e[1];else if(l.match(i))a=void 0;else{if(s&&"origin"!==a)continue;{const e=l.match(o);if(e)if(s=e[1],s.endsWith("\\"))s=s.substring(0,s.length-1),c=!0;else if("origin"===a)return s}}}return s}var f;t.parseRepoUrl=p,t.getRepoUrlFromConfigText=h,function(e){e[e.PENDING=0]="PENDING"}(f=t.ComputationStatus||(t.ComputationStatus={}));class m{constructor(e){this.result=e}}},4604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRepetitive=void 0;const n=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function r(e){const t=function(e){const t=Array(e.length).fill(0);t[0]=-1;let n=-1;for(let r=1;r=0&&e[n+1]!==e[r];)n=t[n];e[n+1]===e[r]&&n++,t[r]=n}return t}(e);for(const r of n)if(!(e.lengthe.trim().length>0)))}},9558:(e,t)=>{"use strict";function n(e,t,n=((e,t)=>e===t?0:1)){if(0===t.length||0===e.length)return{distance:t.length,startOffset:0,endOffset:0};let r=new Array(t.length+1).fill(0),o=new Array(t.length+1).fill(0),i=new Array(e.length+1).fill(0),s=new Array(e.length+1).fill(0),a=t[0];for(let t=0;t0?t-1:0;for(let c=1;c0&&(yield n),n=o,r=e)}n.length>0&&(yield n)}function s(e,t,n,r){const o=[];let i=0;for(const s of n(e))r(s)&&(t.has(s)||t.set(s,t.size),o.push([t.get(s),i])),i+=s.length;return[o,t]}function a(e){return" "!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.lexEditDistance=t.lexicalAnalyzer=t.lexGeneratorWords=t.reverseLexDictionary=t.emptyLexDictionary=t.editDistance=void 0,t.editDistance=n,t.emptyLexDictionary=r,t.reverseLexDictionary=o,t.lexGeneratorWords=i,t.lexicalAnalyzer=s,t.lexEditDistance=function(e,t,c=i){const[l,u]=s(e,r(),c,a),[d,p]=s(t,u,c,a);if(0===d.length||0===l.length)return{lexDistance:d.length,startOffset:0,endOffset:0,haystackLexLength:l.length,needleLexLength:d.length};const h=o(p),f=d.length,m=h[d[0][0]],g=h[d[f-1][0]],_=n(l.map((e=>e[0])),d.map((e=>e[0])),(function(e,t,n,r){if(0===r||r===f-1){const e=h[l[n][0]];return 0==r&&e.endsWith(m)||r==f-1&&e.startsWith(g)?0:1}return e===t?0:1})),y=l[_.startOffset][1];let v=_.endOffset0&&" "===e[v-1]&&--v,{lexDistance:_.distance,startOffset:y,endOffset:v,haystackLexLength:l.length,needleLexLength:d.length}}},1523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextDisplayQuantiles=t.ghostTextDisplayLanguageParameters=t.ghostTextDisplayMeanAlternativeLogProbParameter=t.ghostTextDisplayMeanLogProbParameter=t.ghostTextDisplayLog1pcompCharLenParameter=t.ghostTextDisplayInterceptParameter=void 0,t.ghostTextDisplayInterceptParameter=2.98410452738298,t.ghostTextDisplayLog1pcompCharLenParameter=-.838732736843507,t.ghostTextDisplayMeanLogProbParameter=1.50314646255716,t.ghostTextDisplayMeanAlternativeLogProbParameter=-.237798634012662,t.ghostTextDisplayLanguageParameters={python:.314368072478742},t.ghostTextDisplayQuantiles={.01:.225800751784931,.02:.290204307767402,.03:.333153496466045,.05:.404516749849559,.1:.513216040545626,.2:.626904979128674,.3:.694880719658273,.4:.743100684947291,.5:.782524520571946,.6:.816856186092243,.7:.84922977716585,.8:.883694877241999,.9:.921859050950077,.95:.944571268106974,.99:.969535563141733}},1153:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ghostTextScoreQuantile=t.ghostTextScoreConfidence=void 0;const r=n(5798),o=n(1523),i=(new r.Logger(r.LogLevel.INFO,"restraint"),{link:e=>Math.exp(e)/(1+Math.exp(e)),unlink:e=>Math.log(e/(1-e))});class s{constructor(e,t,n){this.name=e,this.coefficient=t,this.transformation=n||(e=>e)}contribution(e){return this.coefficient*this.transformation(e)}}const a=new class{constructor(e,t,n){if(this.link=i,this.intercept=e,this.coefficients=t,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(const e in n)this.logitsToQuantiles.set(n[e],Number(e))}predict(e,t){let n=this.intercept;for(const e of this.coefficients){const r=t[e.name];if(void 0===r)return NaN;n+=e.contribution(r)}return this.link.link(n)}quantile(e,t){return function(e,t){const n=Math.min(...Array.from(t.keys()).filter((t=>t>=e))),r=Math.max(...Array.from(t.keys()).filter((t=>tMath.log(1+e))),new s("meanLogProb",o.ghostTextDisplayMeanLogProbParameter),new s("meanAlternativeLogProb",o.ghostTextDisplayMeanAlternativeLogProbParameter)].concat(Object.entries(o.ghostTextDisplayLanguageParameters).map((e=>new s(e[0],e[1])))),o.ghostTextDisplayQuantiles);t.ghostTextScoreConfidence=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.predict(e,n)},t.ghostTextScoreQuantile=function(e,t){const n={...t.measurements};return Object.keys(o.ghostTextDisplayLanguageParameters).forEach((e=>{n[e]=t.properties["customDimensions.languageId"]==e?1:0})),a.quantile(e,n)}},3883:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkSuffix=t.postProcessChoice=void 0;const r=n(2273),o=n(5489),i=n(913),s=n(4604);t.postProcessChoice=async function(e,t,n,a,c,l,u){if((0,s.isRepetitive)(c.tokens)){const t=o.TelemetryData.createAndMarkAsIssued();return t.extendWithRequestId(c.requestId),(0,o.telemetry)(e,"repetition.detected",t,!0),void u.info(e,"Filtered out repetitive solution")}const d={...c};if(function(e,t,n){let r="",o=t.line+1;for(;""===r&&o1);return o}(e,n,a,d.completionText,l),d.completionText?d:void 0},t.checkSuffix=function(e,t,n){const r=e.lineAt(t.line).text.substring(t.character);if(r.length>0){if(-1!==n.completionText.indexOf(r))return!0;{let e=0;for(const t of r){const r=n.completionText.indexOf(t,e+1);if(!(r>e)){e=-1;break}e=r}return-1!==e}}return!1}},5489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forceSendingTelemetry=t.dropTelemetryConfig=t.setTelemetryConfig=t.logEnginePrompt=t.logEngineCompletion=t.telemetryError=t.telemetryException=t.telemetryRaw=t.telemetryExpProblem=t.telemetry=t.configureReporter=t.telemetryEndpointUrlOverride=t.noTelemetryEndpointUrlOverride=t.TelemetryEndpointUrlOverride=t.now=t.telemetrizePromptLength=t.TelemetryData=t.setupEmptyReporters=t.setupStandardReporters=t.TelemetryReporters=t.APP_INSIGHTS_KEY_SECURE=t.APP_INSIGHTS_KEY=void 0;const r=n(6236),o=n(9929),i=n(9800),s=n(6905),a=n(4914),c=n(913),l=n(9591);t.APP_INSIGHTS_KEY="7d7048df-6dd0-4048-bb23-b716c1461f8f",t.APP_INSIGHTS_KEY_SECURE="3fdd7f28-937a-48c8-9a21-ba337db23bd1";class u{constructor(e,t){this.reporter=e,this.reporterSecure=t}getReporter(e){return this.reporter}getSecureReporter(e){if(y())return this.reporterSecure;if((0,c.shouldFailForDebugPurposes)(e))throw new Error("Internal error: telemetry opt-out")}setReporter(e){this.reporter=e}setSecureReporter(e){this.reporterSecure=e}async deactivate(){let e=Promise.resolve();this.reporter&&(e=this.reporter.dispose(),this.reporter=void 0);let t=Promise.resolve();this.reporterSecure&&(t=this.reporterSecure.dispose(),this.reporterSecure=void 0),await Promise.all([e,t])}hackOptOutListener(){this.reporter.optOutListener={dispose(){}},this.reporterSecure.optOutListener={dispose(){}}}setToken(e){this.reporter&&this.configureToken(this.reporter,e),this.reporterSecure&&this.configureToken(this.reporterSecure,e)}configureToken(e,t){const n=e;n&&n.appInsightsClient&&(n.appInsightsClient.context.tags.github_telemetry_token=t.token)}}let d;function p(e,t,n,r){const i=new o.default(t,n,r);return _(e,i),i}t.TelemetryReporters=u,t.setupStandardReporters=function(e,n){const r=(0,i.getVersion)(e),o=p(e,n,r,t.APP_INSIGHTS_KEY),s=p(e,n,r,t.APP_INSIGHTS_KEY_SECURE),a=e.get(u);return a.setReporter(o),a.setSecureReporter(s),a},t.setupEmptyReporters=function(){return new u};class h{constructor(e,t,n){this.properties=e,this.measurements=t,this.issuedTime=n}static createAndMarkAsIssued(e,t){return new h(e||{},t||{},m())}extendedBy(e,t){const n={...this.properties,...e},r={...this.measurements,...t},o=new h(n,r,this.issuedTime);return o.displayedTime=this.displayedTime,o.filtersAndExp=this.filtersAndExp,o}markAsDisplayed(){void 0===this.displayedTime&&(this.displayedTime=m())}async extendWithExpTelemetry(e){this.filtersAndExp||await e.get(s.Features).addExpAndFilterToTelemetry(this),this.filtersAndExp.exp.addToTelemetry(this),this.filtersAndExp.filters.addToTelemetry(this)}extendWithEditorAgnosticFields(e){this.properties.editor_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorInfo(e)),this.properties.editor_plugin_version=(0,i.formatNameAndVersion)(e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e));const t=e.get(i.VscInfo);this.properties.client_machineid=t.machineId,this.properties.client_sessionid=t.sessionId,this.properties.copilot_version=`copilot/${(0,i.getVersion)(e)}`,this.properties.common_extname=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).name,this.properties.common_extversion=e.get(i.EditorAndPluginInfo).getEditorPluginInfo(e).version}extendWithConfigProperties(e){const t=(0,i.dumpConfig)(e);try{t["copilot.build"]=(0,i.getBuild)(e),t["copilot.buildType"]=(0,i.getBuildType)(e)}catch(e){}d&&(t["copilot.trackingId"]=d.trackingId),this.properties={...this.properties,...t}}extendWithRequestId(e){const t={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...t}}static maybeRemoveRepoInfoFromPropertiesHack(e,t){if(e)return t;const n={};for(const e in t)h.keysToRemoveFromStandardTelemetryHack.includes(e)||(n[e]=t[e]);return n}sanitizeKeys(){this.properties=h.sanitizeKeys(this.properties),this.measurements=h.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};const t={};for(const n in e)t[h.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_")]=e[n];return t}updateTimeSinceIssuedAndDisplayed(){const e=m()-this.issuedTime;if(this.measurements.timeSinceIssuedMs=e,void 0!==this.displayedTime){const e=m()-this.displayedTime;this.measurements.timeSinceDisplayedMs=e}}validateData(e,t){var n;let r;if(h.validateTelemetryProperties(this.properties)||(r={problem:"properties",error:JSON.stringify(h.validateTelemetryProperties.errors)}),!h.validateTelemetryMeasurements(this.measurements)){const e=JSON.stringify(h.validateTelemetryMeasurements.errors);void 0===r?r={problem:"measurements",error:e}:(r.problem="both",r.error+=`; ${e}`)}if(void 0===r)return!0;if((0,c.shouldFailForDebugPurposes)(e))throw new Error(`Invalid telemetry data: ${r.problem} ${r.error} properties=${JSON.stringify(this.properties)} measurements=${JSON.stringify(this.measurements)}`);return b(e,"invalidTelemetryData",h.createAndMarkAsIssued({properties:JSON.stringify(this.properties),measurements:JSON.stringify(this.measurements),problem:r.problem,validationError:r.error}),t),t&&b(e,"invalidTelemetryData_in_secure",h.createAndMarkAsIssued({problem:r.problem,requestId:null!==(n=this.properties.requestId)&&void 0!==n?n:"unknown"}),!1),!1}async makeReadyForSending(e,t,n){this.extendWithConfigProperties(e),this.extendWithEditorAgnosticFields(e),this.sanitizeKeys(),"IncludeExp"===n&&await this.extendWithExpTelemetry(e),this.updateTimeSinceIssuedAndDisplayed(),this.validateData(e,t)||(this.properties.telemetry_failed_validation="true")}}function f(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}function m(){return(new Date).getTime()}t.TelemetryData=h,h.ajv=new r.default({strictNumbers:!1}),h.validateTelemetryProperties=h.ajv.compile({type:"object",additionalProperties:{type:"string"},required:[]}),h.validateTelemetryMeasurements=h.ajv.compile({type:"object",properties:{meanLogProb:{type:"number",nullable:!0},meanAlternativeLogProb:{type:"number",nullable:!0}},additionalProperties:{type:"number"},required:[]}),h.keysExemptedFromSanitization=[a.ExpServiceTelemetryNames.assignmentContextTelemetryPropertyName,a.ExpServiceTelemetryNames.featuresTelemetryPropertyName],h.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo"],t.telemetrizePromptLength=function(e){return e.isFimEnabled?{promptPrefixCharLen:e.prefix.length,promptSuffixCharLen:e.suffix.length}:{promptCharLen:e.prefix.length}},t.now=m;class g{constructor(e){this.url=e}getUrl(){return this.url}}function _(e,t){const n=t;if(n.appInsightsClient){const t=n.appInsightsClient.commonProperties,r=h.sanitizeKeys(t);n.appInsightsClient.commonProperties=r,n.appInsightsClient.context.tags[n.appInsightsClient.context.keys.cloudRoleInstance]="REDACTED";const o=e.get(g).getUrl();void 0!==o&&(n.appInsightsClient.config.endpointUrl=o)}}function y(){var e;return null!==(e=null==d?void 0:d.optedIn)&&void 0!==e&&e}async function v(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),f(e,null!=r&&r,t,o)}async function b(e,t,n,r){if(r&&!y())return;const o=n||h.createAndMarkAsIssued({},{});await o.makeReadyForSending(e,null!=r&&r,"IncludeExp"),function(e,t,n,r){const o=t?e.get(u).getSecureReporter(e):e.get(u).getReporter(e);o&&o.sendTelemetryErrorEvent(n,h.maybeRemoveRepoInfoFromPropertiesHack(t,r.properties),r.measurements)}(e,null!=r&&r,t,o)}t.TelemetryEndpointUrlOverride=g,t.noTelemetryEndpointUrlOverride=new g,t.telemetryEndpointUrlOverride=new g("https://copilot-telemetry.githubusercontent.com/telemetry"),t.configureReporter=_,t.telemetry=v,t.telemetryExpProblem=async function(e,t){const n=h.createAndMarkAsIssued(t,{});await n.makeReadyForSending(e,!1,"SkipExp"),f(e,!1,"expProblem",n)},t.telemetryRaw=async function(e,t,n,r){f(e,!1,t,{properties:n,measurements:r})},t.telemetryException=async function(e,t,n,r){const o=t instanceof Error?t:new Error("Non-error thrown: "+t),i=y(),s=h.createAndMarkAsIssued({origin:(0,l.redactPaths)(n),reason:i?"Exception logged to restricted telemetry":"Exception, not logged due to opt-out",...r});if(await s.makeReadyForSending(e,!1,"IncludeExp"),f(e,!1,"exception",s),!i)return;const a=h.createAndMarkAsIssued({origin:n,...r});await a.makeReadyForSending(e,!0,"IncludeExp"),function(e,t,n,r){const o=e.get(u).getSecureReporter(e);o&&o.sendTelemetryException(n,h.maybeRemoveRepoInfoFromPropertiesHack(true,r.properties),r.measurements)}(e,0,o,a)},t.telemetryError=b,t.logEngineCompletion=async function(e,t,n,r,o){var i;const s=h.createAndMarkAsIssued({completionTextJson:JSON.stringify(t),choiceIndex:o.toString()});for(const[e,t]of Object.entries(n.logprobs))s.properties["logprobs_"+e]=null!==(i=JSON.stringify(t))&&void 0!==i?i:"unset";s.extendWithRequestId(r),await v(e,"engine.completion",s,!0)},t.logEnginePrompt=async function(e,t,n){let r;r=t.isFimEnabled?{promptPrefixJson:JSON.stringify(t.prefix),promptSuffixJson:JSON.stringify(t.suffix),promptElementRanges:JSON.stringify(t.promptElementRanges)}:{promptJson:JSON.stringify(t.prefix),promptElementRanges:JSON.stringify(t.promptElementRanges)};const o=n.extendedBy(r);await v(e,"engine.prompt",o,!0)},t.setTelemetryConfig=function(e){d=e},t.dropTelemetryConfig=function(){d=void 0},t.forceSendingTelemetry=function(e,n){const r=n.getReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY),_(e,r)}try{const r=n.getSecureReporter(e);if(r){const n=r;n.userOptIn=!0,n.createAppInsightsClient(t.APP_INSIGHTS_KEY_SECURE),_(e,r)}}catch(e){}}},4630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LibTestsEditorInfo=t.createLibTestingContext=t.setupTestingContext=t.setupTestingContextNoTelemetry=t.setupTestingContextNoTelemetryNoLog=t.setupTestingContextNoTelemetryNoLogNoNotifications=void 0;const r=n(4617),o=n(7147),i=n(2137),s=n(9800),a=n(5611),c=n(6905),l=n(6046),u=n(6817),d=n(4619),p=n(5798),h=n(39),f=n(9035),m=n(5489),g=n(2369),_=n(819),y=n(4567),v=n(913),b=n(6584),w=n(751);function x(e){e.set(s.BuildInfo,new s.BuildInfo),e.set(v.RuntimeMode,v.RuntimeMode.fromEnvironment(!0)),e.set(h.Fetcher,new h.HelixFetcher(e)),e.set(p.LogVerbose,new p.LogVerbose(!1)),e.set(i.Clock,new i.Clock),e.set(l.ExpConfigMaker,new l.ExpConfigNone),e.set(d.GhostTextDebounceManager,new d.GhostTextDebounceManager),e.set(u.ContextualFilterManager,new u.ContextualFilterManager)}function T(e){x(e),e.set(f.NotificationSender,new b.TestNotificationSender),e.set(y.UrlOpener,new b.TestUrlOpener)}function E(e){T(e),e.set(p.LogTarget,new p.ConsoleLog(console))}function C(e){E(e),e.set(m.TelemetryEndpointUrlOverride,m.noTelemetryEndpointUrlOverride),e.set(m.TelemetryReporters,(0,m.setupEmptyReporters)()),(0,m.setupStandardReporters)(e,"copilot-test"),e.set(c.Features,new c.Features(e))}t.setupTestingContextNoTelemetryNoLogNoNotifications=x,t.setupTestingContextNoTelemetryNoLog=T,t.setupTestingContextNoTelemetry=E,t.setupTestingContext=C,t.createLibTestingContext=function(){const e=new a.Context;return e.set(s.ConfigProvider,new s.DefaultsOnlyConfigProvider),C(e),e.set(s.EditorAndPluginInfo,new S),e.set(r.FileSystem,k),e.set(_.TextDocumentManager,new w.TestTextDocumentManager),e.set(g.LocationFactory,new w.TestLocationFactory),e};class S extends s.EditorAndPluginInfo{getEditorInfo(e){return{name:"lib-tests-editor",version:"1"}}getEditorPluginInfo(e){return{name:"lib-tests-plugin",version:"2"}}}t.LibTestsEditorInfo=S;const k={readFile:function(e){return o.promises.readFile(e)},mtime:async function(e){return(await o.promises.stat(e)).mtimeMs},stat:async function(e){const t=await o.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},5922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readTestingGitHubToken=t.makeTestingCopilotTokenManager=void 0;const r=n(7147),o=n(5765);function i(){const e=`${process.env.HOME}/.copilot-testing-gh-token`;if(r.existsSync(e))return r.readFileSync(e).toString();throw new Error(`Tests: either GH_COPILOT_TOKEN, or GITHUB_TOKEN, must be set, or there must be a GitHub token from an app with access to Copilot in ${e}. Run "npm run get_token" to get one.`)}t.makeTestingCopilotTokenManager=function(){if(process.env.GH_COPILOT_TOKEN)return new o.FixedCopilotTokenManager({token:process.env.GH_COPILOT_TOKEN,telemetry:"enabled"});if(process.env.GITHUB_TOKEN)return new o.CopilotTokenManagerFromGitHubToken({token:process.env.GITHUB_TOKEN});const e=i();return process.env.GITHUB_TOKEN=e,new o.CopilotTokenManagerFromGitHubToken({token:e})},t.readTestingGitHubToken=i},913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isVerboseLoggingEnabled=t.isDebugEnabled=t.shouldFailForDebugPurposes=t.isRunningInTest=t.RuntimeMode=void 0;class n{constructor(e){this.flags=e}static fromEnvironment(e){return new n({debug:(t=process.argv,r=process.env,t.includes("--debug")||"true"===(null===(s=r.GITHUB_COPILOT_DEBUG)||void 0===s?void 0:s.toLowerCase())),verboseLogging:o(process.env),testMode:e,recordInput:i(process.argv,process.env)});var t,r,s}}function r(e){return e.get(n).flags.testMode}function o(e){if("COPILOT_AGENT_VERBOSE"in e){const t=e.COPILOT_AGENT_VERBOSE;return"1"===t||"true"===t}return!1}function i(e,t){var n;return e.includes("--record")||"true"===(null===(n=t.GITHUB_COPILOT_RECORD)||void 0===n?void 0:n.toLowerCase())}t.RuntimeMode=n,t.isRunningInTest=r,t.shouldFailForDebugPurposes=function(e){return r(e)},t.isDebugEnabled=function(e){return e.get(n).flags.debug},t.isVerboseLoggingEnabled=function(e){return e.get(n).flags.verboseLogging}},6584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestNotificationSender=t.TestUrlOpener=t.rangeToString=t.positionToString=void 0;const r=n(9035);function o(e){return`${e.line}:${e.character}`}t.positionToString=o,t.rangeToString=function(e){return`[${o(e.start)}--${o(e.end)}]`},t.TestUrlOpener=class{constructor(){this.openedUrls=[]}open(e){this.openedUrls.push(e)}};class i extends r.NotificationSender{constructor(){super(),this.sentMessages=[]}showWarningMessage(e,...t){return this.sentMessages.push(e),t?Promise.resolve(t[0]):Promise.resolve(void 0)}}t.TestNotificationSender=i},751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestLocationFactory=t.TestTextDocumentManager=t.InMemoryTextDocument=void 0;const r=n(4086);t.InMemoryTextDocument=class{constructor(e,t,n,o,i){this._uri=e,this._textDocument=r.TextDocument.create(e.toString(),t,n,o),this._relativePath=i}get uri(){return this._uri}get relativePath(){return this._relativePath}get fileName(){return this._uri.fsPath}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){const t="number"==typeof e?e:e.line,n=this.getText().split("\n")[t],r={start:{line:t,character:0},end:{line:t,character:n.length}},o=0===n.trim().length;return{text:n,range:r,isEmptyOrWhitespace:o}}getWordRangeAtPosition(e){}update(e,t){r.TextDocument.update(this._textDocument,e,t)}},t.TestTextDocumentManager=class{constructor(){this.onDidChangeTextDocument=()=>({dispose:()=>{}}),this.onDidFocusTextDocument=()=>({dispose:()=>{}}),this.textDocuments=[]}async getTextDocument(e){}async getRelativePath(e){}findNotebook(e){}},t.TestLocationFactory=class{position(e,t){return{line:e,character:t}}range(e,t,n,r){return"number"==typeof e?{start:{line:e,character:t},end:{line:n,character:r}}:{start:e,end:t}}}},2369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocationFactory=void 0,t.LocationFactory=class{}},819:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocumentManager=t.getRelativePath=void 0;const r=n(1017);t.getRelativePath=function(e,t){for(const n of e){const e=n.fsPath;if(t.startsWith(e+r.sep))return r.relative(e,t)}},t.TextDocumentManager=class{}},4567:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealUrlOpener=t.UrlOpener=void 0;const r=n(1814);t.UrlOpener=class{},t.RealUrlOpener=class{async open(e){await r(e)}}},9591:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactPaths=void 0,t.redactPaths=function(e){return e.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}},5614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(7147);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},4990:(e,t)=>{"use strict";function n(e){return"virtual"===e.type}function r(e){return"top"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.duplicateTree=t.cutTreeAfterLine=t.isTop=t.isVirtual=t.isLine=t.isBlank=t.topNode=t.blankNode=t.lineNode=t.virtualNode=void 0,t.virtualNode=function(e,t,n){return{type:"virtual",indentation:e,subs:t,label:n}},t.lineNode=function(e,t,n,r,o){if(""===n)throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:e,lineNumber:t,sourceLine:n,subs:r,label:o}},t.blankNode=function(e){return{type:"blank",lineNumber:e,subs:[]}},t.topNode=function(e){return{type:"top",indentation:-1,subs:null!=e?e:[]}},t.isBlank=function(e){return"blank"===e.type},t.isLine=function(e){return"line"===e.type},t.isVirtual=n,t.isTop=r,t.cutTreeAfterLine=function(e,t){!function e(o){if(!n(o)&&!r(o)&&o.lineNumber===t)return o.subs=[],!0;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rebuildTree=t.foldTree=t.visitTreeConditionally=t.visitTree=t.resetLineNumbers=t.mapLabels=t.clearLabelsIf=t.clearLabels=void 0;const r=n(4990);function o(e,t,n){!function e(r){"topDown"===n&&t(r),r.subs.forEach((t=>{e(t)})),"bottomUp"===n&&t(r)}(e)}t.clearLabels=function(e){return o(e,(e=>{e.label=void 0}),"bottomUp"),e},t.clearLabelsIf=function(e,t){return o(e,(e=>{e.label=e.label?t(e.label)?void 0:e.label:void 0}),"bottomUp"),e},t.mapLabels=function e(t,n){switch(t.type){case"line":case"virtual":const r=t.subs.map((t=>e(t,n)));return{...t,subs:r,label:t.label?n(t.label):void 0};case"blank":return{...t,label:t.label?n(t.label):void 0};case"top":return{...t,subs:t.subs.map((t=>e(t,n))),label:t.label?n(t.label):void 0}}},t.resetLineNumbers=function(e){let t=0;o(e,(function(e){(0,r.isVirtual)(e)||(0,r.isTop)(e)||(e.lineNumber=t,t++)}),"topDown")},t.visitTree=o,t.visitTreeConditionally=function(e,t,n){!function e(r){if("topDown"===n&&!t(r))return!1;let o=!0;return r.subs.forEach((t=>{o=o&&e(t)})),"bottomUp"===n&&(o=o&&t(r)),o}(e)},t.foldTree=function(e,t,n,r){let i=t;return o(e,(function(e){i=n(e,i)}),r),i},t.rebuildTree=function(e,t,n){const o=e=>{if(void 0!==n&&n(e))return e;{const n=e.subs.map(o).filter((e=>void 0!==e));return e.subs=n,t(e)}},i=o(e);return void 0!==i?i:(0,r.topNode)()}},2563:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTree=t.registerLanguageSpecificParser=t.flattenVirtual=t.groupBlocks=t.combineClosersAndOpeners=t.buildLabelRules=t.labelVirtualInherited=t.labelLines=t.parseRaw=void 0;const r=n(4990),o=n(2890);function i(e){const t=e.split("\n"),n=t.map((e=>e.match(/^\s*/)[0].length)),o=t.map((e=>e.trimLeft()));function i(e){const[t,i]=s(e+1,n[e]);return[(0,r.lineNode)(n[e],e,o[e],t),i]}function s(e,t){let s;const a=[];let c,l=e;for(;lt);)if(""===o[l])void 0===c&&(c=l),l+=1;else{if(void 0!==c){for(let e=c;et.matches(e.sourceLine)));n&&(e.label=n.label)}}),"bottomUp")}function a(e){return Object.keys(e).map((t=>{let n;return n=e[t].test?n=>e[t].test(n):e[t],{matches:n,label:t}}))}function c(e){const t=(0,o.rebuildTree)(e,(function(e){if(0===e.subs.length||-1===e.subs.findIndex((e=>"closer"===e.label||"opener"===e.label)))return e;const t=[];let n;for(let o=0;os.subs.push(e))),i.subs=[];else if("closer"===i.label&&void 0!==n&&((0,r.isLine)(i)||(0,r.isVirtual)(i))&&i.indentation>=n.indentation){let e=t.length-1;for(;e>0&&(0,r.isBlank)(t[e]);)e-=1;if(n.subs.push(...t.splice(e+1)),i.subs.length>0){const e=n.subs.findIndex((e=>"newVirtual"!==e.label)),t=n.subs.slice(0,e),o=n.subs.slice(e),s=o.length>0?[(0,r.virtualNode)(i.indentation,o,"newVirtual")]:[];n.subs=[...t,...s,i]}else n.subs.push(i)}else t.push(i),(0,r.isBlank)(i)||(n=i)}return e.subs=t,e}));return(0,o.clearLabelsIf)(e,(e=>"newVirtual"===e)),t}t.parseRaw=i,t.labelLines=s,t.labelVirtualInherited=function(e){(0,o.visitTree)(e,(function(e){if((0,r.isVirtual)(e)&&void 0===e.label){const t=e.subs.filter((e=>!(0,r.isBlank)(e)));1===t.length&&(e.label=t[0].label)}}),"bottomUp")},t.buildLabelRules=a,t.combineClosersAndOpeners=c,t.groupBlocks=function(e,t=r.isBlank,n){return(0,o.rebuildTree)(e,(function(e){if(e.subs.length<=1)return e;const o=[];let i,s=[],a=!1;function c(e=!1){if(void 0!==i&&(o.length>0||!e)){const e=(0,r.virtualNode)(i,s,n);o.push(e)}else s.forEach((e=>o.push(e)))}for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowsDelineations=void 0;const r=n(2563),o=n(2890);t.getWindowsDelineations=function(e,t,n,i){if(e.length{if("blank"===e.type)return void(e.label={totalLength:1,firstLineAfter:e.lineNumber+1});let t="line"===e.type?1:0,r="line"===e.type?e.lineNumber+1:NaN;function o(n){return-1==n?r-t:e.subs[n].label.firstLineAfter-e.subs[n].label.totalLength}function a(t,n){return 0==t?n+1:e.subs[t-1].label.firstLineAfter}let c="line"===e.type?-1:0,l="line"===e.type?1:0,u=0;for(let d=0;d=0&&ci){const t=o(c),r=a(d,t),p=u==d?r:a(u,t);for(n<=r-t&&s.push([t,p]);l>i;)l-=-1==c?"line"==e.type?1:0:e.subs[c].label.totalLength,c++}}if(ce[0]-t[0]||e[1]-t[1])).filter(((e,t,n)=>0==t||e[0]!=n[t-1][0]||e[1]!=n[t-1][1]))}},3272:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},haskell:{start:"--",end:""},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},ql:{start:"//",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},verilog:{start:"//",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(1017),o=n(2133);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===(0,r.extname)(o))o+=".ts";else if(".ts"!==(0,r.extname)(o))return null;return(0,r.join)((0,r.dirname)(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=(0,o.getFirstPrecedingComment)(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=(0,o.getFirstPrecedingComment)(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await(0,o.parseTree)(t,s);for(let e of(0,o.queryExports)(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await(0,o.parseTree)(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},2133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(1017),o=n(7908),i=n(7908);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=(0,r.resolve)(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},4343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(2133);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await(0,r.parseTree)(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!(0,r.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[(0,r.languageIdToWasmLanguage)(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!(0,r.isSupportedLanguageId)(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if((0,r.isSupportedLanguageId)(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if((0,r.isSupportedLanguageId)(e))return d(e).getNodeStart(t,n)}},8684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(5037),o=n(3272),i=n(1986),s=n(7289),a=n(1729),c=n(5037),l=n(7503),u=n(6885);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`)}}t.PromptOptions=x;const T={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function E(e){var t;return e=e.toLowerCase(),null!==(t=T[e])&&void 0!==t?t:e}function C(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=E,t.newLineEnded=C,t.getPrompt=async function(e,n,y={},w=[]){var T;const S=new x(e,y);let k=!1;const{source:P,offset:I}=n;if(I<0||I>P.length)throw new Error(`Offset ${I} is out of range.`);n.languageId=E(n.languageId);const R=new l.Priorities,O=R.justBelow(l.Priorities.TOP),A=S.pathMarker==h.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),N=S.languageMarker==p.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),D=S.includeSiblingFunctions==f.ContextOverSiblings?R.justBelow(O):R.justAbove(O),M=R.justBelow(O,D),L=R.justBelow(M),$=new l.PromptWishlist(S.lineEnding);let j,F;if(S.languageMarker!=p.NoMarker){const e=C((0,o.getLanguageMarker)(n));j=$.append(e,l.PromptElementKind.LanguageMarker,N)}if(S.pathMarker!=h.NoMarker){const e=C((0,o.getPathMarker)(n));F=$.append(e,l.PromptElementKind.PathMarker,A)}if(S.localImportContext!=_.NoContext)for(const e of await(0,i.extractLocalImportContext)(n,S.fs))$.append(C(e),l.PromptElementKind.ImportedFile,M);const q=S.neighboringTabs==m.None||0==w.length?[]:await(0,s.getNeighborSnippets)(n,w,S.neighboringTabs,S.neighboringTabsMinLength,S.neighboringTabsMaxLength);function B(){q.forEach((e=>$.append(e.snippet,l.PromptElementKind.SimilarFile,L,(0,c.tokenLength)(e.snippet),e.score)))}S.neighboringTabsPosition==g.TopOfText&&B();const U=[];let H;if(S.includeSiblingFunctions==f.NoSiblings)H=P.substring(0,I);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await(0,a.getSiblingFunctions)(n);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));let o=D;e.forEach((e=>{$.append(e,l.PromptElementKind.AfterCursor,o),o=R.justBelow(o)})),S.neighboringTabsPosition==g.AfterSiblings&&B(),H=r}if(S.neighboringTabsPosition==g.DirectlyAboveCursor){const e=H.lastIndexOf("\n")+1,t=H.substring(0,e),n=H.substring(e);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e))),B(),n.length>0&&(U.push($.append(n,l.PromptElementKind.AfterCursor,O)),U.length>1&&$.require(U[U.length-2],U[U.length-1]))}else $.appendLineForLine(H,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));if(p.Top==S.languageMarker&&U.length>0&&void 0!==j&&$.require(j,U[0]),h.Top==S.pathMarker&&U.length>0&&void 0!==F&&(j?$.require(F,j):$.require(F,U[0])),0==S.suffixPercent)return $.fulfill(S.maxPromptLength);{let e=n.offset;S.suffixStartMode!==b.Cursor&&S.suffixStartMode!==b.CursorTrimStart&&(e=await(0,a.getSiblingFunctionStart)(n));const o=S.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-S.suffixPercent)/100),s=$.fulfill(i);const l=o-s.prefixLength;let p=P.slice(e);S.suffixStartMode!=b.SiblingBlockTrimStart&&S.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=(0,r.takeFirstTokens)(p,l),f=(0,c.tokenLength)(h);f<=l-3&&(i=o-f,s=$.fulfill(i));const m=h.length,g=(0,c.tokenLength)(d);if(S.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(S.suffixMatchCriteria==v.Levenshtein){const e=null===(T=(0,u.findEditDistanceScore)(h,d))||void 0===T?void 0:T.score;m>0&&S.suffixMatchThreshold>0&&100*e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(8684),o=n(2133);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if((0,o.isSupportedLanguageId)(n)){const u=await(0,o.parseTree)(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=(0,o.getAncestorWithSiblingFunctions)(n,p);if(h){const u=(0,o.getFirstPrecedingComment)(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if((0,o.isFunctionDefinition)(n,i)){const n=(0,o.getFirstPrecedingComment)(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=(0,o.getAncestorWithSiblingFunctions)(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if((0,o.isFunctionDefinition)(n,e)){const n=(0,o.getFirstPrecedingComment)(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},1186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentationBasedJaccardMatcher=t.FixedWindowSizeJaccardMatcher=void 0;const r=n(4505),o=n(1864);class i extends o.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e({to:t=>new i(t,e)});class s extends o.WindowedMatcher{constructor(e,t,n){super(e),this.minLength=t,this.maxLength=n,this.languageId=e.languageId}id(){return`indent:${this.minLength}:${this.maxLength}:${this.languageId}`}getWindowsDelineations(e){return(0,r.getWindowsDelineations)(e,this.languageId,this.minLength,this.maxLength)}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.maxLength).join("\n")}similarityScore(e,t){return a(e,t)}}function a(e,t){const n=new Set;return e.forEach((e=>{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}t.IndentationBasedJaccardMatcher=s,s.FACTORY=(e,t)=>({to:n=>new s(n,e,t)})},7289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=t.neighborOptionToSelection=void 0;const r=n(3272),o=n(1186);function i(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.neighborOptionToSelection={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}},t.getNeighborSnippets=async function(e,n,s,a,c){const l=t.neighborOptionToSelection[s],u=function(e,n,r,i){const s={...t.neighborOptionToSelection[n]};return void 0!==r&&void 0!==i&&(s.matcherFactory=o.IndentationBasedJaccardMatcher.FACTORY(r,i)),s.matcherFactory.to(e)}(e,s,a,c);return n.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...u.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>l.threshold)).sort(((e,t)=>e.score-t.score)).slice(-l.numberOfNeighbors).map((t=>({score:t.score,snippet:i(t).map((t=>(0,r.comment)(t,e.languageId)+"\n")).join(""),startLine:t.startLine,endLine:t.endLine})))}},1864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},6885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(8684),o=n(5037);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=(0,o.tokenLength)(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=(0,o.tokenLength)(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=(0,o.tokenLength)(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{e.exports=n(1193)},1193:(e,t,n)=>{"use strict";n(1808);var r,o=n(4404),i=n(3685),s=n(5687),a=n(2361),c=(n(9491),n(3837));function l(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||i.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",(function(e,n,r,o){for(var i=d(n,r,o),s=0,a=t.requests.length;s=this.maxSockets?o.requests.push(i):o.createSocket(i,(function(t){function n(){o.emit("free",t,i)}function r(e){o.removeSocket(t),t.removeListener("free",n),t.removeListener("close",r),t.removeListener("agentRemove",r)}t.on("free",n),t.on("close",r),t.on("agentRemove",r),e.onSocket(t)}))},l.prototype.createSocket=function(e,t){var n=this,o={};n.sockets.push(o);var i=p({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),r("making CONNECT request");var s=n.request(i);function a(i,a,c){var l;return s.removeAllListeners(),a.removeAllListeners(),200!==i.statusCode?(r("tunneling socket could not be established, statusCode=%d",i.statusCode),a.destroy(),(l=new Error("tunneling socket could not be established, statusCode="+i.statusCode)).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):c.length>0?(r("got illegal response body from proxy"),a.destroy(),(l=new Error("got illegal response body from proxy")).code="ECONNRESET",e.request.emit("error",l),void n.removeSocket(o)):(r("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=a,t(a))}s.useChunkedEncodingByDefault=!1,s.once("response",(function(e){e.upgrade=!0})),s.once("upgrade",(function(e,t,n){process.nextTick((function(){a(e,t,n)}))})),s.once("connect",a),s.once("error",(function(t){s.removeAllListeners(),r("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, cause="+t.message);i.code="ECONNRESET",e.request.emit("error",i),n.removeSocket(o)})),s.end()},l.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var n=this.requests.shift();n&&this.createSocket(n,(function(e){n.request.onSocket(e)}))}},r=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},t.debug=r},2371:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),n=0;n1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,o=1;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function _(e){throw new RangeError(f[e])}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(h,".")).split("."),t).join(".")}function v(e){for(var t=[],n=0,r=e.length;n=55296&&o<=56319&&n>1,e+=m(e/t);e>455;r+=u)e=m(e/35);return m(r+36*e/(e+38))},x=function(e){var t,n=[],r=e.length,o=0,i=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c=128&&_("not-basic"),n.push(e.charCodeAt(c));for(var d=a>0?a+1:0;d=r&&_("invalid-input");var g=(t=e.charCodeAt(d++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:u;(g>=u||g>m((l-o)/h))&&_("overflow"),o+=g*h;var y=f<=s?1:f>=s+26?26:f-s;if(gm(l/v)&&_("overflow"),h*=v}var b=n.length+1;s=w(o-p,b,0==p),m(o/b)>l-i&&_("overflow"),i+=m(o/b),o%=b,n.splice(o++,0,i)}return String.fromCodePoint.apply(String,n)},T=function(e){var t=[],n=(e=v(e)).length,r=128,o=0,i=72,s=!0,a=!1,c=void 0;try{for(var d,p=e[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;h<128&&t.push(g(h))}}catch(e){a=!0,c=e}finally{try{!s&&p.return&&p.return()}finally{if(a)throw c}}var f=t.length,y=f;for(f&&t.push("-");y=r&&Pm((l-o)/I)&&_("overflow"),o+=(x-r)*I,r=x;var R=!0,O=!1,A=void 0;try{for(var N,D=e[Symbol.iterator]();!(R=(N=D.next()).done);R=!0){var M=N.value;if(Ml&&_("overflow"),M==r){for(var L=o,$=u;;$+=u){var j=$<=i?1:$>=i+26?26:$-i;if(L>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function P(e){for(var t="",n=0,r=e.length;n=194&&o<224){if(r-n>=6){var i=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&o)<<6|63&i)}else t+=e.substr(n,6);n+=6}else if(o>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function I(e,t){function n(e){var n=P(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,k).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,k).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,k).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,k).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,k).replace(t.PCT_ENCODED,o)),e}function R(e){return e.replace(/^0*(.*)/,"$1")||"0"}function O(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=c(n,2)[1];return r?r.split(".").map(R).join("."):e}function A(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=c(n,3),o=r[1],i=r[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),a=c(s,2),l=a[0],u=a[1],d=u?u.split(":").map(R):[],p=l.split(":").map(R),h=t.IPV4ADDRESS.test(p[p.length-1]),f=h?7:8,m=p.length-f,g=Array(f),_=0;_1){var b=g.slice(0,y.index),w=g.slice(y.index+y.length);v=b.join(":")+"::"+w.join(":")}else v=g.join(":");return i&&(v+="%"+i),v}return e}var N=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,D=void 0==="".match(/(){0}/)[1];function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(N);if(o){D?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||void 0,n.userinfo=-1!==e.indexOf("@")?o[3]:void 0,n.host=-1!==e.indexOf("//")?o[4]:void 0,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:void 0,n.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),n.host&&(n.host=A(O(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var i=S[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)I(n,r);else{if(n.host&&(t.domainHost||i&&i.domainHost))try{n.host=E(n.host.replace(r.PCT_ENCODED,P).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}I(n,s)}i&&i.parse&&i.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function L(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(A(O(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}var $=/^\.\.?\//,j=/^\/\.(\/|$)/,F=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function B(e){for(var t=[];e.length;)if(e.match($))e=e.replace($,"");else if(e.match(j))e=e.replace(j,"/");else if(e.match(F))e=e.replace(F,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(q);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function U(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],o=S[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?C(e.host):E(e.host.replace(n.PCT_ENCODED,P).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}I(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var i=L(e,t);if(void 0!==i&&("suffix"!==t.reference&&r.push("//"),r.push(i),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||o&&o.absolutePath||(c=B(c)),void 0===i&&(c=c.replace(/^\/\//,"/%2F")),r.push(c)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=M(U(e,n),n),t=M(U(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=B(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=B(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=B(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function W(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,P)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},K={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function V(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var G={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=V(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(V(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=c(n,2),o=r[0],i=r[1];e.path=o&&"/"!==o?o:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:G.domainHost,parse:G.parse,serialize:G.serialize},X={},Q="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",Z=n(n("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+n("%"+Y+Y)),ee=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),te=new RegExp(Q,"g"),ne=new RegExp(Z,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ee),"g"),oe=new RegExp(t("[^]",Q,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ie=oe;function se(e){var t=P(e);return t.match(te)?t:e}var ae={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var o=!1,i={},s=n.query.split("&"),a=0,c=s.length;a{"use strict";n.r(t),n.d(t,{NIL:()=>x,parse:()=>_,stringify:()=>d,v1:()=>g,v3:()=>v,v4:()=>b,v5:()=>w,validate:()=>l,version:()=>T});var r=n(6113),o=n.n(r);const i=new Uint8Array(256);let s=i.length;function a(){return s>i.length-16&&(o().randomFillSync(i),s=0),i.slice(s,s+=16)}const c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&c.test(e)},u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).substr(1));const d=function(e,t=0){const n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};let p,h,f=0,m=0;const g=function(e,t,n){let r=t&&n||0;const o=t||new Array(16);let i=(e=e||{}).node||p,s=void 0!==e.clockseq?e.clockseq:h;if(null==i||null==s){const t=e.random||(e.rng||a)();null==i&&(i=p=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=h=16383&(t[6]<<8|t[7]))}let c=void 0!==e.msecs?e.msecs:Date.now(),l=void 0!==e.nsecs?e.nsecs:m+1;const u=c-f+(l-m)/1e4;if(u<0&&void 0===e.clockseq&&(s=s+1&16383),(u<0||c>f)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=c,m=l,h=s,c+=122192928e5;const g=(1e4*(268435455&c)+l)%4294967296;o[r++]=g>>>24&255,o[r++]=g>>>16&255,o[r++]=g>>>8&255,o[r++]=255&g;const _=c/4294967296*1e4&268435455;o[r++]=_>>>8&255,o[r++]=255&_,o[r++]=_>>>24&15|16,o[r++]=_>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(let e=0;e<6;++e)o[r+e]=i[e];return t||d(o)},_=function(e){if(!l(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function y(e,t,n){function r(e,r,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=!0;var r=n(7147),o=n(2037),i=n(1017),s=n(8212),a=n(8144),c=function(){function e(e,t,n,o){var a=this;this.extensionId=e,this.extensionVersion=t,this.firstParty=!1,this.userOptIn=!1,this.firstParty=!!o;var c=process.env.VSCODE_LOGS||"";c&&e&&"trace"===process.env.VSCODE_LOG_LEVEL&&(c=i.join(c,e+".txt"),this.logStream=r.createWriteStream(c,{flags:"a",encoding:"utf8",autoClose:!0})),this.updateUserOptIn(n),void 0!==s.env.onDidChangeTelemetryEnabled?this.optOutListener=s.env.onDidChangeTelemetryEnabled((function(){return a.updateUserOptIn(n)})):this.optOutListener=s.workspace.onDidChangeConfiguration((function(){return a.updateUserOptIn(n)}))}return e.prototype.updateUserOptIn=function(t){var n=s.workspace.getConfiguration(e.TELEMETRY_CONFIG_ID),r=void 0===s.env.isTelemetryEnabled?n.get(e.TELEMETRY_CONFIG_ENABLED_ID,!0):s.env.isTelemetryEnabled;this.userOptIn!==r&&(this.userOptIn=r,this.userOptIn?this.createAppInsightsClient(t):this.dispose())},e.prototype.createAppInsightsClient=function(e){a.defaultClient?(this.appInsightsClient=new a.TelemetryClient(e),this.appInsightsClient.channel.setUseDiskRetryCaching(!0)):(a.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0).start(),this.appInsightsClient=a.defaultClient),this.appInsightsClient.commonProperties=this.getCommonProperties(),s&&s.env&&(this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.userId]=s.env.machineId,this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.sessionId]=s.env.sessionId),e&&0===e.indexOf("AIF-")&&(this.appInsightsClient.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1",this.firstParty=!0)},e.prototype.getCommonProperties=function(){var e=Object.create(null);if(e["common.os"]=o.platform(),e["common.platformversion"]=(o.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),e["common.extname"]=this.extensionId,e["common.extversion"]=this.extensionVersion,s&&s.env){switch(e["common.vscodemachineid"]=s.env.machineId,e["common.vscodesessionid"]=s.env.sessionId,e["common.vscodeversion"]=s.version,e["common.isnewappinstall"]=s.env.isNewAppInstall,s.env.uiKind){case s.UIKind.Web:e["common.uikind"]="web";break;case s.UIKind.Desktop:e["common.uikind"]="desktop";break;default:e["common.uikind"]="unknown"}e["common.remotename"]=this.cleanRemoteName(s.env.remoteName)}return e},e.prototype.cleanRemoteName=function(e){if(!e)return"none";var t="other";return["ssh-remote","dev-container","attached-container","wsl"].forEach((function(n){0===e.indexOf(n+"+")&&(t=n)})),t},e.prototype.shouldSendErrorTelemetry=function(){return!this.firstParty||"other"!==this.cleanRemoteName(s.env.remoteName)||void 0!==this.extension&&this.extension.extensionKind!==s.ExtensionKind.Workspace&&s.env.uiKind!==s.UIKind.Web},Object.defineProperty(e.prototype,"extension",{get:function(){return void 0===this._extension&&(this._extension=s.extensions.getExtension(this.extensionId)),this._extension},enumerable:!1,configurable:!0}),e.prototype.cloneAndChange=function(e,t){if(null===e||"object"!=typeof e)return e;if("function"!=typeof t)return e;var n={};for(var r in e)n[r]=t(r,e[r]);return n},e.prototype.anonymizeFilePaths=function(e,t){if(null==e)return"";var n=[new RegExp(s.env.appRoot.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi")];this.extension&&n.push(new RegExp(this.extension.extensionPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"));var r=e;if(t){for(var o=[],i=0,a=n;i=r}))&&(r+=e.substring(p,t.index)+"",p=d.lastIndex)};"break"!==h(););p{"use strict";var r;n.r(t),n.d(t,{URI:()=>o,Utils:()=>i}),r=(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",o=0):o=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",o=0,i=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s;i>=0?s=arguments[i]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,o=47===s.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;ol){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else s>l&&(47===e.charCodeAt(o+d)?u=d:0===d&&(u=0));break}var p=e.charCodeAt(o+d);if(p!==n.charCodeAt(a+d))break;47===p&&(u=d)}var h="";for(d=o+u+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,i=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!s){o=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(l===n.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){o=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!i){r=a+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),i=47===o;i?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,d=0;u>=r;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==d&&(d=1):-1!==s&&(d=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===d||1===d&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},447:(e,t,n)=>{var r;if(n.r(t),n.d(t,{URI:()=>f,Utils:()=>C}),"object"==typeof process)r="win32"===process.platform;else if("object"==typeof navigator){var o=navigator.userAgent;r=o.indexOf("Windows")>=0}var i,s,a=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),c=/^\w[\w\d+.-]*$/,l=/^\//,u=/^\/\//,d="",p="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function e(e,t,n,r,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||d,this.authority=e.authority||d,this.path=e.path||d,this.query=e.query||d,this.fragment=e.fragment||d):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||d,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==p&&(t=p+t):t=p}return t}(this.scheme,n||d),this.query=r||d,this.fragment=o||d,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!c.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!l.test(e.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(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,i))}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString},Object.defineProperty(e.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!1,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,o=e.query,i=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=d),void 0===n?n=this.authority:null===n&&(n=d),void 0===r?r=this.path:null===r&&(r=d),void 0===o?o=this.query:null===o&&(o=d),void 0===i?i=this.fragment:null===i&&(i=d),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&i===this.fragment?this:new g(t,n,r,o,i)},e.parse=function(e,t){void 0===t&&(t=!1);var n=h.exec(e);return n?new g(n[2]||d,E(n[4]||d),E(n[5]||d),E(n[7]||d),E(n[9]||d),t):new g(d,d,d,d,d)},e.file=function(e){var t=d;if(r&&(e=e.replace(/\\/g,p)),e[0]===p&&e[1]===p){var n=e.indexOf(p,2);-1===n?(t=e.substring(2),e=p):(t=e.substring(2,n),e=e.substring(n)||p)}return new g("file",t,e,d,d)},e.from=function(e){return new g(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new g(t);return n._formatted=t.external,n._fsPath=t._sep===m?t.fsPath:null,n}return t},e}(),m=r?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return a(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),_=((s={})[58]="%3A",s[47]="%2F",s[63]="%3F",s[35]="%23",s[91]="%5B",s[93]="%5D",s[64]="%40",s[33]="%21",s[36]="%24",s[38]="%26",s[39]="%27",s[40]="%28",s[41]="%29",s[42]="%2A",s[43]="%2B",s[44]="%2C",s[59]="%3B",s[61]="%3D",s[32]="%20",s);function y(e,t){for(var n=void 0,r=-1,o=0;o=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||45===i||46===i||95===i||126===i||t&&47===i)-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=_[i];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),n+=s):-1===r&&(r=o)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function v(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,r&&(n=n.replace(/\//g,"\\")),n}function w(e,t){var n=t?v:y,r="",o=e.scheme,i=e.authority,s=e.path,a=e.query,c=e.fragment;if(o&&(r+=o,r+=":"),(i||"file"===o)&&(r+=p,r+=p),i){var l=i.indexOf("@");if(-1!==l){var u=i.substr(0,l);i=i.substr(l+1),-1===(l=u.indexOf(":"))?r+=n(u,!1):(r+=n(u.substr(0,l),!1),r+=":",r+=n(u.substr(l+1),!1)),r+="@"}-1===(l=(i=i.toLowerCase()).indexOf(":"))?r+=n(i,!1):(r+=n(i.substr(0,l),!1),r+=i.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(d=s.charCodeAt(1))>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var d;(d=s.charCodeAt(0))>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),c&&(r+="#",r+=t?c:y(c,!1)),r}function x(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+x(e.substr(3)):e}}var T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(T)?e.replace(T,(function(e){return x(e)})):e}var C,S=n(470),k=function(){for(var e=0,t=0,n=arguments.length;t{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(447)})();const{URI:o,Utils:i}=r},7908:(e,t,n)=>{var r,o=void 0!==o?o:{};void 0===(r=function(){var t,r={};for(t in o)o.hasOwnProperty(t)&&(r[t]=o[t]);var i,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,i="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!i&&!d;var p,h,f,m,g,_="";i?(_=d?n(1017).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(7147)),g||(g=n(1017)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=o,l=function(e){process.exit(e)},o.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),o.print||console.log.bind(console);var y=o.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(o[t]=r[t]);r=null,o.arguments&&(a=o.arguments),o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":L[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[e>>2]=pe[0],L[e+4>>2]=pe[1];break;case"float":$[e>>2]=t;break;case"double":j[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return L[e>>2];case"float":return $[e>>2];case"double":return j[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,L,$,j,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function U(e,t){return e?B(D,e,t):""}function H(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return H(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return H(e,N,n,t),n}function V(e){A=e,o.HEAP8=N=new Int8Array(e),o.HEAP16=M=new Int16Array(e),o.HEAP32=L=new Int32Array(e),o.HEAPU8=D=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=new Uint32Array(e),o.HEAPF32=$=new Float32Array(e),o.HEAPF64=j=new Float64Array(e)}var G=o.INITIAL_MEMORY||33554432;(S=o.wasmMemory?o.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,o.monitorRunDependencies&&o.monitorRunDependencies(te)}function ie(e){if(te--,o.monitorRunDependencies&&o.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw o.onAbort&&o.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}o.preloadedImages={},o.preloadedAudios={},o.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=o.locateFile?o.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(o)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}function we(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function xe(e,t){for(var n in e)if(e.hasOwnProperty(n)){Be.hasOwnProperty(n)||(Be[n]=e[n]);var r=we(n);o.hasOwnProperty(r)||(o[r]=e[n])}}var Te={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function Ee(e,t,n){return e.includes("j")?function(e,t,n){var r=o["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Ce=5250816;function Se(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function ke(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Se(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Pe(e,t){var n,r;return t&&(n=Be["orig$"+e]),n||(n=Be[e]),n||(n=o[we(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return Ee(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Ie(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return Ue(e);var t=Ce,n=t+e+15&-16;return Ce=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return L[t>>2]=n/1e3|0,L[t+4>>2]=n%1e3*1e3*1e3|0,0}function $e(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function je(e){Qe(e)}function Fe(e){E(e)}Le.sig="iii",je.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Ce,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:Le,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),$e(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:je,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=U(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},Ue=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=ke(n,1024),o.asm=n;var r,i=ye(t);i.neededDynlibs&&(C=i.neededDynlibs.concat(C)),xe(n),r=o.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.__wasm_call_ctors).apply(null,arguments)},o._malloc=function(){return(Ue=o._malloc=o.asm.malloc).apply(null,arguments)}),He=(o._ts_language_symbol_count=function(){return(o._ts_language_symbol_count=o.asm.ts_language_symbol_count).apply(null,arguments)},o._ts_language_version=function(){return(o._ts_language_version=o.asm.ts_language_version).apply(null,arguments)},o._ts_language_field_count=function(){return(o._ts_language_field_count=o.asm.ts_language_field_count).apply(null,arguments)},o._ts_language_symbol_name=function(){return(o._ts_language_symbol_name=o.asm.ts_language_symbol_name).apply(null,arguments)},o._ts_language_symbol_for_name=function(){return(o._ts_language_symbol_for_name=o.asm.ts_language_symbol_for_name).apply(null,arguments)},o._ts_language_symbol_type=function(){return(o._ts_language_symbol_type=o.asm.ts_language_symbol_type).apply(null,arguments)},o._ts_language_field_name_for_id=function(){return(o._ts_language_field_name_for_id=o.asm.ts_language_field_name_for_id).apply(null,arguments)},o._memcpy=function(){return(o._memcpy=o.asm.memcpy).apply(null,arguments)},o._free=function(){return(o._free=o.asm.free).apply(null,arguments)},o._calloc=function(){return(o._calloc=o.asm.calloc).apply(null,arguments)},o._ts_parser_delete=function(){return(o._ts_parser_delete=o.asm.ts_parser_delete).apply(null,arguments)},o._ts_parser_reset=function(){return(o._ts_parser_reset=o.asm.ts_parser_reset).apply(null,arguments)},o._ts_parser_set_language=function(){return(o._ts_parser_set_language=o.asm.ts_parser_set_language).apply(null,arguments)},o._ts_parser_timeout_micros=function(){return(o._ts_parser_timeout_micros=o.asm.ts_parser_timeout_micros).apply(null,arguments)},o._ts_parser_set_timeout_micros=function(){return(o._ts_parser_set_timeout_micros=o.asm.ts_parser_set_timeout_micros).apply(null,arguments)},o._memcmp=function(){return(o._memcmp=o.asm.memcmp).apply(null,arguments)},o._ts_query_new=function(){return(o._ts_query_new=o.asm.ts_query_new).apply(null,arguments)},o._ts_query_delete=function(){return(o._ts_query_delete=o.asm.ts_query_delete).apply(null,arguments)},o._iswspace=function(){return(o._iswspace=o.asm.iswspace).apply(null,arguments)},o._iswalnum=function(){return(o._iswalnum=o.asm.iswalnum).apply(null,arguments)},o._ts_query_pattern_count=function(){return(o._ts_query_pattern_count=o.asm.ts_query_pattern_count).apply(null,arguments)},o._ts_query_capture_count=function(){return(o._ts_query_capture_count=o.asm.ts_query_capture_count).apply(null,arguments)},o._ts_query_string_count=function(){return(o._ts_query_string_count=o.asm.ts_query_string_count).apply(null,arguments)},o._ts_query_capture_name_for_id=function(){return(o._ts_query_capture_name_for_id=o.asm.ts_query_capture_name_for_id).apply(null,arguments)},o._ts_query_string_value_for_id=function(){return(o._ts_query_string_value_for_id=o.asm.ts_query_string_value_for_id).apply(null,arguments)},o._ts_query_predicates_for_pattern=function(){return(o._ts_query_predicates_for_pattern=o.asm.ts_query_predicates_for_pattern).apply(null,arguments)},o._ts_tree_copy=function(){return(o._ts_tree_copy=o.asm.ts_tree_copy).apply(null,arguments)},o._ts_tree_delete=function(){return(o._ts_tree_delete=o.asm.ts_tree_delete).apply(null,arguments)},o._ts_init=function(){return(o._ts_init=o.asm.ts_init).apply(null,arguments)},o._ts_parser_new_wasm=function(){return(o._ts_parser_new_wasm=o.asm.ts_parser_new_wasm).apply(null,arguments)},o._ts_parser_enable_logger_wasm=function(){return(o._ts_parser_enable_logger_wasm=o.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},o._ts_parser_parse_wasm=function(){return(o._ts_parser_parse_wasm=o.asm.ts_parser_parse_wasm).apply(null,arguments)},o._ts_language_type_is_named_wasm=function(){return(o._ts_language_type_is_named_wasm=o.asm.ts_language_type_is_named_wasm).apply(null,arguments)},o._ts_language_type_is_visible_wasm=function(){return(o._ts_language_type_is_visible_wasm=o.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},o._ts_tree_root_node_wasm=function(){return(o._ts_tree_root_node_wasm=o.asm.ts_tree_root_node_wasm).apply(null,arguments)},o._ts_tree_edit_wasm=function(){return(o._ts_tree_edit_wasm=o.asm.ts_tree_edit_wasm).apply(null,arguments)},o._ts_tree_get_changed_ranges_wasm=function(){return(o._ts_tree_get_changed_ranges_wasm=o.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},o._ts_tree_cursor_new_wasm=function(){return(o._ts_tree_cursor_new_wasm=o.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},o._ts_tree_cursor_delete_wasm=function(){return(o._ts_tree_cursor_delete_wasm=o.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},o._ts_tree_cursor_reset_wasm=function(){return(o._ts_tree_cursor_reset_wasm=o.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_first_child_wasm=function(){return(o._ts_tree_cursor_goto_first_child_wasm=o.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_next_sibling_wasm=function(){return(o._ts_tree_cursor_goto_next_sibling_wasm=o.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},o._ts_tree_cursor_goto_parent_wasm=function(){return(o._ts_tree_cursor_goto_parent_wasm=o.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_type_id_wasm=function(){return(o._ts_tree_cursor_current_node_type_id_wasm=o.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_named_wasm=function(){return(o._ts_tree_cursor_current_node_is_named_wasm=o.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_is_missing_wasm=function(){return(o._ts_tree_cursor_current_node_is_missing_wasm=o.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_id_wasm=function(){return(o._ts_tree_cursor_current_node_id_wasm=o.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},o._ts_tree_cursor_start_position_wasm=function(){return(o._ts_tree_cursor_start_position_wasm=o.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},o._ts_tree_cursor_end_position_wasm=function(){return(o._ts_tree_cursor_end_position_wasm=o.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},o._ts_tree_cursor_start_index_wasm=function(){return(o._ts_tree_cursor_start_index_wasm=o.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},o._ts_tree_cursor_end_index_wasm=function(){return(o._ts_tree_cursor_end_index_wasm=o.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},o._ts_tree_cursor_current_field_id_wasm=function(){return(o._ts_tree_cursor_current_field_id_wasm=o.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},o._ts_tree_cursor_current_node_wasm=function(){return(o._ts_tree_cursor_current_node_wasm=o.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},o._ts_node_symbol_wasm=function(){return(o._ts_node_symbol_wasm=o.asm.ts_node_symbol_wasm).apply(null,arguments)},o._ts_node_child_count_wasm=function(){return(o._ts_node_child_count_wasm=o.asm.ts_node_child_count_wasm).apply(null,arguments)},o._ts_node_named_child_count_wasm=function(){return(o._ts_node_named_child_count_wasm=o.asm.ts_node_named_child_count_wasm).apply(null,arguments)},o._ts_node_child_wasm=function(){return(o._ts_node_child_wasm=o.asm.ts_node_child_wasm).apply(null,arguments)},o._ts_node_named_child_wasm=function(){return(o._ts_node_named_child_wasm=o.asm.ts_node_named_child_wasm).apply(null,arguments)},o._ts_node_child_by_field_id_wasm=function(){return(o._ts_node_child_by_field_id_wasm=o.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},o._ts_node_next_sibling_wasm=function(){return(o._ts_node_next_sibling_wasm=o.asm.ts_node_next_sibling_wasm).apply(null,arguments)},o._ts_node_prev_sibling_wasm=function(){return(o._ts_node_prev_sibling_wasm=o.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},o._ts_node_next_named_sibling_wasm=function(){return(o._ts_node_next_named_sibling_wasm=o.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},o._ts_node_prev_named_sibling_wasm=function(){return(o._ts_node_prev_named_sibling_wasm=o.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},o._ts_node_parent_wasm=function(){return(o._ts_node_parent_wasm=o.asm.ts_node_parent_wasm).apply(null,arguments)},o._ts_node_descendant_for_index_wasm=function(){return(o._ts_node_descendant_for_index_wasm=o.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_index_wasm=function(){return(o._ts_node_named_descendant_for_index_wasm=o.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},o._ts_node_descendant_for_position_wasm=function(){return(o._ts_node_descendant_for_position_wasm=o.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_named_descendant_for_position_wasm=function(){return(o._ts_node_named_descendant_for_position_wasm=o.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},o._ts_node_start_point_wasm=function(){return(o._ts_node_start_point_wasm=o.asm.ts_node_start_point_wasm).apply(null,arguments)},o._ts_node_end_point_wasm=function(){return(o._ts_node_end_point_wasm=o.asm.ts_node_end_point_wasm).apply(null,arguments)},o._ts_node_start_index_wasm=function(){return(o._ts_node_start_index_wasm=o.asm.ts_node_start_index_wasm).apply(null,arguments)},o._ts_node_end_index_wasm=function(){return(o._ts_node_end_index_wasm=o.asm.ts_node_end_index_wasm).apply(null,arguments)},o._ts_node_to_string_wasm=function(){return(o._ts_node_to_string_wasm=o.asm.ts_node_to_string_wasm).apply(null,arguments)},o._ts_node_children_wasm=function(){return(o._ts_node_children_wasm=o.asm.ts_node_children_wasm).apply(null,arguments)},o._ts_node_named_children_wasm=function(){return(o._ts_node_named_children_wasm=o.asm.ts_node_named_children_wasm).apply(null,arguments)},o._ts_node_descendants_of_type_wasm=function(){return(o._ts_node_descendants_of_type_wasm=o.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},o._ts_node_is_named_wasm=function(){return(o._ts_node_is_named_wasm=o.asm.ts_node_is_named_wasm).apply(null,arguments)},o._ts_node_has_changes_wasm=function(){return(o._ts_node_has_changes_wasm=o.asm.ts_node_has_changes_wasm).apply(null,arguments)},o._ts_node_has_error_wasm=function(){return(o._ts_node_has_error_wasm=o.asm.ts_node_has_error_wasm).apply(null,arguments)},o._ts_node_is_missing_wasm=function(){return(o._ts_node_is_missing_wasm=o.asm.ts_node_is_missing_wasm).apply(null,arguments)},o._ts_query_matches_wasm=function(){return(o._ts_query_matches_wasm=o.asm.ts_query_matches_wasm).apply(null,arguments)},o._ts_query_captures_wasm=function(){return(o._ts_query_captures_wasm=o.asm.ts_query_captures_wasm).apply(null,arguments)},o._iswdigit=function(){return(o._iswdigit=o.asm.iswdigit).apply(null,arguments)},o._iswalpha=function(){return(o._iswalpha=o.asm.iswalpha).apply(null,arguments)},o._iswlower=function(){return(o._iswlower=o.asm.iswlower).apply(null,arguments)},o._towupper=function(){return(o._towupper=o.asm.towupper).apply(null,arguments)},o.___errno_location=function(){return(He=o.___errno_location=o.asm.__errno_location).apply(null,arguments)}),We=(o._memchr=function(){return(o._memchr=o.asm.memchr).apply(null,arguments)},o._strlen=function(){return(o._strlen=o.asm.strlen).apply(null,arguments)},o.stackSave=function(){return(We=o.stackSave=o.asm.stackSave).apply(null,arguments)}),ze=o.stackRestore=function(){return(ze=o.stackRestore=o.asm.stackRestore).apply(null,arguments)},Ke=o.stackAlloc=function(){return(Ke=o.stackAlloc=o.asm.stackAlloc).apply(null,arguments)},Ve=o._setThrew=function(){return(Ve=o._setThrew=o.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(o.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=o.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(o.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=o.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(o.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=o.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},o.__Znwm=function(){return(o.__Znwm=o.asm._Znwm).apply(null,arguments)},o.__ZdlPv=function(){return(o.__ZdlPv=o.asm._ZdlPv).apply(null,arguments)},o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(o.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=o.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},o._orig$ts_parser_timeout_micros=function(){return(o._orig$ts_parser_timeout_micros=o.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},o._orig$ts_parser_set_timeout_micros=function(){return(o._orig$ts_parser_set_timeout_micros=o.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},o.allocate=function(e,t){var n;return n=t==F?Ke(e.length):Ue(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,o.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Ye&&function(e){var t=o._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));L[r>>2]=K(c);for(var i=1;i>2)+i]=K(e[i-1]);L[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(o.onExit&&o.onExit(e),R=!0),l(e,new Ge(e)))}if(o.run=Xe,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Ye=!0;o.noInitialRun&&(Ye=!1),Xe();const Ze=o,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{o.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(7147);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Ie;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{var r,o,i;r={271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFileSystem=t.FileSystem=void 0;const r=n(747);t.FileSystem=class{},t.defaultFileSystem={readFile:e=>r.promises.readFile(e),mtime:async e=>(await r.promises.stat(e)).mtimeMs,stat:async function(e){const t=await r.promises.stat(e);return{ctime:t.ctimeMs,mtime:t.mtimeMs,size:t.size}}}},876:(e,t)=>{"use strict";function n(e){return"virtual"===e.type}function r(e){return"top"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.duplicateTree=t.cutTreeAfterLine=t.isTop=t.isVirtual=t.isLine=t.isBlank=t.topNode=t.blankNode=t.lineNode=t.virtualNode=void 0,t.virtualNode=function(e,t,n){return{type:"virtual",indentation:e,subs:t,label:n}},t.lineNode=function(e,t,n,r,o){if(""===n)throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:e,lineNumber:t,sourceLine:n,subs:r,label:o}},t.blankNode=function(e){return{type:"blank",lineNumber:e,subs:[]}},t.topNode=function(e){return{type:"top",indentation:-1,subs:null!=e?e:[]}},t.isBlank=function(e){return"blank"===e.type},t.isLine=function(e){return"line"===e.type},t.isVirtual=n,t.isTop=r,t.cutTreeAfterLine=function(e,t){!function e(o){if(!n(o)&&!r(o)&&o.lineNumber===t)return o.subs=[],!0;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rebuildTree=t.foldTree=t.visitTreeConditionally=t.visitTree=t.resetLineNumbers=t.mapLabels=t.clearLabelsIf=t.clearLabels=void 0;const r=n(876);function o(e,t,n){!function e(r){"topDown"===n&&t(r),r.subs.forEach((t=>{e(t)})),"bottomUp"===n&&t(r)}(e)}t.clearLabels=function(e){return o(e,(e=>{e.label=void 0}),"bottomUp"),e},t.clearLabelsIf=function(e,t){return o(e,(e=>{e.label=e.label?t(e.label)?void 0:e.label:void 0}),"bottomUp"),e},t.mapLabels=function e(t,n){switch(t.type){case"line":case"virtual":const r=t.subs.map((t=>e(t,n)));return{...t,subs:r,label:t.label?n(t.label):void 0};case"blank":return{...t,label:t.label?n(t.label):void 0};case"top":return{...t,subs:t.subs.map((t=>e(t,n))),label:t.label?n(t.label):void 0}}},t.resetLineNumbers=function(e){let t=0;o(e,(function(e){r.isVirtual(e)||r.isTop(e)||(e.lineNumber=t,t++)}),"topDown")},t.visitTree=o,t.visitTreeConditionally=function(e,t,n){!function e(r){if("topDown"===n&&!t(r))return!1;let o=!0;return r.subs.forEach((t=>{o=o&&e(t)})),"bottomUp"===n&&(o=o&&t(r)),o}(e)},t.foldTree=function(e,t,n,r){let i=t;return o(e,(function(e){i=n(e,i)}),r),i},t.rebuildTree=function(e,t,n){const o=e=>{if(void 0!==n&&n(e))return e;{const n=e.subs.map(o).filter((e=>void 0!==e));return e.subs=n,t(e)}},i=o(e);return void 0!==i?i:r.topNode()}},469:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseTree=t.registerLanguageSpecificParser=t.flattenVirtual=t.groupBlocks=t.combineClosersAndOpeners=t.buildLabelRules=t.labelVirtualInherited=t.labelLines=t.parseRaw=void 0;const r=n(876),o=n(617);function i(e){const t=e.split("\n"),n=t.map((e=>e.match(/^\s*/)[0].length)),o=t.map((e=>e.trimLeft()));function i(e){const[t,i]=s(e+1,n[e]);return[r.lineNode(n[e],e,o[e],t),i]}function s(e,t){let s;const a=[];let c,l=e;for(;lt);)if(""===o[l])void 0===c&&(c=l),l+=1;else{if(void 0!==c){for(let e=c;et.matches(e.sourceLine)));n&&(e.label=n.label)}}),"bottomUp")}function a(e){return Object.keys(e).map((t=>{let n;return n=e[t].test?n=>e[t].test(n):e[t],{matches:n,label:t}}))}function c(e){const t=o.rebuildTree(e,(function(e){if(0===e.subs.length||-1===e.subs.findIndex((e=>"closer"===e.label||"opener"===e.label)))return e;const t=[];let n;for(let o=0;os.subs.push(e))),i.subs=[];else if("closer"===i.label&&void 0!==n&&(r.isLine(i)||r.isVirtual(i))&&i.indentation>=n.indentation){let e=t.length-1;for(;e>0&&r.isBlank(t[e]);)e-=1;if(n.subs.push(...t.splice(e+1)),i.subs.length>0){const e=n.subs.findIndex((e=>"newVirtual"!==e.label)),t=n.subs.slice(0,e),o=n.subs.slice(e),s=o.length>0?[r.virtualNode(i.indentation,o,"newVirtual")]:[];n.subs=[...t,...s,i]}else n.subs.push(i)}else t.push(i),r.isBlank(i)||(n=i)}return e.subs=t,e}));return o.clearLabelsIf(e,(e=>"newVirtual"===e)),t}t.parseRaw=i,t.labelLines=s,t.labelVirtualInherited=function(e){o.visitTree(e,(function(e){if(r.isVirtual(e)&&void 0===e.label){const t=e.subs.filter((e=>!r.isBlank(e)));1===t.length&&(e.label=t[0].label)}}),"bottomUp")},t.buildLabelRules=a,t.combineClosersAndOpeners=c,t.groupBlocks=function(e,t=r.isBlank,n){return o.rebuildTree(e,(function(e){if(e.subs.length<=1)return e;const o=[];let i,s=[],a=!1;function c(e=!1){if(void 0!==i&&(o.length>0||!e)){const e=r.virtualNode(i,s,n);o.push(e)}else s.forEach((e=>o.push(e)))}for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowsDelineations=void 0;const r=n(469),o=n(617);t.getWindowsDelineations=function(e,t,n,i){if(e.length{if("blank"===e.type)return void(e.label={totalLength:1,firstLineAfter:e.lineNumber+1});let t="line"===e.type?1:0,r="line"===e.type?e.lineNumber+1:NaN;function o(n){return-1==n?r-t:e.subs[n].label.firstLineAfter-e.subs[n].label.totalLength}function a(t,n){return 0==t?n+1:e.subs[t-1].label.firstLineAfter}let c="line"===e.type?-1:0,l="line"===e.type?1:0,u=0;for(let d=0;d=0&&ci){const t=o(c),r=a(d,t),p=u==d?r:a(u,t);for(n<=r-t&&s.push([t,p]);l>i;)l-=-1==c?"line"==e.type?1:0:e.subs[c].label.totalLength,c++}}if(ce[0]-t[0]||e[1]-t[1])).filter(((e,t,n)=>0==t||e[0]!=n[t-1][0]||e[1]!=n[t-1][1]))}},417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathMarker=t.getLanguageMarker=t.comment=t.hasLanguageMarker=t.languageCommentMarkers=void 0,t.languageCommentMarkers={abap:{start:'"',end:""},bat:{start:"REM",end:""},bibtex:{start:"%",end:""},blade:{start:"#",end:""},c:{start:"//",end:""},clojure:{start:";",end:""},coffeescript:{start:"//",end:""},cpp:{start:"//",end:""},csharp:{start:"//",end:""},css:{start:"/*",end:"*/"},dart:{start:"//",end:""},dockerfile:{start:"#",end:""},elixir:{start:"#",end:""},erb:{start:"<%#",end:"%>"},erlang:{start:"%",end:""},fsharp:{start:"//",end:""},go:{start:"//",end:""},groovy:{start:"//",end:""},haml:{start:"-#",end:""},handlebars:{start:"{{!",end:"}}"},haskell:{start:"--",end:""},html:{start:"\x3c!--",end:"--\x3e"},ini:{start:";",end:""},java:{start:"//",end:""},javascript:{start:"//",end:""},javascriptreact:{start:"//",end:""},jsonc:{start:"//",end:""},jsx:{start:"//",end:""},julia:{start:"#",end:""},kotlin:{start:"//",end:""},latex:{start:"%",end:""},less:{start:"//",end:""},lua:{start:"--",end:""},makefile:{start:"#",end:""},markdown:{start:"[]: #",end:""},"objective-c":{start:"//",end:""},"objective-cpp":{start:"//",end:""},perl:{start:"#",end:""},php:{start:"//",end:""},powershell:{start:"#",end:""},pug:{start:"//",end:""},python:{start:"#",end:""},ql:{start:"//",end:""},r:{start:"#",end:""},razor:{start:"\x3c!--",end:"--\x3e"},ruby:{start:"#",end:""},rust:{start:"//",end:""},sass:{start:"//",end:""},scala:{start:"//",end:""},scss:{start:"//",end:""},shellscript:{start:"#",end:""},slim:{start:"/",end:""},solidity:{start:"//",end:""},sql:{start:"--",end:""},stylus:{start:"//",end:""},svelte:{start:"\x3c!--",end:"--\x3e"},swift:{start:"//",end:""},terraform:{start:"#",end:""},tex:{start:"%",end:""},typescript:{start:"//",end:""},typescriptreact:{start:"//",end:""},vb:{start:"'",end:""},verilog:{start:"//",end:""},"vue-html":{start:"\x3c!--",end:"--\x3e"},vue:{start:"//",end:""},xml:{start:"\x3c!--",end:"--\x3e"},xsl:{start:"\x3c!--",end:"--\x3e"},yaml:{start:"#",end:""}};const n=["php","plaintext"],r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function o({source:e}){return e.startsWith("#!")||e.startsWith("{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractLocalImportContext=t.getDocComment=void 0;const r=n(622),o=n(306);function i(e,t){var n;let o=null===(n=t.namedChild(1))||void 0===n?void 0:n.text.slice(1,-1);if(!o||!o.startsWith("."))return null;if(""===r.extname(o))o+=".ts";else if(".ts"!==r.extname(o))return null;return r.join(r.dirname(e),o)}function s(e){var t,n,r,o,i;let s=[];if("import_clause"===(null===(t=e.namedChild(0))||void 0===t?void 0:t.type)){let t=e.namedChild(0);if("named_imports"===(null===(n=null==t?void 0:t.namedChild(0))||void 0===n?void 0:n.type)){let e=t.namedChild(0);for(let t of null!==(r=null==e?void 0:e.namedChildren)&&void 0!==r?r:[])if("import_specifier"===t.type){const e=null===(o=t.childForFieldName("name"))||void 0===o?void 0:o.text;if(e){const n=null===(i=t.childForFieldName("alias"))||void 0===i?void 0:i.text;s.push({name:e,alias:n})}}}}return s}const a=new Map;function c(e,t){var n,r;let o=null!==(r=null===(n=null==t?void 0:t.childForFieldName("name"))||void 0===n?void 0:n.text)&&void 0!==r?r:"";switch(null==t?void 0:t.type){case"ambient_declaration":return c(e,t.namedChild(0));case"interface_declaration":case"enum_declaration":case"type_alias_declaration":return{name:o,decl:t.text};case"function_declaration":case"function_signature":return{name:o,decl:l(e,t)};case"class_declaration":{let n=function(e,t){let n=t.childForFieldName("body");if(n)return n.namedChildren.map((t=>d(e,t))).filter((e=>e))}(e,t),r="";if(n){let o=t.childForFieldName("body");r=`declare ${e.substring(t.startIndex,o.startIndex+1)}`,r+=n.map((e=>"\n"+e)).join(""),r+="\n}"}return{name:o,decl:r}}}return{name:o,decl:""}}function l(e,t){var n,r,o;const i=null!==(r=null===(n=t.childForFieldName("return_type"))||void 0===n?void 0:n.endIndex)&&void 0!==r?r:null===(o=t.childForFieldName("parameters"))||void 0===o?void 0:o.endIndex;if(void 0!==i){let n=e.substring(t.startIndex,i)+";";return"function_declaration"===t.type||"function_signature"===t.type?"declare "+n:n}return""}function u(e,t){const n=o.getFirstPrecedingComment(t);return n?e.substring(n.startIndex,t.startIndex):""}function d(e,t){var n,r,i,s,a;if("accessibility_modifier"===(null===(n=null==t?void 0:t.firstChild)||void 0===n?void 0:n.type)&&"private"===t.firstChild.text)return"";const c=o.getFirstPrecedingComment(t),p=null!==(r=function(e,t){let n=t.startIndex-1;for(;n>=0&&(" "===e[n]||"\t"===e[n]);)n--;if(n<0||"\n"===e[n])return e.substring(n+1,t.startIndex)}(e,null!=c?c:t))&&void 0!==r?r:" ",h=u(e,t);switch(t.type){case"ambient_declaration":const n=t.namedChild(0);return n?p+h+d(e,n):"";case"method_definition":case"method_signature":return p+h+l(e,t);case"public_field_definition":{let n=null!==(s=null===(i=t.childForFieldName("type"))||void 0===i?void 0:i.endIndex)&&void 0!==s?s:null===(a=t.childForFieldName("name"))||void 0===a?void 0:a.endIndex;if(void 0!==n)return p+h+e.substring(t.startIndex,n)+";"}}return""}async function p(e,t,n){let r=new Map,i=-1;try{i=await n.mtime(e)}catch{return r}let s=a.get(e);if(s&&s.mtime===i)return s.exports;if("typescript"===t){let i=null;try{let s=(await n.readFile(e)).toString();i=await o.parseTree(t,s);for(let e of o.queryExports(t,i.rootNode))for(let t of e.captures){let e=t.node;if("export_statement"===e.type){let t=e.childForFieldName("declaration");if(null==t?void 0:t.hasError())continue;let{name:n,decl:o}=c(s,t);if(n){o=u(s,e)+o;let t=r.get(n);t||(t=[],r.set(n,t)),t.push(o)}}}}catch{}finally{i&&i.delete()}}if(a.size>2e3)for(let e of a.keys())if(a.delete(e),r.size<=1e3)break;return a.set(e,{mtime:i,exports:r}),r}t.getDocComment=u;const h=/^\s*import\s*(type|)\s*\{[^}]*\}\s*from\s*['"]\./gm;t.extractLocalImportContext=async function(e,t){let{source:n,uri:r,languageId:a}=e;return t&&"typescript"===a?async function(e,t,n){let r="typescript",a=[];const c=function(e){let t,n=-1;h.lastIndex=-1;do{t=h.exec(e),t&&(n=h.lastIndex+t.length)}while(t);if(-1===n)return-1;const r=e.indexOf("\n",n);return-1!==r?r:e.length}(e);if(-1===c)return a;e=e.substring(0,c);let l=await o.parseTree(r,e);try{for(let e of function(e){let t=[];for(let n of e.namedChildren)"import_statement"===n.type&&t.push(n);return t}(l.rootNode)){let o=i(t,e);if(!o)continue;let c=s(e);if(0===c.length)continue;let l=await p(o,r,n);for(let e of c)l.has(e.name)&&a.push(...l.get(e.name))}}finally{l.delete()}return a}(n,r,t):[]}},306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFunctionPositions=t.getFirstPrecedingComment=t.isFunctionDefinition=t.isFunction=t.getAncestorWithSiblingFunctions=t.queryPythonIsDocstring=t.queryGlobalVars=t.queryExports=t.queryImports=t.queryFunctions=t.getBlockCloseToken=t.parsesWithoutError=t.parseTree=t.getLanguage=t.languageIdToWasmLanguage=t.isSupportedLanguageId=t.WASMLanguage=void 0;const r=n(622),o=n(87),i=n(87);var s;!function(e){e.Python="python",e.JavaScript="javascript",e.TypeScript="typescript",e.Go="go",e.Ruby="ruby"}(s=t.WASMLanguage||(t.WASMLanguage={}));const a={python:s.Python,javascript:s.JavaScript,javascriptreact:s.JavaScript,jsx:s.JavaScript,typescript:s.TypeScript,typescriptreact:s.TypeScript,go:s.Go,ruby:s.Ruby};function c(e){if(!(e in a))throw new Error(`Unrecognized language: ${e}`);return a[e]}t.isSupportedLanguageId=function(e){return e in a},t.languageIdToWasmLanguage=c;const l={python:[["(function_definition body: (block\n (expression_statement (string))? @docstring) @body) @function"],['(ERROR ("def" (identifier) (parameters))) @function']],javascript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],typescript:[["[\n (function body: (statement_block) @body)\n (function_declaration body: (statement_block) @body)\n (generator_function body: (statement_block) @body)\n (generator_function_declaration body: (statement_block) @body)\n (method_definition body: (statement_block) @body)\n ] @function"]],go:[["[\n (function_declaration body: (block) @body)\n (method_declaration body: (block) @body)\n ] @function"]],ruby:[['[\n (method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n (singleton_method name: (_) parameters: (method_parameters)? @params [(_)+ "end"] @body)\n ] @function']]},u='(variable_declarator value: (call_expression function: ((identifier) @req (#eq? @req "require"))))',d=`\n (lexical_declaration ${u}+)\n (variable_declaration ${u}+)\n`,p={python:[["(module (future_import_statement) @import)"],["(module (import_statement) @import)"],["(module (import_from_statement) @import)"]],javascript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) ] @import)"]],typescript:[[`(program [ ${d} ] @import)`],["(program [ (import_statement) (import_alias) ] @import)"]],go:[],ruby:[]},h={python:[],javascript:[["(program (export_statement) @export)"]],typescript:[["(program (export_statement) @export)"]],go:[],ruby:[]},f={python:[["(module (global_statement) @globalVar)"],["(module (expression_statement) @globalVar)"]],javascript:[],typescript:[],go:[],ruby:[]},m={python:new Set(["function_definition"]),javascript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),typescript:new Set(["function","function_declaration","generator_function","generator_function_declaration","method_definition","arrow_function"]),go:new Set(["function_declaration","method_declaration"]),ruby:new Set(["method","singleton_method"])},g={python:e=>{var t;return"module"===e.type||"block"===e.type&&"class_definition"===(null===(t=e.parent)||void 0===t?void 0:t.type)},javascript:e=>"program"===e.type||"class_body"===e.type,typescript:e=>"program"===e.type||"class_body"===e.type,go:e=>"source_file"===e.type,ruby:e=>"program"===e.type||"class"===e.type},_=new Map;async function y(e){const t=c(e);if(!_.has(t)){const e=await async function(e){await o.init();const t=r.resolve(__dirname,"..","dist",`tree-sitter-${e}.wasm`);return i.Language.load(t)}(t);_.set(t,e)}return _.get(t)}async function v(e,t){let n=await y(e);const r=new o;r.setLanguage(n);const i=r.parse(t);return r.delete(),i}function b(e,t){const n=[];for(const r of e){if(!r[1]){const e=t.tree.getLanguage();r[1]=e.query(r[0])}n.push(...r[1].matches(t))}return n}function w(e,t){return b(l[c(e)],t)}t.getLanguage=y,t.parseTree=v,t.parsesWithoutError=async function(e,t){const n=await v(e,t),r=!n.rootNode.hasError();return n.delete(),r},t.getBlockCloseToken=function(e){switch(c(e)){case s.Python:return null;case s.JavaScript:case s.TypeScript:case s.Go:return"}";case s.Ruby:return"end"}},t.queryFunctions=w,t.queryImports=function(e,t){return b(p[c(e)],t)},t.queryExports=function(e,t){return b(h[c(e)],t)},t.queryGlobalVars=function(e,t){return b(f[c(e)],t)};const x=["[\n (class_definition (block (expression_statement (string))))\n (function_definition (block (expression_statement (string))))\n]"];function T(e,t){return m[c(e)].has(t.type)}t.queryPythonIsDocstring=function(e){return 1==b([x],e).length},t.getAncestorWithSiblingFunctions=function(e,t){const n=g[c(e)];for(;t.parent;){if(n(t.parent))return t;t=t.parent}return t.parent?t:null},t.isFunction=T,t.isFunctionDefinition=function(e,t){switch(c(e)){case s.Python:case s.Go:case s.Ruby:return T(e,t);case s.JavaScript:case s.TypeScript:if("function_declaration"===t.type||"generator_function_declaration"===t.type||"method_definition"===t.type)return!0;if("lexical_declaration"===t.type||"variable_declaration"===t.type){if(t.namedChildCount>1)return!1;let n=t.namedChild(0);if(null==n)return!1;let r=n.namedChild(1);return null!==r&&T(e,r)}if("expression_statement"===t.type){let n=t.namedChild(0);if("assignment_expression"===(null==n?void 0:n.type)){let t=n.namedChild(1);return null!==t&&T(e,t)}}return!1}},t.getFirstPrecedingComment=function(e){var t;let n=e;for(;"comment"===(null===(t=n.previousSibling)||void 0===t?void 0:t.type);){let e=n.previousSibling;if(e.endPosition.row{const t=e.captures.find((e=>"function"===e.name)).node;return{startIndex:t.startIndex,endIndex:t.endIndex}}))}},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeStart=t.isBlockBodyFinished=t.isEmptyBlockStart=t.getBlockParser=void 0;const r=n(306);class o{constructor(e,t,n){this.languageId=e,this.nodeMatch=t,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,t,n){const o=await r.parseTree(this.languageId,e);try{let e=o.rootNode.descendantForIndex(t);for(;e;){const t=this.nodeMatch[e.type];if(t){if(!this.nodeTypesWithBlockOrStmtChild.has(e.type))break;const n=this.nodeTypesWithBlockOrStmtChild.get(e.type),r=""==n?e.namedChildren[0]:e.childForFieldName(n);if((null==r?void 0:r.type)==t)break}e=e.parent}if(!e)return;return n(e)}finally{o.delete()}}getNextBlockAtPosition(e,t,n){return this.getNodeMatchAtPosition(e,t,(e=>{let t=e.children.reverse().find((t=>t.type==this.nodeMatch[e.type]));if(t){if("python"==this.languageId&&t.parent){const e=":"==t.parent.type?t.parent.parent:t.parent;let n=null==e?void 0:e.nextSibling;for(;n&&"comment"==n.type;){const r=n.startPosition.row==t.endPosition.row&&n.startPosition.column>=t.endPosition.column,o=n.startPosition.row>e.endPosition.row&&n.startPosition.column>e.startPosition.column;if(!r&&!o)break;t=n,n=n.nextSibling}}if(!(t.endIndex>=t.tree.rootNode.endIndex-1&&(t.hasError()||t.parent.hasError())))return n(t)}}))}async isBlockBodyFinished(e,t,n){const r=(e+t).trimEnd(),o=await this.getNextBlockAtPosition(r,n,(e=>e.endIndex));if(void 0!==o&&o0?t:void 0}}getNodeStart(e,t){const n=e.trimEnd();return this.getNodeMatchAtPosition(n,t,(e=>e.startIndex))}}class i extends o{constructor(e,t,n,r,o){super(e,r,o),this.blockEmptyMatch=t,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,t){const n=await this.getNextBlockAtPosition(e,t,(n=>{n.startIndex0&&/\s/.test(e.charAt(n-1));)n--;return n}function a(e,t){const n=e.startIndex,r=e.startIndex-e.startPosition.column,o=t.substring(r,n);if(/^\s*$/.test(o))return o}function c(e,t,n){if(t.startPosition.row<=e.startPosition.row)return!1;const r=a(e,n),o=a(t,n);return void 0!==r&&void 0!==o&&r.startsWith(o)}class l extends o{constructor(e,t,n,r,o,i,s){super(e,t,n),this.startKeywords=r,this.blockNodeType=o,this.emptyStatementType=i,this.curlyBraceLanguage=s}isBlockEmpty(e,t){var n,o;let i=e.text.trim();return this.curlyBraceLanguage&&(i.startsWith("{")&&(i=i.slice(1)),i.endsWith("}")&&(i=i.slice(0,-1)),i=i.trim()),0==i.length||!("python"!=this.languageId||"class_definition"!=(null===(n=e.parent)||void 0===n?void 0:n.type)&&"function_definition"!=(null===(o=e.parent)||void 0===o?void 0:o.type)||1!=e.children.length||!r.queryPythonIsDocstring(e.parent))}async isEmptyBlockStart(e,t){var n,o,i;if(t>e.length)throw new RangeError("Invalid offset");for(let n=t;n";"==e.type))&&n.endIndex<=t}n=n.parent}}let s=null,l=null,u=null,d=r;for(;null!=d;){if(d.type==this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if("ERROR"==d.type){s=d;break}d=d.parent}if(null!=l){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if("python"==this.languageId){const e=l.previousSibling;if(null!=e&&e.hasError()&&(e.text.startsWith('"""')||e.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,t)}if(null!=s){if("module"==(null===(n=s.previousSibling)||void 0===n?void 0:n.type)||"internal_module"==(null===(o=s.previousSibling)||void 0===o?void 0:o.type))return!0;const e=[...s.children].reverse(),a=e.find((e=>this.startKeywords.includes(e.type)));let c=e.find((e=>e.type==this.blockNodeType));if(a){switch(this.languageId){case"python":{"try"==a.type&&"identifier"==r.type&&r.text.length>4&&(c=null===(i=e.find((e=>e.hasError())))||void 0===i?void 0:i.children.find((e=>"block"==e.type)));const t=e.find((e=>":"==e.type));if(t&&a.endIndex<=t.startIndex&&t.nextSibling){if("def"==a.type){const e=t.nextSibling;if('"'==e.type||"'"==e.type)return!0;if("ERROR"==e.type&&('"""'==e.text||"'''"==e.text))return!0}return!1}break}case"javascript":{const t=e.find((e=>"formal_parameters"==e.type));if("class"==a.type&&t)return!0;const n=e.find((e=>"{"==e.type));if(n&&n.startIndex>a.endIndex&&null!=n.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}case"typescript":{const t=e.find((e=>"{"==e.type));if(t&&t.startIndex>a.endIndex&&null!=t.nextSibling)return!1;if(e.find((e=>"do"==e.type))&&"while"==a.type)return!1;if("=>"==a.type&&a.nextSibling&&"{"!=a.nextSibling.type)return!1;break}}return!(c&&c.startIndex>a.endIndex)||this.isBlockEmpty(c,t)}}if(null!=u){const e=this.nodeMatch[u.type],n=u.children.slice().reverse().find((t=>t.type==e));if(n)return this.isBlockEmpty(n,t);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){const e=this.nodeTypesWithBlockOrStmtChild.get(u.type),t=""==e?u.children[0]:u.childForFieldName(e);if(t&&t.type!=this.blockNodeType&&t.type!=this.emptyStatementType)return!1}return!0}return!1}finally{a.delete()}}}const u={python:new l("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new l("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new l("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new i("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new i("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map)};function d(e){return u[r.languageIdToWasmLanguage(e)]}t.getBlockParser=d,t.isEmptyBlockStart=async function(e,t,n){return!!r.isSupportedLanguageId(e)&&d(e).isEmptyBlockStart(t,n)},t.isBlockBodyFinished=async function(e,t,n,o){if(r.isSupportedLanguageId(e))return d(e).isBlockBodyFinished(t,n,o)},t.getNodeStart=async function(e,t,n){if(r.isSupportedLanguageId(e))return d(e).getNodeStart(t,n)}},312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPrompt=t.newLineEnded=t.normalizeLanguageId=t.PromptOptions=t.SuffixStartMode=t.SuffixMatchOption=t.SuffixOption=t.LineEndingOptions=t.LocalImportContextOption=t.NeighboringTabsPositionOption=t.NeighboringTabsOption=t.SiblingOption=t.PathMarkerOption=t.LanguageMarkerOption=t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=t.MAX_PROMPT_LENGTH=void 0;const r=n(94),o=n(417),i=n(179),s=n(125),a=n(670),c=n(94),l=n(456),u=n(395);let d="";var p,h,f,m,g,_,y,v,b,w;t.MAX_PROMPT_LENGTH=1500,t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING=5,function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(p=t.LanguageMarkerOption||(t.LanguageMarkerOption={})),function(e){e.NoMarker="nomarker",e.Top="top",e.Always="always"}(h=t.PathMarkerOption||(t.PathMarkerOption={})),function(e){e.NoSiblings="nosiblings",e.SiblingsOverContext="siblingabove",e.ContextOverSiblings="contextabove"}(f=t.SiblingOption||(t.SiblingOption={})),function(e){e.None="none",e.Conservative="conservative",e.Medium="medium",e.Eager="eager",e.EagerButLittle="eagerButLittle"}(m=t.NeighboringTabsOption||(t.NeighboringTabsOption={})),function(e){e.TopOfText="top",e.DirectlyAboveCursor="aboveCursor",e.AfterSiblings="afterSiblings"}(g=t.NeighboringTabsPositionOption||(t.NeighboringTabsPositionOption={})),function(e){e.NoContext="nocontext",e.Declarations="declarations"}(_=t.LocalImportContextOption||(t.LocalImportContextOption={})),function(e){e.ConvertToUnix="unix",e.KeepOriginal="keep"}(y=t.LineEndingOptions||(t.LineEndingOptions={})),(w=t.SuffixOption||(t.SuffixOption={})).None="none",w.FifteenPercent="fifteenPercent",function(e){e.Equal="equal",e.Levenshtein="levenshteineditdistance"}(v=t.SuffixMatchOption||(t.SuffixMatchOption={})),function(e){e.Cursor="cursor",e.CursorTrimStart="cursortrimstart",e.SiblingBlock="siblingblock",e.SiblingBlockTrimStart="siblingblocktrimstart"}(b=t.SuffixStartMode||(t.SuffixStartMode={}));class x{constructor(e,n){if(this.fs=e,this.maxPromptLength=t.MAX_PROMPT_LENGTH,this.languageMarker=p.Top,this.pathMarker=h.Top,this.includeSiblingFunctions=f.ContextOverSiblings,this.localImportContext=_.Declarations,this.neighboringTabs=m.Eager,this.neighboringTabsPosition=g.TopOfText,this.lineEnding=y.ConvertToUnix,this.suffixPercent=0,this.suffixStartMode=b.Cursor,this.suffixMatchThreshold=20,this.suffixMatchCriteria=v.Levenshtein,n)for(const e in n)this[e]=n[e];if(this.suffixPercent<0||this.suffixPercent>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${this.suffixPercent}`);if(this.suffixPercent>0&&this.includeSiblingFunctions!=f.NoSiblings)throw new Error(`Invalid option combination. Cannot set suffixPercent > 0 (${this.suffixPercent}) and includeSiblingFunctions ${this.includeSiblingFunctions}`);if(this.suffixMatchThreshold<0||this.suffixMatchThreshold>100)throw new Error(`suffixMatchThreshold must be at between 0 and 100, but was ${this.suffixMatchThreshold}`)}}t.PromptOptions=x;const T={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor"};function E(e){var t;return e=e.toLowerCase(),null!==(t=T[e])&&void 0!==t?t:e}function C(e){return""==e||e.endsWith("\n")?e:e+"\n"}t.normalizeLanguageId=E,t.newLineEnded=C,t.getPrompt=async function(e,n,y={},w=[]){var T;const S=new x(e,y);let k=!1;const{source:P,offset:I}=n;if(I<0||I>P.length)throw new Error(`Offset ${I} is out of range.`);n.languageId=E(n.languageId);const R=new l.Priorities,O=R.justBelow(l.Priorities.TOP),A=S.pathMarker==h.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),N=S.languageMarker==p.Always?R.justBelow(l.Priorities.TOP):R.justBelow(O),D=S.includeSiblingFunctions==f.ContextOverSiblings?R.justBelow(O):R.justAbove(O),M=R.justBelow(O,D),L=R.justBelow(M),$=new l.PromptWishlist(S.lineEnding);let j,F;if(S.languageMarker!=p.NoMarker){const e=C(o.getLanguageMarker(n));j=$.append(e,l.PromptElementKind.LanguageMarker,N)}if(S.pathMarker!=h.NoMarker){const e=C(o.getPathMarker(n));F=$.append(e,l.PromptElementKind.PathMarker,A)}if(S.localImportContext!=_.NoContext)for(const e of await i.extractLocalImportContext(n,S.fs))$.append(C(e),l.PromptElementKind.ImportedFile,M);const q=S.neighboringTabs==m.None||0==w.length?[]:await s.getNeighborSnippets(n,w,S.neighboringTabs,S.neighboringTabsMinLength,S.neighboringTabsMaxLength);function B(){q.forEach((e=>$.append(e.snippet,l.PromptElementKind.SimilarFile,L,c.tokenLength(e.snippet),e.score)))}S.neighboringTabsPosition==g.TopOfText&&B();const U=[];let H;if(S.includeSiblingFunctions==f.NoSiblings)H=P.substring(0,I);else{const{siblings:e,beforeInsertion:t,afterInsertion:r}=await a.getSiblingFunctions(n);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));let o=D;e.forEach((e=>{$.append(e,l.PromptElementKind.AfterCursor,o),o=R.justBelow(o)})),S.neighboringTabsPosition==g.AfterSiblings&&B(),H=r}if(S.neighboringTabsPosition==g.DirectlyAboveCursor){const e=H.lastIndexOf("\n")+1,t=H.substring(0,e),n=H.substring(e);$.appendLineForLine(t,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e))),B(),n.length>0&&(U.push($.append(n,l.PromptElementKind.AfterCursor,O)),U.length>1&&$.require(U[U.length-2],U[U.length-1]))}else $.appendLineForLine(H,l.PromptElementKind.BeforeCursor,O).forEach((e=>U.push(e)));if(p.Top==S.languageMarker&&U.length>0&&void 0!==j&&$.require(j,U[0]),h.Top==S.pathMarker&&U.length>0&&void 0!==F&&(j?$.require(F,j):$.require(F,U[0])),0==S.suffixPercent)return $.fulfill(S.maxPromptLength);{let e=n.offset;S.suffixStartMode!==b.Cursor&&S.suffixStartMode!==b.CursorTrimStart&&(e=await a.getSiblingFunctionStart(n));const o=S.maxPromptLength-t.TOKENS_RESERVED_FOR_SUFFIX_ENCODING;let i=Math.floor(o*(100-S.suffixPercent)/100),s=$.fulfill(i);const l=o-s.prefixLength;let p=P.slice(e);S.suffixStartMode!=b.SiblingBlockTrimStart&&S.suffixStartMode!=b.CursorTrimStart||(p=p.trimStart());const h=r.takeFirstTokens(p,l),f=c.tokenLength(h);f<=l-3&&(i=o-f,s=$.fulfill(i));const m=h.length,g=c.tokenLength(d);if(S.suffixMatchCriteria==v.Equal)h===d&&(k=!0);else if(S.suffixMatchCriteria==v.Levenshtein){const e=null===(T=u.findEditDistanceScore(h,d))||void 0===T?void 0:T.score;m>0&&S.suffixMatchThreshold>0&&100*e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSiblingFunctionStart=t.getSiblingFunctions=void 0;const r=n(312),o=n(306);t.getSiblingFunctions=async function({source:e,offset:t,languageId:n}){var i,s;const a=[];let c="",l=e.substring(0,t);if(o.isSupportedLanguageId(n)){const u=await o.parseTree(n,e);try{let d=t;for(;d>=0&&/\s/.test(e[d]);)d--;const p=u.rootNode.descendantForIndex(d),h=o.getAncestorWithSiblingFunctions(n,p);if(h){const u=o.getFirstPrecedingComment(h),d=null!==(i=null==u?void 0:u.startIndex)&&void 0!==i?i:h.startIndex;let p,f=0;for(;" "==(p=e[d-f-1])||"\t"==p;)f++;const m=e.substring(d-f,d);for(let i=h.nextSibling;i;i=i.nextSibling)if(o.isFunctionDefinition(n,i)){const n=o.getFirstPrecedingComment(i),c=null!==(s=null==n?void 0:n.startIndex)&&void 0!==s?s:i.startIndex;if(c=0&&/\s/.test(e[s]);)s--;const a=i.rootNode.descendantForIndex(s),c=o.getAncestorWithSiblingFunctions(n,a);if(c){for(let e=c.nextSibling;e;e=e.nextSibling)if(o.isFunctionDefinition(n,e)){const n=o.getFirstPrecedingComment(e),i=null!==(r=null==n?void 0:n.startIndex)&&void 0!==r?r:e.startIndex;if(i=t)return c.endIndex}}finally{i.delete()}}return t}},404:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentationBasedJaccardMatcher=t.FixedWindowSizeJaccardMatcher=void 0;const r=n(250),o=n(467);class i extends o.WindowedMatcher{constructor(e,t){super(e),this.windowLength=t}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){const t=[],n=e.length;for(let e=0;0==e||e({to:t=>new i(t,e)});class s extends o.WindowedMatcher{constructor(e,t,n){super(e),this.minLength=t,this.maxLength=n,this.languageId=e.languageId}id(){return`indent:${this.minLength}:${this.maxLength}:${this.languageId}`}getWindowsDelineations(e){return r.getWindowsDelineations(e,this.languageId,this.minLength,this.maxLength)}trimDocument(e){return e.source.slice(0,e.offset).split("\n").slice(-this.maxLength).join("\n")}similarityScore(e,t){return a(e,t)}}function a(e,t){const n=new Set;return e.forEach((e=>{t.has(e)&&n.add(e)})),n.size/(e.size+t.size-n.size)}t.IndentationBasedJaccardMatcher=s,s.FACTORY=(e,t)=>({to:n=>new s(n,e,t)})},125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNeighborSnippets=t.neighborOptionToSelection=void 0;const r=n(417),o=n(404);function i(e){return[e.relativePath?"Compare this snippet from "+e.relativePath+":":"Compare this snippet:"].concat(e.snippet.split("\n"))}t.neighborOptionToSelection={none:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(1),threshold:-1,numberOfNeighbors:0},conservative:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:.3,numberOfNeighbors:1},medium:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(20),threshold:.1,numberOfNeighbors:2},eager:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(60),threshold:0,numberOfNeighbors:4},eagerButLittle:{matcherFactory:o.FixedWindowSizeJaccardMatcher.FACTORY(10),threshold:0,numberOfNeighbors:1}},t.getNeighborSnippets=async function(e,n,s,a,c){const l=t.neighborOptionToSelection[s],u=function(e,n,r,i){const s={...t.neighborOptionToSelection[n]};return void 0!==r&&void 0!==i&&(s.matcherFactory=o.IndentationBasedJaccardMatcher.FACTORY(r,i)),s.matcherFactory.to(e)}(e,s,a,c);return n.filter((e=>e.source.length<1e4&&e.source.length>0)).slice(0,20).map((e=>({relativePath:e.relativePath,...u.findBestMatch(e)}))).filter((e=>e.score&&e.snippet&&e.score>l.threshold)).sort(((e,t)=>e.score-t.score)).slice(-l.numberOfNeighbors).map((t=>({score:t.score,snippet:i(t).map((t=>r.comment(t,e.languageId)+"\n")).join(""),startLine:t.startLine,endLine:t.endLine})))}},467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitIntoWords=t.WindowedMatcher=void 0;class n{constructor(e){var t;this.stopsForLanguage=null!==(t=a.get(e.languageId))&&void 0!==t?t:s}tokenize(e){return new Set(o(e).filter((e=>!this.stopsForLanguage.has(e))))}}const r=new class{constructor(e){this.keys=[],this.cache={},this.size=e}put(e,t){var n;if(this.cache[e]=t,this.keys.length>this.size){this.keys.push(e);const t=null!==(n=this.keys.shift())&&void 0!==n?n:"";delete this.cache[t]}}get(e){return this.cache[e]}}(20);function o(e){return e.split(/[^a-zA-Z0-9]/).filter((e=>e.length>0))}t.WindowedMatcher=class{constructor(e){this.tokenizer=new n(e),this.referenceTokens=this.tokenizer.tokenize(this.trimDocument(e))}findBestMatch(e){var t;if(0===e.source.length||0===this.referenceTokens.size)return;const n=e.source.split("\n"),o=this.id()+":"+e.source,i=null!==(t=r.get(o))&&void 0!==t?t:[],s=0==i.length,a=s?n.map(this.tokenizer.tokenize,this.tokenizer):[];let c=-1,l=-1,u=0;for(const[e,[t,r]]of this.getWindowsDelineations(n).entries()){if(s){const e=new Set;a.slice(t,r).forEach((t=>t.forEach(e.add,e))),i.push(e)}const n=i[e],o=this.similarityScore(n,this.referenceTokens);o>u&&(u=o,c=t,l=r)}return s&&r.put(o,i),-1!==c?{snippet:n.slice(c,l).join("\n"),score:u,startLine:c,endLine:l}:void 0}},t.splitIntoWords=o;const i=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),s=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...i]),a=new Map([])},395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findEditDistanceScore=void 0,t.findEditDistanceScore=function(e,t){if(0===e.length||0===t.length)return{score:e.length+t.length};const n=Array.from({length:e.length}).map((()=>Array.from({length:t.length}).map((()=>0))));for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Priorities=t.PromptWishlist=t.PromptElementRanges=t.PromptChoices=t.PromptBackground=t.PromptElementKind=void 0;const r=n(312),o=n(94);var i;!function(e){e.BeforeCursor="BeforeCursor",e.AfterCursor="AfterCursor",e.SimilarFile="SimilarFile",e.ImportedFile="ImportedFile",e.LanguageMarker="LanguageMarker",e.PathMarker="PathMarker"}(i=t.PromptElementKind||(t.PromptElementKind={}));class s{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.IsNeighboringTab(e)&&this.used.set(e.id,this.convert(e))}undoMarkUsed(e){this.IsNeighboringTab(e)&&this.used.delete(e.id)}markUnused(e){this.IsNeighboringTab(e)&&this.unused.set(e.id,this.convert(e))}convert(e){return{score:e.score.toFixed(4),length:e.text.length}}IsNeighboringTab(e){return e.kind==i.SimilarFile}}t.PromptBackground=s;class a{constructor(){this.used=new Map,this.unused=new Map}markUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}undoMarkUsed(e){this.used.set(e.kind,(this.used.get(e.kind)||0)-e.tokens)}markUnused(e){this.unused.set(e.kind,(this.used.get(e.kind)||0)+e.tokens)}}t.PromptChoices=a;class c{constructor(e){this.ranges=new Array;let t,n=0;for(const{element:r}of e)0!==r.text.length&&(t===i.BeforeCursor&&r.kind===i.BeforeCursor?this.ranges[this.ranges.length-1].end+=r.text.length:this.ranges.push({kind:r.kind,start:n,end:n+r.text.length}),t=r.kind,n+=r.text.length)}}t.PromptElementRanges=c,t.PromptWishlist=class{constructor(e){this.content=[],this.lineEndingOption=e}getContent(){return[...this.content]}convertLineEndings(e){return this.lineEndingOption===r.LineEndingOptions.ConvertToUnix&&(e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),e}append(e,t,n,r=o.tokenLength(e),i=NaN){e=this.convertLineEndings(e);const s=this.content.length;return this.content.push({id:s,text:e,kind:t,priority:n,tokens:r,requires:[],excludes:[],score:i}),s}appendLineForLine(e,t,n){const r=(e=this.convertLineEndings(e)).split("\n");for(let e=0;e{"\n"===e&&o.length>0&&!o[o.length-1].endsWith("\n\n")?o[o.length-1]+="\n":o.push(e)}));const i=[];return o.forEach(((e,r)=>{""!==e&&(i.push(this.append(e,t,n)),r>0&&(this.content[this.content.length-2].requires=[this.content[this.content.length-1]]))})),i}require(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.requires.push(r)}exclude(e,t){const n=this.content.find((t=>t.id===e)),r=this.content.find((e=>e.id===t));n&&r&&n.excludes.push(r)}fulfill(e){const t=new a,n=new s,r=this.content.map(((e,t)=>({element:e,index:t})));r.sort(((e,t)=>e.element.priority===t.element.priority?t.index-e.index:t.element.priority-e.element.priority));const i=new Set,l=new Set;let u;const d=[];let p=e;r.forEach((e=>{var r;const o=e.element,s=e.index;if(p>=0&&(p>0||void 0===u)&&o.requires.every((e=>i.has(e.id)))&&!l.has(o.id)){let a=o.tokens;const c=null===(r=function(e,t){let n,r=1/0;for(const o of e)o.index>t&&o.index=a?(p-=a,i.add(o.id),o.excludes.forEach((e=>l.add(e.id))),t.markUsed(o),n.markUsed(o),d.push(e)):u=null!=u?u:e}else t.markUnused(o),n.markUnused(o)})),d.sort(((e,t)=>e.index-t.index));let h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h);for(;f>e;){d.sort(((e,t)=>t.element.priority===e.element.priority?t.index-e.index:t.element.priority-e.element.priority));const e=d.pop();e&&(t.undoMarkUsed(e.element),t.markUnused(e.element),n.undoMarkUsed(e.element),n.markUnused(e.element),u=void 0),d.sort(((e,t)=>e.index-t.index)),h=d.reduce(((e,t)=>e+t.element.text),""),f=o.tokenLength(h)}const m=[...d];if(void 0!==u){m.push(u),m.sort(((e,t)=>e.index-t.index));const r=m.reduce(((e,t)=>e+t.element.text),""),i=o.tokenLength(r);if(i<=e){t.markUsed(u.element),n.markUsed(u.element);const e=new c(m);return{prefix:r,suffix:"",prefixLength:i,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:e}}t.markUnused(u.element),n.markUnused(u.element)}const g=new c(d);return{prefix:h,suffix:"",prefixLength:f,suffixLength:0,promptChoices:t,promptBackground:n,promptElementRanges:g}}};class l{constructor(){this.registeredPriorities=[0,1]}register(e){if(e>l.TOP||ee>t)));return this.register((n+t)/2)}justBelow(...e){const t=Math.min(...e),n=Math.max(...this.registeredPriorities.filter((e=>en>e&&n{var r,o,i=void 0!==i?i:{};void 0===(o="function"==typeof(r=function(){var t,r={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t]);var o,s,a=[],c="./this.program",l=function(e,t){throw t},u=!1,d=!1;u="object"==typeof window,d="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,s=!u&&!o&&!d;var p,h,f,m,g,_="";o?(_=d?n(622).dirname(_)+"/":__dirname+"/",p=function(e,t){return m||(m=n(747)),g||(g=n(622)),e=g.normalize(e),m.readFileSync(e,t?null:"utf8")},f=function(e){var t=p(e,!0);return t.buffer||(t=new Uint8Array(t)),O(t.buffer),t},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),e.exports=i,l=function(e){process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(p=function(e){return read(e)}),f=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(O("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(l=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||d)&&(d?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),_=0!==_.indexOf("blob:")?_.substr(0,_.lastIndexOf("/")+1):"",p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}),i.print||console.log.bind(console);var y=i.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t]);r=null,i.arguments&&(a=i.arguments),i.thisProgram&&(c=i.thisProgram),i.quit&&(l=i.quit);var v,b=16,w=[];function x(e,t){if(!v){v=new WeakMap;for(var n=0;n>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":L[e>>2]=t;break;case"i64":pe=[t>>>0,(de=t,+Math.abs(de)>=1?de>0?(0|Math.min(+Math.floor(de/4294967296),4294967295))>>>0:~~+Math.ceil((de-+(~~de>>>0))/4294967296)>>>0:0)],L[e>>2]=pe[0],L[e+4>>2]=pe[1];break;case"float":$[e>>2]=t;break;case"double":j[e>>3]=t;break;default:se("invalid type for setValue: "+n)}}function I(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return N[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return L[e>>2];case"float":return $[e>>2];case"double":return j[e>>3];default:se("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&se("no native wasm support detected");var R=!1;function O(e,t){e||se("Assertion failed: "+t)}var A,N,D,M,L,$,j,F=1,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.subarray&&q)return q.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function U(e,t){return e?B(D,e,t):""}function H(e,t,n,r){if(!(r>0))return 0;for(var o=n,i=n+r-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-o}function W(e,t,n){return H(e,D,t,n)}function z(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:4}return t}function K(e){var t=z(e)+1,n=Ke(t);return H(e,N,n,t),n}function V(e){A=e,i.HEAP8=N=new Int8Array(e),i.HEAP16=M=new Int16Array(e),i.HEAP32=L=new Int32Array(e),i.HEAPU8=D=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=$=new Float32Array(e),i.HEAPF64=j=new Float64Array(e)}var G=i.INITIAL_MEMORY||33554432;(S=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:G/65536,maximum:32768}))&&(A=S.buffer),G=A.byteLength,V(A);var J=new WebAssembly.Table({initial:13,element:"anyfunc"}),X=[],Q=[],Y=[],Z=[],ee=!1,te=0,ne=null,re=null;function oe(e){te++,i.monitorRunDependencies&&i.monitorRunDependencies(te)}function ie(e){if(te--,i.monitorRunDependencies&&i.monitorRunDependencies(te),0==te&&(null!==ne&&(clearInterval(ne),ne=null),re)){var t=re;re=null,t()}}function se(e){throw i.onAbort&&i.onAbort(e),y(e+=""),R=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}i.preloadedImages={},i.preloadedAudios={},i.preloadedWasm={};var ae="data:application/octet-stream;base64,";function ce(e){return e.startsWith(ae)}function le(e){return e.startsWith("file://")}var ue,de,pe,he="tree-sitter.wasm";function fe(e){try{if(e==he&&T)return new Uint8Array(T);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){se(e)}}ce(he)||(ue=he,he=i.locateFile?i.locateFile(ue,_):_+ue);var me={},ge={get:function(e,t){return me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),me[t]}};function _e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?J.get(n)():J.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}else t(i)}}function ye(e){var t=0;function n(){for(var n=0,r=1;;){var o=e[t++];if(n+=(127&o)*r,r*=128,!(128&o))break}return n}if(e instanceof WebAssembly.Module){var r=WebAssembly.Module.customSections(e,"dylink");O(0!=r.length,"need dylink section"),e=new Int8Array(r[0])}else O(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0],"need to see wasm magic number"),O(0===e[8],"need the dylink section to be first"),t=9,n(),O(6===e[t]),O(e[++t]==="d".charCodeAt(0)),O(e[++t]==="y".charCodeAt(0)),O(e[++t]==="l".charCodeAt(0)),O(e[++t]==="i".charCodeAt(0)),O(e[++t]==="n".charCodeAt(0)),O(e[++t]==="k".charCodeAt(0)),t++;var o={};o.memorySize=n(),o.memoryAlign=n(),o.tableSize=n(),o.tableAlign=n();var i=n();o.neededDynlibs=[];for(var s=0;s0}var we={nextHandle:1,loadedLibs:{},loadedLibNames:{}};function xe(e,t,n){return e.includes("j")?function(e,t,n){var r=i["dynCall_"+e];return n&&n.length?r.apply(null,[t].concat(n)):r.call(null,t)}(e,t,n):J.get(t).apply(null,n)}var Te=5250832;function Ee(e){return["__cpp_exception","__wasm_apply_data_relocs","__dso_handle","__set_stack_limits"].includes(e)}function Ce(e,t){var n={};for(var r in e){var o=e[r];"object"==typeof o&&(o=o.value),"number"==typeof o&&(o+=t),n[r]=o}return function(e){for(var t in e)if(!Ee(t)){var n=!1,r=e[t];t.startsWith("orig$")&&(t=t.split("$")[1],n=!0),me[t]||(me[t]=new WebAssembly.Global({value:"i32",mutable:!0})),(n||0==me[t].value)&&("function"==typeof r?me[t].value=x(r):"number"==typeof r?me[t].value=r:y("unhandled export type for `"+t+"`: "+typeof r))}}(n),n}function Se(e){return 0==e.indexOf("dynCall_")||["stackAlloc","stackSave","stackRestore"].includes(e)?e:"_"+e}function ke(e,t){var n,r;return t&&(n=i.asm["orig$"+e]),n||(n=i.asm[e]),!n&&t&&(n=i["_orig$"+e]),n||(n=i[Se(e)]),!n&&e.startsWith("invoke_")&&(r=e.split("_")[1],n=function(){var e=We();try{return xe(r,arguments[0],Array.prototype.slice.call(arguments,1))}catch(t){if(ze(e),t!==t+0&&"longjmp"!==t)throw t;Ve(1,0)}}),n}function Pe(e,t){var n=ye(e);function r(){var r=Math.pow(2,n.memoryAlign);r=Math.max(r,b);var o,i,s,a=(o=function(e){if(ee)return Ue(e);var t=Te,n=t+e+15&-16;return Te=n,me.__heap_base.value=n,t}(n.memorySize+r),(i=r)||(i=b),Math.ceil(o/i)*i),c=J.length;J.grow(n.tableSize);for(var l=a;l>2]=28,-1;n=Ae()}return L[t>>2]=n/1e3|0,L[t+4>>2]=n%1e3*1e3*1e3|0,0}function $e(e){try{return S.grow(e-A.byteLength+65535>>>16),V(S.buffer),1}catch(e){}}function je(e){Qe(e)}function Fe(e){E(e)}Le.sig="iii",je.sig="vi",Fe.sig="vi";var qe,Be={__heap_base:Te,__indirect_function_table:J,__memory_base:1024,__stack_pointer:Ne,__table_base:1,abort:De,clock_gettime:Le,emscripten_memcpy_big:function(e,t,n){D.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=D.length;if((e>>>=0)>2147483648)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),$e(Math.min(2147483648,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},exit:je,memory:S,setTempRet0:Fe,tree_sitter_log_callback:function(e,t){if(ft){const n=U(t);ft(n,0!==e)}},tree_sitter_parse_callback:function(e,t,n,r,o){var i=ht(t,{row:n,column:r});"string"==typeof i?(P(o,i.length,"i32"),function(e,t,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=(n-=2)<2*e.length?n/2:e.length,o=0;o>1]=i,t+=2}M[t>>1]=0}(i,e,10240)):P(o,0,"i32")}},Ue=(function(){var e={env:Be,wasi_snapshot_preview1:Be,"GOT.mem":new Proxy(Be,ge),"GOT.func":new Proxy(Be,ge)};function t(e,t){var n=e.exports;n=Ce(n,1024),i.asm=n;var r,o=ye(t);o.neededDynlibs&&(C=o.neededDynlibs.concat(C)),r=i.asm.__wasm_call_ctors,Q.unshift(r),ie()}function n(e){t(e.instance,e.module)}function r(t){return function(){if(!T&&(u||d)){if("function"==typeof fetch&&!le(he))return fetch(he,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+he+"'";return e.arrayBuffer()})).catch((function(){return fe(he)}));if(h)return new Promise((function(e,t){h(he,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return fe(he)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),se(e)}))}if(oe(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||ce(he)||le(he)||"function"!=typeof fetch?r(n):fetch(he,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.__wasm_call_ctors).apply(null,arguments)},i._malloc=function(){return(Ue=i._malloc=i.asm.malloc).apply(null,arguments)}),He=(i._ts_language_symbol_count=function(){return(i._ts_language_symbol_count=i.asm.ts_language_symbol_count).apply(null,arguments)},i._ts_language_version=function(){return(i._ts_language_version=i.asm.ts_language_version).apply(null,arguments)},i._ts_language_field_count=function(){return(i._ts_language_field_count=i.asm.ts_language_field_count).apply(null,arguments)},i._ts_language_symbol_name=function(){return(i._ts_language_symbol_name=i.asm.ts_language_symbol_name).apply(null,arguments)},i._ts_language_symbol_for_name=function(){return(i._ts_language_symbol_for_name=i.asm.ts_language_symbol_for_name).apply(null,arguments)},i._ts_language_symbol_type=function(){return(i._ts_language_symbol_type=i.asm.ts_language_symbol_type).apply(null,arguments)},i._ts_language_field_name_for_id=function(){return(i._ts_language_field_name_for_id=i.asm.ts_language_field_name_for_id).apply(null,arguments)},i._memcpy=function(){return(i._memcpy=i.asm.memcpy).apply(null,arguments)},i._free=function(){return(i._free=i.asm.free).apply(null,arguments)},i._calloc=function(){return(i._calloc=i.asm.calloc).apply(null,arguments)},i._ts_parser_delete=function(){return(i._ts_parser_delete=i.asm.ts_parser_delete).apply(null,arguments)},i._ts_parser_reset=function(){return(i._ts_parser_reset=i.asm.ts_parser_reset).apply(null,arguments)},i._ts_parser_set_language=function(){return(i._ts_parser_set_language=i.asm.ts_parser_set_language).apply(null,arguments)},i._ts_parser_timeout_micros=function(){return(i._ts_parser_timeout_micros=i.asm.ts_parser_timeout_micros).apply(null,arguments)},i._ts_parser_set_timeout_micros=function(){return(i._ts_parser_set_timeout_micros=i.asm.ts_parser_set_timeout_micros).apply(null,arguments)},i._memcmp=function(){return(i._memcmp=i.asm.memcmp).apply(null,arguments)},i._ts_query_new=function(){return(i._ts_query_new=i.asm.ts_query_new).apply(null,arguments)},i._ts_query_delete=function(){return(i._ts_query_delete=i.asm.ts_query_delete).apply(null,arguments)},i._iswspace=function(){return(i._iswspace=i.asm.iswspace).apply(null,arguments)},i._iswalnum=function(){return(i._iswalnum=i.asm.iswalnum).apply(null,arguments)},i._ts_query_pattern_count=function(){return(i._ts_query_pattern_count=i.asm.ts_query_pattern_count).apply(null,arguments)},i._ts_query_capture_count=function(){return(i._ts_query_capture_count=i.asm.ts_query_capture_count).apply(null,arguments)},i._ts_query_string_count=function(){return(i._ts_query_string_count=i.asm.ts_query_string_count).apply(null,arguments)},i._ts_query_capture_name_for_id=function(){return(i._ts_query_capture_name_for_id=i.asm.ts_query_capture_name_for_id).apply(null,arguments)},i._ts_query_string_value_for_id=function(){return(i._ts_query_string_value_for_id=i.asm.ts_query_string_value_for_id).apply(null,arguments)},i._ts_query_predicates_for_pattern=function(){return(i._ts_query_predicates_for_pattern=i.asm.ts_query_predicates_for_pattern).apply(null,arguments)},i._ts_tree_copy=function(){return(i._ts_tree_copy=i.asm.ts_tree_copy).apply(null,arguments)},i._ts_tree_delete=function(){return(i._ts_tree_delete=i.asm.ts_tree_delete).apply(null,arguments)},i._ts_init=function(){return(i._ts_init=i.asm.ts_init).apply(null,arguments)},i._ts_parser_new_wasm=function(){return(i._ts_parser_new_wasm=i.asm.ts_parser_new_wasm).apply(null,arguments)},i._ts_parser_enable_logger_wasm=function(){return(i._ts_parser_enable_logger_wasm=i.asm.ts_parser_enable_logger_wasm).apply(null,arguments)},i._ts_parser_parse_wasm=function(){return(i._ts_parser_parse_wasm=i.asm.ts_parser_parse_wasm).apply(null,arguments)},i._ts_language_type_is_named_wasm=function(){return(i._ts_language_type_is_named_wasm=i.asm.ts_language_type_is_named_wasm).apply(null,arguments)},i._ts_language_type_is_visible_wasm=function(){return(i._ts_language_type_is_visible_wasm=i.asm.ts_language_type_is_visible_wasm).apply(null,arguments)},i._ts_tree_root_node_wasm=function(){return(i._ts_tree_root_node_wasm=i.asm.ts_tree_root_node_wasm).apply(null,arguments)},i._ts_tree_edit_wasm=function(){return(i._ts_tree_edit_wasm=i.asm.ts_tree_edit_wasm).apply(null,arguments)},i._ts_tree_get_changed_ranges_wasm=function(){return(i._ts_tree_get_changed_ranges_wasm=i.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)},i._ts_tree_cursor_new_wasm=function(){return(i._ts_tree_cursor_new_wasm=i.asm.ts_tree_cursor_new_wasm).apply(null,arguments)},i._ts_tree_cursor_delete_wasm=function(){return(i._ts_tree_cursor_delete_wasm=i.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)},i._ts_tree_cursor_reset_wasm=function(){return(i._ts_tree_cursor_reset_wasm=i.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_first_child_wasm=function(){return(i._ts_tree_cursor_goto_first_child_wasm=i.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_next_sibling_wasm=function(){return(i._ts_tree_cursor_goto_next_sibling_wasm=i.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)},i._ts_tree_cursor_goto_parent_wasm=function(){return(i._ts_tree_cursor_goto_parent_wasm=i.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_type_id_wasm=function(){return(i._ts_tree_cursor_current_node_type_id_wasm=i.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_named_wasm=function(){return(i._ts_tree_cursor_current_node_is_named_wasm=i.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_is_missing_wasm=function(){return(i._ts_tree_cursor_current_node_is_missing_wasm=i.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_id_wasm=function(){return(i._ts_tree_cursor_current_node_id_wasm=i.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)},i._ts_tree_cursor_start_position_wasm=function(){return(i._ts_tree_cursor_start_position_wasm=i.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)},i._ts_tree_cursor_end_position_wasm=function(){return(i._ts_tree_cursor_end_position_wasm=i.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)},i._ts_tree_cursor_start_index_wasm=function(){return(i._ts_tree_cursor_start_index_wasm=i.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)},i._ts_tree_cursor_end_index_wasm=function(){return(i._ts_tree_cursor_end_index_wasm=i.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)},i._ts_tree_cursor_current_field_id_wasm=function(){return(i._ts_tree_cursor_current_field_id_wasm=i.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)},i._ts_tree_cursor_current_node_wasm=function(){return(i._ts_tree_cursor_current_node_wasm=i.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)},i._ts_node_symbol_wasm=function(){return(i._ts_node_symbol_wasm=i.asm.ts_node_symbol_wasm).apply(null,arguments)},i._ts_node_child_count_wasm=function(){return(i._ts_node_child_count_wasm=i.asm.ts_node_child_count_wasm).apply(null,arguments)},i._ts_node_named_child_count_wasm=function(){return(i._ts_node_named_child_count_wasm=i.asm.ts_node_named_child_count_wasm).apply(null,arguments)},i._ts_node_child_wasm=function(){return(i._ts_node_child_wasm=i.asm.ts_node_child_wasm).apply(null,arguments)},i._ts_node_named_child_wasm=function(){return(i._ts_node_named_child_wasm=i.asm.ts_node_named_child_wasm).apply(null,arguments)},i._ts_node_child_by_field_id_wasm=function(){return(i._ts_node_child_by_field_id_wasm=i.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)},i._ts_node_next_sibling_wasm=function(){return(i._ts_node_next_sibling_wasm=i.asm.ts_node_next_sibling_wasm).apply(null,arguments)},i._ts_node_prev_sibling_wasm=function(){return(i._ts_node_prev_sibling_wasm=i.asm.ts_node_prev_sibling_wasm).apply(null,arguments)},i._ts_node_next_named_sibling_wasm=function(){return(i._ts_node_next_named_sibling_wasm=i.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)},i._ts_node_prev_named_sibling_wasm=function(){return(i._ts_node_prev_named_sibling_wasm=i.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)},i._ts_node_parent_wasm=function(){return(i._ts_node_parent_wasm=i.asm.ts_node_parent_wasm).apply(null,arguments)},i._ts_node_descendant_for_index_wasm=function(){return(i._ts_node_descendant_for_index_wasm=i.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_index_wasm=function(){return(i._ts_node_named_descendant_for_index_wasm=i.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)},i._ts_node_descendant_for_position_wasm=function(){return(i._ts_node_descendant_for_position_wasm=i.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_named_descendant_for_position_wasm=function(){return(i._ts_node_named_descendant_for_position_wasm=i.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)},i._ts_node_start_point_wasm=function(){return(i._ts_node_start_point_wasm=i.asm.ts_node_start_point_wasm).apply(null,arguments)},i._ts_node_end_point_wasm=function(){return(i._ts_node_end_point_wasm=i.asm.ts_node_end_point_wasm).apply(null,arguments)},i._ts_node_start_index_wasm=function(){return(i._ts_node_start_index_wasm=i.asm.ts_node_start_index_wasm).apply(null,arguments)},i._ts_node_end_index_wasm=function(){return(i._ts_node_end_index_wasm=i.asm.ts_node_end_index_wasm).apply(null,arguments)},i._ts_node_to_string_wasm=function(){return(i._ts_node_to_string_wasm=i.asm.ts_node_to_string_wasm).apply(null,arguments)},i._ts_node_children_wasm=function(){return(i._ts_node_children_wasm=i.asm.ts_node_children_wasm).apply(null,arguments)},i._ts_node_named_children_wasm=function(){return(i._ts_node_named_children_wasm=i.asm.ts_node_named_children_wasm).apply(null,arguments)},i._ts_node_descendants_of_type_wasm=function(){return(i._ts_node_descendants_of_type_wasm=i.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)},i._ts_node_is_named_wasm=function(){return(i._ts_node_is_named_wasm=i.asm.ts_node_is_named_wasm).apply(null,arguments)},i._ts_node_has_changes_wasm=function(){return(i._ts_node_has_changes_wasm=i.asm.ts_node_has_changes_wasm).apply(null,arguments)},i._ts_node_has_error_wasm=function(){return(i._ts_node_has_error_wasm=i.asm.ts_node_has_error_wasm).apply(null,arguments)},i._ts_node_is_missing_wasm=function(){return(i._ts_node_is_missing_wasm=i.asm.ts_node_is_missing_wasm).apply(null,arguments)},i._ts_query_matches_wasm=function(){return(i._ts_query_matches_wasm=i.asm.ts_query_matches_wasm).apply(null,arguments)},i._ts_query_captures_wasm=function(){return(i._ts_query_captures_wasm=i.asm.ts_query_captures_wasm).apply(null,arguments)},i._iswalpha=function(){return(i._iswalpha=i.asm.iswalpha).apply(null,arguments)},i._iswdigit=function(){return(i._iswdigit=i.asm.iswdigit).apply(null,arguments)},i._iswlower=function(){return(i._iswlower=i.asm.iswlower).apply(null,arguments)},i._towupper=function(){return(i._towupper=i.asm.towupper).apply(null,arguments)},i._memchr=function(){return(i._memchr=i.asm.memchr).apply(null,arguments)},i.___errno_location=function(){return(He=i.___errno_location=i.asm.__errno_location).apply(null,arguments)}),We=(i._strlen=function(){return(i._strlen=i.asm.strlen).apply(null,arguments)},i.stackSave=function(){return(We=i.stackSave=i.asm.stackSave).apply(null,arguments)}),ze=i.stackRestore=function(){return(ze=i.stackRestore=i.asm.stackRestore).apply(null,arguments)},Ke=i.stackAlloc=function(){return(Ke=i.stackAlloc=i.asm.stackAlloc).apply(null,arguments)},Ve=i._setThrew=function(){return(Ve=i._setThrew=i.asm.setThrew).apply(null,arguments)};function Ge(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)},i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return(i.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=i.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)},i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return(i.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=i.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)},i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=function(){return(i.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_=i.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_).apply(null,arguments)},i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=function(){return(i.__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv=i.asm._ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv).apply(null,arguments)},i.__Znwm=function(){return(i.__Znwm=i.asm._Znwm).apply(null,arguments)},i.__ZdlPv=function(){return(i.__ZdlPv=i.asm._ZdlPv).apply(null,arguments)},i._orig$ts_parser_timeout_micros=function(){return(i._orig$ts_parser_timeout_micros=i.asm.orig$ts_parser_timeout_micros).apply(null,arguments)},i._orig$ts_parser_set_timeout_micros=function(){return(i._orig$ts_parser_set_timeout_micros=i.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)},i._TRANSFER_BUFFER=7296,i.___THREW__=7932,i.___threwValue=7936,i.___cxa_new_handler=7928,i.allocate=function(e,t){var n;return n=t==F?Ke(e.length):Ue(e.length),e.subarray||e.slice?D.set(e,n):D.set(new Uint8Array(e),n),n},re=function e(){qe||Xe(),qe||(re=e)};var Je=!1;function Xe(e){function t(){qe||(qe=!0,i.calledRun=!0,R||(ee=!0,_e(Q),_e(Y),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Ye&&function(e){var t=i._main;if(t){var n=(e=e||[]).length+1,r=Ke(4*(n+1));L[r>>2]=K(c);for(var o=1;o>2)+o]=K(e[o-1]);L[(r>>2)+n]=0;try{Qe(t(n,r),!0)}catch(e){if(e instanceof Ge)return;if("unwind"==e)return;var s=e;e&&"object"==typeof e&&e.stack&&(s=[e,e.stack]),y("exception thrown: "+s),l(1,e)}}}(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),Z.unshift(e);var e;_e(Z)}()))}e=e||a,te>0||!Je&&(function(){if(C.length){if(!f)return oe(),void C.reduce((function(e,t){return e.then((function(){return Re(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}))}),Promise.resolve()).then((function(){ie(),Oe()}));C.forEach((function(e){Re(e,{global:!0,nodelete:!0,allowUndefined:!0})})),Oe()}else Oe()}(),Je=!0,te>0)||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),X.unshift(e);var e;_e(X)}(),te>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}function Qe(e,t){t&&be()&&0===e||(be()||(i.onExit&&i.onExit(e),R=!0),l(e,new Ge(e)))}if(i.run=Xe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Ye=!0;i.noInitialRun&&(Ye=!1),Xe();const Ze=i,et={},tt=4,nt=5*tt,rt=2*tt,ot=2*tt+2*rt,it={row:0,column:0},st=/[\w-.]*/g,at=1,ct=2,lt=/^_?tree_sitter_\w+/;var ut,dt,pt,ht,ft,mt=new Promise((e=>{i.onRuntimeInitialized=e})).then((()=>{pt=Ze._ts_init(),ut=I(pt,"i32"),dt=I(pt+tt,"i32")}));class gt{static init(){return mt}constructor(){if(null==pt)throw new Error("You must first call Parser.init() and wait for it to resolve.");Ze._ts_parser_new_wasm(),this[0]=I(pt,"i32"),this[1]=I(pt+tt,"i32")}delete(){Ze._ts_parser_delete(this[0]),Ze._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==bt)throw new Error("Argument must be a Language");{t=e[0];const n=Ze._ts_language_version(t);if(ne.slice(t,r);else{if("function"!=typeof e)throw new Error("Argument must be a string or a function");ht=e}this.logCallback?(ft=this.logCallback,Ze._ts_parser_enable_logger_wasm(this[0],1)):(ft=null,Ze._ts_parser_enable_logger_wasm(this[0],0));let r=0,o=0;if(n&&n.includedRanges){r=n.includedRanges.length;let e=o=Ze._calloc(r,ot);for(let t=0;t0){let e=n;for(let n=0;n0){let n=t;for(let t=0;t0){let n=t;for(let t=0;t0){let e=a;for(let t=0;t>0];if(!n)return t;t+=String.fromCharCode(n)}}(e);return Ze._free(e),t}}class vt{constructor(e,t){Et(e),this.tree=t,It(this)}delete(){Pt(this),Ze._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){St(e),Pt(this,pt+nt),Ze._ts_tree_cursor_reset_wasm(this.tree[0]),It(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return Pt(this),Ze._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return Pt(this),Ze._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return Pt(this),1===Ze._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){Pt(this);const e=Ze._ts_tree_cursor_start_index_wasm(this.tree[0]),t=Ze._ts_tree_cursor_end_index_wasm(this.tree[0]);return xt(this.tree,e,t)}get startPosition(){return Pt(this),Ze._ts_tree_cursor_start_position_wasm(this.tree[0]),Ot(pt)}get endPosition(){return Pt(this),Ze._ts_tree_cursor_end_position_wasm(this.tree[0]),Ot(pt)}get startIndex(){return Pt(this),Ze._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return Pt(this),Ze._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return Pt(this),Ze._ts_tree_cursor_current_node_wasm(this.tree[0]),kt(this.tree)}currentFieldId(){return Pt(this),Ze._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){Pt(this);const e=Ze._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return It(this),1===e}gotoNextSibling(){Pt(this);const e=Ze._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return It(this),1===e}gotoParent(){Pt(this);const e=Ze._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return It(this),1===e}}class bt{constructor(e,t){Et(e),this[0]=t,this.types=new Array(Ze._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e0){if("string"!==o[0].type)throw new Error("Predicates must begin with a literal value");const t=o[0].value;let n=!0;switch(t){case"not-eq?":n=!1;case"eq?":if(3!==o.length)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(o.length-1));if("capture"!==o[1].type)throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${o[1].value}"`);if("capture"===o[2].type){const t=o[1].name,r=o[2].name;h[e].push((function(e){let o,i;for(const n of e)n.name===t&&(o=n.node),n.name===r&&(i=n.node);return o.text===i.text===n}))}else{const t=o[1].name,r=o[2].value;h[e].push((function(e){for(const o of e)if(o.name===t)return o.node.text===r===n;return!1}))}break;case"not-match?":n=!1;case"match?":if(3!==o.length)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${o.length-1}.`);if("capture"!==o[1].type)throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${o[1].value}".`);if("string"!==o[2].type)throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${o[2].value}.`);const r=o[1].name,i=new RegExp(o[2].value);h[e].push((function(e){for(const t of e)if(t.name===r)return i.test(t.node.text)===n;return!1}));break;case"set!":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.".');l[e]||(l[e]={}),l[e][o[1].value]=o[2]?o[2].value:null;break;case"is?":case"is-not?":if(o.length<2||o.length>3)throw new Error(`Wrong number of arguments to \`#${t}\` predicate. Expected 1 or 2. Got ${o.length-1}.`);if(o.some((e=>"string"!==e.type)))throw new Error(`Arguments to \`#${t}\` predicate must be a strings.".`);const s="is?"===t?u:d;s[e]||(s[e]={}),s[e][o[1].value]=o[2]?o[2].value:null;break;default:p[e].push({operator:t,operands:o.slice(1)})}o.length=0}}Object.freeze(l[e]),Object.freeze(u[e]),Object.freeze(d[e])}return Ze._free(n),new wt(et,r,a,h,p,Object.freeze(l),Object.freeze(u),Object.freeze(d))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const r=e;if("undefined"!=typeof process&&process.versions&&process.versions.node){const e=n(747);t=Promise.resolve(e.readFileSync(r))}else t=fetch(r).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const n=new TextDecoder("utf-8").decode(t);throw new Error(`Language.load failed with status ${e.status}.\n\n${n}`)}}))))}const r="function"==typeof loadSideModule?loadSideModule:Pe;return t.then((e=>r(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),n=t.find((e=>lt.test(e)&&!e.includes("external_scanner_")));n||console.log(`Couldn't find language function in WASM file. Symbols:\n${JSON.stringify(t,null,2)}`);const r=e[n]();return new bt(et,r)}))}}class wt{constructor(e,t,n,r,o,i,s,a){Et(e),this[0]=t,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=i,this.assertedProperties=s,this.refutedProperties=a,this.exceededMatchLimit=!1}delete(){Ze._ts_query_delete(this[0]),this[0]=0}matches(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=new Array(r);this.exceededMatchLimit=!!i;let a=0,c=o;for(let t=0;te(o)))){s[a++]={pattern:n,captures:o};const e=this.setProperties[n];e&&(s[t].setProperties=e);const r=this.assertedProperties[n];r&&(s[t].assertedProperties=r);const i=this.refutedProperties[n];i&&(s[t].refutedProperties=i)}}return s.length=a,Ze._free(o),s}captures(e,t,n){t||(t=it),n||(n=it),St(e),Ze._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,n.row,n.column);const r=I(pt,"i32"),o=I(pt+tt,"i32"),i=I(pt+2*tt,"i32"),s=[];this.exceededMatchLimit=!!i;const a=[];let c=o;for(let t=0;te(a)))){const e=a[r],n=this.setProperties[t];n&&(e.setProperties=n);const o=this.assertedProperties[t];o&&(e.assertedProperties=o);const i=this.refutedProperties[t];i&&(e.refutedProperties=i),s.push(e)}}return Ze._free(o),s}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function xt(e,t,n){const r=n-t;let o=e.textCallback(t,null,n);for(t+=o.length;t0))break;t+=r.length,o+=r}return t>n&&(o=o.slice(0,r)),o}function Tt(e,t,n,r){for(let o=0,i=r.length;o{const r=n(747),o=n(622),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=n(7147)},622:e=>{"use strict";e.exports=n(1017)},13:e=>{"use strict";e.exports=n(1267)}},o={},i=function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return r[t].call(i.exports,i,i.exports,e),i.exports}(563),e.exports=i},5037:(e,t,n)=>{const r=n(7147),o=n(1017),i=(e,t)=>Array.from(Array(t).keys()).slice(e),s=e=>e.charCodeAt(0),a=new TextDecoder("utf-8"),c=e=>a.decode(new Uint8Array(e));function l(e){const t=new Set;let n=e[0];for(let r=1;r{h[m[e]]=e}));const e=r.readFileSync(o.resolve(__dirname,"..","dist","vocab.bpe"),"utf-8").split("\n"),t=e.slice(1,e.length-1).map((e=>e.split(/(\s+)/).filter((function(e){return e.trim().length>0}))));f=((e,t)=>{const n={};return e.map(((r,o)=>{n[e[o]]=t[o]})),n})(t,i(0,t.length)),function(e){const t=i(s("!"),s("~")+1).concat(i(s("¡"),s("¬")+1),i(s("®"),s("ÿ")+1));let n=t.slice(),r=0;for(let e=0;e<256;e++)t.includes(e)||(t.push(e),n.push(256+r),r+=1);n=n.map((e=>(e=>String.fromCharCode(e))(e)));for(let r=0;rg.get(e))),n=l(t);var r;if(!n)return t.map((e=>m[e]));for(;;){const e={};Array.from(n).map((t=>{const n=f[t];e[isNaN(n)?1e11:n]=t}));const r=e[Math.min(...Object.keys(e).map((e=>parseInt(e))))];if(!(r in f))break;const o=r[0],i=r[1];let s=[],a=0;for(;am[e])),y.set(e,tokens),tokens}function w(e){v();let t=[];const n=Array.from(e.matchAll(d)).map((e=>e[0]));for(let e of n){const n=b(e);Array.prototype.push.apply(t,n)}return t}function x(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(-n),o=w(r);for(;o.lengthh[e])).join("");return t=c(t.split("").map((e=>_.get(e)))),t}e.exports={prepareTokenizer:v,tokenize:w,tokenize_strings:function(e){return w(e).map((e=>c(h[e].split("").map((e=>_.get(e))))))},tokenLength:function(e){return w(e).length},takeLastTokens:x,takeLastLinesTokens:function(e,t){const n=x(e,t);if(n.length===e.length||"\n"===e[e.length-n.length-1])return n;let r=n.indexOf("\n");return n.substring(r+1)},takeFirstTokens:function(e,t){if(t<=0)return"";let n=Math.min(e.length,4*t),r=e.slice(0,n),o=w(r);for(;o.length{"use strict";e.exports=require("@opentelemetry/tracing")},9166:e=>{"use strict";e.exports=require("applicationinsights-native-metrics")},9491:e=>{"use strict";e.exports=require("assert")},852:e=>{"use strict";e.exports=require("async_hooks")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6206:e=>{"use strict";e.exports=require("console")},2057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5158:e=>{"use strict";e.exports=require("http2")},5687:e=>{"use strict";e.exports=require("https")},8188:e=>{"use strict";e.exports=require("module")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},2781:e=>{"use strict";e.exports=require("stream")},9512:e=>{"use strict";e.exports=require("timers")},4404:e=>{"use strict";e.exports=require("tls")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},9796:e=>{"use strict";e.exports=require("zlib")},3180:e=>{"use strict";e.exports=JSON.parse('{"name":"@adobe/helix-fetch","version":"3.1.1","description":"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2","main":"src/index.js","scripts":{"test":"nyc mocha","lint":"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},"mocha":{"timeout":"5000","recursive":"true","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"engines":{"node":">=12.0"},"types":"src/index.d.ts","exports":{"import":"./src/index.mjs","require":"./src/index.js"},"repository":{"type":"git","url":"https://github.com/adobe/helix-fetch"},"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/adobe/helix-fetch/issues"},"homepage":"https://github.com/adobe/helix-fetch#readme","keywords":["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],"dependencies":{"debug":"4.3.4","http-cache-semantics":"4.1.0","lru-cache":"7.13.1"},"devDependencies":{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2","eslint":"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3","mocha":"10.0.0","mocha-multi-reporters":"1.5.1","nock":"13.2.9","nyc":"15.1.0","parse-cache-control":"1.0.1","pem":"1.14.6","proxy":"^1.0.2","semantic-release":"19.0.3","sinon":"14.0.0","stream-buffers":"3.0.2","tunnel":"^0.0.6"},"lint-staged":{"*.js":"eslint"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"ghooks":{"pre-commit":"npx lint-staged"}}}')},1143:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},3186:e=>{"use strict";e.exports={i8:"1.7.6"}},9674:e=>{"use strict";e.exports={i8:"0.2.0"}},735:e=>{"use strict";e.exports={i8:"1.3.7"}},9876:e=>{"use strict";e.exports=JSON.parse('{"name":"copilot","displayName":"GitHub Copilot","description":"Your AI pair programmer","version":"1.50.0","build":"dev","buildType":"dev","publisher":"GitHub","preview":false,"homepage":"https://github.com/features/copilot","bugs":{"url":"https://github.com/community/community/discussions/categories/copilot"},"qna":"https://github.com/github-community/community/discussions/categories/copilot","icon":"assets/Copilot-App-Icon.png","engines":{"vscode":"^1.68.0","npm":">=7.0.0"},"categories":["Other"],"badges":[{"url":"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange","href":"https://github.com/github-copilot/signup","description":"Sign up for GitHub Copilot"}],"activationEvents":["onStartupFinished"],"main":"./dist/extension","enabledApiProposals":["inlineCompletionsAdditions"],"contributes":{"commands":[{"command":"github.copilot.generate","title":"Open GitHub Copilot"},{"command":"github.copilot.toggleCopilot","title":"GitHub Copilot: Configure Enabled/Disabled"},{"command":"github.copilot.sendFeedback","title":"GitHub Copilot: Send Feedback"}],"keybindings":[{"command":"github.copilot.generate","key":"ctrl+enter","mac":"ctrl+enter","when":"editorTextFocus && github.copilot.activated"},{"command":"editor.action.inlineSuggest.trigger","key":"alt+\\\\","when":"editorTextFocus && !editorHasSelection && config.github.copilot.inlineSuggest.enable && !inlineSuggestionsVisible"}],"menus":{"editor/inlineCompletions/actions":[{"command":"github.copilot.generate","when":"github.copilot.activated"}],"commandPalette":[{"command":"github.copilot.generate","when":"github.copilot.activated"},{"command":"github.copilot.toggleCopilot","when":"github.copilot.activated"},{"command":"github.copilot.sendFeedback","when":"github.copilot.activated"}]},"configuration":[{"title":"Copilot","properties":{"github.copilot.advanced":{"type":"object","title":"Advanced Settings","properties":{"secret_key":{"type":"string","default":"","description":"Secret API key"},"length":{"type":"integer","default":500,"description":"Length of code to generate in tokens"},"temperature":{"type":"string","default":"","description":"Override sampling temperature (range 0.0 - 1.0)"},"top_p":{"type":"number","default":1,"description":"Top probability mass to consider"},"stops":{"type":"object","default":{"*":["\\n\\n\\n"],"python":["\\ndef ","\\nclass ","\\nif ","\\n\\n#"]},"description":"Configure per-language stop sequences"},"indentationMode":{"type":"object","default":{"python":false,"javascript":false,"javascriptreact":false,"jsx":false,"typescript":false,"typescriptreact":false,"go":false,"ruby":false,"*":true},"markdownDescription":"Enable or disable indentation block termination for specified [languages](https://code.visualstudio.com/docs/languages/identifiers). Set to \'clientandserver\' to run both parser-based and indent-based termination."},"inlineSuggestCount":{"type":"integer","default":3,"description":"Number of inline suggestions to fetch"},"listCount":{"type":"integer","default":10,"description":"Number of solutions to list in Open GitHub Copilot"},"debug.showScores":{"type":"boolean","default":false,"description":"Show scores in sorted solutions"},"debug.overrideEngine":{"type":"string","default":"","description":"Override engine name"},"debug.overrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy full URL"},"debug.testOverrideProxyUrl":{"type":"string","default":"","description":"Override GitHub authentication proxy URL when running tests"},"debug.overrideLogLevels":{"type":"object","default":{},"description":"Override what the minimum logged level is per logger (or \'*\' for all loggers). Levels are \'DEBUG\', \'INFO\', \'WARN\', \'ERROR\'. Ex: `{\\"default\\": \\"DEBUG\\"}` to see all things logged to the \'default\' logger."},"debug.filterLogCategories":{"type":"array","default":[],"description":"Show only log categories listed in this setting. If an array is empty, show all loggers"}}},"github.copilot.enable":{"type":"object","default":{"*":true,"yaml":false,"plaintext":false,"markdown":false},"markdownDescription":"Enable or disable Copilot for specified [languages](https://code.visualstudio.com/docs/languages/identifiers)"},"github.copilot.inlineSuggest.enable":{"type":"boolean","default":true,"description":"Show inline suggestions"}}}],"icons":{"copilot-logo":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0041"}},"copilot-warning":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0042"}},"copilot-notconnected":{"description":"GitHub Copilot icon","default":{"fontPath":"assets/copilot.woff","fontCharacter":"\\\\0043"}}},"iconFonts":[{"id":"copilot-font","src":[{"path":"assets/copilot.woff","format":"woff"}]}]},"scripts":{"postinstall":"npx vscode-dts dev && mv vscode.proposed.*.ts extension/src","vscode:prepublish":"npm-run-all build:extension","build":"npm-run-all build:*","build:agent":"cd agent && npm run build","build:agent-no-pkg":"cd agent && npm run build-no-pkg","build:extension":"webpack --mode production","build:lib":"cd lib && npm run build","compile":"npm-run-all compile:*","compile:agent":"cd agent && npm run compile","compile:extension":"webpack --mode development","compile:lib":"cd lib && npm run compile","watch":"npm-run-all -p watch:*","watch:agent":"cd agent && npm run watch","watch:extension":"webpack --mode development --watch","watch:lib":"cd lib && npm run watch","lint":"eslint lib extension agent --ext ts","check_deps":"depcruise -c .dependency-cruiser.js .","test":"npm-run-all test:*","test:agent":"cd agent && npm run test","test:extension":"cd extension && ts-node ./test/runTest.ts","test:prompt":"cd prompt && npm install && npm run test","test:lib":"cd lib && npm run test","test:lsp-client":"cd lsp-client && npm run smokeTest","build_test":"tsc extension/test/run.ts","get_token":"ts-node script/getToken.ts"},"devDependencies":{"@github/prettier-config":"0.0.4","@types/crypto-js":"^4.0.1","@types/mocha":"^5.2.6","@types/node":"^13.11.0","@types/tunnel":"^0.0.3","@types/uuid":"^8.3.1","@types/vscode":"^1.68.0","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","dependency-cruiser":"^9.26.1","eslint":"^7.29.0","eslint-plugin-no-only-tests":"^2.6.0","fantasticon":"^1.2.2","get-port":"^5.1.1","mocha":"^6.1.4","npm-run-all":"^4.1.5","prettier":"2.5.1","prettier-plugin-organize-imports":"^2.3.4","ts-dedent":"^2.2.0","ts-loader":"^8.0.11","ts-node":"^9.0.0","typescript":"^4.4.3","vsce":"1.91.0","vscode-dts":"^0.3.2","vscode-test":"^1.3.0","webpack":"^5.54.0","webpack-cli":"^4.2.0","zlib":"^1.0.5"},"dependencies":{"@adobe/helix-fetch":"github:bmuskalla/helix-fetch#4e33e47bf6e64b637d5d713558fde504bf71c947","@github/copilot-promptlib":"file:prompt","@sinclair/typebox":"^0.23.4","@types/git-url-parse":"^9.0.1","ajv":"^8.6.3","ajv-errors":"^3.0.0","crypto-js":"^4.0.0","git-url-parse":"^13.1.0","open":"^8.4.0","source-map-support":"^0.5.19","tunnel":"^0.0.6","uuid":"^8.3.2","vscode-extension-telemetry":"^0.1.6","vscode-uri":"^3.0.2"}}')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});const t=n(6995),o=n(2879);!async function(){const e=(0,t.init)(),n=(0,o.createWrappedConnection)(e,process.stdin,process.stdout);new o.CopilotService(e,n).listen()}()})(),module.exports=r})(); //# sourceMappingURL=agent.js.map \ No newline at end of file