UNPKG

code-server

Version:

Run VS Code on a remote server.

208 lines 974 kB
"use strict";var o5=Object.create;var Sd=Object.defineProperty;var qE=Object.getOwnPropertyDescriptor;var s5=Object.getOwnPropertyNames;var a5=Object.getPrototypeOf,c5=Object.prototype.hasOwnProperty;var Gn=(r,e)=>()=>(r&&(e=r(r=0)),e);var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),l_=(r,e)=>{for(var t in e)Sd(r,t,{get:e[t],enumerable:!0})},WE=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s5(e))!c5.call(r,i)&&i!==t&&Sd(r,i,{get:()=>e[i],enumerable:!(n=qE(e,i))||n.enumerable});return r};var b=(r,e,t)=>(t=r!=null?o5(a5(r)):{},WE(e||!r||!r.__esModule?Sd(t,"default",{value:r,enumerable:!0}):t,r)),p_=r=>WE(Sd({},"__esModule",{value:!0}),r),S=(r,e,t,n)=>{for(var i=n>1?void 0:n?qE(e,t):e,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(e,t,i):s(i))||i);return n&&i&&Sd(e,t,i),i},g=(r,e)=>(t,n)=>e(t,n,r);var ie=v((xse,GE)=>{"use strict";var d_=Object.defineProperty,u5=Object.getOwnPropertyDescriptor,l5=Object.getOwnPropertyNames,p5=Object.prototype.hasOwnProperty,d5=(r,e)=>{for(var t in e)d_(r,t,{get:e[t],enumerable:!0})},f5=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l5(e))!p5.call(r,i)&&i!==t&&d_(r,i,{get:()=>e[i],enumerable:!(n=u5(e,i))||n.enumerable});return r},h5=r=>f5(d_({},"__esModule",{value:!0}),r),$E={};d5($E,{config:()=>v5,t:()=>HE});GE.exports=h5($E);var m5=require("fs"),g5=require("fs/promises");async function y5(r){if(r.protocol==="file:")return await(0,g5.readFile)(r,"utf8");if(r.protocol==="http:"||r.protocol==="https:"){let e=await fetch(r.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${r}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}function b5(r){return(0,m5.readFileSync)(r,"utf8")}var _d;function v5(r){if("contents"in r){typeof r.contents=="string"?_d=JSON.parse(r.contents):_d=r.contents;return}if("fsPath"in r){let e=b5(r.fsPath),t=JSON.parse(e);_d=VE(t)?t.contents.bundle:t;return}if(r.uri){let e=r.uri;return typeof r.uri=="string"&&(e=new URL(r.uri)),new Promise((t,n)=>{y5(e).then(i=>{try{let o=JSON.parse(i);_d=VE(o)?o.contents.bundle:o,t()}catch(o){n(o)}}).catch(i=>{n(i)})})}}function HE(...r){let e=r[0],t,n,i;if(typeof e=="string")t=e,n=e,r.splice(0,1),i=!r||typeof r[0]!="object"?r:r[0];else if(e instanceof Array){let s=r.slice(1);if(e.length!==s.length+1)throw new Error("expected a string as the first argument to l10n.t");let a=e[0];for(let c=1;c<e.length;c++)a+=`{${c-1}}`+e[c];return HE(a,...s)}else n=e.message,t=n,e.comment&&e.comment.length>0&&(t+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),i=e.args??{};let o=_d?.[t];return o?typeof o=="string"?om(o,i):o.comment?om(o.message,i):om(n,i):om(n,i)}var w5=/{([^}]+)}/g;function om(r,e){return Object.keys(e).length===0?r:r.replace(w5,(t,n)=>e[n]??t)}function VE(r){return typeof r?.contents?.bundle=="object"&&typeof r?.version=="string"}});var vo=v(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.findWindowsCandidates=nr.sort=nr.preferredEdgePath=nr.preferredFirefoxPath=nr.preferredChromePath=nr.escapeRegexSpecialChars=nr.canAccess=void 0;var A5=require("path");async function Ed({access:r},e){if(!e)return!1;try{return await r(e),!0}catch{return!1}}nr.canAccess=Ed;var D5="/\\.?*()^${}|[]+";function O5(r,e){let t=D5.split("").filter(i=>!e||e.indexOf(i)<0).join("").replace(/[\\\]]/g,"\\$&"),n=new RegExp(`[${t}]`,"g");return r.replace(n,"\\$&")}nr.escapeRegexSpecialChars=O5;async function L5(r,e){if(await Ed(r,e.CHROME_PATH))return e.CHROME_PATH}nr.preferredChromePath=L5;async function M5(r,e){if(await Ed(r,e.FIREFOX_PATH))return e.FIREFOX_PATH}nr.preferredFirefoxPath=M5;async function N5(r,e){if(await Ed(r,e.EDGE_PATH))return e.EDGE_PATH}nr.preferredEdgePath=N5;function F5(r,e){return[...r].filter(n=>!!n).map(n=>{let i=e.find(o=>o.regex.test(n));return i?{path:n,weight:i.weight,quality:i.quality}:{path:n,weight:10,quality:"dev"}}).sort((n,i)=>i.weight-n.weight).map(n=>({path:n.path,quality:n.quality}))}nr.sort=F5;async function B5(r,e,t){let n=[r.LOCALAPPDATA,r.PROGRAMFILES,r["PROGRAMFILES(X86)"]].filter(o=>!!o),i=[];for(let o of n)for(let s of t){let a=A5.win32.join(o,s.name);i.push(Ed(e,a).then(c=>c?{path:a,quality:s.type}:void 0))}return(await Promise.all(i)).filter(o=>!!o)}nr.findWindowsCandidates=B5});var bm=v(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.DarwinFinderBase=void 0;var j5=require("path"),U5=require("fs"),C_=vo(),ik=/( \(0x[a-f0-9]+\))/,T_=class{constructor(e=process.env,t=U5.promises,n=n){this.env=e,this.fs=t,this.execa=n,this.lsRegisterCommand="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump",this.wellKnownPaths=[]}async findWhere(e){for(let t of this.wellKnownPaths)if(e(t)&&await(0,C_.canAccess)(this.fs,t.path))return t;return(await this.findAll()).find(e)}findAll(){var e;return(e=this.foundAll)!==null&&e!==void 0||(this.foundAll=this.findAllInner()),this.foundAll}async findLaunchRegisteredApps(e,t,n){let{stdout:i}=await this.execa.command(`${this.lsRegisterCommand} | awk 'tolower($0) ~ /${e.toLowerCase()}${ik.source}?$/ { $1=""; print $0 }'`,{shell:!0,stdio:"pipe"}),o=[...t,...i.split(`
`).map(c=>c.trim().replace(ik,""))].filter(c=>!!c),s=this.getPreferredPath();s&&o.push(s);let a=new Set;for(let c of o)for(let u of n){let l=j5.posix.join(c.trim(),u);try{await this.fs.access(l),a.add(l)}catch{}}return a}createPriorities(e){let t=this.env.HOME&&(0,C_.escapeRegexSpecialChars)(this.env.HOME),n=this.getPreferredPath(),i=e.reduce((o,s)=>[...o,{regex:new RegExp(`^/Applications/.*${s.name}`),weight:s.weight+100,quality:s.quality},{regex:new RegExp(`^${t}/Applications/.*${s.name}`),weight:s.weight,quality:s.quality},{regex:new RegExp(`^/Volumes/.*${s.name}`),weight:s.weight-100,quality:s.quality}],[]);return n&&i.unshift({regex:new RegExp((0,C_.escapeRegexSpecialChars)(n)),weight:151,quality:"custom"}),i}};ym.DarwinFinderBase=T_});var ok=v(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.DarwinChromeBrowserFinder=void 0;var q5=vo(),W5=bm(),P_=class extends W5.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",quality:"stable"},{path:"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",quality:"canary"},{path:"/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta",quality:"beta"},{path:"/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Google Chrome Canary","/Contents/MacOS/Google Chrome Beta","/Contents/MacOS/Google Chrome Dev","/Contents/MacOS/Google Chrome"],t=["/Applications/Google Chrome.app","/Applications/Google Chrome Canary.app"],n=await this.findLaunchRegisteredApps("google chrome[A-Za-z() ]*.app",t,e);return(0,q5.sort)(n,this.createPriorities([{name:"Chrome.app",weight:0,quality:"stable"},{name:"Chrome Canary.app",weight:1,quality:"canary"},{name:"Chrome Beta.app",weight:2,quality:"beta"},{name:"Chrome Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.CHROME_PATH}};vm.DarwinChromeBrowserFinder=P_});var sk=v(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.DarwinEdgeBrowserFinder=void 0;var V5=vo(),$5=bm(),E_=class extends $5.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",quality:"stable"},{path:"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary",quality:"canary"},{path:"/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta",quality:"beta"},{path:"/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Microsoft Edge Canary","/Contents/MacOS/Microsoft Edge Beta","/Contents/MacOS/Microsoft Edge Dev","/Contents/MacOS/Microsoft Edge"],t=["/Applications/Microsoft Edge.app"],n=await this.findLaunchRegisteredApps("Microsoft Edge[A-Za-z ]*.app",t,e);return(0,V5.sort)(n,this.createPriorities([{name:"Microsoft Edge.app",weight:0,quality:"stable"},{name:"Microsoft Edge Canary.app",weight:1,quality:"canary"},{name:"Microsoft Edge Beta.app",weight:2,quality:"beta"},{name:"Microsoft Edge Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.EDGE_PATH}};wm.DarwinEdgeBrowserFinder=E_});var ak=v(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.DarwinFirefoxBrowserFinder=void 0;var H5=vo(),G5=bm(),k_=class extends G5.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Firefox.app/Contents/MacOS/firefox",quality:"stable"},{path:"/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox",quality:"dev"},{path:"/Applications/Firefox Nightly.app/Contents/MacOS/firefox",quality:"canary"}]}async findAllInner(){let e=["/Contents/MacOS/firefox"],t=["/Applications/Firefox.app"],n=await this.findLaunchRegisteredApps("Firefox[A-Za-z ]*.app",t,e);return(0,H5.sort)(n,this.createPriorities([{name:"Firefox.app",weight:0,quality:"stable"},{name:"Firefox Nightly.app",weight:1,quality:"canary"},{name:"Firefox Developer Edition.app",weight:2,quality:"dev"}]))}getPreferredPath(){return this.env.FIREFOX_PATH}};Sm.DarwinFirefoxBrowserFinder=k_});var Im=v(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.LinuxChromeBrowserFinder=void 0;var z5=require("path"),ru=vo(),R_=require("child_process"),K5=require("os"),J5=require("fs"),ck=/\r?\n/,A_=class{constructor(e=process.env,t=J5.promises){this.env=e,this.fs=t,this.pathEnvironmentVar="CHROME_PATH",this.priorities=[{regex:/chrome-wrapper$/,weight:54,quality:"custom"},{regex:/google-chrome-dev$/,weight:53,quality:"dev"},{regex:/google-chrome-canary$/,weight:52,quality:"canary"},{regex:/google-chrome-unstable$/,weight:51,quality:"canary"},{regex:/google-chrome-canary$/,weight:51,quality:"canary"},{regex:/google-chrome-stable$/,weight:50,quality:"stable"},{regex:/(google-)?chrome$/,weight:49,quality:"stable"},{regex:/chromium-browser$/,weight:48,quality:"custom"},{regex:/chromium$/,weight:47,quality:"custom"}],this.executablesOnPath=["google-chrome-unstable","google-chrome-dev","google-chrome-beta","google-chrome-canary","google-chrome-stable","google-chrome","chromium-browser","chromium"]}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=new Set,t=this.env[this.pathEnvironmentVar];t&&await(0,ru.canAccess)(this.fs,t)&&e.add(t),[z5.posix.join((0,K5.homedir)(),".local/share/applications/"),"/usr/share/applications/","/usr/bin","/opt/google"].forEach(s=>{for(let a in this.findChromeExecutables(s))e.add(a)}),await Promise.all(this.executablesOnPath.map(async s=>{try{let a=(0,R_.execFileSync)("which",[s],{stdio:"pipe"}).toString().split(ck)[0];await(0,ru.canAccess)(this.fs,a)&&e.add(a)}catch{}}));let o=t?[{regex:new RegExp((0,ru.escapeRegexSpecialChars)(t)),weight:101,quality:"custom"}].concat(this.priorities):this.priorities;return(0,ru.sort)(e,o)}async findChromeExecutables(e){let t=/(^[^ ]+).*/,n=`^Exec=/.*/(${this.executablesOnPath.join("|")})-.*`,i=[];if(await(0,ru.canAccess)(this.fs,e)){let o;try{o=(0,R_.execSync)(`grep -ERI "${n}" ${e} | awk -F '=' '{print $2}'`)}catch{o=(0,R_.execSync)(`grep -Er "${n}" ${e} | awk -F '=' '{print $2}'`)}let s=o.toString().split(ck).map(a=>a.replace(t,"$1"));await Promise.all(s.map(async a=>{await(0,ru.canAccess)(this.fs,a)&&i.push(a)}))}return i}};_m.LinuxChromeBrowserFinder=A_});var uk=v(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.LinuxEdgeBrowserFinder=void 0;var Y5=Im(),D_=class extends Y5.LinuxChromeBrowserFinder{constructor(){super(...arguments),this.pathEnvironmentVar="EDGE_PATH",this.executablesOnPath=["microsoft-edge-dev","microsoft-edge-beta","microsoft-edge-stable","microsoft-edge"],this.priorities=[{regex:/microsoft-edge\-wrapper$/,weight:52,quality:"custom"},{regex:/microsoft-edge\-dev$/,weight:51,quality:"dev"},{regex:/microsoft-edge\-beta$/,weight:51,quality:"beta"},{regex:/microsoft-edge\-stable$/,weight:50,quality:"stable"},{regex:/microsoft-edge$/,weight:49,quality:"stable"}]}};xm.LinuxEdgeBrowserFinder=D_});var lk=v(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.LinuxFirefoxBrowserFinder=void 0;var X5=Im(),O_=class extends X5.LinuxChromeBrowserFinder{constructor(){super(...arguments),this.pathEnvironmentVar="FIREFOX_PATH",this.executablesOnPath=["firefox-aurora","firefox-dev","firefox-developer","firefox-trunk","firefox-nightly","firefox"],this.priorities=[{regex:/firefox\-aurora$/,weight:51,quality:"dev"},{regex:/firefox\-dev$/,weight:51,quality:"dev"},{regex:/firefox\-developer$/,weight:51,quality:"dev"},{regex:/firefox\-trunk'$/,weight:50,quality:"canary"},{regex:/firefox\-nightly'$/,weight:50,quality:"canary"},{regex:/firefox$/,weight:49,quality:"stable"}]}};Cm.LinuxFirefoxBrowserFinder=O_});var dk=v(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.WindowsChromeBrowserFinder=void 0;var Q5=require("path"),pk=vo(),Z5=require("fs"),L_=class{constructor(e=process.env,t=Z5.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=Q5.win32.sep,t=[{name:`${e}Google${e}Chrome Dev${e}Application${e}chrome.exe`,type:"dev"},{name:`${e}Google${e}Chrome SxS${e}Application${e}chrome.exe`,type:"canary"},{name:`${e}Google${e}Chrome Beta${e}Application${e}chrome.exe`,type:"beta"},{name:`${e}Google${e}Chrome${e}Application${e}chrome.exe`,type:"stable"}],n=await(0,pk.findWindowsCandidates)(this.env,this.fs,t),i=await(0,pk.preferredChromePath)(this.fs,this.env);return i&&n.unshift({path:i,quality:"custom"}),n}};Tm.WindowsChromeBrowserFinder=L_});var hk=v(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.WindowsEdgeBrowserFinder=void 0;var ir=require("path"),e3=require("fs"),fk=vo(),M_=class{constructor(e=process.env,t=e3.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=[{name:`${ir.sep}Microsoft${ir.sep}Edge SxS${ir.sep}Application${ir.sep}msedge.exe`,type:"canary"},{name:`${ir.sep}Microsoft${ir.sep}Edge Dev${ir.sep}Application${ir.sep}msedge.exe`,type:"dev"},{name:`${ir.sep}Microsoft${ir.sep}Edge Beta${ir.sep}Application${ir.sep}msedge.exe`,type:"beta"},{name:`${ir.sep}Microsoft${ir.sep}Edge${ir.sep}Application${ir.sep}msedge.exe`,type:"stable"}],t=await(0,fk.findWindowsCandidates)(this.env,this.fs,e),n=await(0,fk.preferredEdgePath)(this.fs,this.env);return n&&t.unshift({path:n,quality:"custom"}),t}};Pm.WindowsEdgeBrowserFinder=M_});var gk=v(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.WindowsFirefoxBrowserFinder=void 0;var t3=require("path"),mk=vo(),r3=require("fs"),N_=class{constructor(e=process.env,t=r3.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=t3.win32.sep,t=[{name:`${e}Firefox Developer Edition${e}firefox.exe`,type:"dev"},{name:`${e}Firefox Nightly${e}firefox.exe`,type:"canary"},{name:`${e}Mozilla Firefox${e}firefox.exe`,type:"stable"}],n=await(0,mk.findWindowsCandidates)(this.env,this.fs,t),i=await(0,mk.preferredFirefoxPath)(this.fs,this.env);return i&&n.unshift({path:i,quality:"custom"}),n}};Em.WindowsFirefoxBrowserFinder=N_});var F_=v(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.FirefoxBrowserFinder=zr.EdgeBrowserFinder=zr.ChromeBrowserFinder=zr.isQuality=zr.allQualities=void 0;var n3=ok(),i3=sk(),o3=ak(),s3=Im(),a3=uk(),c3=lk(),u3=dk(),l3=hk(),p3=gk(),d3={canary:null,stable:null,beta:null,dev:null,custom:null};zr.allQualities=new Set(Object.keys(d3));var f3=r=>zr.allQualities.has(r);zr.isQuality=f3;zr.ChromeBrowserFinder=process.platform==="win32"?u3.WindowsChromeBrowserFinder:process.platform==="darwin"?n3.DarwinChromeBrowserFinder:s3.LinuxChromeBrowserFinder;zr.EdgeBrowserFinder=process.platform==="win32"?l3.WindowsEdgeBrowserFinder:process.platform==="darwin"?i3.DarwinEdgeBrowserFinder:a3.LinuxEdgeBrowserFinder;zr.FirefoxBrowserFinder=process.platform==="win32"?p3.WindowsFirefoxBrowserFinder:process.platform==="darwin"?o3.DarwinFirefoxBrowserFinder:c3.LinuxFirefoxBrowserFinder});var Sk=v((Hse,wk)=>{wk.exports=vk;vk.sync=m3;var yk=require("fs");function h3(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var i=t[n].toLowerCase();if(i&&r.substr(-i.length).toLowerCase()===i)return!0}return!1}function bk(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:h3(e,t)}function vk(r,e,t){yk.stat(r,function(n,i){t(n,n?!1:bk(i,r,e))})}function m3(r,e){return bk(yk.statSync(r),r,e)}});var Tk=v((Gse,Ck)=>{Ck.exports=Ik;Ik.sync=g3;var _k=require("fs");function Ik(r,e,t){_k.stat(r,function(n,i){t(n,n?!1:xk(i,e))})}function g3(r,e){return xk(_k.statSync(r),e)}function xk(r,e){return r.isFile()&&y3(r,e)}function y3(r,e){var t=r.mode,n=r.uid,i=r.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,p=t&u||t&c&&i===s||t&a&&n===o||t&l&&o===0;return p}});var Ek=v((Kse,Pk)=>{var zse=require("fs"),km;process.platform==="win32"||global.TESTING_WINDOWS?km=Sk():km=Tk();Pk.exports=B_;B_.sync=b3;function B_(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){B_(r,e||{},function(o,s){o?i(o):n(s)})})}km(r,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),t(n,i)})}function b3(r,e){try{return km.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Mk=v((Jse,Lk)=>{var nu=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",kk=require("path"),v3=nu?";":":",Rk=Ek(),Ak=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Dk=(r,e)=>{let t=e.colon||v3,n=r.match(/\//)||nu&&r.match(/\\/)?[""]:[...nu?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],i=nu?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=nu?i.split(t):[""];return nu&&r.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},Ok=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Dk(r,e),s=[],a=u=>new Promise((l,p)=>{if(u===n.length)return e.all&&s.length?l(s):p(Ak(r));let d=n[u],f=/^".*"$/.test(d)?d.slice(1,-1):d,h=kk.join(f,r),m=!f&&/^\.[\\\/]/.test(r)?r.slice(0,2)+h:h;l(c(m,u,0))}),c=(u,l,p)=>new Promise((d,f)=>{if(p===i.length)return d(a(l+1));let h=i[p];Rk(u+h,{pathExt:o},(m,y)=>{if(!m&&y)if(e.all)s.push(u+h);else return d(u+h);return d(c(u,l,p+1))})});return t?a(0).then(u=>t(null,u),t):a(0)},w3=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:i}=Dk(r,e),o=[];for(let s=0;s<t.length;s++){let a=t[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=kk.join(c,r),l=!c&&/^\.[\\\/]/.test(r)?r.slice(0,2)+u:u;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(Rk.sync(d,{pathExt:i}))if(e.all)o.push(d);else return d}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw Ak(r)};Lk.exports=Ok;Ok.sync=w3});var U_=v((Yse,j_)=>{"use strict";var Nk=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};j_.exports=Nk;j_.exports.default=Nk});var Uk=v((Xse,jk)=>{"use strict";var Fk=require("path"),S3=Mk(),_3=U_();function Bk(r,e){let t=r.options.env||process.env,n=process.cwd(),i=r.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(r.options.cwd)}catch{}let s;try{s=S3.sync(r.command,{path:t[_3({env:t})],pathExt:e?Fk.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=Fk.resolve(i?r.options.cwd:"",s)),s}function I3(r){return Bk(r)||Bk(r,!0)}jk.exports=I3});var qk=v((Qse,W_)=>{"use strict";var q_=/([()\][%!^"`<>&|;, *?])/g;function x3(r){return r=r.replace(q_,"^$1"),r}function C3(r,e){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(q_,"^$1"),e&&(r=r.replace(q_,"^$1")),r}W_.exports.command=x3;W_.exports.argument=C3});var Vk=v((Zse,Wk)=>{"use strict";Wk.exports=/^#!(.*)/});var Hk=v((eae,$k)=>{"use strict";var T3=Vk();$k.exports=(r="")=>{let e=r.match(T3);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),i=t.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var zk=v((tae,Gk)=>{"use strict";var V_=require("fs"),P3=Hk();function E3(r){let t=Buffer.alloc(150),n;try{n=V_.openSync(r,"r"),V_.readSync(n,t,0,150,0),V_.closeSync(n)}catch{}return P3(t.toString())}Gk.exports=E3});var Xk=v((rae,Yk)=>{"use strict";var k3=require("path"),Kk=Uk(),Jk=qk(),R3=zk(),A3=process.platform==="win32",D3=/\.(?:com|exe)$/i,O3=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function L3(r){r.file=Kk(r);let e=r.file&&R3(r.file);return e?(r.args.unshift(r.file),r.command=e,Kk(r)):r.file}function M3(r){if(!A3)return r;let e=L3(r),t=!D3.test(e);if(r.options.forceShell||t){let n=O3.test(e);r.command=k3.normalize(r.command),r.command=Jk.command(r.command),r.args=r.args.map(o=>Jk.argument(o,n));let i=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${i}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function N3(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:M3(n)}Yk.exports=N3});var eR=v((nae,Zk)=>{"use strict";var $_=process.platform==="win32";function H_(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function F3(r,e){if(!$_)return;let t=r.emit;r.emit=function(n,i){if(n==="exit"){let o=Qk(i,e);if(o)return t.call(r,"error",o)}return t.apply(r,arguments)}}function Qk(r,e){return $_&&r===1&&!e.file?H_(e.original,"spawn"):null}function B3(r,e){return $_&&r===1&&!e.file?H_(e.original,"spawnSync"):null}Zk.exports={hookChildProcess:F3,verifyENOENT:Qk,verifyENOENTSync:B3,notFoundError:H_}});var nR=v((iae,iu)=>{"use strict";var tR=require("child_process"),G_=Xk(),z_=eR();function rR(r,e,t){let n=G_(r,e,t),i=tR.spawn(n.command,n.args,n.options);return z_.hookChildProcess(i,n),i}function j3(r,e,t){let n=G_(r,e,t),i=tR.spawnSync(n.command,n.args,n.options);return i.error=i.error||z_.verifyENOENTSync(i.status,n),i}iu.exports=rR;iu.exports.spawn=rR;iu.exports.sync=j3;iu.exports._parse=G_;iu.exports._enoent=z_});var oR=v((oae,iR)=>{"use strict";iR.exports=r=>{let e=typeof r=="string"?`
`:10,t=typeof r=="string"?"\r":13;return r[r.length-1]===e&&(r=r.slice(0,r.length-1)),r[r.length-1]===t&&(r=r.slice(0,r.length-1)),r}});var cR=v((sae,Rd)=>{"use strict";var kd=require("path"),sR=U_(),aR=r=>{r={cwd:process.cwd(),path:process.env[sR()],execPath:process.execPath,...r};let e,t=kd.resolve(r.cwd),n=[];for(;e!==t;)n.push(kd.join(t,"node_modules/.bin")),e=t,t=kd.resolve(t,"..");let i=kd.resolve(r.cwd,r.execPath,"..");return n.push(i),n.concat(r.path).join(kd.delimiter)};Rd.exports=aR;Rd.exports.default=aR;Rd.exports.env=r=>{r={env:process.env,...r};let e={...r.env},t=sR({env:e});return r.path=e[t],e[t]=Rd.exports(r),e}});var lR=v((aae,K_)=>{"use strict";var uR=(r,e)=>{for(let t of Reflect.ownKeys(e))Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t));return r};K_.exports=uR;K_.exports.default=uR});var dR=v((cae,Am)=>{"use strict";var U3=lR(),Rm=new WeakMap,pR=(r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",o=function(...s){if(Rm.set(o,++n),n===1)t=r.apply(this,s),r=null;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t};return U3(o,r),Rm.set(o,n),o};Am.exports=pR;Am.exports.default=pR;Am.exports.callCount=r=>{if(!Rm.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return Rm.get(r)}});var fR=v(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.SIGNALS=void 0;var q3=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Dm.SIGNALS=q3});var J_=v(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.SIGRTMAX=ou.getRealtimeSignals=void 0;var W3=function(){let r=mR-hR+1;return Array.from({length:r},V3)};ou.getRealtimeSignals=W3;var V3=function(r,e){return{name:`SIGRT${e+1}`,number:hR+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},hR=34,mR=64;ou.SIGRTMAX=mR});var gR=v(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.getSignals=void 0;var $3=require("os"),H3=fR(),G3=J_(),z3=function(){let r=(0,G3.getRealtimeSignals)();return[...H3.SIGNALS,...r].map(K3)};Om.getSignals=z3;var K3=function({name:r,number:e,description:t,action:n,forced:i=!1,standard:o}){let{signals:{[r]:s}}=$3.constants,a=s!==void 0;return{name:r,number:a?s:e,description:t,supported:a,action:n,forced:i,standard:o}}});var bR=v(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.signalsByNumber=su.signalsByName=void 0;var J3=require("os"),yR=gR(),Y3=J_(),X3=function(){return(0,yR.getSignals)().reduce(Q3,{})},Q3=function(r,{name:e,number:t,description:n,supported:i,action:o,forced:s,standard:a}){return{...r,[e]:{name:e,number:t,description:n,supported:i,action:o,forced:s,standard:a}}},Z3=X3();su.signalsByName=Z3;var e4=function(){let r=(0,yR.getSignals)(),e=Y3.SIGRTMAX+1,t=Array.from({length:e},(n,i)=>t4(i,r));return Object.assign({},...t)},t4=function(r,e){let t=r4(r,e);if(t===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=t;return{[r]:{name:n,number:r,description:i,supported:o,action:s,forced:a,standard:c}}},r4=function(r,e){let t=e.find(({name:n})=>J3.constants.signals[n]===r);return t!==void 0?t:e.find(n=>n.number===r)},n4=e4();su.signalsByNumber=n4});var wR=v((fae,vR)=>{"use strict";var{signalsByName:i4}=bR(),o4=({timedOut:r,timeout:e,errorCode:t,signal:n,signalDescription:i,exitCode:o,isCanceled:s})=>r?`timed out after ${e} milliseconds`:s?"was canceled":t!==void 0?`failed with ${t}`:n!==void 0?`was killed with ${n} (${i})`:o!==void 0?`failed with exit code ${o}`:"failed",s4=({stdout:r,stderr:e,all:t,error:n,signal:i,exitCode:o,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:l,parsed:{options:{timeout:p}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let d=i===void 0?void 0:i4[i].description,f=n&&n.code,m=`Command ${o4({timedOut:c,timeout:p,errorCode:f,signal:i,signalDescription:d,exitCode:o,isCanceled:u})}: ${s}`,y=Object.prototype.toString.call(n)==="[object Error]",I=y?`${m}
${n.message}`:m,L=[I,e,r].filter(Boolean).join(`
`);return y?(n.originalMessage=n.message,n.message=L):n=new Error(L),n.shortMessage=I,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=r,n.stderr=e,t!==void 0&&(n.all=t),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=u,n.killed=l&&!c,n};vR.exports=s4});var _R=v((hae,Y_)=>{"use strict";var Lm=["stdin","stdout","stderr"],a4=r=>Lm.some(e=>r[e]!==void 0),SR=r=>{if(!r)return;let{stdio:e}=r;if(e===void 0)return Lm.map(n=>r[n]);if(a4(r))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Lm.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let t=Math.max(e.length,Lm.length);return Array.from({length:t},(n,i)=>e[i])};Y_.exports=SR;Y_.exports.node=r=>{let e=SR(r);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var IR=v((mae,Mm)=>{Mm.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Mm.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Mm.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var TR=v((gae,Od)=>{var c4=require("assert"),Ad=IR(),u4=/^win/i.test(process.platform),Nm=require("events");typeof Nm!="function"&&(Nm=Nm.EventEmitter);var Xt;process.__signal_exit_emitter__?Xt=process.__signal_exit_emitter__:(Xt=process.__signal_exit_emitter__=new Nm,Xt.count=0,Xt.emitted={});Xt.infinite||(Xt.setMaxListeners(1/0),Xt.infinite=!0);Od.exports=function(r,e){c4.equal(typeof r,"function","a callback must be provided for exit handler"),Dd===!1&&xR();var t="exit";e&&e.alwaysLast&&(t="afterexit");var n=function(){Xt.removeListener(t,r),Xt.listeners("exit").length===0&&Xt.listeners("afterexit").length===0&&Q_()};return Xt.on(t,r),n};Od.exports.unload=Q_;function Q_(){Dd&&(Dd=!1,Ad.forEach(function(r){try{process.removeListener(r,Z_[r])}catch{}}),process.emit=X_,process.reallyExit=CR,Xt.count-=1)}function au(r,e,t){Xt.emitted[r]||(Xt.emitted[r]=!0,Xt.emit(r,e,t))}var Z_={};Ad.forEach(function(r){Z_[r]=function(){var t=process.listeners(r);t.length===Xt.count&&(Q_(),au("exit",null,r),au("afterexit",null,r),u4&&r==="SIGHUP"&&(r="SIGINT"),process.kill(process.pid,r))}});Od.exports.signals=function(){return Ad};Od.exports.load=xR;var Dd=!1;function xR(){Dd||(Dd=!0,Xt.count+=1,Ad=Ad.filter(function(r){try{return process.on(r,Z_[r]),!0}catch{return!1}}),process.emit=p4,process.reallyExit=l4)}var CR=process.reallyExit;function l4(r){process.exitCode=r||0,au("exit",process.exitCode,null),au("afterexit",process.exitCode,null),CR.call(process,process.exitCode)}var X_=process.emit;function p4(r,e){if(r==="exit"){e!==void 0&&(process.exitCode=e);var t=X_.apply(this,arguments);return au("exit",process.exitCode,null),au("afterexit",process.exitCode,null),t}else return X_.apply(this,arguments)}});var ER=v((yae,PR)=>{"use strict";var d4=require("os"),f4=TR(),h4=1e3*5,m4=(r,e="SIGTERM",t={})=>{let n=r(e);return g4(r,e,t,n),n},g4=(r,e,t,n)=>{if(!y4(e,t,n))return;let i=v4(t),o=setTimeout(()=>{r("SIGKILL")},i);o.unref&&o.unref()},y4=(r,{forceKillAfterTimeout:e},t)=>b4(r)&&e!==!1&&t,b4=r=>r===d4.constants.signals.SIGTERM||typeof r=="string"&&r.toUpperCase()==="SIGTERM",v4=({forceKillAfterTimeout:r=!0})=>{if(r===!0)return h4;if(!Number.isFinite(r)||r<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`);return r},w4=(r,e)=>{r.kill()&&(e.isCanceled=!0)},S4=(r,e,t)=>{r.kill(e),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},_4=(r,{timeout:e,killSignal:t="SIGTERM"},n)=>{if(e===0||e===void 0)return n;let i,o=new Promise((a,c)=>{i=setTimeout(()=>{S4(r,t,c)},e)}),s=n.finally(()=>{clearTimeout(i)});return Promise.race([o,s])},I4=({timeout:r})=>{if(r!==void 0&&(!Number.isFinite(r)||r<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`)},x4=async(r,{cleanup:e,detached:t},n)=>{if(!e||t)return n;let i=f4(()=>{r.kill()});return n.finally(()=>{i()})};PR.exports={spawnedKill:m4,spawnedCancel:w4,setupTimeout:_4,validateTimeout:I4,setExitHandler:x4}});var RR=v((bae,kR)=>{"use strict";var fi=r=>r!==null&&typeof r=="object"&&typeof r.pipe=="function";fi.writable=r=>fi(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object";fi.readable=r=>fi(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object";fi.duplex=r=>fi.writable(r)&&fi.readable(r);fi.transform=r=>fi.duplex(r)&&typeof r._transform=="function"&&typeof r._transformState=="object";kR.exports=fi});var DR=v((vae,AR)=>{"use strict";var{PassThrough:C4}=require("stream");AR.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",i=!1;e?i=!(t||n):t=t||"utf8",n&&(t=null);let o=new C4({objectMode:i});t&&o.setEncoding(t);let s=0,a=[];return o.on("data",c=>{a.push(c),i?s=a.length:s+=c.length}),o.getBufferedValue=()=>e?a:n?Buffer.concat(a,s):a.join(""),o.getBufferedLength=()=>s,o}});var OR=v((wae,Ld)=>{"use strict";var{constants:T4}=require("buffer"),P4=require("stream"),{promisify:E4}=require("util"),k4=DR(),R4=E4(P4.pipeline),Fm=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function eI(r,e){if(!r)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n=k4(e);return await new Promise((i,o)=>{let s=a=>{a&&n.getBufferedLength()<=T4.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),o(a)};(async()=>{try{await R4(r,n),i()}catch(a){s(a)}})(),n.on("data",()=>{n.getBufferedLength()>t&&s(new Fm)})}),n.getBufferedValue()}Ld.exports=eI;Ld.exports.buffer=(r,e)=>eI(r,{...e,encoding:"buffer"});Ld.exports.array=(r,e)=>eI(r,{...e,array:!0});Ld.exports.MaxBufferError=Fm});var MR=v((Sae,LR)=>{"use strict";var{PassThrough:A4}=require("stream");LR.exports=function(){var r=[],e=new A4({objectMode:!0});return e.setMaxListeners(0),e.add=t,e.isEmpty=n,e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(t),e;function t(o){return Array.isArray(o)?(o.forEach(t),this):(r.push(o),o.once("end",i.bind(null,o)),o.once("error",e.emit.bind(e,"error")),o.pipe(e,{end:!1}),this)}function n(){return r.length==0}function i(o){r=r.filter(function(s){return s!==o}),!r.length&&e.readable&&e.end()}}});var jR=v((_ae,BR)=>{"use strict";var FR=RR(),NR=OR(),D4=MR(),O4=(r,e)=>{e===void 0||r.stdin===void 0||(FR(e)?e.pipe(r.stdin):r.stdin.end(e))},L4=(r,{all:e})=>{if(!e||!r.stdout&&!r.stderr)return;let t=D4();return r.stdout&&t.add(r.stdout),r.stderr&&t.add(r.stderr),t},tI=async(r,e)=>{if(r){r.destroy();try{return await e}catch(t){return t.bufferedData}}},rI=(r,{encoding:e,buffer:t,maxBuffer:n})=>{if(!(!r||!t))return e?NR(r,{encoding:e,maxBuffer:n}):NR.buffer(r,{maxBuffer:n})},M4=async({stdout:r,stderr:e,all:t},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=rI(r,{encoding:n,buffer:i,maxBuffer:o}),c=rI(e,{encoding:n,buffer:i,maxBuffer:o}),u=rI(t,{encoding:n,buffer:i,maxBuffer:o*2});try{return await Promise.all([s,a,c,u])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},tI(r,a),tI(e,c),tI(t,u)])}},N4=({input:r})=>{if(FR(r))throw new TypeError("The `input` option cannot be a stream in sync mode")};BR.exports={handleInput:O4,makeAllStream:L4,getSpawnedResult:M4,validateInputSync:N4}});var qR=v((Iae,UR)=>{"use strict";var F4=(async()=>{})().constructor.prototype,B4=["then","catch","finally"].map(r=>[r,Reflect.getOwnPropertyDescriptor(F4,r)]),j4=(r,e)=>{for(let[t,n]of B4){let i=typeof e=="function"?(...o)=>Reflect.apply(n.value,e(),o):n.value.bind(e);Reflect.defineProperty(r,t,{...n,value:i})}return r},U4=r=>new Promise((e,t)=>{r.on("exit",(n,i)=>{e({exitCode:n,signal:i})}),r.on("error",n=>{t(n)}),r.stdin&&r.stdin.on("error",n=>{t(n)})});UR.exports={mergePromise:j4,getSpawnedPromise:U4}});var $R=v((xae,VR)=>{"use strict";var WR=(r,e=[])=>Array.isArray(e)?[r,...e]:[r],q4=/^[\w.-]+$/,W4=/"/g,V4=r=>typeof r!="string"||q4.test(r)?r:`"${r.replace(W4,'\\"')}"`,$4=(r,e)=>WR(r,e).join(" "),H4=(r,e)=>WR(r,e).map(t=>V4(t)).join(" "),G4=/ +/g,z4=r=>{let e=[];for(let t of r.trim().split(G4)){let n=e[e.length-1];n&&n.endsWith("\\")?e[e.length-1]=`${n.slice(0,-1)} ${t}`:e.push(t)}return e};VR.exports={joinCommand:$4,getEscapedCommand:H4,parseCommand:z4}});var Um=v((Cae,cu)=>{"use strict";var K4=require("path"),nI=require("child_process"),J4=nR(),Y4=oR(),X4=cR(),Q4=dR(),Bm=wR(),GR=_R(),{spawnedKill:Z4,spawnedCancel:eG,setupTimeout:tG,validateTimeout:rG,setExitHandler:nG}=ER(),{handleInput:iG,getSpawnedResult:oG,makeAllStream:sG,validateInputSync:aG}=jR(),{mergePromise:HR,getSpawnedPromise:cG}=qR(),{joinCommand:zR,parseCommand:KR,getEscapedCommand:JR}=$R(),uG=1e3*1e3*100,lG=({env:r,extendEnv:e,preferLocal:t,localDir:n,execPath:i})=>{let o=e?{...process.env,...r}:r;return t?X4.env({env:o,cwd:n,execPath:i}):o},YR=(r,e,t={})=>{let n=J4._parse(r,e,t);return r=n.command,e=n.args,t=n.options,t={maxBuffer:uG,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=lG(t),t.stdio=GR(t),process.platform==="win32"&&K4.basename(r,".exe")==="cmd"&&e.unshift("/q"),{file:r,args:e,options:t,parsed:n}},Md=(r,e,t)=>typeof e!="string"&&!Buffer.isBuffer(e)?t===void 0?void 0:"":r.stripFinalNewline?Y4(e):e,jm=(r,e,t)=>{let n=YR(r,e,t),i=zR(r,e),o=JR(r,e);rG(n.options);let s;try{s=nI.spawn(n.file,n.args,n.options)}catch(f){let h=new nI.ChildProcess,m=Promise.reject(Bm({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return HR(h,m)}let a=cG(s),c=tG(s,n.options,a),u=nG(s,n.options,c),l={isCanceled:!1};s.kill=Z4.bind(null,s.kill.bind(s)),s.cancel=eG.bind(null,s,l);let d=Q4(async()=>{let[{error:f,exitCode:h,signal:m,timedOut:y},I,L,P]=await oG(s,n.options,u),W=Md(n.options,I),E=Md(n.options,L),M=Md(n.options,P);if(f||h!==0||m!==null){let k=Bm({error:f,exitCode:h,signal:m,stdout:W,stderr:E,all:M,command:i,escapedCommand:o,parsed:n,timedOut:y,isCanceled:l.isCanceled,killed:s.killed});if(!n.options.reject)return k;throw k}return{command:i,escapedCommand:o,exitCode:0,stdout:W,stderr:E,all:M,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return iG(s,n.options.input),s.all=sG(s,n.options),HR(s,d)};cu.exports=jm;cu.exports.sync=(r,e,t)=>{let n=YR(r,e,t),i=zR(r,e),o=JR(r,e);aG(n.options);let s;try{s=nI.spawnSync(n.file,n.args,n.options)}catch(u){throw Bm({error:u,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let a=Md(n.options,s.stdout,s.error),c=Md(n.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let u=Bm({stdout:a,stderr:c,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:o,parsed:n,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!n.options.reject)return u;throw u}return{command:i,escapedCommand:o,exitCode:0,stdout:a,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};cu.exports.command=(r,e)=>{let[t,...n]=KR(r);return jm(t,n,e)};cu.exports.commandSync=(r,e)=>{let[t,...n]=KR(r);return jm.sync(t,n,e)};cu.exports.node=(r,e,t={})=>{e&&!Array.isArray(e)&&typeof e=="object"&&(t=e,e=[]);let n=GR.node(t),i=process.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:o=process.execPath,nodeOptions:s=i}=t;return jm(o,[...s,r,...Array.isArray(e)?e:[]],{...t,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var St=v(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.NON_CUSTOM_TAG_KEYS=Ce.PRE_DESTROY=Ce.POST_CONSTRUCT=Ce.DESIGN_PARAM_TYPES=Ce.PARAM_TYPES=Ce.TAGGED_PROP=Ce.TAGGED=Ce.MULTI_INJECT_TAG=Ce.INJECT_TAG=Ce.OPTIONAL_TAG=Ce.UNMANAGED_TAG=Ce.NAME_TAG=Ce.NAMED_TAG=void 0;Ce.NAMED_TAG="named";Ce.NAME_TAG="name";Ce.UNMANAGED_TAG="unmanaged";Ce.OPTIONAL_TAG="optional";Ce.INJECT_TAG="inject";Ce.MULTI_INJECT_TAG="multi_inject";Ce.TAGGED="inversify:tagged";Ce.TAGGED_PROP="inversify:tagged_props";Ce.PARAM_TYPES="inversify:paramtypes";Ce.DESIGN_PARAM_TYPES="design:paramtypes";Ce.POST_CONSTRUCT="post_construct";Ce.PRE_DESTROY="pre_destroy";function pG(){return[Ce.INJECT_TAG,Ce.MULTI_INJECT_TAG,Ce.NAME_TAG,Ce.UNMANAGED_TAG,Ce.NAMED_TAG,Ce.OPTIONAL_TAG]}Ce.NON_CUSTOM_TAG_KEYS=pG()});var mn=v(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.TargetTypeEnum=ss.BindingTypeEnum=ss.BindingScopeEnum=void 0;var dG={Request:"Request",Singleton:"Singleton",Transient:"Transient"};ss.BindingScopeEnum=dG;var fG={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};ss.BindingTypeEnum=fG;var hG={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};ss.TargetTypeEnum=hG});var as=v(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.id=void 0;var mG=0;function gG(){return mG++}qm.id=gG});var QR=v(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.Binding=void 0;var XR=mn(),yG=as(),bG=function(){function r(e,t){this.id=(0,yG.id)(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=XR.BindingTypeEnum.Invalid,this.constraint=function(n){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return r.prototype.clone=function(){var e=new r(this.serviceIdentifier,this.scope);return e.activated=e.scope===XR.BindingScopeEnum.Singleton?this.activated:!1,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},r}();Wm.Binding=bG});var or=v(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.STACK_OVERFLOW=K.CIRCULAR_DEPENDENCY_IN_FACTORY=K.ON_DEACTIVATION_ERROR=K.PRE_DESTROY_ERROR=K.POST_CONSTRUCT_ERROR=K.ASYNC_UNBIND_REQUIRED=K.MULTIPLE_POST_CONSTRUCT_METHODS=K.MULTIPLE_PRE_DESTROY_METHODS=K.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=K.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=K.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=K.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=K.ARGUMENTS_LENGTH_MISMATCH=K.INVALID_DECORATOR_OPERATION=K.INVALID_TO_SELF_VALUE=K.LAZY_IN_SYNC=K.INVALID_FUNCTION_BINDING=K.INVALID_MIDDLEWARE_RETURN=K.NO_MORE_SNAPSHOTS_AVAILABLE=K.INVALID_BINDING_TYPE=K.NOT_IMPLEMENTED=K.CIRCULAR_DEPENDENCY=K.UNDEFINED_INJECT_ANNOTATION=K.MISSING_INJECT_ANNOTATION=K.MISSING_INJECTABLE_ANNOTATION=K.NOT_REGISTERED=K.CANNOT_UNBIND=K.AMBIGUOUS_MATCH=K.KEY_NOT_FOUND=K.NULL_ARGUMENT=K.DUPLICATED_METADATA=K.DUPLICATED_INJECTABLE_DECORATOR=void 0;K.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.";K.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:";K.NULL_ARGUMENT="NULL argument";K.KEY_NOT_FOUND="Key Not Found";K.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:";K.CANNOT_UNBIND="Could not unbind serviceIdentifier:";K.NOT_REGISTERED="No matching bindings found for serviceIdentifier:";K.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:";K.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var vG=function(r){return"@inject called with undefined this could mean that the class "+r+" has a circular dependency problem. You can use a LazyServiceIdentifier to  overcome this limitation."};K.UNDEFINED_INJECT_ANNOTATION=vG;K.CIRCULAR_DEPENDENCY="Circular dependency found:";K.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.";K.INVALID_BINDING_TYPE="Invalid binding type:";K.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.";K.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!";K.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!";var wG=function(r){return"You are attempting to construct '"+r+`' in a synchronous way
 but it has asynchronous dependencies.`};K.LAZY_IN_SYNC=wG;K.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier";K.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var SG=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"The number of constructor arguments in the derived class "+(r[0]+" must be >= than the number of constructor arguments of its base class.")};K.ARGUMENTS_LENGTH_MISMATCH=SG;K.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.";K.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE='Invalid Container option. Default scope must be a string ("singleton" or "transient").';K.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean";K.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean";K.MULTIPLE_PRE_DESTROY_METHODS="Cannot apply @preDestroy decorator multiple times in the same class";K.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";K.ASYNC_UNBIND_REQUIRED="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)";var _G=function(r,e){return"@postConstruct error in class "+r+": "+e};K.POST_CONSTRUCT_ERROR=_G;var IG=function(r,e){return"@preDestroy error in class "+r+": "+e};K.PRE_DESTROY_ERROR=IG;var xG=function(r,e){return"onDeactivation() error in class "+r+": "+e};K.ON_DEACTIVATION_ERROR=xG;var CG=function(r,e){return"It looks like there is a circular dependency in one of the '"+r+"' bindings. Please investigate bindings with "+("service identifier '"+e+"'.")};K.CIRCULAR_DEPENDENCY_IN_FACTORY=CG;K.STACK_OVERFLOW="Maximum call stack size exceeded"});var oI=v(hi=>{"use strict";var TG=hi&&hi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PG=hi&&hi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),EG=hi&&hi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&TG(e,r,t);return PG(e,r),e};Object.defineProperty(hi,"__esModule",{value:!0});hi.MetadataReader=void 0;var iI=EG(St()),kG=function(){function r(){}return r.prototype.getConstructorMetadata=function(e){var t=Reflect.getMetadata(iI.PARAM_TYPES,e),n=Reflect.getMetadata(iI.TAGGED,e);return{compilerGeneratedMetadata:t,userGeneratedMetadata:n||{}}},r.prototype.getPropertiesMetadata=function(e){var t=Reflect.getMetadata(iI.TAGGED_PROP,e)||[];return t},r}();hi.MetadataReader=kG});var ZR=v(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.BindingCount=void 0;Vm.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}});var sI=v(gn=>{"use strict";var RG=gn&&gn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),AG=gn&&gn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),DG=gn&&gn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&RG(e,r,t);return AG(e,r),e};Object.defineProperty(gn,"__esModule",{value:!0});gn.tryAndThrowErrorIfStackOverflow=gn.isStackOverflowExeption=void 0;var OG=DG(or());function eA(r){return r instanceof RangeError||r.message===OG.STACK_OVERFLOW}gn.isStackOverflowExeption=eA;var LG=function(r,e){try{return r()}catch(t){throw eA(t)&&(t=e()),t}};gn.tryAndThrowErrorIfStackOverflow=LG});var Aa=v(_t=>{"use strict";var MG=_t&&_t.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),NG=_t&&_t.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),FG=_t&&_t.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&MG(e,r,t);return NG(e,r),e};Object.defineProperty(_t,"__esModule",{value:!0});_t.getSymbolDescription=_t.circularDependencyToException=_t.listMetadataForTarget=_t.listRegisteredBindingsForServiceIdentifier=_t.getServiceIdentifierAsString=_t.getFunctionName=void 0;var BG=FG(or());function tA(r){if(typeof r=="function"){var e=r;return e.name}else{if(typeof r=="symbol")return r.toString();var e=r;return e}}_t.getServiceIdentifierAsString=tA;function jG(r,e,t){var n="",i=t(r,e);return i.length!==0&&(n=`
Registered bindings:`,i.forEach(function(o){var s="Object";o.implementationType!==null&&(s=iA(o.implementationType)),n=n+`
 `+s,o.constraint.metaData&&(n=n+" - "+o.constraint.metaData)})),n}_t.listRegisteredBindingsForServiceIdentifier=jG;function rA(r,e){return r.parentRequest===null?!1:r.parentRequest.serviceIdentifier===e?!0:rA(r.parentRequest,e)}function UG(r){function e(n,i){i===void 0&&(i=[]);var o=tA(n.serviceIdentifier);return i.push(o),n.parentRequest!==null?e(n.parentRequest,i):i}var t=e(r);return t.reverse().join(" --> ")}function nA(r){r.childRequests.forEach(function(e){if(rA(e,e.serviceIdentifier)){var t=UG(e);throw new Error(BG.CIRCULAR_DEPENDENCY+" "+t)}else nA(e)})}_t.circularDependencyToException=nA;function qG(r,e){if(e.isTagged()||e.isNamed()){var t="",n=e.getNamedTag(),i=e.getCustomTags();return n!==null&&(t+=n.toString()+`
`),i!==null&&i.forEach(function(o){t+=o.toString()+`
`})," "+r+`
 `+r+" - "+t}else return" "+r}_t.listMetadataForTarget=qG;function iA(r){if(r.name)return r.name;var e=r.toString(),t=e.match(/^function\s*([^\s(]+)/);return t?t[1]:"Anonymous function: "+e}_t.getFunctionName=iA;function WG(r){return r.toString().slice(7,-1)}_t.getSymbolDescription=WG});var oA=v($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.Context=void 0;var VG=as(),$G=function(){function r(e){this.id=(0,VG.id)(),this.container=e}return r.prototype.addPlan=function(e){this.plan=e},r.prototype.setCurrentRequest=function(e){this.currentRequest=e},r}();$m.Context=$G});var Jn=v(mi=>{"use strict";var HG=mi&&mi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),GG=mi&&mi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zG=mi&&mi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&HG(e,r,t);return GG(e,r),e};Object.defineProperty(mi,"__esModule",{value:!0});mi.Metadata=void 0;var KG=zG(St()),JG=function(){function r(e,t){this.key=e,this.value=t}return r.prototype.toString=function(){return this.key===KG.NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},r}();mi.Metadata=JG});var sA=v(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.Plan=void 0;var YG=function(){function r(e,t){this.parentContext=e,this.rootRequest=t}return r}();Hm.Plan=YG});var zm=v(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.LazyServiceIdentifier=void 0;var XG=function(){function r(e){this._cb=e}return r.prototype.unwrap=function(){return this._cb()},r}();Gm.LazyServiceIdentifier=XG});var aA=v(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.QueryableString=void 0;var QG=function(){function r(e){this.str=e}return r.prototype.startsWith=function(e){return this.str.indexOf(e)===0},r.prototype.endsWith=function(e){var t="",n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},r.prototype.contains=function(e){return this.str.indexOf(e)!==-1},r.prototype.equals=function(e){return this.str===e},r.prototype.value=function(){return this.str},r}();Km.QueryableString=QG});var aI=v(gi=>{"use strict";var ZG=gi&&gi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),e6=gi&&gi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),t6=gi&&gi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ZG(e,r,t);return e6(e,r),e};Object.defineProperty(gi,"__esModule",{value:!0});gi.Target=void 0;var wo=t6(St()),r6=as(),n6=Aa(),cA=Jn(),i6=aA(),o6=function(){function r(e,t,n,i){this.id=(0,r6.id)(),this.type=e,this.serviceIdentifier=n;var o=typeof t=="symbol"?(0,n6.getSymbolDescription)(t):t;this.name=new i6.QueryableString(o||""),this.identifier=t,this.metadata=new Array;var s=null;typeof i=="string"?s=new cA.Metadata(wo.NAMED_TAG,i):i instanceof cA.Metadata&&(s=i),s!==null&&this.metadata.push(s)}return r.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t<n.length;t++){var i=n[t];if(i.key===e)return!0}return!1},r.prototype.isArray=function(){return this.hasTag(wo.MULTI_INJECT_TAG)},r.prototype.matchesArray=function(e){return this.matchesTag(wo.MULTI_INJECT_TAG)(e)},r.prototype.isNamed=function(){return this.hasTag(wo.NAMED_TAG)},r.prototype.isTagged=function(){return this.metadata.some(function(e){return wo.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})})},r.prototype.isOptional=function(){return this.matchesTag(wo.OPTIONAL_TAG)(!0)},r.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(e){return e.key===wo.NAMED_TAG})[0]:null},r.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(e){return wo.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})}):null},r.prototype.matchesNamedTag=function(e){return this.matchesTag(wo.NAMED_TAG)(e)},r.prototype.matchesTag=function(e){var t=this;return function(n){for(var i=0,o=t.metadata;i<o.length;i++){var s=o[i];if(s.key===e&&s.value===n)return!0}return!1}},r}();gi.Target=o6});var gA=v(sr=>{"use strict";var s6=sr&&sr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),a6=sr&&sr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),uA=sr&&sr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&s6(e,r,t);return a6(e,r),e},Jm=sr&&sr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(sr,"__esModule",{value:!0});sr.getFunctionName=sr.getBaseClassDependencyCount=sr.getDependencies=void 0;var c6=zm(),cI=uA(or()),lA=mn(),Nd=uA(St()),uI=Aa();Object.defineProperty(sr,"getFunctionName",{enumerable:!0,get:function(){return uI.getFunctionName}});var pA=aI();function u6(r,e){var t=(0,uI.getFunctionName)(e);return dA(r,t,e,!1)}sr.getDependencies=u6;function dA(r,e,t,n){var i=r.getConstructorMetadata(t),o=i.compilerGeneratedMetadata;if(o===void 0){var s=cI.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(s)}var a=i.userGeneratedMetadata,c=Object.keys(a),u=t.length===0&&c.length>0,l=c.length>t.length,p=u||l?c.length:t.length,d=p6(n,e,o,a,p),f=fA(r,t,e),h=Jm(Jm([],d,!0),f,!0);return h}function l6(r,e,t,n,i){var o=i[r.toString()]||[],s=mA(o),a=s.unmanaged!==!0,c=n[r],u=s.inject||s.multiInject;if(c=u||c,c instanceof c6.LazyServiceIdentifier&&(c=c.unwrap()),a){var l=c===Object,p=c===Function,d=c===void 0,f=l||p||d;if(!e&&f){var h=cI.MISSING_INJECT_ANNOTATION+" argument "+r+" in class "+t+".";throw new Error(h)}var m=new pA.Target(lA.TargetTypeEnum.ConstructorArgument,s.targetName,c);return m.metadata=o,m}return null}function p6(r,e,t,n,i){for(var o=[],s=0;s<i;s++){var a=s,c=l6(a,r,e,t,n);c!==null&&o.push(c)}return o}function d6(r,e,t,n){var i=r||e;if(i===void 0){var o=cI.MISSING_INJECTABLE_ANNOTATION+" for property "+String(t)+" in class "+n+".";throw new Error(o)}return i}function fA(r,e,t){for(var n=r.getPropertiesMetadata(e),i=[],o=Object.getOwnPropertySymbols(n),s=Object.keys(n),a=s.concat(o),c=0,u=a;c<u.length;c++){var l=u[c],p=n[l],d=mA(p),f=d.targetName||l,h=d6(d.inject,d.multiInject,l,t),m=new pA.Target(lA.TargetTypeEnum.ClassProperty,f,h);m.metadata=p,i.push(m)}var y=Object.getPrototypeOf(e.prototype).constructor;if(y!==Object){var I=fA(r,y,t);i=Jm(Jm([],i,!0),I,!0)}return i}function hA(r,e){var t=Object.getPrototypeOf(e.prototype).constructor;if(t!==Object){var n=(0,uI.getFunctionName)(t),i=dA(r,n,t,!0),o=i.map(function(c){return c.metadata.filter(function(u){return u.key===Nd.UNMANAGED_TAG})}),s=[].concat.apply([],o).length,a=i.length-s;return a>0?a:hA(r,t)}else return 0}sr.getBaseClassDependencyCount=hA;function mA(r){var e={};return r.forEach(function(t){e[t.key.toString()]=t.value}),{inject:e[Nd.INJECT_TAG],multiInject:e[Nd.MULTI_INJECT_TAG],targetName:e[Nd.NAME_TAG],unmanaged:e[Nd.UNMANAGED_TAG]}}});var yA=v(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.Request=void 0;var f6=as(),h6=function(){function r(e,t,n,i,o){this.id=(0,f6.id)(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=n===null?new Map:null}return r.prototype.addChildRequest=function(e,t,n){var i=new r(e,this.parentContext,this,t,n);return this.childRequests.push(i),i},r}();Ym.Request=h6});var hI=v(Tr=>{"use strict";var m6=Tr&&Tr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),g6=Tr&&Tr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),wA=Tr&&Tr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&m6(e,r,t);return g6(e,r),e};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.getBindingDictionary=Tr.createMockRequest=Tr.plan=void 0;var Xm=ZR(),pI=wA(or()),SA=mn(),bA=wA(St()),y6=sI(),uu=Aa(),_A=oA(),dI=Jn(),b6=sA(),lI=gA(),fI=yA(),IA=aI();function xA(r){return r._bindingDictionary}Tr.getBindingDictionary=xA;function v6(r,e,t,n,i,o){var s=r?bA.MULTI_INJECT_TAG:bA.INJECT_TAG,a=new dI.Metadata(s,t),c=new IA.Target(e,n,t,a);if(i!==void 0){var u=new dI.Metadata(i,o);c.metadata.push(u)}return c}function vA(r,e,t,n,i){var o=Fd(t.container,i.serviceIdentifier),s=[];return o.length===Xm.BindingCount.NoBindingsAvailable&&t.container.options.autoBindInjectable&&typeof i.serviceIdentifier=="function"&&r.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(t.container.bind(i.serviceIdentifier).toSelf(),o=Fd(t.container,i.serviceIdentifier)),e?s=o:s=o.filter(function(a){var c=new fI.Request(a.serviceIdentifier,t,n,a,i);return a.constraint(c)}),w6(i.serviceIdentifier,s,i,t.container),s}function w6(r,e,t,n){switch(e.length){case Xm.BindingCount.NoBindingsAvailable:if(t.isOptional())return e;var i=(0,uu.getServiceIdentifierAsString)(r),o=pI.NOT_REGISTERED;throw o+=(0,uu.listMetadataForTarget)(i,t),o+=(0,uu.listRegisteredBindingsForServiceIdentifier)(n,i,Fd),new Error(o);case Xm.BindingCount.OnlyOneBindingAvailable:return e;case Xm.BindingCount.MultipleBindingsAvailable:default:if(t.isArray())return e;var i=(0,uu.getServiceIdentifierAsString)(r),o=pI.AMBIGUOUS_MATCH+" "+i;throw o+=(0,uu.listRegisteredBindingsForServiceIdentifier)(n,i,Fd),new Error(o)}}function CA(r,e,t,n,i,o){var s,a;if(i===null){s=vA(r,e,n,null,o),a=new fI.Request(t,n,null,s,o);var c=new b6.Plan(n,a);n.addPlan(c)}else s=vA(r,e,n,i,o),a=i.addChildRequest(o.serviceIdentifier,s,o);s.forEach(function(u){var l=null;if(o.isArray())l=a.addChildRequest(u.serviceIdentifier,u,o);else{if(u.cache)return;l=a}if(u.type===SA.BindingTypeEnum.Instance&&u.implementationType!==null){var p=(0,lI.getDependencies)(r,u.implementationType);if(!n.container.options.skipBaseClassChecks){var d=(0,lI.getBaseClassDependencyCount)(r,u.implementationType);if(p.length<d){var f=pI.ARGUMENTS_LENGTH_MISMATCH((0,lI.getFunctionName)(u.implementationType));throw new Error(f)}}p.forEach(function(h){CA(r,!1,h.serviceIdentifier,n,l,h)})}})}function Fd(r,e){var t=[],n=xA(r);return n.hasKey(e)?t=n.get(e):r.parent!==null&&(t=Fd(r.parent,e)),t}function S6(r,e,t,n,i,o,s,a){a===void 0&&(a=!1);var c=new _A.Context(e),u=v6(t,n,i,"",o,s);try{return CA(r,a,i,c,null,u),c}catch(l){throw(0,y6.isStackOverflowExeption)(l)&&(0,uu.circularDependencyToException)(c.plan.rootRequest),l}}Tr.plan=S6;function _6(r,e,t,n){var i=new IA.Target(SA.TargetTypeEnum.Variable,"",e,new dI.Metadata(t,n)),o=new _A.Context(r),s=new fI.Request(e,o,null,[],i);return s}Tr.createMockRequest=_6});var Bd=v(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.isPromiseOrContainsPromise=lu.isPromise=void 0;function mI(r){var e=typeof r=="object"&&r!==null||typeof r=="function";return e&&typeof r.then=="function"}lu.isPromise=mI;function I6(r){return mI(r)?!0:Array.isArray(r)&&r.some(mI)}lu.isPromiseOrContainsPromise=I6});var TA=v(yi=>{"use strict";var x6=yi&&yi.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},C6=yi&&yi.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(yi,"__esModule",{value:!0});yi.saveToScope=yi.tryGetFromScope=void 0;var Qm=mn(),T6=Bd(),P6=function(r,e){return e.scope===Qm.BindingScopeEnum.Singleton&&e.activated?e.cache:e.scope===Qm.BindingScopeEnum.Request&&r.has(e.id)?r.get(e.id):null};yi.tryGetFromScope=P6;var E6=function(r,e,t){e.scope===Qm.BindingScopeEnum.Singleton&&R6(e,t),e.scope===Qm.BindingScopeEnum.Request&&k6(r,e,t)};yi.saveToScope=E6;var k6=function(r,e,t){r.has(e.id)||r.set(e.id,t)},R6=function(r,e){r.cache=e,r.activated=!0,(0,T6.isPromise)(e)&&A6(r,e)},A6=function(r,e){return x6(void 0,void 0,void 0,function(){var t,n;return C6(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e];case 1:return t=i.sent(),r.cache=t,[3,3];case 2:throw n=i.sent(),r.cache=null,r.activated=!1,n;case 3:return[2]}})})}});var PA=v(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.FactoryType=void 0;var D6;(function(r){r.DynamicValue="toDynamicValue",r.Factory="toFactory",r.Provider="toProvider"})(D6=jd.FactoryType||(jd.FactoryType={}))});var yI=v(Pr=>{"use strict";var O6=Pr&&Pr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),L6=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),M6=Pr&&Pr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&O6(e,r,t);return L6(e,r),e};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.getFactoryDetails=Pr.ensureFullyBound=Pr.multiBindToService=void 0;var N6=Aa(),F6=M6(or()),bi=mn(),gI=PA(),B6=function(r){return function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.forEach(function(i){return r.bind(i).toService(e)})}}};Pr.multiBindToService=B6;var j6=function(r){var e=null;switch(r.type){case bi.BindingTypeEnum.ConstantValue:case bi.BindingTypeEnum.Function:e=r.cache;break;case bi.BindingTypeEnum.Constructor:case bi.BindingTypeEnum.Instance:e=r.implementationType;break;case bi.BindingTypeEnum.DynamicValue:e=r.dynamicValue;break;case bi.BindingTypeEnum.Provider:e=r.provider;break;case bi.BindingTypeEnum.Factory:e=r.factory;break}if(e===null){var t=(0,N6.getServiceIdentifierAsString)(r.serviceIdentifier);throw new Error(F6.INVALID_BINDING_TYPE+" "+t)}};Pr.ensureFullyBound=j6;var U6=function(r){switch(r.type){case bi.BindingTypeEnum.Factory:return{factory:r.factory,factoryType:gI.FactoryType.Factory};case bi.BindingTypeEnum.Provider:return{factory:r.provider,factoryType:gI.FactoryType.Provider};case bi.BindingTypeEnum.DynamicValue:return{factory:r.dynamicValue,factoryType:gI.FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+r.type)}};Pr.getFactoryDetails=U6});var OA=v(Lt=>{"use strict";var pu=Lt&&Lt.__assign||function(){return pu=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},pu.apply(this,arguments)},q6=Lt&&Lt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),W6=Lt&&Lt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),V6=Lt&&Lt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&q6(e,r,t);return W6(e,r),e},RA=Lt&&Lt.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},AA=Lt&&Lt.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},$6=Lt&&Lt.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.resolveInstance=void 0;var bI=or(),wI=mn(),vI=V6(St()),SI=Bd();function H6(r,e){return r.reduce(function(t,n){var i=e(n),o=n.target.type;return o===wI.TargetTypeEnum.ConstructorArgument?t.constructorInjections.push(i):(t.propertyRequests.push(n),t.propertyInjections.push(i)),t.isAsync||(t.isAsync=(0,SI.isPromiseOrContainsPromise)(i)),t},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function G6(r,e,t){var n;if(e.length>0){var i=H6(e,t),o=pu(pu({},i),{constr:r});i.isAsync?n=z6(o):n=DA(o)}else n=new r;return n}function DA(r){var e,t=new((e=r.constr).bind.apply(e,$6([void 0],r.constructorInjections,!1)));return r.propertyRequests.forEach(function(n,i){var o=n.target.identifier,s=r.propertyInjections[i];(!n.target.isOptional()||s!==void 0)&&(t[o]=s)}),t}function z6(r){return RA(this,void 0,void 0,function(){var e,t;return AA(this,function(n){switch(n.label){case 0:return[4,EA(r.constructorInjections)];case 1:return e=n.sent(),[4,EA(r.propertyInjections)];case 2:return t=n.sent(),[2,DA(pu(pu({},r),{constructorInjections:e,propertyInjections:t}))]}})})}function EA(r){return RA(this,void 0,void 0,function(){var e,t,n,i;return AA(this,function(o){for(e=[],t=0,n=r;t<n.length;t++)i=n[t],Array.isArray(i)?e.push(Promise.all(i)):e.push(i);return[2,Promise.all(e)]})})}function kA(r,e){var t=K6(r,e);return(0,SI.isPromise)(t)?t.then(function(){return e}):e}function K6(r,e){var t,n;if(Reflect.hasMetadata(vI.POST_CONSTRUCT,r)){var i=Reflect.getMetadata(vI.POST_CONSTRUCT,r);try{return(n=(t=e)[i.value])===null||n===void 0?void 0:n.call(t)}catch(o){if(o instanceof Error)throw new Error((0,bI.POST_CONSTRUCT_ERROR)(r.name,o.message))}}}function J6(r,e){r.scope!==wI.BindingScopeEnum.Singleton&&Y6(r,e)}function Y6(r,e){var t="Class cannot be instantiated in "+(r.scope===wI.BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof r.onDeactivation=="function")throw new Error((0,bI.ON_DEACTIVATION_ERROR)(e.name,t));if(Reflect.hasMetadata(vI.PRE_DESTROY,e))throw new Error((0,bI.PRE_DESTROY_ERROR)(e.name,t))}function X6(r,e,t,n){J6(r,e);var i=G6(e,t,n);return(0,SI.isPromise)(i)?i.then(function(o){return kA(e,o)}):kA(e,i)}Lt.resolveInstance=X6});var BA=v(Er=>{"use strict";var Q6=Er&&Er.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Z6=Er&&Er.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ez=Er&&Er.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Q6(e,r,t);return Z6(e,r),e},tz=Er&&Er.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},rz=Er&&Er.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Er,"__esModule",{value:!0});Er.resolve=void 0;var nz=ez(or()),Zm=mn(),iz=hI(),LA=TA(),_I=Bd(),NA=yI(),oz=sI(),sz=OA(),II=function(r){return function(e){e.parentContext.setCurrentRequest(e);var t=e.bindings,n=e.childRequests,i=e.target&&e.target.isArray(),o=!e.parentRequest||!e.parentRequest.target||!e.target||!e.parentRequest.target.matchesArray(e.target.serviceIdentifier);if(i&&o)return n.map(function(a){var c=II(r);return c(a)});if(e.target.isOptional()&&t.length===0)return;var s=t[0];return lz(r,e,s)}},az=function(r,e){var t=(0,NA.getFactoryDetails)(r);return(0,oz.tryAndThrowErrorIfStackOverflow)(function(){return t.factory.bind(r)(e)},function(){return new Error(nz.CIRCULAR_DEPENDENCY_IN_FACTORY(t.factoryType,e.currentRequest.serviceIdentifier.toString()))})},cz=function(r,e,t){var n,i=e.childRequests;switch((0,NA.ensureFullyBound)(t),t.type){case Zm.BindingTypeEnum.ConstantValue:case Zm.BindingTypeEnum.Function:n=t.cache;break;case Zm.BindingTypeEnum.Constructor:n=t.implementationType;break;case Zm.BindingTypeEnum.Instance:n=(0,sz.resolveInstance)(t,t.implementationType,i,II(r));break;default:n=az(t,e.parentContext)}return n},uz=function(r,e,t){var n=(0,LA.tryGetFromScope)(r,e);return n!==null||(n=t(),(0,LA.saveToScope)(r,e,n)),n},lz=function(r,e,t){return uz(r,t,function(){var n=cz(r,e,t);return(0,_I.isPromise)(n)?n=n.then(function(i){return MA(e,t,i)}):n=MA(e,t,n),n})};function MA(r,e,t){var n=pz(r.parentContext,e,t),i=hz(r.parentContext.container),o,s=i.next();do{o=s.value;var a=r.parentContext,c=r.serviceIdentifier,u=fz(o,c);(0,_I.isPromise)(n)?n=FA(u,a,n):n=dz(u,a,n),s=i.next()}while(s.done!==!0&&!(0,iz.getBindingDictionary)(o).hasKey(r.serviceIdentifier));return n}var pz=function(r,e,t){var n;return typeof e.onActivation=="function"?n=e.onActivation(r,t):n=t,n},dz=function(r,e,t){for(var n=r.next();!n.done;){if(t=n.value(e,t),(0,_I.isPromise)(t))return FA(r,e,t);n=r.next()}return t},FA=function(r,e,t){return tz(void 0,void 0,void 0,function(){var n,i;return rz(this,function(o){switch(o.label){case 0:return[4,t];case 1:n=o.sent(),i=r.next(),o.label=2;case 2:return i.done?[3,4]:[4,i.value(e,n)];case 3:return n=o.sent(),i=r.next(),[3,2];case 4:return[2,n]}})})},fz=function(r,e){var t=r._activations;return t.hasKey(e)?t.get(e).values():[].values()},hz=function(r){for(var e=[r],t=r.parent;t!==null;)e.push(t),t=t.parent;var n=function(){var o=e.pop();return o!==void 0?{done:!1,value:o}:{done:!0,value:void 0}},i={next:n};return i};function mz(r){var e=II(r.plan.rootRequest.requestScope);return e(r.plan.rootRequest)}Er.resolve=mz});var xI=v(ar=>{"use strict";var gz=ar&&ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yz=ar&&ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bz=ar&&ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&gz(e,r,t);return yz(e,r),e};Object.defineProperty(ar,"__esModule",{value:!0});ar.typeConstraint=ar.namedConstraint=ar.taggedConstraint=ar.traverseAncerstors=void 0;var vz=bz(St()),wz=Jn(),jA=function(r,e){var t=r.parentRequest;return t!==null?e(t)?!0:jA(t,e):!1};ar.traverseAncerstors=jA;var UA=function(r){return function(e){var t=function(n){return n!==null&&n.target!==null&&n.target.matchesTag(r)(e)};return t.metaData=new wz.Metadata(r,e),t}};ar.taggedConstraint=UA;var Sz=UA(vz.NAMED_TAG);ar.namedConstraint=Sz;var _z=function(r){return function(e){var t=null;if(e!==null)if(t=e.bindings[0],typeof r=="string"){var n=t.serviceIdentifier;return n===r}else{var i=e.bindings[0].implementationType;return r===i}return!1}};ar.typeConstraint=_z});var tg=v(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.BindingWhenSyntax=void 0;var gr=rg(),kt=xI(),Iz=function(){function r(e){this._binding=e}return r.prototype.when=function(e){return this._binding.constraint=e,new gr.BindingOnSyntax(this._binding)},r.prototype.whenTargetNamed=function(e){return this._binding.constraint=(0,kt.namedConstraint)(e),new gr.BindingOnSyntax(this._binding)},r.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){if(e===null)return!1;var t=e.target!==null&&!e.target.isNamed()&&!e.target.isTagged();return t},new gr.BindingOnSyntax(this._binding)},r.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=(0,kt.taggedConstraint)(e)(t),new gr.BindingOnSyntax(this._binding)},r.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return t!==null&&(0,kt.typeConstraint)(e)(t.parentRequest)},new gr.BindingOnSyntax(this._binding)},r.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return t!==null&&(0,kt.namedConstraint)(e)(t.parentRequest)},new gr.BindingOnSyntax(this._binding)},r.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return n!==null&&(0,kt.taggedConstraint)(e)(t)(n.parentRequest)},new gr.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return t!==null&&(0,kt.traverseAncerstors)(t,(0,kt.typeConstraint)(e))},new gr.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return t!==null&&!(0,kt.traverseAncerstors)(t,(0,kt.typeConstraint)(e))},new gr.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return t!==null&&(0,kt.traverseAncerstors)(t,(0,kt.namedConstraint)(e))},new gr.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return t!==null&&!(0,kt.traverseAncerstors)(t,(0,kt.namedConstraint)(e))},new gr.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return n!==null&&(0,kt.traverseAncerstors)(n,(0,kt.taggedConstraint)(e)(t))},new gr.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return n!==null&&!(0,kt.traverseAncerstors)(n,(0,kt.taggedConstraint)(e)(t))},new gr.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return t!==null&&(0,kt.traverseAncerstors)(t,e)},new gr.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return t!==null&&!(0,kt.traverseAncerstors)(t,e)},new gr.BindingOnSyntax(this._binding)},r}();eg.BindingWhenSyntax=Iz});var rg=v(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.BindingOnSyntax=void 0;var qA=tg(),xz=function(){function r(e){this._binding=e}return r.prototype.onActivation=function(e){return this._binding.onActivation=e,new qA.BindingWhenSyntax(this._binding)},r.prototype.onDeactivation=function(e){return this._binding.onDeactivation=e,new qA.BindingWhenSyntax(this._binding)},r}();ng.BindingOnSyntax=xz});var CI=v(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.BindingWhenOnSyntax=void 0;var Cz=rg(),Tz=tg(),Pz=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new Tz.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new Cz.BindingOnSyntax(this._binding)}return r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},r}();ig.BindingWhenOnSyntax=Pz});var WA=v(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});og.BindingInSyntax=void 0;var TI=mn(),PI=CI(),Ez=function(){function r(e){this._binding=e}return r.prototype.inRequestScope=function(){return this._binding.scope=TI.BindingScopeEnum.Request,new PI.BindingWhenOnSyntax(this._binding)},r.prototype.inSingletonScope=function(){return this._binding.scope=TI.BindingScopeEnum.Singleton,new PI.BindingWhenOnSyntax(this._binding)},r.prototype.inTransientScope=function(){return this._binding.scope=TI.BindingScopeEnum.Transient,new PI.BindingWhenOnSyntax(this._binding)},r}();og.BindingInSyntax=Ez});var VA=v(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.BindingInWhenOnSyntax=void 0;var kz=WA(),Rz=rg(),Az=tg(),Dz=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new Az.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new Rz.BindingOnSyntax(this._binding),this._bindingInSyntax=new kz.BindingInSyntax(e)}return r.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},r.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},r.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},r}();sg.BindingInWhenOnSyntax=Dz});var GA=v(vi=>{"use strict";var Oz=vi&&vi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Lz=vi&&vi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Mz=vi&&vi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Oz(e,r,t);return Lz(e,r),e};Object.defineProperty(vi,"__esModule",{value:!0});vi.BindingToSyntax=void 0;var $A=Mz(or()),yr=mn(),HA=VA(),du=CI(),Nz=function(){function r(e){this._binding=e}return r.prototype.to=function(e){return this._binding.type=yr.BindingTypeEnum.Instance,this._binding.implementationType=e,new HA.BindingInWhenOnSyntax(this._binding)},r.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+$A.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},r.prototype.toConstantValue=function(e){return this._binding.type=yr.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=yr.BindingScopeEnum.Singleton,new du.BindingWhenOnSyntax(this._binding)},r.prototype.toDynamicValue=function(e){return this._binding.type=yr.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new HA.BindingInWhenOnSyntax(this._binding)},r.prototype.toConstructor=function(e){return this._binding.type=yr.BindingTypeEnum.Constructor,this._binding.implementationType=e,this._binding.scope=yr.BindingScopeEnum.Singleton,new du.BindingWhenOnSyntax(this._binding)},r.prototype.toFactory=function(e){return this._binding.type=yr.BindingTypeEnum.Factory,this._binding.factory=e,this._binding.scope=yr.BindingScopeEnum.Singleton,new du.BindingWhenOnSyntax(this._binding)},r.prototype.toFunction=function(e){if(typeof e!="function")throw new Error($A.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=yr.BindingTypeEnum.Function,this._binding.scope=yr.BindingScopeEnum.Singleton,t},r.prototype.toAutoFactory=function(e){return this._binding.type=yr.BindingTypeEnum.Factory,this._binding.factory=function(t){var n=function(){return t.container.get(e)};return n},this._binding.scope=yr.BindingScopeEnum.Singleton,new du.BindingWhenOnSyntax(this._binding)},r.prototype.toAutoNamedFactory=function(e){return this._binding.type=yr.BindingTypeEnum.Factory,this._binding.factory=function(t){return function(n){return t.container.getNamed(e,n)}},new du.BindingWhenOnSyntax(this._binding)},r.prototype.toProvider=function(e){return this._binding.type=yr.BindingTypeEnum.Provider,this._binding.provider=e,this._binding.scope=yr.BindingScopeEnum.Singleton,new du.BindingWhenOnSyntax(this._binding)},r.prototype.toService=function(e){this.toDynamicValue(function(t){return t.container.get(e)})},r}();vi.BindingToSyntax=Nz});var zA=v(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.ContainerSnapshot=void 0;var Fz=function(){function r(){}return r.of=function(e,t,n,i,o){var s=new r;return s.bindings=e,s.middleware=t,s.deactivations=i,s.activations=n,s.moduleActivationStore=o,s},r}();ag.ContainerSnapshot=Fz});var KA=v(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.isClonable=void 0;function Bz(r){return typeof r=="object"&&r!==null&&"clone"in r&&typeof r.clone=="function"}cg.isClonable=Bz});var EI=v(wi=>{"use strict";var jz=wi&&wi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Uz=wi&&wi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),qz=wi&&wi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&jz(e,r,t);return Uz(e,r),e};Object.defineProperty(wi,"__esModule",{value:!0});wi.Lookup=void 0;var Da=qz(or()),Wz=KA(),Vz=function(){function r(){this._map=new Map}return r.prototype.getMap=function(){return this._map},r.prototype.add=function(e,t){if(e==null)throw new Error(Da.NULL_ARGUMENT);if(t==null)throw new Error(Da.NULL_ARGUMENT);var n=this._map.get(e);n!==void 0?n.push(t):this._map.set(e,[t])},r.prototype.get=function(e){if(e==null)throw new Error(Da.NULL_ARGUMENT);var t=this._map.get(e);if(t!==void 0)return t;throw new Error(Da.KEY_NOT_FOUND)},r.prototype.remove=function(e){if(e==null)throw new Error(Da.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error(Da.KEY_NOT_FOUND)},r.prototype.removeIntersection=function(e){var t=this;this.traverse(function(n,i){var o=e.hasKey(n)?e.get(n):void 0;if(o!==void 0){var s=i.filter(function(a){return!o.some(function(c){return a===c})});t._setValue(n,s)}})},r.prototype.removeByCondition=function(e){var t=this,n=[];return this._map.forEach(function(i,o){for(var s=[],a=0,c=i;a<c.length;a++){var u=c[a],l=e(u);l?n.push(u):s.push(u)}t._setValue(o,s)}),n},r.prototype.hasKey=function(e){if(e==null)throw new Error(Da.NULL_ARGUMENT);return this._map.has(e)},r.prototype.clone=function(){var e=new r;return this._map.forEach(function(t,n){t.forEach(function(i){return e.add(n,(0,Wz.isClonable)(i)?i.clone():i)})}),e},r.prototype.traverse=function(e){this._map.forEach(function(t,n){e(n,t)})},r.prototype._setValue=function(e,t){t.length>0?this._map.set(e,t):this._map.delete(e)},r}();wi.Lookup=Vz});var YA=v(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.ModuleActivationStore=void 0;var JA=EI(),$z=function(){function r(){this._map=new Map}return r.prototype.remove=function(e){if(this._map.has(e)){var t=this._map.get(e);return this._map.delete(e),t}return this._getEmptyHandlersStore()},r.prototype.addDeactivation=function(e,t,n){this._getModuleActivationHandlers(e).onDeactivations.add(t,n)},r.prototype.addActivation=function(e,t,n){this._getModuleActivationHandlers(e).onActivations.add(t,n)},r.prototype.clone=function(){var e=new r;return this._map.forEach(function(t,n){e._map.set(n,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})}),e},r.prototype._getModuleActivationHandlers=function(e){var t=this._map.get(e);return t===void 0&&(t=this._getEmptyHandlersStore(),this._map.set(e,t)),t},r.prototype._getEmptyHandlersStore=function(){var e={onActivations:new JA.Lookup,onDeactivations:new JA.Lookup};return e},r}();ug.ModuleActivationStore=$z});var QA=v(Mt=>{"use strict";var pg=Mt&&Mt.__assign||function(){return pg=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},pg.apply(this,arguments)},Hz=Mt&&Mt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Gz=Mt&&Mt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),XA=Mt&&Mt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Hz(e,r,t);return Gz(e,r),e},yn=Mt&&Mt.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},bn=Mt&&Mt.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},zz=Mt&&Mt.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Container=void 0;var Kz=QR(),Yn=XA(or()),fu=mn(),Oa=XA(St()),Jz=oI(),lg=hI(),Yz=BA(),Xz=GA(),La=Bd(),Qz=as(),Zz=Aa(),e8=zA(),Ud=EI(),t8=YA(),r8=function(){function r(e){var t=e||{};if(typeof t!="object")throw new Error(""+Yn.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(t.defaultScope===void 0)t.defaultScope=fu.BindingScopeEnum.Transient;else if(t.defaultScope!==fu.BindingScopeEnum.Singleton&&t.defaultScope!==fu.BindingScopeEnum.Transient&&t.defaultScope!==fu.BindingScopeEnum.Request)throw new Error(""+Yn.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(t.autoBindInjectable===void 0)t.autoBindInjectable=!1;else if(typeof t.autoBindInjectable!="boolean")throw new Error(""+Yn.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(t.skipBaseClassChecks===void 0)t.skipBaseClassChecks=!1;else if(typeof t.skipBaseClassChecks!="boolean")throw new Error(""+Yn.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=(0,Qz.id)(),this._bindingDictionary=new Ud.Lookup,this._snapshots=[],this._middleware=null,this._activations=new Ud.Lookup,this._deactivations=new Ud.Lookup,this.parent=null,this._metadataReader=new Jz.MetadataReader,this._moduleActivationStore=new t8.ModuleActivationStore}return r.merge=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=new r,s=zz([e,t],n,!0).map(function(u){return(0,lg.getBindingDictionary)(u)}),a=(0,lg.getBindingDictionary)(o);function c(u,l){u.traverse(function(p,d){d.forEach(function(f){l.add(f.serviceIdentifier,f.clone())})})}return s.forEach(function(u){c(u,a)}),o},r.prototype.load=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=this._getContainerModuleHelpersFactory(),i=0,o=e;i<o.length;i++){var s=o[i],a=n(s.id);s.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)}},r.prototype.loadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return yn(this,void 0,void 0,function(){var n,i,o,s,a;return bn(this,function(c){switch(c.label){case 0:n=this._getContainerModuleHelpersFactory(),i=0,o=e,c.label=1;case 1:return i<o.length?(s=o[i],a=n(s.id),[4,s.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)]):[3,4];case 2:c.sent(),c.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},r.prototype.unload=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach(function(i){var o=e._removeModuleBindings(i.id);e._deactivateSingletons(o),e._removeModuleHandlers(i.id)})},r.prototype.unloadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return yn(this,void 0,void 0,function(){var n,i,o,s;return bn(this,function(a){switch(a.label){case 0:n=0,i=e,a.label=1;case 1:return n<i.length?(o=i[n],s=this._removeModuleBindings(o.id),[4,this._deactivateSingletonsAsync(s)]):[3,4];case 2:a.sent(),this._removeModuleHandlers(o.id),a.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},r.prototype.bind=function(e){var t=this.options.defaultScope||fu.BindingScopeEnum.Transient,n=new Kz.Binding(e,t);return this._bindingDictionary.add(e,n),new Xz.BindingToSyntax(n)},r.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},r.prototype.rebindAsync=function(e){return yn(this,void 0,void 0,function(){return bn(this,function(t){switch(t.label){case 0:return[4,this.unbindAsync(e)];case 1:return t.sent(),[2,this.bind(e)]}})})},r.prototype.unbind=function(e){if(this._bindingDictionary.hasKey(e)){var t=this._bindingDictionary.get(e);this._deactivateSingletons(t)}this._removeServiceFromDictionary(e)},r.prototype.unbindAsync=function(e){return yn(this,void 0,void 0,function(){var t;return bn(this,function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(e)?(t=this._bindingDictionary.get(e),[4,this._deactivateSingletonsAsync(t)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(e),[2]}})})},r.prototype.unbindAll=function(){var e=this;this._bindingDictionary.traverse(function(t,n){e._deactivateSingletons(n)}),this._bindingDictionary=new Ud.Lookup},r.prototype.unbindAllAsync=function(){return yn(this,void 0,void 0,function(){var e,t=this;return bn(this,function(n){switch(n.label){case 0:return e=[],this._bindingDictionary.traverse(function(i,o){e.push(t._deactivateSingletonsAsync(o))}),[4,Promise.all(e)];case 1:return n.sent(),this._bindingDictionary=new Ud.Lookup,[2]}})})},r.prototype.onActivation=function(e,t){this._activations.add(e,t)},r.prototype.onDeactivation=function(e,t){this._deactivations.add(e,t)},r.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},r.prototype.isCurrentBound=function(e){return this._bindingDictionary.hasKey(e)},r.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,Oa.NAMED_TAG,t)},r.prototype.isBoundTagged=function(e,t,n){var i=!1;if(this._bindingDictionary.hasKey(e)){var o=this._bindingDictionary.get(e),s=(0,lg.createMockRequest)(this,e,t,n);i=o.some(function(a){return a.constraint(s)})}return!i&&this.parent&&(i=this.parent.isBoundTagged(e,t,n)),i},r.prototype.snapshot=function(){this._snapshots.push(e8.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},r.prototype.restore=function(){var e=this._snapshots.pop();if(e===void 0)throw new Error(Yn.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=e.bindings,this._activations=e.activations,this._deactivations=e.deactivations,this._middleware=e.middleware,this._moduleActivationStore=e.moduleActivationStore},r.prototype.createChild=function(e){var t=new r(e||this.options);return t.parent=this,t},r.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce(function(i,o){return o(i)},n)},r.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},r.prototype.get=function(e){var t=this._getNotAllArgs(e,!1);return this._getButThrowIfAsync(t)},r.prototype.getAsync=function(e){return yn(this,void 0,void 0,function(){var t;return bn(this,function(n){return t=this._getNotAllArgs(e,!1),[2,this._get(t)]})})},r.prototype.getTagged=function(e,t,n){var i=this._getNotAllArgs(e,!1,t,n);return this._getButThrowIfAsync(i)},r.prototype.getTaggedAsync=function(e,t,n){return yn(this,void 0,void 0,function(){var i;return bn(this,function(o){return i=this._getNotAllArgs(e,!1,t,n),[2,this._get(i)]})})},r.prototype.getNamed=function(e,t){return this.getTagged(e,Oa.NAMED_TAG,t)},r.prototype.getNamedAsync=function(e,t){return this.getTaggedAsync(e,Oa.NAMED_TAG,t)},r.prototype.getAll=function(e){var t=this._getAllArgs(e);return this._getButThrowIfAsync(t)},r.prototype.getAllAsync=function(e){var t=this._getAllArgs(e);return this._getAll(t)},r.prototype.getAllTagged=function(e,t,n){var i=this._getNotAllArgs(e,!0,t,n);return this._getButThrowIfAsync(i)},r.prototype.getAllTaggedAsync=function(e,t,n){var i=this._getNotAllArgs(e,!0,t,n);return this._getAll(i)},r.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,Oa.NAMED_TAG,t)},r.prototype.getAllNamedAsync=function(e,t){return this.getAllTaggedAsync(e,Oa.NAMED_TAG,t)},r.prototype.resolve=function(e){var t=this.isBound(e);t||this.bind(e).toSelf();var n=this.get(e);return t||this.unbind(e),n},r.prototype._preDestroy=function(e,t){var n,i;if(Reflect.hasMetadata(Oa.PRE_DESTROY,e)){var o=Reflect.getMetadata(Oa.PRE_DESTROY,e);return(i=(n=t)[o.value])===null||i===void 0?void 0:i.call(n)}},r.prototype._removeModuleHandlers=function(e){var t=this._moduleActivationStore.remove(e);this._activations.removeIntersection(t.onActivations),this._deactivations.removeIntersection(t.onDeactivations)},r.prototype._removeModuleBindings=function(e){return this._bindingDictionary.removeByCondition(function(t){return t.moduleId===e})},r.prototype._deactivate=function(e,t){var n=this,i=Object.getPrototypeOf(t).constructor;try{if(this._deactivations.hasKey(e.serviceIdentifier)){var o=this._deactivateContainer(t,this._deactivations.get(e.serviceIdentifier).values());if((0,La.isPromise)(o))return this._handleDeactivationError(o.then(function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(e,t,i)}),i)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(e,t,i);if((0,La.isPromise)(s))return this._handleDeactivationError(s,i)}catch(a){if(a instanceof Error)throw new Error(Yn.ON_DEACTIVATION_ERROR(i.name,a.message))}},r.prototype._handleDeactivationError=function(e,t){return yn(this,void 0,void 0,function(){var n;return bn(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e];case 1:return i.sent(),[3,3];case 2:if(n=i.sent(),n instanceof Error)throw new Error(Yn.ON_DEACTIVATION_ERROR(t.name,n.message));return[3,3];case 3:return[2]}})})},r.prototype._deactivateContainer=function(e,t){for(var n=this,i=t.next();i.value;){var o=i.value(e);if((0,La.isPromise)(o))return o.then(function(){return n._deactivateContainerAsync(e,t)});i=t.next()}},r.prototype._deactivateContainerAsync=function(e,t){return yn(this,void 0,void 0,function(){var n;return bn(this,function(i){switch(i.label){case 0:n=t.next(),i.label=1;case 1:return n.value?[4,n.value(e)]:[3,3];case 2:return i.sent(),n=t.next(),[3,1];case 3:return[2]}})})},r.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(l,p){l._binding.moduleId=p},n=function(l){return function(p){var d=e.bind(p);return t(d,l),d}},i=function(){return function(l){return e.unbind(l)}},o=function(){return function(l){return e.unbindAsync(l)}},s=function(){return function(l){return e.isBound(l)}},a=function(l){return function(p){var d=e.rebind(p);return t(d,l),d}},c=function(l){return function(p,d){e._moduleActivationStore.addActivation(l,p,d),e.onActivation(p,d)}},u=function(l){return function(p,d){e._moduleActivationStore.addDeactivation(l,p,d),e.onDeactivation(p,d)}};return function(l){return{bindFunction:n(l),isboundFunction:s(),onActivationFunction:c(l),onDeactivationFunction:u(l),rebindFunction:a(l),unbindFunction:i(),unbindAsyncFunction:o()}}},r.prototype._getAll=function(e){return Promise.all(this._get(e))},r.prototype._get=function(e){var t=pg(pg({},e),{contextInterceptor:function(i){return i},targetType:fu.TargetTypeEnum.Variable});if(this._middleware){var n=this._middleware(t);if(n==null)throw new Error(Yn.INVALID_MIDDLEWARE_RETURN);return n}return this._planAndResolve()(t)},r.prototype._getButThrowIfAsync=function(e){var t=this._get(e);if((0,La.isPromiseOrContainsPromise)(t))throw new Error(Yn.LAZY_IN_SYNC(e.serviceIdentifier));return t},r.prototype._getAllArgs=function(e){var t={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:e};return t},r.prototype._getNotAllArgs=function(e,t,n,i){var o={avoidConstraints:!1,isMultiInject:t,serviceIdentifier:e,key:n,value:i};return o},r.prototype._planAndResolve=function(){var e=this;return function(t){var n=(0,lg.plan)(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);n=t.contextInterceptor(n);var i=(0,Yz.resolve)(n);return i}},r.prototype._deactivateIfSingleton=function(e){var t=this;if(e.activated)return(0,La.isPromise)(e.cache)?e.cache.then(function(n){return t._deactivate(e,n)}):this._deactivate(e,e.cache)},r.prototype._deactivateSingletons=function(e){for(var t=0,n=e;t<n.length;t++){var i=n[t],o=this._deactivateIfSingleton(i);if((0,La.isPromise)(o))throw new Error(Yn.ASYNC_UNBIND_REQUIRED)}},r.prototype._deactivateSingletonsAsync=function(e){return yn(this,void 0,void 0,function(){var t=this;return bn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(i){return t._deactivateIfSingleton(i)}))];case 1:return n.sent(),[2]}})})},r.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(e,t,n){return this.parent?this._deactivate.bind(this.parent)(e,t):this._bindingDeactivationAndPreDestroy(e,t,n)},r.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(e,t,n){return yn(this,void 0,void 0,function(){return bn(this,function(i){switch(i.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(e,t)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(e,t,n)];case 3:i.sent(),i.label=4;case 4:return[2]}})})},r.prototype._removeServiceFromDictionary=function(e){try{this._bindingDictionary.remove(e)}catch{throw new Error(Yn.CANNOT_UNBIND+" "+(0,Zz.getServiceIdentifierAsString)(e))}},r.prototype._bindingDeactivationAndPreDestroy=function(e,t,n){var i=this;if(typeof e.onDeactivation=="function"){var o=e.onDeactivation(t);if((0,La.isPromise)(o))return o.then(function(){return i._preDestroy(n,t)})}return this._preDestroy(n,t)},r.prototype._bindingDeactivationAndPreDestroyAsync=function(e,t,n){return yn(this,void 0,void 0,function(){return bn(this,function(i){switch(i.label){case 0:return typeof e.onDeactivation!="function"?[3,2]:[4,e.onDeactivation(t)];case 1:i.sent(),i.label=2;case 2:return[4,this._preDestroy(n,t)];case 3:return i.sent(),[2]}})})},r}();Mt.Container=r8});var eD=v(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.AsyncContainerModule=hu.ContainerModule=void 0;var ZA=as(),n8=function(){function r(e){this.id=(0,ZA.id)(),this.registry=e}return r}();hu.ContainerModule=n8;var i8=function(){function r(e){this.id=(0,ZA.id)(),this.registry=e}return r}();hu.AsyncContainerModule=i8});var tD=v(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.getFirstArrayDuplicate=void 0;function o8(r){for(var e=new Set,t=0,n=r;t<n.length;t++){var i=n[t];if(e.has(i))return i;e.add(i)}}dg.getFirstArrayDuplicate=o8});var So=v(cr=>{"use strict";var s8=cr&&cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),a8=cr&&cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),nD=cr&&cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&s8(e,r,t);return a8(e,r),e};Object.defineProperty(cr,"__esModule",{value:!0});cr.createTaggedDecorator=cr.tagProperty=cr.tagParameter=cr.decorate=void 0;var fg=nD(or()),iD=nD(St()),c8=tD();function u8(r){return r.prototype!==void 0}function l8(r){if(r!==void 0)throw new Error(fg.INVALID_DECORATOR_OPERATION)}function oD(r,e,t,n){l8(e),aD(iD.TAGGED,r,t.toString(),n)}cr.tagParameter=oD;function sD(r,e,t){if(u8(r))throw new Error(fg.INVALID_DECORATOR_OPERATION);aD(iD.TAGGED_PROP,r.constructor,e,t)}cr.tagProperty=sD;function p8(r){var e=[];if(Array.isArray(r)){e=r;var t=(0,c8.getFirstArrayDuplicate)(e.map(function(n){return n.key}));if(t!==void 0)throw new Error(fg.DUPLICATED_METADATA+" "+t.toString())}else e=[r];return e}function aD(r,e,t,n){var i=p8(n),o={};Reflect.hasOwnMetadata(r,e)&&(o=Reflect.getMetadata(r,e));var s=o[t];if(s===void 0)s=[];else for(var a=function(p){if(i.some(function(d){return d.key===p.key}))throw new Error(fg.DUPLICATED_METADATA+" "+p.key.toString())},c=0,u=s;c<u.length;c++){var l=u[c];a(l)}s.push.apply(s,i),o[t]=s,Reflect.defineMetadata(r,o,e)}function d8(r){return function(e,t,n){typeof n=="number"?oD(e,t,n,r):sD(e,t,r)}}cr.createTaggedDecorator=d8;function rD(r,e){Reflect.decorate(r,e)}function f8(r,e){return function(t,n){e(t,n,r)}}function h8(r,e,t){typeof t=="number"?rD([f8(t,r)],e):typeof t=="string"?Reflect.decorate([r],e,t):rD([r],e)}cr.decorate=h8});var uD=v(Si=>{"use strict";var m8=Si&&Si.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),g8=Si&&Si.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),cD=Si&&Si.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&m8(e,r,t);return g8(e,r),e};Object.defineProperty(Si,"__esModule",{value:!0});Si.injectable=void 0;var y8=cD(or()),kI=cD(St());function b8(){return function(r){if(Reflect.hasOwnMetadata(kI.PARAM_TYPES,r))throw new Error(y8.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(kI.DESIGN_PARAM_TYPES,r)||[];return Reflect.defineMetadata(kI.PARAM_TYPES,e,r),r}}Si.injectable=b8});var lD=v(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});hg.tagged=void 0;var v8=Jn(),w8=So();function S8(r,e){return(0,w8.createTaggedDecorator)(new v8.Metadata(r,e))}hg.tagged=S8});var pD=v(_i=>{"use strict";var _8=_i&&_i.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),I8=_i&&_i.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),x8=_i&&_i.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&_8(e,r,t);return I8(e,r),e};Object.defineProperty(_i,"__esModule",{value:!0});_i.named=void 0;var C8=x8(St()),T8=Jn(),P8=So();function E8(r){return(0,P8.createTaggedDecorator)(new T8.Metadata(C8.NAMED_TAG,r))}_i.named=E8});var RI=v(mg=>{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});mg.injectBase=void 0;var k8=or(),R8=Jn(),A8=So();function D8(r){return function(e){return function(t,n,i){if(e===void 0){var o=typeof t=="function"?t.name:t.constructor.name;throw new Error((0,k8.UNDEFINED_INJECT_ANNOTATION)(o))}return(0,A8.createTaggedDecorator)(new R8.Metadata(r,e))(t,n,i)}}}mg.injectBase=D8});var dD=v(Ii=>{"use strict";var O8=Ii&&Ii.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),L8=Ii&&Ii.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),M8=Ii&&Ii.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&O8(e,r,t);return L8(e,r),e};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.inject=void 0;var N8=M8(St()),F8=RI(),B8=(0,F8.injectBase)(N8.INJECT_TAG);Ii.inject=B8});var fD=v(xi=>{"use strict";var j8=xi&&xi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),U8=xi&&xi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),q8=xi&&xi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&j8(e,r,t);return U8(e,r),e};Object.defineProperty(xi,"__esModule",{value:!0});xi.optional=void 0;var W8=q8(St()),V8=Jn(),$8=So();function H8(){return(0,$8.createTaggedDecorator)(new V8.Metadata(W8.OPTIONAL_TAG,!0))}xi.optional=H8});var hD=v(Ci=>{"use strict";var G8=Ci&&Ci.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),z8=Ci&&Ci.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),K8=Ci&&Ci.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&G8(e,r,t);return z8(e,r),e};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.unmanaged=void 0;var J8=K8(St()),Y8=Jn(),X8=So();function Q8(){return function(r,e,t){var n=new Y8.Metadata(J8.UNMANAGED_TAG,!0);(0,X8.tagParameter)(r,e,t,n)}}Ci.unmanaged=Q8});var mD=v(Ti=>{"use strict";var Z8=Ti&&Ti.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),eK=Ti&&Ti.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),tK=Ti&&Ti.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Z8(e,r,t);return eK(e,r),e};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.multiInject=void 0;var rK=tK(St()),nK=RI(),iK=(0,nK.injectBase)(rK.MULTI_INJECT_TAG);Ti.multiInject=iK});var gD=v(Pi=>{"use strict";var oK=Pi&&Pi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),sK=Pi&&Pi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),aK=Pi&&Pi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&oK(e,r,t);return sK(e,r),e};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.targetName=void 0;var cK=aK(St()),uK=Jn(),lK=So();function pK(r){return function(e,t,n){var i=new uK.Metadata(cK.NAME_TAG,r);(0,lK.tagParameter)(e,t,n,i)}}Pi.targetName=pK});var AI=v(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});gg.propertyEventDecorator=void 0;var dK=Jn();function fK(r,e){return function(){return function(t,n){var i=new dK.Metadata(r,n);if(Reflect.hasOwnMetadata(r,t.constructor))throw new Error(e);Reflect.defineMetadata(r,i,t.constructor)}}}gg.propertyEventDecorator=fK});var bD=v(Ei=>{"use strict";var hK=Ei&&Ei.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),mK=Ei&&Ei.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),yD=Ei&&Ei.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&hK(e,r,t);return mK(e,r),e};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.postConstruct=void 0;var gK=yD(or()),yK=yD(St()),bK=AI(),vK=(0,bK.propertyEventDecorator)(yK.POST_CONSTRUCT,gK.MULTIPLE_POST_CONSTRUCT_METHODS);Ei.postConstruct=vK});var wD=v(ki=>{"use strict";var wK=ki&&ki.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),SK=ki&&ki.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),vD=ki&&ki.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&wK(e,r,t);return SK(e,r),e};Object.defineProperty(ki,"__esModule",{value:!0});ki.preDestroy=void 0;var _K=vD(or()),IK=vD(St()),xK=AI(),CK=(0,xK.propertyEventDecorator)(IK.PRE_DESTROY,_K.MULTIPLE_PRE_DESTROY_METHODS);ki.preDestroy=CK});var SD=v(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});yg.interfaces=void 0;var DI;DI||(DI={});yg.interfaces=DI});var N=v(z=>{"use strict";var TK=z&&z.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PK=z&&z.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),EK=z&&z.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&TK(e,r,t);return PK(e,r),e};Object.defineProperty(z,"__esModule",{value:!0});z.multiBindToService=z.getServiceIdentifierAsString=z.typeConstraint=z.namedConstraint=z.taggedConstraint=z.traverseAncerstors=z.decorate=z.interfaces=z.id=z.MetadataReader=z.preDestroy=z.postConstruct=z.targetName=z.multiInject=z.unmanaged=z.optional=z.LazyServiceIdentifer=z.LazyServiceIdentifier=z.inject=z.named=z.tagged=z.injectable=z.createTaggedDecorator=z.ContainerModule=z.AsyncContainerModule=z.TargetTypeEnum=z.BindingTypeEnum=z.BindingScopeEnum=z.Container=z.METADATA_KEY=void 0;var kK=EK(St());z.METADATA_KEY=kK;var RK=QA();Object.defineProperty(z,"Container",{enumerable:!0,get:function(){return RK.Container}});var OI=mn();Object.defineProperty(z,"BindingScopeEnum",{enumerable:!0,get:function(){return OI.BindingScopeEnum}});Object.defineProperty(z,"BindingTypeEnum",{enumerable:!0,get:function(){return OI.BindingTypeEnum}});Object.defineProperty(z,"TargetTypeEnum",{enumerable:!0,get:function(){return OI.TargetTypeEnum}});var _D=eD();Object.defineProperty(z,"AsyncContainerModule",{enumerable:!0,get:function(){return _D.AsyncContainerModule}});Object.defineProperty(z,"ContainerModule",{enumerable:!0,get:function(){return _D.ContainerModule}});var AK=So();Object.defineProperty(z,"createTaggedDecorator",{enumerable:!0,get:function(){return AK.createTaggedDecorator}});var DK=uD();Object.defineProperty(z,"injectable",{enumerable:!0,get:function(){return DK.injectable}});var OK=lD();Object.defineProperty(z,"tagged",{enumerable:!0,get:function(){return OK.tagged}});var LK=pD();Object.defineProperty(z,"named",{enumerable:!0,get:function(){return LK.named}});var MK=dD();Object.defineProperty(z,"inject",{enumerable:!0,get:function(){return MK.inject}});var NK=zm();Object.defineProperty(z,"LazyServiceIdentifier",{enumerable:!0,get:function(){return NK.LazyServiceIdentifier}});var FK=zm();Object.defineProperty(z,"LazyServiceIdentifer",{enumerable:!0,get:function(){return FK.LazyServiceIdentifier}});var BK=fD();Object.defineProperty(z,"optional",{enumerable:!0,get:function(){return BK.optional}});var jK=hD();Object.defineProperty(z,"unmanaged",{enumerable:!0,get:function(){return jK.unmanaged}});var UK=mD();Object.defineProperty(z,"multiInject",{enumerable:!0,get:function(){return UK.multiInject}});var qK=gD();Object.defineProperty(z,"targetName",{enumerable:!0,get:function(){return qK.targetName}});var WK=bD();Object.defineProperty(z,"postConstruct",{enumerable:!0,get:function(){return WK.postConstruct}});var VK=wD();Object.defineProperty(z,"preDestroy",{enumerable:!0,get:function(){return VK.preDestroy}});var $K=oI();Object.defineProperty(z,"MetadataReader",{enumerable:!0,get:function(){return $K.MetadataReader}});var HK=as();Object.defineProperty(z,"id",{enumerable:!0,get:function(){return HK.id}});var GK=SD();Object.defineProperty(z,"interfaces",{enumerable:!0,get:function(){return GK.interfaces}});var zK=So();Object.defineProperty(z,"decorate",{enumerable:!0,get:function(){return zK.decorate}});var bg=xI();Object.defineProperty(z,"traverseAncerstors",{enumerable:!0,get:function(){return bg.traverseAncerstors}});Object.defineProperty(z,"taggedConstraint",{enumerable:!0,get:function(){return bg.taggedConstraint}});Object.defineProperty(z,"namedConstraint",{enumerable:!0,get:function(){return bg.namedConstraint}});Object.defineProperty(z,"typeConstraint",{enumerable:!0,get:function(){return bg.typeConstraint}});var KK=Aa();Object.defineProperty(z,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return KK.getServiceIdentifierAsString}});var JK=yI();Object.defineProperty(z,"multiBindToService",{enumerable:!0,get:function(){return JK.multiBindToService}})});var xD=v(()=>{var ID;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),n=i(r);typeof t.Reflect<"u"&&(n=i(t.Reflect,n)),e(n,t),typeof t.Reflect>"u"&&(t.Reflect=r);function i(c,u){return function(l,p){Object.defineProperty(c,l,{configurable:!0,writable:!0,value:p}),u&&u(l,p)}}function o(){try{return Function("return this;")()}catch{}}function s(){try{return(0,eval)("(function() { return this; })()")}catch{}}function a(){return o()||s()}})(function(e,t){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",o=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!a&&!c,l={create:a?function(){return u_(Object.create(null))}:c?function(){return u_({__proto__:null})}:function(){return u_({})},has:u?function(_,C){return n.call(_,C)}:function(_,C){return C in _},get:u?function(_,C){return n.call(_,C)?_[C]:void 0}:function(_,C){return _[C]}},p=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:e5(),f=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:t5(),h=typeof WeakMap=="function"?WeakMap:r5(),m=i?Symbol.for("@reflect-metadata:registry"):void 0,y=XH(),I=QH(y);function L(_,C,D,U){if(re(D)){if(!V(_))throw new TypeError;if(!Ve(C))throw new TypeError;return Se(_,C)}else{if(!V(_))throw new TypeError;if(!Be(C))throw new TypeError;if(!Be(U)&&!re(U)&&!ts(U))throw new TypeError;return ts(U)&&(U=void 0),D=be(D),ge(_,C,D,U)}}e("decorate",L);function P(_,C){function D(U,te){if(!Be(U))throw new TypeError;if(!re(te)&&!Yt(te))throw new TypeError;_e(_,C,U,te)}return D}e("metadata",P);function W(_,C,D,U){if(!Be(D))throw new TypeError;return re(U)||(U=be(U)),_e(_,C,D,U)}e("defineMetadata",W);function E(_,C,D){if(!Be(C))throw new TypeError;return re(D)||(D=be(D)),oe(_,C,D)}e("hasMetadata",E);function M(_,C,D){if(!Be(C))throw new TypeError;return re(D)||(D=be(D)),x(_,C,D)}e("hasOwnMetadata",M);function k(_,C,D){if(!Be(C))throw new TypeError;return re(D)||(D=be(D)),R(_,C,D)}e("getMetadata",k);function j(_,C,D){if(!Be(C))throw new TypeError;return re(D)||(D=be(D)),Fe(_,C,D)}e("getOwnMetadata",j);function Z(_,C){if(!Be(_))throw new TypeError;return re(C)||(C=be(C)),Hr(_,C)}e("getMetadataKeys",Z);function he(_,C){if(!Be(_))throw new TypeError;return re(C)||(C=be(C)),Gr(_,C)}e("getOwnMetadataKeys",he);function A(_,C,D){if(!Be(C))throw new TypeError;if(re(D)||(D=be(D)),!Be(C))throw new TypeError;re(D)||(D=be(D));var U=wd(C,D,!1);return re(U)?!1:U.OrdinaryDeleteMetadata(_,C,D)}e("deleteMetadata",A);function Se(_,C){for(var D=_.length-1;D>=0;--D){var U=_[D],te=U(C);if(!re(te)&&!ts(te)){if(!Ve(te))throw new TypeError;C=te}}return C}function ge(_,C,D,U){for(var te=_.length-1;te>=0;--te){var ht=_[te],Et=ht(C,D,U);if(!re(Et)&&!ts(Et)){if(!Be(Et))throw new TypeError;U=Et}}return U}function oe(_,C,D){var U=x(_,C,D);if(U)return!0;var te=c_(C);return ts(te)?!1:oe(_,te,D)}function x(_,C,D){var U=wd(C,D,!1);return re(U)?!1:im(U.OrdinaryHasOwnMetadata(_,C,D))}function R(_,C,D){var U=x(_,C,D);if(U)return Fe(_,C,D);var te=c_(C);if(!ts(te))return R(_,te,D)}function Fe(_,C,D){var U=wd(C,D,!1);if(!re(U))return U.OrdinaryGetOwnMetadata(_,C,D)}function _e(_,C,D,U){var te=wd(D,U,!0);te.OrdinaryDefineOwnMetadata(_,C,D,U)}function Hr(_,C){var D=Gr(_,C),U=c_(_);if(U===null)return D;var te=Hr(U,C);if(te.length<=0)return D;if(D.length<=0)return te;for(var ht=new f,Et=[],ye=0,H=D;ye<H.length;ye++){var Y=H[ye],J=ht.has(Y);J||(ht.add(Y),Et.push(Y))}for(var Q=0,ve=te;Q<ve.length;Q++){var Y=ve[Q],J=ht.has(Y);J||(ht.add(Y),Et.push(Y))}return Et}function Gr(_,C){var D=wd(_,C,!1);return D?D.OrdinaryOwnMetadataKeys(_,C):[]}function rr(_){if(_===null)return 1;switch(typeof _){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return _===null?1:6;default:return 6}}function re(_){return _===void 0}function ts(_){return _===null}function Xc(_){return typeof _=="symbol"}function Be(_){return typeof _=="object"?_!==null:typeof _=="function"}function me(_,C){switch(rr(_)){case 0:return _;case 1:return _;case 2:return _;case 3:return _;case 4:return _;case 5:return _}var D=C===3?"string":C===5?"number":"default",U=Zc(_,o);if(U!==void 0){var te=U.call(_,D);if(Be(te))throw new TypeError;return te}return Qc(_,D==="default"?"number":D)}function Qc(_,C){if(C==="string"){var D=_.toString;if(ae(D)){var U=D.call(_);if(!Be(U))return U}var te=_.valueOf;if(ae(te)){var U=te.call(_);if(!Be(U))return U}}else{var te=_.valueOf;if(ae(te)){var U=te.call(_);if(!Be(U))return U}var ht=_.toString;if(ae(ht)){var U=ht.call(_);if(!Be(U))return U}}throw new TypeError}function im(_){return!!_}function G(_){return""+_}function be(_){var C=me(_,3);return Xc(C)?C:G(C)}function V(_){return Array.isArray?Array.isArray(_):_ instanceof Object?_ instanceof Array:Object.prototype.toString.call(_)==="[object Array]"}function ae(_){return typeof _=="function"}function Ve(_){return typeof _=="function"}function Yt(_){switch(rr(_)){case 3:return!0;case 4:return!0;default:return!1}}function ot(_,C){return _===C||_!==_&&C!==C}function Zc(_,C){var D=_[C];if(D!=null){if(!ae(D))throw new TypeError;return D}}function Ea(_){var C=Zc(_,s);if(!ae(C))throw new TypeError;var D=C.call(_);if(!Be(D))throw new TypeError;return D}function FE(_){return _.value}function BE(_){var C=_.next();return C.done?!1:C}function jE(_){var C=_.return;C&&C.call(_)}function c_(_){var C=Object.getPrototypeOf(_);if(typeof _!="function"||_===p||C!==p)return C;var D=_.prototype,U=D&&Object.getPrototypeOf(D);if(U==null||U===Object.prototype)return C;var te=U.constructor;return typeof te!="function"||te===_?C:te}function YH(){var _;!re(m)&&typeof t.Reflect<"u"&&!(m in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(_=ZH(t.Reflect));var C,D,U,te=new h,ht={registerProvider:Et,getProvider:H,setProvider:J};return ht;function Et(Q){if(!Object.isExtensible(ht))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case _===Q:break;case re(C):C=Q;break;case C===Q:break;case re(D):D=Q;break;case D===Q:break;default:U===void 0&&(U=new f),U.add(Q);break}}function ye(Q,ve){if(!re(C)){if(C.isProviderFor(Q,ve))return C;if(!re(D)){if(D.isProviderFor(Q,ve))return C;if(!re(U))for(var ze=Ea(U);;){var mt=BE(ze);if(!mt)return;var Hn=FE(mt);if(Hn.isProviderFor(Q,ve))return jE(ze),Hn}}}if(!re(_)&&_.isProviderFor(Q,ve))return _}function H(Q,ve){var ze=te.get(Q),mt;return re(ze)||(mt=ze.get(ve)),re(mt)&&(mt=ye(Q,ve),re(mt)||(re(ze)&&(ze=new d,te.set(Q,ze)),ze.set(ve,mt))),mt}function Y(Q){if(re(Q))throw new TypeError;return C===Q||D===Q||!re(U)&&U.has(Q)}function J(Q,ve,ze){if(!Y(ze))throw new Error("Metadata provider not registered.");var mt=H(Q,ve);if(mt!==ze){if(!re(mt))return!1;var Hn=te.get(Q);re(Hn)&&(Hn=new d,te.set(Q,Hn)),Hn.set(ve,ze)}return!0}}function XH(){var _;return!re(m)&&Be(t.Reflect)&&Object.isExtensible(t.Reflect)&&(_=t.Reflect[m]),re(_)&&(_=YH()),!re(m)&&Be(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,m,{enumerable:!1,configurable:!1,writable:!1,value:_}),_}function QH(_){var C=new h,D={isProviderFor:function(Y,J){var Q=C.get(Y);return re(Q)?!1:Q.has(J)},OrdinaryDefineOwnMetadata:Et,OrdinaryHasOwnMetadata:te,OrdinaryGetOwnMetadata:ht,OrdinaryOwnMetadataKeys:ye,OrdinaryDeleteMetadata:H};return y.registerProvider(D),D;function U(Y,J,Q){var ve=C.get(Y),ze=!1;if(re(ve)){if(!Q)return;ve=new d,C.set(Y,ve),ze=!0}var mt=ve.get(J);if(re(mt)){if(!Q)return;if(mt=new d,ve.set(J,mt),!_.setProvider(Y,J,D))throw ve.delete(J),ze&&C.delete(Y),new Error("Wrong provider for target.")}return mt}function te(Y,J,Q){var ve=U(J,Q,!1);return re(ve)?!1:im(ve.has(Y))}function ht(Y,J,Q){var ve=U(J,Q,!1);if(!re(ve))return ve.get(Y)}function Et(Y,J,Q,ve){var ze=U(Q,ve,!0);ze.set(Y,J)}function ye(Y,J){var Q=[],ve=U(Y,J,!1);if(re(ve))return Q;for(var ze=ve.keys(),mt=Ea(ze),Hn=0;;){var UE=BE(mt);if(!UE)return Q.length=Hn,Q;var n5=FE(UE);try{Q[Hn]=n5}catch(i5){try{jE(mt)}finally{throw i5}}Hn++}}function H(Y,J,Q){var ve=U(J,Q,!1);if(re(ve)||!ve.delete(Y))return!1;if(ve.size===0){var ze=C.get(J);re(ze)||(ze.delete(Q),ze.size===0&&C.delete(ze))}return!0}}function ZH(_){var C=_.defineMetadata,D=_.hasOwnMetadata,U=_.getOwnMetadata,te=_.getOwnMetadataKeys,ht=_.deleteMetadata,Et=new h,ye={isProviderFor:function(H,Y){var J=Et.get(H);return re(J)?te(H,Y).length?(re(J)&&(J=new f,Et.set(H,J)),J.add(Y),!0):!1:J.has(Y)},OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:U,OrdinaryOwnMetadataKeys:te,OrdinaryDeleteMetadata:ht};return ye}function wd(_,C,D){var U=y.getProvider(_,C);if(!re(U))return U;if(D){if(y.setProvider(_,C,I))return I;throw new Error("Illegal state.")}}function e5(){var _={},C=[],D=function(){function ye(H,Y,J){this._index=0,this._keys=H,this._values=Y,this._selector=J}return ye.prototype["@@iterator"]=function(){return this},ye.prototype[s]=function(){return this},ye.prototype.next=function(){var H=this._index;if(H>=0&&H<this._keys.length){var Y=this._selector(this._keys[H],this._values[H]);return H+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:Y,done:!1}}return{value:void 0,done:!0}},ye.prototype.throw=function(H){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),H},ye.prototype.return=function(H){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:H,done:!0}},ye}(),U=function(){function ye(){this._keys=[],this._values=[],this._cacheKey=_,this._cacheIndex=-2}return Object.defineProperty(ye.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ye.prototype.has=function(H){return this._find(H,!1)>=0},ye.prototype.get=function(H){var Y=this._find(H,!1);return Y>=0?this._values[Y]:void 0},ye.prototype.set=function(H,Y){var J=this._find(H,!0);return this._values[J]=Y,this},ye.prototype.delete=function(H){var Y=this._find(H,!1);if(Y>=0){for(var J=this._keys.length,Q=Y+1;Q<J;Q++)this._keys[Q-1]=this._keys[Q],this._values[Q-1]=this._values[Q];return this._keys.length--,this._values.length--,ot(H,this._cacheKey)&&(this._cacheKey=_,this._cacheIndex=-2),!0}return!1},ye.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=_,this._cacheIndex=-2},ye.prototype.keys=function(){return new D(this._keys,this._values,te)},ye.prototype.values=function(){return new D(this._keys,this._values,ht)},ye.prototype.entries=function(){return new D(this._keys,this._values,Et)},ye.prototype["@@iterator"]=function(){return this.entries()},ye.prototype[s]=function(){return this.entries()},ye.prototype._find=function(H,Y){if(!ot(this._cacheKey,H)){this._cacheIndex=-1;for(var J=0;J<this._keys.length;J++)if(ot(this._keys[J],H)){this._cacheIndex=J;break}}return this._cacheIndex<0&&Y&&(this._cacheIndex=this._keys.length,this._keys.push(H),this._values.push(void 0)),this._cacheIndex},ye}();return U;function te(ye,H){return ye}function ht(ye,H){return H}function Et(ye,H){return[ye,H]}}function t5(){var _=function(){function C(){this._map=new d}return Object.defineProperty(C.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),C.prototype.has=function(D){return this._map.has(D)},C.prototype.add=function(D){return this._map.set(D,D),this},C.prototype.delete=function(D){return this._map.delete(D)},C.prototype.clear=function(){this._map.clear()},C.prototype.keys=function(){return this._map.keys()},C.prototype.values=function(){return this._map.keys()},C.prototype.entries=function(){return this._map.entries()},C.prototype["@@iterator"]=function(){return this.keys()},C.prototype[s]=function(){return this.keys()},C}();return _}function r5(){var _=16,C=l.create(),D=U();return function(){function H(){this._key=U()}return H.prototype.has=function(Y){var J=te(Y,!1);return J!==void 0?l.has(J,this._key):!1},H.prototype.get=function(Y){var J=te(Y,!1);return J!==void 0?l.get(J,this._key):void 0},H.prototype.set=function(Y,J){var Q=te(Y,!0);return Q[this._key]=J,this},H.prototype.delete=function(Y){var J=te(Y,!1);return J!==void 0?delete J[this._key]:!1},H.prototype.clear=function(){this._key=U()},H}();function U(){var H;do H="@@WeakMap@@"+ye();while(l.has(C,H));return C[H]=!0,H}function te(H,Y){if(!n.call(H,D)){if(!Y)return;Object.defineProperty(H,D,{value:l.create()})}return H[D]}function ht(H,Y){for(var J=0;J<Y;++J)H[J]=Math.random()*255|0;return H}function Et(H){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(H)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(H)):ht(new Uint8Array(H),H):ht(new Array(H),H)}function ye(){var H=Et(_);H[6]=H[6]&79|64,H[8]=H[8]&191|128;for(var Y="",J=0;J<_;++J){var Q=H[J];(J===4||J===6||J===8)&&(Y+="-"),Q<16&&(Y+="0"),Y+=Q.toString(16).toLowerCase()}return Y}}function u_(_){return _.__=void 0,delete _.__,_}})})(ID||(ID={}))});var SO=v((qle,Ka)=>{var vO={};vO.__wbindgen_placeholder__=Ka.exports;var Wi,{TextDecoder:y7}=require("util"),cy=null;function mx(){return(cy===null||cy.byteLength===0)&&(cy=new Uint8Array(Wi.memory.buffer)),cy}function b7(r,e){return r=r>>>0,mx().subarray(r/1,r/1+e)}var Eo=new Array(128).fill(void 0);Eo.push(void 0,null,!0,!1);function uy(r){return Eo[r]}var nf=Eo.length;function v7(r){r<132||(Eo[r]=nf,nf=r)}function w7(r){let e=uy(r);return v7(r),e}var wO=new y7("utf-8",{ignoreBOM:!0,fatal:!0});wO.decode();function S7(r,e){return r=r>>>0,wO.decode(mx().subarray(r,r+e))}var fx=0;function yO(r,e){let t=e(r.length*1,1)>>>0;return mx().set(r,t/1),fx=r.length,t}function _7(r){nf===Eo.length&&Eo.push(Eo.length+1);let e=nf;return nf=Eo[e],Eo[e]=r,e}var bO=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>Wi.__wbg_hasher_free(r>>>0,1)),hx=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,bO.unregister(this),e}free(){let e=this.__destroy_into_raw();Wi.__wbg_hasher_free(e,0)}constructor(){let e=Wi.hasher_new();return this.__wbg_ptr=e>>>0,bO.register(this,this.__wbg_ptr,this),this}update(e){let t=yO(e,Wi.__wbindgen_malloc),n=fx;Wi.hasher_update(this.__wbg_ptr,t,n)}digest(e){var t=yO(e,Wi.__wbindgen_malloc),n=fx;Wi.hasher_digest(this.__wbg_ptr,t,n,_7(e))}};Ka.exports.Hasher=hx;Ka.exports.__wbindgen_copy_to_typed_array=function(r,e,t){new Uint8Array(uy(t).buffer,uy(t).byteOffset,uy(t).byteLength).set(b7(r,e))};Ka.exports.__wbindgen_object_drop_ref=function(r){w7(r)};Ka.exports.__wbindgen_throw=function(r,e){throw new Error(S7(r,e))};var I7=require("path").join(__dirname,"chromehash_bg.wasm"),x7=require("fs").readFileSync(I7),C7=new WebAssembly.Module(x7),T7=new WebAssembly.Instance(C7,vO);Wi=T7.exports;Ka.exports.__wasm=Wi});var PO=v(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.normalizeShaBuffer=Qr.shaHashFile=Qr.hashFile=Qr.shaHash=Qr.hash=void 0;var xO=SO(),CO=require("fs"),_O=require("string_decoder"),TO=require("crypto"),py=Buffer.alloc(4*5),P7=r=>{let e=new xO.Hasher;return e.update(A7(r)),e.digest(py),e.free(),py.toString("hex")};Qr.hash=P7;var E7=r=>{let e=(0,TO.createHash)("sha256");return e.update((0,Qr.normalizeShaBuffer)(r)),e.digest("hex")};Qr.shaHash=E7;var k7=async(r,e=4096)=>{e%2===1&&e++;let t=Buffer.alloc(e),n=new xO.Hasher,i;try{i=await CO.promises.open(r,"r");let o=await i.read(t,0,t.length,null),s=t.slice(0,o.bytesRead);if(fy(s))for(n.update(s.slice(2));o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead));else if(hy(s))for(n.update(s.slice(2).swap16());o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead).swap16());else if(dy(s)){let a=new _O.StringDecoder("utf8");for(n.update(Buffer.from(a.write(s.slice(3)),"utf16le"));o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(Buffer.from(a.write(t.slice(0,o.bytesRead)),"utf16le"))}else{let a=new _O.StringDecoder("utf8");for(n.update(Buffer.from(a.write(s),"utf16le"));o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(Buffer.from(a.write(t.slice(0,o.bytesRead)),"utf16le"))}return n.digest(py),py.toString("hex")}finally{n.free(),i!==void 0&&await i.close()}};Qr.hashFile=k7;var ly={stream:!0},R7=async(r,e=4096)=>{e%2===1&&e++;let t=Buffer.alloc(e),n=(0,TO.createHash)("sha256"),i;try{i=await CO.promises.open(r,"r");let o=await i.read(t,0,t.length,null),s=t.slice(0,o.bytesRead);if(fy(s)){let a=new TextDecoder("utf-16le");for(n.update(a.decode(s.slice(2),ly));o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(a.decode(t.slice(0,o.bytesRead),ly))}else if(hy(s)){let a=new TextDecoder("utf-16be");for(n.update(a.decode(s.slice(2),ly));o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(a.decode(t.slice(0,o.bytesRead),ly))}else if(dy(s))for(n.update(s.slice(3));o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead));else for(n.update(s);o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead));return n.digest("hex")}finally{await i?.close()}};Qr.shaHashFile=R7;var dy=r=>r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191,fy=r=>r.length>=2&&r[0]===255&&r[1]===254,hy=r=>r.length>=2&&r[0]===254&&r[1]===255,A7=r=>dy(r)?IO(r.slice(3)):fy(r)?r.slice(2):hy(r)?r.slice(2).swap16():IO(r),D7=r=>dy(r)?r.slice(3):fy(r)?new TextEncoder().encode(new TextDecoder("utf-16le").decode(r.slice(2))):hy(r)?new TextEncoder().encode(new TextDecoder("utf-16be").decode(r.slice(2))):r;Qr.normalizeShaBuffer=D7;var IO=r=>Buffer.from(r.toString("utf8"),"utf16le")});var Py=v(In=>{"use strict";In.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;In.find=(r,e)=>r.nodes.find(t=>t.type===e);In.exceedsLimit=(r,e,t=1,n)=>n===!1||!In.isInteger(r)||!In.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;In.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};In.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;In.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;In.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;In.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);In.flatten=(...r)=>{let e=[],t=n=>{for(let i=0;i<n.length;i++){let o=n[i];if(Array.isArray(o)){t(o);continue}o!==void 0&&e.push(o)}return e};return t(r),e}});var Ey=v((Hde,QO)=>{"use strict";var XO=Py();QO.exports=(r,e={})=>{let t=(n,i={})=>{let o=e.escapeInvalid&&XO.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(o||s)&&XO.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var eL=v((Gde,ZO)=>{"use strict";ZO.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var uL=v((zde,cL)=>{"use strict";var tL=eL(),Za=(r,e,t)=>{if(tL(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(tL(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),o=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+i+o+s+a;if(Za.cache.hasOwnProperty(c))return Za.cache[c].result;let u=Math.min(r,e),l=Math.max(r,e);if(Math.abs(u-l)===1){let m=r+"|"+e;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let p=aL(r)||aL(e),d={min:r,max:e,a:u,b:l},f=[],h=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),u<0){let m=l<0?Math.abs(l):1;h=rL(m,Math.abs(u),d,n),u=d.a=0}return l>=0&&(f=rL(u,l,d,n)),d.negatives=h,d.positives=f,d.result=Q7(h,f,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&f.length+h.length>1&&(d.result=`(?:${d.result})`),Za.cache[c]=d,d.result};function Q7(r,e,t){let n=Sx(r,e,"-",!1,t)||[],i=Sx(e,r,"",!1,t)||[],o=Sx(r,e,"-?",!0,t)||[];return n.concat(o).concat(i).join("|")}function Z7(r,e){let t=1,n=1,i=iL(r,t),o=new Set([e]);for(;r<=i&&i<=e;)o.add(i),t+=1,i=iL(r,t);for(i=oL(e+1,n)-1;r<i&&i<=e;)o.add(i),n+=1,i=oL(e+1,n)-1;return o=[...o],o.sort(rJ),o}function eJ(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=tJ(r,e),i=n.length,o="",s=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?o+=c:c!=="0"||u!=="9"?o+=nJ(c,u,t):s++}return s&&(o+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[s],digits:i}}function rL(r,e,t,n){let i=Z7(r,e),o=[],s=r,a;for(let c=0;c<i.length;c++){let u=i[c],l=eJ(String(s),String(u),n),p="";if(!t.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+sL(a.count),s=u+1;continue}t.isPadded&&(p=iJ(u,t,n)),l.string=p+l.pattern+sL(l.count),o.push(l),s=u+1,a=l}return o}function Sx(r,e,t,n,i){let o=[];for(let s of r){let{string:a}=s;!n&&!nL(e,"string",a)&&o.push(t+a),n&&nL(e,"string",a)&&o.push(t+a)}return o}function tJ(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function rJ(r,e){return r>e?1:e>r?-1:0}function nL(r,e,t){return r.some(n=>n[e]===t)}function iL(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function oL(r,e){return r-r%Math.pow(10,e)}function sL(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function nJ(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function aL(r){return/^-?(0+)\d/.test(r)}function iJ(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),i=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Za.cache={};Za.clearCache=()=>Za.cache={};cL.exports=Za});var xx=v((Kde,gL)=>{"use strict";var oJ=require("util"),pL=uL(),lL=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),sJ=r=>e=>r===!0?Number(e):String(e),_x=r=>typeof r=="number"||typeof r=="string"&&r!=="",sf=r=>Number.isInteger(+r),Ix=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},aJ=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,cJ=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},Ry=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},uJ=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",o="",s;return r.positives.length&&(i=r.positives.map(a=>Ry(String(a),t)).join("|")),r.negatives.length&&(o=`-(${n}${r.negatives.map(a=>Ry(String(a),t)).join("|")})`),i&&o?s=`${i}|${o}`:s=i||o,e.wrap?`(${n}${s})`:s},dL=(r,e,t,n)=>{if(t)return pL(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let o=String.fromCharCode(e);return`[${i}-${o}]`},fL=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return pL(r,e,t)},hL=(...r)=>new RangeError("Invalid range arguments: "+oJ.inspect(...r)),mL=(r,e,t)=>{if(t.strictRanges===!0)throw hL([r,e]);return[]},lJ=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},pJ=(r,e,t=1,n={})=>{let i=Number(r),o=Number(e);if(!Number.isInteger(i)||!Number.isInteger(o)){if(n.strictRanges===!0)throw hL([r,e]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,a=String(r),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let l=Ix(a)||Ix(c)||Ix(u),p=l?Math.max(a.length,c.length,u.length):0,d=l===!1&&aJ(r,e,n)===!1,f=n.transform||sJ(d);if(n.toRegex&&t===1)return dL(Ry(r,p),Ry(e,p),!0,n);let h={negatives:[],positives:[]},m=L=>h[L<0?"negatives":"positives"].push(Math.abs(L)),y=[],I=0;for(;s?i>=o:i<=o;)n.toRegex===!0&&t>1?m(i):y.push(cJ(f(i,I),p,d)),i=s?i-t:i+t,I++;return n.toRegex===!0?t>1?uJ(h,n,p):fL(y,null,{wrap:!1,...n}):y},dJ=(r,e,t=1,n={})=>{if(!sf(r)&&r.length>1||!sf(e)&&e.length>1)return mL(r,e,n);let i=n.transform||(d=>String.fromCharCode(d)),o=`${r}`.charCodeAt(0),s=`${e}`.charCodeAt(0),a=o>s,c=Math.min(o,s),u=Math.max(o,s);if(n.toRegex&&t===1)return dL(c,u,!1,n);let l=[],p=0;for(;a?o>=s:o<=s;)l.push(i(o,p)),o=a?o-t:o+t,p++;return n.toRegex===!0?fL(l,null,{wrap:!1,options:n}):l},ky=(r,e,t,n={})=>{if(e==null&&_x(r))return[r];if(!_x(r)||!_x(e))return mL(r,e,n);if(typeof t=="function")return ky(r,e,1,{transform:t});if(lL(t))return ky(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,sf(t)?sf(r)&&sf(e)?pJ(r,e,t,i):dJ(r,e,Math.max(Math.abs(t),1),i):t!=null&&!lL(t)?lJ(t,i):ky(r,e,1,t)};gL.exports=ky});var vL=v((Jde,bL)=>{"use strict";var fJ=xx(),yL=Py(),hJ=(r,e={})=>{let t=(n,i={})=>{let o=yL.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a=o===!0||s===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=yL.reduce(n.nodes),p=fJ(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)u+=t(l,n);return u};return t(r)};bL.exports=hJ});var _L=v((Yde,SL)=>{"use strict";var mJ=xx(),wL=Ey(),Wu=Py(),ec=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Wu.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let o of i)n.push(ec(o,e,t));else for(let o of e)t===!0&&typeof o=="string"&&(o=`{${o}}`),n.push(Array.isArray(o)?ec(i,o,t):i+o);return Wu.flatten(n)},gJ=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,o={})=>{i.queue=[];let s=o,a=o.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(i.invalid||i.dollar){a.push(ec(a.pop(),wL(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(ec(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let p=Wu.reduce(i.nodes);if(Wu.exceedsLimit(...p,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=mJ(...p,e);d.length===0&&(d=wL(i,e)),a.push(ec(a.pop(),d)),i.nodes=[];return}let c=Wu.encloseBrace(i),u=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let p=0;p<i.nodes.length;p++){let d=i.nodes[p];if(d.type==="comma"&&i.type==="brace"){p===1&&u.push(""),u.push("");continue}if(d.type==="close"){a.push(ec(a.pop(),u,c));continue}if(d.value&&d.type!=="open"){u.push(ec(u.pop(),d.value));continue}d.nodes&&n(d,i)}return u};return Wu.flatten(n(r))};SL.exports=gJ});var xL=v((Xde,IL)=>{"use strict";IL.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"	",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var kL=v((Qde,EL)=>{"use strict";var yJ=Ey(),{MAX_LENGTH:CL,CHAR_BACKSLASH:Cx,CHAR_BACKTICK:bJ,CHAR_COMMA:vJ,CHAR_DOT:wJ,CHAR_LEFT_PARENTHESES:SJ,CHAR_RIGHT_PARENTHESES:_J,CHAR_LEFT_CURLY_BRACE:IJ,CHAR_RIGHT_CURLY_BRACE:xJ,CHAR_LEFT_SQUARE_BRACKET:TL,CHAR_RIGHT_SQUARE_BRACKET:PL,CHAR_DOUBLE_QUOTE:CJ,CHAR_SINGLE_QUOTE:TJ,CHAR_NO_BREAK_SPACE:PJ,CHAR_ZERO_WIDTH_NOBREAK_SPACE:EJ}=xL(),kJ=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(CL,t.maxLength):CL;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},o=[i],s=i,a=i,c=0,u=r.length,l=0,p=0,d,f=()=>r[l++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(h({type:"bos"});l<u;)if(s=o[o.length-1],d=f(),!(d===EJ||d===PJ)){if(d===Cx){h({type:"text",value:(e.keepEscaping?d:"")+f()});continue}if(d===PL){h({type:"text",value:"\\"+d});continue}if(d===TL){c++;let m;for(;l<u&&(m=f());){if(d+=m,m===TL){c++;continue}if(m===Cx){d+=f();continue}if(m===PL&&(c--,c===0))break}h({type:"text",value:d});continue}if(d===SJ){s=h({type:"paren",nodes:[]}),o.push(s),h({type:"text",value:d});continue}if(d===_J){if(s.type!=="paren"){h({type:"text",value:d});continue}s=o.pop(),h({type:"text",value:d}),s=o[o.length-1];continue}if(d===CJ||d===TJ||d===bJ){let m=d,y;for(e.keepQuotes!==!0&&(d="");l<u&&(y=f());){if(y===Cx){d+=y+f();continue}if(y===m){e.keepQuotes===!0&&(d+=y);break}d+=y}h({type:"text",value:d});continue}if(d===IJ){p++;let y={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=h(y),o.push(s),h({type:"open",value:d});continue}if(d===xJ){if(s.type!=="brace"){h({type:"text",value:d});continue}let m="close";s=o.pop(),s.close=!0,h({type:m,value:d}),p--,s=o[o.length-1];continue}if(d===vJ&&p>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:yJ(s)}]}h({type:"comma",value:d}),s.commas++;continue}if(d===wJ&&p>0&&s.commas===0){let m=s.nodes;if(p===0||m.length===0){h({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let y=m[m.length-1];y.value+=a.value+d,a=y,s.ranges--;continue}h({type:"dot",value:d});continue}h({type:"text",value:d})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(I=>{I.nodes||(I.type==="open"&&(I.isOpen=!0),I.type==="close"&&(I.isClose=!0),I.nodes||(I.type="text"),I.invalid=!0)});let m=o[o.length-1],y=m.nodes.indexOf(s);m.nodes.splice(y,1,...s.nodes)}while(o.length>0);return h({type:"eos"}),i};EL.exports=kJ});var DL=v((Zde,AL)=>{"use strict";var RL=Ey(),RJ=vL(),AJ=_L(),DJ=kL(),Zr=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=Zr.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(Zr.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};Zr.parse=(r,e={})=>DJ(r,e);Zr.stringify=(r,e={})=>RL(typeof r=="string"?Zr.parse(r,e):r,e);Zr.compile=(r,e={})=>(typeof r=="string"&&(r=Zr.parse(r,e)),RJ(r,e));Zr.expand=(r,e={})=>{typeof r=="string"&&(r=Zr.parse(r,e));let t=AJ(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};Zr.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?Zr.compile(r,e):Zr.expand(r,e);AL.exports=Zr});var af=v((efe,FL)=>{"use strict";var OJ=require("path"),$i="\\\\/",OL=`[^${$i}]`,Ao="\\.",LJ="\\+",MJ="\\?",Ay="\\/",NJ="(?=.)",LL="[^/]",Tx=`(?:${Ay}|$)`,ML=`(?:^|${Ay})`,Px=`${Ao}{1,2}${Tx}`,FJ=`(?!${Ao})`,BJ=`(?!${ML}${Px})`,jJ=`(?!${Ao}{0,1}${Tx})`,UJ=`(?!${Px})`,qJ=`[^.${Ay}]`,WJ=`${LL}*?`,NL={DOT_LITERAL:Ao,PLUS_LITERAL:LJ,QMARK_LITERAL:MJ,SLASH_LITERAL:Ay,ONE_CHAR:NJ,QMARK:LL,END_ANCHOR:Tx,DOTS_SLASH:Px,NO_DOT:FJ,NO_DOTS:BJ,NO_DOT_SLASH:jJ,NO_DOTS_SLASH:UJ,QMARK_NO_DOT:qJ,STAR:WJ,START_ANCHOR:ML},VJ={...NL,SLASH_LITERAL:`[${$i}]`,QMARK:OL,STAR:`${OL}*?`,DOTS_SLASH:`${Ao}{1,2}(?:[${$i}]|$)`,NO_DOT:`(?!${Ao})`,NO_DOTS:`(?!(?:^|[${$i}])${Ao}{1,2}(?:[${$i}]|$))`,NO_DOT_SLASH:`(?!${Ao}{0,1}(?:[${$i}]|$))`,NO_DOTS_SLASH:`(?!${Ao}{1,2}(?:[${$i}]|$))`,QMARK_NO_DOT:`[^.${$i}]`,START_ANCHOR:`(?:^|[${$i}])`,END_ANCHOR:`(?:[${$i}]|$)`},$J={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};FL.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$J,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:OJ.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?VJ:NL}}});var cf=v(Dr=>{"use strict";var HJ=require("path"),GJ=process.platform==="win32",{REGEX_BACKSLASH:zJ,REGEX_REMOVE_BACKSLASH:KJ,REGEX_SPECIAL_CHARS:JJ,REGEX_SPECIAL_CHARS_GLOBAL:YJ}=af();Dr.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Dr.hasRegexChars=r=>JJ.test(r);Dr.isRegexChar=r=>r.length===1&&Dr.hasRegexChars(r);Dr.escapeRegex=r=>r.replace(YJ,"\\$1");Dr.toPosixSlashes=r=>r.replace(zJ,"/");Dr.removeBackslashes=r=>r.replace(KJ,e=>e==="\\"?"":e);Dr.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Dr.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:GJ===!0||HJ.sep==="\\";Dr.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?Dr.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};Dr.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Dr.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",o=`${n}(?:${r})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var HL=v((rfe,$L)=>{"use strict";var BL=cf(),{CHAR_ASTERISK:Ex,CHAR_AT:XJ,CHAR_BACKWARD_SLASH:uf,CHAR_COMMA:QJ,CHAR_DOT:kx,CHAR_EXCLAMATION_MARK:Rx,CHAR_FORWARD_SLASH:VL,CHAR_LEFT_CURLY_BRACE:Ax,CHAR_LEFT_PARENTHESES:Dx,CHAR_LEFT_SQUARE_BRACKET:ZJ,CHAR_PLUS:eY,CHAR_QUESTION_MARK:jL,CHAR_RIGHT_CURLY_BRACE:tY,CHAR_RIGHT_PARENTHESES:UL,CHAR_RIGHT_SQUARE_BRACKET:rY}=af(),qL=r=>r===VL||r===uf,WL=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},nY=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,o=[],s=[],a=[],c=r,u=-1,l=0,p=0,d=!1,f=!1,h=!1,m=!1,y=!1,I=!1,L=!1,P=!1,W=!1,E=!1,M=0,k,j,Z={value:"",depth:0,isGlob:!1},he=()=>u>=n,A=()=>c.charCodeAt(u+1),Se=()=>(k=j,c.charCodeAt(++u));for(;u<n;){j=Se();let Fe;if(j===uf){L=Z.backslashes=!0,j=Se(),j===Ax&&(I=!0);continue}if(I===!0||j===Ax){for(M++;he()!==!0&&(j=Se());){if(j===uf){L=Z.backslashes=!0,Se();continue}if(j===Ax){M++;continue}if(I!==!0&&j===kx&&(j=Se())===kx){if(d=Z.isBrace=!0,h=Z.isGlob=!0,E=!0,i===!0)continue;break}if(I!==!0&&j===QJ){if(d=Z.isBrace=!0,h=Z.isGlob=!0,E=!0,i===!0)continue;break}if(j===tY&&(M--,M===0)){I=!1,d=Z.isBrace=!0,E=!0;break}}if(i===!0)continue;break}if(j===VL){if(o.push(u),s.push(Z),Z={value:"",depth:0,isGlob:!1},E===!0)continue;if(k===kx&&u===l+1){l+=2;continue}p=u+1;continue}if(t.noext!==!0&&(j===eY||j===XJ||j===Ex||j===jL||j===Rx)===!0&&A()===Dx){if(h=Z.isGlob=!0,m=Z.isExtglob=!0,E=!0,j===Rx&&u===l&&(W=!0),i===!0){for(;he()!==!0&&(j=Se());){if(j===uf){L=Z.backslashes=!0,j=Se();continue}if(j===UL){h=Z.isGlob=!0,E=!0;break}}continue}break}if(j===Ex){if(k===Ex&&(y=Z.isGlobstar=!0),h=Z.isGlob=!0,E=!0,i===!0)continue;break}if(j===jL){if(h=Z.isGlob=!0,E=!0,i===!0)continue;break}if(j===ZJ){for(;he()!==!0&&(Fe=Se());){if(Fe===uf){L=Z.backslashes=!0,Se();continue}if(Fe===rY){f=Z.isBracket=!0,h=Z.isGlob=!0,E=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&j===Rx&&u===l){P=Z.negated=!0,l++;continue}if(t.noparen!==!0&&j===Dx){if(h=Z.isGlob=!0,i===!0){for(;he()!==!0&&(j=Se());){if(j===Dx){L=Z.backslashes=!0,j=Se();continue}if(j===UL){E=!0;break}}continue}break}if(h===!0){if(E=!0,i===!0)continue;break}}t.noext===!0&&(m=!1,h=!1);let ge=c,oe="",x="";l>0&&(oe=c.slice(0,l),c=c.slice(l),p-=l),ge&&h===!0&&p>0?(ge=c.slice(0,p),x=c.slice(p)):h===!0?(ge="",x=c):ge=c,ge&&ge!==""&&ge!=="/"&&ge!==c&&qL(ge.charCodeAt(ge.length-1))&&(ge=ge.slice(0,-1)),t.unescape===!0&&(x&&(x=BL.removeBackslashes(x)),ge&&L===!0&&(ge=BL.removeBackslashes(ge)));let R={prefix:oe,input:r,start:l,base:ge,glob:x,isBrace:d,isBracket:f,isGlob:h,isExtglob:m,isGlobstar:y,negated:P,negatedExtglob:W};if(t.tokens===!0&&(R.maxDepth=0,qL(j)||s.push(Z),R.tokens=s),t.parts===!0||t.tokens===!0){let Fe;for(let _e=0;_e<o.length;_e++){let Hr=Fe?Fe+1:l,Gr=o[_e],rr=r.slice(Hr,Gr);t.tokens&&(_e===0&&l!==0?(s[_e].isPrefix=!0,s[_e].value=oe):s[_e].value=rr,WL(s[_e]),R.maxDepth+=s[_e].depth),(_e!==0||rr!=="")&&a.push(rr),Fe=Gr}if(Fe&&Fe+1<r.length){let _e=r.slice(Fe+1);a.push(_e),t.tokens&&(s[s.length-1].value=_e,WL(s[s.length-1]),R.maxDepth+=s[s.length-1].depth)}R.slashes=o,R.parts=a}return R};$L.exports=nY});var KL=v((nfe,zL)=>{"use strict";var Dy=af(),en=cf(),{MAX_LENGTH:Oy,POSIX_REGEX_SOURCE:iY,REGEX_NON_SPECIAL_CHARS:oY,REGEX_SPECIAL_CHARS_BACKREF:sY,REPLACEMENTS:GL}=Dy,aY=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>en.escapeRegex(i)).join("..")}return t},Vu=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,Ox=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=GL[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Oy,t.maxLength):Oy,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:t.prepend||""},s=[o],a=t.capture?"":"?:",c=en.isWindows(e),u=Dy.globChars(c),l=Dy.extglobChars(u),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:y,NO_DOT_SLASH:I,NO_DOTS_SLASH:L,QMARK:P,QMARK_NO_DOT:W,STAR:E,START_ANCHOR:M}=u,k=G=>`(${a}(?:(?!${M}${G.dot?m:p}).)*?)`,j=t.dot?"":y,Z=t.dot?P:W,he=t.bash===!0?k(t):E;t.capture&&(he=`(${he})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let A={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};r=en.removePrefix(r,A),i=r.length;let Se=[],ge=[],oe=[],x=o,R,Fe=()=>A.index===i-1,_e=A.peek=(G=1)=>r[A.index+G],Hr=A.advance=()=>r[++A.index]||"",Gr=()=>r.slice(A.index+1),rr=(G="",be=0)=>{A.consumed+=G,A.index+=be},re=G=>{A.output+=G.output!=null?G.output:G.value,rr(G.value)},ts=()=>{let G=1;for(;_e()==="!"&&(_e(2)!=="("||_e(3)==="?");)Hr(),A.start++,G++;return G%2===0?!1:(A.negated=!0,A.start++,!0)},Xc=G=>{A[G]++,oe.push(G)},Be=G=>{A[G]--,oe.pop()},me=G=>{if(x.type==="globstar"){let be=A.braces>0&&(G.type==="comma"||G.type==="brace"),V=G.extglob===!0||Se.length&&(G.type==="pipe"||G.type==="paren");G.type!=="slash"&&G.type!=="paren"&&!be&&!V&&(A.output=A.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=he,A.output+=x.output)}if(Se.length&&G.type!=="paren"&&(Se[Se.length-1].inner+=G.value),(G.value||G.output)&&re(G),x&&x.type==="text"&&G.type==="text"){x.output=(x.output||x.value)+G.value,x.value+=G.value;return}G.prev=x,s.push(G),x=G},Qc=(G,be)=>{let V={...l[be],conditions:1,inner:""};V.prev=x,V.parens=A.parens,V.output=A.output;let ae=(t.capture?"(":"")+V.open;Xc("parens"),me({type:G,value:be,output:A.output?"":h}),me({type:"paren",extglob:!0,value:Hr(),output:ae}),Se.push(V)},im=G=>{let be=G.close+(t.capture?")":""),V;if(G.type==="negate"){let ae=he;if(G.inner&&G.inner.length>1&&G.inner.includes("/")&&(ae=k(t)),(ae!==he||Fe()||/^\)+$/.test(Gr()))&&(be=G.close=`)$))${ae}`),G.inner.includes("*")&&(V=Gr())&&/^\.[^\\/.]+$/.test(V)){let Ve=Ox(V,{...e,fastpaths:!1}).output;be=G.close=`)${Ve})${ae})`}G.prev.type==="bos"&&(A.negatedExtglob=!0)}me({type:"paren",extglob:!0,value:R,output:be}),Be("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let G=!1,be=r.replace(sY,(V,ae,Ve,Yt,ot,Zc)=>Yt==="\\"?(G=!0,V):Yt==="?"?ae?ae+Yt+(ot?P.repeat(ot.length):""):Zc===0?Z+(ot?P.repeat(ot.length):""):P.repeat(Ve.length):Yt==="."?p.repeat(Ve.length):Yt==="*"?ae?ae+Yt+(ot?he:""):he:ae?V:`\\${V}`);return G===!0&&(t.unescape===!0?be=be.replace(/\\/g,""):be=be.replace(/\\+/g,V=>V.length%2===0?"\\\\":V?"\\":"")),be===r&&t.contains===!0?(A.output=r,A):(A.output=en.wrapOutput(be,A,e),A)}for(;!Fe();){if(R=Hr(),R==="\0")continue;if(R==="\\"){let V=_e();if(V==="/"&&t.bash!==!0||V==="."||V===";")continue;if(!V){R+="\\",me({type:"text",value:R});continue}let ae=/^\\+/.exec(Gr()),Ve=0;if(ae&&ae[0].length>2&&(Ve=ae[0].length,A.index+=Ve,Ve%2!==0&&(R+="\\")),t.unescape===!0?R=Hr():R+=Hr(),A.brackets===0){me({type:"text",value:R});continue}}if(A.brackets>0&&(R!=="]"||x.value==="["||x.value==="[^")){if(t.posix!==!1&&R===":"){let V=x.value.slice(1);if(V.includes("[")&&(x.posix=!0,V.includes(":"))){let ae=x.value.lastIndexOf("["),Ve=x.value.slice(0,ae),Yt=x.value.slice(ae+2),ot=iY[Yt];if(ot){x.value=Ve+ot,A.backtrack=!0,Hr(),!o.output&&s.indexOf(x)===1&&(o.output=h);continue}}}(R==="["&&_e()!==":"||R==="-"&&_e()==="]")&&(R=`\\${R}`),R==="]"&&(x.value==="["||x.value==="[^")&&(R=`\\${R}`),t.posix===!0&&R==="!"&&x.value==="["&&(R="^"),x.value+=R,re({value:R});continue}if(A.quotes===1&&R!=='"'){R=en.escapeRegex(R),x.value+=R,re({value:R});continue}if(R==='"'){A.quotes=A.quotes===1?0:1,t.keepQuotes===!0&&me({type:"text",value:R});continue}if(R==="("){Xc("parens"),me({type:"paren",value:R});continue}if(R===")"){if(A.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Vu("opening","("));let V=Se[Se.length-1];if(V&&A.parens===V.parens+1){im(Se.pop());continue}me({type:"paren",value:R,output:A.parens?")":"\\)"}),Be("parens");continue}if(R==="["){if(t.nobracket===!0||!Gr().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Vu("closing","]"));R=`\\${R}`}else Xc("brackets");me({type:"bracket",value:R});continue}if(R==="]"){if(t.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){me({type:"text",value:R,output:`\\${R}`});continue}if(A.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Vu("opening","["));me({type:"text",value:R,output:`\\${R}`});continue}Be("brackets");let V=x.value.slice(1);if(x.posix!==!0&&V[0]==="^"&&!V.includes("/")&&(R=`/${R}`),x.value+=R,re({value:R}),t.literalBrackets===!1||en.hasRegexChars(V))continue;let ae=en.escapeRegex(x.value);if(A.output=A.output.slice(0,-x.value.length),t.literalBrackets===!0){A.output+=ae,x.value=ae;continue}x.value=`(${a}${ae}|${x.value})`,A.output+=x.value;continue}if(R==="{"&&t.nobrace!==!0){Xc("braces");let V={type:"brace",value:R,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};ge.push(V),me(V);continue}if(R==="}"){let V=ge[ge.length-1];if(t.nobrace===!0||!V){me({type:"text",value:R,output:R});continue}let ae=")";if(V.dots===!0){let Ve=s.slice(),Yt=[];for(let ot=Ve.length-1;ot>=0&&(s.pop(),Ve[ot].type!=="brace");ot--)Ve[ot].type!=="dots"&&Yt.unshift(Ve[ot].value);ae=aY(Yt,t),A.backtrack=!0}if(V.comma!==!0&&V.dots!==!0){let Ve=A.output.slice(0,V.outputIndex),Yt=A.tokens.slice(V.tokensIndex);V.value=V.output="\\{",R=ae="\\}",A.output=Ve;for(let ot of Yt)A.output+=ot.output||ot.value}me({type:"brace",value:R,output:ae}),Be("braces"),ge.pop();continue}if(R==="|"){Se.length>0&&Se[Se.length-1].conditions++,me({type:"text",value:R});continue}if(R===","){let V=R,ae=ge[ge.length-1];ae&&oe[oe.length-1]==="braces"&&(ae.comma=!0,V="|"),me({type:"comma",value:R,output:V});continue}if(R==="/"){if(x.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",s.pop(),x=o;continue}me({type:"slash",value:R,output:f});continue}if(R==="."){if(A.braces>0&&x.type==="dot"){x.value==="."&&(x.output=p);let V=ge[ge.length-1];x.type="dots",x.output+=R,x.value+=R,V.dots=!0;continue}if(A.braces+A.parens===0&&x.type!=="bos"&&x.type!=="slash"){me({type:"text",value:R,output:p});continue}me({type:"dot",value:R,output:p});continue}if(R==="?"){if(!(x&&x.value==="(")&&t.noextglob!==!0&&_e()==="("&&_e(2)!=="?"){Qc("qmark",R);continue}if(x&&x.type==="paren"){let ae=_e(),Ve=R;if(ae==="<"&&!en.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(x.value==="("&&!/[!=<:]/.test(ae)||ae==="<"&&!/<([!=]|\w+>)/.test(Gr()))&&(Ve=`\\${R}`),me({type:"text",value:R,output:Ve});continue}if(t.dot!==!0&&(x.type==="slash"||x.type==="bos")){me({type:"qmark",value:R,output:W});continue}me({type:"qmark",value:R,output:P});continue}if(R==="!"){if(t.noextglob!==!0&&_e()==="("&&(_e(2)!=="?"||!/[!=<:]/.test(_e(3)))){Qc("negate",R);continue}if(t.nonegate!==!0&&A.index===0){ts();continue}}if(R==="+"){if(t.noextglob!==!0&&_e()==="("&&_e(2)!=="?"){Qc("plus",R);continue}if(x&&x.value==="("||t.regex===!1){me({type:"plus",value:R,output:d});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||A.parens>0){me({type:"plus",value:R});continue}me({type:"plus",value:d});continue}if(R==="@"){if(t.noextglob!==!0&&_e()==="("&&_e(2)!=="?"){me({type:"at",extglob:!0,value:R,output:""});continue}me({type:"text",value:R});continue}if(R!=="*"){(R==="$"||R==="^")&&(R=`\\${R}`);let V=oY.exec(Gr());V&&(R+=V[0],A.index+=V[0].length),me({type:"text",value:R});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=R,x.output=he,A.backtrack=!0,A.globstar=!0,rr(R);continue}let G=Gr();if(t.noextglob!==!0&&/^\([^?]/.test(G)){Qc("star",R);continue}if(x.type==="star"){if(t.noglobstar===!0){rr(R);continue}let V=x.prev,ae=V.prev,Ve=V.type==="slash"||V.type==="bos",Yt=ae&&(ae.type==="star"||ae.type==="globstar");if(t.bash===!0&&(!Ve||G[0]&&G[0]!=="/")){me({type:"star",value:R,output:""});continue}let ot=A.braces>0&&(V.type==="comma"||V.type==="brace"),Zc=Se.length&&(V.type==="pipe"||V.type==="paren");if(!Ve&&V.type!=="paren"&&!ot&&!Zc){me({type:"star",value:R,output:""});continue}for(;G.slice(0,3)==="/**";){let Ea=r[A.index+4];if(Ea&&Ea!=="/")break;G=G.slice(3),rr("/**",3)}if(V.type==="bos"&&Fe()){x.type="globstar",x.value+=R,x.output=k(t),A.output=x.output,A.globstar=!0,rr(R);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&!Yt&&Fe()){A.output=A.output.slice(0,-(V.output+x.output).length),V.output=`(?:${V.output}`,x.type="globstar",x.output=k(t)+(t.strictSlashes?")":"|$)"),x.value+=R,A.globstar=!0,A.output+=V.output+x.output,rr(R);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&G[0]==="/"){let Ea=G[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(V.output+x.output).length),V.output=`(?:${V.output}`,x.type="globstar",x.output=`${k(t)}${f}|${f}${Ea})`,x.value+=R,A.output+=V.output+x.output,A.globstar=!0,rr(R+Hr()),me({type:"slash",value:"/",output:""});continue}if(V.type==="bos"&&G[0]==="/"){x.type="globstar",x.value+=R,x.output=`(?:^|${f}|${k(t)}${f})`,A.output=x.output,A.globstar=!0,rr(R+Hr()),me({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-x.output.length),x.type="globstar",x.output=k(t),x.value+=R,A.output+=x.output,A.globstar=!0,rr(R);continue}let be={type:"star",value:R,output:he};if(t.bash===!0){be.output=".*?",(x.type==="bos"||x.type==="slash")&&(be.output=j+be.output),me(be);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&t.regex===!0){be.output=R,me(be);continue}(A.index===A.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?(A.output+=I,x.output+=I):t.dot===!0?(A.output+=L,x.output+=L):(A.output+=j,x.output+=j),_e()!=="*"&&(A.output+=h,x.output+=h)),me(be)}for(;A.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Vu("closing","]"));A.output=en.escapeLast(A.output,"["),Be("brackets")}for(;A.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Vu("closing",")"));A.output=en.escapeLast(A.output,"("),Be("parens")}for(;A.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Vu("closing","}"));A.output=en.escapeLast(A.output,"{"),Be("braces")}if(t.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&me({type:"maybe_slash",value:"",output:`${f}?`}),A.backtrack===!0){A.output="";for(let G of A.tokens)A.output+=G.output!=null?G.output:G.value,G.suffix&&(A.output+=G.suffix)}return A};Ox.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Oy,t.maxLength):Oy,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=GL[r]||r;let o=en.isWindows(e),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:h}=Dy.globChars(o),m=t.dot?p:l,y=t.dot?d:l,I=t.capture?"":"?:",L={negated:!1,prefix:""},P=t.bash===!0?".*?":f;t.capture&&(P=`(${P})`);let W=j=>j.noglobstar===!0?P:`(${I}(?:(?!${h}${j.dot?u:s}).)*?)`,E=j=>{switch(j){case"*":return`${m}${c}${P}`;case".*":return`${s}${c}${P}`;case"*.*":return`${m}${P}${s}${c}${P}`;case"*/*":return`${m}${P}${a}${c}${y}${P}`;case"**":return m+W(t);case"**/*":return`(?:${m}${W(t)}${a})?${y}${c}${P}`;case"**/*.*":return`(?:${m}${W(t)}${a})?${y}${P}${s}${c}${P}`;case"**/.*":return`(?:${m}${W(t)}${a})?${s}${c}${P}`;default:{let Z=/^(.*?)\.(\w+)$/.exec(j);if(!Z)return;let he=E(Z[1]);return he?he+s+Z[2]:void 0}}},M=en.removePrefix(r,L),k=E(M);return k&&t.strictSlashes!==!0&&(k+=`${a}?`),k};zL.exports=Ox});var YL=v((ife,JL)=>{"use strict";var cY=require("path"),uY=HL(),Lx=KL(),Mx=cf(),lY=af(),pY=r=>r&&typeof r=="object"&&!Array.isArray(r),bt=(r,e,t=!1)=>{if(Array.isArray(r)){let l=r.map(d=>bt(d,e,t));return d=>{for(let f of l){let h=f(d);if(h)return h}return!1}}let n=pY(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=Mx.isWindows(e),s=n?bt.compileRe(r,e):bt.makeRe(r,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};c=bt(i.ignore,l,t)}let u=(l,p=!1)=>{let{isMatch:d,match:f,output:h}=bt.test(l,s,e,{glob:r,posix:o}),m={glob:r,state:a,regex:s,posix:o,input:l,output:h,match:f,isMatch:d};return typeof i.onResult=="function"&&i.onResult(m),d===!1?(m.isMatch=!1,p?m:!1):c(l)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,p?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),p?m:!0)};return t&&(u.state=a),u};bt.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let o=t||{},s=o.format||(i?Mx.toPosixSlashes:null),a=r===n,c=a&&s?s(r):r;return a===!1&&(c=s?s(r):r,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=bt.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};bt.matchBase=(r,e,t,n=Mx.isWindows(t))=>(e instanceof RegExp?e:bt.makeRe(e,t)).test(cY.basename(r));bt.isMatch=(r,e,t)=>bt(e,t)(r);bt.parse=(r,e)=>Array.isArray(r)?r.map(t=>bt.parse(t,e)):Lx(r,{...e,fastpaths:!1});bt.scan=(r,e)=>uY(r,e);bt.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${r.output})${s}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=bt.toRegex(a,e);return n===!0&&(c.state=r),c};bt.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=Lx.fastpaths(r,e)),i.output||(i=Lx(r,e)),bt.compileRe(i,e,t,n)};bt.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};bt.constants=lY;JL.exports=bt});var Nx=v((ofe,XL)=>{"use strict";XL.exports=YL()});var lf=v((sfe,rM)=>{"use strict";var ZL=require("util"),eM=DL(),Hi=Nx(),Fx=cf(),QL=r=>r===""||r==="./",tM=r=>{let e=r.indexOf("{");return e>-1&&r.indexOf("}",e)>-1},Je=(r,e,t)=>{e=[].concat(e),r=[].concat(r);let n=new Set,i=new Set,o=new Set,s=0,a=l=>{o.add(l.output),t&&t.onResult&&t.onResult(l)};for(let l=0;l<e.length;l++){let p=Hi(String(e[l]),{...t,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let f of r){let h=p(f,!0);(d?!h.isMatch:h.isMatch)&&(d?n.add(h.output):(n.delete(h.output),i.add(h.output)))}}let u=(s===e.length?[...o]:[...i]).filter(l=>!n.has(l));if(t&&u.length===0){if(t.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(t.nonull===!0||t.nullglob===!0)return t.unescape?e.map(l=>l.replace(/\\/g,"")):e}return u};Je.match=Je;Je.matcher=(r,e)=>Hi(r,e);Je.isMatch=(r,e,t)=>Hi(e,t)(r);Je.any=Je.isMatch;Je.not=(r,e,t={})=>{e=[].concat(e).map(String);let n=new Set,i=[],o=a=>{t.onResult&&t.onResult(a),i.push(a.output)},s=new Set(Je(r,e,{...t,onResult:o}));for(let a of i)s.has(a)||n.add(a);return[...n]};Je.contains=(r,e,t)=>{if(typeof r!="string")throw new TypeError(`Expected a string: "${ZL.inspect(r)}"`);if(Array.isArray(e))return e.some(n=>Je.contains(r,n,t));if(typeof e=="string"){if(QL(r)||QL(e))return!1;if(r.includes(e)||r.startsWith("./")&&r.slice(2).includes(e))return!0}return Je.isMatch(r,e,{...t,contains:!0})};Je.matchKeys=(r,e,t)=>{if(!Fx.isObject(r))throw new TypeError("Expected the first argument to be an object");let n=Je(Object.keys(r),e,t),i={};for(let o of n)i[o]=r[o];return i};Je.some=(r,e,t)=>{let n=[].concat(r);for(let i of[].concat(e)){let o=Hi(String(i),t);if(n.some(s=>o(s)))return!0}return!1};Je.every=(r,e,t)=>{let n=[].concat(r);for(let i of[].concat(e)){let o=Hi(String(i),t);if(!n.every(s=>o(s)))return!1}return!0};Je.all=(r,e,t)=>{if(typeof r!="string")throw new TypeError(`Expected a string: "${ZL.inspect(r)}"`);return[].concat(e).every(n=>Hi(n,t)(r))};Je.capture=(r,e,t)=>{let n=Fx.isWindows(t),o=Hi.makeRe(String(r),{...t,capture:!0}).exec(n?Fx.toPosixSlashes(e):e);if(o)return o.slice(1).map(s=>s===void 0?"":s)};Je.makeRe=(...r)=>Hi.makeRe(...r);Je.scan=(...r)=>Hi.scan(...r);Je.parse=(r,e)=>{let t=[];for(let n of[].concat(r||[]))for(let i of eM(String(n),e))t.push(Hi.parse(i,e));return t};Je.braces=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!tM(r)?[r]:eM(r,e)};Je.braceExpand=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");return Je.braces(r,{...e,expand:!0})};Je.hasBraces=tM;rM.exports=Je});var TM=v((ume,CM)=>{"use strict";var{Duplex:SY}=require("stream");function IM(r){r.emit("close")}function _Y(){!this.destroyed&&this._writableState.finished&&this.destroy()}function xM(r){this.removeListener("error",xM),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function IY(r,e){let t=!0,n=new SY({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(o,s){let a=!s&&n._readableState.objectMode?o.toString():o;n.push(a)||r.pause()}),r.once("error",function(o){n.destroyed||(t=!1,n.destroy(o))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,o){if(r.readyState===r.CLOSED){o(i),process.nextTick(IM,n);return}let s=!1;r.once("error",function(c){s=!0,o(c)}),r.once("close",function(){s||o(i),process.nextTick(IM,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,o,s){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,o,s)});return}r.send(i,s)},n.on("end",_Y),n.on("error",xM),n}CM.exports=IY});var Cs=v((lme,PM)=>{"use strict";PM.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var hf=v((pme,Vy)=>{"use strict";var{EMPTY_BUFFER:xY}=Cs(),Gx=Buffer[Symbol.species];function CY(r,e){if(r.length===0)return xY;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let o=r[i];t.set(o,n),n+=o.length}return n<e?new Gx(t.buffer,t.byteOffset,n):t}function EM(r,e,t,n,i){for(let o=0;o<i;o++)t[n+o]=r[o]^e[o&3]}function kM(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function TY(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function zx(r){if(zx.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Gx(r):ArrayBuffer.isView(r)?e=new Gx(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),zx.readOnly=!1),e}Vy.exports={concat:CY,mask:EM,toArrayBuffer:TY,toBuffer:zx,unmask:kM};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=require("bufferutil");Vy.exports.mask=function(e,t,n,i,o){o<48?EM(e,t,n,i,o):r.mask(e,t,n,i,o)},Vy.exports.unmask=function(e,t){e.length<32?kM(e,t):r.unmask(e,t)}}catch{}});var DM=v((dme,AM)=>{"use strict";var RM=Symbol("kDone"),Kx=Symbol("kRun"),Jx=class{constructor(e){this[RM]=()=>{this.pending--,this[Kx]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Kx]()}[Kx](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[RM])}}};AM.exports=Jx});var yf=v((fme,NM)=>{"use strict";var mf=require("zlib"),OM=hf(),PY=DM(),{kStatusCode:LM}=Cs(),EY=Buffer[Symbol.species],kY=Buffer.from([0,0,255,255]),Gy=Symbol("permessage-deflate"),Oo=Symbol("total-length"),gf=Symbol("callback"),Ts=Symbol("buffers"),Hy=Symbol("error"),$y,Yx=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!$y){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;$y=new PY(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[gf];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){$y.add(i=>{this._decompress(e,t,(o,s)=>{i(),n(o,s)})})}compress(e,t,n){$y.add(i=>{this._compress(e,t,(o,s)=>{i(),n(o,s)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?mf.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=mf.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Gy]=this,this._inflate[Oo]=0,this._inflate[Ts]=[],this._inflate.on("error",AY),this._inflate.on("data",MM)}this._inflate[gf]=n,this._inflate.write(e),t&&this._inflate.write(kY),this._inflate.flush(()=>{let o=this._inflate[Hy];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=OM.concat(this._inflate[Ts],this._inflate[Oo]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Oo]=0,this._inflate[Ts]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?mf.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=mf.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Oo]=0,this._deflate[Ts]=[],this._deflate.on("data",RY)}this._deflate[gf]=n,this._deflate.write(e),this._deflate.flush(mf.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=OM.concat(this._deflate[Ts],this._deflate[Oo]);t&&(o=new EY(o.buffer,o.byteOffset,o.length-4)),this._deflate[gf]=null,this._deflate[Oo]=0,this._deflate[Ts]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};NM.exports=Yx;function RY(r){this[Ts].push(r),this[Oo]+=r.length}function MM(r){if(this[Oo]+=r.length,this[Gy]._maxPayload<1||this[Oo]<=this[Gy]._maxPayload){this[Ts].push(r);return}this[Hy]=new RangeError("Max payload size exceeded"),this[Hy].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Hy][LM]=1009,this.removeListener("data",MM),this.reset()}function AY(r){this[Gy]._inflate=null,r[LM]=1007,this[gf](r)}});var bf=v((hme,zy)=>{"use strict";var{isUtf8:FM}=require("buffer"),DY=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function OY(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Xx(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}zy.exports={isValidStatusCode:OY,isValidUTF8:Xx,tokenChars:DY};if(FM)zy.exports.isValidUTF8=function(r){return r.length<24?Xx(r):FM(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=require("utf-8-validate");zy.exports.isValidUTF8=function(e){return e.length<32?Xx(e):r(e)}}catch{}});var rC=v((mme,$M)=>{"use strict";var{Writable:LY}=require("stream"),BM=yf(),{BINARY_TYPES:MY,EMPTY_BUFFER:jM,kStatusCode:NY,kWebSocket:FY}=Cs(),{concat:Qx,toArrayBuffer:BY,unmask:jY}=hf(),{isValidStatusCode:UY,isValidUTF8:UM}=bf(),Ky=Buffer[Symbol.species],Tn=0,qM=1,WM=2,VM=3,Zx=4,eC=5,Jy=6,tC=class extends LY{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||MY[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[FY]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Tn}_write(e,t,n){if(this._opcode===8&&this._state==Tn)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Ky(n.buffer,n.byteOffset+e,n.length-e),new Ky(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Ky(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case Tn:this.getInfo(e);break;case qM:this.getPayloadLength16(e);break;case WM:this.getPayloadLength64(e);break;case VM:this.getMask();break;case Zx:this.getData(e);break;case eC:case Jy:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[BM.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=qM:this._payloadLength===127?this._state=WM:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=VM:this._state=Zx}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Zx}getData(e){let t=jM;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&jY(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=eC,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[BM.extensionName].decompress(e,this._fin,(i,o)=>{if(i)return t(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(s);return}this._fragments.push(o)}this.dataMessage(t),this._state===Tn&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=Tn;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Qx(n,t):this._binaryType==="arraybuffer"?i=BY(Qx(n,t)):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Tn):(this._state=Jy,setImmediate(()=>{this.emit("message",i,!0),this._state=Tn,this.startLoop(e)}))}else{let i=Qx(n,t);if(!this._skipUTF8Validation&&!UM(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===eC||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Tn):(this._state=Jy,setImmediate(()=>{this.emit("message",i,!1),this._state=Tn,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,jM),this.end();else{let n=e.readUInt16BE(0);if(!UY(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(o);return}let i=new Ky(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!UM(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=Tn;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Tn):(this._state=Jy,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Tn,this.startLoop(t)}))}createError(e,t,n,i,o){this._loop=!1,this._errored=!0;let s=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,this.createError),s.code=o,s[NY]=i,s}};$M.exports=tC});var iC=v((yme,zM)=>{"use strict";var{Duplex:gme}=require("stream"),{randomFillSync:qY}=require("crypto"),HM=yf(),{EMPTY_BUFFER:WY}=Cs(),{isValidStatusCode:VY}=bf(),{mask:GM,toBuffer:Zu}=hf(),ei=Symbol("kByteLength"),$Y=Buffer.alloc(4),Yy=8*1024,ic,el=Yy,nC=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,i=!1,o=2,s=!1;t.mask&&(n=t.maskBuffer||$Y,t.generateMask?t.generateMask(n):(el===Yy&&(ic===void 0&&(ic=Buffer.alloc(Yy)),qY(ic,0,Yy),el=0),n[0]=ic[el++],n[1]=ic[el++],n[2]=ic[el++],n[3]=ic[el++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof e=="string"?(!t.mask||s)&&t[ei]!==void 0?a=t[ei]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!s);let c=a;a>=65536?(o+=8,c=127):a>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(i?a+o:o);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[o-4]=n[0],u[o-3]=n[1],u[o-2]=n[2],u[o-1]=n[3],s?[u,e]:i?(GM(e,n,u,o,a),[u]):(GM(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let o;if(e===void 0)o=WY;else{if(typeof e!="number"||!VY(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(e,0),typeof t=="string"?o.write(t,2):o.set(t,2)}}let s={[ei]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,s,i]):this.sendFrame(r.frame(o,s),i)}ping(e,t,n){let i,o;if(typeof e=="string"?(i=Buffer.byteLength(e),o=!1):(e=Zu(e),i=e.length,o=Zu.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[ei]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,s,n]):this.sendFrame(r.frame(e,s),n)}pong(e,t,n){let i,o;if(typeof e=="string"?(i=Buffer.byteLength(e),o=!1):(e=Zu(e),i=e.length,o=Zu.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[ei]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,s,n]):this.sendFrame(r.frame(e,s),n)}send(e,t,n){let i=this._extensions[HM.extensionName],o=t.binary?2:1,s=t.compress,a,c;if(typeof e=="string"?(a=Buffer.byteLength(e),c=!1):(e=Zu(e),a=e.length,c=Zu.readOnly),this._firstFragment?(this._firstFragment=!1,s&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=i._threshold),this._compress=s):(s=!1,o=0),t.fin&&(this._firstFragment=!0),i){let u={[ei]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};this._deflating?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}else this.sendFrame(r.frame(e,{[ei]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:!1}),n)}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let o=this._extensions[HM.extensionName];this._bufferedBytes+=n[ei],this._deflating=!0,o.compress(e,n.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(c);for(let u=0;u<this._queue.length;u++){let l=this._queue[u],p=l[l.length-1];typeof p=="function"&&p(c)}return}this._bufferedBytes-=n[ei],this._deflating=!1,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][ei],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][ei],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};zM.exports=nC});var rN=v((bme,tN)=>{"use strict";var{kForOnEventAttribute:vf,kListener:oC}=Cs(),KM=Symbol("kCode"),JM=Symbol("kData"),YM=Symbol("kError"),XM=Symbol("kMessage"),QM=Symbol("kReason"),tl=Symbol("kTarget"),ZM=Symbol("kType"),eN=Symbol("kWasClean"),Lo=class{constructor(e){this[tl]=null,this[ZM]=e}get target(){return this[tl]}get type(){return this[ZM]}};Object.defineProperty(Lo.prototype,"target",{enumerable:!0});Object.defineProperty(Lo.prototype,"type",{enumerable:!0});var oc=class extends Lo{constructor(e,t={}){super(e),this[KM]=t.code===void 0?0:t.code,this[QM]=t.reason===void 0?"":t.reason,this[eN]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[KM]}get reason(){return this[QM]}get wasClean(){return this[eN]}};Object.defineProperty(oc.prototype,"code",{enumerable:!0});Object.defineProperty(oc.prototype,"reason",{enumerable:!0});Object.defineProperty(oc.prototype,"wasClean",{enumerable:!0});var rl=class extends Lo{constructor(e,t={}){super(e),this[YM]=t.error===void 0?null:t.error,this[XM]=t.message===void 0?"":t.message}get error(){return this[YM]}get message(){return this[XM]}};Object.defineProperty(rl.prototype,"error",{enumerable:!0});Object.defineProperty(rl.prototype,"message",{enumerable:!0});var wf=class extends Lo{constructor(e,t={}){super(e),this[JM]=t.data===void 0?null:t.data}get data(){return this[JM]}};Object.defineProperty(wf.prototype,"data",{enumerable:!0});var HY={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[vf]&&i[oC]===e&&!i[vf])return;let n;if(r==="message")n=function(o,s){let a=new wf("message",{data:s?o:o.toString()});a[tl]=this,Xy(e,this,a)};else if(r==="close")n=function(o,s){let a=new oc("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[tl]=this,Xy(e,this,a)};else if(r==="error")n=function(o){let s=new rl("error",{error:o,message:o.message});s[tl]=this,Xy(e,this,s)};else if(r==="open")n=function(){let o=new Lo("open");o[tl]=this,Xy(e,this,o)};else return;n[vf]=!!t[vf],n[oC]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[oC]===e&&!t[vf]){this.removeListener(r,t);break}}};tN.exports={CloseEvent:oc,ErrorEvent:rl,Event:Lo,EventTarget:HY,MessageEvent:wf};function Xy(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var sC=v((vme,nN)=>{"use strict";var{tokenChars:Sf}=bf();function Yi(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function GY(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,o=!1,s,a,c=-1,u=-1,l=-1,p=0;for(;p<r.length;p++)if(u=r.charCodeAt(p),s===void 0)if(l===-1&&Sf[u]===1)c===-1&&(c=p);else if(p!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);let f=r.slice(c,l);u===44?(Yi(e,f,t),t=Object.create(null)):s=f,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(a===void 0)if(l===-1&&Sf[u]===1)c===-1&&(c=p);else if(u===32||u===9)l===-1&&c!==-1&&(l=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p),Yi(t,r.slice(c,l),!0),u===44&&(Yi(e,s,t),t=Object.create(null),s=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=r.slice(c,p),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(i){if(Sf[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1?c=p:n||(n=!0),i=!1}else if(o)if(Sf[u]===1)c===-1&&(c=p);else if(u===34&&c!==-1)o=!1,l=p;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&r.charCodeAt(p-1)===61)o=!0;else if(l===-1&&Sf[u]===1)c===-1&&(c=p);else if(c!==-1&&(u===32||u===9))l===-1&&(l=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);let f=r.slice(c,l);n&&(f=f.replace(/\\/g,""),n=!1),Yi(t,a,f),u===44&&(Yi(e,s,t),t=Object.create(null),s=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=p);let d=r.slice(c,l);return s===void 0?Yi(e,d,t):(a===void 0?Yi(t,d,!0):n?Yi(t,a,d.replace(/\\/g,"")):Yi(t,a,d),Yi(e,s,t)),e}function zY(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}nN.exports={format:zY,parse:GY}});var pC=v((_me,hN)=>{"use strict";var KY=require("events"),JY=require("https"),YY=require("http"),sN=require("net"),XY=require("tls"),{randomBytes:QY,createHash:ZY}=require("crypto"),{Duplex:wme,Readable:Sme}=require("stream"),{URL:aC}=require("url"),Ps=yf(),eX=rC(),tX=iC(),{BINARY_TYPES:iN,EMPTY_BUFFER:Qy,GUID:rX,kForOnEventAttribute:cC,kListener:nX,kStatusCode:iX,kWebSocket:fr,NOOP:aN}=Cs(),{EventTarget:{addEventListener:oX,removeEventListener:sX}}=rN(),{format:aX,parse:cX}=sC(),{toBuffer:uX}=hf(),lX=30*1e3,cN=Symbol("kAborted"),uC=[8,13],Mo=["CONNECTING","OPEN","CLOSING","CLOSED"],pX=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,vt=class r extends KY{constructor(e,t,n){super(),this._binaryType=iN[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Qy,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),uN(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){iN.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new eX({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new tX(e,this._extensions,n.generateMask),this._receiver=i,this._socket=e,i[fr]=this,e[fr]=this,i.on("conclude",hX),i.on("drain",mX),i.on("error",gX),i.on("message",yX),i.on("ping",bX),i.on("pong",vX),e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",pN),e.on("data",eb),e.on("end",dN),e.on("error",fN),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ps.extensionName]&&this._extensions[Ps.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){rn(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),lX)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){lC(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||Qy,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){lC(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||Qy,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){lC(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Ps.extensionName]||(i.compress=!1),this._sender.send(e||Qy,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){rn(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(vt,"CONNECTING",{enumerable:!0,value:Mo.indexOf("CONNECTING")});Object.defineProperty(vt.prototype,"CONNECTING",{enumerable:!0,value:Mo.indexOf("CONNECTING")});Object.defineProperty(vt,"OPEN",{enumerable:!0,value:Mo.indexOf("OPEN")});Object.defineProperty(vt.prototype,"OPEN",{enumerable:!0,value:Mo.indexOf("OPEN")});Object.defineProperty(vt,"CLOSING",{enumerable:!0,value:Mo.indexOf("CLOSING")});Object.defineProperty(vt.prototype,"CLOSING",{enumerable:!0,value:Mo.indexOf("CLOSING")});Object.defineProperty(vt,"CLOSED",{enumerable:!0,value:Mo.indexOf("CLOSED")});Object.defineProperty(vt.prototype,"CLOSED",{enumerable:!0,value:Mo.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(vt.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(vt.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[cC])return e[nX];return null},set(e){for(let t of this.listeners(r))if(t[cC]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[cC]:!0})}})});vt.prototype.addEventListener=oX;vt.prototype.removeEventListener=sX;hN.exports=vt;function uN(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:uC[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!uC.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${uC.join(", ")})`);let o;if(e instanceof aC)o=e;else try{o=new aC(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),r._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",c;if(o.protocol!=="ws:"&&!s&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:a&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let m=new SyntaxError(c);if(r._redirects===0)throw m;Zy(r,m);return}let u=s?443:80,l=QY(16).toString("base64"),p=s?JY.request:YY.request,d=new Set,f;if(i.createConnection=i.createConnection||(s?fX:dX),i.defaultPort=i.defaultPort||u,i.port=o.port||u,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(f=new Ps(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=aX({[Ps.extensionName]:f.offer()})),t.length){for(let m of t){if(typeof m!="string"||!pX.test(m)||d.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(m)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){let m=i.path.split(":");i.socketPath=m[0],i.path=m[1]}let h;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=s,r._originalHostOrSocketPath=a?i.socketPath:o.host;let m=n&&n.headers;if(n={...n,headers:{}},m)for(let[y,I]of Object.entries(m))n.headers[y.toLowerCase()]=I}else if(r.listenerCount("redirect")===0){let m=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:o.host===r._originalHostOrSocketPath;(!m||r._originalSecure&&!s)&&(delete i.headers.authorization,delete i.headers.cookie,m||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),h=r._req=p(i),r._redirects&&r.emit("redirect",r.url,h)}else h=r._req=p(i);i.timeout&&h.on("timeout",()=>{rn(r,h,"Opening handshake has timed out")}),h.on("error",m=>{h===null||h[cN]||(h=r._req=null,Zy(r,m))}),h.on("response",m=>{let y=m.headers.location,I=m.statusCode;if(y&&i.followRedirects&&I>=300&&I<400){if(++r._redirects>i.maxRedirects){rn(r,h,"Maximum redirects exceeded");return}h.abort();let L;try{L=new aC(y,e)}catch{let W=new SyntaxError(`Invalid URL: ${y}`);Zy(r,W);return}uN(r,L,t,n)}else r.emit("unexpected-response",h,m)||rn(r,h,`Unexpected server response: ${m.statusCode}`)}),h.on("upgrade",(m,y,I)=>{if(r.emit("upgrade",m),r.readyState!==vt.CONNECTING)return;h=r._req=null;let L=m.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){rn(r,y,"Invalid Upgrade header");return}let P=ZY("sha1").update(l+rX).digest("base64");if(m.headers["sec-websocket-accept"]!==P){rn(r,y,"Invalid Sec-WebSocket-Accept header");return}let W=m.headers["sec-websocket-protocol"],E;if(W!==void 0?d.size?d.has(W)||(E="Server sent an invalid subprotocol"):E="Server sent a subprotocol but none was requested":d.size&&(E="Server sent no subprotocol"),E){rn(r,y,E);return}W&&(r._protocol=W);let M=m.headers["sec-websocket-extensions"];if(M!==void 0){if(!f){rn(r,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let k;try{k=cX(M)}catch{rn(r,y,"Invalid Sec-WebSocket-Extensions header");return}let j=Object.keys(k);if(j.length!==1||j[0]!==Ps.extensionName){rn(r,y,"Server indicated an extension that was not requested");return}try{f.accept(k[Ps.extensionName])}catch{rn(r,y,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Ps.extensionName]=f}r.setSocket(y,I,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(h,r):h.end()}function Zy(r,e){r._readyState=vt.CLOSING,r.emit("error",e),r.emitClose()}function dX(r){return r.path=r.socketPath,sN.connect(r)}function fX(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=sN.isIP(r.host)?"":r.host),XY.connect(r)}function rn(r,e,t){r._readyState=vt.CLOSING;let n=new Error(t);Error.captureStackTrace(n,rn),e.setHeader?(e[cN]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Zy,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function lC(r,e,t){if(e){let n=uX(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${Mo[r.readyState]})`);process.nextTick(t,n)}}function hX(r,e){let t=this[fr];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[fr]!==void 0&&(t._socket.removeListener("data",eb),process.nextTick(lN,t._socket),r===1005?t.close():t.close(r,e))}function mX(){let r=this[fr];r.isPaused||r._socket.resume()}function gX(r){let e=this[fr];e._socket[fr]!==void 0&&(e._socket.removeListener("data",eb),process.nextTick(lN,e._socket),e.close(r[iX])),e.emit("error",r)}function oN(){this[fr].emitClose()}function yX(r,e){this[fr].emit("message",r,e)}function bX(r){let e=this[fr];e._autoPong&&e.pong(r,!this._isServer,aN),e.emit("ping",r)}function vX(r){this[fr].emit("pong",r)}function lN(r){r.resume()}function pN(){let r=this[fr];this.removeListener("close",pN),this.removeListener("data",eb),this.removeListener("end",dN),r._readyState=vt.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[fr]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",oN),r._receiver.on("finish",oN))}function eb(r){this[fr]._receiver.write(r)||this.pause()}function dN(){let r=this[fr];r._readyState=vt.CLOSING,r._receiver.end(),this.end()}function fN(){let r=this[fr];this.removeListener("error",fN),this.on("error",aN),r&&(r._readyState=vt.CLOSING,this.destroy())}});var gN=v((Ime,mN)=>{"use strict";var{tokenChars:wX}=bf();function SX(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let s=r.charCodeAt(i);if(n===-1&&wX[s]===1)t===-1&&(t=i);else if(i!==0&&(s===32||s===9))n===-1&&t!==-1&&(n=i);else if(s===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let o=r.slice(t,i);if(e.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return e.add(o),e}mN.exports={parse:SX}});var IN=v((Cme,_N)=>{"use strict";var _X=require("events"),tb=require("http"),{Duplex:xme}=require("stream"),{createHash:IX}=require("crypto"),yN=sC(),sc=yf(),xX=gN(),CX=pC(),{GUID:TX,kWebSocket:PX}=Cs(),EX=/^[+/0-9A-Za-z]{22}==$/,bN=0,vN=1,SN=2,dC=class extends _X{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:CX,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=tb.createServer((n,i)=>{let o=tb.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=kX(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=bN}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===SN){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(_f,this);return}if(e&&this.once("close",e),this._state!==vN)if(this._state=vN,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(_f,this):process.nextTick(_f,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{_f(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",wN);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ac(this,e,t,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ac(this,e,t,400,"Invalid Upgrade header");return}if(o===void 0||!EX.test(o)){ac(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==8&&a!==13){ac(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){If(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=xX.parse(c)}catch{ac(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&l!==void 0){let d=new sc(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let f=yN.parse(l);f[sc.extensionName]&&(d.accept(f[sc.extensionName]),p[sc.extensionName]=d)}catch{ac(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(f,h,m,y)=>{if(!f)return If(t,h||401,m,y);this.completeUpgrade(p,o,u,e,t,n,i)});return}if(!this.options.verifyClient(d))return If(t,401)}this.completeUpgrade(p,o,u,e,t,n,i)}completeUpgrade(e,t,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[PX])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>bN)return If(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${IX("sha1").update(t+TX).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let p=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),l._protocol=p)}if(e[sc.extensionName]){let p=e[sc.extensionName].params,d=yN.format({[sc.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${d}`),l._extensions=e}this.emit("headers",u,i),o.write(u.concat(`\r
`).join(`\r
`)),o.removeListener("error",wN),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(_f,this)})),a(l,i)}};_N.exports=dC;function kX(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function _f(r){r._state=SN,r.emit("close")}function wN(){this.destroy()}function If(r,e,t,n){t=t||tb.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${tb.STATUS_CODES[e]}\r
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
`)+`\r
\r
`+t)}function ac(r,e,t,n,i){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ac),r.emit("wsClientError",o,t,e)}else If(t,n,i)}});var WN=v((cge,qN)=>{"use strict";qN.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var $N=v((uge,VN)=>{VN.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var zN=v((lge,GN)=>{"use strict";var BX=$N(),jX=Array.prototype.concat,UX=Array.prototype.slice,HN=GN.exports=function(e){for(var t=[],n=0,i=e.length;n<i;n++){var o=e[n];BX(o)?t=jX.call(t,UX.call(o)):t.push(o)}return t};HN.wrap=function(r){return function(){return r(HN(arguments))}}});var XN=v((pge,YN)=>{var Tf=WN(),Pf=zN(),KN=Object.hasOwnProperty,JN={};for(ab in Tf)KN.call(Tf,ab)&&(JN[Tf[ab]]=ab);var ab,nn=YN.exports={to:{},get:{}};nn.get=function(r){var e=r.substring(0,3).toLowerCase(),t,n;switch(e){case"hsl":t=nn.get.hsl(r),n="hsl";break;case"hwb":t=nn.get.hwb(r),n="hwb";break;default:t=nn.get.rgb(r),n="rgb";break}return t?{model:n,value:t}:null};nn.get.rgb=function(r){if(!r)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,s=[0,0,0,1],a,c,u;if(a=r.match(t)){for(u=a[2],a=a[1],c=0;c<3;c++){var l=c*2;s[c]=parseInt(a.slice(l,l+2),16)}u&&(s[3]=parseInt(u,16)/255)}else if(a=r.match(e)){for(a=a[1],u=a[3],c=0;c<3;c++)s[c]=parseInt(a[c]+a[c],16);u&&(s[3]=parseInt(u+u,16)/255)}else if(a=r.match(n)){for(c=0;c<3;c++)s[c]=parseInt(a[c+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=r.match(i)){for(c=0;c<3;c++)s[c]=Math.round(parseFloat(a[c+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=r.match(o))?a[1]==="transparent"?[0,0,0,0]:KN.call(Tf,a[1])?(s=Tf[a[1]],s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=As(s[c],0,255);return s[3]=As(s[3],0,1),s};nn.get.hsl=function(r){if(!r)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,o=As(parseFloat(t[2]),0,100),s=As(parseFloat(t[3]),0,100),a=As(isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};nn.get.hwb=function(r){if(!r)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,o=As(parseFloat(t[2]),0,100),s=As(parseFloat(t[3]),0,100),a=As(isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};nn.to.hex=function(){var r=Pf(arguments);return"#"+cb(r[0])+cb(r[1])+cb(r[2])+(r[3]<1?cb(Math.round(r[3]*255)):"")};nn.to.rgb=function(){var r=Pf(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};nn.to.rgb.percent=function(){var r=Pf(arguments),e=Math.round(r[0]/255*100),t=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+e+"%, "+t+"%, "+n+"%)":"rgba("+e+"%, "+t+"%, "+n+"%, "+r[3]+")"};nn.to.hsl=function(){var r=Pf(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};nn.to.hwb=function(){var r=Pf(arguments),e="";return r.length>=4&&r[3]!==1&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"};nn.to.keyword=function(r){return JN[r.slice(0,3)]};function As(r,e,t){return Math.min(Math.max(e,r),t)}function cb(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var ZN=v((dge,QN)=>{"use strict";QN.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var vC=v((fge,tF)=>{var Ef=ZN(),eF={};for(let r of Object.keys(Ef))eF[Ef[r]]=r;var X={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};tF.exports=X;for(let r of Object.keys(X)){if(!("channels"in X[r]))throw new Error("missing channels property: "+r);if(!("labels"in X[r]))throw new Error("missing channel labels property: "+r);if(X[r].labels.length!==X[r].channels)throw new Error("channel and label counts mismatch: "+r);let{channels:e,labels:t}=X[r];delete X[r].channels,delete X[r].labels,Object.defineProperty(X[r],"channels",{value:e}),Object.defineProperty(X[r],"labels",{value:t})}X.rgb.hsl=function(r){let e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),o=Math.max(e,t,n),s=o-i,a,c;o===i?a=0:e===o?a=(t-n)/s:t===o?a=2+(n-e)/s:n===o&&(a=4+(e-t)/s),a=Math.min(a*60,360),a<0&&(a+=360);let u=(i+o)/2;return o===i?c=0:u<=.5?c=s/(o+i):c=s/(2-o-i),[a,c*100,u*100]};X.rgb.hsv=function(r){let e,t,n,i,o,s=r[0]/255,a=r[1]/255,c=r[2]/255,u=Math.max(s,a,c),l=u-Math.min(s,a,c),p=function(d){return(u-d)/6/l+1/2};return l===0?(i=0,o=0):(o=l/u,e=p(s),t=p(a),n=p(c),s===u?i=n-t:a===u?i=1/3+e-n:c===u&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,u*100]};X.rgb.hwb=function(r){let e=r[0],t=r[1],n=r[2],i=X.rgb.hsl(r)[0],o=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[i,o*100,n*100]};X.rgb.cmyk=function(r){let e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(1-e,1-t,1-n),o=(1-e-i)/(1-i)||0,s=(1-t-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function qX(r,e){return(r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2}X.rgb.keyword=function(r){let e=eF[r];if(e)return e;let t=1/0,n;for(let i of Object.keys(Ef)){let o=Ef[i],s=qX(r,o);s<t&&(t=s,n=i)}return n};X.keyword.rgb=function(r){return Ef[r]};X.rgb.xyz=function(r){let e=r[0]/255,t=r[1]/255,n=r[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+t*.3576+n*.1805,o=e*.2126+t*.7152+n*.0722,s=e*.0193+t*.1192+n*.9505;return[i*100,o*100,s*100]};X.rgb.lab=function(r){let e=X.rgb.xyz(r),t=e[0],n=e[1],i=e[2];t/=95.047,n/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(t-n),a=200*(n-i);return[o,s,a]};X.hsl.rgb=function(r){let e=r[0]/360,t=r[1]/100,n=r[2]/100,i,o,s;if(t===0)return s=n*255,[s,s,s];n<.5?i=n*(1+t):i=n+t-n*t;let a=2*n-i,c=[0,0,0];for(let u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,c[u]=s*255;return c};X.hsl.hsv=function(r){let e=r[0],t=r[1]/100,n=r[2]/100,i=t,o=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+t)/2,a=n===0?2*i/(o+i):2*t/(n+t);return[e,a*100,s*100]};X.hsv.rgb=function(r){let e=r[0]/60,t=r[1]/100,n=r[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-t),a=255*n*(1-t*o),c=255*n*(1-t*(1-o));switch(n*=255,i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};X.hsv.hsl=function(r){let e=r[0],t=r[1]/100,n=r[2]/100,i=Math.max(n,.01),o,s;s=(2-t)*n;let a=(2-t)*i;return o=t*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};X.hwb.rgb=function(r){let e=r[0]/360,t=r[1]/100,n=r[2]/100,i=t+n,o;i>1&&(t/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,(s&1)!==0&&(o=1-o);let c=t+o*(a-t),u,l,p;switch(s){default:case 6:case 0:u=a,l=c,p=t;break;case 1:u=c,l=a,p=t;break;case 2:u=t,l=a,p=c;break;case 3:u=t,l=c,p=a;break;case 4:u=c,l=t,p=a;break;case 5:u=a,l=t,p=c;break}return[u*255,l*255,p*255]};X.cmyk.rgb=function(r){let e=r[0]/100,t=r[1]/100,n=r[2]/100,i=r[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,t*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};X.xyz.rgb=function(r){let e=r[0]/100,t=r[1]/100,n=r[2]/100,i,o,s;return i=e*3.2406+t*-1.5372+n*-.4986,o=e*-.9689+t*1.8758+n*.0415,s=e*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};X.xyz.lab=function(r){let e=r[0],t=r[1],n=r[2];e/=95.047,t/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*t-16,o=500*(e-t),s=200*(t-n);return[i,o,s]};X.lab.xyz=function(r){let e=r[0],t=r[1],n=r[2],i,o,s;o=(e+16)/116,i=t/500+o,s=o-n/200;let a=o**3,c=i**3,u=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,s=u>.008856?u:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};X.lab.lch=function(r){let e=r[0],t=r[1],n=r[2],i;i=Math.atan2(n,t)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(t*t+n*n);return[e,s,i]};X.lch.lab=function(r){let e=r[0],t=r[1],i=r[2]/360*2*Math.PI,o=t*Math.cos(i),s=t*Math.sin(i);return[e,o,s]};X.rgb.ansi16=function(r,e=null){let[t,n,i]=r,o=e===null?X.rgb.hsv(r)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return o===2&&(s+=60),s};X.hsv.ansi16=function(r){return X.rgb.ansi16(X.hsv.rgb(r),r[2])};X.rgb.ansi256=function(r){let e=r[0],t=r[1],n=r[2];return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)};X.ansi16.rgb=function(r){let e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(r>50)+1)*.5,n=(e&1)*t*255,i=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[n,i,o]};X.ansi256.rgb=function(r){if(r>=232){let o=(r-232)*10+8;return[o,o,o]}r-=16;let e,t=Math.floor(r/36)/5*255,n=Math.floor((e=r%36)/6)/5*255,i=e%6/5*255;return[t,n,i]};X.rgb.hex=function(r){let t=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};X.hex.rgb=function(r){let e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let n=parseInt(t,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};X.rgb.hcg=function(r){let e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.max(Math.max(e,t),n),o=Math.min(Math.min(e,t),n),s=i-o,a,c;return s<1?a=o/(1-s):a=0,s<=0?c=0:i===e?c=(t-n)/s%6:i===t?c=2+(n-e)/s:c=4+(e-t)/s,c/=6,c%=1,[c*360,s*100,a*100]};X.hsl.hcg=function(r){let e=r[1]/100,t=r[2]/100,n=t<.5?2*e*t:2*e*(1-t),i=0;return n<1&&(i=(t-.5*n)/(1-n)),[r[0],n*100,i*100]};X.hsv.hcg=function(r){let e=r[1]/100,t=r[2]/100,n=e*t,i=0;return n<1&&(i=(t-n)/(1-n)),[r[0],n*100,i*100]};X.hcg.rgb=function(r){let e=r[0]/360,t=r[1]/100,n=r[2]/100;if(t===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,c=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return c=(1-t)*n,[(t*i[0]+c)*255,(t*i[1]+c)*255,(t*i[2]+c)*255]};X.hcg.hsv=function(r){let e=r[1]/100,t=r[2]/100,n=e+t*(1-e),i=0;return n>0&&(i=e/n),[r[0],i*100,n*100]};X.hcg.hsl=function(r){let e=r[1]/100,n=r[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[r[0],i*100,n*100]};X.hcg.hwb=function(r){let e=r[1]/100,t=r[2]/100,n=e+t*(1-e);return[r[0],(n-e)*100,(1-n)*100]};X.hwb.hcg=function(r){let e=r[1]/100,n=1-r[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[r[0],i*100,o*100]};X.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};X.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};X.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};X.gray.hsl=function(r){return[0,0,r[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(r){return[0,100,r[0]]};X.gray.cmyk=function(r){return[0,0,0,r[0]]};X.gray.lab=function(r){return[r[0],0,0]};X.gray.hex=function(r){let e=Math.round(r[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};X.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});var nF=v((hge,rF)=>{var ub=vC();function WX(){let r={},e=Object.keys(ub);for(let t=e.length,n=0;n<t;n++)r[e[n]]={distance:-1,parent:null};return r}function VX(r){let e=WX(),t=[r];for(e[r].distance=0;t.length;){let n=t.pop(),i=Object.keys(ub[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],c=e[a];c.distance===-1&&(c.distance=e[n].distance+1,c.parent=n,t.unshift(a))}}return e}function $X(r,e){return function(t){return e(r(t))}}function HX(r,e){let t=[e[r].parent,r],n=ub[e[r].parent][r],i=e[r].parent;for(;e[i].parent;)t.unshift(e[i].parent),n=$X(ub[e[i].parent][i],n),i=e[i].parent;return n.conversion=t,n}rF.exports=function(r){let e=VX(r),t={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(t[s]=HX(s,e))}return t}});var oF=v((mge,iF)=>{var wC=vC(),GX=nF(),al={},zX=Object.keys(wC);function KX(r){let e=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function JX(r){let e=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let i=r(t);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in r&&(e.conversion=r.conversion),e}zX.forEach(r=>{al[r]={},Object.defineProperty(al[r],"channels",{value:wC[r].channels}),Object.defineProperty(al[r],"labels",{value:wC[r].labels});let e=GX(r);Object.keys(e).forEach(n=>{let i=e[n];al[r][n]=JX(i),al[r][n].raw=KX(i)})});iF.exports=al});var cF=v((gge,aF)=>{var cl=XN(),on=oF(),sF=["keyword","gray","hex"],SC={};for(let r of Object.keys(on))SC[[...on[r].labels].sort().join("")]=r;var lb={};function Ut(r,e){if(!(this instanceof Ut))return new Ut(r,e);if(e&&e in sF&&(e=null),e&&!(e in on))throw new Error("Unknown model: "+e);let t,n;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof Ut)this.model=r.model,this.color=[...r.color],this.valpha=r.valpha;else if(typeof r=="string"){let i=cl.get(r);if(i===null)throw new Error("Unable to parse color from string: "+r);this.model=i.model,n=on[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(r.length>0){this.model=e||"rgb",n=on[this.model].channels;let i=Array.prototype.slice.call(r,0,n);this.color=_C(i,n),this.valpha=typeof r[n]=="number"?r[n]:1}else if(typeof r=="number")this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(r);"alpha"in r&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);let o=i.sort().join("");if(!(o in SC))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=SC[o];let{labels:s}=on[this.model],a=[];for(t=0;t<s.length;t++)a.push(r[s[t]]);this.color=_C(a)}if(lb[this.model])for(n=on[this.model].channels,t=0;t<n;t++){let i=lb[this.model][t];i&&(this.color[t]=i(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Ut.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(r){let e=this.model in cl.to?this:this.rgb();e=e.round(typeof r=="number"?r:1);let t=e.valpha===1?e.color:[...e.color,this.valpha];return cl.to[e.model](t)},percentString(r){let e=this.rgb().round(typeof r=="number"?r:1),t=e.valpha===1?e.color:[...e.color,this.valpha];return cl.to.rgb.percent(t)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let r={},{channels:e}=on[this.model],{labels:t}=on[this.model];for(let n=0;n<e;n++)r[t[n]]=this.color[n];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray(){let r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject(){let r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round(r){return r=Math.max(r||0,0),new Ut([...this.color.map(XX(r)),this.valpha],this.model)},alpha(r){return r!==void 0?new Ut([...this.color,Math.max(0,Math.min(1,r))],this.model):this.valpha},red:lt("rgb",0,At(255)),green:lt("rgb",1,At(255)),blue:lt("rgb",2,At(255)),hue:lt(["hsl","hsv","hsl","hwb","hcg"],0,r=>(r%360+360)%360),saturationl:lt("hsl",1,At(100)),lightness:lt("hsl",2,At(100)),saturationv:lt("hsv",1,At(100)),value:lt("hsv",2,At(100)),chroma:lt("hcg",1,At(100)),gray:lt("hcg",2,At(100)),white:lt("hwb",1,At(100)),wblack:lt("hwb",2,At(100)),cyan:lt("cmyk",0,At(100)),magenta:lt("cmyk",1,At(100)),yellow:lt("cmyk",2,At(100)),black:lt("cmyk",3,At(100)),x:lt("xyz",0,At(95.047)),y:lt("xyz",1,At(100)),z:lt("xyz",2,At(108.833)),l:lt("lab",0,At(100)),a:lt("lab",1),b:lt("lab",2),keyword(r){return r!==void 0?new Ut(r):on[this.model].keyword(this.color)},hex(r){return r!==void 0?new Ut(r):cl.to.hex(this.rgb().round().color)},hexa(r){if(r!==void 0)return new Ut(r);let e=this.rgb().round().color,t=Math.round(this.valpha*255).toString(16).toUpperCase();return t.length===1&&(t="0"+t),cl.to.hex(e)+t},rgbNumber(){let r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity(){let r=this.rgb().color,e=[];for(let[t,n]of r.entries()){let i=n/255;e[t]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(r){let e=this.luminosity(),t=r.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level(r){let e=this.contrast(r);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){let r=this.rgb().color;return(r[0]*2126+r[1]*7152+r[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let r=this.rgb();for(let e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten(r){let e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken(r){let e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate(r){let e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate(r){let e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten(r){let e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken(r){let e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale(){let r=this.rgb().color,e=r[0]*.3+r[1]*.59+r[2]*.11;return Ut.rgb(e,e,e)},fade(r){return this.alpha(this.valpha-this.valpha*r)},opaquer(r){return this.alpha(this.valpha+this.valpha*r)},rotate(r){let e=this.hsl(),t=e.color[0];return t=(t+r)%360,t=t<0?360+t:t,e.color[0]=t,e},mix(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);let t=r.rgb(),n=this.rgb(),i=e===void 0?.5:e,o=2*i-1,s=t.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,c=1-a;return Ut.rgb(a*t.red()+c*n.red(),a*t.green()+c*n.green(),a*t.blue()+c*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};for(let r of Object.keys(on)){if(sF.includes(r))continue;let{channels:e}=on[r];Ut.prototype[r]=function(...t){return this.model===r?new Ut(this):t.length>0?new Ut(t,r):new Ut([...QX(on[this.model][r].raw(this.color)),this.valpha],r)},Ut[r]=function(...t){let n=t[0];return typeof n=="number"&&(n=_C(t,e)),new Ut(n,r)}}function YX(r,e){return Number(r.toFixed(e))}function XX(r){return function(e){return YX(e,r)}}function lt(r,e,t){r=Array.isArray(r)?r:[r];for(let n of r)(lb[n]||(lb[n]=[]))[e]=t;return r=r[0],function(n){let i;return n!==void 0?(t&&(n=t(n)),i=this[r](),i.color[e]=n,i):(i=this[r]().color[e],t&&(i=t(i)),i)}}function At(r){return function(e){return Math.max(0,Math.min(r,e))}}function QX(r){return Array.isArray(r)?r:[r]}function _C(r,e){for(let t=0;t<e;t++)typeof r[t]!="number"&&(r[t]=0);return r}aF.exports=Ut});var lB=v($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});$b.dataUriToBuffer=void 0;function kQ(r){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=[];for(let o=0;o<r.length;o+=4){let s=e.indexOf(r.charAt(o)),a=e.indexOf(r.charAt(o+1)),c=r.charAt(o+2)==="="?0:e.indexOf(r.charAt(o+2)),u=r.charAt(o+3)==="="?0:e.indexOf(r.charAt(o+3)),l=s<<2|a>>4,p=(a&15)<<4|c>>2,d=(c&3)<<6|u;t.push(l),r.charAt(o+2)!=="="&&t.push(p),r.charAt(o+3)!=="="&&t.push(d)}let n=new ArrayBuffer(t.length);return new Uint8Array(n).set(t),n}function RQ(r){let e=new ArrayBuffer(r.length),t=new Uint8Array(e);for(let n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return e}function AQ(r){if(r=String(r),!/^data:/i.test(r))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');r=r.replace(/\r?\n/g,"");let e=r.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let t=r.substring(5,e).split(";"),n="",i=!1,o=t[0]||"text/plain",s=o;for(let u=1;u<t.length;u++)t[u]==="base64"?i=!0:t[u]&&(s+=`;${t[u]}`,t[u].indexOf("charset=")===0&&(n=t[u].substring(8)));!t[0]&&!n.length&&(s+=";charset=US-ASCII",n="US-ASCII");let a=unescape(r.substring(e+1)),c=i?kQ(a):RQ(a);return{type:o,typeFull:s,charset:n,buffer:c}}$b.dataUriToBuffer=AQ});var Bo=v((Fo,Hb)=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});var pB=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function DQ(r){return pB.includes(r)}var OQ=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...pB];function LQ(r){return OQ.includes(r)}var MQ=["null","undefined","string","number","bigint","boolean","symbol"];function NQ(r){return MQ.includes(r)}function _l(r){return e=>typeof e===r}var{toString:dB}=Object.prototype,jf=r=>{let e=dB.call(r).slice(8,-1);if(/HTML\w+Element/.test(e)&&w.domElement(r))return"HTMLElement";if(LQ(e))return e},qe=r=>e=>jf(e)===r;function w(r){if(r===null)return"null";switch(typeof r){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(w.observable(r))return"Observable";if(w.array(r))return"Array";if(w.buffer(r))return"Buffer";let e=jf(r);if(e)return e;if(r instanceof String||r instanceof Boolean||r instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}w.undefined=_l("undefined");w.string=_l("string");var FQ=_l("number");w.number=r=>FQ(r)&&!w.nan(r);w.bigint=_l("bigint");w.function_=_l("function");w.null_=r=>r===null;w.class_=r=>w.function_(r)&&r.toString().startsWith("class ");w.boolean=r=>r===!0||r===!1;w.symbol=_l("symbol");w.numericString=r=>w.string(r)&&!w.emptyStringOrWhitespace(r)&&!Number.isNaN(Number(r));w.array=(r,e)=>Array.isArray(r)?w.function_(e)?r.every(e):!0:!1;w.buffer=r=>{var e,t,n,i;return(i=(n=(t=(e=r)===null||e===void 0?void 0:e.constructor)===null||t===void 0?void 0:t.isBuffer)===null||n===void 0?void 0:n.call(t,r))!==null&&i!==void 0?i:!1};w.blob=r=>qe("Blob")(r);w.nullOrUndefined=r=>w.null_(r)||w.undefined(r);w.object=r=>!w.null_(r)&&(typeof r=="object"||w.function_(r));w.iterable=r=>{var e;return w.function_((e=r)===null||e===void 0?void 0:e[Symbol.iterator])};w.asyncIterable=r=>{var e;return w.function_((e=r)===null||e===void 0?void 0:e[Symbol.asyncIterator])};w.generator=r=>{var e,t;return w.iterable(r)&&w.function_((e=r)===null||e===void 0?void 0:e.next)&&w.function_((t=r)===null||t===void 0?void 0:t.throw)};w.asyncGenerator=r=>w.asyncIterable(r)&&w.function_(r.next)&&w.function_(r.throw);w.nativePromise=r=>qe("Promise")(r);var BQ=r=>{var e,t;return w.function_((e=r)===null||e===void 0?void 0:e.then)&&w.function_((t=r)===null||t===void 0?void 0:t.catch)};w.promise=r=>w.nativePromise(r)||BQ(r);w.generatorFunction=qe("GeneratorFunction");w.asyncGeneratorFunction=r=>jf(r)==="AsyncGeneratorFunction";w.asyncFunction=r=>jf(r)==="AsyncFunction";w.boundFunction=r=>w.function_(r)&&!r.hasOwnProperty("prototype");w.regExp=qe("RegExp");w.date=qe("Date");w.error=qe("Error");w.map=r=>qe("Map")(r);w.set=r=>qe("Set")(r);w.weakMap=r=>qe("WeakMap")(r);w.weakSet=r=>qe("WeakSet")(r);w.int8Array=qe("Int8Array");w.uint8Array=qe("Uint8Array");w.uint8ClampedArray=qe("Uint8ClampedArray");w.int16Array=qe("Int16Array");w.uint16Array=qe("Uint16Array");w.int32Array=qe("Int32Array");w.uint32Array=qe("Uint32Array");w.float32Array=qe("Float32Array");w.float64Array=qe("Float64Array");w.bigInt64Array=qe("BigInt64Array");w.bigUint64Array=qe("BigUint64Array");w.arrayBuffer=qe("ArrayBuffer");w.sharedArrayBuffer=qe("SharedArrayBuffer");w.dataView=qe("DataView");w.enumCase=(r,e)=>Object.values(e).includes(r);w.directInstanceOf=(r,e)=>Object.getPrototypeOf(r)===e.prototype;w.urlInstance=r=>qe("URL")(r);w.urlString=r=>{if(!w.string(r))return!1;try{return new URL(r),!0}catch{return!1}};w.truthy=r=>!!r;w.falsy=r=>!r;w.nan=r=>Number.isNaN(r);w.primitive=r=>w.null_(r)||NQ(typeof r);w.integer=r=>Number.isInteger(r);w.safeInteger=r=>Number.isSafeInteger(r);w.plainObject=r=>{if(dB.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.getPrototypeOf({})};w.typedArray=r=>DQ(jf(r));var jQ=r=>w.safeInteger(r)&&r>=0;w.arrayLike=r=>!w.nullOrUndefined(r)&&!w.function_(r)&&jQ(r.length);w.inRange=(r,e)=>{if(w.number(e))return r>=Math.min(0,e)&&r<=Math.max(e,0);if(w.array(e)&&e.length===2)return r>=Math.min(...e)&&r<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var UQ=1,qQ=["innerHTML","ownerDocument","style","attributes","nodeValue"];w.domElement=r=>w.object(r)&&r.nodeType===UQ&&w.string(r.nodeName)&&!w.plainObject(r)&&qQ.every(e=>e in r);w.observable=r=>{var e,t,n,i;return r?r===((t=(e=r)[Symbol.observable])===null||t===void 0?void 0:t.call(e))||r===((i=(n=r)["@@observable"])===null||i===void 0?void 0:i.call(n)):!1};w.nodeStream=r=>w.object(r)&&w.function_(r.pipe)&&!w.observable(r);w.infinite=r=>r===1/0||r===-1/0;var fB=r=>e=>w.integer(e)&&Math.abs(e%2)===r;w.evenInteger=fB(0);w.oddInteger=fB(1);w.emptyArray=r=>w.array(r)&&r.length===0;w.nonEmptyArray=r=>w.array(r)&&r.length>0;w.emptyString=r=>w.string(r)&&r.length===0;var WQ=r=>w.string(r)&&!/\S/.test(r);w.emptyStringOrWhitespace=r=>w.emptyString(r)||WQ(r);w.nonEmptyString=r=>w.string(r)&&r.length>0;w.nonEmptyStringAndNotWhitespace=r=>w.string(r)&&!w.emptyStringOrWhitespace(r);w.emptyObject=r=>w.object(r)&&!w.map(r)&&!w.set(r)&&Object.keys(r).length===0;w.nonEmptyObject=r=>w.object(r)&&!w.map(r)&&!w.set(r)&&Object.keys(r).length>0;w.emptySet=r=>w.set(r)&&r.size===0;w.nonEmptySet=r=>w.set(r)&&r.size>0;w.emptyMap=r=>w.map(r)&&r.size===0;w.nonEmptyMap=r=>w.map(r)&&r.size>0;w.propertyKey=r=>w.any([w.string,w.number,w.symbol],r);w.formData=r=>qe("FormData")(r);w.urlSearchParams=r=>qe("URLSearchParams")(r);var hB=(r,e,t)=>{if(!w.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(t.length===0)throw new TypeError("Invalid number of values");return r.call(t,e)};w.any=(r,...e)=>(w.array(r)?r:[r]).some(n=>hB(Array.prototype.some,n,e));w.all=(r,...e)=>hB(Array.prototype.every,r,e);var q=(r,e,t,n={})=>{if(!r){let{multipleValues:i}=n,o=i?`received values of types ${[...new Set(t.map(s=>`\`${w(s)}\``))].join(", ")}`:`received value of type \`${w(t)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${o}.`)}};Fo.assert={undefined:r=>q(w.undefined(r),"undefined",r),string:r=>q(w.string(r),"string",r),number:r=>q(w.number(r),"number",r),bigint:r=>q(w.bigint(r),"bigint",r),function_:r=>q(w.function_(r),"Function",r),null_:r=>q(w.null_(r),"null",r),class_:r=>q(w.class_(r),"Class",r),boolean:r=>q(w.boolean(r),"boolean",r),symbol:r=>q(w.symbol(r),"symbol",r),numericString:r=>q(w.numericString(r),"string with a number",r),array:(r,e)=>{q(w.array(r),"Array",r),e&&r.forEach(e)},buffer:r=>q(w.buffer(r),"Buffer",r),blob:r=>q(w.blob(r),"Blob",r),nullOrUndefined:r=>q(w.nullOrUndefined(r),"null or undefined",r),object:r=>q(w.object(r),"Object",r),iterable:r=>q(w.iterable(r),"Iterable",r),asyncIterable:r=>q(w.asyncIterable(r),"AsyncIterable",r),generator:r=>q(w.generator(r),"Generator",r),asyncGenerator:r=>q(w.asyncGenerator(r),"AsyncGenerator",r),nativePromise:r=>q(w.nativePromise(r),"native Promise",r),promise:r=>q(w.promise(r),"Promise",r),generatorFunction:r=>q(w.generatorFunction(r),"GeneratorFunction",r),asyncGeneratorFunction:r=>q(w.asyncGeneratorFunction(r),"AsyncGeneratorFunction",r),asyncFunction:r=>q(w.asyncFunction(r),"AsyncFunction",r),boundFunction:r=>q(w.boundFunction(r),"Function",r),regExp:r=>q(w.regExp(r),"RegExp",r),date:r=>q(w.date(r),"Date",r),error:r=>q(w.error(r),"Error",r),map:r=>q(w.map(r),"Map",r),set:r=>q(w.set(r),"Set",r),weakMap:r=>q(w.weakMap(r),"WeakMap",r),weakSet:r=>q(w.weakSet(r),"WeakSet",r),int8Array:r=>q(w.int8Array(r),"Int8Array",r),uint8Array:r=>q(w.uint8Array(r),"Uint8Array",r),uint8ClampedArray:r=>q(w.uint8ClampedArray(r),"Uint8ClampedArray",r),int16Array:r=>q(w.int16Array(r),"Int16Array",r),uint16Array:r=>q(w.uint16Array(r),"Uint16Array",r),int32Array:r=>q(w.int32Array(r),"Int32Array",r),uint32Array:r=>q(w.uint32Array(r),"Uint32Array",r),float32Array:r=>q(w.float32Array(r),"Float32Array",r),float64Array:r=>q(w.float64Array(r),"Float64Array",r),bigInt64Array:r=>q(w.bigInt64Array(r),"BigInt64Array",r),bigUint64Array:r=>q(w.bigUint64Array(r),"BigUint64Array",r),arrayBuffer:r=>q(w.arrayBuffer(r),"ArrayBuffer",r),sharedArrayBuffer:r=>q(w.sharedArrayBuffer(r),"SharedArrayBuffer",r),dataView:r=>q(w.dataView(r),"DataView",r),enumCase:(r,e)=>q(w.enumCase(r,e),"EnumCase",r),urlInstance:r=>q(w.urlInstance(r),"URL",r),urlString:r=>q(w.urlString(r),"string with a URL",r),truthy:r=>q(w.truthy(r),"truthy",r),falsy:r=>q(w.falsy(r),"falsy",r),nan:r=>q(w.nan(r),"NaN",r),primitive:r=>q(w.primitive(r),"primitive",r),integer:r=>q(w.integer(r),"integer",r),safeInteger:r=>q(w.safeInteger(r),"integer",r),plainObject:r=>q(w.plainObject(r),"plain object",r),typedArray:r=>q(w.typedArray(r),"TypedArray",r),arrayLike:r=>q(w.arrayLike(r),"array-like",r),domElement:r=>q(w.domElement(r),"HTMLElement",r),observable:r=>q(w.observable(r),"Observable",r),nodeStream:r=>q(w.nodeStream(r),"Node.js Stream",r),infinite:r=>q(w.infinite(r),"infinite number",r),emptyArray:r=>q(w.emptyArray(r),"empty array",r),nonEmptyArray:r=>q(w.nonEmptyArray(r),"non-empty array",r),emptyString:r=>q(w.emptyString(r),"empty string",r),emptyStringOrWhitespace:r=>q(w.emptyStringOrWhitespace(r),"empty string or whitespace",r),nonEmptyString:r=>q(w.nonEmptyString(r),"non-empty string",r),nonEmptyStringAndNotWhitespace:r=>q(w.nonEmptyStringAndNotWhitespace(r),"non-empty string and not whitespace",r),emptyObject:r=>q(w.emptyObject(r),"empty object",r),nonEmptyObject:r=>q(w.nonEmptyObject(r),"non-empty object",r),emptySet:r=>q(w.emptySet(r),"empty set",r),nonEmptySet:r=>q(w.nonEmptySet(r),"non-empty set",r),emptyMap:r=>q(w.emptyMap(r),"empty map",r),nonEmptyMap:r=>q(w.nonEmptyMap(r),"non-empty map",r),propertyKey:r=>q(w.propertyKey(r),"PropertyKey",r),formData:r=>q(w.formData(r),"FormData",r),urlSearchParams:r=>q(w.urlSearchParams(r),"URLSearchParams",r),evenInteger:r=>q(w.evenInteger(r),"even integer",r),oddInteger:r=>q(w.oddInteger(r),"odd integer",r),directInstanceOf:(r,e)=>q(w.directInstanceOf(r,e),"T",r),inRange:(r,e)=>q(w.inRange(r,e),"in range",r),any:(r,...e)=>q(w.any(r,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(r,...e)=>q(w.all(r,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(w,{class:{value:w.class_},function:{value:w.function_},null:{value:w.null_}});Object.defineProperties(Fo.assert,{class:{value:Fo.assert.class_},function:{value:Fo.assert.function_},null:{value:Fo.assert.null_}});Fo.default=w;Hb.exports=w;Hb.exports.default=w;Hb.exports.assert=Fo.assert});var mB=v((Qwe,sT)=>{"use strict";var Gb=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},zb=class r{static fn(e){return(...t)=>new r((n,i,o)=>{t.push(o),e(...t).then(n,i)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((t,n)=>{this._reject=n;let i=a=>{(!this._isCanceled||!s.shouldReject)&&(this._isPending=!1,t(a))},o=a=>{this._isPending=!1,n(a)},s=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};return Object.defineProperties(s,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(i,o,s)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let t of this._cancelHandlers)t()}catch(t){this._reject(t);return}this._rejectOnCancel&&this._reject(new Gb(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(zb.prototype,Promise.prototype);sT.exports=zb;sT.exports.CancelError=Gb});var gB=v((cT,uT)=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});function VQ(r){return r.encrypted}var aT=(r,e)=>{let t;typeof e=="function"?t={connect:e}:t=e;let n=typeof t.connect=="function",i=typeof t.secureConnect=="function",o=typeof t.close=="function",s=()=>{n&&t.connect(),VQ(r)&&i&&(r.authorized?t.secureConnect():r.authorizationError||r.once("secureConnect",t.secureConnect)),o&&r.once("close",t.close)};r.writable&&!r.connecting?s():r.connecting?r.once("connect",s):r.destroyed&&o&&t.close(r._hadError)};cT.default=aT;uT.exports=aT;uT.exports.default=aT});var yB=v((pT,dT)=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});var $Q=gB(),HQ=require("util"),GQ=Number(process.versions.node.split(".")[0]),lT=r=>{if(r.timings)return r.timings;let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};r.timings=e;let t=a=>{let c=a.emit.bind(a);a.emit=(u,...l)=>(u==="error"&&(e.error=Date.now(),e.phases.total=e.error-e.start,a.emit=c),c(u,...l))};t(r);let n=()=>{e.abort=Date.now(),(!e.response||GQ>=13)&&(e.phases.total=Date.now()-e.start)};r.prependOnceListener("abort",n);let i=a=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,HQ.types.isProxy(a))return;let c=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};a.prependOnceListener("lookup",c),$Q.default(a,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(a.removeListener("lookup",c),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};r.socket?i(r.socket):r.prependOnceListener("socket",i);let o=()=>{var a;e.upload=Date.now(),e.phases.request=e.upload-((a=e.secureConnect)!==null&&a!==void 0?a:e.connect)};return(typeof r.writableFinished=="boolean"?r.writableFinished:r.finished&&r.outputSize===0&&(!r.socket||r.socket.writableLength===0))?o():r.prependOnceListener("finish",o),r.prependOnceListener("response",a=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,a.timings=e,t(a),a.prependOnceListener("end",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start}),a.prependOnceListener("aborted",n)}),e};pT.default=lT;dT.exports=lT;dT.exports.default=lT});var xB=v((Zwe,mT)=>{"use strict";var{V4MAPPED:zQ,ADDRCONFIG:KQ,ALL:IB,promises:{Resolver:bB},lookup:JQ}=require("dns"),{promisify:fT}=require("util"),YQ=require("os"),Il=Symbol("cacheableLookupCreateConnection"),hT=Symbol("cacheableLookupInstance"),vB=Symbol("expires"),XQ=typeof IB=="number",wB=r=>{if(!(r&&typeof r.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},QQ=r=>{for(let e of r)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},SB=()=>{let r=!1,e=!1;for(let t of Object.values(YQ.networkInterfaces()))for(let n of t)if(!n.internal&&(n.family==="IPv6"?e=!0:r=!0,r&&e))return{has4:r,has6:e};return{has4:r,has6:e}},ZQ=r=>Symbol.iterator in r,_B={ttl:!0},eZ={all:!0},Kb=class{constructor({cache:e=new Map,maxTtl:t=1/0,fallbackDuration:n=3600,errorTtl:i=.15,resolver:o=new bB,lookup:s=JQ}={}){if(this.maxTtl=t,this.errorTtl=i,this._cache=e,this._resolver=o,this._dnsLookup=fT(s),this._resolver instanceof bB?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=fT(this._resolver.resolve4.bind(this._resolver)),this._resolve6=fT(this._resolver.resolve6.bind(this._resolver))),this._iface=SB(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,n<1)this._fallback=!1;else{this._fallback=!0;let a=setInterval(()=>{this._hostnamesToFallback.clear()},n*1e3);a.unref&&a.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,n){if(typeof t=="function"?(n=t,t={}):typeof t=="number"&&(t={family:t}),!n)throw new Error("Callback must be a function.");this.lookupAsync(e,t).then(i=>{t.all?n(null,i):n(null,i.address,i.family,i.expires,i.ttl)},n)}async lookupAsync(e,t={}){typeof t=="number"&&(t={family:t});let n=await this.query(e);if(t.family===6){let i=n.filter(o=>o.family===6);t.hints&zQ&&(XQ&&t.hints&IB||i.length===0)?QQ(n):n=i}else t.family===4&&(n=n.filter(i=>i.family===4));if(t.hints&KQ){let{_iface:i}=this;n=n.filter(o=>o.family===6?i.has6:i.has4)}if(n.length===0){let i=new Error(`cacheableLookup ENOTFOUND ${e}`);throw i.code="ENOTFOUND",i.hostname=e,i}return t.all?n:n[0]}async query(e){let t=await this._cache.get(e);if(!t){let n=this._pending[e];if(n)t=await n;else{let i=this.queryAndCache(e);this._pending[e]=i;try{t=await i}finally{delete this._pending[e]}}}return t=t.map(n=>({...n})),t}async _resolve(e){let t=async u=>{try{return await u}catch(l){if(l.code==="ENODATA"||l.code==="ENOTFOUND")return[];throw l}},[n,i]=await Promise.all([this._resolve4(e,_B),this._resolve6(e,_B)].map(u=>t(u))),o=0,s=0,a=0,c=Date.now();for(let u of n)u.family=4,u.expires=c+u.ttl*1e3,o=Math.max(o,u.ttl);for(let u of i)u.family=6,u.expires=c+u.ttl*1e3,s=Math.max(s,u.ttl);return n.length>0?i.length>0?a=Math.min(o,s):a=o:a=s,{entries:[...n,...i],cacheTtl:a}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,t,n){if(this.maxTtl>0&&n>0){n=Math.min(n,this.maxTtl)*1e3,t[vB]=Date.now()+n;try{await this._cache.set(e,t,n)}catch(i){this.lookupAsync=async()=>{let o=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw o.cause=i,o}}ZQ(this._cache)&&this._tick(n)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,eZ);let t=await this._resolve(e);t.entries.length===0&&this._fallback&&(t=await this._lookup(e),t.entries.length!==0&&this._hostnamesToFallback.add(e));let n=t.entries.length===0?this.errorTtl:t.cacheTtl;return await this._set(e,t.entries,n),t.entries}_tick(e){let t=this._nextRemovalTime;(!t||e<t)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let n=1/0,i=Date.now();for(let[o,s]of this._cache){let a=s[vB];i>=a?this._cache.delete(o):a<n&&(n=a)}n!==1/0&&this._tick(n-i)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(wB(e),Il in e)throw new Error("CacheableLookup has been already installed");e[Il]=e.createConnection,e[hT]=this,e.createConnection=(t,n)=>("lookup"in t||(t.lookup=this.lookup),e[Il](t,n))}uninstall(e){if(wB(e),e[Il]){if(e[hT]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Il],delete e[Il],delete e[hT]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=SB(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};mT.exports=Kb;mT.exports.default=Kb});var PB=v((eSe,TB)=>{"use strict";var tZ="text/plain",rZ="us-ascii",CB=(r,e)=>e.some(t=>t instanceof RegExp?t.test(r):t===r),nZ=(r,{stripHash:e})=>{let t=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(r);if(!t)throw new Error(`Invalid URL: ${r}`);let{type:n,data:i,hash:o}=t.groups,s=n.split(";");o=e?"":o;let a=!1;s[s.length-1]==="base64"&&(s.pop(),a=!0);let c=(s.shift()||"").toLowerCase(),l=[...s.map(p=>{let[d,f=""]=p.split("=").map(h=>h.trim());return d==="charset"&&(f=f.toLowerCase(),f===rZ)?"":`${d}${f?`=${f}`:""}`}).filter(Boolean)];return a&&l.push("base64"),(l.length!==0||c&&c!==tZ)&&l.unshift(c),`data:${l.join(";")},${a?i.trim():i}${o?`#${o}`:""}`},iZ=(r,e)=>{if(e={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,...e},r=r.trim(),/^data:/i.test(r))return nZ(r,e);if(/^view-source:/i.test(r))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let t=r.startsWith("//");!t&&/^\.*\//.test(r)||(r=r.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let i=new URL(r);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&i.protocol==="https:"&&(i.protocol="http:"),e.forceHttps&&i.protocol==="http:"&&(i.protocol="https:"),e.stripAuthentication&&(i.username="",i.password=""),e.stripHash?i.hash="":e.stripTextFragment&&(i.hash=i.hash.replace(/#?:~:text.*?$/i,"")),i.pathname&&(i.pathname=i.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")),i.pathname)try{i.pathname=decodeURI(i.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let s=i.pathname.split("/"),a=s[s.length-1];CB(a,e.removeDirectoryIndex)&&(s=s.slice(0,s.length-1),i.pathname=s.slice(1).join("/")+"/")}if(i.hostname&&(i.hostname=i.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(i.hostname)&&(i.hostname=i.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let s of[...i.searchParams.keys()])CB(s,e.removeQueryParameters)&&i.searchParams.delete(s);e.removeQueryParameters===!0&&(i.search=""),e.sortQueryParameters&&i.searchParams.sort(),e.removeTrailingSlash&&(i.pathname=i.pathname.replace(/\/$/,""));let o=r;return r=i.toString(),!e.removeSingleSlash&&i.pathname==="/"&&!o.endsWith("/")&&i.hash===""&&(r=r.replace(/\/$/,"")),(e.removeTrailingSlash||i.pathname==="/")&&i.hash===""&&e.removeSingleSlash&&(r=r.replace(/\/$/,"")),t&&!e.normalizeProtocol&&(r=r.replace(/^http:\/\//,"//")),e.stripProtocol&&(r=r.replace(/^(?:https?:)?\/\//,"")),r};TB.exports=iZ});var RB=v((tSe,kB)=>{kB.exports=EB;function EB(r,e){if(r&&e)return EB(r)(e);if(typeof r!="function")throw new TypeError("need wrapper function");return Object.keys(r).forEach(function(n){t[n]=r[n]}),t;function t(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=r.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var yT=v((rSe,gT)=>{var AB=RB();gT.exports=AB(Jb);gT.exports.strict=AB(DB);Jb.proto=Jb(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Jb(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return DB(this)},configurable:!0})});function Jb(r){var e=function(){return e.called?e.value:(e.called=!0,e.value=r.apply(this,arguments))};return e.called=!1,e}function DB(r){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=r.apply(this,arguments)},t=r.name||"Function wrapped with `once`";return e.onceError=t+" shouldn't be called more than once",e.called=!1,e}});var MB=v((nSe,LB)=>{var oZ=yT(),sZ=function(){},aZ=function(r){return r.setHeader&&typeof r.abort=="function"},cZ=function(r){return r.stdio&&Array.isArray(r.stdio)&&r.stdio.length===3},OB=function(r,e,t){if(typeof e=="function")return OB(r,null,e);e||(e={}),t=oZ(t||sZ);var n=r._writableState,i=r._readableState,o=e.readable||e.readable!==!1&&r.readable,s=e.writable||e.writable!==!1&&r.writable,a=!1,c=function(){r.writable||u()},u=function(){s=!1,o||t.call(r)},l=function(){o=!1,s||t.call(r)},p=function(y){t.call(r,y?new Error("exited with error code: "+y):null)},d=function(y){t.call(r,y)},f=function(){process.nextTick(h)},h=function(){if(!a){if(o&&!(i&&i.ended&&!i.destroyed))return t.call(r,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return t.call(r,new Error("premature close"))}},m=function(){r.req.on("finish",u)};return aZ(r)?(r.on("complete",u),r.on("abort",f),r.req?m():r.on("request",m)):s&&!n&&(r.on("end",c),r.on("close",c)),cZ(r)&&r.on("exit",p),r.on("end",l),r.on("finish",u),e.error!==!1&&r.on("error",d),r.on("close",f),function(){a=!0,r.removeListener("complete",u),r.removeListener("abort",f),r.removeListener("request",m),r.req&&r.req.removeListener("finish",u),r.removeListener("end",c),r.removeListener("close",c),r.removeListener("finish",u),r.removeListener("exit",p),r.removeListener("end",l),r.removeListener("error",d),r.removeListener("close",f)}};LB.exports=OB});var BB=v((iSe,FB)=>{var uZ=yT(),lZ=MB(),bT=require("fs"),Uf=function(){},pZ=/^v?\.0/.test(process.version),Yb=function(r){return typeof r=="function"},dZ=function(r){return!pZ||!bT?!1:(r instanceof(bT.ReadStream||Uf)||r instanceof(bT.WriteStream||Uf))&&Yb(r.close)},fZ=function(r){return r.setHeader&&Yb(r.abort)},hZ=function(r,e,t,n){n=uZ(n);var i=!1;r.on("close",function(){i=!0}),lZ(r,{readable:e,writable:t},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,dZ(r))return r.close(Uf);if(fZ(r))return r.abort();if(Yb(r.destroy))return r.destroy();n(s||new Error("stream was destroyed"))}}},NB=function(r){r()},mZ=function(r,e){return r.pipe(e)},gZ=function(){var r=Array.prototype.slice.call(arguments),e=Yb(r[r.length-1]||Uf)&&r.pop()||Uf;if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new Error("pump requires two streams per minimum");var t,n=r.map(function(i,o){var s=o<r.length-1,a=o>0;return hZ(i,s,a,function(c){t||(t=c),c&&n.forEach(NB),!s&&(n.forEach(NB),e(t))})});return r.reduce(mZ)};FB.exports=gZ});var UB=v((oSe,jB)=>{"use strict";var{PassThrough:yZ}=require("stream");jB.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",i=!1;e?i=!(t||n):t=t||"utf8",n&&(t=null);let o=new yZ({objectMode:i});t&&o.setEncoding(t);let s=0,a=[];return o.on("data",c=>{a.push(c),i?s=a.length:s+=c.length}),o.getBufferedValue=()=>e?a:n?Buffer.concat(a,s):a.join(""),o.getBufferedLength=()=>s,o}});var qB=v((sSe,xl)=>{"use strict";var{constants:bZ}=require("buffer"),vZ=BB(),wZ=UB(),Xb=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Qb(r,e){if(!r)return Promise.reject(new Error("Expected a stream"));e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n;return await new Promise((i,o)=>{let s=a=>{a&&n.getBufferedLength()<=bZ.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),o(a)};n=vZ(r,wZ(e),a=>{if(a){s(a);return}i()}),n.on("data",()=>{n.getBufferedLength()>t&&s(new Xb)})}),n.getBufferedValue()}xl.exports=Qb;xl.exports.default=Qb;xl.exports.buffer=(r,e)=>Qb(r,{...e,encoding:"buffer"});xl.exports.array=(r,e)=>Qb(r,{...e,array:!0});xl.exports.MaxBufferError=Xb});var VB=v((cSe,WB)=>{"use strict";var SZ=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),_Z=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),IZ=new Set([500,502,503,504]),xZ={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},CZ={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function yc(r){let e=parseInt(r,10);return isFinite(e)?e:0}function TZ(r){return r?IZ.has(r.status):!0}function vT(r){let e={};if(!r)return e;let t=r.trim().split(/,/);for(let n of t){let[i,o]=n.split(/=/,2);e[i.trim()]=o===void 0?!0:o.trim().replace(/^"|"$/g,"")}return e}function PZ(r){let e=[];for(let t in r){let n=r[t];e.push(n===!0?t:t+"="+n)}if(e.length)return e.join(", ")}WB.exports=class{constructor(e,t,{shared:n,cacheHeuristic:i,immutableMinTimeToLive:o,ignoreCargoCult:s,_fromObject:a}={}){if(a){this._fromObject(a);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=o!==void 0?o:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=vT(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=vT(e.headers["cache-control"]),s&&"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":PZ(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&_Z.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||SZ.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);let t=vT(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"]&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge()))?!1: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&&e.method==="HEAD")&&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;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let n in e)xZ[n]||(t[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let i of n)delete t[i]}if(t.warning){let n=t.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));n.length?t.warning=n.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(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(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return yc(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return yc(this._rescc["s-maxage"])}if(this._rescc["max-age"])return yc(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<t?0:Math.max(e,(n-t)/1e3)}if(this._resHeaders["last-modified"]){let n=Date.parse(this._resHeaders["last-modified"]);if(isFinite(n)&&t>n)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+yc(this._rescc["stale-if-error"]),n=e+yc(this._rescc["stale-while-revalidate"]);return Math.max(0,e,t,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+yc(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+yc(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||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,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);let 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&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let i=t["if-none-match"].split(/,/).filter(o=>!/^\s*W\//.test(o));i.length?t["if-none-match"]=i.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()&&TZ(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let n=!1;if(t.status!==void 0&&t.status!=304?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:t.status!=304,matches:!1};let i={};for(let s in this._resHeaders)i[s]=s in t.headers&&!CZ[s]?t.headers[s]:this._resHeaders[s];let o=Object.assign({},t,{status:this._status,method:this._method,headers:i});return{policy:new this.constructor(e,o,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var Zb=v((uSe,$B)=>{"use strict";$B.exports=r=>{let e={};for(let[t,n]of Object.entries(r))e[t.toLowerCase()]=n;return e}});var GB=v((lSe,HB)=>{"use strict";var EZ=require("stream").Readable,kZ=Zb(),wT=class extends EZ{constructor(e,t,n,i){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof t!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof i!="string")throw new TypeError("Argument `url` should be a string");super(),this.statusCode=e,this.headers=kZ(t),this.body=n,this.url=i}_read(){this.push(this.body),this.push(null)}};HB.exports=wT});var KB=v((pSe,zB)=>{"use strict";var RZ=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];zB.exports=(r,e)=>{let t=new Set(Object.keys(r).concat(RZ));for(let n of t)n in e||(e[n]=typeof r[n]=="function"?r[n].bind(r):r[n])}});var YB=v((dSe,JB)=>{"use strict";var AZ=require("stream").PassThrough,DZ=KB(),OZ=r=>{if(!(r&&r.pipe))throw new TypeError("Parameter `response` must be a response stream.");let e=new AZ;return DZ(r,e),r.pipe(e)};JB.exports=OZ});var XB=v(ST=>{ST.stringify=function r(e){if(typeof e>"u")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var t="",n=Array.isArray(e);t=n?"[":"{";var i=!0;for(var o in e){var s=typeof e[o]=="function"||!n&&typeof e[o]>"u";Object.hasOwnProperty.call(e,o)&&!s&&(i||(t+=","),i=!1,n?e[o]==null?t+="null":t+=r(e[o]):e[o]!==void 0&&(t+=r(o)+":"+r(e[o])))}return t+=n?"]":"}",t}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e>"u"?"null":JSON.stringify(e)};ST.parse=function(r){return JSON.parse(r,function(e,t){return typeof t=="string"?/^:base64:/.test(t)?Buffer.from(t.substring(8),"base64"):/^:/.test(t)?t.substring(1):t:t})}});var tj=v((hSe,ej)=>{"use strict";var LZ=require("events"),QB=XB(),MZ=r=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(r.adapter||r.uri){let t=r.adapter||/^[^:+]*/.exec(r.uri)[0];return new(require(e[t]))(r)}return new Map},ZB=["sqlite","postgres","mysql","mongo","redis","tiered"],_T=class extends LZ{constructor(e,{emitErrors:t=!0,...n}={}){if(super(),this.opts={namespace:"keyv",serialize:QB.stringify,deserialize:QB.parse,...typeof e=="string"?{uri:e}:e,...n},!this.opts.store){let o={...this.opts};this.opts.store=MZ(o)}if(this.opts.compression){let o=this.opts.compression;this.opts.serialize=o.serialize.bind(o),this.opts.deserialize=o.deserialize.bind(o)}typeof this.opts.store.on=="function"&&t&&this.opts.store.on("error",o=>this.emit("error",o)),this.opts.store.namespace=this.opts.namespace;let i=o=>async function*(){for await(let[s,a]of typeof o=="function"?o(this.opts.store.namespace):o){let c=await this.opts.deserialize(a);if(!(this.opts.store.namespace&&!s.includes(this.opts.store.namespace))){if(typeof c.expires=="number"&&Date.now()>c.expires){this.delete(s);continue}yield[this._getKeyUnprefix(s),c.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=i(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=i(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return ZB.includes(this.opts.store.opts.dialect)||ZB.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(t=>`${this.opts.namespace}:${t}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,t){let{store:n}=this.opts,i=Array.isArray(e),o=i?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(i&&n.getMany===void 0){let s=[];for(let a of o)s.push(Promise.resolve().then(()=>n.get(a)).then(c=>typeof c=="string"?this.opts.deserialize(c):this.opts.compression?this.opts.deserialize(c):c).then(c=>{if(c!=null)return typeof c.expires=="number"&&Date.now()>c.expires?this.delete(a).then(()=>{}):t&&t.raw?c:c.value}));return Promise.allSettled(s).then(a=>{let c=[];for(let u of a)c.push(u.value);return c})}return Promise.resolve().then(()=>i?n.getMany(o):n.get(o)).then(s=>typeof s=="string"?this.opts.deserialize(s):this.opts.compression?this.opts.deserialize(s):s).then(s=>{if(s!=null)return i?s.map((a,c)=>{if(typeof a=="string"&&(a=this.opts.deserialize(a)),a!=null){if(typeof a.expires=="number"&&Date.now()>a.expires){this.delete(e[c]).then(()=>{});return}return t&&t.raw?a:a.value}}):typeof s.expires=="number"&&Date.now()>s.expires?this.delete(e).then(()=>{}):t&&t.raw?s:s.value})}set(e,t,n){let i=this._getKeyPrefix(e);typeof n>"u"&&(n=this.opts.ttl),n===0&&(n=void 0);let{store:o}=this.opts;return Promise.resolve().then(()=>{let s=typeof n=="number"?Date.now()+n:null;return typeof t=="symbol"&&this.emit("error","symbol cannot be serialized"),t={value:t,expires:s},this.opts.serialize(t)}).then(s=>o.set(i,s,n)).then(()=>!0)}delete(e){let{store:t}=this.opts;if(Array.isArray(e)){let i=this._getKeyPrefixArray(e);if(t.deleteMany===void 0){let o=[];for(let s of i)o.push(t.delete(s));return Promise.allSettled(o).then(s=>s.every(a=>a.value===!0))}return Promise.resolve().then(()=>t.deleteMany(i))}let n=this._getKeyPrefix(e);return Promise.resolve().then(()=>t.delete(n))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let t=this._getKeyPrefix(e),{store:n}=this.opts;return Promise.resolve().then(async()=>typeof n.has=="function"?n.has(t):await n.get(t)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};ej.exports=_T});var ij=v((mSe,nj)=>{"use strict";var NZ=require("events"),ev=require("url"),FZ=PB(),BZ=qB(),IT=VB(),rj=GB(),jZ=Zb(),UZ=YB(),qZ=tj(),qf=class r{constructor(e,t){if(typeof e!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new qZ({uri:typeof t=="string"&&t,store:typeof t!="string"&&t,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(t,n)=>{let i;if(typeof t=="string")i=xT(ev.parse(t)),t={};else if(t instanceof ev.URL)i=xT(ev.parse(t.toString())),t={};else{let[p,...d]=(t.path||"").split("?"),f=d.length>0?`?${d.join("?")}`:"";i=xT({...t,pathname:p,search:f})}t={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...t,...WZ(i)},t.headers=jZ(t.headers);let o=new NZ,s=FZ(ev.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${t.method}:${s}`,c=!1,u=!1,l=p=>{u=!0;let d=!1,f,h=new Promise(y=>{f=()=>{d||(d=!0,y())}}),m=y=>{if(c&&!p.forceRefresh){y.status=y.statusCode;let L=IT.fromObject(c.cachePolicy).revalidatedPolicy(p,y);if(!L.modified){let P=L.policy.responseHeaders();y=new rj(c.statusCode,P,c.body,c.url),y.cachePolicy=L.policy,y.fromCache=!0}}y.fromCache||(y.cachePolicy=new IT(p,y,p),y.fromCache=!1);let I;p.cache&&y.cachePolicy.storable()?(I=UZ(y),(async()=>{try{let L=BZ.buffer(y);if(await Promise.race([h,new Promise(M=>y.once("end",M))]),d)return;let P=await L,W={cachePolicy:y.cachePolicy.toObject(),url:y.url,statusCode:y.fromCache?c.statusCode:y.statusCode,body:P},E=p.strictTtl?y.cachePolicy.timeToLive():void 0;p.maxTtl&&(E=E?Math.min(E,p.maxTtl):p.maxTtl),await this.cache.set(a,W,E)}catch(L){o.emit("error",new r.CacheError(L))}})()):p.cache&&c&&(async()=>{try{await this.cache.delete(a)}catch(L){o.emit("error",new r.CacheError(L))}})(),o.emit("response",I||y),typeof n=="function"&&n(I||y)};try{let y=e(p,m);y.once("error",f),y.once("abort",f),o.emit("request",y)}catch(y){o.emit("error",new r.RequestError(y))}};return(async()=>{let p=async f=>{await Promise.resolve();let h=f.cache?await this.cache.get(a):void 0;if(typeof h>"u")return l(f);let m=IT.fromObject(h.cachePolicy);if(m.satisfiesWithoutRevalidation(f)&&!f.forceRefresh){let y=m.responseHeaders(),I=new rj(h.statusCode,y,h.body,h.url);I.cachePolicy=m,I.fromCache=!0,o.emit("response",I),typeof n=="function"&&n(I)}else c=h,f.headers=m.revalidationHeaders(f),l(f)},d=f=>o.emit("error",new r.CacheError(f));this.cache.once("error",d),o.on("response",()=>this.cache.removeListener("error",d));try{await p(t)}catch(f){t.automaticFailover&&!u&&l(t),o.emit("error",new r.CacheError(f))}})(),o}}};function WZ(r){let e={...r};return e.path=`${r.pathname||"/"}${r.search||""}`,delete e.pathname,delete e.search,e}function xT(r){return{protocol:r.protocol,auth:r.auth,hostname:r.hostname||r.host||"localhost",port:r.port,pathname:r.pathname,search:r.search}}qf.RequestError=class extends Error{constructor(r){super(r.message),this.name="RequestError",Object.assign(this,r)}};qf.CacheError=class extends Error{constructor(r){super(r.message),this.name="CacheError",Object.assign(this,r)}};nj.exports=qf});var sj=v((bSe,oj)=>{"use strict";var VZ=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];oj.exports=(r,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let t=new Set(Object.keys(r).concat(VZ)),n={};for(let i of t)i in e||(n[i]={get(){let o=r[i];return typeof o=="function"?o.bind(r):o},set(o){r[i]=o},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),r.once("aborted",()=>{e.destroy(),e.emit("aborted")}),r.once("close",()=>{r.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var cj=v((vSe,aj)=>{"use strict";var{Transform:$Z,PassThrough:HZ}=require("stream"),CT=require("zlib"),GZ=sj();aj.exports=r=>{let e=(r.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return r;let t=e==="br";if(t&&typeof CT.createBrotliDecompress!="function")return r.destroy(new Error("Brotli is not supported on Node.js < 12")),r;let n=!0,i=new $Z({transform(a,c,u){n=!1,u(null,a)},flush(a){a()}}),o=new HZ({autoDestroy:!1,destroy(a,c){r.destroy(),c(a)}}),s=t?CT.createBrotliDecompress():CT.createUnzip();return s.once("error",a=>{if(n&&!r.readable){o.end();return}o.destroy(a)}),GZ(r,o),r.pipe(i).pipe(s).pipe(o),o}});var PT=v((wSe,uj)=>{"use strict";var TT=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){if(this.cache.set(e,t),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[n,i]of this.oldCache.entries())this.onEviction(n,i);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(let t of this.oldCache.keys())this.cache.has(t)||e++;return Math.min(this._size+e,this.maxSize)}};uj.exports=TT});var kT=v((SSe,fj)=>{"use strict";var zZ=require("events"),KZ=require("tls"),JZ=require("http2"),YZ=PT(),_r=Symbol("currentStreamsCount"),lj=Symbol("request"),En=Symbol("cachedOriginSet"),Cl=Symbol("gracefullyClosing"),XZ=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],QZ=(r,e,t)=>{let n=0,i=r.length;for(;n<i;){let o=n+i>>>1;t(r[o],e)?n=o+1:i=o}return n},ZZ=(r,e)=>r.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,ET=(r,e)=>{for(let t of r)t[En].length<e[En].length&&t[En].every(n=>e[En].includes(n))&&t[_r]+e[_r]<=e.remoteSettings.maxConcurrentStreams&&dj(t)},eee=(r,e)=>{for(let t of r)e[En].length<t[En].length&&e[En].every(n=>t[En].includes(n))&&e[_r]+t[_r]<=t.remoteSettings.maxConcurrentStreams&&dj(e)},pj=({agent:r,isFree:e})=>{let t={};for(let n in r.sessions){let o=r.sessions[n].filter(s=>{let a=s[bc.kCurrentStreamsCount]<s.remoteSettings.maxConcurrentStreams;return e?a:!a});o.length!==0&&(t[n]=o)}return t},dj=r=>{r[Cl]=!0,r[_r]===0&&r.close()},bc=class r extends zZ{constructor({timeout:e=6e4,maxSessions:t=1/0,maxFreeSessions:n=10,maxCachedTlsSessions:i=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=t,this.maxFreeSessions=n,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new YZ({maxSize:i})}static normalizeOrigin(e,t){return typeof e=="string"&&(e=new URL(e)),t&&e.hostname!==t&&(e.hostname=t),e.origin}normalizeOptions(e){let t="";if(e)for(let n of XZ)e[n]&&(t+=`:${e[n]}`);return t}_tryToCreateNewSession(e,t){if(!(e in this.queue)||!(t in this.queue[e]))return;let n=this.queue[e][t];this._sessionsCount<this.maxSessions&&!n.completed&&(n.completed=!0,n())}getSession(e,t,n){return new Promise((i,o)=>{Array.isArray(n)?(n=[...n],i()):n=[{resolve:i,reject:o}];let s=this.normalizeOptions(t),a=r.normalizeOrigin(e,t&&t.servername);if(a===void 0){for(let{reject:l}of n)l(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(s in this.sessions){let l=this.sessions[s],p=-1,d=-1,f;for(let h of l){let m=h.remoteSettings.maxConcurrentStreams;if(m<p)break;if(h[En].includes(a)){let y=h[_r];if(y>=m||h[Cl]||h.destroyed)continue;f||(p=m),y>d&&(f=h,d=y)}}if(f){if(n.length!==1){for(let{reject:h}of n){let m=new Error(`Expected the length of listeners to be 1, got ${n.length}.
Please report this to https://github.com/szmarczak/http2-wrapper/`);h(m)}return}n[0].resolve(f);return}}if(s in this.queue){if(a in this.queue[s]){this.queue[s][a].listeners.push(...n),this._tryToCreateNewSession(s,a);return}}else this.queue[s]={};let c=()=>{s in this.queue&&this.queue[s][a]===u&&(delete this.queue[s][a],Object.keys(this.queue[s]).length===0&&delete this.queue[s])},u=()=>{let l=`${a}:${s}`,p=!1;try{let d=JZ.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(l),...t});d[_r]=0,d[Cl]=!1;let f=()=>d[_r]<d.remoteSettings.maxConcurrentStreams,h=!0;d.socket.once("session",y=>{this.tlsSessionCache.set(l,y)}),d.once("error",y=>{for(let{reject:I}of n)I(y);this.tlsSessionCache.delete(l)}),d.setTimeout(this.timeout,()=>{d.destroy()}),d.once("close",()=>{if(p){h&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[s];y.splice(y.indexOf(d),1),y.length===0&&delete this.sessions[s]}else{let y=new Error("Session closed without receiving a SETTINGS frame");y.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:I}of n)I(y);c()}this._tryToCreateNewSession(s,a)});let m=()=>{if(!(!(s in this.queue)||!f())){for(let y of d[En])if(y in this.queue[s]){let{listeners:I}=this.queue[s][y];for(;I.length!==0&&f();)I.shift().resolve(d);let L=this.queue[s];if(L[y].listeners.length===0&&(delete L[y],Object.keys(L).length===0)){delete this.queue[s];break}if(!f())break}}};d.on("origin",()=>{d[En]=d.originSet,f()&&(m(),ET(this.sessions[s],d))}),d.once("remoteSettings",()=>{if(d.ref(),d.unref(),this._sessionsCount++,u.destroyed){let y=new Error("Agent has been destroyed");for(let I of n)I.reject(y);d.destroy();return}d[En]=d.originSet;{let y=this.sessions;if(s in y){let I=y[s];I.splice(QZ(I,d,ZZ),0,d)}else y[s]=[d]}this._freeSessionsCount+=1,p=!0,this.emit("session",d),m(),c(),d[_r]===0&&this._freeSessionsCount>this.maxFreeSessions&&d.close(),n.length!==0&&(this.getSession(a,t,n),n.length=0),d.on("remoteSettings",()=>{m(),ET(this.sessions[s],d)})}),d[lj]=d.request,d.request=(y,I)=>{if(d[Cl])throw new Error("The session is gracefully closing. No new streams are allowed.");let L=d[lj](y,I);return d.ref(),++d[_r],d[_r]===d.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,L.once("close",()=>{if(h=f(),--d[_r],!d.destroyed&&!d.closed&&(eee(this.sessions[s],d),f()&&!d.closed)){h||(this._freeSessionsCount++,h=!0);let P=d[_r]===0;P&&d.unref(),P&&(this._freeSessionsCount>this.maxFreeSessions||d[Cl])?d.close():(ET(this.sessions[s],d),m())}}),L}}catch(d){for(let f of n)f.reject(d);c()}};u.listeners=n,u.completed=!1,u.destroyed=!1,this.queue[s][a]=u,this._tryToCreateNewSession(s,a)})}request(e,t,n,i){return new Promise((o,s)=>{this.getSession(e,t,[{reject:s,resolve:a=>{try{o(a.request(n,i))}catch(c){s(c)}}}])})}createConnection(e,t){return r.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];let n=e.port||443,i=e.hostname||e.host;return typeof t.servername>"u"&&(t.servername=i),KZ.connect(n,i,t)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let t of e)t[_r]===0&&t.close()}destroy(e){for(let t of Object.values(this.sessions))for(let n of t)n.destroy(e);for(let t of Object.values(this.queue))for(let n of Object.values(t))n.destroyed=!0;this.queue={}}get freeSessions(){return pj({agent:this,isFree:!0})}get busySessions(){return pj({agent:this,isFree:!1})}};bc.kCurrentStreamsCount=_r;bc.kGracefullyClosing=Cl;fj.exports={Agent:bc,globalAgent:new bc}});var AT=v((_Se,hj)=>{"use strict";var{Readable:tee}=require("stream"),RT=class extends tee{constructor(e,t){super({highWaterMark:t,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,t){return this.req.setTimeout(e,t),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};hj.exports=RT});var DT=v((ISe,mj)=>{"use strict";mj.exports=r=>{let e={protocol:r.protocol,hostname:typeof r.hostname=="string"&&r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,host:r.host,hash:r.hash,search:r.search,pathname:r.pathname,href:r.href,path:`${r.pathname||""}${r.search||""}`};return typeof r.port=="string"&&r.port.length!==0&&(e.port=Number(r.port)),(r.username||r.password)&&(e.auth=`${r.username||""}:${r.password||""}`),e}});var yj=v((xSe,gj)=>{"use strict";gj.exports=(r,e,t)=>{for(let n of t)r.on(n,(...i)=>e.emit(n,...i))}});var vj=v((CSe,bj)=>{"use strict";bj.exports=r=>{switch(r){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var Sj=v((PSe,wj)=>{"use strict";var Tl=(r,e,t)=>{wj.exports[e]=class extends r{constructor(...i){super(typeof t=="string"?t:t(i)),this.name=`${super.name} [${e}]`,this.code=e}}};Tl(TypeError,"ERR_INVALID_ARG_TYPE",r=>{let e=r[0].includes(".")?"property":"argument",t=r[1],n=Array.isArray(t);return n&&(t=`${t.slice(0,-1).join(", ")} or ${t.slice(-1)}`),`The "${r[0]}" ${e} must be ${n?"one of":"of"} type ${t}. Received ${typeof r[2]}`});Tl(TypeError,"ERR_INVALID_PROTOCOL",r=>`Protocol "${r[0]}" not supported. Expected "${r[1]}"`);Tl(Error,"ERR_HTTP_HEADERS_SENT",r=>`Cannot ${r[0]} headers after they are sent to the client`);Tl(TypeError,"ERR_INVALID_HTTP_TOKEN",r=>`${r[0]} must be a valid HTTP token [${r[1]}]`);Tl(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",r=>`Invalid value "${r[0]} for header "${r[1]}"`);Tl(TypeError,"ERR_INVALID_CHAR",r=>`Invalid character in ${r[0]} [${r[1]}]`)});var FT=v((ESe,Ej)=>{"use strict";var ree=require("http2"),{Writable:nee}=require("stream"),{Agent:_j,globalAgent:iee}=kT(),oee=AT(),see=DT(),aee=yj(),cee=vj(),{ERR_INVALID_ARG_TYPE:OT,ERR_INVALID_PROTOCOL:uee,ERR_HTTP_HEADERS_SENT:Ij,ERR_INVALID_HTTP_TOKEN:lee,ERR_HTTP_INVALID_HEADER_VALUE:pee,ERR_INVALID_CHAR:dee}=Sj(),{HTTP2_HEADER_STATUS:xj,HTTP2_HEADER_METHOD:Cj,HTTP2_HEADER_PATH:Tj,HTTP2_METHOD_CONNECT:fee}=ree.constants,mr=Symbol("headers"),LT=Symbol("origin"),MT=Symbol("session"),Pj=Symbol("options"),tv=Symbol("flushedHeaders"),Wf=Symbol("jobs"),hee=/^[\^`\-\w!#$%&*+.|~]+$/,mee=/[^\t\u0020-\u007E\u0080-\u00FF]/,NT=class extends nee{constructor(e,t,n){super({autoDestroy:!1});let i=typeof e=="string"||e instanceof URL;if(i&&(e=see(e instanceof URL?e:new URL(e))),typeof t=="function"||t===void 0?(n=t,t=i?e:{...e}):t={...e,...t},t.h2session)this[MT]=t.h2session;else if(t.agent===!1)this.agent=new _j({maxFreeSessions:0});else if(typeof t.agent>"u"||t.agent===null)typeof t.createConnection=="function"?(this.agent=new _j({maxFreeSessions:0}),this.agent.createConnection=t.createConnection):this.agent=iee;else if(typeof t.agent.request=="function")this.agent=t.agent;else throw new OT("options.agent",["Agent-like Object","undefined","false"],t.agent);if(t.protocol&&t.protocol!=="https:")throw new uee(t.protocol,"https:");let o=t.port||t.defaultPort||this.agent&&this.agent.defaultPort||443,s=t.hostname||t.host||"localhost";delete t.hostname,delete t.host,delete t.port;let{timeout:a}=t;if(t.timeout=void 0,this[mr]=Object.create(null),this[Wf]=[],this.socket=null,this.connection=null,this.method=t.method||"GET",this.path=t.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,t.headers)for(let[c,u]of Object.entries(t.headers))this.setHeader(c,u);t.auth&&!("authorization"in this[mr])&&(this[mr].authorization="Basic "+Buffer.from(t.auth).toString("base64")),t.session=t.tlsSession,t.path=t.socketPath,this[Pj]=t,o===443?(this[LT]=`https://${s}`,":authority"in this[mr]||(this[mr][":authority"]=s)):(this[LT]=`https://${s}:${o}`,":authority"in this[mr]||(this[mr][":authority"]=`${s}:${o}`)),a&&this.setTimeout(a),n&&this.once("response",n),this[tv]=!1}get method(){return this[mr][Cj]}set method(e){e&&(this[mr][Cj]=e.toUpperCase())}get path(){return this[mr][Tj]}set path(e){e&&(this[mr][Tj]=e)}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,t,n){if(this._mustNotHaveABody){n(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let i=()=>this._request.write(e,t,n);this._request?i():this[Wf].push(i)}_final(e){if(this.destroyed)return;this.flushHeaders();let t=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?t():this[Wf].push(t)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}_destroy(e,t){this.res&&this.res._dump(),this._request&&this._request.destroy(),t(e)}async flushHeaders(){if(this[tv]||this.destroyed)return;this[tv]=!0;let e=this.method===fee,t=n=>{if(this._request=n,this.destroyed){n.destroy();return}e||aee(n,this,["timeout","continue","close","error"]);let i=s=>(...a)=>{!this.writable&&!this.destroyed?s(...a):this.once("finish",()=>{s(...a)})};n.once("response",i((s,a,c)=>{let u=new oee(this.socket,n.readableHighWaterMark);this.res=u,u.req=this,u.statusCode=s[xj],u.headers=s,u.rawHeaders=c,u.once("end",()=>{this.aborted?(u.aborted=!0,u.emit("aborted")):(u.complete=!0,u.socket=null,u.connection=null)}),e?(u.upgrade=!0,this.emit("connect",u,n,Buffer.alloc(0))?this.emit("close"):n.destroy()):(n.on("data",l=>{!u._dumped&&!u.push(l)&&n.pause()}),n.once("end",()=>{u.push(null)}),this.emit("response",u)||u._dump())})),n.once("headers",i(s=>this.emit("information",{statusCode:s[xj]}))),n.once("trailers",i((s,a,c)=>{let{res:u}=this;u.trailers=s,u.rawTrailers=c}));let{socket:o}=n.session;this.socket=o,this.connection=o;for(let s of this[Wf])s();this.emit("socket",this.socket)};if(this[MT])try{t(this[MT].request(this[mr]))}catch(n){this.emit("error",n)}else{this.reusedSocket=!0;try{t(await this.agent.request(this[LT],this[Pj],this[mr]))}catch(n){this.emit("error",n)}}}getHeader(e){if(typeof e!="string")throw new OT("name","string",e);return this[mr][e.toLowerCase()]}get headersSent(){return this[tv]}removeHeader(e){if(typeof e!="string")throw new OT("name","string",e);if(this.headersSent)throw new Ij("remove");delete this[mr][e.toLowerCase()]}setHeader(e,t){if(this.headersSent)throw new Ij("set");if(typeof e!="string"||!hee.test(e)&&!cee(e))throw new lee("Header name",e);if(typeof t>"u")throw new pee(t,e);if(mee.test(t))throw new dee("header content",e);this[mr][e.toLowerCase()]=t}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,t){let n=()=>this._request.setTimeout(e,t);return this._request?n():this[Wf].push(n),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};Ej.exports=NT});var Rj=v((kSe,kj)=>{"use strict";var gee=require("tls");kj.exports=(r={},e=gee.connect)=>new Promise((t,n)=>{let i=!1,o,s=async()=>{await c,o.off("timeout",a),o.off("error",n),r.resolveSocket?(t({alpnProtocol:o.alpnProtocol,socket:o,timeout:i}),i&&(await Promise.resolve(),o.emit("timeout"))):(o.destroy(),t({alpnProtocol:o.alpnProtocol,timeout:i}))},a=async()=>{i=!0,s()},c=(async()=>{try{o=await e(r,s),o.on("error",n),o.once("timeout",a)}catch(u){n(u)}})()})});var Dj=v((RSe,Aj)=>{"use strict";var yee=require("net");Aj.exports=r=>{let e=r.host,t=r.headers&&r.headers.host;return t&&(t.startsWith("[")?t.indexOf("]")===-1?e=t:e=t.slice(1,-1):e=t.split(":",1)[0]),yee.isIP(e)?"":e}});var Mj=v((ASe,jT)=>{"use strict";var Oj=require("http"),BT=require("https"),bee=Rj(),vee=PT(),wee=FT(),See=Dj(),_ee=DT(),rv=new vee({maxSize:100}),Vf=new Map,Lj=(r,e,t)=>{e._httpMessage={shouldKeepAlive:!0};let n=()=>{r.emit("free",e,t)};e.on("free",n);let i=()=>{r.removeSocket(e,t)};e.on("close",i);let o=()=>{r.removeSocket(e,t),e.off("close",i),e.off("free",n),e.off("agentRemove",o)};e.on("agentRemove",o),r.emit("free",e,t)},Iee=async r=>{let e=`${r.host}:${r.port}:${r.ALPNProtocols.sort()}`;if(!rv.has(e)){if(Vf.has(e))return(await Vf.get(e)).alpnProtocol;let{path:t,agent:n}=r;r.path=r.socketPath;let i=bee(r);Vf.set(e,i);try{let{socket:o,alpnProtocol:s}=await i;if(rv.set(e,s),r.path=t,s==="h2")o.destroy();else{let{globalAgent:a}=BT,c=BT.Agent.prototype.createConnection;n?n.createConnection===c?Lj(n,o,r):o.destroy():a.createConnection===c?Lj(a,o,r):o.destroy()}return Vf.delete(e),s}catch(o){throw Vf.delete(e),o}}return rv.get(e)};jT.exports=async(r,e,t)=>{if((typeof r=="string"||r instanceof URL)&&(r=_ee(new URL(r))),typeof e=="function"&&(t=e,e=void 0),e={ALPNProtocols:["h2","http/1.1"],...r,...e,resolveSocket:!0},!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let n=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||See(e),e.port=e.port||(n?443:80),e._defaultAgent=n?BT.globalAgent:Oj.globalAgent;let i=e.agent;if(i){if(i.addRequest)throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties");e.agent=i[n?"https":"http"]}return n&&await Iee(e)==="h2"?(i&&(e.agent=i.http2),new wee(e,t)):Oj.request(e,t)};jT.exports.protocolCache=rv});var Fj=v((DSe,Nj)=>{"use strict";var xee=require("http2"),Cee=kT(),UT=FT(),Tee=AT(),Pee=Mj(),Eee=(r,e,t)=>new UT(r,e,t),kee=(r,e,t)=>{let n=new UT(r,e,t);return n.end(),n};Nj.exports={...xee,ClientRequest:UT,IncomingMessage:Tee,...Cee,request:Eee,get:kee,auto:Pee}});var WT=v(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});var Bj=Bo();qT.default=r=>Bj.default.nodeStream(r)&&Bj.default.function_(r.getBoundary)});var Wj=v(VT=>{"use strict";Object.defineProperty(VT,"__esModule",{value:!0});var Uj=require("fs"),qj=require("util"),jj=Bo(),Ree=WT(),Aee=qj.promisify(Uj.stat);VT.default=async(r,e)=>{if(e&&"content-length"in e)return Number(e["content-length"]);if(!r)return 0;if(jj.default.string(r))return Buffer.byteLength(r);if(jj.default.buffer(r))return r.length;if(Ree.default(r))return qj.promisify(r.getLength.bind(r))();if(r instanceof Uj.ReadStream){let{size:t}=await Aee(r.path);return t===0?void 0:t}}});var HT=v($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});function Dee(r,e,t){let n={};for(let i of t)n[i]=(...o)=>{e.emit(i,...o)},r.on(i,n[i]);return()=>{for(let i of t)r.off(i,n[i])}}$T.default=Dee});var Vj=v(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0});GT.default=()=>{let r=[];return{once(e,t,n){e.once(t,n),r.push({origin:e,event:t,fn:n})},unhandleAll(){for(let e of r){let{origin:t,event:n,fn:i}=e;t.removeListener(n,i)}r.length=0}}}});var Hj=v($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.TimeoutError=void 0;var Oee=require("net"),Lee=Vj(),$j=Symbol("reentry"),Mee=()=>{},nv=class extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`),this.event=t,this.name="TimeoutError",this.code="ETIMEDOUT"}};$f.TimeoutError=nv;$f.default=(r,e,t)=>{if($j in r)return Mee;r[$j]=!0;let n=[],{once:i,unhandleAll:o}=Lee.default(),s=(p,d,f)=>{var h;let m=setTimeout(d,p,p,f);(h=m.unref)===null||h===void 0||h.call(m);let y=()=>{clearTimeout(m)};return n.push(y),y},{host:a,hostname:c}=t,u=(p,d)=>{r.destroy(new nv(p,d))},l=()=>{for(let p of n)p();o()};if(r.once("error",p=>{if(l(),r.listenerCount("error")===0)throw p}),r.once("close",l),i(r,"response",p=>{i(p,"end",l)}),typeof e.request<"u"&&s(e.request,u,"request"),typeof e.socket<"u"){let p=()=>{u(e.socket,"socket")};r.setTimeout(e.socket,p),n.push(()=>{r.removeListener("timeout",p)})}return i(r,"socket",p=>{var d;let{socketPath:f}=r;if(p.connecting){let h=!!(f??Oee.isIP((d=c??a)!==null&&d!==void 0?d:"")!==0);if(typeof e.lookup<"u"&&!h&&typeof p.address().address>"u"){let m=s(e.lookup,u,"lookup");i(p,"lookup",m)}if(typeof e.connect<"u"){let m=()=>s(e.connect,u,"connect");h?i(p,"connect",m()):i(p,"lookup",y=>{y===null&&i(p,"connect",m())})}typeof e.secureConnect<"u"&&t.protocol==="https:"&&i(p,"connect",()=>{let m=s(e.secureConnect,u,"secureConnect");i(p,"secureConnect",m)})}if(typeof e.send<"u"){let h=()=>s(e.send,u,"send");p.connecting?i(p,"connect",()=>{i(r,"upload-complete",h())}):i(r,"upload-complete",h())}}),typeof e.response<"u"&&i(r,"upload-complete",()=>{let p=s(e.response,u,"response");i(r,"response",p)}),l}});var zj=v(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});var Gj=Bo();zT.default=r=>{r=r;let e={protocol:r.protocol,hostname:Gj.default.string(r.hostname)&&r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,host:r.host,hash:r.hash,search:r.search,pathname:r.pathname,href:r.href,path:`${r.pathname||""}${r.search||""}`};return Gj.default.string(r.port)&&r.port.length>0&&(e.port=Number(r.port)),(r.username||r.password)&&(e.auth=`${r.username||""}:${r.password||""}`),e}});var Kj=v(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});var Nee=require("url"),Fee=["protocol","host","hostname","port","pathname","search"];KT.default=(r,e)=>{var t,n;if(e.path){if(e.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(e.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(e.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(e.search&&e.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(!r){if(!e.protocol)throw new TypeError("No URL protocol specified");r=`${e.protocol}//${(n=(t=e.hostname)!==null&&t!==void 0?t:e.host)!==null&&n!==void 0?n:""}`}let i=new Nee.URL(r);if(e.path){let o=e.path.indexOf("?");o===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,o),e.search=e.path.slice(o+1)),delete e.path}for(let o of Fee)e[o]&&(i[o]=e[o].toString());return i}});var Jj=v(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});var JT=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,t){typeof e=="object"?this.weakMap.set(e,t):this.map.set(e,t)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};YT.default=JT});var QT=v(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var Bee=async r=>{let e=[],t=0;for await(let n of r)e.push(n),t+=Buffer.byteLength(n);return Buffer.isBuffer(e[0])?Buffer.concat(e,t):Buffer.from(e.join(""))};XT.default=Bee});var Xj=v(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.dnsLookupIpVersionToFamily=vc.isDnsLookupIpVersion=void 0;var Yj={auto:0,ipv4:4,ipv6:6};vc.isDnsLookupIpVersion=r=>r in Yj;vc.dnsLookupIpVersionToFamily=r=>{if(vc.isDnsLookupIpVersion(r))return Yj[r];throw new Error("Invalid DNS lookup IP version")}});var ZT=v(iv=>{"use strict";Object.defineProperty(iv,"__esModule",{value:!0});iv.isResponseOk=void 0;iv.isResponseOk=r=>{let{statusCode:e}=r,t=r.request.options.followRedirect?299:399;return e>=200&&e<=t||e===304}});var Zj=v(eP=>{"use strict";Object.defineProperty(eP,"__esModule",{value:!0});var Qj=new Set;eP.default=r=>{Qj.has(r)||(Qj.add(r),process.emitWarning(`Got: ${r}`,{type:"DeprecationWarning"}))}});var e2=v(tP=>{"use strict";Object.defineProperty(tP,"__esModule",{value:!0});var Qe=Bo(),jee=(r,e)=>{if(Qe.default.null_(r.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");Qe.assert.any([Qe.default.string,Qe.default.undefined],r.encoding),Qe.assert.any([Qe.default.boolean,Qe.default.undefined],r.resolveBodyOnly),Qe.assert.any([Qe.default.boolean,Qe.default.undefined],r.methodRewriting),Qe.assert.any([Qe.default.boolean,Qe.default.undefined],r.isStream),Qe.assert.any([Qe.default.string,Qe.default.undefined],r.responseType),r.responseType===void 0&&(r.responseType="text");let{retry:t}=r;if(e?r.retry={...e.retry}:r.retry={calculateDelay:n=>n.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},Qe.default.object(t)?(r.retry={...r.retry,...t},r.retry.methods=[...new Set(r.retry.methods.map(n=>n.toUpperCase()))],r.retry.statusCodes=[...new Set(r.retry.statusCodes)],r.retry.errorCodes=[...new Set(r.retry.errorCodes)]):Qe.default.number(t)&&(r.retry.limit=t),Qe.default.undefined(r.retry.maxRetryAfter)&&(r.retry.maxRetryAfter=Math.min(...[r.timeout.request,r.timeout.connect].filter(Qe.default.number))),Qe.default.object(r.pagination)){e&&(r.pagination={...e.pagination,...r.pagination});let{pagination:n}=r;if(!Qe.default.function_(n.transform))throw new Error("`options.pagination.transform` must be implemented");if(!Qe.default.function_(n.shouldContinue))throw new Error("`options.pagination.shouldContinue` must be implemented");if(!Qe.default.function_(n.filter))throw new TypeError("`options.pagination.filter` must be implemented");if(!Qe.default.function_(n.paginate))throw new Error("`options.pagination.paginate` must be implemented")}return r.responseType==="json"&&r.headers.accept===void 0&&(r.headers.accept="application/json"),r};tP.default=jee});var t2=v(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.retryAfterStatusCodes=void 0;Hf.retryAfterStatusCodes=new Set([413,429,503]);var Uee=({attemptCount:r,retryOptions:e,error:t,retryAfter:n})=>{if(r>e.limit)return 0;let i=e.methods.includes(t.options.method),o=e.errorCodes.includes(t.code),s=t.response&&e.statusCodes.includes(t.response.statusCode);if(!i||!o&&!s)return 0;if(t.response){if(n)return e.maxRetryAfter===void 0||n>e.maxRetryAfter?0:n;if(t.response.statusCode===413)return 0}let a=Math.random()*100;return 2**(r-1)*1e3+a};Hf.default=Uee});var Kf=v(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.UnsupportedProtocolError=Ee.ReadError=Ee.TimeoutError=Ee.UploadError=Ee.CacheError=Ee.HTTPError=Ee.MaxRedirectsError=Ee.RequestError=Ee.setNonEnumerableProperties=Ee.knownHookEvents=Ee.withoutBody=Ee.kIsNormalizedAlready=void 0;var r2=require("util"),n2=require("stream"),qee=require("fs"),qs=require("url"),i2=require("http"),rP=require("http"),Wee=require("https"),Vee=yB(),$ee=xB(),o2=ij(),Hee=cj(),Gee=Fj(),zee=Zb(),T=Bo(),Kee=Wj(),s2=WT(),Jee=HT(),a2=Hj(),Yee=zj(),c2=Kj(),Xee=Jj(),Qee=QT(),u2=Xj(),Zee=ZT(),Ws=Zj(),ete=e2(),tte=t2(),nP,Zt=Symbol("request"),av=Symbol("response"),Pl=Symbol("responseSize"),El=Symbol("downloadedSize"),kl=Symbol("bodySize"),Rl=Symbol("uploadedSize"),ov=Symbol("serverResponsesPiped"),l2=Symbol("unproxyEvents"),p2=Symbol("isFromCache"),iP=Symbol("cancelTimeouts"),d2=Symbol("startedReading"),Al=Symbol("stopReading"),sv=Symbol("triggerRead"),Vs=Symbol("body"),Gf=Symbol("jobs"),f2=Symbol("originalResponse"),h2=Symbol("retryTimeout");Ee.kIsNormalizedAlready=Symbol("isNormalizedAlready");var rte=T.default.string(process.versions.brotli);Ee.withoutBody=new Set(["GET","HEAD"]);Ee.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function nte(r){for(let e in r){let t=r[e];if(!T.default.string(t)&&!T.default.number(t)&&!T.default.boolean(t)&&!T.default.null_(t)&&!T.default.undefined(t))throw new TypeError(`The \`searchParams\` value '${String(t)}' must be a string, number, boolean or null`)}}function ite(r){return T.default.object(r)&&!("statusCode"in r)}var oP=new Xee.default,ote=async r=>new Promise((e,t)=>{let n=i=>{t(i)};r.pending||e(),r.once("error",n),r.once("ready",()=>{r.off("error",n),e()})}),ste=new Set([300,301,302,303,304,307,308]),ate=["context","body","json","form"];Ee.setNonEnumerableProperties=(r,e)=>{let t={};for(let n of r)if(n)for(let i of ate)i in n&&(t[i]={writable:!0,configurable:!0,enumerable:!1,value:n[i]});Object.defineProperties(e,t)};var wt=class extends Error{constructor(e,t,n){var i,o;if(super(e),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=(i=t.code)!==null&&i!==void 0?i:"ERR_GOT_REQUEST_ERROR",n instanceof hv?(Object.defineProperty(this,"request",{enumerable:!1,value:n}),Object.defineProperty(this,"response",{enumerable:!1,value:n[av]}),Object.defineProperty(this,"options",{enumerable:!1,value:n.options})):Object.defineProperty(this,"options",{enumerable:!1,value:n}),this.timings=(o=this.request)===null||o===void 0?void 0:o.timings,T.default.string(t.stack)&&T.default.string(this.stack)){let s=this.stack.indexOf(this.message)+this.message.length,a=this.stack.slice(s).split(`
`).reverse(),c=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(`
`).reverse();for(;c.length!==0&&c[0]===a[0];)a.shift();this.stack=`${this.stack.slice(0,s)}${a.reverse().join(`
`)}${c.reverse().join(`
`)}`}}};Ee.RequestError=wt;var cv=class extends wt{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};Ee.MaxRedirectsError=cv;var uv=class extends wt{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};Ee.HTTPError=uv;var lv=class extends wt{constructor(e,t){super(e.message,e,t),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};Ee.CacheError=lv;var pv=class extends wt{constructor(e,t){super(e.message,e,t),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};Ee.UploadError=pv;var dv=class extends wt{constructor(e,t,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=t}};Ee.TimeoutError=dv;var zf=class extends wt{constructor(e,t){super(e.message,e,t),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};Ee.ReadError=zf;var fv=class extends wt{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};Ee.UnsupportedProtocolError=fv;var cte=["socket","connect","continue","information","upgrade","timeout"],hv=class extends n2.Duplex{constructor(e,t={},n){super({autoDestroy:!1,highWaterMark:0}),this[El]=0,this[Rl]=0,this.requestInitialized=!1,this[ov]=new Set,this.redirects=[],this[Al]=!1,this[sv]=!1,this[Gf]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),o=()=>this._lockWrite();this.on("pipe",u=>{u.prependListener("data",i),u.on("data",o),u.prependListener("end",i),u.on("end",o)}),this.on("unpipe",u=>{u.off("data",i),u.off("data",o),u.off("end",i),u.off("end",o)}),this.on("pipe",u=>{u instanceof rP.IncomingMessage&&(this.options.headers={...u.headers,...this.options.headers})});let{json:s,body:a,form:c}=t;if((s||a||c)&&this._lockWrite(),Ee.kIsNormalizedAlready in t)this.options=t;else try{this.options=this.constructor.normalizeArguments(e,t,n)}catch(u){T.default.nodeStream(t.body)&&t.body.destroy(),this.destroy(u);return}(async()=>{var u;try{this.options.body instanceof qee.ReadStream&&await ote(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(u=this[Zt])===null||u===void 0||u.destroy();return}for(let p of this[Gf])p();this[Gf].length=0,this.requestInitialized=!0}catch(l){if(l instanceof wt){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,t,n){var i,o,s,a,c;let u=t;if(T.default.object(e)&&!T.default.urlInstance(e))t={...n,...e,...t};else{if(e&&t&&t.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");t={...n,...t},e!==void 0&&(t.url=e),T.default.urlInstance(t.url)&&(t.url=new qs.URL(t.url.toString()))}if(t.cache===!1&&(t.cache=void 0),t.dnsCache===!1&&(t.dnsCache=void 0),T.assert.any([T.default.string,T.default.undefined],t.method),T.assert.any([T.default.object,T.default.undefined],t.headers),T.assert.any([T.default.string,T.default.urlInstance,T.default.undefined],t.prefixUrl),T.assert.any([T.default.object,T.default.undefined],t.cookieJar),T.assert.any([T.default.object,T.default.string,T.default.undefined],t.searchParams),T.assert.any([T.default.object,T.default.string,T.default.undefined],t.cache),T.assert.any([T.default.object,T.default.number,T.default.undefined],t.timeout),T.assert.any([T.default.object,T.default.undefined],t.context),T.assert.any([T.default.object,T.default.undefined],t.hooks),T.assert.any([T.default.boolean,T.default.undefined],t.decompress),T.assert.any([T.default.boolean,T.default.undefined],t.ignoreInvalidCookies),T.assert.any([T.default.boolean,T.default.undefined],t.followRedirect),T.assert.any([T.default.number,T.default.undefined],t.maxRedirects),T.assert.any([T.default.boolean,T.default.undefined],t.throwHttpErrors),T.assert.any([T.default.boolean,T.default.undefined],t.http2),T.assert.any([T.default.boolean,T.default.undefined],t.allowGetBody),T.assert.any([T.default.string,T.default.undefined],t.localAddress),T.assert.any([u2.isDnsLookupIpVersion,T.default.undefined],t.dnsLookupIpVersion),T.assert.any([T.default.object,T.default.undefined],t.https),T.assert.any([T.default.boolean,T.default.undefined],t.rejectUnauthorized),t.https&&(T.assert.any([T.default.boolean,T.default.undefined],t.https.rejectUnauthorized),T.assert.any([T.default.function_,T.default.undefined],t.https.checkServerIdentity),T.assert.any([T.default.string,T.default.object,T.default.array,T.default.undefined],t.https.certificateAuthority),T.assert.any([T.default.string,T.default.object,T.default.array,T.default.undefined],t.https.key),T.assert.any([T.default.string,T.default.object,T.default.array,T.default.undefined],t.https.certificate),T.assert.any([T.default.string,T.default.undefined],t.https.passphrase),T.assert.any([T.default.string,T.default.buffer,T.default.array,T.default.undefined],t.https.pfx)),T.assert.any([T.default.object,T.default.undefined],t.cacheOptions),T.default.string(t.method)?t.method=t.method.toUpperCase():t.method="GET",t.headers===n?.headers?t.headers={...t.headers}:t.headers=zee({...n?.headers,...t.headers}),"slashes"in t)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in t)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in t&&t.searchParams&&t.searchParams!==n?.searchParams){let f;if(T.default.string(t.searchParams)||t.searchParams instanceof qs.URLSearchParams)f=new qs.URLSearchParams(t.searchParams);else{nte(t.searchParams),f=new qs.URLSearchParams;for(let h in t.searchParams){let m=t.searchParams[h];m===null?f.append(h,""):m!==void 0&&f.append(h,m)}}(i=n?.searchParams)===null||i===void 0||i.forEach((h,m)=>{f.has(m)||f.append(m,h)}),t.searchParams=f}if(t.username=(o=t.username)!==null&&o!==void 0?o:"",t.password=(s=t.password)!==null&&s!==void 0?s:"",T.default.undefined(t.prefixUrl)?t.prefixUrl=(a=n?.prefixUrl)!==null&&a!==void 0?a:"":(t.prefixUrl=t.prefixUrl.toString(),t.prefixUrl!==""&&!t.prefixUrl.endsWith("/")&&(t.prefixUrl+="/")),T.default.string(t.url)){if(t.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");t.url=c2.default(t.prefixUrl+t.url,t)}else(T.default.undefined(t.url)&&t.prefixUrl!==""||t.protocol)&&(t.url=c2.default(t.prefixUrl,t));if(t.url){"port"in t&&delete t.port;let{prefixUrl:f}=t;Object.defineProperty(t,"prefixUrl",{set:m=>{let y=t.url;if(!y.href.startsWith(m))throw new Error(`Cannot change \`prefixUrl\` from ${f} to ${m}: ${y.href}`);t.url=new qs.URL(m+y.href.slice(f.length)),f=m},get:()=>f});let{protocol:h}=t.url;if(h==="unix:"&&(h="http:",t.url=new qs.URL(`http://unix${t.url.pathname}${t.url.search}`)),t.searchParams&&(t.url.search=t.searchParams.toString()),h!=="http:"&&h!=="https:")throw new fv(t);t.username===""?t.username=t.url.username:t.url.username=t.username,t.password===""?t.password=t.url.password:t.url.password=t.password}let{cookieJar:l}=t;if(l){let{setCookie:f,getCookieString:h}=l;T.assert.function_(f),T.assert.function_(h),f.length===4&&h.length===0&&(f=r2.promisify(f.bind(t.cookieJar)),h=r2.promisify(h.bind(t.cookieJar)),t.cookieJar={setCookie:f,getCookieString:h})}let{cache:p}=t;if(p&&(oP.has(p)||oP.set(p,new o2((f,h)=>{let m=f[Zt](f,h);return T.default.promise(m)&&(m.once=(y,I)=>{if(y==="error")m.catch(I);else if(y==="abort")(async()=>{try{(await m).once("abort",I)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${y}`);return m}),m},p))),t.cacheOptions={...t.cacheOptions},t.dnsCache===!0)nP||(nP=new $ee.default),t.dnsCache=nP;else if(!T.default.undefined(t.dnsCache)&&!t.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${T.default(t.dnsCache)}`);T.default.number(t.timeout)?t.timeout={request:t.timeout}:n&&t.timeout!==n.timeout?t.timeout={...n.timeout,...t.timeout}:t.timeout={...t.timeout},t.context||(t.context={});let d=t.hooks===n?.hooks;t.hooks={...t.hooks};for(let f of Ee.knownHookEvents)if(f in t.hooks)if(T.default.array(t.hooks[f]))t.hooks[f]=[...t.hooks[f]];else throw new TypeError(`Parameter \`${f}\` must be an Array, got ${T.default(t.hooks[f])}`);else t.hooks[f]=[];if(n&&!d)for(let f of Ee.knownHookEvents)n.hooks[f].length>0&&(t.hooks[f]=[...n.hooks[f],...t.hooks[f]]);if("family"in t&&Ws.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n?.https&&(t.https={...n.https,...t.https}),"rejectUnauthorized"in t&&Ws.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in t&&Ws.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in t&&Ws.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in t&&Ws.default('"options.key" was never documented, please use "options.https.key"'),"cert"in t&&Ws.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in t&&Ws.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in t&&Ws.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in t)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(t.agent){for(let f in t.agent)if(f!=="http"&&f!=="https"&&f!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${f}\``)}return t.maxRedirects=(c=t.maxRedirects)!==null&&c!==void 0?c:0,Ee.setNonEnumerableProperties([n,u],t),ete.default(t,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:t}=e,n=!T.default.undefined(e.form),i=!T.default.undefined(e.json),o=!T.default.undefined(e.body),s=n||i||o,a=Ee.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,s){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([o,n,i].filter(c=>c).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(o&&!(e.body instanceof n2.Readable)&&!T.default.string(e.body)&&!T.default.buffer(e.body)&&!s2.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!T.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let c=!T.default.string(t["content-type"]);o?(s2.default(e.body)&&c&&(t["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Vs]=e.body):n?(c&&(t["content-type"]="application/x-www-form-urlencoded"),this[Vs]=new qs.URLSearchParams(e.form).toString()):(c&&(t["content-type"]="application/json"),this[Vs]=e.stringifyJson(e.json));let u=await Kee.default(this[Vs],e.headers);T.default.undefined(t["content-length"])&&T.default.undefined(t["transfer-encoding"])&&!a&&!T.default.undefined(u)&&(t["content-length"]=String(u))}}else a?this._lockWrite():this._unlockWrite();this[kl]=Number(t["content-length"])||void 0}async _onResponseBase(e){let{options:t}=this,{url:n}=t;this[f2]=e,t.decompress&&(e=Hee(e));let i=e.statusCode,o=e;o.statusMessage=o.statusMessage?o.statusMessage:i2.STATUS_CODES[i],o.url=t.url.toString(),o.requestUrl=this.requestUrl,o.redirectUrls=this.redirects,o.request=this,o.isFromCache=e.fromCache||!1,o.ip=this.ip,o.retryCount=this.retryCount,this[p2]=o.isFromCache,this[Pl]=Number(e.headers["content-length"])||void 0,this[av]=e,e.once("end",()=>{this[Pl]=this[El],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new zf(a,this))}),e.once("aborted",()=>{this._beforeError(new zf({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let s=e.headers["set-cookie"];if(T.default.object(t.cookieJar)&&s){let a=s.map(async c=>t.cookieJar.setCookie(c,n.toString()));t.ignoreInvalidCookies&&(a=a.map(async c=>c.catch(()=>{})));try{await Promise.all(a)}catch(c){this._beforeError(c);return}}if(t.followRedirect&&e.headers.location&&ste.has(i)){if(e.resume(),this[Zt]&&(this[iP](),delete this[Zt],this[l2]()),(i===303&&t.method!=="GET"&&t.method!=="HEAD"||!t.methodRewriting)&&(t.method="GET","body"in t&&delete t.body,"json"in t&&delete t.json,"form"in t&&delete t.form,this[Vs]=void 0,delete t.headers["content-length"]),this.redirects.length>=t.maxRedirects){this._beforeError(new cv(this));return}try{let p=function(d){return d.protocol==="unix:"||d.hostname==="unix"},c=Buffer.from(e.headers.location,"binary").toString(),u=new qs.URL(c,n),l=u.toString();if(decodeURI(l),!p(n)&&p(u)){this._beforeError(new wt("Cannot redirect to UNIX socket",{},this));return}u.hostname!==n.hostname||u.port!==n.port?("host"in t.headers&&delete t.headers.host,"cookie"in t.headers&&delete t.headers.cookie,"authorization"in t.headers&&delete t.headers.authorization,(t.username||t.password)&&(t.username="",t.password="")):(u.username=t.username,u.password=t.password),this.redirects.push(l),t.url=u;for(let d of t.hooks.beforeRedirect)await d(t,o);this.emit("redirect",o,t),await this._makeRequest()}catch(c){this._beforeError(c);return}return}if(t.isStream&&t.throwHttpErrors&&!Zee.isResponseOk(o)){this._beforeError(new uv(o));return}e.on("readable",()=>{this[sv]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[ov])if(!a.headersSent){for(let c in e.headers){let u=t.decompress?c!=="content-encoding":!0,l=e.headers[c];u&&a.setHeader(c,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(t){this._beforeError(t)}}_onRequest(e){let{options:t}=this,{timeout:n,url:i}=t;Vee.default(e),this[iP]=a2.default(e,n,i);let o=t.cache?"cacheableResponse":"response";e.once(o,c=>{this._onResponse(c)}),e.once("error",c=>{var u;e.destroy(),(u=e.res)===null||u===void 0||u.removeAllListeners("end"),c=c instanceof a2.TimeoutError?new dv(c,this.timings,this):new wt(c.message,c,this),this._beforeError(c)}),this[l2]=Jee.default(e,this,cte),this[Zt]=e,this.emit("uploadProgress",this.uploadProgress);let s=this[Vs],a=this.redirects.length===0?this:e;T.default.nodeStream(s)?(s.pipe(a),s.once("error",c=>{this._beforeError(new pv(c,this))})):(this._unlockWrite(),T.default.undefined(s)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(s,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,t){return new Promise((n,i)=>{Object.assign(t,Yee.default(e)),delete t.url;let o,s=oP.get(t.cache)(t,async a=>{a._readableState.autoDestroy=!1,o&&(await o).emit("cacheableResponse",a),n(a)});t.url=e,s.once("error",i),s.once("request",async a=>{o=a,n(o)})})}async _makeRequest(){var e,t,n,i,o;let{options:s}=this,{headers:a}=s;for(let I in a)if(T.default.undefined(a[I]))delete a[I];else if(T.default.null_(a[I]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${I}\` header`);if(s.decompress&&T.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=rte?"gzip, deflate, br":"gzip, deflate"),s.cookieJar){let I=await s.cookieJar.getCookieString(s.url.toString());T.default.nonEmptyString(I)&&(s.headers.cookie=I)}for(let I of s.hooks.beforeRequest){let L=await I(s);if(!T.default.undefined(L)){s.request=()=>L;break}}s.body&&this[Vs]!==s.body&&(this[Vs]=s.body);let{agent:c,request:u,timeout:l,url:p}=s;if(s.dnsCache&&!("lookup"in s)&&(s.lookup=s.dnsCache.lookup),p.hostname==="unix"){let I=/(?<socketPath>.+?):(?<path>.+)/.exec(`${p.pathname}${p.search}`);if(I?.groups){let{socketPath:L,path:P}=I.groups;Object.assign(s,{socketPath:L,path:P,host:""})}}let d=p.protocol==="https:",f;s.http2?f=Gee.auto:f=d?Wee.request:i2.request;let h=(e=s.request)!==null&&e!==void 0?e:f,m=s.cache?this._createCacheableRequest:h;c&&!s.http2&&(s.agent=c[d?"https":"http"]),s[Zt]=h,delete s.request,delete s.timeout;let y=s;if(y.shared=(t=s.cacheOptions)===null||t===void 0?void 0:t.shared,y.cacheHeuristic=(n=s.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,y.immutableMinTimeToLive=(i=s.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,y.ignoreCargoCult=(o=s.cacheOptions)===null||o===void 0?void 0:o.ignoreCargoCult,s.dnsLookupIpVersion!==void 0)try{y.family=u2.dnsLookupIpVersionToFamily(s.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}s.https&&("rejectUnauthorized"in s.https&&(y.rejectUnauthorized=s.https.rejectUnauthorized),s.https.checkServerIdentity&&(y.checkServerIdentity=s.https.checkServerIdentity),s.https.certificateAuthority&&(y.ca=s.https.certificateAuthority),s.https.certificate&&(y.cert=s.https.certificate),s.https.key&&(y.key=s.https.key),s.https.passphrase&&(y.passphrase=s.https.passphrase),s.https.pfx&&(y.pfx=s.https.pfx));try{let I=await m(p,y);T.default.undefined(I)&&(I=f(p,y)),s.request=u,s.timeout=l,s.agent=c,s.https&&("rejectUnauthorized"in s.https&&delete y.rejectUnauthorized,s.https.checkServerIdentity&&delete y.checkServerIdentity,s.https.certificateAuthority&&delete y.ca,s.https.certificate&&delete y.cert,s.https.key&&delete y.key,s.https.passphrase&&delete y.passphrase,s.https.pfx&&delete y.pfx),ite(I)?this._onRequest(I):this.writable?(this.once("finish",()=>{this._onResponse(I)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(I)}catch(I){throw I instanceof o2.CacheError?new lv(I,this):new wt(I.message,I,this)}}async _error(e){try{for(let t of this.options.hooks.beforeError)e=await t(e)}catch(t){e=new wt(t.message,t,this)}this.destroy(e)}_beforeError(e){if(this[Al])return;let{options:t}=this,n=this.retryCount+1;this[Al]=!0,e instanceof wt||(e=new wt(e.message,e,this));let i=e,{response:o}=i;(async()=>{if(o&&!o.body){o.setEncoding(this._readableState.encoding);try{o.rawBody=await Qee.default(o),o.body=o.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let s;try{let a;o&&"retry-after"in o.headers&&(a=Number(o.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(o.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),s=await t.retry.calculateDelay({attemptCount:n,retryOptions:t.retry,error:i,retryAfter:a,computedValue:tte.default({attemptCount:n,retryOptions:t.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new wt(a.message,a,this));return}if(s){let a=async()=>{try{for(let c of this.options.hooks.beforeRetry)await c(this.options,i,n)}catch(c){this._error(new wt(c.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[h2]=setTimeout(a,s);return}}this._error(i)})()}_read(){this[sv]=!0;let e=this[av];if(e&&!this[Al]){e.readableLength&&(this[sv]=!1);let t;for(;(t=e.read())!==null;){this[El]+=t.length,this[d2]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(t)}}}_write(e,t,n){let i=()=>{this._writeRequest(e,t,n)};this.requestInitialized?i():this[Gf].push(i)}_writeRequest(e,t,n){this[Zt].destroyed||(this._progressCallbacks.push(()=>{this[Rl]+=Buffer.byteLength(e,t);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[Zt].write(e,t,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let t=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(Zt in this)){e();return}if(this[Zt].destroyed){e();return}this[Zt].end(n=>{n||(this[kl]=this[Rl],this.emit("uploadProgress",this.uploadProgress),this[Zt].emit("upload-complete")),e(n)})};this.requestInitialized?t():this[Gf].push(t)}_destroy(e,t){var n;this[Al]=!0,clearTimeout(this[h2]),Zt in this&&(this[iP](),!((n=this[av])===null||n===void 0)&&n.complete||this[Zt].destroy()),e!==null&&!T.default.undefined(e)&&!(e instanceof wt)&&(e=new wt(e.message,e,this)),t(e)}get _isAboutToError(){return this[Al]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,t,n;return((t=(e=this[Zt])===null||e===void 0?void 0:e.destroyed)!==null&&t!==void 0?t:this.destroyed)&&!(!((n=this[f2])===null||n===void 0)&&n.complete)}get socket(){var e,t;return(t=(e=this[Zt])===null||e===void 0?void 0:e.socket)!==null&&t!==void 0?t:void 0}get downloadProgress(){let e;return this[Pl]?e=this[El]/this[Pl]:this[Pl]===this[El]?e=1:e=0,{percent:e,transferred:this[El],total:this[Pl]}}get uploadProgress(){let e;return this[kl]?e=this[Rl]/this[kl]:this[kl]===this[Rl]?e=1:e=0,{percent:e,transferred:this[Rl],total:this[kl]}}get timings(){var e;return(e=this[Zt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[p2]}pipe(e,t){if(this[d2])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof rP.ServerResponse&&this[ov].add(e),super.pipe(e,t)}unpipe(e){return e instanceof rP.ServerResponse&&this[ov].delete(e),super.unpipe(e),this}};Ee.default=hv});var Jf=v(ti=>{"use strict";var ute=ti&&ti.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),lte=ti&&ti.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ute(e,r,t)};Object.defineProperty(ti,"__esModule",{value:!0});ti.CancelError=ti.ParseError=void 0;var m2=Kf(),sP=class extends m2.RequestError{constructor(e,t){let{options:n}=t.request;super(`${e.message} in "${n.url.toString()}"`,e,t.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};ti.ParseError=sP;var aP=class extends m2.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};ti.CancelError=aP;lte(Kf(),ti)});var y2=v(cP=>{"use strict";Object.defineProperty(cP,"__esModule",{value:!0});var g2=Jf(),pte=(r,e,t,n)=>{let{rawBody:i}=r;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":t(i.toString());if(e==="buffer")return i;throw new g2.ParseError({message:`Unknown body type '${e}'`,name:"Error"},r)}catch(o){throw new g2.ParseError(o,r)}};cP.default=pte});var uP=v($s=>{"use strict";var dte=$s&&$s.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),fte=$s&&$s.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&dte(e,r,t)};Object.defineProperty($s,"__esModule",{value:!0});var hte=require("events"),mte=Bo(),gte=mB(),mv=Jf(),b2=y2(),v2=Kf(),yte=HT(),bte=QT(),w2=ZT(),vte=["request","response","redirect","uploadProgress","downloadProgress"];function S2(r){let e,t,n=new hte.EventEmitter,i=new gte((s,a,c)=>{let u=l=>{let p=new v2.default(void 0,r);p.retryCount=l,p._noPipe=!0,c(()=>p.destroy()),c.shouldReject=!1,c(()=>a(new mv.CancelError(p))),e=p,p.once("response",async h=>{var m;if(h.retryCount=l,h.request.aborted)return;let y;try{y=await bte.default(p),h.rawBody=y}catch{return}if(p._isAboutToError)return;let I=((m=h.headers["content-encoding"])!==null&&m!==void 0?m:"").toLowerCase(),L=["gzip","deflate","br"].includes(I),{options:P}=p;if(L&&!P.decompress)h.body=y;else try{h.body=b2.default(h,P.responseType,P.parseJson,P.encoding)}catch(W){if(h.body=y.toString(),w2.isResponseOk(h)){p._beforeError(W);return}}try{for(let[W,E]of P.hooks.afterResponse.entries())h=await E(h,async M=>{let k=v2.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},P);k.hooks.afterResponse=k.hooks.afterResponse.slice(0,W);for(let Z of k.hooks.beforeRetry)await Z(k);let j=S2(k);return c(()=>{j.catch(()=>{}),j.cancel()}),j})}catch(W){p._beforeError(new mv.RequestError(W.message,W,p));return}if(t=h,!w2.isResponseOk(h)){p._beforeError(new mv.HTTPError(h));return}p.destroy(),s(p.options.resolveBodyOnly?h.body:h)});let d=h=>{if(i.isCanceled)return;let{options:m}=p;if(h instanceof mv.HTTPError&&!m.throwHttpErrors){let{response:y}=h;s(p.options.resolveBodyOnly?y.body:y);return}a(h)};p.once("error",d);let f=p.options.body;p.once("retry",(h,m)=>{var y,I;if(f===((y=m.request)===null||y===void 0?void 0:y.options.body)&&mte.default.nodeStream((I=m.request)===null||I===void 0?void 0:I.options.body)){d(m);return}u(h)}),yte.default(p,n,vte)};u(0)});i.on=(s,a)=>(n.on(s,a),i);let o=s=>{let a=(async()=>{await i;let{options:c}=t.request;return b2.default(t,s,c.parseJson,c.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:s}=e.options;return!e.writableFinished&&s.accept===void 0&&(s.accept="application/json"),o("json")},i.buffer=()=>o("buffer"),i.text=()=>o("text"),i}$s.default=S2;fte(Jf(),$s)});var _2=v(lP=>{"use strict";Object.defineProperty(lP,"__esModule",{value:!0});var wte=Jf();function Ste(r,...e){let t=(async()=>{if(r instanceof wte.RequestError)try{for(let i of e)if(i)for(let o of i)r=await o(r)}catch(i){r=i}throw r})(),n=()=>t;return t.json=n,t.text=n,t.buffer=n,t.on=n,t}lP.default=Ste});var C2=v(pP=>{"use strict";Object.defineProperty(pP,"__esModule",{value:!0});var I2=Bo();function x2(r){for(let e of Object.values(r))(I2.default.plainObject(e)||I2.default.array(e))&&x2(e);return Object.freeze(r)}pP.default=x2});var P2=v(T2=>{"use strict";Object.defineProperty(T2,"__esModule",{value:!0})});var dP=v(Rn=>{"use strict";var _te=Rn&&Rn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ite=Rn&&Rn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&_te(e,r,t)};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.defaultHandler=void 0;var E2=Bo(),kn=uP(),xte=_2(),yv=Kf(),Cte=C2(),Tte={RequestError:kn.RequestError,CacheError:kn.CacheError,ReadError:kn.ReadError,HTTPError:kn.HTTPError,MaxRedirectsError:kn.MaxRedirectsError,TimeoutError:kn.TimeoutError,ParseError:kn.ParseError,CancelError:kn.CancelError,UnsupportedProtocolError:kn.UnsupportedProtocolError,UploadError:kn.UploadError},Pte=async r=>new Promise(e=>{setTimeout(e,r)}),{normalizeArguments:gv}=yv.default,k2=(...r)=>{let e;for(let t of r)e=gv(void 0,t,e);return e},Ete=r=>r.isStream?new yv.default(void 0,r):kn.default(r),kte=r=>"defaults"in r&&"options"in r.defaults,Rte=["get","post","put","patch","head","delete"];Rn.defaultHandler=(r,e)=>e(r);var R2=(r,e)=>{if(r)for(let t of r)t(e)},A2=r=>{r._rawHandlers=r.handlers,r.handlers=r.handlers.map(n=>(i,o)=>{let s,a=n(i,c=>(s=o(c),s));if(a!==s&&!i.isStream&&s){let c=a,{then:u,catch:l,finally:p}=c;Object.setPrototypeOf(c,Object.getPrototypeOf(s)),Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)),c.then=u,c.catch=l,c.finally=p}return a});let e=(n,i={},o)=>{var s,a;let c=0,u=l=>r.handlers[c++](l,c===r.handlers.length?Ete:u);if(E2.default.plainObject(n)){let l={...n,...i};yv.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{R2(r.options.hooks.init,i),R2((s=i.hooks)===null||s===void 0?void 0:s.init,i)}catch(d){l=d}let p=gv(n,i,o??r.options);if(p[yv.kIsNormalizedAlready]=!0,l)throw new kn.RequestError(l.message,l,p);return u(p)}catch(l){if(i.isStream)throw l;return xte.default(l,r.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[r.options],o=[...r._rawHandlers],s;for(let a of n)kte(a)?(i.push(a.defaults.options),o.push(...a.defaults._rawHandlers),s=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&o.push(...a.handlers),s=a.mutableDefaults);return o=o.filter(a=>a!==Rn.defaultHandler),o.length===0&&o.push(Rn.defaultHandler),A2({options:k2(...i),handlers:o,mutableDefaults:!!s})};let t=async function*(n,i){let o=gv(n,i,r.options);o.resolveBodyOnly=!1;let s=o.pagination;if(!E2.default.object(s))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:c}=s,u=0;for(;u<s.requestLimit;){u!==0&&await Pte(s.backoff);let l=await e(void 0,void 0,o),p=await s.transform(l),d=[];for(let h of p)if(s.filter(h,a,d)&&(!s.shouldContinue(h,a,d)||(yield h,s.stackAllItems&&a.push(h),d.push(h),--c<=0)))return;let f=s.paginate(l,a,d);if(f===!1)return;f===l.request.options?o=l.request.options:f!==void 0&&(o=gv(void 0,f,o)),u++}};e.paginate=t,e.paginate.all=async(n,i)=>{let o=[];for await(let s of t(n,i))o.push(s);return o},e.paginate.each=t,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of Rte)e[n]=(i,o)=>e(i,{...o,method:n}),e.stream[n]=(i,o)=>e(i,{...o,method:n,isStream:!0});return Object.assign(e,Tte),Object.defineProperty(e,"defaults",{value:r.mutableDefaults?r:Cte.default(r),writable:r.mutableDefaults,configurable:r.mutableDefaults,enumerable:!0}),e.mergeOptions=k2,e};Rn.default=A2;Ite(P2(),Rn)});var L2=v((jo,bv)=>{"use strict";var Ate=jo&&jo.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),D2=jo&&jo.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ate(e,r,t)};Object.defineProperty(jo,"__esModule",{value:!0});var Dte=require("url"),O2=dP(),Ote={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:r})=>r},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:r=>r.request.options.responseType==="json"?r.body:JSON.parse(r.body),paginate:r=>{if(!Reflect.has(r.headers,"link"))return!1;let e=r.headers.link.split(","),t;for(let n of e){let i=n.split(";");if(i[1].includes("next")){t=i[0].trimStart().trim(),t=t.slice(1,-1);break}}return t?{url:new Dte.URL(t)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:r=>JSON.parse(r),stringifyJson:r=>JSON.stringify(r),cacheOptions:{}},handlers:[O2.defaultHandler],mutableDefaults:!1},fP=O2.default(Ote);jo.default=fP;bv.exports=fP;bv.exports.default=fP;bv.exports.__esModule=!0;D2(dP(),jo);D2(uP(),jo)});async function hP(){if($2.default.platform!=="darwin")throw new Error("macOS only");let{stdout:r}=await Fte("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(r)?.groups.id??"com.apple.Safari"}var V2,$2,H2,Fte,G2=Gn(()=>{V2=require("node:util"),$2=b(require("node:process"),1),H2=require("node:child_process"),Fte=(0,V2.promisify)(H2.execFile)});async function J2(r,{humanReadableOutput:e=!0}={}){if(z2.default.platform!=="darwin")throw new Error("macOS only");let t=e?[]:["-ss"],{stdout:n}=await Bte("osascript",["-e",r,t]);return n.trim()}var z2,K2,mP,Bte,Y2=Gn(()=>{z2=b(require("node:process"),1),K2=require("node:util"),mP=require("node:child_process"),Bte=(0,K2.promisify)(mP.execFile)});async function gP(r){return J2(`tell application "Finder" to set app_path to application file id "${r}" as string
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var X2=Gn(()=>{Y2()});async function yP(r=jte){let{stdout:e}=await r("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),t=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!t)throw new wv(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=t.groups,i=Ute[n];if(!i)throw new wv(`Unknown browser ID: ${n}`);return i}var Q2,Z2,jte,Ute,wv,eU=Gn(()=>{Q2=require("node:util"),Z2=require("node:child_process"),jte=(0,Q2.promisify)(Z2.execFile),Ute={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},wv=class extends Error{}});var iU={};l_(iU,{default:()=>nU});async function nU(){if(Sv.default.platform==="darwin"){let r=await hP();return{name:await gP(r),id:r}}if(Sv.default.platform==="linux"){let{stdout:r}=await qte("xdg-mime",["query","default","x-scheme-handler/http"]),e=r.trim();return{name:Wte(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Sv.default.platform==="win32")return yP();throw new Error("Only macOS, Linux, and Windows are supported")}var tU,Sv,rU,qte,Wte,oU=Gn(()=>{tU=require("node:util"),Sv=b(require("node:process"),1),rU=require("node:child_process");G2();X2();eU();qte=(0,tU.promisify)(rU.execFile),Wte=r=>r.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var lU=v((AIe,uU)=>{"use strict";function $te(r){var e=new r,t=e;function n(){var o=e;return o.next?e=o.next:(e=new r,t=e),o.next=null,o}function i(o){t.next=o,t=o}return{get:n,release:i}}uU.exports=$te});var dU=v((DIe,vP)=>{"use strict";var Hte=lU();function pU(r,e,t){if(typeof r=="function"&&(t=e,e=r,r=null),t<1)throw new Error("fastqueue concurrency must be greater than 1");var n=Hte(Gte),i=null,o=null,s=0,a=null,c={push:m,drain:On,saturated:On,pause:l,paused:!1,concurrency:t,running:u,resume:f,idle:h,length:p,getQueue:d,unshift:y,empty:On,kill:L,killAndDrain:P,error:W};return c;function u(){return s}function l(){c.paused=!0}function p(){for(var E=i,M=0;E;)E=E.next,M++;return M}function d(){for(var E=i,M=[];E;)M.push(E.value),E=E.next;return M}function f(){if(c.paused){c.paused=!1;for(var E=0;E<c.concurrency;E++)s++,I()}}function h(){return s===0&&c.length()===0}function m(E,M){var k=n.get();k.context=r,k.release=I,k.value=E,k.callback=M||On,k.errorHandler=a,s===c.concurrency||c.paused?o?(o.next=k,o=k):(i=k,o=k,c.saturated()):(s++,e.call(r,k.value,k.worked))}function y(E,M){var k=n.get();k.context=r,k.release=I,k.value=E,k.callback=M||On,s===c.concurrency||c.paused?i?(k.next=i,i=k):(i=k,o=k,c.saturated()):(s++,e.call(r,k.value,k.worked))}function I(E){E&&n.release(E);var M=i;M?c.paused?s--:(o===i&&(o=null),i=M.next,M.next=null,e.call(r,M.value,M.worked),o===null&&c.empty()):--s===0&&c.drain()}function L(){i=null,o=null,c.drain=On}function P(){i=null,o=null,c.drain(),c.drain=On}function W(E){a=E}}function On(){}function Gte(){this.value=null,this.callback=On,this.next=null,this.release=On,this.context=null,this.errorHandler=null;var r=this;this.worked=function(t,n){var i=r.callback,o=r.errorHandler,s=r.value;r.value=null,r.callback=On,r.errorHandler&&o(t,s),i.call(r.context,t,n),r.release(r)}}function zte(r,e,t){typeof r=="function"&&(t=e,e=r,r=null);function n(l,p){e.call(this,l).then(function(d){p(null,d)},p)}var i=pU(r,n,t),o=i.push,s=i.unshift;return i.push=a,i.unshift=c,i.drained=u,i;function a(l){var p=new Promise(function(d,f){o(l,function(h,m){if(h){f(h);return}d(m)})});return p.catch(On),p}function c(l){var p=new Promise(function(d,f){s(l,function(h,m){if(h){f(h);return}d(m)})});return p.catch(On),p}function u(){if(i.idle())return new Promise(function(d){d()});var l=i.drain,p=new Promise(function(d){i.drain=function(){l(),d()}});return p}}vP.exports=pU;vP.exports.promise=zte});var wP=v((OIe,fU)=>{fU.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var i=r[2];(i==="?"||i===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var o=r.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),n+o.join("/")}});var vU=v((yU,bU)=>{"use strict";Object.defineProperty(yU,"__esModule",{value:!0});var gU=Nx(),Kte=wP(),hU="!",Jte={returnIndex:!1},Yte=r=>Array.isArray(r)?r:[r],Xte=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=gU(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},mU=(r,e,t,n)=>{let i=Array.isArray(t),o=i?t[0]:t;if(!i&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let s=Kte(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(s))return n?-1:!1}let a=i&&[s].concat(t.slice(1));for(let c=0;c<r.length;c++){let u=r[c];if(i?u(...a):u(s))return n?c:!0}return n?-1:!1},SP=(r,e,t=Jte)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,o=Yte(r),s=o.filter(c=>typeof c=="string"&&c.charAt(0)===hU).map(c=>c.slice(1)).map(c=>gU(c,n)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==hU).map(c=>Xte(c,n));return e==null?(c,u=!1)=>mU(a,s,c,typeof u=="boolean"?u:!1):mU(a,s,e,i)};SP.default=SP;bU.exports=SP});var SU=v((LIe,wU)=>{wU.exports=typeof queueMicrotask=="function"?queueMicrotask:r=>Promise.resolve().then(r)});var IU=v((MIe,_U)=>{_U.exports=typeof process<"u"&&typeof process.nextTick=="function"?process.nextTick.bind(process):SU()});var CU=v((FIe,xU)=>{xU.exports=class{constructor(e){if(!(e>0)||(e-1&e)!==0)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return this.buffer[this.btm]===void 0}}});var EU=v((jIe,PU)=>{var TU=CU();PU.exports=class{constructor(e){this.hwm=e||16,this.head=new TU(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(e){if(this.length++,!this.head.push(e)){let t=this.head;this.head=t.next=new TU(2*this.head.buffer.length),this.head.push(e)}}shift(){this.length!==0&&this.length--;let e=this.tail.shift();if(e===void 0&&this.tail.next){let t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return e}peek(){let e=this.tail.peek();return e===void 0&&this.tail.next?this.tail.next.peek():e}isEmpty(){return this.length===0}}});var XU=v((UIe,YU)=>{var{EventEmitter:Qte}=require("events"),kv=new Error("Stream was destroyed"),_P=new Error("Premature close"),OU=IU(),LU=EU(),Ct=(1<<27)-1,Tc=1,kP=2,Ic=4,Qf=8,MU=Ct^Tc,Zte=Ct^kP,oh=16,Zf=32,ql=64,zs=128,eh=256,RP=512,xc=1024,IP=2048,AP=4096,DP=8192,ri=16384,Fl=32768,Rv=65536,NU=eh|RP,ere=oh|Rv,tre=ql|oh,rre=AP|zs,nre=Ct^oh,ire=Ct^ql,ore=Ct^(ql|Rv),sre=Ct^Rv,are=Ct^eh,cre=Ct^(zs|DP),ure=Ct^xc,kU=Ct^NU,FU=Ct^Fl,lre=Ct^Zf,Ks=1<<17,jl=2<<17,sh=4<<17,Cc=8<<17,ah=16<<17,Pc=32<<17,xP=64<<17,Bl=128<<17,OP=256<<17,Ul=512<<17,BU=Ct^(Ks|OP),jU=Ct^sh,pre=Ct^Ul,dre=Ct^ah,fre=Ct^Cc,UU=Ct^Bl,hre=Ct^jl,th=oh|Ks,qU=Ct^th,LP=ri|Pc,Uo=Ic|Qf|kP,cn=Uo|Tc,WU=Uo|LP,mre=jU&ire,MP=Bl|Fl,gre=MP&qU,VU=cn|gre,yre=cn|xc|ri,RU=cn|ri|zs,bre=cn|xc|zs,vre=cn|AP|zs|DP,wre=cn|oh|xc|ri|Rv,Sre=Uo|xc|ri,_re=Zf|cn|Fl|ql,Ire=cn|Ul|Pc,xre=Cc|ah,$U=Cc|Ks,Cre=Cc|ah|cn|Ks,AU=cn|Ks|Cc,Tre=sh|Ks,Pre=Ks|OP,Ere=cn|Ul|$U|Pc,kre=ah|Uo|Ul|Pc,Rre=jl|cn|Bl|sh,xv=Symbol.asyncIterator||Symbol("asyncIterator"),Cv=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:i,byteLength:o,byteLengthWritable:s}={}){this.stream=e,this.queue=new LU,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=s||o||JU,this.map=i||n,this.afterWrite=Ore.bind(this),this.afterUpdateNextTick=Nre.bind(this)}get ended(){return(this.stream._duplexState&Pc)!==0}push(e){return this.map!==null&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark?(this.stream._duplexState|=Cc,!0):(this.stream._duplexState|=xre,!1)}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),this.buffered===0&&(this.stream._duplexState&=fre),e}end(e){typeof e=="function"?this.stream.once("finish",e):e!=null&&this.push(e),this.stream._duplexState=(this.stream._duplexState|Ul)&jU}autoBatch(e,t){let n=[],i=this.stream;for(n.push(e);(i._duplexState&AU)===$U;)n.push(i._writableState.shift());if((i._duplexState&cn)!==0)return t(null);i._writev(n,t)}update(){let e=this.stream;e._duplexState|=jl;do{for(;(e._duplexState&AU)===Cc;){let t=this.shift();e._duplexState|=Pre,e._write(t,this.afterWrite)}(e._duplexState&Tre)===0&&this.updateNonPrimary()}while(this.continueUpdate()===!0);e._duplexState&=hre}updateNonPrimary(){let e=this.stream;if((e._duplexState&Ere)===Ul){e._duplexState=(e._duplexState|Ks)&pre,e._final(Dre.bind(this));return}if((e._duplexState&Uo)===Ic){(e._duplexState&MP)===0&&(e._duplexState|=th,e._destroy(HU.bind(this)));return}(e._duplexState&VU)===Tc&&(e._duplexState=(e._duplexState|th)&MU,e._open(GU.bind(this)))}continueUpdate(){return(this.stream._duplexState&Bl)===0?!1:(this.stream._duplexState&=UU,!0)}updateCallback(){(this.stream._duplexState&Rre)===sh?this.update():this.updateNextTick()}updateNextTick(){(this.stream._duplexState&Bl)===0&&(this.stream._duplexState|=Bl,(this.stream._duplexState&jl)===0&&OU(this.afterUpdateNextTick))}},CP=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapReadable:i,byteLength:o,byteLengthReadable:s}={}){this.stream=e,this.queue=new LU,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||o||JU,this.map=i||n,this.pipeTo=null,this.afterRead=Lre.bind(this),this.afterUpdateNextTick=Mre.bind(this)}get ended(){return(this.stream._duplexState&ri)!==0}pipe(e,t){if(this.pipeTo!==null)throw new Error("Can only pipe to one destination");if(typeof t!="function"&&(t=null),this.stream._duplexState|=RP,this.pipeTo=e,this.pipeline=new PP(this.stream,e,t),t&&this.stream.on("error",DU),ih(e))e._writableState.pipeline=this.pipeline,t&&e.on("error",DU),e.on("finish",this.pipeline.finished.bind(this.pipeline));else{let n=this.pipeline.done.bind(this.pipeline,e),i=this.pipeline.done.bind(this.pipeline,e,null);e.on("error",n),e.on("close",i),e.on("finish",this.pipeline.finished.bind(this.pipeline))}e.on("drain",Are.bind(this)),this.stream.emit("piping",e),e.emit("pipe",this.stream)}push(e){let t=this.stream;return e===null?(this.highWaterMark=0,t._duplexState=(t._duplexState|xc)&ore,!1):(this.map!==null&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=(t._duplexState|zs)&sre,this.buffered<this.highWaterMark)}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),this.buffered===0&&(this.stream._duplexState&=cre),e}unshift(e){let t=[this.map!==null?this.map(e):e];for(;this.buffered>0;)t.push(this.shift());for(let n=0;n<t.length-1;n++){let i=t[n];this.buffered+=this.byteLength(i),this.queue.push(i)}this.push(t[t.length-1])}read(){let e=this.stream;if((e._duplexState&RU)===zs){let t=this.shift();return this.pipeTo!==null&&this.pipeTo.write(t)===!1&&(e._duplexState&=kU),(e._duplexState&IP)!==0&&e.emit("data",t),t}return null}drain(){let e=this.stream;for(;(e._duplexState&RU)===zs&&(e._duplexState&NU)!==0;){let t=this.shift();this.pipeTo!==null&&this.pipeTo.write(t)===!1&&(e._duplexState&=kU),(e._duplexState&IP)!==0&&e.emit("data",t)}}update(){let e=this.stream;e._duplexState|=Zf;do{for(this.drain();this.buffered<this.highWaterMark&&(e._duplexState&wre)===0;)e._duplexState|=ere,e._read(this.afterRead),this.drain();(e._duplexState&vre)===rre&&(e._duplexState|=DP,e.emit("readable")),(e._duplexState&tre)===0&&this.updateNonPrimary()}while(this.continueUpdate()===!0);e._duplexState&=lre}updateNonPrimary(){let e=this.stream;if((e._duplexState&bre)===xc&&(e._duplexState=(e._duplexState|ri)&ure,e.emit("end"),(e._duplexState&WU)===LP&&(e._duplexState|=Ic),this.pipeTo!==null&&this.pipeTo.end()),(e._duplexState&Uo)===Ic){(e._duplexState&MP)===0&&(e._duplexState|=th,e._destroy(HU.bind(this)));return}(e._duplexState&VU)===Tc&&(e._duplexState=(e._duplexState|th)&MU,e._open(GU.bind(this)))}continueUpdate(){return(this.stream._duplexState&Fl)===0?!1:(this.stream._duplexState&=FU,!0)}updateCallback(){(this.stream._duplexState&_re)===ql?this.update():this.updateNextTick()}updateNextTick(){(this.stream._duplexState&Fl)===0&&(this.stream._duplexState|=Fl,(this.stream._duplexState&Zf)===0&&OU(this.afterUpdateNextTick))}},TP=class{constructor(e){this.data=null,this.afterTransform=Bre.bind(e),this.afterFinal=null}},PP=class{constructor(e,t,n){this.from=e,this.to=t,this.afterPipe=n,this.error=null,this.pipeToFinished=!1}finished(){this.pipeToFinished=!0}done(e,t){if(t&&(this.error=t),e===this.to&&(this.to=null,this.from!==null)){((this.from._duplexState&ri)===0||!this.pipeToFinished)&&this.from.destroy(this.error||new Error("Writable stream closed prematurely"));return}if(e===this.from&&(this.from=null,this.to!==null)){(e._duplexState&ri)===0&&this.to.destroy(this.error||new Error("Readable stream closed before ending"));return}this.afterPipe!==null&&this.afterPipe(this.error),this.to=this.from=this.afterPipe=null}};function Are(){this.stream._duplexState|=RP,this.updateCallback()}function Dre(r){let e=this.stream;r&&e.destroy(r),(e._duplexState&Uo)===0&&(e._duplexState|=Pc,e.emit("finish")),(e._duplexState&WU)===LP&&(e._duplexState|=Ic),e._duplexState&=BU,(e._duplexState&jl)===0?this.update():this.updateNextTick()}function HU(r){let e=this.stream;!r&&this.error!==kv&&(r=this.error),r&&e.emit("error",r),e._duplexState|=Qf,e.emit("close");let t=e._readableState,n=e._writableState;if(t!==null&&t.pipeline!==null&&t.pipeline.done(e,r),n!==null){for(;n.drains!==null&&n.drains.length>0;)n.drains.shift().resolve(!1);n.pipeline!==null&&n.pipeline.done(e,r)}}function Ore(r){let e=this.stream;r&&e.destroy(r),e._duplexState&=BU,this.drains!==null&&Fre(this.drains),(e._duplexState&Cre)===ah&&(e._duplexState&=dre,(e._duplexState&xP)===xP&&e.emit("drain")),this.updateCallback()}function Lre(r){r&&this.stream.destroy(r),this.stream._duplexState&=nre,this.updateCallback()}function Mre(){(this.stream._duplexState&Zf)===0&&(this.stream._duplexState&=FU,this.update())}function Nre(){(this.stream._duplexState&jl)===0&&(this.stream._duplexState&=UU,this.update())}function Fre(r){for(let e=0;e<r.length;e++)--r[e].writes===0&&(r.shift().resolve(!0),e--)}function GU(r){let e=this.stream;r&&e.destroy(r),(e._duplexState&Ic)===0&&((e._duplexState&yre)===0&&(e._duplexState|=ql),(e._duplexState&Ire)===0&&(e._duplexState|=sh),e.emit("open")),e._duplexState&=qU,e._writableState!==null&&e._writableState.updateCallback(),e._readableState!==null&&e._readableState.updateCallback()}function Bre(r,e){e!=null&&this.push(e),this._writableState.afterWrite(r)}function jre(r){this._readableState!==null&&(r==="data"&&(this._duplexState|=IP|eh,this._readableState.updateNextTick()),r==="readable"&&(this._duplexState|=AP,this._readableState.updateNextTick())),this._writableState!==null&&r==="drain"&&(this._duplexState|=xP,this._writableState.updateNextTick())}var rh=class extends Qte{constructor(e){super(),this._duplexState=0,this._readableState=null,this._writableState=null,e&&(e.open&&(this._open=e.open),e.destroy&&(this._destroy=e.destroy),e.predestroy&&(this._predestroy=e.predestroy),e.signal&&e.signal.addEventListener("abort",Hre.bind(this))),this.on("newListener",jre)}_open(e){e(null)}_destroy(e){e(null)}_predestroy(){}get readable(){return this._readableState!==null?!0:void 0}get writable(){return this._writableState!==null?!0:void 0}get destroyed(){return(this._duplexState&Qf)!==0}get destroying(){return(this._duplexState&Uo)!==0}destroy(e){(this._duplexState&Uo)===0&&(e||(e=kv),this._duplexState=(this._duplexState|Ic)&mre,this._readableState!==null&&(this._readableState.highWaterMark=0,this._readableState.error=e),this._writableState!==null&&(this._writableState.highWaterMark=0,this._writableState.error=e),this._duplexState|=kP,this._predestroy(),this._duplexState&=Zte,this._readableState!==null&&this._readableState.updateNextTick(),this._writableState!==null&&this._writableState.updateNextTick())}},Tv=class r extends rh{constructor(e){super(e),this._duplexState|=Tc|Pc,this._readableState=new CP(this,e),e&&(e.read&&(this._read=e.read),e.eagerOpen&&this._readableState.updateNextTick())}_read(e){e(null)}pipe(e,t){return this._readableState.updateNextTick(),this._readableState.pipe(e,t),e}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(e){return this._readableState.updateNextTick(),this._readableState.push(e)}unshift(e){return this._readableState.updateNextTick(),this._readableState.unshift(e)}resume(){return this._duplexState|=eh,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=are,this}static _fromAsyncIterator(e,t){let n,i=new r({...t,read(s){e.next().then(o).then(s.bind(null,null)).catch(s)},predestroy(){n=e.return()},destroy(s){if(!n)return s(null);n.then(s.bind(null,null)).catch(s)}});return i;function o(s){s.done?i.push(null):i.push(s.value)}}static from(e,t){if(Vre(e))return e;if(e[xv])return this._fromAsyncIterator(e[xv](),t);Array.isArray(e)||(e=e===void 0?[]:[e]);let n=0;return new r({...t,read(i){this.push(n===e.length?null:e[n++]),i(null)}})}static isBackpressured(e){return(e._duplexState&Sre)!==0||e._readableState.buffered>=e._readableState.highWaterMark}static isPaused(e){return(e._duplexState&eh)===0}[xv](){let e=this,t=null,n=null,i=null;return this.on("error",u=>{t=u}),this.on("readable",o),this.on("close",s),{[xv](){return this},next(){return new Promise(function(u,l){n=u,i=l;let p=e.read();p!==null?a(p):(e._duplexState&Qf)!==0&&a(null)})},return(){return c(null)},throw(u){return c(u)}};function o(){n!==null&&a(e.read())}function s(){n!==null&&a(null)}function a(u){i!==null&&(t?i(t):u===null&&(e._duplexState&ri)===0?i(kv):n({value:u,done:u===null}),i=n=null)}function c(u){return e.destroy(u),new Promise((l,p)=>{if(e._duplexState&Qf)return l({value:void 0,done:!0});e.once("close",function(){u?p(u):l({value:void 0,done:!0})})})}}},Pv=class extends rh{constructor(e){super(e),this._duplexState|=Tc|ri,this._writableState=new Cv(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final),e.eagerOpen&&this._writableState.updateNextTick())}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return(e._duplexState&kre)!==0}static drained(e){if(e.destroyed)return Promise.resolve(!1);let t=e._writableState,i=(Gre(e)?Math.min(1,t.queue.length):t.queue.length)+(e._duplexState&OP?1:0);return i===0?Promise.resolve(!0):(t.drains===null&&(t.drains=[]),new Promise(o=>{t.drains.push({writes:i,resolve:o})}))}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},nh=class extends Tv{constructor(e){super(e),this._duplexState=Tc,this._writableState=new Cv(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},Ev=class extends nh{constructor(e){super(e),this._transformState=new TP(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(this._transformState.data!==null){let t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}destroy(e){super.destroy(e),this._transformState.data!==null&&(this._transformState.data=null,this._transformState.afterTransform())}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(Ure.bind(this))}},EP=class extends Ev{};function Ure(r,e){let t=this._transformState.afterFinal;if(r)return t(r);e!=null&&this.push(e),this.push(null),t(null)}function qre(...r){return new Promise((e,t)=>zU(...r,n=>{if(n)return t(n);e()}))}function zU(r,...e){let t=Array.isArray(r)?[...r,...e]:[r,...e],n=t.length&&typeof t[t.length-1]=="function"?t.pop():null;if(t.length<2)throw new Error("Pipeline requires at least 2 streams");let i=t[0],o=null,s=null;for(let u=1;u<t.length;u++)o=t[u],ih(i)?i.pipe(o,c):(a(i,!0,u>1,c),i.pipe(o)),i=o;if(n){let u=!1,l=ih(o)||!!(o._writableState&&o._writableState.autoDestroy);o.on("error",p=>{s===null&&(s=p)}),o.on("finish",()=>{u=!0,l||n(s)}),l&&o.on("close",()=>n(s||(u?null:_P)))}return o;function a(u,l,p,d){u.on("error",d),u.on("close",f);function f(){if(l&&u._readableState&&!u._readableState.ended||p&&u._writableState&&!u._writableState.ended)return d(_P)}}function c(u){if(!(!u||s)){s=u;for(let l of t)l.destroy(u)}}}function KU(r){return!!r._readableState||!!r._writableState}function ih(r){return typeof r._duplexState=="number"&&KU(r)}function Wre(r){let e=r._readableState&&r._readableState.error||r._writableState&&r._writableState.error;return e===kv?null:e}function Vre(r){return ih(r)&&r.readable}function $re(r){return typeof r=="object"&&r!==null&&typeof r.byteLength=="number"}function JU(r){return $re(r)?r.byteLength:1024}function DU(){}function Hre(){this.destroy(new Error("Stream aborted."))}function Gre(r){return r._writev!==Pv.prototype._writev&&r._writev!==nh.prototype._writev}YU.exports={pipeline:zU,pipelinePromise:qre,isStream:KU,isStreamx:ih,getStreamError:Wre,Stream:rh,Writable:Pv,Readable:Tv,Duplex:nh,Transform:Ev,PassThrough:EP}});var ZU=v((qIe,QU)=>{QU.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var NP=v((WIe,tq)=>{var zre=ZU(),eq={"{":"}","(":")","[":"]"},Kre=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,i=-2,o=-2,s=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(s===-1||s>n||(s=r.indexOf("\\",e),s===-1||s>n)))||i!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(i=r.indexOf("}",e),i>e&&(s=r.indexOf("\\",e),s===-1||s>i))||o!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(o=r.indexOf(")",e),o>e&&(s=r.indexOf("\\",e),s===-1||s>o))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(o=r.indexOf(")",t),o>t&&(s=r.indexOf("\\",t),s===-1||s>o))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=eq[a];if(c){var u=r.indexOf(c,e);u!==-1&&(e=u+1)}if(r[e]==="!")return!0}else e++}return!1},Jre=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=eq[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};tq.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(zre(e))return!0;var n=Kre;return t&&t.strict===!1&&(n=Jre),n(e)}});var nq=v((VIe,rq)=>{"use strict";var Yre=NP(),Xre=require("path").posix.dirname,Qre=require("os").platform()==="win32",Av="/",Zre=/\\/g,ene=/\\([!*?|[\](){}])/g;rq.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&Qre&&e.indexOf(Av)<0&&(e=e.replace(Zre,Av)),tne(e)&&(e+=Av),e+="a";do e=Xre(e);while(rne(e));return e.replace(ene,"$1")};function tne(r){var e=r.slice(-1),t;switch(e){case"}":t="{";break;case"]":t="[";break;default:return!1}var n=r.indexOf(t);return n<0?!1:r.slice(n+1,-1).includes(Av)}function rne(r){return/\([^()]+$/.test(r)||r[0]==="{"||r[0]==="["||/[^\\][{[]/.test(r)?!0:Yre(r)}});var Dv=v(($Ie,iq)=>{"use strict";iq.exports=function(r){if(typeof r!="string")throw new TypeError("expected a string");var e={negated:!1,pattern:r,original:r};return r.charAt(0)==="!"&&r.charAt(1)!=="("&&(e.negated=!0,e.pattern=r.slice(1)),e}});var uq=v((HIe,cq)=>{"use strict";var Ov=require("path"),nne=Dv();cq.exports=function(r,e){var t=e||{},n=sq(t.cwd?t.cwd:process.cwd());n=Ov.resolve(n),n=FP(n),n=oq(n);var i=t.root;i&&(i=sq(i),i=FP(i),(process.platform==="win32"||!Ov.isAbsolute(i))&&(i=FP(Ov.resolve(i))),i=oq(i));var o=r.slice(-1),s=nne(r);return r=s.pattern,r.slice(0,2)==="./"&&(r=r.slice(2)),r.length===1&&r==="."&&(r=""),i&&r.charAt(0)==="/"?r=aq(i,r):(!Ov.isAbsolute(r)||r.slice(0,1)==="\\")&&(r=aq(n,r)),o==="/"&&r.slice(-1)!=="/"&&(r+="/"),s.negated?"!"+r:r};function oq(r){return r.replace(/([({[\]})*?!])/g,"\\$1")}function sq(r){return r.replace(/\\([({[\]})*?!])/g,"$1")}function FP(r){return r.replace(/\\/g,"/")}function aq(r,e){if(r.charAt(r.length-1)==="/"&&(r=r.slice(0,-1)),e.charAt(0)==="/"&&(e=e.slice(1)),!e)return r;for(;e.slice(0,3)==="../";)r=r.slice(0,r.lastIndexOf("/")),e=e.slice(3);return r+"/"+e}});var dq=v((GIe,pq)=>{"use strict";var ine=require("fs"),BP=require("path"),one=require("events"),sne=dU(),ane=vU(),cne=XU().Readable,une=NP(),lne=nq(),lq=wP(),pne=Dv(),dne=uq(),fne="File not found with singular glob: ",hne=" (if this was purposeful, use `allowEmpty` option)";function mne(r){return une(r)}function gne(){var r={withFileTypes:!0},e=new one,t=sne(i,1);t.drain=function(){e.emit("end")},t.error(n);function n(o){o&&e.emit("error",o)}e.pause=function(){t.pause()},e.resume=function(){t.resume()},e.end=function(){t.kill()},e.walk=function(o){t.push(o)};function i(o,s){ine.readdir(o,r,a);function a(u,l){if(u)return s(u);l.forEach(c),s()}function c(u){var l=BP.join(o,u.name);e.emit("path",l,u),u.isDirectory()&&t.push(l)}}return e}function yne(r){var e=!1;r.forEach(t);function t(n,i){if(typeof n!="string")throw new Error("Invalid glob at index "+i);var o=pne(n);o.negated===!1&&(e=!0)}if(e===!1)throw new Error("Missing positive glob")}function bne(r){if(typeof r.cwd!="string")throw new Error("The `cwd` option must be a string");if(typeof r.dot!="boolean")throw new Error("The `dot` option must be a boolean");if(typeof r.cwdbase!="boolean")throw new Error("The `cwdbase` option must be a boolean");if(typeof r.uniqueBy!="string"&&typeof r.uniqueBy!="function")throw new Error("The `uniqueBy` option must be a string or function");if(typeof r.allowEmpty!="boolean")throw new Error("The `allowEmpty` option must be a boolean");if(r.base&&typeof r.base!="string")throw new Error("The `base` option must be a string if specified");if(!Array.isArray(r.ignore))throw new Error("The `ignore` option must be a string or array")}function vne(r){var e=new Set;if(typeof r=="string")return n;return i;function t(o){return e.has(o)?!1:(e.add(o),!0)}function n(o){return t(o[r])}function i(o){return t(r(o))}}function wne(r,e){Array.isArray(r)||(r=[r]),yne(r);var t=Object.assign({},{cwd:process.cwd(),dot:!1,cwdbase:!1,uniqueBy:"path",allowEmpty:!1,ignore:[]},e);t.ignore=typeof t.ignore=="string"?[t.ignore]:t.ignore,bne(t),t.cwd=lq(BP.resolve(t.cwd),!0);var n=t.base;t.cwdbase&&(n=t.cwd);var i=gne(),o=new cne({highWaterMark:t.highWaterMark,read:l,predestroy:p}),s=r.map(d);t.ignore=t.ignore.map(d);var a=s.map(mne),c=ane(s,null,t),u=vne(t.uniqueBy);i.on("path",f),i.once("end",h),i.once("error",m),i.walk(t.cwd);function l(y){i.resume(),y()}function p(){i.end()}function d(y){return dne(y,t)}function f(y,I){var L=c(y,!0);if(L===-1&&I.isDirectory()&&(L=c(y+BP.sep,!0)),L!==-1){a[L]=!0;var P=n||lne(s[L]),W={cwd:t.cwd,base:P,path:lq(y,!0)},E=u(W);if(E){var M=o.push(W);M||i.pause()}}}function h(){var y=!1;a.forEach(function(I,L){if(t.allowEmpty!==!0&&!I){y=!0;var P=new Error(fne+s[L]+hne);return o.destroy(P)}}),y===!1&&o.push(null)}function m(y){o.destroy(y)}return o}pq.exports=wne});var hq=v((KIe,fq)=>{"use strict";fq.exports=function(){return/^[\\\/]{2,}[^\\\/]+[\\\/]+[^\\\/]+/}});var gq=v((JIe,mq)=>{"use strict";var Sne=hq()();mq.exports=function(r){if(typeof r!="string")throw new TypeError("expected a string");return Sne.test(r)}});var bq=v((YIe,yq)=>{"use strict";var _ne=gq();yq.exports=function(e){if(typeof e!="string")throw new TypeError("expected filepath to be a string");return!_ne(e)&&!/^([a-z]:)?[\\\/]/i.test(e)}});var vq=v((jP,UP)=>{(function(r){jP&&typeof jP=="object"&&typeof UP<"u"?UP.exports=r():typeof define=="function"&&define.amd?define([],r):typeof window<"u"?window.isWindows=r():typeof global<"u"?global.isWindows=r():typeof self<"u"?self.isWindows=r():this.isWindows=r()})(function(){"use strict";return function(){return process&&(process.platform==="win32"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var Sq=v((XIe,wq)=>{"use strict";var Ine=bq(),xne=vq();wq.exports=ch;function ch(r){if(typeof r!="string")throw new TypeError("isAbsolute expects a string.");return xne()?ch.win32(r):ch.posix(r)}ch.posix=function(e){return e.charAt(0)==="/"};ch.win32=function(e){return/[a-z]/i.test(e.charAt(0))&&e.charAt(1)===":"&&e.charAt(2)==="\\"||e.slice(0,2)==="\\\\"?!0:!Ine(e)}});var Eq=v((QIe,Pq)=>{"use strict";var _q=require("path"),Cne=Dv(),Iq=Sq();Pq.exports=function(r,e){var t=e||{},n=Cq(t.cwd?t.cwd:process.cwd());n=_q.resolve(n),n=qP(n),n=xq(n);var i=t.root;i&&(i=Cq(i),i=qP(i),(process.platform==="win32"||!Iq(i))&&(i=qP(_q.resolve(i))),i=xq(i)),r.slice(0,2)==="./"&&(r=r.slice(2)),r.length===1&&r==="."&&(r="");var o=r.slice(-1),s=Cne(r);return r=s.pattern,i&&r.charAt(0)==="/"?r=Tq(i,r):(!Iq(r)||r.slice(0,1)==="\\")&&(r=Tq(n,r)),o==="/"&&r.slice(-1)!=="/"&&(r+="/"),s.negated?"!"+r:r};function xq(r){return r.replace(/([({[\]})*?!])/g,"\\$1")}function Cq(r){return r.replace(/\\([({[\]})*?!])/g,"$1")}function qP(r){return r.replace(/\\/g,"/")}function Tq(r,e){return r.charAt(r.length-1)==="/"&&(r=r.slice(0,-1)),e.charAt(0)==="/"&&(e=e.slice(1)),e?r+"/"+e:r}});var sW=v((CPe,oW)=>{try{oW.exports=require("./win32-app-container-tokens.win32-arm64-msvc-4ZJZ3U55.node")}catch{}});var cW=v((TPe,aW)=>{try{aW.exports=require("./win32-app-container-tokens.win32-x64-msvc-VCQE7GJP.node")}catch{}});var CW=v((CEe,Vne)=>{Vne.exports={name:"dotenv",version:"16.4.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var EW=v((TEe,Ho)=>{var iw=require("fs"),t0=require("path"),$ne=require("os"),Hne=require("crypto"),Gne=CW(),r0=Gne.version,zne=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Kne(r){let e={},t=r.toString();t=t.replace(/\r\n?/mg,`
`);let n;for(;(n=zne.exec(t))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
`),o=o.replace(/\\r/g,"\r")),e[i]=o}return e}function Jne(r){let e=PW(r),t=Wt.configDotenv({path:e});if(!t.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=TW(r).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),c=Qne(t,a);o=Wt.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=i)throw a}return Wt.parse(o)}function Yne(r){console.log(`[dotenv@${r0}][INFO] ${r}`)}function Xne(r){console.log(`[dotenv@${r0}][WARN] ${r}`)}function ow(r){console.log(`[dotenv@${r0}][DEBUG] ${r}`)}function TW(r){return r&&r.DOTENV_KEY&&r.DOTENV_KEY.length>0?r.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Qne(r,e){let t;try{t=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=t.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=t.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=r.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function PW(r){let e=null;if(r&&r.path&&r.path.length>0)if(Array.isArray(r.path))for(let t of r.path)iw.existsSync(t)&&(e=t.endsWith(".vault")?t:`${t}.vault`);else e=r.path.endsWith(".vault")?r.path:`${r.path}.vault`;else e=t0.resolve(process.cwd(),".env.vault");return iw.existsSync(e)?e:null}function Zne(r){return r[0]==="~"?t0.join($ne.homedir(),r.slice(1)):r}function eie(r){Yne("Loading env from encrypted .env.vault");let e=Wt._parseVault(r),t=process.env;return r&&r.processEnv!=null&&(t=r.processEnv),Wt.populate(t,e,r),{parsed:e}}function tie(r){let e=t0.resolve(process.cwd(),".env"),t="utf8",n=!!(r&&r.debug);if(r){if(r.path!=null){let i=r.path;if(Array.isArray(i)){for(let o of r.path)if(iw.existsSync(o)){i=o;break}}e=Zne(i)}r.encoding!=null?t=r.encoding:n&&ow("No encoding is specified. UTF-8 is used by default")}try{let i=Wt.parse(iw.readFileSync(e,{encoding:t})),o=process.env;return r&&r.processEnv!=null&&(o=r.processEnv),Wt.populate(o,i,r),{parsed:i}}catch(i){return n&&ow(`Failed to load ${e} ${i.message}`),{error:i}}}function rie(r){if(TW(r).length===0)return Wt.configDotenv(r);let e=PW(r);return e?Wt._configVault(r):(Xne(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),Wt.configDotenv(r))}function nie(r,e){let t=Buffer.from(e.slice(-64),"hex"),n=Buffer.from(r,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=Hne.createDecipheriv("aes-256-gcm",t,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function iie(r,e,t={}){let n=!!(t&&t.debug),i=!!(t&&t.override);if(typeof e!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(e))Object.prototype.hasOwnProperty.call(r,o)?(i===!0&&(r[o]=e[o]),n&&ow(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):r[o]=e[o]}var Wt={configDotenv:tie,_configVault:eie,_parseVault:Jne,config:rie,decrypt:nie,parse:Kne,populate:iie};Ho.exports.configDotenv=Wt.configDotenv;Ho.exports._configVault=Wt._configVault;Ho.exports._parseVault=Wt._parseVault;Ho.exports.config=Wt.config;Ho.exports.decrypt=Wt.decrypt;Ho.exports.parse=Wt.parse;Ho.exports.populate=Wt.populate;Ho.exports=Wt});var f0=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.TargetPopulation=pa.Filters=pa.VSCodeFilterProvider=void 0;var Pw=require("vscode"),d0=class r{constructor(e,t,n){this.extensionName=e,this.extensionVersion=t,this.targetPopulation=n}static trimVersionSuffix(e){let t=/\-[a-zA-Z0-9]+$/;return e.split(t)[0]}getFilterValue(e){switch(e){case ao.ApplicationVersion:return r.trimVersionSuffix(Pw.version);case ao.Build:return Pw.env.appName;case ao.ClientId:return Pw.env.machineId;case ao.ExtensionName:return this.extensionName;case ao.ExtensionVersion:return r.trimVersionSuffix(this.extensionVersion);case ao.Language:return Pw.env.language;case ao.TargetPopulation:return this.targetPopulation;default:return""}}getFilters(){let e=new Map,t=Object.values(ao);for(let n of t)e.set(n,this.getFilterValue(n));return e}};pa.VSCodeFilterProvider=d0;var ao;(function(r){r.Market="X-MSEdge-Market",r.CorpNet="X-FD-Corpnet",r.ApplicationVersion="X-VSCode-AppVersion",r.Build="X-VSCode-Build",r.ClientId="X-MSEdge-ClientId",r.ExtensionName="X-VSCode-ExtensionName",r.ExtensionVersion="X-VSCode-ExtensionVersion",r.Language="X-VSCode-Language",r.TargetPopulation="X-VSCode-TargetPopulation"})(ao||(pa.Filters=ao={}));var pV;(function(r){r.Team="team",r.Internal="internal",r.Insiders="insider",r.Public="public"})(pV||(pa.TargetPopulation=pV={}))});var dV=v(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});Ew.BaseFeatureProvider=void 0;var h0=class{constructor(e){this.telemetry=e,this.isFetching=!1}async getFeatures(){if(this.isFetching&&this.fetchPromise)return this.fetchPromise;this.fetchPromise=this.fetch();let e=await this.fetchPromise;return this.isFetching=!1,this.fetchPromise=void 0,e}};Ew.BaseFeatureProvider=h0});var fV=v(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});kw.FilteredFeatureProvider=void 0;var _ie=dV(),m0=class extends _ie.BaseFeatureProvider{constructor(e,t){super(e),this.telemetry=e,this.filterProviders=t,this.cachedTelemetryEvents=[]}getFilters(){let e=new Map;for(let t of this.filterProviders){let n=t.getFilters();for(let i of n.keys()){let o=n.get(i);e.set(i,o)}}return e}PostEventToTelemetry(e){if(this.cachedTelemetryEvents.includes(e))return;let t=JSON.stringify(e);this.telemetry.postEvent("report-headers",new Map([["ABExp.headers",t]])),this.cachedTelemetryEvents.push(e)}};kw.FilteredFeatureProvider=m0});var hV=v(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.TasApiFeatureProvider=da.TASAPI_FETCHERROR_EVENTNAME=void 0;var Iie=fV();da.TASAPI_FETCHERROR_EVENTNAME="call-tas-error";var g0="ErrorType",y0=class extends Iie.FilteredFeatureProvider{constructor(e,t,n){super(t,n),this.httpClient=e,this.telemetry=t,this.filterProviders=n}async fetch(){let e=this.getFilters(),t={};for(let a of e.keys()){let c=e.get(a);t[a]=c}let n;try{n=await this.httpClient.get({headers:t})}catch(a){let c=a,u=new Map;c.responseReceived&&!c.responseOk?u.set(g0,"ServerError"):c.responseReceived===!1?u.set(g0,"NoResponse"):u.set(g0,"GenericError"),this.telemetry.postEvent(da.TASAPI_FETCHERROR_EVENTNAME,u)}if(!n)throw Error(da.TASAPI_FETCHERROR_EVENTNAME);e.keys.length>0&&this.PostEventToTelemetry(t);let i=n.data,o=i.Configs,s=[];for(let a of o)if(a.Parameters)for(let c of Object.keys(a.Parameters)){let u=c+(a.Parameters[c]?"":"cf");s.includes(u)||s.push(u)}return{features:s,assignmentContext:i.AssignmentContext,configs:o}}};da.TasApiFeatureProvider=y0});var mV=v(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.HttpClient=Sp.FetchError=void 0;var wp=class extends Error{constructor(e,t,n){super(e),this.responseReceived=t,this.responseOk=n}};Sp.FetchError=wp;var b0=class{constructor(e){this.endpoint=e}async get(e){let t=await fetch(this.endpoint,{method:"GET",headers:e?.headers});if(!t)throw new wp("No response received",!1);if(!t.ok)throw new wp("Response not ok",!0,!1);let n=await t.json();if(!n)throw new wp("No data received",!1);return{data:n}}};Sp.HttpClient=b0});var gV=v(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});Rw.MemoryKeyValueStorage=void 0;var v0=class{constructor(){this.storage=new Map}async getValue(e,t){return this.storage.has(e)?await Promise.resolve(this.storage.get(e)):await Promise.resolve(t||void 0)}setValue(e,t){this.storage.set(e,t)}};Rw.MemoryKeyValueStorage=v0});var yV=v(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});Aw.ExperimentationServiceBase=void 0;var xie=gV(),w0=class{get features(){return this._features}set features(e){this._features=e,this.telemetry&&this.telemetry.setSharedProperty(this.assignmentContextTelemetryPropertyName,this.features.assignmentContext)}constructor(e,t,n,i,o){this.telemetry=e,this.assignmentContextTelemetryPropertyName=t,this.telemetryEventName=n,this.storageKey=i,this.storage=o,this.featuresConsumed=!1,this.cachedTelemetryEvents=[],this._features={features:[],assignmentContext:"",configs:[]},this.storageKey||(this.storageKey="ABExp.Features"),this.storage||(o=new xie.MemoryKeyValueStorage),this.loadCachePromise=this.loadCachedFeatureData(),this.initializePromise=this.loadCachePromise,this.initialFetch=new Promise((s,a)=>{this.resolveInitialFetchPromise=s})}async getFeaturesAsync(e=!1){if(this.fetchPromise!=null){try{await this.fetchPromise}catch{}return this.features}if(!this.featureProviders||this.featureProviders.length===0)return Promise.resolve({features:[],assignmentContext:"",configs:[]});try{this.fetchPromise=Promise.all(this.featureProviders.map(async n=>await n.getFeatures()));let t=await this.fetchPromise;this.updateFeatures(t,e)}catch{}return this.fetchPromise=void 0,this.resolveInitialFetchPromise&&(this.resolveInitialFetchPromise(),this.resolveInitialFetchPromise=void 0),this.features}updateFeatures(e,t=!1){let n={features:[],assignmentContext:"",configs:[]};for(let i of e){for(let o of i.features)n.features.includes(o)||n.features.push(o);for(let o of i.configs){let s=n.configs.find(a=>a.Id===o.Id);s?s.Parameters=Object.assign(Object.assign({},s.Parameters),o.Parameters):n.configs.push(o)}n.assignmentContext+=i.assignmentContext}(t||!this.featuresConsumed)&&(this.features=n),this.storage&&this.storage.setValue(this.storageKey,n)}async loadCachedFeatureData(){let e;this.storage&&(e=await this.storage.getValue(this.storageKey),e!==void 0&&e.configs===void 0&&(e.configs=[])),this.features.features.length===0&&(this.features=e||{features:[],assignmentContext:"",configs:[]})}isFlightEnabled(e){return this.featuresConsumed=!0,this.PostEventToTelemetry(e),this.features.features.includes(e)}async isCachedFlightEnabled(e){return await this.loadCachePromise,this.featuresConsumed=!0,this.PostEventToTelemetry(e),this.features.features.includes(e)}async isFlightEnabledAsync(e){let t=await this.getFeaturesAsync(!0);return this.featuresConsumed=!0,this.PostEventToTelemetry(e),t.features.includes(e)}getTreatmentVariable(e,t){this.featuresConsumed=!0,this.PostEventToTelemetry(`${e}.${t}`);let n=this.features.configs.find(i=>i.Id===e);return n?.Parameters[t]}async getTreatmentVariableAsync(e,t,n){if(n){let i=this.featuresConsumed,o=this.getTreatmentVariable(e,t);if(o===void 0)this.featuresConsumed=i;else return o}return await this.getFeaturesAsync(!0),this.getTreatmentVariable(e,t)}PostEventToTelemetry(e){this.cachedTelemetryEvents.includes(e)||(this.telemetry.postEvent(this.telemetryEventName,new Map([["ABExp.queriedFeature",e]])),this.cachedTelemetryEvents.push(e))}invokeInit(){this.init()}addFeatureProvider(...e){if(!(e==null||this.featureProviders==null))for(let t of e)this.featureProviders.push(t)}};Aw.ExperimentationServiceBase=w0});var bV=v(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});Dw.PollingService=void 0;var S0=class{constructor(e){this.fetchInterval=e}StopPolling(){clearInterval(this.intervalHandle),this.intervalHandle=void 0}OnPollTick(e){this.onTick=e}StartPolling(e=!1){this.intervalHandle&&this.StopPolling(),this.onTick!=null&&(e&&this.onTick().then(()=>{}).catch(()=>{}),this.intervalHandle=setInterval(async()=>{await this.onTick()},this.fetchInterval),this.intervalHandle.unref&&this.intervalHandle.unref())}};Dw.PollingService=S0});var vV=v(Ow=>{"use strict";Object.defineProperty(Ow,"__esModule",{value:!0});Ow.ExperimentationServiceAutoPolling=void 0;var Cie=yV(),Tie=bV(),_0=class extends Cie.ExperimentationServiceBase{constructor(e,t,n,i,o,s,a){if(super(e,i,o,s,a),this.telemetry=e,this.filterProviders=t,this.refreshRateMs=n,this.assignmentContextTelemetryPropertyName=i,this.telemetryEventName=o,this.storageKey=s,this.storage=a,n<1e3&&n!==0)throw new Error("The minimum refresh rate for polling is 1000 ms (1 second). If you wish to deactivate this auto-polling use value of 0.");n>0&&(this.pollingService=new Tie.PollingService(n),this.pollingService.OnPollTick(async()=>{await super.getFeaturesAsync()}))}init(){this.pollingService?this.pollingService.StartPolling(!0):super.getFeaturesAsync()}async getFeaturesAsync(e=!1){if(this.pollingService){this.pollingService.StopPolling();let t=await super.getFeaturesAsync(e);return this.pollingService.StartPolling(),t}else return await super.getFeaturesAsync(e)}};Ow.ExperimentationServiceAutoPolling=_0});var wV=v(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});Mw.ExperimentationService=void 0;var Pie=hV(),Eie=mV(),kie=vV(),Lw=class extends kie.ExperimentationServiceAutoPolling{constructor(e){super(e.telemetry,e.filterProviders||[],e.refetchInterval!=null?e.refetchInterval:0,e.assignmentContextTelemetryPropertyName,e.telemetryEventName,e.storageKey,e.keyValueStorage),this.options=e,this.invokeInit()}init(){this.featureProviders=[],this.addFeatureProvider(new Pie.TasApiFeatureProvider(new Eie.HttpClient(this.options.endpoint),this.telemetry,this.filterProviders)),super.init()}};Mw.ExperimentationService=Lw;Lw.REFRESH_RATE_IN_MINUTES=30});var SV=v(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});Nw.ExperimentationService=void 0;var Rie=wV();Object.defineProperty(Nw,"ExperimentationService",{enumerable:!0,get:function(){return Rie.ExperimentationService}})});var _V=v(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});Fw.MementoKeyValueStorage=void 0;var I0=class{constructor(e){this.mementoGlobalStorage=e}async getValue(e,t){return await this.mementoGlobalStorage.get(e)||t}setValue(e,t){this.mementoGlobalStorage.update(e,t)}};Fw.MementoKeyValueStorage=I0});var IV=v(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var x0=class{constructor(){this.initializePromise=Promise.resolve(),this.initialFetch=Promise.resolve()}isFlightEnabled(e){return!1}isCachedFlightEnabled(e){return Promise.resolve(!1)}isFlightEnabledAsync(e){return Promise.resolve(!1)}getTreatmentVariable(e,t){}getTreatmentVariableAsync(e,t){return Promise.resolve(void 0)}};C0.default=x0});var CV=v(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.getExperimentationServiceAsync=_p.getExperimentationService=void 0;var Aie=f0(),Die=SV(),T0=require("vscode"),Oie=_V(),Lie=IV(),Mie="https://default.exp-tas.com/vscode/ab",Nie="query-expfeature",Fie="abexp.assignmentcontext",Bie="VSCode.ABExp.FeatureData",jie=1e3*60*30;function xV(r,e,t,n,i,...o){if(!i)throw new Error("Memento storage was not provided.");let s=T0.workspace.getConfiguration("telemetry");if(!(T0.env.isTelemetryEnabled===void 0?s.get("enableTelemetry",!0):T0.env.isTelemetryEnabled))return new Lie.default;let u=[new Aie.VSCodeFilterProvider(r,e,t),...o],l=new Oie.MementoKeyValueStorage(i);return new Die.ExperimentationService({filterProviders:u,telemetry:n,storageKey:Bie,keyValueStorage:l,featuresTelemetryPropertyName:"",assignmentContextTelemetryPropertyName:Fie,telemetryEventName:Nie,endpoint:Mie,refetchInterval:jie})}_p.getExperimentationService=xV;async function Uie(r,e,t,n,i,...o){let s=xV(r,e,t,n,i,...o);return await s.initializePromise,s}_p.getExperimentationServiceAsync=Uie});var PV=v(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.TargetPopulation=fa.getExperimentationServiceAsync=fa.getExperimentationService=void 0;var TV=CV();Object.defineProperty(fa,"getExperimentationService",{enumerable:!0,get:function(){return TV.getExperimentationService}});Object.defineProperty(fa,"getExperimentationServiceAsync",{enumerable:!0,get:function(){return TV.getExperimentationServiceAsync}});var qie=f0();Object.defineProperty(fa,"TargetPopulation",{enumerable:!0,get:function(){return qie.TargetPopulation}})});function $c(r,e=!1){let t=r.length,n=0,i="",o=0,s=16,a=0,c=0,u=0,l=0,p=0;function d(P,W){let E=0,M=0;for(;E<P||!W;){let k=r.charCodeAt(n);if(k>=48&&k<=57)M=M*16+k-48;else if(k>=65&&k<=70)M=M*16+k-65+10;else if(k>=97&&k<=102)M=M*16+k-97+10;else break;n++,E++}return E<P&&(M=-1),M}function f(P){n=P,i="",o=0,s=16,p=0}function h(){let P=n;if(r.charCodeAt(n)===48)n++;else for(n++;n<r.length&&Jp(r.charCodeAt(n));)n++;if(n<r.length&&r.charCodeAt(n)===46)if(n++,n<r.length&&Jp(r.charCodeAt(n)))for(n++;n<r.length&&Jp(r.charCodeAt(n));)n++;else return p=3,r.substring(P,n);let W=n;if(n<r.length&&(r.charCodeAt(n)===69||r.charCodeAt(n)===101))if(n++,(n<r.length&&r.charCodeAt(n)===43||r.charCodeAt(n)===45)&&n++,n<r.length&&Jp(r.charCodeAt(n))){for(n++;n<r.length&&Jp(r.charCodeAt(n));)n++;W=n}else p=3;return r.substring(P,W)}function m(){let P="",W=n;for(;;){if(n>=t){P+=r.substring(W,n),p=2;break}let E=r.charCodeAt(n);if(E===34){P+=r.substring(W,n),n++;break}if(E===92){if(P+=r.substring(W,n),n++,n>=t){p=2;break}switch(r.charCodeAt(n++)){case 34:P+='"';break;case 92:P+="\\";break;case 47:P+="/";break;case 98:P+="\b";break;case 102:P+="\f";break;case 110:P+=`
`;break;case 114:P+="\r";break;case 116:P+="	";break;case 117:let k=d(4,!0);k>=0?P+=String.fromCharCode(k):p=4;break;default:p=5}W=n;continue}if(E>=0&&E<=31)if(kh(E)){P+=r.substring(W,n),p=2;break}else p=6;n++}return P}function y(){if(i="",p=0,o=n,c=a,l=u,n>=t)return o=t,s=17;let P=r.charCodeAt(n);if(W0(P)){do n++,i+=String.fromCharCode(P),P=r.charCodeAt(n);while(W0(P));return s=15}if(kh(P))return n++,i+=String.fromCharCode(P),P===13&&r.charCodeAt(n)===10&&(n++,i+=`
`),a++,u=n,s=14;switch(P){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,i=m(),s=10;case 47:let W=n-1;if(r.charCodeAt(n+1)===47){for(n+=2;n<t&&!kh(r.charCodeAt(n));)n++;return i=r.substring(W,n),s=12}if(r.charCodeAt(n+1)===42){n+=2;let E=t-1,M=!1;for(;n<E;){let k=r.charCodeAt(n);if(k===42&&r.charCodeAt(n+1)===47){n+=2,M=!0;break}n++,kh(k)&&(k===13&&r.charCodeAt(n)===10&&n++,a++,u=n)}return M||(n++,p=1),i=r.substring(W,n),s=13}return i+=String.fromCharCode(P),n++,s=16;case 45:if(i+=String.fromCharCode(P),n++,n===t||!Jp(r.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=h(),s=11;default:for(;n<t&&I(P);)n++,P=r.charCodeAt(n);if(o!==n){switch(i=r.substring(o,n),i){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return i+=String.fromCharCode(P),n++,s=16}}function I(P){if(W0(P)||kh(P))return!1;switch(P){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function L(){let P;do P=y();while(P>=12&&P<=15);return P}return{setPosition:f,getPosition:()=>n,scan:e?L:y,getToken:()=>s,getTokenValue:()=>i,getTokenOffset:()=>o,getTokenLength:()=>n-o,getTokenStartLine:()=>c,getTokenStartCharacter:()=>o-l,getTokenError:()=>p}}function W0(r){return r===32||r===9}function kh(r){return r===10||r===13}function Jp(r){return r>=48&&r<=57}var y$,Zw=Gn(()=>{"use strict";(function(r){r[r.lineFeed=10]="lineFeed",r[r.carriageReturn=13]="carriageReturn",r[r.space=32]="space",r[r._0=48]="_0",r[r._1=49]="_1",r[r._2=50]="_2",r[r._3=51]="_3",r[r._4=52]="_4",r[r._5=53]="_5",r[r._6=54]="_6",r[r._7=55]="_7",r[r._8=56]="_8",r[r._9=57]="_9",r[r.a=97]="a",r[r.b=98]="b",r[r.c=99]="c",r[r.d=100]="d",r[r.e=101]="e",r[r.f=102]="f",r[r.g=103]="g",r[r.h=104]="h",r[r.i=105]="i",r[r.j=106]="j",r[r.k=107]="k",r[r.l=108]="l",r[r.m=109]="m",r[r.n=110]="n",r[r.o=111]="o",r[r.p=112]="p",r[r.q=113]="q",r[r.r=114]="r",r[r.s=115]="s",r[r.t=116]="t",r[r.u=117]="u",r[r.v=118]="v",r[r.w=119]="w",r[r.x=120]="x",r[r.y=121]="y",r[r.z=122]="z",r[r.A=65]="A",r[r.B=66]="B",r[r.C=67]="C",r[r.D=68]="D",r[r.E=69]="E",r[r.F=70]="F",r[r.G=71]="G",r[r.H=72]="H",r[r.I=73]="I",r[r.J=74]="J",r[r.K=75]="K",r[r.L=76]="L",r[r.M=77]="M",r[r.N=78]="N",r[r.O=79]="O",r[r.P=80]="P",r[r.Q=81]="Q",r[r.R=82]="R",r[r.S=83]="S",r[r.T=84]="T",r[r.U=85]="U",r[r.V=86]="V",r[r.W=87]="W",r[r.X=88]="X",r[r.Y=89]="Y",r[r.Z=90]="Z",r[r.asterisk=42]="asterisk",r[r.backslash=92]="backslash",r[r.closeBrace=125]="closeBrace",r[r.closeBracket=93]="closeBracket",r[r.colon=58]="colon",r[r.comma=44]="comma",r[r.dot=46]="dot",r[r.doubleQuote=34]="doubleQuote",r[r.minus=45]="minus",r[r.openBrace=123]="openBrace",r[r.openBracket=91]="openBracket",r[r.plus=43]="plus",r[r.slash=47]="slash",r[r.formFeed=12]="formFeed",r[r.tab=9]="tab"})(y$||(y$={}))});var fn,Yp,V0,b$,v$=Gn(()=>{fn=new Array(20).fill(0).map((r,e)=>" ".repeat(e)),Yp=200,V0={" ":{"\n":new Array(Yp).fill(0).map((r,e)=>`
`+" ".repeat(e)),"\r":new Array(Yp).fill(0).map((r,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Yp).fill(0).map((r,e)=>`\r
`+" ".repeat(e))},"	":{"\n":new Array(Yp).fill(0).map((r,e)=>`
`+"	".repeat(e)),"\r":new Array(Yp).fill(0).map((r,e)=>"\r"+"	".repeat(e)),"\r\n":new Array(Yp).fill(0).map((r,e)=>`\r
`+"	".repeat(e))}},b$=[`
`,"\r",`\r
`]});function eS(r,e,t){let n,i,o,s,a;if(e){for(s=e.offset,a=s+e.length,o=s;o>0&&!Rh(r,o-1);)o--;let E=a;for(;E<r.length&&!Rh(r,E);)E++;i=r.substring(o,E),n=hoe(i,t)}else i=r,n=0,o=0,s=0,a=r.length;let c=moe(t,r),u=b$.includes(c),l=0,p=0,d;t.insertSpaces?d=fn[t.tabSize||4]??Xp(fn[1],t.tabSize||4):d="	";let f=d==="	"?"	":" ",h=$c(i,!1),m=!1;function y(){if(l>1)return Xp(c,l)+Xp(d,n+p);let E=d.length*(n+p);return!u||E>V0[f][c].length?c+Xp(d,n+p):E<=0?c:V0[f][c][E]}function I(){let E=h.scan();for(l=0;E===15||E===14;)E===14&&t.keepLines?l+=1:E===14&&(l=1),E=h.scan();return m=E===16||h.getTokenError()!==0,E}let L=[];function P(E,M,k){!m&&(!e||M<a&&k>s)&&r.substring(M,k)!==E&&L.push({offset:M,length:k-M,content:E})}let W=I();if(t.keepLines&&l>0&&P(Xp(c,l),0,0),W!==17){let E=h.getTokenOffset()+o,M=d.length*n<20&&t.insertSpaces?fn[d.length*n]:Xp(d,n);P(M,o,E)}for(;W!==17;){let E=h.getTokenOffset()+h.getTokenLength()+o,M=I(),k="",j=!1;for(;l===0&&(M===12||M===13);){let he=h.getTokenOffset()+o;P(fn[1],E,he),E=h.getTokenOffset()+h.getTokenLength()+o,j=M===12,k=j?y():"",M=I()}if(M===2)W!==1&&p--,t.keepLines&&l>0||!t.keepLines&&W!==1?k=y():t.keepLines&&(k=fn[1]);else if(M===4)W!==3&&p--,t.keepLines&&l>0||!t.keepLines&&W!==3?k=y():t.keepLines&&(k=fn[1]);else{switch(W){case 3:case 1:p++,t.keepLines&&l>0||!t.keepLines?k=y():k=fn[1];break;case 5:t.keepLines&&l>0||!t.keepLines?k=y():k=fn[1];break;case 12:k=y();break;case 13:l>0?k=y():j||(k=fn[1]);break;case 6:t.keepLines&&l>0?k=y():j||(k=fn[1]);break;case 10:t.keepLines&&l>0?k=y():M===6&&!j&&(k="");break;case 7:case 8:case 9:case 11:case 2:case 4:t.keepLines&&l>0?k=y():(M===12||M===13)&&!j?k=fn[1]:M!==5&&M!==17&&(m=!0);break;case 16:m=!0;break}l>0&&(M===12||M===13)&&(k=y())}M===17&&(t.keepLines&&l>0?k=y():k=t.insertFinalNewline?c:"");let Z=h.getTokenOffset()+o;P(k,E,Z),W=M}return L}function Xp(r,e){let t="";for(let n=0;n<e;n++)t+=r;return t}function hoe(r,e){let t=0,n=0,i=e.tabSize||4;for(;t<r.length;){let o=r.charAt(t);if(o===fn[1])n++;else if(o==="	")n+=i;else break;t++}return Math.floor(n/i)}function moe(r,e){for(let t=0;t<e.length;t++){let n=e.charAt(t);if(n==="\r")return t+1<e.length&&e.charAt(t+1)===`
`?`\r
`:"\r";if(n===`
`)return`
`}return r&&r.eol||`
`}function Rh(r,e){return`\r
`.indexOf(r.charAt(e))!==-1}var $0=Gn(()=>{"use strict";Zw();v$()});function w$(r,e){let t=[],n=new Object,i,o={value:{},offset:0,length:0,type:"object",parent:void 0},s=!1;function a(c,u,l,p){o.value=c,o.offset=u,o.length=l,o.type=p,o.colonOffset=void 0,i=o}try{Oh(r,{onObjectBegin:(c,u)=>{if(e<=c)throw n;i=void 0,s=e>c,t.push("")},onObjectProperty:(c,u,l)=>{if(e<u||(a(c,u,l,"property"),t[t.length-1]=c,e<=u+l))throw n},onObjectEnd:(c,u)=>{if(e<=c)throw n;i=void 0,t.pop()},onArrayBegin:(c,u)=>{if(e<=c)throw n;i=void 0,t.push(0)},onArrayEnd:(c,u)=>{if(e<=c)throw n;i=void 0,t.pop()},onLiteralValue:(c,u,l)=>{if(e<u||(a(c,u,l,I$(c)),e<=u+l))throw n},onSeparator:(c,u,l)=>{if(e<=u)throw n;if(c===":"&&i&&i.type==="property")i.colonOffset=u,s=!1,i=void 0;else if(c===","){let p=t[t.length-1];typeof p=="number"?t[t.length-1]=p+1:(s=!0,t[t.length-1]=""),i=void 0}}})}catch(c){if(c!==n)throw c}return{path:t,previousNode:i,isAtPropertyKey:s,matches:c=>{let u=0;for(let l=0;u<c.length&&l<t.length;l++)if(c[u]===t[l]||c[u]==="*")u++;else if(c[u]!=="**")return!1;return u===c.length}}}function S$(r,e=[],t=Ah.DEFAULT){let n=null,i=[],o=[];function s(c){Array.isArray(i)?i.push(c):n!==null&&(i[n]=c)}return Oh(r,{onObjectBegin:()=>{let c={};s(c),o.push(i),i=c,n=null},onObjectProperty:c=>{n=c},onObjectEnd:()=>{i=o.pop()},onArrayBegin:()=>{let c=[];s(c),o.push(i),i=c,n=null},onArrayEnd:()=>{i=o.pop()},onLiteralValue:s,onError:(c,u,l)=>{e.push({error:c,offset:u,length:l})}},t),i[0]}function rS(r,e=[],t=Ah.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(c){n.type==="property"&&(n.length=c-n.offset,n=n.parent)}function o(c){return n.children.push(c),c}Oh(r,{onObjectBegin:c=>{n=o({type:"object",offset:c,length:-1,parent:n,children:[]})},onObjectProperty:(c,u,l)=>{n=o({type:"property",offset:u,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:c,offset:u,length:l,parent:n})},onObjectEnd:(c,u)=>{i(c+u),n.length=c+u-n.offset,n=n.parent,i(c+u)},onArrayBegin:(c,u)=>{n=o({type:"array",offset:c,length:-1,parent:n,children:[]})},onArrayEnd:(c,u)=>{n.length=c+u-n.offset,n=n.parent,i(c+u)},onLiteralValue:(c,u,l)=>{o({type:I$(c),offset:u,length:l,parent:n,value:c}),i(u+l)},onSeparator:(c,u,l)=>{n.type==="property"&&(c===":"?n.colonOffset=u:c===","&&i(u))},onError:(c,u,l)=>{e.push({error:c,offset:u,length:l})}},t);let a=n.children[0];return a&&delete a.parent,a}function Dh(r,e){if(!r)return;let t=r;for(let n of e)if(typeof n=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let i=!1;for(let o of t.children)if(Array.isArray(o.children)&&o.children[0].value===n&&o.children.length===2){t=o.children[1],i=!0;break}if(!i)return}else{let i=n;if(t.type!=="array"||i<0||!Array.isArray(t.children)||i>=t.children.length)return;t=t.children[i]}return t}function H0(r){if(!r.parent||!r.parent.children)return[];let e=H0(r.parent);if(r.parent.type==="property"){let t=r.parent.children[0].value;e.push(t)}else if(r.parent.type==="array"){let t=r.parent.children.indexOf(r);t!==-1&&e.push(t)}return e}function tS(r){switch(r.type){case"array":return r.children.map(tS);case"object":let e=Object.create(null);for(let t of r.children){let n=t.children[1];n&&(e[t.children[0].value]=tS(n))}return e;case"null":case"string":case"number":case"boolean":return r.value;default:return}}function yoe(r,e,t=!1){return e>=r.offset&&e<r.offset+r.length||t&&e===r.offset+r.length}function G0(r,e,t=!1){if(yoe(r,e,t)){let n=r.children;if(Array.isArray(n))for(let i=0;i<n.length&&n[i].offset<=e;i++){let o=G0(n[i],e,t);if(o)return o}return r}}function Oh(r,e,t=Ah.DEFAULT){let n=$c(r,!1),i=[],o=0;function s(oe){return oe?()=>o===0&&oe(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function a(oe){return oe?x=>o===0&&oe(x,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function c(oe){return oe?x=>o===0&&oe(x,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice()):()=>!0}function u(oe){return oe?()=>{o>0?o++:oe(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice())===!1&&(o=1)}:()=>!0}function l(oe){return oe?()=>{o>0&&o--,o===0&&oe(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}let p=u(e.onObjectBegin),d=c(e.onObjectProperty),f=l(e.onObjectEnd),h=u(e.onArrayBegin),m=l(e.onArrayEnd),y=c(e.onLiteralValue),I=a(e.onSeparator),L=s(e.onComment),P=a(e.onError),W=t&&t.disallowComments,E=t&&t.allowTrailingComma;function M(){for(;;){let oe=n.scan();switch(n.getTokenError()){case 4:k(14);break;case 5:k(15);break;case 3:k(13);break;case 1:W||k(11);break;case 2:k(12);break;case 6:k(16);break}switch(oe){case 12:case 13:W?k(10):L();break;case 16:k(1);break;case 15:case 14:break;default:return oe}}}function k(oe,x=[],R=[]){if(P(oe),x.length+R.length>0){let Fe=n.getToken();for(;Fe!==17;){if(x.indexOf(Fe)!==-1){M();break}else if(R.indexOf(Fe)!==-1)break;Fe=M()}}}function j(oe){let x=n.getTokenValue();return oe?y(x):(d(x),i.push(x)),M(),!0}function Z(){switch(n.getToken()){case 11:let oe=n.getTokenValue(),x=Number(oe);isNaN(x)&&(k(2),x=0),y(x);break;case 7:y(null);break;case 8:y(!0);break;case 9:y(!1);break;default:return!1}return M(),!0}function he(){return n.getToken()!==10?(k(3,[],[2,5]),!1):(j(!1),n.getToken()===6?(I(":"),M(),ge()||k(4,[],[2,5])):k(5,[],[2,5]),i.pop(),!0)}function A(){p(),M();let oe=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(oe||k(4,[],[]),I(","),M(),n.getToken()===2&&E)break}else oe&&k(6,[],[]);he()||k(4,[],[2,5]),oe=!0}return f(),n.getToken()!==2?k(7,[2],[]):M(),!0}function Se(){h(),M();let oe=!0,x=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(x||k(4,[],[]),I(","),M(),n.getToken()===4&&E)break}else x&&k(6,[],[]);oe?(i.push(0),oe=!1):i[i.length-1]++,ge()||k(4,[],[4,5]),x=!0}return m(),oe||i.pop(),n.getToken()!==4?k(8,[4],[]):M(),!0}function ge(){switch(n.getToken()){case 3:return Se();case 1:return A();case 10:return j(!0);default:return Z()}}return M(),n.getToken()===17?t.allowEmptyContent?!0:(k(4,[],[]),!1):ge()?(n.getToken()!==17&&k(9,[],[]),!0):(k(4,[],[]),!1)}function _$(r,e){let t=$c(r),n=[],i,o=0,s;do switch(s=t.getPosition(),i=t.scan(),i){case 12:case 13:case 17:o!==s&&n.push(r.substring(o,s)),e!==void 0&&n.push(t.getTokenValue().replace(/[^\r\n]/g,e)),o=t.getPosition();break}while(i!==17);return n.join("")}function I$(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(r){if(Array.isArray(r))return"array"}else return"null";return"object"}default:return"null"}}var Ah,z0=Gn(()=>{"use strict";Zw();(function(r){r.DEFAULT={allowTrailingComma:!1}})(Ah||(Ah={}))});function x$(r,e,t,n){let i=e.slice(),s=rS(r,[]),a,c;for(;i.length>0&&(c=i.pop(),a=Dh(s,i),a===void 0&&t!==void 0);)typeof c=="string"?t={[c]:t}:t=[t];if(a)if(a.type==="object"&&typeof c=="string"&&Array.isArray(a.children)){let u=Dh(a,[c]);if(u!==void 0)if(t===void 0){if(!u.parent)throw new Error("Malformed AST");let l=a.children.indexOf(u.parent),p,d=u.parent.offset+u.parent.length;if(l>0){let f=a.children[l-1];p=f.offset+f.length}else p=a.offset+1,a.children.length>1&&(d=a.children[1].offset);return Hc(r,{offset:p,length:d-p,content:""},n)}else return Hc(r,{offset:u.offset,length:u.length,content:JSON.stringify(t)},n);else{if(t===void 0)return[];let l=`${JSON.stringify(c)}: ${JSON.stringify(t)}`,p=n.getInsertionIndex?n.getInsertionIndex(a.children.map(f=>f.children[0].value)):a.children.length,d;if(p>0){let f=a.children[p-1];d={offset:f.offset+f.length,length:0,content:","+l}}else a.children.length===0?d={offset:a.offset+1,length:0,content:l}:d={offset:a.offset+1,length:0,content:l+","};return Hc(r,d,n)}}else if(a.type==="array"&&typeof c=="number"&&Array.isArray(a.children)){let u=c;if(u===-1){let l=`${JSON.stringify(t)}`,p;if(a.children.length===0)p={offset:a.offset+1,length:0,content:l};else{let d=a.children[a.children.length-1];p={offset:d.offset+d.length,length:0,content:","+l}}return Hc(r,p,n)}else if(t===void 0&&a.children.length>=0){let l=c,p=a.children[l],d;if(a.children.length===1)d={offset:a.offset+1,length:a.length-2,content:""};else if(a.children.length-1===l){let f=a.children[l-1],h=f.offset+f.length,m=a.offset+a.length;d={offset:h,length:m-2-h,content:""}}else d={offset:p.offset,length:a.children[l+1].offset-p.offset,content:""};return Hc(r,d,n)}else if(t!==void 0){let l,p=`${JSON.stringify(t)}`;if(!n.isArrayInsertion&&a.children.length>c){let d=a.children[c];l={offset:d.offset,length:d.length,content:p}}else if(a.children.length===0||c===0)l={offset:a.offset+1,length:0,content:a.children.length===0?p:p+","};else{let d=c>a.children.length?a.children.length:c,f=a.children[d-1];l={offset:f.offset+f.length,length:0,content:","+p}}return Hc(r,l,n)}else throw new Error(`Can not ${t===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${u} as length is not sufficient`)}else throw new Error(`Can not add ${typeof c!="number"?"index":"property"} to parent of type ${a.type}`);else{if(t===void 0)throw new Error("Can not delete in empty document");return Hc(r,{offset:s?s.offset:0,length:s?s.length:0,content:JSON.stringify(t)},n)}}function Hc(r,e,t){if(!t.formattingOptions)return[e];let n=nS(r,e),i=e.offset,o=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;i>0&&!Rh(n,i-1);)i--;for(;o<n.length&&!Rh(n,o);)o++}let s=eS(n,{offset:i,length:o-i},{...t.formattingOptions,keepLines:!1});for(let c=s.length-1;c>=0;c--){let u=s[c];n=nS(n,u),i=Math.min(i,u.offset),o=Math.max(o,u.offset+u.length),o+=u.content.length-u.length}let a=r.length-(n.length-o)-i;return[{offset:i,length:a,content:n.substring(i,o)}]}function nS(r,e){return r.substring(0,e.offset)+e.content+r.substring(e.offset+e.length)}var C$=Gn(()=>{"use strict";$0();z0()});var X0={};l_(X0,{ParseErrorCode:()=>Y0,ScanError:()=>K0,SyntaxKind:()=>J0,applyEdits:()=>Ooe,createScanner:()=>woe,findNodeAtLocation:()=>xoe,findNodeAtOffset:()=>Coe,format:()=>Aoe,getLocation:()=>Soe,getNodePath:()=>Toe,getNodeValue:()=>Poe,modify:()=>Doe,parse:()=>_oe,parseTree:()=>Ioe,printParseErrorCode:()=>Roe,stripComments:()=>koe,visit:()=>Eoe});function Roe(r){switch(r){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function Aoe(r,e,t){return eS(r,e,t)}function Doe(r,e,t,n){return x$(r,e,t,n)}function Ooe(r,e){let t=e.slice(0).sort((i,o)=>{let s=i.offset-o.offset;return s===0?i.length-o.length:s}),n=r.length;for(let i=t.length-1;i>=0;i--){let o=t[i];if(o.offset+o.length<=n)r=nS(r,o);else throw new Error("Overlapping edit");n=o.offset}return r}var woe,K0,J0,Soe,_oe,Ioe,xoe,Coe,Toe,Poe,Eoe,koe,Y0,Q0=Gn(()=>{"use strict";$0();C$();Zw();z0();woe=$c;(function(r){r[r.None=0]="None",r[r.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",r[r.UnexpectedEndOfString=2]="UnexpectedEndOfString",r[r.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",r[r.InvalidUnicode=4]="InvalidUnicode",r[r.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",r[r.InvalidCharacter=6]="InvalidCharacter"})(K0||(K0={}));(function(r){r[r.OpenBraceToken=1]="OpenBraceToken",r[r.CloseBraceToken=2]="CloseBraceToken",r[r.OpenBracketToken=3]="OpenBracketToken",r[r.CloseBracketToken=4]="CloseBracketToken",r[r.CommaToken=5]="CommaToken",r[r.ColonToken=6]="ColonToken",r[r.NullKeyword=7]="NullKeyword",r[r.TrueKeyword=8]="TrueKeyword",r[r.FalseKeyword=9]="FalseKeyword",r[r.StringLiteral=10]="StringLiteral",r[r.NumericLiteral=11]="NumericLiteral",r[r.LineCommentTrivia=12]="LineCommentTrivia",r[r.BlockCommentTrivia=13]="BlockCommentTrivia",r[r.LineBreakTrivia=14]="LineBreakTrivia",r[r.Trivia=15]="Trivia",r[r.Unknown=16]="Unknown",r[r.EOF=17]="EOF"})(J0||(J0={}));Soe=w$,_oe=S$,Ioe=rS,xoe=Dh,Coe=G0,Toe=H0,Poe=tS,Eoe=Oh,koe=_$;(function(r){r[r.InvalidSymbol=1]="InvalidSymbol",r[r.InvalidNumberFormat=2]="InvalidNumberFormat",r[r.PropertyNameExpected=3]="PropertyNameExpected",r[r.ValueExpected=4]="ValueExpected",r[r.ColonExpected=5]="ColonExpected",r[r.CommaExpected=6]="CommaExpected",r[r.CloseBraceExpected=7]="CloseBraceExpected",r[r.CloseBracketExpected=8]="CloseBracketExpected",r[r.EndOfFileExpected=9]="EndOfFileExpected",r[r.InvalidCommentToken=10]="InvalidCommentToken",r[r.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",r[r.UnexpectedEndOfString=12]="UnexpectedEndOfString",r[r.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",r[r.InvalidUnicode=14]="InvalidUnicode",r[r.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",r[r.InvalidCharacter=16]="InvalidCharacter"})(Y0||(Y0={}))});var iH=v(Kt=>{"use strict";var qoe="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Woe="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",fE="numeric",hE="ascii",mE="alpha",Wh="asciinumeric",Uh="alphanumeric",gE="domain",z$="emoji",Voe="scheme",$oe="slashscheme",uE="whitespace";function Hoe(r,e){return r in e||(e[r]=[]),e[r]}function zc(r,e,t){e[fE]&&(e[Wh]=!0,e[Uh]=!0),e[hE]&&(e[Wh]=!0,e[mE]=!0),e[Wh]&&(e[Uh]=!0),e[mE]&&(e[Uh]=!0),e[Uh]&&(e[gE]=!0),e[z$]&&(e[gE]=!0);for(let n in e){let i=Hoe(n,t);i.indexOf(r)<0&&i.push(r)}}function Goe(r,e){let t={};for(let n in e)e[n].indexOf(r)>=0&&(t[n]=!0);return t}function Cr(r=null){this.j={},this.jr=[],this.jd=null,this.t=r}Cr.groups={};Cr.prototype={accepts(){return!!this.t},go(r){let e=this,t=e.j[r];if(t)return t;for(let n=0;n<e.jr.length;n++){let i=e.jr[n][0],o=e.jr[n][1];if(o&&i.test(r))return o}return e.jd},has(r,e=!1){return e?r in this.j:!!this.go(r)},ta(r,e,t,n){for(let i=0;i<r.length;i++)this.tt(r[i],e,t,n)},tr(r,e,t,n){n=n||Cr.groups;let i;return e&&e.j?i=e:(i=new Cr(e),t&&n&&zc(e,t,n)),this.jr.push([r,i]),i},ts(r,e,t,n){let i=this,o=r.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(r[s]);return i.tt(r[o-1],e,t,n)},tt(r,e,t,n){n=n||Cr.groups;let i=this;if(e&&e.j)return i.j[r]=e,e;let o=e,s,a=i.go(r);if(a?(s=new Cr,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Cr,o){if(n)if(s.t&&typeof s.t=="string"){let c=Object.assign(Goe(s.t,n),t);zc(o,c,n)}else t&&zc(o,t,n);s.t=o}return i.j[r]=s,s}};var de=(r,e,t,n,i)=>r.ta(e,t,n,i),pt=(r,e,t,n,i)=>r.tr(e,t,n,i),V$=(r,e,t,n,i)=>r.ts(e,t,n,i),B=(r,e,t,n,i)=>r.tt(e,t,n,i),Zo="WORD",yE="UWORD",K$="ASCIINUMERICAL",J$="ALPHANUMERICAL",Kh="LOCALHOST",bE="TLD",vE="UTLD",mS="SCHEME",dd="SLASH_SCHEME",IE="NUM",wE="WS",xE="NL",Vh="OPENBRACE",$h="CLOSEBRACE",bS="OPENBRACKET",vS="CLOSEBRACKET",wS="OPENPAREN",SS="CLOSEPAREN",_S="OPENANGLEBRACKET",IS="CLOSEANGLEBRACKET",xS="FULLWIDTHLEFTPAREN",CS="FULLWIDTHRIGHTPAREN",TS="LEFTCORNERBRACKET",PS="RIGHTCORNERBRACKET",ES="LEFTWHITECORNERBRACKET",kS="RIGHTWHITECORNERBRACKET",RS="FULLWIDTHLESSTHAN",AS="FULLWIDTHGREATERTHAN",DS="AMPERSAND",OS="APOSTROPHE",LS="ASTERISK",xa="AT",MS="BACKSLASH",NS="BACKTICK",FS="CARET",Ca="COLON",CE="COMMA",BS="DOLLAR",ho="DOT",jS="EQUALS",TE="EXCLAMATION",Wn="HYPHEN",Hh="PERCENT",US="PIPE",qS="PLUS",WS="POUND",Gh="QUERY",PE="QUOTE",Y$="FULLWIDTHMIDDLEDOT",EE="SEMI",mo="SLASH",zh="TILDE",VS="UNDERSCORE",X$="EMOJI",$S="SYM",Q$=Object.freeze({__proto__:null,ALPHANUMERICAL:J$,AMPERSAND:DS,APOSTROPHE:OS,ASCIINUMERICAL:K$,ASTERISK:LS,AT:xa,BACKSLASH:MS,BACKTICK:NS,CARET:FS,CLOSEANGLEBRACKET:IS,CLOSEBRACE:$h,CLOSEBRACKET:vS,CLOSEPAREN:SS,COLON:Ca,COMMA:CE,DOLLAR:BS,DOT:ho,EMOJI:X$,EQUALS:jS,EXCLAMATION:TE,FULLWIDTHGREATERTHAN:AS,FULLWIDTHLEFTPAREN:xS,FULLWIDTHLESSTHAN:RS,FULLWIDTHMIDDLEDOT:Y$,FULLWIDTHRIGHTPAREN:CS,HYPHEN:Wn,LEFTCORNERBRACKET:TS,LEFTWHITECORNERBRACKET:ES,LOCALHOST:Kh,NL:xE,NUM:IE,OPENANGLEBRACKET:_S,OPENBRACE:Vh,OPENBRACKET:bS,OPENPAREN:wS,PERCENT:Hh,PIPE:US,PLUS:qS,POUND:WS,QUERY:Gh,QUOTE:PE,RIGHTCORNERBRACKET:PS,RIGHTWHITECORNERBRACKET:kS,SCHEME:mS,SEMI:EE,SLASH:mo,SLASH_SCHEME:dd,SYM:$S,TILDE:zh,TLD:bE,UNDERSCORE:VS,UTLD:vE,UWORD:yE,WORD:Zo,WS:wE}),po=/[a-z]/,fd=new RegExp("\\p{L}","u"),gS=new RegExp("\\p{Emoji}","u"),zoe=/\ufe0f/,fo=/\d/,yS=/\s/,Koe=Object.freeze({__proto__:null,ASCII_LETTER:po,DIGIT:fo,EMOJI:gS,EMOJI_VARIATION:zoe,LETTER:fd,SPACE:yS}),$$="\r",lE=`
`,Joe="\uFE0F",Yoe="\u200D",pE="\uFFFC",fS=null,hS=null;function Xoe(r=[]){let e={};Cr.groups=e;let t=new Cr;fS==null&&(fS=H$(qoe)),hS==null&&(hS=H$(Woe)),B(t,"'",OS),B(t,"{",Vh),B(t,"}",$h),B(t,"[",bS),B(t,"]",vS),B(t,"(",wS),B(t,")",SS),B(t,"<",_S),B(t,">",IS),B(t,"\uFF08",xS),B(t,"\uFF09",CS),B(t,"\u300C",TS),B(t,"\u300D",PS),B(t,"\u300E",ES),B(t,"\u300F",kS),B(t,"\uFF1C",RS),B(t,"\uFF1E",AS),B(t,"&",DS),B(t,"*",LS),B(t,"@",xa),B(t,"`",NS),B(t,"^",FS),B(t,":",Ca),B(t,",",CE),B(t,"$",BS),B(t,".",ho),B(t,"=",jS),B(t,"!",TE),B(t,"-",Wn),B(t,"%",Hh),B(t,"|",US),B(t,"+",qS),B(t,"#",WS),B(t,"?",Gh),B(t,'"',PE),B(t,"/",mo),B(t,";",EE),B(t,"~",zh),B(t,"_",VS),B(t,"\\",MS),B(t,"\u30FB",Y$);let n=pt(t,fo,IE,{[fE]:!0});pt(n,fo,n);let i=pt(n,po,K$,{[Wh]:!0}),o=pt(n,fd,J$,{[Uh]:!0}),s=pt(t,po,Zo,{[hE]:!0});pt(s,fo,i),pt(s,po,s),pt(i,fo,i),pt(i,po,i);let a=pt(t,fd,yE,{[mE]:!0});pt(a,po),pt(a,fo,o),pt(a,fd,a),pt(o,fo,o),pt(o,po),pt(o,fd,o);let c=B(t,lE,xE,{[uE]:!0}),u=B(t,$$,wE,{[uE]:!0}),l=pt(t,yS,wE,{[uE]:!0});B(t,pE,l),B(u,lE,c),B(u,pE,l),pt(u,yS,l),B(l,$$),B(l,lE),pt(l,yS,l),B(l,pE,l);let p=pt(t,gS,X$,{[z$]:!0});B(p,"#"),pt(p,gS,p),B(p,Joe,p);let d=B(p,Yoe);B(d,"#"),pt(d,gS,p);let f=[[po,s],[fo,i]],h=[[po,null],[fd,a],[fo,o]];for(let m=0;m<fS.length;m++)Ia(t,fS[m],bE,Zo,f);for(let m=0;m<hS.length;m++)Ia(t,hS[m],vE,yE,h);zc(bE,{tld:!0,ascii:!0},e),zc(vE,{utld:!0,alpha:!0},e),Ia(t,"file",mS,Zo,f),Ia(t,"mailto",mS,Zo,f),Ia(t,"http",dd,Zo,f),Ia(t,"https",dd,Zo,f),Ia(t,"ftp",dd,Zo,f),Ia(t,"ftps",dd,Zo,f),zc(mS,{scheme:!0,ascii:!0},e),zc(dd,{slashscheme:!0,ascii:!0},e),r=r.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<r.length;m++){let y=r[m][0],L=r[m][1]?{[Voe]:!0}:{[$oe]:!0};y.indexOf("-")>=0?L[gE]=!0:po.test(y)?fo.test(y)?L[Wh]=!0:L[hE]=!0:L[fE]=!0,V$(t,y,y,L)}return V$(t,"localhost",Kh,{ascii:!0}),t.jd=new Cr($S),{start:t,tokens:Object.assign({groups:e},Q$)}}function Z$(r,e){let t=eH(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=t.length,i=[],o=0,s=0;for(;s<n;){let a=r,c=null,u=0,l=null,p=-1,d=-1;for(;s<n&&(c=a.go(t[s]));)a=c,a.accepts()?(p=0,d=0,l=a):p>=0&&(p+=t[s].length,d++),u+=t[s].length,o+=t[s].length,s++;o-=p,s-=d,u-=p,i.push({t:l.t,v:e.slice(o-u,o),s:o-u,e:o})}return i}function eH(r){let e=[],t=r.length,n=0;for(;n<t;){let i=r.charCodeAt(n),o,s=i<55296||i>56319||n+1===t||(o=r.charCodeAt(n+1))<56320||o>57343?r[n]:r.slice(n,n+2);e.push(s),n+=s.length}return e}function Ia(r,e,t,n,i){let o,s=e.length;for(let a=0;a<s-1;a++){let c=e[a];r.j[c]?o=r.j[c]:(o=new Cr(n),o.jr=i.slice(),r.j[c]=o),r=o}return o=new Cr(t),o.jr=i.slice(),r.j[e[s-1]]=o,o}function H$(r){let e=[],t=[],n=0,i="0123456789";for(;n<r.length;){let o=0;for(;i.indexOf(r[n+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(r.substring(n,n+o),10);s>0;s--)t.pop();n+=o}else t.push(r[n]),n++}return e}var hd={defaultProtocol:"http",events:null,format:G$,formatHref:G$,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Xh(r,e=null){let t=Object.assign({},hd);r&&(t=Object.assign(t,r instanceof Xh?r.o:r));let n=t.ignoreTags,i=[];for(let o=0;o<n.length;o++)i.push(n[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Xh.prototype={o:hd,ignoreTags:[],defaultRender(r){return r},check(r){return this.get("validate",r.toString(),r)},get(r,e,t){let n=e!=null,i=this.o[r];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:hd[r],typeof i=="function"&&n&&(i=i(e,t))):typeof i=="function"&&n&&(i=i(e,t.t,t)),i)},getObj(r,e,t){let n=this.o[r];return typeof n=="function"&&e!=null&&(n=n(e,t.t,t)),n},render(r){let e=r.render(this);return(this.get("render",null,r)||this.defaultRender)(e,r.t,r)}};function G$(r){return r}var Qoe=Object.freeze({__proto__:null,Options:Xh,defaults:hd});function Jh(r,e){this.t="token",this.v=r,this.tk=e}Jh.prototype={isLink:!1,toString(){return this.v},toHref(r){return this.toString()},toFormattedString(r){let e=this.toString(),t=r.get("truncate",e,this),n=r.get("format",e,this);return t&&n.length>t?n.substring(0,t)+"\u2026":n},toFormattedHref(r){return r.get("formatHref",this.toHref(r.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(r=hd.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(r),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(r){return{type:this.t,value:this.toFormattedString(r),isLink:this.isLink,href:this.toFormattedHref(r),start:this.startIndex(),end:this.endIndex()}},validate(r){return r.get("validate",this.toString(),this)},render(r){let e=this,t=this.toHref(r.get("defaultProtocol")),n=r.get("formatHref",t,this),i=r.get("tagName",t,e),o=this.toFormattedString(r),s={},a=r.get("className",t,e),c=r.get("target",t,e),u=r.get("rel",t,e),l=r.getObj("attributes",t,e),p=r.getObj("events",t,e);return s.href=n,a&&(s.class=a),c&&(s.target=c),u&&(s.rel=u),l&&Object.assign(s,l),{tagName:i,attributes:s,content:o,eventListeners:p}}};function md(r,e){class t extends Jh{constructor(i,o){super(i,o),this.t=r}}for(let n in e)t.prototype[n]=e[n];return t.t=r,t}var SE=md("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_E=md("text"),tH=md("nl"),qh=md("url",{isLink:!0,toHref(r=hd.defaultProtocol){return this.hasProtocol()?this.v:`${r}://${this.v}`},hasProtocol(){let r=this.tk;return r.length>=2&&r[0].t!==Kh&&r[1].t===Ca}}),rH=Object.freeze({__proto__:null,Base:Jh,Email:SE,MultiToken:Jh,Nl:tH,Text:_E,Url:qh,createTokenClass:md}),qn=r=>new Cr(r);function Zoe({groups:r}){let e=r.domain.concat([DS,LS,xa,MS,NS,FS,BS,jS,Wn,IE,Hh,US,qS,WS,mo,$S,zh,VS]),t=[OS,Ca,CE,ho,TE,Hh,Gh,PE,EE,_S,IS,Vh,$h,vS,bS,wS,SS,xS,CS,TS,PS,ES,kS,RS,AS],n=[DS,OS,LS,MS,NS,FS,BS,jS,Wn,Vh,$h,Hh,US,qS,WS,Gh,mo,$S,zh,VS],i=qn(),o=B(i,zh);de(o,n,o),de(o,r.domain,o);let s=qn(),a=qn(),c=qn();de(i,r.domain,s),de(i,r.scheme,a),de(i,r.slashscheme,c),de(s,n,o),de(s,r.domain,s);let u=B(s,xa);B(o,xa,u),B(a,xa,u),B(c,xa,u);let l=B(o,ho);de(l,n,o),de(l,r.domain,o);let p=qn();de(u,r.domain,p),de(p,r.domain,p);let d=B(p,ho);de(d,r.domain,p);let f=qn(SE);de(d,r.tld,f),de(d,r.utld,f),B(u,Kh,f);let h=B(p,Wn);B(h,Wn,h),de(h,r.domain,p),de(f,r.domain,p),B(f,ho,d),B(f,Wn,h);let m=B(f,Ca);de(m,r.numeric,SE);let y=B(s,Wn),I=B(s,ho);B(y,Wn,y),de(y,r.domain,s),de(I,n,o),de(I,r.domain,s);let L=qn(qh);de(I,r.tld,L),de(I,r.utld,L),de(L,r.domain,s),de(L,n,o),B(L,ho,I),B(L,Wn,y),B(L,xa,u);let P=B(L,Ca),W=qn(qh);de(P,r.numeric,W);let E=qn(qh),M=qn();de(E,e,E),de(E,t,M),de(M,e,E),de(M,t,M),B(L,mo,E),B(W,mo,E);let k=B(a,Ca),j=B(c,Ca),Z=B(j,mo),he=B(Z,mo);de(a,r.domain,s),B(a,ho,I),B(a,Wn,y),de(c,r.domain,s),B(c,ho,I),B(c,Wn,y),de(k,r.domain,E),B(k,mo,E),B(k,Gh,E),de(he,r.domain,E),de(he,e,E),B(he,mo,E);let A=[[Vh,$h],[bS,vS],[wS,SS],[_S,IS],[xS,CS],[TS,PS],[ES,kS],[RS,AS]];for(let Se=0;Se<A.length;Se++){let[ge,oe]=A[Se],x=B(E,ge);B(M,ge,x),B(x,oe,E);let R=qn(qh);de(x,e,R);let Fe=qn();de(x,t),de(R,e,R),de(R,t,Fe),de(Fe,e,R),de(Fe,t,Fe),B(R,oe,E),B(Fe,oe,E)}return B(i,Kh,L),B(i,xE,tH),{start:i,tokens:Q$}}function ese(r,e,t){let n=t.length,i=0,o=[],s=[];for(;i<n;){let a=r,c=null,u=null,l=0,p=null,d=-1;for(;i<n&&!(c=a.go(t[i].t));)s.push(t[i++]);for(;i<n&&(u=c||a.go(t[i].t));)c=null,a=u,a.accepts()?(d=0,p=a):d>=0&&d++,i++,l++;if(d<0)i-=l,i<n&&(s.push(t[i]),i++);else{s.length>0&&(o.push(dE(_E,e,s)),s=[]),i-=d,l-=d;let f=p.t,h=t.slice(i-l,i);o.push(dE(f,e,h))}}return s.length>0&&o.push(dE(_E,e,s)),o}function dE(r,e,t){let n=t[0].s,i=t[t.length-1].e,o=e.slice(n,i);return new r(o,t)}var Yh=typeof console<"u"&&console&&console.warn||(()=>{}),kE="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ie={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tse(){return Cr.groups={},Ie.scanner=null,Ie.parser=null,Ie.tokenQueue=[],Ie.pluginQueue=[],Ie.customSchemes=[],Ie.initialized=!1,Ie}function rse(r,e){if(typeof e!="function")throw new Error(`linkifyjs: Invalid token plugin ${e} (expects function)`);for(let t=0;t<Ie.tokenQueue.length;t++)if(r===Ie.tokenQueue[t][0]){Yh(`linkifyjs: token plugin "${r}" already registered - will be overwritten`),Ie.tokenQueue[t]=[r,e];return}Ie.tokenQueue.push([r,e]),Ie.initialized&&Yh(`linkifyjs: already initialized - will not register token plugin "${r}" ${kE}`)}function nse(r,e){if(typeof e!="function")throw new Error(`linkifyjs: Invalid plugin ${e} (expects function)`);for(let t=0;t<Ie.pluginQueue.length;t++)if(r===Ie.pluginQueue[t][0]){Yh(`linkifyjs: plugin "${r}" already registered - will be overwritten`),Ie.pluginQueue[t]=[r,e];return}Ie.pluginQueue.push([r,e]),Ie.initialized&&Yh(`linkifyjs: already initialized - will not register plugin "${r}" ${kE}`)}function ise(r,e=!1){if(Ie.initialized&&Yh(`linkifyjs: already initialized - will not register custom scheme "${r}" ${kE}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(r))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);Ie.customSchemes.push([r,e])}function nH(){Ie.scanner=Xoe(Ie.customSchemes);for(let r=0;r<Ie.tokenQueue.length;r++)Ie.tokenQueue[r][1]({scanner:Ie.scanner});Ie.parser=Zoe(Ie.scanner.tokens);for(let r=0;r<Ie.pluginQueue.length;r++)Ie.pluginQueue[r][1]({scanner:Ie.scanner,parser:Ie.parser});return Ie.initialized=!0,Ie}function HS(r){return Ie.initialized||nH(),ese(Ie.parser.start,r,Z$(Ie.scanner.start,r))}HS.scan=Z$;function ose(r,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}let n=new Xh(t),i=HS(r),o=[];for(let s=0;s<i.length;s++){let a=i[s];a.isLink&&(!e||a.t===e)&&n.check(a)&&o.push(a.toFormattedObject(n))}return o}function sse(r,e=null){let t=HS(r);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}Kt.MultiToken=Jh;Kt.Options=Xh;Kt.State=Cr;Kt.createTokenClass=md;Kt.find=ose;Kt.init=nH;Kt.multi=rH;Kt.options=Qoe;Kt.regexp=Koe;Kt.registerCustomProtocol=ise;Kt.registerPlugin=nse;Kt.registerTokenPlugin=rse;Kt.reset=tse;Kt.stringToArray=eH;Kt.test=sse;Kt.text=rH;Kt.tokenize=HS});var _se={};l_(_se,{activate:()=>wse,deactivate:()=>Sse});module.exports=p_(_se);var KH=b(ie()),JH=require("os"),ft=b(require("vscode"));var Id=new Map([["pwa-node","node"],["pwa-chrome","chrome"],["pwa-extensionHost","extensionHost"],["pwa-msedge","msedge"],["pwa-editor-browser","editor-browser"]]),rs=r=>Id.get(r)||r,S5={"pwa-extensionHost":null,"node-terminal":null,"pwa-node":null,"pwa-chrome":null,"pwa-msedge":null,"pwa-editor-browser":null},_5={"extension.js-debug.addCustomBreakpoints":null,"extension.js-debug.addXHRBreakpoints":null,"extension.js-debug.editXHRBreakpoints":null,"extension.pwa-node-debug.attachNodeProcess":null,"extension.js-debug.clearAutoAttachVariables":null,"extension.js-debug.setAutoAttachVariables":null,"extension.js-debug.autoAttachToProcess":null,"extension.js-debug.createDebuggerTerminal":null,"extension.js-debug.createDiagnostics":null,"extension.js-debug.getDiagnosticLogs":null,"extension.js-debug.debugLink":null,"extension.js-debug.npmScript":null,"extension.js-debug.pickNodeProcess":null,"extension.js-debug.prettyPrint":null,"extension.js-debug.removeXHRBreakpoint":null,"extension.js-debug.removeAllCustomBreakpoints":null,"extension.js-debug.revealPage":null,"extension.js-debug.startProfile":null,"extension.js-debug.stopProfile":null,"extension.js-debug.toggleSkippingFile":null,"extension.node-debug.startWithStopOnEntry":null,"extension.js-debug.requestCDPProxy":null,"extension.js-debug.openEdgeDevTools":null,"extension.js-debug.callers.add":null,"extension.js-debug.callers.goToCaller":null,"extension.js-debug.callers.gotToTarget":null,"extension.js-debug.callers.remove":null,"extension.js-debug.callers.removeAll":null,"extension.js-debug.enableSourceMapStepping":null,"extension.js-debug.disableSourceMapStepping":null,"extension.js-debug.network.viewRequest":null,"extension.js-debug.network.copyUri":null,"extension.js-debug.network.openBody":null,"extension.js-debug.network.openBodyInHex":null,"extension.js-debug.network.replayXHR":null,"extension.js-debug.network.clear":null,"extension.js-debug.completion.nodeTool":null},Cse=new Set(Object.keys(_5)),f_=new Set(Object.keys(S5)),ns=r=>f_.has(r);var sm="jsDebugNetworkFs",ce=(r,e,t)=>r.registerCommand(e,t),am=async(r,e,...t)=>await r.executeCommand(e,...t);var Ze=(r,e,t)=>r.getConfiguration(void 0,t).get(e),h_=(r,e,t,n)=>r.getConfiguration().update(e,t,n);var is=async(r,e,t)=>await r.executeCommand("setContext",e,t);var tk=require("os");var zn="node:",Kn="<node_internals>";var et=r=>!!r,eu=r=>cm(r,e=>e!==null),zE=r=>cm(r,e=>e!==void 0),ka=r=>e=>e instanceof r,tu=(r,e)=>{debugger;throw new Error(e.replace("{value}",JSON.stringify(r)))};function cm(r,e){let t={};for(let n of Object.keys(r)){let i=r[n];e(i,n)&&(t[n]=i)}return t}function go(r,e){let t={};for(let n of Object.keys(r)){let i=r[n];t[n]=e(i,n)}return t}function KE(r,e){let t={};for(let n of Object.keys(r))e(n,r[n])&&(t[n]=r[n]);return t}function JE(...r){if(r.length===0)return{};let e={},t=Object.create(null);for(let n of r)if(n)for(let i of Object.keys(n)){let o=i.toLowerCase();t[o]?e[t[o]]=n[i]:(t[o]=i,e[i]=n[i])}return e}function YE(r,e){if(r.hasOwnProperty(e))return r[e];let t=e.toLowerCase();for(let n of Object.keys(r))if(n.toLowerCase()===t)return r[n]}var m_=Symbol("unset");function ne(r){let e=m_,t=(...n)=>(e===m_&&(t.value=e=r(...n)),e);return t.forget=()=>{e=m_,t.value=void 0},t.value=void 0,t}function yo(r){let e=new Map,t=n=>{if(e.has(n))return e.get(n);let i=r(n);return e.set(n,i),i};return t.clear=()=>e.clear(),t}function XE(r){let e,t=n=>(e?.arg===n||(e={arg:n,val:r(n)}),e.val);return t.clear=()=>e=void 0,t}function QE(r,e){let t,n=()=>{t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,e()},r)};return n.clear=()=>{t&&(clearTimeout(t),t=void 0)},n}function ZE(r,e){let t,n=()=>{t===void 0&&(t=setTimeout(()=>{t=void 0,e()},r))};return n.queued=()=>!!t,n.clear=()=>{t&&(clearTimeout(t),t=void 0)},n}async function ek(r,e){let t=[],n=[];for(let i of r)await e(i)?t.push(i):n.push(i);return[t,n]}function bo(r){let e=[];for(let t of r)e=e.concat(t);return e}var I5=2**31-1,um=()=>{let r=0;return()=>r++&I5};var we=Symbol("AnyLaunchConfiguration"),xd={type:"",name:"",request:"",trace:!1,outputCapture:"console",timeout:1e4,timeouts:{},showAsyncStacks:!0,skipFiles:[],smartStep:!0,sourceMaps:!0,sourceMapRenames:!0,pauseForSourceMap:!0,resolveSourceMapLocations:null,rootPath:"${workspaceFolder}",outFiles:["${workspaceFolder}/**/*.(m|c|)js","!**/node_modules/**"],sourceMapPathOverrides:dm("${workspaceFolder}"),enableContentValidation:!0,cascadeTerminateToConfigurations:[],enableDWARF:!0,__workspaceFolder:"",__remoteFilePrefix:void 0,__breakOnConditionalError:!1,customDescriptionGenerator:void 0,customPropertiesGenerator:void 0},Cd={...xd,cwd:"${workspaceFolder}",env:{},envFile:null,pauseForSourceMap:!1,sourceMaps:!0,localRoot:null,remoteRoot:null,resolveSourceMapLocations:["**","!**/node_modules/**"],autoAttachChildProcesses:!0,runtimeSourcemapPausePatterns:[],skipFiles:[`${Kn}/**`]},lm={...Cd,showAsyncStacks:{onceBreakpointResolved:16},type:"node-terminal",request:"launch",name:"JavaScript Debug Terminal"},x5={...Cd,type:"node-terminal",request:"attach",name:lm.name,showAsyncStacks:{onceBreakpointResolved:16},delegateId:-1},Td={...Cd,type:"pwa-extensionHost",name:"Debug Extension",request:"launch",args:["--extensionDevelopmentPath=${workspaceFolder}"],outFiles:["${workspaceFolder}/out/**/*.js"],resolveSourceMapLocations:["${workspaceFolder}/**","!**/node_modules/**"],rendererDebugOptions:{},runtimeExecutable:"${execPath}",autoAttachChildProcesses:!1,debugWebviews:!1,debugWebWorkerHost:!1,__sessionId:""},C5={...Cd,type:"pwa-node",request:"launch",program:"",cwd:"${workspaceFolder}",stopOnEntry:!1,console:"internalConsole",restart:!1,args:[],runtimeExecutable:"node",runtimeVersion:"default",runtimeArgs:[],profileStartup:!1,attachSimplePort:null,experimentalNetworking:"auto",killBehavior:"forceful"},Pd={...xd,type:"pwa-chrome",request:"attach",address:"localhost",port:0,disableNetworkCache:!0,pathMapping:{},url:null,restart:!1,urlFilter:"",sourceMapPathOverrides:dm("${webRoot}"),webRoot:"${workspaceFolder}",server:null,browserAttachLocation:"workspace",targetSelection:"automatic",vueComponentPaths:["${workspaceFolder}/**/*.vue","!**/node_modules/**"],perScriptSourcemaps:"auto"},g_={...Pd,type:"pwa-msedge",useWebView:!1},pm={...Pd,type:"pwa-chrome",request:"launch",cwd:null,file:null,env:{},urlFilter:"*",includeDefaultArgs:!0,includeLaunchArgs:!0,runtimeArgs:null,runtimeExecutable:"*",userDataDir:!0,browserLaunchLocation:"workspace",profileStartup:!1,cleanUp:"wholeBrowser",killBehavior:"forceful"},y_={...pm,type:"pwa-msedge",useWebView:!1},rk={...xd,disableNetworkCache:!0,pathMapping:{},url:null,urlFilter:"",sourceMapPathOverrides:dm("${webRoot}"),webRoot:"${workspaceFolder}",server:null,vueComponentPaths:["${workspaceFolder}/**/*.vue","!**/node_modules/**"],perScriptSourcemaps:"auto"},b_={...rk,type:"pwa-editor-browser",request:"attach"},v_={...rk,type:"pwa-editor-browser",request:"launch",url:"http://localhost:8080"},w_={...Cd,type:"pwa-node",attachExistingChildren:!0,address:"localhost",port:9229,restart:!1,request:"attach",continueOnAttach:!1};function dm(r){return{"webpack:///./~/*":`${r}/node_modules/*`,"webpack:////*":"/*","webpack://@?:*/?:*/*":`${r}/*`,"webpack://?:*/*":`${r}/*`,"webpack:///([a-z]):/(.+)":"$1:/$2","meteor://\u{1F4BB}app/*":`${r}/*`,"turbopack://[project]/*":"${workspaceFolder}/*","turbopack:///[project]/*":"${workspaceFolder}/*"}}var fm=r=>{!r.sourceMapPathOverrides&&r.cwd&&(r.sourceMapPathOverrides=dm(r.cwd)),r.resolveSourceMapLocations===void 0&&(r.resolveSourceMapLocations=r.outFiles)};function S_({...r}){return fm(r),r.request==="attach"?{...w_,...r}:{...C5,...r}}function T5(r,e){return r.request==="attach"?{...Pd,browserAttachLocation:e,...r}:{...pm,browserLaunchLocation:e,...r}}function P5(r,e){return r.request==="attach"?{...g_,browserAttachLocation:e,...r}:{...y_,browserLaunchLocation:e,...r}}function E5(r){return r.request==="attach"?{...b_,...r}:{...v_,...r}}function k5(r){let e={...Td,...r};return e.skipFiles=[...e.skipFiles,"**/node_modules.asar/**","**/bootstrap-fork.js"],e}function __(r){return fm(r),r.request==="launch"?{...lm,...r}:{...x5,...r}}function os(r,e){let t,n=e==="remote"?"ui":"workspace";switch(r.type){case"pwa-node":t=S_(r);break;case"pwa-msedge":t=P5(r,n);break;case"pwa-chrome":t=T5(r,n);break;case"pwa-extensionHost":t=k5(r);break;case"node-terminal":t=__(r);break;case"pwa-editor-browser":t=E5(r);break;default:throw tu(r,"Unknown config: {value}")}return x_(t)}function I_(r){let e="${workspaceFolder}",t={...r,rootPath:void 0,outFiles:r.outFiles.filter(n=>!n.includes(e)),sourceMapPathOverrides:cm(r.sourceMapPathOverrides,n=>!n.includes("${workspaceFolder}"))};return"vueComponentPaths"in t&&(t.vueComponentPaths=t.vueComponentPaths.filter(n=>!n.includes(e))),"resolveSourceMapLocations"in t&&(t.resolveSourceMapLocations=t.resolveSourceMapLocations?.filter(n=>!n.includes(e))??null),"cwd"in t&&t.cwd?.includes(e)&&(t.cwd=t.request==="launch"&&t.type==="pwa-node"?(0,tk.homedir)():void 0),"webRoot"in t&&t.webRoot?.includes(e)&&(t.webRoot="/"),t}function x_(r){return r.__workspaceFolder||(r=I_(r)),r=di(r,"workspaceFolder",r.__workspaceFolder),r=di(r,"webRoot","webRoot"in r?r.webRoot:r.__workspaceFolder),r}function di(r,e,t){let n;if(typeof r=="string")n=r.replace(new RegExp(`\\$\\{${e}\\}`,"g"),()=>{if(!t)throw new Error(`Unable to resolve \${${e}} in configuration (${JSON.stringify(e)})`);return t});else if(r instanceof Array)n=r.map(i=>di(i,e,t));else if(typeof r=="object"&&r){let i={};for(let[o,s]of Object.entries(r))i[di(o,e,t)]=di(s,e,t);n=i}else n=r;return n}var hm=["javascript","typescript","typescriptreact","javascriptreact","fsharp","html","wat","c","cpp","rust","zig"],mm="js-debug",Ra="1.117.0",R5="ms-vscode",gm=mm.includes("nightly"),nk=`${R5}.${mm}`;var KS=b(F_()),uH=b(Um()),zS=require("fs"),JS=b(N()),xBe=b(xD());var rf=require("fs"),Nt=b(N()),iy=b(require("path"));var O=class{constructor(){this._listeners=new Set;this.event=(e,t,n)=>{let i={listener:e,thisArg:t};this._listeners.add(i);let o={dispose:()=>{o.dispose=()=>{},this._listeners.delete(i)}};return n&&n.push(o),o}}get size(){return this._listeners.size}fire(e){let t=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(let n of this._listeners)this._deliveryQueue.push({data:n,event:e});if(t){for(let n=0;n<this._deliveryQueue.length;n++){let{data:i,event:o}=this._deliveryQueue[n];i.listener.call(i.thisArg,o)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}},qd=class{constructor(){this.map=new Map;this.listeners=this.map}listen(e,t){let n=this.map.get(e);n||(n=new O,this.map.set(e,n));let i=n.event(t);return{dispose:ne(()=>{i.dispose(),n?.size===0&&this.map.delete(e)})}}emit(e,t){this.listeners.get(e)?.fire(t)}};var Ma=b(N()),$d=b(require("path"));var ED=require("crypto"),kD=b(Um()),RD=require("os"),Te=b(require("path"));var _o=b(require("fs")),CD=b(require("util"));async function Io({access:r},e){if(!e)return!1;try{return await r(e),!0}catch{return!1}}async function MI(r,e,t){try{await r.copyFile(e,t)}catch(n){try{if(await Io(r,t))await r.unlink(t),await r.copyFile(e,t);else throw n}catch{throw n}}}async function br({stat:r},e){if(e)try{return await r(e)}catch{return}}async function TD({lstat:r},e){if(e)try{return await r(e)}catch{return}}async function PD({copyFile:r,rename:e,unlink:t},n,i){try{await e(n,i)}catch{await r(n,i),await t(n)}}function wg(r){return new Promise(e=>{_o.readFile(r,"utf8",async(t,n)=>{e(t?"":n)})})}var kce=CD.promisify(_o.writeFile);var ur=Symbol("FsUtils"),Kr=class{constructor(e){this.fs=e}realPath(e){return this.fs.realpath(e)}async exists(e){try{return await this.fs.access(e,_o.constants.F_OK),!0}catch{return!1}}readFile(e){return this.fs.readFile(e)}},LI=class{constructor(e){this.dap=e}async realPath(){throw new Error("not implemented")}async exists(e){try{let{doesExists:t}=await this.dap.remoteFileExistsRequest({localFilePath:e});return t}catch{return!1}}readFile(){throw new Error("not implemented")}},vg=class{constructor(e,t,n){this.remoteFilePrefix=e;this.localFsUtils=t;this.remoteFsUtils=n}static create(e,t,n){let i=new Kr(t);return e!==void 0?new this(e.toLowerCase(),i,new LI(n)):i}async exists(e){return this.selectFs(e).exists(e)}async readFile(e){return this.selectFs(e).readFile(e)}async realPath(e){return this.selectFs(e).realPath(e)}selectFs(e){return e.toLowerCase().startsWith(this.remoteFilePrefix)?this.remoteFsUtils:this.localFsUtils}};var YK=process.platform==="win32"?"\\\\.\\pipe\\":(0,RD.tmpdir)(),XK=0,Sg=()=>Te.join(YK,`node-cdp.${process.pid}-${(0,ED.randomBytes)(4).toString("hex")}-${XK++}.sock`);function QK(r){return process.platform!=="win32"?[""]:r.lookup("PATHEXT")?.split(";")||[".exe"]}async function _g(r,e,t){let n;if(process.platform==="win32"){let i=t.WINDIR||"C:\\Windows";n=Te.join(i,"System32","where.exe")}else n="/usr/bin/which";try{if(await br(r,n)){let o=(await(0,kD.default)(n,[e],{env:eu(t)})).stdout.split(/\r?\n/);if(process.platform==="win32"){let s=String(t.PATHEXT||".exe").toUpperCase().split(";");for(let a of o){let c=Te.extname(a).toUpperCase();if(c&&s.includes(c))return a}}else if(o.length>0)return o[0];return}return e}catch{}}async function NI(r,e,t){if(e){if(process.platform==="win32"&&!Te.extname(e))for(let n of QK(t)){let i=e+n;if(await br(r,i))return i}if(await br(r,e))return e}}var AD=r=>r.includes(`.asar${Te.sep}`);function cs(...r){return Te.posix.isAbsolute(r[0])?je(Te.posix.join(...r)):Te.win32.isAbsolute(r[0])?Te.win32.join(...r):Te.join(...r)}function Jr(...r){return Te.posix.isAbsolute(r[0])?Te.posix.resolve(...r):Te.win32.isAbsolute(r[0])?Te.win32.resolve(...r):Te.resolve(...r)}function Vd(r,e){return Te.posix.isAbsolute(r)?Te.posix.relative(r,e):Te.win32.isAbsolute(r)?Te.win32.relative(r,e):Te.relative(r,e)}var ZK=/\/|\\/,Wd="file:///",DD=r=>r.startsWith(Wd)&&r[Wd.length+1]===":",FI=r=>r.split(ZK);function mu(r,e=!1){if(!r)return r;if(DD(r)){let t=Wd.length;r=Wd+r[t].toLowerCase()+r.substr(t+1)}else xg(r)&&(r=(e?r[0].toUpperCase():r[0].toLowerCase())+r.substr(1));return r}function st(r,e=!1){if(!r)return r;if(r=mu(r,e),DD(r)){let t=Wd.length;r=r.substr(0,t+1)+r.substr(t+1).replace(/\//g,"\\")}else xg(r)&&(r=r.replace(/\//g,"\\"));return r}function je(r){return r.replace(/\\\//g,"/").replace(/\\/g,"/")}var Ig=(r,e)=>{let t=Te.relative(r,e);return t.length&&!Te.isAbsolute(t)&&!t.startsWith("..")},gu=(r,e)=>{let t=Te.relative(r,e);return!Te.isAbsolute(t)&&!t.startsWith("..")},BI=r=>r.startsWith("\\\\"),xg=r=>/^[A-Za-z]:/.test(r)||BI(r);var yu=class{get empty(){return this.patterns.length===0}constructor({rootPath:e,patterns:t}){!e||!t?(this.rootPath="",this.patterns=[]):(this.rootPath=e,this.patterns=t.map(n=>{let i=n.startsWith("!");return{negated:i,pattern:n.slice(i?1:0)}}))}*explode(){for(let e=0;e<this.patterns.length;e++){let{negated:t,pattern:n}=this.patterns[e];if(t)continue;let i=$d.resolve(this.rootPath,n).split(/[\\/]/g),o=i.findIndex(c=>c.includes("*"));if(o===-1){yield{cwd:i.slice(0,-1).join("/"),pattern:i[i.length-1],negations:[]};continue}let s=i.slice(0,o).join("/"),a=[];for(let c=e+1;c<this.patterns.length;c++){let{negated:u,pattern:l}=this.patterns[c];if(u)if(l.startsWith("**"))a.push(je(l));else{let p=$d.relative(s,$d.resolve(this.rootPath,l));p.startsWith("..")||a.push(je(p))}}yield{cwd:s,negations:a,pattern:i.slice(o).join("/")}}}};yu=S([(0,Ma.injectable)()],yu);var Ri=class extends yu{constructor({rootPath:e,outFiles:t}){super({rootPath:e,patterns:t})}};Ri=S([(0,Ma.injectable)(),g(0,(0,Ma.inject)(we))],Ri);var xo=class extends yu{constructor(e){super({rootPath:e.rootPath,patterns:"vueComponentPaths"in e?e.vueComponentPaths:[]})}};xo=S([(0,Ma.injectable)(),g(0,(0,Ma.inject)(we))],xo);var LD=require("crypto"),MD=require("os"),ND=b(require("path"));var Tg=require("fs"),OD=require("path"),t9=(r,e)=>e instanceof Error?{message:e.message,stack:e.stack}:typeof e=="bigint"?e.toString():e,Cg=class{constructor(e,t){this.file=e;this.dap=t;try{(0,Tg.mkdirSync)((0,OD.dirname)(e),{recursive:!0})}catch{}this.stream=(0,Tg.createWriteStream)(e)}async setup(){this.dap?.output({category:"console",output:`Verbose logs are written to:
${this.file}
`})}dispose(){this.stream&&(this.stream.end(),this.stream=void 0)}write(e){this.stream&&this.stream.write(JSON.stringify(e,t9)+`
`)}};var r9={runtime:null,"runtime.sourcecreate":null,"runtime.assertion":null,"runtime.launch":null,"runtime.target":null,"runtime.welcome":null,"runtime.exception":null,"runtime.sourcemap":null,"runtime.breakpoints":null,"sourcemap.parsing":null,"perf.function":null,"cdp.send":null,"cdp.receive":null,"dap.send":null,"dap.receive":null,internal:null,proxyActivity:null},jce=Object.keys(r9),$=Symbol("ILogger");function jI(r,e=(0,MD.tmpdir)()){if(r===!1)return{stdio:!1,logFile:null};let t={stdio:!0,logFile:ND.join(e,`vscode-debugadapter-${(0,LD.randomBytes)(4).toString("hex")}.json`)};return r===!0?t:{...t,...r}}function FD(r,e){let t=jI(e),n={sinks:[]};return t.logFile&&n.sinks.push(new Cg(t.logFile,r)),n}var n9=44;var BD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i9=new Uint8Array(64),UD=new Uint8Array(128);for(let r=0;r<BD.length;r++){let e=BD.charCodeAt(r);i9[r]=e,UD[e]=r}function Hd(r,e){let t=0,n=0,i=0;do{let s=r.next();i=UD[s],t|=(i&31)<<n,n+=5}while(i&32);let o=t&1;return t>>>=1,o&&(t=-2147483648|-t),e+t}function jD(r,e){return r.pos>=e?!1:r.peek()!==n9}var qce=1024*16;var o9=class{constructor(r){this.pos=0,this.buffer=r}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(r){let{buffer:e,pos:t}=this,n=e.indexOf(r,t);return n===-1?e.length:n}};function qD(r){let{length:e}=r,t=new o9(r),n=[],i=0,o=0,s=0,a=0,c=0;do{let u=t.indexOf(";"),l=[],p=!0,d=0;for(i=0;t.pos<u;){let f;i=Hd(t,i),i<d&&(p=!1),d=i,jD(t,u)?(o=Hd(t,o),s=Hd(t,s),a=Hd(t,a),jD(t,u)?(c=Hd(t,c),f=[i,o,s,a,c]):f=[i,o,s,a]):f=[i],l.push(f),t.pos++}p||s9(l),n.push(l),t.pos=u+1}while(t.pos<=e);return n}function s9(r){r.sort(a9)}function a9(r,e){return r[0]-e[0]}var c9=/^[\w+.-]+:\/\//,u9=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,l9=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i,gt;(function(r){r[r.Empty=1]="Empty",r[r.Hash=2]="Hash",r[r.Query=3]="Query",r[r.RelativePath=4]="RelativePath",r[r.AbsolutePath=5]="AbsolutePath",r[r.SchemeRelative=6]="SchemeRelative",r[r.Absolute=7]="Absolute"})(gt||(gt={}));function p9(r){return c9.test(r)}function d9(r){return r.startsWith("//")}function $D(r){return r.startsWith("/")}function f9(r){return r.startsWith("file:")}function WD(r){return/^[.?#]/.test(r)}function Pg(r){let e=u9.exec(r);return HD(e[1],e[2]||"",e[3],e[4]||"",e[5]||"/",e[6]||"",e[7]||"")}function h9(r){let e=l9.exec(r),t=e[2];return HD("file:","",e[1]||"","",$D(t)?t:"/"+t,e[3]||"",e[4]||"")}function HD(r,e,t,n,i,o,s){return{scheme:r,user:e,host:t,port:n,path:i,query:o,hash:s,type:gt.Absolute}}function VD(r){if(d9(r)){let t=Pg("http:"+r);return t.scheme="",t.type=gt.SchemeRelative,t}if($D(r)){let t=Pg("http://foo.com"+r);return t.scheme="",t.host="",t.type=gt.AbsolutePath,t}if(f9(r))return h9(r);if(p9(r))return Pg(r);let e=Pg("http://foo.com/"+r);return e.scheme="",e.host="",e.type=r?r.startsWith("?")?gt.Query:r.startsWith("#")?gt.Hash:gt.RelativePath:gt.Empty,e}function m9(r){if(r.endsWith("/.."))return r;let e=r.lastIndexOf("/");return r.slice(0,e+1)}function g9(r,e){GD(e,e.type),r.path==="/"?r.path=e.path:r.path=m9(e.path)+r.path}function GD(r,e){let t=e<=gt.RelativePath,n=r.path.split("/"),i=1,o=0,s=!1;for(let c=1;c<n.length;c++){let u=n[c];if(!u){s=!0;continue}if(s=!1,u!=="."){if(u===".."){o?(s=!0,o--,i--):t&&(n[i++]=u);continue}n[i++]=u,o++}}let a="";for(let c=1;c<i;c++)a+="/"+n[c];(!a||s&&!a.endsWith("/.."))&&(a+="/"),r.path=a}function zD(r,e){if(!r&&!e)return"";let t=VD(r),n=t.type;if(e&&n!==gt.Absolute){let o=VD(e),s=o.type;switch(n){case gt.Empty:t.hash=o.hash;case gt.Hash:t.query=o.query;case gt.Query:case gt.RelativePath:g9(t,o);case gt.AbsolutePath:t.user=o.user,t.host=o.host,t.port=o.port;case gt.SchemeRelative:t.scheme=o.scheme}s>n&&(n=s)}GD(t,n);let i=t.query+t.hash;switch(n){case gt.Hash:case gt.Query:return i;case gt.RelativePath:{let o=t.path.slice(1);return o?WD(e||r)&&!WD(o)?"./"+o+i:o+i:i||"."}case gt.AbsolutePath:return t.path+i;default:return t.scheme+"//"+t.user+t.host+t.port+t.path+i}}function b9(r){if(!r)return"";let e=r.lastIndexOf("/");return r.slice(0,e+1)}function v9(r,e){let t=b9(r),n=e?e+"/":"";return i=>zD(n+(i||""),t)}var Xn=0,qI=1,WI=2,VI=3,JD=4,YD=1,XD=2;function w9(r,e){let t=KD(r,0);if(t===r.length)return r;e||(r=r.slice());for(let n=t;n<r.length;n=KD(r,n+1))r[n]=_9(r[n],e);return r}function KD(r,e){for(let t=e;t<r.length;t++)if(!S9(r[t]))return t;return r.length}function S9(r){for(let e=1;e<r.length;e++)if(r[e][Xn]<r[e-1][Xn])return!1;return!0}function _9(r,e){return e||(r=r.slice()),r.sort(QD)}function QD(r,e){return r[Xn]-e[Xn]}function I9(r,e){let t=e.map(()=>[]);for(let n=0;n<r.length;n++){let i=r[n];for(let o=0;o<i.length;o++){let s=i[o];if(s.length===1)continue;let a=s[qI],c=s[WI],u=s[VI],l=t[a];(l[c]||(l[c]=[])).push([u,n,s[Xn]])}}for(let n=0;n<t.length;n++){let i=t[n];for(let o=0;o<i.length;o++){let s=i[o];s&&s.sort(QD)}}return t}var Na=!1;function x9(r,e,t,n){for(;t<=n;){let i=t+(n-t>>1),o=r[i][Xn]-e;if(o===0)return Na=!0,i;o<0?t=i+1:n=i-1}return Na=!1,t-1}function ZD(r,e,t){for(let n=t+1;n<r.length&&r[n][Xn]===e;t=n++);return t}function e1(r,e,t){for(let n=t-1;n>=0&&r[n][Xn]===e;t=n--);return t}function t1(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function C9(r,e,t,n){let{lastKey:i,lastNeedle:o,lastIndex:s}=t,a=0,c=r.length-1;if(n===i){if(e===o)return Na=s!==-1&&r[s][Xn]===e,s;e>=o?a=s===-1?0:s:c=s}return t.lastKey=n,t.lastNeedle=e,t.lastIndex=x9(r,e,a,c)}function $I(r){return typeof r=="string"?JSON.parse(r):r}var kg=function(r,e){let t=$I(r);if(!("sections"in t))return new Rg(t,e);let n=[],i=[],o=[],s=[],a=[];r1(t,e,n,i,o,s,a,0,0,1/0,1/0);let c={version:3,file:t.file,names:s,sources:i,sourcesContent:o,mappings:n,ignoreList:a};return E9(c)};function r1(r,e,t,n,i,o,s,a,c,u,l){let{sections:p}=r;for(let d=0;d<p.length;d++){let{map:f,offset:h}=p[d],m=u,y=l;if(d+1<p.length){let I=p[d+1].offset;m=Math.min(u,a+I.line),m===u?y=Math.min(l,c+I.column):m<u&&(y=c+I.column)}T9(f,e,t,n,i,o,s,a+h.line,c+h.column,m,y)}}function T9(r,e,t,n,i,o,s,a,c,u,l){let p=$I(r);if("sections"in p)return r1(...arguments);let d=new Rg(p,e),f=n.length,h=o.length,m=Fa(d),{resolvedSources:y,sourcesContent:I,ignoreList:L}=d;if(UI(n,y),UI(o,d.names),I)UI(i,I);else for(let P=0;P<y.length;P++)i.push(null);if(L)for(let P=0;P<L.length;P++)s.push(L[P]+f);for(let P=0;P<m.length;P++){let W=a+P;if(W>u)return;let E=P9(t,W),M=P===0?c:0,k=m[P];for(let j=0;j<k.length;j++){let Z=k[j],he=M+Z[Xn];if(W===u&&he>=l)return;if(Z.length===1){E.push([he]);continue}let A=f+Z[qI],Se=Z[WI],ge=Z[VI];E.push(Z.length===4?[he,A,Se,ge]:[he,A,Se,ge,h+Z[JD]])}}}function UI(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}function P9(r,e){for(let t=r.length;t<=e;t++)r[t]=[];return r[e]}var n1="`line` must be greater than 0 (lines start at line 1)",i1="`column` must be greater than or equal to 0 (columns start at column 0)",bu=-1,Co=1,Rg=class{constructor(r,e){let t=typeof r=="string";if(!t&&r._decodedMemo)return r;let n=$I(r),{version:i,file:o,names:s,sourceRoot:a,sources:c,sourcesContent:u}=n;this.version=i,this.file=o,this.names=s||[],this.sourceRoot=a,this.sources=c,this.sourcesContent=u,this.ignoreList=n.ignoreList||n.x_google_ignoreList||void 0;let l=v9(e,a);this.resolvedSources=c.map(l);let{mappings:p}=n;if(typeof p=="string")this._encoded=p,this._decoded=void 0;else if(Array.isArray(p))this._encoded=void 0,this._decoded=w9(p,t);else throw n.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(n)}`);this._decodedMemo=t1(),this._bySources=void 0,this._bySourceMemos=void 0}};function Fa(r){var e;return(e=r)._decoded||(e._decoded=qD(r._encoded))}function o1(r,e){let{line:t,column:n,bias:i}=e;if(t--,t<0)throw new Error(n1);if(n<0)throw new Error(i1);let o=Fa(r);if(t>=o.length)return Eg(null,null,null,null);let s=o[t],a=HI(s,r._decodedMemo,t,n,i||Co);if(a===-1)return Eg(null,null,null,null);let c=s[a];if(c.length===1)return Eg(null,null,null,null);let{names:u,resolvedSources:l}=r;return Eg(l[c[qI]],c[WI]+1,c[VI],c.length===5?u[c[JD]]:null)}function s1(r,e){let{source:t,line:n,column:i,bias:o}=e;return u1(r,t,n,i,o||Co,!1)}function a1(r,e){let{source:t,line:n,column:i,bias:o}=e;return u1(r,t,n,i,o||bu,!0)}function c1(r,e){let t=Fa(r),{names:n,resolvedSources:i}=r;for(let o=0;o<t.length;o++){let s=t[o];for(let a=0;a<s.length;a++){let c=s[a],u=o+1,l=c[0],p=null,d=null,f=null,h=null;c.length!==1&&(p=i[c[1]],d=c[2]+1,f=c[3]),c.length===5&&(h=n[c[4]]),e({generatedLine:u,generatedColumn:l,source:p,originalLine:d,originalColumn:f,name:h})}}}function E9(r,e){let t=new Rg(k9(r,[]),e);return t._decoded=r.mappings,t}function k9(r,e){return{version:r.version,file:r.file,names:r.names,sourceRoot:r.sourceRoot,sources:r.sources,sourcesContent:r.sourcesContent,mappings:e,ignoreList:r.ignoreList||r.x_google_ignoreList}}function Eg(r,e,t,n){return{source:r,line:e,column:t,name:n}}function Gd(r,e){return{line:r,column:e}}function HI(r,e,t,n,i){let o=C9(r,n,e,t);return Na?o=(i===bu?ZD:e1)(r,n,o):i===bu&&o++,o===-1||o===r.length?-1:o}function R9(r,e,t,n,i){let o=HI(r,e,t,n,Co);if(!Na&&i===bu&&o++,o===-1||o===r.length)return[];let s=Na?n:r[o][Xn];Na||(o=e1(r,s,o));let a=ZD(r,s,o),c=[];for(;o<=a;o++){let u=r[o];c.push(Gd(u[YD]+1,u[XD]))}return c}function u1(r,e,t,n,i,o){var s,a;if(t--,t<0)throw new Error(n1);if(n<0)throw new Error(i1);let{sources:c,resolvedSources:u}=r,l=c.indexOf(e);if(l===-1&&(l=u.indexOf(e)),l===-1)return o?[]:Gd(null,null);let p=(s=r)._bySourceMemos||(s._bySourceMemos=c.map(t1)),f=((a=r)._bySources||(a._bySources=I9(Fa(r),p)))[l][t];if(f==null)return o?[]:Gd(null,null);let h=p[l];if(o)return R9(f,h,t,n,i);let m=HI(f,h,t,n,i);if(m===-1)return Gd(null,null);let y=f[m];return Gd(y[YD]+1,y[XD])}var ji=b(N());var Ag=class extends Error{constructor(t,n,i){super(`Unexpected ${t} response from ${n}: ${i??"<empty body>"}`);this.statusCode=t;this.url=n;this.body=i}},Ba=Symbol("IResourceProvider");var le=r=>isFinite(r)?new Promise(e=>setTimeout(e,r)):new Promise(()=>{}),l1=(r,e)=>{let t=setTimeout(r,e);return{dispose:()=>clearTimeout(t)}};function Ai(r){return new Promise((e,t)=>{let n=r.length;for(let i of r)i.then(o=>{o?(e(o),n=-1):--n===0&&e(void 0)}).catch(t)})}async function p1(r,e){for(let t=0;t<r.length;t++)if(await e(r[t]))return t;return-1}function ke(){let r=null,e=null,t=!1,n,i=new Promise((o,s)=>{r=a=>{t=!0,n=a,o(a)},e=a=>{t=!0,s(a)}});return{resolve:r,reject:e,promise:i,get settledValue(){return n},hasSettled:()=>t}}var Ue=b(ie());var F=class extends Error{get cause(){return this._cause}constructor(e){super("__errorMarker"in e?e.error.format:e.format),this._cause="__errorMarker"in e?e.error:e}};function d1(r,e){r.output({category:"console",output:e+`
`})}function Me(r,e=9222){return{__errorMarker:!0,error:{id:e,format:r,showUser:!1}}}function Ne(r,e=9223){return{__errorMarker:!0,error:{id:e,format:r,showUser:!0}}}var GI=()=>Ne(Ue.t("Attribute 'runtimeVersion' requires Node.js version manager 'nvs', 'nvm' or 'fnm' to be installed."),9224),f1=()=>Ne(Ue.t("Attribute 'runtimeVersion' with a flavor/architecture requires 'nvs' to be installed."),9225),h1=()=>Ne(Ue.t("Attribute 'runtimeVersion' requires Node.js version manager 'nvm-windows' or 'nvs'."),9226),zI=(r,e)=>Ne(Ue.t("Node.js version '{0}' not installed using version manager {1}.",r,e),9226),m1=r=>Ne(Ue.t("Cannot launch debug target in terminal ({0}).",r),9227),g1=r=>Ne(Ue.t("Can't load environment variables from file ({0}).",r),9228),y1=r=>Ne(Ue.t("The configured `cwd` {0} does not exist.",r),9245),KI=(r,e)=>Ne(Ue.t(`Can't find Node.js binary "{0}": {1}. Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json`,r,e),9229),b1=(r,e)=>Ne(Ue.t('The Node version in "{0}" is outdated (version {1}), we require at least Node 8.x.',e,r),9230),JI=r=>Ne(Ue.t('Invalid hit condition "{0}". Expected an expression like "> 42" or "== 2".',r),9231),vu=()=>Ne(Ue.t("An error occurred taking a profile from the target."),9235),v1=()=>Ne(Ue.t("Please stop the running profile before starting a new one."),9236),w1=r=>Me(r,9238),Dg=(r,e,t)=>Ne(e==="*"&&!t.length?Ue.t('Unable to find an installation of the browser on your system. Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json.'):Ue.t('Unable to find {0} version {1}. Available auto-discovered versions are: {2}. You can set the "runtimeExecutable" in your launch.json to one of these, or provide an absolute path to the browser executable.',r,e,JSON.stringify([...new Set(t)])),9233),us=r=>Ne(Ue.t('Unable to launch browser: "{0}"',r.message),9240),Di=r=>Ne(r??Ue.t("Unable to attach to browser"),9242),Og=()=>Ne(Ue.t('Target page not found. You may need to update your "urlFilter" to match the page you want to debug.'),9241);var S1=()=>Me(Ue.t("Variables not available in async stacks"),9234),ls=(r,e)=>Ne(Ue.t("Syntax error setting breakpoint with condition {0} on line {1}: {2}",JSON.stringify(r.condition),r.line,e),9237),YI=()=>Me(Ue.t("Thread not found"),9244),Lg=(r,e)=>Ne(Ue.t("Could not read source map for {0}: {1}",r,e)),_1=()=>Ne(Ue.t("UWP webview debugging is not available on your platform.")),I1=()=>Ne(Ue.t("Networking not available.")),x1=()=>Ne(Ue.t("Could not connect to any UWP Webview pipe. Make sure your webview is hosted in debug mode, and that the `pipeName` in your `launch.json` is correct.")),zd=()=>Ne(Ue.t("Could not find a location for the variable")),C1=()=>Me(Ue.t('Missing source information. Did you set "originalUrl" or "source"?')),T1=r=>typeof r=="object"&&!!r&&"__errorMarker"in r,P1=(r,e)=>r instanceof F&&r.cause.id===e,E1=r=>Ne(Ue.t("The browser process exited with code {0} before connecting to the debug server. Make sure the `runtimeExecutable` is configured correctly and that it can run without errors.",r));var k1=new WeakSet;var A9="Request",D9=r=>r.endsWith("Request"),kr=Symbol("IDapApi"),Su=Symbol("IRootDapApi"),wu=class{constructor(e,t){this.transport=e;this.logger=t;this._pendingRequests=new Map;this._requestHandlers=new Map;this._eventListeners=new Map;this.disposables=[];this._initialized=ke();this.closed=!1;this._sequence=1,this.disposables.push(this.transport.messageReceived(n=>this._onMessage(n.message,n.receivedTime))),this._dap=this._createApi()}get initializedBlocker(){return this._initialized.promise}attachTelemetry(e){this.telemetryReporter=e,e.attachDap(this._dap)}dap(){return this._dap}_createApi(){return new Proxy({},{get:(e,t)=>{if(t!=="then")return t==="on"?(n,i)=>(this._requestHandlers.set(n,i),()=>this._requestHandlers.delete(n)):t==="off"?n=>this._requestHandlers.delete(n):n=>{if(D9(t))return this.enqueueRequest(t.slice(0,-A9.length),n);this._send({seq:0,type:"event",event:t,body:n})}}})}createTestApi(){let e=(i,o)=>{let s=this._eventListeners.get(i);s||(s=new Set,this._eventListeners.set(i,s)),s.add(o)},t=(i,o)=>{let s=this._eventListeners.get(i);s&&s.delete(o)},n=(i,o)=>new Promise(s=>{let a=c=>{o&&!o(c)||(t(i,a),s(c))};e(i,a)});return new Proxy({},{get:(i,o)=>o==="on"?e:o==="off"?t:o==="once"?n:s=>this.enqueueRequest(o,s)})}enqueueRequest(e,t){return new Promise(n=>{let i={seq:0,type:"request",command:e,arguments:t||{}};this._send(i),this._pendingRequests.set(i.seq,n)})}stop(){this.closed=!0,this.transport.close()}_send(e,t){if(this.closed)this.logger.warn("dap.send","Not sending message because the connection has ended",e),t?.();else{e.seq=this._sequence++;let n=e.type!=="event"||!k1.has(e.body);this.transport.send(e,n,t)}}async _onMessage(e,t){if(e.type==="request"){let n={seq:0,type:"response",request_seq:e.seq,command:e.command,success:!0};try{let i=this._requestHandlers.get(e.command);if(!i)console.error(`Unknown request: ${e.command}`);else{let o=await i(e.arguments);if(T1(o))this._send({...n,success:!1,message:o.error.format,body:{error:o.error}});else{let s={...n,body:o};n.command==="initialize"?(this._send(s),this._initialized.resolve(this)):n.command==="disconnect"?this._send({...n,body:o},()=>{this.stop()}):this._send(s)}}this.telemetryReporter?.reportOperation("dapOperation",e.command,t.elapsed().ms)}catch(i){i instanceof F?this._send({...n,success:!1,body:{error:i.cause}}):(console.error(i),this._send({...n,success:!1,body:{error:{id:9221,format:`Error processing ${e.command}: ${i.stack||i.message}`,showUser:!1,sendTelemetry:!1}}})),this.telemetryReporter?.reportOperation("dapOperation",e.command,t.elapsed().ms,i)}}if(e.type==="event"){let n=this._eventListeners.get(e.event)||new Set;for(let i of n)i(e.body)}if(e.type==="response"){let n=this._pendingRequests.get(e.request_seq);if(!this.logger.assert(n,`Expected callback for request sequence ID ${e.request_seq}`))return;if(this._pendingRequests.delete(e.request_seq),e.success)n(e.body);else{let i=e.body?.error?.format;n(i||e.message||"Unknown error")}}}};var Ng=class{constructor(e,t){this.key=e;this.value=t}toString(){return`${this.key}: ${this.value}`}},Oi=class{constructor(e,t){this.projection=e;this.initialContents=t;let n=Array.from(t||[]).map(i=>[this.projection(i[0]),new Ng(i[0],i[1])]);this.projectionToKeyAndValue=new Map(n)}clear(){this.projectionToKeyAndValue.clear()}delete(e){let t=this.projection(e);return this.projectionToKeyAndValue.delete(t)}forEach(e,t){this.projectionToKeyAndValue.forEach(n=>{e.call(t,n.value,n.key,this)},t)}get(e){let t=this.projection(e),n=this.projectionToKeyAndValue.get(t);return n?n.value:void 0}has(e){return this.projectionToKeyAndValue.has(this.projection(e))}set(e,t){return this.projectionToKeyAndValue.set(this.projection(e),new Ng(e,t)),this}get size(){return this.projectionToKeyAndValue.size}*entries(){for(let e of this.projectionToKeyAndValue.values())yield[e.key,e.value]}*keys(){for(let e of this.projectionToKeyAndValue.values())yield e.key}*values(){for(let e of this.projectionToKeyAndValue.values())yield e.value}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return JSON.stringify(Array.from(this.entries()))}toString(){return`MapUsingProjection<${JSON.stringify([...this.entries()])}>`}};var Re=Symbol("ISourcePathResolver");var uO=require("dns"),Xr=b(require("path")),Fi=require("url");var rO=require("url");var Z1=require("./vendor/acorn.js"),eO=require("crypto");var Ke=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return this}get base1(){return new tt(this.lineNumber+1,this.columnNumber+1)}get base01(){return new Rr(this.lineNumber,this.columnNumber+1)}compare(e){let t=e.base0;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber}},tt=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return new Ke(this.lineNumber-1,this.columnNumber-1)}get base1(){return this}get base01(){return new Rr(this.lineNumber-1,this.columnNumber)}compare(e){let t=e.base1;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber||0}},Rr=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return new Ke(this.lineNumber-1,this.columnNumber)}get base1(){return new tt(this.lineNumber,this.columnNumber+1)}get base01(){return this}compare(e){let t=e.base01;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber}},lr=class r{constructor(e,t){this.begin=e;this.end=t}static{this.ZERO=new r(new Ke(0,0),new Ke(0,0))}static{this.INFINITE=new r(new Ke(0,0),new Ke(1/0,1/0))}static simplify(e){if(e.length===0)return[];let t=e.slice().sort((o,s)=>o.begin.compare(s.begin)),n=[],i=t[0];for(let o=1;o<t.length;o++){let s=t[o];i.end.compare(s.begin)>=0?i=new r(i.begin,s.end):(n.push(i),i=s)}return n.push(i),n}contains(e){return e.compare(this.begin)>=0&&e.compare(this.end)<=0}containsRange(e){return this.contains(e.begin)&&this.contains(e.end)}toString(){let e=this.begin.base0,t=this.end.base0;return`Range[${e.lineNumber}:${e.columnNumber} -> ${t.lineNumber}:${t.columnNumber}]`}};var XI=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function O9(r,e){return r._indexes[e]}function QI(r,e){let t=O9(r,e);if(t!==void 0)return t;let{array:n,_indexes:i}=r,o=n.push(e);return i[e]=o-1}var L9=0,M9=1,N9=2,F9=3,B9=4,A1=-1,D1=class{constructor({file:r,sourceRoot:e}={}){this._names=new XI,this._sources=new XI,this._sourcesContent=[],this._mappings=[],this.file=r,this.sourceRoot=e,this._ignoreList=new XI}};function O1(r,e,t,n,i,o,s,a){return j9(!1,r,e,t,n,i,o,s,a)}function L1(r,e,t){let{_sources:n,_sourcesContent:i}=r,o=QI(n,e);i[o]=t}function M1(r){let{_mappings:e,_sources:t,_sourcesContent:n,_names:i,_ignoreList:o}=r;return W9(e),{version:3,file:r.file||void 0,names:i.array,sourceRoot:r.sourceRoot||void 0,sources:t.array,sourcesContent:n,mappings:e,ignoreList:o.array}}function j9(r,e,t,n,i,o,s,a,c){let{_mappings:u,_sources:l,_sourcesContent:p,_names:d}=e,f=U9(u,t),h=q9(f,n);if(!i)return r&&V9(f,h)?void 0:R1(f,h,[n]);let m=QI(l,i),y=a?QI(d,a):A1;if(m===p.length&&(p[m]=c??null),!(r&&$9(f,h,m,o,s,y)))return R1(f,h,a?[n,m,o,s,y]:[n,m,o,s])}function U9(r,e){for(let t=r.length;t<=e;t++)r[t]=[];return r[e]}function q9(r,e){let t=r.length;for(let n=t-1;n>=0;t=n--){let i=r[n];if(e>=i[L9])break}return t}function R1(r,e,t){for(let n=r.length;n>e;n--)r[n]=r[n-1];r[e]=t}function W9(r){let{length:e}=r,t=e;for(let n=t-1;n>=0&&!(r[n].length>0);t=n,n--);t<e&&(r.length=t)}function V9(r,e){return e===0?!0:r[e-1].length===1}function $9(r,e,t,n,i,o){if(e===0)return!1;let s=r[e-1];return s.length===1?!1:t===s[M9]&&n===s[N9]&&i===s[F9]&&o===(s.length===5?s[B9]:A1)}var $g=require("./vendor/acorn.js");var{stringify:G9}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var Fg={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},Qn=17,z9={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:Qn,ClassExpression:Qn,FunctionExpression:Qn,ObjectExpression:Qn,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function _u(r,e){let{generator:t}=r;if(r.write("("),e!=null&&e.length>0){t[e[0].type](e[0],r);let{length:n}=e;for(let i=1;i<n;i++){let o=e[i];r.write(", "),t[o.type](o,r)}}r.write(")")}function W1(r,e,t,n){let i=r.expressionsPrecedence[e.type];if(i===Qn)return!0;let o=r.expressionsPrecedence[t.type];return i!==o?!n&&i===15&&o===14&&t.operator==="**"||i<o:i!==13&&i!==14?!1:e.operator==="**"&&t.operator==="**"?!n:i===13&&o===13&&(e.operator==="??"||t.operator==="??")?!0:n?Fg[e.operator]<=Fg[t.operator]:Fg[e.operator]<Fg[t.operator]}function Bg(r,e,t,n){let{generator:i}=r;W1(r,e,t,n)?(r.write("("),i[e.type](e,r),r.write(")")):i[e.type](e,r)}function K9(r,e,t,n){let i=e.split(`
`),o=i.length-1;if(r.write(i[0].trim()),o>0){r.write(n);for(let s=1;s<o;s++)r.write(t+i[s].trim()+n);r.write(t+i[o].trim())}}function vr(r,e,t,n){let{length:i}=e;for(let o=0;o<i;o++){let s=e[o];r.write(t),s.type[0]==="L"?r.write("// "+s.value.trim()+`
`,s):(r.write("/*"),K9(r,s.value,t,n),r.write("*/"+n))}}function J9(r){let e=r;for(;e!=null;){let{type:t}=e;if(t[0]==="C"&&t[1]==="a")return!0;if(t[0]==="M"&&t[1]==="e"&&t[2]==="m")e=e.object;else return!1}}function ZI(r,e){let{generator:t}=r,{declarations:n}=e;r.write(e.kind+" ");let{length:i}=n;if(i>0){t.VariableDeclarator(n[0],r);for(let o=1;o<i;o++)r.write(", "),t.VariableDeclarator(n[o],r)}}var N1,F1,B1,j1,U1,q1,Y9={Program(r,e){let t=e.indent.repeat(e.indentLevel),{lineEnd:n,writeComments:i}=e;i&&r.comments!=null&&vr(e,r.comments,t,n);let o=r.body,{length:s}=o;for(let a=0;a<s;a++){let c=o[a];i&&c.comments!=null&&vr(e,c.comments,t,n),e.write(t),this[c.type](c,e),e.write(n)}i&&r.trailingComments!=null&&vr(e,r.trailingComments,t,n)},BlockStatement:q1=function(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e,o=t+e.indent;e.write("{");let s=r.body;if(s!=null&&s.length>0){e.write(n),i&&r.comments!=null&&vr(e,r.comments,o,n);let{length:a}=s;for(let c=0;c<a;c++){let u=s[c];i&&u.comments!=null&&vr(e,u.comments,o,n),e.write(o),this[u.type](u,e),e.write(n)}e.write(t)}else i&&r.comments!=null&&(e.write(n),vr(e,r.comments,o,n),e.write(t));i&&r.trailingComments!=null&&vr(e,r.trailingComments,o,n),e.write("}"),e.indentLevel--},ClassBody:q1,StaticBlock(r,e){e.write("static "),this.BlockStatement(r,e)},EmptyStatement(r,e){e.write(";")},ExpressionStatement(r,e){let t=e.expressionsPrecedence[r.expression.type];t===Qn||t===3&&r.expression.left.type[0]==="O"?(e.write("("),this[r.expression.type](r.expression,e),e.write(")")):this[r.expression.type](r.expression,e),e.write(";")},IfStatement(r,e){e.write("if ("),this[r.test.type](r.test,e),e.write(") "),this[r.consequent.type](r.consequent,e),r.alternate!=null&&(e.write(" else "),this[r.alternate.type](r.alternate,e))},LabeledStatement(r,e){this[r.label.type](r.label,e),e.write(": "),this[r.body.type](r.body,e)},BreakStatement(r,e){e.write("break"),r.label!=null&&(e.write(" "),this[r.label.type](r.label,e)),e.write(";")},ContinueStatement(r,e){e.write("continue"),r.label!=null&&(e.write(" "),this[r.label.type](r.label,e)),e.write(";")},WithStatement(r,e){e.write("with ("),this[r.object.type](r.object,e),e.write(") "),this[r.body.type](r.body,e)},SwitchStatement(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e;e.indentLevel++;let o=t+e.indent,s=o+e.indent;e.write("switch ("),this[r.discriminant.type](r.discriminant,e),e.write(") {"+n);let{cases:a}=r,{length:c}=a;for(let u=0;u<c;u++){let l=a[u];i&&l.comments!=null&&vr(e,l.comments,o,n),l.test?(e.write(o+"case "),this[l.test.type](l.test,e),e.write(":"+n)):e.write(o+"default:"+n);let{consequent:p}=l,{length:d}=p;for(let f=0;f<d;f++){let h=p[f];i&&h.comments!=null&&vr(e,h.comments,s,n),e.write(s),this[h.type](h,e),e.write(n)}}e.indentLevel-=2,e.write(t+"}")},ReturnStatement(r,e){e.write("return"),r.argument&&(e.write(" "),this[r.argument.type](r.argument,e)),e.write(";")},ThrowStatement(r,e){e.write("throw "),this[r.argument.type](r.argument,e),e.write(";")},TryStatement(r,e){if(e.write("try "),this[r.block.type](r.block,e),r.handler){let{handler:t}=r;t.param==null?e.write(" catch "):(e.write(" catch ("),this[t.param.type](t.param,e),e.write(") ")),this[t.body.type](t.body,e)}r.finalizer&&(e.write(" finally "),this[r.finalizer.type](r.finalizer,e))},WhileStatement(r,e){e.write("while ("),this[r.test.type](r.test,e),e.write(") "),this[r.body.type](r.body,e)},DoWhileStatement(r,e){e.write("do "),this[r.body.type](r.body,e),e.write(" while ("),this[r.test.type](r.test,e),e.write(");")},ForStatement(r,e){if(e.write("for ("),r.init!=null){let{init:t}=r;t.type[0]==="V"?ZI(e,t):this[t.type](t,e)}e.write("; "),r.test&&this[r.test.type](r.test,e),e.write("; "),r.update&&this[r.update.type](r.update,e),e.write(") "),this[r.body.type](r.body,e)},ForInStatement:N1=function(r,e){e.write(`for ${r.await?"await ":""}(`);let{left:t}=r;t.type[0]==="V"?ZI(e,t):this[t.type](t,e),e.write(r.type[3]==="I"?" in ":" of "),this[r.right.type](r.right,e),e.write(") "),this[r.body.type](r.body,e)},ForOfStatement:N1,DebuggerStatement(r,e){e.write("debugger;",r)},FunctionDeclaration:F1=function(r,e){e.write((r.async?"async ":"")+(r.generator?"function* ":"function ")+(r.id?r.id.name:""),r),_u(e,r.params),e.write(" "),this[r.body.type](r.body,e)},FunctionExpression:F1,VariableDeclaration(r,e){ZI(e,r),e.write(";")},VariableDeclarator(r,e){this[r.id.type](r.id,e),r.init!=null&&(e.write(" = "),this[r.init.type](r.init,e))},ClassDeclaration(r,e){if(e.write("class "+(r.id?`${r.id.name} `:""),r),r.superClass){e.write("extends ");let{superClass:t}=r,{type:n}=t,i=e.expressionsPrecedence[n];(n[0]!=="C"||n[1]!=="l"||n[5]!=="E")&&(i===Qn||i<e.expressionsPrecedence.ClassExpression)?(e.write("("),this[r.superClass.type](t,e),e.write(")")):this[t.type](t,e),e.write(" ")}this.ClassBody(r.body,e)},ImportDeclaration(r,e){e.write("import ");let{specifiers:t}=r,{length:n}=t,i=0;if(n>0){for(;i<n;){i>0&&e.write(", ");let o=t[i],s=o.type[6];if(s==="D")e.write(o.local.name,o),i++;else if(s==="N")e.write("* as "+o.local.name,o),i++;else break}if(i<n){for(e.write("{");;){let o=t[i],{name:s}=o.imported;if(e.write(s,o),s!==o.local.name&&e.write(" as "+o.local.name),++i<n)e.write(", ");else break}e.write("}")}e.write(" from ")}this.Literal(r.source,e),e.write(";")},ImportExpression(r,e){e.write("import("),this[r.source.type](r.source,e),e.write(")")},ExportDefaultDeclaration(r,e){e.write("export default "),this[r.declaration.type](r.declaration,e),e.expressionsPrecedence[r.declaration.type]!=null&&r.declaration.type[0]!=="F"&&e.write(";")},ExportNamedDeclaration(r,e){if(e.write("export "),r.declaration)this[r.declaration.type](r.declaration,e);else{e.write("{");let{specifiers:t}=r,{length:n}=t;if(n>0)for(let i=0;;){let o=t[i],{name:s}=o.local;if(e.write(s,o),s!==o.exported.name&&e.write(" as "+o.exported.name),++i<n)e.write(", ");else break}e.write("}"),r.source&&(e.write(" from "),this.Literal(r.source,e)),e.write(";")}},ExportAllDeclaration(r,e){r.exported!=null?e.write("export * as "+r.exported.name+" from "):e.write("export * from "),this.Literal(r.source,e),e.write(";")},MethodDefinition(r,e){r.static&&e.write("static ");let t=r.kind[0];(t==="g"||t==="s")&&e.write(r.kind+" "),r.value.async&&e.write("async "),r.value.generator&&e.write("*"),r.computed?(e.write("["),this[r.key.type](r.key,e),e.write("]")):this[r.key.type](r.key,e),_u(e,r.value.params),e.write(" "),this[r.value.body.type](r.value.body,e)},ClassExpression(r,e){this.ClassDeclaration(r,e)},ArrowFunctionExpression(r,e){e.write(r.async?"async ":"",r);let{params:t}=r;t!=null&&(t.length===1&&t[0].type[0]==="I"?e.write(t[0].name,t[0]):_u(e,r.params)),e.write(" => "),r.body.type[0]==="O"?(e.write("("),this.ObjectExpression(r.body,e),e.write(")")):this[r.body.type](r.body,e)},ThisExpression(r,e){e.write("this",r)},Super(r,e){e.write("super",r)},RestElement:B1=function(r,e){e.write("..."),this[r.argument.type](r.argument,e)},SpreadElement:B1,YieldExpression(r,e){e.write(r.delegate?"yield*":"yield"),r.argument&&(e.write(" "),this[r.argument.type](r.argument,e))},AwaitExpression(r,e){e.write("await ",r),Bg(e,r.argument,r)},TemplateLiteral(r,e){let{quasis:t,expressions:n}=r;e.write("`");let{length:i}=n;for(let s=0;s<i;s++){let a=n[s],c=t[s];e.write(c.value.raw,c),e.write("${"),this[a.type](a,e),e.write("}")}let o=t[t.length-1];e.write(o.value.raw,o),e.write("`")},TemplateElement(r,e){e.write(r.value.raw,r)},TaggedTemplateExpression(r,e){Bg(e,r.tag,r),this[r.quasi.type](r.quasi,e)},ArrayExpression:U1=function(r,e){if(e.write("["),r.elements.length>0){let{elements:t}=r,{length:n}=t;for(let i=0;;){let o=t[i];if(o!=null&&this[o.type](o,e),++i<n)e.write(", ");else{o==null&&e.write(", ");break}}}e.write("]")},ArrayPattern:U1,ObjectExpression(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e,o=t+e.indent;if(e.write("{"),r.properties.length>0){e.write(n),i&&r.comments!=null&&vr(e,r.comments,o,n);let s=","+n,{properties:a}=r,{length:c}=a;for(let u=0;;){let l=a[u];if(i&&l.comments!=null&&vr(e,l.comments,o,n),e.write(o),this[l.type](l,e),++u<c)e.write(s);else break}e.write(n),i&&r.trailingComments!=null&&vr(e,r.trailingComments,o,n),e.write(t+"}")}else i?r.comments!=null?(e.write(n),vr(e,r.comments,o,n),r.trailingComments!=null&&vr(e,r.trailingComments,o,n),e.write(t+"}")):r.trailingComments!=null?(e.write(n),vr(e,r.trailingComments,o,n),e.write(t+"}")):e.write("}"):e.write("}");e.indentLevel--},Property(r,e){r.method||r.kind[0]!=="i"?this.MethodDefinition(r,e):(r.shorthand||(r.computed?(e.write("["),this[r.key.type](r.key,e),e.write("]")):this[r.key.type](r.key,e),e.write(": ")),this[r.value.type](r.value,e))},PropertyDefinition(r,e){if(r.static&&e.write("static "),r.computed&&e.write("["),this[r.key.type](r.key,e),r.computed&&e.write("]"),r.value==null){r.key.type[0]!=="F"&&e.write(";");return}e.write(" = "),this[r.value.type](r.value,e),e.write(";")},ObjectPattern(r,e){if(e.write("{"),r.properties.length>0){let{properties:t}=r,{length:n}=t;for(let i=0;this[t[i].type](t[i],e),++i<n;)e.write(", ")}e.write("}")},SequenceExpression(r,e){_u(e,r.expressions)},UnaryExpression(r,e){if(r.prefix){let{operator:t,argument:n,argument:{type:i}}=r;e.write(t);let o=W1(e,n,r);!o&&(t.length>1||i[0]==="U"&&(i[1]==="n"||i[1]==="p")&&n.prefix&&n.operator[0]===t&&(t==="+"||t==="-"))&&e.write(" "),o?(e.write(t.length>1?" (":"("),this[i](n,e),e.write(")")):this[i](n,e)}else this[r.argument.type](r.argument,e),e.write(r.operator)},UpdateExpression(r,e){r.prefix?(e.write(r.operator),this[r.argument.type](r.argument,e)):(this[r.argument.type](r.argument,e),e.write(r.operator))},AssignmentExpression(r,e){this[r.left.type](r.left,e),e.write(" "+r.operator+" "),this[r.right.type](r.right,e)},AssignmentPattern(r,e){this[r.left.type](r.left,e),e.write(" = "),this[r.right.type](r.right,e)},BinaryExpression:j1=function(r,e){let t=r.operator==="in";t&&e.write("("),Bg(e,r.left,r,!1),e.write(" "+r.operator+" "),Bg(e,r.right,r,!0),t&&e.write(")")},LogicalExpression:j1,ConditionalExpression(r,e){let{test:t}=r,n=e.expressionsPrecedence[t.type];n===Qn||n<=e.expressionsPrecedence.ConditionalExpression?(e.write("("),this[t.type](t,e),e.write(")")):this[t.type](t,e),e.write(" ? "),this[r.consequent.type](r.consequent,e),e.write(" : "),this[r.alternate.type](r.alternate,e)},NewExpression(r,e){e.write("new ");let t=e.expressionsPrecedence[r.callee.type];t===Qn||t<e.expressionsPrecedence.CallExpression||J9(r.callee)?(e.write("("),this[r.callee.type](r.callee,e),e.write(")")):this[r.callee.type](r.callee,e),_u(e,r.arguments)},CallExpression(r,e){let t=e.expressionsPrecedence[r.callee.type];t===Qn||t<e.expressionsPrecedence.CallExpression?(e.write("("),this[r.callee.type](r.callee,e),e.write(")")):this[r.callee.type](r.callee,e),r.optional&&e.write("?."),_u(e,r.arguments)},ChainExpression(r,e){this[r.expression.type](r.expression,e)},MemberExpression(r,e){let t=e.expressionsPrecedence[r.object.type];t===Qn||t<e.expressionsPrecedence.MemberExpression?(e.write("("),this[r.object.type](r.object,e),e.write(")")):this[r.object.type](r.object,e),r.computed?(r.optional&&e.write("?."),e.write("["),this[r.property.type](r.property,e),e.write("]")):(r.optional?e.write("?."):e.write("."),this[r.property.type](r.property,e))},MetaProperty(r,e){e.write(r.meta.name+"."+r.property.name,r)},Identifier(r,e){e.write(r.name,r)},PrivateIdentifier(r,e){e.write(`#${r.name}`,r)},Literal(r,e){r.raw!=null?e.write(r.raw,r):r.regex!=null?this.RegExpLiteral(r,e):r.bigint!=null?e.write(r.bigint+"n",r):e.write(G9(r.value),r)},RegExpLiteral(r,e){let{regex:t}=r;e.write(`/${t.pattern}/${t.flags}`,r)}},X9={};var ex=class{constructor(e){let t=e??X9;this.output="",t.output!=null?(this.output=t.output,this.write=this.writeToStream):this.output="",this.generator=t.generator!=null?t.generator:Y9,this.expressionsPrecedence=t.expressionsPrecedence!=null?t.expressionsPrecedence:z9,this.indent=t.indent!=null?t.indent:"  ",this.lineEnd=t.lineEnd!=null?t.lineEnd:`
`,this.indentLevel=t.startingIndentLevel!=null?t.startingIndentLevel:0,this.writeComments=t.comments?t.comments:!1,t.sourceMap!=null&&(this.write=t.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=t.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
`).length-1,this.mapping={original:null,generated:this,name:void 0,source:t.sourceMap.file||t.sourceMap._file})}write(e){this.output+=e}writeToStream(e){this.output.write(e)}writeAndMap(e,t){this.output+=e,this.map(e,t)}writeToStreamAndMap(e,t){this.output.write(e),this.map(e,t)}map(e,t){if(t!=null){let{type:o}=t;if(o[0]==="L"&&o[2]==="n"){this.column=0,this.line++;return}if(t.loc!=null){let{mapping:s}=this;s.original=t.loc.start,s.name=t.name,this.sourceMap.addMapping(s)}if(o[0]==="T"&&o[8]==="E"||o[0]==="L"&&o[1]==="i"&&typeof t.value=="string"){let{length:s}=e,{column:a,line:c}=this;for(let u=0;u<s;u++)e[u]===`
`?(a=0,c++):a++;this.column=a,this.line=c;return}}let{length:n}=e,{lineEnd:i}=this;n>0&&(this.lineEndSize>0&&(i.length===1?e[n-1]===i:e.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function To(r,e){let t=new ex(e);return t.generator[r.type](r,t),t.output}var V1=require("./vendor/acorn.js"),qg=require("./vendor/acorn-loose.js");var jg={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},Q9=Object.keys(jg);for(let r of Q9)Object.freeze(jg[r]);Object.freeze(jg);var tx=jg;var rx={ecmaVersion:"latest",locations:!0,allowAwaitOutsideFunction:!0,allowImportExportEverywhere:!0,allowReserved:!0,allowReturnOutsideFunction:!0},ps=r=>r.start,nx=r=>r.end,$1=(r,e)=>r.slice(ps(e),nx(e)),Li=(r,e=!1)=>(e?V1.parse:qg.parse)(r,rx),Kd=r=>{let e=Li(r);for(let t of e.body)t.type==="FunctionDeclaration"&&t.id&&(0,qg.isDummy)(t.id)&&(t.id=null);return e.body};function H1(r,e,t){return e.length>1||e[0].type!=="FunctionDeclaration"?K1(r,e,!0,t):G1(r,[{type:"ReturnStatement",argument:{type:"CallExpression",optional:!1,arguments:[{type:"ThisExpression"},...r.map(n=>({type:"Identifier",name:n}))],callee:{type:"MemberExpression",property:{type:"Identifier",name:"call"},computed:!1,optional:!1,object:{type:"FunctionExpression",params:e[0].params,body:e[0].body}}}}],!0,t)}var G1=(r,e,t,n)=>{let i={type:"Identifier",name:"e"},s=n?[{type:"TryStatement",block:{type:"BlockStatement",body:e},handler:{type:"CatchClause",param:i,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"LogicalExpression",left:{type:"LogicalExpression",left:{type:"MemberExpression",object:i,property:{type:"Identifier",name:"stack"},computed:!1,optional:!1},operator:"||",right:{type:"MemberExpression",object:i,property:{type:"Identifier",name:"message"},computed:!1,optional:!1}},operator:"||",right:{type:"CallExpression",callee:{type:"Identifier",name:"String"},arguments:[i],optional:!1}}}]}}}]:e;return t?{type:"FunctionExpression",id:{type:"Identifier",name:"_generatedCode"},params:r.map(a=>({type:"Identifier",name:a})),body:{type:"BlockStatement",body:s}}:{type:"ArrowFunctionExpression",params:r.map(a=>({type:"Identifier",name:a})),expression:!1,body:{type:"BlockStatement",body:s}}},e7=(r,e)=>({type:"CallExpression",arguments:r.map(t=>({type:"Identifier",name:t})),callee:e,optional:!1}),z1=(r,e,t)=>e7(r,K1(r,e,t,!0));function K1(r,e,t,n){let i=e[e.length-1];if(i.type!=="ReturnStatement"){let o=t7(i);o&&(e=[...e.slice(0,-1),{type:"ReturnStatement",argument:o}])}return G1(r,e,t,n)}function t7(r){switch(r.type){case"ExpressionStatement":return r.expression;case"BlockStatement":return{type:"CallExpression",arguments:[],callee:{type:"ArrowFunctionExpression",params:[],expression:!1,body:r},optional:!1};case"ReturnStatement":return r.argument||void 0;default:return}}var ds=(r,e)=>{Ug(r,e)},Wg=(r,e)=>{let t=Ug(r,e);return t&&typeof t=="object"?t.replace:r},Ug=(r,e,t)=>{if(!r)return;let n=e.enter(r,t);if(n===0)return 0;if(n&&typeof n=="object")return n;if(n===1)return;let i=tx[r.type];if(i)for(let o of i){let s=r[o];if(s instanceof Array)for(let[a,c]of s.entries()){let u=Ug(c,e,r);if(u===0)return 0;u&&typeof u=="object"&&(s[a]=u.replace)}else if(s){let a=Ug(s,e,r);if(a===0)return 0;a&&typeof a=="object"&&(r[o]=a.replace)}}e.leave?.(r)};var Iu=class r{constructor(e,t,n,i,o){this.original=e;this.metadata=t;this.actualRoot=n;this.actualSources=i;this.hasNames=o;this.sourceActualToOriginal=new Map;this.sourceOriginalToActual=new Map;this.id=r.idCounter++;if(i.length!==e.sources.length)throw new Error("Expected actualSources.length === original.source.length");for(let s=0;s<i.length;s++){let a=i[s],c=e.sources[s];a!==null&&c!==null&&(this.sourceActualToOriginal.set(a,c),this.sourceOriginalToActual.set(c,a))}}static{this.idCounter=0}get sources(){return this.actualSources.slice()}get sourceRoot(){return this.actualRoot}computedSourceUrl(e){return st(Vg(Qt(this.metadata.sourceMapUrl)?this.metadata.compiledPath:this.metadata.sourceMapUrl,this.sourceRoot+e))}originalPositionFor(e){let t=o1(this.original,e);return t.source&&(t.source=this.sourceOriginalToActual.get(t.source)??t.source),t}generatedPositionFor(e){let t=this.sourceActualToOriginal.get(e.source)??e.source;if(!isFinite(e.line)){let n=e.bias||Co;return this.getBestGeneratedForOriginal(t,(i,o)=>r7(i,o)*n)}return s1(this.original,{...e,source:t})}allGeneratedPositionsFor(e){return a1(this.original,{...e,source:this.sourceActualToOriginal.get(e.source)??e.source})}sourceContentFor(e){e=this.sourceActualToOriginal.get(e)??e;let t=this.original.sources.indexOf(e);return t===-1?null:this.original.sourcesContent?.[t]??null}eachMapping(e){c1(this.original,e)}decodedMappings(){return Fa(this.original)}names(){return this.original.names}getBestGeneratedForOriginal(e,t){let n;return this.eachMapping(i=>{i.source===e&&(!n||t(i,n)>0)&&(n=i)}),n?{column:n.generatedColumn,line:n.generatedLine}:{column:null,line:null}}},r7=({originalLine:r,originalColumn:e},{originalLine:t,originalColumn:n})=>(r||0)-(t||0)||(e||0)-(n||0);async function Y1(r,e,t,n){let i=$g.Parser.parse(e,{locations:!0,ecmaVersion:"latest"}),o=new D1({file:r}),s=To(i,{sourceMap:{addMapping:a=>O1(o,a.original.line-1,a.original.column,r,a.generated.line-1,a.generated.column)}});return L1(o,r,s),new Iu(new kg(M1(o)),{sourceMapUrl:n,compiledPath:t},"",[r],!1)}function X1(r){let e;try{e=Li(r)}catch{return}let t=(c,u)=>({type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:c,right:u}}),n=!1,i=!1,o=Wg(e,{enter(c,u){switch(c.type){case"ClassDeclaration":return{replace:t(c.id||{type:"Identifier",name:"_default"},{...c,type:"ClassExpression"})};case"FunctionDeclaration":return{replace:t(c.id||{type:"Identifier",name:"_default"},{...c,type:"FunctionExpression"})};case"FunctionExpression":case"ArrowFunctionExpression":case"MethodDefinition":return 1;case"AwaitExpression":n=!0;return;case"ForOfStatement":c.await&&(n=!0);return;case"ReturnStatement":i=!0;return;case"VariableDeclaration":if(!u||!("body"in u)||!(u.body instanceof Array))return;let l=u.body,p=c.declarations.map(d=>({type:"ExpressionStatement",expression:{type:"UnaryExpression",operator:"void",prefix:!0,argument:{type:"AssignmentExpression",operator:"=",left:d.id,right:d.init||{type:"Identifier",name:"undefined"}}}}));l.splice(l.indexOf(c),1,...p)}}});if(!n||i)return;let s=e.body[e.body.length-1];s.type==="ExpressionStatement"&&(e.body[e.body.length-1]={type:"ReturnStatement",argument:s.expression});let a={type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"ArrowFunctionExpression",params:[],generator:!1,expression:!1,async:!0,body:{type:"BlockStatement",body:o.body}},arguments:[],optional:!1}};return To(a)}function Jd(r){try{let e=(0,$g.parseExpressionAt)(r,0,rx);return e.end<r.length||e.type!=="ObjectExpression"?r:`(${r})`}catch{return r}}function xu(r){if(!r)return;let e="sourceMappingURL",t=r.length,n=e.length,i=t,o=0;for(;;){if(i=r.lastIndexOf(e,i),i===-1||i<4)return;if(i-=4,r[i]==="/"&&r[i+1]==="/"&&!(r[i+2]!=="#"&&r[i+2]!=="@")&&!(r[i+3]!==" "&&r[i+3]!=="	")&&(o=i+4+n,!(o<t&&r[o]!=="=")))break}let s=r.substring(o+1),a=s.indexOf(`
`);return a!==-1&&(s=s.substring(0,a)),s.trim()}function Hg(r,e,t){let n=t.generatedPositionFor({source:r,line:e.lineNumber,column:e.columnNumber-1,bias:Co}),i=a=>{if(a.line===null||a.column===null)return 1e11;let c=t.originalPositionFor(a);return c.line!==null?Math.abs(e.lineNumber-c.line):1e11},o=i(n),s=t.allGeneratedPositionsFor({source:r,line:e.lineNumber,column:e.columnNumber-1}).filter(a=>a.line!==null&&a.column!==null).sort((a,c)=>a.line!==c.line?a.line-c.line:a.column-c.column).map(a=>[a,i(a)]);return s.push([n,o]),s.sort(([a,c],[u,l])=>c-l||a.line-u.line||a.column-u.column),s[0][0]}var ix=(r,e)=>!!e&&((e.type==="FunctionExpression"||e.type==="FunctionDeclaration"||e.type==="ArrowFunctionExpression")&&e.params.includes(r)||(e.type==="ForInStatement"||e.type==="ForOfStatement")&&e.left===r||e.type==="VariableDeclarator"&&e.id===r||e.type==="AssignmentPattern"&&e.left===r||e.type==="CatchClause"&&e.param===r||"kind"in e&&e.kind==="init"&&e.value===r||e.type==="RestElement"&&e.argument===r||e.type==="AssignmentPattern"&&e.left===r);function fs(r){try{new Function(r)}catch(e){return e}}function i7(r,e){let t=Li(r),n,i;return ds(t,{enter:o=>{let s=o;e>=s.start&&e<s.end&&(o.type==="CallExpression"||o.type==="NewExpression"?i=o:n=o)}}),i||n}var J1=/^[^()]+/g;function Q1(r,e){try{let n=i7(r,e);if(n&&"callee"in n){let i=n.callee;return{text:`${r.slice(i.start,i.end)}(...)`,start:i.start,end:i.end}}else{let i=n;return{text:r.slice(i.start,i.end),start:i.start,end:i.end}}}catch{}J1.lastIndex=e-1;let t=J1.exec(r);if(t)return{text:t[0],start:e,end:e+t[0].length}}var at=(r=ox())=>`
//# sourceURL=${r}
`,ox=()=>`eval-${(0,eO.randomBytes)(4).toString("hex")}.cdp`;function Mi(r,e){return o7(""+r,e)}function o7(r,e){let t=(0,Z1.parseExpressionAt)(r,0,{ecmaVersion:"latest",locations:!0});if(t.type!=="FunctionExpression")throw new Error(`Could not find function declaration for:

${r}`);let n=t.params.map(a=>{if(a.type!=="Identifier")throw new Error("Parameter must be identifier");return a.name}),{start:i,end:o}=t.body,s=(a,c,u)=>{let l=c,p=[];for(let[d,f]of a.entries())l+=`let ${n[d]}=`,p.push(new lr(new Ke(0,l.length),new Ke(0,l.length+f.length))),l+=f,l+=";";return l+=r.slice(i+1,o-1),l+=u,l+=`
${at(e)}`,{out:l,argRanges:p}};return{expr:(...a)=>s(a,"(()=>{","})();").out,exprArgRanges:(...a)=>s(a,"(()=>{","})();").argRanges,decl:(...a)=>s(a,"function(...runtimeArgs){","}").out}}var ja=class extends Error{constructor(t){super(t.text);this.details=t}},Yd=class{constructor(e){this.objectId=e}};function It(r,e){let t=""+r,n=t.lastIndexOf("}");t=t.slice(0,n)+at(e)+t.slice(n);let i=async({cdp:o,args:s,...a})=>{let c=await o.Runtime.callFunctionOn({functionDeclaration:t,arguments:s.map(u=>u instanceof Yd?{objectId:u.objectId}:{value:u}),...a});if(!c)throw new ja({exceptionId:0,text:"No response from CDP",lineNumber:0,columnNumber:0});if(c.exceptionDetails)throw new ja(c.exceptionDetails);return c.result};return i.source=t,i}var tO=()=>"globalThis.__jsDebugIsReady = true; "+at();var Xd=new Set(["page","iframe","worker","service_worker"]),Kg=new Set(["page","iframe"]),sx=new Set(["page","iframe"]),s7=sx,Jg=class r{constructor(e,t,n,i,o,s,a,c,u){this._manager=e;this._targetInfo=t;this.launchConfig=s;this.sessionId=a;this.logger=c;this._attached=!1;this._onNameChangedEmitter=new O;this.onNameChanged=this._onNameChangedEmitter.event;this.entryBreakpoint=void 0;this._children=new Map;this.willWaitForDebugger=Promise.resolve();this.sourcePathResolver=this._manager._sourcePathResolver;this._cdp=n,n.pause(),this.parentTarget=i,this._waitingForDebugger=o,this._updateFromInfo(t),this._ondispose=u}get targetInfo(){return this._targetInfo}get targetId(){return this._targetInfo.targetId}get independentLifeycle(){return sx.has(this.type())}get supplementalConfig(){let e=this.type();return{__browserTargetType:e,__usePerformanceFromParent:e!=="page"}}targetOrigin(){return this._manager._targetOrigin}id(){return this.sessionId}cdp(){return this._cdp}name(){return this._computeName()}fileName(){return this._targetInfo.url}type(){return this._targetInfo.type}afterBind(){return this._cdp.resume(),Promise.resolve()}initialize(){return Promise.resolve()}async runIfWaitingForDebugger(){await Promise.all([!this._targetInfo.canAccessOpener&&this._cdp.Runtime.runIfWaitingForDebugger({}),this._cdp.Runtime.evaluate({expression:tO()})])}parent(){return this.parentTarget&&!Xd.has(this.parentTarget.type())?this.parentTarget.parentTarget:this.parentTarget}children(){let e=[];for(let t of this._children.values())Xd.has(t.type())?e.push(t):e.push(...t.children());return e}canStop(){return s7.has(this.type())}stop(){if(this._manager.targetList().includes(this))if(this.type()==="service_worker"){if(this._manager.serviceWorkerModel.stopWorker(this.id()),!this.parentTarget)return;this._manager.serviceWorkerModel.stopWorker(this.parentTarget.id())}else this._cdp.Target.closeTarget({targetId:this._targetInfo.targetId})}canRestart(){return sx.has(this.type())}restart(){this._cdp.Page.reload({})}waitingForDebugger(){return this._waitingForDebugger}canAttach(){return!this._attached}async attach(){return this._waitingForDebugger=!1,this._attached=!0,Promise.resolve(this._cdp)}canDetach(){return this._attached}async detach(){this._attached=!1,this._manager._detachedFromTarget(this.sessionId)}executionContextName(e){let t=e.auxData,n=e.name;if(!t)return n;let i=t.frameId,o=i?this._manager.frameModel.frameForId(i):void 0;return o&&t.isDefault&&!o.parentFrame()?"top":o&&t.isDefault?o.displayName():o?`${n}`:n}supportsCustomBreakpoints(){return Kg.has(this.type())}supportsXHRBreakpoints(){return Kg.has(this.type())}scriptUrlToUrl(e){return hs(this._targetInfo.url,e)||e}_updateFromInfo(e){this._targetInfo={...e,type:this._targetInfo.type},this._onNameChangedEmitter.fire()}setComputeNameFn(e){this._customNameComputeFn=e,this._onNameChangedEmitter.fire()}_computeName(){let e=this._customNameComputeFn?.(this);if(e)return e;if(this.type()==="service_worker"){let i=this._manager.serviceWorkerModel.version(this.id());if(i)return i.label()+" [Service Worker]"}let t=this._targetInfo.title;if(!(t&&this._manager.targetList().some(i=>i instanceof r&&i!==this&&i._targetInfo.title===this._targetInfo.title)))return t;try{let i=new rO.URL(this._targetInfo.url);i.protocol==="data:"?t=" <data>":i?t+=` (${this._targetInfo.url.replace(/^[a-z]+:\/\/|\/$/gi,"")})`:t+=` (${this._targetInfo.url})`}catch{t+=` (${this._targetInfo.url})`}return t}async _detached(){await this._manager.serviceWorkerModel.detached(this._cdp),this._ondispose(this)}};function Yg(r){return r instanceof Array?r:[r]}function nO(r,e,t){let n=0,i=r.length-1;for(;n<=i;){let o=(n+i)/2|0,s=t(r[o],e);if(s<0)n=o+1;else if(s>0)i=o-1;else return o}return n}function iO(r,e){let t=new Map;for(let n of r){let i=e(n),o=t.get(i);o?o.push(n):t.set(i,[n])}return t}function ms(r){return r.next().value}function Ni(r,e){return r.length<=e?r:r.substr(0,e-1)+"\u2026"}function Cu(r,e){if(r.length<=e)return r;let t=e>>1,n=e-t-1,i=r.codePointAt(r.length-n-1);i&&i>=65536&&(--n,++t);let o=r.codePointAt(t-1);return t>0&&o&&o>=65536&&--t,r.substr(0,t)+"\u2026"+r.substr(r.length-n,n)}var oO="/\\.?*()^${}|[]+",sO=r=>oO.includes(r);function wr(r,e){let t=oO.split("").filter(i=>!e||e.indexOf(i)<0).join("").replace(/[\\\]]/g,"\\$&"),n=new RegExp(`[${t}]`,"g");return r.replace(n,"\\$&")}var gs=class{constructor(e){this.source=e;this.lines=[];this.lines.push(0);for(let t=e.indexOf(`
`);t!==-1;t=e.indexOf(`
`,t+1))this.lines.push(t+1)}getLineOffset(e){return e>=this.lines.length?this.source.length:this.lines[e]}convert(e){let t=e.base0;if(t.lineNumber>this.lines.length)return this.source.length;let n=this.lines[t.lineNumber],i=this.lines[t.lineNumber+1]??this.source.length+1;return n+Math.min(i-n-1,t.columnNumber)}};var Qg=process.platform!=="win32";function cx(){return Qg}function Zg(r){return Qg?r:r.toLowerCase()}function ey(r,e){return Qg?r===e:r.toLowerCase()===e.toLowerCase()}function qa(){return cx()?new Map:new Oi(Zg)}var aO=process.platform==="win32"?process.env.PATHEXT?.toLowerCase().split(";"):void 0,ef=r=>{let e=Zg(Xr.basename(r));if(aO){for(let t of aO)if(e.endsWith(t))return e.slice(0,-t.length)}return e},Wa=async(r,e)=>{for(;;){let t=await e(r);if(t!==void 0)return t;let n=Xr.dirname(r);if(n===r)return;r=n}},Tu=(r,e,t)=>Wa(e,async n=>await r.exists(Xr.join(n,t))?n:void 0),c7=new Set(["localhost","127.0.0.1","::1"]),u7=new Set(["0.0.0.0","::","0000:0000:0000:0000:0000:0000:0000:0000"]),Xg=r=>c7.has(r.toLowerCase()),lO=r=>{try{return new Fi.URL(r).hostname.replace(/^\[|\]$/g,"")}catch{return r}},pO=r=>u7.has(lO(r)),Pu=yo(async r=>{let e=lO(r);if(Xg(e))return!0;try{let t=await uO.promises.lookup(e);return Xg(t.address)}catch{return!1}});function hs(r,e){try{return new Fi.URL(e,r).href}catch{}}function ux(r){try{return new Fi.URL(r).pathname}catch{return}}function Vg(r,e){try{return new Fi.URL(e),e}catch{}let t;try{t=new Fi.URL(r||"")}catch{return e}let n=t.protocol+"//";return t.username&&(n+=t.username+":"+t.password+"@"),n+=t.host,n+=Xr.dirname(t.pathname),n[n.length-1]!=="/"&&(n+="/"),n+=e,n}function ty(r){try{return new Fi.URL(r),!0}catch{return!1}}function dO(r){return r.replace(/\/$/,"").replace(/\\$/,"")}var l7=/^https:\/\/([a-z0-9\-]+)\+\.vscode-resource\.vscode-(?:webview|cdn)\.net\/(.+)/i,cO="vscode-file://vscode-app/";function ct(r){let e=l7.exec(r);if(e)r=`${e[1]}:///${e[2]}`;else if(r.startsWith("vscode-webview-resource://"))r=new Fi.URL(r).pathname.replace(/%2F/gi,"/").replace(/^\/([a-z0-9\-]+)(\/{1,2})/i,(n,i,o)=>o.length===1?`${i}:///`:`${i}://`);else if(r.startsWith(cO))r=r.slice(cO.length);else if(!Ar(r))return;return r=r.replace("file:///",""),r=decodeURIComponent(r),r.startsWith("/")&&process.platform==="win32"&&r[1]!=="/"&&(r="/"+r),r[0]!=="/"&&!r.match(/^[A-Za-z]:/)&&(r="/"+r),st(r)}function fO(r){return Ar(r)&&(r=r.replace("file:///","\\\\"),r=r.replace(/\//g,"\\"),r=decodeURIComponent(r)),r}function Ae(r){return lx==="win32"?"file:///"+ys(r):"file://"+ys(r)}function Eu(r){return r.startsWith("/")?"file://"+ys(r):"file:///"+ys(r)}function pr(r){return Xr.posix.isAbsolute(r)||Xr.win32.isAbsolute(r)}function Qt(r){return!!r&&r.startsWith("data:")}var ax=(r,e,t)=>{if(!t||r===":"){e.add(r);return}if(r==="/"){e.add(`\\${r}`);return}sO(r)?e.add(`\\${r}`):e.add(r);let n=encodeURIComponent(r);r!=="\\"&&n!==r&&e.add(n)},p7=r=>{switch(r.size){case 0:return"";case 1:return ms(r.values());default:let e=[...r];return e.some(t=>t.length>1)?`(?:${e.join("|")})`:`[${e.join("")}]`}},Qd=new Set;function Zd(r,e,t,n,i=Qg){let o="";for(let s of r.slice(e,t))i?ax(s,Qd,n):(ax(s.toLowerCase(),Qd,n),ax(s.toUpperCase(),Qd,n)),o+=p7(Qd),Qd.clear();return o}function vn(r,[e,t]=[0,r.length]){if(t<=e)return r;let n=[],i=Zd(r,0,e,!1),o=Zd(r,t,r.length,!1),s=r.slice(e,t);for(let a of[decodeURIComponent(s),ct(s)]){if(!a)continue;let c=Zd(a,0,a.length,!0);n.push(d7(`${i}${c}${o}`).concat("($|\\?)"))}return n.join("|")}var d7=r=>r.replace(/^(file:\\\/\\\/\\\/)?([a-z]):/i,(e,t="",n)=>`${t}[${n.toUpperCase()}${n.toLowerCase()}]:`);function Ar(r){return r.startsWith("file:///")}var lx=process.platform;function ys(r){return r=Po(r),lx==="win32"?(BI(r)&&(r=r.slice(1)),r.split(/[\\//]/g).map((e,t)=>t>0?encodeURIComponent(e):e).join("/")):r.split("/").map(encodeURIComponent).join("/")}function Po(r){return r&&lx==="win32"&&r[1]===":"?r[0].toUpperCase()+r.substring(1):r}var bs=(r,e=[])=>{let t=r.urlFilter||"file"in r&&r.file||r.url,n=t?ry(t,...e):void 0;return i=>!i.url.startsWith("devtools://")&&n?.(i.url)!==!1},Bi=r=>e=>e.type==="page"&&!e.url.startsWith("edge://force-signin")&&r(e);function f7(r){return!!r&&!Xr.isAbsolute(r)&&!!(0,Fi.parse)(r).protocol}var ry=(...r)=>{let e=i=>{i=i.toLowerCase();let o=ct(i);o?i=o:f7(i)&&i.includes("://")&&(i=i.substr(i.indexOf("://")+3)),i.endsWith("/")&&(i=i.substr(0,i.length-1));let s=i.indexOf("#");return s!==-1&&(i=i.slice(0,i[s-1]==="/"?s-1:s)),i},t=r.map(i=>wr(e(i),"/*").replace(/(\/\*$)|\*/g,".*")),n=new RegExp("^("+t.join("|")+")$","g");return i=>(n.lastIndex=0,n.test(e(i)))};var Ui=Symbol("ISourceMapFactory"),px=Symbol("IRootSourceMapFactory"),Va=class{constructor(e,t){this.root=e;this.resourceProvider=t}load(e){return this.root.load(this.resourceProvider,e)}guardSourceMapFn(e,t,n){return this.root.guardSourceMapFn(e,t,n)}};Va=S([(0,ji.injectable)(),g(0,(0,ji.inject)(px)),g(1,(0,ji.inject)(Ba))],Va);var tf=class{constructor(e,t,n){this.pathResolve=e;this.dap=t;this.logger=n;this.hasWarnedAboutMaps=new WeakSet}async load(e,t){let n=await this.parseSourceMap(e,t.sourceMapUrl),i;"sourceRoot"in n&&(i=n.sourceRoot,n.sourceRoot=void 0);let o=!1,s=[];if("sections"in n){s=[];let a=0;for(let c of n.sections){let u=c.map;s.push(...u.sources),u.sources=u.sources.map(()=>`source${a++}.js`),o||=!!u.names?.length}}else"sources"in n&&Array.isArray(n.sources)&&(s=n.sources,n.sources=n.sources.map((a,c)=>`source${c}.js`),o=!!n.names?.length);return new Iu(new kg(n),t,i??"",s,o)}async parseSourceMap(e,t){let n;try{n=await this.parseSourceMapDirect(e,t)}catch(i){if(n=await this.parsePathMappedSourceMap(e,t),!n)throw i}if("sections"in n){let i=await Promise.all(n.sections.map((o,s)=>"url"in o?this.parseSourceMap(e,o.url).then(a=>({offset:o.offset,map:a})).catch(a=>{this.logger.warn("sourcemap.parsing",`Error parsing nested map ${s}: ${a}`)}):o));n.sections=i.filter(et)}return n}async parsePathMappedSourceMap(e,t){if(Qt(t))return;let n=await this.pathResolve.urlToAbsolutePath({url:t});if(n)try{return this.parseSourceMapDirect(e,n)}catch(i){this.logger.info("sourcemap.parsing","Parsing path mapped source map failed.",i)}}guardSourceMapFn(e,t,n){try{return t()}catch(i){if(!/error parsing/i.test(String(i.message)))throw i;if(!this.hasWarnedAboutMaps.has(e)){let o=Lg(e.metadata.compiledPath,i.message).error;this.dap.output({output:o.format+`
`,category:"stderr"}),this.hasWarnedAboutMaps.add(e)}return n()}}dispose(){}async parseSourceMapDirect(e,t){let n=ct(t);n&&(n=this.pathResolve.rebaseRemoteToLocal(n));let i=await e.fetch(n||t);if(!i.ok)throw i.error;let o=i.body;return o.slice(0,3)===")]}"&&(o=o.substring(o.indexOf(`
`))),JSON.parse(o)}};tf=S([(0,ji.injectable)(),g(0,(0,ji.inject)(Re)),g(1,(0,ji.inject)(Su)),g(2,(0,ji.inject)($))],tf);var vs=class extends tf{constructor(){super(...arguments);this.knownMaps=new Oi(t=>t.toLowerCase())}load(t,n){let i=this.knownMaps.get(n.sourceMapUrl);if(!i)return this.loadNewSourceMap(t,n);let o=n.cacheKey,s=i.metadata.cacheKey;return i.reloadIfNoMtime?o&&s&&o===s?(i.reloadIfNoMtime=!1,i.prom):this.loadNewSourceMap(t,n):s&&o&&o!==s?this.loadNewSourceMap(t,n):i.prom}loadNewSourceMap(t,n){let i=super.load(t,n);return this.knownMaps.set(n.sourceMapUrl,{metadata:n,reloadIfNoMtime:!1,prom:i}),i}dispose(){this.knownMaps.clear()}invalidateCache(){for(let t of this.knownMaps.values())t.reloadIfNoMtime=!0}};vs=S([(0,ji.injectable)()],vs);var hO=require("path");var ku=Symbol("ISearchStrategy"),yle=Symbol("ISearchStrategyFallback"),mO=async(r,e,t)=>{let n,o=`${(0,hO.basename)(r)}.map`;if(e.siblings.includes(o)&&(n=o),n||(typeof t>"u"&&(t=await wg(r)),n=xu(t)),!(!n||(Qt(n)||(n=hs(Ae(r),n)),!n))&&!(!n.startsWith("data:")&&!n.startsWith("file://")))return{compiledPath:r,sourceMapUrl:n,cacheKey:e.mtime}};var ny=async(r,e,t,n={})=>{let i=Date.now();try{return await t()}finally{r.verbose("perf.function","",{method:e,duration:Date.now()-i,...n})}};var dx=Symbol("InlineSourceMapUrl"),gO=10*1e3,$a=class{constructor(e){e.__workspaceCachePath&&(this.path=iy.join(e.__workspaceCachePath,"bp-predict.json"))}async load(){if(this.value||!this.path)return this.value;try{this.value=JSON.parse(await rf.promises.readFile(this.path,"utf-8"))}catch{}return this.value}async store(e){this.value=e,this.path&&(await rf.promises.mkdir(iy.dirname(this.path),{recursive:!0}),await rf.promises.writeFile(this.path,JSON.stringify(e)))}};$a=S([(0,Nt.injectable)(),g(0,(0,Nt.inject)(we))],$a);var qi=class{constructor(e,t,n,i,o,s){this.outFiles=e;this.repo=t;this.logger=n;this.sourceMapFactory=i;this.sourcePathResolver=o;this.state=s}async createMapping(e){if(this.outFiles.empty)return new Map;let t=qa(),n=await this.state.load();try{let{state:i}=await this.repo.streamChildrenWithSourcemaps({files:this.outFiles,processMap:async o=>{let s=[],a=await this.sourceMapFactory.load(o);for(let c of a.sources){if(c===null)continue;let u=this.sourcePathResolver?await this.sourcePathResolver.urlToAbsolutePath({url:c,map:a}):ct(c);u&&s.push({...o,sourceMapUrl:Qt(o.sourceMapUrl)?{[dx]:o.sourceMapUrl}:o.sourceMapUrl,resolvedPath:u,sourceUrl:c})}return{discovered:s,compiledPath:st(o.compiledPath)}},onProcessedMap:({discovered:o})=>{for(let s of o){let a=t.get(s.resolvedPath);a||(a=new Set,t.set(s.resolvedPath,a)),a.add(s)}},lastState:n,...e});i&&this.state.store(i).catch(o=>this.logger.warn("runtime.exception","Error saving sourcemap cache",{error:o}))}catch(i){this.logger.warn("runtime.exception","Error reading sourcemaps from disk",{error:i})}return t}};qi=S([(0,Nt.injectable)(),g(0,(0,Nt.inject)(Ri)),g(1,(0,Nt.inject)(ku)),g(2,(0,Nt.inject)($)),g(3,(0,Nt.inject)(Ui)),g(4,(0,Nt.inject)(Re)),g(5,(0,Nt.inject)($a))],qi);var Ru=class extends qi{async getMetadataForPaths(e){this.sourcePathToCompiled||(this.sourcePathToCompiled=this.createInitialMapping());let t=await this.sourcePathToCompiled;return e.map(n=>t.get(n))}async createInitialMapping(){return ny(this.logger,"BreakpointsPredictor.createInitialMapping",()=>this.createMapping())}};Ru=S([(0,Nt.injectable)()],Ru);var Au=class extends qi{constructor(){super(...arguments);this.sourcePathToCompiled=new Map}async getMetadataForPaths(t){let n=t.map(s=>this.sourcePathToCompiled.get(s)),i=t.map((s,a)=>a).filter(s=>!n[s]);if(i.length){let s=new Set(i.map(c=>st(t[c]))),a=this.createMapping({filter:(c,u)=>!u||u.discovered.some(l=>s.has(l.resolvedPath))});for(let c of i)this.sourcePathToCompiled.set(t[c],a),n[c]=a}return await Promise.all(n.map(async(s,a)=>(await s).get(t[a])))}};Au=S([(0,Nt.injectable)()],Au);var Ga=Symbol("IBreakpointsPredictor"),Ha=class{constructor(e,t,n,i){this.bpSearch=e;this.outFiles=t;this.logger=n;this.sourceMapFactory=i;this.predictedLocations=new Map;this.longParseEmitter=new O;this.targetedMode=!1;this.onLongParse=this.longParseEmitter.event}async predictBreakpoints(e){if(!e.source.path||!e.breakpoints?.length)return;let t=await this.getMetadataForPaths([e.source.path]).then(i=>i[0]);if(!t)return;let n=async(i,o,s)=>{let a=typeof s.sourceMapUrl=="string"?s.sourceMapUrl:s.sourceMapUrl.hasOwnProperty(dx)?s.sourceMapUrl[dx]:await rf.promises.readFile(s.compiledPath,"utf8").then(xu);if(!a)return[];let c=await this.sourceMapFactory.load({...s,sourceMapUrl:a}),u=this.sourceMapFactory.guardSourceMapFn(c,()=>Hg(s.sourceUrl,{lineNumber:i,columnNumber:o||1},c),()=>null);if(!u||u.line===null)return[];let l=await this.getMetadataForPaths([s.compiledPath]).then(p=>p[0]);return l?(await Promise.all([...l].map(d=>n(u.line,u.column,d)))).flat():[{absolutePath:s.compiledPath,lineNumber:u.line||1,columnNumber:u.column?u.column+1:1}]};for(let i of e.breakpoints??[]){let o=`${e.source.path}:${i.line}:${i.column||1}`;if(this.predictedLocations.has(o))return;let s=[];this.predictedLocations.set(o,s);for(let a of t)s.push(...await n(i.line,i.column||0,a))}}async getPredictionForSource(e){return this.getMetadataForPaths([e]).then(t=>t[0])}async getMetadataForPaths(e){let t=setTimeout(()=>{this.longParseEmitter.fire(),this.logger.warn("runtime.sourcemap","Long breakpoint predictor runtime",{longPredictionWarning:gO,patterns:[...this.outFiles.explode()].join(", ")})},gO),n=await this.bpSearch.getMetadataForPaths(e);return clearTimeout(t),n}predictedResolvedLocations(e){let t=`${e.absolutePath}:${e.lineNumber}:${e.columnNumber||1}`;return this.predictedLocations.get(t)??[]}};Ha=S([(0,Nt.injectable)(),g(0,(0,Nt.inject)(qi)),g(1,(0,Nt.inject)(Ri)),g(2,(0,Nt.inject)($)),g(3,(0,Nt.inject)(Ui))],Ha);var Ki=b(N());var oy=class{constructor(e=!1,t=!1){this.verified=e;this.hit=t}},sy=class{constructor(){this._statisticsById=new Map}registerBreakpoints(e){e.forEach(t=>{t.id!==void 0&&!this._statisticsById.has(t.id)&&this._statisticsById.set(t.id,new oy(t.verified,!1))})}registerResolvedBreakpoint(e){this.getStatistics(e).verified=!0}registerBreakpointHit(e){this.getStatistics(e).hit=!0}getStatistics(e){let t=this._statisticsById.get(e);if(t!==void 0)return t;{let n=new oy;return this._statisticsById.set(e,n),n}}statistics(){let e=0,t=0,n=0;for(let i of this._statisticsById.values())e++,i.hit&&n++,i.verified&&t++;return{set:e,verified:t,hit:n}}};var Uu=b(N());var GO=require("crypto"),Fu=b(N());var h7=0,nt=Symbol("ICdpApi"),za=class extends Error{constructor(t){super("<<message>>");this.method=t}setCause(t,n){return this.cause={code:t,message:n},this.message=`CDP error ${t} calling method ${this.method}: ${n}`,this.stack=this.stack?.replace("<<message>>",this.message),this}},rt=class{constructor(e,t,n){this.logger=t;this.telemetryReporter=n;this._connectionId=h7++;this._lastId=1e3;this._disposedSessions=new Map;this._onDisconnectedEmitter=new O;this.waitWrapper=g7();this.onDisconnected=this._onDisconnectedEmitter.event;this._transport=e,this._transport.onMessage(([i,o])=>this._onMessage(i,o)),this._transport.onEnd(()=>this._onTransportClose()),this._sessions=new Map,this._closed=!1,this._rootSession=new ay(this,"",this.logger),this._sessions.set("",this._rootSession)}rootSession(){return this._rootSession.cdp()}_send(e,t={},n){let i=++this._lastId,o={id:i,method:e,params:t};n&&(o.sessionId=n);let s=JSON.stringify(o);return this.logger.verbose("cdp.send",void 0,{connectionId:this._connectionId,message:o}),this._transport.send(s),i}_onMessage(e,t){let n=JSON.parse(e),i=n;n.result&&n.result.scriptSource?i={...n,result:{...n.result,scriptSource:"<script source>"}}:n.method==="Debugger.scriptParsed"&&n.params&&Qt(n.params.sourceMapURL)&&(i={...n,params:{...n.params,sourceMapURL:"<data source map url>"}}),this.logger.verbose("cdp.receive",void 0,{connectionId:this._connectionId,message:i});let o=this._sessions.get(n.sessionId||"");if(!o){let c=this._disposedSessions.get(n.sessionId);if(c){let u=(Date.now()-c.getTime())/1e3;this.logger.warn("internal",`Got message for a session disposed ${u} seconds ago`,{sessionId:n.sessionId,disposeOn:c});return}else throw new Error(`Unknown session id: ${n.sessionId} while processing: ${n.method}`)}let s=n.method,a;try{o._onMessage(n)}catch(c){a=c}s&&this.telemetryReporter.reportOperation("cdpOperation",s,t.elapsed().ms,a)}_onTransportClose(){if(!this._closed){this._closed=!0,this._transport.dispose(),this.logger.info("cdp.receive","Connection closed",{connectionId:this._connectionId});for(let e of this._sessions.values())e._onClose();this._sessions.clear(),this._onDisconnectedEmitter.fire()}}close(){this._onTransportClose()}isClosed(){return this._closed}createSession(e){let t=new ay(this,e,this.logger);return this._sessions.set(e,t),t.cdp()}disposeSession(e){let t=this._sessions.get(e);t&&(t._onClose(),this._disposedSessions.set(t.sessionId(),new Date),this._sessions.delete(t.sessionId()))}},m7=+process.version.substring(1).split(".")[0]<11,ay=class{constructor(e,t,n){this.logger=n;this._queue=[];this._prefixListeners=new qd;this._directListeners=new qd;this.paused=!1;this._callbacks=new Map,this._connection=e,this._sessionId=t,this._cdp=this._createApi()}pause(){this.paused=!0}resume(){if(!this.paused)return;this.paused=!1;let e=this._queue;this._queue=[],this.logger.verbose("cdp.receive","Dequeue messages",{message:e});for(let t of e)this._processResponse(t)}cdp(){return this._cdp}sessionId(){return this._sessionId}_createApi(){return new Proxy({},{get:(e,t)=>t==="pause"?()=>this.pause():t==="resume"?()=>this.resume():t==="session"?this:new Proxy({},{get:(n,i)=>{if(i!=="then")return i==="on"?(o,s)=>this.on(`${t}.${o}`,s):o=>this.send(`${t}.${i}`,o)}})})}on(e,t){return this._directListeners.listen(e,t)}onPrefix(e,t){return this._prefixListeners.listen(e,t)}send(e,t={}){return this.sendOrDie(e,t).catch(()=>{})}sendOrDie(e,t={}){if(!this._connection)return Promise.reject(new za(e).setCause(0,"Connection is closed"));let n=this._connection._send(e,t,this._sessionId);return new Promise((i,o)=>{this._callbacks.set(n,{resolve:i,reject:o,from:new za(e),method:e})})}_onMessage(e){if(this.paused&&e.id){this._processResponse(e);return}if(this._queue.length>0){this._queue.push(e);return}if(!m7&&!this.paused){this._processResponse(e);return}this._queue.push(e),this.paused||this._processQueue()}_processQueue(){this._connection?.waitWrapper(()=>{if(this.paused)return;let e=this._queue.shift();e&&(this._processResponse(e),this._queue.length&&this._processQueue())})}_processResponse(e){if(e.id===void 0){let n=e;this._directListeners.emit(n.method,n.params);for(let[i,o]of this._prefixListeners.listeners)n.method.startsWith(i)&&o.fire(n);return}let t=this._callbacks.get(e.id);t&&(this._callbacks.delete(e.id),"error"in e?t.reject(t.from.setCause(e.error.code,e.error.message)):"result"in e&&t.resolve(e.result))}async detach(){if(!this._connection)throw new Error("Session already detached. Most likely the target has been closed.");this._connection._send("Target.detachFromTarget",{},this._sessionId)}isClosed(){return!this._connection}_onClose(){for(let e of this._callbacks.values())e.reject(e.from.setCause(0,"Connection is closed"));this._callbacks.clear(),this._connection=void 0}};function g7(){if(parseInt(process.versions.node,10)>=11)return setImmediate;let r=!1,e=[],t=()=>{let n=e.shift();if(!n){r=!1;return}setImmediate(t),n()};return n=>{e.push(n),r||(r=!0,setImmediate(t))}}var Mu=b(N());var MO=b(ie()),NO=require("path"),FO=require("url");var OO=require("fs");var RO=require("path"),AO=require("worker_threads");var ws=b(PO()),gy=require("crypto"),gx=require("fs"),yx=require("worker_threads");var O7=r=>(0,gy.createHash)("sha256").update(r).digest("hex"),L7=Buffer.from("(function (exports, require, module, __filename, __dirname) { "),M7=Buffer.from(`
});`),N7=Buffer.from("(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { "),F7=Buffer.from(`
}.call(this, exports, require, module, __filename, __dirname); });`),B7=Buffer.from("#!"),j7=Buffer.from("\r")[0],U7=Buffer.from(`
`)[0],q7=(r,e)=>r.slice(0,e.length).equals(e),my=(r,...e)=>{if(r.length!==64)return(0,ws.hash)(e.length===1?e[0]:Buffer.concat(e))===r;let t=(0,gy.createHash)("sha256");for(let o of e)t.update(o);if(t.digest("hex")===r)return!0;let n=e.length===1?e[0]:Buffer.concat(e),i=(0,ws.normalizeShaBuffer)(n);return n===i?!1:(0,gy.createHash)("sha256").update(i).digest("hex")===r},EO=(r,e,t)=>{if(my(e,r))return!0;if(t){if(q7(r,B7)){let n=r.indexOf(U7);return r[n-1]===j7&&n--,my(e,r.subarray(n))}if(my(e,L7,r,M7))return!0}return!!my(e,N7,r,F7)},kO=r=>r instanceof Buffer?r:Buffer.from(r,"utf-8");async function W7(r){switch(r.type){case 0:try{let e=await gx.promises.readFile(r.file);return{id:r.id,hash:r.mode===0?(0,ws.hash)(e):r.mode===2?O7(e):(0,ws.shaHash)(e)}}catch{return{id:r.id}}case 1:try{return{id:r.id,hash:(0,ws.hash)(kO(r.data))}}catch{return{id:r.id}}case 2:try{let e=await gx.promises.readFile(r.file);return{id:r.id,matches:EO(e,r.expected,r.checkNode)}}catch{return{id:r.id,matches:!1}}case 3:try{return{id:r.id,matches:EO(kO(r.data),r.expected,r.checkNode)}}catch{return{id:r.id,matches:!1}}}}function V7(r){r.on("message",e=>{W7(e).then(t=>r.postMessage(t))})}yx.parentPort&&V7(yx.parentPort);var yy=class{constructor(e=3,t=(0,RO.join)(__dirname,"hash.js")){this.maxFailures=e;this.hasherScriptPath=t;this.idCounter=0;this.failureCount=0;this.deferredMap=new Map;this.deferCleanup=QE(3e4,()=>this.cleanup())}async hashBytes(e,t){return(await this.send({type:1,data:t,mode:e,id:this.idCounter++})).hash}async hashFile(e,t){return(await this.send({type:0,file:t,mode:e,id:this.idCounter++})).hash}async verifyBytes(e,t,n){return(await this.send({type:3,data:e,id:this.idCounter++,expected:t,checkNode:n})).matches}async verifyFile(e,t,n){return(await this.send({type:2,file:e,id:this.idCounter++,expected:t,checkNode:n})).matches}dispose(){this.cleanup(),this.deferCleanup.clear()}send(e){let t=this.getProcess();if(!t)throw new Error("hash.js process unexpectedly exited");this.deferCleanup();let n=ke();return this.deferredMap.set(e.id,{deferred:n,request:e}),t.postMessage(e),n.promise}cleanup(){this.instance&&(this.instance.removeAllListeners("exit"),this.instance.terminate(),this.instance=void 0,this.failureCount=0)}getProcess(){if(this.instance)return this.instance;if(this.failureCount>this.maxFailures)return;let e=this.instance=new AO.Worker(this.hasherScriptPath);return e.setMaxListeners(1/0),e.on("message",t=>{let n=t,i=this.deferredMap.get(n.id);i&&(i.deferred.resolve(n),this.deferredMap.delete(n.id))}),e.on("exit",()=>{this.instance=void 0,this.failureCount++;let t=this.getProcess();if(t){this.deferCleanup();for(let{request:n}of this.deferredMap.values())t.postMessage(n)}else{for(let{deferred:n}of this.deferredMap.values())n.reject(new Error("hash.js process unexpectedly exited"));this.deferredMap.clear(),this.deferCleanup.clear()}}),e}};var DO=new yy;async function LO(r,e,t){return!r||AD(r)?void 0:e?(typeof t=="string"?await DO.verifyBytes(t,e,!0):await DO.verifyFile(r,e,!0))?r:void 0:await new Kr(OO.promises).exists(r)?r:void 0}var Ja=class{constructor(e,t,n,i,o,s,a,c){this.url=t;this.inlineScriptOffset=s;this.runtimeScriptOffset=a;this.contentHash=c;this._scripts=[];this.hasBeenAnnounced=!1;this.sourceReference=e.getSourceReference(t),this._contentGetter=ne(i),this._container=e,this.absolutePath=n||"",this._fqname=this._fullyQualifiedName(),this._name=this._humanName(),this.setSourceMapUrl(o),this._existingAbsolutePath=this.checkContentHash(c)}get sendLazy(){return!this.url}checkContentHash(e){return LO(this.absolutePath,this.inlineScriptOffset||this.runtimeScriptOffset?void 0:e,this._container._fileContentOverridesForTest.get(this.absolutePath))}offsetScriptToSource(e){return this.runtimeScriptOffset?{...e,lineNumber:Math.max(1,e.lineNumber-this.runtimeScriptOffset.lineOffset),columnNumber:e.columnNumber-this.runtimeScriptOffset.columnOffset}:e}offsetSourceToScript(e){return this.runtimeScriptOffset?{...e,lineNumber:e.lineNumber+this.runtimeScriptOffset.lineOffset,columnNumber:e.columnNumber+this.runtimeScriptOffset.columnOffset}:e}async equalsDap(e){let t=await this._existingAbsolutePath;return t?!e.sourceReference&&t===e.path:e.sourceReference===this.sourceReference}setSourceMapUrl(e){if(!e){this.sourceMap=void 0;return}this.sourceMap={type:0,sourceByUrl:new Map,value:ke(),metadata:e}}addScript(e){this._scripts.push(e)}filterScripts(e){this._scripts=this._scripts.filter(e)}get scripts(){return this._scripts}get getSuggestedMimeType(){if(this.url.endsWith(".wat"))return"text/wat";if(!/\.[^/]+$/.test(this.url)||this.url.includes("?"))return"text/javascript"}async content(){let e=await this._contentGetter();return this.inlineScriptOffset?.lineOffset&&(e=`
`.repeat(this.inlineScriptOffset.lineOffset)+e),e}async prettyPrint(){if(!this._container)return;if(Ya(this)&&this.sourceMap.metadata.sourceMapUrl.endsWith("-pretty.map")){let c=this.sourceMap.value.settledValue;return c&&{map:c,source:[...this.sourceMap.sourceByUrl.values()][0]}}let e=await this.content();if(!e)return;let t=this.url||`eval://${this.sourceReference}.js`,n=t+"-pretty.map",o=t.split(/[\/\\]/).pop()+"-pretty.js",s=await Y1(o,e,t,n);if(!s)return;this.setSourceMapUrl({compiledPath:this.absolutePath,sourceMapUrl:""}),this.sourceMap.value.resolve(s);let a=this;return await this._container._addSourceMapSources(a,s),{map:s,source:[...a.sourceMap.sourceByUrl.values()][0]}}async toDap(){let e=await this._existingAbsolutePath,t={name:this._name,path:this._fqname,sourceReference:this.sourceReference,presentationHint:this.blackboxed()?"deemphasize":void 0,origin:this.blackboxed()?MO.t("Skipped by skipFiles"):void 0};return e&&(t.sourceReference=0,t.path=e),this.hasBeenAnnounced||(this.hasBeenAnnounced=!0,this._container.emitLoadedSource(this)),t}existingAbsolutePath(){return this._existingAbsolutePath}async prettyName(){let e=await this._existingAbsolutePath;return e||this._fqname}_humanName(){if(pr(this._fqname)){for(let e of this._container.rootPaths)if(Ig(e,this._fqname))return je((0,NO.relative)(e,this._fqname))}return this._fqname}_fullyQualifiedName(){if(!this.url)return"<eval>/VM"+this.sourceReference;if(this.url.endsWith(".repl"))return"repl";if(this.url.startsWith(zn))return Kn+"/"+this.url.slice(zn.length);if(this.absolutePath.startsWith(Kn))return this.absolutePath;if(pr(this.url))return this.url;let e=ct(this.url);if(e)return e;let t=this.url;try{let n=[],i=new FO.URL(this.url);if(i.protocol==="data:")return"<eval>/VM"+this.sourceReference;i.hostname&&n.push(i.hostname),i.port&&n.push("\uA789"+i.port),i.pathname&&n.push(/^\/[a-z]:/.test(i.pathname)?i.pathname.slice(1):i.pathname);let o=i.searchParams?.toString();o&&n.push("?"+o),t=n.join("")}catch{}return t.endsWith("/")&&(t+="(index)"),this.inlineScriptOffset&&(t+=`\uA789${this.inlineScriptOffset.lineOffset+1}:${this.inlineScriptOffset.columnOffset+1}`),t}blackboxed(){return this._container.isSourceSkipped(this.url)}};var of;(n=>{async function r(i){return i.value.promise}n.waitForValue=r;function e(i,o){return i.type===0&&i.value.settledValue?Promise.resolve(i.value.settledValue):Promise.race([r(i),le(o)])}n.waitForValueWithTimeout=e;async function t(i){return await r(i),i.sourceByUrl}n.waitForSources=t})(of||={});var yt=class extends Ja{constructor(){super(...arguments);this.compiledToSourceUrl=new Map}},by=class extends Ja{constructor(t,n,i){super(t,n.url,i,()=>Promise.resolve("Binary content not shown, see the decompiled WAT file"),void 0,void 0,void 0,void 0);this.event=n;this.sourceMap={type:1,value:ke(),sourceByUrl:new Map}}checkContentHash(){return Promise.resolve(void 0)}offsetScriptToSource(t){return t}offsetSourceToScript(t){return t}},Sr=r=>!!r&&r instanceof Ja&&!!r.sourceMap,Ya=r=>Sr(r)&&r.sourceMap.type===0,Xa=r=>Sr(r)&&r.sourceMap.type===1,bx=r=>!!r&&typeof r.getDisassembly=="function";function BO(r,e){if(!e)return r;let{lineNumber:t,columnNumber:n}=r;return e&&(t+=e.lineOffset,t<=1&&(n+=e.columnOffset)),{...r,lineNumber:t,columnNumber:n}}function jO(r,e){if(!e)return r;let{lineNumber:t,columnNumber:n}=r;return e&&(t=Math.max(1,t-e.lineOffset),t<=1&&(n=Math.max(1,n-e.columnOffset))),{...r,lineNumber:t,columnNumber:n}}var UO=r=>({lineNumber:r.lineNumber+1,columnNumber:r.columnNumber+1}),ko=r=>({lineNumber:r.lineNumber-1,columnNumber:r.columnNumber-1});var qO=require("worker_threads");var Du=require("worker_threads");function vx(r){let e=Li(r),t=[],n=(s,{loc:a}=s,{loc:c}=s)=>{if(!a||!c)throw new Error("should include locations");t.push({start:a.start,end:c.end,depth:o.length}),o.push(s)},i=new Set,o=[];return ds(e,{enter:s=>{switch(s.type){case"FunctionDeclaration":case"ArrowFunctionExpression":n(s,s.params[0]||s.body,s.body),i.add(s.body);break;case"Program":n(s);break;case"ForStatement":case"ForOfStatement":case"ForInStatement":n(s),i.add(s.body);break;case"BlockStatement":i.has(s)||n(s);break}},leave:s=>{s===o[o.length-1]&&o.pop()}}),t}Du.isMainThread||Du.parentPort?.postMessage(vx(Du.workerData));var Ou=class r{constructor(e){this.range=e}static hydrate(e,t){let n=new r(new lr(new Rr(e[0].start.line,e[0].start.column),new Rr(e[0].end.line,e[0].end.column))),i=[n],o=1;for(let s=1;s<e.length;s++){let a=e[s];for(;a.depth<o;)o--,i[o].data=t(i[o]);let c=new r(new lr(new Rr(a.start.line,a.start.column),new Rr(a.end.line,a.end.column))),u=i[o-1];u.children??=[],u.children.push(c),i[o++]=c}for(let s=o-1;s>=0;s--)i[s].data=t(i[s]);return n}search(e){if(this.range.contains(e)){if(!this.children)return this;for(let t of this.children){let n=t.search(e);if(n)return n}return this}}findDeepest(e,t){if(this.range.contains(e)){if(this.children)for(let n of this.children){let i=n.findDeepest(e,t);if(i!==void 0)return i}return t(this)}}filterHoist(e){if(this.children)for(let t=0;t<this.children.length;t++){let n=this.children[t];if(n.filterHoist(e),!e(n)){let i=n.children||[];this.children.splice(t,1,...i),t--}}}forEach(e){e(this),this.children?.forEach(t=>t.forEach(e))}forEachDepthFirst(e){this.children?.forEach(t=>t.forEach(e)),e(this)}toJSON(){return{range:this.range,children:this.children}}},$7=1024*512;function WO(r,e){return r.length<$7?Ou.hydrate(vx(r),e):new Promise((t,n)=>{let i=new qO.Worker(`${__dirname}/renameWorker.js`,{workerData:r});i.on("message",o=>t(Ou.hydrate(o,e))),i.on("error",n),i.on("exit",()=>n("rename worker exited"))})}var VO=/[$a-z_][$0-9A-Z_$]*/iy,$O=async(r,e)=>{let t=new gs(r),n=new Set,i=e.decodedMappings(),o=e.names(),s=(u,l,p)=>{let d=u*2147483647+l;if(n.has(d))return;n.add(d);let f=new Ke(u,l),h=t.convert(f);VO.lastIndex=h;let m=VO.exec(r);if(!m)return;let y=m[0];if(y!==p)return y},c=await WO(r,u=>{let l=u.range.begin.base0,p=u.range.end.base0,d;for(let f=l.lineNumber;f<=p.lineNumber;f++){let h=i[f];if(h)for(let m=0;m<h.length;m++){let y=h[m];if(y.length<=4)continue;let I=f,L=y[0];if(I===l.lineNumber&&l.columnNumber>L||I===p.lineNumber&&p.columnNumber<L)continue;let P=o[y[4]],W=s(I,L,P);W&&(d??=[],d.some(E=>E.compiled==W)||d.push({compiled:W,original:P}))}}return d});return c.filterHoist(u=>!!u.data),c};var Ss=Symbol("IRenameProvider"),Lu=class{constructor(e,t,n){this.logger=e;this.sourceMapFactory=t;this.launchConfig=n;this.renames=new Map}provideOnStackframe(e){if(!this.launchConfig.sourceMapRenames)return wn.None;let t=e.uiLocation();return t===void 0?wn.None:"then"in t?t.then(n=>this.provideForSource(n?.source)):this.provideForSource(t?.source)}provideForSource(e){if(!this.launchConfig.sourceMapRenames||!(e instanceof yt))return wn.None;let t=ms(e.compiledToSourceUrl.keys());if(!t)throw new Error("unreachable");if(!Ya(t))return wn.None;let n=this.renames.get(t.url);if(n)return n;let i=this.sourceMapFactory.load(t.sourceMap.metadata).then(async o=>{if(!o?.hasNames)return wn.None;let s=await t.content();return s?await this.createFromSourceMap(o,s):wn.None}).catch(()=>wn.None);return this.renames.set(t.url,i),i}async createFromSourceMap(e,t){let n=Date.now(),i;try{i=await $O(t,e)}catch(s){return this.logger.info("runtime",`Error parsing content for source tree: ${s}}`,{url:e.metadata.compiledPath}),wn.None}let o=Date.now();return this.logger.info("runtime",`renames calculated in ${o-n}ms`,{url:e.metadata.compiledPath}),new wn(i)}};Lu=S([(0,Mu.injectable)(),g(0,(0,Mu.inject)($)),g(1,(0,Mu.inject)(Ui)),g(2,(0,Mu.inject)(we))],Lu);var wn=class r{constructor(e){this.renames=e}static{this.None=new r(new Ou(lr.ZERO))}getOriginalName(e,t){return this.getClosestRename(t,n=>n.compiled===e)?.original}getCompiledName(e,t){return this.getClosestRename(t,n=>n.original===e)?.compiled}getClosestRename(e,t){return this.renames.findDeepest(e,n=>n.data?.find(t))}};var Ro="$returnValue",H7="__js_debug_hoisted_",HO=()=>H7+(0,GO.randomBytes)(8).toString("hex"),Sn=Symbol("IEvaluator"),Nu=class{constructor(e,t,n){this.cdp=e;this.renameProvider=t;this.logger=n}get hasReturnValue(){return!!this.returnValue}setReturnedValue(e){this.returnValue=e}prepare(e,{isInternalScript:t,hoist:n,renames:i,transformRanges:o}={}){t!==!1&&(e+=at());let s=new Map;s.set(Ro,HO());for(let u of n??[])s.set(u,HO());let{transformed:a,hoisted:c}=this.replaceVariableInExpression(e,s,i,o);return c.size?{canEvaluateDirectly:!1,invoke:(u,l)=>Promise.all([...s].map(async([p,d])=>{await this.hoistValue(p===Ro?this.returnValue:await l?.(p),d)||(a=a.replaceAll(d,p))})).then(()=>this.cdp.Debugger.evaluateOnCallFrame({...u,expression:a}))}:{canEvaluateDirectly:!0,invoke:u=>this.cdp.Debugger.evaluateOnCallFrame({...u,expression:a})}}async evaluate(e,t={}){if(!("callFrameId"in e))return this.cdp.Runtime.evaluate(e);let n={...t},{location:i,stackFrame:o}=t,s;if(i)await Promise.all([Promise.resolve(this.renameProvider.provideForSource(i.source)).then(a=>{n.renames={mapping:a,position:i.position}}),o&&this.setupShadowedVariableHoisting(i,o).then(a=>{a&&(s=a.doHoist,n.hoist=[...a.hoistable])})]);else if(o){let a=await this.renameProvider.provideOnStackframe(o);n.renames={mapping:a,position:o.rawPosition}}return this.prepare(e.expression,n).invoke(e,s)}async hoistValue(e,t){if(e===void 0)return!1;let n=e?.objectId,i=`setTimeout(() => { delete globalThis.${t} }, 0)`,o;return n?o=await this.cdp.Runtime.callFunctionOn({objectId:n,functionDeclaration:`function() { globalThis.${t} = this; ${i}; ${at()} }`}):o=await this.cdp.Runtime.evaluate({expression:`globalThis.${t} = ${JSON.stringify(e?.value)};${i};`+at()}),!!o&&!o.exceptionDetails}async setupShadowedVariableHoisting({position:e,source:t,variables:n},i){let{scopes:o}=await i.scopes(),s=await p1(o,async u=>u.source&&u.line&&u.endLine&&new lr(new tt(u.line,u.column||1),new tt(u.endLine,u.endColumn||1/0)).contains(e)&&await t.equalsDap(u.source));if(s===-1)return;this.logger.verbose("runtime",`Evaluating expression in scope ${o[s].name}`);let a=new Set;return await Promise.all(o.slice(0,s).map(async u=>{let l=await n.getVariableNames({variablesReference:u.variablesReference});for(let{name:p}of l)a.add(p)})),{hoistable:a,doHoist:async u=>{for(let l=s;l<o.length;l++)return(await n.getVariableNames({variablesReference:o[l].variablesReference})).find(d=>d.name===u)?.remoteObject}}}replaceVariableInExpression(e,t,n,i){let o=new Set,s=!1,a=(d,f)=>({type:"ConditionalExpression",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:!0,argument:{type:"Identifier",name:d}},operator:"!==",right:{type:"Literal",value:"undefined"}},consequent:{type:"Identifier",name:d},alternate:f}),c=[],u=Li(e),l=Wg(u,{enter(d,f){let h=d;if(d.type!=="Identifier"||e[h.start-1]===".")return;if(i){if(!d.loc)throw new Error("Node should have location");let I=new lr(new Rr(d.loc.start.line,d.loc.start.column),new Rr(d.loc.end.line,d.loc.end.column));if(!i.some(L=>L.containsRange(I)))return}let m=t.get(d.name);if(m)return o.add(d.name),s=!0,{replace:ix(d,f)?{type:"Identifier",name:m}:a(m,G7)};let y=n?.mapping.getCompiledName(d.name,n.position);if(y)return s=!0,{replace:ix(d,f)?{type:"Identifier",name:y}:a(y,d)}},leave:()=>{c.pop()}});if(!s)return{hoisted:o,transformed:e};let p=u.body[u.body.length-1].end;return{hoisted:o,transformed:To(l)+e.slice(p)}}};Nu=S([(0,Fu.injectable)(),g(0,(0,Fu.inject)(nt)),g(1,(0,Fu.inject)(Ss)),g(2,(0,Fu.inject)($))],Nu);var G7={type:"Identifier",name:"undefined"};var vy=class r{static parse(e,t,n,i){t=wx(t,n);let o=t&&fs(t);if(o)throw new F(ls(e,o.message));let{canEvaluateDirectly:s,invoke:a}=i.prepare(t);return new r(s?t:a)}constructor(e){typeof e=="function"?this.invoke=e:this.breakCondition=e}async shouldStayPaused(e){return this.invoke?(await this.invoke({callFrameId:e.callFrames[0].callFrameId,returnByValue:!0}))?.result.value===!0:Promise.resolve(!0)}},wx=(r,e)=>`(()=>{try{return ${r};}catch(e){console.error(\`Breakpoint condition error: \${e.message||e}\`);return ${!!e}}})()`;var z7=/^(>|>=|={1,3}|<|<=|%)?\s*([0-9]+)$/,Bu=class r{constructor(e){this.predicate=e;this.hits=0;this.breakCondition=void 0}shouldStayPaused(){return Promise.resolve(this.predicate(++this.hits))}static parse(e){let t=z7.exec(e);if(!t)throw new F(JI(e));let[,n="=",i]=t;return new r(K7(e,n,Number(i)))}},K7=(r,e,t)=>{switch(e){case"=":case"==":case"===":return n=>n===t;case">":return n=>n>t;case">=":return n=>n>=t;case"<":return n=>n<t;case"<=":return n=>n<=t;case"%":return n=>n%t===0;default:throw new F(JI(r))}};var zO=require("crypto"),Sy=b(N());var wy=class{constructor(e){this.invoke=e;this.breakCondition=void 0}async shouldStayPaused(e){return await this.invoke({callFrameId:e.callFrames[0].callFrameId}),!1}};var Qa=class{constructor(e,t){this.breakCondition=t;let n=t&&fs(t);if(n)throw new F(ls(e,n.message))}shouldStayPaused(){return Promise.resolve(!0)}};var _s=class{constructor(e){this.evaluator=e}compile(e,t){let n=this.logMessageToExpression(t),i=fs(n);if(i)throw new F(ls(e,i.message));let{canEvaluateDirectly:o,invoke:s}=this.evaluator.prepare(n);return o?new Qa(e,this.logMessageToExpression(t)):new wy(s)}serializeLogStatements(e){return z1([],e,!1)}logMessageToExpression(e){let t=u=>u.replace(/%/g,"%%"),n=[],i=[],o=0;for(;;){let u=e.indexOf("{",o);if(u===-1){n.push(t(e.slice(o)));break}n.push(t(e.slice(o,u)));let[l]=Kd(e.slice(u));if(o=u+l.end,o-1===u+1||e[o-1]!=="}"){n.push(t(e.slice(u,o)));continue}if(l.type!=="BlockStatement")break;l.body.length===1&&l.body[0].type==="BlockStatement"&&(l.body=Kd(`(${e.slice(u+1,o-2)}})`)),i.push(To(this.serializeLogStatements(l.body))),n.push("%O")}let a=`console.log(${[JSON.stringify(n.join("")),...i].join(", ")}), false`,c=(0,zO.createHash)("sha256").update(a).digest("hex").slice(0,7);return a+`
//# sourceURL=logpoint-${c}.cdp`}};_s=S([(0,Sy.injectable)(),g(0,(0,Sy.inject)(Sn))],_s);var J7=new Qa({line:0},void 0),_de=new Qa({line:0},"false"),_y=Symbol("IBreakpointConditionFactory"),ju=class{constructor(e,t,n){this.logPointCompiler=e;this.evaluator=t;this.breakOnError=n.__breakOnConditionalError}getConditionFor(e){return e.condition?vy.parse(e,e.condition,this.breakOnError,this.evaluator):e.logMessage?this.logPointCompiler.compile(e,e.logMessage):e.hitCondition?Bu.parse(e.hitCondition):J7}};ju=S([(0,Uu.injectable)(),g(0,(0,Uu.inject)(_s)),g(1,(0,Uu.inject)(Sn)),g(2,(0,Uu.inject)(we))],ju);var Cy=require("path");var Iy=(r,e)=>r.lineNumber===e.lineNumber&&r.columnNumber===e.columnNumber;var xy=r=>!("location"in r),KO=r=>"location"in r,Y7=(r,e)=>r.url&&e===r.url||r.urlRegex&&new RegExp(r.urlRegex).test(e),qu=class{constructor(e,t,n){this._manager=e;this._source=t;this._originalPosition=n;this.isEnabled=!1;this.setInCdpScriptIds=new Set;this.cdpScriptIds=this.setInCdpScriptIds;this.cdpBreakpoints=[];this._cdpIds=new Set}get enabled(){return this.isEnabled}get cdpIds(){return this._cdpIds}get source(){return this._source}get originalPosition(){return this._originalPosition}async updateSourceLocation(e,t,n){this._source=t,this._originalPosition=n;let i=[];for(let o of this.cdpBreakpoints)o.state===1&&i.push(this.updateUiLocations(e,o.cdpId,o.locations));await Promise.all(i)}async refreshUiLocations(e){await Promise.all(this.cdpBreakpoints.filter(t=>t.state===1).map(t=>this.updateUiLocations(e,t.cdpId,t.locations)))}async enable(e){if(this.isEnabled)return;this.isEnabled=!0;let t=[this._setPredicted(e)],n=this._manager._sourceContainer.source(this.source);if((!n||!(n instanceof yt))&&t.push(this._setByPath(e,n?.offsetSourceToScript(this.originalPosition)||this.originalPosition)),await Promise.all(t),n&&this.isEnabled){let i=await this._manager._sourceContainer.currentSiblingUiLocations({lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber,source:n});await Promise.all(i.map(o=>this._setByUiLocation(e,n.offsetSourceToScript(o))))}}async updateUiLocations(e,t,n){this.updateExistingCdpRef(t,a=>({...a,locations:n}));let i=(await Promise.all(n.map(a=>e.rawLocationToUiLocation(e.rawLocation(a))))).find(a=>!!a);if(!i)return;let o=this._manager._sourceContainer.source(this.source);if(!o)return;let s=await this._manager._sourceContainer.currentSiblingUiLocations(i);this.updateExistingCdpRef(t,a=>{let c=s.filter(u=>u.source===o);return{...a,locations:n,uiLocations:c.length?c:s}})}compare(e){let t=this.originalPosition,n=e.originalPosition;return t.lineNumber!==n.lineNumber?t.lineNumber-n.lineNumber:t.columnNumber-n.columnNumber}async disable(){if(!this.isEnabled)return;this.isEnabled=!1;let e=this.cdpBreakpoints.map(t=>this.removeCdpBreakpoint(t));await Promise.all(e)}async updateForNewLocations(e,t){let n=this._manager._sourceContainer.source(this.source);if(!n)return[];let i=await this._manager._sourceContainer.currentSiblingUiLocations({lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber,source:n},await t.source);if(!i.length)return[];let o=[];for(let s of i)o.push(this._setForSpecific(e,t,n.offsetSourceToScript(s)));for(let s of this.cdpBreakpoints){if(!xy(s.args)||!Y7(s.args,t.url))continue;let a=s.args;i.some(c=>c.columnNumber-1===a.columnNumber&&c.lineNumber-1===a.lineNumber)||(this._manager.logger.verbose("runtime.sourcemap","Adjusted breakpoint due to overlaid sourcemap",{url:n.url}),o.push(this.removeCdpBreakpoint(s)))}return await Promise.all(o),i}executionContextWasCleared(){this.updateCdpRefs(e=>e.filter(t=>xy(t.args)))}hasResolvedAt(e,t){let{lineNumber:n,columnNumber:i}=t.base0;return this.cdpBreakpoints.some(o=>o.state===1&&o.locations.some(s=>s.scriptId===e&&s.lineNumber===n&&(s.columnNumber===void 0||s.columnNumber===i)))}getBreakCondition(){}updateExistingCdpRef(e,t){this.updateCdpRefs(n=>n.map(i=>i.state!==1||i.cdpId!==e?i:t(i)))}updateCdpRefs(e){let t=this;t.cdpBreakpoints=e(this.cdpBreakpoints);let n=new Set;this.setInCdpScriptIds.clear();for(let i of this.cdpBreakpoints)if(i.state===1){n.add(i.cdpId);for(let o of i.locations)this.setInCdpScriptIds.add(o.scriptId)}this._cdpIds=n}async _setPredicted(e){if(!this.source.path||!this._manager._breakpointsPredictor)return;let t=this._manager._breakpointsPredictor.predictedResolvedLocations({absolutePath:this.source.path,lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber}),n=[];for(let i of t){let o=this._manager._sourceContainer.sourcePathResolver.absolutePathToUrlRegexp(i.absolutePath);o!==void 0&&(typeof o=="string"?n.push(this._setByUrlRegexp(e,o,i)):n.push(o.then(s=>s?this._setByUrlRegexp(e,s,i):void 0)))}await Promise.all(n)}async _setByUiLocation(e,t){await Promise.all(t.source.scripts.map(n=>this._setForSpecific(e,n,t)))}async _setByPath(e,t){let n=this._manager._sourceContainer.source({path:this.source.path});if(!(n instanceof yt&&[...n.compiledToSourceUrl.keys()].some(o=>o.absolutePath===this.source.path)))if(this.source.path){let i=await this._manager._sourceContainer.sourcePathResolver.absolutePathToUrlRegexp(this.source.path);if(!i)return;await this._setByUrlRegexp(e,i,t)}else{let o=this._manager._sourceContainer.source(this.source)?.url;if(!o)return;await this._setByUrl(e,o,t),this.source.path!==o&&this.source.path!==void 0&&await this._setByUrl(e,Ae(this.source.path),t)}}hasSetOnLocation(e,t){return this.cdpBreakpoints.find(n=>e.scriptId&&KO(n.args)&&n.args.location.scriptId===e.scriptId&&Iy(n.args.location,t)||e.url&&!e.hasSourceURL&&xy(n.args)&&(n.args.urlRegex?new RegExp(n.args.urlRegex).test(e.url):e.url===n.args.url)&&Iy(n.args,t))}hasSetOnLocationByUrl(e,t,n){return this.cdpBreakpoints.find(i=>{if(xy(i.args))return Iy(i.args,n)?e==="url"?i.args.urlRegex?new RegExp(i.args.urlRegex).test(t):i.args.url===t:e==="re"&&i.args.urlRegex===t:!1;let o=this._manager._sourceContainer.getScriptById(i.args.location.scriptId);if(o)return Iy(i.args.location,n)&&e==="re"?new RegExp(t).test(o.url):o.url===t})}async _setForSpecific(e,t,n){return t.url&&!t.hasSourceURL&&(!t.embedderName||t.embedderName===t.url)?this._setByUrl(e,t.url,n):this._setByScriptId(e,t,n)}async _setByUrl(e,t,n){n=ko(n);let i=this.hasSetOnLocationByUrl("url",t,n);if(i){i.state===0&&await i.done;return}return this._setAny(e,{url:t,condition:this.getBreakCondition(),...n})}async _setByUrlRegexp(e,t,n){n=ko(n);let i=this.hasSetOnLocationByUrl("re",t,n);if(i){i.state===0&&await i.done;return}return this._setAny(e,{urlRegex:t,condition:this.getBreakCondition(),...n})}async _setByScriptId(e,t,n){n=ko(n);let i=this.hasSetOnLocation(t,n);if(i){i.state===0&&await i.done;return}return this._setAny(e,{condition:this.getBreakCondition(),location:{scriptId:t.scriptId,...n}})}async _setAny(e,t){if(!this.isEnabled)return;let n={state:0,args:t,deadletter:!1};n.done=(async()=>{let i=KO(t)?await e.cdp().Debugger.setBreakpoint(t):await e.cdp().Debugger.setBreakpointByUrl(t);if(!i)return;if(n.deadletter){await e.cdp().Debugger.removeBreakpoint({breakpointId:i.breakpointId});return}let o="actualLocation"in i?[i.actualLocation]:i.locations;this._manager._resolvedBreakpoints.set(i.breakpointId,this);let s={state:1,cdpId:i.breakpointId,args:t,locations:o,uiLocations:[]};return this.updateCdpRefs(a=>a.map(c=>c===n?s:c)),await this.updateUiLocations(e,i.breakpointId,o),s})(),this.updateCdpRefs(i=>[...i,n]),await n.done}async removeCdpBreakpoint(e){this.updateCdpRefs(t=>t.filter(n=>n!==e)),e.state===0?(e.deadletter=!0,await e.done):(await this._manager._thread?.cdp().Debugger.removeBreakpoint({breakpointId:e.cdpId}),this._manager._resolvedBreakpoints.delete(e.cdpId))}};var Vi=class r extends qu{constructor(t,n,i){super(t,n,{lineNumber:1,columnNumber:1});this.mode=i}static getModeKeyForSource(t,n){return t===1?(0,Cy.basename)(n,(0,Cy.extname)(n)||void 0):n}_setPredicted(){return Promise.resolve()}_setByPath(t,n){if(!this.source.path)return Promise.resolve();let i=r.getModeKeyForSource(this.mode,this.source.path);return this.mode===1?super._setByUrlRegexp(t,wr(i),n):super._setByPath(t,n)}};var YO=b(ie());var _n=class extends qu{constructor(t,n,i,o,s){super(t,i,{lineNumber:o.line,columnNumber:o.column||1});this.dapId=n;this.dapParams=o;this.condition=s;this.completedSet=ke()}equivalentTo(t){return t.dapParams.column===this.dapParams.column&&t.dapParams.line===this.dapParams.line&&t.dapParams.hitCondition===this.dapParams.hitCondition&&t.dapParams.condition===this.dapParams.condition&&t.dapParams.logMessage===this.dapParams.logMessage}untilSetCompleted(){return this.completedSet.promise}markSetCompleted(){this.completedSet.resolve()}testHitCondition(t){return this.condition.shouldStayPaused(t)}async toDap(){let t=this.getResolvedUiLocation();this.lastAnnouncedUiLocation=t;let n=this.enabled&&t;return n?{id:this.dapId,verified:!0,source:await n.source.toDap(),line:n.lineNumber,column:n.columnNumber}:{id:this.dapId,verified:!1,message:YO.t("Unbound breakpoint")}}diagnosticDump(){return{source:this.source,params:this.dapParams,cdp:this.cdpBreakpoints}}getBreakCondition(){return this.condition.breakCondition}updateCdpRefs(t){super.updateCdpRefs(t),this.getResolvedUiLocation()!==this.lastAnnouncedUiLocation&&this.notifyResolved()}getResolvedUiLocation(){for(let t of this.cdpBreakpoints)if(t.state===1&&t.uiLocations.length)return t.uiLocations[0]}async notifyResolved(){await this.completedSet.promise,await this._manager.notifyBreakpointChange(this,!0)}};var Ty=class extends _n{constructor(e,t,n,i){super(e,t,n,i,new Bu(()=>!1))}getResolvedUiLocation(){}};var nM=b(lf());var pf=class extends Vi{constructor(t,n){super(t,{path:n},1);this.pattern=n}async enable(t){if(this.isEnabled)return;this.isEnabled=!0;let n=(0,nM.makeRe)(je(this.pattern),{contains:!0,lookbehinds:!1});await this._setAny(t,{urlRegex:n.source.replace(/([a-z]):/i,(i,o)=>`[${o.toLowerCase()}${o.toUpperCase()}]:`),lineNumber:0,columnNumber:0})}};var Hu=b(N());var Is={dispose:()=>{}},pe=class{constructor(e){this.disposed=!1;this.items=[];e&&(this.items=e.slice())}get isDisposed(){return this.disposed}callback(...e){for(let t of e)this.push({dispose:t})}push(...e){return this.disposed?(e.forEach(t=>t.dispose()),e[0]):(this.items.push(...e),e[0])}disposeObject(e){this.items=this.items.filter(t=>t!==e),e.dispose()}clear(){let e=Promise.all(this.items.map(t=>t.dispose()));return this.items=[],e}dispose(){let e=Promise.all(this.items.map(t=>t.dispose()));return this.items=[],this.disposed=!0,e}};var $u=Symbol("IExperimentationService");var xt=Symbol("ITelemetryReporter");var dY=/\/node_modules\/|^node\:/,fY=2,iM=5e3,hY=iM/2,it=class{constructor(e,t,n){this.telemetry=t;this.experimentation=n;this.disposable=new pe;this.hadBreakpoint=!1;this.didVerifyBreakpoint=!1;this.hadNonModuleSourcemap=!1;this.startedAt=Date.now();this.disposable.push(it.didVerifyEmitter.event(()=>{this.didVerifyBreakpoint=!0})),it.consecutiveQualifyingSessions>=fY&&this.disposable.push(l1(async()=>{this.currentlyQualifying&&await this.experimentation.getTreatment("diagnosticPrompt",!0)&&(t.report("diagnosticPrompt",{event:"suggested"}),it.didSuggest=!0,e.suggestDiagnosticTool({}))},iM))}get currentlyQualifying(){return this.hadBreakpoint&&!this.didVerifyBreakpoint&&this.hadNonModuleSourcemap}notifyHadBreakpoint(){this.hadBreakpoint=!0}notifyVerifiedBreakpoint(){this.didVerifyBreakpoint||(it.didVerifyEmitter.fire(),it.didSuggest&&(it.didSuggest=!1,this.telemetry.report("diagnosticPrompt",{event:"resolved"})))}attach(e){if(!this.hadNonModuleSourcemap){let t=this.disposable.push(e.Debugger.on("scriptParsed",n=>{n.sourceMapURL&&!dY.test(n.url)&&(this.hadNonModuleSourcemap=!0,this.disposable.disposeObject(t))}))}}dispose(){this.currentlyQualifying&&Date.now()-hY>this.startedAt?it.consecutiveQualifyingSessions++:it.consecutiveQualifyingSessions=0,this.disposable.dispose()}};it.consecutiveQualifyingSessions=0,it.didVerifyEmitter=new O,it.didSuggest=!1,it=S([(0,Hu.injectable)(),g(0,(0,Hu.inject)(Su)),g(1,(0,Hu.inject)(xt)),g(2,(0,Hu.inject)($u))],it);var xn=b(N());function mY(r){let e=[];for(let t=0,n=r.length;t<n;++t){let i=r.charCodeAt(t);if(i<128)e.push(i);else if(i<2048)e.push(192|i>>6,128|i&63);else if(i<55296||i>=57344)e.push(224|i>>12,128|i>>6&63,128|i&63);else{let o=65536+((i&1023)<<10|r.charCodeAt(++t)&1023);e.push(240|o>>18&7,128|o>>12&63,128|o>>6&63,128|o&63)}}return new Uint8Array(e)}var oM=mY;var Gu=2654435761,zu=2246822519,Ly=3266489917,sM=668265263,aM=374761393;function Bx(r,e=0){r=typeof r=="string"?oM(r):r;let t=r,n=e+aM&4294967295,i=0;if(t.length>=16){let s=[e+Gu+zu&4294967295,e+zu&4294967295,e+0&4294967295,e-Gu&4294967295],a=r,c=a.length-16,u=0;for(i=0;(i&4294967280)<=c;i+=4){let l=i,p=a[l+0]+(a[l+1]<<8),d=a[l+2]+(a[l+3]<<8),f=p*zu+(d*zu<<16),h=s[u]+f&4294967295;h=h<<13|h>>>19;let m=h&65535,y=h>>>16;s[u]=m*Gu+(y*Gu<<16)&4294967295,u=u+1&3}n=(s[0]<<1|s[0]>>>31)+(s[1]<<7|s[1]>>>25)+(s[2]<<12|s[2]>>>20)+(s[3]<<18|s[3]>>>14)&4294967295}n=n+r.length&4294967295;let o=r.length-4;for(;i<=o;i+=4){let s=i,a=t[s+0]+(t[s+1]<<8),c=t[s+2]+(t[s+3]<<8),u=a*Ly+(c*Ly<<16);n=n+u&4294967295,n=n<<17|n>>>15,n=(n&65535)*sM+((n>>>16)*sM<<16)&4294967295}for(;i<t.length;++i){let s=t[i];n=n+s*aM,n=n<<11|n>>>21,n=(n&65535)*Gu+((n>>>16)*Gu<<16)&4294967295}return n=n^n>>>15,n=((n&65535)*zu&4294967295)+((n>>>16)*zu<<16),n=n^n>>>13,n=((n&65535)*Ly&4294967295)+((n>>>16)*Ly<<16),n=n^n>>>16,n<0?n+4294967296:n}var Ku=Symbol("IContainer"),Gi=Symbol("StoragePath"),Or=Symbol("IInitializeParams"),Ft=Symbol("VSCodeApi"),tc=Symbol("IsVSCode"),$e=Symbol("ExtensionContext"),jx=Symbol("ProcessEnv"),Ux=Symbol("execa"),ue=Symbol("FS"),Zn="ExtensionLocation",rc=Symbol("IBrowserFinder"),kfe=Symbol("DwarfDebugging"),Ju=Symbol("SessionSubStates"),My=new WeakMap,De=(r,e)=>{if(!(typeof e=="object"&&e&&"dispose"in e))return e;let t=e,n=My.get(r.container);return n?n.push(t):My.set(r.container,[t]),e},Ny=r=>{My.get(r)?.forEach(e=>e.dispose()),My.delete(r)},dr=Symbol("IExtensionContribution"),Do=Symbol("IDebugTerminalOptionsProviders");var By=b(N());var cM=b(require("fs")),Fy=b(require("path")),uM=r=>{let e={};f(e);function t(m,y){return r({category:"telemetry",output:m,data:y})}let n=m=>t("js-debug/dap/operation",{...e,...m}),i=m=>t("js-debug/cdp/operation",{...e,...m}),o=m=>t("js-debug/error",{...e,...m}),s=m=>t("blazor-debug/blazorDebugException",{...e,...m}),a=m=>{e.browser=(m.targetProject||m.targetProject)+"/"+m.targetVersion,t("js-debug/browserVersion",{...e,...m})},c=m=>t("js-debug/breakpointStats",{...e,...m}),u=m=>t("js-debug/statistics",{...e,...m}),l=m=>{e.nodeVersion=m.version,t("js-debug/nodeRuntime",{...e,...m})},p=m=>{t("js-debug/launch",{...e,...m,parameters:JSON.stringify(m.parameters)})},d=m=>{t("js-debug/diagnosticPrompt",{...e,...m})};function f(m){try{let y=Fy.resolve(Fy.dirname(__filename),"..","..",".gitcommit");m.jsDebugCommitId=cM.readFileSync(y,"utf8")}catch{}}return{breakpointStats:c,statistics:u,browserVersion:a,cdpOperation:i,dapOperation:n,error:o,launch:p,nodeRuntime:l,diagnosticPrompt:d,setGlobalMetric:(m,y)=>{e[m]=y},blazorDebugException:s}};var df=class{constructor(e=!0){this.isVSCode=e;this.measurements=Object.create(null)}add(e,t,n){let i=this.measurements[e];i||(i=this.measurements[e]={times:[],errors:[]}),i.times.push(t),n&&i.errors.push(n)}flush(){let e={errors:[]};for(let t in this.measurements){let{times:n,errors:i}=this.measurements[t],o={operation:t,totalTime:0,max:0,avg:0,stddev:0,count:n.length,failed:i.length};for(let s of n)o.totalTime+=s,o.max=Math.max(o.max,s);o.avg=o.totalTime/o.count;for(let s of n)o.stddev+=(s-o.avg)**2;o.stddev=Math.sqrt(o.stddev/(n.length-1)),e[o.operation]=o,e[`!${o.operation}.errors`]=i,this.isVSCode||(e[`${o.operation}.errors`]=i)}return this.measurements=Object.create(null),e}};var Lr=class{constructor(e=!0){this.isVsCode=e;this.target=[];this.flushEmitter=new O;this.loggers=uM(e=>this.pushOutput(e));this.batchFlushTimeout={};this.batchers={dapOperation:new df(this.isVsCode),cdpOperation:new df(this.isVsCode)};this.onFlush=this.flushEmitter.event;this.setGlobalMetric=this.loggers.setGlobalMetric}report(e,...t){let n=this.loggers[e];n(...t)}reportOperation(e,t,n,i){this.batchers[e].add(t,n,i),this.batchFlushTimeout[e]===void 0&&(this.batchFlushTimeout[e]=setTimeout(()=>{this.report(e,this.batchers[e].flush()),this.batchFlushTimeout[e]=void 0},Lr.batchFlushInterval))}attachDap(e){this.target instanceof Array&&this.target.forEach(t=>e.output(t)),this.target=e}flush(){this.flushEmitter.fire();let e=Object.entries(this.batchFlushTimeout);for(let[t,n]of e){let i=this.batchers[t].flush();i.length&&this.report(t,i),this.batchFlushTimeout[t]=void 0,clearTimeout(n)}}dispose(){for(let e of Object.values(this.batchFlushTimeout))e&&clearTimeout(e)}pushOutput(e){e.data=qx(e.data),this.target instanceof Array?this.target.push(e):this.target.output(e)}};Lr.batchFlushInterval=5e3,Lr=S([(0,By.injectable)(),g(0,(0,By.inject)(tc))],Lr);var qx=r=>typeof r=="number"?Number(r.toFixed(1)):typeof r!="object"||!r?r:r instanceof Error?Wx(r):r instanceof Array?r.map(qx):go(r,qx),lM=/(?:[A-z]:)?(?:[\\/][^:]*)+[\\/]([^:]*:)/g;function Wx(r){let e=String(r.message),t=String(r.name);lM.lastIndex=0;let n=typeof r.stack=="string"?r.stack.replace(lM,"$1"):void 0;return{error:{message:e,name:t,stack:n}}}var fM=require("crypto"),zi=b(N());var nc=Symbol("IDwarfModuleProvider");var qy=Symbol("IWasmSymbolProvider"),$x=Symbol("IWasmWorkerFactory"),Wy=r=>r.replace(/\.wasm$/i,"")+".wat",Yu=class{constructor(e,t){this.dwarf=e;this.launchConfig=t;this.cdpCounter=0;this.cdp=new Map;this.prompt=ne(()=>this.dwarf.prompt())}async spawn(e){if(!this.launchConfig.enableDWARF)return null;this.worker??=this.dwarf.load().then(i=>{if(!i)return null;let o=i.spawn({getWasmGlobal:(s,a)=>this.loadWasmValue(`globals[${s}]`,a),getWasmLocal:(s,a)=>this.loadWasmValue(`locals[${s}]`,a),getWasmOp:(s,a)=>this.loadWasmValue(`stack[${s}]`,a),getWasmLinearMemory:(s,a,c)=>this.loadWasmValue(`[].slice.call(new Uint8Array(memories[0].buffer, ${+s}, ${+a}))`,c).then(u=>new Uint8Array(u).buffer)});return o.rpc.sendMessage("hello",[],!1),o});let t=await this.worker;if(!t)return null;let n=this.cdpCounter++;return this.cdp.set(n,e),{rpc:t.rpc,getStopId:i=>`${n}:${i}`,dispose:()=>(this.cdp.delete(n),this.cdp.size>0?Promise.resolve():(this.worker=void 0,t.dispose()))}}async dispose(){await this.worker?.then(e=>e?.dispose()),this.worker=Promise.resolve(null)}async loadWasmValue(e,t){let n=t,i=n.indexOf(":"),o=n.substring(0,i),s=n.substring(i+1),a=await this.cdp.get(+o)?.Debugger.evaluateOnCallFrame({callFrameId:s,expression:e+at(),silent:!0,returnByValue:!0,throwOnSideEffect:!0});if(!a||a.exceptionDetails)throw new Error(`evaluate failed: ${a?.exceptionDetails?.text||"unknown"}`);return a.result.value}};Yu=S([(0,zi.injectable)(),g(0,(0,zi.inject)(nc)),g(1,(0,zi.inject)(we))],Yu);var Xu=class{constructor(e,t,n,i){this.dwarf=e;this.cdp=t;this.logger=n;this.launchConfig=i;this.worker=ne(()=>this.dwarf.spawn(this.cdp))}async loadWasmSymbols(e){if(!this.launchConfig.enableDWARF)return this.defaultSymbols(e);let t=await this.worker();if(!t){let l=this.defaultSymbols(e);return l.onDidDisassemble=this.dwarf.prompt,l}let{rpc:n}=t,i=(0,fM.randomUUID)(),o;try{let l=e.debugSymbols;if(gY(l)&&l.externalURL)o=new URL(l.externalURL);else if(Array.isArray(l)){let p=e.debugSymbols?.find(d=>(d.type==="EmbeddedDWARF"||d.type==="ExternalDWARF")&&d.externalURL);p?.externalURL&&(o=new URL(p.externalURL))}}catch{}let s=new URL(e.url),a=s.hostname==="localhost"?["127.0.0.1","[::1]","localhost"]:[s.hostname],c=o?.hostname==="localhost",u;for(let l of a){s.hostname=l,o&&c&&(o.hostname=l);try{u=await n.sendMessage("addRawModule",i,o?.toString(),{url:s.toString(),code:!o&&s.protocol.startsWith("wasm:")?await this.getBytecode(e.scriptId):void 0});break}catch(p){this.logger.warn("sourcemap.parsing",`failed to load wasm symbols for ${s}`,{error:p})}}return u?!(u instanceof Array)||u.length===0?(n.sendMessage("removeRawModule",i),this.defaultSymbols(e)):(this.logger.info("sourcemap.parsing","parsed files from wasm",{files:u}),new Vx(e,this.cdp,i,t,u)):this.defaultSymbols(e)}async dispose(){await this.worker.value?.then(e=>e?.dispose())}defaultSymbols(e){return new jy(e,this.cdp,[])}async getBytecode(e){let n=(await this.cdp.Debugger.getScriptSource({scriptId:e}))?.bytecode;return n?Buffer.from(n,"base64").buffer:void 0}};Xu=S([(0,zi.injectable)(),g(0,(0,zi.inject)($x)),g(1,(0,zi.inject)(nt)),g(2,(0,zi.inject)($)),g(3,(0,zi.inject)(we))],Xu);var gY=r=>!!r?.externalURL;var jy=class{constructor(e,t,n){this.event=e;this.cdp=t;this.doDisassemble=ne(async()=>{let e=[],t;for await(let n of this.getDisassembledStream()){e=e.concat(n.lines);let i;if(t){let o=new Uint32Array(t.length+n.lines.length);i=t.length,o.set(t),t=o}else t=new Uint32Array(n.lines.length),i=0;for(let o=0;o<n.lines.length;o++)t[i+o]=n.bytecodeOffsets[o]}return t??=new Uint32Array(0),{lines:e,byteOffsetsOfLines:t}});this.decompiledUrl=Wy(e.url),n.push(this.decompiledUrl),this.files=n}async getDisassembly(){let{lines:e}=await this.doDisassemble();return this.onDidDisassemble?.(),e.join(`
`)}originalPositionFor(e){return this.disassembledPositionFor(e)}async disassembledPositionFor(e){let{byteOffsetsOfLines:t}=await this.doDisassemble(),n=nO(t,e.base0.columnNumber,(i,o)=>i-o);if(n!==t.length)return{url:this.decompiledUrl,position:new Ke(n,0)}}async compiledPositionFor(e,t){if(e!==this.decompiledUrl)return[];let{byteOffsetsOfLines:n}=await this.doDisassemble(),{lineNumber:i}=t.base0;if(i>=n.length)return[];let o=n[t.base0.lineNumber];return[new Ke(0,o)]}dispose(){}async*getDisassembledStream(){let{scriptId:e}=this.event,t=await this.cdp.Debugger.disassembleWasmModule({scriptId:e});if(t)for(yield t.chunk;t.streamId;){let n=await this.cdp.Debugger.nextWasmDisassemblyChunk({streamId:t.streamId});if(!n)return;yield n.chunk}}},Vx=class extends jy{constructor(t,n,i,o,s){super(t,n,s);this.moduleId=i;this.worker=o;this.mappedLines=new Map}get codeOffset(){return this.event.codeOffset||0}async originalPositionFor(t){let n=await this.worker.rpc.sendMessage("rawLocationToSourceLocation",{codeOffset:t.base0.columnNumber-this.codeOffset,inlineFrameIndex:t.base0.lineNumber,rawModuleId:this.moduleId});return n.length?{position:new Ke(n[0].lineNumber,n[0].columnNumber),url:n[0].sourceFileURL}:super.originalPositionFor(t)}async compiledPositionFor(t,n){if(t===this.decompiledUrl)return super.compiledPositionFor(t,n);let{lineNumber:i,columnNumber:o}=n.base0,s=await this.worker.rpc.sendMessage("sourceLocationToRawLocation",{lineNumber:i,columnNumber:o===0?-1:o,rawModuleId:this.moduleId,sourceFileURL:t});if(o===0&&s.length===0){let a=await this.getMappedLines(t),c=a.find(u=>u>i);if(!a.includes(i)&&c)return this.compiledPositionFor(t,new Ke(c,0))}return s.filter(a=>a.rawModuleId===this.moduleId).map(a=>new Ke(0,this.codeOffset+a.startOffset))}dispose(){return this.worker.rpc.sendMessage("removeRawModule",this.moduleId)}async getVariablesInScope(t,n){let i={codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId};return(await this.worker.rpc.sendMessage("listVariablesInScope",i)).map(s=>({name:s.name,scope:s.scope,type:s.type,evaluate:async()=>{let a=await this.worker.rpc.sendMessage("evaluate",s.name,i,this.worker.getStopId(t));return a?new Uy(a,this.worker.rpc):pM}}))}async getFunctionStack(t){let n=await this.worker.rpc.sendMessage("getFunctionInfo",{codeOffset:t.base0.columnNumber-this.codeOffset,inlineFrameIndex:t.base0.lineNumber,rawModuleId:this.moduleId});return"frames"in n?n.frames:[]}async getStepSkipList(t,n,i,o){if(i===this.decompiledUrl)return[];let s={codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId},a=()=>o&&i?this.worker.rpc.sendMessage("sourceLocationToRawLocation",{lineNumber:o.base0.lineNumber,columnNumber:-1,rawModuleId:this.moduleId,sourceFileURL:i}):[],c;switch(t){case 2:{c=await this.worker.rpc.sendMessage("getInlinedFunctionRanges",s);break}case 1:{let u=await Promise.all([this.worker.rpc.sendMessage("getInlinedCalleesRanges",s),a()]);c=bo(u);break}case 0:c=await a();break;default:c=[];break}return c.map(u=>new lr(new Ke(0,u.startOffset+this.codeOffset),new Ke(0,u.endOffset+this.codeOffset)))}async evaluate(t,n,i){try{let o=await this.worker.rpc.sendMessage("evaluate",i,{codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId},this.worker.getStopId(t));return o?new Uy(o,this.worker.rpc):pM}catch(o){throw new F(Me(o.message))}}getMappedLines(t){let n=this.mappedLines.get(t);if(n)return n;let i=(async()=>{try{let o=await this.worker.rpc.sendMessage("getMappedLines",this.moduleId,t);return new Uint32Array(o?.sort((s,a)=>s-a)||[])}catch{return new Uint32Array}})();return this.mappedLines.set(t,i),i}},pM={type:"null",description:"no properties"},Uy=class r{constructor(e,t){if(this.type=e.type,this.description=e.description,this.linearMemoryAddress=e.linearMemoryAddress,this.linearMemorySize=e.linearMemoryAddress,e.objectId&&e.hasChildren){let n=e.objectId;this.getChildren=ne(()=>this._getChildren(t,n))}}async _getChildren(e,t){return(await e.sendMessage("getProperties",t)).map(i=>({name:i.name,value:new r(i.value,e)}))}};var xs=Symbol("IScriptSkipper");function hM(r){return typeof r.lineNumber=="number"&&typeof r.columnNumber=="number"&&!!r.source}var mM=()=>({source:null,line:null,column:null,name:null,lastColumn:null,isSourceMapLoadFailure:!0}),yY=/\?t=[0-9]+$/,bY=r=>r.endsWith(".hot-update.js")||yY.test(r),vY={load:0,resolveLocation:2e3,sourceMapMinPause:1e3,output:1e3,sourceMapCumulativePause:1e4},gM=(r,e)=>e instanceof yt&&e.compiledToSourceUrl.has(r);var yM=2**31-1,Bt=class{constructor(e,t,n,i,o,s,a,c,u){this.sourceMapFactory=t;this.logger=n;this.launchConfig=i;this.initializeConfig=o;this.sourcePathResolver=s;this.scriptSkipper=a;this.resourceProvider=c;this.wasmSymbols=u;this.rootPaths=[];this.scriptsById=new Map;this.onSourceMappedSteppingChangeEmitter=new O;this.onScriptEmitter=new O;this._sourceByOriginalUrl=new Oi(e=>e.toLowerCase());this._sourceByReference=new Map;this._sourceMapSourcesByUrl=new Map;this._sourceByAbsolutePath=qa();this._sourceMapTimeouts=vY;this._fileContentOverridesForTest=new Map;this._temporarilyDisabledSourceMaps=new Set;this._permanentlyDisabledSourceMaps=new Set;this.onScript=this.onScriptEmitter.event;this._statistics={fallbackSourceMapCount:0};this._doSourceMappedStepping=this.launchConfig.sourceMaps;this.onSourceMappedSteppingChange=this.onSourceMappedSteppingChangeEmitter.event;this._dap=e;let l="webRoot"in i?i.webRoot:i.rootPath;l&&(this.rootPaths=[l,Jr(l,"..","ClientApp")]),a.setSourceContainer(this),this.setSourceMapTimeouts({...this.sourceMapTimeouts(),...i.timeouts})}get sources(){return this._sourceByReference.values()}statistics(){return this._statistics}get doSourceMappedStepping(){return this._doSourceMappedStepping}set doSourceMappedStepping(e){e!==this._doSourceMappedStepping&&(this._doSourceMappedStepping=e,this.onSourceMappedSteppingChangeEmitter.fire(e))}setSourceMapTimeouts(e){this._sourceMapTimeouts=e}sourceMapTimeouts(){return this._sourceMapTimeouts}setFileContentOverrideForTest(e,t){t===void 0?this._fileContentOverridesForTest.delete(e):this._fileContentOverridesForTest.set(e,t)}async loadedSources(){let e=[];for(let t of this._sourceByReference.values())e.push(t.toDap());return await Promise.all(e)}source(e){if(e.sourceReference)return this._sourceByReference.get(e.sourceReference);if(e.path)return this._sourceByAbsolutePath.get(e.path)}isSourceSkipped(e){return this.scriptSkipper.isScriptSkipped(e)}addScriptById(e){this.scriptsById.set(e.scriptId,e),"source"in e&&this.onScriptEmitter.fire(e)}getSourceScriptById(e){return this.scriptsById.get(e)}getScriptById(e){let t=this.scriptsById.get(e);return t&&"source"in t?t:void 0}getSourceByOriginalUrl(e){return this._sourceByOriginalUrl.get(e)}getSourceReference(e){let t=Bx(e)&yM;for(let n=0;n<65535;n++){if(!this._sourceByReference.has(t))return t;t===yM&&(t=0),t++}return this.logger.assert(!1,"Max iterations exceeding for source reference assignment"),t}async preferredUiLocation(e){let t=!1,n=4;for(;;){let i=await this._originalPositionFor(e);if(!hM(i)){n=t?void 0:i;break}e=i,t=!0,n=void 0}return{...e,isMapped:t,unmappedReason:n}}async currentSiblingUiLocations(e,t){let n=await this._uiLocations(e);return t?n.filter(i=>i.source===t):n}clear(e){this.scriptsById.clear();for(let t of this._sourceByReference.values())this.removeSource(t,e);this._sourceByReference.clear(),this.sourceMapFactory instanceof vs&&this.sourceMapFactory.invalidateCache()}async _uiLocations(e){let[t,n]=await Promise.all([this.getSourceMapUiLocations(e),this.getCompiledLocations(e)]);return[...t,e,...n]}async getSourceMapUiLocations(e){let t=await this._originalPositionFor(e);if(!hM(t))return[];let n=await this.getSourceMapUiLocations(t);return n.push(t),n}async _originalPositionFor(e){if(!Sr(e.source))return 1;let t=await of.waitForValueWithTimeout(e.source.sourceMap,this._sourceMapTimeouts.resolveLocation);if(!t)return 2;if(this._doSourceMappedStepping)return this._originalPositionForMap(e,t);if(bx(t)){let n=await t.disassembledPositionFor(new tt(e.lineNumber,e.columnNumber)),i=n&&e.source.sourceMap.sourceByUrl.get(n.url);if(i)return i?{columnNumber:n.position.base1.lineNumber,lineNumber:n.position.base1.lineNumber,source:i}:3}return 0}async _originalPositionForMap(e,t){let n=e.source;if(!Sr(n))return 1;if(this._temporarilyDisabledSourceMaps.has(n)||this._permanentlyDisabledSourceMaps.has(n))return 0;let i=await this.getOptiminalOriginalPosition(t,jO(e,n.inlineScriptOffset));if(!i)return 3;let o=n.sourceMap.sourceByUrl.get(i.url);if(!o)return 3;let s=i.position.base1;return{lineNumber:s.lineNumber,columnNumber:s.columnNumber,source:o}}async getCompiledLocations(e){if(!(e.source instanceof yt))return[];let t=[];for(let[n,i]of e.source.compiledToSourceUrl){let o=await of.waitForValueWithTimeout(n.sourceMap,this._sourceMapTimeouts.resolveLocation);if(!o)continue;let s;if("decompiledUrl"in o){let a=await o.compiledPositionFor(i,new tt(e.lineNumber,e.columnNumber));if(!a)continue;s=a.map(c=>({lineNumber:c.base1.lineNumber,columnNumber:c.base1.columnNumber,source:n}))}else{let a=this.sourceMapFactory.guardSourceMapFn(o,()=>Hg(i,e,o),mM);if(!a||a.line===null)continue;let{lineNumber:c,columnNumber:u}=BO({lineNumber:a.line||1,columnNumber:(a.column||0)+1},n.inlineScriptOffset),l={lineNumber:c,columnNumber:u,source:n};s=[l,...await this.getCompiledLocations(l)]}t=t.concat(s)}return t}async getOptiminalOriginalPosition(e,t){if(bx(e))return await e.originalPositionFor(new tt(t.lineNumber,t.columnNumber));let n=this.sourceMapFactory.guardSourceMapFn(e,()=>{let i=e.originalPositionFor({line:t.lineNumber,column:t.columnNumber-1,bias:Co});return i.line!==null?i:e.originalPositionFor({line:t.lineNumber,column:t.columnNumber-1,bias:bu})},mM);if(!(n.column===null||n.line===null||n.source===null))return{position:new Rr(n.line,n.column),url:n.source}}async addSource(e,t,n,i,o,s){let a=await this.sourcePathResolver.urlToAbsolutePath({url:e.url});this.logger.verbose("runtime.sourcecreate","Creating source from url",{inputUrl:e.url,absolutePath:a});let c;return e.scriptLanguage==="WebAssembly"?c=new by(this,e,a):c=new Ja(this,e.url,a,t,n&&this.sourcePathResolver.shouldResolveSourceMap({sourceMapUrl:n,compiledPath:a||e.url})?{sourceMapUrl:n,compiledPath:a||e.url,cacheKey:e.hash}:void 0,i,o,s),this._addSource(c),c}async _addSource(e){let t=e.url&&this._sourceByOriginalUrl.get(e.url);t&&!gM(t,e)&&this.removeSource(t,!0),this._sourceByOriginalUrl.set(e.url,e),this._sourceByReference.set(e.sourceReference,e),e instanceof yt&&this._sourceMapSourcesByUrl.set(e.url,e);let n=this._sourceByAbsolutePath.get(e.absolutePath);(n===void 0||n.url.length>=e.url.length||gM(n,e))&&this._sourceByAbsolutePath.set(e.absolutePath,e),this.scriptSkipper.initializeSkippingValueForSource(e),e.sendLazy||this.emitLoadedSource(e),Ya(e)?this._finishAddSourceWithSourceMap(e):Xa(e)&&this._finishAddSourceWithWasm(e)}async _finishAddSourceWithWasm(e){let t=await this.wasmSymbols.loadWasmSymbols(e.event),n=[];for(let i of t.files){let o,s,a;i===t.decompiledUrl?(o=Wy(e.absolutePath),s=Wy(e.url),a=()=>t.getDisassembly()):(o=await this.sourcePathResolver.urlToAbsolutePath({url:i}),s=o?Ae(o):i,a=()=>this.resourceProvider.fetch(s).then(u=>u.body)),this.logger.verbose("runtime.sourcecreate","Creating wasm source from source map",{inputUrl:i,absolutePath:o,resolvedUrl:s});let c=new yt(this,s,o,a);c.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,c),n.push(this._addSource(c))}await Promise.all(n),e.sourceMap.value.resolve(t)}async _finishAddSourceWithSourceMap(e){let t=e.sourceMap.value,n;try{n=await this.sourceMapFactory.load(e.sourceMap.metadata)}catch(i){if(this.initializeConfig.clientID==="visualstudio"){let o=e.sourceMap.metadata.sourceMapUrl;try{let s=await this.sourcePathResolver.urlToAbsolutePath({url:o});s&&(e.sourceMap.metadata.sourceMapUrl=Ae(s)),n=await this.sourceMapFactory.load(e.sourceMap.metadata),this._statistics.fallbackSourceMapCount++,this.logger.info("sourcemap.parsing","Failed to process original source-map; falling back to storage source-map",{fallbackSourceMapUrl:e.sourceMap.metadata.sourceMapUrl,originalSourceMapUrl:o,originalSourceMapError:Wx(i)})}catch{}}if(n===void 0)return this._dap.output({output:Lg(e.url,i.message).error.format+`
`,category:"stderr"}),t.resolve(void 0)}if(this._sourceByReference.get(e.sourceReference)!==e)return t.resolve(void 0);this.logger.verbose("sourcemap.parsing","Creating sources from source map",{sourceMapId:n.id,metadata:n.metadata});try{await this._addSourceMapSources(e,n)}finally{t.resolve(n)}this.scriptSkipper.initializeSkippingValueForSource(e)}removeSource(e,t=!1){let n=this._sourceByReference.get(e.sourceReference);if(n!==void 0){if(this.logger.assert(e===n,"Expected source to be the same as the existing reference"),this._sourceByReference.delete(e.sourceReference),this._sourceByOriginalUrl.get(e.url)===e&&this._sourceByOriginalUrl.delete(e.url),e instanceof yt){this._sourceMapSourcesByUrl.delete(e.url);for(let[i,o]of e.compiledToSourceUrl)i.sourceMap.sourceByUrl.delete(o)}this._sourceByAbsolutePath.delete(e.absolutePath),Sr(e)&&(this._permanentlyDisabledSourceMaps.delete(e),this._temporarilyDisabledSourceMaps.delete(e)),!t&&e.hasBeenAnnounced&&e.toDap().then(i=>this._dap.loadedSource({reason:"removed",source:i})),Xa(e)&&e.sourceMap.value.promise.then(i=>i?.dispose()),Sr(e)&&this._removeSourceMapSources(e,t)}}emitLoadedSource(e){return e.hasBeenAnnounced=!0,e.toDap().then(t=>this._dap.loadedSource({reason:"new",source:t}))}async _addSourceMapSources(e,t){let n=[];for(let i of t.sources){if(i===null)continue;let o=await this.sourcePathResolver.urlToAbsolutePath({url:i,map:t}),s=o?Ae(o):t.computedSourceUrl(i),a=this._sourceMapSourcesByUrl.get(s);if(e===a)continue;if(a)if(bY(e.url))this.removeSource(a);else{a.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,a);continue}this.logger.verbose("runtime.sourcecreate","Creating source from source map",{inputUrl:i,sourceMapId:t.id,absolutePath:o,resolvedUrl:s});let c=o&&Ae(o),u=this.sourceMapFactory.guardSourceMapFn(t,()=>t.sourceContentFor(i),()=>null),l;if(u){let d=xu(u);if(d&&(!Qt(d)&&o?l=hs(o?Ae(o):i,d):l=d),o&&l){let f={sourceMapUrl:l,compiledPath:o};this.sourcePathResolver.shouldResolveSourceMap(f)||(l=void 0)}}let p=new yt(this,s,o,u!==null?()=>Promise.resolve(u):c?()=>this.resourceProvider.fetch(c).then(d=>d.body):()=>e.content(),l?{compiledPath:o||s,sourceMapUrl:l,cacheKey:t.metadata.cacheKey}:void 0,void 0,e.runtimeScriptOffset);p.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,p),n.push(this._addSource(p))}await Promise.all(n)}_removeSourceMapSources(e,t){for(let n of e.sourceMap.sourceByUrl.keys()){let i=e.sourceMap.sourceByUrl.get(n);i&&(e.sourceMap.sourceByUrl.delete(n),i.compiledToSourceUrl.delete(e),!i.compiledToSourceUrl.size&&this.removeSource(i,t))}}async waitForSourceMapSources(e){return Sr(e)?[...(await of.waitForSources(e.sourceMap)).values()]:[]}async revealUiLocation(e){this._dap.revealLocationRequested({source:await e.source.toDap(),line:e.lineNumber,column:e.columnNumber})}disableSourceMapForSource(e,t=!1){t?this._permanentlyDisabledSourceMaps.add(e):this._temporarilyDisabledSourceMaps.add(e)}clearDisabledSourceMaps(e){e?this._temporarilyDisabledSourceMaps.delete(e):this._temporarilyDisabledSourceMaps.clear()}};Bt=S([(0,xn.injectable)(),g(0,(0,xn.inject)(kr)),g(1,(0,xn.inject)(Ui)),g(2,(0,xn.inject)($)),g(3,(0,xn.inject)(we)),g(4,(0,xn.inject)(Or)),g(5,(0,xn.inject)(Re)),g(6,(0,xn.inject)(xs)),g(7,(0,xn.inject)(Ba)),g(8,(0,xn.inject)(qy))],Bt);var bM=r=>r.originalPosition.columnNumber===1&&r.originalPosition.lineNumber===1,vM=500,wM=Symbol("DontCompare");var Cn=class{constructor(e,t,n,i,o,s,a){this.logger=n;this.launchConfig=i;this.conditionFactory=o;this.suggester=s;this._breakpointsPredictor=a;this._resolvedBreakpoints=new Map;this._totalBreakpointsCount=0;this._launchBlocker=new Set;this._predictorDisabledForTest=!1;this._breakpointsStatisticsCalculator=new sy;this.entryBreakpointMode=0;this._enabledFilter=()=>!0;this._byDapId=new Map;this._byPath=qa();this._byRef=new Map;this.moduleEntryBreakpoints=qa();this._dap=e,this._sourceContainer=t,a?.onLongParse(()=>e.longPrediction({})),t.onScript(c=>{c.source.then(u=>{let l=this._thread;l&&this._byRef.get(u.sourceReference)?.forEach(p=>p.updateForNewLocations(l,c))})}),t.onSourceMappedSteppingChange(()=>{if(this._thread)for(let c of this._byDapId.values())c.refreshUiLocations(this._thread)}),this._scriptSourceMapHandler=async(c,u)=>{if(!n.assert(this._thread,"Expected thread to be set for the breakpoint source map handler"))return[];let l=[],p=[u];for(let d=0;d<p.length;d++)for(let f of p[d]){let h=f.absolutePath,m=h?this._byPath.get(h):void 0;for(let I of m||[])l.push(I.updateForNewLocations(this._thread,c));let y=this._byRef.get(f.sourceReference);for(let I of y||[])l.push(I.updateForNewLocations(this._thread,c));f.sourceMap&&p.push(f.sourceMap.sourceByUrl.values())}return bo(await Promise.all(l))}}get appliedByPath(){return this._byPath}get appliedByRef(){return this._byRef}hasAtLocation(e){let t=this._byPath.get(e.source.absolutePath)||[],n=this._byRef.get(e.source.sourceReference)||[];return t.concat(n).some(i=>i.originalPosition.columnNumber===e.columnNumber&&i.originalPosition.lineNumber===e.lineNumber)}async moveBreakpoints(e,t,n,i){let o=l=>ek(l,async p=>{let d=await this._sourceContainer.getOptiminalOriginalPosition(n,p.originalPosition);if(!d)return!1;let f=d.position.base1;return p.updateSourceLocation(e,{path:i.absolutePath,sourceReference:i.sourceReference},{lineNumber:f.lineNumber,columnNumber:f.columnNumber,source:i}),!1}),s=t.absolutePath,a=i.absolutePath,c=s?this._byPath.get(s):void 0;if(c&&a){let[l,p]=await o(c);this._byPath.set(s,l),this._byPath.set(a,p)}let u=this._byRef.get(t.sourceReference);if(u){let[l,p]=await o(u);this._byRef.set(t.sourceReference,l),this._byRef.set(i.sourceReference,p)}}async updateEntryBreakpointMode(e,t){if(t===this.entryBreakpointMode)return;let n=[...this.moduleEntryBreakpoints.values()];this.moduleEntryBreakpoints.clear(),this.entryBreakpointMode=t,await Promise.all(n.map(i=>this.ensureModuleEntryBreakpoint(e,i.source)))}async applyEnabledFilter(e,t=wM){if(t!==wM&&this._enabledFilter!==t)return;this._enabledFilter=e||(()=>!0);let n=this._thread;n&&await Promise.all([...this._byDapId.values()].map(i=>this._enabledFilter(i)?i.enable(n):i.disable()))}async getBreakpointLocations(e,t,n,i){let o=n.base1,s=i.base1,[a,c]=await Promise.all([this._sourceContainer.currentSiblingUiLocations({source:t,lineNumber:o.lineNumber,columnNumber:o.columnNumber}),this._sourceContainer.currentSiblingUiLocations({source:t,lineNumber:s.lineNumber,columnNumber:s.columnNumber})]);if(a.length!==c.length)return this.logger.warn("internal","Expected to have the same number of start and end locations"),[];let u=[],l=[];for(let p=0;p<a.length;p++){let d=a[p],f=c[p];if(d.source!==f.source){this.logger.warn("internal","Expected to have the same number of start and end scripts");continue}let h=d.source;if(!h.scripts.length)continue;let{scriptId:m}=h.scripts[h.scripts.length-1];u.push(e.cdp().Debugger.getPossibleBreakpoints({restrictToFunction:!1,start:{scriptId:m,...h.offsetSourceToScript(ko(d))},end:{scriptId:m,...h.offsetSourceToScript(ko(f))}}).then(y=>{if(y?.locations)return Promise.all(y.locations.map(async I=>{let{lineNumber:L,columnNumber:P=0}=I,W=await this._sourceContainer.currentSiblingUiLocations({source:h,...h.offsetScriptToSource(UO({lineNumber:L,columnNumber:P}))});l.push({breakLocation:I,uiLocations:W})}))}))}return await Promise.all(u),l}setThread(e){this._thread=e,this._thread.cdp().Debugger.on("breakpointResolved",async t=>{let n=this._resolvedBreakpoints.get(t.breakpointId)||await le(0).then(()=>this._resolvedBreakpoints.get(t.breakpointId));n&&n.updateUiLocations(e,t.breakpointId,[t.location])}),this._thread.setSourceMapDisabler(t=>{let n=[];for(let i of t){let o=this._resolvedBreakpoints.get(i);if(o){let s=this._sourceContainer.source(o.source);Sr(s)&&n.push(s)}}return n});for(let t of this._byPath.values())t.forEach(n=>this._setBreakpoint(n,e)),this.ensureModuleEntryBreakpoint(e,t[0]?.source);for(let t of this._byRef.values())t.forEach(n=>this._setBreakpoint(n,e));"runtimeSourcemapPausePatterns"in this.launchConfig&&this.launchConfig.runtimeSourcemapPausePatterns.length&&this.setRuntimeSourcemapPausePatterns(e,this.launchConfig.runtimeSourcemapPausePatterns),this._byDapId.size>0&&this._installSourceMapHandler(this._thread)}async launchBlocker(){ny(this.logger,"BreakpointManager.launchBlocker",async()=>{this._predictorDisabledForTest||await Promise.all([...this._launchBlocker])})}setRuntimeSourcemapPausePatterns(e,t){return Promise.all(t.map(n=>this._setBreakpoint(new pf(this,n),e)))}addLaunchBlocker(...e){for(let t of e)this._launchBlocker.add(t),t.finally(()=>this._launchBlocker.delete(t))}setPredictorDisabledForTest(e){this._predictorDisabledForTest=e}_installSourceMapHandler(e){let t=this.launchConfig.perScriptSourcemaps==="yes",n;t?n=Promise.all([this.updateEntryBreakpointMode(e,1),e.setScriptSourceMapHandler(!1,this._scriptSourceMapHandler)]).then(()=>!0):this._breakpointsPredictor&&!this.launchConfig.pauseForSourceMap?n=e.setScriptSourceMapHandler(!1,this._scriptSourceMapHandler):n=e.setScriptSourceMapHandler(!0,this._scriptSourceMapHandler),this._sourceMapHandlerInstalled={entryBpSet:n}}async _uninstallSourceMapHandler(e){e.setScriptSourceMapHandler(!1),this._sourceMapHandlerInstalled=void 0}_setBreakpoint(e,t){this._enabledFilter(e)&&this.addLaunchBlocker(Promise.race([le(vM),e.enable(t)]))}async setBreakpoints(e,t){!this._sourceMapHandlerInstalled&&this._thread&&e.breakpoints?.length&&this._installSourceMapHandler(this._thread);let n=await this._sourceMapHandlerInstalled?.entryBpSet;e.source.path=st(e.source.path,!0);let i=this._sourceContainer.source(e.source);if(!n&&this._breakpointsPredictor&&!i){let l=this._breakpointsPredictor.predictBreakpoints(e);this.addLaunchBlocker(l),await l}let o=this._thread;if(o?.debuggerReady.hasSettled()===!1){let l=o.debuggerReady.promise;this.addLaunchBlocker(l),await l}let s=l=>{let p={unbound:l.slice(),new:[],list:[]};if(!e.breakpoints)return p;for(let d=0;d<e.breakpoints.length;d++){let f=e.breakpoints[d],h;try{h=new _n(this,t[d],e.source,f,this.conditionFactory.getConditionFor(f))}catch(I){if(!(I instanceof F))throw I;this._dap.output({category:"stderr",output:I.message}),h=new Ty(this,t[d],e.source,f)}let m=p.unbound.findIndex(I=>I.equivalentTo(h)),y=p.unbound[m];y?.equivalentTo?.(h)?(p.list.push(y),p.unbound.splice(m,1)):(p.new.push(h),p.list.push(h),this._byDapId.set(h.dapId,h))}return p},a=()=>e.source.sourceReference?this._byRef.get(e.source.sourceReference):e.source.path?this._byPath.get(e.source.path):void 0,c=s(a()??[]);if(e.source.sourceReference)this._byRef.set(e.source.sourceReference,c.list);else if(e.source.path)this._byPath.set(e.source.path,c.list);else return{breakpoints:[]};if(c.unbound.length===0&&c.new.length===0)return{breakpoints:[]};if(this._totalBreakpointsCount-=c.unbound.length,await Promise.all(c.unbound.map(l=>(this._byDapId.delete(l.dapId),l.disable()))),this._totalBreakpointsCount+=c.new.length,this._thread&&(this._totalBreakpointsCount===0&&this._sourceMapHandlerInstalled?this._uninstallSourceMapHandler(this._thread):this._totalBreakpointsCount>0&&!this._sourceMapHandlerInstalled&&this._installSourceMapHandler(this._thread)),o&&c.new.length){this.ensureModuleEntryBreakpoint(o,e.source);let l=a(),p=Promise.all(c.new.filter(this._enabledFilter).filter(d=>l?.includes(d)).map(d=>d.enable(o)));this.addLaunchBlocker(Promise.race([le(vM),p])),await p}let u=await Promise.all(c.list.map(l=>l.toDap()));return this._breakpointsStatisticsCalculator.registerBreakpoints(u),le(0).then(()=>c.new.forEach(l=>l.markSetCompleted())),{breakpoints:u}}async notifyBreakpointChange(e,t){if(!this._byDapId.has(e.dapId))return;let n=await e.toDap();n.verified&&(this._breakpointsStatisticsCalculator.registerResolvedBreakpoint(e.dapId),this.suggester.notifyVerifiedBreakpoint()),t&&this._dap.breakpoint({reason:"changed",breakpoint:n})}isEntrypointBreak(e,t){return[...this.moduleEntryBreakpoints.values()].some(i=>i.enabled&&i.cdpScriptIds.has(t))?!0:e.some(i=>{let o=this._resolvedBreakpoints.get(i);return o&&(o instanceof Vi||bM(o))})}async disableEntrypointBreaks(e){await Promise.all([...this.moduleEntryBreakpoints.values()].map(t=>{if(t.enabled&&t.cdpScriptIds.has(e))return t.disable()}))}isEntrypointCdpBreak(e){return this._resolvedBreakpoints.get(e)instanceof Vi}async shouldPauseAt(e,t,n,i=!1){if(!t.length)return e.reason!=="instrumentation";let o=0,s=i?1:0;return await Promise.all(t.map(async a=>{if(n?.cdpId===a){o++;return}let c=this._resolvedBreakpoints.get(a);if(c instanceof Vi){this.entryBreakpointMode===0&&!(c instanceof pf)&&c.disable(),s++;return}c instanceof _n&&(await c.testHitCondition(e)?o++:s++)})),o>0||s===0}registerBreakpointsHit(e){for(let t of e){let n=this._resolvedBreakpoints.get(t);n instanceof _n&&this._breakpointsStatisticsCalculator.registerBreakpointHit(n.dapId)}}statisticsForTelemetry(){return this._breakpointsStatisticsCalculator.statistics()}ensureModuleEntryBreakpoint(e,t){if(!t.path||(this._byPath.get(t.path)??[]).some(bM))return;let i=Vi.getModeKeyForSource(this.entryBreakpointMode,t.path);if(!t.path||this.moduleEntryBreakpoints.has(i))return;let o=new Vi(this,t,this.entryBreakpointMode);this.moduleEntryBreakpoints.set(t.path,o),this._setBreakpoint(o,e)}executionContextWasCleared(){for(let e of this._byDapId.values())e.executionContextWasCleared()}async reapply(){let e=[...this._byDapId.values()];if(await Promise.all(e.map(t=>t.disable())),this._thread){let t=this._thread;await Promise.all(e.map(n=>n.enable(t)))}}};Cn=S([(0,Ki.injectable)(),g(0,(0,Ki.inject)(kr)),g(1,(0,Ki.inject)(Bt)),g(2,(0,Ki.inject)($)),g(3,(0,Ki.inject)(we)),g(4,(0,Ki.inject)(_y)),g(5,(0,Ki.inject)(it)),g(6,(0,Ki.inject)(Ga))],Cn);var MN=require("crypto"),ol=b(N());var He=class r{static{this.Undefined=new r(void 0)}constructor(e){this.element=e,this.next=r.Undefined,this.prev=r.Undefined}},ff=class{constructor(){this._first=He.Undefined;this._last=He.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===He.Undefined}clear(){let e=this._first;for(;e!==He.Undefined;){let t=e.next;e.prev=He.Undefined,e.next=He.Undefined,e=t}this._first=He.Undefined,this._last=He.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new He(e);if(this._first===He.Undefined)this._first=n,this._last=n;else if(t){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==He.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==He.Undefined){let e=this._last.element;return this._remove(this._last),e}}applyFilter(e){let t=this._first;for(;t!==He.Undefined;){let n=t.next;e(t.element)||this._remove(t),t=n}}_remove(e){if(e.prev!==He.Undefined&&e.next!==He.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===He.Undefined&&e.next===He.Undefined?(this._first=He.Undefined,this._last=He.Undefined):e.next===He.Undefined?(this._last=this._last.prev,this._last.next=He.Undefined):e.prev===He.Undefined&&(this._first=this._first.next,this._first.prev=He.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==He.Undefined;)yield e.element,e=e.next}};var nb=b(N()),AN=b(require("net"));var tn=class extends F{constructor(e){super({id:9243,format:e,showUser:!0}),this._cause={id:9243,format:e,showUser:!0}}};function Ji(r,e,t){if(e.isCancellationRequested)return Promise.reject(new tn(t||"Task cancelled"));let n=ke(),i=e.onCancellationRequested(n.resolve);return Promise.race([n.promise.then(()=>{throw new tn(t||"Task cancelled")}),r.then(o=>(i.dispose(),o)).catch(o=>{throw i.dispose(),o})])}function SM(r,e){let t=new Rt(e),n=r.map(async i=>{try{return await i(t.token)}finally{t.cancel()}});return Promise.race(n)}var _M=Object.freeze(function(r,e){let t=setTimeout(r.bind(e),0);return{dispose(){clearTimeout(t)}}}),jt=Object.freeze({isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),wY=Object.freeze({isCancellationRequested:!0,onCancellationRequested:_M}),Rt=class r{constructor(e){this._token=void 0;this._parentListener=void 0;this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}static withTimeout(e,t){let n=new r(t),i=n._token=new Qu,o=setTimeout(()=>i.cancel(),e);return i.onCancellationRequested(()=>clearTimeout(o)),n}get token(){return this._token||(this._token=new Qu),this._token}cancel(){this._token?this._token instanceof Qu&&this._token.cancel():this._token=wY}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof Qu&&this._token.dispose():this._token=jt}},Qu=class{constructor(){this._isCancelled=!1;this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?_M:(this._emitter||(this._emitter=new O),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var hC=b(require("net"));var RX=b(TM(),1),AX=b(rC(),1),DX=b(iC(),1),xN=b(pC(),1),fC=b(IN(),1);var CN=xN.default;var TN=(r,e)=>r+Math.floor(Math.random()*(e-r));async function Es({min:r=53e3,max:e=54e3,attempts:t=1e3,tester:n=EN}={},i=jt){let o=TN(r,e);for(let s=Math.min(t,e-r);;s--)try{return await n(o,i)}catch(a){if(s===0||a instanceof tn)throw a;o=o===e-1?r:o+1}}async function PN(r,e){try{return await EN(r,e),!0}catch{return!1}}function EN(r,e=jt){let t;return new Promise((n,i)=>{let o=hC.createServer();o.listen(r,"127.0.0.1",()=>{let s=o.address();o.close(()=>n(s.port))}),o.on("error",i),t=e.onCancellationRequested(()=>{o.close(),i(new tn("Port open lookup cancelled"))})}).finally(()=>t?.dispose())}var kN=(r,e)=>(t,n)=>{let i=hC.createServer(r);return i.listen(t,e),rb(i,n)},RN=r=>(e,t)=>rb(new fC.default({host:"127.0.0.1",...r,port:e}),t),rb=(r,e)=>{let t;return new Promise((n,i)=>{r.on("error",i),r.on("listening",()=>n(r)),t=e.onCancellationRequested(()=>{r.close(),i(new tn("Port open lookup cancelled"))})}).finally(()=>t?.dispose())};var DN=async(r,e,t,n,i=jt)=>{let o=t?await rb(AN.createServer(e).listen(t,n),i):await Es({tester:kN(e,n)},i),s=r.register(o.address().port);return o.on("close",()=>s.dispose()),o.on("error",()=>s.dispose()),o},ib=async(r,e,t)=>{let n=await Es({tester:RN(e)},t),i=r.register(n.address().port);return n.on("close",()=>i.dispose()),n.on("error",()=>i.dispose()),n},Ye=Symbol("IPortLeaseTracker"),nl=class{constructor(e){this.usedPorts=new Set;this.onRegistered=new O;this.isMandated=e==="remote"}register(e){return this.usedPorts.add(e),this.onRegistered.fire(e),{dispose:()=>this.usedPorts.delete(e)}}isRegistered(e,t=2e3){return this.usedPorts.has(e)?Promise.resolve(!0):e<53e3||e>=54e3?Promise.resolve(!1):SM([()=>le(t).then(()=>!1),n=>new Promise(i=>{let o=this.onRegistered.event(s=>{s===e&&i(!0)});n.onCancellationRequested(()=>o.dispose())})])}};nl=S([(0,nb.injectable)(),g(0,(0,nb.inject)(Zn))],nl);var ON="JsDebug",LN="*";var mC=class{constructor(){this.replays=new Map}addReplay(e,t,n){let i=this.replays.get(e);return i||(i=new ff,this.replays.set(e,i)),i.push({event:`${e}.${t}`,params:n})}capture(e,t,n,i){let o=e[t];if(i===0)o.on(n,s=>this.addReplay(t,n,s));else if(i===2){let s;o.on(n,a=>{s?.(),s=this.addReplay(t,n,a)})}else{let s=new ff;o.on(n,a=>{s.size===i.cap&&s.shift()?.(),s.push(this.addReplay(t,n,a))})}}filter(e,t){let n=this.replays.get(e);n&&n.applyFilter(t)}clearEvent(e,t){let n=`${e}.${t}`;this.filter(e,i=>i.event!==n)}clearDomain(e){this.replays.delete(e)}read(e){return this.replays.get(e)??[]}},ob=Symbol("ICdpProxyProvider"),il=class{constructor(e,t,n){this.cdp=e;this.portTracker=t;this.logger=n;this.disposables=new pe;this.replay=new mC;this.jsDebugApi={subscribe:(e,{events:t})=>{for(let n of t)n.endsWith(LN)?e.pushDisposable(this.cdp.session.onPrefix(n.slice(0,-LN.length),i=>e.send({method:i.method,params:i.params}))):e.pushDisposable(this.cdp.session.on(n,i=>e.send({method:n,params:i})));return{}}};this.replay.capture(e,"CSS","styleSheetAdded",0),this.replay.capture(e,"Debugger","paused",2),this.replay.capture(e,"Runtime","executionContextCreated",{cap:50,type:1}),this.replay.capture(e,"Runtime","consoleAPICalled",{cap:50,type:1}),e.Debugger.on("resumed",()=>{this.replay.clearEvent("Debugger","paused")}),e.CSS.on("fontsUpdated",i=>{i.font&&this.replay.addReplay("CSS","fontsUpdated",i)}),e.CSS.on("styleSheetRemoved",i=>this.replay.filter("CSS",o=>o.params.styleSheetId!==i.styleSheetId))}async proxy(){this.server||(this.server=this.createServer());let{server:e,path:t}=await this.server,n=e.address();return{host:n.address,port:n.port,path:t}}async createServer(){let e=`/${(0,MN.randomBytes)(20).toString("hex")}`,t=await ib(this.portTracker,{perMessageDeflate:!0,path:e});return this.logger.info("proxyActivity","activated cdp proxy"),t.on("connection",n=>{let i=new gC(n,this.logger);this.logger.info("proxyActivity","accepted proxy connection",{id:i.id}),n.on("close",()=>{this.logger.verbose("proxyActivity","closed proxy connection",{id:i.id}),this.disposables.disposeObject(i)}),n.on("message",async o=>{let s;try{s=JSON.parse(o.toString())}catch(d){return i.send({id:0,error:{code:-32700,message:d.message}})}this.logger.verbose("proxyActivity","received proxy message",s);let{method:a,params:c,id:u=0}=s,[l,p]=a.split(".");try{let d=l===ON?await this.invokeJsDebugDomainMethod(i,p,c):await this.invokeCdpMethod(i,l,p,c);i.send({id:u,result:d})}catch(d){let f=d instanceof za&&d.cause?d.cause:{code:0,message:d.message};i.send({id:u,error:f})}})}),{server:t,path:e}}dispose(){this.disposables.dispose(),this.server?.then(e=>e.server.close()),this.server=void 0}invokeCdpMethod(e,t,n,i){let o=this.cdp.session.sendOrDie(`${t}.${n}`,i);switch(n){case"enable":for(let s of this.replay.read(t))e.send({method:s.event,params:s.params});break;case"disable":this.replay.clearDomain(t);break;default:}return o}invokeJsDebugDomainMethod(e,t,n){if(!this.jsDebugApi.hasOwnProperty(t))throw new za(t).setCause(-32601,`${ON}.${t} not found`);return this.jsDebugApi[t](e,n)}};il=S([(0,ol.injectable)(),g(0,(0,ol.inject)(nt)),g(1,(0,ol.inject)(Ye)),g(2,(0,ol.inject)($))],il);var MX=0,gC=class{constructor(e,t){this.webSocket=e;this.logger=t;this.disposables=new pe;this.id=MX++}pushDisposable(e){this.disposables.push(e)}dispose(){this.disposables.dispose(),this.webSocket.close()}send(e){this.logger.verbose("proxyActivity","send proxy message",e),this.webSocket.send(JSON.stringify(e))}};var NN=b(N());var xf=Symbol("IClientCapabilies"),ks=class{};ks=S([(0,NN.injectable)()],ks);var BN=require("./vendor/acorn-loose.js"),Cf=b(N());var yC=It(function(r,e,t){let n=t?"variable":"property",i=(l,p,d)=>{if(p!=="function")return n;if(l==="constructor")return"class";let f=String(d);return f.startsWith("class ")||f.includes("[native code]")&&/^[A-Z]/.test(l)?"class":t?"function":"method"},o=l=>{switch(typeof l){case"number":case"boolean":return`${l}`;case"object":return l===null?"null":l.constructor.name||"object";case"function":return`fn(${new Array(l.length).fill("?").join(", ")})`;default:return typeof l}},s=[],a=new Set,c="~",u=r===void 0?this:r;for(;u!=null;u=u.__proto__){c+="~";let l=Object.getOwnPropertyNames(u).filter(p=>p.startsWith(e)&&!p.match(/^\d+$/));for(let p of l){if(a.has(p))continue;a.add(p);let d=Object.getOwnPropertyDescriptor(u,p),f=n,h;try{let m=u[p];f=i(p,typeof d?.value,m),h=o(m)}catch{}s.push({label:p,sortText:c+p.replace(/^_+/,m=>"{".repeat(m.length)),type:f,detail:h})}t=!1}return{result:s,isArray:this instanceof Array}}),FN=Mi(yC.source);var NX=r=>{switch(r.type){case"ClassDeclaration":case"ClassExpression":return{type:"class",id:r.id};case"MethodDefinition":return{type:r.key?.type==="Identifier"&&r.key.name==="constructor"?"constructor":"method",id:r.key};case"VariableDeclarator":return{type:r.init?.type==="FunctionExpression"||r.init?.type==="ArrowFunctionExpression"?"function":"variable",id:r.id}}};function FX(r){let e=!1;return ds(r,{enter(t){if(t.type==="CallExpression"||t.type==="NewExpression"||t.type==="UnaryExpression"&&t.operator==="delete"||t.type==="ClassBody")return e=!0,0}}),e}var sb=Symbol("ICompletions"),sl=class{constructor(e,t){this.evaluator=e;this.cdp=t}async completions(e){let t=Li(e.expression),n=new gs(e.expression).convert(e.position),i=()=>Promise.resolve([]);return ds(t,{enter:(o,s)=>{let a=o;if(a.start<n&&n<=a.end){if(o.type==="MemberExpression"||o.type==="Identifier"&&s?.type==="MemberExpression"&&!s.computed&&s.object!==o){let c=o.type==="MemberExpression"?o:s;i=c.computed?()=>this.elementAccessCompleter(e,c,n):()=>this.propertyAccessCompleter(e,c,n)}else o.type==="Identifier"&&(i=()=>this.identifierCompleter(e,t,o,n));s=o}}}),i().then(o=>o.sort((s,a)=>s.sortText>a.sortText?1:-1))}async elementAccessCompleter(e,t,n){if(t.property.type!=="Literal"||typeof t.property.value!="string")return[];let i=e.expression.slice(ps(t.property)+1,n);return(await this.defaultCompletions(e,i)).filter(s=>s.sortText!=="~~[").map(s=>({...s,text:JSON.stringify(s.text??s.label)+"]",start:ps(t.property),length:nx(t.property)-ps(t.property)}))}async identifierCompleter(e,t,n,i){let o=[],s=ps(n);ds(t,{enter(u){let l=NX(u);l?.id?.type==="Identifier"&&o.push({label:l.id.name,type:l.type,sortText:l.id.name})}});let a=e.expression.slice(s,i),c=[...o,...await this.defaultCompletions(e,a)];this.evaluator.hasReturnValue&&e.executionContextId!==void 0&&Ro.startsWith(a)&&c.push({sortText:`~${Ro}`,label:Ro,type:"variable"});for(let u of c)u.start=s,u.length=i-s;return c}async propertyAccessCompleter(e,t,n){let{result:i,isArray:o}=await this.completePropertyAccess({executionContextId:e.executionContextId,stackFrame:e.stackFrame,expression:$1(e.expression,t.object),prefix:(0,BN.isDummy)(t.property)?"":e.expression.slice(ps(t.property),n),throwOnSideEffect:FX(t)}),s=ps(t.property)-1,a=/^[$a-z_][0-9a-z_$]*$/i;for(let c of i)a.test(c.label)||(c.text=`[${JSON.stringify(c.label)}]`,c.start=s,c.length=1);if(o){let c="index";i.unshift({label:`[${c}]`,text:`[${c}]`,type:"property",sortText:"~~[",start:s,selectionStart:1,selectionLength:c.length,length:1})}return i}async completePropertyAccess({executionContextId:e,stackFrame:t,expression:n,prefix:i,isInGlobalScope:o=!1,throwOnSideEffect:s=!1}){let a={expression:`(${n})`,objectGroup:"console",silent:!0,throwOnSideEffect:s},c=t&&t.callFrameId(),u=await this.evaluator.evaluate(c?{...a,callFrameId:c}:{...a,contextId:e},{stackFrame:t});if(!u||u.exceptionDetails)return{result:[],isArray:!1};if(!u.result.objectId){let l={...a,returnByValue:!0,throwOnSideEffect:!1,expression:FN.expr(`(${n})`,JSON.stringify(i),JSON.stringify(o))},p=await this.evaluator.evaluate(c?{...l,callFrameId:c}:{...l,contextId:e});return!p||p.exceptionDetails?{result:[],isArray:!1}:p.result.value}try{return(await yC({cdp:this.cdp,args:[void 0,i,o],objectId:u.result.objectId,returnByValue:!0})).value}catch{return{result:[],isArray:!1}}finally{this.cdp.Runtime.releaseObject({objectId:u.result.objectId})}}async defaultCompletions(e,t=""){for(let n of["self","global","this"]){let{result:i}=await this.completePropertyAccess({executionContextId:e.executionContextId,stackFrame:e.stackFrame,expression:n,prefix:t,isInGlobalScope:!0});if(e.stackFrame){let o=t.toLowerCase(),s=new Set(i.map(a=>a.label));for(let a of await e.stackFrame.completions())s.has(a.label)||!a.label.toLowerCase().includes(o)||(s.add(a.label),i.push(a))}return i.push(...this.syntheticCompletions(e,t)),i}return this.syntheticCompletions(e,t)}syntheticCompletions(e,t){return this.evaluator.hasReturnValue&&Ro.startsWith(t)?[{sortText:`~${Ro}`,label:Ro,type:"variable"}]:[]}};sl=S([(0,Cf.injectable)(),g(0,(0,Cf.inject)(Sn)),g(1,(0,Cf.inject)(nt))],sl);var jN=/^(\W*at .*\()(.*):(\d+):(\d+)(\))$/,UN=/^(\W*at )(.*):(\d+):(\d+)$/,Rs=class{constructor(e){this.stack=e}static isStackLike(e){return jN.test(e)||UN.test(e)}*[Symbol.iterator](){for(let e of this.stack.split(`
`)){let t=jN.exec(e)||UN.exec(e);if(!t){yield e+`
`;continue}let[,n,i,o,s,a]=t;n&&(yield n),yield new bC(i,new tt(Number(o),Number(s))),a&&(yield a),yield`
`}}},bC=class{constructor(e,t){this.path=e;this.position=t}toString(){return`${this.path}:${this.position.lineNumber}:${this.position.columnNumber}`}};var Xi=class{constructor(e,t){this._tokens=[];this._separator=t||"",this._budget=e-1-this._separator.length}append(e){if(e.length>this.budget()){this.appendEllipsis();return}this._append(e)}_append(e){this._tokens.length&&(this._budget-=this._separator.length),this._tokens.push(e),this._budget-=e.length}appendEllipsis(){this._tokens[this._tokens.length-1]!=="\u2026"&&this._append("\u2026")}checkBudget(){return this._budget<=0&&this.appendEllipsis(),this._budget>0}budget(){return this._budget-(this._tokens.length?this._separator.length:0)}build(){return this._tokens.join(this._separator)}isEmpty(){return!this._tokens.length}};var lF=b(cF());var ZX=1e4;function eQ(r,e){if(!r.includes("%"))return[{type:"string",value:r}];let t=[];function n(c){if(!c)return;let u=t[t.length-1];u?.type==="string"?u.value+=c:t.push({type:"string",value:c})}function i(c,u,l){t.push({type:"specifier",specifier:c,precision:u,substitutionIndex:l})}let o=0,s=0,a=new RegExp(`%%|%(?:(\\d+)\\$)?(?:\\.(\\d*))?([${e.join("")}])`,"g");for(let c=a.exec(r);c;c=a.exec(r)){let u=c.index;if(u>o&&n(r.substring(o,u)),c[0]==="%%")n("%");else{let[,l,p,d]=c;l&&Number(l)>0&&(s=Number(l)-1);let f=p?Number(p):void 0;i(d,f,s),++s}o=u+c[0].length}return n(r.substring(o)),t}function IC(r,e,t){let n=eQ(r,Array.from(t.keys())),i=new Set,o=t.get("");if(!o)throw new Error("Expected to hav a default formatter");let s=new Xi(ZX),a=!1;for(let c=0;s.checkBudget()&&c<n.length;++c){let u=n[c];if(u.type==="string"){s.append(u.value);continue}let l=u.substitutionIndex;if(l>=e.length){s.append("%"+(u.precision||"")+u.specifier);continue}i.add(l),u.specifier==="c"&&(a=!0);let p=t.get(u.specifier)||o;s.append(p(e[l],{budget:s.budget(),quoted:!1,ansi:!0}))}a&&s.append("\x1B[0m");for(let c=0;s.checkBudget()&&c<e.length;++c)i.has(c)||(i.add(c),(r||c)&&s.append(" "),s.append(o(e[c],{budget:s.budget(),quoted:!1,ansi:!0})));return{result:s.build(),usedAllSubs:i.size===e.length}}function uF(r){try{return new lF.default(r).ansi256().object().ansi256}catch{}}function pF(r){let e=/\s*(.*?)\s*:\s*(.*?)\s*(?:;|$)/g,t="\x1B[0m",n=e.exec(r);for(;n!==null;){if(n.length===3)switch(n[1]){case"color":let i=uF(n[2]);i&&(t+=`\x1B[38;5;${i}m`);break;case"background":case"background-color":let o=uF(n[2]);o&&(t+=`\x1B[48;5;${o}m`);break;case"font-weight":n[2]==="bold"&&(t+="\x1B[1m");break;case"font-style":n[2]==="italic"&&(t+="\x1B[3m");break;case"text-decoration":n[2]==="underline"&&(t+="\x1B[4m");break;default:}n=e.exec(r)}return t}var fF=r=>r.replace(/\n/gm,"\\n").replace(/\r/gm,"\\r").replace(/\t/gm,"\\t"),rQ={budget:1e5,quoted:!0},dF={budget:1e3,quoted:!0,postProcess:fF},nQ={budget:1/0,quoted:!1},iQ={budget:1e3,quoted:!0,postProcess:fF},oQ={budget:1e5,quoted:!0},pb=r=>{switch(r){case"repl":return rQ;case"hover":return dF;case"propertyValue":return dF;case"watch":return iQ;case"copy":case"clipboard":return nQ;default:return oQ}};var sQ=30,aQ=100,xC=20,cQ=1e4,uQ=3,hF=120,CC=new Set(["null","regexp","date"]);function cc(r){return r.type==="function"||r.type==="object"&&!CC.has(r.subtype)}function TC(r){return r.subtype==="array"||r.subtype==="typedarray"}function uc(r,e,t){let n=pb(e),i=db(r,n,t);return r.preview?.subtype==="regexp"?i:n.postProcess?.(i)??i}function db(r,e,t){return r.type==="function"?r.description?wF(r.description,e.budget):"<function>":r.type==="object"&&r.subtype==="node"?r.description:"preview"in r&&r.preview?fb(r.preview,e.budget,t):vF(r,e,t)}function fb(r,e,t){return TC(r)?lQ(r,e):r.subtype==="internal#entry"?Ni(r.description||"",e):r.type==="function"?wF(r.description,e):cc(r)?pQ(r,e,t):fQ(r,e,t)}function lQ(r,e){let t=new Xi(e),n=r.description,i=n.match(/[^(]*\(([\d]+)\)/);if(!i)return n;let o=parseInt(i[1],10);n.startsWith("Array(")&&(n=n.substring(5)),t.append(Ni(n,t.budget())),t.append(" ");let s=new Xi(t.budget()-2,", "),a=-1;for(let c of r.properties){if(!s.checkBudget())break;if(isNaN(c.name))continue;let u=parseInt(c.name,10);u>a+1&&s.appendEllipsis(),a=u,s.append(kf(c,s.budget()))}o>a+1&&s.appendEllipsis();for(let c of r.properties){if(!s.checkBudget())break;isNaN(c.name)&&s.append(kf(c,s.budget(),c.name))}return r.overflow&&s.appendEllipsis(),t.append("["+s.build()+"]"),t.build()}function pQ(r,e,t){let n=new Xi(e," ");r.description!=="Object"&&r.description!=null&&n.append(Ni(r.description,n.budget()));let i=new Map,o=r.properties||[];for(let d of o)i.set(d.name,d);let s=i.get("[[PrimitiveValue]]");if(s)return n.append(`(${kf(s,n.budget()-2)})`),n.build();let a=i.get("[[PromiseStatus]]"),c=i.get("[[PromiseValue]]");if(a&&c)return a.value==="pending"?n.append(`{<${a.value}>}`):n.append(`{${kf(c,n.budget()-2,`<${a.value}>`)}}`),n.build();let u=i.get("[[GeneratorStatus]]");if(u)return n.append(`{<${u.value}>}`),n.build();let l=new Xi(n.budget()-2,", ");for(let d of o){if(!l.checkBudget())break;l.append(kf(d,l.budget(),d.name))}for(let d of r.entries||[]){if(!l.checkBudget())break;if(d.key){let f=fb(d.key,Math.min(xC,l.budget()),t),h=fb(d.value,Math.min(xC,l.budget()-f.length-4),t);l.append(ul(f," => ",h,l.budget()))}else l.append(fb(d.value,Math.min(xC,l.budget()),t))}r.overflow&&l.appendEllipsis();let p=l.build();return p?n.append("{"+p+"}"):n.isEmpty()&&n.append("{}"),n.build()}function mF(r,e){return r.length<=e?r:"\u2026"}function dQ(r,e){return r.length>=e?r.slice(0,e-1)+"\u2026":r}function fQ(r,e,t){if(r.type==="object"&&r.subtype==="null")return mF("null",e);if(r.type==="undefined")return mF("undefined",e);if(r.type==="string"){let n=r.description??r.value;return t?.hex&&(n=Buffer.from(n,"utf8").toString("hex")),Cu(n,e)}return r.type==="number"||r.type==="bigint"?Rf(r,!1,e,t):dQ(r.description||"",e)}function ul(r,e,t,n){return r===void 0?Cu(t,n):r.length+e.length>n?Ni(r,n):yF(`${r}${e}${Cu(t,n-r.length-e.length)}`)}function kf(r,e,t){return e=Math.min(e,aQ),r.type==="function"?ul(t,": ","\u0192",e):r.type==="object"&&r.value==="Object"?ul(t,": ","{\u2026}",e):typeof r.value>"u"?ul(t,": ",`<${r.type}>`,e):r.type==="string"?ul(t,": ",bF(r.value),e):ul(t,": ",r.value??"unknown",e)}function yF(r){return r.replaceAll("\x1B","\\x1b")}function bF(r){let e=r.includes("'")?r.includes('"')?r.includes("`")?"'":"`":'"':"'",t=new RegExp(`[${e}\\\\]`,"g");return`${e}${r.replace(t,"\\$&")}${e}`}function vF(r,{budget:e,quoted:t,ansi:n},i){if(r.type==="string"){let o=r.value||(r.description?r.description:"");i?.hex&&(o=Buffer.from(o,"utf8").toString("hex"),t=!1);let s=Cu(o,t?e-2:e);return t&&(s=bF(s)),n?s:yF(s)}return r.type==="undefined"?"undefined":r.subtype==="null"?"null":r.type==="bigint"||r.type==="number"?Rf(r,!1,e,i):r.description?Ni(r.description,Math.max(e,1e5)):Ni(String("value"in r?r.value:r.description),e)}function wF(r,e){let t=new Xi(e),n=r.replace(/^function [gs]et /,"function ").replace(/^function [gs]et\(/,"function(").replace(/^[gs]et /,""),i=n.match(/^(async\s+function)/),o=n.startsWith("function*"),s=n.startsWith("*"),a=!o&&n.startsWith("function"),c=n.startsWith("class ")||n.startsWith("class{"),u=n.indexOf("=>"),l=!i&&!o&&!a&&!c&&u>0,p;if(c){p=n.substring(5);let h=/^[^{\s]+/.exec(p.trim()),m="";h&&(m=h[0].trim()||""),f("class",p,m)}else if(i)p=n.substring(i[1].length),f("async \u0192",p,d(p));else if(o)p=n.substring(9),f("\u0192*",p,d(p));else if(s)p=n.substring(1),f("\u0192*",p,d(p));else if(a)p=n.substring(8),f("\u0192",p,d(p));else if(l){let h=n;n.length>sQ&&(h=n.substring(0,u+2)+" {\u2026}"),f("",n,h)}else f("\u0192",n,d(n));return t.build();function d(h){let m=h.indexOf("("),y=h.match(/\)\s*{/),I=y&&y.index||0;if(m!==-1&&y&&I>m){let L=h.substring(0,m).trim()||"",P=h.substring(m,I+1);return L+P}return"()"}function f(h,m,y){t.checkBudget()&&(h.length&&t.append(h+" "),m=m.trim(),m.endsWith(" { [native code] }")&&(m=m.substring(0,m.length-18)),t.budget()>=m.length?t.append(m):t.append(y.replace(/\n/g," ")))}}function lc(r){let e=r;if(e.type!=="object"||e.subtype==="null")return{title:vF(e,{budget:cQ,quoted:!1},void 0)};let t=e.description??e.className??"Error",n=/^\s+at\s/m.exec(t);if(!n){let i=t.lastIndexOf(`
`);return i===-1?{title:t}:{title:t.substring(0,i)}}return{title:t.substring(0,n.index-1),stackTrace:t.substring(n.index+2)}}function Rf(r,e,t,n){if(r.type==="number"){if("unserializableValue"in r)return r.unserializableValue;let s=r.value!==void 0?r.value:+r.description;return n?.hex?s.toString(16):String(s)}if(r.type==="bigint"){let s=r.unserializableValue||r.description;return n?.hex?BigInt(s.slice(0,-1)).toString(16):s}let i=r,o=typeof i.value=="number"?i.value:+String(i.description);return Ni(String(e?Math.floor(o):o),t)}function hQ(r,e){return Cu(String(typeof r.value<"u"?r.value:r.description),e)}function SF(r){let e=[],t=new Set([void 0]),n=new Map;for(let l of r.properties.filter(p=>p.valuePreview)){let p=new Map;p.set(void 0,l.name),n.set(void 0,Math.max(n.get(void 0)||0,l.name.length)),e.push(p),l.valuePreview?.properties.map(d=>{d.value&&(t.add(d.name),p.set(d.name,d.value),n.set(d.name,Math.max(n.get(d.name)||0,d.value.length)))})}for(let l of t.values())l&&n.set(l,Math.max(n.get(l)||0,l.length));let i=Array.from(n.values()).reduce((l,p)=>l+p,0),o=hF-4-(t.size-1)*3;if(i>o){let l=o/i;for(let p of n.keys()){let d=Math.max(uQ,n.get(p)*l|0);n.set(p,d)}}let s=[];for(let l of t.values())s.push("-".repeat(n.get(l)));let a="[-"+s.join("-|-")+"-]",c=[];c.push(a.replace("[","\u256D").replace(/\|/g,"\u252C").replace("]","\u256E").replace(/-/g,"\u2504"));let u=[];for(let l of t.values())u.push(gF(l||"",n.get(l)));c.push("\u250A "+u.join(" \u250A ")+" \u250A"),c.push(a.replace("[","\u251C").replace(/\|/g,"\u253C").replace("]","\u2524").replace(/-/g,"\u2504"));for(let l of e){let p=[];for(let d of t.values())p.push(gF(l.get(d)||"",n.get(d)));c.push("\u250A "+p.join(" \u250A ")+" \u250A")}return c.push(a.replace("[","\u2570").replace(/\|/g,"\u2534").replace("]","\u256F").replace(/-/g,"\u2504")),c.map(l=>Ni(l,hF)).join(`
`)}var PC=new Map([["",(r,e)=>db(r,e)],["s",(r,e)=>hQ(r,e.budget)],["i",(r,e)=>Rf(r,!0,e.budget,void 0)],["d",(r,e)=>Rf(r,!0,e.budget,void 0)],["f",(r,e)=>Rf(r,!1,e.budget,void 0)],["c",r=>pF(r.value)],["o",(r,e)=>db(r,e)],["O",(r,e)=>db(r,e)]]);function gF(r,e){return r.length===e?r:r.length<e?r+" ".repeat(e-r.length):Ni(r,e)}var Fr=b(ie());var Af=b(N());async function EC(r){let e=await r.uiLocation();return e?e.source.blackboxed()?2:Sr(e.source)&&!e.isMapped&&e.unmappedReason===3?1:0:0}var mQ=new Set(["breakpoint","exception","entry"]),gQ=256,Ds=class{constructor(e,t){this.launchConfig=e;this.logger=t;this._smartStepCount=0}resetSmartStepCount(){this._smartStepCount>0&&(this.logger.verbose("internal",`smartStep: skipped ${this._smartStepCount} steps`),this._smartStepCount=0)}async getSmartStepDirection(e,t){if(!this.launchConfig.smartStep||mQ.has(e.reason))return;let n=(await e.stackTrace.loadFrames(1)).find(ka(hr));if((n&&await EC(n))===0){this.resetSmartStepCount();return}return this._smartStepCount++>gQ?2:t?.reason==="step"?t.direction:0}};Ds=S([(0,Af.injectable)(),g(0,(0,Af.inject)(we)),g(1,(0,Af.inject)($))],Ds);var IF=It(function(){return[Symbol.for("debug.description"),Symbol.for("nodejs.util.inspect.custom"),Symbol.for("debug.properties")]}),xF=Mi(function(r,e){let t=!1,n={},i="<<default preview>>";if(typeof this!="object"||!this)return n;for(let o of Object.keys(this)){let s;try{s=this[o]}catch{continue}if(e)try{let a=e.call(s,i);if(a!==i){n[o]=String(a);continue}}catch(a){n[o]=`<<indescribable>>${JSON.stringify([String(a),o])}`;continue}if(typeof s=="object"&&s){let a;for(let c of runtimeArgs[0].slice(0,2))if(typeof s[c]=="function")try{a=s[c](2);break}catch{}!a&&!String(s.toString).includes("[native code]")&&(a=String(s)),a&&!a.startsWith("[object ")&&(n[o]=a.length>=r?a.slice(0,r)+"\u2026":a)}}try{t=typeof this[runtimeArgs[0][2]]=="function"}catch{}return{out:n,customProps:t}}),hb=Mi(function(r,e){if(e)try{let t="<<default preview>>",n=e.call(this,t);if(n!==t)return String(n)}catch(t){return`<<indescribable>>${JSON.stringify([String(t),"object"])}`}if(typeof this=="object"&&this){let t;for(let n of[Symbol.for("debug.description"),Symbol.for("nodejs.util.inspect.custom")])if(typeof this[n]=="function")try{t=this[n](2);break}catch{}if(!t&&!String(this.toString).includes("[native code]")&&(t=String(this)),t&&!t.startsWith("[object "))return t.length>=r?t.slice(0,r)+"\u2026":t}}),CF=Mi(function(){let r=runtimeArgs[0][2];if(!(typeof this!="object"||!this)&&typeof this[r]=="function")try{let e=this[r]();if(typeof e=="object"&&e!==null)return e}catch{}});var Pe=b(ie()),$F=require("crypto");var Mr=class r{constructor(e=process.hrtime()){this.value=e}get ms(){return this.s*1e3}get s(){return this.value[0]+this.value[1]/1e9}elapsed(){return new r().subtract(this)}subtract(e){let t=this.value[1]-e.value[1],n=this.value[0]-e.value[0];return t<0&&(t+=1e9,n--),new r([n,t])}};var ll=class{constructor(e,t,n,i,o,s){this.launchConfig=e;this.targetInfo=t;this.parentTarget=n;this.targetOriginValue=i;this.cdp=o;this.logger=s;this.onNameChanged=new O().event;this.attached=!1;this.isWaitingForDebugger=!0;o.pause()}id(){return this.targetInfo.targetId}name(){return this.targetInfo.title}fileName(){return this.targetInfo.url}type(){return"node"}parent(){return this.parentTarget}children(){return[]}canStop(){return!1}stop(){}canRestart(){return!1}restart(){}canAttach(){return!this.attached}async attach(){return await this.cdp.Runtime.enable({}),this.launchConfig.noDebug||await this.cdp.Debugger.enable({}),this.attached=!0,this.cdp}canDetach(){return this.attached}async detach(){await this.cdp.Debugger.resume({}),await this.cdp.NodeWorker.detach({sessionId:this.targetInfo.targetId}),this.attached=!1}targetOrigin(){return this.targetOriginValue}afterBind(){return this.cdp.resume(),Promise.resolve()}async runIfWaitingForDebugger(){this.isWaitingForDebugger=!1,await this.cdp.Runtime.runIfWaitingForDebugger({})}initialize(){return Promise.resolve()}waitingForDebugger(){return this.isWaitingForDebugger}supportsCustomBreakpoints(){return!1}supportsXHRBreakpoints(){return!1}scriptUrlToUrl(e){return e[0]==="/"||process.platform==="win32"&&e[1]===":"&&e[2]==="\\"?Ae(e):e}executionContextName(){return this.targetInfo.title}};var Xe=b(ie()),mb=new Map;function pl(){if(mb.size)return mb;function r(o,s){for(let a of s)a.group=o,mb.set(a.id,a)}function e(o,s){let a=s||o;return{id:"instrumentation:"+o,title:a,group:"",details:c=>{if(o==="webglErrorFired"){let u=c.webglErrorName;return u=u.replace(/^.*(0x[0-9a-f]+).*$/i,"$1"),{short:u,long:Xe.t('Paused on WebGL Error instrumentation breakpoint, error "{0}"',u)}}return o==="scriptBlockedByCSP"&&c.directiveText?{short:Xe.t('CSP violation "{0}"',c.directiveText),long:Xe.t('Paused on Content Security Policy violation instrumentation breakpoint, directive "{0}"',c.directiveText)}:{short:a,long:Xe.t('Paused on instrumentation breakpoint "{0}"',a)}},apply:async(c,u)=>(u?await c.EventBreakpoints.setInstrumentationBreakpoint({eventName:o}):await c.EventBreakpoints.removeInstrumentationBreakpoint({eventName:o}))?!0:!!(u?await c.DOMDebugger.setInstrumentationBreakpoint({eventName:o}):await c.DOMDebugger.removeInstrumentationBreakpoint({eventName:o}))}}function t(o,s,a){let c=s===void 0?"*":typeof s=="string"?[s]:s;return{id:"listener:"+o,title:a||o,group:"",details:u=>{let l=(u.targetName||"*").toLowerCase();return{short:l+"."+o,long:Xe.t('Paused on event listener breakpoint "{0}", triggered on "{1}"',o,l)}},apply:async(u,l)=>{let p=!0;for(let d of c)l?p=p&&!!await u.DOMDebugger.setEventListenerBreakpoint({eventName:o,targetName:d}):p=p&&!!await u.DOMDebugger.removeEventListenerBreakpoint({eventName:o,targetName:d});return p}}}r("Ad Auction Worklet",[e("beforeBidderWorkletBiddingStart",Xe.t("Bidder Bidding Phase Start")),e("beforeBidderWorkletReportingStart",Xe.t("Bidder Reporting Phase Start")),e("beforeSellerWorkletScoringStart",Xe.t("Seller Scoring Phase Start")),e("beforeSellerWorkletReportingStart",Xe.t("Seller Reporting Phase Start"))]),r("Animation",[e("requestAnimationFrame",Xe.t("Request Animation Frame")),e("cancelAnimationFrame",Xe.t("Cancel Animation Frame")),e("requestAnimationFrame.callback",Xe.t("Animation Frame Fired"))]),r("Canvas",[e("canvasContextCreated",Xe.t("Create canvas context")),e("webglErrorFired",Xe.t("WebGL Error Fired")),e("webglWarningFired",Xe.t("WebGL Warning Fired"))]),r("Clipboard",[t("copy"),t("cut"),t("paste"),t("beforecopy"),t("beforecut"),t("beforepaste")]),r("Control",[t("resize"),t("scroll"),t("scrollend"),t("zoom"),t("focus"),t("blur"),t("select"),t("change"),t("submit"),t("reset")]),r("Device",[t("deviceorientation"),t("devicemotion")]),r("DOM Mutation",[t("DOMActivate"),t("DOMFocusIn"),t("DOMFocusOut"),t("DOMAttrModified"),t("DOMCharacterDataModified"),t("DOMNodeInserted"),t("DOMNodeInsertedIntoDocument"),t("DOMNodeRemoved"),t("DOMNodeRemovedFromDocument"),t("DOMSubtreeModified"),t("DOMContentLoaded")]),r("Drag / Drop",[t("drag"),t("dragstart"),t("dragend"),t("dragenter"),t("dragover"),t("dragleave"),t("drop")]),r("Geolocation",[e("Geolocation.getCurrentPosition","getCurrentPosition"),e("Geolocation.watchPosition","watchPosition")]),r("Keyboard",[t("keydown"),t("keyup"),t("keypress"),t("input")]),r("Load",[t("load"),t("beforeunload"),t("unload"),t("abort"),t("error"),t("hashchange"),t("popstate"),t("navigate"),t("navigatesuccess"),t("navigateerror"),t("currentchange"),t("nagivateto"),t("navigatefrom"),t("finish"),t("dispose")]);let n=["audio","video"];r("Media",[t("play",n),t("pause",n),t("playing",n),t("canplay",n),t("canplaythrough",n),t("seeking",n),t("seeked",n),t("timeupdate",n),t("ended",n),t("ratechange",n),t("durationchange",n),t("volumechange",n),t("loadstart",n),t("progress",n),t("suspend",n),t("abort",n),t("error",n),t("emptied",n),t("stalled",n),t("loadedmetadata",n),t("loadeddata",n),t("waiting",n)]),r("Mouse",[t("auxclick"),t("click"),t("dblclick"),t("mousedown"),t("mouseup"),t("mouseover"),t("mousemove"),t("mouseout"),t("mouseenter"),t("mouseleave"),t("mousewheel"),t("wheel"),t("contextmenu")]),r("Notification",[e("Notification.requestPermission","requestPermission")]),r("Parse",[e("Element.setInnerHTML",Xe.t("Set innerHTML")),e("Document.write","document.write")]),r("Picture-in-Picture",[t("enterpictureinpicture","video"),t("leavepictureinpicture","video"),t("resize","PictureInPictureWindow"),t("enter","documentPictureInPicture")]),r("Pointer",[t("pointerover"),t("pointerout"),t("pointerenter"),t("pointerleave"),t("pointerdown"),t("pointerup"),t("pointermove"),t("pointercancel"),t("gotpointercapture"),t("lostpointercapture"),t("pointerrawupdate")]),r("Script",[e("scriptFirstStatement",Xe.t("Script First Statement")),e("scriptBlockedByCSP",Xe.t("Script Blocked by Content Security Policy"))]),r("Timer",[e("setTimeout"),e("clearTimeout"),e("setInterval"),e("clearInterval"),e("setTimeout.callback",Xe.t("setTimeout fired")),e("setInterval.callback",Xe.t("setInterval fired"))]),r("Touch",[t("touchstart"),t("touchmove"),t("touchend"),t("touchcancel")]),r("WebAudio",[e("audioContextCreated",Xe.t("Create AudioContext")),e("audioContextClosed",Xe.t("Close AudioContext")),e("audioContextResumed",Xe.t("Resume AudioContext")),e("audioContextSuspended",Xe.t("Suspend AudioContext"))]),r("Window",[e("DOMWindow.close","window.close")]),r("Worker",[t("message"),t("messageerror")]);let i=["xmlhttprequest","xmlhttprequestupload"];return r("XHR",[t("readystatechange",i),t("load",i),t("loadstart",i),t("loadend",i),t("abort",i),t("error",i),t("progress",i),t("timeout",i)]),mb}var kC=ox(),TF=Mi(function(){let r=["instantiate","instantiateStreaming","compile","compileStreaming"];for(let e of r){let t=WebAssembly[e];WebAssembly[e]=function(...n){return t.apply(this,n).then(i=>{if(!(n[0]instanceof WebAssembly.Module))debugger;return i})}}},kC);var gb=Mi(function(r,e){let t=" ".repeat(e),n=`
`;function i(s){if(s instanceof Uint8Array)return Uint8Array;if(s instanceof Uint8ClampedArray)return Uint8ClampedArray;if(s instanceof Uint16Array)return Uint16Array;if(s instanceof Uint32Array)return Uint32Array;if(s instanceof BigUint64Array)return BigUint64Array;if(s instanceof Int8Array)return Int8Array;if(s instanceof Int32Array)return Int32Array;if(s instanceof BigInt64Array)return BigInt64Array;if(s instanceof Float32Array)return Float32Array;if(s instanceof Float64Array)return Float64Array}function o(s,a=0,c=[]){switch(typeof s){case"bigint":return`${s}n`;case"boolean":return s.toString();case"function":{let p=s.toString().replace(/^[^\s]+\(/,"function(").split(/\r?\n/g),d=/^$/;for(let f of p){let h=/^[ \t]+/.exec(f);if(h){d=new RegExp(`^[ \\t]{0,${h[0].length}}`);break}}return p.map((f,h)=>h===0?f:(f=f.replace(d,""),h===p.length-1?t.repeat(a)+f:t.repeat(a+1)+f)).join(n)}case"number":return`${s}`;case"object":if(s===null)return"null";if(c.includes(s))return"[Circular]";if(s instanceof Date)return`"${s.toISOString()}"`;if(typeof Node<"u"&&r instanceof Node)return r.outerHTML;let u=i(s);if(u)return`new ${u.name}([${s.join(", ")}])`;if(s instanceof ArrayBuffer)return`new Uint8Array([${new Uint8Array(s).join(", ")}]).buffer`;if(s instanceof Array)return["[",...s.map(p=>t.repeat(a+1)+o(p,a+1,[...c,s])+","),t.repeat(a)+"]"].join(n);let l=s;return["{",...Object.keys(l).map(p=>t.repeat(a+1)+(/^[$a-z_][0-9a-z_$]*$/i.test(p)?p:JSON.stringify(p))+": "+o(l[p],a+1,[...c,s])+","),t.repeat(a)+"}"].join(n);case"string":return s.includes(`
`)?"`"+s.replace(/[`\\\\]|\${/g,"\\$&")+"`":JSON.stringify(s);case"symbol":return s.toString();case"undefined":return"undefined";default:return String(s)}}try{return o(r)}catch{return""+r}}),PF=It(`
  function(spaces2) {
    const result = ${gb.expr("this","spaces2")};
    return result;
  }
`);var Pn=b(ie());var Os=b(N());var EF=It(function(){let r={__proto__:this.__proto__},e=Object.getOwnPropertyNames(this);for(let t=0;t<e.length;++t){let n=e[t],i=n>>>0;if(String(i>>>0)===n&&i>>>0!==4294967295)continue;let o=Object.getOwnPropertyDescriptor(this,n);o&&Object.defineProperty(r,n,o)}return r});var kF=It(function(r,e){let t={},n=r===-1?0:r,i=e===-1?this.length:r+e;for(let o=n;o<i&&o<this.length;++o){let s=Object.getOwnPropertyDescriptor(this,o);s&&Object.defineProperty(t,o,s)}return t});var RF=It(function(r,e){let t={},n=r===-1?0:r,i=e===-1?this.childNodes.length:r+e;for(let o=n;o<i&&o<this.childNodes.length;++o){let s=this.childNodes[o];s.nodeName==="#comment"?t[o]=`<!-- ${s.textContent} -->`:s.nodeName==="#text"?t[o]=s.textContent||"":t[o]=s}return t});var AF=It(function(r){return r.call(this)});var RC=It(function(r,e){let{buffer:t,byteLength:n,byteOffset:i}=this instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&this instanceof SharedArrayBuffer?new DataView(this):this instanceof WebAssembly.Memory?new DataView(this.buffer):this,o=i+Math.min(r,n),s=Math.max(0,Math.min(e,n-r));return a(new Uint8Array(t,o,s));function a(c){let u="0123456789abcdef",l="";for(let p=0;p<c.length;p++){let d=c[p];l+=u[d>>>4]+u[d&15]}return l}});var AC=It(function(r,e){let t=c(e),{buffer:n,byteLength:i,byteOffset:o}=this instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&this instanceof SharedArrayBuffer?new DataView(this):this instanceof WebAssembly.Memory?new DataView(this.buffer):this,s=o+Math.min(r,i),a=Math.max(0,Math.min(t.length,i-r));return new Uint8Array(n,s,a).set(t.subarray(0,a)),a;function c(u){let l=new Uint8Array(u.length>>>1);for(let p=0;p<u.length;p+=2)l[p>>>1]=parseInt(u.slice(p,p+2),16);return l}});var fl=(()=>{let r=0,e=2147483646;return()=>r++%e+1})(),GC=r=>{if(typeof r=="string")return{value:r};let e=r;return e.objectId?{objectId:e.objectId}:e.unserializableValue?{unserializableValue:e.unserializableValue}:{value:e.value}},bQ=new Set(["typedarray","dataview","arraybuffer","webassemblymemory"]);var jF=1024,DF=/^[$a-z_][0-9a-z_$]*$/i,vQ=/^#[0-9a-z_$]+$/i,wQ=r=>r.hasOwnProperty("configurable"),OF=(r,e,t)=>{let n=H1(r,Kd(e),t);return To(n)},LF="<<indescribable>>",UF=r=>{if(!r.startsWith(LF))return r;let e,t;try{[e,t]=JSON.parse(r.slice(LF.length))}catch{return r}return Pn.t("{0} (couldn't describe: {1})",e,t)},DC=r=>!!r&&typeof r=="object"&&"readMemory"in r&&"writeMemory"in r,MF={PARAMETER:{name:Pn.t("Parameters"),sortOrder:-10},LOCAL:{name:Pn.t("Locals"),sortOrder:-9},GLOBAL:{name:Pn.t("Globals"),sortOrder:-8}},Df=class r{constructor(e,t,n,i,o,s,a,c){this.cdp=e;this.parent=t;this.vars=i;this.locationProvider=o;this.currentRef=s;this.settings=a;this.clientCapabilities=c;this.name=n.name,this.presentationHint=n.presentationHint,this.sortOrder=n.sortOrder||0,this.isCustomProperty=n.isCustomProperty}get customDescriptionGenerator(){return this.settings.customDescriptionGenerator}createVariable(e,t,...n){let i=new e(new r(this.cdp,this.currentRef?.(),t,this.vars,this.locationProvider,()=>i,this.settings,this.clientCapabilities),...n);return i.id>0&&this.vars.add(i),i}createVariableByType(e,t,n){if(TC(t))return this.createVariable(wb,e,t);if(t.objectId){if(t.type==="function")return this.createVariable(jC,e,t,n);if(t.subtype==="map"||t.subtype==="set")return this.createVariable(UC,e,t,n);if(t.subtype==="node")return this.createVariable(BC,e,t,n);if(!CC.has(t.subtype))return this.createVariable(Ms,e,t,n)}return this.createVariable(Nr,e,t)}createWasmVariable(e,t,n){return this.createVariable(Lf,e,t,n)}async getDescriptionSymbols(e){return this.settings.descriptionSymbols??=IF({cdp:this.cdp,args:[],objectId:e}).then(t=>({objectId:t.objectId}),()=>({value:[]})),await this.settings.descriptionSymbols}async fetchObjectProperties(e){return Promise.all([this.cdp.Runtime.getProperties({objectId:e,accessorPropertiesOnly:!0,ownProperties:!1,generatePreview:!0}),this.cdp.Runtime.getProperties({objectId:e,ownProperties:!0,generatePreview:!0}),this.cdp.Runtime.callFunctionOn({functionDeclaration:xF.decl(`${jF}`,this.settings.customDescriptionGenerator||"null"),arguments:[await this.getDescriptionSymbols(e)],objectId:e,throwOnSideEffect:!0,returnByValue:!0}).then(t=>t?.result.value||{}).catch(()=>({}))])}async createObjectPropertyVars(e,t,n=!1){let i=[],o;if(this.settings.customPropertiesGenerator){let{result:p,errorDescription:d}=await this.evaluateCodeForObject(e,this.settings.customPropertiesGenerator,[]);p&&p.type!=="undefined"?e=p:i.push([this.createVariable(MC,{name:"",sortOrder:-1},p,p?.description||d||Pn.t("Unknown error"))])}if(!e.objectId)return[];t&&this.cdp.DotnetDebugger.setEvaluationOptions({options:t,type:"variable"});let[s,a,c]=await this.fetchObjectProperties(e.objectId);if(!s||!a)return[];if(!this.settings.customPropertiesGenerator&&c.customProps&&!n)try{let p=await this.cdp.Runtime.callFunctionOn({functionDeclaration:CF.decl(),arguments:[await this.getDescriptionSymbols(e.objectId)],objectId:e.objectId,throwOnSideEffect:!0});if(p&&p.result.objectId&&(o=e,e=p.result,[s,a,c]=await this.fetchObjectProperties(e.objectId),!s||!a))return[]}catch{}if(!s||!a)return[];let u=new Map,l=[];for(let p of s.result){if(p.symbol){l.push(p);continue}p.name==="__proto__"&&a.internalProperties?.some(d=>d.name==="[[Prototype]]")||u.set(p.name,p)}for(let p of a.result)p.get||p.set||(p.symbol?l.push(p):u.set(p.name,p));for(let p of[u.values(),l.values()])for(let d of p){if("symbol"in d&&d.symbol?.description==="Symbol(debug.properties)")continue;let f=o?{presentationHint:{kind:"virtual"},isCustomProperty:!!o}:void 0;i.push(this.createPropertyVar(d,e,c.out?.hasOwnProperty(d.name)?UF(c.out[d.name]):void 0,f))}for(let p of a.privateProperties??[]){let d=o?{presentationHint:{kind:"virtual",visibility:"private"},sortOrder:1,isCustomProperty:!!o}:{presentationHint:{visibility:"private"},sortOrder:1,isCustomProperty:!!o};i.push(this.createPropertyVar(p,e,void 0,d))}for(let p of a.internalProperties||[]){if(p.name==="[[StableObjectId]]")continue;let d;WF(p)?d=this.createFunctionLocationVariable(p):p.value!==void 0&&(d=this.createVariableByType({name:p.name,presentationHint:{visibility:"internal"},sortOrder:2},p.value)),d&&i.push([d])}return o&&i.push([this.createVariable(NC,{name:"...",presentationHint:{kind:"virtual",attributes:["readOnly"],visibility:"internal"},sortOrder:2},o)]),bo(await Promise.all(i))}createFunctionLocationVariable(e){return this.createVariable(bb,{name:e.name,presentationHint:{visibility:"internal",attributes:["readOnly"]},sortOrder:2},e.value)}async createPropertyVar(e,t,n,i){let o=[],s=e.get&&e.get.type!=="undefined",a=e.set&&e.set.type!=="undefined",c={name:e.name,sortOrder:0,isCustomProperty:!1,...i,presentationHint:{...i?.presentationHint}};return i||(wQ(e)?(e.enumerable===!1&&!s&&(c.presentationHint.visibility="internal",c.sortOrder=1),(e.writable===!1||s&&!a)&&(c.presentationHint.attributes=["readOnly"])):(c.presentationHint.visibility="private",c.sortOrder=1)),"value"in e&&e.value&&o.push(this.createVariableByType(c,e.value,n)),s?o.push(this.createVariable(VC,c,e.get,t)):a&&o.push(this.createVariable(WC,c,e.set)),o}async evaluateCodeForObject(e,t,n){try{let i=await this.cdp.Runtime.callFunctionOn({objectId:e.objectId,functionDeclaration:t,arguments:n.map(GC)});if(i){if(i.exceptionDetails===void 0)return{result:i.result};if(i&&i.result.description)return{errorDescription:i.result.description}}return{errorDescription:Pn.t("Unknown error")}}catch(i){return{errorDescription:i.stack||i.message||String(i)}}}},NF=r=>typeof r=="number"||/^[0-9]+$/.test(r),Nr=class r{constructor(e,t){this.context=e;this.remoteObject=t;this.id=fl()}get name(){return this.context.name}get sortOrder(){return this.context.sortOrder}get accessor(){let{parent:e,name:t,isCustomProperty:n}=this.context;if(e instanceof Of)return e.accessor;if(!(e instanceof r))return this.context.name;if(n){let o=`${e.accessor}[Symbol.for(${JSON.stringify("debug.properties")})]()`;return NF(t)?`${o}[${t}]`:DF.test(t)?`${o}.${t}`:`${o}[${JSON.stringify(t)}]`}let i=e.context.parent;if(i instanceof r){if(this.remoteObject.subtype==="internal#entry")return`[...${i.accessor}.entries()][${+t}]`;if(e.remoteObject.subtype==="internal#entry")return`${e.accessor}[${this.name==="key"?0:1}]`}return NF(t)?`${e.accessor}[${t}]`:DF.test(t)?`${e.accessor}.${t}`:e.accessor==="this"&&vQ.test(t)?`${e.accessor}.${t}`:`${e.accessor}[${JSON.stringify(t)}]`}async toDap(e,t){let n=this.context.name;return this.context.parent instanceof dl&&(n=await this.context.parent.getRename(n)),Promise.resolve({name:n,value:uc(this.remoteObject,e,t),evaluateName:this.accessor,type:this.remoteObject.type,variablesReference:0,presentationHint:this.context.presentationHint})}async setProperty(e,t){let n=await this.context.cdp.Runtime.callFunctionOn({objectId:this.remoteObject.objectId,functionDeclaration:`function(a) { return this[a] = ${t}; ${at()} }`,arguments:[GC(e)],silent:!0});if(!n)throw new F(Me(Pn.t("Unable to set variable value")));if(n.exceptionDetails)throw new F(qF(n.exceptionDetails));return this.context.createVariableByType({name:e},n.result)}async getChildren(e){return Promise.resolve([])}},yb=class{constructor(e){this.child=e;this.id=fl()}getChildren(){return Promise.resolve([this.child])}},OC=class extends Nr{constructor(t,n,i,o){super(t,{type:i[0]?.type??"string"});this.value=n;this.args=i;this.stackTrace=o}toDap(){return Promise.resolve({name:this.context.name,value:this.value,variablesReference:this.stackTrace||this.args.some(cc)?this.id:0})}getChildren(t){let n=[],{args:i,stackTrace:o}=this;for(let s=0;s<i.length;++s)cc(i[s])&&n.push(this.context.createVariableByType({name:`arg${s}`,sortOrder:s},i[s]));return o&&n.push(this.context.createVariable(LC,{name:"",sortOrder:Number.MAX_SAFE_INTEGER},this.remoteObject,o)),Promise.resolve(n)}},LC=class extends Nr{constructor(t,n,i){super(t,n);this.stacktrace=i}async toDap(){return{name:"",value:await this.stacktrace.format(),variablesReference:0}}},bb=class extends Nr{constructor(e,t){super(e,t),this.location=t.value}async toDap(){return{name:this.context.name,value:await this.context.locationProvider.renderDebuggerLocation(this.location),variablesReference:0,presentationHint:{visibility:"internal"}}}},MC=class extends Nr{constructor(t,n,i){super(t,n);this.message=i}get accessor(){if(!(this.context.parent instanceof Nr))throw new Error("ErrorVariable must have a parent Variable");return this.context.parent.accessor}toDap(){return Promise.resolve({name:this.context.name,value:this.message,variablesReference:0})}},vb=Symbol("NoStringRepr"),Ms=class extends Nr{constructor(t,n,i){super(t,n);this.customStringRepr=i}async toDap(t,n){let[i,o]=await Promise.all([await super.toDap(t,n),await this.getValueRepresentation(t)]);return{...i,type:this.remoteObject.className||this.remoteObject.subtype||this.remoteObject.type,variablesReference:this.id,memoryReference:bQ.has(this.remoteObject.subtype)?String(this.id):void 0,value:o}}async getValueRepresentation(t){if(typeof this.customStringRepr=="string")return this.customStringRepr;if(!this.context.parent&&this.remoteObject.objectId&&this.customStringRepr!==vb)try{let n=await this.context.cdp.Runtime.callFunctionOn({functionDeclaration:hb.decl(`${jF}`,this.context.customDescriptionGenerator||"null"),objectId:this.remoteObject.objectId,returnByValue:!0});if(n?.result.value)return this.customStringRepr=UF(n.result.value)}catch{this.customStringRepr=vb}return this.context.name==="__proto__"&&this.remoteObject.description||uc(this.remoteObject,t)}async readMemory(t,n){let i=await RC({cdp:this.context.cdp,args:[t,n],objectId:this.remoteObject.objectId,returnByValue:!0});return Buffer.from(i.value,"hex")}async writeMemory(t,n){return(await AC({cdp:this.context.cdp,args:[t,n.toString("hex")],objectId:this.remoteObject.objectId,returnByValue:!0})).value}getChildren(t){return this.context.createObjectPropertyVars(this.remoteObject,t.evaluationOptions)}},NC=class extends Ms{get accessor(){let{parent:e}=this.context;return e instanceof Nr?e.accessor:super.accessor}getChildren(e){return this.context.createObjectPropertyVars(this.remoteObject,e.evaluationOptions,!0)}},FC=class extends Ms{constructor(){super(...arguments);this.id=fl()}get accessor(){return this.context.parent.accessor}async toDap(t,n){return Promise.resolve({...await super.toDap(t,n),value:"..."})}},BC=class extends Nr{constructor(){super(...arguments);this.description=ne(()=>this.context.cdp.DOM.describeNode({objectId:this.remoteObject.objectId}))}async toDap(t,n){let o=(await this.description())?.node?.childNodeCount||0;return{...await super.toDap(t,n),value:await this.getValuePreview(t),variablesReference:this.id,indexedVariables:o>100?o:void 0,namedVariables:o>100?1:void 0}}async getChildren(t){switch(t?.filter){case"indexed":return this.getNodeChildren(t.start,t.count);case"named":return[this.getAttributesVar()];default:return[this.getAttributesVar(),...await this.getNodeChildren()]}}getAttributesVar(){return this.context.createVariable(FC,{name:Pn.t("Node Attributes"),presentationHint:{visibility:"internal"},sortOrder:Number.MAX_SAFE_INTEGER},this.remoteObject,void 0)}async getNodeChildren(t=-1,n=-1){let i;try{i=await RF({cdp:this.context.cdp,generatePreview:!1,args:[t,n],objectId:this.remoteObject.objectId})}catch{return[]}let o=await this.context.createObjectPropertyVars(i);return i.objectId&&await this.context.cdp.Runtime.releaseObject({objectId:i.objectId}),o}async getValuePreview(t){let n=await this.description();if(!n?.node)return"";let{localName:i,attributes:o,childNodeCount:s}=n.node,a=this.context.clientCapabilities.value?.supportsANSIStyling?!0:"",c=(a&&"\x1B[34m")+`<${i}`;if(o)for(let u=0;u<o.length;u+=2){let l=o[u],p=o[u+1];c+=` ${a&&"\x1B[34;1m"}${l}${a&&"\x1B[2m"}=${a&&"\x1B[33m"}${JSON.stringify(p)}`}return c+=(a&&"\x1B[34m")+">",s&&(c+=`${a&&"\x1B[2m"}...${a&&"\x1B[34m"}`),c+=`</${i}>${a&&"\x1B[0m"}`,c}},jC=class extends Ms{async toDap(e){let[t,n]=await Promise.all([super.toDap(e),this.context.cdp.Runtime.getProperties({objectId:this.remoteObject.objectId,ownProperties:!0,nonIndexedPropertiesOnly:!0})]),i=n?.internalProperties?.find(WF);return i&&(t.valueLocationReference=this.context.createFunctionLocationVariable(i).id),t}},FF="[[Entries]]",UC=class extends Ms{constructor(t,n){super(t,n,vb);this.baseChildren=ne(()=>super.getChildren({variablesReference:this.id}));this.isMap=n.subtype==="map";let i=n.preview;this.size=Number(i?.properties.find(o=>o.name==="size")?.value)??void 0}async toDap(t){let n=await super.toDap(t);return this.size&&this.size>100&&(n.indexedVariables=this.size),n}async getChildren(t){let n=await this.baseChildren();return[...(await n.find(o=>o.name===FF)?.getChildren(t)||[]).filter(o=>o.sortOrder===0),...n.filter(o=>o.name!==FF)]}},wb=class extends Ms{constructor(t,n){super(t,n,vb);this.length=0;let i=String(n.description).match(/\(([0-9]+)\)/);this.length=i?+i[1]:0}async toDap(t){return{...await super.toDap(t),indexedVariables:this.length>100?this.length:void 0,namedVariables:this.length>100?1:void 0}}async getChildren(t){switch(t?.filter){case"indexed":return this.getArraySlots(t);case"named":return this.getArrayProperties();default:return Promise.all([this.getArrayProperties(),this.getArraySlots()]).then(bo)}}async getArrayProperties(){try{let t=await EF({cdp:this.context.cdp,args:[],objectId:this.remoteObject.objectId,generatePreview:!0});return this.context.createObjectPropertyVars(t)}catch{return[]}}async getArraySlots(t){let n=t&&typeof t.start<"u"?t.start:-1,i=t&&typeof t.count<"u"?t.count:-1,o;try{o=await kF({cdp:this.context.cdp,generatePreview:!1,args:[n,i],objectId:this.remoteObject.objectId})}catch{return[]}let s=await this.context.createObjectPropertyVars(o);return o.objectId&&await this.context.cdp.Runtime.releaseObject({objectId:o.objectId}),s}},qC=class extends wb{async toDap(e){return this.remoteObject.preview?{...await super.toDap(e),name:SF(this.remoteObject.preview)}:super.toDap(e)}},Of=class extends Nr{constructor(e,t){super(e,t)}getChildren(e){return this.context.createObjectPropertyVars(this.remoteObject)}},WC=class extends Of{async toDap(e,t){return{...await super.toDap(e,t),value:"write-only",variablesReference:this.id}}},VC=class extends Of{constructor(t,n,i){super(t,n);this.parentObject=i}async toDap(t,n){let i=await super.toDap(t,n);return i.variablesReference=this.id,i.presentationHint={...i.presentationHint,lazy:!0},i}async getChildren(t){try{let n=await AF({cdp:this.context.cdp,objectId:this.parentObject.objectId,args:[new Yd(this.remoteObject.objectId)]});return[this.context.createVariableByType({name:this.name,presentationHint:this.context.presentationHint},n)]}catch(n){if(!(n instanceof ja))throw n}return super.getChildren(t)}},Lf=class r{constructor(e,t,n){this.context=e;this.variable=t;this.scopeRef=n;this.id=fl();this.sortOrder=0}static{this.presentationHint={attributes:["readOnly"]}}toDap(){return Promise.resolve({name:this.context.name,value:this.variable.description||"",variablesReference:this.variable.getChildren?this.id:0,memoryReference:this.variable.linearMemoryAddress?String(this.id):void 0,presentationHint:this.context.presentationHint})}async getChildren(){return(await this.variable.getChildren?.()||[]).map(t=>this.context.createVariable(r,{name:t.name,presentationHint:r.presentationHint},t.value,this.scopeRef))}async readMemory(e,t){let n=this.variable.linearMemoryAddress;if(n===void 0)return;let i=await this.context.cdp.Debugger.evaluateOnCallFrame({callFrameId:this.scopeRef.callFrameId,expression:`(${RC.source}).call(memories[0].buffer, ${+n+e}, ${+t}) ${at()}`,returnByValue:!0});if(!i)throw new ja({exceptionId:0,text:"No response from CDP",lineNumber:0,columnNumber:0});return Buffer.from(i.result.value,"hex")}async writeMemory(e,t){let n=this.variable.linearMemoryAddress;return n===void 0?0:(await this.context.cdp.Debugger.evaluateOnCallFrame({callFrameId:this.scopeRef.callFrameId,expression:`(${AC.source}).call(memories[0].buffer, ${+n+e}, ${JSON.stringify(t.toString("hex"))}) ${at()}`,returnByValue:!0}))?.result.value||0}},$C=class{constructor(e,t,n,i){this.context=e;this.kind=t;this.variables=n;this.scopeRef=i;this.id=fl();this.sortOrder=MF[this.kind]?.sortOrder||0}toDap(){return Promise.resolve({name:MF[this.kind]?.name||this.kind,value:"",variablesReference:this.id})}getChildren(){return Promise.all(this.variables.map(async e=>{let t=await e.evaluate();return this.context.createVariable(Lf,{name:e.name,presentationHint:Lf.presentationHint},t,this.scopeRef)}))}},dl=class{constructor(e,t,n,i,o){this.remoteObject=e;this.context=t;this.ref=n;this.extraProperties=i;this.renameProvider=o;this.id=fl()}async getChildren(e){let t=await this.context.createObjectPropertyVars(this.remoteObject),n=new Set(t.map(i=>i.name));for(let i of this.extraProperties)n.has(i.name)||t.push(this.context.createVariableByType({name:i.name},i.value));return t}async getRename(e){return(await this.renameProvider.provideOnStackframe(this.ref.stackFrame)).getOriginalName(e,this.ref.stackFrame.rawPosition)||e}async setProperty(e,t){let n=await this.context.cdp.Debugger.evaluateOnCallFrame({expression:`${t} ${at()}`,callFrameId:this.ref.callFrameId});if(!n)throw new F(Ne(Pn.t("Invalid expression")));if(n.exceptionDetails)throw new F(qF(n.exceptionDetails));return await this.context.cdp.Debugger.setVariableValue({callFrameId:this.ref.callFrameId,scopeNumber:this.ref.scopeNumber,variableName:e,newValue:GC(n.result)}),this.context.createVariableByType({name:e},n.result)}},HC=class{constructor(){this.value=new Map}get(e){return this.value.get(e)}add(e){this.value.set(e.id,e)}clear(){this.value.clear()}},Ls=class{constructor(e,t,n,i,o,s){this.renameProvider=e;this.cdp=t;this.dap=n;this.launchConfig=i;this.clientCapabilities=o;this.locationProvider=s;this.vars=new HC;this.contextSettings={customDescriptionGenerator:i.customDescriptionGenerator&&OF(["defaultValue"],i.customDescriptionGenerator,!1),customPropertiesGenerator:i.customPropertiesGenerator&&OF([],i.customPropertiesGenerator,!1)}}createDetached(){return new Ls(this.renameProvider,this.cdp,this.dap,this.launchConfig,this.clientCapabilities,this.locationProvider)}clear(){this.vars.clear()}createFloatingVariable(e,t){return this.createFloatingContext().createVariableByType({name:e},t)}createFloatingWasmVariable(e,t,n,i){let o=this.createFloatingContext(),s={stackFrame:n,callFrameId:i,scopeNumber:0};return o.createWasmVariable({name:e},t,s)}createVariableForOutput(e,t,n,i){let o=this.createFloatingContext(),s=t.length===1&&i==="table"?o.createVariable(qC,{name:""},t[0]):t.length===1&&cc(t[0])&&!n?o.createVariableByType({name:""},t[0]):o.createVariable(OC,{name:""},e,t,n),a=new yb(s);return this.vars.add(a),a}createScope(e,t,n){let i=new dl(e,new Df(this.cdp,void 0,{name:""},this.vars,this.locationProvider,()=>i,this.contextSettings,this.clientCapabilities),t,n,this.renameProvider);return this.vars.add(i),i}createWasmScope(e,t,n){let i=new $C(new Df(this.cdp,void 0,{name:""},this.vars,this.locationProvider,()=>i,this.contextSettings,this.clientCapabilities),e,t,n);return this.vars.add(i),i}hasVariable(e){return!!this.vars.get(e)}hasMemory(e){return DC(this.vars.get(Number(e)))}async readMemory(e,t,n){let i=this.vars.get(Number(e));return DC(i)?i.readMemory(t,n):void 0}async writeMemory(e,t,n){let i=this.vars.get(Number(e)),o=DC(i)?await i.writeMemory(t,n):0;return o>0&&this.dap.invalidated({areas:["variables"]}),o}async getVariableNames(e){let t=this.vars.get(e.variablesReference);return t?(await t.getChildren(e)).filter(ka(Nr)):[]}async getVariables(e){let t=this.vars.get(e.variablesReference);if(!t)return[];let n=await t.getChildren(e);return(await Promise.all(n.map(o=>o.toDap(t instanceof dl||t instanceof yb?"repl":"propertyValue",e.format).then(s=>({v:o,dap:s}))))).sort((o,s)=>o.v.sortOrder-s.v.sortOrder||+o.dap.name-+s.dap.name||o.dap.name.localeCompare(s.dap.name)).map(o=>o.dap)}async getLocations(e){let t=this.vars.get(e);if(!t||!(t instanceof bb))throw zd();return t.location}async setVariable(e){let t=this.vars.get(e.variablesReference);if(!e.value)throw new F(Ne(Pn.t("Cannot set an empty value")));if(t instanceof dl||t instanceof Nr)return await(await t.setProperty(e.name,e.value)).toDap("propertyValue",e.format);throw new F(Me(Pn.t("Variable not found")))}createFloatingContext(){return new Df(this.cdp,void 0,{name:"<unnamed>"},this.vars,this.locationProvider,void 0,this.contextSettings,this.clientCapabilities)}};Ls=S([(0,Os.injectable)(),g(0,(0,Os.inject)(Ss)),g(1,(0,Os.inject)(nt)),g(2,(0,Os.inject)(kr)),g(3,(0,Os.inject)(we)),g(4,(0,Os.inject)(ks))],Ls);function qF(r){let e=r.exception&&lc(r.exception).title||r.text;return Ne(e)}function WF(r){return r.name==="[[FunctionLocation]]"&&!!r.value&&r.value.subtype==="internal#location"}var zC=class{constructor(e){this.description=e;this.sourceMapLoads=new Map;this.scripts=[]}get isDefault(){return this.description.auxData&&this.description.auxData.isDefault}async remove(e){await Promise.all(this.scripts.map(async t=>{let n=await t.source;n.filterScripts(i=>i.executionContextId!==this.description.id),n.scripts.length||e.removeSource(n)}))}},KC=class{constructor(e){this._obj=e;this._dapDeferred=ke()}resolve(){this._dapDeferred.resolve(this._obj)}with(e){return this._dapDeferred.hasSettled()?e(this._obj):this._dapDeferred.promise.then(t=>e(t))}},_Q=50,VF=(r,e)=>r.sourceReference===e.sourceReference&&ey(r.path||"",e.path||""),IQ=()=>`
//# sourceURL=eval-${(0,$F.randomBytes)(4).toString("hex")}.repl
`,JC=class{async enqueue(e,t){if(this.queue?.operation===e&&await new Promise(n=>setTimeout(n)),!this.queue||this.queue.operation!==e){let n=this.queue?.result.then(t,t)??t(),i=this.queue={operation:e,result:n.finally(()=>{this.queue===i&&(this.queue=void 0)})}}return this.queue.result}};var hl=class r{constructor(e,t,n,i,o,s,a,c,u,l,p,d,f,h,m){this.target=i;this.logger=s;this.evaluator=a;this.completer=c;this.launchConfig=u;this._breakpointManager=l;this.console=p;this.exceptionPause=d;this._smartStepper=f;this.shutdown=h;this._executionContexts=new Map;this._excludedCallers=[];this.stateQueue=new JC;this._onPausedEmitter=new O;this.disposed=!1;this.debuggerReady=ke();this.onPaused=this._onPausedEmitter.event;this._dap=new KC(n),this._sourceContainer=e,this._cdp=t,this.id=r._lastThreadId++,this.replVariables=new Ls(o,this._cdp,n,u,m,this),e.onSourceMappedSteppingChange(()=>this.refreshStackTrace()),this._initialize()}static{this._lastThreadId=0}static{this._allThreadsByDebuggerId=new Map}setExcludedCallers(e){this._excludedCallers=e}cdp(){return this._cdp}name(){return this.target.name()}pausedDetails(){return this._pausedDetails}pausedVariables(){return this._pausedVariables}defaultExecutionContext(){for(let e of this._executionContexts.values())if(e.isDefault)return e}resume(){return this.stateQueue.enqueue("resume",async()=>(this._sourceContainer.clearDisabledSourceMaps(),!await this._cdp.Debugger.resume({})&&this._pausedDetails!==void 0?Me(Pe.t("Unable to resume")):{allThreadsContinued:!1}))}pause(){return this.stateQueue.enqueue("pause",async()=>(this._expectedPauseReason={reason:"pause"},await this._cdp.Debugger.pause({})?{}:Me(Pe.t("Unable to pause"))))}stepOver(){return this.stateQueue.enqueue("stepOver",async()=>{this._expectedPauseReason={reason:"step",direction:1};let e=await this.getCurrentSkipList(1);return await this._cdp.Debugger.stepOver({skipList:e})?{}:Me(Pe.t("Unable to step next"))})}stepInto(e){return this.stateQueue.enqueue("stepInto",async()=>{this._waitingForStepIn={lastDetails:this._pausedDetails},this._expectedPauseReason={reason:"step",direction:0};let t=this._pausedDetails?.stepInTargets?.[e];if(t){let n=await this._cdp.Debugger.setBreakpoint({location:t.breakLocation});if(this._waitingForStepIn.intoTargetBreakpoint=n?.breakpointId,await this._cdp.Debugger.resume({}))return{}}else{let n=await this.getCurrentSkipList(0);if(await this._cdp.Debugger.stepInto({breakOnAsyncCall:!0,skipList:n}))return{}}return Me(Pe.t("Unable to step in"))})}stepOut(){return this.stateQueue.enqueue("stepOut",async()=>(this._expectedPauseReason={reason:"step",direction:2},await this._cdp.Debugger.stepOut({})?{}:Me(Pe.t("Unable to step out"))))}async getCurrentSkipList(e){if(!this._pausedDetails)return;let[t]=await this._pausedDetails.stackTrace.loadFrames(1);if(!t||!HF(t))return;let n=await t.getStepSkipList(e);if(n)return lr.simplify(n).map(i=>({start:i.begin.base0,end:i.end.base0,scriptId:t.root.scriptId}))}_stackFrameNotFoundError(){return Me(Pe.t("Stack frame not found"))}_evaluateOnAsyncFrameError(){return Me(Pe.t("Unable to evaluate on async stack frame"))}async restartFrame(e){let t=this._pausedDetails?.stackTrace.frame(e.frameId)?.root;if(!t)return this._stackFrameNotFoundError();let n=t.callFrameId();return n?await this._cdp.Debugger.restartFrame({callFrameId:n,mode:"StepInto"})?(this._expectedPauseReason={reason:"frame_entry",description:Pe.t("Paused on frame entry")},t.canExplicitlyBeRestarted||await this._cdp.Debugger.stepInto({}),{}):Ne(Pe.t("Frame could not be restarted")):Ne(Pe.t("Cannot restart asynchronous frame"))}async stackTrace(e){return this._pausedDetails?this._pausedDetails.stackTrace.toDap(e):Me(Pe.t("Thread is not paused"))}async scopes(e){let t=this._pausedDetails?this._pausedDetails.stackTrace.frame(e.frameId):void 0;return t?t.scopes():this._stackFrameNotFoundError()}async exceptionInfo(){let e=this._pausedDetails&&this._pausedDetails.exception;if(!e)return Me(Pe.t("Thread is not paused on exception"));let t=lc(e);return{exceptionId:t.title,breakMode:"all",details:{stackTrace:t.stackTrace,evaluateName:void 0}}}async revealPage(){return this._cdp.Page.bringToFront({}),{}}async completions(e){let t;if(e.frameId!==void 0){if(t=this._pausedDetails?this._pausedDetails.stackTrace.frame(e.frameId)?.root:void 0,!t)return this._stackFrameNotFoundError();if(!t.callFrameId())return this._evaluateOnAsyncFrameError()}if(e.line===1&&e.text.startsWith("cd "))return{targets:this.getExecutionContextCompletions(e)};let n=await this.completer.completions({executionContextId:this._selectedContext?this._selectedContext.description.id:void 0,stackFrame:t,expression:e.text,position:new tt(e.line||1,e.column)});return{targets:[...this.getExecutionContextCompletions(e),...n]}}getExecutionContextCompletions(e){if(e.line&&e.line>1)return[];let t=e.text.slice(0,e.column).trim();return[...this._executionContexts.values()].map(n=>`cd ${this.target.executionContextName(n.description)}`).filter(n=>n.startsWith(t)).map(n=>({label:n,start:0,length:e.text.length}))}async _evaluteWasm(e,t,n){if(!e)return;let i=e.root,o=i.callFrameId(),s=await i.scriptSource?.source;if(!Xa(s)||!o)return;let a=await s.sourceMap.value.promise;if(!a.evaluate)return;let c=new Ke(e instanceof Nf?e.inlineFrameIndex:0,i.rawPosition.base0.columnNumber),u=await a.evaluate(o,c,t.expression);return await n.createFloatingWasmVariable(t.expression,u,i,o).toDap(t.context,t.format)}async _evaluteJs(e,t,n){let i,o;if(t.context==="clipboard"?(o=gb.exprArgRanges(t.expression,"2"),i={expression:gb.expr(t.expression,"2"),includeCommandLineAPI:!0,returnByValue:!0,objectGroup:"console"}):i={expression:t.expression,includeCommandLineAPI:!0,objectGroup:"console",generatePreview:!0,timeout:t.context==="hover"?this.getHoverEvalTimeout():void 0},t.context==="repl"){if(i.expression=Jd(i.expression),i.expression.indexOf("await")!==-1){let l=X1(i.expression);l&&(i.expression=l,i.awaitPromise=!0)}i.expression+=IQ()}t.evaluationOptions&&this.cdp().DotnetDebugger.setEvaluationOptions({options:t.evaluationOptions,type:"evaluation"});let s;if(t.source&&t.line&&t.column){let l=this._pausedVariables,p=this._sourceContainer.source(t.source);p&&l&&(s={source:p,position:new tt(t.line,t.column),variables:l})}let a=e?.root.callFrameId(),c=this.evaluator.evaluate(a?{...i,callFrameId:a}:{...i,contextId:this._selectedContext?this._selectedContext.description.id:void 0},{isInternalScript:!1,stackFrame:e?.root,location:s,transformRanges:o});if(t.context==="repl")return await this._evaluateRepl(t,c,t.format);let u=await c;if(!u)throw new F(Me(Pe.t("Unable to evaluate")));if(u.exceptionDetails){let l=u.exceptionDetails.exception?lc(u.exceptionDetails.exception).title:u.exceptionDetails.text;throw l.startsWith("Uncaught")||(l="Uncaught "+l),new F(Me(l))}return n.createFloatingVariable(i.expression,u.result).toDap(t.context,t.format)}async evaluate(e){let t,n;if(e.frameId!==void 0){if(n=this._pausedDetails?this._pausedDetails.stackTrace.frame(e.frameId):void 0,!n)throw new F(this._stackFrameNotFoundError());if(t=n.root.callFrameId(),!t)throw new F(this._evaluateOnAsyncFrameError())}if(e.context==="repl"&&e.expression.startsWith("cd ")){let s=e.expression.substring(3).trim();for(let a of this._executionContexts.values())if(this.target.executionContextName(a.description)===s)return this._selectedContext=a,{result:`[${s}]`,variablesReference:0}}let i=t?this._pausedVariables:this.replVariables;if(!i)throw new F(Me(Pe.t("Unable to evaluate")));let o=await this._evaluteWasm(n,e,i)??await this._evaluteJs(n,e,i);return{type:o.type,result:o.value,variablesReference:o.variablesReference,namedVariables:o.namedVariables,indexedVariables:o.indexedVariables,memoryReference:o.memoryReference,valueLocationReference:o.valueLocationReference}}getHoverEvalTimeout(){let e=this.launchConfig.timeouts?.hoverEvaluation;if(e===void 0)return 500;if(!(e<=0))return e}async _evaluateRepl(e,t,n){let i=await t;if(!i)return{name:e.expression,value:"",variablesReference:0};if(i.exceptionDetails){let c=await new Mf(i.exceptionDetails).toDap(this);throw new F(w1(c.output))}let o=this._selectedContext&&this.defaultExecutionContext()!==this._selectedContext?`\x1B[33m[${this.target.executionContextName(this._selectedContext.description)}] `:"",s=await this.replVariables.createFloatingVariable(e.expression,i.result).toDap("repl",n),a=pb("repl").budget;return s.variablesReference===0&&s.value.length===a&&setImmediate(()=>this.console.enqueue(this,{toDap:()=>({output:Pe.t("Output has been truncated to the first {0} characters. Run `{1}` to copy the full output.",a,`copy(${e.expression.trim()})`),category:"stdout"})})),{...s,value:`${o}${s.value}`}}_initialize(){this._cdp.Runtime.on("executionContextCreated",e=>{this._executionContextCreated(e.context)}),this._cdp.Runtime.on("executionContextDestroyed",e=>{this._executionContextDestroyed(e.executionContextId)}),this._cdp.Runtime.on("executionContextsCleared",()=>{this._ensureDebuggerEnabledAndRefreshDebuggerId(),this.replVariables.clear(),this._executionContextsCleared()}),this._cdp.Inspector.on("targetReloadedAfterCrash",()=>{this._breakpointManager.reapply()}),this.launchConfig.outputCapture==="console"&&(this._cdp.Runtime.on("consoleAPICalled",e=>{this.console.dispatch(this,e)}),this._cdp.Runtime.on("exceptionThrown",e=>{this.console.enqueue(this,new Mf(e.exceptionDetails))})),this._cdp.Runtime.on("inspectRequested",e=>{e.hints.copyToClipboard?this._copyObjectToClipboard(e.object):e.hints.queryObjects?this.console.enqueue(this,new Sb(e.object,this.cdp())):this._revealObject(e.object)}),this._cdp.Debugger.on("paused",async e=>this._onPaused(e)),this._cdp.Debugger.on("resumed",()=>this.onResumed()),this._cdp.Debugger.on("scriptParsed",e=>this._onScriptParsed(e)),this._cdp.Debugger.on("scriptFailedToParse",e=>this._onScriptParsed(e)),this._cdp.Runtime.enable({}),this._cdp.Profiler.enable({}),this._ensureDebuggerEnabledAndRefreshDebuggerId(),this.launchConfig.noDebug&&this.logger.info("runtime.launch","Running with noDebug, so debug domains are disabled"),this.target.initialize(),this._dap.with(e=>e.thread({reason:"started",threadId:this.id}))}dapInitialized(){this._dap.resolve()}async enableNetworking({mirrorEvents:e}){if(!await this._cdp.Network.enable({}))throw I1();return this._dap.with(n=>{for(let i of e)this._cdp.Network.on(i,o=>n.networkEvent({data:o,event:i}))}),{}}async getStepInTargets(e){let t=this._pausedDetails;if(!t)return[];let n=t.stackTrace.frames.find(l=>l.frameId===e);if(!(n instanceof hr))return[];let i=await n.uiLocation();if(!i)return[];let o=t.event.callFrames[0].location,[s,a]=await Promise.all([this._breakpointManager.getBreakpointLocations(this,i.source,new tt(i.lineNumber,1),new tt(i.lineNumber+1,1)).then(l=>l.filter(p=>p.breakLocation.lineNumber!==o.lineNumber||p.breakLocation.columnNumber!==o.columnNumber)),i.source.content()]),c=t.stepInTargets?.length||0;t.stepInTargets=t.stepInTargets?.concat(s)||s;let u=a&&new gs(a);return s.map((l,p)=>{let d=l.uiLocations.find(h=>h.source===i.source);if(!d)return;if(!u)return{id:c+p,label:`Column ${d}`,line:d.lineNumber,column:d.columnNumber};let f=Q1(a.slice(u.getLineOffset(d.lineNumber-1),u.getLineOffset(d.lineNumber)),d.columnNumber-1);if(f)return{id:c+p,label:f.text,line:d.lineNumber,column:f.start+1,endLine:d.lineNumber,endColumn:f.end+1}}).filter(et)}async refreshStackTrace(){this._pausedDetails&&(this._pausedDetails=await this._createPausedDetails(this._pausedDetails.event),this._onThreadResumed(),await this._onThreadPaused(this._pausedDetails))}_executionContextCreated(e){let t=new zC(e);return this._executionContexts.set(e.id,t),this._scriptWithSourceMapHandler&&this._installWasmPauseHandler(e.id),t}_installWasmPauseHandler(e){return this._cdp.Runtime.evaluate({expression:TF.expr(),silent:!0,contextId:e})}async _executionContextDestroyed(e){let t=this._executionContexts.get(e);t&&(this._executionContexts.delete(e),await this.shutdown.shutdownContext(),t.remove(this._sourceContainer))}async _executionContextsCleared(){let e=[...this._executionContexts.values()],t=this._pausedDetails;this._executionContexts.clear(),await this.shutdown.shutdownContext();for(let n of e)n.remove(this._sourceContainer);this._breakpointManager.executionContextWasCleared(),t&&t===this._pausedDetails&&!this.disposed&&this.onResumed()}_ensureDebuggerEnabledAndRefreshDebuggerId(){if(this.launchConfig.noDebug)return this.debuggerReady.resolve();this._cdp.Debugger.enable({}).then(e=>{this.debuggerReady.resolve(),e&&r._allThreadsByDebuggerId.set(e.debuggerId,this)}),this.exceptionPause.apply(this._cdp)}async _onPaused(e){let t=e.hitBreakpoints??[],n=e.reason==="Break on start"||e.reason==="debugCommand",i=e.callFrames[0]?.location,o=e.data?.scriptId||i?.scriptId,s=o&&this._sourceContainer.getSourceScriptById(o)?.url===kC,a=o&&(e.reason==="instrumentation"||this._breakpointManager.isEntrypointBreak(t,o)||t.some(p=>this._pauseOnSourceMapBreakpointIds?.includes(p))||s);if(this.evaluator.setReturnedValue(e.callFrames[0]?.returnValue),a){this.launchConfig.perScriptSourcemaps==="auto"&&this._shouldEnablePerScriptSms(e)&&await this._enablePerScriptSourcemaps(),e.data&&!n&&(e.data.__rewriteAs="breakpoint");let p=this._expectedPauseReason;if(s){let d=this._lastParsedWasmScriptIds;return this._lastParsedWasmScriptIds=void 0,d&&await Promise.all(d.map(f=>this._handleSourceMapPause(f,i))),this.resume()}else if(!(o&&await this._handleSourceMapPause(o,i))){if(!n){if(await this.isCrossThreadStep(e))e.data={...e.data,__rewriteAs:"step"};else if(!await this._breakpointManager.shouldPauseAt(e,t,this.target.entryBreakpoint,!0))if(p?.reason==="step"){if(p.direction!==0)return this._cdp.Debugger.resume({})}else return this.resume()}}}else if(!(e.reason==="exception"||e.reason==="promiseRejection"?await this.exceptionPause.shouldPauseAt(e):await this._breakpointManager.shouldPauseAt(e,t,this.target.entryBreakpoint,!1)))return this.resume();let c=this._waitingForStepIn?.intoTargetBreakpoint;if(c){e.hitBreakpoints?.includes(c)?(this._waitingForStepIn.intoTargetBreakpoint=void 0,await this._cdp.Debugger.removeBreakpoint({breakpointId:c}),await this._cdp.Debugger.stepInto({breakOnAsyncCall:!1})):this.resume();return}if(n&&("continueOnAttach"in this.launchConfig&&this.launchConfig.continueOnAttach||this.launchConfig.type==="pwa-extensionHost"||this.target instanceof ll)){this.resume();return}let u=this._pausedDetails=await this._createPausedDetails(e);if(this._excludedCallers.length&&await this._matchesExcludedCaller(this._pausedDetails.stackTrace)){this.logger.info("runtime","Skipping pause due to excluded caller"),this.resume();return}let l=await this._smartStepper.getSmartStepDirection(u,this._expectedPauseReason);if(this._pausedDetails===u){switch(l){case 0:return this.stepInto();case 2:return this.stepOut();case 1:return this.stepOver();default:}this._waitingForStepIn=void 0,this._pausedVariables=this.replVariables.createDetached(),await this._onThreadPaused(u)}}async _matchesExcludedCaller(e){if(!this._excludedCallers.length)return!1;let t=e.frames[0],n=t instanceof hr&&await t.uiLocation();if(!n)return!1;let i,o,s=[];for(let{caller:a,target:c}of this._excludedCallers)if(!(c.line!==n.lineNumber||c.column!==n.columnNumber)&&(i??=await n.source.toDap(),!!VF(i,c.source))){o||(o=await e.loadFrames(_Q).then(l=>Promise.all(l.slice(1).filter(ka(hr)).map(p=>p.uiLocation()))));for(let u=0;u<o.length;u++){let l=o[u];if(!l||l.lineNumber!==a.line||l.columnNumber!==a.column)continue;let p=s[u]??=await l.source.toDap();if(VF(p,a.source))return!0}}return!1}onResumed(){this._pausedDetails=void 0,this._pausedVariables=void 0,this.evaluator.setReturnedValue(void 0),this._onThreadResumed()}async dispose(){await this.shutdown.shutdownAll(),this.disposed=!0;for(let[e,t]of r._allThreadsByDebuggerId)t===this&&r._allThreadsByDebuggerId.delete(e);this._removeAllScripts(!0),this._executionContextsCleared(),await this._dap.with(e=>e.thread({reason:"exited",threadId:this.id}))}rawLocation(e){if("location"in e){let t=e;return{lineNumber:Math.max(0,t.location.lineNumber)+1,columnNumber:Math.max(0,t.location.columnNumber||0)+1,scriptId:t.location.scriptId}}return{lineNumber:Math.max(0,e.lineNumber)+1,columnNumber:Math.max(0,e.columnNumber||0)+1,scriptId:e.scriptId}}rawLocationToUiLocation(e){if(!e.scriptId||this.disposed||this.launchConfig.noDebug)return;let t=this._sourceContainer.getScriptById(e.scriptId);return t?t.resolvedSource?this._sourceContainer.preferredUiLocation({...t.resolvedSource.offsetScriptToSource(e),source:t.resolvedSource}):t.source.then(n=>this._sourceContainer.preferredUiLocation({...n.offsetSourceToScript(e),source:n})):this.rawLocationToUiLocationWithWaiting(e)}async rawLocationToUiLocationWithWaiting(e){let t=e.scriptId?await this.getScriptByIdOrWait(e.scriptId):void 0;if(!t)return;let n=await t.source;return this._sourceContainer.preferredUiLocation({...n.offsetScriptToSource(e),source:n})}getScriptById(e){return this._sourceContainer.getScriptById(e)}getScriptByIdOrWait(e,t=500){return this._sourceContainer.getScriptById(e)||this.waitForScriptId(e,t)}waitForScriptId(e,t){return new Promise(n=>{let i=this._sourceContainer.onScript(s=>{s.scriptId===e&&(n(s),i.dispose(),clearTimeout(o))}),o=setTimeout(()=>{n(void 0),i.dispose()},t)})}async renderDebuggerLocation(e){let t=this.rawLocation(e),n=await this.rawLocationToUiLocation(t);return n?`@ ${await n.source.prettyName()}:${n.lineNumber}`:`@ VM${t.scriptId||"XX"}:${t.lineNumber}`}async updateCustomBreakpoints(e,t){if(!this.target.supportsCustomBreakpoints())return;this._enabledCustomBreakpoints??=new Set;let n=new Set;for(let o of e)n.add("x"+o);for(let o of t)n.add("e"+o);let i=[];for(let o of n)if(!this._enabledCustomBreakpoints.has(o)){let s=o.slice(1);i.push(o.startsWith("x")?this._cdp.DOMDebugger.setXHRBreakpoint({url:s}):pl().get(s)?.apply(this._cdp,!0))}for(let o of this._enabledCustomBreakpoints)if(!n.has(o)){let s=o.slice(1);i.push(o.startsWith("x")?this._cdp.DOMDebugger.removeXHRBreakpoint({url:s}):pl().get(s)?.apply(this._cdp,!1))}this._enabledCustomBreakpoints=n,await Promise.all(i)}async _createPausedDetails(e){let t=e.reason==="assert"||e.reason==="exception"||e.reason==="promiseRejection"||e.reason==="other"||e.reason==="ambiguous",n=e.hitBreakpoints?.filter(o=>!this._breakpointManager.isEntrypointCdpBreak(o))||[];if((n.length||!t)&&this._sourceContainer.clearDisabledSourceMaps(),e.hitBreakpoints&&this._sourceMapDisabler)for(let o of this._sourceMapDisabler(e.hitBreakpoints))this._sourceContainer.disableSourceMapForSource(o);let i=No.fromDebugger(this,e.callFrames,e.asyncStackTrace,e.asyncStackTraceId);if(e.data?.__rewriteAs==="breakpoint")return{thread:this,event:e,stackTrace:i,reason:"breakpoint",description:Pe.t("Paused on breakpoint")};if(e.data?.__rewriteAs==="step")return{thread:this,event:e,stackTrace:i,reason:"step",description:Pe.t("Paused")};switch(e.reason){case"assert":return{thread:this,event:e,stackTrace:i,reason:"exception",description:Pe.t("Paused on assert")};case"debugCommand":return{thread:this,event:e,stackTrace:i,reason:"pause",description:Pe.t("Paused on debug() call")};case"DOM":return{thread:this,event:e,stackTrace:i,reason:"data breakpoint",description:Pe.t("Paused on DOM breakpoint")};case"EventListener":return this._resolveEventListenerBreakpointDetails(i,e);case"exception":return{thread:this,event:e,stackTrace:i,reason:"exception",description:Pe.t("Paused on exception"),exception:e.data};case"promiseRejection":return{thread:this,event:e,stackTrace:i,reason:"exception",description:Pe.t("Paused on {0}","promise rejection"),exception:e.data};case"instrumentation":return e.data&&e.data.scriptId?{thread:this,event:e,stackTrace:i,reason:"step",description:Pe.t("Paused")}:{thread:this,event:e,stackTrace:i,reason:"function breakpoint",description:Pe.t("Paused on instrumentation breakpoint")};case"XHR":return{thread:this,event:e,stackTrace:i,reason:"data breakpoint",description:Pe.t("Paused on XMLHttpRequest or fetch")};case"OOM":return{thread:this,event:e,stackTrace:i,reason:"exception",description:Pe.t("Paused before Out Of Memory exception")};default:if(n.length){let o=!1,s=this.target.entryBreakpoint;if(s&&n.includes(s.cdpId)){o=!0;let a=this._sourceContainer.source({path:ct(s.path)});a!==void 0&&(o=!(await this._sourceContainer.currentSiblingUiLocations({lineNumber:e.callFrames[0].location.lineNumber+1,columnNumber:(e.callFrames[0].location.columnNumber||0)+1,source:a}))?.some(u=>this._breakpointManager.hasAtLocation(u)))}return o||this._breakpointManager.registerBreakpointsHit(n),{thread:this,event:e,stackTrace:i,hitBreakpoints:e.hitBreakpoints,reason:o?"entry":"breakpoint",description:Pe.t("Paused on breakpoint")}}return this._expectedPauseReason?{thread:this,event:e,stackTrace:i,description:Pe.t("Paused"),...this._expectedPauseReason}:{thread:this,event:e,stackTrace:i,reason:"pause",description:Pe.t("Paused on debugger statement")}}}_resolveEventListenerBreakpointDetails(e,t){let n=t.data,i=n&&n.eventName||"",o=pl().get(i);if(o){let s=o.details(n);return{thread:this,event:t,stackTrace:e,reason:"function breakpoint",description:s.short,text:s.long}}return{thread:this,event:t,stackTrace:e,reason:"function breakpoint",description:Pe.t("Paused on event listener")}}_clearDebuggerConsole(){return{category:"console",output:"\x1B[2J"}}_removeAllScripts(e=!1){this._sourceContainer.clear(e)}_onScriptParsed(e){let t={url:e.url,hasSourceURL:!!e.hasSourceURL,embedderName:e.embedderName,scriptId:e.scriptId,executionContextId:e.executionContextId};pr(e.url)&&(e.url=Ae(e.url));let n=this._sourceContainer.getScriptById(e.scriptId);if(n&&this._executionContexts.has(n.executionContextId))return;if(e.url.endsWith(".cdp")){this._sourceContainer.addScriptById(t);return}e.url&&(e.url=this.target.scriptUrlToUrl(e.url));let i=this._executionContexts.get(e.executionContextId);i||(this.logger.info("internal","Creating missing execution context id",e),i=this._executionContextCreated({id:e.executionContextId,name:"<autofilled>",origin:"",uniqueId:String(e.executionContextId)}));let s={...t,source:(async()=>{let a=this._sourceContainer.getSourceByOriginalUrl(e.url);if(e.hash&&a?.contentHash===e.hash)return a.addScript({scriptId:e.scriptId,url:e.url,embedderName:e.embedderName,hasSourceURL:!!e.hasSourceURL,executionContextId:e.executionContextId}),a;let c=async()=>{let f=await this._cdp.Debugger.getScriptSource({scriptId:e.scriptId});return f?f.scriptSource:void 0},u=e.startLine||e.startColumn?{lineOffset:e.startLine,columnOffset:e.startColumn}:void 0,l=e.url.endsWith("#vscode-extension")?{lineOffset:2,columnOffset:0}:void 0,p;e.sourceMapURL&&(p=Qt(e.sourceMapURL)?e.sourceMapURL:e.url&&hs(e.url,e.sourceMapURL)||e.url,p||this._dap.with(f=>d1(f,`Could not load source map from ${e.sourceMapURL}`))),e.scriptLanguage==="WebAssembly"&&(this._lastParsedWasmScriptIds??=[],this._lastParsedWasmScriptIds.push(e.scriptId));let d=await this._sourceContainer.addSource(e,c,p,u,l,!e.hasSourceURL&&this.launchConfig.enableContentValidation?e.hash:void 0);return d.addScript({scriptId:e.scriptId,url:e.url,embedderName:e.embedderName,hasSourceURL:!!e.hasSourceURL,executionContextId:e.executionContextId}),d})()};s.source.then(a=>s.resolvedSource=a),i.scripts.push(s),this._sourceContainer.addScriptById(s),(e.sourceMapURL||e.scriptLanguage==="WebAssembly")&&this._getOrStartLoadingSourceMaps(s)}async _handleSourceMapPause(e,t){this._pausedForSourceMapScriptId=e;let n=this._sourceContainer.sourceMapTimeouts().sourceMapMinPause,i=n+this._sourceContainer.sourceMapTimeouts().sourceMapCumulativePause,o=this._sourceContainer.getScriptById(e);if(!o)return this._pausedForSourceMapScriptId=void 0,!1;let s=new Mr,a=this._breakpointManager.disableEntrypointBreaks(e),c=await Promise.race([this._getOrStartLoadingSourceMaps(o),le(i)]),u=s.elapsed().ms,l=this._sourceContainer.sourceMapTimeouts().sourceMapCumulativePause-Math.max(u-n,0);this._sourceContainer.setSourceMapTimeouts({...this._sourceContainer.sourceMapTimeouts(),sourceMapCumulativePause:l}),this.logger.verbose("internal","Blocked execution waiting for source-map",{timeSpentWallClockInMs:u,sourceMapCumulativePause:l}),c||this._dap.with(f=>f.output({category:"stderr",output:Pe.t("WARNING: Processing source-maps of {0} took longer than {1} ms so we continued execution without waiting for all the breakpoints for the script to be set.",o.url||o.scriptId,i)})),console.assert(this._pausedForSourceMapScriptId===e),this._pausedForSourceMapScriptId=void 0,await a;let p=t?.lineNumber||0,d=t?.columnNumber;return!!c?.map(ko).some(f=>f.lineNumber===p&&(d===void 0||d===f.columnNumber))}_getOrStartLoadingSourceMaps(e){let t=this._executionContexts.get(e.executionContextId);if(!t)return Promise.resolve([]);let n=t.sourceMapLoads.get(e.scriptId);if(n)return n;let i=e.source.then(o=>this._sourceContainer.waitForSourceMapSources(o)).then(o=>o.length&&this._scriptWithSourceMapHandler?this._scriptWithSourceMapHandler(e,o):[]);return t.sourceMapLoads.set(e.scriptId,i),i}async _revealObject(e){if(e.type!=="function"||e.objectId===void 0)return;let t=await this._cdp.Runtime.getProperties({objectId:e.objectId,ownProperties:!0});if(t)for(let n of t.internalProperties||[]){if(n.name!=="[[FunctionLocation]]"||!n.value||n.value.subtype!=="internal#location")continue;let i=await this.rawLocationToUiLocation(this.rawLocation(n.value.value));i&&this._sourceContainer.revealUiLocation(i);break}}async _copyObjectToClipboard(e){if(!e.objectId){this._dap.with(t=>t.copyRequested({text:uc(e,"copy")}));return}try{let t=await PF({cdp:this.cdp(),objectId:e.objectId,args:[2],silent:!0,returnByValue:!0});this._dap.with(n=>n.copyRequested({text:t.value}))}catch{}finally{this.cdp().Runtime.releaseObject({objectId:e.objectId}).catch(()=>{})}}async _onThreadPaused(e){this._expectedPauseReason=void 0,this._onPausedEmitter.fire(e);let t;e.hitBreakpoints&&(t=await Promise.race([le(1e3).then(()=>{}),Promise.all(e.hitBreakpoints.map(n=>this._breakpointManager._resolvedBreakpoints.get(n)).filter(ka(_n)).map(n=>n.untilSetCompleted().then(()=>n.dapId)))])),await le(0),this._dap.with(n=>n.stopped({reason:e.reason,description:e.description,threadId:this.id,text:e.text,hitBreakpointIds:t,allThreadsStopped:!1}))}_onThreadResumed(){this._dap.with(e=>e.continued({threadId:this.id,allThreadsContinued:!1}))}isCrossThreadStep(e){if(!e.asyncStackTraceId||!e.asyncStackTraceId.debuggerId)return!1;let t=r.threadForDebuggerId(e.asyncStackTraceId.debuggerId);if(!t||!t._waitingForStepIn?.lastDetails)return!1;let n=t._waitingForStepIn.lastDetails.stackTrace;return t._cdp.Debugger.getStackTrace({stackTraceId:e.asyncStackTraceId}).then(i=>!i||!i.stackTrace.callFrames.length||!hr.fromRuntime(t,i.stackTrace.callFrames[0],!1).equivalentTo(n.frames[0])?!1:(t._waitingForStepIn=void 0,!0))}async setScriptSourceMapHandler(e,t){this._scriptWithSourceMapHandler=t;let n=e&&this._sourceContainer.sourceMapTimeouts().sourceMapMinPause&&t;if(n&&!this._pauseOnSourceMapBreakpointIds?.length){await this.debuggerReady.promise;let i=await Promise.all([this._cdp.Debugger.setInstrumentationBreakpoint({instrumentation:"beforeScriptWithSourceMapExecution"})]);this._pauseOnSourceMapBreakpointIds=i.map(o=>o?.breakpointId).filter(et)}else if(!n&&this._pauseOnSourceMapBreakpointIds?.length){let i=this._pauseOnSourceMapBreakpointIds;this._pauseOnSourceMapBreakpointIds=void 0,await Promise.all(i.map(o=>this._cdp.Debugger.removeBreakpoint({breakpointId:o})))}if(t){let i=Promise.all([...this._executionContexts.keys()].map(o=>this._installWasmPauseHandler(o)));await Promise.race([i,le(100)])}return!!this._pauseOnSourceMapBreakpointIds?.length}async _enablePerScriptSourcemaps(){await this._breakpointManager.updateEntryBreakpointMode(this,1),await this.setScriptSourceMapHandler(!1,this._scriptWithSourceMapHandler)}_shouldEnablePerScriptSms(e){let t=this._sourceContainer.getScriptById(e.callFrames[0]?.location.scriptId);return t?t.url.includes("@vite/client")?!0:e.reason!=="instrumentation"||!Qt(e.data?.sourceMapURL)?!1:t.url.startsWith("webpack")||t.url.startsWith("ng:"):!1}setSourceMapDisabler(e){this._sourceMapDisabler=e}static threadForDebuggerId(e){return r._allThreadsByDebuggerId.get(e)}async replacePathsInStackTrace(e){let t=[];for(let i of new Rs(e)){if(typeof i=="string"){t.push(i);continue}let o=this._sourceContainer.getSourceByOriginalUrl(Ae(i.path))||this._sourceContainer.getSourceByOriginalUrl(i.path);if(!o){t.push(i.toString());continue}t.push(this._sourceContainer.preferredUiLocation({columnNumber:i.position.base1.columnNumber,lineNumber:i.position.base1.lineNumber,source:o}).then(({source:s,lineNumber:a,columnNumber:c})=>`${s.absolutePath}:${a}:${c}`))}return(await Promise.all(t)).join("")}};var HF=r=>typeof r.uiLocation=="function",No=class r{constructor(e){this.thread=e;this.frames=[];this._frameById=new Map;this._lastInlineWasmExpanded=Promise.resolve(0);this._lastFrameThread=e}static fromRuntime(e,t){let n=new r(e);for(let i of t.callFrames)i.url.endsWith(".cdp")||n.frames.push(hr.fromRuntime(e,i,!1));return t.parentId?(n._asyncStackTraceId=t.parentId,console.assert(!t.parent)):n._appendStackTrace(e,t.parent),n}static fromDebugger(e,t,n,i){let o=new r(e);for(let s of t)o._appendFrame(hr.fromDebugger(e,s));return i?(o._asyncStackTraceId=i,console.assert(!n)):o._appendStackTrace(e,n),o}async loadFrames(e,t){return await this.expandAsyncStack(e,t),await this.expandWasmFrames(),this.frames}async expandAsyncStack(e,t){for(;this.frames.length<e&&this._asyncStackTraceId;){if(this._asyncStackTraceId.debuggerId&&(this._lastFrameThread=hl.threadForDebuggerId(this._asyncStackTraceId.debuggerId)),!this._lastFrameThread){this._asyncStackTraceId=void 0;break}t&&this._lastFrameThread.cdp().DotnetDebugger.setEvaluationOptions({options:{noFuncEval:t},type:"stackFrame"});let n=await this._lastFrameThread.cdp().Debugger.getStackTrace({stackTraceId:this._asyncStackTraceId});this._asyncStackTraceId=void 0,n&&this._appendStackTrace(this._lastFrameThread,n.stackTrace)}}expandWasmFrames(){return this._lastInlineWasmExpanded=this._lastInlineWasmExpanded.then(async e=>{for(;e<this.frames.length;e++){let t=this.frames[e];if(!(t instanceof hr))continue;let n=t.scriptSource?.resolvedSource;if(!Xa(n))continue;let i=await n.sourceMap.value.promise;if(!i.getFunctionStack)continue;let o=await i.getFunctionStack(t.rawPosition);if(o.length===0)continue;let s=[];for(let a=0;a<o.length;a++){let c=new Nf({source:n,thread:this.thread,inlineFrameIndex:a,name:o[a].name,root:t});this._frameById.set(c.frameId,c),s.push(c)}this._spliceFrames(e,1,...s),e+=o.length-1}return e})}frame(e){return this._frameById.get(e)}_appendStackTrace(e,t){for(console.assert(!t||!this._asyncStackTraceId);t;){if(t.description==="async function"&&t.callFrames.length&&t.callFrames.shift(),t.callFrames.length){this._appendFrame(new _b(t.description||"async"));for(let n of t.callFrames)this._appendFrame(hr.fromRuntime(e,n,!0))}t.parentId&&(this._asyncStackTraceId=t.parentId,console.assert(!t.parent)),t=t.parent}}_spliceFrames(e,t,...n){this.frames.splice(e,t,...n);for(let i of n)i instanceof _b||this._frameById.set(i.frameId,i)}_appendFrame(e){this._spliceFrames(this.frames.length,0,e)}async formatAsNative(){return await this.formatWithMapper(e=>e.formatAsNative())}async format(){return await this.formatWithMapper(e=>e.format())}async formatWithMapper(e){let t=await this.loadFrames(50);for(let i=t.length-1;i>=0;i--){let o=t[i];if(o instanceof hr&&o.isReplEval){t=t.slice(0,i+1);break}}let n=t.map(e);return(await Promise.all(n)).join(`
`)+`
`}async toDap(e){let t=e.startFrame||0,n=(e.levels||50)+t,i=await this.loadFrames(n,e.noFuncEval);n=Math.min(i.length,e.levels?n:i.length);let o=[];for(let s=t;s<n;s++)o.push(i[s].toDap(e.format));return{stackFrames:await Promise.all(o),totalFrames:this._asyncStackTraceId?1e6:i.length}}},XC=um(),_b=class{constructor(e="async"){this.label=e;this.frameId=XC()}async toDap(){return{name:this.label,id:this.frameId,line:0,column:0,presentationHint:"label"}}async formatAsNative(){return`    --- ${this.label} ---`}async format(){return`\u25C0 ${this.label} \u25B6`}},GF="<anonymous>",xQ=/^class\s+(.+) {($|\n)/;async function CQ(r,e,t){if(!e.functionName)return GF;if(e.functionName.includes("."))return e.functionName;let n;if(e.this.objectId&&t&&(n=(await r.cdp().Runtime.callFunctionOn({functionDeclaration:hb.decl("64","null"),objectId:e.this.objectId,returnByValue:!0}))?.result?.value),!n&&e.this.description){n=e.this.description;let s=xQ.exec(n);s&&(n=s[1])}if(!n)return e.functionName;let i=n.indexOf(`
`);i!==-1&&(n=n.slice(0,i).trim());let o=e.functionName;return n===o?`${n}.constructor`:n?`${n}.${o}`:o}function TQ(r){return r.functionName||GF}var hr=class r{constructor(e,t,n,i=!1){this.callFrame=t;this.isAsync=i;this.frameId=XC();this.root=this;this.getLocationInfo=ne(async()=>{let e=this.uiLocation(),t=await EC(this),n=this.overrideName||("this"in this.callFrame?await CQ(this._thread,this.callFrame,t===0):TQ(this.callFrame));return{isSmartStepped:t,name:n,uiLocation:await e}});this.completions=ne(async()=>{if(!this._scope)return[];let e=this._thread.pausedVariables();if(!e)return[];let t=[];for(let i=0;i<this._scope.chain.length;i++){let o=this._scopeVariable(i,this._scope);o&&t.push(e.getVariableNames({variablesReference:o.id}).then(s=>s.map(({name:a})=>({label:a,type:"property"}))))}let n=await Promise.all(t);return[].concat(...n)});this._rawLocation=n,this.uiLocation=ne(()=>e.rawLocationToUiLocation(n)),this._thread=e;let o=n.scriptId?e.getScriptById(n.scriptId):void 0;this.isReplEval=o?o.url.endsWith(".repl"):!1}get rawPosition(){return new tt(this._rawLocation.lineNumber,this._rawLocation.columnNumber)}get rawScopeChain(){return this._scope?.chain||[]}static fromRuntime(e,t,n){return new r(e,t,e.rawLocation(t),n)}static fromDebugger(e,t){let n=new r(e,t,e.rawLocation(t));return n._scope={chain:t.scopeChain,thisObject:t.this,returnValue:t.returnValue,variables:new Array(t.scopeChain.length).fill(void 0),callFrameId:t.callFrameId},n}get scriptId(){return"scriptId"in this.callFrame?this.callFrame.scriptId:this.callFrame.location.scriptId}get scriptSource(){return this._thread._sourceContainer.getScriptById(this.scriptId)}get canExplicitlyBeRestarted(){return!!this.callFrame.canBeRestarted}equivalentTo(e){return e instanceof r&&e._rawLocation.columnNumber===this._rawLocation.columnNumber&&e._rawLocation.lineNumber===this._rawLocation.lineNumber&&e._rawLocation.scriptId===this._rawLocation.scriptId}callFrameId(){return this._scope?this._scope.callFrameId:void 0}async scopes(){let e=this._scope;if(!e)throw new F(S1());return{scopes:(await Promise.all(e.chain.map(async(n,i)=>{let o="",s;switch(n.type){case"global":o=Fr.t("Global");break;case"local":o=Fr.t("Local"),s="locals";break;case"with":o=Fr.t("With Block"),s="locals";break;case"closure":o=Fr.t("Closure"),s="arguments";break;case"catch":o=Fr.t("Catch Block"),s="locals";break;case"block":o=Fr.t("Block"),s="locals";break;case"script":o=Fr.t("Script");break;case"eval":o=Fr.t("Eval");break;case"module":o=Fr.t("Module");break;default:o=n.type.substr(0,1).toUpperCase()+n.type.substr(1);break}n.name&&n.type==="closure"?o=Fr.t("Closure ({0})",n.name):n.name&&(o=`${o}: ${n.name}`);let a=this._scopeVariable(i,e);if(!a)return;let c={name:o,presentationHint:s,expensive:n.type==="global"||n.type==="module",variablesReference:a.id};if(n.startLocation){let u=this._thread.rawLocation(n.startLocation),l=await this._thread.rawLocationToUiLocation(u);if(c.line=(l||u).lineNumber,c.column=(l||u).columnNumber,l&&(c.source=await l.source.toDap()),n.endLocation){let p=this._thread.rawLocation(n.endLocation),d=await this._thread.rawLocationToUiLocation(p);c.endLine=(d||p).lineNumber,c.endColumn=(d||p).columnNumber}}return c}))).filter(et)}}getStepSkipList(e){return Promise.resolve(void 0)}async toDap(e){let{isSmartStepped:t,name:n,uiLocation:i}=await this.getLocationInfo(),o=i?await i.source.toDap():void 0,s=t?"deemphasize":"normal";t&&o&&(o.origin=t===1?Fr.t("Skipped by smartStep"):Fr.t("Skipped by skipFiles"));let a=(i||this._rawLocation).lineNumber,c=(i||this._rawLocation).columnNumber,u=n;return o&&e&&(e.module&&(u+=` [${o.name}]`),e.line&&(u+=` Line ${a}`)),{id:this.frameId,name:u,line:a,column:c,source:o,presentationHint:s,canRestart:this.callFrame.canBeRestarted??!this.isAsync}}async formatAsNative(){let{name:e,uiLocation:t}=await this.getLocationInfo(),n=await t?.source.existingAbsolutePath()||await t?.source.prettyName()||this.callFrame.url,{lineNumber:i,columnNumber:o}=t||this._rawLocation;return`    at ${e} (${n}:${i}:${o})`}async format(){let{name:e,uiLocation:t}=await this.getLocationInfo(),n=await t?.source.prettyName()||"<unknown>",i=t||this._rawLocation,o=`${e} @ ${n}:${i.lineNumber}`;return i.columnNumber>1&&(o+=`:${i.columnNumber}`),o}_scopeVariable(e,t){let n=t.variables[e];if(n)return n;let i={stackFrame:this,callFrameId:t.callFrameId,scopeNumber:e},o=[];e===0&&(t.thisObject&&o.push({name:"this",value:t.thisObject}),t.returnValue&&o.push({name:Fr.t("Return value"),value:t.returnValue}));let s=this._thread.pausedVariables();if(!s)return;let a=s.createScope(t.chain[e].object,i,o);return t.variables[e]=a}},YC={scopes:[]},Nf=class{constructor(e){this.frameId=XC();this.name=e.name,this.root=e.root,this.thread=e.thread,this.source=e.source,this.inlineFrameIndex=e.inlineFrameIndex,this.wasmPosition=new Ke(this.inlineFrameIndex,this.root.rawPosition.base0.columnNumber),this.uiLocation=ne(()=>e.thread._sourceContainer.preferredUiLocation({columnNumber:e.root.rawPosition.base1.columnNumber,lineNumber:e.inlineFrameIndex+1,source:e.source}))}async formatAsNative(){let{columnNumber:e,lineNumber:t,source:n}=await this.uiLocation();return`    at ${this.name} (${n.url}:${t}:${e})`}async format(){let{columnNumber:e,lineNumber:t,source:n}=await this.uiLocation(),i=await n.prettyName()||"<unknown>";return`${this.name} @ ${i}:${t}:${e}`}async toDap(){let{columnNumber:e,lineNumber:t,source:n}=await this.uiLocation();return Promise.resolve({id:this.frameId,name:this.name,column:e,line:t,source:await n.toDap()})}async getStepSkipList(e){let t=this.source.sourceMap.value.settledValue;if(!t?.getStepSkipList)return;let n=await this.uiLocation();return n?t.getStepSkipList(e,this.wasmPosition,n.source.compiledToSourceUrl.get(this.source),new tt(n.lineNumber,n.columnNumber)):t.getStepSkipList(e,this.root.rawPosition)}async scopes(){let e=this.source.sourceMap.value.settledValue,t=this.root.callFrameId();if(!e||!t)return YC;let n=await e.getVariablesInScope?.(t,this.wasmPosition);if(!n)return YC;let i=this.thread.pausedVariables();if(!i)return YC;let o={stackFrame:this.root,callFrameId:t,scopeNumber:0};return{scopes:await Promise.all([...iO(n,s=>s.scope)].map(([s,a])=>i.createWasmScope(s,a,o).toDap("propertyValue").then(c=>({name:c.name,variablesReference:c.variablesReference,expensive:s!=="LOCAL"}))))}}};var zF=b(ie());var pc=class{constructor(e){this.event=e;this.stackTrace=ne(e=>this.event.stackTrace?No.fromRuntime(e,this.event.stackTrace):void 0);this.getUiLocation=ne(async e=>{let t=this.stackTrace(e);if(!t)return;let n;for(let i of t.frames){if(!(i instanceof hr))continue;let o=await i.uiLocation();if(o&&(n||(n=o),!o.source.blackboxed()))return{source:await o.source.toDap(),line:o.lineNumber,column:o.columnNumber}}if(n)return{source:await n.source.toDap(),line:n.lineNumber,column:n.columnNumber}})}formatDefaultString(e,t,n=!1){let o=t.length>1&&t[0].type==="string"?IC(t[0].value,t.slice(1),PC):IC("",t,PC),s=o.result+`
`;return o.usedAllSubs&&!t.some(cc)?{output:s}:this.formatComplexStringOutput(e,s,t,n)}async formatComplexStringOutput(e,t,n,i){(n.some(s=>s.subtype==="error")||Rs.isStackLike(t))&&(await this.getUiLocation(e),t=await e.replacePathsInStackTrace(t),i=!0);let o=e.replVariables.createVariableForOutput(t,n,i?this.stackTrace(e):void 0);return{output:t,variablesReference:o.id}}},Ib=class extends pc{async toDap(e){return this.event.args[0]?.value==="console.assert"&&(this.event.args[0].value=zF.t("Assertion failed")),{category:"stderr",...await this.formatDefaultString(e,this.event.args,!0),...await this.getUiLocation(e)}}},dc=class extends pc{constructor(t,n,i){super(t);this.includeStack=n;this.category=i}async toDap(t){return{category:this.category,...await this.formatDefaultString(t,this.event.args,this.includeStack),...await this.getUiLocation(t)}}},Ns=class extends dc{constructor(e){super(e,!1,"stdout")}},xb=class extends dc{constructor(e){super(e,!0,"stdout")}},Cb=class extends dc{constructor(e){super(e,!0,"stderr")}},Tb=class extends dc{constructor(e){super(e,!0,"stderr")}},Pb=class extends pc{async toDap(e){return{category:"stdout",group:this.event.type==="startGroupCollapsed"?"startCollapsed":"start",...await this.formatDefaultString(e,this.event.args),...await this.getUiLocation(e)}}},Eb=class extends dc{constructor(e){super(e,!1,"stdout")}async toDap(e){return this.event.args[0]?.preview?{category:"stdout",output:"",variablesReference:e.replVariables.createVariableForOutput("",this.event.args,void 0,this.event.type).id,...await this.getUiLocation(e)}:super.toDap(e)}};var Mf=class extends pc{constructor(){super(...arguments);this.stackTrace=ne(t=>{if(this.event.stackTrace)return No.fromRuntime(t,this.event.stackTrace);if(this.event.scriptId)return No.fromRuntime(t,{callFrames:[{functionName:"(program)",lineNumber:this.event.lineNumber,columnNumber:this.event.columnNumber,scriptId:this.event.scriptId,url:this.event.url||""}]})})}async toDap(t){let n=this.event.exception?lc(this.event.exception):{title:""},i=n.title;i.startsWith("Uncaught")||(i=`Uncaught ${this.event.exception?.className??"Error"} `+i);let o=this.stackTrace(t),s=this.event.exception&&!n.stackTrace?[this.event.exception]:[];return Rs.isStackLike(i)?i=await t.replacePathsInStackTrace(i):o&&(i+=`
`+await o.formatAsNative()),{category:"stderr",output:i,variablesReference:o||s.length?t.replVariables.createVariableForOutput(i,s,o).id:void 0,...await this.getUiLocation(t)}}};var kb=b(ie());var KF=It(function(){return this});var Sb=class{constructor(e,t){this.protoObj=e;this.cdp=t}async toDap(e){if(!this.protoObj.objectId)return{category:"stderr",output:kb.t("Only objects can be queried")};let t=await this.cdp.Runtime.queryObjects({prototypeObjectId:this.protoObj.objectId,objectGroup:"console"});if(await this.cdp.Runtime.releaseObject({objectId:this.protoObj.objectId}),!t)return{category:"stderr",output:kb.t("Could not query the provided object")};let n;try{n=await KF({cdp:this.cdp,args:[],objectId:t.objects.objectId,objectGroup:"console",generatePreview:!0})}catch(s){return{category:"stderr",output:kb.t(s.message)}}let i="\x1B[32mobjects: "+uc(n,"repl")+"\x1B[0m";return{category:"stdout",output:"",variablesReference:e.replVariables.createVariableForOutput(i,[n]).id}}};var Rb=Symbol("IConsole");var Bf=b(N());var JF=b(N());var Fs=Symbol("IShutdownParticipants"),ml=class{constructor(){this.participants=[]}register(e,t){if(this.shutdownStage!==void 0&&this.shutdownStage>=e)return t(!0),Is;for(;this.participants.length<=e;)this.participants.push(new Set);return this.participants[e].add(t),{dispose:()=>this.participants[e].delete(t)}}async shutdownContext(){(this.shutdownStage===void 0||this.shutdownStage<0)&&await Promise.all([...this.participants[0]].map(e=>e(!1)))}async shutdownAll(){for(this.shutdownStage=0;this.shutdownStage<this.participants.length;this.shutdownStage++)await Promise.all([...this.participants[this.shutdownStage]].map(e=>e(!0)))}};ml=S([(0,JF.injectable)()],ml);var Ff=class{toDap(){return{category:"console",output:"\x1B[2J"}}},Ab=class{toDap(){return{category:"stdout",output:"",group:"end"}}};var Db=class{constructor(e){this.sink=e;this.q=[];this.disposed=!1;this.onDrainedEmitter=new O;this.onDrained=this.onDrainedEmitter.event}get length(){return this.q.length}enqueue(e){this.disposed||(this.q.push(new QC(e)),this.q.length===1&&this.process())}dispose(){this.disposed=!0,this.q=[]}async process(){let e=this.q.findIndex(t=>t.value===XF);e===0?await this.q[0].wait:e===-1?(this.sink(YF(this.q)),this.q=[]):(this.sink(YF(this.q.slice(0,e))),this.q=this.q.slice(e)),this.q.length?this.process():this.onDrainedEmitter.fire()}},YF=r=>r.map(e=>e.value).filter(e=>e!==QF),XF=Symbol("unsettled"),QF=Symbol("unsettled"),QC=class{constructor(e){this.value=XF;e instanceof Promise?this.wait=e.then(t=>{this.value=t},()=>{this.value=QF}):(this.value=e,this.wait=Promise.resolve())}};var EQ=new Set(["group","assert","count"]),gl=class{constructor(e,t){this.dap=e;this.isDirty=!1;this.queue=new Db(e=>{for(let t of e)this.dap.output(t)});this.onDrained=this.queue.onDrained;t.register(0,async n=>{this.length&&await new Promise(i=>this.onDrained(i)),n&&this.dispose()})}get length(){return this.queue.length}dispose(){this.queue.dispose()}dispatch(e,t){let n=this.parse(t);n&&this.enqueue(e,n)}enqueue(e,t){if(!(t instanceof Ff))this.isDirty=!0;else if(this.isDirty)this.isDirty=!1;else return;this.queue.enqueue(t.toDap(e))}parse(e){if(e.type==="log"){let t=e.stackTrace?.callFrames[0];if(t&&t.url==="internal/console/constructor.js"&&EQ.has(t.functionName))return}switch(e.type){case"clear":return new Ff;case"endGroup":return new Ab;case"assert":return new Ib(e);case"table":return new Eb(e);case"startGroup":case"startGroupCollapsed":return new Pb(e);case"debug":case"log":case"info":return new Ns(e);case"trace":return new xb(e);case"error":return new Tb(e);case"warning":return new Cb(e);case"dir":case"dirxml":return new Ns(e);case"count":return new Ns(e);case"profile":case"profileEnd":return new Ns(e);case"timeEnd":return new Ns(e);default:try{tu(e.type,"unknown console message type")}catch{}}}};gl=S([(0,Bf.injectable)(),g(0,(0,Bf.inject)(kr)),g(1,(0,Bf.inject)(Fs))],gl);var fc=b(N()),tB=require("os"),rB=require("path");var ZC=require("path"),ZF=(0,ZC.join)(__dirname,"diagnosticTool.js"),eB=(0,ZC.join)(__dirname,"diagnosticTool.css");var Qi=Symbol("ITarget"),Dt=Symbol("ILauncher");var Bs=class{constructor(e,t,n,i){this.fs=e;this.sources=t;this.breakpoints=n;this.target=i}async generateObject(){let[e]=await Promise.all([this.dumpSources()]);return{breakpoints:this.dumpBreakpoints(),sources:e,config:this.target.launchConfig}}async generateHtml(e=(0,rB.join)((0,tB.tmpdir)(),"js-debug-diagnostics.html")){return await this.fs.writeFile(e,`<!DOCTYPE html>
      <html lang="en">
      <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>${await this.fs.readFile(eB,"utf-8")}<</style>
      </head>
      <body>
        <script>window.DUMP=${JSON.stringify(await this.generateObject())}</script>
        <script>${await this.fs.readFile(ZF,"utf-8")}</script>
      </body>
      </html>`),e}dumpBreakpoints(){let e=[];for(let t of[this.breakpoints.appliedByPath,this.breakpoints.appliedByRef])for(let n of t.values())for(let i of n){let o=i.diagnosticDump();e.push({source:o.source,params:o.params,cdp:o.cdp.map(s=>s.state===1?{...s,uiLocations:s.uiLocations.map(a=>this.dumpUiLocation(a))}:{...s,done:void 0})})}return e}dumpSources(){let e=[],t=0;for(let n of this.sources.sources)e.push((async()=>({uniqueId:t++,url:n.url,sourceReference:n.sourceReference,absolutePath:n.absolutePath,actualAbsolutePath:await n.existingAbsolutePath(),scriptIds:n.scripts.map(i=>i.scriptId),prettyName:await n.prettyName(),compiledSourceRefToUrl:n instanceof yt?[...n.compiledToSourceUrl.entries()].map(([i,o])=>[i.sourceReference,o]):void 0,sourceMap:Ya(n)?{url:n.sourceMap.metadata.sourceMapUrl,metadata:n.sourceMap.metadata,sources:go(Object.fromEntries(n.sourceMap.sourceByUrl),i=>i.sourceReference)}:void 0}))());return Promise.all(e)}dumpUiLocation(e){return{lineNumber:e.lineNumber,columnNumber:e.columnNumber,sourceReference:e.source.sourceReference}}};Bs=S([(0,fc.injectable)(),g(0,(0,fc.inject)(ue)),g(1,(0,fc.inject)(Bt)),g(2,(0,fc.inject)(Cn)),g(3,(0,fc.inject)(Qi))],Bs);var iB=b(ie()),Ob=b(N());var nB="@vscode/dwarf-debugging",yl=class{constructor(e){this.dap=e;this.didPrompt=!1}async load(){try{return await import(nB)}catch{return}}prompt(){this.didPrompt||(this.didPrompt=!0,this.dap.output({output:iB.t("You may install the `{}` module via npm for enhanced WebAssembly debugging",nB),category:"console"}))}};yl=S([(0,Ob.injectable)(),g(0,(0,Ob.inject)(kr))],yl);var js=b(N());var vl=Symbol("IExceptionPauseService");var bl=class{constructor(e,t,n,i,o){this.evaluator=e;this.scriptSkipper=t;this.dap=n;this.sourceContainer=o;this.state={cdp:"none"};this.blocker=ke();this.noDebug=!!i.noDebug,this.breakOnError=i.__breakOnConditionalError,this.blocker.resolve()}get launchBlocker(){return this.blocker.promise}async setBreakpoints(e){if(!this.noDebug){try{this.state=this.parseBreakpointRequest(e)}catch(t){if(!(t instanceof F))throw t;this.dap.output({category:"stderr",output:t.message});return}this.cdp?await this.sendToCdp(this.cdp):this.state.cdp!=="none"&&this.blocker.hasSettled()&&(this.blocker=ke())}}async shouldPauseAt(e){if(e.reason!=="exception"&&e.reason!=="promiseRejection"||this.state.cdp==="none"||e.callFrames.some(n=>this.sourceContainer.getSourceScriptById(n.location.scriptId)?.url.endsWith(".cdp"))||this.shouldScriptSkip(e))return!1;let t=this.state.condition;if(e.data?.uncaught){if(t.uncaught&&!await this.evalCondition(e,t.uncaught))return!1}else if(t.caught&&!await this.evalCondition(e,t.caught))return!1;return!0}async apply(e){this.cdp=e,this.state.cdp!=="none"&&await this.sendToCdp(e)}async sendToCdp(e){await e.Debugger.setPauseOnExceptions({state:this.state.cdp}),this.blocker.resolve()}async evalCondition(e,t){return!!(await t({callFrameId:e.callFrames[0].callFrameId},i=>i==="error"?e.data:void 0))?.result.value}shouldScriptSkip(e){if(e.data?.uncaught||!e.callFrames.length)return!1;let t=this.sourceContainer.getScriptById(e.callFrames[0].location.scriptId);return!!t&&this.scriptSkipper.isScriptSkipped(t.url)}parseBreakpointRequest(e){let t=(e.filterOptions??[]).concat(e.filters.map(a=>({filterId:a}))),n="none",i=[],o=[];for(let{filterId:a,condition:c}of t)a==="all"?(n="all",c&&i.push(a)):a==="uncaught"&&(n==="none"&&(n="uncaught"),c&&o.push(a));let s=a=>{if(a.length===0)return;let c="!!("+t.map(p=>p.condition).filter(et).join(") || !!(")+")",u=fs(c);if(u)throw new F(ls({line:0,condition:c},u.message));let l=wx(c,this.breakOnError);return this.evaluator.prepare(l,{hoist:["error"]}).invoke};return n==="none"?{cdp:n}:{cdp:n,condition:{caught:s(i),uncaught:s(o)}}}};bl=S([(0,js.injectable)(),g(0,(0,js.inject)(Sn)),g(1,(0,js.inject)(xs)),g(2,(0,js.inject)(kr)),g(3,(0,js.inject)(we)),g(4,(0,js.inject)(Bt))],bl);var Nb=b(N());var Lb=class{constructor(){this.didEnable=new WeakSet}async retrieve(e){this.didEnable.has(e)||(this.didEnable.add(e),await e.Performance.enable({}));let t=await e.Performance.getMetrics({});if(!t)return{error:"Error in CDP"};let n={};for(let i of t.metrics)n[i.name]=i.value;return{metrics:n}}};var Mb=class{async retrieve(e){let t=await e.Runtime.evaluate({expression:`({
        memory: process.memoryUsage(),
        cpu: process.cpuUsage(),
        timestamp: Date.now(),
        resourceUsage: process.resourceUsage && process.resourceUsage(),
      })${at()}`,returnByValue:!0});return t?t.exceptionDetails?{error:t.exceptionDetails.text}:{metrics:t.result.value}:{error:"No response from CDP"}}};var Fb=Symbol("IPerformanceProvider"),hc=class{constructor(e){this.target=e}create(){return this.target.type()==="node"?new Mb:new Lb}};hc=S([(0,Nb.injectable)(),g(0,(0,Nb.inject)(Qi))],hc);var oT=b(ie()),aB=require("crypto"),Us=b(N()),cB=require("os"),uB=require("path");var Ub=b(N());var eT=b(ie()),mc=b(N()),Bb=require("path");var wl=class{constructor(e){this.sources=e;this.locationIdCounter=0;this.locationsByRef=new Map}getLocationIdFor(e){let t=[e.functionName,e.url,e.scriptId,e.lineNumber,e.columnNumber].join(":"),n=this.locationsByRef.get(t);if(n)return n.id;let i=this.locationIdCounter++;return this.locationsByRef.set(t,{id:i,callFrame:e,locations:(async()=>{let o=await this.sources.getScriptById(e.scriptId)?.source;if(!o)return[];let s=await this.sources.currentSiblingUiLocations({lineNumber:e.lineNumber+1,columnNumber:e.columnNumber+1,source:o});return Promise.all(s.map(async a=>({...a,source:await a.source.toDap()})))})()}),i}getLocations(){return Promise.all([...this.locationsByRef.values()].sort((e,t)=>e.id-t.id).map(async e=>({callFrame:e.callFrame,locations:await e.locations})))}};var qt=class{constructor(e,t,n,i){this.cdp=e;this.fs=t;this.sources=n;this.launchConfig=i}static canApplyTo(){return!0}async start(e,t){if(!await this.cdp.Profiler.start({}))throw new F(vu());return new tT(this.cdp,this.fs,this.sources,this.launchConfig.__workspaceFolder,t)}async save(e,t){let n=await oB(e,this.sources,this.launchConfig.__workspaceFolder);(0,Bb.isAbsolute)(t)||(t=(0,Bb.join)(this.launchConfig.__workspaceFolder,t)),await this.fs.writeFile(t,JSON.stringify(n))}};qt.type="cpu",qt.extension=".cpuprofile",qt.label=eT.t("CPU Profile"),qt.description=eT.t("Generates a .cpuprofile file you can open in VS Code or the Edge/Chrome devtools"),qt.editable=!0,qt=S([(0,mc.injectable)(),g(0,(0,mc.inject)(nt)),g(1,(0,mc.inject)(ue)),g(2,(0,mc.inject)(Bt)),g(3,(0,mc.inject)(we))],qt);var tT=class{constructor(e,t,n,i,o){this.cdp=e;this.fs=t;this.sources=n;this.workspaceFolder=i;this.file=o;this.stopEmitter=new O;this.disposed=!1;this.onUpdate=new O().event;this.onStop=this.stopEmitter.event}async dispose(){this.disposed||(this.disposed=!0,this.stopEmitter.fire())}async stop(){let e=await this.cdp.Profiler.stop({});if(!e)throw new F(vu());await this.dispose();let t=await oB(e.profile,this.sources,this.workspaceFolder);await this.fs.writeFile(this.file,JSON.stringify(t))}};async function oB(r,e,t){let n=new wl(e),i=r.nodes.map(o=>({...o,locationId:n.getLocationIdFor(o.callFrame),positionTicks:o.positionTicks?.map(s=>({...s,startLocationId:n.getLocationIdFor({...o.callFrame,lineNumber:s.line-1,columnNumber:0}),endLocationId:n.getLocationIdFor({...o.callFrame,lineNumber:s.line,columnNumber:0})}))}));return{...r,nodes:i,$vscode:{rootPath:t,locations:await n.getLocations()}}}var rT=b(ie()),gc=b(N());var sn=class{constructor(e,t,n,i){this.cdp=e;this.fs=t;this.sources=n;this.launchConfig=i}static canApplyTo(){return!0}async start(e,t){if(await this.cdp.HeapProfiler.enable({}),!await this.cdp.HeapProfiler.startSampling({}))throw new F(vu());return new nT(this.cdp,this.fs,this.sources,this.launchConfig.__workspaceFolder,t)}};sn.type="heap",sn.extension=".heapprofile",sn.label=rT.t("Heap Profile"),sn.description=rT.t("Generates a .heapprofile file you can open in VS Code or the Edge/Chrome devtools"),sn.editable=!0,sn=S([(0,gc.injectable)(),g(0,(0,gc.inject)(nt)),g(1,(0,gc.inject)(ue)),g(2,(0,gc.inject)(Bt)),g(3,(0,gc.inject)(we))],sn);var nT=class{constructor(e,t,n,i,o){this.cdp=e;this.fs=t;this.sources=n;this.workspaceFolder=i;this.file=o;this.stopEmitter=new O;this.disposed=!1;this.onUpdate=new O().event;this.onStop=this.stopEmitter.event}async dispose(){this.disposed||(this.disposed=!0,await this.cdp.HeapProfiler.disable({}),this.stopEmitter.fire())}async stop(){let e=await this.cdp.HeapProfiler.stopSampling({});if(!e)throw new F(vu());await this.dispose();let t=await this.annotateSources(e.profile);await this.fs.writeFile(this.file,JSON.stringify(t))}async annotateSources(e){let t=new wl(this.sources),n=(o,s)=>{s.locationId=t.getLocationIdFor(o.callFrame);for(let a of o.children){let c={...a,children:[]};s.children.push(c),n(a,c)}},i={...e.head,children:[]};return n(e.head,i),{...e,head:i,$vscode:{rootPath:this.workspaceFolder,locations:await t.getLocations()}}}};var iT=b(ie()),sB=require("fs"),jb=b(N());var an=class{constructor(e){this.cdp=e;this.cdp.HeapProfiler.on("addHeapSnapshotChunk",({chunk:t})=>this.currentWriter?.stream.write(t))}static canApplyTo(){return!0}async start(e,t){return{onStop:new O().event,onUpdate:new O().event,dispose:()=>{},stop:async()=>{await this.cdp.HeapProfiler.enable({}),await this.dumpToFile(t),await this.cdp.HeapProfiler.disable({})}}}async dumpToFile(e){let{stream:t,promise:n}=this.currentWriter={stream:(0,sB.createWriteStream)(e),promise:this.cdp.HeapProfiler.takeHeapSnapshot({})};await n,t.end(),this.currentWriter=void 0}};an.type="memory",an.extension=".heapsnapshot",an.label=iT.t("Heap Snapshot"),an.description=iT.t("Generates a .heapsnapshot file you can open in VS Code or the Edge/Chrome devtools"),an.instant=!0,an=S([(0,jb.injectable)(),g(0,(0,jb.inject)(nt))],an);var qb=Symbol("IProfilerFactory"),Wb=()=>{let r=new Date;return["vscode-profile",r.getFullYear(),r.getMonth()+1,r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds()].map(e=>String(e).padStart(2,"0")).join("-")},Br=class{constructor(e){this.container=e}get(e){let t=Br.ctors.find(n=>n.type===e);if(!t)throw new Error(`Invalid profilter type ${e}`);return this.container.get(t)}};Br.ctors=[qt,sn,an],Br=S([(0,Ub.injectable)(),g(0,(0,Ub.inject)(Ku))],Br);var Vb=Symbol("IProfileController"),Sl=class{constructor(e,t,n,i,o){this.cdp=e;this.factory=t;this.basicCpuProfiler=n;this.breakpoints=i;this.shutdown=o;this.seenConsoleProfileNames=Object.create(null)}connect(e,t){e.on("startProfile",async n=>(await this.start(e,t,n),{})),e.on("stopProfile",()=>this.stopProfiling(e)),this.cdp.Profiler.on("consoleProfileStarted",()=>{e.output({output:oT.t("Console profile started")+`
`,category:"console"})}),this.cdp.Profiler.on("consoleProfileFinished",async n=>{let i=this.saveConsoleProfile(e,n),o=this.shutdown.register(0,()=>i);await i,o.dispose()}),t.onPaused(()=>this.stopProfiling(e))}async start(e,t,n){if(this.profile)throw new F(v1());this.profile=this.startProfileInner(e,t,n).catch(i=>{throw this.profile=void 0,i}),await this.profile}async saveConsoleProfile(e,t){let n;if(t.title){n=t.title.replace(/[\/\\]/g,"-");let i=this.seenConsoleProfileNames[t.title]||0;this.seenConsoleProfileNames[t.title]=i+1,i>0&&(n+=`-${i}`)}else n=Wb();n+=qt.extension,await this.basicCpuProfiler.save(t.profile,n),e.output({output:oT.t('CPU profile saved as "{0}" in your workspace folder',n)+`
`,category:"console"})}async startProfileInner(e,t,n){let i=!1,o;if(n.stopAtBreakpoint?.length){let l=new Set(n.stopAtBreakpoint);i=!0,o=p=>!(p instanceof _n)||l.has(p.dapId)}else o=()=>!1;await this.breakpoints.applyEnabledFilter(o);let s=(0,uB.join)((0,cB.tmpdir)(),`vscode-js-profile-${(0,aB.randomBytes)(4).toString("hex")}`),a=await this.factory.get(n.type).start(n,s),c={file:s,profile:a,enableFilter:o,keptDebuggerOn:i};a.onUpdate(l=>e.profilerStateUpdate({label:l,running:!0})),a.onStop(()=>this.disposeProfile(c));let u=!!t.pausedDetails();return i?await t.resume():u&&(await this.cdp.Debugger.disable({}),u&&t.onResumed()),e.profileStarted({file:c.file,type:n.type}),c}async stopProfiling(e){let t=await this.profile?.catch(()=>{});return!t||!this.profile?{}:(this.profile=void 0,await t?.profile.stop(),e.profilerStateUpdate({label:"",running:!1}),{})}async disposeProfile({profile:e,enableFilter:t,keptDebuggerOn:n}){n||await this.cdp.Debugger.enable({}),await this.breakpoints.applyEnabledFilter(void 0,t),e.dispose()}};Sl=S([(0,Us.injectable)(),g(0,(0,Us.inject)(nt)),g(1,(0,Us.inject)(qb)),g(2,(0,Us.inject)(qt)),g(3,(0,Us.inject)(Cn)),g(4,(0,Us.inject)(Fs))],Sl);var An=b(N());var M2=b(lB()),N2=require("dns"),vv=b(L2()),wc=b(N());var Dl=Symbol("IRequestOptionsProvider");var Hs=class{constructor(e,t){this.fs=e;this.options=t;this.autoLocalhostPortFallbacks={}}async fetch(e,t=jt,n){try{let o=(0,M2.dataUriToBuffer)(e);return{ok:!0,url:e,body:new TextDecoder().decode(o.buffer),statusCode:200}}catch{}let i=pr(e)?e:ct(e);if(i)try{return{ok:!0,url:e,body:await this.fs.readFile(i,"utf-8"),statusCode:200}}catch(o){return{ok:!1,url:e,error:o,statusCode:200}}return this.fetchHttp(e,t,n)}async fetchJson(e,t,n){let i=await this.fetch(e,t,{Accept:"application/json",...n});if(!i.ok)return i;try{return{...i,body:JSON.parse(i.body)}}catch(o){return{...i,ok:!1,url:e,error:o}}}async fetchHttp(e,t,n){let i=new URL(e),o=i.protocol!=="http:",s=Number(i.port)??(o?443:80),a={headers:n,followRedirect:!0};o&&await Pu(e)&&(a.rejectUnauthorized=!1),this.options?.provideOptions(a,e);let c=i.hostname==="localhost";if(c&&this.autoLocalhostPortFallbacks[s]){let p=await this.requestHttp(i.toString(),a,t);return p.statusCode!==503?p:(delete this.autoLocalhostPortFallbacks[s],this.requestHttp(e,a,t))}let l=await this.requestHttp(e,a,t);if(l.statusCode===503&&c){let p;try{p=await N2.promises.lookup(i.hostname)}catch{return l}i.hostname=p.family===6?"127.0.0.1":"[::1]",l=await this.requestHttp(i.toString(),a,t),l.statusCode!==503&&(this.autoLocalhostPortFallbacks[s]=i.hostname)}return l}async requestHttp(e,t,n){this.options?.provideOptions(t,e);let i=new pe;try{let o=(0,vv.default)(e,t);i.push(n.onCancellationRequested(()=>o.cancel()));let s=await o;return{ok:!0,url:e,body:s.body,statusCode:s.statusCode}}catch(o){if(!(o instanceof vv.RequestError))throw o;let s=o.response?String(o.response?.body):o.message,a=o.response?.statusCode??503;return{ok:!1,body:s,statusCode:a,url:e,error:new Ag(a,e,s)}}finally{i.dispose()}}};Hs=S([(0,wc.injectable)(),g(0,(0,wc.inject)(ue)),g(1,(0,wc.optional)()),g(1,(0,wc.inject)(Dl))],Hs);var Sc=class extends Hs{constructor(t,n,i,o,s){super(t,s);this.logger=n;this.target=i;this.cdp=o;this.disposables=new pe}dispose(){this.disposables.dispose()}async fetchHttp(t,n,i={}){let o=await super.fetchHttp(t,n,i);return o.ok?o:(this.logger.info("runtime","Network load failed, falling back to CDP",{url:t,res:o}),this.fetchOverBrowserNetwork(t,o))}async fetchOverBrowserNetwork(t,n){if(!this.cdp)return n;let i=await this.cdp.Network.loadNetworkResource({frameId:this.target?.targetInfo.targetId,url:t,options:{includeCredentials:!0,disableCache:!0}});if(!i||!i.resource.success||!i.resource.httpStatusCode||i.resource.httpStatusCode>=400||!i.resource.stream)return n;let o=Number(i.resource.headers?.["Content-Length"]);isNaN(o)&&(o=1/0);let s=[],a=0;for(;;){let c=await this.cdp.IO.read({handle:i.resource.stream,offset:a});if(!c)return this.logger.info("runtime","Stream error encountered in middle, falling back",{url:t}),n;let u=c.base64Encoded?Buffer.from(c.data,"base64").toString():c.data;if(a+=Buffer.byteLength(u,"utf-8"),s.push(u),a>=o){this.cdp.IO.close({handle:i.resource.stream});break}if(c.eof)break}return{ok:!0,body:s.join(""),statusCode:i.resource.httpStatusCode,url:t}}};Sc=S([(0,An.injectable)(),g(0,(0,An.inject)(ue)),g(1,(0,An.inject)($)),g(2,(0,An.optional)()),g(2,(0,An.inject)(Qi)),g(3,(0,An.optional)()),g(3,(0,An.inject)(nt)),g(4,(0,An.optional)()),g(4,(0,An.inject)(Dl))],Sc);var Gs=b(N()),j2=b(lf());function B2(r,e=wr){let t=[];for(let n=0;n<r.length;n++){let i=r[n];if(i.startsWith("!")){let o=F2(i.slice(1),e);for(let s=0;s<t.length;s++)t[s]=`^(?!${o.slice(1)})${t[s].slice(1)}`}else t.push(F2(i,e))}return t.map(n=>new RegExp(n,"i"))}function F2(r,e=wr){let t=r.split("/"),n=[];for(let i=0;i<t.length;i++){let o=t[i];if(o==="**")i===0?n.push("(.+/)?"):i===t.length-1||n.push(".*/");else{if(o.includes("*")){let s=o.split("*");n.push(s.map(a=>e(a)).join("[^\\/]*"))}else n.push(e(o));n.push(i<t.length-1?"\\/":"$")}}return`^${n.join("")}`}function Lte(r){let e=/^<node_internals>[\/\\](.*)$/,t=r.map(n=>{n=n.trim();let i=e.exec(n);return i?i[1]:null}).filter(et);return t.length>0?t:void 0}function Mte(r,e){return e.filter(n=>!n.includes(Kn)).map(n=>pr(n)?Eu(r.rebaseLocalToRemote(n)):je(n)).map(Zg)}var Zi=class{constructor({skipFiles:e},t,n,i,o){this.logger=n;this.cdp=i;this._regexForAuthored=XE(e=>B2(e,t=>Zd(t,0,t.length,!0,!0)));this._scriptsWithSkipping=new Set;this._targetId=o.id(),this._rootTargetId=U2(o).id(),this._isUrlFromSourceMapSkipped=new Oi(s=>this._normalizeUrl(s)),this._authoredGlobs=Mte(t,e),this._nodeInternalsGlobs=Lte(e),this._initNodeInternals(o),this._updateSkippedDebounce=ZE(500,()=>this._updateGeneratedSkippedSources()),e.length&&this._updateGeneratedSkippedSources(),this._sharedSkipListener=Zi.sharedSkipsEmitter.event(s=>{s.rootTargetId===this._rootTargetId&&s.targetId!==this._targetId&&this._toggleSkippingFile(s.params)})}dispose(){this._sharedSkipListener.dispose()}setSourceContainer(e){this._sourceContainer=e}_testSkipNodeInternal(e){return this._nodeInternalsGlobs?(e.startsWith(zn)&&(e=e.slice(zn.length)),(0,j2.default)([e],this._nodeInternalsGlobs).length>0):!1}_testSkipAuthored(e){return this._regexForAuthored(this._authoredGlobs).some(t=>t.test(e))}_isNodeInternal(e,t){return e.startsWith(zn)?!0:t?.has(e)||/^internal\/.+\.js$/.test(e)}async _updateGeneratedSkippedSources(){let e=this._regexForAuthored(this._authoredGlobs).map(n=>n.source),t=this._allNodeInternals?.settledValue;if(t){e.push(`^(${zn})?internal\\/`);for(let n of t)this._testSkipNodeInternal(n)&&e.push(`^(${zn})?${wr(n)}$`)}await this.cdp.Debugger.setBlackboxPatterns({patterns:e})}_normalizeUrl(e){return je(e.toLowerCase())}isScriptSkipped(e){return this._isNodeInternal(e,this._allNodeInternals?.settledValue)?this._testSkipNodeInternal(e):(e=this._normalizeUrl(e),this._isUrlFromSourceMapSkipped.get(e)===!0?!0:this._testSkipAuthored(e))}async _updateSourceWithSkippedSourceMappedSources(e,t){let n=this.isScriptSkipped(e.url),i=[],o=n;for(let a of e.sourceMap.sourceByUrl.values()){let c=this.isScriptSkipped(a.url);if(typeof c>"u"&&(c=n),c!==o){let[[u],[l]]=await Promise.all([this._sourceContainer.currentSiblingUiLocations({source:a,lineNumber:1,columnNumber:1},e),this._sourceContainer.currentSiblingUiLocations({source:a,lineNumber:1/0,columnNumber:1},e)]);u&&l?(i.push({lineNumber:u.lineNumber-1,columnNumber:u.columnNumber-1},{lineNumber:l.lineNumber-1,columnNumber:l.columnNumber-1}),o=!o):this.logger.error("internal","Could not map script beginning for "+a.sourceReference)}}let s=t;i.length||(s=s.filter(a=>this._scriptsWithSkipping.has(a.scriptId)),s.forEach(a=>this._scriptsWithSkipping.delete(a.scriptId))),s.map(({scriptId:a})=>this.cdp.Debugger.setBlackboxedRanges({scriptId:a,positions:i}))}initializeSkippingValueForSource(e){this._initializeSkippingValueForSource(e)}_initializeSkippingValueForSource(e,t=e.scripts){let n=e.url,i=this.isScriptSkipped(n);if(!i&&e.absolutePath&&this._testSkipAuthored(Ae(e.absolutePath))&&(this.setIsUrlBlackboxSkipped(n,!0),i=!0,this._updateSkippedDebounce()),Sr(e)){if(i)for(let o of e.sourceMap.sourceByUrl.values())this._isUrlFromSourceMapSkipped.set(o.url,!0);for(let o of e.sourceMap.sourceByUrl.values())this._initializeSkippingValueForSource(o,t);this._updateSourceWithSkippedSourceMappedSources(e,t)}}async _initNodeInternals(e){if(e.type()!=="node"||!this._nodeInternalsGlobs||this._allNodeInternals)return;let t=this._allNodeInternals=ke(),n=await this.cdp.Runtime.evaluate({expression:"require('module').builtinModules"+at(),returnByValue:!0,includeCommandLineAPI:!0});n&&!n.exceptionDetails?t.resolve(new Set(n.result.value.map(i=>i+".js"))):t.resolve(new Set),await this._updateGeneratedSkippedSources()}async _toggleSkippingFile(e){let t;e.resource&&pr(e.resource)&&(t=e.resource);let n={path:t,sourceReference:e.sourceReference},i=this._sourceContainer.source(n);if(!i)return{};let o=!this.isScriptSkipped(i.url);if(i instanceof yt){this._isUrlFromSourceMapSkipped.set(i.url,o);let s=Array.from(i.compiledToSourceUrl.keys());await Promise.all(s.map(a=>this._updateSourceWithSkippedSourceMappedSources(a,a.scripts)))}else{if(Sr(i))for(let s of i.sourceMap.sourceByUrl.values())this._isUrlFromSourceMapSkipped.set(s.url,o);this.setIsUrlBlackboxSkipped(i.url,o),await this._updateGeneratedSkippedSources()}return{}}setIsUrlBlackboxSkipped(e,t){let n=e,i=`!${n}`,o=this._authoredGlobs.filter(s=>s!==n&&s!==i);this._regexForAuthored(o).some(s=>s.test(e))!==t&&(o.push(t?n:i),this._regexForAuthored.clear()),this._authoredGlobs=o}async toggleSkippingFile(e){let t=await this._toggleSkippingFile(e);return Zi.sharedSkipsEmitter.fire({params:e,rootTargetId:this._rootTargetId,targetId:this._targetId}),t}};Zi.sharedSkipsEmitter=new O,Zi=S([(0,Gs.injectable)(),g(0,(0,Gs.inject)(we)),g(1,(0,Gs.inject)(Re)),g(2,(0,Gs.inject)($)),g(3,(0,Gs.inject)(nt)),g(4,(0,Gs.inject)(Qi))],Zi);function U2(r){let e=r.parent();return e?U2(e):r}var Yf=b(N()),W2=require("path");var q2=/^webpack:\/{3}([^/]+?\.vue)(\?[0-9a-z]*)?$/i,Nte=/^webpack:\/{3}\.\/.+\.vue\?[0-9a-z]+$/i,Ll=Symbol("IVueFileMapper");var Ol=class{constructor(e,t){this.files=e;this.search=t;this.getMapping=ne(async()=>{let e=new Map;return await this.search.streamAllChildren(this.files,t=>e.set((0,W2.basename)(t),t)),e})}async lookup(e){let t=q2.exec(e);return t?(await this.getMapping()).get(t[1]):void 0}getVueHandling(e){return this.files.empty?0:q2.test(e)?1:Nte.test(e)?2:0}};Ol=S([(0,Yf.injectable)(),g(0,(0,Yf.inject)(xo)),g(1,(0,Yf.inject)(ku))],Ol);var eo=class{constructor(){this.changeEmitter=new O;this.addEmitter=new O;this.removeEmitter=new O;this.targetMap=new Map;this.onChanged=this.changeEmitter.event;this.onAdd=this.addEmitter.event;this.onRemove=this.removeEmitter.event}get size(){return this.targetMap.size}add(e,t){this.targetMap.set(e,t),this.addEmitter.fire([e,t]),this.changeEmitter.fire()}get(e){return this.targetMap.get(e)}remove(e){let t=this.targetMap.get(e);return t===void 0?!1:(this.targetMap.delete(e),this.removeEmitter.fire([e,t]),this.changeEmitter.fire(),!0)}value(){return this.targetMap.values()}};var _c=b(N());var Nl=Symbol("IDefaultBrowserProvider"),Ml=class{constructor(e,t){this.location=e;this.vscode=t;this.lookup=ne(async()=>{let e;return this.location==="remote"&&this.vscode?e=await this.vscode.commands.executeCommand("js-debug-companion.defaultBrowser"):e=(await Promise.resolve().then(()=>(oU(),iU)).then(n=>n.default())).name,["chrome","edge"].find(n=>e.toLowerCase().includes(n))??"other"})}};Ml=S([(0,_c.injectable)(),g(0,(0,_c.inject)(Zn)),g(1,(0,_c.optional)()),g(1,(0,_c.inject)(Ft))],Ml);var aU=b(N()),Iv=b(require("os"));var _v=class{async setup(){}dispose(){}write(e){if(e.level>2)throw new Error(e.message);console.log(JSON.stringify(e))}};var bP=class{constructor(e=512){this.size=e;this.items=[];this.i=0}write(e){this.items[this.i]=e,this.i=(this.i+1)%this.size}read(){return this.items.slice(this.i).concat(this.items.slice(0,this.i))}},Dn=class{constructor(){this.logTarget={queue:[]};this.logBuffer=new bP(1)}static async test(){let e=new Dn;return e.setup({sinks:[new _v],showWelcome:!1}),e}info(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:1})}verbose(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:0})}warn(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:2})}error(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:3})}fatal(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:4})}assert(e,t){if(e===!1||e===void 0||e===null){if(this.error("runtime.assertion",t,{error:new Error("Assertion failed")}),process.env.JS_DEBUG_THROW_ASSERTIONS)throw new Error(t);debugger;return!1}return!0}log(e){if(this.logBuffer.write(e),"queue"in this.logTarget){this.logTarget.queue.push(e);return}for(let t of this.logTarget.sinks)t.write(e)}getRecentLogs(){return this.logBuffer.read()}dispose(){if("sinks"in this.logTarget){for(let e of this.logTarget.sinks)e.dispose();this.logTarget={queue:[]}}}forTarget(){return this}async setup(e){if(await Promise.all(e.sinks.map(n=>n.setup())),e.showWelcome!==!1){let n=Vte();for(let i of e.sinks)i.write(n)}let t=this.logTarget;this.logTarget={sinks:e.sinks.slice()},"sinks"in t?t.sinks.forEach(n=>n.dispose()):t.queue.forEach(n=>this.log(n))}};Dn.null=(()=>{let e=new Dn;return e.setup({sinks:[]}),e})(),Dn=S([(0,aU.injectable)()],Dn);var Vte=()=>({timestamp:Date.now(),tag:"runtime.welcome",level:1,message:`${mm} v${Ra} started`,metadata:{os:`${Iv.platform()} ${Iv.arch()}`,nodeVersion:process.version,adapterVersion:Ra}});var Xf=Symbol("MutableLaunchConfig"),cU=r=>{let e=new O;return new Proxy({},{ownKeys(){return Object.keys(r)},get(t,n){switch(n){case"update":return i=>{r=i,e.fire()};case"onChange":return e.event;default:return r[n]}}})};var Rq=b(dq()),Mv=b(N());var Ec=Symbol("touched"),Js;(c=>{function r(){return{children:{},[Ec]:1}}c.root=r;function e(u,l){return u[Ec]=1,a(u,s(l),0)}c.getPath=e;function t(u){u[Ec]=1}c.touch=t;function n(u){u[Ec]=2}c.touchAll=n;function i(u,l){let p=u.children[l]??={children:{}};return p[Ec]=1,p}c.getOrMakeChild=i;function o(u){if(u[Ec]){for(let[l,p]of Object.entries(u.children))switch(p[Ec]){case 1:o(p);break;case 2:break;default:delete u.children[l]}return u}}c.prune=o;function s(u){let l=u.split(/\/|\\/);return l[0]===""&&l.unshift(),l}function a(u,l,p){let d=i(u,l[p]);return p===l.length-1?d:a(d,l,p+1)}})(Js||={});var WP=require("fs"),VP=b(lf()),kc=require("path"),kq=b(Eq());var Tne=/\//g,Lv=class{constructor(e){this.stat=yo(e=>WP.promises.lstat(e));this.readdir=yo(e=>WP.promises.readdir(e,{withFileTypes:!0}));this.alreadyProcessedFiles=new Set;this.fileEmitter=new O;this.onFile=this.fileEmitter.event;this.errorEmitter=new O;this.onError=this.errorEmitter.event;this.processor=e.fileProcessor,this.filter=e.filter,this.ignore=e.ignore.map(i=>VP.default.matcher((0,kq.default)(je(i),{cwd:e.cwd})));let t=(0,kc.isAbsolute)(e.pattern)?(0,kc.relative)(e.cwd,e.pattern):e.pattern,n=VP.default.parse(je(t),{ignore:e.ignore,cwd:e.cwd,expand:!0});this.done=Promise.all(n.map(i=>{let o=[];for(let u=1;u<i.tokens.length;){let l=u+1;for(;l<i.tokens.length&&i.tokens[l].type!=="slash";)l++;let p=i.tokens[u];p.type==="globstar"?o.push("**"):l===u+1&&p.type==="text"?o.push(p.value):o.push(new RegExp("^"+i.tokens.slice(u,l).map(d=>d.output||d.value).join("")+"$")),u=l+1}let s=o[0]==="**"?[0,1]:[0],a=Js.getPath(e.cache,e.cwd),c={elements:o,seen:new Set};return Promise.all(s.map(u=>this.readSomething(c,u,e.cwd,[],a)))})).then(()=>{})}async readSomething(e,t,n,i,o){if(this.alreadyProcessedFiles.has(o))return;let s=`${t}:${n}`;if(e.seen.has(s))return;e.seen.add(s);let a;try{a=await this.stat(n)}catch(u){this.errorEmitter.fire({path:n,error:u});return}if(this.alreadyProcessedFiles.has(o))return;let c=o.data;if(c&&a.mtimeMs===c.mtime){if(c.type===0){let u=[],p=Object.entries(o.children).filter(([,d])=>d.data?.type!==0).map(([d])=>d);for(let[d,f]of Object.entries(o.children))u.push(f.data!==void 0?this.handleDirectoryEntry(e,t,n,{name:d,type:f.data.type},p,o):this.stat(n).then(h=>this.handleDirectoryEntry(e,t,n,{name:d,type:h.isFile()?1:0},p,o),()=>{}));await Promise.all(u)}else c.type===1&&(this.alreadyProcessedFiles.add(o),this.fileEmitter.fire(c.extracted));return}a.isDirectory()?await this.handleDir(e,t,a.mtimeMs,n,o):(this.alreadyProcessedFiles.add(o),await this.handleFile(a.mtimeMs,n,i,o))}applyFilterToFile(e,t,n){let i=n.children[e];if(this.alreadyProcessedFiles.has(i))return!1;if(!this.filter)return!0;let o=i.data?.type===1?i.data.extracted:void 0;return Js.touch(i),this.filter(t,o)}handleDirectoryEntry(e,t,n,i,o,s){let a=n+"/"+i.name,c=this.getDirectoryReadDescends(e,t,n,i);if(c===void 0)return;let u=Js.getOrMakeChild(s,i.name);if(!(i.type===1&&!this.applyFilterToFile(i.name,a,s)))return typeof c=="number"?this.readSomething(e,t+c,a,o,u):Promise.all(c.map(l=>this.readSomething(e,t+l,a,o,u)))}getDirectoryReadDescends(e,t,n,i){let o=n+"/"+i.name;if(this.ignore.some(c=>c(o)))return;let s=t===e.elements.length-1,a=e.elements[t];if(a==="**")return i.type===1?s?0:this.getDirectoryReadDescends(e,t+1,n,i):s?0:[0,1];if((a instanceof RegExp&&a.test(i.name)||a===i.name)&&(i.type===0?!s:s))return 1}async handleFile(e,t,n,i){let o=kc.sep==="/"?t:t.replace(Tne,kc.sep),s;try{s=await this.processor(o,{siblings:n,mtime:e})}catch(a){this.errorEmitter.fire({path:o,error:a});return}i.data={type:1,mtime:e,extracted:s},this.fileEmitter.fire(s)}async handleDir(e,t,n,i,o){let s;try{s=await this.readdir(i)}catch(u){this.errorEmitter.fire({path:i,error:u});return}let a=[],c=s.filter(u=>u.isFile()).map(u=>u.name);for(let u of s){if(u.name.startsWith("."))continue;let l;if(u.isDirectory())l=0;else if(u.isFile())l=1;else continue;a.push(this.handleDirectoryEntry(e,t,i,{name:u.name,type:l},c,o))}await Promise.all(a),o.data={type:0,mtime:n}}};var Wl=class{constructor(e){this.logger=e}async streamAllChildren(e,t){let n=[];return await this.globForFiles(e,o=>n.push(t(st(o.path)))),(await Promise.all(n)).filter(o=>o!==void 0)}async streamChildrenWithSourcemaps(e){let t=[],n=e.lastState||{},i={};return await Promise.all([...e.files.explode()].map(async s=>{let a=JSON.stringify(s),c=n[a]||Js.root();await this._streamChildrenWithSourcemaps(c,e,t,s);let u=Js.prune(c);u&&(i[a]=u)})),this.logger.info("sourcemap.parsing",`turboGlobStream search found ${t.length} files`),{values:(await Promise.all(t)).filter(et),state:i}}async _streamChildrenWithSourcemaps(e,t,n,i){let o=new Lv({pattern:i.pattern,ignore:i.negations,cwd:i.cwd,cache:e,filter:t.filter,fileProcessor:(s,a)=>mO(s,a).then(c=>c&&t.processMap(c))});o.onError(({path:s,error:a})=>{this.logger.warn("sourcemap.parsing","Error parsing source map",{error:a,path:s})}),o.onFile(s=>s&&n.push(t.onProcessedMap(s))),await o.done}async globForFiles(e,t){await Promise.all([...e.explode()].map(n=>new Promise((i,o)=>(0,Rq.default)([n.pattern,"!**/*.asar/**"],{ignore:n.negations,cwd:n.cwd}).on("data",t).on("end",i).on("error",o))))}};Wl=S([(0,Mv.injectable)(),g(0,(0,Mv.inject)($))],Wl);var Gv=b(ie()),Zs=b(N());var Aq=b(require("path")),Dq=require("url");var Nv=class{constructor(){this._onFrameAddedEmitter=new O;this._onFrameRemovedEmitter=new O;this._onFrameNavigatedEmitter=new O;this.onFrameAdded=this._onFrameAddedEmitter.event;this.onFrameRemoved=this._onFrameRemovedEmitter.event;this.onFrameNavigated=this._onFrameNavigatedEmitter.event;this._frames=new Map}attached(e,t){e.Page.enable({}),e.Page.getResourceTree({}).then(n=>{this._processCachedResources(e,n?n.frameTree:void 0,t)})}mainFrame(){return this._mainFrame}_processCachedResources(e,t,n){t&&this._addFramesRecursively(e,t,t.frame.parentId,n),e.Page.on("frameAttached",i=>{this._frameAttached(e,n,i.frameId,i.parentFrameId)}),e.Page.on("frameNavigated",i=>{this._frameNavigated(e,n,i.frame)}),e.Page.on("frameDetached",i=>{this._frameDetached(e,n,i.frameId)})}_addFrame(e,t,n){let i=new HP(this,e,t,n);return this._frames.set(i.id,i),i.isMainFrame()&&(this._mainFrame=i),this._onFrameAddedEmitter.fire(i),i}_frameAttached(e,t,n,i){let o=this._frames.get(n);return o||(o=this._addFrame(e,n,i)),o._ref(t),o}_frameNavigated(e,t,n){let i=this._frames.get(n.id);i||(i=this._frameAttached(e,t,n.id,n.parentId)),i._navigate(n,t),this._onFrameNavigatedEmitter.fire(i)}_frameDetached(e,t,n){let i=this._frames.get(n);i&&i._unref(t)}frameForId(e){return this._frames.get(e)}frames(){return Array.from(this._frames.values())}_addFramesRecursively(e,t,n,i){let o=t.frame,s=this._frames.get(o.id);s?(s._navigate(o,i),this._onFrameNavigatedEmitter.fire(s)):(s=this._addFrame(e,o.id,n),s._navigate(o,i));for(let a=0;t.childFrames&&a<t.childFrames.length;++a)this._addFramesRecursively(e,t.childFrames[a],s.id,i)}},HP=class{constructor(e,t,n,i){this._targets=new Set;this.cdp=t,this.model=e,this._parentFrameId=i,this.id=n,this._url=""}_ref(e){this._targets.add(e)}_navigate(e,t){this._name=e.name,this._url=e.url,this._securityOrigin=e.securityOrigin,this._unreachableUrl=e.unreachableUrl||"",this._ref(t),this._unrefChildFrames(t)}name(){return this._name||""}url(){return this._url}securityOrigin(){return this._securityOrigin}unreachableUrl(){return this._unreachableUrl}isMainFrame(){return!this._parentFrameId}parentFrame(){return this._parentFrameId?this.model.frameForId(this._parentFrameId):void 0}childFrames(){return this.model.frames().filter(e=>e._parentFrameId===this.id)}_unrefChildFrames(e){for(let t of this.childFrames())t._unref(e)}_unref(e){this._targets.delete(e),!this._targets.size&&(this._unrefChildFrames(e),this.model._frames.delete(this.id),this.model._onFrameRemovedEmitter.fire(this))}displayName(){return this._name?this._name:Pne(this._url)||`<iframe ${this.id}>`}};function $P(r,e){return r.length<=e?r:r.substr(0,e-1)+"\u2026"}function Pne(r){let e;try{e=new Dq.URL(r)}catch{return $P(r,20)}if(e.protocol==="data")return $P(r,20);if(e.protocol==="blob"||r==="about:blank")return r;let t=Aq.basename(e.pathname);return t||(t=(e.host||"")+"/"),t==="/"&&(t=$P(r,20)),t}var Oq=require("url");var GP=class{constructor(e){this.versions=new Map;this.id=e.registrationId,this.scopeURL=e.scopeURL}},zP=class{constructor(e,t){this.revisions=[];this.registration=e,this.id=t.versionId,this.scriptURL=t.scriptURL,this._targetId=t.targetId,this._status=t.status,this._runningStatus=t.runningStatus}addRevision(e){this._targetId&&e.targetId&&this._targetId!==e.targetId&&console.error(`${this._targetId} !== ${e.targetId}`),e.targetId&&(this._targetId=e.targetId),this._status=e.status,this._runningStatus=e.runningStatus,this.revisions.unshift(e)}status(){return this._status}runningStatus(){return this._runningStatus}targetId(){return this._targetId}label(){let e=new Oq.URL(this.registration.scopeURL),t=e.pathname.substr(1);t.endsWith("/")&&(t=t.substring(0,t.length-1));let n=t||`${e.host}`,i=this._status==="activated"?"":` ${this._status}`,o=this._runningStatus==="running"?"":` ${this._runningStatus}`;return`${n} #${this.id}${i}${o}`}},Fv=class r{constructor(e){this._registrations=new Map;this._versions=new Map;this._onDidChangeUpdater=new O;this.onDidChange=this._onDidChangeUpdater.event;this._targets=new Set;this._frameModel=e,r._instances.add(this)}static{this._instances=new Set}dispose(){r._instances.delete(this)}attached(e){this._targets.add(e),!this._cdp&&(this._cdp=e,e.ServiceWorker.enable({}),e.ServiceWorker.on("workerRegistrationUpdated",t=>this._workerRegistrationsUpdated(t.registrations)),e.ServiceWorker.on("workerVersionUpdated",t=>this._workerVersionsUpdated(t.versions)),r._mode!=="normal"&&this.setMode(r._mode))}async detached(e){this._targets.delete(e)}version(e){return this._versions.get(e)}registrations(){let e=[],t=this._frameModel.frames().map(n=>n.url());for(let n of this._registrations.values())for(let i of t)if(i.startsWith(n.scopeURL)){e.push(n);break}return e}registration(e){return this._registrations.get(e)}_workerVersionsUpdated(e){for(let t of e){let n=this._registrations.get(t.registrationId);if(!n)continue;let i=n.versions.get(t.versionId);i||(i=new zP(n,t),n.versions.set(t.versionId,i)),t.targetId&&this._versions.set(t.targetId,i),i.addRevision(t),i.status()==="redundant"&&i.runningStatus()==="stopped"&&(t.targetId&&this._versions.delete(t.targetId),n.versions.delete(i.id))}this._onDidChangeUpdater.fire()}_workerRegistrationsUpdated(e){for(let t of e)if(t.isDeleted){if(!this._registrations.has(t.registrationId))debugger;this._registrations.delete(t.registrationId)}else{if(this._registrations.has(t.registrationId))return;this._registrations.set(t.registrationId,new GP(t))}this._onDidChangeUpdater.fire()}static setModeForAll(e){r._mode=e;for(let t of r._instances)t.setMode(e)}setMode(e){if(this._cdp){this._cdp.ServiceWorker.setForceUpdateOnPageLoad({forceUpdateOnPageLoad:e==="force"});for(let t of this._targets.values())e==="bypass"?(t.Network.enable({}),t.Network.setBypassServiceWorker({bypass:!0})):t.Network.disable({})}}async stopWorker(e){if(!this._cdp)return;let t=this.version(e);t&&await this._cdp.ServiceWorker.stopWorker({versionId:t.id})}};var Ln=class{constructor(e,t,n,i,o,s,a,c){this.process=t;this.logger=o;this.telemetry=s;this.launchParams=a;this._targets=new Map;this._detachedTargets=new Set;this.frameModel=new Nv;this.serviceWorkerModel=new Fv(this.frameModel);this._lifecycleQueue=Promise.resolve();this._onTargetAddedEmitter=new O;this._onTargetRemovedEmitter=new O;this.onTargetAdded=this._onTargetAddedEmitter.event;this.onTargetRemoved=this._onTargetRemovedEmitter.event;this._connection=e,this._sourcePathResolver=i,this._browser=n,this._targetOrigin=c,this.serviceWorkerModel.onDidChange(()=>{for(let u of this._targets.values())u.type()==="service_worker"&&u._onNameChangedEmitter.fire()})}static async connect(e,t,n,i,o,s,a){let u=await e.rootSession().Target.attachToBrowserTarget({});if(!u)return;let l=e.createSession(u.sessionId);return new this(e,t,l,n,o,s,i,a)}dispose(){this.serviceWorkerModel.dispose()}targetList(){return Array.from(this._targets.values()).filter(e=>Xd.has(e.type()))}async getCandiateInfo(e){let t=await this._browser.Target.getTargets({});return t?e?t.targetInfos.filter(e):t.targetInfos:[]}async closeBrowser(){if(this.launchParams.request==="launch"){if(this.launchParams.cleanUp==="wholeBrowser")await this._browser.Browser.close({}),this.process?.kill();else for(let e of this._targets.values())await this._browser.Target.closeTarget({targetId:e.targetId}),this._connection.close();this.process=void 0}}waitForMainTarget(e){let t,n=new Promise(o=>t=o),i=async o=>{if([...this._targets.values()].some(c=>c.targetId===o.targetId)||this._detachedTargets.has(o.targetId)||e&&!e(o))return;let s=this._browser.Target.on("targetInfoChanged",c=>{c.targetInfo.targetId===o.targetId&&(o=c.targetInfo)}),a;try{a=await this._browser.Target.attachToTarget({targetId:o.targetId,flatten:!0})}finally{s.dispose()}if(!a){t(void 0);return}t(this.attachedToTarget(o,a.sessionId,!0))};return this._browser.Target.setDiscoverTargets({discover:!0}),this._browser.Target.on("targetCreated",this.enqueueLifecycleFn(o=>i(o.targetInfo))),this._browser.Target.on("targetInfoChanged",o=>this._targetInfoChanged(o.targetInfo,this.enqueueLifecycleFn(i))),this._browser.Target.on("detachedFromTarget",this.enqueueLifecycleFn(async o=>{o.targetId&&await this._detachedFromTarget(o.sessionId,!1)})),n}enqueueLifecycleFn(e){return t=>this._lifecycleQueue=this._lifecycleQueue.then(()=>e(t))}attachedToTarget(e,t,n,i,o=!0){let s=this._targets.get(t);if(s)return s;let a=this._connection.createSession(t),c=new Jg(this,e,a,i,n,this.launchParams,t,this.logger,()=>{this._connection.disposeSession(t),this._detachedFromTarget(t)});this._targets.set(t,c),i&&i._children.set(e.targetId,c),a.Target.on("attachedToTarget",async l=>{this.attachedToTarget(l.targetInfo,l.sessionId,l.waitingForDebugger,c)}),a.Target.on("detachedFromTarget",async l=>{l.targetId&&this._detachedFromTarget(l.sessionId,!1)}),a.Target.setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:o,flatten:!0}),a.Network.setCacheDisabled({cacheDisabled:this.launchParams.disableNetworkCache}).catch(l=>this.logger.info("runtime.target","Error setting network cache state",l)),i||this.retrieveBrowserTelemetry(a);let u=e.type;return Kg.has(u)&&this.frameModel.attached(a,e.targetId),this.serviceWorkerModel.attached(a),this._onTargetAddedEmitter.fire(c),!Xd.has(u)||u==="service_worker"?c.runIfWaitingForDebugger():u==="page"&&o&&!e.canAccessOpener&&a.Page.waitForDebugger({}),c}async retrieveBrowserTelemetry(e){try{let t=await e.Browser.getVersion({});if(!t)throw new Error("Undefined return from getVersion()");let n={targetCRDPVersion:t.protocolVersion,targetRevision:t.revision,targetUserAgent:t.userAgent,targetV8:t.jsVersion,targetVersion:"",targetProject:"",targetProduct:""};this.logger.verbose("runtime.target","Retrieved browser information",t);let i=(t.product||"").split("/");i.length===2?(n.targetProject=i[0],n.targetVersion=i[1]):n.targetProduct=t.product,this.telemetry.report("browserVersion",n)}catch(t){this.logger.warn("runtime.target","Error getting browser telemetry",t)}}async _detachedFromTarget(e,t=!0){let n=this._targets.get(e);if(n){this._targets.delete(e),n.parentTarget?._children.delete(e);try{await n._detached()}catch{}if(this._onTargetRemovedEmitter.fire(n),t&&(this._detachedTargets.add(n.targetId),await this._browser.Target.detachFromTarget({sessionId:e})),!this._targets.size&&this.launchParams.request==="launch")try{this.launchParams.cleanUp==="wholeBrowser"?await this._browser.Browser.close({}):(await this._browser.Target.closeTarget({targetId:n.id()}),this._connection.close())}catch{}}}async _targetInfoChanged(e,t){let n=[...this._targets.values()].filter(i=>i.targetId===e.targetId);if(!e.attached||!n.length)return n.length&&await Promise.all(n.map(i=>this._detachedFromTarget(i.sessionId,!1))),t(e);for(let i of n)i._updateFromInfo(e);for(let i of this._targets.values())i.targetId!==e.targetId&&i._onNameChangedEmitter.fire()}};var zq=b(require("child_process")),Kq=require("fs");var Ene=50,Ir=class r{constructor(e){this.messageEmitter=new O;this.endEmitter=new O;this.onMessage=this.messageEmitter.event;this.onEnd=this.endEmitter.event;this._ws=e,this._ws.addEventListener("message",t=>{this.messageEmitter.fire([t.data.toString("utf-8"),new Mr])}),this._ws.addEventListener("close",()=>{this.endEmitter.fire(),this._ws=void 0}),this._ws.addEventListener("error",()=>{})}static async create(e,t,n){let i=!e.startsWith("ws://"),o=await Pu(e);for(;;){let s=Date.now()+Ene;try{let a={headers:{host:n??"localhost"},perMessageDeflate:!1,maxPayload:268435456,rejectUnauthorized:!(i&&o),followRedirects:!0},c=new CN(e,[],a);return await Ji(new Promise((u,l)=>{c.addEventListener("open",()=>u(new r(c))),c.addEventListener("error",p=>{let d=e===c.url?e:c.url.replace(/^http(s?):/,"ws$1:");if(d===e){l(p.error);return}this.create(d,t,n).then(u,l)})}),Rt.withTimeout(2e3,t).token,`Could not open ${e}`).catch(u=>{throw c.close(),u})}catch(a){if(t.isCancellationRequested)throw a;let c=s-Date.now();c>0&&await le(c)}}}send(e){this._ws?.send(e)}dispose(){return new Promise(e=>{if(!this._ws)return e();this._ws.addEventListener("close",()=>e()),this._ws.close()})}};var Bv=b(require("path"));function kne(r){let e=[/^APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL$/i,/^ELECTRON_.+$/i,/^GOOGLE_API_KEY$/i,/^VSCODE_.+$/i,/^SNAP(|_.*)$/i,/^GDK_PIXBUF_.+$/i];return new Tt(r).map((t,n)=>e.some(i=>i.test(t))?void 0:n)}var Tt=class r{constructor(e){this.defined=ne(()=>eu(this.value));this.value=e?zE(e):{}}static{this.platform=process.platform}static{this.empty=new r({})}static{this.processEnv=ne(()=>kne(process.env))}lookup(e){return r.platform==="win32"?YE(this.value,e):this.value[e]}addToPath(e,t="append",n=!1){let i=r.platform==="win32"?"Path":"PATH",o=r.platform==="win32"?Bv.win32.delimiter:Bv.posix.delimiter,s=this.lookup(i);return n&&!s&&(s=`\${env:${i}}`),s?t==="append"?s=s+o+e:s=e+o+s:s=e,this.update(i,s)}addNodeOption(e){let t=this.lookup("NODE_OPTIONS");return this.update("NODE_OPTIONS",t?`${t} ${e}`:e)}update(e,t){return r.merge(this,{[e]:t})}merge(...e){return r.merge(this,...e)}map(e){return new r(go(this.value,(t,n)=>e(n,t)))}static merge(...e){let t=e.map(i=>i instanceof r?i.value:i),n=r.platform==="win32"?JE(...t):Object.assign({},...t);return new r(n)}};var Lq=require("child_process");var uh=class r extends Error{constructor(t,n,i,o,s){super(`${t} exited with code ${o||-1}: ${n}`);this.command=t;this.stderr=n;this.stdout=i;this.code=o;this.innerError=s}static fromExeca(t){return new r(t.command,t.stderr.toString(),t.stdout.toString(),t.exitCode)}};function jv(r,e,t){return new Promise((n,i)=>{let o=lh(r,e,t?.cwd),s=(0,Lq.spawn)(o.executable,o.args,{...t,cwd:o.cwd,shell:o.shell,stdio:"pipe"}),a=[],c=[];s.stderr.on("data",l=>a.push(l)),s.stdout.on("data",l=>c.push(l));let u=(l,p)=>i(new uh(r,Buffer.concat(a).toString(),Buffer.concat(c).toString(),l,p));s.on("error",l=>u(void 0,l)),s.on("close",l=>l?u(l):n({stdout:Buffer.concat(c).toString(),stderr:Buffer.concat(a).toString()}))})}var Rne=/\.(bat|cmd)$/i,lh=(r,e,t)=>(process.platform==="win32"&&(r=Po(r),t&&(t=Po(t.toString())),r.endsWith(".ps1")&&(e=["-File",r,...e],r="powershell.exe")),process.platform!=="win32"||!Rne.test(r)?{executable:r,args:e,shell:!1,cwd:t}:{executable:`"${r}"`,args:e.map(n=>n.includes(" ")?`"${n}"`:n),shell:!0,cwd:t});var Mq=r=>{let e={};for(let t of r){let n=t.indexOf("=");n===-1?e[t]=null:e[t.slice(0,n)]=t.slice(n+1)}return e},ph=r=>{let e=[];for(let t of Object.keys(r)){let n=r[t];n!==void 0&&e.push(n===null?t:`${t}=${n}`)}return e},Vl=class r{constructor(e=[]){this.args=e;this.argMap=ne(()=>Mq(this.args))}add(e,t=null){return this.newThis(ph({...this.argMap(),[e]:t}))}get(e){let t=this.argMap();return t.hasOwnProperty(e)?t[e]:void 0}remove(e){return this.newThis(ph({...this.argMap(),[e]:void 0}))}merge(e){return this.newThis(ph({...this.argMap(),...e instanceof r?e.argMap():Mq(e)}))}filter(e){let t=this.argMap(),n=[];for(let i of Object.keys(t)){let o=t[i];e(i,o)&&n.push(o===null?i:`${i}=${o}`)}return this.newThis(n)}toArray(){return this.args.slice()}newThis(e){return new this.constructor(e)}};var Nq="--remote-debugging-port",Fq="--remote-debugging-pipe",Ys=class r extends Vl{static{this.default=new r(["--disable-background-networking","--disable-background-timer-throttling","--disable-backgrounding-occluded-windows","--disable-breakpad","--disable-client-side-phishing-detection","--disable-default-apps","--disable-dev-shm-usage","--disable-renderer-backgrounding","--disable-sync","--metrics-recording-only","--no-first-run","--no-default-browser-check"])}setConnection(e){return new r(ph({...this.argMap(),[Fq]:e==="pipe"?null:void 0,[Nq]:e!=="pipe"?String(e):void 0}))}getSuggestedConnection(){let e=this.argMap();if(e.hasOwnProperty(Fq))return"pipe";let t=e[Nq];if(t!==void 0)return t&&Number(t)||0}};var KP=require("url");function Uv(r,e,t){let n=yo(s=>{if(s)return new KP.URL(s);throw new Error(`A valid url wasn't supplied: <${s}>`)}),i={"url.hostname":()=>{let s=n(e).hostname;return s.endsWith(".localhost")?"localhost":s},"url.port":()=>n(e).port,browserInspectUri:()=>encodeURIComponent(t),browserInspectUriPath:()=>new KP.URL(t).pathname,wsProtocol:()=>n(e).protocol==="https:"?"wss":"ws"};return r.replace(/{([^\}]+)}/g,(s,a)=>i.hasOwnProperty(a)?i[a]():s)}var $q=b(require("readline"));var Bq=require("stream"),Xs=class extends Bq.Transform{constructor(t){super();this.prefix=[];this.splitSuffix=Buffer.alloc(0);if(typeof t=="string"&&t.length===1)this.splitter=t.charCodeAt(0);else if(typeof t=="number")this.splitter=t;else throw new Error("not implemented here")}_transform(t,n,i){let o=0;for(;o<t.length;){let s=t.indexOf(this.splitter,o);if(s===-1)break;let a=t.subarray(o,s),c=this.prefix.length||this.splitSuffix.length?Buffer.concat([...this.prefix,a,this.splitSuffix]):a;this.push(c),this.prefix.length=0,o=s+1}o<t.length&&this.prefix.push(t.subarray(o)),i()}_flush(t){this.prefix.length&&this.push(Buffer.concat([...this.prefix,this.splitSuffix])),t()}};var to=class{constructor(e,t,n){this.logger=e;this.pipeWrite=t;this.pipeRead=n;this.messageEmitter=new O;this.endEmitter=new O;this.onMessage=this.messageEmitter.event;this.onEnd=this.endEmitter.event;this.onceEnded=ne(()=>{this.streams&&(this.beforeClose(),this.streams.read.removeAllListeners(),this.pipeRead?.destroy(),this.streams.write.removeListener("end",this.onceEnded),this.streams.write.removeListener("error",this.onWriteError),this.streams.write.on("error",()=>{}),this.streams.write.end(),this.streams=void 0,this.endEmitter.fire())});this.onWriteError=e=>{this.logger.error("internal","pipeWrite error",{error:e})};let i=n||t;this.streams={read:i.on("error",o=>this.logger.error("internal","pipeRead error",{error:o})).pipe(new Xs(0)).on("data",o=>this.messageEmitter.fire([o.toString(),new Mr])).on("end",this.onceEnded),write:t.on("end",this.onceEnded).on("error",this.onWriteError)}}send(e){this.streams?.write.write(e+"\0")}dispose(){this.onceEnded()}beforeClose(){}};var Qs=class{constructor(e,t,n){this.pid=e;this.onExit=t;this.updateInterval(n)}dispose(){clearInterval(this.timer)}updateInterval(e=200){this.timer&&clearInterval(this.timer),this.timer=setInterval(()=>{Ane(this.pid)||(this.onExit(!0),this.dispose())},e)}};function Ane(r){try{return process.kill(r,0),!0}catch{return!1}}var qv=require("child_process"),JP=require("path");function ni(r,e,t="forceful"){if(t==="none")return!0;if(process.platform==="win32"){let n=process.env.WINDIR||"C:\\Windows",i=(0,JP.join)(n,"System32","taskkill.exe");try{return(0,qv.execSync)(`${i} ${t==="forceful"?"/F":""} /T /PID ${r}`,{stdio:"pipe"}),!0}catch(o){return e.error("runtime.exception","Error running taskkill.exe",o),!1}}else try{let n=(0,JP.join)(__dirname,"./targets/node/terminateProcess.sh"),i=(0,qv.spawnSync)("sh",[n,r.toString(),t==="forceful"?"9":"15"]);return i.stderr&&i.status?(e.error("runtime.exception","Error running terminateProcess",i),!1):!0}catch(n){return e.error("runtime.exception","Error running terminateProcess",n),!1}}var Wq=require("fs");async function YP(r,e,t,n,i){let o=new Hs(Wq.promises),[s,a]=await Promise.all([Uq(o,new URL("/json/version",r),e,i),n?Uq(o,new URL("/json/list",r),e,i):Promise.resolve(void 0)]);if(!s.ok)t.verbose("runtime.launch","Error looking up /json/version",s);else if(s.body.webSocketDebuggerUrl){let c=qq(s.url,s.body.webSocketDebuggerUrl);return t.verbose("runtime.launch","Discovered target URL from /json/version",{url:s.body.webSocketDebuggerUrl,fixed:c}),c}if(a)if(!a.ok)t.verbose("runtime.launch","Error looking up /json/list",a);else{let c=qq(a.url,a.body[0].webSocketDebuggerUrl);return t.verbose("runtime.launch","Discovered target URL from /json/list",{url:a.body[0].webSocketDebuggerUrl,fixed:c}),c}throw new Error("Could not find any debuggable target")}async function Uq(r,e,t,n){if(e.hostname!=="localhost")return r.fetchJson(e.toString(),t,{host:n??"localhost"});e.hostname="127.0.0.1";let i=e.toString();e.hostname="[::1]";let o=e.toString(),s=new Rt(t);try{let a;return await Ai([i,o].map(async u=>(a=await r.fetchJson(u,s.token),a.ok&&a)))||a}finally{s.cancel()}}var Vq=r=>async(e,t,n,i)=>{for(;;)try{return await YP(e,t,n,r,i)}catch(o){if(t.isCancellationRequested)throw new Error(`Could not connect to debug target at ${e}: ${o.message}`);await le(200)}},$l=Vq(!0),Wv=Vq(!1);function qq(r,e){let t=new URL(r),n=new URL(e);return n.host=t.host,n.toString()}var XP=async(r,e,t,n)=>{let i=t.connection===0?await Dne(e,n):await Wv(`http://localhost:${t.connection}`,n,r),o=t.inspectUri?Uv(t.inspectUri,t.url,i):i;for(;;)try{return await Ir.create(o,n)}catch(s){if(n.isCancellationRequested)throw s;await le(200)}},Vv=class{constructor(e){this.logger=e;this.pid=void 0;this.onExit=new O().event;this.onError=new O().event}async transport(e,t){return XP(this.logger,this,e,t)}kill(){}},$v=class{constructor(e,t){this.pid=e;this.logger=t;this.stderr=void 0;this.stdout=void 0;this.exitEmitter=new O;this.onExit=this.exitEmitter.event;this.errorEmitter=new O;this.onError=this.errorEmitter.event;this.liveness=new Qs(e,()=>this.exitEmitter.fire(0),1e3)}async transport(e,t){return XP(this.logger,this,e,t)}kill(){try{process.kill(this.pid)}catch{}this.liveness.updateInterval(200)}},Hv=class{constructor(e,t,n){this.cp=e;this.logger=t;this.killBehavior=n;this.pid=void 0;this.exitEmitter=new O;this.onExit=this.exitEmitter.event;this.errorEmitter=new O;this.onError=this.errorEmitter.event;e.on("exit",i=>this.exitEmitter.fire(i||0)),e.on("error",i=>this.errorEmitter.fire(i))}get stderr(){return this.cp.stderr}get stdio(){return this.cp.stdio}async transport(e,t){return e.connection==="pipe"?new to(this.logger,this.cp.stdio[3],this.cp.stdio[4]):XP(this.logger,this,e,t)}kill(){ni(this.cp.pid,this.logger,this.killBehavior)}};function Dne(r,e){if(!r.stderr)throw new Error("Cannot wait for a websocket for a target that lacks stderr");return new Promise((t,n)=>{let i=$q.createInterface({input:r.stderr}),o="",s=()=>u();i.on("line",l),i.on("close",s);let a=new pe([r.onExit(()=>u()),r.onError(u)]),c=e.onCancellationRequested(()=>{p(),n(new tn(`Timed out after ${c} ms while trying to connect to the browser!`))});function u(d){p(),n(new Error(["Failed to launch browser!"+(d?" "+d.message:""),o,"","TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md",""].join(`
`)))}function l(d){o+=d+`
`;let f=d.match(/^DevTools listening on (ws:\/\/.*)$/);f&&(p(),t(f[1]))}function p(){c.dispose(),i.removeListener("line",l),i.removeListener("close",s),a.dispose()}})}async function Hq(r,e,t,n){let i=r.launchUnelevatedRequest({process:e,args:t});return await Ji(i,n,"Could not launch browser unelevated")}var Gq=()=>{};async function Jq(r,e,t,n,i,o,s={}){let{onStderr:a=Gq,onStdout:c=Gq,args:u=[],dumpio:l=!1,cwd:p=process.cwd(),env:d=Tt.empty,connection:f="pipe",cleanUp:h="wholeBrowser",url:m,killBehavior:y="forceful",inspectUri:I}=s,L=new Ys(u),P=L.getSuggestedConnection();s.includeLaunchArgs!==!1?(L=QP(L,s),P===void 0&&(L=L.setConnection(f),P=f)):P===void 0&&(P="pipe");let W=["pipe","pipe","pipe"];P==="pipe"&&(l?W=["ignore","pipe","pipe","pipe","pipe"]:W=["ignore","ignore","ignore","pipe","pipe"]);let E,M=!!(i.supportsLaunchUnelevatedProcessRequest&&s.launchUnelevated);if(M&&typeof P=="number"&&P!==0){let j=await Hq(r,e,L.toArray(),o);E=j.pid?new $v(j.pid,t):new Vv(t)}else{t.info("runtime.launch",`Launching Chrome from ${e}`);let j=lh(e,L.toArray(),await Io(Kq.promises,p)?p:process.cwd()),Z=zq.spawn(j.executable,j.args,{detached:!0,env:d.defined(),shell:j.shell,cwd:j.cwd,stdio:W});if(Z.pid===void 0)throw await Promise.race([le(1e3).then(()=>new Error("Unable to launch the executable (undefined pid)")),new Promise(he=>Z.once("error",he))]);E=new Hv(Z,t,y)}l?(E.stderr?.on("data",j=>a(j.toString())),E.stdout?.on("data",j=>c(j.toString()))):(E.stderr?.resume(),E.stdout?.resume());let k=()=>{h==="wholeBrowser"&&E.kill()};process.on("exit",k),E.onExit(()=>process.removeListener("exit",k));try{if(s.promisedPort){let j;P=await Promise.race([s.promisedPort,new Promise((Z,he)=>{j=E.onExit(A=>{he(new F(E1(A)))})})]).finally(()=>j.dispose())}return{process:E,canReconnect:typeof P=="number"&&!M,createConnection:async j=>{let Z=await E.transport({connection:P,inspectUri:I||void 0,url:m||void 0},j);return new rt(Z,t,n)}}}catch(j){throw E.kill(),j}}function QP(r,e={}){let{userDataDir:t=null,ignoreDefaultArgs:n=!1}=e,i=n===!0?new Ys:Ys.default;return n instanceof Array&&(i=i.filter(o=>!n.includes(o))),t&&(i=i.add("--user-data-dir",t)),i=i.merge(r),r.toArray().every(o=>o.startsWith("-"))&&e.hasUserNavigation&&(i=i.add("about:blank")),i}async function Yq(r,e,t,n){let{browserWSEndpoint:i,browserURL:o}=r;if(i){let s=await Ir.create(i,e);return new rt(s,t,n)}else if(o){let s=await Wv(o,e,t),a=r.inspectUri?Uv(r.inspectUri,r.pageURL,s):s,c=await Ir.create(a,e);return new rt(c,t,n)}throw new Error("Either browserURL or browserWSEndpoint needs to be specified")}var Mn=class{constructor(e,t,n){this.logger=e;this.pathResolver=t;this.vscode=n;this._disposables=[];this._onTerminatedEmitter=new O;this.onTerminated=this._onTerminatedEmitter.event;this._onTargetListChangedEmitter=new O;this.onTargetListChanged=this._onTargetListChangedEmitter.event;this.closeWhenTargetsEmpty=!0}dispose(){for(let e of this._disposables)e.dispose();this._disposables=[],this._attemptTimer&&clearTimeout(this._attemptTimer),this._targetManager&&this._targetManager.dispose()}resolveParams(e){return e.request==="attach"&&(e.type==="pwa-chrome"||e.type==="pwa-msedge"&&typeof e.useWebView!="object")&&e.browserAttachLocation==="workspace"}async launch(e,t){return this.resolveParams(e)?(this._lastLaunchParams={...e,timeout:1/0},await this.attemptToAttach(this._lastLaunchParams,t),{blockSessionTermination:!0}):{blockSessionTermination:!1}}_scheduleAttach(e,t){this._attemptTimer=setTimeout(()=>{this._attemptTimer=void 0,this.attemptToAttach(e,{...t,cancellationToken:jt})},1e3)}createTargetManager(e,t,n){return Ln.connect(e,void 0,this.pathResolver,t,this.logger,n.telemetryReporter,n.targetOrigin)}async attemptToAttach(e,t){let n=await this.acquireConnectionForBrowser(t,e);this._connection=n,n.onDisconnected(()=>{this._connection=void 0,this._targetManager&&(this._targetManager.dispose(),this._targetManager=void 0,this._onTargetListChangedEmitter.fire()),this._lastLaunchParams===e&&e.restart?this._scheduleAttach(e,t):this._onTerminatedEmitter.fire({killed:!0,code:0})},void 0,this._disposables);let i=this._targetManager=await this.createTargetManager(n,e,t);if(!i)return;i.serviceWorkerModel.onDidChange(()=>this._onTargetListChangedEmitter.fire()),i.frameModel.onFrameNavigated(()=>this._onTargetListChangedEmitter.fire()),i.onTargetAdded(()=>{this._onTargetListChangedEmitter.fire()}),i.onTargetRemoved(()=>{this._onTargetListChangedEmitter.fire(),!i.targetList().length&&this.closeWhenTargetsEmpty&&(this._onTerminatedEmitter.fire({killed:!0,code:0}),this._connection?.close())});let o=await Promise.race([i.waitForMainTarget(await this.getTargetFilter(i,e)),le(e.timeout).then(()=>{throw new F(Og())})]);return typeof o=="string"?o:void 0}async getTargetFilter(e,t){let n=bs(t),i=Bi(n);if(t.targetSelection!=="pick")return i;let o=await e.getCandiateInfo(i);if(o.length===0)return i;if(o.length===1||!this.vscode)return c=>c.targetId===o[0].targetId;let s=Gv.t("Select a tab"),a=await this.vscode.window.showQuickPick(o.map(c=>({label:c.title,detail:c.url,targetId:c.targetId})),{matchOnDescription:!0,matchOnDetail:!0,placeHolder:s});return a?c=>c.targetId===a.targetId:i}async acquireConnectionForBrowser({telemetryReporter:e,cancellationToken:t},n){for(;this._lastLaunchParams===n;)try{return await this.acquireConnectionInner(e,n,t)}catch(i){if(t.isCancellationRequested)throw new F(Di(Gv.t("Cannot connect to the target at {0}: {1}",`${n.address}:${n.port}`,i.message)));await le(1e3)}throw new F(Di(Gv.t("Cannot connect to the target at {0}: {1}",`${n.address}:${n.port}`,"Cancelled")))}async acquireConnectionInner(e,t,n){let i=`http://${t.address}:${t.port}`;return await Yq({browserURL:i,inspectUri:t.inspectUri,pageURL:t.url},n,this.logger,e)}async terminate(){this._lastLaunchParams=void 0,this._connection?.close()}async restart(){if(this._targetManager)for(let e of this._targetManager.targetList())e.type()==="page"&&!e.name().startsWith("devtools://")&&e.restart()}targetList(){let e=this._targetManager;return e?e.targetList():[]}};Mn=S([(0,Zs.injectable)(),g(0,(0,Zs.inject)($)),g(1,(0,Zs.inject)(Re)),g(2,(0,Zs.optional)()),g(2,(0,Zs.inject)(Ft))],Mn);var ii=b(N());var Qq=b(F_()),Zq=b(ie()),dh=b(require("fs")),ea=b(N()),Hl=b(require("path"));var ro=class{constructor(e,t,n,i,o){this.storagePath=e;this.logger=t;this.pathResolver=n;this.initializeParams=i;this.fs=o;this._disposables=new pe;this._onTerminatedEmitter=new O;this.onTerminated=this._onTerminatedEmitter.event;this._onTargetListChangedEmitter=new O;this.onTargetListChanged=this._onTargetListChangedEmitter.event;this._terminatedCts=new Rt}dispose(){this._disposables.dispose()}async launchBrowser({runtimeExecutable:e,trace:t,includeDefaultArgs:n,includeLaunchArgs:i,runtimeArgs:o,userDataDir:s,env:a,cwd:c,port:u,url:l,file:p,inspectUri:d,webRoot:f,cleanUp:h,launchUnelevated:m,killBehavior:y},I,L,P,W){let E=await this.findBrowserPath(e||"stable"),M;return typeof s=="string"?M=Hl.resolve(s):s&&(M=Hl.resolve(Hl.join(this.storagePath,o?.includes("--headless")?".headless-profile":".profile"))),dh.mkdirSync(this.storagePath,{recursive:!0}),M&&(dh.mkdirSync(M,{recursive:!0}),M=dh.realpathSync(M)),await Jq(I,E,this.logger,P,this.initializeParams,L,{onStdout:k=>I.output({category:"stdout",output:k}),onStderr:k=>I.output({category:"stderr",output:k}),dumpio:typeof t=="boolean"?t:t.stdio,cleanUp:h,hasUserNavigation:!!(l||p),cwd:c||f||void 0,env:Tt.merge(Tt.processEnv(),a),args:o||[],userDataDir:M,connection:u||(d?0:"pipe"),launchUnelevated:m,ignoreDefaultArgs:!n,includeLaunchArgs:i,killBehavior:y,url:l,inspectUri:d,promisedPort:W})}getFilterForTarget(e){return Bi(bs(e,["about:blank"]))}async doLaunch(e,t){let n;try{n=await this.launchBrowser(e,t.dap,t.cancellationToken,t.telemetryReporter)}catch(u){throw new F(us(u))}let i=new Rt(this._terminatedCts.token);n.process.onExit(()=>this.fireTerminatedEvent());let o=()=>n.canReconnect&&!i.token.isCancellationRequested,s=async u=>{if(this._targetManager?.dispose(),this._targetManager=void 0,this._onTargetListChangedEmitter.fire(),o()&&(await le(1e3),o())){t.dap.output({category:"stderr",output:Zq.t("Browser connection failed, will retry: {0}",u?.message||"Connection closed")});try{return await le(2e3),await a()}catch{}}n.process.kill(),this.fireTerminatedEvent()},a=async()=>{if(!i.token.isCancellationRequested)try{let u=await n.createConnection(i.token),l=await this.launchCdp(e,n,u,{...t,cancellationToken:i.token});await this.finishLaunch(l,e),u.onDisconnected(()=>s())}catch(u){if(o())return s(u);throw n.process.kill(),new F(us(u))}},c=t.cancellationToken.onCancellationRequested(()=>i.cancel());try{await a()}finally{c.dispose()}}async launchCdp(e,t,n,i){if(this._connectionForTest=n,this._targetManager=await Ln.connect(n,t.process,this.pathResolver,e,this.logger,i.telemetryReporter,i.targetOrigin),!this._targetManager)throw new F(Di());this._targetManager.serviceWorkerModel.onDidChange(()=>this._onTargetListChangedEmitter.fire()),this._targetManager.frameModel.onFrameNavigated(()=>this._onTargetListChangedEmitter.fire()),this._disposables.push(this._targetManager),this._targetManager.onTargetAdded(()=>{this._onTargetListChangedEmitter.fire()}),this._targetManager.onTargetRemoved(()=>{this._onTargetListChangedEmitter.fire()});let o=this.getFilterForTarget(e),s=await Ji(this._targetManager.waitForMainTarget(o),i.cancellationToken,"Could not attach to main target");if(!s)throw new F(Og());return s}async finishLaunch(e,t){if("skipNavigateForTest"in t)return;let n;if(t.file){let i=Hl.resolve(t.webRoot||t.rootPath||"",t.file),o=Math.min(i.includes("#")?i.indexOf("#"):1/0,i.includes("?")?i.indexOf("?"):1/0);isFinite(o)&&!await br(this.fs,i)?n=Ae(i.slice(0,o))+i.slice(o):n=Ae(i)}else n=t.url;n&&await e.cdp().Page.navigate({url:n})}async launch(e,t){let n=this.resolveParams(e);return n?(await this.doLaunch(n,t),{blockSessionTermination:!0}):{blockSessionTermination:!1}}async terminate(){this._targetManager?await this._targetManager.closeBrowser():this.fireTerminatedEvent()}async restart(){for(let e of this.targetList())e.type()==="page"&&e.restart()}async findBrowserByExe(e,t){return t==="*"?(await e.findWhere(i=>i.quality==="stable")||(await e.findAll())[0])?.path:(0,Qq.isQuality)(t)?(await e.findWhere(n=>n.quality===t))?.path:t}targetList(){let e=this._targetManager;return e?e.targetList():[]}connectionForTest(){return this._connectionForTest}fireTerminatedEvent(){this._terminatedCts.token.isCancellationRequested||(this._terminatedCts.cancel(),this._onTerminatedEmitter.fire({code:0,killed:!0}))}};ro=S([(0,ea.injectable)(),g(0,(0,ea.inject)(Gi)),g(1,(0,ea.inject)($)),g(2,(0,ea.inject)(Re)),g(3,(0,ea.inject)(Or)),g(4,(0,ea.inject)(ue))],ro);var Rc=class extends ro{constructor(t,n,i,o,s,a){super(t,n,s,a,o);this.browserFinder=i}resolveParams(t){return t.type==="pwa-chrome"&&t.request==="launch"&&t.browserLaunchLocation==="workspace"?t:void 0}async findBrowserPath(t){let n=await this.findBrowserByExe(this.browserFinder,t);if(!n||!await Io(this.fs,n))throw new F(Dg("Chrome",t,(await this.browserFinder.findAll()).map(i=>i.quality)));return n}};Rc=S([(0,ii.injectable)(),g(0,(0,ii.inject)(Gi)),g(1,(0,ii.inject)($)),g(2,(0,ii.inject)(rc)),g(2,(0,ii.tagged)("browser","chrome")),g(3,(0,ii.inject)(ue)),g(4,(0,ii.inject)(Re)),g(5,(0,ii.inject)(Or))],Rc);var eW=require("crypto"),oi=b(N()),tW=require("net"),rW=require("os"),nW=require("path");var One=["--do-not-de-elevate"],Gl=class extends ro{constructor(t,n,i,o,s,a){super(t,n,s,a,o);this.browserFinder=i}resolveParams(t){return t.type==="pwa-msedge"&&t.request==="launch"&&t.browserLaunchLocation==="workspace"?t:void 0}launchBrowser(t,n,i,o){return super.launchBrowser({...t,runtimeArgs:t.runtimeArgs??One},n,i,o,t.useWebView?this.getWebviewPort(t,o):void 0)}getFilterForTarget(t){return t.useWebView&&t.urlFilter?Bi(bs(t)):super.getFilterForTarget(t)}async getWebviewPort(t,n){let i=ke();if(!t.runtimeExecutable)return i.resolve(t.port),i.promise;let o=t.runtimeExecutable.split(/\\|\//).pop(),s=`VSCode_${(0,eW.randomBytes)(12).toString("base64")}`,a=`\\\\.\\pipe\\WebView2\\Debugger\\${o}\\${s}`,c=(0,tW.createServer)(u=>{u.on("data",async l=>{let p=JSON.parse(l.toString()),d=p.devtoolsActivePort||"",f=parseInt(d.split(`
`).shift()||""),h=t.port||f;i.resolve(h);let m=`ws://${t.address}:${h}/devtools/${p.type}/${p.id}`,y=await Ir.create(m,jt),I=new rt(y,this.logger,n);await I.rootSession().Runtime.runIfWaitingForDebugger({}),I.close()})});return c.on("error",i.reject),c.on("close",()=>i.resolve(t.port)),c.listen(a),t.userDataDir=t.userDataDir||(0,nW.join)((0,rW.tmpdir)(),`vscode-js-debug-userdatadir_${t.port}`),t.env=t.env||{},t.env.WEBVIEW2_USER_DATA_FOLDER=t.userDataDir.toString(),t.env.WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=`--remote-debugging-port=${t.port}`,t.env.WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER="true",t.env.WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER=s,i.promise}async findBrowserPath(t){let n=await this.findBrowserByExe(this.browserFinder,t);if(!n||!await Io(this.fs,n))throw new F(Dg("Edge",t,(await this.browserFinder.findAll()).map(i=>i.quality)));return n}};Gl=S([(0,oi.injectable)(),g(0,(0,oi.inject)(Gi)),g(1,(0,oi.inject)($)),g(2,(0,oi.inject)(rc)),g(2,(0,oi.tagged)("browser","edge")),g(3,(0,oi.inject)(ue)),g(4,(0,oi.inject)(Re)),g(5,(0,oi.inject)(Or))],Gl);var qo=b(N());var iW=require("crypto"),zv=b(N());var Lne=0,no=class{constructor(e){this.portLeaseTracker=e;this.teardown=new WeakMap}async launch(e,t,n){this.server&&this.server.close();let i=`/${(0,iW.randomBytes)(20).toString("hex")}`,o=this.server=await ib(this.portLeaseTracker,{perMessageDeflate:!0,host:"127.0.0.1",path:i}),s=++Lne;e.launchBrowserInCompanion({...n,serverPort:o.address().port,path:i,launchId:s});let a=await Ji(new Promise((u,l)=>{o.once("connection",u),o.once("error",l)}),t,"Timed out waiting for browser connection"),c=new Ir(a);return this.teardown.set(c,()=>e.killCompanionBrowser({launchId:s})),c}close(e){this.teardown.get(e)?.()}dispose(){this.server?.close(),this.server=void 0}};no=S([(0,zv.injectable)(),g(0,(0,zv.inject)(Ye))],no);var zl=class extends Mn{constructor(t,n,i,o){super(n,i,o);this.helper=t}resolveParams(t){return t.request==="attach"&&(t.type==="pwa-chrome"||t.type==="pwa-msedge")&&t.browserAttachLocation==="ui"}async acquireConnectionForBrowser(t,n){let i=await this.helper.launch(t.dap,t.cancellationToken,{type:n.type==="pwa-chrome"?"chrome":"edge",params:n,attach:{host:n.address,port:n.port}});return new rt(i,this.logger,t.telemetryReporter)}};zl=S([(0,qo.injectable)(),g(0,(0,qo.inject)(no)),g(1,(0,qo.inject)($)),g(2,(0,qo.inject)(Re)),g(3,(0,qo.optional)()),g(3,(0,qo.inject)(Ft))],zl);var Wo=b(N());var Kl=class extends ro{constructor(t,n,i,o,s,a){super(t,n,i,o,s);this.helper=a}resolveParams(t){return(t.type==="pwa-chrome"||t.type==="pwa-msedge")&&t.request==="launch"&&t.browserLaunchLocation==="ui"?t:void 0}async launchBrowser(t,n,i,o){let s=await this.helper.launch(n,i,{type:t.type==="pwa-chrome"?"chrome":"edge",browserArgs:QP(new Ys(t.runtimeArgs||[]),{hasUserNavigation:!!t.url,ignoreDefaultArgs:!t.includeDefaultArgs}).setConnection(t.port||"pipe").toArray(),params:t});return{canReconnect:!1,createConnection:()=>Promise.resolve(new rt(s,this.logger,o)),process:{onExit:new O().event,onError:new O().event,transport:()=>Promise.resolve(s),kill:()=>this.helper.close(s)}}}async findBrowserPath(){throw new Error("not implemented")}};Kl=S([(0,Wo.injectable)(),g(0,(0,Wo.inject)(Gi)),g(1,(0,Wo.inject)($)),g(2,(0,Wo.inject)(Re)),g(3,(0,Wo.inject)(Or)),g(4,(0,Wo.inject)(ue)),g(5,(0,Wo.inject)(no))],Kl);var ta=b(N()),uW=require("net"),lW=require("path");var Mne=ne(()=>{if(process.arch==="arm64")return Promise.resolve().then(()=>b(sW()));if(process.arch==="x64")return Promise.resolve().then(()=>b(cW()));throw new Error(`Unsupported architecture ${process.arch}`)});function Kv(){if(process.platform!=="win32")throw new Error("Not running on Windows");return Mne()}var Jl=class extends Mn{constructor(e,t,n){super(e,t,n)}resolveParams(e){return e.request==="attach"&&e.type==="pwa-msedge"&&typeof e.useWebView=="object"}async acquireConnectionForBrowser(e,t){let{getAppContainerProcessTokens:n}=await Kv(),i=n().map(c=>(0,lW.join)(c,t.useWebView.pipeName));if(!i)throw new F(_1());let o=i.map(c=>(0,uW.connect)(c)),s;try{s=await Ji(Ai(o.map(c=>new Promise(u=>c.on("error",()=>u(void 0)).on("connect",()=>u(c))))),e.cancellationToken)}finally{for(let c of o)c!==s&&c.destroy()}if(!s)throw new F(x1());let a=new to(this.logger,s);return new rt(a,this.logger,e.telemetryReporter)}};Jl=S([(0,ta.injectable)(),g(0,(0,ta.inject)($)),g(1,(0,ta.inject)(Re)),g(2,(0,ta.optional)()),g(2,(0,ta.inject)(Ft))],Jl);var Ql=b(N());var un=b(N());var fh=Symbol("ILinkedBreakpointLocation");var yW=b(require("path"));var mh=b(N()),ia=b(require("path")),gW=require("url");var pW=require("fs"),Vo=b(require("path"));function Jv(r,e){return r?(r.endsWith("/")||(r+="/"),r+e):e}async function Yv(r,e,t,n,i){e=ct(e)||e;let o;if(r){if(Ar(r))o=ct(r);else if(pr(r))o=await n(r,t,i)||r;else if(Vo.isAbsolute(e))o=Bne(e,r);else{let s=ux(e)||"/",a=await n(s,t,i),c=Vo.dirname(a);o=cs(c,r)}i.verbose("sourcemap.parsing","resolved sourceRoot",{sourceRoot:r,absSourceRoot:o})}else if(Vo.isAbsolute(e))o=Vo.dirname(e),i.verbose("sourcemap.parsing","no sourceRoot specified, using script dirname",{absSourceRoot:o});else{let s=ux(e)||"/placeholder.js",a=await n(s,t,i);o=a?Vo.dirname(a):"",i.verbose("sourcemap.parsing","no sourceRoot specified, using webRoot + script path dirname",{absSourceRoot:o})}return o=dO(o),o=st(o),o}var hh=async(r,e,t)=>{if(!r||!r.startsWith("/"))return"";let n=Object.keys(e).sort((i,o)=>o.length-i.length);for(let i of n){if(!i)continue;let o=e[i];if(i[0]!=="/"&&(t.verbose("sourcemap.parsing",`Keys should be absolute: ${i}`),i="/"+i),Nne(i,r))return Fne(i,o,r)}return""},dW=(r,e)=>async(t,n,i)=>{if(process.platform==="win32"&&/^[a-z]:/i.test(t))return t;let o=await Tu(r,Vo.dirname(e),"package.json");if(!o)return hh(t,n,i);let s=await hh(t,KE(n,a=>a.length>=o.length),i);return process.platform!=="win32"&&t!=="/"&&!s&&(await pW.promises.stat(t).catch(()=>{}))?.isDirectory()?t:s||o};function Nne(r,e){return r===e?!0:(r.endsWith("/")||(r+="/"),e.startsWith(r))}function Fne(r,e,t){let n=decodeURIComponent(t.substring(r.length));return n?cs(e,n):e}function Bne(r,e){return Jr(Vo.dirname(r),e)}var mW=b(lf()),ra=b(require("path"));var Zv="*",fW=new RegExp(wr(Zv),"g"),Xv="?:"+Zv,jne=new RegExp(wr(Xv),"g"),ZP=(r,e)=>{let t=e.match(r);return r.lastIndex=0,t?t.length:0},hW=new RegExp(`${wr(Xv)}|${wr(Zv)}`,"g"),Qv=class{constructor(e,t){this.logger=t;this.replacers=[];let n=Object.keys(e).sort((i,o)=>o.replace(Xv,"*").length-i.replace(Xv,"*").length);for(let i of n){let o=e[i];if(!o.includes("*")&&/\$[0-9'`&]/.test(o)){this.replacers.push([new RegExp(`^${i}$`,"i"),o]);continue}let s=je(i),a=`"${s}": "${o}"`,c=ZP(fW,s)-ZP(jne,s);if(c>1){t.warn("runtime.sourcemap",`Warning: only one asterisk allowed in a sourceMapPathOverrides entry - ${a}`);continue}if(ZP(fW,o)>c){t.warn("runtime.sourcemap",`The right side of a sourceMapPathOverrides entry must have 0 or 1 asterisks - ${a}}`);continue}let u="^",l=0;for(hW.lastIndex=0;;){let p=hW.exec(s);if(u+=wr(s.slice(l,p?.index),"/"),!p)break;p[0]===Zv?u+="(.*?)":u+=".*?",l=p.index+p[0].length}c===0&&(u+="([\\/\\\\].*)?",o+="*"),this.replacers.push([new RegExp(u+"$","i"),o.replace(/\$/g,"$$$$").replace(/\*/,"$1")])}}apply(e){let t=je(e);for(let[n,i]of this.replacers){let o=t.replace(n,i);if(o!==t)return this.logger.verbose("runtime.sourcemap",`SourceMap: mapping ${e} => ${o}, via sourceMapPathOverrides entry - ${n.toString()}`),cs(o)}return e}};var Une=/\x00/,Yl=class{constructor(e,t){this.options=e;this.logger=t;this.sourceMapOverrides=new Qv(this.options.sourceMapOverrides,this.logger);this.resolvePatterns=this.options.resolveSourceMapLocations?.map(e=>{let t=e.startsWith("!")?"!":"",n=e.slice(t.length).replace(/(?<!\.)\.[^./\\]+$/,".*");if(!pr(n))return je(e);n=je(Jr(n));let i=FI(this.options.workspaceFolder),o=FI(n),s=0;for(let a=0;a<i.length&&a<o.length&&o[a].toLowerCase()===i[a].toLowerCase();a++)s+=i[a].length+1;return n=n.slice(0,s).replace(/[\[\]\(\)\{\}\!\*]/g,"\\$&")+n.slice(s),t+n})}shouldResolveSourceMap({sourceMapUrl:e,compiledPath:t}){if(t.startsWith(zn))return!1;if(!this.resolvePatterns||this.resolvePatterns.length===0)return!0;let n=ct(e)||Qt(e)&&t||e;if(n.startsWith("webpack-internal:///"))return!0;let i=xg(e)?!1:cx(),o=this.rebaseRemoteToLocal(n);return(0,mW.default)((o!==n?[n,o]:[n]).map(je),this.resolvePatterns,{dot:!0,nocase:!i}).length>0}rebaseRemoteToLocal(e){if(!this.options.remoteRoot||!this.options.localRoot||!this.canMapPath(e))return mu(ra.isAbsolute(e)?ra.resolve(e):e);let t=Vd(this.options.remoteRoot,e);if(t.startsWith(".."))return"";let n=cs(this.options.localRoot,t);return n=mu(n),this.logger.verbose("runtime.sourcemap",`Mapped remoteToLocal: ${e} -> ${n}`),Jr(n)}rebaseLocalToRemote(e){if(!this.options.remoteRoot||!this.options.localRoot||!this.canMapPath(e))return e;let t=Vd(this.options.localRoot,e),n=cs(this.options.remoteRoot,t);return n=st(n,!0),this.logger.verbose("runtime.sourcemap",`Mapped localToRemote: ${e} -> ${n}`),n}normalizeSourceMapUrl(e){e=e.replace(Une,"");let t=e.lastIndexOf("?");return t!==-1&&e.slice(t-4,t)!==".vue"&&(e=e.slice(0,t)),e}canMapPath(e){return ra.posix.isAbsolute(e)||ra.win32.isAbsolute(e)||Ar(e)}};var e0="https?:\\/\\/[^\\/]+\\/",na=class extends Yl{constructor(t,n,i,o){super(i,o);this.vueMapper=t;this.fsUtils=n}absolutePathToUrlPath(t){t=ia.normalize(t);let{baseUrl:n,pathMapping:i}=this.options,o=["/",i["/"]],s=Object.entries(i).sort(([u,l],[p,d])=>d.length-l.length||p.length-u.length).find(([,u])=>gu(u,t))||o;if(!s)return{url:Ae(t),needsWildcard:!1};if(n&&Ar(n))return{url:Eu(t),needsWildcard:!1};let a=ys(ia.relative(s[1],t)),c=s[0].replace(/\/$|^\//g,"");return c&&(a=c+"/"+a),!n&&!ty(a)?{url:a,needsWildcard:!0}:{url:Vg(n,a),needsWildcard:!1}}async urlToAbsolutePath({url:t,map:n}){let i=t.indexOf("?");return i!==-1&&t.slice(i-4,i)!==".vue"&&(t=t.slice(0,i)),n?this.sourceMapSourceToAbsolute(t,n):this.simpleUrlToAbsolute(t)}async simpleUrlToAbsolute(t){if(!t)return;if(t=this.sourceMapOverrides.apply(t),Ar(t)){let s=ct(t);if(await this.fsUtils.exists(s))return s;let a=fO(t);return await this.fsUtils.exists(a)?a:s}let n;try{let s=new gW.URL(t);if(!s.pathname||s.pathname==="/"?n="index.html":n=s.pathname,s.protocol==="webpack-internal:")return}catch{n=t}let i=ia.extname(n),o=n.replace(/^\//,"").split(/[\/\\]/);for(;o.length>0;){let s="/"+o.join("/"),a=await hh(s,this.options.pathMapping,this.logger);if(a){if(!i&&await this.fsUtils.exists(a+".html"))return a+".html";if(await this.fsUtils.exists(a))return a}o.shift()}}async sourceMapSourceToAbsolute(t,n){if(!this.shouldResolveSourceMap(n.metadata))return;switch(this.vueMapper.getVueHandling(t)){case 2:return;case 1:let a=await this.vueMapper.lookup(t);if(a)return st(a);break;default:}t=this.normalizeSourceMapUrl(t);let{pathMapping:i}=this.options,o=Jv(n.sourceRoot,t),s=this.sourceMapOverrides.apply(o);if(s!==o){s=st(s);let a=Jr(i["/"],"..","ClientApp",Vd(i["/"],s));return this.options.clientID==="visualstudio"&&o.startsWith("webpack:///")&&!await this.fsUtils.exists(s)&&await this.fsUtils.exists(a)?a:s}return Ar(t)?ct(t):ia.isAbsolute(t)?st(t):Jr(await Yv(n.sourceRoot,n.metadata.compiledPath,i,hh,this.logger),t)}absolutePathToUrlRegexp(t){let n=this.absolutePathToUrlPath(t),i=n.url,o=i.length;i.endsWith("index.html")?(o=i.length-10-1,i=i.slice(0,o)+"\\/?($|index(\\.html)?)"):i.endsWith(".html")&&(o=i.length-5,i=i.slice(0,o)+"(\\.html)?");let s=0;n.needsWildcard&&(i=e0+i,s=e0.length,o+=e0.length);let a=vn(i,[s,o]);return n.needsWildcard?`${vn(Ae(t))}|${a}`:a}};na=S([(0,mh.injectable)(),g(0,(0,mh.inject)(Ll)),g(1,(0,mh.inject)(ur))],na);var ew=class extends na{constructor(t,n,i,o){super(t,n,i,o);this.blazorInCodespacesRegexpSubstitution="$1:\\$2";if(this.options.remoteFilePrefix){let s=`\\${yW.default.sep}`,a=this.options.remoteFilePrefix.replace(new RegExp(s,"g"),s);this.blazorInCodespacesRegexp=new RegExp(`^${a}${s}([A-z])\\$${s}(.*)$`)}else this.blazorInCodespacesRegexp=new RegExp("")}absolutePathToUrlRegexp(t){if(this.options.remoteFilePrefix){let n=t.replace(this.blazorInCodespacesRegexp,this.blazorInCodespacesRegexpSubstitution),o=ys(n).replace(/^(\w):(.*)$/,"$1$2"),s=vn(o);if(s){let a=`dotnet://.*\\.dll/${s}`;return this.logger.verbose("runtime.breakpoints","absolutePathToUrlRegexp.blazor.remoteFs",{absolutePath:t,dotnetUrlRegexp:a}),a}}else{let n=Ae(t),i=vn(n),o=super.absolutePathToUrlRegexp(t);return i.includes(o)?i:`${i}|${o}`}return super.absolutePathToUrlRegexp(t)}};var bW=require("url");function vW(r){if("file"in r&&r.file)return Eu(r.file);if(r.url)try{let e=new bW.URL(r.url);return e.pathname="/",e.search="",e.hash="",e.protocol==="data:"?void 0:e.href}catch{}}var Ac=b(require("path")),SW=require("url");var wW="node:",$o=class r extends Yl{constructor(t,n,i,o){super(i,o);this.fsUtils=t;this.linkedBp=n;this.options=i;this.logger=o}static shouldWarnAboutSymlinks(t){return"runtimeArgs"in t&&!t.runtimeArgs?.includes("--preserve-symlinks")}static getOptions(t){return{workspaceFolder:t.__workspaceFolder,resolveSourceMapLocations:t.resolveSourceMapLocations,basePath:t.cwd,sourceMapOverrides:t.sourceMapPathOverrides,remoteRoot:t.remoteRoot,localRoot:t.localRoot}}derive(t){return new r(this.fsUtils,this.linkedBp,{...this.options,...t},this.logger)}get resolutionOptions(){return this.options}async urlToAbsolutePath({url:t,map:n}){t=this.normalizeSourceMapUrl(t);let i=this.sourceMapOverrides.apply(t),o=i!==t;if(t=i,t.startsWith(wW)&&this.options.basePath)return t=Ac.join(this.options.basePath,"lib",t.slice(wW.length)),t.endsWith(".js")||(t+=".js"),t;if(n)return this.sourceMapSourceToAbsolute(t,n,o);let s=ct(t);if(s)return this.rebaseRemoteToLocal(s);if(ty(t))t=o?i:new SW.URL(t).pathname.slice(1);else if(Ac.isAbsolute(t))t=this.sourceMapOverrides.apply(t);else return`${Kn}/${t}`;let a=Jr(this.options.basePath??"",t);return this.rebaseRemoteToLocal(a)}absolutePathToUrl(t){return Ae(this.rebaseLocalToRemote(Ac.normalize(t)))}async absolutePathToUrlRegexp(t){let n=t;try{n=await this.fsUtils.realPath(t)}catch{}return ey(n,t)?vn(this.absolutePathToUrl(t)):(this.linkedBp?.warn(),vn(this.absolutePathToUrl(t))+"|"+vn(this.absolutePathToUrl(n)))}async sourceMapSourceToAbsolute(t,n,i){if(!this.shouldResolveSourceMap(n.metadata))return;if(i)return mu(t);let o=Jv(n.sourceRoot,t),s=this.sourceMapOverrides.apply(o);return s!==o?st(s):Ar(t)?this.rebaseRemoteToLocal(ct(t)):!Ac.isAbsolute(t)&&this.options.basePath?Jr(await Yv(this.options.remoteRoot&&pr(n.sourceRoot)&&this.rebaseRemoteToLocal(n.sourceRoot)||n.sourceRoot,n.metadata.compiledPath,{"/":this.options.basePath},dW(this.fsUtils,n.metadata.compiledPath),this.logger),t):this.rebaseRemoteToLocal(t)||t}};var xr=Symbol("ISourcePathResolverFactory"),si=class{constructor(e,t){this.fsUtils=e;this.linkedBp=t}create(e,t){if(e.type==="pwa-node"||e.type==="node-terminal"||e.type==="pwa-extensionHost")return new $o(this.fsUtils,$o.shouldWarnAboutSymlinks(e)?this.linkedBp:void 0,$o.getOptions(e),t);throw new Error(`Not usable for type ${e.type}`)}};si=S([(0,un.injectable)(),g(0,(0,un.inject)(ur)),g(1,(0,un.optional)()),g(1,(0,un.inject)(fh))],si);var Xl=class{constructor(e,t,n,i){this.initializeParams=e;this.vueMapper=t;this.fsUtils=n;this.linkedBp=i}create(e,t){if(e.type==="pwa-node"||e.type==="node-terminal"||e.type==="pwa-extensionHost")return new $o(this.fsUtils,$o.shouldWarnAboutSymlinks(e)?this.linkedBp:void 0,$o.getOptions(e),t);{let n=!!e.inspectUri;return new(n?ew:na)(this.vueMapper,this.fsUtils,{workspaceFolder:e.__workspaceFolder,resolveSourceMapLocations:e.resolveSourceMapLocations,baseUrl:vW(e),localRoot:null,remoteRoot:null,pathMapping:{"/":e.webRoot,...e.pathMapping},sourceMapOverrides:e.sourceMapPathOverrides,clientID:this.initializeParams.clientID,remoteFilePrefix:e.__remoteFilePrefix},t)}}};Xl=S([(0,un.injectable)(),g(0,(0,un.inject)(Or)),g(1,(0,un.inject)(Ll)),g(2,(0,un.inject)(ur)),g(3,(0,un.optional)()),g(3,(0,un.inject)(fh))],Xl);var _W=require("url");var tw=class extends Ln{constructor(){super(...arguments);this.baseFilter=bs(this.launchParams);this.filter=t=>{let{debugWebWorkerExtHost:n,debugWebviews:i}=this.launchParams;return!!(n&&(t.type==="worker"&&t.title.startsWith("DebugExtensionHostWorker")||t.type==="page"&&t.title.includes("[Extension Development Host]"))||i&&t.type==="iframe"&&this.baseFilter(t))}}static async connectRenderer(t,n,i,o,s,a){let u=await t.rootSession().Target.attachToBrowserTarget({});if(!u)return;let l=t.createSession(u.sessionId);return new this(t,void 0,l,n,o,s,i,a)}waitForMainTarget(t){let n=this.launchParams;return n.debugWebWorkerExtHost&&this._browser.Target.on("targetCreated",this.enqueueLifecycleFn(async({targetInfo:i})=>{if(!i.url.includes(n.__sessionId))return;let o=await this._browser.Target.attachToTarget({targetId:i.targetId,flatten:!0});o&&this.attachedToTarget(i,o.sessionId,!1)})),super.waitForMainTarget(t)}attachedToTarget(t,n,i,o){let s=super.attachedToTarget(t,n,i||this.filter(t),o,!1);return t.type==="iframe"&&s.setComputeNameFn(qne),s}},qne=r=>{let e;try{e=new _W.URL(r.targetInfo.url)}catch{return}switch(e.searchParams.get("purpose")){case"customEditor":return`${e.searchParams.get("extensionId")} editor: ${e.host}`;case"notebookRenderer":return`Notebook Renderer: ${e.host}`;default:let t=e.searchParams.get("extensionId");return`Webview: ${t?t+" ":""} ${e.host}`}};var ai=class extends Mn{constructor(t,n,i){super(t,n);this.pathResolverFactory=i;this.closeWhenTargetsEmpty=!1}async launch(t,n){if(t.type!=="pwa-extensionHost"||t.request!=="attach")return{blockSessionTermination:!1};let i=ai.debugIdTorendererDebugAddr.get(t.__sessionId);if(!i)return{blockSessionTermination:!1};let o=os({name:"Webview",type:"pwa-chrome",request:"attach",address:i,__workspaceFolder:t.__workspaceFolder,timeout:0,urlFilter:"",resolveSourceMapLocations:t.resolveSourceMapLocations,...t.rendererDebugOptions});return o.__sessionId=t.__sessionId,o.debugWebWorkerExtHost=t.debugWebWorkerHost,o.debugWebviews=t.debugWebviews,super.launch(o,n).catch(s=>this.logger.error("runtime.exception","Error in webview attach",{err:s})),{blockSessionTermination:!1}}async acquireConnectionInner(t,n,i){return new rt(await Ir.create(n.address,i),this.logger,t)}async getTargetFilter(t){return t.filter}async createTargetManager(t,n,i){return new tw(t,void 0,t.rootSession(),this.pathResolverFactory.create(n,this.logger),this.logger,i.telemetryReporter,n,i.targetOrigin)}};ai.debugIdTorendererDebugAddr=new Map,ai=S([(0,Ql.injectable)(),g(0,(0,Ql.inject)($)),g(1,(0,Ql.inject)(Re)),g(2,(0,Ql.inject)(xr))],ai);var xW=b(N());var oa=class r{constructor(){this.target={queue:[]}}connectTo(e){this.target={logger:e}}info(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:1})}verbose(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:0})}warn(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:2})}error(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:3})}fatal(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:4})}log(e){this.target&&("queue"in this.target?this.target.queue.push(e):this.target.logger.log(e))}getRecentLogs(){return this.target?"queue"in this.target?this.target.queue:this.target.logger.getRecentLogs():[]}assert(e,t){if(e===!1||e===void 0||e===null){if(this.error("runtime.assertion",t,{error:new Error("Assertion failed")}),process.env.JS_DEBUG_THROW_ASSERTIONS)throw new Error(t);debugger;return!1}return!0}setup(){throw new Error("A ProxyLogger cannot be setup()")}dispose(){this.target=void 0}forTarget(){return new r}};var IW=Symbol("ITargetOrigin"),rw=class{constructor(e){this.id=e}},Zl=class{constructor(e){this.id=e}};var nw=class{constructor(e,t){this.parentList=e;this.logger=t;this.targets=new eo;this.onTerminatedEmitter=new O;this.onTerminated=this.onTerminatedEmitter.event;this.onTargetListChanged=this.targets.onChanged;e.onAdd(([,n])=>{n.parent&&this.targets.get(n.parent.id)&&this.targets.add(n.id,n.target)}),e.onRemove(([n])=>{this.targets.remove(n)&&!this.targets.size&&this.onTerminatedEmitter.fire({killed:!0,code:0})})}async launch(e,t){if(e.type!=="node-terminal"||e.request!=="attach")return{blockSessionTermination:!1};let n=this.parentList.get(e.delegateId);if(n===void 0)return setTimeout(()=>this.onTerminatedEmitter.fire({killed:!0,code:0}),1),{blockSessionTermination:!0};let i=n.target.targetOrigin();if(!(i instanceof Zl))throw new Error("Expected delegate session to have a mutable target origin");let o=n.target.logger;if(!(o instanceof oa))throw new Error("Expected delegate session to have a proxy logger");return i.id=t.targetOrigin.id,o.connectTo(this.logger),setTimeout(()=>{this.targets.add(e.delegateId,n.target),n.dap.connect(t.dap)},0),{blockSessionTermination:!0}}terminate(){for(let e of this.targets.value())e.stop();return Promise.resolve()}restart(){for(let e of this.targets.value())e.restart();return Promise.resolve()}targetList(){return[...this.targets.value()]}dispose(){this.terminate()}};var Wne=0,io=class{constructor(){this.delegateSessions=new eo;this.refsByTarget=new WeakMap}createLauncher(e){return new nw(this.delegateSessions,e)}addDelegate(e,t,n){let i={id:Wne++,target:e,dap:t,parent:n&&this.refsByTarget.get(n)};return this.refsByTarget.set(e,i),this.delegateSessions.add(i.id,i),i.id}removeDelegate(e){let t=this.refsByTarget.get(e);t&&this.delegateSessions.remove(t.id)}};io=S([(0,xW.injectable)()],io);var WW=b(N());var Oe=class r{constructor(e,t,n){this.major=e;this.minor=t;this.patch=n}static parse(e){let t=e.split(".").map(Number);if(t.length!==3||t.some(isNaN))throw new SyntaxError(`Input string '${e}' is not a semver`);return new r(t[0],t[1],t[2])}static min(e,t){return e.lt(t)?e:t}compare(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch}gt(e){return this.compare(e)>0}gte(e){return this.compare(e)>=0}lt(e){return this.compare(e)<0}lte(e){return this.compare(e)<=0}toString(){return`${this.major}.${this.minor}.${this.patch}`}};var BW=b(N());var NW=b(EW()),oo=b(require("fs")),Oc=b(N()),FW=b(require("net")),s0=b(require("os")),a0=b(require("path"));var sw=class{constructor(e,t){this.sessionId=e;this.sink=t;this.onMessageEmitter=new O;this.onEndEmitter=new O;this.disposables=new pe;this.onMessage=this.onMessageEmitter.event;this.onEnd=this.onEndEmitter.event;this.disposables.push(t.NodeWorker.on("detachedFromWorker",n=>{n.sessionId===e&&(this.onEndEmitter.fire(),this.dispose())}),t.NodeWorker.on("receivedMessageFromWorker",n=>{n.sessionId===e&&this.onMessageEmitter.fire([n.message,new Mr])}))}send(e){this.sink.NodeWorker.sendMessageToWorker({message:e,sessionId:this.sessionId})}dispose(){this.disposables.isDisposed||(this.disposables.dispose(),this.onEndEmitter.fire())}};var n0=":::",aw=class{constructor(e){this.processEnv=e}get nodeOptions(){return this.processEnv.NODE_OPTIONS}set nodeOptions(e){e===void 0?delete this.processEnv.NODE_OPTIONS:this.processEnv.NODE_OPTIONS=e}get inspectorOptions(){let e=this.processEnv.VSCODE_INSPECTOR_OPTIONS;if(!e)return;let t=e.split(n0).reverse().find(n=>!!n);if(t)try{return JSON.parse(t)}catch{return}}set inspectorOptions(e){e===void 0?delete this.processEnv.VSCODE_INSPECTOR_OPTIONS:this.processEnv.VSCODE_INSPECTOR_OPTIONS=JSON.stringify(e)}unsetForTree(){delete this.processEnv.VSCODE_INSPECTOR_OPTIONS}updateInspectorOption(e,t){let n=this.inspectorOptions;n&&(this.inspectorOptions={...n,[e]:t})}};var i0=require("path"),kW=(0,i0.join)(__dirname,"watchdog.js"),cw=(0,i0.join)(__dirname,"bootloader.js");var bh=b(ie()),jr=b(N()),Ur=require("path");var gh=b(N()),RW=require("path");var Dc=Symbol("IPackageJsonProvider"),uw={getPath:()=>Promise.resolve(void 0),getContents:()=>Promise.resolve(void 0)},ep=class{constructor(e,t){this.fs=e;this.config=t;this.getPath=ne(async()=>{if(this.config.type!=="pwa-node"||this.config.request!=="launch")return;let e=await Tu(this.fs,this.config.cwd,"package.json");return e?(0,RW.join)(e,"package.json"):void 0});this.getContents=ne(async()=>{let e=await this.getPath();if(e)try{let t=await this.fs.readFile(e);return JSON.parse(t.toString())}catch{return}})}};ep=S([(0,gh.injectable)(),g(0,(0,gh.inject)(ur)),g(1,(0,gh.inject)(we))],ep);var Nn=Symbol("INodeBinaryProvider");function lw(r,e){return r.has(1)?e.addNodeOption("--inspect-publish-uid=http"):e}var oie=new Set(["npm","yarn","pnpm","tnpm","cnpm"]),AW=r=>oie.has((0,Ur.basename)(r,(0,Ur.extname)(r))),DW=(r,e)=>{if(!(!r||!AW(r)))return e.find(t=>!t.startsWith("-")&&t!=="run"&&t!=="run-script")},o0=new Oe(12,0,0),sie=new Oe(8,0,0),aie=[{inclusiveMin:new Oe(16,0,0),inclusiveMax:new Oe(16,3,99),message:bh.t("Some breakpoints might not work in your version of Node.js. We recommend upgrading for the latest bug, performance, and security fixes. Details: https://aka.ms/AAcsvqm")},{inclusiveMin:new Oe(7,0,0),inclusiveMax:new Oe(8,99,99),message:bh.t("You're running an outdated version of Node.js. We recommend upgrading for the latest bug, performance, and security fixes.")}],Vt=class{constructor(e,t){this.path=e;this.version=t;this.capabilities=new Set;t===void 0&&(t=o0),t.gte(new Oe(12,0,0))&&this.capabilities.add(0),t.gte(new Oe(12,6,0))&&this.capabilities.add(1),t.gte(new Oe(22,14,0))&&t.lt(new Oe(24,0,0))&&cie.includes(ef(e))&&this.capabilities.add(2)}get isPreciselyKnown(){return this.version!==void 0}get warning(){if(this.version){for(let e of aie)if(e.inclusiveMax.gte(this.version)&&e.inclusiveMin.lte(this.version))return e}}has(e,t){return!this.isPreciselyKnown&&t!==void 0?t:this.capabilities.has(e)}},yh=class extends F{constructor(t,n){super(b1(t.toString(),n));this.version=t;this.location=n}},OW=["node","node64","electron"],cie=[...OW,"npx","npm"],uie=new Map([[11,new Oe(12,0,0)],[10,new Oe(12,0,0)],[9,new Oe(12,0,0)],[8,new Oe(12,0,0)],[7,new Oe(12,0,0)],[6,new Oe(12,0,0)],[5,new Oe(10,0,0)],[4,new Oe(10,0,0)],[3,new Oe(10,0,0)],[2,new Oe(8,0,0)],[1,new Oe(8,0,0)]]),Go=class{constructor(e,t,n,i){this.logger=e;this.fs=t;this.packageJson=n;this.launchConfig=i;this.knownGoodMappings=new Map}async resolveAndValidate(e,t="node",n,i){try{return await this.resolveAndValidateInner(e,t,n,i)}catch(o){if(!(o instanceof yh))throw o;if(await this.shouldTryDebuggingAnyway(o))return new Vt(o.location,o.version instanceof Oe?o.version:void 0);throw o}}shouldTryDebuggingAnyway(e){return Promise.resolve(!1)}async resolveNodeModulesLocation(e,t,n){if(!n||(0,Ur.isAbsolute)(t)||!(0,Ur.isAbsolute)(n))return;let i=this.launchConfig.__workspaceFolder;if(i)return Wa(n,o=>gu(i,o)?NI(this.fs,(0,Ur.join)(o,"node_modules",".bin",t),e):Promise.resolve(void 0))}async resolveAndValidateInner(e,t,n,i){let o=await this.resolveBinaryLocation(t,e);if(o||(o=await this.resolveNodeModulesLocation(e,t,i)),this.logger.info("runtime.launch","Using binary at",{location:o,executable:t}),!o)throw new F(KI(t,bh.t("path does not exist")));if(n)return new Vt(o,new Oe(n,0,0));let s=ef(o);if(s==="deno")return new Vt(o,new Oe(20,0,0));if(!OW.includes(s)){if(AW(o)){let m=await this.packageJson.getPath();m&&(e=e.addToPath((0,Ur.resolve)((0,Ur.dirname)(m),"node_modules/.bin"),"prepend"))}try{let m=await this.resolveAndValidateInner(e,"node",void 0,i);return new Vt(o,m.version)}catch(m){if(P1(m,9230))throw m;return new Vt(o,void 0)}}if(o.startsWith("/snap/"))return new Vt(o,void 0);let a=this.knownGoodMappings.get(o);if(a)return a;let c=await this.getVersionText(o,i);if(!c)return new Vt(o,void 0);this.logger.info("runtime.launch","Discovered version",{version:c});let u=/v([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(c);if(!u)throw new yh(c,o);let[,l,p,d]=u.map(Number),f=new Oe(l,p,d);if(s==="electron"){let m=await this.resolveAndValidate(e);f=Oe.min(uie.get(f.major)??o0,m.version??o0)}if(f.lt(sie))throw new yh(f,o);let h=new Vt(o,f);return this.knownGoodMappings.set(o,h),h}async resolveBinaryLocation(e,t){return e&&(0,Ur.isAbsolute)(e)?await NI(this.fs,e,t):await _g(this.fs,e,t.value)}async getVersionText(e,t){try{let{stdout:n}=await jv(e,["--version"],{env:Tt.processEnv().defined(),cwd:t});return n.trim()}catch(n){throw t&&!(await br(this.fs,t))?.isDirectory()?new F(y1(t)):new F(KI(e,n.message))}}};Go=S([(0,jr.injectable)(),g(0,(0,jr.inject)($)),g(1,(0,jr.inject)(ue)),g(2,(0,jr.inject)(Dc)),g(3,(0,jr.inject)(we))],Go);var tp=class extends Go{constructor(t,n,i,o,s){super(t,n,i,o);this.vscode=s}async shouldTryDebuggingAnyway({message:t}){if(!this.vscode)return!1;let n=bh.t("Yes");return await this.vscode.window.showErrorMessage(t,n)===n}};tp=S([g(0,(0,jr.inject)($)),g(1,(0,jr.inject)(ue)),g(2,(0,jr.inject)(Dc)),g(3,(0,jr.inject)(we)),g(4,(0,jr.optional)()),g(4,(0,jr.inject)(Ft))],tp);var LW=require("path");var rp=class{constructor(e,t,n,i,o,s,a={},c){this.launchConfig=e;this.targetOriginValue=t;this.connection=n;this.targetInfo=o;this.logger=s;this.lifecycle=a;this._parent=c;this._serialize=Promise.resolve(void 0);this._attached=!1;this._onNameChangedEmitter=new O;this._onDisconnectEmitter=new O;this.entryBreakpoint=void 0;this.onDisconnect=this._onDisconnectEmitter.event;this.onNameChanged=this._onNameChangedEmitter.event;this.connection=n,this._cdp=i,i.pause(),this._waitingForDebugger=o.type==="waitingForDebugger",o.title?this._targetName=`${(0,LW.basename)(o.title)} [${o.processId}]`:this._targetName=`[${o.processId}]`,i.Target.on("targetDestroyed",()=>this.connection.close()),n.onDisconnected(()=>this._disconnected())}id(){return this.targetInfo.targetId}processId(){return this.targetInfo.processId}name(){return this._targetName}fileName(){return this.targetInfo.title}type(){return"node"}targetOrigin(){return this.targetOriginValue}parent(){return this._parent}async initialize(){this.lifecycle.initialized&&(this.entryBreakpoint=await this.lifecycle.initialized(this)||void 0)}waitingForDebugger(){return this._waitingForDebugger}scriptUrlToUrl(e){return e[0]==="/"||process.platform==="win32"&&e[1]===":"&&e[2]==="\\"?Ae(e):e}supportsCustomBreakpoints(){return!1}supportsXHRBreakpoints(){return!1}executionContextName(){return this._targetName}hasParent(){return!!this._parent}async runIfWaitingForDebugger(){await this._cdp.Runtime.runIfWaitingForDebugger({})}async _disconnected(){this._onDisconnectEmitter.fire()}canAttach(){return!this._attached}async attach(){return this._serialize=this._serialize.then(async()=>{if(!this._attached)return this._doAttach()}),this._serialize}async _doAttach(){this._waitingForDebugger=!1,this._attached=!0;let e=await this._cdp.Target.attachToTarget({targetId:this.targetInfo.targetId});if(!e){this.logger.info("runtime.launch","Failed to attach to target",{targetId:this.targetInfo.targetId});return}this._cdp.NodeWorker.enable({waitForDebuggerOnStart:!0}),e&&"__dynamicAttach"in e&&(await this._cdp.Runtime.enable({}),await this._cdp.Debugger.enable({}));let t;return this._cdp.Runtime.on("executionContextCreated",n=>{n.context.auxData&&n.context.auxData.isDefault&&(t=n.context.id)}),this._cdp.Runtime.on("executionContextDestroyed",n=>{n.executionContextId===t&&this.connection.close()}),this._cdp}async afterBind(){this._cdp.resume()}canDetach(){return this._attached}async detach(){this._serialize=this._serialize.then(async()=>{this._waitingForDebugger&&await(await this._doAttach())?.Runtime.runIfWaitingForDebugger({}),this._attached&&this._doDetach()})}async _doDetach(){await Promise.all([this._cdp.Target.detachFromTarget({targetId:this.targetInfo.targetId}),this._cdp.NodeWorker.disable({})]),this.connection.close(),this._attached=!1}canRestart(){return!1}restart(){}canStop(){return!0}stop(){try{this.lifecycle.close&&this.lifecycle.close(this)}finally{this.connection.close()}}};var qr=class{constructor(e,t,n,i){this.pathProvider=e;this.logger=t;this.portLeaseTracker=n;this.pathResolverFactory=i;this.serverConnections=new Set;this.targets=new eo;this.onTerminatedEmitter=new O;this.onTerminated=this.onTerminatedEmitter.event;this.onTargetListChanged=this.targets.onChanged;this.bootloaderFile=ne(this.getBootloaderFile.bind(this));this.seenOpeners=new Map}async launch(e,t){let n=this.resolveParams(e);if(!n)return{blockSessionTermination:!1};this._stopServer();let{server:i,pipe:o}=await this._startServer(t.telemetryReporter),s=this.logger.forTarget(),a=this.run={server:i,serverAddress:o,params:n,context:t,logger:s,pathResolver:this.pathResolverFactory.create(n,this.logger)};return await this.launchProgram(a),{blockSessionTermination:!0}}async terminate(){this.program?await this.program.stop():this.onProgramTerminated({code:0,killed:!0})}async restart(e){if(!this.run)return;let t=this.program;t&&(this.program=void 0,await t.stop(),await Promise.race([le(2e3).then(()=>!1),Promise.all([...this.serverConnections].map(i=>new Promise(o=>i.onDisconnected(o))))])||(this.logger.warn("runtime.launch","Timeout waiting for server connections to close"),this.closeAllConnections())),await this.launchProgram({...this.run,params:e?this.resolveParams(e)??this.run.params:this.run.params,context:{...this.run.context,cancellationToken:this.run.params.timeout>0?Rt.withTimeout(this.run.params.timeout).token:jt}})}targetList(){return[...this.targets.value()]}dispose(){this._stopServer()}onProgramTerminated(e){this.onTerminatedEmitter.fire(e),this._stopServer(),this.program=void 0}resolveNodePath(e,t="node"){return this.pathProvider.resolveAndValidate(Tt.merge(Tt.processEnv(),this.getConfiguredEnvironment(e)),t,e.nodeVersionHint,e.cwd)}getConfiguredEnvironment(e){let t=Tt.empty;if(e.envFile)try{t=t.merge(pie(e.envFile))}catch(n){throw new F(g1(n.message))}return t.merge(e.env)}async resolveEnvironment({params:e,serverAddress:t},n,i){let o=this.getConfiguredEnvironment(e),s=await this.bootloaderFile(e.cwd,n),a={inspectorIpc:t,deferredMode:!1,waitForDebugger:"",execPath:await _g(oo.promises,"node",process.env),onlyEntrypoint:!e.autoAttachChildProcesses,verbose:e.trace===!0||typeof e.trace=="object"&&e.trace.stdio?!0:void 0,autoAttachMode:"always",mandatePortTracking:this.portLeaseTracker.isMandated?!0:void 0,...i},c={NODE_OPTIONS:` --require ${s.interpolatedPath} `,VSCODE_INSPECTOR_OPTIONS:n0+JSON.stringify(a),ELECTRON_RUN_AS_NODE:null},u=o.lookup("NODE_OPTIONS");u&&(c.NODE_OPTIONS+=` ${u} `);let l=Tt.processEnv().lookup("NODE_OPTIONS");return l&&(c.NODE_OPTIONS+=` ${l}`),o.merge({...c})}createLifecycle(e,t,n){return{}}async _startServer(e){let t=Sg(),n=await new Promise((i,o)=>{let s=FW.createServer(a=>this._startSession(a,e)).on("error",o).listen(t,()=>i(s))});return{pipe:t,server:n}}_stopServer(){this.run?.server.close(),this.run=void 0,this.bootloaderFile.value?.then(e=>e.dispose()),this.bootloaderFile.forget(),this.closeAllConnections()}closeAllConnections(){this.serverConnections.forEach(e=>e.close()),this.serverConnections.clear()}async _startSession(e,t){if(!this.run)return;let{connection:n,cdp:i,targetInfo:o}=await this.acquireTarget(e,t,this.run.logger);if(!this.run){e.destroy();return}o.processId===void 0&&(o.processId=Number(o.targetId));let s=o.openerId;for(;s&&!this.targets.get(s)&&this.seenOpeners.has(s);)s=this.seenOpeners.get(s)?.openedBy;let a=new rp(this.run.params,this.run.context.targetOrigin,n,i,o,this.run.logger,this.createLifecycle(i,this.run,o),s?this.targets.get(s):void 0);this.seenOpeners.set(o.targetId,{openedBy:o.openerId}),this.listenToWorkerDomain(i,t,a),this.targets.add(o.targetId,a),a.onDisconnect(()=>this.targets.remove(o.targetId))}async listenToWorkerDomain(e,t,n){e.NodeWorker.on("attachedToWorker",i=>{let o=new sw(i.sessionId,e),s=new ll(n.launchConfig,{attached:!0,canAccessOpener:!1,type:"node-worker",targetId:`${n.id()}-${i.sessionId}`,title:i.workerInfo.title,url:i.workerInfo.url,openerId:n.id()},n,n.targetOrigin(),new rt(o,n.logger,t).rootSession(),n.logger),a=new pe;a.push(o),a.push(n.onDisconnect(()=>a.dispose())),a.push(o.onEnd(()=>a.dispose())),a.callback(()=>this.targets.remove(s.id())),this.targets.add(s.id(),s)})}async acquireTarget(e,t,n){let i=new rt(new to(n,e),n,t);this.serverConnections.add(i),i.onDisconnected(()=>this.serverConnections.delete(i));let o=i.rootSession(),{targetInfo:s}=await new Promise(u=>o.Target.on("targetCreated",u)),a=s,c=this.portLeaseTracker.register(a.processInspectorPort);return i.onDisconnected(()=>c.dispose()),{targetInfo:a,cdp:o,connection:i,logger:n}}async getBootloaderFile(e,t){let n=je(cw);if(!n.includes(" "))return{interpolatedPath:n,dispose:()=>{}};if(t.has(0))return{interpolatedPath:`"${n}"`,dispose:()=>{}};let i=`require(${JSON.stringify(n)})`;if(!s0.tmpdir().includes(" ")||!e){let a=a0.join(s0.tmpdir(),"vscode-js-debug-bootloader.js");return await oo.promises.writeFile(a,i),{interpolatedPath:a,dispose:()=>{}}}let o=".vscode-js-debug-bootloader.js",s=a0.join(e,o);return await oo.promises.writeFile(s,i),{interpolatedPath:`./${o}`,dispose:()=>oo.unlinkSync(s)}}async gatherTelemetryFromCdp(e,t){for(let n=0;n<8;n++){let i=await e.Runtime.evaluate({contextId:1,returnByValue:!0,expression:"typeof process === 'undefined' || process.pid === undefined ? 'process not defined' : ({ processId: process.pid, nodeVersion: process.version, architecture: process.arch })"+at()});if(!this.program)return;if(!i||!i.result||!i.result.value){this.logger.error("runtime.target","Undefined result getting telemetry");return}if(typeof i.result.value!="object"){this.logger.info("runtime.target","Process not yet defined, will retry"),await le(50*2**n);continue}let o=i.result.value;return t.context.telemetryReporter.report("nodeRuntime",{version:o.nodeVersion,arch:o.architecture}),this.program.gotTelemetery(o),o}}};qr=S([(0,Oc.injectable)(),g(0,(0,Oc.inject)(Nn)),g(1,(0,Oc.inject)($)),g(2,(0,Oc.inject)(Ye)),g(3,(0,Oc.inject)(xr))],qr);function pie(r){if(!oo.existsSync(r))return{};let e=die(oo.readFileSync(r,"utf8"));return NW.parse(Buffer.from(e))}function die(r){return r&&r[0]==="\uFEFF"&&(r=r.substr(1)),r}var fie=["NODE_OPTIONS","VSCODE_INSPECTOR_OPTIONS"],sa=class extends qr{async appendEnvironmentVariables(e,t){let n="typeof Deno==='object'?'deno':typeof process==='undefined'||process.pid===undefined?'process not defined':(()=>{"+Object.entries(t.defined()).map(([i,o])=>{let s=JSON.stringify(i);return fie.includes(i)?`process.env[${s}]=(process.env[${s}]||'')+${JSON.stringify(o)}`:`process.env[${s}]=${JSON.stringify(o)}`}).join(";")+"})()"+at();for(let i=0;i<200;i++){let o=await e.Runtime.evaluate({contextId:1,returnByValue:!0,expression:n});if(!o){this.logger.error("runtime.target","Undefined result setting child environment vars");return}if(!o.exceptionDetails&&o.result.value!=="process not defined")return;this.logger.error("runtime.target","Error setting child environment vars",o),await le(50)}}};sa=S([(0,BW.injectable)()],sa);var pw=class{constructor(e,t){this.a=e;this.b=t;this.stopped=Promise.race([this.a.stopped.then(async e=>await this.b.stop()&&e),this.b.stopped.then(async e=>await this.a.stop()&&e)])}gotTelemetery(e){this.a.gotTelemetery(e),this.b.gotTelemetery(e)}async stop(){return(await Promise.all([this.a.stop(),this.b.stop()]))[0]}},dw=class{constructor(e,t,n){this.child=e;this.logger=t;this.killBehavior=n;this.killed=!1;this.stopped=new Promise((i,o)=>{e.once("exit",s=>i({killed:this.killed,code:s||0})),e.once("error",s=>o({killed:this.killed,code:1,error:s}))})}gotTelemetery(){}stop(){return this.killed=!0,ni(this.child.pid,this.logger,this.killBehavior),this.stopped}},zo=class{constructor(){this.stopped=new Promise(e=>this.stopDefer=e)}gotTelemetery(e){this.telemetry=e}stop(){return this.stopDefer({code:0,killed:!0}),this.stopped}},aa=class extends zo{constructor(t){super();this.wd=t;t.onEnd(n=>{this.stopDefer(n),this.wd.dispose()})}stop(){return this.wd.dispose(),this.stopped}},np=class r{constructor(e,t,n){this.terminalResult=e;this.logger=t;this.killBehavior=n;this.didStop=!1;this.stopped=new Promise(e=>this.onStopped=t=>{this.didStop=!0,e({code:0,killed:t})});e.processId&&(this.liveness=new Qs(e.processId,this.onStopped,r.terminationPollInterval))}static{this.terminationPollInterval=1e3}static{this.killConfirmInterval=200}gotTelemetery({processId:e}){if(this.didStop){ni(e,this.logger,this.killBehavior);return}this.liveness??=new Qs(e,this.onStopped,1e3)}stop(){return this.didStop?this.stopped:(this.didStop=!0,this.liveness?(ni(this.liveness.pid,this.logger,this.killBehavior),this.liveness.updateInterval(r.killConfirmInterval)):this.terminalResult.shellProcessId?(ni(this.terminalResult.shellProcessId,this.logger,this.killBehavior),this.liveness=new Qs(this.terminalResult.shellProcessId,this.onStopped,r.killConfirmInterval)):this.onStopped(!0),this.stopped)}};var qW=b(require("net"));var jW=require("crypto"),UW=()=>(0,jW.randomBytes)(12).toString("hex");var Fn=class r{constructor(e,t){this.info=e;this.server=t;this.onEndEmitter=new O;this.cts=new Rt;this.gracefulExit=!1;this.targetAlive=!1;this.targetInfo={targetId:this.info.ownId??UW(),processId:Number(this.info.pid)||0,type:this.info.waitForDebugger?"waitingForDebugger":"",title:this.info.scriptName,url:"file://"+this.info.scriptName,openerId:this.info.openerId,attached:!0,canAccessOpener:!1,processInspectorPort:Number(new URL(this.info.inspectorURL).port)};this.onEnd=this.onEndEmitter.event;this.listenToServer()}get isTargetAlive(){return this.targetAlive}static async attach(e){let t=await new Promise((i,o)=>{let s=qW.createConnection(e.ipcAddress,()=>i(s));s.on("error",o)}),n=new to(Dn.null,t);return new r(e,n)}listenToServer(){let{server:e,targetInfo:t}=this;e.send(JSON.stringify({method:"Target.targetCreated",params:{targetInfo:t}})),e.onMessage(async([n])=>{if(this.target&&!n.includes("Target.attachToTarget")&&!n.includes("Target.detachFromTarget")){this.target.send(n);return}let i=await this.execute(n);i&&e.send(JSON.stringify(i))}),e.onEnd(()=>{this.disposeTarget(),this.onEndEmitter.fire({killed:this.gracefulExit,code:this.gracefulExit?0:1})})}dispose(){this.gracefulExit=!0,this.cts.dispose(!0),this.disposeTarget(),this.server.dispose()}async execute(e){let t=JSON.parse(e);switch(t.method){case"Target.attachToTarget":return this.target&&this.disposeTarget(),this.target=await this.createTarget(),{id:t.id,result:{sessionId:this.targetInfo.targetId,__dynamicAttach:this.info.dynamicAttach?!0:void 0}};case"Target.detachFromTarget":return this.gracefulExit=!0,this.disposeTarget(),{id:t.id,result:{}};default:this.target?.send(t);return}}async createTarget(){this.gracefulExit=!1;let e=await Ir.create(this.info.inspectorURL,this.cts.token,this.info.remoteHostHeader);return e.onMessage(([t])=>this.server.send(t)),e.onEnd(()=>{e&&this.server.send(JSON.stringify({method:"Target.targetDestroyed",params:{targetId:this.targetInfo.targetId,sessionId:this.targetInfo.targetId}})),this.targetAlive=!1,this.server.dispose()}),e}disposeTarget(){this.target&&(this.target.dispose(),this.target=void 0)}};var c0=class extends aa{constructor(t,n){super(t);this.logger=n;this.stopped.then(()=>{this.telemetry&&ni(this.telemetry.processId,this.logger,"polite")})}},ip=class extends sa{constructor(){super(...arguments);this.restarting=!1}async restart(){this.restarting=!0,this.onProgramTerminated({code:0,killed:!0,restart:!0}),this.program?.stop()}resolveParams(t){return t.type==="pwa-extensionHost"&&t.request==="attach"?t:void 0}async launchProgram(t){let n=await $l(`http://localhost:${t.params.port}`,t.context.cancellationToken,this.logger),i=await Fn.attach({ipcAddress:t.serverAddress,scriptName:"Extension Host",inspectorURL:n,waitForDebugger:!0,dynamicAttach:!0}),o=this.program=new c0(i,this.logger);this.program.stopped.then(s=>{o===this.program&&this.onProgramTerminated(s)})}createLifecycle(t,n,i){return i.openerId?{}:{initialized:()=>this.onFirstInitialize(t,n,i)}}async onFirstInitialize(t,n,i){this.setEnvironmentVariables(t,n,i.targetId);let o=await this.gatherTelemetryFromCdp(t,n),s=this.program;if(o&&s){let a=new np({processId:o.processId},this.logger,"forceful");a.stopped.then(()=>s.stop()),s.stopped.then(()=>{this.restarting||a.stop()})}}async setEnvironmentVariables(t,n,i){if(!n.params.autoAttachChildProcesses)return;let o=await this.resolveEnvironment(n,new Vt("node",Oe.parse(process.versions.node)),{openerId:i});return this.appendEnvironmentVariables(t,o.update("ELECTRON_RUN_AS_NODE",null))}};ip=S([(0,WW.injectable)()],ip);var vh=require("fs"),VW=b(N());var op=class extends qr{resolveParams(e){return e.type==="pwa-extensionHost"&&e.request==="launch"?e:void 0}async launchProgram(e){let t=e.params.port||await Es(),n=await e.context.dap.launchVSCodeRequest({args:hie(e.params,t),env:this.getConfiguredEnvironment(e.params).defined(),debugRenderer:e.params.debugWebviews||e.params.debugWebWorkerHost});n.rendererDebugAddr&&ai.debugIdTorendererDebugAddr.set(e.params.__sessionId,n.rendererDebugAddr),this.program=new zo,this.program.stop()}};op=S([(0,VW.injectable)()],op);var hie=(r,e)=>{let t=r.args.map(n=>{if(n.startsWith("-")){let i=n.split("=",2);return i.length===2&&((0,vh.existsSync)(i[1])||(0,vh.existsSync)(i[1]+".js"))?{prefix:i[0]+"=",path:i[1]}:{prefix:n}}else{try{let i=(0,vh.lstatSync)(n);if(i.isDirectory())return{prefix:"--folder-uri=",path:n};if(i.isFile())return{prefix:"--file-uri=",path:n}}catch{}return{path:n}}});return r.noDebug||t.unshift({prefix:`--inspect-brk-extensions=${e}`}),t.unshift({prefix:`--debugId=${r.__sessionId}`}),t};var ZW=b(ie()),Lc=b(N());var $W=require("crypto"),wh=require("fs"),HW=require("os"),GW=b(require("path")),fw=class r{constructor(){this.disposed=!1;this.path=GW.join((0,HW.tmpdir)(),`node-debug-callback-${(0,$W.randomBytes)(8).toString("hex")}`);this.file=wh.promises.open(this.path,"w")}static{this.updateInterval=1e3}static{this.recencyDeadline=2e3}static isValid(e){try{let t=(0,wh.readFileSync)(e);return t.length?t.readDoubleBE()>Date.now()-r.recencyDeadline:!1}catch{return!1}}async startTouchLoop(){await this.touch(),this.disposed||(this.updateInterval=setInterval(()=>this.touch(),r.updateInterval))}async touch(e=()=>Date.now()){let t=await this.file,n=Buffer.alloc(8);n.writeDoubleBE(e()),await t.write(n,0,n.length,0)}async dispose(){if(!this.disposed){this.disposed=!0,this.updateInterval&&clearInterval(this.updateInterval);try{await(await this.file).close(),await wh.promises.unlink(this.path)}catch{}}}};var YW=require("fs");var KW=require("path");var zW=require("child_process");var hw=class{constructor(e=zW.spawn){this.spawn=e}lookup(e,t){return new Promise((n,i)=>{let o=this.createProcess(),s=this.createParser();o.on("error",i),o.stderr.on("error",a=>i(`Error finding processes: ${a.toString()}`)),o.stdout.pipe(new Xs(`
`)).on("data",a=>{let c=s(a.toString());c&&(t=e(c,t))}),o.on("close",(a,c)=>{a===0?n(t):c?i(new Error(`process terminated with signal: ${c}`)):a&&i(new Error(`process terminated with exit code: ${a}`))})})}};var sp=class extends hw{constructor(t){super();this.fsUtils=t}async getWorkingDirectory(t){try{let{stdout:n}=await jv("lsof",["-a","-dcwd","-Fn",`-p${t}`]),i=n.trim().split(`
`).pop().slice(1);return i&&(0,KW.isAbsolute)(i)&&await this.fsUtils.exists(i)?i:void 0}catch(n){if(n instanceof uh)return;throw n}}createProcess(){return this.spawn("ps",["-xo",`pid=PID,ppid=PPID,comm=${"a".repeat(256)},command=COMMAND`])}createParser(){let t;return n=>{if(!t){t=n.indexOf("COMMAND");return}let i=/^\W*([0-9]+)\W*([0-9]+)\W*/.exec(n);if(i)return{pid:Number(i[1]),ppid:Number(i[2]),command:n.slice(i[0].length,t).trim(),args:n.slice(t).trim()}}}};var mw=class extends sp{createProcess(){return this.spawn("ps",["-axo","pid=PID,ppid=PPID,comm:30,command=COMMAND"])}createParser(){let e=super.createParser();return t=>{let n=e(t);if(!n)return;let i=n.args.indexOf(n.command);if(i===-1)return n;for(i=i+n.command.length;i<n.args.length&&n.args[i]!==" ";)i++;return n.command=n.args.substr(0,i),n.args=n.args.substr(i+1),n}}};var gw=class{async getWorkingDirectory(){}async lookup(e,t){let n=await Kv();for(let i of n.getProcessInfo()){let o="",s,a=i.commandLine.indexOf('" ');if(a===-1){let c=i.commandLine.indexOf(" ");c===-1?s=i.commandLine:(s=i.commandLine.slice(0,c),o=i.commandLine.slice(c+1))}else s=i.commandLine.slice(1,a),o=i.commandLine.slice(a+2);t=e({args:o,command:s,date:i.creationDate*1e3,pid:i.processId,ppid:i.parentProcessId},t)}return t}};var JW=new Kr(YW.promises),Sh=process.platform==="win32"?new gw:process.platform==="darwin"?new sp(JW):new mw(JW),mie=ne(()=>{let r=["--inspect(?:-brk)?","(?:=",["(?:",["(?:","(?<address>\\[[0-9a-f:]*\\]|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+|(?:[a-z][a-z0-9\\.]*))","(?::(?<port1>\\d+))?",")"],"|",["(?:",":?","(?<port2>\\d+)?",")"],")"],")?"].flat(1/0).join("");return new RegExp(r,"i")});function yw(r){let e=/--inspect-port=(\d+)/,t,n,i=mie().exec(r);if(i?.groups){let o=i.groups.port1||i.groups.port2;n=o?Number(o):9229,t=i.groups.address??"127.0.0.1"}return i=e.exec(r),i&&i.length===2&&(t||="127.0.0.1",n=parseInt(i[1])),{address:t,port:n}}async function XW(r,e,t,n=jt){let i=await gie(r.pid,t);if(!i)return[];let o=[],s=i.children.slice();for(;s.length;){let a=s.pop();s=s.concat(a.children);let{port:c}=yw(a.args);c&&o.push(YP(`http://${r.hostname}:${c}`,n,t,!0).then(u=>Fn.attach({ipcAddress:r.ipcAddress,scriptName:"Child Process",inspectorURL:u,waitForDebugger:!0,dynamicAttach:!0,pid:String(a.pid),openerId:e})).catch(u=>t.info("internal","Could not spawn WD for child process",{err:u,port:c,child:a})))}return(await Promise.all(o)).filter(a=>!!a)}async function gie(r,e){let t=new Map;t.set(0,{children:[],pid:0,ppid:0,command:"",args:""});try{await Sh.lookup(({pid:i,ppid:o,command:s,args:a})=>(i!==o&&t.set(i,{pid:i,ppid:o,command:s,args:a,children:[]}),t),null)}catch(i){e.warn("internal","Error getting child process tree",i);return}let n=t.values();for(let i of n){let o=t.get(i.ppid);o&&o!==i&&o.children.push(i)}return!isNaN(r)&&r>0?t.get(r):t.get(0)}var QW=b(N());var so=class{create(e){return e===!1?new u0:e===!0?new bw({maxAttempts:1/0,delay:1e3}):new bw({maxAttempts:e.maxAttempts??1/0,delay:e.delay??1e3})}};so=S([(0,QW.injectable)()],so);var bw=class r{constructor(e,t=0){this.options=e;this.attempt=t}get delay(){return this.options.delay}next(){return this.attempt===this.options.maxAttempts?void 0:new r(this.options,this.attempt+1)}reset(){return this.attempt?new r(this.options):this}},u0=class{constructor(){this.delay=-1}next(){}reset(){return this}};var ap=class extends sa{constructor(t,n,i,o,s=new so){super(t,n,o,i);this.restarters=s}resolveParams(t){return t.type==="pwa-node"&&t.request==="attach"?t:void 0}async launchProgram(t){let n=async(o,s)=>{let a=this.program,c;try{t.params.websocketAddress?c=t.params.websocketAddress:c=await $l(`http://${t.params.address}:${t.params.port}`,s&&t.params.timeout>0?Rt.withTimeout(t.params.timeout).token:t.context.cancellationToken,this.logger,t.params.remoteHostHeader)}catch(p){if(a&&a===s)return i(o,a,{killed:!1,code:1});throw p}let u=await Fn.attach({ipcAddress:t.serverAddress,scriptName:"Remote Process",inspectorURL:c,remoteHostHeader:t.params.remoteHostHeader,waitForDebugger:!0,dynamicAttach:!0}),l=this.program=new aa(u);l.stopped.then(p=>i(o.reset(),l,p))},i=async(o,s,a)=>{if(this.program!==s)return;if(a.killed){this.onProgramTerminated(a);return}let c=o.next();if(!c){this.onProgramTerminated(a);return}t.context.dap.output({output:ZW.t(`Lost connection to debugee, reconnecting in {0}ms\r
`,c.delay)});let u=new zo;this.program=u;let l=await Promise.race([le(c.delay),u.stopped]);this.program===u&&(l?this.onProgramTerminated(a):n(c,u))};return n(this.restarters.create(t.params.restart))}async terminate(t){await super.terminate(),t&&this.telemetry&&ni(this.telemetry.processId,this.logger)}createLifecycle(t,n,i){if(i.openerId)return{};let o;return{initialized:async()=>{o=this.onFirstInitialize(t,n,i),await o},close:()=>{this.targetList().length&&this.program?.stop(),o?.then(s=>s.dispose())}}}async onFirstInitialize(t,n,i){let o=new fw;await o.startTouchLoop();let s=new Vt("node",void 0);try{s=await this.resolveNodePath(n.params)}catch{}let[a]=await Promise.all([this.gatherTelemetryFromCdp(t,n),this.setEnvironmentVariables(t,n,o.path,i.targetId,s)]);return this.telemetry=a,a&&n.params.attachExistingChildren&&XW({pid:a.processId,nodePath:s.path,hostname:n.params.address,ipcAddress:n.serverAddress},i.targetId,this.logger).catch(c=>this.logger.warn("internal","Error watching child processes",{err:c})),o}async setEnvironmentVariables(t,n,i,o,s){if(!n.params.autoAttachChildProcesses)return;if(!await Pu(n.params.address)){this.logger.warn("runtime.target","Cannot attach to children of remote process");return}let a=await this.resolveEnvironment(n,s,{requireLease:i,openerId:o});return this.appendEnvironmentVariables(t,a)}};ap=S([(0,Lc.injectable)(),g(0,(0,Lc.inject)(Nn)),g(1,(0,Lc.inject)($)),g(2,(0,Lc.inject)(xr)),g(3,(0,Lc.inject)(Ye))],ap);var ln=b(N()),lp=require("path");function vw(r){if(!r.runtimeArgs||r.attachSimplePort)return;let e=[];for(let t of r.runtimeArgs)/^--inspect-brk(=|$)/.test(t)?r.stopOnEntry=r.stopOnEntry||!0:e.push(t);r.runtimeArgs=e}var eV=require("crypto"),cp=require("fs"),tV=require("os"),rV=b(require("path")),ww=class r{constructor(){this.path=rV.join((0,tV.tmpdir)(),`node-debug-callback-${(0,eV.randomBytes)(8).toString("hex")}`);this.disposed=!1}static{this.pollInterval=200}read(e=r.pollInterval){return this.readPromise?this.readPromise:(this.readPromise=new Promise((t,n)=>{let i=setInterval(()=>{if(this.disposed){clearInterval(i),t(void 0);return}if((0,cp.existsSync)(this.path)){try{t(JSON.parse((0,cp.readFileSync)(this.path,"utf-8")))}catch(o){n(o)}finally{this.dispose()}clearInterval(i)}},e)}),this.readPromise)}dispose(){if(!this.disposed){this.disposed=!0;try{(0,cp.unlinkSync)(this.path)}catch{}}}};var Mc=b(require("path"));var _h=Symbol("IProgramLauncher"),Sw=r=>{let e=r.program;if(e&&Mc.isAbsolute(e)){let n=Mc.relative(r.cwd,e);e=Mc.isAbsolute(n)?n:`.${Mc.sep}${n}`}let t=Yg(r.args).filter(n=>n!=="");return e?[...r.runtimeArgs,e,...t]:[...r.runtimeArgs,...t]};var yie=async(r,e)=>{if(typeof e.stopOnEntry=="string")return(0,lp.resolve)(e.cwd,e.stopOnEntry);if(e.program)return(0,lp.resolve)(e.cwd,e.program);for(let t of Yg(e.args)){if(t.startsWith("-"))continue;let n=(0,lp.resolve)(e.cwd,t);if(await r.exists(n))return n}},up=class extends qr{constructor(t,n,i,o,s,a,c,u,l){super(t,n,l,u);this.bpPredictor=i;this.launchers=o;this.restarters=s;this.fsUtils=a;this.packageJson=c}resolveParams(t){let n;if(t.type==="pwa-node"&&t.request==="launch"?n={...t}:"server"in t&&t.server&&"program"in t.server&&(n={...t.server}),!!n)return vw(n),n}async launchProgram(t){t.params.program&&(t.params.program=await this.tryGetCompiledFile(t.params.program)),this.attachSimplePort=await this.getSimpleAttachPortIfAny(t.params);let n=async i=>{this.program&&this.program.stop();let o=await this.resolveNodePath(t.params,t.params.runtimeExecutable||void 0),s=o.warning;s&&t.context.dap.output({category:"stderr",output:s.message});let a=new ww,c=await this.resolveEnvironment(t,o,{fileCallback:a.path});this.attachSimplePort?(t.params.attachSimplePort||t.context.dap.output({category:"stderr",output:"Using legacy attach mode for --inspect-brk in npm scripts. We recommend removing --inspect-brk, and using `stopOnEntry` in your launch.json if you need it."}),c=c.merge({NODE_OPTIONS:null})):c=lw(o,c);let u={...t.params,env:c.value},l="--experimental-network-inspection";t.params.experimentalNetworking==="off"||(o.has(2)||t.params.experimentalNetworking==="on")&&(u.runtimeArgs=[l,...u.runtimeArgs]);let p=this.launchers.find(f=>f.canLaunch(u));if(!p)throw new Error("Cannot find an appropriate launcher for the given set of options");let d=await p.launchProgram(o.path,u,t.context);if(this.attachSimplePort){let f=await Fn.attach({ipcAddress:t.serverAddress,scriptName:"Remote Process",inspectorURL:await $l(`http://127.0.0.1:${this.attachSimplePort}`,t.context.cancellationToken,this.logger),waitForDebugger:!0,dynamicAttach:!0});d=new pw(d,new aa(f))}else a.read().then(f=>{f&&d.gotTelemetery(f)});this.program=d,d.stopped.then(async f=>{if(a.dispose(),this.program!==d)return;if(f.killed||f.code===0){this.onProgramTerminated(f);return}let h=i.next();if(!h){this.onProgramTerminated(f);return}await le(h.delay),this.program===d&&n(h)})};return n(this.restarters.create(t.params.restart))}async getSimpleAttachPortIfAny(t){if(t.attachSimplePort)return t.attachSimplePort;let n=DW(t.runtimeExecutable,t.runtimeArgs);if(!(!n||!(await this.packageJson.getContents())?.scripts?.[n]?.includes("--inspect-brk")))return t.port??9229}createLifecycle(t,n,{targetId:i}){return{initialized:async()=>{if(this.attachSimplePort&&await this.gatherTelemetryFromCdp(t,n),!n.params.stopOnEntry)return;let o=await yie(this.fsUtils,n.params);if(!o){this.logger.warn("runtime","Could not resolve program entrypointfrom args");return}let s="(?:entryBreakpoint){0}",a=Ae(o),c=vn(a)+s,u=await t.Debugger.setBreakpointByUrl({urlRegex:c,lineNumber:0,columnNumber:0});return u?.breakpointId?{cdpId:u?.breakpointId,path:a}:void 0},close:()=>{let o=Number(i);if(o>0)try{process.kill(o)}catch{}}}}async tryGetCompiledFile(t){t=st(t);let n=(0,lp.extname)(t);if(!n||n===".js")return t;let i=await this.bpPredictor.getPredictionForSource(t);if(!i||i.size===0)return t;let o=ms(i.values());return o?(this.logger.info("runtime.launch","Updating entrypoint to compiled file",{from:t,to:o.compiledPath,candidates:i.size}),o.compiledPath):t}};up=S([(0,ln.injectable)(),g(0,(0,ln.inject)(Nn)),g(1,(0,ln.inject)($)),g(2,(0,ln.inject)(Ga)),g(3,(0,ln.multiInject)(_h)),g(4,(0,ln.inject)(so)),g(5,(0,ln.inject)(ur)),g(6,(0,ln.inject)(Dc)),g(7,(0,ln.inject)(xr)),g(8,(0,ln.inject)(Ye))],up);var dp=b(require("fs")),nV=require("fs"),_w=b(N()),iV=b(require("os")),Pt=b(require("path"));var Iw=Symbol("INvmResolver");var pp=class{constructor(e=new Kr(nV.promises),t=process.env,n=process.arch,i=process.platform,o=iV.homedir()){this.fsUtils=e;this.env=t;this.arch=n;this.platform=i;this.homedir=o}async resolveNvmVersionPath(e){let t,n=[],i=this.parseVersionString(e),o=this.env.NVS_HOME;if(!o){let s=this.platform==="win32"?Pt.join(this.env.LOCALAPPDATA||"","nvs"):Pt.join(this.env.HOME||"",".nvs");dp.existsSync(s)&&(o=s)}if(i.nvsFormat||o){if(t=await this.resolveNvs(o,i),!t&&i.nvsFormat)throw new F(zI(e,"nvs"));n.push("nvs")}if(!t)if(this.platform==="win32")this.env.NVM_HOME&&(t=await this.resolveWindowsNvm(e),n.push("nvm-windows"));else{let s=this.env.NVM_DIR||Pt.join(this.homedir,".nvm");await this.fsUtils.exists(s)&&(t=await this.resolveUnixNvm(e),n.push("nvm"))}if(!t){let s=this.platform==="win32"?this.env.FNM_DIR||Pt.join(this.env.APPDATA||"","fnm"):this.env.FNM_DIR||Pt.join(this.homedir,".fnm");await this.fsUtils.exists(s)&&(t=await this.resolveFnm(e,s),n.push("fnm"))}if(!n.length)throw new F(GI());if(!t||!await this.fsUtils.exists(t))throw new F(zI(e,n.join("/")));return{directory:t,binary:await this.getBinaryInFolder(t)}}async getBinaryInFolder(e){return await Ai(["node64.exe","node64"].map(t=>this.fsUtils.exists(Pt.join(e,t))))?"node64":"node"}async resolveNvs(e,{remoteName:t,semanticVersion:n,arch:i}){if(!e)throw new F(f1());let o=this.findBinFolderForVersion(Pt.join(e,t),n,s=>dp.existsSync(Pt.join(s,i)));if(o)return this.platform!=="win32"?Pt.join(o,i,"bin"):Pt.join(o,i)}async resolveUnixNvm(e){let t=this.env.NVM_DIR;if(!t){let i=Pt.join(this.env.HOME||"",".nvm");await this.fsUtils.exists(i)&&(t=i)}if(!t)throw new F(GI());let n=this.findBinFolderForVersion(Pt.join(t,"versions","node"),`v${e}`);return n?Pt.join(n,"bin"):void 0}async resolveWindowsNvm(e){let t=this.env.NVM_HOME;if(!t)throw new F(h1());return this.findBinFolderForVersion(t,`v${e}`)}async resolveFnm(e,t){let n=this.findBinFolderForVersion(Pt.join(t,"node-versions"),`v${e}`);if(n)return this.platform==="win32"?Pt.join(n,"installation"):Pt.join(n,"installation","bin")}findBinFolderForVersion(e,t,n){if(!dp.existsSync(e))return;let i=dp.readdirSync(e);if(i.includes(t))return Pt.join(e,t);let o=i.filter(s=>s.startsWith(`${t}.`)).sort(bie).filter(s=>n?n(Pt.join(e,s)):!0).pop();return o?Pt.join(e,o):void 0}parseVersionString(e){let n=/^(([\w-]+)\/)?(v?(\d+(\.\d+(\.\d+)?)?))(\/((x86)|(32)|((x)?64)|(arm\w*)|(ppc\w*)))?$/i.exec(e);if(!n)throw new Error("Invalid version string: "+e);let i=!!(n[2]||n[8]),o=n[2]||"node",s=n[4]||"",a=vie(n[8]||this.arch);return{nvsFormat:i,remoteName:o,semanticVersion:s,arch:a}}};pp=S([(0,_w.injectable)(),g(0,(0,_w.inject)(ur))],pp);var bie=(r,e)=>{let t=/([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(r),n=/([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(e);if(!t||!n)return(n?-1:0)+(t?1:0);let[,i,o,s]=t,[,a,c,u]=n;return Number(i)-Number(a)||Number(o)-Number(c)||Number(s)-Number(u)};function vie(r){switch(r){case"32":case"x86":case"ia32":return"x86";case"64":case"x64":case"amd64":return"x64";case"arm":let e=process.config.variables.arm_version;return e?"armv"+e+"l":"arm";default:return r}}var oV=require("child_process"),Cw=b(N());var fp=class{constructor(e){this.logger=e}canLaunch(e){return e.console==="internalConsole"}async launchProgram(e,t,n){let{executable:i,args:o,shell:s,cwd:a}=lh(e,Sw(t),t.cwd);n.dap.output({category:"console",output:[i,...o].join(" ")+`
`});let c=(0,oV.spawn)(i,o,{shell:s,cwd:a,env:Tt.merge(Tt.processEnv(),t.env).defined()});return t.outputCapture==="console"?this.discardStdio(n.dap,c):this.captureStdio(n.dap,c),new dw(c,this.logger,t.killBehavior)}captureStdio(e,t){t.stdout.pipe(new xw).on("data",n=>e.output({category:"stdout",output:n.toString()})).resume(),t.stderr.pipe(new xw).on("data",n=>e.output({category:"stderr",output:n.toString()})).resume()}discardStdio(e,t){let n=[],i=()=>{n&&e.output({category:"stderr",output:Buffer.concat(n).toString()})},o=Buffer.from("Debugger attached."),s=a=>{a.includes(o)?(n=void 0,t.stderr.removeListener("data",s)):n&&n.push(a)};t.stderr.on("data",s),t.on("error",a=>{i(),e.output({category:"stderr",output:a.stack||a.message})}),t.on("exit",a=>{a!==null&&a>0&&(i(),e.output({category:"stderr",output:`Process exited with code ${a}\r
`}))}),t.stdout.resume(),t.stderr.resume()}};fp=S([(0,Cw.injectable)(),g(0,(0,Cw.inject)($))],fp);var xw=class extends Xs{constructor(){super(3);this.etxSpotted=!1;this.splitSuffix=Buffer.from(`
`)}_transform(t,n,i){return!this.etxSpotted&&t.includes(3)&&(this.etxSpotted=!0),this.etxSpotted?super._transform(t,n,i):(this.push(t),i())}};var Tw=b(N());var hp=class{constructor(e){this.logger=e}canLaunch(e){return e.internalConsoleOptions,e.console!=="internalConsole"}async launchProgram(e,t,n){let i={kind:t.console==="integratedTerminal"?"integrated":"external",title:t.name,cwd:t.cwd,args:[e,...Sw(t)],env:eu(t.env),argsCanBeInterpretedByShell:!Array.isArray(t.args)},o;try{o=await this.sendLaunchRequest(i,n)}catch(s){throw new F(m1(s.message))}return new np(o,this.logger,t.killBehavior)}sendLaunchRequest(e,t){return t.dap.runInTerminalRequest(e)}};hp=S([(0,Tw.injectable)(),g(0,(0,Tw.inject)($))],hp);var sV=b(N());var mp=class{getTreatment(e,t){return Promise.resolve(t)}};mp=S([(0,sV.injectable)()],mp);var aV=b(N());var Nc=class{constructor(){this.flushEmitter=new O;this.onFlush=this.flushEmitter.event}report(){}reportOperation(){}attachDap(){}flush(){this.flushEmitter.fire()}dispose(){}};Nc=S([(0,aV.injectable)()],Nc);var Fc=Symbol("ITerminalLinkProvider");var ca=b(ie()),ua=b(N());var gp=class{constructor(e){this.session=e;this.messageEmitter=new O;this.endEmitter=new O;this.onMessage=this.messageEmitter.event;this.onEnd=this.endEmitter.event;e.onDidReceiveMessage(t=>{this.messageEmitter.fire([typeof t=="string"?t:JSON.stringify(t),new Mr])}),e.onDidClose(()=>{this.endEmitter.fire()})}send(e){let t=JSON.parse(e);this.session.sendMessage(t)}dispose(){this.session.close()}};var yp=class{constructor(e,t,n){this.logger=e;this.pathResolver=t;this.vscode=n;this._onTerminatedEmitter=new O;this.onTerminated=this._onTerminatedEmitter.event;this._onTargetListChangedEmitter=new O;this.onTargetListChanged=this._onTargetListChangedEmitter.event}dispose(){this._targetManager&&(this._targetManager.dispose(),this._targetManager=void 0)}async launch(e,t){if(e.type!=="pwa-editor-browser"||e.request!=="attach")return{blockSessionTermination:!1};if(!this.vscode)throw new F(Di("VS Code API is not available"));let n=this.vscode,{window:i}=n,o=i.browserTabs;if(!o)throw new F(Di("The browser tab API is not available. Is the proposal enabled?"));let a=e.urlFilter;if(a){let p=ry(a),d=o.filter(f=>p(f.url));if(d.length===1)return this.attachToTab(d[0],e,t)}let c=()=>{let p=a?ry(a):void 0,d=i.activeBrowserTab,f=[];d&&(!p||p(d.url))&&(f.push({label:ca.t("Active"),kind:n.QuickPickItemKind.Separator}),f.push({label:d.title,detail:d.url,iconPath:d.icon,tab:d}));let h=(i.browserTabs??[]).filter(m=>m!==d&&(!p||p(m.url)));if(h.length>0){f.push({label:ca.t("Other"),kind:n.QuickPickItemKind.Separator});for(let m of h)f.push({label:m.title,detail:m.url,iconPath:m.icon,tab:m})}return f.push({label:"",kind:n.QuickPickItemKind.Separator}),f.push({label:ca.t("Open new\u2026"),iconPath:new n.ThemeIcon("add"),openNew:!0}),f},u=await new Promise(p=>{let d=n.window.createQuickPick();d.placeholder=ca.t("Select a browser tab to debug"),d.matchOnDetail=!0,d.items=c();let f=[],h=()=>{d.items=c()};i.onDidOpenBrowserTab&&f.push(i.onDidOpenBrowserTab(h)),i.onDidCloseBrowserTab&&f.push(i.onDidCloseBrowserTab(h)),i.onDidChangeActiveBrowserTab&&f.push(i.onDidChangeActiveBrowserTab(h)),i.onDidChangeBrowserTabState&&f.push(i.onDidChangeBrowserTabState(h)),f.push(d.onDidAccept(()=>{p(d.selectedItems[0]),d.dispose()})),f.push(d.onDidHide(()=>{p(void 0),d.dispose()})),f.push(d),f.push({dispose:()=>f.forEach(m=>m.dispose())}),d.show()});if(!u)return this._onTerminatedEmitter.fire({killed:!0,code:0}),{blockSessionTermination:!1};let l;if(u.openNew){let p=await n.window.showInputBox({prompt:ca.t("Enter a URL to open"),placeHolder:"https://example.com",validateInput:d=>{try{new URL(d);return}catch{return ca.t("Please enter a valid URL")}}});if(!p)return this._onTerminatedEmitter.fire({killed:!0,code:0}),{blockSessionTermination:!1};if(!i.openBrowserTab)throw new F(Di("The browser tab API is not available."));l=await i.openBrowserTab(p)}else l=u.tab;return this.attachToTab(l,e,t)}async attachToTab(e,t,n){let i=await e.startCDPSession(),o=new gp(i),s=new rt(o,this.logger,n.telemetryReporter);s.onDisconnected(()=>{this._targetManager?.dispose(),this._targetManager=void 0,this._onTargetListChangedEmitter.fire(),this._onTerminatedEmitter.fire({killed:!0,code:0})});let a=await Ln.connect(s,void 0,this.pathResolver,t,this.logger,n.telemetryReporter,n.targetOrigin);if(!a)throw s.close(),new F(Di(ca.t("Could not connect to browser target")));return this._targetManager=a,a.onTargetAdded(()=>this._onTargetListChangedEmitter.fire()),a.onTargetRemoved(()=>{this._onTargetListChangedEmitter.fire(),a.targetList().length||(this._onTerminatedEmitter.fire({killed:!0,code:0}),s.close())}),await a.waitForMainTarget(Bi(c=>c.type==="page")),{blockSessionTermination:!0}}async terminate(){this._targetManager?.dispose(),this._targetManager=void 0}async restart(){}targetList(){return this._targetManager?.targetList()??[]}};yp=S([(0,ua.injectable)(),g(0,(0,ua.inject)($)),g(1,(0,ua.inject)(Re)),g(2,(0,ua.optional)()),g(2,(0,ua.inject)(Ft))],yp);var l0=b(ie()),la=b(N());var bp=class{constructor(e,t,n){this.logger=e;this.pathResolver=t;this.vscode=n;this._onTerminatedEmitter=new O;this.onTerminated=this._onTerminatedEmitter.event;this._onTargetListChangedEmitter=new O;this.onTargetListChanged=this._onTargetListChangedEmitter.event}dispose(){this._targetManager&&(this._targetManager.dispose(),this._targetManager=void 0)}async launch(e,t){if(e.type!=="pwa-editor-browser"||e.request!=="launch")return{blockSessionTermination:!1};if(!this.vscode)throw new F(us(new Error("VS Code API is not available")));let{window:n}=this.vscode;if(!n.openBrowserTab)throw new F(us(new Error("The browser tab API is not available. Is the proposal enabled?")));let i=e,o=i.url;if(!o)throw new F(us(new Error(l0.t('A "url" is required to launch an integrated browser'))));let a=await(await n.openBrowserTab("")).startCDPSession(),c=new gp(a),u=new rt(c,this.logger,t.telemetryReporter);u.onDisconnected(()=>{this._targetManager?.dispose(),this._targetManager=void 0,this._onTargetListChangedEmitter.fire(),this._onTerminatedEmitter.fire({killed:!0,code:0})});let l=await Ln.connect(u,void 0,this.pathResolver,{...i,cleanUp:"wholeBrowser"},this.logger,t.telemetryReporter,t.targetOrigin);if(!l)throw u.close(),new F(us(new Error(l0.t("Could not connect to browser target"))));this._targetManager=l,l.onTargetAdded(()=>this._onTargetListChangedEmitter.fire()),l.onTargetRemoved(()=>{this._onTargetListChangedEmitter.fire(),l.targetList().length||(this._onTerminatedEmitter.fire({killed:!0,code:0}),u.close())});let p=await l.waitForMainTarget(Bi(d=>d.type==="page"));return p&&await p.cdp().Page.navigate({url:o}),{blockSessionTermination:!0}}async terminate(){this._targetManager?.dispose(),this._targetManager=void 0}async restart(){if(this._targetManager)for(let e of this._targetManager.targetList())e.type()==="page"&&e.restart()}targetList(){return this._targetManager?.targetList()??[]}};bp=S([(0,la.injectable)(),g(0,(0,la.inject)($)),g(1,(0,la.inject)(Re)),g(2,(0,la.optional)()),g(2,(0,la.inject)(Ft))],bp);var cV=require("crypto"),Bn=b(N()),uV=require("os"),lV=b(require("path")),vp=b(require("vscode"));var wie=1e3,Sie=1e3,p0=class{constructor(e){this.terminal=e;this.stopped=new Promise(t=>{let n=vp.window.onDidCloseTerminal(i=>{i===e&&(t({code:0,killed:!0}),n.dispose())})})}gotTelemetery(){}stop(){return this.terminal.sendText(""),setTimeout(()=>this.terminal.dispose(),1),this.stopped}},Ko=class extends qr{constructor(t,n,i,o,s,a,c){super(t,n,s,o);this.fs=i;this.optionsProviders=a;this.terminalLinkProvider=c;this.terminalCreatedEmitter=new O;this.callbackFile=lV.join((0,uV.tmpdir)(),`node-debug-callback-${(0,cV.randomBytes)(8).toString("hex")}`);this.onTerminalCreated=this.terminalCreatedEmitter.event}async getProcessTelemetry(){try{return JSON.parse(await this.fs.readFile(this.callbackFile,"utf-8"))}catch{return}}resolveParams(t){if(t.type==="node-terminal"&&t.request==="launch")return t;if(t.type==="pwa-chrome"&&t.server&&"command"in t.server)return t.server}async launchProgram(t){let n;try{n=await this.resolveNodePath(t.params)}catch(c){if(c instanceof F&&c.cause.id===9230)throw c;n=new Vt("node",void 0)}let i=await this.resolveEnvironment(t,n,{fileCallback:this.callbackFile}),o={name:t.params.name,cwd:t.params.cwd,iconPath:new vp.ThemeIcon("debug"),env:lw(n,i).defined(),isTransient:!0};for(let c of this.optionsProviders){let u=await c.provideTerminalOptions(o);u&&(o=u)}let s=await this.createTerminal(o);this.terminalLinkProvider?.enableHandlingInTerminal(s),this.terminalCreatedEmitter.fire(s),s.show();let a=this.program=new p0(s);t.params.command&&await this.writeCommand(s,t.params.command),a.stopped.then(c=>{a===this.program&&this.onProgramTerminated(c)})}async writeCommand(t,n){if(!t.shellIntegration){let i;await Promise.race([le(wie),new Promise(o=>{i=vp.window.onDidChangeTerminalShellIntegration(s=>{s.terminal===t&&s.shellIntegration&&o()})})]),i.dispose()}t.shellIntegration?t.shellIntegration.executeCommand(n):(await Promise.race([t.processId,le(Sie)]),t.sendText(n,!0))}createTerminal(t){return Promise.resolve(vp.window.createTerminal(t))}dispose(){super.dispose(),this.fs.unlink(this.callbackFile).catch(()=>{})}};Ko=S([(0,Bn.injectable)(),g(0,(0,Bn.inject)(Nn)),g(1,(0,Bn.inject)($)),g(2,(0,Bn.inject)(ue)),g(3,(0,Bn.inject)(xr)),g(4,(0,Bn.inject)(Ye)),g(5,(0,Bn.inject)(Do)),g(6,(0,Bn.optional)()),g(6,(0,Bn.inject)(Fc))],Ko);var Bc=b(N()),Ih=b(PV());var Ip=class{constructor(e,t){t&&e instanceof Lr&&(this.service=(0,Ih.getExperimentationService)("ms-vscode.js-debug",Ra,gm?Ih.TargetPopulation.Insiders:Ih.TargetPopulation.Public,{setSharedProperty(n,i){e.setGlobalMetric(n,i)},postEvent(n,i){e.pushOutput({category:"telemetry",output:n,data:i})}},t.globalState))}dispose(){this.service?.pollingService?.StopPolling()}async getTreatment(e,t){if(!this.service)return t;try{return await this.service.getTreatmentVariableAsync("vscode",e,!0)}catch{return t}}};Ip=S([(0,Bc.injectable)(),g(0,(0,Bc.inject)(xt)),g(1,(0,Bc.optional)()),g(1,(0,Bc.inject)($e))],Ip);var Bw=b(N()),kV=b(require("vscode"));var EV=b(N()),er=b(require("vscode"));var Le=class{constructor(){this._onSessionAddedEmitter=new er.EventEmitter;this._onSessionEndedEmitter=new er.EventEmitter;this._disposables=[];this.sessions=new Map;this.onSessionAdded=this._onSessionAddedEmitter.event;this.onSessionEnded=this._onSessionEndedEmitter.event}static isConcreteSession(e){return!!e.configuration.__pendingTargetId}static pickSession(e,t){if(e.length<2)return e[0];let n=er.window.createQuickPick();return n.title=t,n.items=e.map(i=>({label:i.name,id:i.id})),n.ignoreFocusOut=!0,new Promise(i=>{n.onDidAccept(()=>i(e.find(o=>o.id===n.selectedItems[0]?.id))),n.onDidHide(()=>i(void 0)),n.show()}).finally(()=>n.dispose())}get isDebugging(){return this.sessions.size>0}getById(e){return this.sessions.get(e)}isRunning(e){return[...this.sessions.values()].includes(e)}getByName(e){return[...this.sessions.values()].filter(t=>t.name===e)}getConcreteSessions(){return[...this.sessions.values()].filter(Le.isConcreteSession)}getChildren(e){return[...this.sessions.values()].filter(t=>t.configuration.__parentId===e.id)}attach(){er.debug.onDidStartDebugSession(e=>{ns(e.type)&&(this.sessions.set(e.id,e),this._onSessionAddedEmitter.fire(e))},void 0,this._disposables),er.debug.onDidTerminateDebugSession(e=>{ns(e.type)&&(this.sessions.delete(e.id),this._onSessionEndedEmitter.fire(e))},void 0,this._disposables),er.debug.onDidReceiveDebugSessionCustomEvent(e=>{if(ns(e.session.type)){if(e.event==="revealLocationRequested"){let t=e.body,n=er.debug.asDebugSourceUri(e.body.source),i={};if(t.line){let o=new er.Position((t.line||1)-1,(t.column||1)-1);i.selection=new er.Range(o,o)}er.window.showTextDocument(n,i)}else if(e.event==="copyRequested"){let t=e.body;er.env.clipboard.writeText(t.text)}}},void 0,this._disposables)}dispose(){for(let e of this._disposables)e.dispose();this._disposables=[]}};Le=S([(0,EV.injectable)()],Le);var xp=class{constructor(e){this.tracker=e}register(e){e.subscriptions.push(this.tracker.onSessionEnded(t=>{let n=t.configuration.cascadeTerminateToConfigurations;if(!(!n||!(n instanceof Array)))for(let i of n)for(let o of this.tracker.getByName(i))kV.debug.stopDebugging(o)}))}};xp=S([(0,Bw.injectable)(),g(0,(0,Bw.inject)(Le))],xp);var jw=Symbol("IDebugConfigurationResolver"),Uw=Symbol("IDebugConfigurationProvider");var D0=b(N());var Rp=b(ie()),Yo=b(N()),VV=require("os"),Ap=require("path"),Ch=b(require("vscode"));var RV=b(N()),AV=b(require("vscode"));var ci=class{get type(){return this.getType()}get triggerKind(){return this.getTriggerKind()}async provideDebugConfigurations(e,t){try{let n=await this.provide(e,t);if(!n)return[];let i=n instanceof Array?n:[n],o=Id.get(this.type);if(o)for(let s of i)s.type===this.type&&(s.type=o);return i}catch(n){return AV.window.showErrorMessage(n.message,{modal:!0}),[]}}};ci=S([(0,RV.injectable)()],ci);var $w=b(N()),LV=require("path"),Jo=b(require("vscode"));var xh=b(N()),P0=b(require("vscode"));var DV=b(require("vscode")),Cp=class{constructor(e){this.key=e}set value(e){e!==this._value&&(this._value=e,DV.commands.executeCommand("setContext",this.key,e))}get value(){return this._value}};var OV=Symbol("Uninitialized"),qw=class{constructor(e,t){this.key=e;this.defaultValue=t;this._value=OV}write(e,t){t!==this.read(e)&&(this._value=t,e.update(this.key,t))}read(e){return this._value===OV&&(this._value=e.get(this.key)??this.defaultValue),this._value}};var Ww=new qw("sourceSteppingEnabled",!0),Tp=class{constructor(e,t){this.context=e;this.tracker=t}register(e){let t=new Cp("jsDebugIsMapSteppingDisabled");Ww.read(this.context.workspaceState)===!1&&(t.value=!0);let n=i=>{t.value=!i,Ww.write(this.context.workspaceState,i);for(let o of this.tracker.getConcreteSessions())o.customRequest("setSourceMapStepping",{enabled:i})};e.subscriptions.push(ce(P0.commands,"extension.js-debug.enableSourceMapStepping",()=>{n(!0)}),ce(P0.commands,"extension.js-debug.disableSourceMapStepping",()=>{n(!1)}))}};Tp=S([(0,xh.injectable)(),g(0,(0,xh.inject)($e)),g(1,(0,xh.inject)(Le))],Tp);var Wr=class{constructor(e){this.extensionContext=e}get type(){return this.getType()}async resolveDebugConfiguration(e,t,n){if(t.type&&(t.type=this.getType()),"__pendingTargetId"in t)return t;let i=t;i.sourceMaps??=Ww.read(this.extensionContext.workspaceState);try{let o=await this.resolveDebugConfigurationAsync(e,i,n);return o&&this.commonResolution(o,e)}catch(o){Jo.window.showErrorMessage(o.message,{modal:!0})}}applyDefaultRuntimeExecutable(e){if(e.runtimeExecutable)return;let t=Ze(Jo.workspace,"debug.javascript.defaultRuntimeExecutable"),n=t?t[e.type]:void 0;n&&(e.runtimeExecutable=n)}commonResolution(e,t){return e.trace=jI(e.trace,this.extensionContext.logPath),e.__workspaceCachePath=this.extensionContext.storagePath,e.__breakOnConditionalError=Ze(Jo.workspace,"debug.javascript.breakOnConditionalError",t)??!1,t?e.__workspaceFolder=t.uri.fsPath:(e.__workspaceFolder||=this.getSuggestedWorkspaceFolders(e).filter(et).filter(n=>!n.includes("${workspaceFolder}")).map(n=>(0,LV.isAbsolute)(n)?Jo.workspace.getWorkspaceFolder(Jo.Uri.file(n))?.uri.fsPath:n).find(et)||Jo.workspace.workspaceFolders?.[0]?.uri.fsPath||"",e.__workspaceFolder?e=x_(e):e=I_(e)),e}getSuggestedWorkspaceFolders(e){return[]}};Wr=S([(0,$w.injectable)(),g(0,(0,$w.inject)($e))],Wr);var ha=b(ie()),Ep=require("fs"),Pp=b(N()),ut=b(require("path")),pn=b(require("vscode"));var MV=b(require("vscode"));function Hw(r){MV.debug.activeDebugConsole.appendLine(r)}var jc=b(ie()),NV=require("child_process"),FV=require("fs"),BV=require("path"),Vr=b(require("vscode"));var Wie=9229;async function jV(){let r=await k0();if(!r)return;let e=Ze(Vr.workspace,"debug.javascript.pickAndAttachOptions"),t={...w_,...e,name:"process",processId:r};await E0(new Kr(FV.promises),t,!0),await Vr.debug.startDebugging(t.cwd?Vr.workspace.getWorkspaceFolder(Vr.Uri.file(t.cwd)):void 0,t)}async function E0(r,e,t=!1){let n=e.processId?.trim(),i=n&&Hie(n);if(!i||isNaN(i.pid))throw new Error(jc.t("Attach to process: '{0}' doesn't look like a process id.",n||"<unknown>"));if(i.port||zie(i.pid),e.port=i.port||Wie,delete e.processId,t){let o=await Vie(r,i.pid);o&&(e.cwd=o)}}async function Vie(r,e){let t=e&&await Sh.getWorkingDirectory(e);if(!t)return Vr.workspace.workspaceFolders?.[0].uri.fsPath;let n=await Tu(r,t,"package.json");if(!n)return t;let i=Vr.workspace.getWorkspaceFolder(Vr.Uri.file(t));return!i||Ig(i.uri.fsPath,n)?n:i.uri.fsPath}async function k0(){try{let r=await Gie();return r?r.pidAndPort:null}catch(r){return await Vr.window.showErrorMessage(jc.t("Process picker failed ({0})",r.message),{modal:!0}),null}}var $ie=(r,e)=>`${r}:${e??""}`,Hie=r=>{let[e,t]=r.split(":");return{pid:Number(e),port:t?Number(t):void 0}};async function Gie(){let r=/^(?:node|iojs)(?:$|\b)/i,e=0,t=Vr.window.createQuickPick();t.placeholder=jc.t("Pick the node.js process to attach to"),t.matchOnDescription=!0,t.matchOnDetail=!0,t.busy=!0,t.show();let n=!1,i=new Promise(s=>{t.onDidAccept(()=>s(t.selectedItems[0])),t.onDidHide(()=>s(void 0))});Sh.lookup((s,a)=>{if(n)return a;process.platform==="win32"&&s.command.indexOf("\\??\\")===0&&(s.command=s.command.replace("\\??\\",""));let c=(0,BV.basename)(s.command,".exe"),{port:u}=yw(s.args);if(!u&&!r.test(c))return a;let l={label:c,description:s.args,pidAndPort:$ie(s.pid,u),sortKey:s.date?s.date:e++,detail:u?jc.t("process id: {0}, debug port: {1} ({2})",s.pid,u,"SIGUSR1"):jc.t("process id: {0} ({1})",s.pid,"SIGUSR1")},p=a.findIndex(d=>d.sortKey<l.sortKey);return a.splice(p===-1?a.length:p,0,l),t.items=a,a},[]).then(()=>t.busy=!1).catch(s=>{Vr.window.showErrorMessage(`Error listing processes: ${s.message}`),t.dispose()});let o=await i;return n=!0,t.dispose(),o}function zie(r){try{if(process.platform==="win32"){let e=`node -e process._debugProcess(${r})`;(0,NV.execSync)(e)}else process.kill(r,"SIGUSR1")}catch(e){throw new Error(jc.t("Attach to process: cannot enable debug mode for process '{0}' ({1}).",r,e))}}var ma=class extends Wr{constructor(t,n,i){super(t);this.nvmResolver=n;this.fsUtils=i}async resolveDebugConfigurationWithSubstitutedVariables(t,n){let i=n;if(i.type==="pwa-node"&&i.request==="attach"&&typeof i.processId=="string"&&await E0(this.fsUtils,i),"port"in i&&typeof i.port=="string"&&(i.port=Number(i.port)),"attachSimplePort"in i&&typeof i.attachSimplePort=="string"&&(i.attachSimplePort=Number(i.attachSimplePort)),i.cwd){let o=await br(Ep.promises,i.cwd);if(!o){pn.window.showErrorMessage(ha.t("The configured `cwd` {0} does not exist.",i.cwd),{modal:!0});return}if(!o.isDirectory()){pn.window.showErrorMessage(ha.t("The configured `cwd` {0} is not a folder.",i.cwd),{modal:!0});return}}return i}async resolveDebugConfigurationAsync(t,n,i){if(!n.name&&!n.type&&!n.request&&(n=await A0(t,!0,n),n.request==="launch"&&!n.program)){pn.window.showErrorMessage(ha.t("Cannot find a program to debug"),{modal:!0});return}if(n.cwd||(n.cwd=n.localRoot||R0(n.request==="launch"?n.program:void 0,t)),n.remoteRoot&&!n.localRoot&&(n.localRoot="${workspaceFolder}"),n.request==="launch"){if(this.applyDefaultRuntimeExecutable(n),n.runtimeExecutable&&ef(n.runtimeExecutable)==="deno"&&!n.attachSimplePort){let s=await Es();n.attachSimplePort=s,n.continueOnAttach??=!0;let a=[`--inspect-brk=127.0.0.1:${s}`];n.runtimeArgs?(!n.runtimeArgs.includes("--allow-all")&&!n.runtimeArgs.includes("-A")&&a.push("--allow-all"),n.runtimeArgs.includes("run")?n.runtimeArgs=[...n.runtimeArgs,...a]:n.runtimeArgs=["run",...a,...n.runtimeArgs]):(a.push("--allow-all"),n.runtimeArgs=["run",...a])}let o=n.runtimeVersion;if(typeof o=="string"&&o!=="default"){let{directory:s,binary:a}=await this.nvmResolver.resolveNvmVersionPath(o);n.env=new Tt(n.env).addToPath(s,"prepend",!0).value,n.runtimeExecutable=!n.runtimeExecutable||n.runtimeExecutable==="node"?a:n.runtimeExecutable}if(n.console==="integratedTerminal"&&!n.internalConsoleOptions&&(n.internalConsoleOptions="neverOpen"),n.attachSimplePort===null||n.attachSimplePort===void 0)vw(n);else{if(n.attachSimplePort===0){n.attachSimplePort=await Es(void 0,i);let s=`--inspect-brk=${n.attachSimplePort}`;n.runtimeArgs=n.runtimeArgs?[...n.runtimeArgs,s]:[s]}n.continueOnAttach=!n.stopOnEntry,n.stopOnEntry=!1}await Kie(this.fsUtils,t,n)}return S_(n)}getType(){return"pwa-node"}getSuggestedWorkspaceFolders(t){return[t.rootPath,t.cwd]}};ma=S([(0,Pp.injectable)(),g(0,(0,Pp.inject)($e)),g(1,(0,Pp.inject)(Iw)),g(2,(0,Pp.inject)(ur))],ma);function R0(r,e){if(e)return e.uri.fsPath;if(pn.workspace.workspaceFolders&&pn.workspace.workspaceFolders.length>0)return pn.workspace.workspaceFolders[0].uri.fsPath;if(r){if(r==="${file}")return"${fileDirname}";if(ut.isAbsolute(r))return ut.dirname(r)}return"${workspaceFolder}"}function UV(r,e){if(r&&(e=di(e,"workspaceFolder",r.uri.fsPath)),pn.workspace.workspaceFolders?.length&&(e=di(e,"workspaceRoot",pn.workspace.workspaceFolders[0].uri.fsPath)),ut.isAbsolute(e))return e;if(r)return ut.join(r.uri.fsPath,e)}async function Kie(r,e,t){if(t.outFiles||!e)return;let n;if(t.program?(n=UV(e,t.program),n&&(n=ut.dirname(n))):t.cwd&&(n=UV(e,t.cwd)),!n||gu(e.uri.fsPath,n))return;let i=await Wa(n,async o=>!o.includes("node_modules")&&await r.exists(ut.join(o,"package.json"))?o:void 0);if(i){let o=je(ut.relative(e.uri.fsPath,i));o.length&&(t.outFiles=[...xd.outFiles,`\${workspaceFolder}/${o}/**/*.js`,`!\${workspaceFolder}/${o}/**/node_modules/**`])}}var Jie=["index.js","main.js"];async function A0(r,e,t){let n={type:"pwa-node",request:"launch",name:ha.t("Launch Program"),skipFiles:[`${Kn}/**`]};t&&t.noDebug&&(n.noDebug=!0);let i=await qV(r,"package.json"),o,s=!1;if(i&&i.name==="mern-starter")return e&&Hw(ha.t("Launch configuration for '{0}' project created.","Mern Starter")),Xie(n),n;if(i&&(o=await Zie(r,i,e),o&&e&&Hw(ha.t("Launch configuration created based on 'package.json'."))),!o){let a=pn.window.activeTextEditor;a&&hm.includes(a.document.languageId)&&(s=a.document.languageId!=="javascript",o=r?ut.relative(r.uri.fsPath,a.document.uri.fsPath):a.document.uri.fsPath,ut.isAbsolute(o)||(o="${workspaceFolder}"+ut.sep+o))}if(!o&&r){let a=r.uri.fsPath;o=await Ai(Jie.map(async c=>await br(Ep.promises,ut.join(a,c))&&"${workspaceFolder}"+ut.sep+c))}if(o||(o="${file}"),o&&(n.program=o,r||(n.__workspaceFolder=ut.dirname(o))),s||pn.workspace.textDocuments.some(a=>Qie(a.languageId))){e&&Hw(ha.t("Adjust glob pattern(s) in the 'outFiles' attribute so that they cover the generated JavaScript."));let a="",c=await qV(r,"tsconfig.json");if(c?.compilerOptions?.outDir&&Yie()){let u=c.compilerOptions.outDir;ut.isAbsolute(u)||(a=u,a.indexOf("./")===0&&(a=a.substr(2)),a[a.length-1]!=="/"&&(a+="/")),n.preLaunchTask="tsc: build - tsconfig.json"}n.outFiles=["${workspaceFolder}/"+a+"**/*.js"]}return n}function Yie(){let r=pn.workspace.getConfiguration().get("typescript.tsc.autoDetect");return r!=="off"&&r!=="watch"}function Xie(r){r.request==="launch"&&(r.runtimeExecutable="nodemon",r.program="${workspaceFolder}/index.js",r.restart=!0,r.env={BABEL_DISABLE_CACHE:"1",NODE_ENV:"development"},r.console="integratedTerminal",r.internalConsoleOptions="neverOpen")}function Qie(r){return r==="typescript"||r==="coffeescript"}async function qV(r,e){if(r)try{let t=await Ep.promises.readFile(ut.join(r.uri.fsPath,e),"utf8");return JSON.parse(t)}catch{}}async function Zie(r,e,t){let n;try{if(e.main?n=e.main:e.scripts&&typeof e.scripts.start=="string"&&(n=e.scripts.start.split(" ").pop()),n){let i;if(ut.isAbsolute(n)?i=n:(i=r?ut.join(r.uri.fsPath,n):void 0,n=ut.join("${workspaceFolder}",n)),t&&i&&!await br(Ep.promises,i)&&!await br(Ep.promises,i+".js"))return}}catch{}return n}var WV=b(require("vscode"));var kp=class extends Wr{async resolveDebugConfigurationAsync(e,t){if(t.cwd||(t.cwd=R0(void 0,e)),t.request==="launch"&&!t.command){await am(WV.commands,"extension.js-debug.createDebuggerTerminal",void 0,e);return}return t.remoteRoot&&!t.localRoot&&(t.localRoot="${workspaceFolder}"),__(t)}getType(){return"node-terminal"}};var eoe=r=>r.request==="launch",toe=r=>r.request==="attach",ga=class extends Wr{constructor(t,n,i,o,s){super(t);this.nodeProvider=n;this.terminalProvider=i;this.location=o;this.fs=s}async resolveBrowserCommon(t,n){if(n.request,n.server&&"program"in n.server){let o={...n.server,type:"pwa-node",request:"launch",name:`${n.name}: Server`};n.server=await this.nodeProvider.resolveDebugConfiguration(t,o)}else n.server&&"command"in n.server&&(n.server=await this.terminalProvider.resolveDebugConfiguration(t,{...n.server,type:"node-terminal",request:"launch",name:`${n.name}: Server`}));let i=this.location==="remote"?"ui":"workspace";if(eoe(n)&&!n.browserLaunchLocation&&(n.browserLaunchLocation=i),toe(n)&&!n.browserAttachLocation&&(n.browserAttachLocation=i),n.request==="launch"){let o=n;this.applyDefaultRuntimeExecutable(o)}}getSuggestedWorkspaceFolders(t){return[t.rootPath,t.webRoot]}async resolveDebugConfigurationWithSubstitutedVariables(t,n){if("__pendingTargetId"in n)return n;let i=n;if("port"in i&&typeof i.port=="string"&&(i.port=Number(i.port)),i.request==="launch"){let o=await this.ensureNoLockfile(i);if(o===void 0)return;i=o}return i}async ensureNoLockfile(t){if(t.request!=="launch")return t;let n=t;if(n.userDataDir===!1||n.port&&!await PN(n.port))return t;let i=typeof n.userDataDir=="string"?n.userDataDir:(0,Ap.join)(this.extensionContext.storagePath??(0,VV.tmpdir)(),n.runtimeArgs?.includes("--headless")?".headless-profile":".profile"),o=(0,Ap.join)(i,process.platform==="win32"?"lockfile":"SingletonLock");if(await Ai([TD(this.fs,o),this.isVsCodeLocked((0,Ap.join)(i,"code.lock"))])){let a=Rp.t("Debug Anyway");if(await Ch.window.showErrorMessage(Rp.t("It looks like a browser is already running from {0}. Please close it before trying to debug, otherwise VS Code may not be able to connect to it.",n.userDataDir===!0?Rp.t("an old debug session"):Rp.t("the configured userDataDir")),{modal:!0},a)!==a)return}return{...t,userDataDir:i}}async isVsCodeLocked(t){try{let n=Number(await this.fs.readFile(t,"utf-8"));return process.kill(n,0),!0}catch{return!1}}};ga=S([(0,Yo.injectable)(),g(0,(0,Yo.inject)($e)),g(1,(0,Yo.inject)(ma)),g(2,(0,Yo.inject)(kp)),g(3,(0,Yo.inject)(Zn)),g(4,(0,Yo.inject)(ue))],ga);var ya=class extends ci{provide(){return this.createLaunchConfigFromContext()||this.getDefaultLaunch()}getTriggerKind(){return Ch.DebugConfigurationProviderTriggerKind.Initial}createLaunchConfigFromContext(){let e=Ch.window.activeTextEditor;if(e&&e.document.languageId==="html")return{type:this.getType(),request:"launch",name:`Open ${(0,Ap.basename)(e.document.uri.fsPath)}`,file:e.document.uri.fsPath}}getDefaultLaunch(){return{type:this.getType(),request:"launch",name:Rp.t("Launch Chrome against localhost"),url:"http://localhost:8080",webRoot:"${workspaceFolder}"}}};ya=S([(0,Yo.injectable)()],ya);var Dp=class extends ga{async resolveDebugConfigurationAsync(e,t){if(!t.name&&!t.type&&!t.request){let n=new Uc().createLaunchConfigFromContext();if(!n)return null;t=n}return await this.resolveBrowserCommon(e,t),t.request==="attach"?{...Pd,...t}:{...pm,...t}}getType(){return"pwa-chrome"}};Dp=S([(0,D0.injectable)()],Dp);var Uc=class extends ya{getType(){return"pwa-chrome"}};Uc=S([(0,D0.injectable)()],Uc);var $V=b(ie()),O0=b(N());var Op=class extends ga{async resolveDebugConfigurationAsync(e,t){if(!t.name&&!t.type&&!t.request){let n=new qc().createLaunchConfigFromContext();if(!n)return;t=n}return await this.resolveBrowserCommon(e,t),t.useWebView&&(t.timeout=t.timeout??0),t.request==="attach"?{...g_,...t}:{...y_,...t}}getType(){return"pwa-msedge"}};Op=S([(0,O0.injectable)()],Op);var qc=class extends ya{getType(){return"pwa-msedge"}getDefaultLaunch(){return{...super.getDefaultLaunch(),name:$V.t("Launch Edge against localhost")}}};qc=S([(0,O0.injectable)()],qc);var HV=b(ie()),L0=b(N()),GV=require("path"),Xo=b(require("vscode"));var Lp=class extends Wr{async resolveDebugConfigurationAsync(e,t){return Xo.env.uiKind===Xo.UIKind.Web?(Xo.window.showErrorMessage("Integrated Browser debugging is only available on VS Code Desktop."),null):!t.name&&!t.type&&!t.request?null:t.request==="attach"?{...b_,...t}:{...v_,...t}}getType(){return"pwa-editor-browser"}getSuggestedWorkspaceFolders(e){return[e.rootPath,e.webRoot]}};Lp=S([(0,L0.injectable)()],Lp);var Mp=class extends ci{getType(){return"pwa-editor-browser"}getTriggerKind(){return Xo.DebugConfigurationProviderTriggerKind.Initial}provide(){return this.createLaunchConfigFromContext()||this.getDefaultLaunch()}createLaunchConfigFromContext(){let e=Xo.window.activeTextEditor;if(e&&e.document.languageId==="html")return{type:this.getType(),request:"launch",name:`Open ${(0,GV.basename)(e.document.uri.fsPath)}`,url:e.document.uri.toString()}}getDefaultLaunch(){return{type:this.getType(),request:"launch",name:HV.t("Launch Integrated Browser against localhost"),url:"http://localhost:8080",webRoot:"${workspaceFolder}"}}};Mp=S([(0,L0.injectable)()],Mp);var Gw=b(ie()),zV=b(Um()),M0=require("fs"),KV=b(N()),Ht=b(require("path")),JV=b(require("vscode"));var roe=["workspace"],Np=class extends Wr{async resolveDebugConfigurationAsync(e,t){let n=new Vl(t.args),i=await ooe(e,t,n);if(t.debugWebWorkerHost===void 0){let o=i?.value.extensionKind??roe;t={...t,debugWebWorkerHost:o.length===1&&o[0]==="web"}}if(t.debugWebWorkerHost&&(t.outFiles=[],t.resolveSourceMapLocations=Td.resolveSourceMapLocations),!t.outFiles&&i&&e){let o=await noe(e,i);o&&(t.outFiles=o,t.resolveSourceMapLocations??=Td.resolveSourceMapLocations)}return fm(t),Promise.resolve({...Td,...t})}async resolveDebugConfigurationWithSubstitutedVariables(e,t){let n=t;try{let i=await soe(n);i&&(n.env={...n.env,...i.env},n.args=[...n.args||[],...i.config.launchArgs||[],`--extensionDevelopmentPath=${i.extensionDevelopmentPath}`,`--extensionTestsPath=${i.extensionTestsPath}`])}catch(i){if(i instanceof tn)return;throw i}return n}getType(){return"pwa-extensionHost"}};Np=S([(0,KV.injectable)()],Np);var noe=async(r,e)=>{if(!e.value.main)return;let t=Ht.resolve(Ht.dirname(e.path),e.value.main),n=Ht.relative(r.uri.fsPath,Ht.dirname(e.path)),o=Ht.relative(Ht.dirname(e.path),t).split(Ht.sep)[0];return[Ht.join("${workspaceFolder}",n,o,"**/*.js").replaceAll("\\","/")]},ioe="--extensionDevelopmentPath",ooe=async(r,e,t)=>{let n=t.get(ioe);if(!n)return;let i=di(n,"workspaceFolder",r?.uri.fsPath??e.__workspaceFolder??"");try{let o=Ht.join(i,"package.json"),s=await M0.promises.readFile(o,"utf-8");return{value:JSON.parse(s),path:o}}catch{return}},soe=async r=>{let{testConfiguration:e}=r,{testConfigurationLabel:t}=r;if(!e)return;let n=Ht.join("node_modules","@vscode","test-cli","out","bin.mjs"),i=await Wa(e,async c=>{let u=Ht.join(c,n);return await Io(M0.promises,u)?c:void 0});if(!i)throw new Error(Gw.t("Cannot find `{0}` installed in {1}","@vscode/test-cli",Ht.dirname(e)));let o=await(0,zV.default)(process.execPath,[Ht.join(i,n),"--config",e,"--list-configuration"],{env:{...process.env,ELECTRON_RUN_AS_NODE:"1"}}),s=JSON.parse(o.stdout);if(s.length===1)return s[0];if(s.length&&!t&&(t=await JV.window.showQuickPick(s.map((c,u)=>c.config.label||String(u)),{title:Gw.t("Select test configuration to run")}),!t))throw new tn("cancelled");let a=s.find((c,u)=>c.config.label===t||String(u)===t);if(!a)throw new Error(Gw.t("Cannot find test configuration with label `{0}`, got: {1}",String(t),s.map((c,u)=>c.config.label||u).join(", ")));return a};var Th=b(ie()),U0=b(N()),ba=b(require("path")),Ph=b(require("vscode"));var Fp=b(ie()),QV=b(require("fs")),zw=b(require("path")),We=b(require("vscode"));var N0=require("vscode"),F0=async r=>{try{return await N0.commands.executeCommand("npm.scriptRunner",r?.uri)}catch{try{return await N0.commands.executeCommand("npm.packageManager",r?.uri)}catch{return"npm"}}},YV=async(r,e)=>{let t=await F0(e);return`${t} ${t==="node"?"--run":"run"} ${r}`};async function ZV(r){let e=await j0(r?[r]:void 0);if(!e)return;let t=async a=>{let c=We.workspace.getWorkspaceFolder(We.Uri.file(a.directory));am(We.commands,"extension.js-debug.createDebuggerTerminal",await YV(a.name,c),c,{cwd:a.directory})};if(e.length===1)return t(e[0]);let n=e.some(a=>a.directory!==e[0].directory),i=We.window.createQuickPick(),o,s=[];for(let a of e)a.directory!==o&&n&&(s.push({label:zw.basename(a.directory),kind:We.QuickPickItemKind.Separator}),o=a.directory),s.push({script:a,label:a.name,description:a.command});i.items=s,i.onDidAccept(async()=>{t(i.selectedItems[0].script),i.dispose()}),i.show()}var B0=(r,e)=>r.score>e.score?r:e;async function j0(r,e=!1){let t=r??We.workspace.workspaceFolders??[];if(!t||t.length===0){e||We.window.showErrorMessage(Fp.t("You need to open a workspace folder to debug npm scripts."));return}let n=(await Promise.all(t.map(s=>We.workspace.findFiles(new We.RelativePattern(s,"**/package.json"),"**/{node_modules,.vscode-test}/**")))).flat();if(n.length===0){e||We.window.showErrorMessage(Fp.t("No package.json files found in your workspace."));return}let i=[],o={path:n[0].fsPath,score:0};for(let{fsPath:s}of new Set(n)){o=B0(o,{path:s,score:1});let a;try{a=JSON.parse(await wg(s))}catch(c){e||XV("showWarningMessage",Fp.t("Could not read {0}: {1}",s,c.message),s),o=B0(o,{path:void 0,score:3});continue}if(o=B0(o,{path:void 0,score:2}),!!a.scripts)for(let c of Object.keys(a.scripts))i.push({directory:zw.dirname(s),name:c,command:a.scripts[c]})}if(i.length===0){o.path&&!e&&XV("showErrorMessage",Fp.t("No npm scripts found in your package.json"),o.path);return}return i.sort((s,a)=>(s.name==="start"?-1:0)+(a.name==="start"?1:0)),i}var aoe=`{
  "scripts": {
    
  }
}
`;async function XV(r,e,t){let n=Fp.t("Edit package.json");if(await We.window[r](e,n)!==n)return;if(QV.existsSync(t)){let a=await We.workspace.openTextDocument(t);await We.window.showTextDocument(a);return}let i=await We.workspace.openTextDocument(We.Uri.file(t).with({scheme:"untitled"})),o=await We.window.showTextDocument(i);await o.edit(a=>a.insert(new We.Position(0,0),aoe));let s=new We.Position(2,5);o.selection=new We.Selection(s,s)}var Bp=class extends ci{provide(e){return A0(e,!0)}getType(){return"pwa-node"}getTriggerKind(){return Ph.DebugConfigurationProviderTriggerKind.Initial}};Bp=S([(0,U0.injectable)()],Bp);var coe=["cwd","program"],jp=class extends ci{async provide(e){let t=bo(await Promise.all([this.getFromNpmScripts(e),this.getFromActiveFile()]));if(e)for(let n of t){let i=n;for(let o of coe){let s=i[o];s&&ba.isAbsolute(s)&&(i[o]=ba.join("${workspaceFolder}",ba.relative(e.uri.fsPath,s)))}}return t}getType(){return"pwa-node"}getTriggerKind(){return Ph.DebugConfigurationProviderTriggerKind.Dynamic}async getFromNpmScripts(e){let t={type:rs("node-terminal"),name:Th.t("JavaScript Debug Terminal"),request:"launch",cwd:e?.uri.fsPath};if(!e)return[t];let n=await j0([e],!0);if(!n)return[t];let i=await F0(e),o=n.some(s=>s.directory!==n[0].directory);return n.map(s=>({type:rs("node-terminal"),name:o?Th.t("Run Script: {0} ({1})",s.name,ba.basename(s.directory)):Th.t("Run Script: {0}",s.name),request:"launch",command:`${i} run ${s.name}`,cwd:s.directory})).concat(t)}getFromActiveFile(){let e=Ph.window.activeTextEditor;return!e||!hm.includes(e.document.languageId)||e.document.uri.scheme!=="file"?[]:[{type:rs("pwa-node"),name:Th.t("Run Current File"),request:"launch",program:e.document.uri.fsPath}]}};jp=S([(0,U0.injectable)()],jp);var e$=[Dp,Op,Lp,Np,ma,kp],t$=[Uc,qc,Mp,Bp,jp];var Up=b(ie()),i$=b(require("dns/promises")),Eh=b(N()),Kw=require("url"),$r=b(require("vscode"));async function r$(r,e=1e3){return Promise.race([i$.lookup(r),le(e)])}async function n$(r,e){if(r){try{let t=new Kw.URL(r);if(t.hostname)return await r$(t.hostname),r}catch{}try{let t=`http://${r}`,n=new Kw.URL(t);if(await r$(n.hostname),!e||n.port)return t}catch{}}}var qp=class{constructor(e,t){this.defaultBrowser=e;this.context=t}register(e){e.subscriptions.push($r.commands.registerCommand("extension.js-debug.debugLink",t=>this.handle(t)))}async handle(e){if(e=e??await this.getLinkFromTextEditor()??await this.getLinkFromQuickInput(),!e)return;let t="pwa-chrome";try{await this.defaultBrowser.lookup()==="edge"&&(t="pwa-msedge")}catch{}let n=Ze($r.workspace,"debug.javascript.debugByLinkOptions")??{},i={...typeof n=="string"?{}:n,type:rs(t),name:e,request:"launch",url:e};$r.debug.startDebugging($r.workspace.workspaceFolders?.[0],i),this.persistConfig(i)}getLinkFromTextEditor(){let e=$r.window.activeTextEditor;if(e)return n$(e.document.getText(e.selection),!0)}async getLinkFromQuickInput(){let e=await $r.env.clipboard.readText(),t=await $r.window.showInputBox({value:await n$(e,!1)||this.mostRecentLink,placeHolder:"https://localhost:8080",validateInput:n=>{if(n&&!Kw.URL.canParse(n))return Up.t("The URL provided is invalid")}});if(t)return this.mostRecentLink=t,t}async persistConfig(e){if(this.context.globalState.get("saveDebugLinks")===!1)return;let t=$r.workspace.getConfiguration("launch"),n=t.get("configurations")??[];if(n.some(a=>a.url===e.url))return;let i=Up.t("Yes"),o=Up.t("Never"),s=await $r.window.showInformationMessage(Up.t("Would you like to save a configuration in your launch.json for easy access later?"),i,Up.t("No"),o);s===o&&this.context.globalState.update("saveDebugLinks",!1),s===i&&await t.update("configurations",[...n,e])}};qp=S([(0,Eh.injectable)(),g(0,(0,Eh.inject)(Nl)),g(1,(0,Eh.inject)($e))],qp);var Wp=b(ie()),$p=b(N()),dn=b(require("vscode"));var o$="neverRemind",Vp=class{constructor(e,t,n){this.fs=e;this.context=t;this.tracker=n;this.dismissedForSession=!1;this.isPrompting=!1}register(e){e.subscriptions.push(ce(dn.commands,"extension.js-debug.getDiagnosticLogs",async()=>{let t=await this.getTargetSession();if(!t)return;let n=await dn.window.showSaveDialog({filters:{JSON:["json"]}});n&&t.customRequest("saveDiagnosticLogs",{toFile:n.fsPath})}),ce(dn.commands,"extension.js-debug.createDiagnostics",async()=>this.getDiagnosticInfo(await this.getTargetSession())),dn.debug.onDidReceiveDebugSessionCustomEvent(async t=>{if(t.event==="openDiagnosticTool")return this.openDiagnosticTool(t.body.file);if(t.event!=="suggestDiagnosticTool"||this.dismissedForSession||this.context.workspaceState.get(o$)||this.isPrompting)return;this.isPrompting=!0;let n=Wp.t("Yes"),i=Wp.t("Not Now"),o=Wp.t("Never"),s=await dn.window.showInformationMessage("It looks like you might be having trouble with breakpoints. Would you like to open our diagnostic tool?",n,i,o);switch(this.isPrompting=!1,s){case n:this.getDiagnosticInfo(await this.getTargetSession(),!0);break;case o:e.workspaceState.update(o$,!0);break;case i:this.dismissedForSession=!0;break}}))}getTargetSession(){let e=dn.debug.activeDebugSession;if(!e||!ns(e?.type))return this.pickSession();if(Le.isConcreteSession(e))return e;let t=this.tracker.getChildren(e);return t.length===1?t[0]:this.pickSession()}pickSession(){return Le.pickSession(this.tracker.getConcreteSessions(),Wp.t("Select the session you want to inspect:"))}async getDiagnosticInfo(e,t=!1){if(!e||!this.tracker.isRunning(e)){dn.window.showErrorMessage(Wp.t('It looks like your debug session has already ended. Try debugging again, then run the "Debug: Diagnose Breakpoint Problems" command.'));return}let{file:n}=await e.customRequest("createDiagnostics",{fromSuggestion:t});await this.openDiagnosticTool(n)}async openDiagnosticTool(e){let t=dn.window.createWebviewPanel("jsDebugDiagnostics","Debug Diagnostics",dn.ViewColumn.Active,{enableScripts:!0});t.webview.html=await this.fs.readFile(e,"utf-8")}};Vp=S([(0,$p.injectable)(),g(0,(0,$p.inject)(ue)),g(1,(0,$p.inject)($e)),g(2,(0,$p.inject)(Le))],Vp);var Hp=b(ie()),s$=b(N()),jn=b(require("vscode"));var Wc=class{register(e){e.subscriptions.push(jn.debug.onDidReceiveDebugSessionCustomEvent(t=>{if(t.event!=="suggestDisableSourcemap"||!ns(t.session.type))return;let n=t.body;this.unmap(t.session,n.source).catch(i=>jn.window.showErrorMessage(i.message))}))}async unmap(e,t){(Ze(jn.workspace,"debug.javascript.unmapMissingSources")||await this.prompt())&&await e.customRequest("disableSourcemap",{source:t})}async prompt(){let e=Hp.t("Always"),t=Hp.t("Always in this Workspace"),n=Hp.t("Yes");switch(await jn.window.showInformationMessage(Hp.t("This is a missing file path referenced by a sourcemap. Would you like to debug the compiled version instead?"),e,t,Hp.t("No"),n)){case e:return h_(jn.workspace,"debug.javascript.unmapMissingSources",!0,jn.ConfigurationTarget.Global),!0;case t:return h_(jn.workspace,"debug.javascript.unmapMissingSources",!0,jn.ConfigurationTarget.Workspace),!0;case n:return!0;default:return!1}}};Wc=S([(0,s$.injectable)()],Wc);var Vc=b(ie()),Jw=b(N()),ui=b(require("vscode"));var a$="ms-vscode.wasm-dwarf-debugging",c$="dwarf.neverRemind",Gp=class{constructor(e){this.context=e;this.didPromptForSession=this.context.workspaceState.get(c$,!1)}async load(){try{return await import("@vscode/dwarf-debugging")}catch{}let e=ui.extensions.getExtension(a$);if(e)return e.isActive||await e.activate(),e.exports}async prompt(){if(this.didPromptForSession)return;this.didPromptForSession=!0;let e=Vc.t("Yes"),t=Vc.t("Never"),n=await ui.window.showInformationMessage(Vc.t({message:'VS Code can provide better debugging experience for WebAssembly via "DWARF Debugging" extension. Would you like to install it?',comment:'"DWARF Debugging" is the extension name and should not be localized.'}),e,Vc.t("Not Now"),t);n===e?this.install():n===t&&this.context.workspaceState.update(c$,!0)}async install(){await ui.window.withProgress({location:ui.ProgressLocation.Notification,title:Vc.t("Installing the DWARF debugger...")},async()=>{try{await ui.commands.executeCommand("workbench.extensions.installExtension",a$),ui.window.showInformationMessage(Vc.t("Installation complete! The extension will be used after you restart your debug session."))}catch(e){ui.window.showErrorMessage(e.message||String(e))}})}};Gp=S([(0,Jw.injectable)(),g(0,(0,Jw.inject)($e))],Gp);var l$=b(ie()),Yw=b(N()),va=b(require("vscode"));var u$=r=>{if(r?.type!=="pwa-msedge")return!1;let e=r.configuration.__browserTargetType;return e==="iframe"||e==="page"},loe="ms-edgedevtools.vscode-edge-devtools",poe="vscode-edge-devtools.attachToCurrentDebugTarget";function doe(r){let e=r;for(;e.parentSession;)e=e.parentSession;return e}var zp=class{constructor(e){this.tracker=e}register(e){e.subscriptions.push(ce(va.commands,"extension.js-debug.openEdgeDevTools",async()=>{let t=va.debug.activeDebugSession&&u$(va.debug.activeDebugSession)?va.debug.activeDebugSession:await Le.pickSession(this.tracker.getConcreteSessions().filter(u$),l$.t("Select the page where you want to open the devtools"));if(!t)return;let n=doe(t);try{return await va.commands.executeCommand(poe,t.id,n.configuration)}catch(i){if(i instanceof Error&&/command .+ not found/.test(i.message))return va.commands.executeCommand("workbench.extensions.action.showExtensionsWithIds",[loe]);throw i}}))}};zp=S([(0,Yw.injectable)(),g(0,(0,Yw.inject)(Le))],zp);var m$=require("crypto"),Xw=b(N()),g$=require("path"),Ge=b(require("vscode"));var p$=({name:r,line:e,column:t,source:n})=>`${r} (${(0,g$.basename)(String(n.path))}:${e}:${t})`,d$=({name:r,line:e,column:t,source:n})=>`${r} (${n.path}:${e}:${t})`,f$=async({line:r,column:e,source:t})=>{if(t.sourceReference!==0||!t.path)return;let n=Ge.Uri.file(t.path),i=await Ge.workspace.openTextDocument(n),o=await Ge.window.showTextDocument(i),s=new Ge.Position(r-1,e-1);o.revealRange(new Ge.Range(s,s)),o.selection=new Ge.Selection(s,s)},q0=class{constructor(e,t){this.caller=e;this.target=t;this.treeItem=new Ge.TreeItem(`${p$(e)} \u2192 ${p$(t)}`,Ge.TreeItemCollapsibleState.None),this.treeItem.tooltip=`Breaks at ${d$(t)} containing ${d$(e)} will be skipped`,this.id=this.treeItem.id=(0,m$.createHash)("sha256").update(JSON.stringify([e,t])).digest("base64")}toDap(){return{caller:this.caller,target:this.target}}},Kp=class{constructor(e){this.sessionTracker=e;this._onDidChangeTreeData=new Ge.EventEmitter;this.allCallers=new Map;this.lastHadCallers=!1;this.onDidChangeTreeData=this._onDidChangeTreeData.event}register(e){e.subscriptions.push(Ge.window.createTreeView("jsExcludedCallers",{treeDataProvider:this}),ce(Ge.commands,"extension.js-debug.callers.add",async(t,n)=>{let i=await this.sessionTracker.getById(n.sessionId)?.customRequest("stackTrace",{threadId:0,startFrame:0,levels:1});if(!i?.stackFrames.length)return;let o=i.stackFrames[0],s=new q0({name:n.frameName,column:n.frameLocation.range.startColumn,line:n.frameLocation.range.startLineNumber,source:n.frameLocation.source},{name:o.name,column:o.column,line:o.line,source:o.source});this.allCallers.set(s.id,s),this.triggerUpdate()}),ce(Ge.commands,"extension.js-debug.callers.goToCaller",t=>f$(t.caller)),ce(Ge.commands,"extension.js-debug.callers.gotToTarget",t=>f$(t.target)),ce(Ge.commands,"extension.js-debug.callers.remove",async t=>{this.allCallers.delete(t.id),this.triggerUpdate()}),ce(Ge.commands,"extension.js-debug.callers.removeAll",()=>{this.allCallers.clear(),this.triggerUpdate()}),this.sessionTracker.onSessionAdded(t=>{this.allCallers.size>0&&this.sendCallersToSession(t)}))}getTreeItem(e){return e.treeItem}getChildren(e){return e?[]:[...this.allCallers.values()]}sendCallersToSession(e){e.customRequest("setExcludedCallers",{callers:[...this.allCallers.values()].map(t=>t.toDap())})}triggerUpdate(){this._onDidChangeTreeData.fire(void 0);for(let t of this.sessionTracker.getConcreteSessions())this.sendCallersToSession(t);let e=this.allCallers.size>0;e!==this.lastHadCallers&&(is(Ge.commands,"jsDebugHasExcludedCallers",e),this.lastHadCallers=e)}};Kp=S([(0,Xw.injectable)(),g(0,(0,Xw.inject)(Le))],Kp);var Qw=b(N());var wa=class{constructor(e){this.debugTerminalOptionsProviders=e}create(){return{registerDebugTerminalOptionsProvider:e=>(this.debugTerminalOptionsProviders.add(e),{dispose:()=>this.debugTerminalOptionsProviders.delete(e)})}}};wa=S([(0,Qw.injectable)(),g(0,(0,Qw.inject)(Do))],wa);var Zp=b(ie()),tE=b(require("fs/promises")),T$=b(N()),Un=b(require("path")),Gt=b(require("vscode"));var li=b(require("vscode")),{createScanner:Loe,parse:Moe,SyntaxKind:Z0}=(Q0(),p_(X0)),iS=class r{async selectAndInsertDebugConfig(e,t){let n=li.window.activeTextEditor;if(n&&n.document===e){let i=li.workspace.getWorkspaceFolder(e.uri),o=await this.getLaunchConfig(i);o&&await r.insertDebugConfiguration(e,t,o)}}static async insertDebugConfiguration(e,t,n){let i=r.getCursorPositionInConfigurationsArray(e,t);if(!i)return;let o=r.isCommaImmediatelyBeforeCursor(e,t)?"BeforeCursor":void 0,s=r.getTextForInsertion(n,i,o),a=new li.WorkspaceEdit;a.insert(e.uri,t,s),await li.workspace.applyEdit(a),Promise.resolve(li.commands.executeCommand("editor.action.formatDocument")).then(()=>{})}static getTextForInsertion(e,t,n){let i=JSON.stringify(e);return t==="AfterItem"?n==="BeforeCursor"?i:`,${i}`:t==="BeforeItem"?`${i},`:i}static getCursorPositionInConfigurationsArray(e,t){if(r.isConfigurationArrayEmpty(e))return"InsideEmptyArray";let n=Loe(e.getText(),!0);n.setPosition(e.offsetAt(t));let i=n.scan();if(i===Z0.CommaToken||i===Z0.CloseBracketToken)return"AfterItem";if(i===Z0.OpenBraceToken)return"BeforeItem"}static isConfigurationArrayEmpty(e){let t=Moe(e.getText(),[],{allowTrailingComma:!0,disallowComments:!1});return!t||!Array.isArray(t.configurations)||t.configurations.length===0}static isCommaImmediatelyBeforeCursor(e,t){let n=e.lineAt(t.line),i=e.getText(new li.Range(n.range.start,t));if(i.trim().endsWith(","))return!0;if(i.trim().length!==0)return!1;let o=t.line-1;for(;o>0;){let s=e.lineAt(o).text;if(s.trim().endsWith(","))return!0;if(s.trim().length!==0)return!1;o-=1}return!1}};var{getLocation:Noe}=(Q0(),p_(X0)),Qp=class{constructor(){this.hasNodeModules=new Map}register(e){e.subscriptions.push(Gt.languages.registerCompletionItemProvider({language:"jsonc",pattern:"**/launch.json"},this),ce(Gt.commands,"extension.js-debug.completion.nodeTool",async(t,n)=>{await new eE().selectAndInsertDebugConfig(t,n)}))}async provideCompletionItems(e,t,n){return await this.canProvideCompletions(e,t)?[{command:{command:"extension.js-debug.completion.nodeTool",title:Zp.t("Run Node.js tool"),arguments:[e,t,n]},documentation:Zp.t("Runs a Node.js command-line installed in the workspace node_modules."),sortText:"AAAA",preselect:!0,kind:Gt.CompletionItemKind.Enum,label:Zp.t("Run Node.js tool"),insertText:new Gt.SnippetString}]:[]}async canProvideCompletions(e,t){if(Un.basename(e.uri.fsPath)!=="launch.json")return!1;let n=Noe(e.getText(),e.offsetAt(t));if(!(n.path[0]==="configurations"&&n.path.length===2))return!1;let i=Gt.workspace.getWorkspaceFolder(e.uri);if(!i)return!1;let o=this.hasNodeModules.get(i)??!!await br(tE,Un.join(i.uri.fsPath,"node_modules",".bin"));return this.hasNodeModules.set(i,o),o}};Qp=S([(0,T$.injectable)()],Qp);var eE=class extends iS{async getLaunchConfig(e){let t=Gt.window.createQuickPick();t.title=Zp.t("Select a tool to run"),t.busy=!0,t.show();let n=await this.getOptions(e);if(n.length===0){t.dispose(),Gt.window.showWarningMessage(Zp.t("No npm scripts found in the workspace folder."));return}let i=[];for(let{names:s,relativeDir:a}of n)a&&i.push({label:a,kind:Gt.QuickPickItemKind.Separator,relativeDir:a}),i=i.concat(s.map(c=>({label:c,relativeDir:a})));t.busy=!1,t.items=i;let o=await new Promise(s=>{t.onDidAccept(()=>s(t.selectedItems[0])),t.onDidHide(()=>s(void 0))});if(t.dispose(),!!o)return{type:rs("pwa-node"),request:"launch",name:`Run ${o.label}`,runtimeExecutable:o.label,cwd:Un.join("${workspaceFolder}",o.relativeDir).replaceAll("\\","/"),args:[]}}async getOptions(e){if(!e)return[];let t=await Gt.workspace.findFiles(new Gt.RelativePattern(e,"**/package.json"));return(await Promise.all(t.map(async i=>{try{let o=Un.dirname(i.fsPath),s=await tE.readdir(Un.join(o,"node_modules",".bin")),a=new Set;for(let c of s){let u=Un.extname(c);a.add(u?c.slice(0,-u.length):c)}return{relativeDir:Un.relative(e.uri.fsPath,o),names:Array.from(a)}}catch{return}}))).filter(et)}};var rE=b(ie()),Lh=b(N());var P$="linkBpWarnIgnored",Foe="https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_can-i-debug-if-im-using-symlinks",ed=class{constructor(e,t){this.vscode=e;this.context=t;this.didWarn=this.context.workspaceState.get(P$,!1)}async warn(){if(this.didWarn)return;this.didWarn=!0;let e=rE.t("Read More"),t=rE.t("Ignore"),n=await this.vscode.window.showWarningMessage("It looks like you have symlinked files. You might need to update your configuration to make this work as expected.",t,e);n===t?this.context.workspaceState.update(P$,!0):n===e&&this.vscode.env.openExternal(this.vscode.Uri.parse(Foe))}};ed=S([(0,Lh.injectable)(),g(0,(0,Lh.inject)(Ft)),g(1,(0,Lh.inject)($e))],ed);var Mh=b(ie()),oS=b(N()),k$=require("path"),Qo=b(require("vscode"));var E$="omitLongPredictions",td=class{constructor(e){this.context=e}register(e){e.subscriptions.push(Qo.debug.onDidReceiveDebugSessionCustomEvent(t=>{t.event==="longPrediction"&&this.promptLongBreakpoint(t.session.workspaceFolder)}))}async promptLongBreakpoint(e){if(this.context.workspaceState.get(E$))return;let t=Mh.t("It's taking a while to configure your breakpoints. You can speed this up by updating the 'outFiles' in your launch.json."),n=Mh.t("Open launch.json"),i=Mh.t("Don't show again"),o=await Qo.window.showWarningMessage(t,i,n);if(o===i){this.context.workspaceState.update(E$,!0);return}if(o!==n)return;if(e||(e=await Qo.window.showWorkspaceFolderPick()),!e){await Qo.window.showWarningMessage(Mh.t("No workspace folder open."));return}let s=await Qo.workspace.openTextDocument((0,k$.join)(e.uri.fsPath,".vscode","launch.json"));await Qo.window.showTextDocument(s)}};td=S([(0,oS.injectable)(),g(0,(0,oS.inject)($e))],td);var nE=require("buffer"),sS=b(N()),ee=b(require("vscode"));var R$=Object.keys({requestWillBeSent:0,responseReceived:0,responseReceivedExtraInfo:0,loadingFailed:0,loadingFinished:0});var rd=class{constructor(e){this.debugSessionTracker=e;this.disposables=new pe;this.activeListeners=new pe;this.treeDataChangeEmitter=new ee.EventEmitter;this.models=new Map;this.onDidChangeTreeData=this.treeDataChangeEmitter.event;this.disposables.push(ee.debug.onDidChangeActiveDebugSession(()=>{this.listenToActiveSession()}),this.debugSessionTracker.onSessionEnded(t=>{this.models.delete(t.id)}),ee.debug.onDidReceiveDebugSessionCustomEvent(t=>{t.event==="networkEvent"&&this.models.get(t.session.id)?.append([t.body.event,t.body.data])}),this.debugSessionTracker.onSessionAdded(t=>{this.isEnabled()&&t.customRequest("enableNetworking",{mirrorEvents:R$}).then(()=>{this.models.set(t.id,new oE(t)),t===ee.debug.activeDebugSession&&this.listenToActiveSession()},()=>{})}),ce(ee.commands,"extension.js-debug.network.viewRequest",async t=>{let n=await ee.workspace.openTextDocument(t.fsUri);await ee.window.showTextDocument(n)}),ce(ee.commands,"extension.js-debug.network.copyUri",async t=>{await ee.env.clipboard.writeText(t.init.request.url)}),ce(ee.commands,"extension.js-debug.network.openBody",async t=>{let n=await ee.workspace.openTextDocument(t.fsBodyUri);await ee.window.showTextDocument(n)}),ce(ee.commands,"extension.js-debug.network.openBodyInHex",async t=>{await ee.commands.executeCommand("vscode.openWith",t.fsBodyUri,"hexEditor.hexedit")}),ce(ee.commands,"extension.js-debug.network.replayXHR",async t=>{await t.session.customRequest("networkCall",{method:"replayXHR",params:{requestId:t.id}})}),ce(ee.commands,"extension.js-debug.network.clear",()=>{for(let t of this.models.values())t.clear();this.treeDataChangeEmitter.fire()}))}getTreeItem(e){return e.toTreeItem()}getChildren(e){return!e&&this.current?this.current.allRequests:[]}register(e){e.subscriptions.push(ee.window.registerTreeDataProvider("jsDebugNetworkTree",this),ee.workspace.registerFileSystemProvider(sm,new iE(this.debugSessionTracker,this.models),{isCaseSensitive:!0,isReadonly:!0}))}isEnabled(){return Ze(ee.workspace,"debug.javascript.enableNetworkView")}listenToActiveSession(){this.activeListeners.clear();let e=this.current=ee.debug.activeDebugSession&&this.models.get(ee.debug.activeDebugSession.id),t=!!e&&e.hasRequests;e&&this.activeListeners.push(e.onDidChange(n=>{this.treeDataChangeEmitter.fire(n.isNew?void 0:n.request),e.hasRequests&&!t&&(t=!0,is(ee.commands,"jsDebugNetworkAvailable",!0))})),is(ee.commands,"jsDebugNetworkAvailable",t),this.treeDataChangeEmitter.fire(void 0)}};rd=S([(0,sS.injectable)(),g(0,(0,sS.inject)(Le))],rd);var iE=class{constructor(e,t){this.tracker=e;this.models=t;this.changeFileEmitter=new ee.EventEmitter;this.onDidChangeFile=this.changeFileEmitter.event}watch(e){let[t,n]=e.path.split("/").slice(1),i=this.models.get(t);return i?i.onDidChange(({request:o,isNew:s})=>{let a=e.with({path:`${t}/${o.id}`});s&&!n?this.changeFileEmitter.fire([{type:ee.FileChangeType.Created,uri:a}]):n===o.id&&this.changeFileEmitter.fire([{type:ee.FileChangeType.Changed,uri:a}])}):Is}async stat(e){let[t,n]=e.path.split("/").slice(1),i=this.models.get(t);if(!i)throw ee.FileSystemError.FileNotFound(e);if(!n)return{type:ee.FileType.Directory,ctime:0,mtime:0,size:0};let o=i.getRequest(n);if(!o)throw ee.FileSystemError.FileNotFound(e);return{type:ee.FileType.File,ctime:o.ctime,mtime:o.mtime,size:o.isComplete?await o.body().then(s=>s?.length||0):0}}readDirectory(){return[]}createDirectory(){}async readFile(e){let[t,n,i]=e.path.split("/").slice(1),o=this.models.get(t)?.getRequest(n);if(!o)throw ee.FileSystemError.FileNotFound(e);return i==="body"?o.isComplete?await o.body()||Buffer.from("Body not available"):Buffer.from("Response is still loading..."):Buffer.from(await o.toCurl(this.tracker.getById(t)))}writeFile(){}delete(){}rename(){}},oE=class{constructor(e){this.session=e;this.requests=new Map;this.didChangeEmitter=new ee.EventEmitter;this.onDidChange=this.didChangeEmitter.event}get allRequests(){return[...this.requests.values()]}get hasRequests(){return this.requests.size>0}getRequest(e){return this.requests.get(e)}clear(){this.requests.clear()}append([e,t]){if(e==="requestWillBeSent"){let n=new sE(t,this.session);this.requests.set(t.requestId,n),this.didChangeEmitter.fire({request:n,isNew:!0})}else if(e==="responseReceived"||e==="loadingFailed"||e==="loadingFinished"||e==="responseReceivedExtraInfo"){let n=this.requests.get(t.requestId);if(!n)return;e==="responseReceived"?n.response=t.response||{}:e==="loadingFailed"?n.failed=t:e==="loadingFinished"?n.finished=t:e==="responseReceivedExtraInfo"&&(n.responseExtra=t),n.mtime=Date.now(),this.didChangeEmitter.fire({request:n,isNew:!1})}else tu(e,"unexpected network event")}},sE=class{constructor(e,t){this.init=e;this.session=t;this.ctime=Date.now();this.mtime=Date.now();this.body=ne(async()=>{try{let e=await this.session.customRequest("networkCall",{method:"getResponseBody",params:{requestId:this.init.requestId}});return e.body?e.base64Encoded?Buffer.from(e.body,"base64"):Buffer.from(e.body):this.session.type==="pwa-node"?Buffer.from("Response body inspection is not supported in Node.js yet."):void 0}catch{return}})}get isComplete(){return!!(this.finished||this.failed)}get id(){return this.init.requestId}get fsUri(){return ee.Uri.from({scheme:sm,path:`/${this.session.id}/${this.id}`})}get fsBodyUri(){return ee.Uri.from({scheme:sm,path:`/${this.session.id}/${this.id}/body`})}toTreeItem(){let e;this.isComplete?this.failed?e=new ee.ThemeIcon("error",new ee.ThemeColor("notebookStatusErrorIcon.foreground")):this.response&&this.response.status>=400?e=new ee.ThemeIcon("warning"):e=new ee.ThemeIcon("check",new ee.ThemeColor("notebookStatusSuccessIcon.foreground")):e=new ee.ThemeIcon("sync~spin",new ee.ThemeColor("notebookStatusRunningIcon.foreground"));let t="";this.failed?t+=`[${this.failed.errorText}] `:this.response&&(t+=`[${this.response.status}] `);let n,i;try{let s=new URL(this.init.request.url);n=s.host,i=s.pathname}catch{i=this.init.request.url}t+=`${this.init.request.method.toUpperCase()} ${i}`;let o=new ee.TreeItem(t,ee.TreeItemCollapsibleState.Collapsed);return o.iconPath=e,o.description=n,o.tooltip=this.init.request.url,o.id=this.init.requestId,o.collapsibleState=ee.TreeItemCollapsibleState.None,o}async toCurl(e){let t=this.toCurlCommand();if(!this.response)return t;let n=[t];n.push(`< HTTP ${this.responseExtra?.statusCode||this.response.status||"UNKOWN"}`);for(let o of Object.entries(this.responseExtra?.headers||this.response.headers||{}))n.push(`< ${o[0]}: ${o[1]}`);if(n.push("<"),this.failed&&(n.push("",`${this.failed.errorText}`),this.failed.blockedReason?n.push(`Blocked: ${this.failed.blockedReason}`):this.failed.corsErrorStatus&&n.push(`CORS error: ${this.failed.corsErrorStatus.corsError}`)),!this.isComplete||!e)return n.join(`
`);let i=await this.body()||Buffer.from("");if(!(0,nE.isUtf8)(i))n.push(`[binary data as base64]: ${i.toString("base64")}`);else{let o=i.toString();try{let s=JSON.parse(o);n.push(JSON.stringify(s,null,2))}catch{n.push(o)}}return n.join(`
`)}toCurlCommand(){let e=["curl","-v"];this.init.request.method!=="GET"&&e.push(`-X ${this.init.request.method}`);for(let[t,n]of Object.entries(this.init.request.headers||{}))e.push(`-H '${t}: ${n}'`);if(this.init.request.postDataEntries?.length){let t=this.init.request.postDataEntries.map(i=>i.bytes||"").join(""),n=Buffer.from(t,"base64");e.push((0,nE.isUtf8)(n)?`-d '${n.toString()}'`:"--data-binary '<data>'")}return e.push(`'${this.init.request.url}'`),e.join(" ")}};var aS=b(N()),id=require("vscode");var nd=class{constructor(e){this.leaseTracker=e;this.cachedResolutions=new Array(16).fill("");this.cachedResolutionIndex=0}register(e){typeof id.workspace.registerPortAttributesProvider=="function"&&e.subscriptions.push(id.workspace.registerPortAttributesProvider({portRange:[53e3,54e3]},this))}async providePortAttributes({port:e,pid:t}){if(t&&this.cachedResolutions.includes(`${e}:${t}`))return{port:e,autoForwardAction:id.PortAutoForwardAction.Ignore};if(await this.leaseTracker.isRegistered(e)){if(t){let n=this.cachedResolutionIndex++%this.cachedResolutions.length;this.cachedResolutions[n]=`${e}:${t}`}return{port:e,autoForwardAction:id.PortAutoForwardAction.Ignore}}}};nd=S([(0,aS.injectable)(),g(0,(0,aS.inject)(Ye))],nd);var cS=b(N()),D$=b(require("querystring")),hn=b(require("vscode"));var od=class{constructor(e){this.tracker=e;this.canPrettyPrintKey=new Cp("jsDebugCanPrettyPrint")}register(e){e.subscriptions.push(ce(hn.commands,"extension.js-debug.prettyPrint",()=>this.prettifyActive()),hn.window.onDidChangeActiveTextEditor(t=>this.updateEditorState(t)),this.tracker.onSessionAdded(()=>this.updateEditorState(hn.window.activeTextEditor)),this.tracker.onSessionEnded(()=>this.updateEditorState(hn.window.activeTextEditor)))}async prettifyActive(){let e=hn.window.activeTextEditor;if(!e||!this.canPrettyPrint(e))return;let{sessionId:t,source:n}=Boe(e.document.uri),i=t&&this.tracker.getById(t),o;if(i?o=[{session:i,result:await A$(i,n,e.selection.start)}]:o=await Promise.all(this.tracker.getConcreteSessions().map(async s=>{let a=await A$(s,n,e.selection.start);return{session:s,result:a}})),!o.some(s=>s.result.didReveal)){let s=o.find(a=>a.result.source);if(s){let a=await hn.workspace.openTextDocument(joe(s.session,s.result.source));await hn.window.showTextDocument(a)}}}canPrettyPrint(e){return this.tracker.isDebugging&&e.document.languageId==="javascript"&&!e.document.uri.path.endsWith("-pretty.js")}updateEditorState(e){if(!this.tracker.isDebugging){this.canPrettyPrintKey.value=void 0;return}e&&this.canPrettyPrint(e)&&e.document.uri.toString()!==this.canPrettyPrintKey.value?.[0]&&(this.canPrettyPrintKey.value=[e.document.uri.toString()])}};od=S([(0,cS.injectable)(),g(0,(0,cS.inject)(Le))],od);var A$=(r,e,t)=>r.customRequest("prettyPrintSource",{source:e,line:t.line,column:t.character}),Boe=r=>{let e=D$.parse(r.query),t=e.session,n={path:r.fsPath,sourceReference:Number(e.ref)||0};return{sessionId:t,source:n}},joe=(r,e)=>e.sourceReference?hn.Uri.from({scheme:"debug",path:e.path?.replace(/^\/+/g,"/"),query:`session=${r.id}&ref=${e.sourceReference}`}):hn.Uri.file(e.path||"");var Nh=b(ie()),Fh=b(N()),L$=b(require("path")),pi=b(require("vscode"));var O$="breakpointTerminationWarnedSlow",sd=class{constructor(e,t){this.fs=e;this.context=t;this.sortOrder=2;this.id="breakpoint";this.label=Nh.t("Pick Breakpoint");this.description=Nh.t("Run until a specific breakpoint is hit")}async onPick(e,t){if(t)return new uS(t);let n=pi.window.createQuickPick();n.canSelectMany=!0,n.matchOnDescription=!0,n.busy=!0;let i=await new Promise(o=>{n.onDidAccept(()=>o(n.selectedItems)),n.onDidHide(()=>o(void 0)),n.onDidChangeActive(async s=>{if(!s.length)return;let a=s[0].location,c=await pi.workspace.openTextDocument(a.uri);pi.window.showTextDocument(c,{selection:a.range,preview:!0,preserveFocus:!0})}),n.show(),(async()=>{let s=pi.debug.breakpoints.filter(u=>u.enabled&&u instanceof pi.SourceBreakpoint),a=await Promise.all(s.map(u=>e.getDebugProtocolBreakpoint(u))),c=await this.getCandidates(a,s);n.items=c,n.selectedItems=c,n.busy=!1})()});if(n.dispose(),!!i)return await this.warnSlowCode(),new uS(i.map(o=>Number(o.id)))}async warnSlowCode(){this.context.workspaceState.get(O$)||(pi.window.showWarningMessage(Nh.t('Profiling with breakpoints enabled can change the performance of your code. It can be useful to validate your findings with the "duration" or "manual" termination conditions.'),Nh.t("Got it!")),await this.context.workspaceState.update(O$,!0))}async getCandidates(e,t){if(e.length!==t.length)throw new Error("Mismatched breakpoint array lengths");let n=yo(o=>this.getFileLines(o));return(await Promise.all(t.map(async(o,s)=>{let a=e[s];if(!a||!a.id)return;let c=o.location,u=pi.workspace.getWorkspaceFolder(c.uri),l=u?L$.relative(u.uri.fsPath,c.uri.fsPath):c.uri.fsPath,p=await n(c.uri.fsPath);return{id:a.id,label:`${l}:${c.range.start.line}:${c.range.start.character}`,location:c,description:p?.[c.range.start.line]?.trim()}}))).filter(et)}async getFileLines(e){try{return(await this.fs.readFile(e,"utf-8")).split(`
`)}catch{return}}};sd=S([(0,Fh.injectable)(),g(0,(0,Fh.inject)(ue)),g(1,(0,Fh.inject)($e))],sd);var uS=class{constructor(e){this.breakpointIds=e}get customData(){return{stopAtBreakpoint:this.breakpointIds.slice()}}dispose(){}};var Gc=b(ie()),M$=b(N()),N$=b(require("vscode"));var lS=b(ie()),uo=b(require("vscode"));var Bh=class{constructor(e,t,n){this.session=e;this.impl=t;this.termination=n;this.statusChangeEmitter=new O;this.stopEmitter=new O;this._innerStatus=[];this.disposables=new pe;this.state=0;this.onStatusChange=this.statusChangeEmitter.event;this.onStop=this.stopEmitter.event;this.disposables.push(uo.debug.onDidReceiveDebugSessionCustomEvent(i=>{i.session===e&&i.event==="profilerStateUpdate"&&this.onStateUpdate(i.body)}),uo.debug.onDidTerminateDebugSession(i=>{i===e&&this.stopEmitter.fire(void 0)})),n&&(this.disposables.push(n),n.attachTo?.(this))}get status(){return this._innerStatus.filter(e=>!!e).join(", ")||void 0}async start(){try{await uo.window.withProgress({location:uo.ProgressLocation.Window,title:lS.t("Starting profile...")},()=>this.session.customRequest("startProfile",{type:this.impl.type,...this.termination?.customData}))}catch(e){uo.window.showErrorMessage(e.message),this.stopEmitter.fire(void 0)}}dispose(){this.state=2,this.disposables.dispose()}setFile(e){this.file=e}async stop(){this.state===0&&(this.setStatus(-1,lS.t("Saving")),this.state=1,await uo.window.withProgress({location:uo.ProgressLocation.Window,title:lS.t("Stopping profile...")},()=>this.session.customRequest("stopProfile",{})))}onStateUpdate(e){if(e.running){this.setStatus(0,e.label);return}this.state=2,this.stopEmitter.fire(this.file),this.dispose()}setStatus(e,t){this.state===0&&(e===-1?this._innerStatus=[t]:this._innerStatus[e]=t,this.statusChangeEmitter.fire(this.status))}};var ad=class{constructor(){this.sortOrder=1;this.id="duration";this.label=Gc.t("Duration");this.description=Gc.t("Run for a specific amount of time")}async onPick(e,t){if(t)return new pS(t*1e3);let n=N$.window.createInputBox();n.title=Gc.t("Duration of Profile"),n.placeholder=Gc.t('Profile duration in seconds, e.g "5"'),this.lastDuration&&(n.value=String(this.lastDuration)),n.onDidChangeValue(o=>{/^[0-9]+$/.test(o)?Number(o)<1?n.validationMessage=Gc.t("Please enter a number greater than 1"):n.validationMessage=void 0:n.validationMessage=Gc.t("Please enter a number")});let i=await new Promise(o=>{n.onDidAccept(()=>{if(n.validationMessage)return o(void 0);this.lastDuration=Number(n.value),o(new pS(this.lastDuration*1e3))}),n.onDidHide(()=>o(void 0)),n.show()});return n.dispose(),i}};ad=S([(0,M$.injectable)()],ad);var pS=class{constructor(e){this.duration=e;this.disposable=new pe}attachTo(e){let t=Date.now()+this.duration,n=()=>e.setStatus(1,`${Math.round((t-Date.now())/1e3)}s`),i=setTimeout(()=>e.stop(),this.duration),o=setInterval(n,1e3);n(),this.disposable.callback(()=>{clearTimeout(i),clearInterval(o)})}dispose(){this.disposable.dispose()}};var aE=b(ie()),F$=b(N());var cd=class{constructor(){this.sortOrder=0;this.id="manual";this.label=aE.t("Manual");this.description=aE.t("Run until manually stopped")}async onPick(){return new jh}};cd=S([(0,F$.injectable)()],cd);var jh=class{dispose(){}};var ud=Symbol("ITerminationConditionFactory");var lo=b(ie()),_a=b(N()),B$=require("os"),dS=require("path"),zt=b(require("vscode"));var Uoe=r=>"__pendingTargetId"in r.configuration,Sa=class{constructor(e,t,n,i){this.tracker=e;this.fs=t;this.sessionStates=n;this.terminationConditions=i;this.activeSessions=new Map;this.disposables=new pe;this.disposables.push(zt.debug.onDidReceiveDebugSessionCustomEvent(o=>{if(o.event!=="profileStarted")return;let s=o.body,a=this.activeSessions.get(o.session.id);a||(a=new Bh(o.session,Br.ctors.find(c=>c.type===s.type)||Br.ctors[0],new jh),this.registerSession(a)),a.setFile(s.file)}))}async start(e){let t,n=[...this.tracker.getConcreteSessions()].filter(Uoe);if(e.sessionId?t=n.find(u=>u.id===e.sessionId):t=await this.pickSession(n),!t)return;let i=t,o=this.activeSessions.get(i.id);if(o&&!await this.alreadyRunningSession(o))return;let s=await this.pickType(i,e.type);if(!s)return;let a;if(!s.instant&&(a=await this.pickTermination(i,e.termination),!a))return;let c=new Bh(i,s,a);c&&(this.registerSession(c,e.onCompleteCommand),await c.start(),s.instant&&await c.stop())}async stop(e){let t;if(e)t=this.activeSessions.get(e);else{let n=await this.pickSession([...this.activeSessions.values()].map(i=>i.session));t=n&&this.activeSessions.get(n.id)}t&&(this.sessionStates.remove(t.session.id),await t.stop())}dispose(){for(let e of this.activeSessions.values())e.dispose();this.activeSessions.clear(),this.disposables.dispose()}registerSession(e,t){this.activeSessions.set(e.session.id,e),this.sessionStates.add(e.session.id,lo.t("Profiling")),e.onStatusChange(()=>this.updateStatusBar()),e.onStop(n=>{n&&this.openProfileFile(e,t,e.session,n),this.activeSessions.delete(e.session.id),e.dispose(),this.updateStatusBar()}),this.updateStatusBar()}async openProfileFile(e,t,n,i){if(t)return Promise.all([zt.commands.executeCommand(t,{contents:await this.fs.readFile(i,"utf-8"),basename:(0,dS.basename)(i)+e.impl.extension}),this.fs.unlink(i)]);let o=n.workspaceFolder?.uri.fsPath??zt.workspace.workspaceFolders?.[0].uri.fsPath??(0,B$.homedir)(),s=Wb()+e.impl.extension,a=zt.Uri.file((0,dS.join)(o,s));await PD(this.fs,i,a.fsPath),await zt.commands.executeCommand(e.impl.editable?"vscode.open":"revealInExplorer",a)}updateStatusBar(){if(this.activeSessions.size===0){this.statusBarItem?.hide(),is(zt.commands,"jsDebugIsProfiling",!1);return}this.statusBarItem||(this.statusBarItem=zt.window.createStatusBarItem(zt.StatusBarAlignment.Right,500),this.statusBarItem.command="extension.js-debug.stopProfile"),is(zt.commands,"jsDebugIsProfiling",!0);let e=ms(this.activeSessions.values());e&&this.activeSessions.size===1?this.statusBarItem.text=e.status?lo.t("{0} Click to Stop Profiling ({1})","$(loading~spin)",e.status):lo.t("{0} Click to Stop Profiling","$(loading~spin)"):this.statusBarItem.text=lo.t("{0} Click to Stop Profiling ({1} sessions)","$(loading~spin)",this.activeSessions.size),this.statusBarItem.show()}async alreadyRunningSession(e){let t=lo.t("Yes"),n=lo.t("No");return await zt.window.showErrorMessage(lo.t("A profiling session is already running, would you like to stop it and start a new session?"),t,n)!==t?!1:(await this.stop(e.session.id),!0)}async pickSession(e){if(e.length===0)return;if(e.length===1)return e[0];let t=await zt.window.showQuickPick(e.map(n=>({label:n.name,id:n.id})));return t&&e.find(n=>n.id===t.id)}async pickType(e,t){let n=e.configuration;if(t)return Br.ctors.find(o=>o.type===t&&o.canApplyTo(n));let i=await this.pickWithLastDefault(lo.t("Type of profile"),Br.ctors.filter(o=>o.canApplyTo(n)),this.lastChosenType);return i&&(this.lastChosenType=i.label),i}async pickTermination(e,t){if(t){let i=typeof t=="string"?{type:t}:t;return this.terminationConditions.find(o=>o.id===i.type)?.onPick(e,...i.args??[])}let n=await this.pickWithLastDefault(lo.t("How long to run the profile"),this.terminationConditions,this.lastChosenTermination);return n&&(this.lastChosenTermination=n.label),n?.onPick(e)}async pickWithLastDefault(e,t,n){if(t.length<=1)return t[0];let i=zt.window.createQuickPick();i.title=e,i.items=t.slice().sort((s,a)=>s.label===n||a.label===n?s.label===n?-1:1:(s.sortOrder??0)-(a.sortOrder??0)).map(s=>({label:s.label,description:s.description,alwaysShow:!0}));let o=await new Promise(s=>{i.onDidAccept(()=>s(i.selectedItems[0]?.label)),i.onDidHide(()=>s(void 0)),i.show()});if(i.dispose(),!!o)return t.find(s=>s.label===o)}};Sa=S([(0,_a.injectable)(),g(0,(0,_a.inject)(Le)),g(1,(0,_a.inject)(ue)),g(2,(0,_a.inject)(Ju)),g(3,(0,_a.multiInject)(ud))],Sa);var U$=b(N()),q$=require("vscode");var j$=(r,e)=>{let t=r;for(let[n,i]of Object.entries(e))typeof i=="object"&&i?t[n]=Object.assign(t[n]||{},i):t[n]=i};var ld=class{constructor(){this.read=ne(()=>Ze(q$.workspace,"debug.javascript.resourceRequestOptions"))}provideOptions(e){j$(e,this.read()||{})}};ld=S([(0,U$.injectable)()],ld);var W$=b(N()),cE=require("vscode");var pd=class{register(e){e.subscriptions.push(ce(cE.commands,"extension.node-debug.startWithStopOnEntry",()=>cE.commands.executeCommand("workbench.action.debug.start",{config:{stopOnEntry:!0}})))}};pd=S([(0,W$.injectable)()],pd);var RE=b(ie()),GS=b(N()),oH=b(iH()),sH=require("url"),Ot=b(require("vscode"));var gd=class{constructor(e){this.defaultBrowser=e;this.enabledTerminals=new WeakSet;this.disposable=new pe;this.notifiedCantOpenOnWeb=!1;this.baseConfiguration=this.readConfig();this.disposable.push(Ot.workspace.onDidChangeConfiguration(t=>{t.affectsConfiguration("debug.javascript.debugByLinkOptions")&&(this.baseConfiguration=this.readConfig())}),Ot.window.registerTerminalLinkProvider(this))}enableHandlingInTerminal(e){this.enabledTerminals.add(e)}dispose(){this.disposable.dispose()}provideTerminalLinks(e){switch(this.baseConfiguration.enabled){case"off":return[];case"always":break;case"on":default:if(!this.enabledTerminals.has(e.terminal))return[]}let t=[],n=ne(()=>{if("cwd"in e.terminal.creationOptions&&e.terminal.creationOptions.cwd){let i=Ot.workspace.getWorkspaceFolder(typeof e.terminal.creationOptions.cwd=="string"?Ot.Uri.file(e.terminal.creationOptions.cwd):e.terminal.creationOptions.cwd);if(i)return i}return Ot.workspace.workspaceFolders?.[0]});for(let i of(0,oH.find)(e.line,"url")){let o=-1;for(;(o=e.line.indexOf(i.value,o+1))!==-1;){let s;try{s=new sH.URL(i.href)}catch{continue}s.protocol==="http:"&&!i.value.startsWith("http:")&&!Xg(s.hostname)&&(s.protocol="https:"),!(s.protocol!=="http:"&&s.protocol!=="https:")&&t.push({startIndex:o,length:i.value.length,tooltip:RE.t("Debug URL"),target:s,workspaceFolder:n()?.index})}}return t}async handleTerminalLink(e){await this.handleTerminalLinkInner(e)||Ot.env.openExternal(Ot.Uri.parse(e.target.toString()))}async handleTerminalLinkInner(e){if(!e.target)return!1;let t=e.target;if(Ot.env.uiKind===Ot.UIKind.Web)return this.notifiedCantOpenOnWeb||(Ot.window.showInformationMessage(RE.t("We can't launch a browser in debug mode from here. If you want to debug this webpage, open this workspace from VS Code on your desktop.")),this.notifiedCantOpenOnWeb=!0),!1;pO(t.hostname)&&(t.hostname="localhost");let n="pwa-chrome";try{await this.defaultBrowser.lookup()==="edge"&&(n="pwa-msedge")}catch{}let i=e.workspaceFolder!==void 0?Ot.workspace.workspaceFolders?.[e.workspaceFolder]:void 0;return Ot.debug.startDebugging(i,{...this.baseConfiguration,type:n,name:t.toString(),request:"launch",url:t.toString()}),!0}readConfig(){let e=Ze(Ot.workspace,"debug.javascript.debugByLinkOptions");return typeof e=="boolean"&&(e=e?"on":"off"),typeof e=="string"?{enabled:e}:{enabled:"on",...e}}};gd=S([(0,GS.injectable)(),g(0,(0,GS.inject)(Nl))],gd);var aH=r=>{r.bind(Ft).toConstantValue(require("vscode")),e$.forEach(e=>{r.bind(e).toSelf().inSingletonScope(),r.bind(jw).to(e)}),t$.forEach(e=>r.bind(Uw).to(e).inSingletonScope()),r.bind(dr).to(td).inSingletonScope(),r.bind(dr).to(qp).inSingletonScope(),r.bind(dr).to(xp).inSingletonScope(),r.bind(dr).to(Wc).inSingletonScope(),r.bind(dr).to(Vp).inSingletonScope(),r.bind(dr).to(pd).inSingletonScope(),r.bind(dr).to(nd).inSingletonScope(),r.bind(dr).to(zp).inSingletonScope(),r.bind(dr).to(Kp).inSingletonScope(),r.bind(dr).to(od).inSingletonScope(),r.bind(dr).to(Tp).inSingletonScope(),r.bind(dr).to(rd).inSingletonScope(),r.bind(dr).to(Qp).inSingletonScope().onActivation(De),r.bind(fh).to(ed).inSingletonScope(),r.bind(Le).toSelf().inSingletonScope().onActivation(De),r.bind(Sa).toSelf().inSingletonScope().onActivation(De),r.bind(Wc).toSelf().inSingletonScope(),r.bind(nc).to(Gp).inSingletonScope(),r.bind(Fc).to(gd).inSingletonScope().onActivation(De),r.bind(ud).to(ad).inSingletonScope(),r.bind(ud).to(cd).inSingletonScope(),r.bind(ud).to(sd).inSingletonScope(),r.bind(Do).toConstantValue(new Set),r.bind(wa).toSelf().inSingletonScope()},cH=r=>{r.bind(Dt).to(Ko).onActivation(De),r.bind(Dt).to(bp).onActivation(De),r.bind(Dt).to(yp).onActivation(De),r.bind(Dl).to(ld).inSingletonScope(),r.bind($u).to(Ip).inSingletonScope().onActivation(De)};var lH=(r,e,t,n)=>{let i=new JS.Container;return i.parent=r,i.bind(we).toConstantValue(e.launchConfig),i.bind(Ku).toConstantValue(i),i.bind(kr).toConstantValue(t),i.bind(nt).toConstantValue(n),i.bind(Qi).toConstantValue(e),i.bind(IW).toConstantValue(e.targetOrigin()),i.bind(Ba).to(Sc).inSingletonScope(),i.bind(xf).to(ks).inSingletonScope(),i.bind(Ui).to(Va).inSingletonScope(),i.bind(_y).to(ju).inSingletonScope(),i.bind(_s).toSelf().inSingletonScope(),e.sourcePathResolver&&i.bind(Re).toConstantValue(e.sourcePathResolver),i.bind(hc).toSelf(),i.bind(Fb).toDynamicValue(o=>o.container.get(hc).create()).inSingletonScope(),e.parent()&&(i.bind(Ga).to(Ha).inSingletonScope(),i.bind(qi).to(Au).inSingletonScope()),i.bind(xt).to(process.env.DA_TEST_DISABLE_TELEMETRY?Nc:Lr).inSingletonScope().onActivation(De),i.bind(Cn).toSelf().inSingletonScope(),i.bind(Bt).toSelf().inSingletonScope(),i.bind(Bs).toSelf().inSingletonScope(),i.bind(xs).to(Zi).inSingletonScope().onActivation(De),i.bind(Ds).toSelf().inSingletonScope(),i.bind(vl).to(bl).inSingletonScope(),i.bind(sb).to(sl).inSingletonScope(),i.bind(Sn).to(Nu).inSingletonScope(),i.bind(Rb).to(gl).inSingletonScope(),i.bind(Fs).to(ml).inSingletonScope(),i.bind(qy).to(Xu).inSingletonScope().onActivation(De),i.bind(qt).toSelf(),i.bind(sn).toSelf(),i.bind(an).toSelf(),i.bind(qb).to(Br).inSingletonScope(),i.bind(Vb).to(Sl).inSingletonScope(),i.bind(ob).to(il).inSingletonScope().onActivation(De),i},pH=r=>{let e=new JS.Container;e.parent=r,e.bind(Ku).toConstantValue(e),e.bind($).to(Dn).inSingletonScope().onActivation(De),e.bind(Ba).to(Sc).inSingletonScope(),e.bind(xt).to(process.env.DA_TEST_DISABLE_TELEMETRY?Nc:Lr).inSingletonScope().onActivation(De),e.bind(Ri).to(Ri).inSingletonScope(),e.bind(xo).to(xo).inSingletonScope(),e.bind(Ll).to(Ol).inSingletonScope(),e.bind(ku).to(Wl).inSingletonScope(),e.bind(Nn).to(tp),e.bind(no).toSelf().inSingletonScope().onActivation(De),e.bind(so).toSelf(),e.bind(Dt).to(ai).onActivation(De),e.bind(Dt).to(ip).onActivation(De),e.bind(Dt).to(op).onActivation(De),e.bind(Dt).to(up).onActivation(De),e.bind(_h).to(fp),e.bind(_h).to(hp),e.bind(Dc).to(ep).inSingletonScope(),cH(e),e.bind(Dt).to(ap).onActivation(De),e.bind(Rc).toSelf().inSingletonScope().onActivation(De),e.bind(Dt).toService(Rc),e.bind(Dt).to(Gl).inSingletonScope().onActivation(De),e.bind(Dt).to(Kl).inSingletonScope().onActivation(De),e.bind(Dt).to(zl).inSingletonScope().onActivation(De),e.bind(Dt).to(Jl).inSingletonScope().onActivation(De),e.bind(Dt).to(Mn).onActivation(De),e.bind(Dt).toDynamicValue(()=>r.get(io).createLauncher(e.get($))).inSingletonScope(),e.isBound(nc)||e.bind(nc).to(yl).inSingletonScope(),e.bind($x).to(Yu).inSingletonScope().onActivation(De);let t=n=>i=>new n(i.container.get(jx),i.container.get(ue),i.container.get(Ux));return e.bind(rc).toDynamicValue(t(KS.ChromeBrowserFinder)).inSingletonScope().whenTargetTagged("browser","chrome"),e.bind(rc).toDynamicValue(t(KS.EdgeBrowserFinder)).inSingletonScope().whenTargetTagged("browser","edge"),e},dH=r=>{let e=new JS.Container;return e.bind(Ku).toConstantValue(e),e.bind(io).toSelf().inSingletonScope(),e.bind(si).toSelf().inSingletonScope(),e.bind($u).to(mp).inSingletonScope(),e.bind(Ju).toConstantValue(new eo),e.bind(Nl).to(Ml).inSingletonScope(),e.bind(Gi).toConstantValue(r.storagePath),e.bind(tc).toConstantValue(r.isVsCode),e.bind(Iw).to(pp),e.bind(Ye).to(nl).inSingletonScope(),e.bind(jx).toConstantValue(process.env),e.bind(Ux).toConstantValue(uH.default),e.bind(ue).toConstantValue(zS.promises),e.bind(ur).toConstantValue(new Kr(zS.promises)),e.bind(Zn).toConstantValue(r.isRemote?"remote":"local"),r.context&&e.bind($e).toConstantValue(r.context),aH(e),e},fH=(r,e,t)=>{r.bind(Xf).toConstantValue(cU(e)),r.bind(we).toService(Xf),r.bind(xr).to(Xl).inSingletonScope(),r.bind(Su).toConstantValue(t),r.bind(Re).toDynamicValue(n=>n.container.get(xr).create(e,n.container.get($))).inSingletonScope(),r.bind(ur).toConstantValue(vg.create(e.__remoteFilePrefix,zS.promises,t)),r.bind(px).to(vs).inSingletonScope().onActivation(De),r.bind(Ss).to(Lu).inSingletonScope(),r.bind(it).toSelf().inSingletonScope().onActivation(De),r.bind(Ui).to(Va).inSingletonScope(),r.bind($a).toSelf().inSingletonScope(),r.bind(Ga).to(Ha).inSingletonScope(),r.bind(qi).to(Ru).inSingletonScope()};var SH=b(ie()),Jt=b(require("vscode"));var hH=b(ie()),es=b(N()),AE=b(require("path")),Ta=b(require("vscode"));var Kc=class extends qr{constructor(t,n,i,o,s,a){super(t,n,a,s);this.extensionContext=i;this.fs=o;this.telemetryItems=new Map}get deferredSocketName(){let t=this.extensionContext.environmentVariableCollection.get("VSCODE_INSPECTOR_OPTIONS");return t?new aw({VSCODE_INSPECTOR_OPTIONS:t.value}).inspectorOptions?.inspectorIpc:void 0}getProcessTelemetry(t){return Promise.resolve(t instanceof rp?this.telemetryItems.get(t.processId()):void 0)}resolveParams(t){if(t.type==="node-terminal"&&t.request==="launch")return t}async launchProgram(t){await this.applyInspectorOptions(this.extensionContext.environmentVariableCollection,t),this.program=new zo,this.program.stopped.then(n=>this.onProgramTerminated(n))}async refreshVariables(){this.run&&await this.applyInspectorOptions(this.extensionContext.environmentVariableCollection,this.run)}async applyInspectorOptions(t,n){let i;try{i=await this.resolveNodePath(n.params)}catch(c){if(c instanceof F&&c.cause.id===9229)i=new Vt("node",void 0);else throw c}let o=Ze(Ta.workspace,"debug.javascript.autoAttachFilter"),a=(await this.resolveEnvironment(n,i,{deferredMode:!0,inspectorIpc:this.deferredSocketName??n.serverAddress+".deferred",autoAttachMode:o,aaPatterns:o==="smart"?this.readSmartPatterns():void 0})).defined();t.persistent=!0,t.description=new Ta.MarkdownString(hH.t({message:'Enables Node.js [auto attach]({0}) debugging in "{1}" mode',comment:["{Locked='[auto attach]({0})'}","the 2nd placeholder is the setting value"],args:["https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_auto-attach",o]})),t.prepend("NODE_OPTIONS",a.NODE_OPTIONS),t.append("VSCODE_INSPECTOR_OPTIONS",a.VSCODE_INSPECTOR_OPTIONS)}readSmartPatterns(){let t=Ze(Ta.workspace,"debug.javascript.autoAttachSmartPattern"),n=Ta.workspace.workspaceFolders?.length===1?Ta.workspace.workspaceFolders[0].uri.fsPath:`{${Ta.workspace.workspaceFolders?.map(i=>i.uri.fsPath).join(",")}}`;return t?.map(i=>i.replace("${workspaceFolder}",n)).map(je)}async getBootloaderFile(t,n){let i=this.extensionContext.storagePath||this.extensionContext.globalStoragePath;if(i.includes(" ")&&n.isPreciselyKnown&&!n.has(0))throw new Qh(`The \`node\` version on your PATH is too old (${n.version?.major}), so we cannot enable auto-attach in your environment`,"https://github.com/microsoft/vscode-js-debug/issues/708");let o=AE.join(i,"bootloader.js");try{await this.fs.mkdir(i)}catch{}await Promise.all([MI(this.fs,cw,o),MI(this.fs,kW,AE.join(i,"watchdog.js"))]);let s=je(o);return{interpolatedPath:s.includes(" ")?`"${s}"`:s,dispose:()=>{}}}async spawnForChild(t){if(!this.run)return;let n=Number(t.pid??"0");this.telemetryItems.set(n,t.telemetry);let i=await Fn.attach({...t,ipcAddress:this.run.serverAddress});i.onEnd(()=>{this.telemetryItems.delete(n),i.dispose()})}static clearVariables(t){t.environmentVariableCollection.clear()}};Kc=S([(0,es.injectable)(),g(0,(0,es.inject)(Nn)),g(1,(0,es.inject)($)),g(2,(0,es.inject)($e)),g(3,(0,es.inject)(ue)),g(4,(0,es.inject)(xr)),g(5,(0,es.inject)(Ye))],Kc);var Qh=class extends Error{constructor(t,n){super(t);this.helpLink=n}};var yH=b(ie()),bH=require("os"),dt=b(require("vscode"));var mH=()=>{let r,e=ke(),t=(n,i)=>i==="connect"?o=>{e.resolve(o),r=o}:i==="disconnect"?()=>{e=ke(),r=void 0}:async(...o)=>(r||await e.promise)[i](...o);return new Proxy({},{get:t})};var OE=(r,e,t={},n=()=>!0)=>{let i=new Lr,o={...Ze(dt.workspace,"debug.javascript.terminalOptions"),internalConsoleOptions:"neverOpen"},s=mH();i.attachDap(s);let a=new Set,c=async u=>{let l=await e.getProcessTelemetry(u),p=l&&dt.Uri.file(l.cwd),d=p&&dt.workspace.getWorkspaceFolder(p);return d?d.uri:t.__workspaceFolder?dt.Uri.file(t.__workspaceFolder):dt.workspace.workspaceFolders?.[0].uri??p};return e.onTargetListChanged(async()=>{let u=await dt.workspace.requestWorkspaceTrust(),l=new Set;for(let p of e.targetList()){if(l.add(p),a.has(p)){a.delete(p);continue}let d=r.addDelegate(p,s,p.parent());if(!n(p)){p.detach();continue}if(p.targetInfo.openerId&&!p.parent()){p.detach();continue}if(!u){p.detach();continue}if(!p.parent()){let f=await c(p);dt.debug.startDebugging(f&&dt.workspace.getWorkspaceFolder(f),{...o,type:"node-terminal",name:"Node.js Process",request:"attach",delegateId:d,cwd:f?.fsPath,__workspaceFolder:f})}}for(let p of a)r.removeDelegate(p);a=l}),e.launch(os({...o,type:"node-terminal",name:lm.name,request:"launch",...t}),{dap:s,telemetryReporter:i,cancellationToken:jt,get targetOrigin(){return new Zl("<unset>")}})},vH=Symbol("Abort"),gH=(0,bH.homedir)(),ase=process.platform==="win32"?r=>r:r=>r.startsWith(gH)?`~${r.slice(gH.length)}`:r;async function cse(){let r=dt.workspace.workspaceFolders;return!r||r.length<2?r?.[0]:(await dt.window.showQuickPick(r.map(t=>({label:t.name,description:ase(t.uri.fsPath),folder:t})),{placeHolder:yH.t("Select current working directory for new terminal")}))?.folder??vH}var DE=class extends Ko{constructor(){super(...arguments);this.optionsReadyEmitter=new O;this.onOptionsReady=this.optionsReadyEmitter.event}createTerminal(t){return this.optionsReadyEmitter.fire(t),new Promise(n=>{let i=dt.window.onDidOpenTerminal(o=>{i.dispose(),n(o)})})}};function wH(r,e,t){let n=new Map,i=(s,a)=>new Ko(a,s,t.get(ue),t.get(si),t.get(Ye),t.get(Do),t.get(Fc));async function o(s,a,c,u,l=i){if(!c){let f=await cse();if(f===vH)return;c=f}if(a){for(let[f,h]of n)if(h.folder===c&&h.cwd===u?.cwd&&!h.launcher.targetList().length){f.show(!0),f.sendText(a);return}}let p=new oa,d=l(p,new Go(p,t.get(ue),uw,{}));d.onTerminalCreated(f=>{n.set(f,{launcher:d,folder:c,cwd:u?.cwd})});try{await OE(s,d,{command:a,...u,__workspaceFolder:c?.uri.fsPath},()=>{for(let[f,h]of n)if(h.launcher===d&&f.state.isInteractedWith)return!0;return!1})}catch(f){dt.window.showErrorMessage(f.message)}}r.subscriptions.push(dt.window.onDidCloseTerminal(s=>{n.delete(s)}),ce(dt.commands,"extension.js-debug.createDebuggerTerminal",(s,a,c)=>o(e,s,a,c)),dt.window.registerTerminalProfileProvider("extension.js-debug.debugTerminal",{provideTerminalProfile:()=>new Promise(s=>o(e,void 0,void 0,void 0,(a,c)=>{let u=new DE(c,a,t.get(ue),t.get(si),t.get(Ye),t.get(Do),t.get(Fc));return u.onOptionsReady(l=>s(new dt.TerminalProfile(l))),u}))}))}function _H(r,e,t){let n=new Map,i,o=s=>{let a=n.get(s);if(a)return a;let c=(async()=>{let u=new oa,l=Ze(Jt.workspace,"debug.javascript.terminalOptions");if(s){let d=s?.uri.fsPath;l={...l,cwd:d,__workspaceFolder:d}}let p=new Kc(new Go(u,t.get(ue),uw,l||{}),u,r,t.get(ue),t.get(si),t.get(Ye));return await OE(e,p,l),p.onTargetListChanged(()=>{p.targetList().length===0&&!i?i=setTimeout(()=>{n.delete(s),p.terminate()},5*60*1e3):i&&(clearTimeout(i),i=void 0)}),p})();return n.set(s,c),c};r.subscriptions.push(ce(Jt.commands,"extension.js-debug.setAutoAttachVariables",async()=>{try{return{ipcAddress:(await o(Jt.workspace.workspaceFolders?.[0])).deferredSocketName}}catch(s){if(s instanceof Qh&&s.helpLink){let a=SH.t("Details");await Jt.window.showErrorMessage(s.message,a)===a&&Jt.env.openExternal(Jt.Uri.parse(s.helpLink))}else await Jt.window.showErrorMessage(s.message)}}),ce(Jt.commands,"extension.js-debug.autoAttachToProcess",async s=>{try{let a=s.scriptName&&Jt.workspace.getWorkspaceFolder(Jt.Uri.file(s.scriptName));(await o(a||Jt.workspace.workspaceFolders?.[0])).spawnForChild(s)}catch(a){console.error(a),Jt.window.showErrorMessage(`Error activating auto attach: ${a.stack||a}`)}}),ce(Jt.commands,"extension.js-debug.clearAutoAttachVariables",()=>{Kc.clearVariables(r);for(let[s,a]of n.entries())n.delete(s),a.then(c=>c.terminate())}))}var IH=b(ie()),xH=require("url"),tr=b(require("vscode"));var YS=b(require("vscode"));var yd=class{constructor(){this.tunnels=new Map;this.disposable=new pe;this.disposable.push(YS.debug.onDidTerminateDebugSession(e=>this.destroySession(e.id)))}dispose(){return this.disposable.dispose()}destroySession(e){let t=this.tunnels.get(e);t&&(t.dispose(),this.tunnels.delete(e))}async request(e,t){let n=this.tunnels.get(e);n||(n=await YS.workspace.openTunnel({remoteAddress:{port:t.remotePort,host:"localhost"},localAddressPort:t.localPort??t.remotePort,label:t.label}),this.tunnels.set(e,n));let i;if(typeof n.localAddress=="string"){let[o,s]=n.localAddress.split(":");i={host:o,port:Number(s)}}else i=n.localAddress;return{remoteAddress:n.remoteAddress,localAddress:i}}};var use=r=>e=>typeof e.localAddress=="string"?e.localAddress.endsWith(`:${r}`):e.localAddress.port===r,lse=async r=>{let e=r.params.url;if(!e)return;let t;try{t=new xH.URL(e)}catch{return}if(!Ze(tr.workspace,"debug.javascript.automaticallyTunnelRemoteServer"))return;let n=Number(t.port)||80;if(!(await tr.workspace.tunnels).some(use(n)))try{await tr.workspace.openTunnel({remoteAddress:{port:n,host:"localhost"},localAddressPort:n})}catch{}},pse=async(r,e,t)=>{if(tr.env.uiKind===tr.UIKind.Web)return tr.debug.stopDebugging(r),tr.window.showErrorMessage(IH.t("We can't launch a browser in debug mode from here. Open this workspace in VS Code on your desktop to enable debugging."));try{let[,n]=await Promise.all([lse(t),e.request(r.id,{remotePort:t.serverPort,label:"Browser Debug Tunnel"}).catch(()=>{})]);await tr.commands.executeCommand("js-debug-companion.launchAndAttach",{proxyUri:n?`127.0.0.1:${n.localAddress.port}`:`127.0.0.1:${t.serverPort}`,wslInfo:process.env.WSL_DISTRO_NAME&&{execPath:process.execPath,distro:process.env.WSL_DISTRO_NAME,user:process.env.USER},...t})}catch(n){tr.window.showErrorMessage(`Error launching browser: ${n.message||n.stack}`)}},dse=async(r,e,{launchId:t})=>{await tr.commands.executeCommand("js-debug-companion.kill",{launchId:t}),e.destroySession(r.id)};function CH(r){let e=new yd;r.subscriptions.push(e,tr.debug.onDidReceiveDebugSessionCustomEvent(async t=>{switch(t.event){case"launchBrowserInCompanion":return pse(t.session,e,t.body);case"killCompanionBrowser":return dse(t.session,e,t.body);default:}}))}var se=b(require("vscode")),Vn=require("vscode");var XS=()=>Vn.l10n.t("XHR/Fetch URLs"),TH="jsDebug.focusEmulation.enabled",bd=class extends se.TreeItem{get checked(){return this.checkboxState===se.TreeItemCheckboxState.Checked}constructor(e,t){super(e.match?Vn.l10n.t('URL contains "{0}"',e.match):Vn.l10n.t("Any XHR or fetch"),se.TreeItemCollapsibleState.None),this.contextValue="xhrBreakpoint",this.id=e.match,this.match=e.match,this.checkboxState=t?se.TreeItemCheckboxState.Checked:se.TreeItemCheckboxState.Unchecked}static compare(e,t){return e.match.localeCompare(t.match)}},Zh=class extends se.TreeItem{constructor(t,n){super(t.title,se.TreeItemCollapsibleState.None);this.parent=n;this.checkboxState=se.TreeItemCheckboxState.Unchecked,this.id=t.id,this.group=t.group}get checked(){return this.checkboxState===se.TreeItemCheckboxState.Checked}static compare(t,n){return t.id.localeCompare(n.id)}},Jc=class extends se.TreeItem{constructor(t){super(t,se.TreeItemCollapsibleState.Collapsed);this.label=t;this.children=[];this.checkboxState=se.TreeItemCheckboxState.Unchecked}get checked(){return this.checkboxState===se.TreeItemCheckboxState.Checked}},em=class extends se.TreeItem{get checked(){return this.checkboxState===se.TreeItemCheckboxState.Checked}constructor(){super(Vn.l10n.t("Browser Breakpoints"),se.TreeItemCollapsibleState.Collapsed),this.checkboxState=se.TreeItemCheckboxState.Unchecked,this.id="browserBreakpoints"}},QS=class extends se.TreeItem{constructor(e){super(Vn.l10n.t("Emulate a focused page"),se.TreeItemCollapsibleState.None),this.checkboxState=e?se.TreeItemCheckboxState.Checked:se.TreeItemCheckboxState.Unchecked,this.tooltip=Vn.l10n.t("When enabled, the debugged page will behave as if it has focus"),this.id="focusEmulation"}},LE=class{constructor(e,t){this._onDidChangeTreeData=new O;this.onDidChangeTreeData=this._onDidChangeTreeData.event;this._breakpointsRoot=new em;this.categories=new Map;this.xhrBreakpoints=[];this._emulationSessions=new Set;this._focusEmulationEnabled=!1;this._focusEmulationEnabled=t;for(let i of[...pl().values()]){let o=this.categories.get(i.group);o||(o=new Jc(i.group),this.categories.set(i.group,o)),o.children.push(new Zh(i,o))}let n=new Jc(XS());n.contextValue="xhrCategory",n.checkboxState=void 0,this.categories.set(XS(),n),this.xhrBreakpoints=[],this._debugSessionTracker=e,e.onSessionAdded(i=>{if(!Le.isConcreteSession(i))return;let o=this.allBreakpoints.filter(s=>s.checked).map(s=>s.id);o.length>0&&i.customRequest("setCustomBreakpoints",{xhr:this.xhrBreakpoints.filter(s=>s.checkboxState).map(s=>s.id),ids:o}),this._checkEmulationSupport(i)}),e.onSessionEnded(i=>{this._emulationSessions.delete(i.id)&&this._onDidChangeTreeData.fire(void 0)})}get allCategories(){return this.categories.values()}get allBreakpoints(){return[...this.allCategories].flatMap(e=>e.children)}getTreeItem(e){return e}getChildren(e){if(!e){let t=[this._breakpointsRoot];return this._emulationSessions.size>0&&t.unshift(new QS(this._focusEmulationEnabled)),t}if(e instanceof em)return[...this.categories.values()].sort((t,n)=>t.label.localeCompare(n.label));if(e instanceof Jc){if(e.contextValue==="xhrCategory"){let t=Vn.l10n.t("Add new URL..."),n=new se.TreeItem(t);return n.command={title:t,command:"extension.js-debug.addXHRBreakpoints"},[...this.xhrBreakpoints,n]}return this.categories.get(e.label)?.children}return[]}getParent(e){if(e instanceof Jc)return this._breakpointsRoot;if(e instanceof Zh)return this.categories.get(e.group);if(e instanceof bd)return this.categories.get(XS())}setFocusEmulation(e){this._focusEmulationEnabled=e,this._onFocusEmulationChanged?.(e),this._applyFocusEmulationToAllSessions(),this._onDidChangeTreeData.fire(void 0)}setBreakpointsEnabled(e){for(let[t,n]of e){let i=n?se.TreeItemCheckboxState.Checked:se.TreeItemCheckboxState.Unchecked;if(t.checkboxState=i,t instanceof em){for(let o of this.categories.values()){o.checkboxState=i;for(let s of o.children)s.checkboxState=i}for(let o of this.xhrBreakpoints)o.checkboxState=i;this.syncXHRCategoryState()}else if(t instanceof Jc){for(let o of this.getChildren(t))o.checkboxState!==i&&(o.checkboxState=i);this._syncBreakpointsRootState()}else if(t instanceof Zh||t instanceof bd){let o=this.getParent(t);(!n&&o.checked||n&&this.getChildren(o).every(s=>s.checked||s.checkboxState==null))&&(o.checkboxState=i),this._syncBreakpointsRootState()}}this.updateDebuggersState(),this._onDidChangeTreeData.fire(void 0)}updateDebuggersState(){let e=this.allBreakpoints.filter(n=>n.checked).map(n=>n.id),t=this.xhrBreakpoints.filter(n=>n.checked).map(n=>n.id);for(let n of this._debugSessionTracker.getConcreteSessions())n.customRequest("setCustomBreakpoints",{xhr:t,ids:e})}addXHRBreakpoints(e){this.xhrBreakpoints.some(t=>t.id===e.id)||(this.xhrBreakpoints.push(e),this.updateDebuggersState(),this.syncXHRCategoryState(),this._onDidChangeTreeData.fire(void 0))}removeXHRBreakpoint(e){this.xhrBreakpoints=this.xhrBreakpoints.filter(t=>t!==e),this.updateDebuggersState(),this.syncXHRCategoryState(),this._onDidChangeTreeData.fire(void 0)}syncXHRCategoryState(){let e=this.categories.get(XS());if(e){if(!this.xhrBreakpoints.length){e.checkboxState=void 0;return}e.checkboxState=this.xhrBreakpoints.every(t=>t.checkboxState===se.TreeItemCheckboxState.Checked)?se.TreeItemCheckboxState.Checked:se.TreeItemCheckboxState.Unchecked}}_syncBreakpointsRootState(){let e=[...this.categories.values()].every(t=>t.checked);this._breakpointsRoot.checkboxState=e?se.TreeItemCheckboxState.Checked:se.TreeItemCheckboxState.Unchecked}async _checkEmulationSupport(e){try{(await e.customRequest("canEmulate",{})).supported&&(this._emulationSessions.add(e.id),this._onDidChangeTreeData.fire(void 0),this._focusEmulationEnabled&&e.customRequest("setFocusEmulation",{enabled:!0}))}catch{}}_applyFocusEmulationToAllSessions(){for(let e of this._emulationSessions){let t=this._debugSessionTracker.getById(e);t&&t.customRequest("setFocusEmulation",{enabled:this._focusEmulationEnabled})}}};function PH(r,e){let t=r.workspaceState.get(TH,!1),n=new LE(e,t);n._onFocusEmulationChanged=o=>r.workspaceState.update(TH,o);let i=se.window.createTreeView("jsBrowserBreakpoints",{treeDataProvider:n,showCollapseAll:!0,manageCheckboxStateManually:!0});r.subscriptions.push(i.onDidChangeCheckboxState(async o=>{let s=[];for(let[a,c]of o.items){let u=c===se.TreeItemCheckboxState.Checked;a instanceof QS?n.setFocusEmulation(u):s.push([a,u])}s.length&&n.setBreakpointsEnabled(s)})),r.subscriptions.push(i),r.subscriptions.push(se.commands.registerCommand("extension.js-debug.addCustomBreakpoints",async()=>{let o=[...n.allCategories].flatMap(c=>[{kind:se.QuickPickItemKind.Separator,id:"",label:c.label},...c.children.map(u=>({id:u.id,label:`${u.label}`,picked:u.checked}))]),s=await se.window.showQuickPick(o,{canPickMany:!0,placeHolder:"Select breakpoints to enable"});if(!s)return;let a=new Set(s.map(c=>c.id));n.setBreakpointsEnabled(n.allBreakpoints.map(c=>[c,a.has(c.id)]))})),r.subscriptions.push(se.commands.registerCommand("extension.js-debug.removeAllCustomBreakpoints",()=>{n.setBreakpointsEnabled([...n.allBreakpoints,...n.xhrBreakpoints].map(o=>[o,!1]))})),r.subscriptions.push(se.commands.registerCommand("extension.js-debug.addXHRBreakpoints",()=>{let o=se.window.createInputBox();o.title=Vn.l10n.t("Add XHR Breakpoint"),o.placeholder=Vn.l10n.t("Break when URL Contains"),o.onDidAccept(()=>{let s=o.value;n.addXHRBreakpoints(new bd({match:s},!0)),o.dispose()}),o.show()})),r.subscriptions.push(se.commands.registerCommand("extension.js-debug.editXHRBreakpoints",o=>{let s=se.window.createInputBox();s.title=Vn.l10n.t("Edit XHR Breakpoint"),s.placeholder=Vn.l10n.t("Enter a URL or a pattern to match"),s.value=o.match,s.onDidAccept(()=>{let a=s.value;n.removeXHRBreakpoint(o),n.addXHRBreakpoints(new bd({match:a},o.checkboxState==se.TreeItemCheckboxState.Checked)),s.dispose()}),s.show()})),r.subscriptions.push(se.commands.registerCommand("extension.js-debug.removeXHRBreakpoint",o=>{n.removeXHRBreakpoint(o)}))}var ME=b(require("vscode"));var EH=(r,e)=>{let t=e.get(Sa);r.subscriptions.push(ce(ME.commands,"extension.js-debug.startProfile",n=>t.start(typeof n=="string"?{sessionId:n}:n??{})),ce(ME.commands,"extension.js-debug.stopProfile",n=>t.stop(n)))};var ZS=b(require("vscode"));var kH=(r,e)=>{let t=new yd;r.subscriptions.push(t,ce(ZS.commands,"extension.js-debug.requestCDPProxy",async(n,i)=>{let o=e.getById(n);if(!o)return;let s=await o.customRequest("requestCDPProxy");if(!i)return s;try{if(ZS.env.remoteName!==void 0){let a=await t.request(n,{label:"Edge Devtools Tunnel",remotePort:s.port});return{host:a.localAddress.host,port:a.localAddress.port,path:s.path}}}catch{}return s}))};var RH=b(require("vscode"));var AH=(r,e)=>{r.subscriptions.push(ce(RH.commands,"extension.js-debug.revealPage",async t=>{await e.getById(t)?.customRequest("revealPage")}))};var DH=require("url"),tm=b(require("vscode"));async function OH(r){if(!r){let e=tm.window.activeTextEditor;if(!e)return;r=e&&e.document.fileName}if(r&&tm.debug.activeDebugSession){let e;typeof r=="string"?Ar(r)?e={resource:(0,DH.fileURLToPath)(r)}:e={resource:r}:e={sourceReference:r},await tm.debug.activeDebugSession.customRequest("toggleSkipFileStatus",e)}}var Pa=b(require("vscode"));var GH=require("fs"),zH=b(require("net"));var LH=`\r
\r
`,fse=0,rm=class{constructor(e,t,n){this.inputStream=e;this.outputStream=t;this._contentLength=-1;this._connectionId=fse++;this.msgEmitter=new O;this.messageReceived=this.msgEmitter.event;this.endedEmitter=new O;this.closed=this.endedEmitter.event;this._handleData=e=>{let t=new Mr;for(this._rawData=Buffer.concat([this._rawData,e]);;){if(this._contentLength>=0){if(this._rawData.length>=this._contentLength){let n=this._rawData.toString("utf8",0,this._contentLength);if(this._rawData=this._rawData.slice(this._contentLength),this._contentLength=-1,n.length>0)try{let i=JSON.parse(n);this.logger?.verbose("dap.receive",void 0,{connectionId:this._connectionId,message:i}),this.msgEmitter.fire({message:i,receivedTime:t})}catch(i){console.error("Error handling data: "+(i&&i.message))}continue}}else{let n=this._rawData.indexOf(LH);if(n!==-1){let o=this._rawData.toString("utf8",0,n).split(`\r
`);for(let s=0;s<o.length;s++){let a=o[s].split(/: +/);a[0]==="Content-Length"&&(this._contentLength=+a[1])}this._rawData=this._rawData.slice(n+LH.length);continue}}break}};this.logger=n,this._rawData=Buffer.alloc(0),e.on("end",()=>this.endedEmitter.fire()),e.on("data",this._handleData)}send(e,t=!0,n){let i=JSON.stringify(e);if(t){let s=e;e.type==="response"&&e.command==="source"&&(s={...e,body:{...e.body,content:"<script source>"}}),this.logger?.verbose("dap.send",void 0,{connectionId:this._connectionId,message:s})}let o=`Content-Length: ${Buffer.byteLength(i,"utf8")}\r
\r
${i}`;if(this.outputStream.destroyed){this.logger?.warn("dap.send","Message not sent. Connection was closed."),n?.();return}this.outputStream.write(o,"utf8",s=>{n?.(),s&&(console.log(e),this.logger?.error("dap.send","Error while writing to output stream",s),this.close())})}close(){this.inputStream.destroy(),this.outputStream.destroy()}setLogger(e){return this.logger=e,this}};var $H=b(ie()),n_=b(require("os"));var hse={connect:async()=>Is},NH=r=>({async connect(e){return await e.Debugger.setAsyncCallStackDepth({maxDepth:r}),Is}}),mse=r=>{let e=new O,t=!1,n=()=>{t||(t=!0,e.fire())};return{async connect(i){if(t)return await i.Debugger.setAsyncCallStackDepth({maxDepth:r}),Is;let o=new pe;return o.push(e.event(()=>{o.dispose(),i.Debugger.setAsyncCallStackDepth({maxDepth:r})}),i.Debugger.on("breakpointResolved",n),i.Debugger.on("paused",s=>{s.reason!=="instrumentation"&&n()})),o}}},MH=NH(32),FH=r=>r===!1?hse:r===!0?MH:"onAttach"in r?NH(r.onAttach):"onceBreakpointResolved"in r?mse(r.onceBreakpointResolved):MH;var $n=b(ie());var nm=class r{constructor(e,t,n,i){this.asyncStackPolicy=t;this.launchConfig=n;this._services=i;this._disposables=new pe;this._customBreakpoints=[];this._xhrBreakpoints=[];this._threadDeferred=ke();this.breakpointIdCounter=um();this._cdpProxyProvider=this._services.get(ob);this._configurationDoneDeferred=ke(),this.sourceContainer=i.get(Bt),this.breakpointManager=i.get(Cn);let o=i.get(Fb),s=i.get(xt);s.onFlush(()=>{s.report("breakpointStats",this.breakpointManager.statisticsForTelemetry()),s.report("statistics",this.sourceContainer.statistics())}),this.dap=e,this.dap.on("initialize",a=>this.onInitialize(a)),this.dap.on("setBreakpoints",a=>this._onSetBreakpoints(a)),this.dap.on("setExceptionBreakpoints",a=>this.setExceptionBreakpoints(a)),this.dap.on("configurationDone",()=>this.configurationDone()),this.dap.on("loadedSources",()=>this._onLoadedSources()),this.dap.on("disableSourcemap",a=>this._onDisableSourcemap(a)),this.dap.on("source",a=>this._onSource(a)),this.dap.on("threads",()=>this._onThreads()),this.dap.on("stackTrace",a=>this._withThread(c=>c.stackTrace(a))),this.dap.on("variables",a=>this._onVariables(a)),this.dap.on("readMemory",a=>this._onReadMemory(a)),this.dap.on("writeMemory",a=>this._onWriteMemory(a)),this.dap.on("setVariable",a=>this._onSetVariable(a)),this.dap.on("setExpression",a=>this._onSetExpression(a)),this.dap.on("continue",()=>this._withThread(a=>a.resume())),this.dap.on("pause",()=>this._withThread(a=>a.pause())),this.dap.on("next",()=>this._withThread(a=>a.stepOver())),this.dap.on("stepIn",a=>this._withThread(c=>c.stepInto(a.targetId))),this.dap.on("stepOut",()=>this._withThread(a=>a.stepOut())),this.dap.on("restartFrame",a=>this._withThread(c=>c.restartFrame(a))),this.dap.on("scopes",a=>this._withThread(c=>c.scopes(a))),this.dap.on("evaluate",a=>this.onEvaluate(a)),this.dap.on("completions",a=>this._withThread(c=>c.completions(a))),this.dap.on("exceptionInfo",()=>this._withThread(a=>a.exceptionInfo())),this.dap.on("setCustomBreakpoints",a=>this.setCustomBreakpoints(a)),this.dap.on("toggleSkipFileStatus",a=>this._toggleSkipFileStatus(a)),this.dap.on("toggleSkipFileStatus",a=>this._toggleSkipFileStatus(a)),this.dap.on("prettyPrintSource",a=>this._prettyPrintSource(a)),this.dap.on("locations",a=>this._onLocations(a)),this.dap.on("revealPage",()=>this._withThread(a=>a.revealPage())),this.dap.on("getPerformance",()=>this._withThread(a=>o.retrieve(a.cdp()))),this.dap.on("breakpointLocations",a=>this._breakpointLocations(a)),this.dap.on("createDiagnostics",a=>this._dumpDiagnostics(a)),this.dap.on("requestCDPProxy",()=>this._requestCDPProxy()),this.dap.on("setExcludedCallers",a=>this._onSetExcludedCallers(a)),this.dap.on("saveDiagnosticLogs",({toFile:a})=>this._saveDiagnosticLogs(a)),this.dap.on("setSourceMapStepping",a=>this._setSourceMapStepping(a)),this.dap.on("stepInTargets",a=>this._stepInTargets(a)),this.dap.on("setDebuggerProperty",a=>this._setDebuggerProperty(a)),this.dap.on("setSymbolOptions",a=>this._setSymbolOptions(a)),this.dap.on("networkCall",a=>this._doNetworkCall(a)),this.dap.on("enableNetworking",a=>this._withThread(c=>c.enableNetworking(a))),this.dap.on("canEmulate",()=>this._canEmulate()),this.dap.on("setFocusEmulation",a=>this._setFocusEmulation(a)),this.dap.on("getPreferredUILocation",a=>this._getPreferredUILocation(a))}async _getPreferredUILocation(e){let t;if(e.originalUrl&&(t=this.sourceContainer.getSourceByOriginalUrl(e.originalUrl)),!t&&e.source&&(t=this.sourceContainer.source(e.source)),!t){if(e.source)return{column:e.column,line:e.line,source:e.source};throw new F(C1())}let n=await this.sourceContainer.preferredUiLocation({columnNumber:e.column+1,lineNumber:e.line+1,source:t});return{column:n.columnNumber-1,line:n.lineNumber-1,source:await n.source.toDap()}}async _doNetworkCall({method:e,params:t}){return this._thread?this._thread.cdp().Network[e](t):Promise.resolve({})}async _canEmulate(){let t=(await this._threadDeferred.promise).cdp();if(this._emulationSupported===void 0){let n=await t.Schema.getDomains({});this._emulationSupported=n?.domains.some(i=>i.name==="Emulation")??!1}return{supported:this._emulationSupported}}async _setFocusEmulation(e){return await(await this._threadDeferred.promise).cdp().Emulation.setFocusEmulationEnabled({enabled:e.enabled}),{}}_setDebuggerProperty(e){return this._thread?.cdp().DotnetDebugger.setDebuggerProperty(e),Promise.resolve({})}_setSymbolOptions(e){return this._thread?.cdp().DotnetDebugger.setSymbolOptions(e),Promise.resolve({})}_breakpointLocations(e){return this._withThread(async t=>{let n=this.sourceContainer.source(e.source);return n?{breakpoints:(await this.breakpointManager.getBreakpointLocations(t,n,new tt(e.line,e.column||1),new tt(e.endLine||e.line+1,e.endColumn||e.column||1))).map(o=>o.uiLocations.find(s=>s.source===n)).filter(et).map(o=>({line:o.lineNumber,column:o.columnNumber}))}:{breakpoints:[]}})}_stepInTargets(e){return this._withThread(async t=>({targets:await t.getStepInTargets(e.frameId)}))}_setSourceMapStepping({enabled:e}){return this.sourceContainer.doSourceMappedStepping=e,Promise.resolve({})}async _saveDiagnosticLogs(e){let t=this._services.get($).getRecentLogs();return await this._services.get(ue).writeFile(e,t.map(n=>JSON.stringify(n)).join(`
`)),{}}async launchBlocker(){await this._configurationDoneDeferred.promise,await this._thread?.debuggerReady.promise,await this._services.get(vl).launchBlocker,await this.breakpointManager.launchBlocker()}async _onSetExcludedCallers({callers:e}){return(await this._threadDeferred.promise).setExcludedCallers(e),{}}async onInitialize(e){console.assert(e.linesStartAt1),console.assert(e.columnsStartAt1),this._services.get(xf).value=e;let t=r.capabilities(!0);return setTimeout(()=>this.dap.initialized({}),0),setTimeout(()=>this._thread?.dapInitialized(),0),t}static capabilities(e=!1){return{supportsConfigurationDoneRequest:!0,supportsFunctionBreakpoints:!1,supportsConditionalBreakpoints:!0,supportsHitConditionalBreakpoints:!0,supportsEvaluateForHovers:!0,supportsReadMemoryRequest:!0,supportsWriteMemoryRequest:!0,exceptionBreakpointFilters:[{filter:"all",label:$n.t("Caught Exceptions"),default:!1,supportsCondition:!0,description:$n.t("Breaks on all throw errors, even if they're caught later."),conditionDescription:'error.name == "MyError"'},{filter:"uncaught",label:$n.t("Uncaught Exceptions"),default:!1,supportsCondition:!0,description:$n.t("Breaks only on errors or promise rejections that are not handled."),conditionDescription:'error.name == "MyError"'}],supportsStepBack:!1,supportsSetVariable:!0,supportsRestartFrame:!0,supportsGotoTargetsRequest:!1,supportsStepInTargetsRequest:!0,supportsCompletionsRequest:!0,supportsModulesRequest:!1,additionalModuleColumns:[],supportedChecksumAlgorithms:[],supportsRestartRequest:!0,supportsExceptionOptions:!1,supportsValueFormattingOptions:!0,supportsExceptionInfoRequest:!0,supportTerminateDebuggee:!0,supportsDelayedStackTraceLoading:!0,supportsLoadedSourcesRequest:!0,supportsLogPoints:!0,supportsTerminateThreadsRequest:!1,supportsSetExpression:!0,supportsTerminateRequest:!1,completionTriggerCharacters:[".","[",'"',"'"],supportsBreakpointLocationsRequest:!0,supportsClipboardContext:!0,supportsExceptionFilterOptions:!0,supportsEvaluationOptions:!!e,supportsDebuggerProperties:!!e,supportsSetSymbolOptions:!!e,supportsANSIStyling:!0}}async _onSetBreakpoints(e){return this.breakpointManager.setBreakpoints(e,e.breakpoints?.map(()=>this.breakpointIdCounter())??[])}async setExceptionBreakpoints(e){return await this._services.get(vl).setBreakpoints(e),{}}async configurationDone(){return this._configurationDoneDeferred.resolve(),{}}async _onLoadedSources(){return{sources:await this.sourceContainer.loadedSources()}}async _onDisableSourcemap(e){let t=this.sourceContainer.source(e.source);if(!t)return Me($n.t("Source not found"));if(!(t instanceof yt))return Me($n.t("Source not a source map"));for(let n of t.compiledToSourceUrl.keys())this.sourceContainer.disableSourceMapForSource(n,!0);return await this._thread?.refreshStackTrace(),{}}async _onSource(e){e.source||(e.source={sourceReference:e.sourceReference}),e.source.path=Po(e.source.path);let t=this.sourceContainer.source(e.source);if(!t)return Me($n.t("Source not found"));let n=await t.content();return n===void 0?(t instanceof yt&&this.dap.suggestDisableSourcemap({source:e.source}),Me($n.t("Unable to retrieve source content"))):{content:n,mimeType:t.getSuggestedMimeType}}async _onThreads(){let e=[];return this._thread&&e.push({id:this._thread.id,name:this._thread.name()}),{threads:e}}findVariableStore(e){if(!this._thread)return;let t=this._thread.pausedVariables();if(t&&e(t))return t;if(e(this._thread.replVariables))return this._thread.replVariables}async _onLocations(e){let t=this.findVariableStore(o=>o.hasVariable(e.locationReference));if(!t||!this._thread)throw zd();let n=await t.getLocations(e.locationReference),i=await this._thread.rawLocationToUiLocationWithWaiting(this._thread.rawLocation(n));if(!i)throw zd();return{source:await i.source.toDap(),line:i.lineNumber,column:i.columnNumber}}async _onVariables(e){return{variables:await this.findVariableStore(n=>n.hasVariable(e.variablesReference))?.getVariables(e)??[]}}async _onReadMemory(e){let t=e.memoryReference,n=await this.findVariableStore(i=>i.hasMemory(t))?.readMemory(t,e.offset??0,e.count);return n?{address:"0",data:n.toString("base64"),unreadableBytes:e.count-n.length}:{address:"0",unreadableBytes:e.count}}async _onWriteMemory(e){let t=e.memoryReference;return{bytesWritten:await this.findVariableStore(i=>i.hasMemory(t))?.writeMemory(t,e.offset??0,Buffer.from(e.data,"base64"))}}async _onSetExpression(e){if(!this._thread)throw new F(YI());let t=await this._thread.evaluate({expression:`${e.expression} = ${Jd(e.value)}`,context:"repl",frameId:e.frameId});return{value:t.result,variablesReference:t.variablesReference,indexedVariables:t.indexedVariables,namedVariables:t.namedVariables,presentationHint:t.presentationHint,type:t.type,memoryReference:t.memoryReference,valueLocationReference:t.valueLocationReference}}async _onSetVariable(e){let t=this.findVariableStore(n=>n.hasVariable(e.variablesReference));return t?(e.value=Jd(e.value.trim()),t.setVariable(e)):Me($n.t("Variable not found"))}_withThread(e){if(!this._thread)throw new F(YI());return e(this._thread)}async _refreshStackTrace(){if(!this._thread)return;this._thread.pausedDetails()&&await this._thread.refreshStackTrace()}createThread(e,t){this._thread=new hl(this.sourceContainer,e,this.dap,t,this._services.get(Ss),this._services.get($),this._services.get(Sn),this._services.get(sb),this.launchConfig,this.breakpointManager,this._services.get(Rb),this._services.get(vl),this._services.get(Ds),this._services.get(Fs),this._services.get(xf));let n=this._services.get(Vb);return n.connect(this.dap,this._thread),"profileStartup"in this.launchConfig&&this.launchConfig.profileStartup&&n.start(this.dap,this._thread,{type:qt.type}),this._thread.updateCustomBreakpoints(this._xhrBreakpoints,this._customBreakpoints),this.asyncStackPolicy.connect(e).then(i=>this._disposables.push(i)).catch(i=>this._services.get($).error("internal","Error enabling async stacks",i)),this.breakpointManager.setThread(this._thread),this._services.get(it).attach(e),this._threadDeferred.resolve(this._thread),this._thread}async setCustomBreakpoints({ids:e,xhr:t}){return await this._thread?.updateCustomBreakpoints(t,e),this._customBreakpoints=e,this._xhrBreakpoints=t,{}}async _toggleSkipFileStatus(e){return await this._services.get(xs).toggleSkippingFile(e),await this._refreshStackTrace(),{}}async _prettyPrintSource(e){if(!e.source||!this._thread)return{};e.source.path=Po(e.source.path);let t=this.sourceContainer.source(e.source);if(!t)return Me($n.t("Source not found"));let n=await t.prettyPrint();if(!n)return Me($n.t("Unable to pretty print"));let{map:i,source:o}=n;await this.breakpointManager.moveBreakpoints(this._thread,t,i,o),this.sourceContainer.clearDisabledSourceMaps(t);let s=!!this._thread.pausedDetails();return await this._refreshStackTrace(),{source:await o.toDap(),didReveal:s}}onEvaluate(e){return e.expression===".scripts"?this._dumpDiagnostics({fromSuggestion:!1}).then(this.dap.openDiagnosticTool).then(()=>({result:"Opening diagnostic tool...",variablesReference:0})):this._withThread(t=>t.evaluate(e))}async _dumpDiagnostics(e){let t={file:await this._services.get(Bs).generateHtml()};return e.fromSuggestion&&this._services.get(xt).report("diagnosticPrompt",{event:"opened"}),t}async _requestCDPProxy(){return await this._cdpProxyProvider.proxy()}dispose(){this._disposables.dispose(),Ny(this._services)}};var BH=require("fs"),jH=require("inspector"),e_=class{constructor(e){this.file=e;this.session=new jH.Session;this.session.connect()}async start(){try{await this.post("Profiler.enable")}catch{}await this.post("Profiler.start")}async stop(){let{profile:e}=await this.post("Profiler.stop");await BH.promises.writeFile(this.file,JSON.stringify(e))}dispose(){this.session.disconnect()}post(e,t){return new Promise((n,i)=>this.session.post(e,t,(o,s)=>{o?i(o):n(s)}))}};var t_=b(require("path"));function qH(r,e,t){let n=UH(r,e,"uncaughtException",t),i=UH(r,e,"unhandledRejection",t);return process.addListener("uncaughtException",n),process.addListener("unhandledRejection",i),{dispose:()=>{process.removeListener("uncaughtException",n),process.removeListener("unhandledRejection",i)}}}var UH=(r,e,t,n=!0)=>i=>{bse(i)&&(e.report("error",{"!error":i,error:n?void 0:i,exceptionType:t}),r.error("runtime.exception","Unhandled error in debug adapter",i))},gse=r=>typeof r=="object"&&!!r&&"stack"in r,yse=t_.dirname(t_.dirname(t_.dirname(__dirname)));function bse(r){return!WH||gse(r)&&!!r.stack?.includes(yse)}var WH=!1;function VH(){WH=!0}var r_=class{constructor(e,t,n,i){this._delegate=e;this._rootServices=n;this._disposables=new pe;this._serviceTree=new WeakMap;this._root=new Yc(void 0);this.getLaunchers=ne(()=>{let e=new Set(this._rootServices.getAll(Dt));for(let t of e)this._disposables.push(t.onTargetListChanged(()=>{let n=this.targetList();this._attachToNewTargets(n,t),this._terminateOrphanThreads(n)}));return e});this._dap=t.dap(),this._targetOrigin=i,this._disposables.callback(()=>Ny(n)),this._disposables.push(qH(n.get($),n.get(xt),n.get(tc))),t.attachTelemetry(n.get(xt));let o=this._dap,s=0,a;o.on("initialize",async c=>{this._rootServices.bind(Or).toConstantValue(c);let u=nm.capabilities();return c.clientID==="vscode"&&VH(),setTimeout(()=>o.initialized({}),0),u}),o.on("setExceptionBreakpoints",async()=>({})),o.on("setBreakpoints",async c=>(c.breakpoints?.length&&n.get(it).notifyHadBreakpoint(),{breakpoints:c.breakpoints?.map(()=>({id:++s,verified:!1,message:$H.t("Unbound breakpoint")}))??[]})),o.on("configurationDone",async()=>({})),o.on("threads",async()=>({threads:[]})),o.on("loadedSources",async()=>({sources:[]})),o.on("breakpointLocations",()=>Promise.resolve({breakpoints:[]})),o.on("attach",async c=>(await this.boot(c,o),{})),o.on("launch",async c=>(await this.boot(c,o),{})),o.on("pause",async()=>({})),o.on("terminate",()=>this._terminateRoot(!0)),o.on("disconnect",c=>this._disconnectRoot(c)),o.on("restart",async({arguments:c})=>(await this._restart(c),{})),o.on("startSelfProfile",async({file:c})=>(a?.dispose(),a=new e_(c),await a.start(),{})),o.on("stopSelfProfile",async()=>(a&&(await a.stop(),a.dispose(),a=void 0),{})),o.on("enableNetworking",()=>Promise.resolve({}))}async _terminateRoot(e){return this._root.state=1,await Promise.all([...this.getLaunchers()].map(t=>t.terminate(e))),await this._root.waitUntilChildrenAre(2),this._root.state=2,{}}async _disconnectRoot(e){return this._root.state<1&&await this._terminateRoot(e.terminateDebuggee),this._rootServices.get(xt).flush(),await this._root.waitUntilChildrenAre(3),this._root.state=3,{}}async boot(e,t){return this._boot(os(e,this._rootServices.get(Zn)),t)}async _boot(e,t){vse(t),this.reportBootTelemetry(e),fH(this._rootServices,e,t),this._rootServices.get($).setup(FD(t,e.trace));let n=e.timeout>0?Rt.withTimeout(e.timeout):new Rt;e.rootPath&&(e.rootPath=Po(e.rootPath)),this._launchParams=e;let i=await Promise.all([...this.getLaunchers()].map(o=>this._launch(o,e,n.token)));return Promise.all(i.map(o=>o.terminated)).then(o=>{let s=o.find(et);this._markTargetAsTerminated(this._root,{restart:!!s?.restart})}),{}}reportBootTelemetry(e){let t=os({type:e.type,request:e.request,name:"<string>",__workspaceFolder:"<workspace>"}),n=(i,o)=>typeof i=="string"?o&&t[o]===i?i:"<string>":i instanceof Array?i.map(s=>n(s)):i&&typeof i=="object"?go(i,s=>n(s)):i;this._rootServices.get(xt).report("launch",{type:e.type,request:e.request,os:`${n_.platform()} ${n_.arch()}`,nodeVersion:process.version,adapterVersion:Ra,parameters:go(e,n)})}async _restart(e){let t;if(e){let n=this._rootServices.get(Xf);t=os({__workspaceFolder:n.__workspaceFolder,...e},this._rootServices.get(Zn)),n.update(t)}await Promise.all([...this.getLaunchers()].map(n=>n.restart(t)))}async _launch(e,t,n){return(await this.captureLaunch(e,t,n)).blockSessionTermination?{terminated:new Promise(o=>{let s=this._disposables.push(e.onTerminated(a=>{s.dispose(),o(a)}))})}:{terminated:Promise.resolve(void 0)}}async captureLaunch(e,t,n){let i=e.constructor.name,o;try{o=await e.launch(t,{telemetryReporter:this._rootServices.get(xt),cancellationToken:n,targetOrigin:this._targetOrigin,dap:this._dap})}catch(s){throw this._rootServices.get($).warn("runtime.launch","Launch returned error",{error:s,wasCancelled:n.isCancellationRequested,name:i}),s}return o.blockSessionTermination&&this._rootServices.get($).info("runtime.launch","Launched successfully",{name:i}),o}dispose(){this._disposables.dispose(),this._terminateOrphanThreads([])}targetList(){let e=[];for(let t of this.getLaunchers())e.push(...t.targetList());return e}async attach(e,t){if(!this._launchParams)throw new Error("Cannot launch before params have been set");let n=e.value;if(!n.canAttach())return;let i=await n.attach();if(!i)return;let o=await this._delegate.acquireDap(n),s=o.dap(),a=this._launchParams;this._asyncStackPolicy||(this._asyncStackPolicy=FH(a.showAsyncStacks));let c=n.parent(),u=c&&this._serviceTree.get(c)||this._rootServices,l=lH(u,n,s,i);o.attachTelemetry(l.get(xt)),this._serviceTree.set(n,u);let p=new nm(s,this._asyncStackPolicy,a,l),d=p.createThread(i,n);"inspectUri"in a&&!!a.inspectUri&&this.attachDotnetDebuggerEvent(i,this._rootServices.get(xt),this._rootServices.get(tc));let h=async()=>(await p.launchBlocker(),n.runIfWaitingForDebugger(),e.threadData.resolve({thread:d,debugAdapter:p}),{});s.on("disconnect",m=>this._disconnectTarget(e,m)),s.on("terminate",()=>this._terminateTarget(e)),s.on("restart",async()=>(n.canRestart()?n.restart():await this._restart(),Promise.resolve({}))),await this._delegate.initAdapter(p,n,t)?h():(s.on("attach",h),s.on("launch",h)),await n.afterBind()}attachDotnetDebuggerEvent(e,t,n){e.DotnetDebugger.on("reportBlazorDebugException",i=>{t.report("blazorDebugException",{exceptionType:i.exceptionType,"!error":i.exception,error:n?void 0:i.exception})})}_attachToNewTargets(e,t){for(let n of e.values()){if(!n.waitingForDebugger()||Yc.targetNodes.has(n))continue;let i=n.parent(),o=i?Yc.targetNodes.get(i):this._root;if(!o)throw new Error(`Got target with unknown parent: ${n.name()}`);let s=new Yc(n);o.add(s),this.attach(s,t)}}async _terminateOrphanThreads(e,t){let n=[...this._root.all()].filter(i=>!e.includes(i.value));return Promise.all(n.map(i=>this._markTargetAsTerminated(i,t)))}async _markTargetAsTerminated(e,t={}){if(e.state>=1)return await e.waitUntil(2),{};if(e.state=1,HH(e)){let n=await e.threadData.promise;await n.thread.dispose(),n.debugAdapter.dap.terminated(t),n.debugAdapter.dispose()}else this._dap.terminated(t);return await e.waitUntilChildrenAre(2),e.state=2,{}}async _terminateTarget(e){return e.state>=3?{}:(e.value.canStop()?e.value.stop():this._terminateRoot(!0),await e.waitUntil(2),{})}async _disconnectTarget(e,t){if(e.state>=3)return{};e.state<1&&(t.terminateDebuggee!==!0&&e.value.canDetach()?await e.value.detach():e.value.canStop()?e.value.stop():this._terminateRoot(t.terminateDebuggee)),await e.waitUntil(2),await e.waitUntilChildrenAre(3),e.state=3,queueMicrotask(()=>this._delegate.releaseDap(e.value));let n=e.value.parent();return(n?Yc.targetNodes.get(n):this._root)?.remove(e),{}}};function vse(r){gm&&r.output({category:"console",output:`Note: Using the "preview" debug extension
`})}var HH=r=>!!r.value,Yc=class r{constructor(e){this.value=e;this.threadData=ke();this._state=0;this._children=new Set;this._stateChangeEmitter=new O;e&&r.targetNodes.set(e,this)}static{this.targetNodes=new WeakMap}get state(){return this._state}set state(e){e>this._state&&(this._state=e,this._stateChangeEmitter.fire(e))}add(e){this._children.add(e)}remove(e){this._children.delete(e)}async waitUntil(e){return this._state>=e?Promise.resolve():new Promise(t=>{let n=this._stateChangeEmitter.event(i=>{i>=e&&(n.dispose(),t())})})}async waitUntilChildrenAre(e){await Promise.all([...this._children].map(t=>t.waitUntil(e)))}*all(){HH(this)&&(yield this);for(let e of this._children)yield*e.all()}};var i_=class{constructor(e,t,n,i,o){this.debugSession=e;this.logger=n;this.sessionStates=i;this.parent=o;this.subscriptions=new pe;t instanceof wu?this.connection=t:(t.setLogger(n),this.connection=new wu(t,this.logger))}listenToTarget(e){this.subscriptions.push(e.onNameChanged(()=>this.setName(e)),this.sessionStates.onAdd(([t])=>t===this.debugSession.id&&this.setName(e)),this.sessionStates.onRemove(([t])=>t===this.debugSession.id&&this.setName(e))),this.setName(e)}dispose(){this.subscriptions.dispose()}setName(e){let t=this.sessionStates.get(this.debugSession.id),n=e.name();this.parent instanceof vd&&(n=`${n} \xAB ${this.parent.debugSession.name}`),this.debugSession.name=t?`${n} (${t})`:n}},vd=class extends i_{constructor(t,n,i){super(t,n,i.get($),i.get(Ju));this.debugSession=t;this.services=i;this.connection.attachTelemetry(i.get(xt))}get binder(){return this._binder}createBinder(t){this._binder=new r_(t,this.connection,this.services,new rw(this.debugSession.id))}dispose(){super.dispose(),this._binder?.dispose?.()}},o_=class{constructor(e,t){this.globalContainer=e;this.sessionLauncher=t;this._disposables=[];this._sessions=new Map;this._pendingTarget=new Map;this._sessionForTarget=new Map;this._sessionForTargetCallbacks=new Map}terminate(e){let t=this._sessions.get(e.id);this._sessions.delete(e.id),t&&t.dispose()}hasPendingTargetId(e){return this._pendingTarget.has(e)}createNewRootSession(e,t){let n=new vd(e,t,pH(this.globalContainer));return n.createBinder(this),this._sessions.set(e.id,n),n}createNewChildSession(e,t,n){let i=this._pendingTarget.get(t);if(!i)throw new Error(`Cannot find target ${t}`);let{target:o,parent:s}=i,a=new i_(e,n,s.logger,s.sessionStates,s);this._pendingTarget.delete(t),a.debugSession.name=o.name(),a.listenToTarget(o);let c=this._sessionForTargetCallbacks.get(o);return this._sessionForTargetCallbacks.delete(o),c?.fulfill?.(a),this._sessions.set(e.id,a),a}async acquireDap(e){return(await this.getOrLaunchSession(e)).connection}getOrLaunchSession(e){let t=this._sessionForTarget.get(e);if(t)return t;let n=new Promise(async(i,o)=>{let s,a=e.parent();if(a?s=await this.getOrLaunchSession(a):s=this._sessions.get(e.targetOrigin().id),!s)throw new Error("Expected to get a parent debug session for target");this._pendingTarget.set(e.id(),{target:e,parent:s}),this._sessionForTargetCallbacks.set(e,{fulfill:i,reject:o});let c=s.debugSession.configuration,u={type:c.type==="pwa-extensionHost"?"pwa-chrome":c.type,name:e.name(),request:s.debugSession.configuration.request,__pendingTargetId:e.id(),internalConsoleOptions:c.internalConsoleOptions,preRestartTask:c.preRestartTask??c.postDebugTask,postRestartTask:c.postRestartTask??c.preLaunchTask};this.sessionLauncher.launch(s,e,u)});return this._sessionForTarget.set(e,n),n}initAdapter(e,t,n){return Promise.resolve(!1)}releaseDap(e){this._sessionForTarget.delete(e);let t=this._sessionForTargetCallbacks.get(e);t&&t.reject(new Error("Target gone")),this._sessionForTargetCallbacks.delete(e)}dispose(){for(let e of this._sessions.values())e.dispose();this._sessions.clear(),this._pendingTarget.clear(),this._sessionForTarget.clear(),this._sessionForTargetCallbacks.clear();for(let e of this._disposables)e.dispose();this._disposables=[]}};var s_=class{constructor(e,t,n="127.0.0.1"){this.host=n;this.disposables=[];this.servers=new Map;this.sessionManager=new o_(e,t),this.portLeaseTracker=e.get(Ye),this.disposables.push(this.sessionManager)}createDebugServer(e,t){return e.configuration.__pendingTargetId?this.createChildDebugServer(e):this.createRootDebugServer(e,t)}createRootDebugServer(e,t){return this.innerCreateServer(e,n=>this.sessionManager.createNewRootSession(e,n),t)}createRootDebugSessionFromStreams(e,t,n){let i=new rm(t,n);return this.sessionManager.createNewRootSession(e,i)}createChildDebugServer(e,t){return this.innerCreateServer(e,n=>this.sessionManager.createNewChildSession(e,e.configuration.__pendingTargetId,n),t)}async innerCreateServer(e,t,n){let i=ke(),o=a=>{let c=new rm(a,a),u=t(c);i.resolve(u.connection)},s=n===void 0?await new Promise((a,c)=>{let u=Sg(),l=zH.createServer(o).on("error",c).on("close",()=>GH.promises.unlink(u).catch(()=>{})).listen(u,()=>a(l))}):await DN(this.portLeaseTracker,o,n,this.host);return this.servers.set(e.id,s),{server:s,connectionPromise:i.promise}}terminate(e){this.sessionManager.terminate(e),this.servers.get(e.id)?.close(),this.servers.delete(e.id)}dispose(){this.sessionManager.dispose()}};var NE=class{launch(e,t,n){Pa.debug.startDebugging(e.debugSession.workspaceFolder,{...n,...t.supplementalConfig,serverReadyAction:e.debugSession.configuration.serverReadyAction,__parentId:e.debugSession.id},{parentSession:e.debugSession,consoleMode:Pa.DebugConsoleMode.MergeWithParent,noDebug:e.debugSession.configuration.noDebug,compact:e instanceof vd,lifecycleManagedByParent:!t.independentLifeycle})}},a_=class{constructor(e){this.sessionServerManager=new s_(e,new NE)}async createDebugAdapterDescriptor(e){let t=process.env.JS_DEBUG_USE_LOCAL_DAP_PORT;if(t)return new Pa.DebugAdapterServer(+t);let n=await this.sessionServerManager.createDebugServer(e);return new Pa.DebugAdapterNamedPipeServer(n.server.address())}terminate(e){this.sessionServerManager.terminate(e)}dispose(){this.sessionServerManager.dispose()}};function wse(r){ft.l10n.bundle&&KH.config({contents:ft.l10n.bundle});let e=dH({storagePath:process.platform==="win32"?(0,JH.tmpdir)():r.storagePath||r.extensionPath,isVsCode:!0,isRemote:!!process.env.JS_DEBUG_USE_COMPANION||ft.extensions.getExtension(nk)?.extensionKind===ft.ExtensionKind.Workspace,context:r});r.subscriptions.push(ce(ft.commands,"extension.js-debug.npmScript",ZV),ce(ft.commands,"extension.js-debug.pickNodeProcess",async()=>{let s=await k0();if(!s)throw new ft.CancellationError;return s}),ce(ft.commands,"extension.pwa-node-debug.attachNodeProcess",jV),ce(ft.commands,"extension.js-debug.toggleSkippingFile",OH));let t=e.getAll(jw);for(let s of t){let a=s;r.subscriptions.push(ft.debug.registerDebugConfigurationProvider(s.type,a));let c=Id.get(s.type);c&&r.subscriptions.push(ft.debug.registerDebugConfigurationProvider(c,a))}let n=e.getAll(Uw);for(let s of n)ft.debug.registerDebugConfigurationProvider(s.type,s,ft.DebugConfigurationProviderTriggerKind!==void 0?s.triggerKind:void 0);let i=new a_(e);r.subscriptions.push(...[...f_].map(s=>ft.debug.registerDebugAdapterDescriptorFactory(s,i))),r.subscriptions.push(ft.debug.onDidTerminateDebugSession(s=>i.terminate(s))),r.subscriptions.push(i);let o=e.get(Le);return o.attach(),CH(r),PH(r,o),wH(r,e.get(io),e),EH(r,e),_H(r,e.get(io),e),AH(r,o),kH(r,o),e.getAll(dr).forEach(s=>s.register(r)),e.get(wa).create()}function Sse(){}0&&(module.exports={activate,deactivate});
/*! Bundled license information:

reflect-metadata/Reflect.js:
  (*! *****************************************************************************
  Copyright (C) Microsoft. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** *)

is-number/index.js:
  (*!
   * is-number <https://github.com/jonschlinkert/is-number>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

to-regex-range/index.js:
  (*!
   * to-regex-range <https://github.com/micromatch/to-regex-range>
   *
   * Copyright (c) 2015-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

fill-range/index.js:
  (*!
   * fill-range <https://github.com/jonschlinkert/fill-range>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

normalize-path/index.js:
  (*!
   * normalize-path <https://github.com/jonschlinkert/normalize-path>
   *
   * Copyright (c) 2014-2018, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-extglob/index.js:
  (*!
   * is-extglob <https://github.com/jonschlinkert/is-extglob>
   *
   * Copyright (c) 2014-2016, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

is-glob/index.js:
  (*!
   * is-glob <https://github.com/jonschlinkert/is-glob>
   *
   * Copyright (c) 2014-2017, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-windows/index.js:
  (*!
   * is-windows <https://github.com/jonschlinkert/is-windows>
   *
   * Copyright © 2015-2018, Jon Schlinkert.
   * Released under the MIT License.
   *)
*/
//# sourceMappingURL=extension.js.map