@wispbit/local 1.0.57 → 1.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-bundle.js +4 -4
- package/package.json +1 -1
package/cli-bundle.js
CHANGED
|
@@ -21,7 +21,7 @@ GFS4: `),console.error(t)});Pt[cr]||(The=global[cr]||[],She(Pt,The),Pt.close=(fu
|
|
|
21
21
|
|
|
22
22
|
`)?n.split(`
|
|
23
23
|
|
|
24
|
-
`):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}xhe.exports=i0});var khe=R(Fhe=>{"use strict";var $he=Y("os"),jo=Y("path"),Bhe=$he.tmpdir(),t5e=process.getuid?process.getuid():process.pid,r5e=()=>!0,Vhe=process.platform==="win32",Ghe={editor:()=>process.env.EDITOR||process.env.VISUAL||(Vhe?"notepad.exe":"vi"),shell:()=>Vhe?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},n5e={fromString:()=>process.umask()},d_=$he.homedir();d_?process.env.HOME=d_:d_=jo.resolve(Bhe,"npm-"+t5e);var i5e=process.platform==="win32"?"npm-cache":".npm",o5e=process.platform==="win32"&&process.env.APPDATA||d_,s5e=jo.resolve(o5e,i5e),oR,Gc;Object.defineProperty(Fhe,"defaults",{get:function(){return oR||(process.env.PREFIX?Gc=process.env.PREFIX:process.platform==="win32"?Gc=jo.dirname(process.execPath):(Gc=jo.dirname(jo.dirname(process.execPath)),process.env.DESTDIR&&(Gc=jo.join(process.env.DESTDIR,Gc))),oR={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:s5e,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:Ghe.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:jo.resolve(Gc,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":jo.resolve(d_,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Gc,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:Ghe.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:Bhe,unicode:r5e(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:jo.resolve(d_,".npmrc"),umask:process.umask?process.umask():n5e.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},oR)}})});var Hhe=R((EIt,o0)=>{"use strict";var $c=Y("path"),a5e=whe(),Yhe=khe();o0.exports=(t,e,r)=>{let n=new a5e(Object.assign({},Yhe.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(Y.resolve.paths){let u=Y.resolve.paths("npm"),_;try{_=Y.resolve("npm",{paths:u.slice(-1)})}catch{o=!0}_&&i.push(n.addFile($c.resolve($c.dirname(_),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=$c.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let u=$c.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(u,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let u=$c.resolve(n.get("prefix"),"etc");n.root.globalconfig=$c.resolve(u,"npmrc"),n.root.globalignorefile=$c.resolve(u,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let c=n.get("cafile");return c&&n.loadCAFile(c),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(o0.exports,"defaults",{get(){return Yhe.defaults},enumerable:!0})});var Jhe=R((fIt,Xhe)=>{var jhe=Hhe(),Khe=":_authToken",Whe=":_auth",zhe=":username",qhe=":_password";Xhe.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:jhe()).config,e=e||r.npmrc.get("registry")||jhe.defaults.registry,Zhe(e,r)||u5e(r.npmrc)};function c5e(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:n,search:i,hash:o}=r;return n+i+o}return r.toString()}function Zhe(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=_5e(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:Zhe(new URL("./",r),e);r.pathname=c5e(l5e(n),"..")||"/"}}function u5e(t){return t.get("_auth")?{token:sR(t.get("_auth")),type:"Basic"}:void 0}function l5e(t){return t[t.length-1]==="/"?t:t+"/"}function _5e(t,e){let r=E5e(e.get(t+Khe)||e.get(t+"/"+Khe));if(r)return r;let n=e.get(t+zhe)||e.get(t+"/"+zhe),i=e.get(t+qhe)||e.get(t+"/"+qhe),o=T5e(n,i);if(o)return o;let s=f5e(e.get(t+Whe)||e.get(t+"/"+Whe));if(s)return s}function sR(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function E5e(t){return t?{token:sR(t),type:"Bearer"}:void 0}function T5e(t,e){if(!t||!e)return;let r=Buffer.from(sR(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function f5e(t){return t?{token:sR(t),type:"Basic"}:void 0}});var GAe=R((KIt,lR)=>{var hAe,AAe,mAe,gAe,RAe,OAe,NAe,CAe,IAe,uR,h0,MAe,PAe,h_,DAe,LAe,vAe,yAe,bAe,UAe,xAe,wAe,VAe;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof lR=="object"&&typeof lR.exports=="object"?t(r(e,r(lR.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])};hAe=function(r,n){e(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},AAe=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},mAe=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)n.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(i[o[s]]=r[o[s]]);return i},gAe=function(r,n,i,o){var s=arguments.length,a=s<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,n,i,o);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(s<3?c(a):s>3?c(n,i,a):c(n,i))||a);return s>3&&a&&Object.defineProperty(n,i,a),a},RAe=function(r,n){return function(i,o){n(i,o,r)}},OAe=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},NAe=function(r,n,i,o){function s(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(T){try{E(o.next(T))}catch(f){c(f)}}function _(T){try{E(o.throw(T))}catch(f){c(f)}}function E(T){T.done?a(T.value):s(T.value).then(u,_)}E((o=o.apply(r,n||[])).next())})},CAe=function(r,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(E){return function(T){return _([E,T])}}function _(E){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=E[0]&2?s.return:E[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,E[1])).done)return a;switch(s=0,a&&(E=[E[0]&2,a.value]),E[0]){case 0:case 1:a=E;break;case 4:return i.label++,{value:E[1],done:!1};case 5:i.label++,s=E[1],E=[0];continue;case 7:E=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(E[0]===6||E[0]===2)){i=0;continue}if(E[0]===3&&(!a||E[1]>a[0]&&E[1]<a[3])){i.label=E[1];break}if(E[0]===6&&i.label<a[1]){i.label=a[1],a=E;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(E);break}a[2]&&i.ops.pop(),i.trys.pop();continue}E=n.call(r,i)}catch(T){E=[6,T],s=0}finally{o=a=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}},VAe=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},IAe=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},uR=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},h0=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),s,a=[],c;try{for(;(n===void 0||n-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(c)throw c.error}}return a},MAe=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(h0(arguments[n]));return r},PAe=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),s=0,n=0;n<i;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},h_=function(r){return this instanceof h_?(this.v=r,this):new h_(r)},DAe=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(S){o[S]&&(s[S]=function(d){return new Promise(function(p,g){a.push([S,d,p,g])>1||u(S,d)})})}function u(S,d){try{_(o[S](d))}catch(p){f(a[0][3],p)}}function _(S){S.value instanceof h_?Promise.resolve(S.value.v).then(E,T):f(a[0][2],S)}function E(S){u("next",S)}function T(S){u("throw",S)}function f(S,d){S(d),a.shift(),a.length&&u(a[0][0],a[0][1])}},LAe=function(r){var n,i;return n={},o("next"),o("throw",function(s){throw s}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(s,a){n[s]=r[s]?function(c){return(i=!i)?{value:h_(r[s](c)),done:s==="return"}:a?a(c):c}:a}},vAe=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof uR=="function"?uR(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(a){i[a]=r[a]&&function(c){return new Promise(function(u,_){c=r[a](c),s(u,_,c.done,c.value)})}}function s(a,c,u,_){Promise.resolve(_).then(function(E){a({value:E,done:u})},c)}},yAe=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},bAe=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},UAe=function(r){return r&&r.__esModule?r:{default:r}},xAe=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},wAe=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},t("__extends",hAe),t("__assign",AAe),t("__rest",mAe),t("__decorate",gAe),t("__param",RAe),t("__metadata",OAe),t("__awaiter",NAe),t("__generator",CAe),t("__exportStar",IAe),t("__createBinding",VAe),t("__values",uR),t("__read",h0),t("__spread",MAe),t("__spreadArrays",PAe),t("__await",h_),t("__asyncGenerator",DAe),t("__asyncDelegator",LAe),t("__asyncValues",vAe),t("__makeTemplateObject",yAe),t("__importStar",bAe),t("__importDefault",UAe),t("__classPrivateFieldGet",xAe),t("__classPrivateFieldSet",wAe)})});var BAe={};On(BAe,{__assign:()=>V5e,__asyncDelegator:()=>J5e,__asyncGenerator:()=>X5e,__asyncValues:()=>Q5e,__await:()=>Z5e,__awaiter:()=>k5e,__classPrivateFieldGet:()=>n9e,__classPrivateFieldSet:()=>i9e,__createBinding:()=>j5e,__decorate:()=>$5e,__exportStar:()=>H5e,__extends:()=>w5e,__generator:()=>Y5e,__importDefault:()=>r9e,__importStar:()=>t9e,__makeTemplateObject:()=>e9e,__metadata:()=>F5e,__param:()=>B5e,__read:()=>W5e,__rest:()=>G5e,__spread:()=>z5e,__spreadArrays:()=>q5e,__values:()=>K5e});var $Ae,w5e,V5e,G5e,$5e,B5e,F5e,k5e,Y5e,H5e,j5e,K5e,W5e,z5e,q5e,Z5e,X5e,J5e,Q5e,e9e,t9e,r9e,n9e,i9e,FAe=Z(()=>{$Ae=ne(GAe(),1),{__extends:w5e,__assign:V5e,__rest:G5e,__decorate:$5e,__param:B5e,__metadata:F5e,__awaiter:k5e,__generator:Y5e,__exportStar:H5e,__createBinding:j5e,__values:K5e,__read:W5e,__spread:z5e,__spreadArrays:q5e,__await:Z5e,__asyncGenerator:X5e,__asyncDelegator:J5e,__asyncValues:Q5e,__makeTemplateObject:e9e,__importStar:t9e,__importDefault:r9e,__classPrivateFieldGet:n9e,__classPrivateFieldSet:i9e}=$Ae.default});var jAe=R((WIt,HAe)=>{"use strict";var A0=Object.defineProperty,o9e=Object.getOwnPropertyDescriptor,s9e=Object.getOwnPropertyNames,a9e=Object.prototype.hasOwnProperty,c9e=(t,e)=>{for(var r in e)A0(t,r,{get:e[r],enumerable:!0})},u9e=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s9e(e))!a9e.call(t,i)&&i!==r&&A0(t,i,{get:()=>e[i],enumerable:!(n=o9e(e,i))||n.enumerable});return t},l9e=t=>u9e(A0({},"__esModule",{value:!0}),t),kAe={};c9e(kAe,{defaultDeserialize:()=>E9e,defaultSerialize:()=>_9e});HAe.exports=l9e(kAe);var YAe=Y("buffer"),_R=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(YAe.Buffer.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",n=Array.isArray(t);r=n?"[":"{";let i=!0;for(let o in t){let s=typeof t[o]=="function"||!n&&t[o]===void 0;!Object.hasOwn(t,o)||s||(i||(r+=","),i=!1,n?r+=_R(t[o],e):t[o]!==void 0&&(r+=`${_R(o,!1)}:${_R(t[o],e)}`))}return r+=n?"]":"}",r}return JSON.stringify(t)},_9e=t=>_R(t,!0),E9e=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?YAe.Buffer.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r)});var KAe=R(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.Field=void 0;aS.makeField=T9e;var ER=class{kv;key;defaults;constructor(e,r,n){this.kv=e,this.key=r,this.defaults=n}async get(e=this.defaults){return await this.kv.get(this.key)??e}getSync(e=this.defaults){if("getSync"in this.kv)return this.kv.getSync(this.key)??e;throw new Error("kv does not support getSync")}set(e,r){return this.kv.set(this.key,e,r)}delete(){return this.kv.delete(this.key)}};aS.Field=ER;function T9e(t,e,r){return new ER(t,e,r)}});var ZAe=R(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.KeyvFile=Wo.defaultOpts=void 0;var A_=(FAe(),je(BAe)),f9e=A_.__importStar(Y("os")),TR=A_.__importStar(Y("fs")),WAe=A_.__importStar(Y("fs/promises")),S9e=A_.__importDefault(Y("events")),zAe=jAe(),p9e=A_.__importDefault(Y("path"));A_.__exportStar(KAe(),Wo);Wo.defaultOpts={deserialize:zAe.defaultDeserialize,dialect:"redis",expiredCheckDelay:24*3600*1e3,filename:`${f9e.tmpdir()}/keyv-file/default.json`,serialize:zAe.defaultSerialize,writeDelay:100,checkFileLock:!1};function qAe(t){return typeof t=="number"}var fR=class extends S9e.default{ttlSupport=!0;namespace;opts;_data;_lastExpire;constructor(e){super(),this.opts=Object.assign({},Wo.defaultOpts,e),this.opts.checkFileLock&&this.acquireFileLock();try{let r=this.opts.deserialize(TR.readFileSync(this.opts.filename,"utf8"));if(!Array.isArray(r.cache)){let n=r.cache;r.cache=[];for(let i in n)n.hasOwnProperty(i)&&r.cache.push([i,n[i]])}this._data=new Map(r.cache),this._lastExpire=r.lastExpire}catch{this._data=new Map,this._lastExpire=Date.now()}}get _lockFile(){return this.opts.filename+".lock"}acquireFileLock(){try{let e=TR.openSync(this._lockFile,"wx");TR.closeSync(e),process.on("SIGINT",()=>{this.releaseFileLock(),process.exit(0)}),process.on("exit",()=>{this.releaseFileLock()})}catch(e){throw console.error("[keyv-file] There is another process using this file"),e}}releaseFileLock(){try{TR.unlinkSync(this._lockFile)}catch{}}async get(e){return this.getSync(e)}getSync(e){try{let r=this._data.get(e);if(r)if(this.isExpired(r)){this.delete(e);return}else return r.value;else return}catch{}}async getMany(e){return e.map(r=>this.getSync(r))}async set(e,r,n){return n===0&&(n=void 0),this._data.set(e,{expire:qAe(n)?Date.now()+n:void 0,value:r}),this.save()}async delete(e){let r=this._data.delete(e);return await this.save(),r}async deleteMany(e){let r=e.every(n=>this._data.delete(n));return await this.save(),r}async clear(){return this._data=new Map,this._lastExpire=Date.now(),this.save()}async has(e){return await this.get(e)!==void 0}isExpired(e){return qAe(e.expire)&&e.expire<=Date.now()}clearExpire(){let e=Date.now();if(!(e-this._lastExpire<=this.opts.expiredCheckDelay)){for(let r of this._data.keys()){let n=this._data.get(r);this.isExpired(n)&&this._data.delete(r)}this._lastExpire=e}}async saveToDisk(){let e=[];for(let[n,i]of this._data)e.push([n,i]);let r=this.opts.serialize({cache:e,lastExpire:this._lastExpire});return await WAe.mkdir(p9e.default.dirname(this.opts.filename),{recursive:!0}),WAe.writeFile(this.opts.filename,r)}_savePromise;save(){return this.clearExpire(),this._savePromise?this._savePromise:(this._savePromise=new Promise((e,r)=>{setTimeout(()=>{this.saveToDisk().then(e,r).finally(()=>{this._savePromise=void 0})},this.opts.writeDelay)}),this._savePromise)}disconnect(){return Promise.resolve()}async*iterator(e){for(let[r,n]of this._data.entries())r!==void 0&&(!e||r.includes(e))&&(yield[r,n.value])}};Wo.KeyvFile=fR;Wo.default=fR});var hR=R((aMt,rr)=>{var{createRequire:g9e}=Y("node:module");Y=g9e(__filename);var{readFileSync:R9e}=Y("node:fs"),Rt=null,Re=[],dR=()=>{let t=!1;return process.platform==="linux"&&(t=N9e(),t===null&&(t=C9e()),t===null&&(t=I9e())),t},O9e=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),N9e=()=>{try{return R9e("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},C9e=()=>{let t=null;return typeof process.report?.getReport=="function"&&(process.report.excludeNetwork=!0,t=process.report.getReport()),t?t.header&&t.header.glibcVersionRuntime?!1:!!(Array.isArray(t.sharedObjects)&&t.sharedObjects.some(O9e)):null},I9e=()=>{try{return Y("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function M9e(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{Rt=Y(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(t){Re.push(t)}else if(process.platform==="android")if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.android-arm64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-android-arm64")}catch(t){Re.push(t)}}else if(process.arch==="arm"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.android-arm-eabi.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-android-arm-eabi")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.win32-x64-msvc.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-win32-x64-msvc")}catch(t){Re.push(t)}}else if(process.arch==="ia32"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.win32-ia32-msvc.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-win32-ia32-msvc")}catch(t){Re.push(t)}}else if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.win32-arm64-msvc.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-win32-arm64-msvc")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.darwin-universal.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-darwin-universal")}catch(t){Re.push(t)}if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.darwin-x64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-darwin-x64")}catch(t){Re.push(t)}}else if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.darwin-arm64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-darwin-arm64")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.freebsd-x64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-freebsd-x64")}catch(t){Re.push(t)}}else if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.freebsd-arm64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-freebsd-arm64")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-x64-musl.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-x64-musl")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-x64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-x64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="arm64")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm64-musl.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm64-musl")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="arm")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm-musleabihf.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm-musleabihf")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm-gnueabihf.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm-gnueabihf")}catch(t){Re.push(t)}}else if(process.arch==="riscv64")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-riscv64-musl.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-riscv64-musl")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-riscv64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-riscv64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="ppc64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-ppc64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-ppc64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="s390x"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-s390x-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-s390x-gnu")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm64-ohos.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm64-ohos")}catch(t){Re.push(t)}}else if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-x64-ohos.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-x64-ohos")}catch(t){Re.push(t)}}else if(process.arch==="arm"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm-ohos.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm-ohos")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else Re.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}Rt=M9e();if(!Rt||process.env.NAPI_RS_FORCE_WASI){try{Rt=Y("./ast-grep-napi.wasi.cjs")}catch(t){process.env.NAPI_RS_FORCE_WASI&&Re.push(t)}if(!Rt)try{Rt=Y("@ast-grep/napi-wasm32-wasi")}catch(t){process.env.NAPI_RS_FORCE_WASI&&Re.push(t)}}if(!Rt)throw Re.length>0?new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.",{cause:Re}):new Error("Failed to load native binding");rr.exports=Rt;rr.exports.SgNode=Rt.SgNode;rr.exports.SgRoot=Rt.SgRoot;rr.exports.findInFiles=Rt.findInFiles;rr.exports.kind=Rt.kind;rr.exports.Lang=Rt.Lang;rr.exports.parse=Rt.parse;rr.exports.parseAsync=Rt.parseAsync;rr.exports.parseFiles=Rt.parseFiles;rr.exports.pattern=Rt.pattern;rr.exports.registerDynamicLanguage=Rt.registerDynamicLanguage;rr.exports.css=Rt.css;rr.exports.html=Rt.html;rr.exports.js=Rt.js;rr.exports.jsx=Rt.jsx;rr.exports.ts=Rt.ts;rr.exports.tsx=Rt.tsx});var Vme=R((zPt,wme)=>{"use strict";wme.exports=Ume;function Ume(t,e,r){t instanceof RegExp&&(t=bme(t,r)),e instanceof RegExp&&(e=bme(e,r));var n=xme(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function bme(t,e){var r=e.match(t);return r?r[0]:null}Ume.range=xme;function xme(t,e,r){var n,i,o,s,a,c=r.indexOf(t),u=r.indexOf(e,c+1),_=c;if(c>=0&&u>0){if(t===e)return[c,u];for(n=[],o=r.length;_>=0&&!a;)_==c?(n.push(_),c=r.indexOf(t,_+1)):n.length==1?a=[n.pop(),u]:(i=n.pop(),i<o&&(o=i,s=u),u=r.indexOf(e,_+1)),_=c<u&&c>=0?c:u;n.length&&(a=[o,s])}return a}});var jme=R((qPt,Hme)=>{var Gme=Vme();Hme.exports=w9e;var $me="\0SLASH"+Math.random()+"\0",Bme="\0OPEN"+Math.random()+"\0",O0="\0CLOSE"+Math.random()+"\0",Fme="\0COMMA"+Math.random()+"\0",kme="\0PERIOD"+Math.random()+"\0";function R0(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function U9e(t){return t.split("\\\\").join($me).split("\\{").join(Bme).split("\\}").join(O0).split("\\,").join(Fme).split("\\.").join(kme)}function x9e(t){return t.split($me).join("\\").split(Bme).join("{").split(O0).join("}").split(Fme).join(",").split(kme).join(".")}function Yme(t){if(!t)return[""];var e=[],r=Gme("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,o=r.post,s=n.split(",");s[s.length-1]+="{"+i+"}";var a=Yme(o);return o.length&&(s[s.length-1]+=a.shift(),s.push.apply(s,a)),e.push.apply(e,s),e}function w9e(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),cS(U9e(t),!0).map(x9e)):[]}function V9e(t){return"{"+t+"}"}function G9e(t){return/^-?0\d/.test(t)}function $9e(t,e){return t<=e}function B9e(t,e){return t>=e}function cS(t,e){var r=[],n=Gme("{","}",t);if(!n)return[t];var i=n.pre,o=n.post.length?cS(n.post,!1):[""];if(/\$$/.test(n.pre))for(var s=0;s<o.length;s++){var a=i+"{"+n.body+"}"+o[s];r.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),_=c||u,E=n.body.indexOf(",")>=0;if(!_&&!E)return n.post.match(/,.*\}/)?(t=n.pre+"{"+n.body+O0+n.post,cS(t)):[t];var T;if(_)T=n.body.split(/\.\./);else if(T=Yme(n.body),T.length===1&&(T=cS(T[0],!1).map(V9e),T.length===1))return o.map(function(z){return n.pre+T[0]+z});var f;if(_){var S=R0(T[0]),d=R0(T[1]),p=Math.max(T[0].length,T[1].length),g=T.length==3?Math.abs(R0(T[2])):1,N=$9e,O=d<S;O&&(g*=-1,N=B9e);var C=T.some(G9e);f=[];for(var v=S;N(v,d);v+=g){var x;if(u)x=String.fromCharCode(v),x==="\\"&&(x="");else if(x=String(v),C){var G=p-x.length;if(G>0){var J=new Array(G+1).join("0");v<0?x="-"+J+x.slice(1):x=J+x}}f.push(x)}}else{f=[];for(var j=0;j<T.length;j++)f.push.apply(f,cS(T[j],!1))}for(var j=0;j<f.length;j++)for(var s=0;s<o.length;s++){var a=i+f[j]+o[s];(!e||_||a)&&r.push(a)}}return r}});var z0=R((iLt,FR)=>{function bge(t){return Array.isArray(t)?t:[t]}var _Xe=void 0,Y0="",vge=" ",k0="\\",EXe=/^\s+$/,TXe=/(?:[^\\]|^)\\$/,fXe=/^\\!/,SXe=/^\\#/,pXe=/\r?\n/g,dXe=/^\.{0,2}\/|^\.{1,2}$/,hXe=/\/$/,b_="/",Uge="node-ignore";typeof Symbol<"u"&&(Uge=Symbol.for("node-ignore"));var xge=Uge,U_=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),AXe=/([0-z])-([0-z])/g,wge=()=>!1,mXe=t=>t.replace(AXe,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:Y0),gXe=t=>{let{length:e}=t;return t.slice(0,e-e%2)},RXe=[[/^\uFEFF/,()=>Y0],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?vge:Y0)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+vge}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>k0],[/\\\\/g,()=>k0],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===k0?`\\[${r}${gXe(n)}${i}`:i==="]"&&n.length%2===0?`[${mXe(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],OXe=/(^|\\\/)?\\\*$/,CS="regex",$R="checkRegex",yge="_",NXe={[CS](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[$R](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},CXe=t=>RXe.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),BR=t=>typeof t=="string",IXe=t=>t&&BR(t)&&!EXe.test(t)&&!TXe.test(t)&&t.indexOf("#")!==0,MXe=t=>t.split(pXe).filter(Boolean),H0=class{constructor(e,r,n,i,o,s){this.pattern=e,this.mark=r,this.negative=o,U_(this,"body",n),U_(this,"ignoreCase",i),U_(this,"regexPrefix",s)}get regex(){let e=yge+CS;return this[e]?this[e]:this._make(CS,e)}get checkRegex(){let e=yge+$R;return this[e]?this[e]:this._make($R,e)}_make(e,r){let n=this.regexPrefix.replace(OXe,NXe[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return U_(this,r,i)}},PXe=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(fXe,"!").replace(SXe,"#");let o=CXe(i);return new H0(t,e,i,r,n,o)},j0=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[xge]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(BR(e)&&(e={pattern:e}),IXe(e.pattern)){let r=PXe(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,bge(BR(e)?MXe(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,o=!1,s;this._rules.forEach(c=>{let{negative:u}=c;o===u&&i!==o||u&&!i&&!o&&!r||!c[n].test(e)||(i=!u,o=u,s=u?_Xe:c)});let a={ignored:i,unignored:o};return s&&(a.rule=s),a}},DXe=(t,e)=>{throw new e(t)},Zo=(t,e,r)=>BR(t)?t?Zo.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),Vge=t=>dXe.test(t);Zo.isNotRelative=Vge;Zo.convert=t=>t;var K0=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){U_(this,xge,!0),this._rules=new j0(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let o=e&&Zo.convert(e);return Zo(o,e,this._strictPathCheck?DXe:wge),this._t(o,r,n,i)}checkIgnore(e){if(!hXe.test(e))return this.test(e);let r=e.split(b_).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(b_)+b_,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,$R)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(b_).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,CS);let o=this._t(i.join(b_)+b_,r,n,i);return r[e]=o.ignored?o:this._rules.test(e,n,CS)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return bge(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},W0=t=>new K0(t),LXe=t=>Zo(t&&Zo.convert(t),t,wge),Gge=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Zo.convert=t;let e=/^[a-z]:\//i;Zo.isNotRelative=r=>e.test(r)||Vge(r)};typeof process<"u"&&process.platform==="win32"&&Gge();FR.exports=W0;W0.default=W0;FR.exports.isPathValid=LXe;U_(FR.exports,Symbol.for("setupWindows"),Gge)});var MRe=R((Zbt,IRe)=>{"use strict";IRe.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var DRe=R((Xbt,PRe)=>{"use strict";var AJe=MRe();PRe.exports=t=>typeof t=="string"?t.replace(AJe(),""):t});var vRe=R((Jbt,Sx)=>{"use strict";var LRe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);Sx.exports=LRe;Sx.exports.default=LRe});var bRe=R((Qbt,yRe)=>{"use strict";yRe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var xRe=R((eUt,px)=>{"use strict";var mJe=DRe(),gJe=vRe(),RJe=bRe(),URe=t=>{if(typeof t!="string"||t.length===0||(t=mJe(t),t.length===0))return 0;t=t.replace(RJe()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=gJe(n)?2:1)}return e};px.exports=URe;px.exports.default=URe});import*as Qo from"fs/promises";import*as HRe from"os";import*as Wc from"path";var Ie=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var pt="8.55.0";var we=globalThis;function ts(t,e,r){let n=r||we,i=n.__SENTRY__=n.__SENTRY__||{},o=i[pt]=i[pt]||{};return o[t]||(o[t]=e())}var qr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var eOe="Sentry Logger ",k_=["debug","info","warn","error","log","assert","trace"],qc={};function Ut(t){if(!("console"in we))return t();let e=we.console,r={},n=Object.keys(qc);n.forEach(i=>{let o=qc[i];r[i]=e[i],e[i]=o});try{return t()}finally{n.forEach(i=>{e[i]=r[i]})}}function tOe(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return qr?k_.forEach(r=>{e[r]=(...n)=>{t&&Ut(()=>{we.console[r](`${eOe}[${r}]:`,...n)})}}):k_.forEach(r=>{e[r]=()=>{}}),e}var H=ts("logger",tOe);var Mx=/\(error: (.*)\)/,Px=/captureMessage|captureException/;function HS(...t){let e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,i=0)=>{let o=[],s=r.split(`
|
|
24
|
+
`):n.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}xhe.exports=i0});var khe=R(Fhe=>{"use strict";var $he=Y("os"),jo=Y("path"),Bhe=$he.tmpdir(),t5e=process.getuid?process.getuid():process.pid,r5e=()=>!0,Vhe=process.platform==="win32",Ghe={editor:()=>process.env.EDITOR||process.env.VISUAL||(Vhe?"notepad.exe":"vi"),shell:()=>Vhe?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},n5e={fromString:()=>process.umask()},d_=$he.homedir();d_?process.env.HOME=d_:d_=jo.resolve(Bhe,"npm-"+t5e);var i5e=process.platform==="win32"?"npm-cache":".npm",o5e=process.platform==="win32"&&process.env.APPDATA||d_,s5e=jo.resolve(o5e,i5e),oR,Gc;Object.defineProperty(Fhe,"defaults",{get:function(){return oR||(process.env.PREFIX?Gc=process.env.PREFIX:process.platform==="win32"?Gc=jo.dirname(process.execPath):(Gc=jo.dirname(jo.dirname(process.execPath)),process.env.DESTDIR&&(Gc=jo.join(process.env.DESTDIR,Gc))),oR={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:s5e,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:Ghe.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:jo.resolve(Gc,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":jo.resolve(d_,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Gc,production:!0,progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:Ghe.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:Bhe,unicode:r5e(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:jo.resolve(d_,".npmrc"),umask:process.umask?process.umask():n5e.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},oR)}})});var Hhe=R((EIt,o0)=>{"use strict";var $c=Y("path"),a5e=whe(),Yhe=khe();o0.exports=(t,e,r)=>{let n=new a5e(Object.assign({},Yhe.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(Y.resolve.paths){let u=Y.resolve.paths("npm"),_;try{_=Y.resolve("npm",{paths:u.slice(-1)})}catch{o=!0}_&&i.push(n.addFile($c.resolve($c.dirname(_),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=$c.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let u=$c.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(u,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let u=$c.resolve(n.get("prefix"),"etc");n.root.globalconfig=$c.resolve(u,"npmrc"),n.root.globalignorefile=$c.resolve(u,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let c=n.get("cafile");return c&&n.loadCAFile(c),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(o0.exports,"defaults",{get(){return Yhe.defaults},enumerable:!0})});var Jhe=R((fIt,Xhe)=>{var jhe=Hhe(),Khe=":_authToken",Whe=":_auth",zhe=":username",qhe=":_password";Xhe.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:jhe()).config,e=e||r.npmrc.get("registry")||jhe.defaults.registry,Zhe(e,r)||u5e(r.npmrc)};function c5e(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:n,search:i,hash:o}=r;return n+i+o}return r.toString()}function Zhe(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=_5e(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:Zhe(new URL("./",r),e);r.pathname=c5e(l5e(n),"..")||"/"}}function u5e(t){return t.get("_auth")?{token:sR(t.get("_auth")),type:"Basic"}:void 0}function l5e(t){return t[t.length-1]==="/"?t:t+"/"}function _5e(t,e){let r=E5e(e.get(t+Khe)||e.get(t+"/"+Khe));if(r)return r;let n=e.get(t+zhe)||e.get(t+"/"+zhe),i=e.get(t+qhe)||e.get(t+"/"+qhe),o=T5e(n,i);if(o)return o;let s=f5e(e.get(t+Whe)||e.get(t+"/"+Whe));if(s)return s}function sR(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function E5e(t){return t?{token:sR(t),type:"Bearer"}:void 0}function T5e(t,e){if(!t||!e)return;let r=Buffer.from(sR(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function f5e(t){return t?{token:sR(t),type:"Basic"}:void 0}});var GAe=R((KIt,lR)=>{var hAe,AAe,mAe,gAe,RAe,OAe,NAe,CAe,IAe,uR,h0,MAe,PAe,h_,DAe,LAe,vAe,yAe,bAe,UAe,xAe,wAe,VAe;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof lR=="object"&&typeof lR.exports=="object"?t(r(e,r(lR.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,s){return n[o]=i?i(o,s):s}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])};hAe=function(r,n){e(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},AAe=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])}return r},mAe=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)n.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(i[o[s]]=r[o[s]]);return i},gAe=function(r,n,i,o){var s=arguments.length,a=s<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,n,i,o);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(a=(s<3?c(a):s>3?c(n,i,a):c(n,i))||a);return s>3&&a&&Object.defineProperty(n,i,a),a},RAe=function(r,n){return function(i,o){n(i,o,r)}},OAe=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},NAe=function(r,n,i,o){function s(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function u(T){try{E(o.next(T))}catch(f){c(f)}}function _(T){try{E(o.throw(T))}catch(f){c(f)}}function E(T){T.done?a(T.value):s(T.value).then(u,_)}E((o=o.apply(r,n||[])).next())})},CAe=function(r,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(E){return function(T){return _([E,T])}}function _(E){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=E[0]&2?s.return:E[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,E[1])).done)return a;switch(s=0,a&&(E=[E[0]&2,a.value]),E[0]){case 0:case 1:a=E;break;case 4:return i.label++,{value:E[1],done:!1};case 5:i.label++,s=E[1],E=[0];continue;case 7:E=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(E[0]===6||E[0]===2)){i=0;continue}if(E[0]===3&&(!a||E[1]>a[0]&&E[1]<a[3])){i.label=E[1];break}if(E[0]===6&&i.label<a[1]){i.label=a[1],a=E;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(E);break}a[2]&&i.ops.pop(),i.trys.pop();continue}E=n.call(r,i)}catch(T){E=[6,T],s=0}finally{o=a=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}},VAe=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},IAe=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},uR=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},h0=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),s,a=[],c;try{for(;(n===void 0||n-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(c)throw c.error}}return a},MAe=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(h0(arguments[n]));return r},PAe=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),s=0,n=0;n<i;n++)for(var a=arguments[n],c=0,u=a.length;c<u;c++,s++)o[s]=a[c];return o},h_=function(r){return this instanceof h_?(this.v=r,this):new h_(r)},DAe=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),s,a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(S){o[S]&&(s[S]=function(d){return new Promise(function(p,g){a.push([S,d,p,g])>1||u(S,d)})})}function u(S,d){try{_(o[S](d))}catch(p){f(a[0][3],p)}}function _(S){S.value instanceof h_?Promise.resolve(S.value.v).then(E,T):f(a[0][2],S)}function E(S){u("next",S)}function T(S){u("throw",S)}function f(S,d){S(d),a.shift(),a.length&&u(a[0][0],a[0][1])}},LAe=function(r){var n,i;return n={},o("next"),o("throw",function(s){throw s}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(s,a){n[s]=r[s]?function(c){return(i=!i)?{value:h_(r[s](c)),done:s==="return"}:a?a(c):c}:a}},vAe=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof uR=="function"?uR(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(a){i[a]=r[a]&&function(c){return new Promise(function(u,_){c=r[a](c),s(u,_,c.done,c.value)})}}function s(a,c,u,_){Promise.resolve(_).then(function(E){a({value:E,done:u})},c)}},yAe=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},bAe=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},UAe=function(r){return r&&r.__esModule?r:{default:r}},xAe=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},wAe=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},t("__extends",hAe),t("__assign",AAe),t("__rest",mAe),t("__decorate",gAe),t("__param",RAe),t("__metadata",OAe),t("__awaiter",NAe),t("__generator",CAe),t("__exportStar",IAe),t("__createBinding",VAe),t("__values",uR),t("__read",h0),t("__spread",MAe),t("__spreadArrays",PAe),t("__await",h_),t("__asyncGenerator",DAe),t("__asyncDelegator",LAe),t("__asyncValues",vAe),t("__makeTemplateObject",yAe),t("__importStar",bAe),t("__importDefault",UAe),t("__classPrivateFieldGet",xAe),t("__classPrivateFieldSet",wAe)})});var BAe={};On(BAe,{__assign:()=>V5e,__asyncDelegator:()=>J5e,__asyncGenerator:()=>X5e,__asyncValues:()=>Q5e,__await:()=>Z5e,__awaiter:()=>k5e,__classPrivateFieldGet:()=>n9e,__classPrivateFieldSet:()=>i9e,__createBinding:()=>j5e,__decorate:()=>$5e,__exportStar:()=>H5e,__extends:()=>w5e,__generator:()=>Y5e,__importDefault:()=>r9e,__importStar:()=>t9e,__makeTemplateObject:()=>e9e,__metadata:()=>F5e,__param:()=>B5e,__read:()=>W5e,__rest:()=>G5e,__spread:()=>z5e,__spreadArrays:()=>q5e,__values:()=>K5e});var $Ae,w5e,V5e,G5e,$5e,B5e,F5e,k5e,Y5e,H5e,j5e,K5e,W5e,z5e,q5e,Z5e,X5e,J5e,Q5e,e9e,t9e,r9e,n9e,i9e,FAe=Z(()=>{$Ae=ne(GAe(),1),{__extends:w5e,__assign:V5e,__rest:G5e,__decorate:$5e,__param:B5e,__metadata:F5e,__awaiter:k5e,__generator:Y5e,__exportStar:H5e,__createBinding:j5e,__values:K5e,__read:W5e,__spread:z5e,__spreadArrays:q5e,__await:Z5e,__asyncGenerator:X5e,__asyncDelegator:J5e,__asyncValues:Q5e,__makeTemplateObject:e9e,__importStar:t9e,__importDefault:r9e,__classPrivateFieldGet:n9e,__classPrivateFieldSet:i9e}=$Ae.default});var jAe=R((WIt,HAe)=>{"use strict";var A0=Object.defineProperty,o9e=Object.getOwnPropertyDescriptor,s9e=Object.getOwnPropertyNames,a9e=Object.prototype.hasOwnProperty,c9e=(t,e)=>{for(var r in e)A0(t,r,{get:e[r],enumerable:!0})},u9e=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s9e(e))!a9e.call(t,i)&&i!==r&&A0(t,i,{get:()=>e[i],enumerable:!(n=o9e(e,i))||n.enumerable});return t},l9e=t=>u9e(A0({},"__esModule",{value:!0}),t),kAe={};c9e(kAe,{defaultDeserialize:()=>E9e,defaultSerialize:()=>_9e});HAe.exports=l9e(kAe);var YAe=Y("buffer"),_R=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(YAe.Buffer.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",n=Array.isArray(t);r=n?"[":"{";let i=!0;for(let o in t){let s=typeof t[o]=="function"||!n&&t[o]===void 0;!Object.hasOwn(t,o)||s||(i||(r+=","),i=!1,n?r+=_R(t[o],e):t[o]!==void 0&&(r+=`${_R(o,!1)}:${_R(t[o],e)}`))}return r+=n?"]":"}",r}return JSON.stringify(t)},_9e=t=>_R(t,!0),E9e=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?YAe.Buffer.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r)});var KAe=R(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.Field=void 0;aS.makeField=T9e;var ER=class{kv;key;defaults;constructor(e,r,n){this.kv=e,this.key=r,this.defaults=n}async get(e=this.defaults){return await this.kv.get(this.key)??e}getSync(e=this.defaults){if("getSync"in this.kv)return this.kv.getSync(this.key)??e;throw new Error("kv does not support getSync")}set(e,r){return this.kv.set(this.key,e,r)}delete(){return this.kv.delete(this.key)}};aS.Field=ER;function T9e(t,e,r){return new ER(t,e,r)}});var ZAe=R(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.KeyvFile=Wo.defaultOpts=void 0;var A_=(FAe(),je(BAe)),f9e=A_.__importStar(Y("os")),TR=A_.__importStar(Y("fs")),WAe=A_.__importStar(Y("fs/promises")),S9e=A_.__importDefault(Y("events")),zAe=jAe(),p9e=A_.__importDefault(Y("path"));A_.__exportStar(KAe(),Wo);Wo.defaultOpts={deserialize:zAe.defaultDeserialize,dialect:"redis",expiredCheckDelay:24*3600*1e3,filename:`${f9e.tmpdir()}/keyv-file/default.json`,serialize:zAe.defaultSerialize,writeDelay:100,checkFileLock:!1};function qAe(t){return typeof t=="number"}var fR=class extends S9e.default{ttlSupport=!0;namespace;opts;_data;_lastExpire;constructor(e){super(),this.opts=Object.assign({},Wo.defaultOpts,e),this.opts.checkFileLock&&this.acquireFileLock();try{let r=this.opts.deserialize(TR.readFileSync(this.opts.filename,"utf8"));if(!Array.isArray(r.cache)){let n=r.cache;r.cache=[];for(let i in n)n.hasOwnProperty(i)&&r.cache.push([i,n[i]])}this._data=new Map(r.cache),this._lastExpire=r.lastExpire}catch{this._data=new Map,this._lastExpire=Date.now()}}get _lockFile(){return this.opts.filename+".lock"}acquireFileLock(){try{let e=TR.openSync(this._lockFile,"wx");TR.closeSync(e),process.on("SIGINT",()=>{this.releaseFileLock(),process.exit(0)}),process.on("exit",()=>{this.releaseFileLock()})}catch(e){throw console.error("[keyv-file] There is another process using this file"),e}}releaseFileLock(){try{TR.unlinkSync(this._lockFile)}catch{}}async get(e){return this.getSync(e)}getSync(e){try{let r=this._data.get(e);if(r)if(this.isExpired(r)){this.delete(e);return}else return r.value;else return}catch{}}async getMany(e){return e.map(r=>this.getSync(r))}async set(e,r,n){return n===0&&(n=void 0),this._data.set(e,{expire:qAe(n)?Date.now()+n:void 0,value:r}),this.save()}async delete(e){let r=this._data.delete(e);return await this.save(),r}async deleteMany(e){let r=e.every(n=>this._data.delete(n));return await this.save(),r}async clear(){return this._data=new Map,this._lastExpire=Date.now(),this.save()}async has(e){return await this.get(e)!==void 0}isExpired(e){return qAe(e.expire)&&e.expire<=Date.now()}clearExpire(){let e=Date.now();if(!(e-this._lastExpire<=this.opts.expiredCheckDelay)){for(let r of this._data.keys()){let n=this._data.get(r);this.isExpired(n)&&this._data.delete(r)}this._lastExpire=e}}async saveToDisk(){let e=[];for(let[n,i]of this._data)e.push([n,i]);let r=this.opts.serialize({cache:e,lastExpire:this._lastExpire});return await WAe.mkdir(p9e.default.dirname(this.opts.filename),{recursive:!0}),WAe.writeFile(this.opts.filename,r)}_savePromise;save(){return this.clearExpire(),this._savePromise?this._savePromise:(this._savePromise=new Promise((e,r)=>{setTimeout(()=>{this.saveToDisk().then(e,r).finally(()=>{this._savePromise=void 0})},this.opts.writeDelay)}),this._savePromise)}disconnect(){return Promise.resolve()}async*iterator(e){for(let[r,n]of this._data.entries())r!==void 0&&(!e||r.includes(e))&&(yield[r,n.value])}};Wo.KeyvFile=fR;Wo.default=fR});var hR=R((aMt,rr)=>{var{createRequire:g9e}=Y("node:module");Y=g9e(__filename);var{readFileSync:R9e}=Y("node:fs"),Rt=null,Re=[],dR=()=>{let t=!1;return process.platform==="linux"&&(t=N9e(),t===null&&(t=C9e()),t===null&&(t=I9e())),t},O9e=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),N9e=()=>{try{return R9e("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},C9e=()=>{let t=null;return typeof process.report?.getReport=="function"&&(process.report.excludeNetwork=!0,t=process.report.getReport()),t?t.header&&t.header.glibcVersionRuntime?!1:!!(Array.isArray(t.sharedObjects)&&t.sharedObjects.some(O9e)):null},I9e=()=>{try{return Y("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function M9e(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{Rt=Y(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(t){Re.push(t)}else if(process.platform==="android")if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.android-arm64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-android-arm64")}catch(t){Re.push(t)}}else if(process.arch==="arm"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.android-arm-eabi.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-android-arm-eabi")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.win32-x64-msvc.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-win32-x64-msvc")}catch(t){Re.push(t)}}else if(process.arch==="ia32"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.win32-ia32-msvc.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-win32-ia32-msvc")}catch(t){Re.push(t)}}else if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.win32-arm64-msvc.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-win32-arm64-msvc")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.darwin-universal.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-darwin-universal")}catch(t){Re.push(t)}if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.darwin-x64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-darwin-x64")}catch(t){Re.push(t)}}else if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.darwin-arm64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-darwin-arm64")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.freebsd-x64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-freebsd-x64")}catch(t){Re.push(t)}}else if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.freebsd-arm64.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-freebsd-arm64")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-x64-musl.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-x64-musl")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-x64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-x64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="arm64")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm64-musl.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm64-musl")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="arm")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm-musleabihf.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm-musleabihf")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm-gnueabihf.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm-gnueabihf")}catch(t){Re.push(t)}}else if(process.arch==="riscv64")if(dR()){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-riscv64-musl.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-riscv64-musl")}catch(t){Re.push(t)}}else{try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-riscv64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-riscv64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="ppc64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-ppc64-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-ppc64-gnu")}catch(t){Re.push(t)}}else if(process.arch==="s390x"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-s390x-gnu.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-s390x-gnu")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm64-ohos.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm64-ohos")}catch(t){Re.push(t)}}else if(process.arch==="x64"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-x64-ohos.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-x64-ohos")}catch(t){Re.push(t)}}else if(process.arch==="arm"){try{return Y("./vendor/ast-grep-napi/ast-grep-napi.linux-arm-ohos.node")}catch(t){Re.push(t)}try{return Y("@ast-grep/napi-linux-arm-ohos")}catch(t){Re.push(t)}}else Re.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else Re.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}Rt=M9e();if(!Rt||process.env.NAPI_RS_FORCE_WASI){try{Rt=Y("./ast-grep-napi.wasi.cjs")}catch(t){process.env.NAPI_RS_FORCE_WASI&&Re.push(t)}if(!Rt)try{Rt=Y("@ast-grep/napi-wasm32-wasi")}catch(t){process.env.NAPI_RS_FORCE_WASI&&Re.push(t)}}if(!Rt)throw Re.length>0?new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.",{cause:Re}):new Error("Failed to load native binding");rr.exports=Rt;rr.exports.SgNode=Rt.SgNode;rr.exports.SgRoot=Rt.SgRoot;rr.exports.findInFiles=Rt.findInFiles;rr.exports.kind=Rt.kind;rr.exports.Lang=Rt.Lang;rr.exports.parse=Rt.parse;rr.exports.parseAsync=Rt.parseAsync;rr.exports.parseFiles=Rt.parseFiles;rr.exports.pattern=Rt.pattern;rr.exports.registerDynamicLanguage=Rt.registerDynamicLanguage;rr.exports.css=Rt.css;rr.exports.html=Rt.html;rr.exports.js=Rt.js;rr.exports.jsx=Rt.jsx;rr.exports.ts=Rt.ts;rr.exports.tsx=Rt.tsx});var Vme=R((zPt,wme)=>{"use strict";wme.exports=Ume;function Ume(t,e,r){t instanceof RegExp&&(t=bme(t,r)),e instanceof RegExp&&(e=bme(e,r));var n=xme(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function bme(t,e){var r=e.match(t);return r?r[0]:null}Ume.range=xme;function xme(t,e,r){var n,i,o,s,a,c=r.indexOf(t),u=r.indexOf(e,c+1),_=c;if(c>=0&&u>0){if(t===e)return[c,u];for(n=[],o=r.length;_>=0&&!a;)_==c?(n.push(_),c=r.indexOf(t,_+1)):n.length==1?a=[n.pop(),u]:(i=n.pop(),i<o&&(o=i,s=u),u=r.indexOf(e,_+1)),_=c<u&&c>=0?c:u;n.length&&(a=[o,s])}return a}});var jme=R((qPt,Hme)=>{var Gme=Vme();Hme.exports=w9e;var $me="\0SLASH"+Math.random()+"\0",Bme="\0OPEN"+Math.random()+"\0",O0="\0CLOSE"+Math.random()+"\0",Fme="\0COMMA"+Math.random()+"\0",kme="\0PERIOD"+Math.random()+"\0";function R0(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function U9e(t){return t.split("\\\\").join($me).split("\\{").join(Bme).split("\\}").join(O0).split("\\,").join(Fme).split("\\.").join(kme)}function x9e(t){return t.split($me).join("\\").split(Bme).join("{").split(O0).join("}").split(Fme).join(",").split(kme).join(".")}function Yme(t){if(!t)return[""];var e=[],r=Gme("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,o=r.post,s=n.split(",");s[s.length-1]+="{"+i+"}";var a=Yme(o);return o.length&&(s[s.length-1]+=a.shift(),s.push.apply(s,a)),e.push.apply(e,s),e}function w9e(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),cS(U9e(t),!0).map(x9e)):[]}function V9e(t){return"{"+t+"}"}function G9e(t){return/^-?0\d/.test(t)}function $9e(t,e){return t<=e}function B9e(t,e){return t>=e}function cS(t,e){var r=[],n=Gme("{","}",t);if(!n)return[t];var i=n.pre,o=n.post.length?cS(n.post,!1):[""];if(/\$$/.test(n.pre))for(var s=0;s<o.length;s++){var a=i+"{"+n.body+"}"+o[s];r.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),_=c||u,E=n.body.indexOf(",")>=0;if(!_&&!E)return n.post.match(/,.*\}/)?(t=n.pre+"{"+n.body+O0+n.post,cS(t)):[t];var T;if(_)T=n.body.split(/\.\./);else if(T=Yme(n.body),T.length===1&&(T=cS(T[0],!1).map(V9e),T.length===1))return o.map(function(z){return n.pre+T[0]+z});var f;if(_){var S=R0(T[0]),d=R0(T[1]),p=Math.max(T[0].length,T[1].length),g=T.length==3?Math.abs(R0(T[2])):1,N=$9e,O=d<S;O&&(g*=-1,N=B9e);var C=T.some(G9e);f=[];for(var v=S;N(v,d);v+=g){var x;if(u)x=String.fromCharCode(v),x==="\\"&&(x="");else if(x=String(v),C){var G=p-x.length;if(G>0){var J=new Array(G+1).join("0");v<0?x="-"+J+x.slice(1):x=J+x}}f.push(x)}}else{f=[];for(var j=0;j<T.length;j++)f.push.apply(f,cS(T[j],!1))}for(var j=0;j<f.length;j++)for(var s=0;s<o.length;s++){var a=i+f[j]+o[s];(!e||_||a)&&r.push(a)}}return r}});var z0=R((iLt,FR)=>{function bge(t){return Array.isArray(t)?t:[t]}var _Xe=void 0,Y0="",vge=" ",k0="\\",EXe=/^\s+$/,TXe=/(?:[^\\]|^)\\$/,fXe=/^\\!/,SXe=/^\\#/,pXe=/\r?\n/g,dXe=/^\.{0,2}\/|^\.{1,2}$/,hXe=/\/$/,b_="/",Uge="node-ignore";typeof Symbol<"u"&&(Uge=Symbol.for("node-ignore"));var xge=Uge,U_=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),AXe=/([0-z])-([0-z])/g,wge=()=>!1,mXe=t=>t.replace(AXe,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:Y0),gXe=t=>{let{length:e}=t;return t.slice(0,e-e%2)},RXe=[[/^\uFEFF/,()=>Y0],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?vge:Y0)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+vge}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>k0],[/\\\\/g,()=>k0],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===k0?`\\[${r}${gXe(n)}${i}`:i==="]"&&n.length%2===0?`[${mXe(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],OXe=/(^|\\\/)?\\\*$/,CS="regex",$R="checkRegex",yge="_",NXe={[CS](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[$R](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},CXe=t=>RXe.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),BR=t=>typeof t=="string",IXe=t=>t&&BR(t)&&!EXe.test(t)&&!TXe.test(t)&&t.indexOf("#")!==0,MXe=t=>t.split(pXe).filter(Boolean),H0=class{constructor(e,r,n,i,o,s){this.pattern=e,this.mark=r,this.negative=o,U_(this,"body",n),U_(this,"ignoreCase",i),U_(this,"regexPrefix",s)}get regex(){let e=yge+CS;return this[e]?this[e]:this._make(CS,e)}get checkRegex(){let e=yge+$R;return this[e]?this[e]:this._make($R,e)}_make(e,r){let n=this.regexPrefix.replace(OXe,NXe[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return U_(this,r,i)}},PXe=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(fXe,"!").replace(SXe,"#");let o=CXe(i);return new H0(t,e,i,r,n,o)},j0=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[xge]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(BR(e)&&(e={pattern:e}),IXe(e.pattern)){let r=PXe(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,bge(BR(e)?MXe(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,o=!1,s;this._rules.forEach(c=>{let{negative:u}=c;o===u&&i!==o||u&&!i&&!o&&!r||!c[n].test(e)||(i=!u,o=u,s=u?_Xe:c)});let a={ignored:i,unignored:o};return s&&(a.rule=s),a}},DXe=(t,e)=>{throw new e(t)},Zo=(t,e,r)=>BR(t)?t?Zo.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),Vge=t=>dXe.test(t);Zo.isNotRelative=Vge;Zo.convert=t=>t;var K0=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){U_(this,xge,!0),this._rules=new j0(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let o=e&&Zo.convert(e);return Zo(o,e,this._strictPathCheck?DXe:wge),this._t(o,r,n,i)}checkIgnore(e){if(!hXe.test(e))return this.test(e);let r=e.split(b_).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(b_)+b_,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,$R)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(b_).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,CS);let o=this._t(i.join(b_)+b_,r,n,i);return r[e]=o.ignored?o:this._rules.test(e,n,CS)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return bge(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},W0=t=>new K0(t),LXe=t=>Zo(t&&Zo.convert(t),t,wge),Gge=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Zo.convert=t;let e=/^[a-z]:\//i;Zo.isNotRelative=r=>e.test(r)||Vge(r)};typeof process<"u"&&process.platform==="win32"&&Gge();FR.exports=W0;W0.default=W0;FR.exports.isPathValid=LXe;U_(FR.exports,Symbol.for("setupWindows"),Gge)});var MRe=R((Zbt,IRe)=>{"use strict";IRe.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var DRe=R((Xbt,PRe)=>{"use strict";var AJe=MRe();PRe.exports=t=>typeof t=="string"?t.replace(AJe(),""):t});var vRe=R((Jbt,Sx)=>{"use strict";var LRe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);Sx.exports=LRe;Sx.exports.default=LRe});var bRe=R((Qbt,yRe)=>{"use strict";yRe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var xRe=R((eUt,px)=>{"use strict";var mJe=DRe(),gJe=vRe(),RJe=bRe(),URe=t=>{if(typeof t!="string"||t.length===0||(t=mJe(t),t.length===0))return 0;t=t.replace(RJe()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=gJe(n)?2:1)}return e};px.exports=URe;px.exports.default=URe});import*as Qo from"fs/promises";import*as HRe from"os";import*as Wc from"path";var Ie=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var pt="8.55.0";var we=globalThis;function ts(t,e,r){let n=r||we,i=n.__SENTRY__=n.__SENTRY__||{},o=i[pt]=i[pt]||{};return o[t]||(o[t]=e())}var qr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var eOe="Sentry Logger ",k_=["debug","info","warn","error","log","assert","trace"],qc={};function Ut(t){if(!("console"in we))return t();let e=we.console,r={},n=Object.keys(qc);n.forEach(i=>{let o=qc[i];r[i]=e[i],e[i]=o});try{return t()}finally{n.forEach(i=>{e[i]=r[i]})}}function tOe(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return qr?k_.forEach(r=>{e[r]=(...n)=>{t&&Ut(()=>{we.console[r](`${eOe}[${r}]:`,...n)})}}):k_.forEach(r=>{e[r]=()=>{}}),e}var H=ts("logger",tOe);var Mx=/\(error: (.*)\)/,Px=/captureMessage|captureException/;function HS(...t){let e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,i=0)=>{let o=[],s=r.split(`
|
|
25
25
|
`);for(let a=n;a<s.length;a++){let c=s[a];if(c.length>1024)continue;let u=Mx.test(c)?c.replace(Mx,"$1"):c;if(!u.match(/\S*Error: /)){for(let _ of e){let E=_(u);if(E){o.push(E);break}}if(o.length>=50+i)break}}return Dx(o.slice(i))}}function mO(t){return Array.isArray(t)?HS(...t):t}function Dx(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(YS(e).function||"")&&e.pop(),e.reverse(),Px.test(YS(e).function||"")&&(e.pop(),Px.test(YS(e).function||"")&&e.pop()),e.slice(0,50).map(r=>({...r,filename:r.filename||YS(e).filename,function:r.function||"?"}))}function YS(t){return t[t.length-1]||{}}var AO="<anonymous>";function Y_(t){try{return!t||typeof t!="function"?AO:t.name||AO}catch{return AO}}var jS={},Lx={};function Zc(t,e){jS[t]=jS[t]||[],jS[t].push(e)}function Xc(t,e){if(!Lx[t]){Lx[t]=!0;try{e()}catch(r){qr&&H.error(`Error while instrumenting ${t}`,r)}}}function Jc(t,e){let r=t&&jS[t];if(r)for(let n of r)try{n(e)}catch(i){qr&&H.error(`Error while triggering instrumentation handler.
|
|
26
26
|
Type: ${t}
|
|
27
27
|
Name: ${Y_(n)}
|
|
@@ -39,7 +39,7 @@ Event: ${uo(t)}.
|
|
|
39
39
|
Url: ${Np(t)}`),!0):ONe(t,e.allowUrls)?!1:(Ie&&H.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
40
40
|
Event: ${uo(t)}.
|
|
41
41
|
Url: ${Np(t)}`),!0)}function mNe(t,e){return t.type||!e||!e.length?!1:NNe(t).some(r=>rs(r,e))}function gNe(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?rs(r,e):!1}function RNe(t,e){if(!e||!e.length)return!1;let r=Np(t);return r?rs(r,e):!1}function ONe(t,e){if(!e||!e.length)return!0;let r=Np(t);return r?rs(r,e):!0}function NNe(t){let e=[];t.message&&e.push(t.message);let r;try{r=t.exception.values[t.exception.values.length-1]}catch{}return r&&r.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`)),e}function CNe(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function INe(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Np(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?INe(e):null}catch{return Ie&&H.error(`Cannot extract url for event ${uo(t)}`),null}}function MNe(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}function Gw(t,e,r=250,n,i,o,s){if(!o.exception||!o.exception.values||!s||!Mi(s.originalException,Error))return;let a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=PNe(pN(t,e,i,s.originalException,n,o.exception.values,a,0),r))}function pN(t,e,r,n,i,o,s,a){if(o.length>=r+1)return o;let c=[...o];if(Mi(n[i],Error)){ww(s,a);let u=t(e,n[i]),_=c.length;Vw(u,i,_,a),c=pN(t,e,r,n[i],i,[u,...c],u,_)}return Array.isArray(n.errors)&&n.errors.forEach((u,_)=>{if(Mi(u,Error)){ww(s,a);let E=t(e,u),T=c.length;Vw(E,`errors[${_}]`,T,a),c=pN(t,e,r,u,i,[E,...c],E,T)}}),c}function ww(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function Vw(t,e,r,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:r,parent_id:n}}function PNe(t,e){return t.map(r=>(r.value&&(r.value=_r(r.value,e)),r))}var DNe="cause",LNe=5,vNe="LinkedErrors",yNe=((t={})=>{let e=t.limit||LNe,r=t.key||DNe;return{name:vNe,preprocessEvent(n,i,o){let s=o.getOptions();Gw(fN,s.stackParser,s.maxValueLength,r,e,n,i)}}}),Ip=yNe;function dN(t){let e={},r=0;for(;r<t.length;){let n=t.indexOf("=",r);if(n===-1)break;let i=t.indexOf(";",r);if(i===-1)i=t.length;else if(i<n){r=t.lastIndexOf(";",n-1)+1;continue}let o=t.slice(r,n).trim();if(e[o]===void 0){let s=t.slice(n+1,i).trim();s.charCodeAt(0)===34&&(s=s.slice(1,-1));try{e[o]=s.indexOf("%")!==-1?decodeURIComponent(s):s}catch{e[o]=s}}r=i+1}return e}function Es(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}function cu(t){return t.split(/[?#]/,1)[0]}function Ts(t){let{protocol:e,host:r,path:n}=t,i=r&&r.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${e?`${e}://`:""}${i}${n}`}var Mp=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function hN(t){return Mp.map(i=>{let o=t[i],s=Array.isArray(o)?o.join(";"):o;return i==="Forwarded"?bNe(s):s&&s.split(",").map(a=>a.trim())}).reduce((i,o)=>o?i.concat(o):i,[]).find(i=>i!==null&&UNe(i))||null}function bNe(t){if(!t)return null;for(let e of t.split(";"))if(e.startsWith("for="))return e.slice(4);return null}function UNe(t){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(t)}var $w={ip:!1,request:!0,user:!0},Pp=["cookies","data","headers","method","query_string","url"],AN=["id","username","email"];function Bw(t,e){let r={};return(Array.isArray(e)?e:AN).forEach(i=>{t&&i in t&&(r[i]=t[i])}),r}function mN(t,e={}){let{include:r=Pp}=e,n={},i=t.headers||{},o=t.method,s=i.host||t.hostname||t.host||"<no host>",a=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",c=t.originalUrl||t.url||"",u=c.startsWith(a)?c:`${a}://${s}${c}`;return r.forEach(_=>{switch(_){case"headers":{n.headers=i,r.includes("cookies")||delete n.headers.cookie,r.includes("ip")||Mp.forEach(E=>{delete n.headers[E]});break}case"method":{n.method=o;break}case"url":{n.url=u;break}case"cookies":{n.cookies=t.cookies||i.cookie&&dN(i.cookie)||{};break}case"query_string":{n.query_string=xNe(t);break}case"data":{if(o==="GET"||o==="HEAD")break;let E=t.body;if(E!==void 0){let T=Ii(E)?E:br(E)?JSON.stringify(fn(E)):_r(`${E}`,1024);T&&(n.data=T)}break}default:({}).hasOwnProperty.call(t,_)&&(n[_]=t[_])}}),n}function gN(t,e,r,n){let i={...$w,...n&&n.include};if(i.request){let o=Array.isArray(i.request)?[...i.request]:[...Pp];i.ip&&o.push("ip");let s=wNe(e,{include:o});t.request={...t.request,...s}}if(i.user){let o=r.user&&br(r.user)?Bw(r.user,i.user):{};Object.keys(o).length&&(t.user={...o,...t.user})}if(i.ip){let o=e.headers&&hN(e.headers)||r.ipAddress;o&&(t.user={...t.user,ip_address:o})}}function Dp(t,e,r){let n={...$w,...r&&r.include};if(n.request){let i=Array.isArray(n.request)?[...n.request]:[...Pp];n.ip&&i.push("ip");let o=mN(e,{include:i});t.request={...t.request,...o}}if(n.user){let i=e.user&&br(e.user)?Bw(e.user,n.user):{};Object.keys(i).length&&(t.user={...t.user,...i})}if(n.ip){let i=e.headers&&hN(e.headers)||e.ip||e.socket&&e.socket.remoteAddress;i&&(t.user={...t.user,ip_address:i})}return t}function xNe(t){let e=t.originalUrl||t.url||"";if(e){e.startsWith("/")&&(e=`http://dogs.are.great${e}`);try{let r=t.query||new URL(e).search.slice(1);return r.length?r:void 0}catch{return}}}function Fw(t){let e=Object.create(null);try{Object.entries(t).forEach(([r,n])=>{typeof n=="string"&&(e[r]=n)})}catch{qr&&H.warn("Sentry failed extracting headers from a request object. If you see this, please file an issue.")}return e}function RN(t){let e=t.headers||{},r=e.host||"<no host>",n=t.socket&&t.socket.encrypted?"https":"http",i=t.url||"",o=i.startsWith(n)?i:`${n}://${r}${i}`,s=t.body||void 0,a=t.cookies;return Ye({url:o,method:t.method,query_string:kw(i),headers:Fw(e),cookies:a,data:s})}function kw(t){if(t)try{let e=new URL(t,"http://dogs.are.great").search.slice(1);return e.length?e:void 0}catch{return}}function wNe(t,{include:e}){let r=e?Array.isArray(e)?e:Pp:[],n={},i={...t.headers};if(r.includes("headers")&&(n.headers=i,e.includes("cookies")||delete i.cookie,e.includes("ip")||Mp.forEach(o=>{delete i[o]})),r.includes("method")&&(n.method=t.method),r.includes("url")&&(n.url=t.url),r.includes("cookies")){let o=t.cookies||(i&&i.cookie?dN(i.cookie):void 0);n.cookies=o||{}}return r.includes("query_string")&&(n.query_string=t.query_string),r.includes("data")&&(n.data=t.data),n}var ON={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"},VNe="RequestData",GNe=((t={})=>{let e={...ON,...t,include:{...ON.include,...t.include,user:t.include&&typeof t.include.user=="boolean"?t.include.user:{...ON.include.user,...(t.include||{}).user}}};return{name:VNe,processEvent(r){let{sdkProcessingMetadata:n={}}=r,{request:i,normalizedRequest:o}=n,s=$Ne(e);if(o){let a=i?i.ip||i.socket&&i.socket.remoteAddress:void 0,c=i?i.user:void 0;return gN(r,o,{ipAddress:a,user:c},s),r}return i?Dp(r,i,s):r}}}),Lp=GNe;function $Ne(t){let{transactionNamingScheme:e,include:{ip:r,user:n,...i}}=t,o=["method"];for(let[a,c]of Object.entries(i))c&&o.push(a);let s;if(n===void 0)s=!0;else if(typeof n=="boolean")s=n;else{let a=[];for(let[c,u]of Object.entries(n))u&&a.push(c);s=a}return{include:{ip:r,user:s,request:o.length!==0?o:void 0,transaction:e}}}function NN(t){let e="console";Zc(e,t),Xc(e,BNe)}function BNe(){"console"in we&&k_.forEach(function(t){t in we.console&&LO(we.console,t,function(e){return qc[t]=e,function(...r){Jc("console",{args:r,level:t});let i=qc[t];i&&i.apply(we.console,r)}})})}function CN(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var FNe=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function kNe(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,r=FNe.exec(e);return r?r.slice(1):[]}function IN(t){let e=kNe(t),r=e[0]||"",n=e[1];return!r&&!n?".":(n&&(n=n.slice(0,n.length-1)),r+n)}function aE(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}function Hw(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function jw(t){let e=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return n=>{let i=n.match(r);if(i){let o,s,a,c,u;if(i[1]){a=i[1];let T=a.lastIndexOf(".");if(a[T-1]==="."&&T--,T>0){o=a.slice(0,T),s=a.slice(T+1);let f=o.indexOf(".Module");f>0&&(a=a.slice(f+1),o=o.slice(0,f))}c=void 0}s&&(c=o,u=s),s==="<anonymous>"&&(u=void 0,a=void 0),a===void 0&&(u=u||"?",a=c?`${c}.${u}`:u);let _=i[2]&&i[2].startsWith("file://")?i[2].slice(7):i[2],E=i[5]==="native";return _&&_.match(/\/[A-Z]:/)&&(_=_.slice(1)),!_&&i[5]&&!E&&(_=i[5]),{filename:_?decodeURI(_):void 0,module:t?t(_):void 0,function:a,lineno:Yw(i[3]),colno:Yw(i[4]),in_app:Hw(_||"",E)}}if(n.match(e))return{filename:n}}}function MN(t){return[90,jw(t)]}function Yw(t){return parseInt(t||"",10)||void 0}var Cn=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let r=this._cache.get(e);if(r!==void 0)return this._cache.delete(e),this._cache.set(e,r),r}set(e,r){this._cache.size>=this._maxSize&&this._cache.delete(this._cache.keys().next().value),this._cache.set(e,r)}remove(e){let r=this._cache.get(e);return r&&this._cache.delete(e),r}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(r=>e.push(r)),e}};function sr(t,e){return t??e()}function ce(t){let e,r=t[0],n=1;for(;n<t.length;){let i=t[n],o=t[n+1];if(n+=2,(i==="optionalAccess"||i==="optionalCall")&&r==null)return;i==="access"||i==="optionalAccess"?(e=r,r=o(r)):(i==="call"||i==="optionalCall")&&(r=o((...s)=>r.call(e,...s)),e=void 0)}return r}var G7=ne(pe(),1),$7=ne(x6(),1);var Fe=ne(dt(),1);var on=ne(pe(),1),de=ne(pe(),1);ut();rM();var $M="sentry.parentIsRemote",Xu="sentry.graphql.operation";function BM(t){let e=t;return!!e.attributes&&typeof e.attributes=="object"}function Bxe(t){return typeof t.kind=="number"}function Fxe(t){return!!t.status}function a7(t){return!!t.name}function kxe(t){return!!t.parentSpanId}function Yxe(t){if(!BM(t))return{};let e=t.attributes[Fe.ATTR_URL_FULL]||t.attributes[Fe.SEMATTRS_HTTP_URL],r={url:e,"http.method":t.attributes[Fe.ATTR_HTTP_REQUEST_METHOD]||t.attributes[Fe.SEMATTRS_HTTP_METHOD]};!r["http.method"]&&r.url&&(r["http.method"]="GET");try{if(typeof e=="string"){let n=Es(e);r.url=Ts(n),n.search&&(r["http.query"]=n.search),n.hash&&(r["http.fragment"]=n.hash)}}catch{}return r}function Hxe(t){return Bxe(t)?t.kind:de.SpanKind.INTERNAL}var vM="sentry-trace",yM="baggage",FM="sentry.dsc",kM="sentry.sampled_not_recording",c7="sentry.url",u7=(0,de.createContextKey)("sentry_scopes"),bM=(0,de.createContextKey)("sentry_fork_isolation_scope"),UM=(0,de.createContextKey)("sentry_fork_set_scope"),xM=(0,de.createContextKey)("sentry_fork_set_isolation_scope"),l7="_scopeContext";function hT(t){return t.getValue(u7)}function _7(t,e){return t.setValue(u7,e)}function jxe(t,e){xt(t,l7,e)}function YM(t){return t[l7]}function r7(t){let e,r=t[0],n=1;for(;n<t.length;){let i=t[n],o=t[n+1];if(n+=2,(i==="optionalAccess"||i==="optionalCall")&&r==null)return;i==="access"||i==="optionalAccess"?(e=r,r=o(r)):(i==="call"||i==="optionalCall")&&(r=o((...s)=>r.call(e,...s)),e=void 0)}return r}function Zu(t){let{traceFlags:e,traceState:r}=t,n=r?r.get(kM)==="1":!1;if(e===de.TraceFlags.SAMPLED)return!0;if(n)return!1;let i=r?r.get(FM):void 0,o=i?os(i):void 0;if(r7([o,"optionalAccess",s=>s.sampled])==="true")return!0;if(r7([o,"optionalAccess",s=>s.sampled])==="false")return!1}function E7(t,e,r){let n=e[Fe.ATTR_HTTP_REQUEST_METHOD]||e[Fe.SEMATTRS_HTTP_METHOD];if(n)return Wxe({attributes:e,name:t,kind:r},n);let i=e[Fe.SEMATTRS_DB_SYSTEM],o=typeof e[Be]=="string"&&e[Be].startsWith("cache.");if(i&&!o)return Kxe({attributes:e,name:t});let s=e[jt]==="custom"?"custom":"route";if(e[Fe.SEMATTRS_RPC_SERVICE])return{...dT(t,e,"route"),op:"rpc"};if(e[Fe.SEMATTRS_MESSAGING_SYSTEM])return{...dT(t,e,s),op:"message"};let u=e[Fe.SEMATTRS_FAAS_TRIGGER];return u?{...dT(t,e,s),op:u.toString()}:{op:void 0,description:t,source:"custom"}}function T7(t){let e=BM(t)?t.attributes:{},r=a7(t)?t.name:"<unknown>",n=Hxe(t);return E7(r,e,n)}function Kxe({attributes:t,name:e}){let r=t[Li];if(typeof r=="string")return{op:"db",description:r,source:t[jt]||"custom"};if(t[jt]==="custom")return{op:"db",description:e,source:"custom"};let n=t[Fe.SEMATTRS_DB_STATEMENT];return{op:"db",description:n?n.toString():e,source:"task"}}function Wxe({name:t,kind:e,attributes:r},n){let i=["http"];switch(e){case de.SpanKind.CLIENT:i.push("client");break;case de.SpanKind.SERVER:i.push("server");break}r["sentry.http.prefetch"]&&i.push("prefetch");let{urlPath:o,url:s,query:a,fragment:c,hasRoute:u}=qxe(r,e);if(!o)return{...dT(t,r),op:i.join(".")};let _=r[Xu],E=`${n} ${o}`,T=_?`${E} (${zxe(_)})`:E,f=u||o==="/"?"route":"url",S={};s&&(S.url=s),a&&(S["http.query"]=a),c&&(S["http.fragment"]=c);let d=e===de.SpanKind.CLIENT||e===de.SpanKind.SERVER,g=!`${r[it]||"manual"}`.startsWith("auto"),N=r[jt]==="custom",O=r[Li],C=!N&&O==null&&(d||!g),{description:v,source:x}=C?{description:T,source:f}:dT(t,r);return{op:i.join("."),description:v,source:x,data:S}}function zxe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}function qxe(t,e){let r=t[Fe.SEMATTRS_HTTP_TARGET],n=t[Fe.SEMATTRS_HTTP_URL]||t[Fe.ATTR_URL_FULL],i=t[Fe.ATTR_HTTP_ROUTE],o=typeof n=="string"?Es(n):void 0,s=o?Ts(o):void 0,a=o&&o.search?o.search:void 0,c=o&&o.hash?o.hash:void 0;return typeof i=="string"?{urlPath:i,url:s,query:a,fragment:c,hasRoute:!0}:e===de.SpanKind.SERVER&&typeof r=="string"?{urlPath:cu(r),url:s,query:a,fragment:c,hasRoute:!1}:o?{urlPath:s,url:s,query:a,fragment:c,hasRoute:!1}:typeof r=="string"?{urlPath:cu(r),url:s,query:a,fragment:c,hasRoute:!1}:{urlPath:void 0,url:s,query:a,fragment:c,hasRoute:!1}}function dT(t,e,r="custom"){let n=e[jt]||r,i=e[Li];return i&&typeof i=="string"?{description:i,source:n}:{description:t,source:n}}function f7(t){t.on("createDsc",(e,r)=>{if(!r)return;let o=(xe(r).data||{})[jt],{description:s}=a7(r)?T7(r):{description:void 0};if(o!=="url"&&s&&(e.transaction=s),Ur()){let a=Zu(r.spanContext());e.sampled=a==null?void 0:String(a)}})}function S7({dsc:t,sampled:e}){let r=t?La(t):void 0,n=new ja,i=r?n.set(FM,r):n;return e===!1?i.set(kM,"1"):i}function p7(){return de.trace.getActiveSpan()}var Oo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,d7=new Set;function h7(){return Array.from(d7)}function zh(t){d7.add(t)}function sc(t){let e,r=t[0],n=1;for(;n<t.length;){let i=t[n],o=t[n+1];if(n+=2,(i==="optionalAccess"||i==="optionalCall")&&r==null)return;i==="access"||i==="optionalAccess"?(e=r,r=o(r)):(i==="call"||i==="optionalCall")&&(r=o((...s)=>r.call(e,...s)),e=void 0)}return r}function Zxe(t){let e=t.spanContext(),{traceId:r,spanId:n,traceState:i}=e,o=i?i.get(FM):void 0,s=o?os(o):void 0,a=kxe(t)?t.parentSpanId:void 0,c=Zu(e),u=s||Dt(Nt(t));return{traceId:r,spanId:n,sampled:c,parentSpanId:a,dsc:u}}var jh=class extends Au{constructor(){super(),zh("SentryPropagator"),this._urlMatchesTargetsMap=new Cn(100)}inject(e,r,n){if(wi(e)){Oo&&H.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");return}let i=de.trace.getSpan(e),o=i&&Qxe(i),s=sc([Pe,"call",f=>f(),"optionalAccess",f=>f.getOptions,"call",f=>f(),"optionalAccess",f=>f.tracePropagationTargets]);if(!HM(o,s,this._urlMatchesTargetsMap)){Oo&&H.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:",o);return}let a=Jxe(r),c=de.propagation.getBaggage(e)||de.propagation.createBaggage({}),{dynamicSamplingContext:u,traceId:_,spanId:E,sampled:T}=A7(e);if(a){let f=tp(a);f&&Object.entries(f).forEach(([S,d])=>{c=c.setEntry(S,{value:d})})}u&&(c=Object.entries(u).reduce((f,[S,d])=>d?f.setEntry(`${K_}${S}`,{value:d}):f,c)),_&&_!==de.INVALID_TRACEID&&n.set(r,vM,ss(_,E,T)),super.inject(de.propagation.setBaggage(e,c),r,n)}extract(e,r,n){let i=n.get(r,vM),o=n.get(r,yM),s=i?Array.isArray(i)?i[0]:i:void 0;return g7(m7(e,{sentryTrace:s,baggage:o}))}fields(){return[vM,yM]}},n7="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";function HM(t,e,r){if(typeof t!="string"||!e)return!0;let n=sc([r,"optionalAccess",o=>o.get,"call",o=>o(t)]);if(n!==void 0)return Oo&&!n&&H.log(n7,t),n;let i=rs(t,e);return sc([r,"optionalAccess",o=>o.set,"call",o=>o(t,i)]),Oo&&!i&&H.log(n7,t),i}function A7(t){let e=de.trace.getSpan(t);if(e&&e.spanContext().isRemote){let s=e.spanContext();return{dynamicSamplingContext:Dt(e),traceId:s.traceId,spanId:Er(),sampled:Zu(s)}}if(e){let s=e.spanContext();return{dynamicSamplingContext:Dt(e),traceId:s.traceId,spanId:s.spanId,sampled:Zu(s)}}let r=sc([hT,"call",s=>s(t),"optionalAccess",s=>s.scope])||Qe(),n=Pe(),i=r.getPropagationContext();return{dynamicSamplingContext:n?yi(n,r):void 0,traceId:i.traceId,spanId:i.spanId,sampled:i.sampled}}function m7(t,{sentryTrace:e,baggage:r}){let n=W_(e,r),{traceId:i,parentSpanId:o,sampled:s,dsc:a}=n;if(!o)return t;let c=ewe({traceId:i,spanId:o,sampled:s,dsc:a});return de.trace.setSpanContext(t,c)}function Xxe(t,e,r){let n=g7(m7(t,e));return de.context.with(n,r)}function g7(t){let e=hT(t),r={scope:e?e.scope:Qe().clone(),isolationScope:e?e.isolationScope:ze()};return _7(t,r)}function Jxe(t){try{let e=t[yM];return Array.isArray(e)?e.join(","):e}catch{return}}function Qxe(t){let e=xe(t).data,r=sc([e,"optionalAccess",i=>i[Fe.SEMATTRS_HTTP_URL]])||sc([e,"optionalAccess",i=>i[Fe.ATTR_URL_FULL]]);if(r)return r;let n=sc([t,"access",i=>i.spanContext,"call",i=>i(),"access",i=>i.traceState,"optionalAccess",i=>i.get,"call",i=>i(c7)]);if(n)return n}function ewe({spanId:t,traceId:e,sampled:r,dsc:n}){let i=S7({dsc:n,sampled:r});return{traceId:e,spanId:t,isRemote:!0,traceFlags:r?de.TraceFlags.SAMPLED:de.TraceFlags.NONE,traceState:i}}function twe(t,e){let r=jM(),{name:n,parentSpan:i}=t;return zM(i)(()=>{let s=WM(t.scope,t.forceTransaction),c=t.onlyIfParent&&!de.trace.getSpan(s)?oi(s):s,u=KM(t);return r.startActiveSpan(n,u,c,_=>ba(()=>e(_),()=>{xe(_).status===void 0&&_.setStatus({code:de.SpanStatusCode.ERROR})},()=>_.end()))})}function rwe(t,e){let r=jM(),{name:n,parentSpan:i}=t;return zM(i)(()=>{let s=WM(t.scope,t.forceTransaction),c=t.onlyIfParent&&!de.trace.getSpan(s)?oi(s):s,u=KM(t);return r.startActiveSpan(n,u,c,_=>ba(()=>e(_,()=>_.end()),()=>{xe(_).status===void 0&&_.setStatus({code:de.SpanStatusCode.ERROR})}))})}function nwe(t){let e=jM(),{name:r,parentSpan:n}=t;return zM(n)(()=>{let o=WM(t.scope,t.forceTransaction),a=t.onlyIfParent&&!de.trace.getSpan(o)?oi(o):o,c=KM(t);return e.startSpan(r,c,a)})}function R7(t,e){let r=t?de.trace.setSpan(de.context.active(),t):de.trace.deleteSpan(de.context.active());return de.context.with(r,()=>e(Qe()))}function jM(){let t=Pe();return t&&t.tracer||de.trace.getTracer("@sentry/opentelemetry",pt)}function KM(t){let{startTime:e,attributes:r,kind:n,op:i}=t,o=typeof e=="number"?iwe(e):e;return{attributes:i?{[Be]:i,...r}:r,kind:n,startTime:o}}function iwe(t){return t<9999999999?t*1e3:t}function WM(t,e){let r=owe(t),n=de.trace.getSpan(r);if(!n||!e)return r;let i=de.trace.deleteSpan(r),{spanId:o,traceId:s}=n.spanContext(),a=Zu(n.spanContext()),c=Nt(n),u=Dt(c),_=S7({dsc:u,sampled:a}),E={traceId:s,spanId:o,isRemote:!0,traceFlags:a?de.TraceFlags.SAMPLED:de.TraceFlags.NONE,traceState:_};return de.trace.setSpanContext(i,E)}function owe(t){if(t){let e=YM(t);if(e)return e}return de.context.active()}function swe(t,e){return Xxe(de.context.active(),t,e)}function O7(t,e){let r=YM(e),n=r&&de.trace.getSpan(r),i=n?as(n):Da(e);return[n?Dt(n):yi(t,e),i]}function zM(t){return t!==void 0?e=>R7(t,e):e=>e()}function awe(t){let e=oi(de.context.active());return de.context.with(e,t)}function N7(t){t.on("preprocessEvent",e=>{let r=p7();if(!r||e.type==="transaction")return;e.contexts={trace:as(r),...e.contexts};let n=Nt(r);return e.sdkProcessingMetadata={dynamicSamplingContext:Dt(n),...e.sdkProcessingMetadata},e})}function cwe({span:t}={}){let e=on.context.active();if(t){let{scope:s}=ya(t);e=s&&YM(s)||on.trace.setSpan(on.context.active(),t)}let{traceId:r,spanId:n,sampled:i,dynamicSamplingContext:o}=A7(e);return{"sentry-trace":ss(r,n,i),baggage:La(o)}}function C7(){function t(){let a=on.context.active(),c=hT(a);return c||{scope:nu(),isolationScope:Di()}}function e(a){let c=on.context.active();return on.context.with(c,()=>a(o()))}function r(a,c){let u=on.context.active();return on.context.with(u.setValue(UM,a),()=>c(a))}function n(a){let c=on.context.active();return on.context.with(c.setValue(bM,!0),()=>a(s()))}function i(a,c){let u=on.context.active();return on.context.with(u.setValue(xM,a),()=>c(s()))}function o(){return t().scope}function s(){return t().isolationScope}$O({withScope:e,withSetScope:r,withSetIsolationScope:i,withIsolationScope:n,getCurrentScope:o,getIsolationScope:s,startSpan:twe,startSpanManual:rwe,startInactiveSpan:nwe,getActiveSpan:p7,suppressTracing:awe,getTraceData:cwe,continueTrace:swe,withActiveSpan:R7})}function i7(t){let e,r=t[0],n=1;for(;n<t.length;){let i=t[n],o=t[n+1];if(n+=2,(i==="optionalAccess"||i==="optionalCall")&&r==null)return;i==="access"||i==="optionalAccess"?(e=r,r=o(r)):(i==="call"||i==="optionalCall")&&(r=o((...s)=>r.call(e,...s)),e=void 0)}return r}function I7(t){class e extends t{constructor(...n){super(...n),zh("SentryContextManager")}with(n,i,o,...s){let a=hT(n),c=i7([a,"optionalAccess",N=>N.scope])||Qe(),u=i7([a,"optionalAccess",N=>N.isolationScope])||ze(),_=n.getValue(bM)===!0,E=n.getValue(UM),T=n.getValue(xM),f=E||c.clone(),S=T||(_?u.clone():u),g=_7(n,{scope:f,isolationScope:S}).deleteValue(bM).deleteValue(UM).deleteValue(xM);return jxe(f,g),super.with(g,i,o,...s)}}return e}function uwe(t){let e=new Map;for(let r of t)lwe(e,r);return Array.from(e,function([r,n]){return n})}function M7(t){return t.attributes[$M]===!0?void 0:t.parentSpanId}function lwe(t,e){let r=e.spanContext().spanId,n=M7(e);if(!n){wM(t,{id:r,span:e,children:[]});return}let i=_we(t,n),o=wM(t,{id:r,span:e,parentNode:i,children:[]});i.children.push(o)}function _we(t,e){let r=t.get(e);return r||wM(t,{id:e,children:[]})}function wM(t,e){let r=t.get(e.id);return r&&r.span?r:r&&!r.span?(r.span=e.span,r.parentNode=e.parentNode,r):(t.set(e.id,e),e)}var P7={1:"cancelled",2:"unknown_error",3:"invalid_argument",4:"deadline_exceeded",5:"not_found",6:"already_exists",7:"permission_denied",8:"resource_exhausted",9:"failed_precondition",10:"aborted",11:"out_of_range",12:"unimplemented",13:"internal_error",14:"unavailable",15:"data_loss",16:"unauthenticated"},Ewe=t=>Object.values(P7).includes(t);function D7(t){let e=BM(t)?t.attributes:{},r=Fxe(t)?t.status:void 0;if(r){if(r.code===de.SpanStatusCode.OK)return{code:1};if(r.code===de.SpanStatusCode.ERROR){if(typeof r.message>"u"){let i=o7(e);if(i)return i}return r.message&&Ewe(r.message)?{code:2,message:r.message}:{code:2,message:"unknown_error"}}}let n=o7(e);return n||(r&&r.code===de.SpanStatusCode.UNSET?{code:1}:{code:2,message:"unknown_error"})}function o7(t){let e=t[Fe.ATTR_HTTP_RESPONSE_STATUS_CODE]||t[Fe.SEMATTRS_HTTP_STATUS_CODE],r=t[Fe.SEMATTRS_RPC_GRPC_STATUS_CODE],n=typeof e=="number"?e:typeof e=="string"?parseInt(e):void 0;if(typeof n=="number")return ep(n);if(typeof r=="string")return{code:2,message:P7[r]||"unknown_error"}}function Twe(t){let e,r=t[0],n=1;for(;n<t.length;){let i=t[n],o=t[n+1];if(n+=2,(i==="optionalAccess"||i==="optionalCall")&&r==null)return;i==="access"||i==="optionalAccess"?(e=r,r=o(r)):(i==="call"||i==="optionalCall")&&(r=o((...s)=>r.call(e,...s)),e=void 0)}return r}var s7=1e3,fwe=300,VM=class{constructor(e){this._finishedSpanBucketSize=Twe([e,"optionalAccess",r=>r.timeout])||fwe,this._finishedSpanBuckets=new Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(Date.now()/1e3),this._spansToBucketEntry=new WeakMap}export(e){let r=Math.floor(Date.now()/1e3);if(this._lastCleanupTimestampInS!==r){let o=0;this._finishedSpanBuckets.forEach((s,a)=>{s&&s.timestampInS<=r-this._finishedSpanBucketSize&&(o+=s.spans.size,this._finishedSpanBuckets[a]=void 0)}),o>0&&Oo&&H.log(`SpanExporter dropped ${o} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=r}let n=r%this._finishedSpanBucketSize,i=this._finishedSpanBuckets[n]||{timestampInS:r,spans:new Set};this._finishedSpanBuckets[n]=i,i.spans.add(e),this._spansToBucketEntry.set(e,i),M7(e)||(this._clearTimeout(),this._flushTimeout=setTimeout(()=>{this.flush()},1))}flush(){this._clearTimeout();let e=[];this._finishedSpanBuckets.forEach(o=>{o&&e.push(...o.spans)});let r=Swe(e),n=r.size,i=e.length-n;Oo&&H.log(`SpanExporter exported ${n} spans, ${i} spans are waiting for their parent spans to finish`),r.forEach(o=>{let s=this._spansToBucketEntry.get(o);s&&s.spans.delete(o)})}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._clearTimeout()}_clearTimeout(){this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0)}};function Swe(t){let e=uwe(t),r=new Set;return dwe(e).forEach(i=>{let o=i.span;r.add(o);let s=Awe(o),a=s.spans||[];i.children.forEach(u=>{GM(u,a,r)}),s.spans=a.length>s7?a.sort((u,_)=>u.start_timestamp-_.start_timestamp).slice(0,s7):a;let c=Ua(o.events);c&&(s.measurements=c),dp(s)}),r}function pwe(t){return!!t.span&&!t.parentNode}function dwe(t){return t.filter(pwe)}function hwe(t){let e=t.attributes,r=e[it],n=e[Be],i=e[jt];return{origin:r,op:n,source:i}}function Awe(t){let{op:e,description:r,data:n,origin:i="manual",source:o}=L7(t),s=ya(t),a=t.attributes[ni],c=Ye({[jt]:o,[ni]:a,[Be]:e,[it]:i,...n,...v7(t.attributes)}),{traceId:u,spanId:_}=t.spanContext(),E=t.parentSpanId,T=D7(t),f=Ye({parent_span_id:E,span_id:_,trace_id:u,data:c,origin:i,op:e,status:va(T)}),S=c[Fe.ATTR_HTTP_RESPONSE_STATUS_CODE],d=typeof S=="number"?{response:{status_code:S}}:void 0;return Ye({contexts:{trace:f,otel:{resource:t.resource.attributes},...d},spans:[],start_timestamp:Zr(t.startTime),timestamp:Zr(t.endTime),transaction:r,type:"transaction",sdkProcessingMetadata:{...Ye({capturedSpanScope:s.scope,capturedSpanIsolationScope:s.isolationScope,sampleRate:a,dynamicSamplingContext:Dt(t)})},...o&&{transaction_info:{source:o}},_metrics_summary:To(t)})}function GM(t,e,r){let n=t.span;if(n&&r.add(n),!n){t.children.forEach(N=>{GM(N,e,r)});return}let o=n.spanContext().spanId,s=n.spanContext().traceId,{attributes:a,startTime:c,endTime:u,parentSpanId:_}=n,{op:E,description:T,data:f,origin:S="manual"}=L7(n),d=Ye({[it]:S,[Be]:E,...v7(a),...f}),p=D7(n),g=Ye({span_id:o,trace_id:s,data:d,description:T,parent_span_id:_,start_timestamp:Zr(c),timestamp:Zr(u)||void 0,status:va(p),op:E,origin:S,_metrics_summary:To(n),measurements:Ua(n.events)});e.push(g),t.children.forEach(N=>{GM(N,e,r)})}function L7(t){let{op:e,source:r,origin:n}=hwe(t),{op:i,description:o,source:s,data:a}=T7(t),c=e||i,u=r||s,_={...a,...mwe(t)};return{op:c,description:o,source:u,origin:n,data:_}}function v7(t){let e={...t};return delete e[ni],delete e[$M],delete e[Li],e}function mwe(t){let e=t.attributes,r={};t.kind!==de.SpanKind.INTERNAL&&(r["otel.kind"]=de.SpanKind[t.kind]);let n=e[Fe.SEMATTRS_HTTP_STATUS_CODE];n&&(r[Fe.ATTR_HTTP_RESPONSE_STATUS_CODE]=n);let i=Yxe(t);return i.url&&(r.url=i.url),i["http.query"]&&(r["http.query"]=i["http.query"].slice(1)),i["http.fragment"]&&(r["http.fragment"]=i["http.fragment"].slice(1)),r}function y7(t){let e,r=t[0],n=1;for(;n<t.length;){let i=t[n],o=t[n+1];if(n+=2,(i==="optionalAccess"||i==="optionalCall")&&r==null)return;i==="access"||i==="optionalAccess"?(e=r,r=o(r)):(i==="call"||i==="optionalCall")&&(r=o((...s)=>r.call(e,...s)),e=void 0)}return r}function gwe(t,e){let r=de.trace.getSpan(e),n=hT(e);r&&!r.spanContext().isRemote&&ou(r,t),r&&r.spanContext().isRemote&&t.setAttribute($M,!0),e===de.ROOT_CONTEXT&&(n={scope:nu(),isolationScope:Di()}),n&&q_(t,n.scope,n.isolationScope),Z_(t);let i=Pe();y7([i,"optionalAccess",o=>o.emit,"call",o=>o("spanStart",t)])}function Rwe(t){X_(t);let e=Pe();y7([e,"optionalAccess",r=>r.emit,"call",r=>r("spanEnd",t)])}var Kh=class{constructor(e){zh("SentrySpanProcessor"),this._exporter=new VM(e)}async forceFlush(){this._exporter.flush()}async shutdown(){this._exporter.clear()}onStart(e,r){gwe(e,r)}onEnd(e){Rwe(e),this._exporter.export(e)}},Wh=class{constructor(e){this._client=e,zh("SentrySampler")}shouldSample(e,r,n,i,o,s){let a=this._client.getOptions(),c=Iwe(e),u=ce([c,"optionalAccess",v=>v.spanContext,"call",v=>v()]);if(!Ur(a))return qu({decision:void 0,context:e,spanAttributes:o});let _=o[Fe.SEMATTRS_HTTP_METHOD]||o[Fe.ATTR_HTTP_REQUEST_METHOD];if(i===de.SpanKind.CLIENT&&_&&(!c||ce([u,"optionalAccess",v=>v.isRemote])))return qu({decision:void 0,context:e,spanAttributes:o});let E=c?Nwe(c,r,n):void 0,{description:T,data:f,op:S}=E7(n,o,i),d={...f,...o};S&&(d[Be]=S);let p={decision:!0};if(this._client.emit("beforeSampling",{spanAttributes:d,spanName:T,parentSampled:E,parentContext:u},p),!p.decision)return qu({decision:void 0,context:e,spanAttributes:o});let[g,N]=J_(a,{name:T,attributes:d,transactionContext:{name:T,parentSampled:E},parentSampled:E}),O={[ni]:N},C=`${_}`.toUpperCase();return C==="OPTIONS"||C==="HEAD"?(Oo&&H.log(`[Tracing] Not sampling span because HTTP method is '${C}' for ${n}`),{...qu({decision:dr.NOT_RECORD,context:e,spanAttributes:o}),attributes:O}):g?{...qu({decision:dr.RECORD_AND_SAMPLED,context:e,spanAttributes:o}),attributes:O}:{...qu({decision:dr.NOT_RECORD,context:e,spanAttributes:o}),attributes:O}}toString(){return"SentrySampler"}};function Owe(t){let e=t.spanContext().traceId,r=Zxe(t);return r&&e===r.traceId?r.sampled:void 0}function Nwe(t,e,r){let n=t.spanContext();if((0,de.isSpanContextValid)(n)&&n.traceId===e){if(n.isRemote){let o=Owe(t);return Oo&&H.log(`[Tracing] Inheriting remote parent's sampled decision for ${r}: ${o}`),o}let i=Zu(n);return Oo&&H.log(`[Tracing] Inheriting parent's sampled decision for ${r}: ${i}`),i}}function qu({decision:t,context:e,spanAttributes:r}){let n=Cwe(e,r);return t==null?{decision:dr.NOT_RECORD,traceState:n}:t===dr.NOT_RECORD?{decision:t,traceState:n.set(kM,"1")}:{decision:t,traceState:n}}function Cwe(t,e){let r=de.trace.getSpan(t),n=ce([r,"optionalAccess",s=>s.spanContext,"call",s=>s()]),i=ce([n,"optionalAccess",s=>s.traceState])||new ja,o=e[Fe.SEMATTRS_HTTP_URL]||e[Fe.ATTR_URL_FULL];return o&&typeof o=="string"&&(i=i.set(c7,o)),i}function Iwe(t){let e=de.trace.getSpan(t);return e&&(0,de.isSpanContextValid)(e.spanContext())?e:void 0}et();var b7={};function Ve(t,e){return Object.assign(r=>{let n=b7[t];if(n){r&&n.setConfig(r);return}let i=e(r);b7[t]=i,Os({instrumentations:[i]})},{id:t})}function vt(t,e){t.setAttribute(it,e)}function qh(t){let e=t.protocol||"",r=t.hostname||t.host||"",n=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(r)?"":`:${t.port}`,i=t.path?t.path:"/";return`${e}//${r}${n}${i}`}ut();et();var st=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;import*as U7 from"url";var x7=(t,e,r)=>{let n,i,o,s=!1;if(typeof e=="string"){try{let c=Mwe(e);o=c,n=c.pathname||"/"}catch(c){s=!0,t.verbose("Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:",c),o={path:e},n=o.path||"/"}i=`${o.protocol||"http:"}//${o.host}`,r!==void 0&&Object.assign(o,r)}else if(e instanceof U7.URL)o={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,path:`${e.pathname||""}${e.search||""}`},e.port!==""&&(o.port=Number(e.port)),(e.username||e.password)&&(o.auth=`${e.username}:${e.password}`),n=e.pathname,i=e.origin,r!==void 0&&Object.assign(o,r);else{o=Object.assign({protocol:e.host?"http:":void 0},e);let c=o.host||(o.port!=null?`${o.hostname}${o.port}`:o.hostname);if(i=`${o.protocol||"http:"}//${c}`,n=e.pathname,!n&&o.path)try{n=new URL(o.path,i).pathname||"/"}catch{n="/"}}let a=o.method?o.method.toUpperCase():"GET";return{origin:i,pathname:n,method:a,optionsParsed:o,invalidUrl:s}};function Mwe(t){let{hostname:e,pathname:r,port:n,username:i,password:o,search:s,protocol:a,hash:c,href:u,origin:_,host:E}=new URL(t),T={protocol:a,hostname:e&&e[0]==="["?e.slice(1,-1):e,hash:c,search:s,pathname:r,path:`${r||""}${s||""}`,href:u,origin:_,host:E};return n!==""&&(T.port=Number(n)),(i||o)&&(T.auth=`${decodeURIComponent(i)}:${decodeURIComponent(o)}`),T}var w7=1024*1024,Zh=class extends wn{constructor(e={}){super("@sentry/instrumentation-http",gu,e)}init(){return[this._getHttpsInstrumentation(),this._getHttpInstrumentation()]}_getHttpInstrumentation(){return new li("http",["*"],e=>{Ju(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction());let r=Ju(e,"request",this._getPatchOutgoingRequestFunction());return Ju(e,"get",this._getPatchOutgoingGetFunction(r)),e},()=>{})}_getHttpsInstrumentation(){return new li("https",["*"],e=>{Ju(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction());let r=Ju(e,"request",this._getPatchOutgoingRequestFunction());return Ju(e,"get",this._getPatchOutgoingGetFunction(r)),e},()=>{})}_getPatchIncomingRequestFunction(){let e=this;return r=>function(i,...o){if(i!=="request")return r.apply(this,[i,...o]);e._diag.debug("http instrumentation for incoming request");let s=ze().clone(),a=o[0],c=RN(a);vwe(a,s),s.setSDKProcessingMetadata({request:a,normalizedRequest:c});let u=Pe();u&&u.getOptions().autoSessionTracking&&s.setRequestSession({status:"ok"});let _=(a.method||"GET").toUpperCase(),E=cu(a.url||"/"),T=`${_} ${E}`;return s.setTransactionName(T),j_(s,()=>r.apply(this,[i,...o]))}}_getPatchOutgoingRequestFunction(){let e=this;return r=>function(...i){e._diag.debug("http instrumentation for outgoing requests");let o=[...i],s=o.shift(),a=typeof o[0]=="object"&&(typeof s=="string"||s instanceof URL)?o.shift():void 0,{optionsParsed:c}=x7(e._diag,s,a),u=r.apply(this,i);return u.prependListener("response",_=>{let E=e.getConfig().breadcrumbs,T=typeof E>"u"?!0:E,f=e.getConfig().ignoreOutgoingRequests,S=typeof f=="function"?!f(qh(u),c):!0;T&&S&&Dwe(u,_)}),u}}_getPatchOutgoingGetFunction(e){return r=>function(...i){let o=e(...i);return o.end(),o}}};function Ju(t,e,r){let n=t[e],i=r(n);return Pwe(t,e,i),i}function Pwe(t,e,r){let n=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}function Dwe(t,e){let r=Lwe(t),n=e.statusCode,i=aE(n);Nn({category:"http",data:{status_code:n,...r},type:"http",level:i},{event:"response",request:t,response:e})}function Lwe(t){try{let e=t.getHeader("host")||t.host,r=new URL(t.path,`${t.protocol}//${e}`),n=Es(r.toString()),i={url:Ts(n),"http.method":t.method||"GET"};return n.search&&(i["http.query"]=n.search),n.hash&&(i["http.fragment"]=n.hash),i}catch{return{}}}function vwe(t,e){let r=[];function n(){return r.reduce((o,s)=>o+s.byteLength,0)}let i=new WeakMap;try{t.on=new Proxy(t.on,{apply:(o,s,a)=>{let[c,u,..._]=a;if(c==="data"){let E=new Proxy(u,{apply:(T,f,S)=>{if(n()<w7){let d=S[0];r.push(d)}else st&&H.log(`Dropping request body chunk because it maximum body length of ${w7}b is exceeded.`);return Reflect.apply(T,f,S)}});return i.set(u,E),Reflect.apply(o,s,[c,E,..._])}if(c==="end"){let E=new Proxy(u,{apply:(T,f,S)=>{try{let d=Buffer.concat(r).toString("utf-8");if(d){let p={data:d};e.setSDKProcessingMetadata({normalizedRequest:p})}}catch{}return Reflect.apply(T,f,S)}});return i.set(u,E),Reflect.apply(o,s,[c,E,..._])}return Reflect.apply(o,s,a)}}),t.off=new Proxy(t.off,{apply:(o,s,a)=>{let[,c]=a,u=i.get(c);if(u){i.delete(c);let _=a.slice();return _[1]=u,Reflect.apply(o,s,_)}return Reflect.apply(o,s,a)}})}catch{}}var qM="Http",V7="@opentelemetry_sentry-patched/instrumentation-http",ywe=Ve(`${qM}.sentry`,t=>new Zh({breadcrumbs:ce([t,"optionalAccess",e=>e.breadcrumbs]),ignoreOutgoingRequests:ce([t,"optionalAccess",e=>e.ignoreOutgoingRequests])})),bwe=Ve(qM,t=>{let e=new $7.HttpInstrumentation(t);try{e._diag=G7.diag.createComponentLogger({namespace:V7}),e.instrumentationName=V7}catch{}return e}),Uwe=(t={})=>{if(t.spans!==!1){let e=Vwe(t);bwe(e)}ywe(t)},B7=(t={})=>({name:qM,setupOnce(){Uwe(t)}});function xwe(t){return"outputData"in t&&"outputSize"in t&&!("client"in t)&&!("statusCode"in t)}function wwe(t){return t.headers["next-router-prefetch"]==="1"}function Vwe(t={}){return{...ce([t,"access",r=>r.instrumentation,"optionalAccess",r=>r._experimentalConfig]),disableIncomingRequestInstrumentation:t.disableIncomingRequestSpans,ignoreOutgoingRequestHook:r=>{let n=qh(r);if(!n)return!1;let i=t.ignoreOutgoingRequests;return!!(i&&i(n,r))},ignoreIncomingRequestHook:r=>{let n=r.url,i=ce([r,"access",s=>s.method,"optionalAccess",s=>s.toUpperCase,"call",s=>s()]);if(i==="OPTIONS"||i==="HEAD")return!0;let o=t.ignoreIncomingRequests;return!!(n&&o&&o(n,r))},requireParentforOutgoingSpans:!1,requireParentforIncomingSpans:!1,requestHook:(r,n)=>{vt(r,"auto.http.otel.http"),!xwe(n)&&wwe(n)&&r.setAttribute("sentry.http.prefetch",!0),ce([t,"access",i=>i.instrumentation,"optionalAccess",i=>i.requestHook,"optionalCall",i=>i(r,n)])},responseHook:(r,n)=>{let i=Pe();i&&i.getOptions().autoSessionTracking!==!1&&t.trackIncomingRequestsAsSessions!==!1&&setImmediate(()=>{i._captureRequestSession()}),ce([t,"access",o=>o.instrumentation,"optionalAccess",o=>o.responseHook,"optionalCall",o=>o(r,n)])},applyCustomAttributesOnSpan:(r,n,i)=>{ce([t,"access",o=>o.instrumentation,"optionalAccess",o=>o.applyCustomAttributesOnSpan,"optionalCall",o=>o(r,n,i)])}}}et();var q7=ne(z7(),1);var Bwe=((t={})=>{let e=typeof t.breadcrumbs>"u"?!0:t.breadcrumbs,r=t.ignoreOutgoingRequests;return{name:"NodeFetch",setupOnce(){let n=new Cn(100),i=new q7.UndiciInstrumentation({requireParentforSpans:!1,ignoreRequestHook:o=>{let s=Ywe(o.origin,o.path);if(r&&s&&r(s))return!0;if(!Ur()){let c=ce([Pe,"call",E=>E(),"optionalAccess",E=>E.getOptions,"call",E=>E(),"access",E=>E.tracePropagationTargets]),u=HM(s,c,n)?Rp():{},_=o.headers;return Array.isArray(_)?Object.entries(u).forEach(E=>_.push(...E)):o.headers+=Object.entries(u).map(([E,T])=>`${E}: ${T}\r
|
|
42
|
-
`).join(""),!0}return!1},startSpanHook:()=>({[it]:"auto.http.otel.node_fetch"}),responseHook:(o,{request:s,response:a})=>{e&&Fwe(s,a)}});Os({instrumentations:[i]})}}}),Z7=Bwe;function Fwe(t,e){let r=kwe(t),n=e.statusCode,i=aE(n);Nn({category:"http",data:{status_code:n,...r},type:"http",level:i},{event:"response",request:t,response:e})}function kwe(t){try{let e=new URL(t.path,t.origin),r=Es(e.toString()),n={url:Ts(r),"http.method":t.method||"GET"};return r.search&&(n["http.query"]=r.search),r.hash&&(n["http.fragment"]=r.hash),n}catch{return{}}}function Ywe(t,e="/"){let r=`${t}`;return r.endsWith("/")&&e.startsWith("/")?`${r}${e.slice(1)}`:!r.endsWith("/")&&!e.startsWith("/")?`${r}/${e.slice(1)}`:`${r}${e}`}import*as X7 from"node:util";var Hwe="Console",J7=()=>({name:Hwe,setup(t){NN(({args:e,level:r})=>{Pe()===t&&Nn({category:"console",level:CN(r),message:_r(X7.format.apply(void 0,e),2048)},{input:[...e],level:r})})}});import{execFile as jwe}from"node:child_process";import{readFile as Kwe,readdir as Wwe}from"node:fs";import*as Wt from"node:os";import{join as zwe}from"node:path";import{promisify as eQ}from"node:util";var qwe=eQ(Kwe),Zwe=eQ(Wwe),Xwe="Context",Jwe=((t={})=>{let e,r={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...t};async function n(o){e===void 0&&(e=i());let s=Qwe(await e);return o.contexts={...o.contexts,app:{...s.app,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.app])},os:{...s.os,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.os])},device:{...s.device,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.device])},culture:{...s.culture,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.culture])},cloud_resource:{...s.cloud_resource,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.cloud_resource])}},o}async function i(){let o={};if(r.os&&(o.os=await e1e()),r.app&&(o.app=r1e()),r.device&&(o.device=n1e(r.device)),r.culture){let s=t1e();s&&(o.culture=s)}return r.cloudResource&&(o.cloud_resource=u1e()),o}return{name:Xwe,processEvent(o){return n(o)}}}),tQ=Jwe;function Qwe(t){if(ce([t,"optionalAccess",e=>e.app,"optionalAccess",e=>e.app_memory])&&(t.app.app_memory=process.memoryUsage().rss),ce([t,"optionalAccess",e=>e.app,"optionalAccess",e=>e.free_memory])&&typeof process.availableMemory=="function"){let e=ce([process,"access",r=>r.availableMemory,"optionalCall",r=>r()]);e!=null&&(t.app.free_memory=e)}return ce([t,"optionalAccess",e=>e.device,"optionalAccess",e=>e.free_memory])&&(t.device.free_memory=Wt.freemem()),t}async function e1e(){let t=Wt.platform();switch(t){case"darwin":return a1e();case"linux":return c1e();default:return{name:i1e[t]||t,version:Wt.release()}}}function t1e(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let r=Intl.DateTimeFormat().resolvedOptions();return{locale:r.locale,timezone:r.timeZone}}}catch{}}function r1e(){let t=process.memoryUsage().rss,r={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t};if(typeof process.availableMemory=="function"){let n=ce([process,"access",i=>i.availableMemory,"optionalCall",i=>i()]);n!=null&&(r.free_memory=n)}return r}function n1e(t){let e={},r;try{r=Wt.uptime&&Wt.uptime()}catch{}if(typeof r=="number"&&(e.boot_time=new Date(Date.now()-r*1e3).toISOString()),e.arch=Wt.arch(),(t===!0||t.memory)&&(e.memory_size=Wt.totalmem(),e.free_memory=Wt.freemem()),t===!0||t.cpu){let n=Wt.cpus(),i=n&&n[0];i&&(e.processor_count=n.length,e.cpu_description=i.model,e.processor_frequency=i.speed)}return e}var i1e={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},o1e=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],s1e={alpine:t=>t,arch:t=>Hi(/distrib_release=(.*)/,t),centos:t=>Hi(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>Hi(/release (..)/,t),mint:t=>Hi(/distrib_release=(.*)/,t),red:t=>Hi(/release ([^ ]+)/,t),suse:t=>Hi(/VERSION = (.*)\n/,t),ubuntu:t=>Hi(/distrib_release=(.*)/,t)};function Hi(t,e){let r=t.exec(e);return r?r[1]:void 0}async function a1e(){let t={kernel_version:Wt.release(),name:"Mac OS X",version:`10.${Number(Wt.release().split(".")[0])-4}`};try{let e=await new Promise((r,n)=>{jwe("/usr/bin/sw_vers",(i,o)=>{if(i){n(i);return}r(o)})});t.name=Hi(/^ProductName:\s+(.*)$/m,e),t.version=Hi(/^ProductVersion:\s+(.*)$/m,e),t.build=Hi(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function Q7(t){return t.split(" ")[0].toLowerCase()}async function c1e(){let t={kernel_version:Wt.release(),name:"Linux"};try{let e=await Zwe("/etc"),r=o1e.find(a=>e.includes(a.name));if(!r)return t;let n=zwe("/etc",r.name),i=(await qwe(n,{encoding:"utf-8"})).toLowerCase(),{distros:o}=r;t.name=o.find(a=>i.indexOf(Q7(a))>=0)||o[0];let s=Q7(t.name);t.version=ce([s1e,"access",a=>a[s],"optionalCall",a=>a(i)])}catch{}return t}function u1e(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as l1e}from"node:fs";import{createInterface as _1e}from"node:readline";var XM=new Cn(10),iQ=new Cn(20),E1e=7,T1e="ContextLines",f1e=1e3,S1e=1e4;function p1e(t,e,r){let n=t.get(e);return n===void 0?(t.set(e,r),r):n}function d1e(t){return!!(t.startsWith("node:")||t.endsWith(".min.js")||t.endsWith(".min.cjs")||t.endsWith(".min.mjs")||t.startsWith("data:"))}function h1e(t){return t.lineno!==void 0&&t.lineno>S1e||t.colno!==void 0&&t.colno>f1e}function A1e(t,e){let r=XM.get(t);if(r===void 0)return!1;for(let n=e[0];n<=e[1];n++)if(r[n]===void 0)return!1;return!0}function m1e(t,e){if(!t.length)return[];let r=0,n=t[0];if(typeof n!="number")return[];let i=nQ(n,e),o=[];for(;;){if(r===t.length-1){o.push(i);break}let s=t[r+1];if(typeof s!="number")break;s<=i[1]?i[1]=s+e:(o.push(i),i=nQ(s,e)),r++}return o}function g1e(t,e,r){return new Promise((n,i)=>{let o=l1e(t),s=_1e({input:o});function a(){o.destroy(),n()}let c=0,u=0,_=e[u];if(_===void 0){a();return}let E=_[0],T=_[1];function f(S){iQ.set(t,1),st&&H.error(`Failed to read file: ${t}. Error: ${S}`),s.close(),s.removeAllListeners(),a()}o.on("error",f),s.on("error",f),s.on("close",a),s.on("line",S=>{if(c++,!(c<E)&&(r[c]=PO(S,0),c>=T)){if(u===e.length-1){s.close(),s.removeAllListeners();return}u++;let d=e[u];if(d===void 0){s.close(),s.removeAllListeners();return}E=d[0],T=d[1]}})})}async function R1e(t,e){let r={};if(e>0&&ce([t,"access",o=>o.exception,"optionalAccess",o=>o.values])){for(let o of t.exception.values)if(ce([o,"access",s=>s.stacktrace,"optionalAccess",s=>s.frames,"optionalAccess",s=>s.length]))for(let s=o.stacktrace.frames.length-1;s>=0;s--){let a=o.stacktrace.frames[s],c=ce([a,"optionalAccess",_=>_.filename]);if(!a||typeof c!="string"||typeof a.lineno!="number"||d1e(c)||h1e(a))continue;r[c]||(r[c]=[]),r[c].push(a.lineno)}}let n=Object.keys(r);if(n.length==0)return t;let i=[];for(let o of n){if(iQ.get(o))continue;let s=r[o];if(!s)continue;s.sort((u,_)=>u-_);let a=m1e(s,e);if(a.every(u=>A1e(o,u)))continue;let c=p1e(XM,o,{});i.push(g1e(o,a,c))}if(await Promise.all(i).catch(()=>{st&&H.log("Failed to read one or more source files and resolve context lines")}),e>0&&ce([t,"access",o=>o.exception,"optionalAccess",o=>o.values]))for(let o of t.exception.values)o.stacktrace&&o.stacktrace.frames&&o.stacktrace.frames.length>0&&O1e(o.stacktrace.frames,e,XM);return t}function O1e(t,e,r){for(let n of t)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let i=r.get(n.filename);if(i===void 0)continue;N1e(n.lineno,n,e,i)}}function rQ(t){delete t.pre_context,delete t.context_line,delete t.post_context}function N1e(t,e,r,n){if(e.lineno===void 0||n===void 0){st&&H.error("Cannot resolve context for frame with no lineno or file contents");return}e.pre_context=[];for(let o=oQ(t,r);o<t;o++){let s=n[o];if(s===void 0){rQ(e),st&&H.error(`Could not find line ${o} in file ${e.filename}`);return}e.pre_context.push(s)}if(n[t]===void 0){rQ(e),st&&H.error(`Could not find line ${t} in file ${e.filename}`);return}e.context_line=n[t];let i=sQ(t,r);e.post_context=[];for(let o=t+1;o<=i;o++){let s=n[o];if(s===void 0)break;e.post_context.push(s)}}function oQ(t,e){return Math.max(1,t-e)}function sQ(t,e){return t+e}function nQ(t,e){return[oQ(t,e),sQ(t,e)]}var C1e=((t={})=>{let e=t.frameContextLines!==void 0?t.frameContextLines:E1e;return{name:T1e,processEvent(r){return R1e(r,e)}}}),aQ=C1e;var JM=xO(process.versions.node),cQ=JM.major;import{Worker as I1e}from"node:worker_threads";var eA;async function tA(){if(eA===void 0)try{eA=!!(await import("node:inspector")).url()}catch{eA=!1}return eA}var gT="__SENTRY_ERROR_LOCAL_VARIABLES__";function lQ(t,e,r){let n=0,i=5,o=0;return setInterval(()=>{o===0?n>t&&(i*=2,r(i),i>86400&&(i=86400),o=i):(o-=1,o===0&&e()),n=0},1e3).unref(),()=>{n+=1}}function uQ(t){return t!==void 0&&(t.length===0||t==="?"||t==="<anonymous>")}function rA(t,e){return t===e||uQ(t)&&uQ(e)}var M1e="LyohIEBzZW50cnkvbm9kZSA4LjU1LjAgKDEzNGZjZjMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPSI4LjU1LjAiLG89Z2xvYmFsVGhpcztjb25zdCBpPSJ1bmRlZmluZWQiPT10eXBlb2YgX19TRU5UUllfREVCVUdfX3x8X19TRU5UUllfREVCVUdfXyxhPVsiZGVidWciLCJpbmZvIiwid2FybiIsImVycm9yIiwibG9nIiwiYXNzZXJ0IiwidHJhY2UiXSxzPXt9O2Z1bmN0aW9uIGMoZSl7aWYoISgiY29uc29sZSJpbiBvKSlyZXR1cm4gZSgpO2NvbnN0IHQ9by5jb25zb2xlLG49e30saT1PYmplY3Qua2V5cyhzKTtpLmZvckVhY2goKGU9Pntjb25zdCBvPXNbZV07bltlXT10W2VdLHRbZV09b30pKTt0cnl7cmV0dXJuIGUoKX1maW5hbGx5e2kuZm9yRWFjaCgoZT0+e3RbZV09bltlXX0pKX19IWZ1bmN0aW9uKGUsdCxpKXtjb25zdCBhPW8scz1hLl9fU0VOVFJZX189YS5fX1NFTlRSWV9ffHx7fSxjPXNbbl09c1tuXXx8e307Y1tlXXx8KGNbZV09dCgpKX0oImxvZ2dlciIsKGZ1bmN0aW9uKCl7bGV0IGU9ITE7Y29uc3QgdD17ZW5hYmxlOigpPT57ZT0hMH0sZGlzYWJsZTooKT0+e2U9ITF9LGlzRW5hYmxlZDooKT0+ZX07cmV0dXJuIGk/YS5mb3JFYWNoKChuPT57dFtuXT0oLi4udCk9PntlJiZjKCgoKT0+e28uY29uc29sZVtuXShgU2VudHJ5IExvZ2dlciBbJHtufV06YCwuLi50KX0pKX19KSk6YS5mb3JFYWNoKChlPT57dFtlXT0oKT0+e319KSksdH0pKTtjb25zdCByPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgdT10O2Z1bmN0aW9uIGwoLi4uZSl7dS5kZWJ1ZyYmYygoKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpKX1hc3luYyBmdW5jdGlvbiBmKGUsdCxuLG8pe2NvbnN0IGk9YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtvW25dPWkucmVzdWx0LmZpbHRlcigoZT0+Imxlbmd0aCIhPT1lLm5hbWUmJiFpc05hTihwYXJzZUludChlLm5hbWUsMTApKSkpLnNvcnQoKChlLHQpPT5wYXJzZUludChlLm5hbWUsMTApLXBhcnNlSW50KHQubmFtZSwxMCkpKS5tYXAoKGU9PmUudmFsdWU/LnZhbHVlKSl9YXN5bmMgZnVuY3Rpb24gZyhlLHQsbixvKXtjb25zdCBpPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSk7b1tuXT1pLnJlc3VsdC5tYXAoKGU9PltlLm5hbWUsZS52YWx1ZT8udmFsdWVdKSkucmVkdWNlKCgoZSxbdCxuXSk9PihlW3RdPW4sZSkpLHt9KX1mdW5jdGlvbiBkKGUsdCl7ZS52YWx1ZSYmKCJ2YWx1ZSJpbiBlLnZhbHVlP3ZvaWQgMD09PWUudmFsdWUudmFsdWV8fG51bGw9PT1lLnZhbHVlLnZhbHVlP3RbZS5uYW1lXT1gPCR7ZS52YWx1ZS52YWx1ZX0+YDp0W2UubmFtZV09ZS52YWx1ZS52YWx1ZToiZGVzY3JpcHRpb24iaW4gZS52YWx1ZSYmImZ1bmN0aW9uIiE9PWUudmFsdWUudHlwZT90W2UubmFtZV09YDwke2UudmFsdWUuZGVzY3JpcHRpb259PmA6InVuZGVmaW5lZCI9PT1lLnZhbHVlLnR5cGUmJih0W2UubmFtZV09Ijx1bmRlZmluZWQ+IikpfWFzeW5jIGZ1bmN0aW9uIGIoZSx0KXtjb25zdCBuPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSksbz17fTtmb3IoY29uc3QgdCBvZiBuLnJlc3VsdClpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10Py52YWx1ZS5jbGFzc05hbWUpe2NvbnN0IG49dC52YWx1ZS5vYmplY3RJZDthd2FpdCBmKGUsbix0Lm5hbWUsbyl9ZWxzZSBpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJPYmplY3QiPT09dD8udmFsdWU/LmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGcoZSxuLHQubmFtZSxvKX1lbHNlIHQ/LnZhbHVlJiZkKHQsbyk7cmV0dXJuIG99bGV0IHA7KGFzeW5jIGZ1bmN0aW9uKCl7Y29uc3QgdD1uZXcgZTt0LmNvbm5lY3RUb01haW5UaHJlYWQoKSxsKCJDb25uZWN0ZWQgdG8gbWFpbiB0aHJlYWQiKTtsZXQgbj0hMTt0Lm9uKCJEZWJ1Z2dlci5yZXN1bWVkIiwoKCk9PntuPSExfSkpLHQub24oIkRlYnVnZ2VyLnBhdXNlZCIsKGU9PntuPSEwLGFzeW5jIGZ1bmN0aW9uKGUse3JlYXNvbjp0LGRhdGE6e29iamVjdElkOm59LGNhbGxGcmFtZXM6b30pe2lmKCJleGNlcHRpb24iIT09dCYmInByb21pc2VSZWplY3Rpb24iIT09dClyZXR1cm47aWYocD8uKCksbnVsbD09bilyZXR1cm47Y29uc3QgaT1bXTtmb3IobGV0IHQ9MDt0PG8ubGVuZ3RoO3QrKyl7Y29uc3R7c2NvcGVDaGFpbjpuLGZ1bmN0aW9uTmFtZTphLHRoaXM6c309b1t0XSxjPW4uZmluZCgoZT0+ImxvY2FsIj09PWUudHlwZSkpLHI9Imdsb2JhbCIhPT1zLmNsYXNzTmFtZSYmcy5jbGFzc05hbWU/YCR7cy5jbGFzc05hbWV9LiR7YX1gOmE7aWYodm9pZCAwPT09Yz8ub2JqZWN0Lm9iamVjdElkKWlbdF09e2Z1bmN0aW9uOnJ9O2Vsc2V7Y29uc3Qgbj1hd2FpdCBiKGUsYy5vYmplY3Qub2JqZWN0SWQpO2lbdF09e2Z1bmN0aW9uOnIsdmFyczpufX19YXdhaXQgZS5wb3N0KCJSdW50aW1lLmNhbGxGdW5jdGlvbk9uIix7ZnVuY3Rpb25EZWNsYXJhdGlvbjpgZnVuY3Rpb24oKSB7IHRoaXMuJHtyfSA9IHRoaXMuJHtyfSB8fCAke0pTT04uc3RyaW5naWZ5KGkpfTsgfWAsc2lsZW50OiEwLG9iamVjdElkOm59KSxhd2FpdCBlLnBvc3QoIlJ1bnRpbWUucmVsZWFzZU9iamVjdCIse29iamVjdElkOm59KX0odCxlLnBhcmFtcykudGhlbigoYXN5bmMoKT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSwoYXN5bmMgZT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSl9KSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBvPSExIT09dS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6bz8iYWxsIjoidW5jYXVnaHQifSksbyl7Y29uc3QgZT11Lm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO3A9ZnVuY3Rpb24oZSx0LG4pe2xldCBvPTAsaT01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCgpPT57MD09PWE/bz5lJiYoaSo9MixuKGkpLGk+ODY0MDAmJihpPTg2NDAwKSxhPWkpOihhLT0xLDA9PT1hJiZ0KCkpLG89MH0pLDFlMykudW5yZWYoKSwoKT0+e28rPTF9fShlLChhc3luYygpPT57bCgiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9KSwoYXN5bmMgZT0+e2woYFJhdGUtbGltaXQgZXhjZWVkZWQuIERpc2FibGluZyBjYXB0dXJpbmcgb2YgY2F1Z2h0IGV4Y2VwdGlvbnMgZm9yICR7ZX0gc2Vjb25kcy5gKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6InVuY2F1Z2h0In0pfSkpfX0pKCkuY2F0Y2goKGU9PntsKCJGYWlsZWQgdG8gc3RhcnQgZGVidWdnZXIiLGUpfSkpLHNldEludGVydmFsKCgoKT0+e30pLDFlNCk7";function _Q(...t){H.log("[LocalVariables]",...t)}var EQ=((t={})=>{function e(o,s){let a=(ce([o,"access",c=>c.stacktrace,"optionalAccess",c=>c.frames])||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let u=a.length-c-1,_=s[c],E=a[u];if(!E||!_)break;_.vars===void 0||E.in_app===!1||!rA(E.function,_.function)||(E.vars=_.vars)}}function r(o,s){if(s.originalException&&typeof s.originalException=="object"&&gT in s.originalException&&Array.isArray(s.originalException[gT])){for(let a of ce([o,"access",c=>c.exception,"optionalAccess",c=>c.values])||[])e(a,s.originalException[gT]);s.originalException[gT]=void 0}return o}async function n(){let o=await import("node:inspector");o.url()||o.open(0)}function i(o){let s=new I1e(new URL(`data:application/javascript;base64,${M1e}`),{workerData:o,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{s.terminate()}),s.once("error",a=>{_Q("Worker error",a)}),s.once("exit",a=>{_Q("Worker exit",a)}),s.unref()}return{name:"LocalVariablesAsync",async setup(o){if(!o.getOptions().includeLocalVariables)return;if(await tA()){H.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...t,debug:H.isEnabled()};n().then(()=>{try{i(a)}catch(c){H.error("Failed to start worker",c)}},c=>{H.error("Failed to start inspector",c)})},processEvent(o,s){return r(o,s)}}});function TQ(t){if(t!==void 0)return t.slice(-10).reduce((e,r)=>`${e},${r.function},${r.lineno},${r.colno}`,"")}function P1e(t,e){if(e!==void 0)return TQ(t(e,1))}function fQ(t){let e=[],r=!1;function n(s){e=[],!r&&(r=!0,t(s))}e.push(n);function i(s){e.push(s)}function o(s){let a=e.pop()||n;try{a(s)}catch{n(s)}}return{add:i,next:o}}var QM=class t{constructor(e){this._session=e}static async create(e){if(e)return e;let r=await import("node:inspector");return new t(new r.Session)}configureAndConnect(e,r){this._session.connect(),this._session.on("Debugger.paused",n=>{e(n,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:r?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,r){this._getProperties(e,n=>{let{add:i,next:o}=fQ(r);for(let s of n)if(ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&ce([s,"optionalAccess",a=>a.value,"access",a=>a.className])==="Array"){let a=s.value.objectId;i(c=>this._unrollArray(a,s.name,c,o))}else if(ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.className])==="Object"){let a=s.value.objectId;i(c=>this._unrollObject(a,s.name,c,o))}else ce([s,"optionalAccess",a=>a.value])&&i(a=>this._unrollOther(s,a,o));o({})})}_getProperties(e,r){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(n,i)=>{r(n?[]:i.result)})}_unrollArray(e,r,n,i){this._getProperties(e,o=>{n[r]=o.filter(s=>s.name!=="length"&&!isNaN(parseInt(s.name,10))).sort((s,a)=>parseInt(s.name,10)-parseInt(a.name,10)).map(s=>ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])),i(n)})}_unrollObject(e,r,n,i){this._getProperties(e,o=>{n[r]=o.map(s=>[s.name,ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])]).reduce((s,[a,c])=>(s[a]=c,s),{}),i(n)})}_unrollOther(e,r,n){e.value&&("value"in e.value?e.value.value===void 0||e.value.value===null?r[e.name]=`<${e.value.value}>`:r[e.name]=e.value.value:"description"in e.value&&e.value.type!=="function"?r[e.name]=`<${e.value.description}>`:e.value.type==="undefined"&&(r[e.name]="<undefined>")),n(r)}},D1e="LocalVariables",L1e=((t={},e)=>{let r=new Cn(20),n,i=!1;function o(a){let c=TQ(ce([a,"optionalAccess",E=>E.stacktrace,"optionalAccess",E=>E.frames]));if(c===void 0)return;let u=r.remove(c);if(u===void 0)return;let _=(ce([a,"access",E=>E.stacktrace,"optionalAccess",E=>E.frames])||[]).filter(E=>E.function!=="new Promise");for(let E=0;E<_.length;E++){let T=_.length-E-1,f=u[E],S=_[T];if(!S||!f)break;f.vars===void 0||S.in_app===!1||!rA(S.function,f.function)||(S.vars=f.vars)}}function s(a){for(let c of ce([a,"optionalAccess",u=>u.exception,"optionalAccess",u=>u.values])||[])o(c);return a}return{name:D1e,async setupOnce(){let a=Pe(),c=ce([a,"optionalAccess",_=>_.getOptions,"call",_=>_()]);if(!ce([c,"optionalAccess",_=>_.includeLocalVariables]))return;if(cQ<18){H.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await tA()){H.warn("Local variables capture has been disabled because the debugger was already enabled");return}QM.create(e).then(_=>{function E(f,{params:{reason:S,data:d,callFrames:p}},g){if(S!=="exception"&&S!=="promiseRejection"){g();return}ce([n,"optionalCall",v=>v()]);let N=P1e(f,ce([d,"optionalAccess",v=>v.description]));if(N==null){g();return}let{add:O,next:C}=fQ(v=>{r.set(N,v),g()});for(let v=0;v<Math.min(p.length,5);v++){let{scopeChain:x,functionName:G,this:J}=p[v],j=x.find(V=>V.type==="local"),z=J.className==="global"||!J.className?G:`${J.className}.${G}`;if(ce([j,"optionalAccess",V=>V.object,"access",V=>V.objectId])===void 0)O(V=>{V[v]={function:z},C(V)});else{let V=j.object.objectId;O(W=>ce([_,"optionalAccess",ae=>ae.getLocalVariables,"call",ae=>ae(V,oe=>{W[v]={function:z,vars:oe},C(W)})]))}}C([])}let T=t.captureAllExceptions!==!1;if(_.configureAndConnect((f,S)=>E(c.stackParser,f,S),T),T){let f=t.maxExceptionsPerSecond||50;n=lQ(f,()=>{H.log("Local variables rate-limit lifted."),ce([_,"optionalAccess",S=>S.setPauseOnExceptions,"call",S=>S(!0)])},S=>{H.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${S} seconds.`),ce([_,"optionalAccess",d=>d.setPauseOnExceptions,"call",d=>d(!1)])})}i=!0},_=>{H.log("The `LocalVariables` integration failed to start.",_)})},processEvent(a){return i?s(a):a},_getCachedFramesCount(){return r.size},_getFirstCachedFrame(){return r.values()[0]}}}),SQ=L1e;var pQ=(t={})=>JM.major<19?SQ(t):EQ(t);import{existsSync as v1e,readFileSync as y1e}from"node:fs";import{dirname as b1e,join as U1e}from"node:path";function el(){return typeof Y<"u"}var eP,dQ="Modules",x1e=(()=>el()?{name:dQ,processEvent(t){return t.modules={...t.modules,...G1e()},t}}:(st&&H.warn("modulesIntegration only works in CommonJS (CJS) environments. Remove this integration if you are using ESM."),{name:dQ})),hQ=x1e;function w1e(){try{return Y.cache?Object.keys(Y.cache):[]}catch{return[]}}function V1e(){let t=Y.main&&Y.main.paths||[],e=w1e(),r={},n={};return e.forEach(i=>{let o=i,s=()=>{let a=o;if(o=b1e(a),!o||a===o||n[a])return;if(t.indexOf(o)<0)return s();let c=U1e(a,"package.json");if(n[a]=!0,!v1e(c))return s();try{let u=JSON.parse(y1e(c,"utf8"));r[u.name]=u.version}catch{}};s()}),r}function G1e(){return eP||(eP=V1e()),eP}var $1e=2e3;function RT(t){Ut(()=>{console.error(t)});let e=Pe();if(e===void 0){st&&H.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let r=e.getOptions(),n=r&&r.shutdownTimeout&&r.shutdownTimeout>0&&r.shutdownTimeout||$1e;e.close(n).then(i=>{i||st&&H.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},i=>{st&&H.error(i)})}var B1e="OnUncaughtException",AQ=(t={})=>{let e={exitEvenIfOtherHandlersAreRegistered:!1,...t};return{name:B1e,setup(r){global.process.on("uncaughtException",F1e(r,e))}}};function F1e(t,e){let n=!1,i=!1,o=!1,s,a=t.getOptions();return Object.assign(c=>{let u=RT;e.onFatalError?u=e.onFatalError:a.onFatalError&&(u=a.onFatalError);let E=global.process.listeners("uncaughtException").filter(f=>f.name!=="domainUncaughtExceptionClear"&&f.tag!=="sentry_tracingErrorCallback"&&f._errorHandler!==!0).length===0,T=e.exitEvenIfOtherHandlersAreRegistered||E;n?T&&(o?(st&&H.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),RT(c)):i||(i=!0,setTimeout(()=>{o||(o=!0,u(s,c))},2e3))):(s=c,n=!0,Pe()===t&&Xr(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"onuncaughtexception"}}),!o&&T&&(o=!0,u(c)))},{_errorHandler:!0})}var k1e="OnUnhandledRejection",Y1e=((t={})=>{let e=t.mode||"warn";return{name:k1e,setup(r){global.process.on("unhandledRejection",H1e(r,{mode:e}))}}}),mQ=Y1e;function H1e(t,e){return function(n,i){Pe()===t&&(Xr(n,{originalException:i,captureContext:{extra:{unhandledPromiseRejection:!0}},mechanism:{handled:!1,type:"onunhandledrejection"}}),j1e(n,e))}}function j1e(t,e){let r="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";e.mode==="warn"?Ut(()=>{console.warn(r),console.error(t&&typeof t=="object"&&"stack"in t?t.stack:t)}):e.mode==="strict"&&(Ut(()=>{console.warn(r)}),RT(t))}var yQ=ne(vQ(),1);var bQ="Express",UQ=Ve(bQ,()=>new yQ.ExpressInstrumentation({requestHook(t){vt(t,"auto.http.otel.express");let e=xe(t).data||{},r=e["express.type"];r&&t.setAttribute(Be,`${r}.express`);let n=e["express.name"];typeof n=="string"&&t.updateName(n)},spanNameHook(t,e){if(ze()===Di())return st&&H.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let r=t.request,n=r.method?r.method.toUpperCase():"GET";ze().setTransactionName(`${n} ${t.route}`)}return e}})),nVe=(()=>({name:bQ,setupOnce(){UQ()}})),xQ=nVe;var jQ=ne(HQ(),1);var KQ="Fastify",WQ=Ve(KQ,()=>new jQ.FastifyInstrumentation({requestHook(t){SVe(t)}})),fVe=(()=>({name:KQ,setupOnce(){WQ()}})),zQ=fVe;function SVe(t){let e=xe(t).data||{},r=e["fastify.type"];if(e[Be]||!r)return;t.setAttributes({[it]:"auto.http.otel.fastify",[Be]:`${r}.fastify`});let n=e["fastify.name"]||e["plugin.name"]||e["hook.name"];typeof n=="string"&&t.updateName(n.replace(/^fastify -> /,""))}var pee=ne(See(),1);var dee="Graphql",hee=Ve(dee,(t={})=>{let e=mee(t);return new pee.GraphQLInstrumentation({...e,responseHook(r){vt(r,"auto.graphql.otel.graphql");let n=xe(r).data||{},i=n["graphql.operation.type"],o=n["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let s=Nt(r),c=(xe(s).data||{})[Xu]||[],u=o?`${i} ${o}`:`${i}`;Array.isArray(c)?(c.push(u),s.setAttribute(Xu,c)):c?s.setAttribute(Xu,[c,u]):s.setAttribute(Xu,u)}}})}),bVe=((t={})=>({name:dee,setupOnce(){hee(mee(t))}})),Aee=bVe;function mee(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}var Lee=ne(Dee(),1);var vee="Kafka",yee=Ve(vee,()=>new Lee.KafkaJsInstrumentation({consumerHook(t){vt(t,"auto.kafkajs.otel.consumer")},producerHook(t){vt(t,"auto.kafkajs.otel.producer")}})),xVe=(()=>({name:vee,setupOnce(){yee()}})),bee=xVe;var Bee=ne($ee(),1);var Fee="LruMemoizer",kee=Ve(Fee,()=>new Bee.LruMemoizerInstrumentation),GVe=(()=>({name:Fee,setupOnce(){kee()}})),Yee=GVe;var Xee=ne(Zee(),1);var Jee="Mongo",Qee=Ve(Jee,()=>new Xee.MongoDBInstrumentation({dbStatementSerializer:kVe,responseHook(t){vt(t,"auto.db.otel.mongo")}}));function kVe(t){let e=dP(t);return JSON.stringify(e)}function dP(t){if(Array.isArray(t))return t.map(e=>dP(e));if(YVe(t)){let e={};return Object.entries(t).map(([r,n])=>[r,dP(n)]).reduce((r,n)=>(jVe(n)&&(r[n[0]]=n[1]),r),e)}return"?"}function YVe(t){return typeof t=="object"&&t!==null&&!HVe(t)}function HVe(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function jVe(t){return Array.isArray(t)}var KVe=(()=>({name:Jee,setupOnce(){Qee()}})),ete=KVe;var fte=ne(Tte(),1);var Ste="Mongoose",pte=Ve(Ste,()=>new fte.MongooseInstrumentation({responseHook(t){vt(t,"auto.db.otel.mongoose")}})),rGe=(()=>({name:Ste,setupOnce(){pte()}})),dte=rGe;var Pte=ne(Mte(),1);var Dte="Mysql",Lte=Ve(Dte,()=>new Pte.MySQLInstrumentation({})),EGe=(()=>({name:Dte,setupOnce(){Lte()}})),vte=EGe;var Yte=ne(kte(),1);var Hte="Mysql2",jte=Ve(Hte,()=>new Yte.MySQL2Instrumentation({responseHook(t){vt(t,"auto.db.otel.mysql2")}})),NGe=(()=>({name:Hte,setupOnce(){jte()}})),Kte=NGe;var hre=ne(rre(),1),Are=ne(Tre(),1);var wGe=["get","set","setex"],PP=["get","mget"],VGe=["set","setex"];function GT(t,e){return t.includes(e.toLowerCase())}function DP(t){return GT(PP,t)?"cache.get":GT(VGe,t)?"cache.put":void 0}function GGe(t,e){return e.some(r=>t.startsWith(r))}function Sre(t,e){try{if(e.length===0)return;let r=i=>typeof i=="string"||typeof i=="number"||Buffer.isBuffer(i)?[i.toString()]:Array.isArray(i)?fre(i.map(o=>r(o))):["<unknown>"],n=e[0];return GT(wGe,t)&&n!=null?r(n):fre(e.map(i=>r(i)))}catch{return}}function pre(t,e,r){if(!DP(t))return!1;for(let n of e)if(GGe(n,r))return!0;return!1}function dre(t){let e=r=>{try{return Buffer.isBuffer(r)?r.byteLength:typeof r=="string"?r.length:typeof r=="number"?r.toString().length:r==null?0:JSON.stringify(r).length}catch{return}};return Array.isArray(t)?t.reduce((r,n)=>{let i=e(n);return typeof i=="number"?r!==void 0?r+i:i:r},0):e(t)}function fre(t){let e=[],r=n=>{n.forEach(i=>{Array.isArray(i)?r(i):e.push(i)})};return r(t),e}var mre="Redis",LP={},gre=(t,e,r,n)=>{t.setAttribute(it,"auto.db.otel.redis");let i=Sre(e,r),o=DP(e);if(!i||!o||!ce([LP,"optionalAccess",_=>_.cachePrefixes])||!pre(e,i,LP.cachePrefixes))return;let s=ce([xe,"call",_=>_(t),"access",_=>_.data,"optionalAccess",_=>_["net.peer.name"]]),a=ce([xe,"call",_=>_(t),"access",_=>_.data,"optionalAccess",_=>_["net.peer.port"]]);a&&s&&t.setAttributes({"network.peer.address":s,"network.peer.port":a});let c=dre(n);c&&t.setAttribute(KO,c),GT(PP,e)&&c!==void 0&&t.setAttribute(HO,c>0),t.setAttributes({[Be]:o,[jO]:i});let u=i.join(", ");t.updateName(_r(u,1024))},$Ge=Ve("IORedis",()=>new hre.IORedisInstrumentation({responseHook:gre})),BGe=Ve("Redis-4",()=>new Are.RedisInstrumentation({responseHook:gre})),Rre=Object.assign(()=>{$Ge(),BGe()},{id:mre}),FGe=((t={})=>({name:mre,setupOnce(){LP=t,Rre()}})),Ore=FGe;var Ure=ne(Lre(),1);ut();et();var ZGe="sentryPatched";function Nl(t){return t.sentryPatched?!0:(xt(t,ZGe,!0),!1)}function Hs(t,e=void 0){return{name:sr(e,()=>t.name),attributes:{[Be]:"middleware.nestjs",[it]:"auto.middleware.nestjs"}}}function vre(t){return{name:`event ${t}`,attributes:{[Be]:"event.nestjs",[it]:"auto.event.nestjs"},forceTransaction:!0}}function xP(t,e){e&&(t.subscribe=new Proxy(t.subscribe,{apply:(r,n,i)=>po(e,()=>{let o=r.apply(n,i);return o.add(()=>e.end()),o})}))}function yre(t,e,r){return new Proxy(t,{apply:(n,i,o)=>(e.end(),r?po(r,()=>Reflect.apply(n,i,o)):Reflect.apply(n,i,o))})}var bre=[">=2.0.0"],Cl=class t extends wn{static __initStatic(){this.COMPONENT="@nestjs/event-emitter"}static __initStatic2(){this.COMMON_ATTRIBUTES={component:t.COMPONENT}}constructor(e={}){super("sentry-nestjs-event",pt,e)}init(){let e=new li(t.COMPONENT,bre);return e.files.push(this._getOnEventFileInstrumentation(bre)),e}_getOnEventFileInstrumentation(e){return new oc("@nestjs/event-emitter/dist/decorators/on-event.decorator.js",e,r=>(qa(r.OnEvent)&&this._unwrap(r,"OnEvent"),this._wrap(r,"OnEvent",this._createWrapOnEvent()),r),r=>{this._unwrap(r,"OnEvent")})}_createWrapOnEvent(){return function(r){return function(i,o){let s=Array.isArray(i)?i.join(","):typeof i=="string"||typeof i=="symbol"?i.toString():"<unknown_event>",a=r(i,o);return function(c,u,_){if(!_.value||typeof _.value!="function"||c.__SENTRY_INTERNAL__)return a(c,u,_);let E=_.value,T=E.name||u;return _.value=async function(...f){return ls(vre(s),async()=>{try{return await E.apply(this,f)}catch(S){throw Xr(S),S}})},Object.defineProperty(_.value,"name",{value:T,configurable:!0}),a(c,u,_)}}}}};Cl.__initStatic();Cl.__initStatic2();ut();et();var wP=[">=8.0.0 <11"],Il=class t extends wn{static __initStatic(){this.COMPONENT="@nestjs/common"}static __initStatic2(){this.COMMON_ATTRIBUTES={component:t.COMPONENT}}constructor(e={}){super("sentry-nestjs",pt,e)}init(){let e=new li(t.COMPONENT,wP);return e.files.push(this._getInjectableFileInstrumentation(wP),this._getCatchFileInstrumentation(wP)),e}_getInjectableFileInstrumentation(e){return new oc("@nestjs/common/decorators/core/injectable.decorator.js",e,r=>(qa(r.Injectable)&&this._unwrap(r,"Injectable"),this._wrap(r,"Injectable",this._createWrapInjectable()),r),r=>{this._unwrap(r,"Injectable")})}_getCatchFileInstrumentation(e){return new oc("@nestjs/common/decorators/core/catch.decorator.js",e,r=>(qa(r.Catch)&&this._unwrap(r,"Catch"),this._wrap(r,"Catch",this._createWrapCatch()),r),r=>{this._unwrap(r,"Catch")})}_createWrapInjectable(){return function(r){return function(i){return function(o){if(typeof o.prototype.use=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.use=new Proxy(o.prototype.use,{apply:(s,a,c)=>{let[u,_,E,...T]=c;if(!u||!_||!E||typeof E!="function")return s.apply(a,c);let f=fo();return eE(Hs(o),S=>{let d=yre(E,S,f);return s.apply(a,[u,_,d,T])})}})}if(typeof o.prototype.canActivate=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.canActivate=new Proxy(o.prototype.canActivate,{apply:(s,a,c)=>c[0]?ls(Hs(o),()=>s.apply(a,c)):s.apply(a,c)})}if(typeof o.prototype.transform=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.transform=new Proxy(o.prototype.transform,{apply:(s,a,c)=>{let u=c[0],_=c[1];return!u||!_?s.apply(a,c):ls(Hs(o),()=>s.apply(a,c))}})}if(typeof o.prototype.intercept=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.intercept=new Proxy(o.prototype.intercept,{apply:(s,a,c)=>{let u=c[0],_=c[1],E=fo(),T;return!u||!_||typeof _.handle!="function"?s.apply(a,c):eE(Hs(o),f=>{_.handle=new Proxy(_.handle,{apply:(d,p,g)=>{if(f.end(),E)return po(E,()=>{let N=Reflect.apply(d,p,g);return u._sentryInterceptorInstrumented||(xt(u,"_sentryInterceptorInstrumented",!0),T=tE(Hs(o,"Interceptors - After Route"))),N});{let N=Reflect.apply(d,p,g);return u._sentryInterceptorInstrumented||(xt(u,"_sentryInterceptorInstrumented",!0),T=tE(Hs(o,"Interceptors - After Route"))),N}}});let S;try{S=s.apply(a,c)}catch(d){throw ce([f,"optionalAccess",p=>p.end,"call",p=>p()]),ce([T,"optionalAccess",p=>p.end,"call",p=>p()]),d}return T?En(S)?S.then(d=>(xP(d,sr(T,()=>E)),d),d=>{throw ce([f,"optionalAccess",p=>p.end,"call",p=>p()]),ce([T,"optionalAccess",p=>p.end,"call",p=>p()]),d}):(typeof S.subscribe=="function"&&xP(S,sr(T,()=>E)),S):S})}})}return r(i)(o)}}}}_createWrapCatch(){return function(r){return function(...i){return function(o){if(typeof o.prototype.catch=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(...i)(o);o.prototype.catch=new Proxy(o.prototype.catch,{apply:(s,a,c)=>{let u=c[0],_=c[1];return!u||!_?s.apply(a,c):ls(Hs(o),()=>s.apply(a,c))}})}return r(...i)(o)}}}}};Il.__initStatic();Il.__initStatic2();var xre="Nest",XGe=Ve("Nest-Core",()=>new Ure.NestInstrumentation),JGe=Ve("Nest-Common",()=>new Il),QGe=Ve("Nest-Event",()=>new Cl),wre=Object.assign(()=>{XGe(),JGe(),QGe()},{id:xre}),Vre=()=>({name:xre,setupOnce(){wre()}});var gle=ne(mle(),1);var Rle="Postgres",Ole=Ve(Rle,()=>new gle.PgInstrumentation({requireParentSpan:!0,requestHook(t){vt(t,"auto.db.otel.postgres")}})),U$e=(()=>({name:Rle,setupOnce(){Ole()}})),Nle=U$e;var yle=ne(vle(),1);var ble="Hapi",Ule=Ve(ble,()=>new yle.HapiInstrumentation),j$e=(()=>({name:ble,setupOnce(){Ule()}})),xle=j$e;var Wle=ne(Kle(),1),zle=ne(dt(),1);var qle="Koa",Zle=Ve(qle,()=>new Wle.KoaInstrumentation({requestHook(t,e){if(Q$e(t),ze()===Di()){st&&H.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let r=xe(t).data,n=r&&r[zle.ATTR_HTTP_ROUTE],i=ce([e,"optionalAccess",o=>o.context,"optionalAccess",o=>o.request,"optionalAccess",o=>o.method,"optionalAccess",o=>o.toUpperCase,"call",o=>o()])||"GET";n&&ze().setTransactionName(`${i} ${n}`)}})),J$e=(()=>({name:qle,setupOnce(){Zle()}})),Xle=J$e;function Q$e(t){t.setAttribute(it,"auto.http.otel.koa");let e=xe(t).data||{},r=e["koa.type"];r&&t.setAttribute(Be,`${r}.koa`);let n=e["koa.name"];typeof n=="string"&&t.updateName(n||"< unknown >")}var s_e=ne(o_e(),1);var a_e="Connect",c_e=Ve(a_e,()=>new s_e.ConnectInstrumentation),lBe=(()=>({name:a_e,setupOnce(){c_e()}})),u_e=lBe;import*as _Be from"node:http";var rD="Spotlight",EBe=((t={})=>{let e={sidecarUrl:t.sidecarUrl||"http://localhost:8969/stream"};return{name:rD,setup(r){typeof process=="object"&&process.env&&process.env.NODE_ENV!=="development"&&H.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?"),TBe(r,e)}}}),l_e=EBe;function TBe(t,e){let r=fBe(e.sidecarUrl);if(!r)return;let n=0;t.on("beforeEnvelope",i=>{if(n>3){H.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let o=Q_(i),a=SBe()({method:"POST",path:r.pathname,hostname:r.hostname,port:r.port,headers:{"Content-Type":"application/x-sentry-envelope"}},c=>{c.statusCode&&c.statusCode>=200&&c.statusCode<400&&(n=0),c.on("data",()=>{}),c.on("end",()=>{}),c.setEncoding("utf8")});a.on("error",()=>{n++,H.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),a.write(o),a.end()})}function fBe(t){try{return new URL(`${t}`)}catch{H.warn(`[Spotlight] Invalid sidecar URL: ${t}`);return}}function SBe(){let{request:t}=_Be;return pBe(t)?t.__sentry_original__:t}function pBe(t){return"__sentry_original__"in t}var R_e=ne(g_e(),1);var gBe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),O_e="Tedious",N_e=Ve(O_e,()=>new R_e.TediousInstrumentation({})),RBe=(()=>({name:O_e,setupOnce(){N_e()},setup(t){t.on("spanStart",e=>{let{description:r,data:n}=xe(e);if(!r||ce([n,"optionalAccess",o=>o["db.system"]])!=="mssql")return;let i=ce([r,"optionalAccess",o=>o.split,"call",o=>o(" "),"access",o=>o[0]])||"";gBe.has(i)&&e.setAttribute(it,"auto.db.otel.tedious")})}})),C_e=RBe;var L_e=ne(D_e(),1);var v_e="GenericPool",y_e=Ve(v_e,()=>new L_e.GenericPoolInstrumentation({})),CBe=(()=>({name:v_e,setupOnce(){y_e()},setup(t){t.on("spanStart",e=>{let n=xe(e).description;(n==="generic-pool.aquire"||n==="generic-pool.acquire")&&e.setAttribute(it,"auto.db.otel.generic_pool")})}})),b_e=CBe;var Y_e=ne(k_e(),1);var H_e="Amqplib",xBe={consumeEndHook:t=>{vt(t,"auto.amqplib.otel.consumer")},publishHook:t=>{vt(t,"auto.amqplib.otel.publisher")}},j_e=Ve(H_e,()=>new Y_e.AmqplibInstrumentation(xBe)),wBe=(()=>({name:H_e,setupOnce(){j_e()}})),K_e=wBe;import*as uD from"node:diagnostics_channel";var VBe="ProcessAndThreadBreadcrumbs",W_e=(t={})=>({name:VBe,setup(e){uD.channel("child_process").subscribe(r=>{r&&typeof r=="object"&&"process"in r&&GBe(r.process,t)}),uD.channel("worker_threads").subscribe(r=>{r&&typeof r=="object"&&"worker"in r&&$Be(r.worker)})}});function GBe(t,e){let r=!1,n;t.on("spawn",()=>{if(t.spawnfile==="/usr/bin/sw_vers"){r=!0;return}n={spawnfile:t.spawnfile},e.includeChildProcessArgs&&(n.spawnargs=t.spawnargs)}).on("exit",i=>{r||(r=!0,i!==null&&i!==0&&Nn({category:"child_process",message:`Child process exited with code '${i}'`,level:"warning",data:n}))}).on("error",i=>{r||(r=!0,Nn({category:"child_process",message:`Child process errored with '${i.message}'`,level:"error",data:n}))})}function $Be(t){let e;t.on("online",()=>{e=t.threadId}).on("error",r=>{Nn({category:"worker_thread",message:`Worker thread errored with '${r.message}'`,level:"error",data:{threadId:e}})})}et();var BBe=["generateText","streamText","generateObject","streamObject","embed","embedMany"],lD=!1,rm=class extends wn{constructor(e={}){super("@sentry/instrumentation-vercel-ai",pt,e)}init(){return new li("ai",[">=3.0.0 <5"],this._patch.bind(this))}_patch(e){lD=!0;function r(i){return(...o)=>{let s=o[0].experimental_telemetry||{};return s.isEnabled===void 0&&(o[0].experimental_telemetry={isEnabled:!0,recordInputs:!1,recordOutputs:!1,...s}),e[i].apply(this,o)}}let n=BBe.reduce((i,o)=>(i[o]=r(o),i),{});return{...e,...n}}};var z_e=Ve("vercelAI",()=>new rm({})),FBe=(()=>({name:"vercelAI",setupOnce(){z_e()},processEvent(t){if(t.type==="transaction"&&ce([t,"access",e=>e.spans,"optionalAccess",e=>e.length]))for(let e of t.spans){let{data:r,description:n}=e;!r||!n||e.origin!=="auto.vercelai.otel"||(e.data=e.data||{},r["ai.usage.completionTokens"]!=null&&(e.data["ai.completion_tokens.used"]=r["ai.usage.completionTokens"]),r["ai.usage.promptTokens"]!=null&&(e.data["ai.prompt_tokens.used"]=r["ai.usage.promptTokens"]),r["ai.usage.completionTokens"]!=null&&r["ai.usage.promptTokens"]!=null&&(e.data["ai.total_tokens.used"]=r["ai.usage.completionTokens"]+r["ai.usage.promptTokens"]))}return t},setup(t){t.on("spanStart",e=>{if(!lD)return;let{data:r,description:n}=xe(e);if(!r||!n)return;let i=r["ai.model.id"],o=r["ai.model.provider"];if(!i||!o)return;let s=!1;switch(n){case"ai.generateText":{e.setAttribute(Be,"ai.pipeline.generateText"),s=!0;break}case"ai.generateText.doGenerate":{e.setAttribute(Be,"ai.run.doGenerate");break}case"ai.streamText":{e.setAttribute(Be,"ai.pipeline.streamText"),s=!0;break}case"ai.streamText.doStream":{e.setAttribute(Be,"ai.run.doStream");break}case"ai.generateObject":{e.setAttribute(Be,"ai.pipeline.generateObject"),s=!0;break}case"ai.generateObject.doGenerate":{e.setAttribute(Be,"ai.run.doGenerate");break}case"ai.streamObject":{e.setAttribute(Be,"ai.pipeline.streamObject"),s=!0;break}case"ai.streamObject.doStream":{e.setAttribute(Be,"ai.run.doStream");break}case"ai.embed":{e.setAttribute(Be,"ai.pipeline.embed"),s=!0;break}case"ai.embed.doEmbed":{e.setAttribute(Be,"ai.embeddings");break}case"ai.embedMany":{e.setAttribute(Be,"ai.pipeline.embedMany"),s=!0;break}case"ai.embedMany.doEmbed":{e.setAttribute(Be,"ai.embeddings");break}case"ai.toolCall":case"ai.stream.firstChunk":case"ai.stream.finish":e.setAttribute(Be,"ai.run");break}vt(e,"auto.vercelai.otel");let a=n.replace("ai.","");e.setAttribute("ai.pipeline.name",a),e.updateName(a),r["ai.telemetry.functionId"]&&s&&(e.updateName(r["ai.telemetry.functionId"]),e.setAttribute("ai.pipeline.name",r["ai.telemetry.functionId"])),r["ai.prompt"]&&e.setAttribute("ai.input_messages",r["ai.prompt"]),r["ai.model.id"]&&e.setAttribute("ai.model_id",r["ai.model.id"]),e.setAttribute("ai.streaming",n.includes("stream"))})}})),q_e=FBe;var Q_e=ne(J_e(),1);var eEe=I7(Q_e.AsyncLocalStorageContextManager);function tEe(){return[xQ(),zQ(),Aee(),ete(),dte(),vte(),Kte(),Ore(),Nle(),Vre(),xle(),Xle(),u_e(),C_e(),b_e(),bee(),K_e(),Yee(),q_e()]}import*as QBe from"node:http";import*as eFe from"node:https";import{Readable as tFe}from"node:stream";import{createGzip as rFe}from"node:zlib";import*as wo from"node:net";import*as pD from"node:tls";import*as SD from"node:http";import"node:https";var Qi=Symbol("AgentBaseInternalState"),sm=class extends SD.Agent{constructor(e){super(e),this[Qi]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
42
|
+
`).join(""),!0}return!1},startSpanHook:()=>({[it]:"auto.http.otel.node_fetch"}),responseHook:(o,{request:s,response:a})=>{e&&Fwe(s,a)}});Os({instrumentations:[i]})}}}),Z7=Bwe;function Fwe(t,e){let r=kwe(t),n=e.statusCode,i=aE(n);Nn({category:"http",data:{status_code:n,...r},type:"http",level:i},{event:"response",request:t,response:e})}function kwe(t){try{let e=new URL(t.path,t.origin),r=Es(e.toString()),n={url:Ts(r),"http.method":t.method||"GET"};return r.search&&(n["http.query"]=r.search),r.hash&&(n["http.fragment"]=r.hash),n}catch{return{}}}function Ywe(t,e="/"){let r=`${t}`;return r.endsWith("/")&&e.startsWith("/")?`${r}${e.slice(1)}`:!r.endsWith("/")&&!e.startsWith("/")?`${r}/${e.slice(1)}`:`${r}${e}`}import*as X7 from"node:util";var Hwe="Console",J7=()=>({name:Hwe,setup(t){NN(({args:e,level:r})=>{Pe()===t&&Nn({category:"console",level:CN(r),message:_r(X7.format.apply(void 0,e),2048)},{input:[...e],level:r})})}});import{execFile as jwe}from"node:child_process";import{readFile as Kwe,readdir as Wwe}from"node:fs";import*as Wt from"node:os";import{join as zwe}from"node:path";import{promisify as eQ}from"node:util";var qwe=eQ(Kwe),Zwe=eQ(Wwe),Xwe="Context",Jwe=((t={})=>{let e,r={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...t};async function n(o){e===void 0&&(e=i());let s=Qwe(await e);return o.contexts={...o.contexts,app:{...s.app,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.app])},os:{...s.os,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.os])},device:{...s.device,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.device])},culture:{...s.culture,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.culture])},cloud_resource:{...s.cloud_resource,...ce([o,"access",a=>a.contexts,"optionalAccess",a=>a.cloud_resource])}},o}async function i(){let o={};if(r.os&&(o.os=await e1e()),r.app&&(o.app=r1e()),r.device&&(o.device=n1e(r.device)),r.culture){let s=t1e();s&&(o.culture=s)}return r.cloudResource&&(o.cloud_resource=u1e()),o}return{name:Xwe,processEvent(o){return n(o)}}}),tQ=Jwe;function Qwe(t){if(ce([t,"optionalAccess",e=>e.app,"optionalAccess",e=>e.app_memory])&&(t.app.app_memory=process.memoryUsage().rss),ce([t,"optionalAccess",e=>e.app,"optionalAccess",e=>e.free_memory])&&typeof process.availableMemory=="function"){let e=ce([process,"access",r=>r.availableMemory,"optionalCall",r=>r()]);e!=null&&(t.app.free_memory=e)}return ce([t,"optionalAccess",e=>e.device,"optionalAccess",e=>e.free_memory])&&(t.device.free_memory=Wt.freemem()),t}async function e1e(){let t=Wt.platform();switch(t){case"darwin":return a1e();case"linux":return c1e();default:return{name:i1e[t]||t,version:Wt.release()}}}function t1e(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let r=Intl.DateTimeFormat().resolvedOptions();return{locale:r.locale,timezone:r.timeZone}}}catch{}}function r1e(){let t=process.memoryUsage().rss,r={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t};if(typeof process.availableMemory=="function"){let n=ce([process,"access",i=>i.availableMemory,"optionalCall",i=>i()]);n!=null&&(r.free_memory=n)}return r}function n1e(t){let e={},r;try{r=Wt.uptime&&Wt.uptime()}catch{}if(typeof r=="number"&&(e.boot_time=new Date(Date.now()-r*1e3).toISOString()),e.arch=Wt.arch(),(t===!0||t.memory)&&(e.memory_size=Wt.totalmem(),e.free_memory=Wt.freemem()),t===!0||t.cpu){let n=Wt.cpus(),i=n&&n[0];i&&(e.processor_count=n.length,e.cpu_description=i.model,e.processor_frequency=i.speed)}return e}var i1e={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},o1e=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],s1e={alpine:t=>t,arch:t=>Hi(/distrib_release=(.*)/,t),centos:t=>Hi(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>Hi(/release (..)/,t),mint:t=>Hi(/distrib_release=(.*)/,t),red:t=>Hi(/release ([^ ]+)/,t),suse:t=>Hi(/VERSION = (.*)\n/,t),ubuntu:t=>Hi(/distrib_release=(.*)/,t)};function Hi(t,e){let r=t.exec(e);return r?r[1]:void 0}async function a1e(){let t={kernel_version:Wt.release(),name:"Mac OS X",version:`10.${Number(Wt.release().split(".")[0])-4}`};try{let e=await new Promise((r,n)=>{jwe("/usr/bin/sw_vers",(i,o)=>{if(i){n(i);return}r(o)})});t.name=Hi(/^ProductName:\s+(.*)$/m,e),t.version=Hi(/^ProductVersion:\s+(.*)$/m,e),t.build=Hi(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function Q7(t){return t.split(" ")[0].toLowerCase()}async function c1e(){let t={kernel_version:Wt.release(),name:"Linux"};try{let e=await Zwe("/etc"),r=o1e.find(a=>e.includes(a.name));if(!r)return t;let n=zwe("/etc",r.name),i=(await qwe(n,{encoding:"utf-8"})).toLowerCase(),{distros:o}=r;t.name=o.find(a=>i.indexOf(Q7(a))>=0)||o[0];let s=Q7(t.name);t.version=ce([s1e,"access",a=>a[s],"optionalCall",a=>a(i)])}catch{}return t}function u1e(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as l1e}from"node:fs";import{createInterface as _1e}from"node:readline";var XM=new Cn(10),iQ=new Cn(20),E1e=7,T1e="ContextLines",f1e=1e3,S1e=1e4;function p1e(t,e,r){let n=t.get(e);return n===void 0?(t.set(e,r),r):n}function d1e(t){return!!(t.startsWith("node:")||t.endsWith(".min.js")||t.endsWith(".min.cjs")||t.endsWith(".min.mjs")||t.startsWith("data:"))}function h1e(t){return t.lineno!==void 0&&t.lineno>S1e||t.colno!==void 0&&t.colno>f1e}function A1e(t,e){let r=XM.get(t);if(r===void 0)return!1;for(let n=e[0];n<=e[1];n++)if(r[n]===void 0)return!1;return!0}function m1e(t,e){if(!t.length)return[];let r=0,n=t[0];if(typeof n!="number")return[];let i=nQ(n,e),o=[];for(;;){if(r===t.length-1){o.push(i);break}let s=t[r+1];if(typeof s!="number")break;s<=i[1]?i[1]=s+e:(o.push(i),i=nQ(s,e)),r++}return o}function g1e(t,e,r){return new Promise((n,i)=>{let o=l1e(t),s=_1e({input:o});function a(){o.destroy(),n()}let c=0,u=0,_=e[u];if(_===void 0){a();return}let E=_[0],T=_[1];function f(S){iQ.set(t,1),st&&H.error(`Failed to read file: ${t}. Error: ${S}`),s.close(),s.removeAllListeners(),a()}o.on("error",f),s.on("error",f),s.on("close",a),s.on("line",S=>{if(c++,!(c<E)&&(r[c]=PO(S,0),c>=T)){if(u===e.length-1){s.close(),s.removeAllListeners();return}u++;let d=e[u];if(d===void 0){s.close(),s.removeAllListeners();return}E=d[0],T=d[1]}})})}async function R1e(t,e){let r={};if(e>0&&ce([t,"access",o=>o.exception,"optionalAccess",o=>o.values])){for(let o of t.exception.values)if(ce([o,"access",s=>s.stacktrace,"optionalAccess",s=>s.frames,"optionalAccess",s=>s.length]))for(let s=o.stacktrace.frames.length-1;s>=0;s--){let a=o.stacktrace.frames[s],c=ce([a,"optionalAccess",_=>_.filename]);if(!a||typeof c!="string"||typeof a.lineno!="number"||d1e(c)||h1e(a))continue;r[c]||(r[c]=[]),r[c].push(a.lineno)}}let n=Object.keys(r);if(n.length==0)return t;let i=[];for(let o of n){if(iQ.get(o))continue;let s=r[o];if(!s)continue;s.sort((u,_)=>u-_);let a=m1e(s,e);if(a.every(u=>A1e(o,u)))continue;let c=p1e(XM,o,{});i.push(g1e(o,a,c))}if(await Promise.all(i).catch(()=>{st&&H.log("Failed to read one or more source files and resolve context lines")}),e>0&&ce([t,"access",o=>o.exception,"optionalAccess",o=>o.values]))for(let o of t.exception.values)o.stacktrace&&o.stacktrace.frames&&o.stacktrace.frames.length>0&&O1e(o.stacktrace.frames,e,XM);return t}function O1e(t,e,r){for(let n of t)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let i=r.get(n.filename);if(i===void 0)continue;N1e(n.lineno,n,e,i)}}function rQ(t){delete t.pre_context,delete t.context_line,delete t.post_context}function N1e(t,e,r,n){if(e.lineno===void 0||n===void 0){st&&H.error("Cannot resolve context for frame with no lineno or file contents");return}e.pre_context=[];for(let o=oQ(t,r);o<t;o++){let s=n[o];if(s===void 0){rQ(e),st&&H.error(`Could not find line ${o} in file ${e.filename}`);return}e.pre_context.push(s)}if(n[t]===void 0){rQ(e),st&&H.error(`Could not find line ${t} in file ${e.filename}`);return}e.context_line=n[t];let i=sQ(t,r);e.post_context=[];for(let o=t+1;o<=i;o++){let s=n[o];if(s===void 0)break;e.post_context.push(s)}}function oQ(t,e){return Math.max(1,t-e)}function sQ(t,e){return t+e}function nQ(t,e){return[oQ(t,e),sQ(t,e)]}var C1e=((t={})=>{let e=t.frameContextLines!==void 0?t.frameContextLines:E1e;return{name:T1e,processEvent(r){return R1e(r,e)}}}),aQ=C1e;var JM=xO(process.versions.node),cQ=JM.major;import{Worker as I1e}from"node:worker_threads";var eA;async function tA(){if(eA===void 0)try{eA=!!(await import("node:inspector")).url()}catch{eA=!1}return eA}var gT="__SENTRY_ERROR_LOCAL_VARIABLES__";function lQ(t,e,r){let n=0,i=5,o=0;return setInterval(()=>{o===0?n>t&&(i*=2,r(i),i>86400&&(i=86400),o=i):(o-=1,o===0&&e()),n=0},1e3).unref(),()=>{n+=1}}function uQ(t){return t!==void 0&&(t.length===0||t==="?"||t==="<anonymous>")}function rA(t,e){return t===e||uQ(t)&&uQ(e)}var M1e="LyohIEBzZW50cnkvbm9kZSA4LjU1LjAgKDEzNGZjZjMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPSI4LjU1LjAiLG89Z2xvYmFsVGhpcztjb25zdCBpPSJ1bmRlZmluZWQiPT10eXBlb2YgX19TRU5UUllfREVCVUdfX3x8X19TRU5UUllfREVCVUdfXyxhPVsiZGVidWciLCJpbmZvIiwid2FybiIsImVycm9yIiwibG9nIiwiYXNzZXJ0IiwidHJhY2UiXSxzPXt9O2Z1bmN0aW9uIGMoZSl7aWYoISgiY29uc29sZSJpbiBvKSlyZXR1cm4gZSgpO2NvbnN0IHQ9by5jb25zb2xlLG49e30saT1PYmplY3Qua2V5cyhzKTtpLmZvckVhY2goKGU9Pntjb25zdCBvPXNbZV07bltlXT10W2VdLHRbZV09b30pKTt0cnl7cmV0dXJuIGUoKX1maW5hbGx5e2kuZm9yRWFjaCgoZT0+e3RbZV09bltlXX0pKX19IWZ1bmN0aW9uKGUsdCxpKXtjb25zdCBhPW8scz1hLl9fU0VOVFJZX189YS5fX1NFTlRSWV9ffHx7fSxjPXNbbl09c1tuXXx8e307Y1tlXXx8KGNbZV09dCgpKX0oImxvZ2dlciIsKGZ1bmN0aW9uKCl7bGV0IGU9ITE7Y29uc3QgdD17ZW5hYmxlOigpPT57ZT0hMH0sZGlzYWJsZTooKT0+e2U9ITF9LGlzRW5hYmxlZDooKT0+ZX07cmV0dXJuIGk/YS5mb3JFYWNoKChuPT57dFtuXT0oLi4udCk9PntlJiZjKCgoKT0+e28uY29uc29sZVtuXShgU2VudHJ5IExvZ2dlciBbJHtufV06YCwuLi50KX0pKX19KSk6YS5mb3JFYWNoKChlPT57dFtlXT0oKT0+e319KSksdH0pKTtjb25zdCByPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgdT10O2Z1bmN0aW9uIGwoLi4uZSl7dS5kZWJ1ZyYmYygoKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpKX1hc3luYyBmdW5jdGlvbiBmKGUsdCxuLG8pe2NvbnN0IGk9YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtvW25dPWkucmVzdWx0LmZpbHRlcigoZT0+Imxlbmd0aCIhPT1lLm5hbWUmJiFpc05hTihwYXJzZUludChlLm5hbWUsMTApKSkpLnNvcnQoKChlLHQpPT5wYXJzZUludChlLm5hbWUsMTApLXBhcnNlSW50KHQubmFtZSwxMCkpKS5tYXAoKGU9PmUudmFsdWU/LnZhbHVlKSl9YXN5bmMgZnVuY3Rpb24gZyhlLHQsbixvKXtjb25zdCBpPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSk7b1tuXT1pLnJlc3VsdC5tYXAoKGU9PltlLm5hbWUsZS52YWx1ZT8udmFsdWVdKSkucmVkdWNlKCgoZSxbdCxuXSk9PihlW3RdPW4sZSkpLHt9KX1mdW5jdGlvbiBkKGUsdCl7ZS52YWx1ZSYmKCJ2YWx1ZSJpbiBlLnZhbHVlP3ZvaWQgMD09PWUudmFsdWUudmFsdWV8fG51bGw9PT1lLnZhbHVlLnZhbHVlP3RbZS5uYW1lXT1gPCR7ZS52YWx1ZS52YWx1ZX0+YDp0W2UubmFtZV09ZS52YWx1ZS52YWx1ZToiZGVzY3JpcHRpb24iaW4gZS52YWx1ZSYmImZ1bmN0aW9uIiE9PWUudmFsdWUudHlwZT90W2UubmFtZV09YDwke2UudmFsdWUuZGVzY3JpcHRpb259PmA6InVuZGVmaW5lZCI9PT1lLnZhbHVlLnR5cGUmJih0W2UubmFtZV09Ijx1bmRlZmluZWQ+IikpfWFzeW5jIGZ1bmN0aW9uIGIoZSx0KXtjb25zdCBuPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSksbz17fTtmb3IoY29uc3QgdCBvZiBuLnJlc3VsdClpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10Py52YWx1ZS5jbGFzc05hbWUpe2NvbnN0IG49dC52YWx1ZS5vYmplY3RJZDthd2FpdCBmKGUsbix0Lm5hbWUsbyl9ZWxzZSBpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJPYmplY3QiPT09dD8udmFsdWU/LmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGcoZSxuLHQubmFtZSxvKX1lbHNlIHQ/LnZhbHVlJiZkKHQsbyk7cmV0dXJuIG99bGV0IHA7KGFzeW5jIGZ1bmN0aW9uKCl7Y29uc3QgdD1uZXcgZTt0LmNvbm5lY3RUb01haW5UaHJlYWQoKSxsKCJDb25uZWN0ZWQgdG8gbWFpbiB0aHJlYWQiKTtsZXQgbj0hMTt0Lm9uKCJEZWJ1Z2dlci5yZXN1bWVkIiwoKCk9PntuPSExfSkpLHQub24oIkRlYnVnZ2VyLnBhdXNlZCIsKGU9PntuPSEwLGFzeW5jIGZ1bmN0aW9uKGUse3JlYXNvbjp0LGRhdGE6e29iamVjdElkOm59LGNhbGxGcmFtZXM6b30pe2lmKCJleGNlcHRpb24iIT09dCYmInByb21pc2VSZWplY3Rpb24iIT09dClyZXR1cm47aWYocD8uKCksbnVsbD09bilyZXR1cm47Y29uc3QgaT1bXTtmb3IobGV0IHQ9MDt0PG8ubGVuZ3RoO3QrKyl7Y29uc3R7c2NvcGVDaGFpbjpuLGZ1bmN0aW9uTmFtZTphLHRoaXM6c309b1t0XSxjPW4uZmluZCgoZT0+ImxvY2FsIj09PWUudHlwZSkpLHI9Imdsb2JhbCIhPT1zLmNsYXNzTmFtZSYmcy5jbGFzc05hbWU/YCR7cy5jbGFzc05hbWV9LiR7YX1gOmE7aWYodm9pZCAwPT09Yz8ub2JqZWN0Lm9iamVjdElkKWlbdF09e2Z1bmN0aW9uOnJ9O2Vsc2V7Y29uc3Qgbj1hd2FpdCBiKGUsYy5vYmplY3Qub2JqZWN0SWQpO2lbdF09e2Z1bmN0aW9uOnIsdmFyczpufX19YXdhaXQgZS5wb3N0KCJSdW50aW1lLmNhbGxGdW5jdGlvbk9uIix7ZnVuY3Rpb25EZWNsYXJhdGlvbjpgZnVuY3Rpb24oKSB7IHRoaXMuJHtyfSA9IHRoaXMuJHtyfSB8fCAke0pTT04uc3RyaW5naWZ5KGkpfTsgfWAsc2lsZW50OiEwLG9iamVjdElkOm59KSxhd2FpdCBlLnBvc3QoIlJ1bnRpbWUucmVsZWFzZU9iamVjdCIse29iamVjdElkOm59KX0odCxlLnBhcmFtcykudGhlbigoYXN5bmMoKT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSwoYXN5bmMgZT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSl9KSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBvPSExIT09dS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6bz8iYWxsIjoidW5jYXVnaHQifSksbyl7Y29uc3QgZT11Lm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO3A9ZnVuY3Rpb24oZSx0LG4pe2xldCBvPTAsaT01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCgpPT57MD09PWE/bz5lJiYoaSo9MixuKGkpLGk+ODY0MDAmJihpPTg2NDAwKSxhPWkpOihhLT0xLDA9PT1hJiZ0KCkpLG89MH0pLDFlMykudW5yZWYoKSwoKT0+e28rPTF9fShlLChhc3luYygpPT57bCgiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9KSwoYXN5bmMgZT0+e2woYFJhdGUtbGltaXQgZXhjZWVkZWQuIERpc2FibGluZyBjYXB0dXJpbmcgb2YgY2F1Z2h0IGV4Y2VwdGlvbnMgZm9yICR7ZX0gc2Vjb25kcy5gKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6InVuY2F1Z2h0In0pfSkpfX0pKCkuY2F0Y2goKGU9PntsKCJGYWlsZWQgdG8gc3RhcnQgZGVidWdnZXIiLGUpfSkpLHNldEludGVydmFsKCgoKT0+e30pLDFlNCk7";function _Q(...t){H.log("[LocalVariables]",...t)}var EQ=((t={})=>{function e(o,s){let a=(ce([o,"access",c=>c.stacktrace,"optionalAccess",c=>c.frames])||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let u=a.length-c-1,_=s[c],E=a[u];if(!E||!_)break;_.vars===void 0||E.in_app===!1||!rA(E.function,_.function)||(E.vars=_.vars)}}function r(o,s){if(s.originalException&&typeof s.originalException=="object"&&gT in s.originalException&&Array.isArray(s.originalException[gT])){for(let a of ce([o,"access",c=>c.exception,"optionalAccess",c=>c.values])||[])e(a,s.originalException[gT]);s.originalException[gT]=void 0}return o}async function n(){let o=await import("node:inspector");o.url()||o.open(0)}function i(o){let s=new I1e(new URL(`data:application/javascript;base64,${M1e}`),{workerData:o,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{s.terminate()}),s.once("error",a=>{_Q("Worker error",a)}),s.once("exit",a=>{_Q("Worker exit",a)}),s.unref()}return{name:"LocalVariablesAsync",async setup(o){if(!o.getOptions().includeLocalVariables)return;if(await tA()){H.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...t,debug:H.isEnabled()};n().then(()=>{try{i(a)}catch(c){H.error("Failed to start worker",c)}},c=>{H.error("Failed to start inspector",c)})},processEvent(o,s){return r(o,s)}}});function TQ(t){if(t!==void 0)return t.slice(-10).reduce((e,r)=>`${e},${r.function},${r.lineno},${r.colno}`,"")}function P1e(t,e){if(e!==void 0)return TQ(t(e,1))}function fQ(t){let e=[],r=!1;function n(s){e=[],!r&&(r=!0,t(s))}e.push(n);function i(s){e.push(s)}function o(s){let a=e.pop()||n;try{a(s)}catch{n(s)}}return{add:i,next:o}}var QM=class t{constructor(e){this._session=e}static async create(e){if(e)return e;let r=await import("node:inspector");return new t(new r.Session)}configureAndConnect(e,r){this._session.connect(),this._session.on("Debugger.paused",n=>{e(n,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:r?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,r){this._getProperties(e,n=>{let{add:i,next:o}=fQ(r);for(let s of n)if(ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&ce([s,"optionalAccess",a=>a.value,"access",a=>a.className])==="Array"){let a=s.value.objectId;i(c=>this._unrollArray(a,s.name,c,o))}else if(ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.className])==="Object"){let a=s.value.objectId;i(c=>this._unrollObject(a,s.name,c,o))}else ce([s,"optionalAccess",a=>a.value])&&i(a=>this._unrollOther(s,a,o));o({})})}_getProperties(e,r){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(n,i)=>{r(n?[]:i.result)})}_unrollArray(e,r,n,i){this._getProperties(e,o=>{n[r]=o.filter(s=>s.name!=="length"&&!isNaN(parseInt(s.name,10))).sort((s,a)=>parseInt(s.name,10)-parseInt(a.name,10)).map(s=>ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])),i(n)})}_unrollObject(e,r,n,i){this._getProperties(e,o=>{n[r]=o.map(s=>[s.name,ce([s,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])]).reduce((s,[a,c])=>(s[a]=c,s),{}),i(n)})}_unrollOther(e,r,n){e.value&&("value"in e.value?e.value.value===void 0||e.value.value===null?r[e.name]=`<${e.value.value}>`:r[e.name]=e.value.value:"description"in e.value&&e.value.type!=="function"?r[e.name]=`<${e.value.description}>`:e.value.type==="undefined"&&(r[e.name]="<undefined>")),n(r)}},D1e="LocalVariables",L1e=((t={},e)=>{let r=new Cn(20),n,i=!1;function o(a){let c=TQ(ce([a,"optionalAccess",E=>E.stacktrace,"optionalAccess",E=>E.frames]));if(c===void 0)return;let u=r.remove(c);if(u===void 0)return;let _=(ce([a,"access",E=>E.stacktrace,"optionalAccess",E=>E.frames])||[]).filter(E=>E.function!=="new Promise");for(let E=0;E<_.length;E++){let T=_.length-E-1,f=u[E],S=_[T];if(!S||!f)break;f.vars===void 0||S.in_app===!1||!rA(S.function,f.function)||(S.vars=f.vars)}}function s(a){for(let c of ce([a,"optionalAccess",u=>u.exception,"optionalAccess",u=>u.values])||[])o(c);return a}return{name:D1e,async setupOnce(){let a=Pe(),c=ce([a,"optionalAccess",_=>_.getOptions,"call",_=>_()]);if(!ce([c,"optionalAccess",_=>_.includeLocalVariables]))return;if(cQ<18){H.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await tA()){H.warn("Local variables capture has been disabled because the debugger was already enabled");return}QM.create(e).then(_=>{function E(f,{params:{reason:S,data:d,callFrames:p}},g){if(S!=="exception"&&S!=="promiseRejection"){g();return}ce([n,"optionalCall",v=>v()]);let N=P1e(f,ce([d,"optionalAccess",v=>v.description]));if(N==null){g();return}let{add:O,next:C}=fQ(v=>{r.set(N,v),g()});for(let v=0;v<Math.min(p.length,5);v++){let{scopeChain:x,functionName:G,this:J}=p[v],j=x.find(V=>V.type==="local"),z=J.className==="global"||!J.className?G:`${J.className}.${G}`;if(ce([j,"optionalAccess",V=>V.object,"access",V=>V.objectId])===void 0)O(V=>{V[v]={function:z},C(V)});else{let V=j.object.objectId;O(W=>ce([_,"optionalAccess",ae=>ae.getLocalVariables,"call",ae=>ae(V,oe=>{W[v]={function:z,vars:oe},C(W)})]))}}C([])}let T=t.captureAllExceptions!==!1;if(_.configureAndConnect((f,S)=>E(c.stackParser,f,S),T),T){let f=t.maxExceptionsPerSecond||50;n=lQ(f,()=>{H.log("Local variables rate-limit lifted."),ce([_,"optionalAccess",S=>S.setPauseOnExceptions,"call",S=>S(!0)])},S=>{H.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${S} seconds.`),ce([_,"optionalAccess",d=>d.setPauseOnExceptions,"call",d=>d(!1)])})}i=!0},_=>{H.log("The `LocalVariables` integration failed to start.",_)})},processEvent(a){return i?s(a):a},_getCachedFramesCount(){return r.size},_getFirstCachedFrame(){return r.values()[0]}}}),SQ=L1e;var pQ=(t={})=>JM.major<19?SQ(t):EQ(t);import{existsSync as v1e,readFileSync as y1e}from"node:fs";import{dirname as b1e,join as U1e}from"node:path";function el(){return typeof Y<"u"}var eP,dQ="Modules",x1e=(()=>el()?{name:dQ,processEvent(t){return t.modules={...t.modules,...G1e()},t}}:(st&&H.warn("modulesIntegration only works in CommonJS (CJS) environments. Remove this integration if you are using ESM."),{name:dQ})),hQ=x1e;function w1e(){try{return Y.cache?Object.keys(Y.cache):[]}catch{return[]}}function V1e(){let t=Y.main&&Y.main.paths||[],e=w1e(),r={},n={};return e.forEach(i=>{let o=i,s=()=>{let a=o;if(o=b1e(a),!o||a===o||n[a])return;if(t.indexOf(o)<0)return s();let c=U1e(a,"package.json");if(n[a]=!0,!v1e(c))return s();try{let u=JSON.parse(y1e(c,"utf8"));r[u.name]=u.version}catch{}};s()}),r}function G1e(){return eP||(eP=V1e()),eP}var $1e=2e3;function RT(t){Ut(()=>{console.error(t)});let e=Pe();if(e===void 0){st&&H.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let r=e.getOptions(),n=r&&r.shutdownTimeout&&r.shutdownTimeout>0&&r.shutdownTimeout||$1e;e.close(n).then(i=>{i||st&&H.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},i=>{st&&H.error(i)})}var B1e="OnUncaughtException",AQ=(t={})=>{let e={exitEvenIfOtherHandlersAreRegistered:!1,...t};return{name:B1e,setup(r){global.process.on("uncaughtException",F1e(r,e))}}};function F1e(t,e){let n=!1,i=!1,o=!1,s,a=t.getOptions();return Object.assign(c=>{let u=RT;e.onFatalError?u=e.onFatalError:a.onFatalError&&(u=a.onFatalError);let E=global.process.listeners("uncaughtException").filter(f=>f.name!=="domainUncaughtExceptionClear"&&f.tag!=="sentry_tracingErrorCallback"&&f._errorHandler!==!0).length===0,T=e.exitEvenIfOtherHandlersAreRegistered||E;n?T&&(o?(st&&H.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),RT(c)):i||(i=!0,setTimeout(()=>{o||(o=!0,u(s,c))},2e3))):(s=c,n=!0,Pe()===t&&Xr(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"onuncaughtexception"}}),!o&&T&&(o=!0,u(c)))},{_errorHandler:!0})}var k1e="OnUnhandledRejection",Y1e=((t={})=>{let e=t.mode||"warn";return{name:k1e,setup(r){global.process.on("unhandledRejection",H1e(r,{mode:e}))}}}),mQ=Y1e;function H1e(t,e){return function(n,i){Pe()===t&&(Xr(n,{originalException:i,captureContext:{extra:{unhandledPromiseRejection:!0}},mechanism:{handled:!1,type:"onunhandledrejection"}}),j1e(n,e))}}function j1e(t,e){let r="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";e.mode==="warn"?Ut(()=>{console.warn(r),console.error(t&&typeof t=="object"&&"stack"in t?t.stack:t)}):e.mode==="strict"&&(Ut(()=>{console.warn(r)}),RT(t))}var yQ=ne(vQ(),1);var bQ="Express",UQ=Ve(bQ,()=>new yQ.ExpressInstrumentation({requestHook(t){vt(t,"auto.http.otel.express");let e=xe(t).data||{},r=e["express.type"];r&&t.setAttribute(Be,`${r}.express`);let n=e["express.name"];typeof n=="string"&&t.updateName(n)},spanNameHook(t,e){if(ze()===Di())return st&&H.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let r=t.request,n=r.method?r.method.toUpperCase():"GET";ze().setTransactionName(`${n} ${t.route}`)}return e}})),nVe=(()=>({name:bQ,setupOnce(){UQ()}})),xQ=nVe;var jQ=ne(HQ(),1);var KQ="Fastify",WQ=Ve(KQ,()=>new jQ.FastifyInstrumentation({requestHook(t){SVe(t)}})),fVe=(()=>({name:KQ,setupOnce(){WQ()}})),zQ=fVe;function SVe(t){let e=xe(t).data||{},r=e["fastify.type"];if(e[Be]||!r)return;t.setAttributes({[it]:"auto.http.otel.fastify",[Be]:`${r}.fastify`});let n=e["fastify.name"]||e["plugin.name"]||e["hook.name"];typeof n=="string"&&t.updateName(n.replace(/^fastify -> /,""))}var pee=ne(See(),1);var dee="Graphql",hee=Ve(dee,(t={})=>{let e=mee(t);return new pee.GraphQLInstrumentation({...e,responseHook(r){vt(r,"auto.graphql.otel.graphql");let n=xe(r).data||{},i=n["graphql.operation.type"],o=n["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let s=Nt(r),c=(xe(s).data||{})[Xu]||[],u=o?`${i} ${o}`:`${i}`;Array.isArray(c)?(c.push(u),s.setAttribute(Xu,c)):c?s.setAttribute(Xu,[c,u]):s.setAttribute(Xu,u)}}})}),bVe=((t={})=>({name:dee,setupOnce(){hee(mee(t))}})),Aee=bVe;function mee(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}var Lee=ne(Dee(),1);var vee="Kafka",yee=Ve(vee,()=>new Lee.KafkaJsInstrumentation({consumerHook(t){vt(t,"auto.kafkajs.otel.consumer")},producerHook(t){vt(t,"auto.kafkajs.otel.producer")}})),xVe=(()=>({name:vee,setupOnce(){yee()}})),bee=xVe;var Bee=ne($ee(),1);var Fee="LruMemoizer",kee=Ve(Fee,()=>new Bee.LruMemoizerInstrumentation),GVe=(()=>({name:Fee,setupOnce(){kee()}})),Yee=GVe;var Xee=ne(Zee(),1);var Jee="Mongo",Qee=Ve(Jee,()=>new Xee.MongoDBInstrumentation({dbStatementSerializer:kVe,responseHook(t){vt(t,"auto.db.otel.mongo")}}));function kVe(t){let e=dP(t);return JSON.stringify(e)}function dP(t){if(Array.isArray(t))return t.map(e=>dP(e));if(YVe(t)){let e={};return Object.entries(t).map(([r,n])=>[r,dP(n)]).reduce((r,n)=>(jVe(n)&&(r[n[0]]=n[1]),r),e)}return"?"}function YVe(t){return typeof t=="object"&&t!==null&&!HVe(t)}function HVe(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function jVe(t){return Array.isArray(t)}var KVe=(()=>({name:Jee,setupOnce(){Qee()}})),ete=KVe;var fte=ne(Tte(),1);var Ste="Mongoose",pte=Ve(Ste,()=>new fte.MongooseInstrumentation({responseHook(t){vt(t,"auto.db.otel.mongoose")}})),rGe=(()=>({name:Ste,setupOnce(){pte()}})),dte=rGe;var Pte=ne(Mte(),1);var Dte="Mysql",Lte=Ve(Dte,()=>new Pte.MySQLInstrumentation({})),EGe=(()=>({name:Dte,setupOnce(){Lte()}})),vte=EGe;var Yte=ne(kte(),1);var Hte="Mysql2",jte=Ve(Hte,()=>new Yte.MySQL2Instrumentation({responseHook(t){vt(t,"auto.db.otel.mysql2")}})),NGe=(()=>({name:Hte,setupOnce(){jte()}})),Kte=NGe;var hre=ne(rre(),1),Are=ne(Tre(),1);var wGe=["get","set","setex"],PP=["get","mget"],VGe=["set","setex"];function GT(t,e){return t.includes(e.toLowerCase())}function DP(t){return GT(PP,t)?"cache.get":GT(VGe,t)?"cache.put":void 0}function GGe(t,e){return e.some(r=>t.startsWith(r))}function Sre(t,e){try{if(e.length===0)return;let r=i=>typeof i=="string"||typeof i=="number"||Buffer.isBuffer(i)?[i.toString()]:Array.isArray(i)?fre(i.map(o=>r(o))):["<unknown>"],n=e[0];return GT(wGe,t)&&n!=null?r(n):fre(e.map(i=>r(i)))}catch{return}}function pre(t,e,r){if(!DP(t))return!1;for(let n of e)if(GGe(n,r))return!0;return!1}function dre(t){let e=r=>{try{return Buffer.isBuffer(r)?r.byteLength:typeof r=="string"?r.length:typeof r=="number"?r.toString().length:r==null?0:JSON.stringify(r).length}catch{return}};return Array.isArray(t)?t.reduce((r,n)=>{let i=e(n);return typeof i=="number"?r!==void 0?r+i:i:r},0):e(t)}function fre(t){let e=[],r=n=>{n.forEach(i=>{Array.isArray(i)?r(i):e.push(i)})};return r(t),e}var mre="Redis",LP={},gre=(t,e,r,n)=>{t.setAttribute(it,"auto.db.otel.redis");let i=Sre(e,r),o=DP(e);if(!i||!o||!ce([LP,"optionalAccess",_=>_.cachePrefixes])||!pre(e,i,LP.cachePrefixes))return;let s=ce([xe,"call",_=>_(t),"access",_=>_.data,"optionalAccess",_=>_["net.peer.name"]]),a=ce([xe,"call",_=>_(t),"access",_=>_.data,"optionalAccess",_=>_["net.peer.port"]]);a&&s&&t.setAttributes({"network.peer.address":s,"network.peer.port":a});let c=dre(n);c&&t.setAttribute(KO,c),GT(PP,e)&&c!==void 0&&t.setAttribute(HO,c>0),t.setAttributes({[Be]:o,[jO]:i});let u=i.join(", ");t.updateName(_r(u,1024))},$Ge=Ve("IORedis",()=>new hre.IORedisInstrumentation({responseHook:gre})),BGe=Ve("Redis-4",()=>new Are.RedisInstrumentation({responseHook:gre})),Rre=Object.assign(()=>{$Ge(),BGe()},{id:mre}),FGe=((t={})=>({name:mre,setupOnce(){LP=t,Rre()}})),Ore=FGe;var Ure=ne(Lre(),1);ut();et();var ZGe="sentryPatched";function Nl(t){return t.sentryPatched?!0:(xt(t,ZGe,!0),!1)}function Hs(t,e=void 0){return{name:sr(e,()=>t.name),attributes:{[Be]:"middleware.nestjs",[it]:"auto.middleware.nestjs"}}}function vre(t){return{name:`event ${t}`,attributes:{[Be]:"event.nestjs",[it]:"auto.event.nestjs"},forceTransaction:!0}}function xP(t,e){e&&(t.subscribe=new Proxy(t.subscribe,{apply:(r,n,i)=>po(e,()=>{let o=r.apply(n,i);return o.add(()=>e.end()),o})}))}function yre(t,e,r){return new Proxy(t,{apply:(n,i,o)=>(e.end(),r?po(r,()=>Reflect.apply(n,i,o)):Reflect.apply(n,i,o))})}var bre=[">=2.0.0"],Cl=class t extends wn{static __initStatic(){this.COMPONENT="@nestjs/event-emitter"}static __initStatic2(){this.COMMON_ATTRIBUTES={component:t.COMPONENT}}constructor(e={}){super("sentry-nestjs-event",pt,e)}init(){let e=new li(t.COMPONENT,bre);return e.files.push(this._getOnEventFileInstrumentation(bre)),e}_getOnEventFileInstrumentation(e){return new oc("@nestjs/event-emitter/dist/decorators/on-event.decorator.js",e,r=>(qa(r.OnEvent)&&this._unwrap(r,"OnEvent"),this._wrap(r,"OnEvent",this._createWrapOnEvent()),r),r=>{this._unwrap(r,"OnEvent")})}_createWrapOnEvent(){return function(r){return function(i,o){let s=Array.isArray(i)?i.join(","):typeof i=="string"||typeof i=="symbol"?i.toString():"<unknown_event>",a=r(i,o);return function(c,u,_){if(!_.value||typeof _.value!="function"||c.__SENTRY_INTERNAL__)return a(c,u,_);let E=_.value,T=E.name||u;return _.value=async function(...f){return ls(vre(s),async()=>{try{return await E.apply(this,f)}catch(S){throw Xr(S),S}})},Object.defineProperty(_.value,"name",{value:T,configurable:!0}),a(c,u,_)}}}}};Cl.__initStatic();Cl.__initStatic2();ut();et();var wP=[">=8.0.0 <11"],Il=class t extends wn{static __initStatic(){this.COMPONENT="@nestjs/common"}static __initStatic2(){this.COMMON_ATTRIBUTES={component:t.COMPONENT}}constructor(e={}){super("sentry-nestjs",pt,e)}init(){let e=new li(t.COMPONENT,wP);return e.files.push(this._getInjectableFileInstrumentation(wP),this._getCatchFileInstrumentation(wP)),e}_getInjectableFileInstrumentation(e){return new oc("@nestjs/common/decorators/core/injectable.decorator.js",e,r=>(qa(r.Injectable)&&this._unwrap(r,"Injectable"),this._wrap(r,"Injectable",this._createWrapInjectable()),r),r=>{this._unwrap(r,"Injectable")})}_getCatchFileInstrumentation(e){return new oc("@nestjs/common/decorators/core/catch.decorator.js",e,r=>(qa(r.Catch)&&this._unwrap(r,"Catch"),this._wrap(r,"Catch",this._createWrapCatch()),r),r=>{this._unwrap(r,"Catch")})}_createWrapInjectable(){return function(r){return function(i){return function(o){if(typeof o.prototype.use=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.use=new Proxy(o.prototype.use,{apply:(s,a,c)=>{let[u,_,E,...T]=c;if(!u||!_||!E||typeof E!="function")return s.apply(a,c);let f=fo();return eE(Hs(o),S=>{let d=yre(E,S,f);return s.apply(a,[u,_,d,T])})}})}if(typeof o.prototype.canActivate=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.canActivate=new Proxy(o.prototype.canActivate,{apply:(s,a,c)=>c[0]?ls(Hs(o),()=>s.apply(a,c)):s.apply(a,c)})}if(typeof o.prototype.transform=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.transform=new Proxy(o.prototype.transform,{apply:(s,a,c)=>{let u=c[0],_=c[1];return!u||!_?s.apply(a,c):ls(Hs(o),()=>s.apply(a,c))}})}if(typeof o.prototype.intercept=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(i)(o);o.prototype.intercept=new Proxy(o.prototype.intercept,{apply:(s,a,c)=>{let u=c[0],_=c[1],E=fo(),T;return!u||!_||typeof _.handle!="function"?s.apply(a,c):eE(Hs(o),f=>{_.handle=new Proxy(_.handle,{apply:(d,p,g)=>{if(f.end(),E)return po(E,()=>{let N=Reflect.apply(d,p,g);return u._sentryInterceptorInstrumented||(xt(u,"_sentryInterceptorInstrumented",!0),T=tE(Hs(o,"Interceptors - After Route"))),N});{let N=Reflect.apply(d,p,g);return u._sentryInterceptorInstrumented||(xt(u,"_sentryInterceptorInstrumented",!0),T=tE(Hs(o,"Interceptors - After Route"))),N}}});let S;try{S=s.apply(a,c)}catch(d){throw ce([f,"optionalAccess",p=>p.end,"call",p=>p()]),ce([T,"optionalAccess",p=>p.end,"call",p=>p()]),d}return T?En(S)?S.then(d=>(xP(d,sr(T,()=>E)),d),d=>{throw ce([f,"optionalAccess",p=>p.end,"call",p=>p()]),ce([T,"optionalAccess",p=>p.end,"call",p=>p()]),d}):(typeof S.subscribe=="function"&&xP(S,sr(T,()=>E)),S):S})}})}return r(i)(o)}}}}_createWrapCatch(){return function(r){return function(...i){return function(o){if(typeof o.prototype.catch=="function"&&!o.__SENTRY_INTERNAL__){if(Nl(o))return r(...i)(o);o.prototype.catch=new Proxy(o.prototype.catch,{apply:(s,a,c)=>{let u=c[0],_=c[1];return!u||!_?s.apply(a,c):ls(Hs(o),()=>s.apply(a,c))}})}return r(...i)(o)}}}}};Il.__initStatic();Il.__initStatic2();var xre="Nest",XGe=Ve("Nest-Core",()=>new Ure.NestInstrumentation),JGe=Ve("Nest-Common",()=>new Il),QGe=Ve("Nest-Event",()=>new Cl),wre=Object.assign(()=>{XGe(),JGe(),QGe()},{id:xre}),Vre=()=>({name:xre,setupOnce(){wre()}});var gle=ne(mle(),1);var Rle="Postgres",Ole=Ve(Rle,()=>new gle.PgInstrumentation({requireParentSpan:!0,requestHook(t){vt(t,"auto.db.otel.postgres")}})),U$e=(()=>({name:Rle,setupOnce(){Ole()}})),Nle=U$e;var yle=ne(vle(),1);var ble="Hapi",Ule=Ve(ble,()=>new yle.HapiInstrumentation),j$e=(()=>({name:ble,setupOnce(){Ule()}})),xle=j$e;var Wle=ne(Kle(),1),zle=ne(dt(),1);var qle="Koa",Zle=Ve(qle,()=>new Wle.KoaInstrumentation({requestHook(t,e){if(Q$e(t),ze()===Di()){st&&H.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let r=xe(t).data,n=r&&r[zle.ATTR_HTTP_ROUTE],i=ce([e,"optionalAccess",o=>o.context,"optionalAccess",o=>o.request,"optionalAccess",o=>o.method,"optionalAccess",o=>o.toUpperCase,"call",o=>o()])||"GET";n&&ze().setTransactionName(`${i} ${n}`)}})),J$e=(()=>({name:qle,setupOnce(){Zle()}})),Xle=J$e;function Q$e(t){t.setAttribute(it,"auto.http.otel.koa");let e=xe(t).data||{},r=e["koa.type"];r&&t.setAttribute(Be,`${r}.koa`);let n=e["koa.name"];typeof n=="string"&&t.updateName(n||"< unknown >")}var s_e=ne(o_e(),1);var a_e="Connect",c_e=Ve(a_e,()=>new s_e.ConnectInstrumentation),lBe=(()=>({name:a_e,setupOnce(){c_e()}})),u_e=lBe;import*as _Be from"node:http";var rD="Spotlight",EBe=((t={})=>{let e={sidecarUrl:t.sidecarUrl||"http://localhost:8969/stream"};return{name:rD,setup(r){typeof process=="object"&&process.env&&H.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?"),TBe(r,e)}}}),l_e=EBe;function TBe(t,e){let r=fBe(e.sidecarUrl);if(!r)return;let n=0;t.on("beforeEnvelope",i=>{if(n>3){H.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let o=Q_(i),a=SBe()({method:"POST",path:r.pathname,hostname:r.hostname,port:r.port,headers:{"Content-Type":"application/x-sentry-envelope"}},c=>{c.statusCode&&c.statusCode>=200&&c.statusCode<400&&(n=0),c.on("data",()=>{}),c.on("end",()=>{}),c.setEncoding("utf8")});a.on("error",()=>{n++,H.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),a.write(o),a.end()})}function fBe(t){try{return new URL(`${t}`)}catch{H.warn(`[Spotlight] Invalid sidecar URL: ${t}`);return}}function SBe(){let{request:t}=_Be;return pBe(t)?t.__sentry_original__:t}function pBe(t){return"__sentry_original__"in t}var R_e=ne(g_e(),1);var gBe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),O_e="Tedious",N_e=Ve(O_e,()=>new R_e.TediousInstrumentation({})),RBe=(()=>({name:O_e,setupOnce(){N_e()},setup(t){t.on("spanStart",e=>{let{description:r,data:n}=xe(e);if(!r||ce([n,"optionalAccess",o=>o["db.system"]])!=="mssql")return;let i=ce([r,"optionalAccess",o=>o.split,"call",o=>o(" "),"access",o=>o[0]])||"";gBe.has(i)&&e.setAttribute(it,"auto.db.otel.tedious")})}})),C_e=RBe;var L_e=ne(D_e(),1);var v_e="GenericPool",y_e=Ve(v_e,()=>new L_e.GenericPoolInstrumentation({})),CBe=(()=>({name:v_e,setupOnce(){y_e()},setup(t){t.on("spanStart",e=>{let n=xe(e).description;(n==="generic-pool.aquire"||n==="generic-pool.acquire")&&e.setAttribute(it,"auto.db.otel.generic_pool")})}})),b_e=CBe;var Y_e=ne(k_e(),1);var H_e="Amqplib",xBe={consumeEndHook:t=>{vt(t,"auto.amqplib.otel.consumer")},publishHook:t=>{vt(t,"auto.amqplib.otel.publisher")}},j_e=Ve(H_e,()=>new Y_e.AmqplibInstrumentation(xBe)),wBe=(()=>({name:H_e,setupOnce(){j_e()}})),K_e=wBe;import*as uD from"node:diagnostics_channel";var VBe="ProcessAndThreadBreadcrumbs",W_e=(t={})=>({name:VBe,setup(e){uD.channel("child_process").subscribe(r=>{r&&typeof r=="object"&&"process"in r&&GBe(r.process,t)}),uD.channel("worker_threads").subscribe(r=>{r&&typeof r=="object"&&"worker"in r&&$Be(r.worker)})}});function GBe(t,e){let r=!1,n;t.on("spawn",()=>{if(t.spawnfile==="/usr/bin/sw_vers"){r=!0;return}n={spawnfile:t.spawnfile},e.includeChildProcessArgs&&(n.spawnargs=t.spawnargs)}).on("exit",i=>{r||(r=!0,i!==null&&i!==0&&Nn({category:"child_process",message:`Child process exited with code '${i}'`,level:"warning",data:n}))}).on("error",i=>{r||(r=!0,Nn({category:"child_process",message:`Child process errored with '${i.message}'`,level:"error",data:n}))})}function $Be(t){let e;t.on("online",()=>{e=t.threadId}).on("error",r=>{Nn({category:"worker_thread",message:`Worker thread errored with '${r.message}'`,level:"error",data:{threadId:e}})})}et();var BBe=["generateText","streamText","generateObject","streamObject","embed","embedMany"],lD=!1,rm=class extends wn{constructor(e={}){super("@sentry/instrumentation-vercel-ai",pt,e)}init(){return new li("ai",[">=3.0.0 <5"],this._patch.bind(this))}_patch(e){lD=!0;function r(i){return(...o)=>{let s=o[0].experimental_telemetry||{};return s.isEnabled===void 0&&(o[0].experimental_telemetry={isEnabled:!0,recordInputs:!1,recordOutputs:!1,...s}),e[i].apply(this,o)}}let n=BBe.reduce((i,o)=>(i[o]=r(o),i),{});return{...e,...n}}};var z_e=Ve("vercelAI",()=>new rm({})),FBe=(()=>({name:"vercelAI",setupOnce(){z_e()},processEvent(t){if(t.type==="transaction"&&ce([t,"access",e=>e.spans,"optionalAccess",e=>e.length]))for(let e of t.spans){let{data:r,description:n}=e;!r||!n||e.origin!=="auto.vercelai.otel"||(e.data=e.data||{},r["ai.usage.completionTokens"]!=null&&(e.data["ai.completion_tokens.used"]=r["ai.usage.completionTokens"]),r["ai.usage.promptTokens"]!=null&&(e.data["ai.prompt_tokens.used"]=r["ai.usage.promptTokens"]),r["ai.usage.completionTokens"]!=null&&r["ai.usage.promptTokens"]!=null&&(e.data["ai.total_tokens.used"]=r["ai.usage.completionTokens"]+r["ai.usage.promptTokens"]))}return t},setup(t){t.on("spanStart",e=>{if(!lD)return;let{data:r,description:n}=xe(e);if(!r||!n)return;let i=r["ai.model.id"],o=r["ai.model.provider"];if(!i||!o)return;let s=!1;switch(n){case"ai.generateText":{e.setAttribute(Be,"ai.pipeline.generateText"),s=!0;break}case"ai.generateText.doGenerate":{e.setAttribute(Be,"ai.run.doGenerate");break}case"ai.streamText":{e.setAttribute(Be,"ai.pipeline.streamText"),s=!0;break}case"ai.streamText.doStream":{e.setAttribute(Be,"ai.run.doStream");break}case"ai.generateObject":{e.setAttribute(Be,"ai.pipeline.generateObject"),s=!0;break}case"ai.generateObject.doGenerate":{e.setAttribute(Be,"ai.run.doGenerate");break}case"ai.streamObject":{e.setAttribute(Be,"ai.pipeline.streamObject"),s=!0;break}case"ai.streamObject.doStream":{e.setAttribute(Be,"ai.run.doStream");break}case"ai.embed":{e.setAttribute(Be,"ai.pipeline.embed"),s=!0;break}case"ai.embed.doEmbed":{e.setAttribute(Be,"ai.embeddings");break}case"ai.embedMany":{e.setAttribute(Be,"ai.pipeline.embedMany"),s=!0;break}case"ai.embedMany.doEmbed":{e.setAttribute(Be,"ai.embeddings");break}case"ai.toolCall":case"ai.stream.firstChunk":case"ai.stream.finish":e.setAttribute(Be,"ai.run");break}vt(e,"auto.vercelai.otel");let a=n.replace("ai.","");e.setAttribute("ai.pipeline.name",a),e.updateName(a),r["ai.telemetry.functionId"]&&s&&(e.updateName(r["ai.telemetry.functionId"]),e.setAttribute("ai.pipeline.name",r["ai.telemetry.functionId"])),r["ai.prompt"]&&e.setAttribute("ai.input_messages",r["ai.prompt"]),r["ai.model.id"]&&e.setAttribute("ai.model_id",r["ai.model.id"]),e.setAttribute("ai.streaming",n.includes("stream"))})}})),q_e=FBe;var Q_e=ne(J_e(),1);var eEe=I7(Q_e.AsyncLocalStorageContextManager);function tEe(){return[xQ(),zQ(),Aee(),ete(),dte(),vte(),Kte(),Ore(),Nle(),Vre(),xle(),Xle(),u_e(),C_e(),b_e(),bee(),K_e(),Yee(),q_e()]}import*as QBe from"node:http";import*as eFe from"node:https";import{Readable as tFe}from"node:stream";import{createGzip as rFe}from"node:zlib";import*as wo from"node:net";import*as pD from"node:tls";import*as SD from"node:http";import"node:https";var Qi=Symbol("AgentBaseInternalState"),sm=class extends SD.Agent{constructor(e){super(e),this[Qi]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
43
43
|
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)};Promise.resolve().then(()=>this.connect(e,i)).then(o=>{if(o instanceof SD.Agent)return o.addRequest(e,i);this[Qi].currentSocket=o,super.createSocket(e,r,n)},n)}createConnection(){let e=this[Qi].currentSocket;if(this[Qi].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return sr(this[Qi].defaultPort,()=>this.protocol==="https:"?443:80)}set defaultPort(e){this[Qi]&&(this[Qi].defaultPort=e)}get protocol(){return sr(this[Qi].protocol,()=>this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Qi]&&(this[Qi].protocol=e)}};function am(...t){H.log("[https-proxy-agent:parse-proxy-response]",...t)}function rEe(t){return new Promise((e,r)=>{let n=0,i=[];function o(){let _=t.read();_?u(_):t.once("readable",o)}function s(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",o)}function a(){s(),am("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}function c(_){s(),am("onerror %o",_),r(_)}function u(_){i.push(_),n+=_.length;let E=Buffer.concat(i,n),T=E.indexOf(`\r
|
|
44
44
|
\r
|
|
45
45
|
`);if(T===-1){am("have not received end of HTTP headers yet..."),o();return}let f=E.slice(0,T).toString("ascii").split(`\r
|
|
@@ -104,7 +104,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
104
104
|
`).filter(Boolean);for(let n of r){let i=n.split(" ");if(i.length>=3){let[o,s,a]=i;e.set(a,{additions:parseInt(o)||0,deletions:parseInt(s)||0})}}}async function nAe(t,e,r=""){let n=new Map;if(t.length===0)return n;let i=t.filter(s=>s.baseline),o=t.filter(s=>!s.baseline);if(i.length>0){let s=i.map(E=>E.path),c=`git diff -U0 -M ${i[0].baseline} ${r} -- ${ha(s)}`,{stdout:u}=await ot(c,{cwd:e,maxBuffer:50*1024*1024});l0(u).forEach((E,T)=>n.set(T,sS(E)))}if(o.length>0){let s=o.map(_=>_.path),a=`git diff -U0 -M ${r} -- ${ha(s)}`,{stdout:c}=await ot(a,{cwd:e,maxBuffer:50*1024*1024});l0(c).forEach((_,E)=>n.set(E,sS(_)))}return n}async function iAe(t,e,r=""){let n=new Map;if(t.length===0)return n;let i=t.filter(s=>s.baseline),o=t.filter(s=>!s.baseline);if(i.length>0){let s=i.map(_=>_.path),c=`git diff --numstat ${i[0].baseline} ${r} -- ${ha(s)}`,{stdout:u}=await ot(c,{cwd:e,maxBuffer:50*1024*1024});_0(u,n)}if(o.length>0){let s=o.map(u=>u.path),a=`git diff --numstat ${r} -- ${ha(s)}`,{stdout:c}=await ot(a,{cwd:e,maxBuffer:50*1024*1024});_0(c,n)}return n}function sS(t){if(!t)return"";let e=t.split(`
|
|
105
105
|
`),r=[],n=!1;for(let i of e)i.startsWith("diff --git")||i.startsWith("index ")||i.startsWith("--- ")||i.startsWith("+++ ")||i.startsWith("new file mode")||i.startsWith("deleted file mode")||i.startsWith("old mode")||i.startsWith("new mode")||i.startsWith("similarity index")||i.startsWith("rename from")||i.startsWith("rename to")||i.startsWith("copy from")||i.startsWith("copy to")||i==="\"||(i.startsWith("@@")&&(n=!0),n&&r.push(i));return r.join(`
|
|
106
106
|
`).trimEnd()}function oS(t){let e=t.match(/^(.+)\.\.\.(.+)$/);if(e)return[e[1],e[2],!0];let r=t.match(/^(.+)\.\.([^.].*)$/);return r?[r[1],r[2],!1]:[t,t,!1]}function EAe(t){let[,e]=oS(t);return e}async function E0(t){let{stdout:e}=await ot("git rev-parse --abbrev-ref HEAD",{cwd:t});return e.trim()}async function TAe(t){let e=await E0(t),{stdout:r}=await ot("git rev-parse HEAD",{cwd:t}),n=r.trim(),{stdout:i}=await ot('git log -1 --pretty=format:"%s"',{cwd:t}),o=i.trim(),{stdout:s}=await ot('git log -1 --pretty=format:"%cI"',{cwd:t}),a=s.trim();return{sha:n,branch:e,message:o,timestamp:a}}function T0(t,e,r){if(!t.includes("..")||!(e.includes("staged")||e.includes("unstaged")||e.includes("untracked")))return null;let o=EAe(t);return o==="HEAD"||o===r?null:`Worktree includes (staged, unstaged, untracked) require range to end at HEAD or current branch (${r}). Got: ${t}`}async function f0(t){let{stdout:e}=await ot("git rev-parse --abbrev-ref HEAD",{cwd:t}),r=e.trim(),n=["committed","staged","unstaged","untracked"],i=_Ae(t,r);if(i)return{commitSelector:`${i}...${r}`,include:n};let o=await uAe(t);if(o){if(r===o){let u=await lAe(t).catch(()=>{});return u?{commitSelector:`${u}...HEAD`,include:n}:{commitSelector:"HEAD~1...HEAD",include:n}}let s=`origin/${o}`,{stdout:a}=await ot(`git rev-parse --verify ${s}`,{cwd:t});return{commitSelector:`${a.trim()?s:o}...${r}`,include:n}}return{commitSelector:"HEAD...HEAD",include:n}}async function fAe(t,e){let r=e.commitSelector.trim(),n=r.includes(".."),{stdout:i}=await ot("git rev-parse --abbrev-ref HEAD",{cwd:t}),o=i.trim(),{stdout:s}=await ot("git rev-parse HEAD",{cwd:t}),a=s.trim(),c="",u="";if(n)c=r,u=r;else{let V=_Ae(t,o),W=await uAe(t),ae=r||V||`origin/${W||"main"}`;u=ae;let oe=`git merge-base --fork-point ${Cr(ae)} HEAD || git merge-base ${Cr(ae)} HEAD`,{stdout:Q}=await ot(oe,{cwd:t});if(c=Q.trim(),!r&&o===(W||"main")){let Se=await lAe(t).catch(()=>{});if(Se){u=Se;let{stdout:ue}=await ot(`git merge-base --fork-point ${Cr(Se)} HEAD || git merge-base ${Cr(Se)} HEAD`,{cwd:t});c=ue.trim()}else u="HEAD~1",c="HEAD~1"}}let _=C5e(e.include),E=T0(r,e.include,o);if(E)throw new Error(E);let T=[];if(_.committed)if(n){let[V,W]=oS(r),{stdout:ae}=await ot(`git diff --name-status -M -z ${Cr(V)}..${Cr(W)}`,{cwd:t,maxBuffer:50*1024*1024}),oe=aR(ae,"committed");oe.forEach(Q=>Q.baseline=V),T.push(...oe)}else{let{stdout:V}=await ot(`git diff --name-status -M -z ${c}..HEAD`,{cwd:t,maxBuffer:52428800}),W=aR(V,"committed");W.forEach(ae=>ae.baseline=c),T.push(...W)}if(_.staged){let{stdout:V}=await ot("git diff --name-status -M -z --cached",{cwd:t,maxBuffer:52428800});T.push(...aR(V,"staged"))}if(_.unstaged){let{stdout:V}=await ot("git diff --name-status -M -z",{cwd:t,maxBuffer:52428800});T.push(...aR(V,"unstaged"))}if(_.untracked){let{stdout:V}=await ot("git ls-files --others --exclude-standard -z",{cwd:t,maxBuffer:52428800});T.push(...M5e(V))}let f=P5e(T);if(n){let[V,,W]=oS(r),ae=V;if(W){let{stdout:oe}=await ot(`git merge-base ${Cr(V)} ${Cr(EAe(r))}`,{cwd:t});ae=oe.trim()}for(let oe of f)oe.baseline||(oe.baseline=ae)}let S=f.filter(V=>!I5e(t,V.path)),d=S.filter(V=>V.source==="committed"),p=S.filter(V=>V.source==="staged"),g=S.filter(V=>V.source==="unstaged"),N=S.filter(V=>V.source==="untracked"),O=new Map;if(d.length>0){let V=d.map(Q=>Q.path),W="";if(n){let[Q,Se]=oS(r);W=`git diff -U0 -M ${Cr(Q)}..${Cr(Se)} -- ${ha(V)}`}else W=`git diff -U0 -M ${c}..HEAD -- ${ha(V)}`;let{stdout:ae}=await ot(W,{cwd:t,maxBuffer:50*1024*1024});l0(ae).forEach((Q,Se)=>O.set(Se,sS(Q)))}(await nAe(p,t,"--cached")).forEach((V,W)=>O.set(W,V)),(await nAe(g,t,"")).forEach((V,W)=>O.set(W,V));for(let V of N)try{let{stdout:W}=await ot(`git diff -U0 --no-index /dev/null ${Cr(V.path)}`,{cwd:t,maxBuffer:52428800});O.set(V.path,sS(W))}catch(W){if(W.stdout)O.set(V.path,sS(W.stdout));else throw W}let x=new Map;if(d.length>0){let V=d.map(oe=>oe.path),W="";if(n){let[oe,Q]=oS(r);W=`git diff --numstat ${Cr(oe)}..${Cr(Q)} -- ${ha(V)}`}else W=`git diff --numstat ${c}..HEAD -- ${ha(V)}`;let{stdout:ae}=await ot(W,{cwd:t,maxBuffer:50*1024*1024});_0(ae,x)}(await iAe(p,t,"--cached")).forEach((V,W)=>x.set(W,V)),(await iAe(g,t,"")).forEach((V,W)=>x.set(W,V));for(let V of N){let ae=(O.get(V.path)||"").split(`
|
|
107
|
-
`),oe=0,Q=0;for(let Se of ae)Se.startsWith("+")&&!Se.startsWith("+++")?oe++:Se.startsWith("-")&&!Se.startsWith("---")&&Q++;x.set(V.path,{additions:oe,deletions:Q})}let j=[],z=new Map;for(let V of S){let W=O.get(V.path)||"",ae=x.get(V.path)||{additions:0,deletions:0},oe=D5e(V,d),Q={filename:V.path,status:oe,patch:W,additions:ae.additions,deletions:ae.deletions,sha:Fc(W)};V.oldPath&&(Q.oldFilename=V.oldPath),V.baseline&&z.set(V.path,V.baseline),j.push(Q)}for(let V of j)if(V.status==="modified"){let W=V.oldFilename||V.filename,ae=z.get(V.filename)||c,{stdout:oe}=await ot(`git show ${Cr(ae)}:${Cr(W)}`,{cwd:t,maxBuffer:50*1024*1024});oe&&(V.baseContent=oe)}return{files:j,currentBranch:o,currentCommit:a,diffBranch:u,diffCommit:c}}var Ko=class{workspaceRoot;repositoryUrl;constructor(e){this.repositoryUrl=e?.repositoryUrl||null,this.workspaceRoot=e?.workspaceRoot||sAe()}getWorkspaceRoot(){return this.workspaceRoot}async getRepositoryUrl(e="origin"){if(this.repositoryUrl)return this.repositoryUrl;let r=await cAe(this.workspaceRoot,e);if(!r)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return r}async getCurrentCommit(){return await TAe(this.workspaceRoot)}};import*as Ir from"fs/promises";import d9e from"os";import m_ from"path";import{Buffer as SAe}from"buffer";var cR=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(SAe.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",n=Array.isArray(t);r=n?"[":"{";let i=!0;for(let o in t){let s=typeof t[o]=="function"||!n&&t[o]===void 0;!Object.hasOwn(t,o)||s||(i||(r+=","),i=!1,n?r+=cR(t[o],e):t[o]!==void 0&&(r+=`${cR(o,!1)}:${cR(t[o],e)}`))}return r+=n?"]":"}",r}return JSON.stringify(t)},S0=t=>cR(t,!0),p0=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?SAe.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r);var L5e=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map,this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(t,e){this.on(t,e)}on(t,e){this._eventListeners.has(t)||this._eventListeners.set(t,[]);let r=this._eventListeners.get(t);return r&&(r.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${r.length+1} ${t} listeners added. Use setMaxListeners() to increase limit.`),r.push(e)),this}removeListener(t,e){this.off(t,e)}off(t,e){let r=this._eventListeners.get(t)??[],n=r.indexOf(e);n!==-1&&r.splice(n,1),r.length===0&&this._eventListeners.delete(t)}once(t,e){let r=(...n)=>{e(...n),this.off(t,r)};this.on(t,r)}emit(t,...e){let r=this._eventListeners.get(t);if(r&&r.length>0)for(let n of r)n(...e)}listeners(t){return this._eventListeners.get(t)??[]}removeAllListeners(t){t?this._eventListeners.delete(t):this._eventListeners.clear()}setMaxListeners(t){this._maxListeners=t}},d0=L5e,v5e=class extends d0{_hookHandlers;constructor(){super(),this._hookHandlers=new Map}addHandler(t,e){let r=this._hookHandlers.get(t);r?r.push(e):this._hookHandlers.set(t,[e])}removeHandler(t,e){let r=this._hookHandlers.get(t);if(r){let n=r.indexOf(e);n!==-1&&r.splice(n,1)}}trigger(t,e){let r=this._hookHandlers.get(t);if(r)for(let n of r)try{n(e)}catch(i){this.emit("error",new Error(`Error in hook handler for event "${t}": ${i.message}`))}}get handlers(){return new Map(this._hookHandlers)}},y5e=v5e,b5e=class extends d0{enabled=!0;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(t){super(),t!==void 0&&(this.enabled=t),this.reset()}hit(){this.enabled&&this.hits++}miss(){this.enabled&&this.misses++}set(){this.enabled&&this.sets++}delete(){this.enabled&&this.deletes++}hitsOrMisses(t){for(let e of t)e===void 0?this.miss():this.hit()}reset(){this.hits=0,this.misses=0,this.sets=0,this.deletes=0,this.errors=0}},U5e=b5e;var pAe=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"],x5e=class extends d0{opts;iterator;hooks=new y5e;stats=new U5e(!1);_ttl;_namespace;_store=new Map;_serialize=S0;_deserialize=p0;_compression;_useKeyPrefix=!0;_throwOnErrors=!1;constructor(t,e){if(super(),e??={},t??={},this.opts={namespace:"keyv",serialize:S0,deserialize:p0,emitErrors:!0,store:new Map,...e},t&&t.get?this.opts.store=t:this.opts={...this.opts,...t},this._store=this.opts.store??new Map,this._compression=this.opts.compression,this._serialize=this.opts.serialize,this._deserialize=this.opts.deserialize,this.opts.namespace&&(this._namespace=this.opts.namespace),this._store){if(!this._isValidStorageAdapter(this._store))throw new Error("Invalid storage adapter");typeof this._store.on=="function"&&this._store.on("error",r=>this.emit("error",r)),this._store.namespace=this._namespace,typeof this._store[Symbol.iterator]=="function"&&this._store instanceof Map?this.iterator=this.generateIterator(this._store):"iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(this._store.iterator.bind(this._store)))}this.opts.stats&&(this.stats.enabled=this.opts.stats),this.opts.ttl&&(this._ttl=this.opts.ttl),this.opts.useKeyPrefix!==void 0&&(this._useKeyPrefix=this.opts.useKeyPrefix),this.opts.throwOnErrors!==void 0&&(this._throwOnErrors=this.opts.throwOnErrors)}get store(){return this._store}set store(t){if(this._isValidStorageAdapter(t))this._store=t,this.opts.store=t,typeof t.on=="function"&&t.on("error",e=>this.emit("error",e)),this._namespace&&(this._store.namespace=this._namespace),typeof t[Symbol.iterator]=="function"&&t instanceof Map?this.iterator=this.generateIterator(t):"iterator"in t&&t.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(t.iterator?.bind(t)));else throw new Error("Invalid storage adapter")}get compression(){return this._compression}set compression(t){this._compression=t}get namespace(){return this._namespace}set namespace(t){this._namespace=t,this.opts.namespace=t,this._store.namespace=t,this.opts.store&&(this.opts.store.namespace=t)}get ttl(){return this._ttl}set ttl(t){this.opts.ttl=t,this._ttl=t}get serialize(){return this._serialize}set serialize(t){this.opts.serialize=t,this._serialize=t}get deserialize(){return this._deserialize}set deserialize(t){this.opts.deserialize=t,this._deserialize=t}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(t){this._useKeyPrefix=t,this.opts.useKeyPrefix=t}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(t){this._throwOnErrors=t,this.opts.throwOnErrors=t}generateIterator(t){return async function*(){for await(let[r,n]of typeof t=="function"?t(this._store.namespace):t){let i=await this.deserializeData(n);if(!(this._useKeyPrefix&&this._store.namespace&&!r.includes(this._store.namespace))){if(typeof i.expires=="number"&&Date.now()>i.expires){this.delete(r);continue}yield[this._getKeyUnprefix(r),i.value]}}}.bind(this)}_checkIterableAdapter(){return pAe.includes(this._store.opts.dialect)||pAe.some(t=>this._store.opts.url.includes(t))}_getKeyPrefix(t){return!this._useKeyPrefix||!this._namespace?t:`${this._namespace}:${t}`}_getKeyPrefixArray(t){return!this._useKeyPrefix||!this._namespace?t:t.map(e=>`${this._namespace}:${e}`)}_getKeyUnprefix(t){return this._useKeyPrefix?t.split(":").splice(1).join(":"):t}_isValidStorageAdapter(t){return t instanceof Map||typeof t.get=="function"&&typeof t.set=="function"&&typeof t.delete=="function"&&typeof t.clear=="function"}async get(t,e){let{store:r}=this.opts,n=Array.isArray(t),i=n?this._getKeyPrefixArray(t):this._getKeyPrefix(t),o=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(n)return e?.raw===!0?this.getMany(t,{raw:!0}):this.getMany(t,{raw:!1});this.hooks.trigger("preGet",{key:i});let s;try{s=await r.get(i)}catch(c){if(this.throwOnErrors)throw c}let a=typeof s=="string"||this.opts.compression?await this.deserializeData(s):s;if(a==null){this.stats.miss();return}if(o(a)){await this.delete(t),this.stats.miss();return}return this.hooks.trigger("postGet",{key:i,value:a}),this.stats.hit(),e?.raw?a:a.value}async getMany(t,e){let{store:r}=this.opts,n=this._getKeyPrefixArray(t),i=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(this.hooks.trigger("preGetMany",{keys:n}),r.getMany===void 0){let c=n.map(async E=>{let T=await r.get(E),f=typeof T=="string"||this.opts.compression?await this.deserializeData(T):T;if(f!=null){if(i(f)){await this.delete(E);return}return e?.raw?f:f.value}}),_=(await Promise.allSettled(c)).map(E=>E.value);return this.hooks.trigger("postGetMany",_),_.length>0&&this.stats.hit(),_}let o=await r.getMany(n),s=[],a=[];for(let c in o){let u=o[c];if(typeof u=="string"&&(u=await this.deserializeData(u)),u==null){s.push(void 0);continue}if(i(u)){a.push(t[c]),s.push(void 0);continue}let _=e?.raw?u:u.value;s.push(_)}return a.length>0&&await this.deleteMany(a),this.hooks.trigger("postGetMany",s),s.length>0&&this.stats.hit(),s}async getRaw(t){let{store:e}=this.opts,r=this._getKeyPrefix(t);this.hooks.trigger("preGetRaw",{key:r});let n=await e.get(r);if(n==null){this.stats.miss();return}let i=typeof n=="string"||this.opts.compression?await this.deserializeData(n):n;if(i!==void 0&&i.expires!==void 0&&i.expires!==null&&i.expires<Date.now()){this.stats.miss(),await this.delete(t);return}return this.stats.hit(),this.hooks.trigger("postGetRaw",{key:r,value:i}),i}async getManyRaw(t){let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(t.length===0){let s=Array.from({length:t.length}).fill(void 0);return this.stats.misses+=t.length,this.hooks.trigger("postGetManyRaw",{keys:r,values:s}),s}let n=[];if(e.getMany===void 0){let s=r.map(async c=>{let u=await e.get(c);if(u!=null)return this.deserializeData(u)});n=(await Promise.allSettled(s)).map(c=>c.value)}else{let s=await e.getMany(r);for(let a of s)a!=null?n.push(await this.deserializeData(a)):n.push(void 0)}let i=[],o=s=>typeof s.expires=="number"&&Date.now()>s.expires;for(let[s,a]of n.entries())a!==void 0&&o(a)&&(i.push(r[s]),n[s]=void 0);return i.length>0&&await this.deleteMany(i),this.stats.hitsOrMisses(n),this.hooks.trigger("postGetManyRaw",{keys:r,values:n}),n}async set(t,e,r){let n={key:t,value:e,ttl:r};this.hooks.trigger("preSet",n);let i=this._getKeyPrefix(n.key);n.ttl??=this._ttl,n.ttl===0&&(n.ttl=void 0);let{store:o}=this.opts,s=typeof n.ttl=="number"?Date.now()+n.ttl:void 0;if(typeof n.value=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let a={value:n.value,expires:s},c=await this.serializeData(a),u=!0;try{let _=await o.set(i,c,n.ttl);typeof _=="boolean"&&(u=_)}catch(_){if(u=!1,this.emit("error",_),this._throwOnErrors)throw _}return this.hooks.trigger("postSet",{key:i,value:c,ttl:r}),this.stats.set(),u}async setMany(t){let e=[];try{if(this._store.setMany===void 0){let r=[];for(let i of t)r.push(this.set(i.key,i.value,i.ttl));e=await Promise.all(r)}else{let r=await Promise.all(t.map(async({key:n,value:i,ttl:o})=>{o??=this._ttl,o===0&&(o=void 0);let s=typeof o=="number"?Date.now()+o:void 0;if(typeof i=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let a={value:i,expires:s},c=await this.serializeData(a);return{key:this._getKeyPrefix(n),value:c,ttl:o}}));e=await this._store.setMany(r)}}catch(r){if(this.emit("error",r),this._throwOnErrors)throw r;e=t.map(()=>!1)}return e}async delete(t){let{store:e}=this.opts;if(Array.isArray(t))return this.deleteMany(t);let r=this._getKeyPrefix(t);this.hooks.trigger("preDelete",{key:r});let n=!0;try{let i=await e.delete(r);typeof i=="boolean"&&(n=i)}catch(i){if(n=!1,this.emit("error",i),this._throwOnErrors)throw i}return this.hooks.trigger("postDelete",{key:r,value:n}),this.stats.delete(),n}async deleteMany(t){try{let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(this.hooks.trigger("preDelete",{key:r}),e.deleteMany!==void 0)return await e.deleteMany(r);let n=r.map(async s=>e.delete(s)),o=(await Promise.all(n)).every(Boolean);return this.hooks.trigger("postDelete",{key:r,value:o}),o}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e;return!1}}async clear(){this.emit("clear");let{store:t}=this.opts;try{await t.clear()}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e}}async has(t){if(Array.isArray(t))return this.hasMany(t);let e=this._getKeyPrefix(t),{store:r}=this.opts;if(r.has!==void 0&&!(r instanceof Map))return r.has(e);let n;try{n=await r.get(e)}catch(i){if(this.emit("error",i),this._throwOnErrors)throw i;return!1}if(n){let i=await this.deserializeData(n);if(i)return i.expires===void 0||i.expires===null?!0:i.expires>Date.now()}return!1}async hasMany(t){let e=this._getKeyPrefixArray(t),{store:r}=this.opts;if(r.hasMany!==void 0)return r.hasMany(e);let n=[];for(let i of t)n.push(await this.has(i));return n}async disconnect(){let{store:t}=this.opts;if(this.emit("disconnect"),typeof t.disconnect=="function")return t.disconnect()}emit(t,...e){t==="error"&&!this.opts.emitErrors||super.emit(t,...e)}async serializeData(t){return this._serialize?this._compression?.compress?this._serialize({value:await this._compression.compress(t.value),expires:t.expires}):this._serialize(t):t}async deserializeData(t){if(!this._deserialize)return t;if(this._compression?.decompress&&typeof t=="string"){let e=await this._deserialize(t);return{value:await this._compression.decompress(e?.value),expires:e?.expires}}if(typeof t=="string")return this._deserialize(t)}},dAe=x5e;var XAe=ne(ZAe(),1);var SR=class{environment;cacheStore;constructor(e){this.environment=e}getStorageDirectory(){return m_.join(d9e.homedir(),".powerlint")}getIndexDirectory(){return m_.join(this.getStorageDirectory(),"indexes",Fc(this.environment.getWorkspaceRoot()))}getCacheDirectory(){return m_.join(this.getStorageDirectory(),"cache",Fc(this.environment.getWorkspaceRoot()))}async ensureDirectory(e){await Ir.mkdir(e,{recursive:!0})}async getIndexFilePath(e,r){let n=this.getIndexDirectory();await this.ensureDirectory(n);let i=r||`${e.toLowerCase()}-index.scip`;return m_.join(n,`${e.toLowerCase()}-${i}`)}async indexExists(e,r){let n=await this.getIndexFilePath(e,r);try{return await Ir.access(n),!0}catch{return!1}}async readIndex(e,r){let n=await this.getIndexFilePath(e,r);try{return await Ir.access(n),await Ir.readFile(n)}catch{return null}}async saveIndex(e,r,n){let i=await this.getIndexFilePath(e,n);await Ir.writeFile(i,r)}getCacheFilePath(){return m_.join(this.getCacheDirectory(),"cache.json")}async purgeStorage(){let e=0,r=this.getStorageDirectory();try{await Ir.access(r),await Ir.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}async purgeCache(){let e=0,r=this.getCacheDirectory();try{await Ir.access(r),await Ir.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}getCacheStore(){if(!this.cacheStore){let e=this.getCacheDirectory();this.cacheStore=new dAe({store:new XAe.KeyvFile({filename:m_.join(e,"cache.json")})})}return this.cacheStore}async saveCache(e,r,n){let i=this.getCacheStore(),o=`${e}:${r}`;await i.set(o,n)}async readCache(e,r){let n=this.getCacheStore(),i=`${e}:${r}`;return await n.get(i)||null}async purgeIndexes(){let e=0,r=this.getIndexDirectory();try{await Ir.access(r),await Ir.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}};import*as vS from"path";var JAe=Je.object({conversation_id:Je.string(),generation_id:Je.string(),model:Je.string(),hook_event_name:Je.string(),cursor_version:Je.string(),workspace_roots:Je.array(Je.string()),user_email:Je.string().nullable()}),h9e=JAe.extend({file_path:Je.string(),edits:Je.array(Je.object({old_string:Je.string(),new_string:Je.string()}))}),A9e=JAe.extend({status:Je.enum(["completed","aborted","error"]),loop_count:Je.number()}),QAe={afterFileEdit:h9e,stop:A9e},eme=Je.object({metadata:Je.object({conversation_id:Je.string(),generation_id:Je.string(),model:Je.string(),cursor_version:Je.string(),workspace_roots:Je.array(Je.string()),user_email:Je.string().nullable()}),files:Je.record(Je.string(),Je.object({old_string:Je.string(),new_string:Je.string(),last_updated:Je.string()}))});var pR=class{_storage=null;_conversationId=null;async get(){if(!this._storage||!this._conversationId)throw new Error("get() called outside of event handling context");let e=await this._storage.load(this._conversationId);return e?this.dataSchema.parse(e):null}async save(e){if(!this._storage||!this._conversationId)throw new Error("save() called outside of event handling context");this.dataSchema.parse(e),await this._storage.save(this._conversationId,e)}async clear(){if(!this._storage||!this._conversationId)throw new Error("clear() called outside of event handling context");await this._storage.clear(this._conversationId)}_setContext(e,r){this._storage=e,this._conversationId=r}_clearContext(){this._storage=null,this._conversationId=null}getHookCommand(e){return process.env.NODE_ENV==="production"?`npx --silent --yes @wispbit/local@latest handle-hooks ${this.provider}.${e}`:`pnpm --silent --filter @wispbit/local cli handle-hooks ${this.provider}.${e} --debug`}};var kc=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async getRepositoryUrl(){let e=await this.environment.getRepositoryUrl();if(!e)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return e}async loadRuleById(e){let n=(await this.fetchRules()).filter(i=>new RegExp(e).test(i.id));if(n.length===0)throw new Error(`Rule with ID '${e}' not found`);return n[0]}async loadAllRules(){return await this.fetchRules()}async fetchRules(e){let r=await this.getRepositoryUrl(),i=await this.config.getApiClient().getRules({repository_url:r,rule_ids:e,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion()});if("error"in i)throw new Error(i.error);return i.rules.map(o=>({id:o.id,internalId:o.internalId,internalVersionId:o.internalVersionId,message:o.message,severity:o.severity,execution:o.execution||"llm",steps:o.schema,prompt:o.prompt,collectionName:o.collectionName,testCases:[]}))}};import{EventEmitter as m9e}from"events";var Wn=class extends m9e{rulesStartTime=0;indexingStartTimes=new Map;fileDiscoveryStartTime=0;constructor(){super(),this.setMaxListeners(20)}emit(e,r){return super.emit(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}off(e,r){return super.off(e,r)}setExecutionMode(e,r){this.emit("execution:mode",{mode:e,...r})}startRules(e){this.rulesStartTime=Date.now(),this.emit("rules:start",{totalRules:e})}progressRule(e,r,n,i){let o=Math.round(e/r*100);this.emit("rules:progress",{currentRule:e,totalRules:r,ruleId:n,percentage:o,isLlm:i})}errorRule(e,r,n,i){this.emit("rules:rule-error",{ruleId:e,error:r,message:n,severity:i})}completeRules(e,r){let n=Date.now()-this.rulesStartTime;this.emit("rules:complete",{totalRules:e,totalMatches:r,executionTime:n})}startFileDiscovery(e){this.fileDiscoveryStartTime=Date.now(),this.emit("files:discovery:start",{mode:e})}fileDiscoveryProgress(e,r){this.emit("files:discovery:progress",{message:e,currentCount:r})}completeFileDiscovery(e,r,n,i,o){let s=Date.now()-this.fileDiscoveryStartTime,a;(r==="diff"||r==="custom-diff")&&n&&(a={totalAdditions:0,totalDeletions:0,files:e.map(c=>{let u=n.get(c),_=u?.additions||0,E=u?.deletions||0;return{path:c,additions:_,deletions:E}})},a.totalAdditions=a.files.reduce((c,u)=>c+u.additions,0),a.totalDeletions=a.files.reduce((c,u)=>c+u.deletions,0)),this.emit("files:discovery:complete",{totalFiles:e.length,mode:r,executionTime:s,stats:a,ignoredFiles:i,deletedFiles:o})}fileFilter(e,r,n){this.emit("files:filter",{originalCount:e,filteredCount:r,filterType:n})}startScipMatchLookup(e,r){this.emit("scip:match-lookup:start",{language:e,match:r})}scipMatchLookupProgress(e,r){this.emit("scip:match-lookup:progress",{language:e,document:r})}scipMatchLookupComplete(e,r){this.emit("scip:match-lookup:complete",{language:e,document:r})}startIndexing(e){this.indexingStartTimes.set(e,Date.now()),this.emit("indexing:start",{language:e})}indexingProgress(e,r,n,i){this.emit("indexing:progress",{language:e,message:r,packageName:n,timeMs:i})}completeIndexing(e){let r=this.indexingStartTimes.get(e)||Date.now(),n=Date.now()-r;this.indexingStartTimes.delete(e),this.emit("indexing:complete",{language:e,executionTime:n})}startStep(e,r,n,i,o){this.emit("step:start",{ruleId:e,stepName:r,stepType:n,inputs:i,parentStepName:o})}completeStep(e,r,n,i,o=0,s){this.emit("step:complete",{ruleId:e,stepName:r,stepType:n,outputs:i,executionTime:o,parentStepName:s})}startTest(e,r){this.emit("test:start",{ruleId:e,testName:r})}testMatches(e,r,n){this.emit("test:matches",{ruleId:e,testName:r,matches:n})}completeTest(e,r,n,i){this.emit("test:complete",{ruleId:e,testName:r,matches:n,stepExecutions:i})}startLLMValidation(e,r,n){this.emit("llm:validation:start",{ruleId:e,matchCount:r,estimatedCost:n})}llmValidationProgress(e,r,n,i){this.emit("llm:validation:progress",{ruleId:e,tokenCount:r,elapsedTime:n,streamedText:i})}completeLLMValidation(e,r,n,i,o,s,a,c){this.emit("llm:validation:complete",{ruleId:e,tokenCount:r,inputTokens:n,outputTokens:i,cost:o,executionTime:s,violationCount:a,fromCache:c})}llmToolExecution(e,r,n){this.emit("llm:tool-execution",{ruleId:e,toolName:r,...n})}startLLMSearchPhase(e,r){this.emit("llm:search-phase:start",{ruleId:e,matchCount:r})}startLLMValidationPhase(e,r){this.emit("llm:validation-phase:start",{ruleId:e,matchCount:r})}llmValidationPhaseBatch(e,r,n,i,o,s){this.emit("llm:validation-phase:batch",{ruleId:e,currentBatch:r,totalBatches:n,batchSize:i,remainingMatches:o,totalMatches:s})}llmMaxIterationsReached(e,r,n,i){this.emit("llm:max-iterations-reached",{ruleId:e,maxIterations:r,messages:n,results:i})}};import{cpus as ZXe}from"os";var vme=ne(hR(),1);import v9e from"path";import{existsSync as P9e}from"fs";import Aa from"path";import{fileURLToPath as D9e}from"url";var L9e=D9e(import.meta.url),g_=Aa.dirname(L9e);function Oe(t){let e=process.platform,r=process.arch,n=`${t}-${e}-${r}-parser.so`,i=[Aa.join(g_,"../../dist/vendor/languages"),Aa.join(g_,"../dist/vendor/languages"),Aa.join(g_,"powerlint/dist/vendor/languages"),Aa.join(g_,"./vendor/languages"),Aa.join(g_,"../vendor/languages"),Aa.join(g_,"../../vendor/languages")];for(let o of i){let s=Aa.join(o,n);if(P9e(s))return s}throw new Error(`Prebuild not found for ${t} on ${e} ${r}. Expected file: ${n}. Paths tried: ${i.join(", ")}`)}var tme={libraryPath:Oe("graphql"),extensions:["graphql","gql"],languageSymbol:"tree_sitter_graphql",expandoChar:"$"};var rme={libraryPath:Oe("angular"),extensions:["html"],languageSymbol:"tree_sitter_angular",expandoChar:"z"};var nme={libraryPath:Oe("bash"),extensions:["bash","bats","cgi","command","env","fcgi","ksh","sh","tmux","tool","zsh"],languageSymbol:"tree_sitter_bash",expandoChar:"$"};var ime={libraryPath:Oe("c"),extensions:["c","h"],languageSymbol:"tree_sitter_c",expandoChar:"_"};var ome={libraryPath:Oe("cpp"),extensions:["cc","hpp","cpp","hh","cxx","cu","ino"],languageSymbol:"tree_sitter_cpp",expandoChar:"_"};var sme={libraryPath:Oe("csharp"),extensions:["cs"],languageSymbol:"tree_sitter_c_sharp",expandoChar:"\xB5"};var ame={libraryPath:Oe("css"),extensions:["css","scss","vue"],languageSymbol:"tree_sitter_css",expandoChar:"$"};var cme={libraryPath:Oe("dart"),extensions:["dart"],languageSymbol:"tree_sitter_dart",expandoChar:"$"};var ume={libraryPath:Oe("elixir"),extensions:["ex","exs"],languageSymbol:"tree_sitter_elixir",expandoChar:"\xB5"};var lme={libraryPath:Oe("go"),extensions:["go"],languageSymbol:"tree_sitter_go",expandoChar:"\xB5"};var _me={libraryPath:Oe("haskell"),extensions:["hs"],languageSymbol:"tree_sitter_haskell",expandoChar:"\xB5"};var Eme={libraryPath:Oe("html"),extensions:["html","htm","xhtml","vue"],languageSymbol:"tree_sitter_html",expandoChar:"z"};var Tme={libraryPath:Oe("java"),extensions:["java"],languageSymbol:"tree_sitter_java",expandoChar:"$"};var fme={libraryPath:Oe("javascript"),extensions:["cjs","js","mjs","jsx"],languageSymbol:"tree_sitter_javascript",expandoChar:"$"};var Sme={libraryPath:Oe("json"),extensions:["json"],languageSymbol:"tree_sitter_json",expandoChar:"$"};var pme={libraryPath:Oe("kotlin"),extensions:["kt","ktm","kts"],languageSymbol:"tree_sitter_kotlin",expandoChar:"\xB5"};var dme={libraryPath:Oe("lua"),extensions:["lua"],languageSymbol:"tree_sitter_lua",expandoChar:"$"};var hme={libraryPath:Oe("markdown"),extensions:["md"],languageSymbol:"tree_sitter_markdown",expandoChar:"$"};var Ame={libraryPath:Oe("php"),extensions:["php"],languageSymbol:"tree_sitter_php",expandoChar:"$"};var mme={libraryPath:Oe("python"),extensions:["py"],languageSymbol:"tree_sitter_python",expandoChar:"\xB5"};var gme={libraryPath:Oe("ruby"),extensions:["rb","rbw","gemspec"],languageSymbol:"tree_sitter_ruby",expandoChar:"\xB5"};var Rme={libraryPath:Oe("rust"),extensions:["rs"],languageSymbol:"tree_sitter_rust",expandoChar:"\xB5"};var Ome={libraryPath:Oe("scala"),extensions:["scala","sc","sbt"],languageSymbol:"tree_sitter_scala",expandoChar:"$"};var Nme={libraryPath:Oe("sql"),extensions:["sql"],languageSymbol:"tree_sitter_sql",expandoChar:"_"};var Cme={libraryPath:Oe("swift"),extensions:["swift"],languageSymbol:"tree_sitter_swift",expandoChar:"\xB5"};var Ime={libraryPath:Oe("toml"),extensions:["toml"],languageSymbol:"tree_sitter_toml",expandoChar:"_"};var Mme={libraryPath:Oe("tsx"),extensions:["tsx"],languageSymbol:"tree_sitter_tsx",expandoChar:"$"};var Pme={libraryPath:Oe("typescript"),extensions:["ts","cts","mts","vue"],languageSymbol:"tree_sitter_typescript",expandoChar:"$"};var Dme={libraryPath:Oe("yaml"),extensions:["yaml","yml"],languageSymbol:"tree_sitter_yaml",expandoChar:"$"};console.debug=()=>{};var m0=[{extension:"vue",hostLanguage:"Html",language:"Html",rule:{pattern:"<template>$$$</template>"},contentNodeKinds:["element","text"]},{extension:"vue",hostLanguage:"Html",language:"TypeScript",rule:{kind:"script_element",regex:'lang="ts"'},contentNodeKinds:["raw_text"]},{extension:"vue",hostLanguage:"Html",language:"JavaScript",rule:{kind:"script_element",not:{regex:"lang="}},contentNodeKinds:["raw_text"]},{extension:"vue",hostLanguage:"Html",language:"Css",rule:{kind:"style_element"},contentNodeKinds:["raw_text"]},{extension:"md",hostLanguage:"Markdown",language:"TypeScript",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(typescript|ts)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"JavaScript",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(javascript|js)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Python",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(python|py)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Go",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(go|golang)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Rust",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(rust|rs)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Java",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^java$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"C",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^c$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Cpp",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(cpp|c\\+\\+|cxx)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Csharp",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(csharp|cs|c#)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Ruby",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(ruby|rb)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Php",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^php$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Swift",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^swift$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Kotlin",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(kotlin|kt)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Scala",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^scala$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Dart",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^dart$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Elixir",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(elixir|ex)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Haskell",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(haskell|hs)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Lua",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^lua$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Bash",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(bash|sh|shell)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Sql",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^sql$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Html",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^html$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Css",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(css|scss)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Json",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^json$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Yaml",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(yaml|yml)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Toml",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^toml$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Tsx",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^tsx$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Angular",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^angular$"}},contentNodeKinds:["code_fence_content"]}],y9e=new Set(["vue","md"]),yme={Angular:rme,Bash:nme,C:ime,Cpp:ome,Csharp:sme,Css:ame,Dart:cme,Elixir:ume,Go:lme,Haskell:_me,Html:Eme,Java:Tme,JavaScript:fme,Json:Sme,Kotlin:pme,Lua:dme,Markdown:hme,Php:Ame,Python:mme,Ruby:gme,Rust:Rme,Scala:Ome,Sql:Nme,Swift:Cme,Toml:Ime,Tsx:Mme,TypeScript:Pme,Yaml:Dme,GraphQL:tme};(0,vme.registerDynamicLanguage)(yme);var Lme=Object.entries(yme).reduce((t,[e,r])=>(t[e]=r.extensions??[],t),{});function ma(t){let e=v9e.extname(t).slice(1),r=b9e(e);return r.length>0?r:["Unknown"]}function b9e(t){return Object.keys(Lme).filter(e=>Lme[e].includes(t))}function g0(t){return y9e.has(t)}function AR(t,e){if(g0(e))return m0.find(r=>r.extension===e&&r.language===t)}import*as Ni from"fs";import*as Et from"path";var Qme=ne(jme(),1);var uS=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var F9e={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},lS=t=>t.replace(/[[\]\\-]/g,"\\$&"),k9e=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Kme=t=>t.join(""),Wme=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],o=r+1,s=!1,a=!1,c=!1,u=!1,_=r,E="";e:for(;o<t.length;){let d=t.charAt(o);if((d==="!"||d==="^")&&o===r+1){u=!0,o++;continue}if(d==="]"&&s&&!c){_=o+1;break}if(s=!0,d==="\\"&&!c){c=!0,o++;continue}if(d==="["&&!c){for(let[p,[g,N,O]]of Object.entries(F9e))if(t.startsWith(p,o)){if(E)return["$.",!1,t.length-r,!0];o+=p.length,O?i.push(g):n.push(g),a=a||N;continue e}}if(c=!1,E){d>E?n.push(lS(E)+"-"+lS(d)):d===E&&n.push(lS(d)),E="",o++;continue}if(t.startsWith("-]",o+1)){n.push(lS(d+"-")),o+=2;continue}if(t.startsWith("-",o+1)){E=d,o+=2;continue}n.push(lS(d)),o++}if(_<o)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let d=n[0].length===2?n[0].slice(-1):n[0];return[k9e(d),!1,_-r,!1]}let T="["+(u?"^":"")+Kme(n)+"]",f="["+(u?"":"^")+Kme(i)+"]";return[n.length&&i.length?"("+T+"|"+f+")":n.length?T:f,a,_-r,!0]};var mi=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Y9e=new Set(["!","?","+","*","@"]),zme=t=>Y9e.has(t),H9e="(?!(?:^|/)\\.\\.?(?:$|/))",mR="(?!\\.)",j9e=new Set(["[","."]),K9e=new Set(["..","."]),W9e=new Set("().*{}+?[]^$\\!"),z9e=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),N0="[^/]",qme=N0+"*?",Zme=N0+"+?",R_=class t{type;#t;#r;#e=!1;#o=[];#l;#E;#a;#u=!1;#i;#n;#s=!1;constructor(e,r,n={}){this.type=e,e&&(this.#r=!0),this.#l=r,this.#t=this.#l?this.#l.#t:this,this.#i=this.#t===this?n:this.#t.#i,this.#a=this.#t===this?[]:this.#t.#a,e==="!"&&!this.#t.#u&&this.#a.push(this),this.#E=this.#l?this.#l.#o.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#o)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#n!==void 0?this.#n:this.type?this.#n=this.type+"("+this.#o.map(e=>String(e)).join("|")+")":this.#n=this.#o.map(e=>String(e)).join("")}#f(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,n=r.#l;for(;n;){for(let i=r.#E+1;!n.type&&i<n.#o.length;i++)for(let o of e.#o){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(n.#o[i])}r=n,n=r.#l}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#l===this))throw new Error("invalid part: "+r);this.#o.push(r)}}toJSON(){let e=this.type===null?this.#o.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#o.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#l?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#l?.isStart())return!1;if(this.#E===0)return!0;let e=this.#l;for(let r=0;r<this.#E;r++){let n=e.#o[r];if(!(n instanceof t&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#l?.type==="!")return!0;if(!this.#l?.isEnd())return!1;if(!this.type)return this.#l?.isEnd();let e=this.#l?this.#l.#o.length:0;return this.#E===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let n of this.#o)r.copyIn(n);return r}static#T(e,r,n,i){let o=!1,s=!1,a=-1,c=!1;if(r.type===null){let f=n,S="";for(;f<e.length;){let d=e.charAt(f++);if(o||d==="\\"){o=!o,S+=d;continue}if(s){f===a+1?(d==="^"||d==="!")&&(c=!0):d==="]"&&!(f===a+2&&c)&&(s=!1),S+=d;continue}else if(d==="["){s=!0,a=f,c=!1,S+=d;continue}if(!i.noext&&zme(d)&&e.charAt(f)==="("){r.push(S),S="";let p=new t(d,r);f=t.#T(e,p,f,i),r.push(p);continue}S+=d}return r.push(S),f}let u=n+1,_=new t(null,r),E=[],T="";for(;u<e.length;){let f=e.charAt(u++);if(o||f==="\\"){o=!o,T+=f;continue}if(s){u===a+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(u===a+2&&c)&&(s=!1),T+=f;continue}else if(f==="["){s=!0,a=u,c=!1,T+=f;continue}if(zme(f)&&e.charAt(u)==="("){_.push(T),T="";let S=new t(f,_);_.push(S),u=t.#T(e,S,u,i);continue}if(f==="|"){_.push(T),T="",E.push(_),_=new t(null,r);continue}if(f===")")return T===""&&r.#o.length===0&&(r.#s=!0),_.push(T),T="",r.push(...E,_),u;T+=f}return r.type=null,r.#r=void 0,r.#o=[e.substring(n-1)],u}static fromGlob(e,r={}){let n=new t(null,void 0,r);return t.#T(e,n,0,r),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,n,i,o]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#i.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#i}toRegExpSource(e){let r=e??!!this.#i.dot;if(this.#t===this&&this.#f(),!this.type){let c=this.isStart()&&this.isEnd(),u=this.#o.map(f=>{let[S,d,p,g]=typeof f=="string"?t.#p(f,this.#r,c):f.toRegExpSource(e);return this.#r=this.#r||p,this.#e=this.#e||g,S}).join(""),_="";if(this.isStart()&&typeof this.#o[0]=="string"&&!(this.#o.length===1&&K9e.has(this.#o[0]))){let S=j9e,d=r&&S.has(u.charAt(0))||u.startsWith("\\.")&&S.has(u.charAt(2))||u.startsWith("\\.\\.")&&S.has(u.charAt(4)),p=!r&&!e&&S.has(u.charAt(0));_=d?H9e:p?mR:""}let E="";return this.isEnd()&&this.#t.#u&&this.#l?.type==="!"&&(E="(?:$|\\/)"),[_+u+E,mi(u),this.#r=!!this.#r,this.#e]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",o=this.#_(r);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let c=this.toString();return this.#o=[c],this.type=null,this.#r=void 0,[c,mi(this.toString()),!1,!1]}let s=!n||e||r||!mR?"":this.#_(!0);s===o&&(s=""),s&&(o=`(?:${o})(?:${s})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!r?mR:"")+Zme;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?mR:"")+qme+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;a=i+o+c}return[a,mi(o),this.#r=!!this.#r,this.#e]}#_(e){return this.#o.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,o,s]=r.toRegExpSource(e);return this.#e=this.#e||s,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#p(e,r,n=!1){let i=!1,o="",s=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,o+=(W9e.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?o+="\\\\":i=!0;continue}if(c==="["){let[u,_,E,T]=Wme(e,a);if(E){o+=u,s=s||_,a+=E-1,r=r||T;continue}}if(c==="*"){n&&e==="*"?o+=Zme:o+=qme,r=!0;continue}if(c==="?"){o+=N0,r=!0;continue}o+=z9e(c)}return[o,mi(e),!!r,s]}};var O_=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var Wr=(t,e,r={})=>(uS(e),!r.nocomment&&e.charAt(0)==="#"?!1:new mn(e,r).match(t)),q9e=/^\*+([^+@!?\*\[\(]*)$/,Z9e=t=>e=>!e.startsWith(".")&&e.endsWith(t),X9e=t=>e=>e.endsWith(t),J9e=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),Q9e=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),eZe=/^\*+\.\*+$/,tZe=t=>!t.startsWith(".")&&t.includes("."),rZe=t=>t!=="."&&t!==".."&&t.includes("."),nZe=/^\.\*+$/,iZe=t=>t!=="."&&t!==".."&&t.startsWith("."),oZe=/^\*+$/,sZe=t=>t.length!==0&&!t.startsWith("."),aZe=t=>t.length!==0&&t!=="."&&t!=="..",cZe=/^\?+([^+@!?\*\[\(]*)?$/,uZe=([t,e=""])=>{let r=ege([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},lZe=([t,e=""])=>{let r=tge([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},_Ze=([t,e=""])=>{let r=tge([t]);return e?n=>r(n)&&n.endsWith(e):r},EZe=([t,e=""])=>{let r=ege([t]);return e?n=>r(n)&&n.endsWith(e):r},ege=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},tge=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},rge=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Xme={win32:{sep:"\\"},posix:{sep:"/"}},TZe=rge==="win32"?Xme.win32.sep:Xme.posix.sep;Wr.sep=TZe;var ur=Symbol("globstar **");Wr.GLOBSTAR=ur;var fZe="[^/]",SZe=fZe+"*?",pZe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",dZe="(?:(?!(?:\\/|^)\\.).)*?",hZe=(t,e={})=>r=>Wr(r,t,e);Wr.filter=hZe;var zn=(t,e={})=>Object.assign({},t,e),AZe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Wr;let e=Wr;return Object.assign((n,i,o={})=>e(n,i,zn(t,o)),{Minimatch:class extends e.Minimatch{constructor(i,o={}){super(i,zn(t,o))}static defaults(i){return e.defaults(zn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,o,s={}){super(i,o,zn(t,s))}static fromGlob(i,o={}){return e.AST.fromGlob(i,zn(t,o))}},unescape:(n,i={})=>e.unescape(n,zn(t,i)),escape:(n,i={})=>e.escape(n,zn(t,i)),filter:(n,i={})=>e.filter(n,zn(t,i)),defaults:n=>e.defaults(zn(t,n)),makeRe:(n,i={})=>e.makeRe(n,zn(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,zn(t,i)),match:(n,i,o={})=>e.match(n,i,zn(t,o)),sep:e.sep,GLOBSTAR:ur})};Wr.defaults=AZe;var nge=(t,e={})=>(uS(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Qme.default)(t));Wr.braceExpand=nge;var mZe=(t,e={})=>new mn(t,e).makeRe();Wr.makeRe=mZe;var gZe=(t,e,r={})=>{let n=new mn(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};Wr.match=gZe;var Jme=/[?*]|[+@!]\(.*?\)|\[|\]/,RZe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){uS(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||rge,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((o,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=o[0]===""&&o[1]===""&&(o[2]==="?"||!Jme.test(o[2]))&&!Jme.test(o[3]),u=/^[a-z]:/i.test(o[0]);if(c)return[...o.slice(0,4),...o.slice(4).map(_=>this.parse(_))];if(u)return[o[0],...o.slice(1).map(_=>this.parse(_))]}return o.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){let s=this.set[o];s[0]===""&&s[1]===""&&this.globParts[o][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let o=n[n.length-1];return i==="**"&&o==="**"?n:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let o=e[i];i===1&&o===""&&e[0]===""||(o==="."||o==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let s=i;for(;n[s+1]==="**";)s++;s>i&&n.splice(i+1,s-i);let a=n[i+1],c=n[i+2],u=n[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);let _=n.slice(0);_[i]="**",e.push(_),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<n.length-1;s++){let a=n[s];s===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(s,1),s--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let o=0;for(;(o=n.indexOf("..",o+1))!==-1;){let s=n[o-1];if(s&&s!=="."&&s!==".."&&s!=="**"){r=!0;let c=o===1&&n[o+1]==="**"?["."]:[];n.splice(o-1,2,...c),n.length===0&&n.push(""),o-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,o=0,s=[],a="";for(;i<e.length&&o<r.length;)if(e[i]===r[o])s.push(a==="b"?r[o]:e[i]),i++,o++;else if(n&&e[i]==="**"&&r[o]===e[i+1])s.push(e[i]),i++;else if(n&&r[o]==="**"&&e[i]===r[o+1])s.push(r[o]),o++;else if(e[i]==="*"&&r[o]&&(this.options.dot||!r[o].startsWith("."))&&r[o]!=="**"){if(a==="b")return!1;a="a",s.push(e[i]),i++,o++}else if(r[o]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",s.push(r[o]),i++,o++}else return!1;return e.length===r.length&&s}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=this.options;if(this.isWindows){let d=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),p=!d&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),g=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),N=!g&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),O=p?3:d?0:void 0,C=N?3:g?0:void 0;if(typeof O=="number"&&typeof C=="number"){let[v,x]=[e[O],r[C]];v.toLowerCase()===x.toLowerCase()&&(r[C]=v,C>O?r=r.slice(C):O>C&&(e=e.slice(O)))}}let{optimizationLevel:o=1}=this.options;o>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var s=0,a=0,c=e.length,u=r.length;s<c&&a<u;s++,a++){this.debug("matchOne loop");var _=r[a],E=e[s];if(this.debug(r,_,E),_===!1)return!1;if(_===ur){this.debug("GLOBSTAR",[r,_,E]);var T=s,f=a+1;if(f===u){for(this.debug("** at the end");s<c;s++)if(e[s]==="."||e[s]===".."||!i.dot&&e[s].charAt(0)===".")return!1;return!0}for(;T<c;){var S=e[T];if(this.debug(`
|
|
107
|
+
`),oe=0,Q=0;for(let Se of ae)Se.startsWith("+")&&!Se.startsWith("+++")?oe++:Se.startsWith("-")&&!Se.startsWith("---")&&Q++;x.set(V.path,{additions:oe,deletions:Q})}let j=[],z=new Map;for(let V of S){let W=O.get(V.path)||"",ae=x.get(V.path)||{additions:0,deletions:0},oe=D5e(V,d),Q={filename:V.path,status:oe,patch:W,additions:ae.additions,deletions:ae.deletions,sha:Fc(W)};V.oldPath&&(Q.oldFilename=V.oldPath),V.baseline&&z.set(V.path,V.baseline),j.push(Q)}for(let V of j)if(V.status==="modified"){let W=V.oldFilename||V.filename,ae=z.get(V.filename)||c,{stdout:oe}=await ot(`git show ${Cr(ae)}:${Cr(W)}`,{cwd:t,maxBuffer:50*1024*1024});oe&&(V.baseContent=oe)}return{files:j,currentBranch:o,currentCommit:a,diffBranch:u,diffCommit:c}}var Ko=class{workspaceRoot;repositoryUrl;constructor(e){this.repositoryUrl=e?.repositoryUrl||null,this.workspaceRoot=e?.workspaceRoot||sAe()}getWorkspaceRoot(){return this.workspaceRoot}async getRepositoryUrl(e="origin"){if(this.repositoryUrl)return this.repositoryUrl;let r=await cAe(this.workspaceRoot,e);if(!r)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return r}async getCurrentCommit(){return await TAe(this.workspaceRoot)}};import*as Ir from"fs/promises";import d9e from"os";import m_ from"path";import{Buffer as SAe}from"buffer";var cR=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(SAe.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",n=Array.isArray(t);r=n?"[":"{";let i=!0;for(let o in t){let s=typeof t[o]=="function"||!n&&t[o]===void 0;!Object.hasOwn(t,o)||s||(i||(r+=","),i=!1,n?r+=cR(t[o],e):t[o]!==void 0&&(r+=`${cR(o,!1)}:${cR(t[o],e)}`))}return r+=n?"]":"}",r}return JSON.stringify(t)},S0=t=>cR(t,!0),p0=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?SAe.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r);var L5e=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map,this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(t,e){this.on(t,e)}on(t,e){this._eventListeners.has(t)||this._eventListeners.set(t,[]);let r=this._eventListeners.get(t);return r&&(r.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${r.length+1} ${t} listeners added. Use setMaxListeners() to increase limit.`),r.push(e)),this}removeListener(t,e){this.off(t,e)}off(t,e){let r=this._eventListeners.get(t)??[],n=r.indexOf(e);n!==-1&&r.splice(n,1),r.length===0&&this._eventListeners.delete(t)}once(t,e){let r=(...n)=>{e(...n),this.off(t,r)};this.on(t,r)}emit(t,...e){let r=this._eventListeners.get(t);if(r&&r.length>0)for(let n of r)n(...e)}listeners(t){return this._eventListeners.get(t)??[]}removeAllListeners(t){t?this._eventListeners.delete(t):this._eventListeners.clear()}setMaxListeners(t){this._maxListeners=t}},d0=L5e,v5e=class extends d0{_hookHandlers;constructor(){super(),this._hookHandlers=new Map}addHandler(t,e){let r=this._hookHandlers.get(t);r?r.push(e):this._hookHandlers.set(t,[e])}removeHandler(t,e){let r=this._hookHandlers.get(t);if(r){let n=r.indexOf(e);n!==-1&&r.splice(n,1)}}trigger(t,e){let r=this._hookHandlers.get(t);if(r)for(let n of r)try{n(e)}catch(i){this.emit("error",new Error(`Error in hook handler for event "${t}": ${i.message}`))}}get handlers(){return new Map(this._hookHandlers)}},y5e=v5e,b5e=class extends d0{enabled=!0;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(t){super(),t!==void 0&&(this.enabled=t),this.reset()}hit(){this.enabled&&this.hits++}miss(){this.enabled&&this.misses++}set(){this.enabled&&this.sets++}delete(){this.enabled&&this.deletes++}hitsOrMisses(t){for(let e of t)e===void 0?this.miss():this.hit()}reset(){this.hits=0,this.misses=0,this.sets=0,this.deletes=0,this.errors=0}},U5e=b5e;var pAe=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"],x5e=class extends d0{opts;iterator;hooks=new y5e;stats=new U5e(!1);_ttl;_namespace;_store=new Map;_serialize=S0;_deserialize=p0;_compression;_useKeyPrefix=!0;_throwOnErrors=!1;constructor(t,e){if(super(),e??={},t??={},this.opts={namespace:"keyv",serialize:S0,deserialize:p0,emitErrors:!0,store:new Map,...e},t&&t.get?this.opts.store=t:this.opts={...this.opts,...t},this._store=this.opts.store??new Map,this._compression=this.opts.compression,this._serialize=this.opts.serialize,this._deserialize=this.opts.deserialize,this.opts.namespace&&(this._namespace=this.opts.namespace),this._store){if(!this._isValidStorageAdapter(this._store))throw new Error("Invalid storage adapter");typeof this._store.on=="function"&&this._store.on("error",r=>this.emit("error",r)),this._store.namespace=this._namespace,typeof this._store[Symbol.iterator]=="function"&&this._store instanceof Map?this.iterator=this.generateIterator(this._store):"iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(this._store.iterator.bind(this._store)))}this.opts.stats&&(this.stats.enabled=this.opts.stats),this.opts.ttl&&(this._ttl=this.opts.ttl),this.opts.useKeyPrefix!==void 0&&(this._useKeyPrefix=this.opts.useKeyPrefix),this.opts.throwOnErrors!==void 0&&(this._throwOnErrors=this.opts.throwOnErrors)}get store(){return this._store}set store(t){if(this._isValidStorageAdapter(t))this._store=t,this.opts.store=t,typeof t.on=="function"&&t.on("error",e=>this.emit("error",e)),this._namespace&&(this._store.namespace=this._namespace),typeof t[Symbol.iterator]=="function"&&t instanceof Map?this.iterator=this.generateIterator(t):"iterator"in t&&t.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(t.iterator?.bind(t)));else throw new Error("Invalid storage adapter")}get compression(){return this._compression}set compression(t){this._compression=t}get namespace(){return this._namespace}set namespace(t){this._namespace=t,this.opts.namespace=t,this._store.namespace=t,this.opts.store&&(this.opts.store.namespace=t)}get ttl(){return this._ttl}set ttl(t){this.opts.ttl=t,this._ttl=t}get serialize(){return this._serialize}set serialize(t){this.opts.serialize=t,this._serialize=t}get deserialize(){return this._deserialize}set deserialize(t){this.opts.deserialize=t,this._deserialize=t}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(t){this._useKeyPrefix=t,this.opts.useKeyPrefix=t}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(t){this._throwOnErrors=t,this.opts.throwOnErrors=t}generateIterator(t){return async function*(){for await(let[r,n]of typeof t=="function"?t(this._store.namespace):t){let i=await this.deserializeData(n);if(!(this._useKeyPrefix&&this._store.namespace&&!r.includes(this._store.namespace))){if(typeof i.expires=="number"&&Date.now()>i.expires){this.delete(r);continue}yield[this._getKeyUnprefix(r),i.value]}}}.bind(this)}_checkIterableAdapter(){return pAe.includes(this._store.opts.dialect)||pAe.some(t=>this._store.opts.url.includes(t))}_getKeyPrefix(t){return!this._useKeyPrefix||!this._namespace?t:`${this._namespace}:${t}`}_getKeyPrefixArray(t){return!this._useKeyPrefix||!this._namespace?t:t.map(e=>`${this._namespace}:${e}`)}_getKeyUnprefix(t){return this._useKeyPrefix?t.split(":").splice(1).join(":"):t}_isValidStorageAdapter(t){return t instanceof Map||typeof t.get=="function"&&typeof t.set=="function"&&typeof t.delete=="function"&&typeof t.clear=="function"}async get(t,e){let{store:r}=this.opts,n=Array.isArray(t),i=n?this._getKeyPrefixArray(t):this._getKeyPrefix(t),o=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(n)return e?.raw===!0?this.getMany(t,{raw:!0}):this.getMany(t,{raw:!1});this.hooks.trigger("preGet",{key:i});let s;try{s=await r.get(i)}catch(c){if(this.throwOnErrors)throw c}let a=typeof s=="string"||this.opts.compression?await this.deserializeData(s):s;if(a==null){this.stats.miss();return}if(o(a)){await this.delete(t),this.stats.miss();return}return this.hooks.trigger("postGet",{key:i,value:a}),this.stats.hit(),e?.raw?a:a.value}async getMany(t,e){let{store:r}=this.opts,n=this._getKeyPrefixArray(t),i=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(this.hooks.trigger("preGetMany",{keys:n}),r.getMany===void 0){let c=n.map(async E=>{let T=await r.get(E),f=typeof T=="string"||this.opts.compression?await this.deserializeData(T):T;if(f!=null){if(i(f)){await this.delete(E);return}return e?.raw?f:f.value}}),_=(await Promise.allSettled(c)).map(E=>E.value);return this.hooks.trigger("postGetMany",_),_.length>0&&this.stats.hit(),_}let o=await r.getMany(n),s=[],a=[];for(let c in o){let u=o[c];if(typeof u=="string"&&(u=await this.deserializeData(u)),u==null){s.push(void 0);continue}if(i(u)){a.push(t[c]),s.push(void 0);continue}let _=e?.raw?u:u.value;s.push(_)}return a.length>0&&await this.deleteMany(a),this.hooks.trigger("postGetMany",s),s.length>0&&this.stats.hit(),s}async getRaw(t){let{store:e}=this.opts,r=this._getKeyPrefix(t);this.hooks.trigger("preGetRaw",{key:r});let n=await e.get(r);if(n==null){this.stats.miss();return}let i=typeof n=="string"||this.opts.compression?await this.deserializeData(n):n;if(i!==void 0&&i.expires!==void 0&&i.expires!==null&&i.expires<Date.now()){this.stats.miss(),await this.delete(t);return}return this.stats.hit(),this.hooks.trigger("postGetRaw",{key:r,value:i}),i}async getManyRaw(t){let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(t.length===0){let s=Array.from({length:t.length}).fill(void 0);return this.stats.misses+=t.length,this.hooks.trigger("postGetManyRaw",{keys:r,values:s}),s}let n=[];if(e.getMany===void 0){let s=r.map(async c=>{let u=await e.get(c);if(u!=null)return this.deserializeData(u)});n=(await Promise.allSettled(s)).map(c=>c.value)}else{let s=await e.getMany(r);for(let a of s)a!=null?n.push(await this.deserializeData(a)):n.push(void 0)}let i=[],o=s=>typeof s.expires=="number"&&Date.now()>s.expires;for(let[s,a]of n.entries())a!==void 0&&o(a)&&(i.push(r[s]),n[s]=void 0);return i.length>0&&await this.deleteMany(i),this.stats.hitsOrMisses(n),this.hooks.trigger("postGetManyRaw",{keys:r,values:n}),n}async set(t,e,r){let n={key:t,value:e,ttl:r};this.hooks.trigger("preSet",n);let i=this._getKeyPrefix(n.key);n.ttl??=this._ttl,n.ttl===0&&(n.ttl=void 0);let{store:o}=this.opts,s=typeof n.ttl=="number"?Date.now()+n.ttl:void 0;if(typeof n.value=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let a={value:n.value,expires:s},c=await this.serializeData(a),u=!0;try{let _=await o.set(i,c,n.ttl);typeof _=="boolean"&&(u=_)}catch(_){if(u=!1,this.emit("error",_),this._throwOnErrors)throw _}return this.hooks.trigger("postSet",{key:i,value:c,ttl:r}),this.stats.set(),u}async setMany(t){let e=[];try{if(this._store.setMany===void 0){let r=[];for(let i of t)r.push(this.set(i.key,i.value,i.ttl));e=await Promise.all(r)}else{let r=await Promise.all(t.map(async({key:n,value:i,ttl:o})=>{o??=this._ttl,o===0&&(o=void 0);let s=typeof o=="number"?Date.now()+o:void 0;if(typeof i=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let a={value:i,expires:s},c=await this.serializeData(a);return{key:this._getKeyPrefix(n),value:c,ttl:o}}));e=await this._store.setMany(r)}}catch(r){if(this.emit("error",r),this._throwOnErrors)throw r;e=t.map(()=>!1)}return e}async delete(t){let{store:e}=this.opts;if(Array.isArray(t))return this.deleteMany(t);let r=this._getKeyPrefix(t);this.hooks.trigger("preDelete",{key:r});let n=!0;try{let i=await e.delete(r);typeof i=="boolean"&&(n=i)}catch(i){if(n=!1,this.emit("error",i),this._throwOnErrors)throw i}return this.hooks.trigger("postDelete",{key:r,value:n}),this.stats.delete(),n}async deleteMany(t){try{let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(this.hooks.trigger("preDelete",{key:r}),e.deleteMany!==void 0)return await e.deleteMany(r);let n=r.map(async s=>e.delete(s)),o=(await Promise.all(n)).every(Boolean);return this.hooks.trigger("postDelete",{key:r,value:o}),o}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e;return!1}}async clear(){this.emit("clear");let{store:t}=this.opts;try{await t.clear()}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e}}async has(t){if(Array.isArray(t))return this.hasMany(t);let e=this._getKeyPrefix(t),{store:r}=this.opts;if(r.has!==void 0&&!(r instanceof Map))return r.has(e);let n;try{n=await r.get(e)}catch(i){if(this.emit("error",i),this._throwOnErrors)throw i;return!1}if(n){let i=await this.deserializeData(n);if(i)return i.expires===void 0||i.expires===null?!0:i.expires>Date.now()}return!1}async hasMany(t){let e=this._getKeyPrefixArray(t),{store:r}=this.opts;if(r.hasMany!==void 0)return r.hasMany(e);let n=[];for(let i of t)n.push(await this.has(i));return n}async disconnect(){let{store:t}=this.opts;if(this.emit("disconnect"),typeof t.disconnect=="function")return t.disconnect()}emit(t,...e){t==="error"&&!this.opts.emitErrors||super.emit(t,...e)}async serializeData(t){return this._serialize?this._compression?.compress?this._serialize({value:await this._compression.compress(t.value),expires:t.expires}):this._serialize(t):t}async deserializeData(t){if(!this._deserialize)return t;if(this._compression?.decompress&&typeof t=="string"){let e=await this._deserialize(t);return{value:await this._compression.decompress(e?.value),expires:e?.expires}}if(typeof t=="string")return this._deserialize(t)}},dAe=x5e;var XAe=ne(ZAe(),1);var SR=class{environment;cacheStore;constructor(e){this.environment=e}getStorageDirectory(){return m_.join(d9e.homedir(),".powerlint")}getIndexDirectory(){return m_.join(this.getStorageDirectory(),"indexes",Fc(this.environment.getWorkspaceRoot()))}getCacheDirectory(){return m_.join(this.getStorageDirectory(),"cache",Fc(this.environment.getWorkspaceRoot()))}async ensureDirectory(e){await Ir.mkdir(e,{recursive:!0})}async getIndexFilePath(e,r){let n=this.getIndexDirectory();await this.ensureDirectory(n);let i=r||`${e.toLowerCase()}-index.scip`;return m_.join(n,`${e.toLowerCase()}-${i}`)}async indexExists(e,r){let n=await this.getIndexFilePath(e,r);try{return await Ir.access(n),!0}catch{return!1}}async readIndex(e,r){let n=await this.getIndexFilePath(e,r);try{return await Ir.access(n),await Ir.readFile(n)}catch{return null}}async saveIndex(e,r,n){let i=await this.getIndexFilePath(e,n);await Ir.writeFile(i,r)}getCacheFilePath(){return m_.join(this.getCacheDirectory(),"cache.json")}async purgeStorage(){let e=0,r=this.getStorageDirectory();try{await Ir.access(r),await Ir.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}async purgeCache(){let e=0,r=this.getCacheDirectory();try{await Ir.access(r),await Ir.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}getCacheStore(){if(!this.cacheStore){let e=this.getCacheDirectory();this.cacheStore=new dAe({store:new XAe.KeyvFile({filename:m_.join(e,"cache.json")})})}return this.cacheStore}async saveCache(e,r,n){let i=this.getCacheStore(),o=`${e}:${r}`;await i.set(o,n)}async readCache(e,r){let n=this.getCacheStore(),i=`${e}:${r}`;return await n.get(i)||null}async purgeIndexes(){let e=0,r=this.getIndexDirectory();try{await Ir.access(r),await Ir.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}};import*as vS from"path";var JAe=Je.object({conversation_id:Je.string(),generation_id:Je.string(),model:Je.string(),hook_event_name:Je.string(),cursor_version:Je.string(),workspace_roots:Je.array(Je.string()),user_email:Je.string().nullable()}),h9e=JAe.extend({file_path:Je.string(),edits:Je.array(Je.object({old_string:Je.string(),new_string:Je.string()}))}),A9e=JAe.extend({status:Je.enum(["completed","aborted","error"]),loop_count:Je.number()}),QAe={afterFileEdit:h9e,stop:A9e},eme=Je.object({metadata:Je.object({conversation_id:Je.string(),generation_id:Je.string(),model:Je.string(),cursor_version:Je.string(),workspace_roots:Je.array(Je.string()),user_email:Je.string().nullable()}),files:Je.record(Je.string(),Je.object({old_string:Je.string(),new_string:Je.string(),last_updated:Je.string()}))});var pR=class{_storage=null;_conversationId=null;async get(){if(!this._storage||!this._conversationId)throw new Error("get() called outside of event handling context");let e=await this._storage.load(this._conversationId);return e?this.dataSchema.parse(e):null}async save(e){if(!this._storage||!this._conversationId)throw new Error("save() called outside of event handling context");this.dataSchema.parse(e),await this._storage.save(this._conversationId,e)}async clear(){if(!this._storage||!this._conversationId)throw new Error("clear() called outside of event handling context");await this._storage.clear(this._conversationId)}_setContext(e,r){this._storage=e,this._conversationId=r}_clearContext(){this._storage=null,this._conversationId=null}getHookCommand(e){return`npx --silent --yes @wispbit/local@latest handle-hooks ${this.provider}.${e}`}};var kc=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async getRepositoryUrl(){let e=await this.environment.getRepositoryUrl();if(!e)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return e}async loadRuleById(e){let n=(await this.fetchRules()).filter(i=>new RegExp(e).test(i.id));if(n.length===0)throw new Error(`Rule with ID '${e}' not found`);return n[0]}async loadAllRules(){return await this.fetchRules()}async fetchRules(e){let r=await this.getRepositoryUrl(),i=await this.config.getApiClient().getRules({repository_url:r,rule_ids:e,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion()});if("error"in i)throw new Error(i.error);return i.rules.map(o=>({id:o.id,internalId:o.internalId,internalVersionId:o.internalVersionId,message:o.message,severity:o.severity,execution:o.execution||"llm",steps:o.schema,prompt:o.prompt,collectionName:o.collectionName,testCases:[]}))}};import{EventEmitter as m9e}from"events";var Wn=class extends m9e{rulesStartTime=0;indexingStartTimes=new Map;fileDiscoveryStartTime=0;constructor(){super(),this.setMaxListeners(20)}emit(e,r){return super.emit(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}off(e,r){return super.off(e,r)}setExecutionMode(e,r){this.emit("execution:mode",{mode:e,...r})}startRules(e){this.rulesStartTime=Date.now(),this.emit("rules:start",{totalRules:e})}progressRule(e,r,n,i){let o=Math.round(e/r*100);this.emit("rules:progress",{currentRule:e,totalRules:r,ruleId:n,percentage:o,isLlm:i})}errorRule(e,r,n,i){this.emit("rules:rule-error",{ruleId:e,error:r,message:n,severity:i})}completeRules(e,r){let n=Date.now()-this.rulesStartTime;this.emit("rules:complete",{totalRules:e,totalMatches:r,executionTime:n})}startFileDiscovery(e){this.fileDiscoveryStartTime=Date.now(),this.emit("files:discovery:start",{mode:e})}fileDiscoveryProgress(e,r){this.emit("files:discovery:progress",{message:e,currentCount:r})}completeFileDiscovery(e,r,n,i,o){let s=Date.now()-this.fileDiscoveryStartTime,a;(r==="diff"||r==="custom-diff")&&n&&(a={totalAdditions:0,totalDeletions:0,files:e.map(c=>{let u=n.get(c),_=u?.additions||0,E=u?.deletions||0;return{path:c,additions:_,deletions:E}})},a.totalAdditions=a.files.reduce((c,u)=>c+u.additions,0),a.totalDeletions=a.files.reduce((c,u)=>c+u.deletions,0)),this.emit("files:discovery:complete",{totalFiles:e.length,mode:r,executionTime:s,stats:a,ignoredFiles:i,deletedFiles:o})}fileFilter(e,r,n){this.emit("files:filter",{originalCount:e,filteredCount:r,filterType:n})}startScipMatchLookup(e,r){this.emit("scip:match-lookup:start",{language:e,match:r})}scipMatchLookupProgress(e,r){this.emit("scip:match-lookup:progress",{language:e,document:r})}scipMatchLookupComplete(e,r){this.emit("scip:match-lookup:complete",{language:e,document:r})}startIndexing(e){this.indexingStartTimes.set(e,Date.now()),this.emit("indexing:start",{language:e})}indexingProgress(e,r,n,i){this.emit("indexing:progress",{language:e,message:r,packageName:n,timeMs:i})}completeIndexing(e){let r=this.indexingStartTimes.get(e)||Date.now(),n=Date.now()-r;this.indexingStartTimes.delete(e),this.emit("indexing:complete",{language:e,executionTime:n})}startStep(e,r,n,i,o){this.emit("step:start",{ruleId:e,stepName:r,stepType:n,inputs:i,parentStepName:o})}completeStep(e,r,n,i,o=0,s){this.emit("step:complete",{ruleId:e,stepName:r,stepType:n,outputs:i,executionTime:o,parentStepName:s})}startTest(e,r){this.emit("test:start",{ruleId:e,testName:r})}testMatches(e,r,n){this.emit("test:matches",{ruleId:e,testName:r,matches:n})}completeTest(e,r,n,i){this.emit("test:complete",{ruleId:e,testName:r,matches:n,stepExecutions:i})}startLLMValidation(e,r,n){this.emit("llm:validation:start",{ruleId:e,matchCount:r,estimatedCost:n})}llmValidationProgress(e,r,n,i){this.emit("llm:validation:progress",{ruleId:e,tokenCount:r,elapsedTime:n,streamedText:i})}completeLLMValidation(e,r,n,i,o,s,a,c){this.emit("llm:validation:complete",{ruleId:e,tokenCount:r,inputTokens:n,outputTokens:i,cost:o,executionTime:s,violationCount:a,fromCache:c})}llmToolExecution(e,r,n){this.emit("llm:tool-execution",{ruleId:e,toolName:r,...n})}startLLMSearchPhase(e,r){this.emit("llm:search-phase:start",{ruleId:e,matchCount:r})}startLLMValidationPhase(e,r){this.emit("llm:validation-phase:start",{ruleId:e,matchCount:r})}llmValidationPhaseBatch(e,r,n,i,o,s){this.emit("llm:validation-phase:batch",{ruleId:e,currentBatch:r,totalBatches:n,batchSize:i,remainingMatches:o,totalMatches:s})}llmMaxIterationsReached(e,r,n,i){this.emit("llm:max-iterations-reached",{ruleId:e,maxIterations:r,messages:n,results:i})}};import{cpus as ZXe}from"os";var vme=ne(hR(),1);import v9e from"path";import{existsSync as P9e}from"fs";import Aa from"path";import{fileURLToPath as D9e}from"url";var L9e=D9e(import.meta.url),g_=Aa.dirname(L9e);function Oe(t){let e=process.platform,r=process.arch,n=`${t}-${e}-${r}-parser.so`,i=[Aa.join(g_,"../../dist/vendor/languages"),Aa.join(g_,"../dist/vendor/languages"),Aa.join(g_,"powerlint/dist/vendor/languages"),Aa.join(g_,"./vendor/languages"),Aa.join(g_,"../vendor/languages"),Aa.join(g_,"../../vendor/languages")];for(let o of i){let s=Aa.join(o,n);if(P9e(s))return s}throw new Error(`Prebuild not found for ${t} on ${e} ${r}. Expected file: ${n}. Paths tried: ${i.join(", ")}`)}var tme={libraryPath:Oe("graphql"),extensions:["graphql","gql"],languageSymbol:"tree_sitter_graphql",expandoChar:"$"};var rme={libraryPath:Oe("angular"),extensions:["html"],languageSymbol:"tree_sitter_angular",expandoChar:"z"};var nme={libraryPath:Oe("bash"),extensions:["bash","bats","cgi","command","env","fcgi","ksh","sh","tmux","tool","zsh"],languageSymbol:"tree_sitter_bash",expandoChar:"$"};var ime={libraryPath:Oe("c"),extensions:["c","h"],languageSymbol:"tree_sitter_c",expandoChar:"_"};var ome={libraryPath:Oe("cpp"),extensions:["cc","hpp","cpp","hh","cxx","cu","ino"],languageSymbol:"tree_sitter_cpp",expandoChar:"_"};var sme={libraryPath:Oe("csharp"),extensions:["cs"],languageSymbol:"tree_sitter_c_sharp",expandoChar:"\xB5"};var ame={libraryPath:Oe("css"),extensions:["css","scss","vue"],languageSymbol:"tree_sitter_css",expandoChar:"$"};var cme={libraryPath:Oe("dart"),extensions:["dart"],languageSymbol:"tree_sitter_dart",expandoChar:"$"};var ume={libraryPath:Oe("elixir"),extensions:["ex","exs"],languageSymbol:"tree_sitter_elixir",expandoChar:"\xB5"};var lme={libraryPath:Oe("go"),extensions:["go"],languageSymbol:"tree_sitter_go",expandoChar:"\xB5"};var _me={libraryPath:Oe("haskell"),extensions:["hs"],languageSymbol:"tree_sitter_haskell",expandoChar:"\xB5"};var Eme={libraryPath:Oe("html"),extensions:["html","htm","xhtml","vue"],languageSymbol:"tree_sitter_html",expandoChar:"z"};var Tme={libraryPath:Oe("java"),extensions:["java"],languageSymbol:"tree_sitter_java",expandoChar:"$"};var fme={libraryPath:Oe("javascript"),extensions:["cjs","js","mjs","jsx"],languageSymbol:"tree_sitter_javascript",expandoChar:"$"};var Sme={libraryPath:Oe("json"),extensions:["json"],languageSymbol:"tree_sitter_json",expandoChar:"$"};var pme={libraryPath:Oe("kotlin"),extensions:["kt","ktm","kts"],languageSymbol:"tree_sitter_kotlin",expandoChar:"\xB5"};var dme={libraryPath:Oe("lua"),extensions:["lua"],languageSymbol:"tree_sitter_lua",expandoChar:"$"};var hme={libraryPath:Oe("markdown"),extensions:["md"],languageSymbol:"tree_sitter_markdown",expandoChar:"$"};var Ame={libraryPath:Oe("php"),extensions:["php"],languageSymbol:"tree_sitter_php",expandoChar:"$"};var mme={libraryPath:Oe("python"),extensions:["py"],languageSymbol:"tree_sitter_python",expandoChar:"\xB5"};var gme={libraryPath:Oe("ruby"),extensions:["rb","rbw","gemspec"],languageSymbol:"tree_sitter_ruby",expandoChar:"\xB5"};var Rme={libraryPath:Oe("rust"),extensions:["rs"],languageSymbol:"tree_sitter_rust",expandoChar:"\xB5"};var Ome={libraryPath:Oe("scala"),extensions:["scala","sc","sbt"],languageSymbol:"tree_sitter_scala",expandoChar:"$"};var Nme={libraryPath:Oe("sql"),extensions:["sql"],languageSymbol:"tree_sitter_sql",expandoChar:"_"};var Cme={libraryPath:Oe("swift"),extensions:["swift"],languageSymbol:"tree_sitter_swift",expandoChar:"\xB5"};var Ime={libraryPath:Oe("toml"),extensions:["toml"],languageSymbol:"tree_sitter_toml",expandoChar:"_"};var Mme={libraryPath:Oe("tsx"),extensions:["tsx"],languageSymbol:"tree_sitter_tsx",expandoChar:"$"};var Pme={libraryPath:Oe("typescript"),extensions:["ts","cts","mts","vue"],languageSymbol:"tree_sitter_typescript",expandoChar:"$"};var Dme={libraryPath:Oe("yaml"),extensions:["yaml","yml"],languageSymbol:"tree_sitter_yaml",expandoChar:"$"};console.debug=()=>{};var m0=[{extension:"vue",hostLanguage:"Html",language:"Html",rule:{pattern:"<template>$$$</template>"},contentNodeKinds:["element","text"]},{extension:"vue",hostLanguage:"Html",language:"TypeScript",rule:{kind:"script_element",regex:'lang="ts"'},contentNodeKinds:["raw_text"]},{extension:"vue",hostLanguage:"Html",language:"JavaScript",rule:{kind:"script_element",not:{regex:"lang="}},contentNodeKinds:["raw_text"]},{extension:"vue",hostLanguage:"Html",language:"Css",rule:{kind:"style_element"},contentNodeKinds:["raw_text"]},{extension:"md",hostLanguage:"Markdown",language:"TypeScript",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(typescript|ts)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"JavaScript",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(javascript|js)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Python",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(python|py)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Go",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(go|golang)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Rust",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(rust|rs)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Java",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^java$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"C",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^c$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Cpp",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(cpp|c\\+\\+|cxx)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Csharp",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(csharp|cs|c#)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Ruby",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(ruby|rb)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Php",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^php$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Swift",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^swift$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Kotlin",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(kotlin|kt)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Scala",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^scala$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Dart",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^dart$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Elixir",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(elixir|ex)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Haskell",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(haskell|hs)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Lua",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^lua$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Bash",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(bash|sh|shell)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Sql",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^sql$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Html",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^html$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Css",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(css|scss)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Json",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^json$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Yaml",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^(yaml|yml)$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Toml",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^toml$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Tsx",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^tsx$"}},contentNodeKinds:["code_fence_content"]},{extension:"md",hostLanguage:"Markdown",language:"Angular",rule:{kind:"fenced_code_block",has:{kind:"info_string",regex:"^angular$"}},contentNodeKinds:["code_fence_content"]}],y9e=new Set(["vue","md"]),yme={Angular:rme,Bash:nme,C:ime,Cpp:ome,Csharp:sme,Css:ame,Dart:cme,Elixir:ume,Go:lme,Haskell:_me,Html:Eme,Java:Tme,JavaScript:fme,Json:Sme,Kotlin:pme,Lua:dme,Markdown:hme,Php:Ame,Python:mme,Ruby:gme,Rust:Rme,Scala:Ome,Sql:Nme,Swift:Cme,Toml:Ime,Tsx:Mme,TypeScript:Pme,Yaml:Dme,GraphQL:tme};(0,vme.registerDynamicLanguage)(yme);var Lme=Object.entries(yme).reduce((t,[e,r])=>(t[e]=r.extensions??[],t),{});function ma(t){let e=v9e.extname(t).slice(1),r=b9e(e);return r.length>0?r:["Unknown"]}function b9e(t){return Object.keys(Lme).filter(e=>Lme[e].includes(t))}function g0(t){return y9e.has(t)}function AR(t,e){if(g0(e))return m0.find(r=>r.extension===e&&r.language===t)}import*as Ni from"fs";import*as Et from"path";var Qme=ne(jme(),1);var uS=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var F9e={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},lS=t=>t.replace(/[[\]\\-]/g,"\\$&"),k9e=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Kme=t=>t.join(""),Wme=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],o=r+1,s=!1,a=!1,c=!1,u=!1,_=r,E="";e:for(;o<t.length;){let d=t.charAt(o);if((d==="!"||d==="^")&&o===r+1){u=!0,o++;continue}if(d==="]"&&s&&!c){_=o+1;break}if(s=!0,d==="\\"&&!c){c=!0,o++;continue}if(d==="["&&!c){for(let[p,[g,N,O]]of Object.entries(F9e))if(t.startsWith(p,o)){if(E)return["$.",!1,t.length-r,!0];o+=p.length,O?i.push(g):n.push(g),a=a||N;continue e}}if(c=!1,E){d>E?n.push(lS(E)+"-"+lS(d)):d===E&&n.push(lS(d)),E="",o++;continue}if(t.startsWith("-]",o+1)){n.push(lS(d+"-")),o+=2;continue}if(t.startsWith("-",o+1)){E=d,o+=2;continue}n.push(lS(d)),o++}if(_<o)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let d=n[0].length===2?n[0].slice(-1):n[0];return[k9e(d),!1,_-r,!1]}let T="["+(u?"^":"")+Kme(n)+"]",f="["+(u?"":"^")+Kme(i)+"]";return[n.length&&i.length?"("+T+"|"+f+")":n.length?T:f,a,_-r,!0]};var mi=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Y9e=new Set(["!","?","+","*","@"]),zme=t=>Y9e.has(t),H9e="(?!(?:^|/)\\.\\.?(?:$|/))",mR="(?!\\.)",j9e=new Set(["[","."]),K9e=new Set(["..","."]),W9e=new Set("().*{}+?[]^$\\!"),z9e=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),N0="[^/]",qme=N0+"*?",Zme=N0+"+?",R_=class t{type;#t;#r;#e=!1;#o=[];#l;#E;#a;#u=!1;#i;#n;#s=!1;constructor(e,r,n={}){this.type=e,e&&(this.#r=!0),this.#l=r,this.#t=this.#l?this.#l.#t:this,this.#i=this.#t===this?n:this.#t.#i,this.#a=this.#t===this?[]:this.#t.#a,e==="!"&&!this.#t.#u&&this.#a.push(this),this.#E=this.#l?this.#l.#o.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#o)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#n!==void 0?this.#n:this.type?this.#n=this.type+"("+this.#o.map(e=>String(e)).join("|")+")":this.#n=this.#o.map(e=>String(e)).join("")}#f(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,n=r.#l;for(;n;){for(let i=r.#E+1;!n.type&&i<n.#o.length;i++)for(let o of e.#o){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(n.#o[i])}r=n,n=r.#l}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#l===this))throw new Error("invalid part: "+r);this.#o.push(r)}}toJSON(){let e=this.type===null?this.#o.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#o.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#l?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#l?.isStart())return!1;if(this.#E===0)return!0;let e=this.#l;for(let r=0;r<this.#E;r++){let n=e.#o[r];if(!(n instanceof t&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#l?.type==="!")return!0;if(!this.#l?.isEnd())return!1;if(!this.type)return this.#l?.isEnd();let e=this.#l?this.#l.#o.length:0;return this.#E===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let n of this.#o)r.copyIn(n);return r}static#T(e,r,n,i){let o=!1,s=!1,a=-1,c=!1;if(r.type===null){let f=n,S="";for(;f<e.length;){let d=e.charAt(f++);if(o||d==="\\"){o=!o,S+=d;continue}if(s){f===a+1?(d==="^"||d==="!")&&(c=!0):d==="]"&&!(f===a+2&&c)&&(s=!1),S+=d;continue}else if(d==="["){s=!0,a=f,c=!1,S+=d;continue}if(!i.noext&&zme(d)&&e.charAt(f)==="("){r.push(S),S="";let p=new t(d,r);f=t.#T(e,p,f,i),r.push(p);continue}S+=d}return r.push(S),f}let u=n+1,_=new t(null,r),E=[],T="";for(;u<e.length;){let f=e.charAt(u++);if(o||f==="\\"){o=!o,T+=f;continue}if(s){u===a+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(u===a+2&&c)&&(s=!1),T+=f;continue}else if(f==="["){s=!0,a=u,c=!1,T+=f;continue}if(zme(f)&&e.charAt(u)==="("){_.push(T),T="";let S=new t(f,_);_.push(S),u=t.#T(e,S,u,i);continue}if(f==="|"){_.push(T),T="",E.push(_),_=new t(null,r);continue}if(f===")")return T===""&&r.#o.length===0&&(r.#s=!0),_.push(T),T="",r.push(...E,_),u;T+=f}return r.type=null,r.#r=void 0,r.#o=[e.substring(n-1)],u}static fromGlob(e,r={}){let n=new t(null,void 0,r);return t.#T(e,n,0,r),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,n,i,o]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#i.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#i}toRegExpSource(e){let r=e??!!this.#i.dot;if(this.#t===this&&this.#f(),!this.type){let c=this.isStart()&&this.isEnd(),u=this.#o.map(f=>{let[S,d,p,g]=typeof f=="string"?t.#p(f,this.#r,c):f.toRegExpSource(e);return this.#r=this.#r||p,this.#e=this.#e||g,S}).join(""),_="";if(this.isStart()&&typeof this.#o[0]=="string"&&!(this.#o.length===1&&K9e.has(this.#o[0]))){let S=j9e,d=r&&S.has(u.charAt(0))||u.startsWith("\\.")&&S.has(u.charAt(2))||u.startsWith("\\.\\.")&&S.has(u.charAt(4)),p=!r&&!e&&S.has(u.charAt(0));_=d?H9e:p?mR:""}let E="";return this.isEnd()&&this.#t.#u&&this.#l?.type==="!"&&(E="(?:$|\\/)"),[_+u+E,mi(u),this.#r=!!this.#r,this.#e]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",o=this.#_(r);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let c=this.toString();return this.#o=[c],this.type=null,this.#r=void 0,[c,mi(this.toString()),!1,!1]}let s=!n||e||r||!mR?"":this.#_(!0);s===o&&(s=""),s&&(o=`(?:${o})(?:${s})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!r?mR:"")+Zme;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?mR:"")+qme+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;a=i+o+c}return[a,mi(o),this.#r=!!this.#r,this.#e]}#_(e){return this.#o.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,o,s]=r.toRegExpSource(e);return this.#e=this.#e||s,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#p(e,r,n=!1){let i=!1,o="",s=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,o+=(W9e.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?o+="\\\\":i=!0;continue}if(c==="["){let[u,_,E,T]=Wme(e,a);if(E){o+=u,s=s||_,a+=E-1,r=r||T;continue}}if(c==="*"){n&&e==="*"?o+=Zme:o+=qme,r=!0;continue}if(c==="?"){o+=N0,r=!0;continue}o+=z9e(c)}return[o,mi(e),!!r,s]}};var O_=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var Wr=(t,e,r={})=>(uS(e),!r.nocomment&&e.charAt(0)==="#"?!1:new mn(e,r).match(t)),q9e=/^\*+([^+@!?\*\[\(]*)$/,Z9e=t=>e=>!e.startsWith(".")&&e.endsWith(t),X9e=t=>e=>e.endsWith(t),J9e=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),Q9e=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),eZe=/^\*+\.\*+$/,tZe=t=>!t.startsWith(".")&&t.includes("."),rZe=t=>t!=="."&&t!==".."&&t.includes("."),nZe=/^\.\*+$/,iZe=t=>t!=="."&&t!==".."&&t.startsWith("."),oZe=/^\*+$/,sZe=t=>t.length!==0&&!t.startsWith("."),aZe=t=>t.length!==0&&t!=="."&&t!=="..",cZe=/^\?+([^+@!?\*\[\(]*)?$/,uZe=([t,e=""])=>{let r=ege([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},lZe=([t,e=""])=>{let r=tge([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},_Ze=([t,e=""])=>{let r=tge([t]);return e?n=>r(n)&&n.endsWith(e):r},EZe=([t,e=""])=>{let r=ege([t]);return e?n=>r(n)&&n.endsWith(e):r},ege=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},tge=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},rge=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Xme={win32:{sep:"\\"},posix:{sep:"/"}},TZe=rge==="win32"?Xme.win32.sep:Xme.posix.sep;Wr.sep=TZe;var ur=Symbol("globstar **");Wr.GLOBSTAR=ur;var fZe="[^/]",SZe=fZe+"*?",pZe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",dZe="(?:(?!(?:\\/|^)\\.).)*?",hZe=(t,e={})=>r=>Wr(r,t,e);Wr.filter=hZe;var zn=(t,e={})=>Object.assign({},t,e),AZe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Wr;let e=Wr;return Object.assign((n,i,o={})=>e(n,i,zn(t,o)),{Minimatch:class extends e.Minimatch{constructor(i,o={}){super(i,zn(t,o))}static defaults(i){return e.defaults(zn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,o,s={}){super(i,o,zn(t,s))}static fromGlob(i,o={}){return e.AST.fromGlob(i,zn(t,o))}},unescape:(n,i={})=>e.unescape(n,zn(t,i)),escape:(n,i={})=>e.escape(n,zn(t,i)),filter:(n,i={})=>e.filter(n,zn(t,i)),defaults:n=>e.defaults(zn(t,n)),makeRe:(n,i={})=>e.makeRe(n,zn(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,zn(t,i)),match:(n,i,o={})=>e.match(n,i,zn(t,o)),sep:e.sep,GLOBSTAR:ur})};Wr.defaults=AZe;var nge=(t,e={})=>(uS(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Qme.default)(t));Wr.braceExpand=nge;var mZe=(t,e={})=>new mn(t,e).makeRe();Wr.makeRe=mZe;var gZe=(t,e,r={})=>{let n=new mn(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};Wr.match=gZe;var Jme=/[?*]|[+@!]\(.*?\)|\[|\]/,RZe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){uS(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||rge,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((o,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=o[0]===""&&o[1]===""&&(o[2]==="?"||!Jme.test(o[2]))&&!Jme.test(o[3]),u=/^[a-z]:/i.test(o[0]);if(c)return[...o.slice(0,4),...o.slice(4).map(_=>this.parse(_))];if(u)return[o[0],...o.slice(1).map(_=>this.parse(_))]}return o.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){let s=this.set[o];s[0]===""&&s[1]===""&&this.globParts[o][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let o=n[n.length-1];return i==="**"&&o==="**"?n:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let o=e[i];i===1&&o===""&&e[0]===""||(o==="."||o==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let s=i;for(;n[s+1]==="**";)s++;s>i&&n.splice(i+1,s-i);let a=n[i+1],c=n[i+2],u=n[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);let _=n.slice(0);_[i]="**",e.push(_),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<n.length-1;s++){let a=n[s];s===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(s,1),s--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let o=0;for(;(o=n.indexOf("..",o+1))!==-1;){let s=n[o-1];if(s&&s!=="."&&s!==".."&&s!=="**"){r=!0;let c=o===1&&n[o+1]==="**"?["."]:[];n.splice(o-1,2,...c),n.length===0&&n.push(""),o-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,o=0,s=[],a="";for(;i<e.length&&o<r.length;)if(e[i]===r[o])s.push(a==="b"?r[o]:e[i]),i++,o++;else if(n&&e[i]==="**"&&r[o]===e[i+1])s.push(e[i]),i++;else if(n&&r[o]==="**"&&e[i]===r[o+1])s.push(r[o]),o++;else if(e[i]==="*"&&r[o]&&(this.options.dot||!r[o].startsWith("."))&&r[o]!=="**"){if(a==="b")return!1;a="a",s.push(e[i]),i++,o++}else if(r[o]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",s.push(r[o]),i++,o++}else return!1;return e.length===r.length&&s}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=this.options;if(this.isWindows){let d=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),p=!d&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),g=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),N=!g&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),O=p?3:d?0:void 0,C=N?3:g?0:void 0;if(typeof O=="number"&&typeof C=="number"){let[v,x]=[e[O],r[C]];v.toLowerCase()===x.toLowerCase()&&(r[C]=v,C>O?r=r.slice(C):O>C&&(e=e.slice(O)))}}let{optimizationLevel:o=1}=this.options;o>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var s=0,a=0,c=e.length,u=r.length;s<c&&a<u;s++,a++){this.debug("matchOne loop");var _=r[a],E=e[s];if(this.debug(r,_,E),_===!1)return!1;if(_===ur){this.debug("GLOBSTAR",[r,_,E]);var T=s,f=a+1;if(f===u){for(this.debug("** at the end");s<c;s++)if(e[s]==="."||e[s]===".."||!i.dot&&e[s].charAt(0)===".")return!1;return!0}for(;T<c;){var S=e[T];if(this.debug(`
|
|
108
108
|
globstar while`,e,T,r,f,S),this.matchOne(e.slice(T),r.slice(f),n))return this.debug("globstar found match!",T,c,S),!0;if(S==="."||S===".."||!i.dot&&S.charAt(0)==="."){this.debug("dot detected!",e,T,r,f);break}this.debug("globstar swallow a segment, and continue"),T++}return!!(n&&(this.debug(`
|
|
109
109
|
>>> no match, partial?`,e,T,r,f),T===c))}let d;if(typeof _=="string"?(d=E===_,this.debug("string match",_,E,d)):(d=_.test(E),this.debug("pattern match",_,E,d)),!d)return!1}if(s===c&&a===u)return!0;if(s===c)return n;if(a===u)return s===c-1&&e[s]==="";throw new Error("wtf?")}braceExpand(){return nge(this.pattern,this.options)}parse(e){uS(e);let r=this.options;if(e==="**")return ur;if(e==="")return"";let n,i=null;(n=e.match(oZe))?i=r.dot?aZe:sZe:(n=e.match(q9e))?i=(r.nocase?r.dot?Q9e:J9e:r.dot?X9e:Z9e)(n[1]):(n=e.match(cZe))?i=(r.nocase?r.dot?lZe:uZe:r.dot?_Ze:EZe)(n):(n=e.match(eZe))?i=r.dot?rZe:tZe:(n=e.match(nZe))&&(i=iZe);let o=R_.fromGlob(e,this.options).toMMPattern();return i&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?SZe:r.dot?pZe:dZe,i=new Set(r.nocase?["i"]:[]),o=e.map(c=>{let u=c.map(_=>{if(_ instanceof RegExp)for(let E of _.flags.split(""))i.add(E);return typeof _=="string"?RZe(_):_===ur?ur:_._src});return u.forEach((_,E)=>{let T=u[E+1],f=u[E-1];_!==ur||f===ur||(f===void 0?T!==void 0&&T!==ur?u[E+1]="(?:\\/|"+n+"\\/)?"+T:u[E]=n:T===void 0?u[E-1]=f+"(?:\\/|"+n+")?":T!==ur&&(u[E-1]=f+"(?:\\/|\\/"+n+"\\/)"+T,u[E+1]=ur))}),u.filter(_=>_!==ur).join("/")}).join("|"),[s,a]=e.length>1?["(?:",")"]:["",""];o="^"+s+o+a+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let o=this.set;this.debug(this.pattern,"set",o);let s=i[i.length-1];if(!s)for(let a=i.length-2;!s&&a>=0;a--)s=i[a];for(let a=0;a<o.length;a++){let c=o[a],u=i;if(n.matchBase&&c.length===1&&(u=[s]),this.matchOne(u,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Wr.defaults(e).Minimatch}};Wr.AST=R_;Wr.Minimatch=mn;Wr.escape=O_;Wr.unescape=mi;import{fileURLToPath as eXe}from"node:url";var N_=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,oge=new Set,C0=typeof process=="object"&&process?process:{},sge=(t,e,r,n)=>{typeof C0.emitWarning=="function"?C0.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},gR=globalThis.AbortController,ige=globalThis.AbortSignal;if(typeof gR>"u"){ige=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},gR=class{constructor(){e()}signal=new ige;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=C0.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,sge("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var OZe=t=>!oge.has(t),SDt=Symbol("type"),ga=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),age=t=>ga(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?C_:null:null,C_=class extends Array{constructor(e){super(e),this.fill(0)}},I0=class t{heap;length;static#t=!1;static create(e){let r=age(e);if(!r)return[];t.#t=!0;let n=new t(e,r);return t.#t=!1,n}constructor(e,r){if(!t.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},_S=class t{#t;#r;#e;#o;#l;#E;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#i;#n;#s;#f;#T;#_;#p;#S;#d;#C;#R;#g;#O;#h;#N;static unsafeExposeInternals(e){return{starts:e.#R,ttls:e.#g,sizes:e.#C,keyMap:e.#i,keyList:e.#n,valList:e.#s,next:e.#f,prev:e.#T,get head(){return e.#_},get tail(){return e.#p},free:e.#S,isBackgroundFetch:r=>e.#m(r),backgroundFetch:(r,n,i,o)=>e.#A(r,n,i,o),moveToTail:r=>e.#B(r),indexes:r=>e.#D(r),rindexes:r=>e.#b(r),isStale:r=>e.#I(r)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#l}get memoMethod(){return this.#E}get dispose(){return this.#e}get disposeAfter(){return this.#o}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:c,dispose:u,disposeAfter:_,noDisposeOnSet:E,noUpdateTTL:T,maxSize:f=0,maxEntrySize:S=0,sizeCalculation:d,fetchMethod:p,memoMethod:g,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:v,ignoreFetchAbort:x}=e;if(r!==0&&!ga(r))throw new TypeError("max option must be a nonnegative integer");let G=r?age(r):Array;if(!G)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=f,this.maxEntrySize=S||this.#r,this.sizeCalculation=d,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(g!==void 0&&typeof g!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#E=g,p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#l=p,this.#h=!!p,this.#i=new Map,this.#n=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#f=new G(r),this.#T=new G(r),this.#_=0,this.#p=0,this.#S=I0.create(r),this.#a=0,this.#u=0,typeof u=="function"&&(this.#e=u),typeof _=="function"?(this.#o=_,this.#d=[]):(this.#o=void 0,this.#d=void 0),this.#O=!!this.#e,this.#N=!!this.#o,this.noDisposeOnSet=!!E,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#r!==0&&!ga(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!ga(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#y()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=ga(i)||i===0?i:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!ga(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#v()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let J="LRU_CACHE_UNBOUNDED";OZe(J)&&(oge.add(J),sge("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,t))}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#v(){let e=new C_(this.#t),r=new C_(this.#t);this.#g=e,this.#R=r,this.#P=(o,s,a=N_.now())=>{if(r[o]=s!==0?a:0,e[o]=s,s!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#I(o)&&this.#$(this.#n[o],"expire")},s+1);c.unref&&c.unref()}},this.#M=o=>{r[o]=e[o]!==0?N_.now():0},this.#c=(o,s)=>{if(e[s]){let a=e[s],c=r[s];if(!a||!c)return;o.ttl=a,o.start=c,o.now=n||i();let u=o.now-c;o.remainingTTL=a-u}};let n=0,i=()=>{let o=N_.now();if(this.ttlResolution>0){n=o;let s=setTimeout(()=>n=0,this.ttlResolution);s.unref&&s.unref()}return o};this.getRemainingTTL=o=>{let s=this.#i.get(o);if(s===void 0)return 0;let a=e[s],c=r[s];if(!a||!c)return 1/0;let u=(n||i())-c;return a-u},this.#I=o=>{let s=r[o],a=e[o];return!!a&&!!s&&(n||i())-s>a}}#M=()=>{};#c=()=>{};#P=()=>{};#I=()=>!1;#y(){let e=new C_(this.#t);this.#u=0,this.#C=e,this.#U=r=>{this.#u-=e[r],e[r]=0},this.#L=(r,n,i,o)=>{if(this.#m(n))return 0;if(!ga(i))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(i=o(n,r),!ga(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#G=(r,n,i)=>{if(e[r]=n,this.#r){let o=this.#r-e[r];for(;this.#u>o;)this.#w(!0)}this.#u+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#u)}}#U=e=>{};#G=(e,r,n)=>{};#L=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#p;!(!this.#x(r)||((e||!this.#I(r))&&(yield r),r===this.#_));)r=this.#T[r]}*#b({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#_;!(!this.#x(r)||((e||!this.#I(r))&&(yield r),r===this.#p));)r=this.#f[r]}#x(e){return e!==void 0&&this.#i.get(this.#n[e])===e}*entries(){for(let e of this.#D())this.#s[e]!==void 0&&this.#n[e]!==void 0&&!this.#m(this.#s[e])&&(yield[this.#n[e],this.#s[e]])}*rentries(){for(let e of this.#b())this.#s[e]!==void 0&&this.#n[e]!==void 0&&!this.#m(this.#s[e])&&(yield[this.#n[e],this.#s[e]])}*keys(){for(let e of this.#D()){let r=this.#n[e];r!==void 0&&!this.#m(this.#s[e])&&(yield r)}}*rkeys(){for(let e of this.#b()){let r=this.#n[e];r!==void 0&&!this.#m(this.#s[e])&&(yield r)}}*values(){for(let e of this.#D())this.#s[e]!==void 0&&!this.#m(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#b())this.#s[e]!==void 0&&!this.#m(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#D()){let i=this.#s[n],o=this.#m(i)?i.__staleWhileFetching:i;if(o!==void 0&&e(o,this.#n[n],this))return this.get(this.#n[n],r)}}forEach(e,r=this){for(let n of this.#D()){let i=this.#s[n],o=this.#m(i)?i.__staleWhileFetching:i;o!==void 0&&e.call(r,o,this.#n[n],this)}}rforEach(e,r=this){for(let n of this.#b()){let i=this.#s[n],o=this.#m(i)?i.__staleWhileFetching:i;o!==void 0&&e.call(r,o,this.#n[n],this)}}purgeStale(){let e=!1;for(let r of this.#b({allowStale:!0}))this.#I(r)&&(this.#$(this.#n[r],"expire"),e=!0);return e}info(e){let r=this.#i.get(e);if(r===void 0)return;let n=this.#s[r],i=this.#m(n)?n.__staleWhileFetching:n;if(i===void 0)return;let o={value:i};if(this.#g&&this.#R){let s=this.#g[r],a=this.#R[r];if(s&&a){let c=s-(N_.now()-a);o.ttl=c,o.start=Date.now()}}return this.#C&&(o.size=this.#C[r]),o}dump(){let e=[];for(let r of this.#D({allowStale:!0})){let n=this.#n[r],i=this.#s[r],o=this.#m(i)?i.__staleWhileFetching:i;if(o===void 0||n===void 0)continue;let s={value:o};if(this.#g&&this.#R){s.ttl=this.#g[r];let a=N_.now()-this.#R[r];s.start=Math.floor(Date.now()-a)}this.#C&&(s.size=this.#C[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=N_.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:u=this.noUpdateTTL}=n,_=this.#L(e,r,n.size||0,a);if(this.maxEntrySize&&_>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#$(e,"set"),this;let E=this.#a===0?void 0:this.#i.get(e);if(E===void 0)E=this.#a===0?this.#p:this.#S.length!==0?this.#S.pop():this.#a===this.#t?this.#w(!1):this.#a,this.#n[E]=e,this.#s[E]=r,this.#i.set(e,E),this.#f[this.#p]=E,this.#T[E]=this.#p,this.#p=E,this.#a++,this.#G(E,_,c),c&&(c.set="add"),u=!1;else{this.#B(E);let T=this.#s[E];if(r!==T){if(this.#h&&this.#m(T)){T.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=T;f!==void 0&&!s&&(this.#O&&this.#e?.(f,e,"set"),this.#N&&this.#d?.push([f,e,"set"]))}else s||(this.#O&&this.#e?.(T,e,"set"),this.#N&&this.#d?.push([T,e,"set"]));if(this.#U(E),this.#G(E,_,c),this.#s[E]=r,c){c.set="replace";let f=T&&this.#m(T)?T.__staleWhileFetching:T;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update")}if(i!==0&&!this.#g&&this.#v(),this.#g&&(u||this.#P(E,i,o),c&&this.#c(c,E)),!s&&this.#N&&this.#d){let T=this.#d,f;for(;f=T?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#s[this.#_];if(this.#w(!0),this.#m(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#N&&this.#d){let e=this.#d,r;for(;r=e?.shift();)this.#o?.(...r)}}}#w(e){let r=this.#_,n=this.#n[r],i=this.#s[r];return this.#h&&this.#m(i)?i.__abortController.abort(new Error("evicted")):(this.#O||this.#N)&&(this.#O&&this.#e?.(i,n,"evict"),this.#N&&this.#d?.push([i,n,"evict"])),this.#U(r),e&&(this.#n[r]=void 0,this.#s[r]=void 0,this.#S.push(r)),this.#a===1?(this.#_=this.#p=0,this.#S.length=0):this.#_=this.#f[r],this.#i.delete(n),this.#a--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,o=this.#i.get(e);if(o!==void 0){let s=this.#s[o];if(this.#m(s)&&s.__staleWhileFetching===void 0)return!1;if(this.#I(o))i&&(i.has="stale",this.#c(i,o));else return n&&this.#M(o),i&&(i.has="hit",this.#c(i,o)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#i.get(e);if(i===void 0||!n&&this.#I(i))return;let o=this.#s[i];return this.#m(o)?o.__staleWhileFetching:o}#A(e,r,n,i){let o=r===void 0?void 0:this.#s[r];if(this.#m(o))return o;let s=new gR,{signal:a}=n;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let c={signal:s.signal,options:n,context:i},u=(d,p=!1)=>{let{aborted:g}=s.signal,N=n.ignoreFetchAbort&&d!==void 0;if(n.status&&(g&&!p?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,N&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),g&&!N&&!p)return E(s.signal.reason);let O=f;return this.#s[r]===f&&(d===void 0?O.__staleWhileFetching?this.#s[r]=O.__staleWhileFetching:this.#$(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,d,c.options))),d},_=d=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=d),E(d)),E=d=>{let{aborted:p}=s.signal,g=p&&n.allowStaleOnFetchAbort,N=g||n.allowStaleOnFetchRejection,O=N||n.noDeleteOnFetchRejection,C=f;if(this.#s[r]===f&&(!O||C.__staleWhileFetching===void 0?this.#$(e,"fetch"):g||(this.#s[r]=C.__staleWhileFetching)),N)return n.status&&C.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),C.__staleWhileFetching;if(C.__returned===C)throw d},T=(d,p)=>{let g=this.#l?.(e,o,c);g&&g instanceof Promise&&g.then(N=>d(N===void 0?void 0:N),p),s.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(d(void 0),n.allowStaleOnFetchAbort&&(d=N=>u(N,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(T).then(u,_),S=Object.assign(f,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,S,{...c.options,status:void 0}),r=this.#i.get(e)):this.#s[r]=S,S}#m(e){if(!this.#h)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof gR}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:_=this.noUpdateTTL,noDeleteOnFetchRejection:E=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:T=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:S=this.allowStaleOnFetchAbort,context:d,forceRefresh:p=!1,status:g,signal:N}=r;if(!this.#h)return g&&(g.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:o,status:g});let O={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:a,size:c,sizeCalculation:u,noUpdateTTL:_,noDeleteOnFetchRejection:E,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:S,ignoreFetchAbort:f,status:g,signal:N},C=this.#i.get(e);if(C===void 0){g&&(g.fetch="miss");let v=this.#A(e,C,O,d);return v.__returned=v}else{let v=this.#s[C];if(this.#m(v)){let z=n&&v.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",z&&(g.returnedStale=!0)),z?v.__staleWhileFetching:v.__returned=v}let x=this.#I(C);if(!p&&!x)return g&&(g.fetch="hit"),this.#B(C),i&&this.#M(C),g&&this.#c(g,C),v;let G=this.#A(e,C,O,d),j=G.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=x?"stale":"refresh",j&&x&&(g.returnedStale=!0)),j?G.__staleWhileFetching:G.__returned=G}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#E;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:o,...s}=r,a=this.get(e,s);if(!o&&a!==void 0)return a;let c=n(e,a,{options:s,context:i});return this.set(e,c,s),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=r,a=this.#i.get(e);if(a!==void 0){let c=this.#s[a],u=this.#m(c);return s&&this.#c(s,a),this.#I(a)?(s&&(s.get="stale"),u?(s&&n&&c.__staleWhileFetching!==void 0&&(s.returnedStale=!0),n?c.__staleWhileFetching:void 0):(o||this.#$(e,"expire"),s&&n&&(s.returnedStale=!0),n?c:void 0)):(s&&(s.get="hit"),u?c.__staleWhileFetching:(this.#B(a),i&&this.#M(a),c))}else s&&(s.get="miss")}#V(e,r){this.#T[r]=e,this.#f[e]=r}#B(e){e!==this.#p&&(e===this.#_?this.#_=this.#f[e]:this.#V(this.#T[e],this.#f[e]),this.#V(this.#p,e),this.#p=e)}delete(e){return this.#$(e,"delete")}#$(e,r){let n=!1;if(this.#a!==0){let i=this.#i.get(e);if(i!==void 0)if(n=!0,this.#a===1)this.#F(r);else{this.#U(i);let o=this.#s[i];if(this.#m(o)?o.__abortController.abort(new Error("deleted")):(this.#O||this.#N)&&(this.#O&&this.#e?.(o,e,r),this.#N&&this.#d?.push([o,e,r])),this.#i.delete(e),this.#n[i]=void 0,this.#s[i]=void 0,i===this.#p)this.#p=this.#T[i];else if(i===this.#_)this.#_=this.#f[i];else{let s=this.#T[i];this.#f[s]=this.#f[i];let a=this.#f[i];this.#T[a]=this.#T[i]}this.#a--,this.#S.push(i)}}if(this.#N&&this.#d?.length){let i=this.#d,o;for(;o=i?.shift();)this.#o?.(...o)}return n}clear(){return this.#F("delete")}#F(e){for(let r of this.#b({allowStale:!0})){let n=this.#s[r];if(this.#m(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#n[r];this.#O&&this.#e?.(n,i,e),this.#N&&this.#d?.push([n,i,e])}}if(this.#i.clear(),this.#s.fill(void 0),this.#n.fill(void 0),this.#g&&this.#R&&(this.#g.fill(0),this.#R.fill(0)),this.#C&&this.#C.fill(0),this.#_=0,this.#p=0,this.#S.length=0,this.#u=0,this.#a=0,this.#N&&this.#d){let r=this.#d,n;for(;n=r?.shift();)this.#o?.(...n)}}};import{posix as UZe,win32 as w0}from"node:path";import{fileURLToPath as xZe}from"node:url";import{lstatSync as wZe,readdir as VZe,readdirSync as GZe,readlinkSync as $Ze,realpathSync as BZe}from"fs";import*as FZe from"node:fs";import{lstat as YZe,readdir as HZe,readlink as jZe,realpath as KZe}from"node:fs/promises";import{EventEmitter as b0}from"node:events";import Ege from"node:stream";import{StringDecoder as NZe}from"node:string_decoder";var cge=typeof process=="object"&&process?process:{stdout:null,stderr:null},CZe=t=>!!t&&typeof t=="object"&&(t instanceof Oa||t instanceof Ege||IZe(t)||MZe(t)),IZe=t=>!!t&&typeof t=="object"&&t instanceof b0&&typeof t.pipe=="function"&&t.pipe!==Ege.Writable.prototype.pipe,MZe=t=>!!t&&typeof t=="object"&&t instanceof b0&&typeof t.write=="function"&&typeof t.end=="function",zo=Symbol("EOF"),qo=Symbol("maybeEmitEnd"),Ra=Symbol("emittedEnd"),RR=Symbol("emittingEnd"),ES=Symbol("emittedError"),OR=Symbol("closed"),uge=Symbol("read"),NR=Symbol("flush"),lge=Symbol("flushChunk"),gi=Symbol("encoding"),I_=Symbol("decoder"),nr=Symbol("flowing"),TS=Symbol("paused"),M_=Symbol("resume"),ir=Symbol("buffer"),zr=Symbol("pipes"),or=Symbol("bufferLength"),M0=Symbol("bufferPush"),CR=Symbol("bufferShift"),Mr=Symbol("objectMode"),Gt=Symbol("destroyed"),P0=Symbol("error"),D0=Symbol("emitData"),_ge=Symbol("emitEnd"),L0=Symbol("emitEnd2"),no=Symbol("async"),v0=Symbol("abort"),IR=Symbol("aborted"),fS=Symbol("signal"),Yc=Symbol("dataListeners"),gn=Symbol("discarded"),SS=t=>Promise.resolve().then(t),PZe=t=>t(),DZe=t=>t==="end"||t==="finish"||t==="prefinish",LZe=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,vZe=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),MR=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[M_](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},y0=class extends MR{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},yZe=t=>!!t.objectMode,bZe=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Oa=class extends b0{[nr]=!1;[TS]=!1;[zr]=[];[ir]=[];[Mr];[gi];[no];[I_];[zo]=!1;[Ra]=!1;[RR]=!1;[OR]=!1;[ES]=null;[or]=0;[Gt]=!1;[fS];[IR]=!1;[Yc]=0;[gn]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");yZe(r)?(this[Mr]=!0,this[gi]=null):bZe(r)?(this[gi]=r.encoding,this[Mr]=!1):(this[Mr]=!1,this[gi]=null),this[no]=!!r.async,this[I_]=this[gi]?new NZe(this[gi]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ir]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[zr]});let{signal:n}=r;n&&(this[fS]=n,n.aborted?this[v0]():n.addEventListener("abort",()=>this[v0]()))}get bufferLength(){return this[or]}get encoding(){return this[gi]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Mr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[no]}set async(e){this[no]=this[no]||!!e}[v0](){this[IR]=!0,this.emit("abort",this[fS]?.reason),this.destroy(this[fS]?.reason)}get aborted(){return this[IR]}set aborted(e){}write(e,r,n){if(this[IR])return!1;if(this[zo])throw new Error("write after end");if(this[Gt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[no]?SS:PZe;if(!this[Mr]&&!Buffer.isBuffer(e)){if(vZe(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(LZe(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Mr]?(this[nr]&&this[or]!==0&&this[NR](!0),this[nr]?this.emit("data",e):this[M0](e),this[or]!==0&&this.emit("readable"),n&&i(n),this[nr]):e.length?(typeof e=="string"&&!(r===this[gi]&&!this[I_]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[gi]&&(e=this[I_].write(e)),this[nr]&&this[or]!==0&&this[NR](!0),this[nr]?this.emit("data",e):this[M0](e),this[or]!==0&&this.emit("readable"),n&&i(n),this[nr]):(this[or]!==0&&this.emit("readable"),n&&i(n),this[nr])}read(e){if(this[Gt])return null;if(this[gn]=!1,this[or]===0||e===0||e&&e>this[or])return this[qo](),null;this[Mr]&&(e=null),this[ir].length>1&&!this[Mr]&&(this[ir]=[this[gi]?this[ir].join(""):Buffer.concat(this[ir],this[or])]);let r=this[uge](e||null,this[ir][0]);return this[qo](),r}[uge](e,r){if(this[Mr])this[CR]();else{let n=r;e===n.length||e===null?this[CR]():typeof n=="string"?(this[ir][0]=n.slice(e),r=n.slice(0,e),this[or]-=e):(this[ir][0]=n.subarray(e),r=n.subarray(0,e),this[or]-=e)}return this.emit("data",r),!this[ir].length&&!this[zo]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[zo]=!0,this.writable=!1,(this[nr]||!this[TS])&&this[qo](),this}[M_](){this[Gt]||(!this[Yc]&&!this[zr].length&&(this[gn]=!0),this[TS]=!1,this[nr]=!0,this.emit("resume"),this[ir].length?this[NR]():this[zo]?this[qo]():this.emit("drain"))}resume(){return this[M_]()}pause(){this[nr]=!1,this[TS]=!0,this[gn]=!1}get destroyed(){return this[Gt]}get flowing(){return this[nr]}get paused(){return this[TS]}[M0](e){this[Mr]?this[or]+=1:this[or]+=e.length,this[ir].push(e)}[CR](){return this[Mr]?this[or]-=1:this[or]-=this[ir][0].length,this[ir].shift()}[NR](e=!1){do;while(this[lge](this[CR]())&&this[ir].length);!e&&!this[ir].length&&!this[zo]&&this.emit("drain")}[lge](e){return this.emit("data",e),this[nr]}pipe(e,r){if(this[Gt])return e;this[gn]=!1;let n=this[Ra];return r=r||{},e===cge.stdout||e===cge.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[zr].push(r.proxyErrors?new y0(this,e,r):new MR(this,e,r)),this[no]?SS(()=>this[M_]()):this[M_]()),e}unpipe(e){let r=this[zr].find(n=>n.dest===e);r&&(this[zr].length===1?(this[nr]&&this[Yc]===0&&(this[nr]=!1),this[zr]=[]):this[zr].splice(this[zr].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[gn]=!1,this[Yc]++,!this[zr].length&&!this[nr]&&this[M_]();else if(e==="readable"&&this[or]!==0)super.emit("readable");else if(DZe(e)&&this[Ra])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ES]){let i=r;this[no]?SS(()=>i.call(this,this[ES])):i.call(this,this[ES])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Yc]=this.listeners("data").length,this[Yc]===0&&!this[gn]&&!this[zr].length&&(this[nr]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Yc]=0,!this[gn]&&!this[zr].length&&(this[nr]=!1)),r}get emittedEnd(){return this[Ra]}[qo](){!this[RR]&&!this[Ra]&&!this[Gt]&&this[ir].length===0&&this[zo]&&(this[RR]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[OR]&&this.emit("close"),this[RR]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Gt&&this[Gt])return!1;if(e==="data")return!this[Mr]&&!n?!1:this[no]?(SS(()=>this[D0](n)),!0):this[D0](n);if(e==="end")return this[_ge]();if(e==="close"){if(this[OR]=!0,!this[Ra]&&!this[Gt])return!1;let o=super.emit("close");return this.removeAllListeners("close"),o}else if(e==="error"){this[ES]=n,super.emit(P0,n);let o=!this[fS]||this.listeners("error").length?super.emit("error",n):!1;return this[qo](),o}else if(e==="resume"){let o=super.emit("resume");return this[qo](),o}else if(e==="finish"||e==="prefinish"){let o=super.emit(e);return this.removeAllListeners(e),o}let i=super.emit(e,...r);return this[qo](),i}[D0](e){for(let n of this[zr])n.dest.write(e)===!1&&this.pause();let r=this[gn]?!1:super.emit("data",e);return this[qo](),r}[_ge](){return this[Ra]?!1:(this[Ra]=!0,this.readable=!1,this[no]?(SS(()=>this[L0]()),!0):this[L0]())}[L0](){if(this[I_]){let r=this[I_].end();if(r){for(let n of this[zr])n.dest.write(r);this[gn]||super.emit("data",r)}}for(let r of this[zr])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Mr]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[Mr]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[Mr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[gi]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Gt,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[gn]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[zo])return r();let o,s,a=E=>{this.off("data",c),this.off("end",u),this.off(Gt,_),r(),s(E)},c=E=>{this.off("error",a),this.off("end",u),this.off(Gt,_),this.pause(),o({value:E,done:!!this[zo]})},u=()=>{this.off("error",a),this.off("data",c),this.off(Gt,_),r(),o({done:!0,value:void 0})},_=()=>a(new Error("stream destroyed"));return new Promise((E,T)=>{s=T,o=E,this.once(Gt,_),this.once("error",a),this.once("end",u),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[gn]=!1;let e=!1,r=()=>(this.pause(),this.off(P0,r),this.off(Gt,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(P0,r),this.once(Gt,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Gt])return e?this.emit("error",e):this.emit(Gt),this;this[Gt]=!0,this[gn]=!0,this[ir].length=0,this[or]=0;let r=this;return typeof r.close=="function"&&!this[OR]&&r.close(),e?this.emit("error",e):this.emit(Gt),this}static get isStream(){return CZe}};var kZe=BZe.native,dS={lstatSync:wZe,readdir:VZe,readdirSync:GZe,readlinkSync:$Ze,realpathSync:kZe,promises:{lstat:YZe,readdir:HZe,readlink:jZe,realpath:KZe}},dge=t=>!t||t===dS||t===FZe?dS:{...dS,...t,promises:{...dS.promises,...t.promises||{}}},hge=/^\\\\\?\\([a-z]:)\\?$/i,WZe=t=>t.replace(/\//g,"\\").replace(hge,"$1\\"),zZe=/[\\\/]/,Zn=0,Age=1,mge=2,io=4,gge=6,Rge=8,Hc=10,Oge=12,qn=15,pS=~qn,U0=16,Tge=32,hS=64,Ri=128,PR=256,LR=512,fge=hS|Ri|LR,qZe=1023,x0=t=>t.isFile()?Rge:t.isDirectory()?io:t.isSymbolicLink()?Hc:t.isCharacterDevice()?mge:t.isBlockDevice()?gge:t.isSocket()?Oge:t.isFIFO()?Age:Zn,Sge=new Map,AS=t=>{let e=Sge.get(t);if(e)return e;let r=t.normalize("NFKD");return Sge.set(t,r),r},pge=new Map,DR=t=>{let e=pge.get(t);if(e)return e;let r=AS(t.toLowerCase());return pge.set(t,r),r},vR=class extends _S{constructor(){super({max:256})}},V0=class extends _S{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},Nge=Symbol("PathScurry setAsCwd"),Pr=class{name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#e;get mode(){return this.#e}#o;get nlink(){return this.#o}#l;get uid(){return this.#l}#E;get gid(){return this.#E}#a;get rdev(){return this.#a}#u;get blksize(){return this.#u}#i;get ino(){return this.#i}#n;get size(){return this.#n}#s;get blocks(){return this.#s}#f;get atimeMs(){return this.#f}#T;get mtimeMs(){return this.#T}#_;get ctimeMs(){return this.#_}#p;get birthtimeMs(){return this.#p}#S;get atime(){return this.#S}#d;get mtime(){return this.#d}#C;get ctime(){return this.#C}#R;get birthtime(){return this.#R}#g;#O;#h;#N;#v;#M;#c;#P;#I;#y;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Zn,n,i,o,s,a){this.name=e,this.#g=o?DR(e):AS(e),this.#c=r&qZe,this.nocase=o,this.roots=i,this.root=n||this,this.#P=s,this.#h=a.fullpath,this.#v=a.relative,this.#M=a.relativePosix,this.parent=a.parent,this.parent?this.#t=this.parent.#t:this.#t=dge(a.fs)}depth(){return this.#O!==void 0?this.#O:this.parent?this.#O=this.parent.depth()+1:this.#O=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#U(i):this.#U(i)}#U(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#P.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#P.set(this,r),this.#c&=~U0,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?DR(e):AS(e);for(let c of n)if(c.#g===i)return c;let o=this.parent?this.sep:"",s=this.#h?this.#h+o+e:void 0,a=this.newChild(e,Zn,{...r,parent:this,fullpath:s});return this.canReaddir()||(a.#c|=Ri),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#v!==void 0)return this.#v;let e=this.name,r=this.parent;if(!r)return this.#v=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#M!==void 0)return this.#M;let e=this.name,r=this.parent;if(!r)return this.#M=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#h!==void 0)return this.#h;let e=this.name,r=this.parent;if(!r)return this.#h=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#h=i}fullpathPosix(){if(this.#N!==void 0)return this.#N;if(this.sep==="/")return this.#N=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#N=`//?/${i}`:this.#N=i}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#N=n}isUnknown(){return(this.#c&qn)===Zn}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#c&qn)===Rge}isDirectory(){return(this.#c&qn)===io}isCharacterDevice(){return(this.#c&qn)===mge}isBlockDevice(){return(this.#c&qn)===gge}isFIFO(){return(this.#c&qn)===Age}isSocket(){return(this.#c&qn)===Oge}isSymbolicLink(){return(this.#c&Hc)===Hc}lstatCached(){return this.#c&Tge?this:void 0}readlinkCached(){return this.#I}realpathCached(){return this.#y}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#I)return!0;if(!this.parent)return!1;let e=this.#c&qn;return!(e!==Zn&&e!==Hc||this.#c&PR||this.#c&Ri)}calledReaddir(){return!!(this.#c&U0)}isENOENT(){return!!(this.#c&Ri)}isNamed(e){return this.nocase?this.#g===DR(e):this.#g===AS(e)}async readlink(){let e=this.#I;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#I=n}catch(r){this.#m(r.code);return}}readlinkSync(){let e=this.#I;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#I=n}catch(r){this.#m(r.code);return}}#G(e){this.#c|=U0;for(let r=e.provisional;r<e.length;r++){let n=e[r];n&&n.#L()}}#L(){this.#c&Ri||(this.#c=(this.#c|Ri)&pS,this.#D())}#D(){let e=this.children();e.provisional=0;for(let r of e)r.#L()}#b(){this.#c|=LR,this.#x()}#x(){if(this.#c&hS)return;let e=this.#c;(e&qn)===io&&(e&=pS),this.#c=e|hS,this.#D()}#w(e=""){e==="ENOTDIR"||e==="EPERM"?this.#x():e==="ENOENT"?this.#L():this.children().provisional=0}#A(e=""){e==="ENOTDIR"?this.parent.#x():e==="ENOENT"&&this.#L()}#m(e=""){let r=this.#c;r|=PR,e==="ENOENT"&&(r|=Ri),(e==="EINVAL"||e==="UNKNOWN")&&(r&=pS),this.#c=r,e==="ENOTDIR"&&this.parent&&this.parent.#x()}#V(e,r){return this.#$(e,r)||this.#B(e,r)}#B(e,r){let n=x0(e),i=this.newChild(e.name,n,{parent:this}),o=i.#c&qn;return o!==io&&o!==Hc&&o!==Zn&&(i.#c|=hS),r.unshift(i),r.provisional++,i}#$(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?DR(e.name):AS(e.name))===i.#g)return this.#F(e,i,n,r)}}#F(e,r,n,i){let o=r.name;return r.#c=r.#c&pS|x0(e),o!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#c&Ri)===0)try{return this.#j(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#A(e.code)}}lstatSync(){if((this.#c&Ri)===0)try{return this.#j(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#A(e.code)}}#j(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:o,blksize:s,blocks:a,ctime:c,ctimeMs:u,dev:_,gid:E,ino:T,mode:f,mtime:S,mtimeMs:d,nlink:p,rdev:g,size:N,uid:O}=e;this.#S=r,this.#f=n,this.#R=i,this.#p=o,this.#u=s,this.#s=a,this.#C=c,this.#_=u,this.#r=_,this.#E=E,this.#i=T,this.#e=f,this.#d=S,this.#T=d,this.#o=p,this.#a=g,this.#n=N,this.#l=O;let C=x0(e);this.#c=this.#c&pS|C|Tge,C!==Zn&&C!==io&&C!==Hc&&(this.#c|=hS)}#Y=[];#H=!1;#K(e){this.#H=!1;let r=this.#Y.slice();this.#Y.length=0,r.forEach(n=>n(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let o=n.slice(0,n.provisional);r?e(null,o):queueMicrotask(()=>e(null,o));return}if(this.#Y.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(o,s)=>{if(o)this.#w(o.code),n.provisional=0;else{for(let a of s)this.#V(a,n);this.#G(n)}this.#K(n.slice(0,n.provisional))})}#k;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#k)await this.#k;else{let n=()=>{};this.#k=new Promise(i=>n=i);try{for(let i of await this.#t.promises.readdir(r,{withFileTypes:!0}))this.#V(i,e);this.#G(e)}catch(i){this.#w(i.code),e.provisional=0}this.#k=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#t.readdirSync(r,{withFileTypes:!0}))this.#V(n,e);this.#G(e)}catch(n){this.#w(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#c&fge)return!1;let e=qn&this.#c;return e===Zn||e===io||e===Hc}shouldWalk(e,r){return(this.#c&io)===io&&!(this.#c&fge)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#y)return this.#y;if(!((LR|PR|Ri)&this.#c))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#y=this.resolve(e)}catch{this.#b()}}realpathSync(){if(this.#y)return this.#y;if(!((LR|PR|Ri)&this.#c))try{let e=this.#t.realpathSync(this.fullpath());return this.#y=this.resolve(e)}catch{this.#b()}}[Nge](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),i.#v=n.join(this.sep),i.#M=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#v=void 0,i.#M=void 0,i=i.parent}},yR=class t extends Pr{sep="\\";splitSep=zZe;constructor(e,r=Zn,n,i,o,s,a){super(e,r,n,i,o,s,a)}newChild(e,r=Zn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return w0.parse(e).root}getRoot(e){if(e=WZe(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new P_(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(hge,"$1\\"),e===r}},bR=class t extends Pr{splitSep="/";sep="/";constructor(e,r=Zn,n,i,o,s,a){super(e,r,n,i,o,s,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Zn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},UR=class{root;rootPath;roots;cwd;#t;#r;#e;nocase;#o;constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:o=16*1024,fs:s=dS}={}){this.#o=dge(s),(e instanceof URL||e.startsWith("file://"))&&(e=xZe(e));let a=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#t=new vR,this.#r=new vR,this.#e=new V0(o);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#o),this.roots[this.rootPath]=this.root;let u=this.root,_=c.length-1,E=r.sep,T=this.rootPath,f=!1;for(let S of c){let d=_--;u=u.child(S,{relative:new Array(d).fill("..").join(E),relativePosix:new Array(d).fill("..").join("/"),fullpath:T+=(f?"":E)+S}),f=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#e}resolve(...e){let r="";for(let o=e.length-1;o>=0;o--){let s=e[o];if(!(!s||s===".")&&(r=r?`${s}/${r}`:s,this.isAbsolute(s)))break}let n=this.#t.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return this.#t.set(r,i),i}resolvePosix(...e){let r="";for(let o=e.length-1;o>=0;o--){let s=e[o];if(!(!s||s===".")&&(r=r?`${s}/${r}`:s,this.isAbsolute(s)))break}let n=this.#r.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(o=>o.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:o,walkFilter:s}=r,a=[];(!o||o(e))&&a.push(n?e:e.fullpath());let c=new Set,u=(E,T)=>{c.add(E),E.readdirCB((f,S)=>{if(f)return T(f);let d=S.length;if(!d)return T();let p=()=>{--d===0&&T()};for(let g of S)(!o||o(g))&&a.push(n?g:g.fullpath()),i&&g.isSymbolicLink()?g.realpath().then(N=>N?.isUnknown()?N.lstat():N).then(N=>N?.shouldWalk(c,s)?u(N,p):p()):g.shouldWalk(c,s)?u(g,p):p()},!0)},_=e;return new Promise((E,T)=>{u(_,f=>{if(f)return T(f);E(a)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:o,walkFilter:s}=r,a=[];(!o||o(e))&&a.push(n?e:e.fullpath());let c=new Set([e]);for(let u of c){let _=u.readdirSync();for(let E of _){(!o||o(E))&&a.push(n?E:E.fullpath());let T=E;if(E.isSymbolicLink()){if(!(i&&(T=E.realpathSync())))continue;T.isUnknown()&&T.lstatSync()}T.shouldWalk(c,s)&&c.add(T)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:o,walkFilter:s}=r;(!o||o(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let c of a){let u=c.readdirSync();for(let _ of u){(!o||o(_))&&(yield n?_:_.fullpath());let E=_;if(_.isSymbolicLink()){if(!(i&&(E=_.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(a,s)&&a.add(E)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:o,walkFilter:s}=r,a=new Oa({objectMode:!0});(!o||o(e))&&a.write(n?e:e.fullpath());let c=new Set,u=[e],_=0,E=()=>{let T=!1;for(;!T;){let f=u.shift();if(!f){_===0&&a.end();return}_++,c.add(f);let S=(p,g,N=!1)=>{if(p)return a.emit("error",p);if(i&&!N){let O=[];for(let C of g)C.isSymbolicLink()&&O.push(C.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(O.length){Promise.all(O).then(()=>S(null,g,!0));return}}for(let O of g)O&&(!o||o(O))&&(a.write(n?O:O.fullpath())||(T=!0));_--;for(let O of g){let C=O.realpathCached()||O;C.shouldWalk(c,s)&&u.push(C)}T&&!a.flowing?a.once("drain",E):d||E()},d=!0;f.readdirCB(S,!0),d=!1}};return E(),a}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Pr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:o,walkFilter:s}=r,a=new Oa({objectMode:!0}),c=new Set;(!o||o(e))&&a.write(n?e:e.fullpath());let u=[e],_=0,E=()=>{let T=!1;for(;!T;){let f=u.shift();if(!f){_===0&&a.end();return}_++,c.add(f);let S=f.readdirSync();for(let d of S)(!o||o(d))&&(a.write(n?d:d.fullpath())||(T=!0));_--;for(let d of S){let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,s)&&u.push(p)}}T&&!a.flowing&&a.once("drain",E)};return E(),a}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Nge](r)}},P_=class extends UR{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,w0,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return w0.parse(e).root.toUpperCase()}newRoot(e){return new yR(this.rootPath,io,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},D_=class extends UR{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,UZe,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new bR(this.rootPath,io,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},mS=class extends D_{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},MDt=process.platform==="win32"?yR:bR,Cge=process.platform==="win32"?P_:process.platform==="darwin"?mS:D_;var ZZe=t=>t.length>=1,XZe=t=>t.length>=1,L_=class t{#t;#r;#e;length;#o;#l;#E;#a;#u;#i;#n=!0;constructor(e,r,n,i){if(!ZZe(e))throw new TypeError("empty pattern list");if(!XZe(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=r,this.#e=n,this.#o=i,this.#e===0){if(this.isUNC()){let[o,s,a,c,...u]=this.#t,[_,E,T,f,...S]=this.#r;u[0]===""&&(u.shift(),S.shift());let d=[o,s,a,c,""].join("/"),p=[_,E,T,f,""].join("/");this.#t=[d,...u],this.#r=[p,...S],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[o,...s]=this.#t,[a,...c]=this.#r;s[0]===""&&(s.shift(),c.shift());let u=o+"/",_=a+"/";this.#t=[u,...s],this.#r=[_,...c],this.length=this.#t.length}}}pattern(){return this.#t[this.#e]}isString(){return typeof this.#t[this.#e]=="string"}isGlobstar(){return this.#t[this.#e]===ur}isRegExp(){return this.#t[this.#e]instanceof RegExp}globString(){return this.#E=this.#E||(this.#e===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#l!==void 0?this.#l:this.hasMore()?(this.#l=new t(this.#t,this.#r,this.#e+1,this.#o),this.#l.#i=this.#i,this.#l.#u=this.#u,this.#l.#a=this.#a,this.#l):this.#l=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#o==="win32"&&this.#e===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#o==="win32"&&this.#e===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#i!==void 0?this.#i:this.#i=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#e===0?e:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#n)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#n?!1:(this.#n=!1,!0)}};var JZe=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",v_=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:o,platform:s=JZe}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=s,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:o,optimizationLevel:2,platform:s,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let r=new mn(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],o=r.globParts[n];if(!i||!o)throw new Error("invalid pattern object");for(;i[0]==="."&&o[0]===".";)i.shift(),o.shift();let s=new L_(i,o,0,this.platform),a=new mn(s.globString(),this.mmopts),c=o[o.length-1]==="**",u=s.isAbsolute();u?this.absolute.push(a):this.relative.push(a),c&&(u?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let r=e.fullpath(),n=`${r}/`,i=e.relative()||".",o=`${i}/`;for(let s of this.relative)if(s.match(i)||s.match(o))return!0;for(let s of this.absolute)if(s.match(r)||s.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var G0=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},$0=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),o=this.store.get(e);this.store.set(e,o===void 0?i:i&o)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},B0=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},gS=class t{hasWalkedCache;matches=new $0;subwalks=new B0;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new G0}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,o]of n){this.hasWalkedCache.storeWalked(i,o);let s=o.root(),a=o.isAbsolute()&&this.opts.absolute!==!1;if(s){i=i.resolve(s==="/"&&this.opts.root!==void 0?this.opts.root:s);let E=o.rest();if(E)o=E;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,u,_=!1;for(;typeof(c=o.pattern())=="string"&&(u=o.rest());)i=i.resolve(c),o=u,_=!0;if(c=o.pattern(),u=o.rest(),_){if(this.hasWalkedCache.hasWalked(i,o))continue;this.hasWalkedCache.storeWalked(i,o)}if(typeof c=="string"){let E=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,E);continue}else if(c===ur){(!i.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(i,o);let E=u?.pattern(),T=u?.rest();if(!u||(E===""||E===".")&&!T)this.matches.add(i,a,E===""||E===".");else if(E===".."){let f=i.parent||i;T?this.hasWalkedCache.hasWalked(f,T)||this.subwalks.add(f,T):this.matches.add(f,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let o of r)for(let s of n){let a=s.isAbsolute(),c=s.pattern(),u=s.rest();c===ur?i.testGlobstar(o,s,u,a):c instanceof RegExp?i.testRegExp(o,c,u,a):i.testString(o,c,u,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let o=n.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(e,o,n.rest(),i);else if(o===".."){let s=e.parent||e;this.subwalks.add(s,n)}else o instanceof RegExp&&this.testRegExp(e,o,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var QZe=(t,e)=>typeof t=="string"?new v_([t],e):Array.isArray(t)?new v_(t,e):t,xR=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#e;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#e=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=QZe(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#o(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#l(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let o=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let s=await o.realpath();s&&(s.isUnknown()||this.opts.stat)&&await s.lstat()}return this.matchCheckTest(o,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#o(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let o=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let s=o.realpathSync();s&&(s?.isUnknown()||this.opts.stat)&&s.lstatSync()}return this.matchCheckTest(o,r)}matchFinish(e,r){if(this.#o(e))return;if(!this.includeChildMatches&&this.#r?.add){let o=`${e.relativePosix()}/**`;this.#r.add(o)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let o=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(o+i)}else{let o=this.opts.posix?e.relativePosix():e.relative(),s=this.opts.dotRelative&&!o.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(o?s+o+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new gS(this.opts),n)}walkCB2(e,r,n,i){if(this.#l(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let o=1,s=()=>{--o===0&&i()};for(let[a,c,u]of n.matches.entries())this.#o(a)||(o++,this.match(a,c,u).then(()=>s()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;o++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,s):a.readdirCB((u,_)=>this.walkCB3(a,_,n,s),!0)}s()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let o=1,s=()=>{--o===0&&i()};for(let[a,c,u]of n.matches.entries())this.#o(a)||(o++,this.match(a,c,u).then(()=>s()));for(let[a,c]of n.subwalks.entries())o++,this.walkCB2(a,c,n.child(),s);s()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new gS(this.opts),n)}walkCB2Sync(e,r,n,i){if(this.#l(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let o=1,s=()=>{--o===0&&i()};for(let[a,c,u]of n.matches.entries())this.#o(a)||this.matchSync(a,c,u);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;o++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,s)}s()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let o=1,s=()=>{--o===0&&i()};for(let[a,c,u]of n.matches.entries())this.#o(a)||this.matchSync(a,c,u);for(let[a,c]of n.subwalks.entries())o++,this.walkCB2Sync(a,c,n.child(),s);s()}},RS=class extends xR{matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},OS=class extends xR{results;constructor(e,r,n){super(e,r,n),this.results=new Oa({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var tXe=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Oi=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=eXe(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||tXe,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?P_:r.platform==="darwin"?mS:r.platform?D_:Cge;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},o=this.pattern.map(c=>new mn(c,i)),[s,a]=o.reduce((c,u)=>(c[0].push(...u.set),c[1].push(...u.globParts),c),[[],[]]);this.patterns=s.map((c,u)=>{let _=a[u];if(!_)throw new Error("invalid pattern object");return new L_(c,_,0,this.platform)})}async walk(){return[...await new RS(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new RS(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new OS(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new OS(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var F0=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new mn(r,e).hasMagic())return!0;return!1};function wR(t,e={}){return new Oi(t,e).streamSync()}function Mge(t,e={}){return new Oi(t,e).stream()}function Pge(t,e={}){return new Oi(t,e).walkSync()}async function Ige(t,e={}){return new Oi(t,e).walk()}function VR(t,e={}){return new Oi(t,e).iterateSync()}function Dge(t,e={}){return new Oi(t,e).iterate()}var rXe=wR,nXe=Object.assign(Mge,{sync:wR}),iXe=VR,oXe=Object.assign(Dge,{sync:VR}),sXe=Object.assign(Pge,{stream:wR,iterate:VR}),y_=Object.assign(Ige,{glob:Ige,globSync:Pge,sync:sXe,globStream:Mge,stream:nXe,globStreamSync:wR,streamSync:rXe,globIterate:Dge,iterate:oXe,globIterateSync:VR,iterateSync:iXe,Glob:Oi,hasMagic:F0,escape:O_,unescape:mi});y_.glob=y_;function GR(t,e){let{changedFiles:r}=e;return r.some(n=>t===n||t.endsWith(n)||n.endsWith(t))}function aXe(t,e,r,n){let{fileChangeMap:i}=n,o=i.get(t);return o?o.status==="added"?!0:o.status==="removed"?!1:cXe(o.patch,e,r):!1}function NS(t,e){return GR(t.file.path,e)&&aXe(t.file.path,t.range.start.line,t.range.end.line,e)}function cXe(t,e,r){let n=t.split(`
|
|
110
110
|
`),i=0,o=!1,s=0,a=0,c=new Set,u=[];for(let _ of n){let E=_.match(/^@@\s+-\d+(?:,\d+)?\s+\+(\d+)(?:,(\d+))?\s+@@/);if(E){o&&s>0&&u.push([s,a]),i=parseInt(E[1],10);let T=E[2]?parseInt(E[2],10):1;s=i,a=i+T-1,o=!0;continue}if(o)if(_.startsWith("+"))c.add(i),i++;else{if(_.startsWith("-"))continue;_.startsWith("\\")||i++}}if(o&&s>0&&u.push([s,a]),!c.has(e))return!1;for(let[_,E]of u)if(e>=_&&e<=E&&r>=_&&r<=E)return!0;return!1}function uXe(t,e){let r=new Map;for(let s=0;s<e.length;s++){let a=e[s].fingerprint;a!==void 0&&(r.has(a)||r.set(a,[]),r.get(a).push(s))}let n=new Map;for(let s=0;s<t.length;s++){let a=t[s].fingerprint;a!==void 0&&(n.has(a)||n.set(a,[]),n.get(a).push(s))}let i=new Set,o=new Set;for(let[s,a]of n.entries()){let c=r.get(s);if(!c)continue;let u=a.length>1?[...a].sort((_,E)=>t[E].startLine-t[_].startLine):a;for(let _ of u)for(let E of c)if(!i.has(E)){o.add(_),i.add(E);break}}return o}function lXe(t,e){if(t.length===0||e.length===0)return new Set;let r=[];for(let o=0;o<t.length;o++){let s=t[o];for(let a=0;a<e.length;a++){let c=e[a];if(s.file!==c.file)continue;if(s.startLine===c.startLine&&s.endLine===c.endLine)r.push({newIndex:o,oldIndex:a,distance:0});else{let _=Math.abs(s.startLine-c.startLine);_<=50&&r.push({newIndex:o,oldIndex:a,distance:_})}}}r.sort((o,s)=>o.distance!==s.distance?o.distance-s.distance:t[s.newIndex].startLine-t[o.newIndex].startLine);let n=new Set,i=new Set;for(let o of r)n.has(o.newIndex)||i.has(o.oldIndex)||(n.add(o.newIndex),i.add(o.oldIndex));return n}function Lge(t,e){if(t.length===0||e.length===0)return new Set;let r=uXe(t,e),n=[];for(let _=0;_<t.length;_++)r.has(_)||n.push(_);let i=n.map(_=>t[_]),o=new Set;for(let _ of r){let E=t[_];for(let T=0;T<e.length;T++)if(e[T].fingerprint===E.fingerprint){o.add(T);break}}let s=e.filter((_,E)=>!o.has(E)),a=lXe(i,s),c=new Set;a.forEach(_=>{let E=n[_];c.add(E)});let u=new Set;return r.forEach(_=>u.add(_)),c.forEach(_=>u.add(_)),u}var $ge=ne(z0(),1);function Xo(t,e){return e.length===0?!1:(0,$ge.default)().add(e).ignores(t)}var kR=class t{environment;_filePaths=[];mode;eventEmitter;config;gitIgnoredFilesCache;skipPreExistingViolations=!1;diffMode;customDiffMode;constructor(e,r,n,i){this.environment=r,this.mode=n,this.eventEmitter=i||new Wn,this.config=e}static async initialize(e,r,n,i,o,s,a){let c=new t(e,r,n,i);if(c.skipPreExistingViolations=s?.skipPreExistingViolations??!1,n==="diff"){let _=c.environment.getWorkspaceRoot(),E=s?.include,T=s?.commitSelector;if(!T||!E)throw new Error("Commit selector and include are required in diff mode");let f=await fAe(_,{include:E,commitSelector:T}).catch(p=>{throw new Error(`Error running wispbit in diff mode:
|
|
@@ -174,7 +174,7 @@ ${i.join(`
|
|
|
174
174
|
`),i=n.findIndex(o=>o.startsWith("@@"));return i===-1?"":n.slice(i).join(`
|
|
175
175
|
`)}function lRe(t,e,r){let n=eJe(e,r),i=n.split(`
|
|
176
176
|
`),o=i.filter(a=>a.startsWith("+")&&!a.startsWith("+++")).length,s=i.filter(a=>a.startsWith("-")&&!a.startsWith("---")).length;return{filename:t,status:e===""?"added":"modified",patch:n,additions:o,deletions:s,sha:""}}import*as G_ from"fs/promises";import*as _Re from"os";import*as oO from"path";var nx=class{logFile;enabled=!1;constructor(){this.logFile=oO.join(_Re.homedir(),".wispbit","debug.log")}enable(){this.enabled=!0}disable(){this.enabled=!1}isEnabled(){return this.enabled}async log(e){if(this.enabled)try{await G_.mkdir(oO.dirname(this.logFile),{recursive:!0});let r=`[${new Date().toISOString()}] ${e}`;await G_.appendFile(this.logFile,`${r}
|
|
177
|
-
`)}catch{}}async clear(){try{await G_.unlink(this.logFile)}catch{}}},Ci=new nx;var sO=class extends pR{provider="cursor";dataSchema=eme;eventSchemas=QAe;generateConfig(){return{version:1,hooks:{afterFileEdit:[{command:this.getHookCommand("afterFileEdit")}],stop:[{command:this.getHookCommand("stop")}]}}}getConversationId(e){return e.conversation_id}async handleEvent(e,r){switch(e){case"afterFileEdit":return await this.handleAfterFileEdit(r);case"stop":return await this.handleStop(r);default:throw new Error(`Unknown Cursor event: ${e}`)}}async handleAfterFileEdit(e){let n=await this.get()||{metadata:{conversation_id:e.conversation_id,generation_id:e.generation_id,model:e.model,cursor_version:e.cursor_version,workspace_roots:e.workspace_roots,user_email:e.user_email},files:{}};if(n.metadata.generation_id=e.generation_id,e.edits.length===0){await this.save(n);return}let i=e.edits[e.edits.length-1];n.files[e.file_path]?n.files[e.file_path]={old_string:n.files[e.file_path].old_string,new_string:i.new_string,last_updated:new Date().toISOString()}:n.files[e.file_path]={old_string:i.old_string,new_string:i.new_string,last_updated:new Date().toISOString()},await this.save(n)}async handleStop(e){let r=null;try{r=await this.get()}catch{await Ci.log("[CursorHookHandler] Data format mismatch, clearing old data"),await this.clear();return}let n=r?Object.keys(r.files).length:0;if(!r||n===0){await Ci.log("[CursorHookHandler] No files to process"),await this.clear();return}await Ci.log(`[CursorHookHandler] Running powerlint on ${n} files
|
|
177
|
+
`)}catch{}}async clear(){try{await G_.unlink(this.logFile)}catch{}}},Ci=new nx;var sO=class extends pR{provider="cursor";dataSchema=eme;eventSchemas=QAe;generateConfig(){return{version:1,hooks:{afterFileEdit:[{command:this.getHookCommand("afterFileEdit")}],stop:[{command:this.getHookCommand("stop")}]}}}getConversationId(e){return e.conversation_id}async handleEvent(e,r){switch(e){case"afterFileEdit":return await this.handleAfterFileEdit(r);case"stop":return await this.handleStop(r);default:throw new Error(`Unknown Cursor event: ${e}`)}}async handleAfterFileEdit(e){let n=await this.get()||{metadata:{conversation_id:e.conversation_id,generation_id:e.generation_id,model:e.model,cursor_version:e.cursor_version,workspace_roots:e.workspace_roots,user_email:e.user_email},files:{}};if(n.metadata.generation_id=e.generation_id,e.edits.length===0){await this.save(n);return}let i=e.edits[e.edits.length-1];n.files[e.file_path]?n.files[e.file_path]={old_string:n.files[e.file_path].old_string,new_string:i.new_string,last_updated:new Date().toISOString()}:n.files[e.file_path]={old_string:i.old_string,new_string:i.new_string,last_updated:new Date().toISOString()},await this.save(n)}async handleStop(e){let r=null;try{r=await this.get()}catch{await Ci.log("[CursorHookHandler] Data format mismatch, clearing old data"),await this.clear();return}let n=r?Object.keys(r.files).length:0;if(!r||n===0){await Ci.log("[CursorHookHandler] No files to process"),await this.clear();return}await Ci.log(`[CursorHookHandler] Running powerlint on ${n} files.`);let{results:i,rules:o}=await this.runPowerlint(r);await Ci.log(`[CursorHookHandler] Found ${i.length} rule results. ${JSON.stringify(i,null,2)}`);let s=this.buildFollowupMessage(i,o);if(await Ci.log(`[CursorHookHandler] Built followup message: ${s?"yes":"no"}`),await this.clear(),!!s)return{followup_message:s}}transformToFileChanges(e){let r=[],n=e.metadata.workspace_roots;for(let[i,o]of Object.entries(e.files)){let s=i;if(vS.isAbsolute(i))for(let c of n){let u=vS.relative(c,i);if(!u.startsWith("..")&&!vS.isAbsolute(u)){s=u;break}}let a=lRe(s,o.old_string,o.new_string);r.push(a)}return Ci.log(`[CursorHookHandler] transformToFileChanges output: ${JSON.stringify(r.map(i=>({filename:i.filename,status:i.status,additions:i.additions,deletions:i.deletions,patch:i.patch})),null,2)}`),r}async runPowerlint(e){let r=e.metadata.workspace_roots[0];if(!r)throw new Error("No workspace root found in hook data");let n=new Ko({repositoryUrl:void 0,workspaceRoot:r}),i=await Bc.initialize(n,{});if("failed"in i)throw new Error(`Failed to initialize config: ${i.error}`);let o=i,s=new Wn,c=await new kc(o,n).loadAllRules(),u=new V_(o,n,s),_=this.transformToFileChanges(e);return{results:await u.execute(c,{mode:"custom-diff",customDiffOptions:{fileChanges:_}}),rules:c}}buildFollowupMessage(e,r){let n=e.filter(a=>a.matches.length>0);if(n.length===0)return null;let i=[`Please fix the following wispbit violations in the code you just edited:
|
|
178
178
|
`],o=new Map(r.map(a=>[a.id,a]));for(let a of n){let c=o.get(a.ruleId);if(!c)continue;i.push(`[${a.ruleId}] ${c.message}`);let u=[...a.matches].sort((_,E)=>_.file.path.localeCompare(E.file.path));for(let _ of u){let E=_.range.end.line!==_.range.start.line?`${_.range.start.line}-${_.range.end.line}`:`${_.range.start.line}`,T=_.description?` - ${_.description}`:"";i.push(` ${_.file.path}:${E}${T}`)}i.push("")}let s=n.reduce((a,c)=>a+c.matches.length,0);return i.push(`Total: ${s} issue(s)`),i.join(`
|
|
179
179
|
`)}};function aO(t){switch(t){case"cursor":return new sO;default:throw new Error(`Unknown hook provider: ${t}`)}}function ERe(){return["cursor"]}import*as Ca from"fs/promises";import*as TRe from"os";import*as yS from"path";var cO=class{getStorageDir(){return yS.join(TRe.homedir(),".wispbit","hooks")}getStoragePath(e){return yS.join(this.getStorageDir(),`${e}.json`)}async load(e){let r=this.getStoragePath(e);try{let n=await Ca.readFile(r,"utf-8");return JSON.parse(n)}catch{return null}}async save(e,r){let n=this.getStoragePath(e);await Ca.mkdir(yS.dirname(n),{recursive:!0}),await Ca.writeFile(n,JSON.stringify(r,null,2))}async clear(e){let r=this.getStoragePath(e);try{await Ca.unlink(r)}catch{}}};async function fRe(t,e){let[r,n]=t.split(".");if(!r||!n)throw new Error(`Invalid providerEvent format: ${t}. Expected "provider.event"`);let i=aO(r),o=new cO,s=i.eventSchemas[n];if(!s)throw new Error(`Unknown event: ${n} for provider: ${r}`);let a=s.parse(e),c=i.getConversationId(a);i._setContext(o,c);let u=await i.handleEvent(n,a);return i._clearContext(),u??{}}import{stripVTControlCharacters as GRe}from"node:util";import SO from"node:process";import mRe from"node:process";import EO from"node:process";var tJe=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let i=Object.getOwnPropertyDescriptor(t,r),o=Object.getOwnPropertyDescriptor(e,r);!rJe(i,o)&&n||Object.defineProperty(t,r,o)},rJe=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},nJe=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},iJe=(t,e)=>`/* Wrapped ${t}*/
|
|
180
180
|
${e}`,oJe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),sJe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),aJe=(t,e,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=iJe.bind(null,n,e.toString());Object.defineProperty(i,"name",sJe);let{writable:o,enumerable:s,configurable:a}=oJe;Object.defineProperty(t,"toString",{value:i,writable:o,enumerable:s,configurable:a})};function ix(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:n}=t;for(let i of Reflect.ownKeys(e))tJe(t,e,i,r);return nJe(t,e),aJe(t,e,n),t}var uO=new WeakMap,SRe=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,i=t.displayName||t.name||"<anonymous>",o=function(...s){if(uO.set(o,++n),n===1)r=t.apply(this,s),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return ix(o,t),uO.set(o,n),o};SRe.callCount=t=>{if(!uO.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return uO.get(t)};var pRe=SRe;var jc=[];jc.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&jc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&jc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var lO=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",ox=Symbol.for("signal-exit emitter"),sx=globalThis,cJe=Object.defineProperty.bind(Object),ax=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(sx[ox])return sx[ox];cJe(sx,ox,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},_O=class{},uJe=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),cx=class extends _O{onExit(){return()=>{}}load(){}unload(){}},ux=class extends _O{#t=lx.platform==="win32"?"SIGINT":"SIGHUP";#r=new ax;#e;#o;#l;#E={};#a=!1;constructor(e){super(),this.#e=e,this.#E={};for(let r of jc)this.#E[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#l=e.reallyExit,this.#o=e.emit}onExit(e,r){if(!lO(this.#e))return()=>{};this.#a===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let e of jc)try{let r=this.#E[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#i(e,...r),this.#e.reallyExit=e=>this.#u(e)}}unload(){this.#a&&(this.#a=!1,jc.forEach(e=>{let r=this.#E[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#l,this.#r.count-=1)}#u(e){return lO(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#l.call(this.#e,this.#e.exitCode)):0}#i(e,...r){let n=this.#o;if(e==="exit"&&lO(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},lx=globalThis.process,{onExit:dRe,load:Yyt,unload:Hyt}=uJe(lO(lx)?new ux(lx):new cx);var hRe=EO.stderr.isTTY?EO.stderr:EO.stdout.isTTY?EO.stdout:void 0,lJe=hRe?pRe(()=>{dRe(()=>{hRe.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},ARe=lJe;var TO=!1,$_={};$_.show=(t=mRe.stderr)=>{t.isTTY&&(TO=!1,t.write("\x1B[?25h"))};$_.hide=(t=mRe.stderr)=>{t.isTTY&&(ARe(),TO=!0,t.write("\x1B[?25l"))};$_.toggle=(t,e)=>{t!==void 0&&(TO=t),TO?$_.show(e):$_.hide(e)};var _x=$_;var Ex={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var bS=Ex,tbt=Object.keys(Ex);var Kc={};On(Kc,{error:()=>dJe,info:()=>fJe,success:()=>SJe,warning:()=>pJe});import EJe from"node:tty";var TJe=EJe?.WriteStream?.prototype?.hasColors?.()??!1,ke=(t,e)=>{if(!TJe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0;for(;s!==-1;)a+=o.slice(c,s)+r,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},ibt=ke(0,0),obt=ke(1,22),sbt=ke(2,22),abt=ke(3,23),cbt=ke(4,24),ubt=ke(53,55),lbt=ke(7,27),_bt=ke(8,28),Ebt=ke(9,29),Tbt=ke(30,39),gRe=ke(31,39),RRe=ke(32,39),ORe=ke(33,39),NRe=ke(34,39),fbt=ke(35,39),Sbt=ke(36,39),pbt=ke(37,39),dbt=ke(90,39),hbt=ke(40,49),Abt=ke(41,49),mbt=ke(42,49),gbt=ke(43,49),Rbt=ke(44,49),Obt=ke(45,49),Nbt=ke(46,49),Cbt=ke(47,49),Ibt=ke(100,49),Mbt=ke(91,39),Pbt=ke(92,39),Dbt=ke(93,39),Lbt=ke(94,39),vbt=ke(95,39),ybt=ke(96,39),bbt=ke(97,39),Ubt=ke(101,49),xbt=ke(102,49),wbt=ke(103,49),Vbt=ke(104,49),Gbt=ke(105,49),$bt=ke(106,49),Bbt=ke(107,49);import CRe from"node:process";function US(){let{env:t}=CRe,{TERM:e,TERM_PROGRAM:r}=t;return CRe.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var fO=US(),fJe=NRe(fO?"\u2139":"i"),SJe=RRe(fO?"\u2714":"\u221A"),pJe=ORe(fO?"\u26A0":"\u203C"),dJe=gRe(fO?"\u2716":"\xD7");function Tx({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var hJe=Tx();function fx(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(hJe,"")}var wRe=ne(xRe(),1);function dx({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import oo from"node:process";var OJe=3,hx=class{#t=0;start(){this.#t++,this.#t===1&&this.#r()}stop(){if(this.#t<=0)throw new Error("`stop` called more times than `start`");this.#t--,this.#t===0&&this.#e()}#r(){oo.platform==="win32"||!oo.stdin.isTTY||(oo.stdin.setRawMode(!0),oo.stdin.on("data",this.#o),oo.stdin.resume())}#e(){oo.stdin.isTTY&&(oo.stdin.off("data",this.#o),oo.stdin.pause(),oo.stdin.setRawMode(!1))}#o(e){e[0]===OJe&&oo.emit("SIGINT")}},NJe=new hx,Ax=NJe;var mx=class{#t=0;#r=!1;#e=0;#o=-1;#l=0;#E=0;#a;#u;#i;#n;#s;#f;#T;#_;#p;#S;#d;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#a={color:"cyan",stream:SO.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#a.color,this.spinner=this.#a.spinner,this.#s=this.#a.interval,this.#i=this.#a.stream,this.#f=typeof this.#a.isEnabled=="boolean"?this.#a.isEnabled:dx({stream:this.#i}),this.#T=typeof this.#a.isSilent=="boolean"?this.#a.isSilent:!1,this.text=this.#a.text,this.prefixText=this.#a.prefixText,this.suffixText=this.#a.suffixText,this.indent=this.#a.indent,SO.env.NODE_ENV==="test"&&(this._stream=this.#i,this._isEnabled=this.#f,Object.defineProperty(this,"_linesToClear",{get(){return this.#t},set(r){this.#t=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#_}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#_=e,this.#h()}get interval(){return this.#s??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#o=-1,this.#s=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(r=>typeof r!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!US())this.#u=bS.line;else if(e===void 0)this.#u=bS.dots;else if(e!=="default"&&bS[e])this.#u=bS[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#p}set text(e=""){this.#p=e,this.#h()}get prefixText(){return this.#S}set prefixText(e=""){this.#S=e,this.#h()}get suffixText(){return this.#d}set suffixText(e=""){this.#d=e,this.#h()}get isSpinning(){return this.#n!==void 0}#C(e,r,n=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?n?r+i:i+r:""}#R(e=this.#S,r=" "){return this.#C(e,r,!1)}#g(e=this.#d,r=" "){return this.#C(e,r,!0)}#O(e,r){let n=0;for(let i of fx(e).split(`
|