@seeka-labs/cli-apps 1.1.24 → 1.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/LICENSE +19 -19
  2. package/dist/index.js +10 -10
  3. package/dist/index.js.map +4 -4
  4. package/dist/init-templates/aws-lambda/.example.gitignore +48 -48
  5. package/dist/init-templates/aws-lambda/.gitlab-ci.yml +23 -23
  6. package/dist/init-templates/aws-lambda/.nvmrc +1 -1
  7. package/dist/init-templates/aws-lambda/README.md +76 -76
  8. package/dist/init-templates/aws-lambda/jest.config.js +4 -4
  9. package/dist/init-templates/aws-lambda/package.json +51 -54
  10. package/dist/init-templates/aws-lambda/src/index.test.ts +6 -6
  11. package/dist/init-templates/aws-lambda/src/lib/logging/index.ts +87 -87
  12. package/dist/init-templates/aws-lambda/src/lib/state/redis/index.ts +64 -64
  13. package/dist/init-templates/aws-lambda/src/lib/state/seeka/installations.ts +66 -66
  14. package/dist/init-templates/aws-lambda/src/routes/seekaAppWebhook.ts +193 -193
  15. package/dist/init-templates/azure-function/.example.gitignore +47 -47
  16. package/dist/init-templates/azure-function/README.md +107 -107
  17. package/dist/init-templates/azure-function/jest.config.js +4 -4
  18. package/dist/init-templates/azure-function/package.json +45 -48
  19. package/dist/init-templates/azure-function/scripts/dev-queue-setup.js +29 -29
  20. package/dist/init-templates/azure-function/src/functions/healthCheck.ts +13 -13
  21. package/dist/init-templates/azure-function/src/functions/pollingExample.ts +39 -39
  22. package/dist/init-templates/azure-function/src/functions/queueExample.ts +66 -66
  23. package/dist/init-templates/azure-function/src/functions/seekaAppWebhook.ts +236 -236
  24. package/dist/init-templates/azure-function/src/index.test.ts +6 -6
  25. package/dist/init-templates/azure-function/src/lib/browser/index.ts +54 -54
  26. package/dist/init-templates/azure-function/src/lib/browser/models/index.ts +6 -6
  27. package/dist/init-templates/azure-function/src/lib/jobs/index.ts +95 -95
  28. package/dist/init-templates/azure-function/src/lib/logging/index.ts +92 -92
  29. package/dist/init-templates/azure-function/src/lib/state/redis/index.ts +64 -64
  30. package/dist/init-templates/azure-function/src/lib/state/seeka/installations.ts +66 -66
  31. package/dist/init-templates/browser/.editorconfig +14 -14
  32. package/dist/init-templates/browser/.eslintrc.cjs +1 -1
  33. package/dist/init-templates/browser/.yarnrc +1 -1
  34. package/dist/init-templates/browser/jest.config.js +11 -11
  35. package/dist/init-templates/browser/package.json +3 -3
  36. package/dist/init-templates/browser/scripts/esbuild/build-browser-plugin.mjs +110 -110
  37. package/dist/init-templates/browser/scripts/esbuild/plugins/importAsGlobals.mjs +38 -38
  38. package/dist/init-templates/browser/src/browser.ts +12 -12
  39. package/dist/init-templates/browser/src/plugin/index.test.ts +6 -6
  40. package/dist/init-templates/browser/src/plugin/index.ts +49 -49
  41. package/dist/init-templates/browser/tsconfig.json +34 -34
  42. package/dist/init-templates/netlify-function/.env.example +17 -17
  43. package/dist/init-templates/netlify-function/.example.gitignore +36 -36
  44. package/dist/init-templates/netlify-function/.nvmrc +1 -1
  45. package/dist/init-templates/netlify-function/.vscode/launch.json +44 -44
  46. package/dist/init-templates/netlify-function/README.md +61 -61
  47. package/dist/init-templates/netlify-function/jest.config.js +4 -4
  48. package/dist/init-templates/netlify-function/netlify.toml +6 -6
  49. package/dist/init-templates/netlify-function/package.json +11 -14
  50. package/dist/init-templates/netlify-function/src/api/example-job-background/index.ts +51 -51
  51. package/dist/init-templates/netlify-function/src/api/polling-example-job-scheduled/index.ts +45 -45
  52. package/dist/init-templates/netlify-function/src/api/seeka-app-webhook/index.ts +216 -216
  53. package/dist/init-templates/netlify-function/src/index.test.ts +6 -6
  54. package/dist/init-templates/netlify-function/src/lib/jobs/index.ts +67 -67
  55. package/dist/init-templates/netlify-function/src/lib/logging/index.ts +90 -90
  56. package/dist/init-templates/netlify-function/src/lib/state/redis/index.ts +64 -64
  57. package/dist/init-templates/netlify-function/src/lib/state/seeka/installations.ts +66 -66
  58. package/package.json +7 -7
package/LICENSE CHANGED
@@ -1,19 +1,19 @@
1
- MIT License
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  #! /usr/bin/env node
2
- "use strict";var oo=Object.create;var Ot=Object.defineProperty;var io=Object.getOwnPropertyDescriptor;var so=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var _=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var uo=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of so(e))!mo.call(r,o)&&o!==t&&Ot(r,o,{get:()=>e[o],enumerable:!(n=io(e,o))||n.enumerable});return r};var U=(r,e,t)=>(t=r!=null?oo(ao(r)):{},uo(e||!r||!r.__esModule?Ot(t,"default",{value:r,enumerable:!0}):t,r));var kt=_(Ce=>{var Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ce.encode=function(r){if(0<=r&&r<Et.length)return Et[r];throw new TypeError("Must be between 0 and 63: "+r)};Ce.decode=function(r){var e=65,t=90,n=97,o=122,i=48,s=57,u=43,a=47,m=26,l=52;return e<=r&&r<=t?r-e:n<=r&&r<=o?r-n+m:i<=r&&r<=s?r-i+l:r==u?62:r==a?63:-1}});var ke=_(Ee=>{var Mt=kt(),Oe=5,Lt=1<<Oe,Tt=Lt-1,jt=Lt;function lo(r){return r<0?(-r<<1)+1:(r<<1)+0}function fo(r){var e=(r&1)===1,t=r>>1;return e?-t:t}Ee.encode=function(e){var t="",n,o=lo(e);do n=o&Tt,o>>>=Oe,o>0&&(n|=jt),t+=Mt.encode(n);while(o>0);return t};Ee.decode=function(e,t,n){var o=e.length,i=0,s=0,u,a;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(a=Mt.decode(e.charCodeAt(t++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));u=!!(a&jt),a&=Tt,i=i+(a<<s),s+=Oe}while(u);n.value=fo(i),n.rest=t}});var K=_(O=>{function co(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}O.getArg=co;var Nt=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,po=/^data:.+\,.+$/;function ne(r){var e=r.match(Nt);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}O.urlParse=ne;function G(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}O.urlGenerate=G;function Me(r){var e=r,t=ne(r);if(t){if(!t.path)return r;e=t.path}for(var n=O.isAbsolute(e),o=e.split(/\/+/),i,s=0,u=o.length-1;u>=0;u--)i=o[u],i==="."?o.splice(u,1):i===".."?s++:s>0&&(i===""?(o.splice(u+1,s),s=0):(o.splice(u,2),s--));return e=o.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,G(t)):e}O.normalize=Me;function It(r,e){r===""&&(r="."),e===""&&(e=".");var t=ne(e),n=ne(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),G(t);if(t||e.match(po))return e;if(n&&!n.host&&!n.path)return n.host=e,G(n);var o=e.charAt(0)==="/"?e:Me(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,G(n)):o}O.join=It;O.isAbsolute=function(r){return r.charAt(0)==="/"||Nt.test(r)};function ho(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}O.relative=ho;var Pt=function(){var r=Object.create(null);return!("__proto__"in r)}();function $t(r){return r}function go(r){return Rt(r)?"$"+r:r}O.toSetString=Pt?$t:go;function vo(r){return Rt(r)?r.slice(1):r}O.fromSetString=Pt?$t:vo;function Rt(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function _o(r,e,t){var n=z(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:z(r.name,e.name)}O.compareByOriginalPositions=_o;function xo(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=z(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:z(r.name,e.name)}O.compareByGeneratedPositionsDeflated=xo;function z(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function yo(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=z(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:z(r.name,e.name)}O.compareByGeneratedPositionsInflated=yo;function bo(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}O.parseSourceMapInput=bo;function wo(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=ne(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=It(G(n),e)}return Me(e)}O.computeSourceURL=wo});var je=_(Vt=>{var Le=K(),Te=Object.prototype.hasOwnProperty,F=typeof Map<"u";function I(){this._array=[],this._set=F?new Map:Object.create(null)}I.fromArray=function(e,t){for(var n=new I,o=0,i=e.length;o<i;o++)n.add(e[o],t);return n};I.prototype.size=function(){return F?this._set.size:Object.getOwnPropertyNames(this._set).length};I.prototype.add=function(e,t){var n=F?e:Le.toSetString(e),o=F?this.has(e):Te.call(this._set,n),i=this._array.length;(!o||t)&&this._array.push(e),o||(F?this._set.set(e,i):this._set[n]=i)};I.prototype.has=function(e){if(F)return this._set.has(e);var t=Le.toSetString(e);return Te.call(this._set,t)};I.prototype.indexOf=function(e){if(F){var t=this._set.get(e);if(t>=0)return t}else{var n=Le.toSetString(e);if(Te.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};I.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};I.prototype.toArray=function(){return this._array.slice()};Vt.ArraySet=I});var qt=_(Dt=>{var Ft=K();function So(r,e){var t=r.generatedLine,n=e.generatedLine,o=r.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=o||Ft.compareByGeneratedPositionsInflated(r,e)<=0}function ce(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ce.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};ce.prototype.add=function(e){So(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};ce.prototype.toArray=function(){return this._sorted||(this._array.sort(Ft.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Dt.MappingList=ce});var Ne=_(Ht=>{var oe=ke(),S=K(),pe=je().ArraySet,Ao=qt().MappingList;function M(r){r||(r={}),this._file=S.getArg(r,"file",null),this._sourceRoot=S.getArg(r,"sourceRoot",null),this._skipValidation=S.getArg(r,"skipValidation",!1),this._sources=new pe,this._names=new pe,this._mappings=new Ao,this._sourcesContents=null}M.prototype._version=3;M.fromSourceMap=function(e){var t=e.sourceRoot,n=new M({file:e.file,sourceRoot:t});return e.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,t!=null&&(i.source=S.relative(t,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),e.sources.forEach(function(o){var i=o;t!==null&&(i=S.relative(t,o)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};M.prototype.addMapping=function(e){var t=S.getArg(e,"generated"),n=S.getArg(e,"original",null),o=S.getArg(e,"source",null),i=S.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};M.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=S.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[S.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[S.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};M.prototype.applySourceMap=function(e,t,n){var o=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=S.relative(i,o));var s=new pe,u=new pe;this._mappings.unsortedForEach(function(a){if(a.source===o&&a.originalLine!=null){var m=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});m.source!=null&&(a.source=m.source,n!=null&&(a.source=S.join(n,a.source)),i!=null&&(a.source=S.relative(i,a.source)),a.originalLine=m.line,a.originalColumn=m.column,m.name!=null&&(a.name=m.name))}var l=a.source;l!=null&&!s.has(l)&&s.add(l);var c=a.name;c!=null&&!u.has(c)&&u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(a){var m=e.sourceContentFor(a);m!=null&&(n!=null&&(a=S.join(n,a)),i!=null&&(a=S.relative(i,a)),this.setSourceContent(a,m))},this)};M.prototype._validateMapping=function(e,t,n,o){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!o)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:o}))}};M.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,o=0,i=0,s=0,u="",a,m,l,c,f=this._mappings.toArray(),h=0,g=f.length;h<g;h++){if(m=f[h],a="",m.generatedLine!==t)for(e=0;m.generatedLine!==t;)a+=";",t++;else if(h>0){if(!S.compareByGeneratedPositionsInflated(m,f[h-1]))continue;a+=","}a+=oe.encode(m.generatedColumn-e),e=m.generatedColumn,m.source!=null&&(c=this._sources.indexOf(m.source),a+=oe.encode(c-s),s=c,a+=oe.encode(m.originalLine-1-o),o=m.originalLine-1,a+=oe.encode(m.originalColumn-n),n=m.originalColumn,m.name!=null&&(l=this._names.indexOf(m.name),a+=oe.encode(l-i),i=l)),u+=a}return u};M.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=S.relative(t,n));var o=S.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};M.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};M.prototype.toString=function(){return JSON.stringify(this.toJSON())};Ht.SourceMapGenerator=M});var Bt=_(D=>{D.GREATEST_LOWER_BOUND=1;D.LEAST_UPPER_BOUND=2;function Ie(r,e,t,n,o,i){var s=Math.floor((e-r)/2)+r,u=o(t,n[s],!0);return u===0?s:u>0?e-s>1?Ie(s,e,t,n,o,i):i==D.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-r>1?Ie(r,s,t,n,o,i):i==D.LEAST_UPPER_BOUND?s:r<0?-1:r}D.search=function(e,t,n,o){if(t.length===0)return-1;var i=Ie(-1,t.length,e,t,n,o||D.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(t[i],t[i-1],!0)===0;)--i;return i}});var Ut=_(Wt=>{function Pe(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Co(r,e){return Math.round(r+Math.random()*(e-r))}function $e(r,e,t,n){if(t<n){var o=Co(t,n),i=t-1;Pe(r,o,n);for(var s=r[n],u=t;u<n;u++)e(r[u],s)<=0&&(i+=1,Pe(r,i,u));Pe(r,i+1,u);var a=i+1;$e(r,e,t,a-1),$e(r,e,a+1,n)}}Wt.quickSort=function(r,e){$e(r,e,0,r.length-1)}});var zt=_(de=>{var p=K(),Re=Bt(),J=je().ArraySet,Oo=ke(),ie=Ut().quickSort;function y(r,e){var t=r;return typeof r=="string"&&(t=p.parseSourceMapInput(r)),t.sections!=null?new T(t,e):new A(t,e)}y.fromSourceMap=function(r,e){return A.fromSourceMap(r,e)};y.prototype._version=3;y.prototype.__generatedMappings=null;Object.defineProperty(y.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});y.prototype.__originalMappings=null;Object.defineProperty(y.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});y.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};y.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};y.GENERATED_ORDER=1;y.ORIGINAL_ORDER=2;y.GREATEST_LOWER_BOUND=1;y.LEAST_UPPER_BOUND=2;y.prototype.eachMapping=function(e,t,n){var o=t||null,i=n||y.GENERATED_ORDER,s;switch(i){case y.GENERATED_ORDER:s=this._generatedMappings;break;case y.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;s.map(function(a){var m=a.source===null?null:this._sources.at(a.source);return m=p.computeSourceURL(u,m,this._sourceMapURL),{source:m,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn,originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name===null?null:this._names.at(a.name)}},this).forEach(e,o)};y.prototype.allGeneratedPositionsFor=function(e){var t=p.getArg(e,"line"),n={source:p.getArg(e,"source"),originalLine:t,originalColumn:p.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,Re.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var u=s.originalLine;s&&s.originalLine===u;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==a;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};de.SourceMapConsumer=y;function A(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sources"),i=p.getArg(t,"names",[]),s=p.getArg(t,"sourceRoot",null),u=p.getArg(t,"sourcesContent",null),a=p.getArg(t,"mappings"),m=p.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=p.normalize(s)),o=o.map(String).map(p.normalize).map(function(l){return s&&p.isAbsolute(s)&&p.isAbsolute(l)?p.relative(s,l):l}),this._names=J.fromArray(i.map(String),!0),this._sources=J.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(l){return p.computeSourceURL(s,l,e)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=a,this._sourceMapURL=e,this.file=m}A.prototype=Object.create(y.prototype);A.prototype.consumer=y;A.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=p.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};A.fromSourceMap=function(e,t){var n=Object.create(A.prototype),o=n._names=J.fromArray(e._names.toArray(),!0),i=n._sources=J.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(h){return p.computeSourceURL(n.sourceRoot,h,t)});for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],a=n.__originalMappings=[],m=0,l=s.length;m<l;m++){var c=s[m],f=new Gt;f.generatedLine=c.generatedLine,f.generatedColumn=c.generatedColumn,c.source&&(f.source=i.indexOf(c.source),f.originalLine=c.originalLine,f.originalColumn=c.originalColumn,c.name&&(f.name=o.indexOf(c.name)),a.push(f)),u.push(f)}return ie(n.__originalMappings,p.compareByOriginalPositions),n};A.prototype._version=3;Object.defineProperty(A.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Gt(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}A.prototype._parseMappings=function(e,t){for(var n=1,o=0,i=0,s=0,u=0,a=0,m=e.length,l=0,c={},f={},h=[],g=[],x,j,C,W,Ct;l<m;)if(e.charAt(l)===";")n++,l++,o=0;else if(e.charAt(l)===",")l++;else{for(x=new Gt,x.generatedLine=n,W=l;W<m&&!this._charIsMappingSeparator(e,W);W++);if(j=e.slice(l,W),C=c[j],C)l+=j.length;else{for(C=[];l<W;)Oo.decode(e,l,f),Ct=f.value,l=f.rest,C.push(Ct);if(C.length===2)throw new Error("Found a source, but no line and column");if(C.length===3)throw new Error("Found a source and line, but no column");c[j]=C}x.generatedColumn=o+C[0],o=x.generatedColumn,C.length>1&&(x.source=u+C[1],u+=C[1],x.originalLine=i+C[2],i=x.originalLine,x.originalLine+=1,x.originalColumn=s+C[3],s=x.originalColumn,C.length>4&&(x.name=a+C[4],a+=C[4])),g.push(x),typeof x.originalLine=="number"&&h.push(x)}ie(g,p.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,ie(h,p.compareByOriginalPositions),this.__originalMappings=h};A.prototype._findMapping=function(e,t,n,o,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return Re.search(e,t,i,s)};A.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};A.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",p.compareByGeneratedPositionsDeflated,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=p.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=p.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=p.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:p.getArg(o,"originalLine",null),column:p.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};A.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};A.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=p.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=p.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')};A.prototype.generatedPositionFor=function(e){var t=p.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:p.getArg(e,"line"),originalColumn:p.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:p.getArg(i,"generatedLine",null),column:p.getArg(i,"generatedColumn",null),lastColumn:p.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};de.BasicSourceMapConsumer=A;function T(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new J,this._names=new J;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var u=p.getArg(s,"offset"),a=p.getArg(u,"line"),m=p.getArg(u,"column");if(a<i.line||a===i.line&&m<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=u,{generatedOffset:{generatedLine:a+1,generatedColumn:m+1},consumer:new y(p.getArg(s,"map"),e)}})}T.prototype=Object.create(y.prototype);T.prototype.constructor=y;T.prototype._version=3;Object.defineProperty(T.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});T.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=Re.search(t,this._sections,function(i,s){var u=i.generatedLine-s.generatedOffset.generatedLine;return u||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};T.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};T.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};T.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(p.getArg(e,"source"))!==-1){var o=n.consumer.generatedPositionFor(e);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};T.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var u=i[s],a=o.consumer._sources.at(u.source);a=p.computeSourceURL(o.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var m=null;u.name&&(m=o.consumer._names.at(u.name),this._names.add(m),m=this._names.indexOf(m));var l={source:a,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:m};this.__generatedMappings.push(l),typeof l.originalLine=="number"&&this.__originalMappings.push(l)}ie(this.__generatedMappings,p.compareByGeneratedPositionsDeflated),ie(this.__originalMappings,p.compareByOriginalPositions)};de.IndexedSourceMapConsumer=T});var Jt=_(Kt=>{var Eo=Ne().SourceMapGenerator,he=K(),ko=/(\r?\n)/,Mo=10,Q="$$$isSourceNode$$$";function k(r,e,t,n,o){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=o??null,this[Q]=!0,n!=null&&this.add(n)}k.fromStringWithSourceMap=function(e,t,n){var o=new k,i=e.split(ko),s=0,u=function(){var f=g(),h=g()||"";return f+h;function g(){return s<i.length?i[s++]:void 0}},a=1,m=0,l=null;return t.eachMapping(function(f){if(l!==null)if(a<f.generatedLine)c(l,u()),a++,m=0;else{var h=i[s]||"",g=h.substr(0,f.generatedColumn-m);i[s]=h.substr(f.generatedColumn-m),m=f.generatedColumn,c(l,g),l=f;return}for(;a<f.generatedLine;)o.add(u()),a++;if(m<f.generatedColumn){var h=i[s]||"";o.add(h.substr(0,f.generatedColumn)),i[s]=h.substr(f.generatedColumn),m=f.generatedColumn}l=f},this),s<i.length&&(l&&c(l,u()),o.add(i.splice(s).join(""))),t.sources.forEach(function(f){var h=t.sourceContentFor(f);h!=null&&(n!=null&&(f=he.join(n,f)),o.setSourceContent(f,h))}),o;function c(f,h){if(f===null||f.source===void 0)o.add(h);else{var g=n?he.join(n,f.source):f.source;o.add(new k(f.originalLine,f.originalColumn,g,h,f.name))}}};k.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[Q]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[Q]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.walk=function(e){for(var t,n=0,o=this.children.length;n<o;n++)t=this.children[n],t[Q]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};k.prototype.join=function(e){var t,n,o=this.children.length;if(o>0){for(t=[],n=0;n<o-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};k.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[Q]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};k.prototype.setSourceContent=function(e,t){this.sourceContents[he.toSetString(e)]=t};k.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Q]&&this.children[t].walkSourceContents(e);for(var o=Object.keys(this.sourceContents),t=0,n=o.length;t<n;t++)e(he.fromSetString(o[t]),this.sourceContents[o[t]])};k.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};k.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new Eo(e),o=!1,i=null,s=null,u=null,a=null;return this.walk(function(m,l){t.code+=m,l.source!==null&&l.line!==null&&l.column!==null?((i!==l.source||s!==l.line||u!==l.column||a!==l.name)&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),i=l.source,s=l.line,u=l.column,a=l.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,f=m.length;c<f;c++)m.charCodeAt(c)===Mo?(t.line++,t.column=0,c+1===f?(i=null,o=!1):o&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++}),this.walkSourceContents(function(m,l){n.setSourceContent(m,l)}),{code:t.code,map:n}};Kt.SourceNode=k});var Qt=_(ge=>{ge.SourceMapGenerator=Ne().SourceMapGenerator;ge.SourceMapConsumer=zt().SourceMapConsumer;ge.SourceNode=Jt().SourceNode});var Yt=_((Ra,Xt)=>{var Lo=Object.prototype.toString,Ve=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function To(r){return Lo.call(r).slice(8,-1)==="ArrayBuffer"}function jo(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return Ve?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function No(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Ve?Buffer.from(r,e):new Buffer(r,e)}function Io(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return To(r)?jo(r,e,t):typeof r=="string"?No(r,e):Ve?Buffer.from(r):new Buffer(r)}Xt.exports=Io});var sr=_((H,He)=>{var Po=Qt().SourceMapConsumer,Fe=require("path"),N;try{N=require("fs"),(!N.existsSync||!N.readFileSync)&&(N=null)}catch{}var $o=Yt();function Zt(r,e){return r.require(e)}var er=!1,tr=!1,De=!1,se="auto",q={},ae={},Ro=/^data:application\/json[^,]+base64,/,R=[],V=[];function Be(){return se==="browser"?!0:se==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Vo(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function Fo(){return typeof process=="object"&&process!==null?process.version:""}function Do(){if(typeof process=="object"&&process!==null)return process.stderr}function qo(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function ve(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var We=ve(R);R.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,o){return o?"":"/"})),r in q)return q[r];var e="";try{if(N)N.existsSync(r)&&(e=N.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return q[r]=e});function qe(r,e){if(!r)return e;var t=Fe.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),o=n?n[0]:"",i=t.slice(o.length);return o&&/^\/\w\:/.test(i)?(o+="/",o+Fe.resolve(t.slice(o.length),e).replace(/\\/g,"/")):o+Fe.resolve(t.slice(o.length),e)}function Ho(r){var e;if(Be())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=We(r);for(var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,i,s;s=o.exec(e);)i=s;return i?i[1]:null}var Ue=ve(V);V.push(function(r){var e=Ho(r);if(!e)return null;var t;if(Ro.test(e)){var n=e.slice(e.indexOf(",")+1);t=$o(n,"base64").toString(),e=r}else e=qe(r,e),t=We(e);return t?{url:e,map:t}:null});function Ge(r){var e=ae[r.source];if(!e){var t=Ue(r.source);t?(e=ae[r.source]={url:t.url,map:new Po(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(o,i){var s=e.map.sourcesContent[i];if(s){var u=qe(e.url,o);q[u]=s}})):e=ae[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=qe(e.url,n.source),n}return r}function nr(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=Ge({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+nr(e[2])+")":r}function Bo(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",i=this.getFunctionName(),s=!0,u=this.isConstructor(),a=!(this.isToplevel()||u);if(a){var m=this.getTypeName();m==="[object Object]"&&(m="null");var l=this.getMethodName();i?(m&&i.indexOf(m)!=0&&(o+=m+"."),o+=i,l&&i.indexOf("."+l)!=i.length-l.length-1&&(o+=" [as "+l+"]")):o+=m+"."+(l||"<anonymous>")}else u?o+="new "+(i||"<anonymous>"):i?o+=i:(o+=e,s=!1);return s&&(o+=" ("+e+")"),o}function rr(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=Bo,e}function or(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),o=r.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,s=i.test(Fo())?0:62;n===1&&o>s&&!Be()&&!r.isEval()&&(o-=s);var u=Ge({source:t,line:n,column:o});e.curPosition=u,r=rr(r);var a=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?a():e.nextPosition.name||a()},r.getFileName=function(){return u.source},r.getLineNumber=function(){return u.line},r.getColumnNumber=function(){return u.column+1},r.getScriptNameOrSourceURL=function(){return u.source},r}var m=r.isEval()&&r.getEvalOrigin();return m&&(m=nr(m),r=rr(r),r.getEvalOrigin=function(){return m}),r}function Wo(r,e){De&&(q={},ae={});for(var t=r.name||"Error",n=r.message||"",o=t+": "+n,i={nextPosition:null,curPosition:null},s=[],u=e.length-1;u>=0;u--)s.push(`
2
+ "use strict";var oo=Object.create;var Ot=Object.defineProperty;var io=Object.getOwnPropertyDescriptor;var so=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var x=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var uo=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of so(e))!mo.call(r,o)&&o!==t&&Ot(r,o,{get:()=>e[o],enumerable:!(n=io(e,o))||n.enumerable});return r};var U=(r,e,t)=>(t=r!=null?oo(ao(r)):{},uo(e||!r||!r.__esModule?Ot(t,"default",{value:r,enumerable:!0}):t,r));var kt=x(Ce=>{var Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ce.encode=function(r){if(0<=r&&r<Et.length)return Et[r];throw new TypeError("Must be between 0 and 63: "+r)};Ce.decode=function(r){var e=65,t=90,n=97,o=122,i=48,s=57,u=43,a=47,m=26,l=52;return e<=r&&r<=t?r-e:n<=r&&r<=o?r-n+m:i<=r&&r<=s?r-i+l:r==u?62:r==a?63:-1}});var ke=x(Ee=>{var Mt=kt(),Oe=5,Lt=1<<Oe,Tt=Lt-1,jt=Lt;function lo(r){return r<0?(-r<<1)+1:(r<<1)+0}function fo(r){var e=(r&1)===1,t=r>>1;return e?-t:t}Ee.encode=function(e){var t="",n,o=lo(e);do n=o&Tt,o>>>=Oe,o>0&&(n|=jt),t+=Mt.encode(n);while(o>0);return t};Ee.decode=function(e,t,n){var o=e.length,i=0,s=0,u,a;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(a=Mt.decode(e.charCodeAt(t++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));u=!!(a&jt),a&=Tt,i=i+(a<<s),s+=Oe}while(u);n.value=fo(i),n.rest=t}});var K=x(O=>{function co(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}O.getArg=co;var Nt=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,po=/^data:.+\,.+$/;function ne(r){var e=r.match(Nt);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}O.urlParse=ne;function G(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}O.urlGenerate=G;function Me(r){var e=r,t=ne(r);if(t){if(!t.path)return r;e=t.path}for(var n=O.isAbsolute(e),o=e.split(/\/+/),i,s=0,u=o.length-1;u>=0;u--)i=o[u],i==="."?o.splice(u,1):i===".."?s++:s>0&&(i===""?(o.splice(u+1,s),s=0):(o.splice(u,2),s--));return e=o.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,G(t)):e}O.normalize=Me;function It(r,e){r===""&&(r="."),e===""&&(e=".");var t=ne(e),n=ne(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),G(t);if(t||e.match(po))return e;if(n&&!n.host&&!n.path)return n.host=e,G(n);var o=e.charAt(0)==="/"?e:Me(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,G(n)):o}O.join=It;O.isAbsolute=function(r){return r.charAt(0)==="/"||Nt.test(r)};function ho(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}O.relative=ho;var Pt=function(){var r=Object.create(null);return!("__proto__"in r)}();function $t(r){return r}function go(r){return Rt(r)?"$"+r:r}O.toSetString=Pt?$t:go;function vo(r){return Rt(r)?r.slice(1):r}O.fromSetString=Pt?$t:vo;function Rt(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function xo(r,e,t){var n=z(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:z(r.name,e.name)}O.compareByOriginalPositions=xo;function _o(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=z(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:z(r.name,e.name)}O.compareByGeneratedPositionsDeflated=_o;function z(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function yo(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=z(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:z(r.name,e.name)}O.compareByGeneratedPositionsInflated=yo;function bo(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}O.parseSourceMapInput=bo;function wo(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=ne(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=It(G(n),e)}return Me(e)}O.computeSourceURL=wo});var je=x(Vt=>{var Le=K(),Te=Object.prototype.hasOwnProperty,F=typeof Map<"u";function I(){this._array=[],this._set=F?new Map:Object.create(null)}I.fromArray=function(e,t){for(var n=new I,o=0,i=e.length;o<i;o++)n.add(e[o],t);return n};I.prototype.size=function(){return F?this._set.size:Object.getOwnPropertyNames(this._set).length};I.prototype.add=function(e,t){var n=F?e:Le.toSetString(e),o=F?this.has(e):Te.call(this._set,n),i=this._array.length;(!o||t)&&this._array.push(e),o||(F?this._set.set(e,i):this._set[n]=i)};I.prototype.has=function(e){if(F)return this._set.has(e);var t=Le.toSetString(e);return Te.call(this._set,t)};I.prototype.indexOf=function(e){if(F){var t=this._set.get(e);if(t>=0)return t}else{var n=Le.toSetString(e);if(Te.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};I.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};I.prototype.toArray=function(){return this._array.slice()};Vt.ArraySet=I});var qt=x(Dt=>{var Ft=K();function So(r,e){var t=r.generatedLine,n=e.generatedLine,o=r.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=o||Ft.compareByGeneratedPositionsInflated(r,e)<=0}function ce(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ce.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};ce.prototype.add=function(e){So(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};ce.prototype.toArray=function(){return this._sorted||(this._array.sort(Ft.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Dt.MappingList=ce});var Ne=x(Ht=>{var oe=ke(),S=K(),pe=je().ArraySet,Ao=qt().MappingList;function M(r){r||(r={}),this._file=S.getArg(r,"file",null),this._sourceRoot=S.getArg(r,"sourceRoot",null),this._skipValidation=S.getArg(r,"skipValidation",!1),this._sources=new pe,this._names=new pe,this._mappings=new Ao,this._sourcesContents=null}M.prototype._version=3;M.fromSourceMap=function(e){var t=e.sourceRoot,n=new M({file:e.file,sourceRoot:t});return e.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,t!=null&&(i.source=S.relative(t,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),e.sources.forEach(function(o){var i=o;t!==null&&(i=S.relative(t,o)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};M.prototype.addMapping=function(e){var t=S.getArg(e,"generated"),n=S.getArg(e,"original",null),o=S.getArg(e,"source",null),i=S.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};M.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=S.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[S.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[S.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};M.prototype.applySourceMap=function(e,t,n){var o=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=S.relative(i,o));var s=new pe,u=new pe;this._mappings.unsortedForEach(function(a){if(a.source===o&&a.originalLine!=null){var m=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});m.source!=null&&(a.source=m.source,n!=null&&(a.source=S.join(n,a.source)),i!=null&&(a.source=S.relative(i,a.source)),a.originalLine=m.line,a.originalColumn=m.column,m.name!=null&&(a.name=m.name))}var l=a.source;l!=null&&!s.has(l)&&s.add(l);var c=a.name;c!=null&&!u.has(c)&&u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(a){var m=e.sourceContentFor(a);m!=null&&(n!=null&&(a=S.join(n,a)),i!=null&&(a=S.relative(i,a)),this.setSourceContent(a,m))},this)};M.prototype._validateMapping=function(e,t,n,o){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!o)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:o}))}};M.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,o=0,i=0,s=0,u="",a,m,l,c,f=this._mappings.toArray(),h=0,g=f.length;h<g;h++){if(m=f[h],a="",m.generatedLine!==t)for(e=0;m.generatedLine!==t;)a+=";",t++;else if(h>0){if(!S.compareByGeneratedPositionsInflated(m,f[h-1]))continue;a+=","}a+=oe.encode(m.generatedColumn-e),e=m.generatedColumn,m.source!=null&&(c=this._sources.indexOf(m.source),a+=oe.encode(c-s),s=c,a+=oe.encode(m.originalLine-1-o),o=m.originalLine-1,a+=oe.encode(m.originalColumn-n),n=m.originalColumn,m.name!=null&&(l=this._names.indexOf(m.name),a+=oe.encode(l-i),i=l)),u+=a}return u};M.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=S.relative(t,n));var o=S.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};M.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};M.prototype.toString=function(){return JSON.stringify(this.toJSON())};Ht.SourceMapGenerator=M});var Bt=x(D=>{D.GREATEST_LOWER_BOUND=1;D.LEAST_UPPER_BOUND=2;function Ie(r,e,t,n,o,i){var s=Math.floor((e-r)/2)+r,u=o(t,n[s],!0);return u===0?s:u>0?e-s>1?Ie(s,e,t,n,o,i):i==D.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-r>1?Ie(r,s,t,n,o,i):i==D.LEAST_UPPER_BOUND?s:r<0?-1:r}D.search=function(e,t,n,o){if(t.length===0)return-1;var i=Ie(-1,t.length,e,t,n,o||D.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(t[i],t[i-1],!0)===0;)--i;return i}});var Ut=x(Wt=>{function Pe(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Co(r,e){return Math.round(r+Math.random()*(e-r))}function $e(r,e,t,n){if(t<n){var o=Co(t,n),i=t-1;Pe(r,o,n);for(var s=r[n],u=t;u<n;u++)e(r[u],s)<=0&&(i+=1,Pe(r,i,u));Pe(r,i+1,u);var a=i+1;$e(r,e,t,a-1),$e(r,e,a+1,n)}}Wt.quickSort=function(r,e){$e(r,e,0,r.length-1)}});var zt=x(de=>{var p=K(),Re=Bt(),J=je().ArraySet,Oo=ke(),ie=Ut().quickSort;function y(r,e){var t=r;return typeof r=="string"&&(t=p.parseSourceMapInput(r)),t.sections!=null?new T(t,e):new A(t,e)}y.fromSourceMap=function(r,e){return A.fromSourceMap(r,e)};y.prototype._version=3;y.prototype.__generatedMappings=null;Object.defineProperty(y.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});y.prototype.__originalMappings=null;Object.defineProperty(y.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});y.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};y.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};y.GENERATED_ORDER=1;y.ORIGINAL_ORDER=2;y.GREATEST_LOWER_BOUND=1;y.LEAST_UPPER_BOUND=2;y.prototype.eachMapping=function(e,t,n){var o=t||null,i=n||y.GENERATED_ORDER,s;switch(i){case y.GENERATED_ORDER:s=this._generatedMappings;break;case y.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;s.map(function(a){var m=a.source===null?null:this._sources.at(a.source);return m=p.computeSourceURL(u,m,this._sourceMapURL),{source:m,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn,originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name===null?null:this._names.at(a.name)}},this).forEach(e,o)};y.prototype.allGeneratedPositionsFor=function(e){var t=p.getArg(e,"line"),n={source:p.getArg(e,"source"),originalLine:t,originalColumn:p.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,Re.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var u=s.originalLine;s&&s.originalLine===u;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==a;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};de.SourceMapConsumer=y;function A(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sources"),i=p.getArg(t,"names",[]),s=p.getArg(t,"sourceRoot",null),u=p.getArg(t,"sourcesContent",null),a=p.getArg(t,"mappings"),m=p.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=p.normalize(s)),o=o.map(String).map(p.normalize).map(function(l){return s&&p.isAbsolute(s)&&p.isAbsolute(l)?p.relative(s,l):l}),this._names=J.fromArray(i.map(String),!0),this._sources=J.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(l){return p.computeSourceURL(s,l,e)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=a,this._sourceMapURL=e,this.file=m}A.prototype=Object.create(y.prototype);A.prototype.consumer=y;A.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=p.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};A.fromSourceMap=function(e,t){var n=Object.create(A.prototype),o=n._names=J.fromArray(e._names.toArray(),!0),i=n._sources=J.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(h){return p.computeSourceURL(n.sourceRoot,h,t)});for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],a=n.__originalMappings=[],m=0,l=s.length;m<l;m++){var c=s[m],f=new Gt;f.generatedLine=c.generatedLine,f.generatedColumn=c.generatedColumn,c.source&&(f.source=i.indexOf(c.source),f.originalLine=c.originalLine,f.originalColumn=c.originalColumn,c.name&&(f.name=o.indexOf(c.name)),a.push(f)),u.push(f)}return ie(n.__originalMappings,p.compareByOriginalPositions),n};A.prototype._version=3;Object.defineProperty(A.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Gt(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}A.prototype._parseMappings=function(e,t){for(var n=1,o=0,i=0,s=0,u=0,a=0,m=e.length,l=0,c={},f={},h=[],g=[],_,j,C,W,Ct;l<m;)if(e.charAt(l)===";")n++,l++,o=0;else if(e.charAt(l)===",")l++;else{for(_=new Gt,_.generatedLine=n,W=l;W<m&&!this._charIsMappingSeparator(e,W);W++);if(j=e.slice(l,W),C=c[j],C)l+=j.length;else{for(C=[];l<W;)Oo.decode(e,l,f),Ct=f.value,l=f.rest,C.push(Ct);if(C.length===2)throw new Error("Found a source, but no line and column");if(C.length===3)throw new Error("Found a source and line, but no column");c[j]=C}_.generatedColumn=o+C[0],o=_.generatedColumn,C.length>1&&(_.source=u+C[1],u+=C[1],_.originalLine=i+C[2],i=_.originalLine,_.originalLine+=1,_.originalColumn=s+C[3],s=_.originalColumn,C.length>4&&(_.name=a+C[4],a+=C[4])),g.push(_),typeof _.originalLine=="number"&&h.push(_)}ie(g,p.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,ie(h,p.compareByOriginalPositions),this.__originalMappings=h};A.prototype._findMapping=function(e,t,n,o,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return Re.search(e,t,i,s)};A.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};A.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",p.compareByGeneratedPositionsDeflated,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=p.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=p.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=p.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:p.getArg(o,"originalLine",null),column:p.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};A.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};A.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=p.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=p.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')};A.prototype.generatedPositionFor=function(e){var t=p.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:p.getArg(e,"line"),originalColumn:p.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:p.getArg(i,"generatedLine",null),column:p.getArg(i,"generatedColumn",null),lastColumn:p.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};de.BasicSourceMapConsumer=A;function T(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new J,this._names=new J;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var u=p.getArg(s,"offset"),a=p.getArg(u,"line"),m=p.getArg(u,"column");if(a<i.line||a===i.line&&m<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=u,{generatedOffset:{generatedLine:a+1,generatedColumn:m+1},consumer:new y(p.getArg(s,"map"),e)}})}T.prototype=Object.create(y.prototype);T.prototype.constructor=y;T.prototype._version=3;Object.defineProperty(T.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});T.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=Re.search(t,this._sections,function(i,s){var u=i.generatedLine-s.generatedOffset.generatedLine;return u||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};T.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};T.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};T.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(p.getArg(e,"source"))!==-1){var o=n.consumer.generatedPositionFor(e);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};T.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var u=i[s],a=o.consumer._sources.at(u.source);a=p.computeSourceURL(o.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var m=null;u.name&&(m=o.consumer._names.at(u.name),this._names.add(m),m=this._names.indexOf(m));var l={source:a,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:m};this.__generatedMappings.push(l),typeof l.originalLine=="number"&&this.__originalMappings.push(l)}ie(this.__generatedMappings,p.compareByGeneratedPositionsDeflated),ie(this.__originalMappings,p.compareByOriginalPositions)};de.IndexedSourceMapConsumer=T});var Jt=x(Kt=>{var Eo=Ne().SourceMapGenerator,he=K(),ko=/(\r?\n)/,Mo=10,Q="$$$isSourceNode$$$";function k(r,e,t,n,o){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=o??null,this[Q]=!0,n!=null&&this.add(n)}k.fromStringWithSourceMap=function(e,t,n){var o=new k,i=e.split(ko),s=0,u=function(){var f=g(),h=g()||"";return f+h;function g(){return s<i.length?i[s++]:void 0}},a=1,m=0,l=null;return t.eachMapping(function(f){if(l!==null)if(a<f.generatedLine)c(l,u()),a++,m=0;else{var h=i[s]||"",g=h.substr(0,f.generatedColumn-m);i[s]=h.substr(f.generatedColumn-m),m=f.generatedColumn,c(l,g),l=f;return}for(;a<f.generatedLine;)o.add(u()),a++;if(m<f.generatedColumn){var h=i[s]||"";o.add(h.substr(0,f.generatedColumn)),i[s]=h.substr(f.generatedColumn),m=f.generatedColumn}l=f},this),s<i.length&&(l&&c(l,u()),o.add(i.splice(s).join(""))),t.sources.forEach(function(f){var h=t.sourceContentFor(f);h!=null&&(n!=null&&(f=he.join(n,f)),o.setSourceContent(f,h))}),o;function c(f,h){if(f===null||f.source===void 0)o.add(h);else{var g=n?he.join(n,f.source):f.source;o.add(new k(f.originalLine,f.originalColumn,g,h,f.name))}}};k.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[Q]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[Q]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};k.prototype.walk=function(e){for(var t,n=0,o=this.children.length;n<o;n++)t=this.children[n],t[Q]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};k.prototype.join=function(e){var t,n,o=this.children.length;if(o>0){for(t=[],n=0;n<o-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};k.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[Q]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};k.prototype.setSourceContent=function(e,t){this.sourceContents[he.toSetString(e)]=t};k.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Q]&&this.children[t].walkSourceContents(e);for(var o=Object.keys(this.sourceContents),t=0,n=o.length;t<n;t++)e(he.fromSetString(o[t]),this.sourceContents[o[t]])};k.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};k.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new Eo(e),o=!1,i=null,s=null,u=null,a=null;return this.walk(function(m,l){t.code+=m,l.source!==null&&l.line!==null&&l.column!==null?((i!==l.source||s!==l.line||u!==l.column||a!==l.name)&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),i=l.source,s=l.line,u=l.column,a=l.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,f=m.length;c<f;c++)m.charCodeAt(c)===Mo?(t.line++,t.column=0,c+1===f?(i=null,o=!1):o&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++}),this.walkSourceContents(function(m,l){n.setSourceContent(m,l)}),{code:t.code,map:n}};Kt.SourceNode=k});var Qt=x(ge=>{ge.SourceMapGenerator=Ne().SourceMapGenerator;ge.SourceMapConsumer=zt().SourceMapConsumer;ge.SourceNode=Jt().SourceNode});var Yt=x((Ra,Xt)=>{var Lo=Object.prototype.toString,Ve=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function To(r){return Lo.call(r).slice(8,-1)==="ArrayBuffer"}function jo(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return Ve?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function No(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Ve?Buffer.from(r,e):new Buffer(r,e)}function Io(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return To(r)?jo(r,e,t):typeof r=="string"?No(r,e):Ve?Buffer.from(r):new Buffer(r)}Xt.exports=Io});var sr=x((H,He)=>{var Po=Qt().SourceMapConsumer,Fe=require("path"),N;try{N=require("fs"),(!N.existsSync||!N.readFileSync)&&(N=null)}catch{}var $o=Yt();function Zt(r,e){return r.require(e)}var er=!1,tr=!1,De=!1,se="auto",q={},ae={},Ro=/^data:application\/json[^,]+base64,/,R=[],V=[];function Be(){return se==="browser"?!0:se==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Vo(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function Fo(){return typeof process=="object"&&process!==null?process.version:""}function Do(){if(typeof process=="object"&&process!==null)return process.stderr}function qo(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function ve(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var We=ve(R);R.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,o){return o?"":"/"})),r in q)return q[r];var e="";try{if(N)N.existsSync(r)&&(e=N.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return q[r]=e});function qe(r,e){if(!r)return e;var t=Fe.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),o=n?n[0]:"",i=t.slice(o.length);return o&&/^\/\w\:/.test(i)?(o+="/",o+Fe.resolve(t.slice(o.length),e).replace(/\\/g,"/")):o+Fe.resolve(t.slice(o.length),e)}function Ho(r){var e;if(Be())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=We(r);for(var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,i,s;s=o.exec(e);)i=s;return i?i[1]:null}var Ue=ve(V);V.push(function(r){var e=Ho(r);if(!e)return null;var t;if(Ro.test(e)){var n=e.slice(e.indexOf(",")+1);t=$o(n,"base64").toString(),e=r}else e=qe(r,e),t=We(e);return t?{url:e,map:t}:null});function Ge(r){var e=ae[r.source];if(!e){var t=Ue(r.source);t?(e=ae[r.source]={url:t.url,map:new Po(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(o,i){var s=e.map.sourcesContent[i];if(s){var u=qe(e.url,o);q[u]=s}})):e=ae[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=qe(e.url,n.source),n}return r}function nr(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=Ge({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+nr(e[2])+")":r}function Bo(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",i=this.getFunctionName(),s=!0,u=this.isConstructor(),a=!(this.isToplevel()||u);if(a){var m=this.getTypeName();m==="[object Object]"&&(m="null");var l=this.getMethodName();i?(m&&i.indexOf(m)!=0&&(o+=m+"."),o+=i,l&&i.indexOf("."+l)!=i.length-l.length-1&&(o+=" [as "+l+"]")):o+=m+"."+(l||"<anonymous>")}else u?o+="new "+(i||"<anonymous>"):i?o+=i:(o+=e,s=!1);return s&&(o+=" ("+e+")"),o}function rr(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=Bo,e}function or(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),o=r.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,s=i.test(Fo())?0:62;n===1&&o>s&&!Be()&&!r.isEval()&&(o-=s);var u=Ge({source:t,line:n,column:o});e.curPosition=u,r=rr(r);var a=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?a():e.nextPosition.name||a()},r.getFileName=function(){return u.source},r.getLineNumber=function(){return u.line},r.getColumnNumber=function(){return u.column+1},r.getScriptNameOrSourceURL=function(){return u.source},r}var m=r.isEval()&&r.getEvalOrigin();return m&&(m=nr(m),r=rr(r),r.getEvalOrigin=function(){return m}),r}function Wo(r,e){De&&(q={},ae={});for(var t=r.name||"Error",n=r.message||"",o=t+": "+n,i={nextPosition:null,curPosition:null},s=[],u=e.length-1;u>=0;u--)s.push(`
3
3
  at `+or(e[u],i)),i.nextPosition=i.curPosition;return i.curPosition=i.nextPosition=null,o+s.reverse().join("")}function ir(r){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var t=e[1],n=+e[2],o=+e[3],i=q[t];if(!i&&N&&N.existsSync(t))try{i=N.readFileSync(t,"utf8")}catch{i=""}if(i){var s=i.split(/(?:\r\n|\r|\n)/)[n-1];if(s)return t+":"+n+`
4
4
  `+s+`
5
- `+new Array(o).join(" ")+"^"}}return null}function Uo(r){var e=ir(r),t=Do();t&&t._handle&&t._handle.setBlocking&&t._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),qo(1)}function Go(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return Uo(arguments[1])}return r.apply(this,arguments)}}var zo=R.slice(0),Ko=V.slice(0);H.wrapCallSite=or;H.getErrorSource=ir;H.mapSourcePosition=Ge;H.retrieveSourceMap=Ue;H.install=function(r){if(r=r||{},r.environment&&(se=r.environment,["node","browser","auto"].indexOf(se)===-1))throw new Error("environment "+se+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(R.length=0),R.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(V.length=0),V.unshift(r.retrieveSourceMap)),r.hookRequire&&!Be()){var e=Zt(He,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(i,s){return q[s]=i,ae[s]=void 0,t.call(this,i,s)},e.prototype._compile.__sourceMapSupport=!0)}if(De||(De="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),er||(er=!0,Error.prepareStackTrace=Wo),!tr){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var o=Zt(He,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Vo()&&(tr=!0,Go())}};H.resetRetrieveHandlers=function(){R.length=0,V.length=0,R=zo.slice(0),V=Ko.slice(0),Ue=ve(V),We=ve(R)}});var me=_(Ke=>{var _e=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},ze=class extends _e{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ke.CommanderError=_e;Ke.InvalidArgumentError=ze});var xe=_(Qe=>{var{InvalidArgumentError:Jo}=me(),Je=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Jo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Qo(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Qe.Argument=Je;Qe.humanReadableArgName=Qo});var Ye=_(ar=>{var{humanReadableArgName:Xo}=xe(),Xe=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(o=>!o._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((o,i)=>o.name().localeCompare(i.name())),t}compareOptions(e,t){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(o=>!o.hidden),n=e._getHelpOption();if(n&&!n.hidden){let o=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!o&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!o&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);t.push(...o)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>Xo(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,o)=>Math.max(n,t.subcommandTerm(o).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,o)=>Math.max(n,t.optionTerm(o).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,o)=>Math.max(n,t.optionTerm(o).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,o)=>Math.max(n,t.argumentTerm(o).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let o=e.parent;o;o=o.parent)n=o.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),o=t.helpWidth||80,i=2,s=2;function u(g,x){if(x){let j=`${g.padEnd(n+s)}${x}`;return t.wrap(j,o-i,n+s)}return g}function a(g){return g.join(`
6
- `).replace(/^/gm," ".repeat(i))}let m=[`Usage: ${t.commandUsage(e)}`,""],l=t.commandDescription(e);l.length>0&&(m=m.concat([t.wrap(l,o,0),""]));let c=t.visibleArguments(e).map(g=>u(t.argumentTerm(g),t.argumentDescription(g)));c.length>0&&(m=m.concat(["Arguments:",a(c),""]));let f=t.visibleOptions(e).map(g=>u(t.optionTerm(g),t.optionDescription(g)));if(f.length>0&&(m=m.concat(["Options:",a(f),""])),this.showGlobalOptions){let g=t.visibleGlobalOptions(e).map(x=>u(t.optionTerm(x),t.optionDescription(x)));g.length>0&&(m=m.concat(["Global Options:",a(g),""]))}let h=t.visibleCommands(e).map(g=>u(t.subcommandTerm(g),t.subcommandDescription(g)));return h.length>0&&(m=m.concat(["Commands:",a(h),""])),m.join(`
5
+ `+new Array(o).join(" ")+"^"}}return null}function Uo(r){var e=ir(r),t=Do();t&&t._handle&&t._handle.setBlocking&&t._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),qo(1)}function Go(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return Uo(arguments[1])}return r.apply(this,arguments)}}var zo=R.slice(0),Ko=V.slice(0);H.wrapCallSite=or;H.getErrorSource=ir;H.mapSourcePosition=Ge;H.retrieveSourceMap=Ue;H.install=function(r){if(r=r||{},r.environment&&(se=r.environment,["node","browser","auto"].indexOf(se)===-1))throw new Error("environment "+se+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(R.length=0),R.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(V.length=0),V.unshift(r.retrieveSourceMap)),r.hookRequire&&!Be()){var e=Zt(He,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(i,s){return q[s]=i,ae[s]=void 0,t.call(this,i,s)},e.prototype._compile.__sourceMapSupport=!0)}if(De||(De="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),er||(er=!0,Error.prepareStackTrace=Wo),!tr){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var o=Zt(He,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Vo()&&(tr=!0,Go())}};H.resetRetrieveHandlers=function(){R.length=0,V.length=0,R=zo.slice(0),V=Ko.slice(0),Ue=ve(V),We=ve(R)}});var me=x(Ke=>{var xe=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},ze=class extends xe{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ke.CommanderError=xe;Ke.InvalidArgumentError=ze});var _e=x(Qe=>{var{InvalidArgumentError:Jo}=me(),Je=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Jo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Qo(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Qe.Argument=Je;Qe.humanReadableArgName=Qo});var Ye=x(ar=>{var{humanReadableArgName:Xo}=_e(),Xe=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(o=>!o._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((o,i)=>o.name().localeCompare(i.name())),t}compareOptions(e,t){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(o=>!o.hidden),n=e._getHelpOption();if(n&&!n.hidden){let o=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!o&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!o&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);t.push(...o)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>Xo(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,o)=>Math.max(n,t.subcommandTerm(o).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,o)=>Math.max(n,t.optionTerm(o).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,o)=>Math.max(n,t.optionTerm(o).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,o)=>Math.max(n,t.argumentTerm(o).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let o=e.parent;o;o=o.parent)n=o.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),o=t.helpWidth||80,i=2,s=2;function u(g,_){if(_){let j=`${g.padEnd(n+s)}${_}`;return t.wrap(j,o-i,n+s)}return g}function a(g){return g.join(`
6
+ `).replace(/^/gm," ".repeat(i))}let m=[`Usage: ${t.commandUsage(e)}`,""],l=t.commandDescription(e);l.length>0&&(m=m.concat([t.wrap(l,o,0),""]));let c=t.visibleArguments(e).map(g=>u(t.argumentTerm(g),t.argumentDescription(g)));c.length>0&&(m=m.concat(["Arguments:",a(c),""]));let f=t.visibleOptions(e).map(g=>u(t.optionTerm(g),t.optionDescription(g)));if(f.length>0&&(m=m.concat(["Options:",a(f),""])),this.showGlobalOptions){let g=t.visibleGlobalOptions(e).map(_=>u(t.optionTerm(_),t.optionDescription(_)));g.length>0&&(m=m.concat(["Global Options:",a(g),""]))}let h=t.visibleCommands(e).map(g=>u(t.subcommandTerm(g),t.subcommandDescription(g)));return h.length>0&&(m=m.concat(["Commands:",a(h),""])),m.join(`
7
7
  `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,o=40){let i=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${i}]+`);if(e.match(s))return e;let u=t-n;if(u<o)return e;let a=e.slice(0,n),m=e.slice(n).replace(`\r
8
8
  `,`
9
9
  `),l=" ".repeat(n),f="\\s\u200B",h=new RegExp(`
10
- |.{1,${u-1}}([${f}]|$)|[^${f}]+?([${f}]|$)`,"g"),g=m.match(h)||[];return a+g.map((x,j)=>x===`
11
- `?"":(j>0?l:"")+x.trimEnd()).join(`
12
- `)}};ar.Help=Xe});var rt=_(tt=>{var{InvalidArgumentError:Yo}=me(),Ze=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=ei(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Yo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Zo(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},et=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return t.negate===(i===e)}};function Zo(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ei(r){let e,t,n=r.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),t=n.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}tt.Option=Ze;tt.DualOptions=et});var ur=_(mr=>{function ti(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let o=1;o<=r.length;o++){let i=1;r[o-1]===e[n-1]?i=0:i=1,t[o][n]=Math.min(t[o-1][n]+1,t[o][n-1]+1,t[o-1][n-1]+i),o>1&&n>1&&r[o-1]===e[n-2]&&r[o-2]===e[n-1]&&(t[o][n]=Math.min(t[o][n],t[o-2][n-2]+1))}return t[r.length][e.length]}function ri(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(s=>s.slice(2)));let n=[],o=3,i=.4;return e.forEach(s=>{if(s.length<=1)return;let u=ti(r,s),a=Math.max(r.length,s.length);(a-u)/a>i&&(u<o?(o=u,n=[s]):u===o&&n.push(s))}),n.sort((s,u)=>s.localeCompare(u)),t&&(n=n.map(s=>`--${s}`)),n.length>1?`
10
+ |.{1,${u-1}}([${f}]|$)|[^${f}]+?([${f}]|$)`,"g"),g=m.match(h)||[];return a+g.map((_,j)=>_===`
11
+ `?"":(j>0?l:"")+_.trimEnd()).join(`
12
+ `)}};ar.Help=Xe});var rt=x(tt=>{var{InvalidArgumentError:Yo}=me(),Ze=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=ei(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Yo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Zo(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},et=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return t.negate===(i===e)}};function Zo(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ei(r){let e,t,n=r.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),t=n.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}tt.Option=Ze;tt.DualOptions=et});var ur=x(mr=>{function ti(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let o=1;o<=r.length;o++){let i=1;r[o-1]===e[n-1]?i=0:i=1,t[o][n]=Math.min(t[o-1][n]+1,t[o][n-1]+1,t[o-1][n-1]+i),o>1&&n>1&&r[o-1]===e[n-2]&&r[o-2]===e[n-1]&&(t[o][n]=Math.min(t[o][n],t[o-2][n-2]+1))}return t[r.length][e.length]}function ri(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(s=>s.slice(2)));let n=[],o=3,i=.4;return e.forEach(s=>{if(s.length<=1)return;let u=ti(r,s),a=Math.max(r.length,s.length);(a-u)/a>i&&(u<o?(o=u,n=[s]):u===o&&n.push(s))}),n.sort((s,u)=>s.localeCompare(u)),t&&(n=n.map(s=>`--${s}`)),n.length>1?`
13
13
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
14
- (Did you mean ${n[0]}?)`:""}mr.suggestSimilar=ri});var dr=_(pr=>{var ni=require("events").EventEmitter,nt=require("child_process"),P=require("path"),ot=require("fs"),w=require("process"),{Argument:oi,humanReadableArgName:ii}=xe(),{CommanderError:it}=me(),{Help:si}=Ye(),{Option:lr,DualOptions:ai}=rt(),{suggestSimilar:fr}=ur(),st=class r extends ni{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>w.stdout.write(t),writeErr:t=>w.stderr.write(t),getOutHelpWidth:()=>w.stdout.isTTY?w.stdout.columns:void 0,getErrHelpWidth:()=>w.stderr.isTTY?w.stderr.columns:void 0,outputError:(t,n)=>n(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let o=t,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,u]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(s);return o&&(a.description(o),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(i.noHelp||i.hidden),a._executableFile=i.executableFile||null,u&&a.arguments(u),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),o?this:a}createCommand(e){return new r(e)}createHelp(){return Object.assign(new si,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
14
+ (Did you mean ${n[0]}?)`:""}mr.suggestSimilar=ri});var dr=x(pr=>{var ni=require("node:events").EventEmitter,nt=require("node:child_process"),P=require("node:path"),ot=require("node:fs"),w=require("node:process"),{Argument:oi,humanReadableArgName:ii}=_e(),{CommanderError:it}=me(),{Help:si}=Ye(),{Option:lr,DualOptions:ai}=rt(),{suggestSimilar:fr}=ur(),st=class r extends ni{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>w.stdout.write(t),writeErr:t=>w.stderr.write(t),getOutHelpWidth:()=>w.stdout.isTTY?w.stdout.columns:void 0,getErrHelpWidth:()=>w.stderr.isTTY?w.stderr.columns:void 0,outputError:(t,n)=>n(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let o=t,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,u]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(s);return o&&(a.description(o),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(i.noHelp||i.hidden),a._executableFile=i.executableFile||null,u&&a.arguments(u),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),o?this:a}createCommand(e){return new r(e)}createHelp(){return Object.assign(new si,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
15
15
  - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new oi(e,t)}argument(e,t,n,o){let i=this.createArgument(e,t);return typeof n=="function"?i.default(o).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,o]=e.match(/([^ ]+) *(.*)/),i=t??"display help for command",s=this.createCommand(n);return s.helpOption(!1),o&&s.arguments(o),i&&s.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
16
16
  Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new it(e,t,n)),w.exit(e)}action(e){let t=n=>{let o=this.registeredArguments.length,i=n.slice(0,o);return this._storeOptionsAsProperties?i[o]=this:i[o]=this.opts(),i.push(this),e.apply(this,i)};return this._actionHandler=t,this}createOption(e,t){return new lr(e,t)}_callParseArg(e,t,n,o){try{return e.parseArg(t,n)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${o} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
17
- - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=o=>[o.name()].concat(o.aliases()),n=t(e).find(o=>this._findCommand(o));if(n){let o=t(this._findCommand(n)).join("|"),i=t(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(i,s,u)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let a=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,a,s):i!==null&&e.variadic&&(i=e._concatValue(i,a)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,u)};return this.on("option:"+t,i=>{let s=`error: option '${e.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,i=>{let s=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(e,t,n,o,i){if(typeof t=="object"&&t instanceof lr)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,n);if(s.makeOptionMandatory(!!e.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let u=o;o=(a,m)=>{let l=u.exec(a);return l?l[0]:m},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(e,t,n,o){return this._optionEx({},e,t,n,o)}requiredOption(e,t,n,o){return this._optionEx({mandatory:!0},e,t,n,o)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");t=t||{},e===void 0&&(e=w.argv,w.versions&&w.versions.electron&&(t.from="electron")),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":w.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,c){let f=P.resolve(l,c);if(ot.existsSync(f))return f;if(o.includes(P.extname(c)))return;let h=o.find(g=>ot.existsSync(`${f}${g}`));if(h)return`${f}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let l;try{l=ot.realpathSync(this._scriptPath)}catch{l=this._scriptPath}u=P.resolve(P.dirname(l),u)}if(u){let l=i(u,s);if(!l&&!e._executableFile&&this._scriptPath){let c=P.basename(this._scriptPath,P.extname(this._scriptPath));c!==this._name&&(l=i(u,`${c}-${e._name}`))}s=l||s}n=o.includes(P.extname(s));let a;w.platform!=="win32"?n?(t.unshift(s),t=cr(w.execArgv).concat(t),a=nt.spawn(w.argv[0],t,{stdio:"inherit"})):a=nt.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=cr(w.execArgv).concat(t),a=nt.spawn(w.execPath,t,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{w.on(c,()=>{a.killed===!1&&a.exitCode===null&&a.kill(c)})});let m=this._exitCallback;a.on("close",(l,c)=>{l=l??1,m?m(new it(l,"commander.executeSubCommandAsync","(close)")):w.exit(l)}),a.on("error",l=>{if(l.code==="ENOENT"){let c=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",f=`'${s}' does not exist
17
+ - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=o=>[o.name()].concat(o.aliases()),n=t(e).find(o=>this._findCommand(o));if(n){let o=t(this._findCommand(n)).join("|"),i=t(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(i,s,u)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let a=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,a,s):i!==null&&e.variadic&&(i=e._concatValue(i,a)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,u)};return this.on("option:"+t,i=>{let s=`error: option '${e.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,i=>{let s=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(e,t,n,o,i){if(typeof t=="object"&&t instanceof lr)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,n);if(s.makeOptionMandatory(!!e.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let u=o;o=(a,m)=>{let l=u.exec(a);return l?l[0]:m},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(e,t,n,o){return this._optionEx({},e,t,n,o)}requiredOption(e,t,n,o){return this._optionEx({mandatory:!0},e,t,n,o)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){w.versions?.electron&&(t.from="electron");let o=w.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(t.from="eval")}e===void 0&&(e=w.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":w.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,c){let f=P.resolve(l,c);if(ot.existsSync(f))return f;if(o.includes(P.extname(c)))return;let h=o.find(g=>ot.existsSync(`${f}${g}`));if(h)return`${f}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let l;try{l=ot.realpathSync(this._scriptPath)}catch{l=this._scriptPath}u=P.resolve(P.dirname(l),u)}if(u){let l=i(u,s);if(!l&&!e._executableFile&&this._scriptPath){let c=P.basename(this._scriptPath,P.extname(this._scriptPath));c!==this._name&&(l=i(u,`${c}-${e._name}`))}s=l||s}n=o.includes(P.extname(s));let a;w.platform!=="win32"?n?(t.unshift(s),t=cr(w.execArgv).concat(t),a=nt.spawn(w.argv[0],t,{stdio:"inherit"})):a=nt.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=cr(w.execArgv).concat(t),a=nt.spawn(w.execPath,t,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{w.on(c,()=>{a.killed===!1&&a.exitCode===null&&a.kill(c)})});let m=this._exitCallback;a.on("close",l=>{l=l??1,m?m(new it(l,"commander.executeSubCommandAsync","(close)")):w.exit(l)}),a.on("error",l=>{if(l.code==="ENOENT"){let c=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",f=`'${s}' does not exist
18
18
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
19
19
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
20
20
  - ${c}`;throw new Error(f)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!m)w.exit(1);else{let c=new it(1,"commander.executeSubCommandAsync","(error)");c.nestedError=l,m(c)}}),this.runningCommand=a}_dispatchSubcommand(e,t,n){let o=this._findCommand(e);o||this.help({error:!0});let i;return i=this._chainOrCallSubCommandHook(i,o,"preSubcommand"),i=this._chainOrCall(i,()=>{if(o._executableHandler)this._executeSubCommand(o,t.concat(n));else return o._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,o,i)=>{let s=o;if(o!==null&&n.parseArg){let u=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,o,i,u)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,o)=>{let i=n.defaultValue;n.variadic?o<this.args.length?(i=this.args.slice(o),n.parseArg&&(i=i.reduce((s,u)=>e(n,u,s),n.defaultValue))):i===void 0&&(i=[]):o<this.args.length&&(i=this.args[o],n.parseArg&&(i=e(n,i,n.defaultValue))),t[o]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,o=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[t]!==void 0).forEach(i=>{i._lifeCycleHooks[t].forEach(s=>{o.push({hookedCommand:i,callback:s})})}),t==="postAction"&&o.reverse(),o.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let o=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{o=this._chainOrCall(o,()=>i(this,t))}),o}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,e,t)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(i))o(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=e.find(i=>n.conflictsWith.includes(i.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],o=t,i=e.slice();function s(a){return a.length>1&&a[0]==="-"}let u=null;for(;i.length;){let a=i.shift();if(a==="--"){o===n&&o.push(a),o.push(...i);break}if(u&&!s(a)){this.emit(`option:${u.name()}`,a);continue}if(u=null,s(a)){let m=this._findOption(a);if(m){if(m.required){let l=i.shift();l===void 0&&this.optionMissingArgument(m),this.emit(`option:${m.name()}`,l)}else if(m.optional){let l=null;i.length>0&&!s(i[0])&&(l=i.shift()),this.emit(`option:${m.name()}`,l)}else this.emit(`option:${m.name()}`);u=m.variadic?m:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let m=this._findOption(`-${a[1]}`);if(m){m.required||m.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${m.name()}`,a.slice(2)):(this.emit(`option:${m.name()}`),i.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let m=a.indexOf("="),l=this._findOption(a.slice(0,m));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,a.slice(m+1));continue}}if(s(a)&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(a)){t.push(a),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){t.push(a),i.length>0&&t.push(...i);break}else if(this._defaultCommandName){n.push(a),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){o.push(a),i.length>0&&o.push(...i);break}o.push(a)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let o=this.options[n].attributeName();e[o]=o===this._versionOptionName?this._version:this[o]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
@@ -23,7 +23,7 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
23
23
  `),this.outputHelp({error:!0}));let n=t||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in w.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,w.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new ai(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!t(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=s=>{let u=s.attributeName(),a=this.getOptionValue(u),m=this.options.find(c=>c.negate&&u===c.attributeName()),l=this.options.find(c=>!c.negate&&u===c.attributeName());return m&&(m.presetArg===void 0&&a===!1||m.presetArg!==void 0&&a===m.presetArg)?m:l||s},o=s=>{let u=n(s),a=u.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},i=`error: ${o(e)} cannot be used with ${o(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(u=>u.long).map(u=>u.long);o=o.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);t=fr(e,o)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),t=fr(e,o)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let o=this.createOption(t,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${e}
24
24
  `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>ii(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=P.basename(e,P.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},n;return t.error?n=o=>this._outputConfiguration.writeErr(o):n=o=>this._outputConfiguration.writeOut(o),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation(n);if(t&&(o=t(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=w.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
25
25
  Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,i=>{let s;typeof t=="function"?s=t({error:i.error,command:i.command}):s=t,s&&i.write(`${s}
26
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(o=>t.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function cr(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",o="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?t=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],o=i[4]),t&&o!=="0"?`${t}=${n}:${parseInt(o)+1}`:e})}pr.Command=st});var _r=_(L=>{var{Argument:hr}=xe(),{Command:at}=dr(),{CommanderError:mi,InvalidArgumentError:gr}=me(),{Help:ui}=Ye(),{Option:vr}=rt();L.program=new at;L.createCommand=r=>new at(r);L.createOption=(r,e)=>new vr(r,e);L.createArgument=(r,e)=>new hr(r,e);L.Command=at;L.Option=vr;L.Argument=hr;L.Help=ui;L.CommanderError=mi;L.InvalidArgumentError=gr;L.InvalidOptionArgumentError=gr});var Cr=_((tm,Ar)=>{Ar.exports=Sr;Sr.sync=fi;var br=require("fs");function li(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var o=t[n].toLowerCase();if(o&&r.substr(-o.length).toLowerCase()===o)return!0}return!1}function wr(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:li(e,t)}function Sr(r,e,t){br.stat(r,function(n,o){t(n,n?!1:wr(o,r,e))})}function fi(r,e){return wr(br.statSync(r),r,e)}});var Lr=_((rm,Mr)=>{Mr.exports=Er;Er.sync=ci;var Or=require("fs");function Er(r,e,t){Or.stat(r,function(n,o){t(n,n?!1:kr(o,e))})}function ci(r,e){return kr(Or.statSync(r),e)}function kr(r,e){return r.isFile()&&pi(r,e)}function pi(r,e){var t=r.mode,n=r.uid,o=r.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),u=parseInt("100",8),a=parseInt("010",8),m=parseInt("001",8),l=u|a,c=t&m||t&a&&o===s||t&u&&n===i||t&l&&i===0;return c}});var jr=_((om,Tr)=>{var nm=require("fs"),ye;process.platform==="win32"||global.TESTING_WINDOWS?ye=Cr():ye=Lr();Tr.exports=mt;mt.sync=di;function mt(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){mt(r,e||{},function(i,s){i?o(i):n(s)})})}ye(r,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),t(n,o)})}function di(r,e){try{return ye.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Fr=_((im,Vr)=>{var X=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Nr=require("path"),hi=X?";":":",Ir=jr(),Pr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),$r=(r,e)=>{let t=e.colon||hi,n=r.match(/\//)||X&&r.match(/\\/)?[""]:[...X?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],o=X?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=X?o.split(t):[""];return X&&r.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Rr=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:i}=$r(r,e),s=[],u=m=>new Promise((l,c)=>{if(m===n.length)return e.all&&s.length?l(s):c(Pr(r));let f=n[m],h=/^".*"$/.test(f)?f.slice(1,-1):f,g=Nr.join(h,r),x=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+g:g;l(a(x,m,0))}),a=(m,l,c)=>new Promise((f,h)=>{if(c===o.length)return f(u(l+1));let g=o[c];Ir(m+g,{pathExt:i},(x,j)=>{if(!x&&j)if(e.all)s.push(m+g);else return f(m+g);return f(a(m,l,c+1))})});return t?u(0).then(m=>t(null,m),t):u(0)},gi=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:o}=$r(r,e),i=[];for(let s=0;s<t.length;s++){let u=t[s],a=/^".*"$/.test(u)?u.slice(1,-1):u,m=Nr.join(a,r),l=!a&&/^\.[\\\/]/.test(r)?r.slice(0,2)+m:m;for(let c=0;c<n.length;c++){let f=l+n[c];try{if(Ir.sync(f,{pathExt:o}))if(e.all)i.push(f);else return f}catch{}}}if(e.all&&i.length)return i;if(e.nothrow)return null;throw Pr(r)};Vr.exports=Rr;Rr.sync=gi});var qr=_((sm,ut)=>{"use strict";var Dr=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ut.exports=Dr;ut.exports.default=Dr});var Ur=_((am,Wr)=>{"use strict";var Hr=require("path"),vi=Fr(),_i=qr();function Br(r,e){let t=r.options.env||process.env,n=process.cwd(),o=r.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(r.options.cwd)}catch{}let s;try{s=vi.sync(r.command,{path:t[_i({env:t})],pathExt:e?Hr.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Hr.resolve(o?r.options.cwd:"",s)),s}function xi(r){return Br(r)||Br(r,!0)}Wr.exports=xi});var Gr=_((mm,ft)=>{"use strict";var lt=/([()\][%!^"`<>&|;, *?])/g;function yi(r){return r=r.replace(lt,"^$1"),r}function bi(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(lt,"^$1"),e&&(r=r.replace(lt,"^$1")),r}ft.exports.command=yi;ft.exports.argument=bi});var Kr=_((um,zr)=>{"use strict";zr.exports=/^#!(.*)/});var Qr=_((lm,Jr)=>{"use strict";var wi=Kr();Jr.exports=(r="")=>{let e=r.match(wi);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),o=t.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Yr=_((fm,Xr)=>{"use strict";var ct=require("fs"),Si=Qr();function Ai(r){let t=Buffer.alloc(150),n;try{n=ct.openSync(r,"r"),ct.readSync(n,t,0,150,0),ct.closeSync(n)}catch{}return Si(t.toString())}Xr.exports=Ai});var rn=_((cm,tn)=>{"use strict";var Ci=require("path"),Zr=Ur(),en=Gr(),Oi=Yr(),Ei=process.platform==="win32",ki=/\.(?:com|exe)$/i,Mi=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Li(r){r.file=Zr(r);let e=r.file&&Oi(r.file);return e?(r.args.unshift(r.file),r.command=e,Zr(r)):r.file}function Ti(r){if(!Ei)return r;let e=Li(r),t=!ki.test(e);if(r.options.forceShell||t){let n=Mi.test(e);r.command=Ci.normalize(r.command),r.command=en.command(r.command),r.args=r.args.map(i=>en.argument(i,n));let o=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${o}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function ji(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:Ti(n)}tn.exports=ji});var sn=_((pm,on)=>{"use strict";var pt=process.platform==="win32";function dt(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Ni(r,e){if(!pt)return;let t=r.emit;r.emit=function(n,o){if(n==="exit"){let i=nn(o,e,"spawn");if(i)return t.call(r,"error",i)}return t.apply(r,arguments)}}function nn(r,e){return pt&&r===1&&!e.file?dt(e.original,"spawn"):null}function Ii(r,e){return pt&&r===1&&!e.file?dt(e.original,"spawnSync"):null}on.exports={hookChildProcess:Ni,verifyENOENT:nn,verifyENOENTSync:Ii,notFoundError:dt}});var un=_((dm,Y)=>{"use strict";var an=require("child_process"),ht=rn(),gt=sn();function mn(r,e,t){let n=ht(r,e,t),o=an.spawn(n.command,n.args,n.options);return gt.hookChildProcess(o,n),o}function Pi(r,e,t){let n=ht(r,e,t),o=an.spawnSync(n.command,n.args,n.options);return o.error=o.error||gt.verifyENOENTSync(o.status,n),o}Y.exports=mn;Y.exports.spawn=mn;Y.exports.sync=Pi;Y.exports._parse=ht;Y.exports._enoent=gt});sr().install();var xr=U(_r(),1),{program:Ua,createCommand:Ga,createArgument:za,createOption:Ka,CommanderError:Ja,InvalidArgumentError:Qa,InvalidOptionArgumentError:Xa,Command:yr,Argument:Ya,Option:$,Help:Za}=xr.default;var B=U(un()),v=U(require("fs")),ro=U(require("os")),d=U(require("path"));var $i=/[\p{Lu}]/u,Ri=/[\p{Ll}]/u,ln=/^[\p{Lu}](?![\p{Lu}])/gu,pn=/([\p{Alpha}\p{N}_]|$)/u,vt=/[_.\- ]+/,Vi=new RegExp("^"+vt.source),fn=new RegExp(vt.source+pn.source,"gu"),cn=new RegExp("\\d+"+pn.source,"gu"),Fi=(r,e,t,n)=>{let o=!1,i=!1,s=!1,u=!1;for(let a=0;a<r.length;a++){let m=r[a];u=a>2?r[a-3]==="-":!0,o&&$i.test(m)?(r=r.slice(0,a)+"-"+r.slice(a),o=!1,s=i,i=!0,a++):i&&s&&Ri.test(m)&&(!u||n)?(r=r.slice(0,a-1)+"-"+r.slice(a-1),s=i,i=!1,o=!0):(o=e(m)===m&&t(m)!==m,s=i,i=t(m)===m&&e(m)!==m)}return r},Di=(r,e)=>(ln.lastIndex=0,r.replaceAll(ln,t=>e(t))),qi=(r,e)=>(fn.lastIndex=0,cn.lastIndex=0,r.replaceAll(cn,(t,n,o)=>["_","-"].includes(r.charAt(o+t.length))?t:e(t)).replaceAll(fn,(t,n)=>e(n)));function _t(r,e){if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(i=>i.trim()).filter(i=>i.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?i=>i.toLowerCase():i=>i.toLocaleLowerCase(e.locale),n=e.locale===!1?i=>i.toUpperCase():i=>i.toLocaleUpperCase(e.locale);return r.length===1?vt.test(r)?"":e.pascalCase?n(r):t(r):(r!==t(r)&&(r=Fi(r,t,n,e.preserveConsecutiveUppercase)),r=r.replace(Vi,""),r=e.preserveConsecutiveUppercase?Di(r,t):t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),qi(r,n))}var Hi=typeof global=="object"&&global&&global.Object===Object&&global,be=Hi;var Bi=typeof self=="object"&&self&&self.Object===Object&&self,Wi=be||Bi||Function("return this")(),we=Wi;var Ui=we.Symbol,Z=Ui;var dn=Object.prototype,Gi=dn.hasOwnProperty,zi=dn.toString,ue=Z?Z.toStringTag:void 0;function Ki(r){var e=Gi.call(r,ue),t=r[ue];try{r[ue]=void 0;var n=!0}catch{}var o=zi.call(r);return n&&(e?r[ue]=t:delete r[ue]),o}var hn=Ki;var Ji=Object.prototype,Qi=Ji.toString;function Xi(r){return Qi.call(r)}var gn=Xi;var Yi="[object Null]",Zi="[object Undefined]",vn=Z?Z.toStringTag:void 0;function es(r){return r==null?r===void 0?Zi:Yi:vn&&vn in Object(r)?hn(r):gn(r)}var ee=es;function ts(r){return r!=null&&typeof r=="object"}var te=ts;var rs=Array.isArray,_n=rs;function ns(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var xn=ns;function os(r){return r}var yn=os;var is="[object AsyncFunction]",ss="[object Function]",as="[object GeneratorFunction]",ms="[object Proxy]";function us(r){if(!xn(r))return!1;var e=ee(r);return e==ss||e==as||e==is||e==ms}var bn=us;var ls=9007199254740991,fs=/^(?:0|[1-9]\d*)$/;function cs(r,e){var t=typeof r;return e=e??ls,!!e&&(t=="number"||t!="symbol"&&fs.test(r))&&r>-1&&r%1==0&&r<e}var wn=cs;var ps=9007199254740991;function ds(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ps}var Se=ds;function hs(r){return r!=null&&Se(r.length)&&!bn(r)}var Sn=hs;var gs=Object.prototype;function vs(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||gs;return r===t}var An=vs;function _s(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Cn=_s;var xs="[object Arguments]";function ys(r){return te(r)&&ee(r)==xs}var xt=ys;var On=Object.prototype,bs=On.hasOwnProperty,ws=On.propertyIsEnumerable,Ss=xt(function(){return arguments}())?xt:function(r){return te(r)&&bs.call(r,"callee")&&!ws.call(r,"callee")},En=Ss;function As(){return!1}var kn=As;var Tn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Tn&&typeof module=="object"&&module&&!module.nodeType&&module,Cs=Mn&&Mn.exports===Tn,Ln=Cs?we.Buffer:void 0,Os=Ln?Ln.isBuffer:void 0,Es=Os||kn,jn=Es;var ks="[object Arguments]",Ms="[object Array]",Ls="[object Boolean]",Ts="[object Date]",js="[object Error]",Ns="[object Function]",Is="[object Map]",Ps="[object Number]",$s="[object Object]",Rs="[object RegExp]",Vs="[object Set]",Fs="[object String]",Ds="[object WeakMap]",qs="[object ArrayBuffer]",Hs="[object DataView]",Bs="[object Float32Array]",Ws="[object Float64Array]",Us="[object Int8Array]",Gs="[object Int16Array]",zs="[object Int32Array]",Ks="[object Uint8Array]",Js="[object Uint8ClampedArray]",Qs="[object Uint16Array]",Xs="[object Uint32Array]",b={};b[Bs]=b[Ws]=b[Us]=b[Gs]=b[zs]=b[Ks]=b[Js]=b[Qs]=b[Xs]=!0;b[ks]=b[Ms]=b[qs]=b[Ls]=b[Hs]=b[Ts]=b[js]=b[Ns]=b[Is]=b[Ps]=b[$s]=b[Rs]=b[Vs]=b[Fs]=b[Ds]=!1;function Ys(r){return te(r)&&Se(r.length)&&!!b[ee(r)]}var Nn=Ys;function Zs(r){return function(e){return r(e)}}var In=Zs;var Pn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,le=Pn&&typeof module=="object"&&module&&!module.nodeType&&module,ea=le&&le.exports===Pn,yt=ea&&be.process,ta=function(){try{var r=le&&le.require&&le.require("util").types;return r||yt&&yt.binding&&yt.binding("util")}catch{}}(),bt=ta;var $n=bt&&bt.isTypedArray,ra=$n?In($n):Nn,Rn=ra;var na=Object.prototype,oa=na.hasOwnProperty;function ia(r,e){var t=_n(r),n=!t&&En(r),o=!t&&!n&&jn(r),i=!t&&!n&&!o&&Rn(r),s=t||n||o||i,u=s?Cn(r.length,String):[],a=u.length;for(var m in r)(e||oa.call(r,m))&&!(s&&(m=="length"||o&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||wn(m,a)))&&u.push(m);return u}var Vn=ia;function sa(r,e){return function(t){return r(e(t))}}var Fn=sa;var aa=Fn(Object.keys,Object),Dn=aa;var ma=Object.prototype,ua=ma.hasOwnProperty;function la(r){if(!An(r))return Dn(r);var e=[];for(var t in Object(r))ua.call(r,t)&&t!="constructor"&&e.push(t);return e}var qn=la;function fa(r){return Sn(r)?Vn(r):qn(r)}var Hn=fa;function ca(r){return function(e,t,n){for(var o=-1,i=Object(e),s=n(e),u=s.length;u--;){var a=s[r?u:++o];if(t(i[a],a,i)===!1)break}return e}}var Bn=ca;var pa=Bn(),Wn=pa;function da(r,e){return r&&Wn(r,e,Hn)}var Un=da;function ha(r){return typeof r=="function"?r:yn}var Gn=ha;function ga(r,e){return r&&Un(r,Gn(e))}var wt=ga;var Ae="1.1.24";var Kn=()=>{fe(),console.log(`
26
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(o=>t.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function cr(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",o="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?t=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],o=i[4]),t&&o!=="0"?`${t}=${n}:${parseInt(o)+1}`:e})}pr.Command=st});var xr=x(L=>{var{Argument:hr}=_e(),{Command:at}=dr(),{CommanderError:mi,InvalidArgumentError:gr}=me(),{Help:ui}=Ye(),{Option:vr}=rt();L.program=new at;L.createCommand=r=>new at(r);L.createOption=(r,e)=>new vr(r,e);L.createArgument=(r,e)=>new hr(r,e);L.Command=at;L.Option=vr;L.Argument=hr;L.Help=ui;L.CommanderError=mi;L.InvalidArgumentError=gr;L.InvalidOptionArgumentError=gr});var Cr=x((tm,Ar)=>{Ar.exports=Sr;Sr.sync=fi;var br=require("fs");function li(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var o=t[n].toLowerCase();if(o&&r.substr(-o.length).toLowerCase()===o)return!0}return!1}function wr(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:li(e,t)}function Sr(r,e,t){br.stat(r,function(n,o){t(n,n?!1:wr(o,r,e))})}function fi(r,e){return wr(br.statSync(r),r,e)}});var Lr=x((rm,Mr)=>{Mr.exports=Er;Er.sync=ci;var Or=require("fs");function Er(r,e,t){Or.stat(r,function(n,o){t(n,n?!1:kr(o,e))})}function ci(r,e){return kr(Or.statSync(r),e)}function kr(r,e){return r.isFile()&&pi(r,e)}function pi(r,e){var t=r.mode,n=r.uid,o=r.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),u=parseInt("100",8),a=parseInt("010",8),m=parseInt("001",8),l=u|a,c=t&m||t&a&&o===s||t&u&&n===i||t&l&&i===0;return c}});var jr=x((om,Tr)=>{var nm=require("fs"),ye;process.platform==="win32"||global.TESTING_WINDOWS?ye=Cr():ye=Lr();Tr.exports=mt;mt.sync=di;function mt(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){mt(r,e||{},function(i,s){i?o(i):n(s)})})}ye(r,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),t(n,o)})}function di(r,e){try{return ye.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Fr=x((im,Vr)=>{var X=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Nr=require("path"),hi=X?";":":",Ir=jr(),Pr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),$r=(r,e)=>{let t=e.colon||hi,n=r.match(/\//)||X&&r.match(/\\/)?[""]:[...X?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],o=X?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=X?o.split(t):[""];return X&&r.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Rr=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:i}=$r(r,e),s=[],u=m=>new Promise((l,c)=>{if(m===n.length)return e.all&&s.length?l(s):c(Pr(r));let f=n[m],h=/^".*"$/.test(f)?f.slice(1,-1):f,g=Nr.join(h,r),_=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+g:g;l(a(_,m,0))}),a=(m,l,c)=>new Promise((f,h)=>{if(c===o.length)return f(u(l+1));let g=o[c];Ir(m+g,{pathExt:i},(_,j)=>{if(!_&&j)if(e.all)s.push(m+g);else return f(m+g);return f(a(m,l,c+1))})});return t?u(0).then(m=>t(null,m),t):u(0)},gi=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:o}=$r(r,e),i=[];for(let s=0;s<t.length;s++){let u=t[s],a=/^".*"$/.test(u)?u.slice(1,-1):u,m=Nr.join(a,r),l=!a&&/^\.[\\\/]/.test(r)?r.slice(0,2)+m:m;for(let c=0;c<n.length;c++){let f=l+n[c];try{if(Ir.sync(f,{pathExt:o}))if(e.all)i.push(f);else return f}catch{}}}if(e.all&&i.length)return i;if(e.nothrow)return null;throw Pr(r)};Vr.exports=Rr;Rr.sync=gi});var qr=x((sm,ut)=>{"use strict";var Dr=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ut.exports=Dr;ut.exports.default=Dr});var Ur=x((am,Wr)=>{"use strict";var Hr=require("path"),vi=Fr(),xi=qr();function Br(r,e){let t=r.options.env||process.env,n=process.cwd(),o=r.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(r.options.cwd)}catch{}let s;try{s=vi.sync(r.command,{path:t[xi({env:t})],pathExt:e?Hr.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Hr.resolve(o?r.options.cwd:"",s)),s}function _i(r){return Br(r)||Br(r,!0)}Wr.exports=_i});var Gr=x((mm,ft)=>{"use strict";var lt=/([()\][%!^"`<>&|;, *?])/g;function yi(r){return r=r.replace(lt,"^$1"),r}function bi(r,e){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(lt,"^$1"),e&&(r=r.replace(lt,"^$1")),r}ft.exports.command=yi;ft.exports.argument=bi});var Kr=x((um,zr)=>{"use strict";zr.exports=/^#!(.*)/});var Qr=x((lm,Jr)=>{"use strict";var wi=Kr();Jr.exports=(r="")=>{let e=r.match(wi);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),o=t.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Yr=x((fm,Xr)=>{"use strict";var ct=require("fs"),Si=Qr();function Ai(r){let t=Buffer.alloc(150),n;try{n=ct.openSync(r,"r"),ct.readSync(n,t,0,150,0),ct.closeSync(n)}catch{}return Si(t.toString())}Xr.exports=Ai});var rn=x((cm,tn)=>{"use strict";var Ci=require("path"),Zr=Ur(),en=Gr(),Oi=Yr(),Ei=process.platform==="win32",ki=/\.(?:com|exe)$/i,Mi=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Li(r){r.file=Zr(r);let e=r.file&&Oi(r.file);return e?(r.args.unshift(r.file),r.command=e,Zr(r)):r.file}function Ti(r){if(!Ei)return r;let e=Li(r),t=!ki.test(e);if(r.options.forceShell||t){let n=Mi.test(e);r.command=Ci.normalize(r.command),r.command=en.command(r.command),r.args=r.args.map(i=>en.argument(i,n));let o=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${o}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function ji(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:Ti(n)}tn.exports=ji});var sn=x((pm,on)=>{"use strict";var pt=process.platform==="win32";function dt(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Ni(r,e){if(!pt)return;let t=r.emit;r.emit=function(n,o){if(n==="exit"){let i=nn(o,e);if(i)return t.call(r,"error",i)}return t.apply(r,arguments)}}function nn(r,e){return pt&&r===1&&!e.file?dt(e.original,"spawn"):null}function Ii(r,e){return pt&&r===1&&!e.file?dt(e.original,"spawnSync"):null}on.exports={hookChildProcess:Ni,verifyENOENT:nn,verifyENOENTSync:Ii,notFoundError:dt}});var un=x((dm,Y)=>{"use strict";var an=require("child_process"),ht=rn(),gt=sn();function mn(r,e,t){let n=ht(r,e,t),o=an.spawn(n.command,n.args,n.options);return gt.hookChildProcess(o,n),o}function Pi(r,e,t){let n=ht(r,e,t),o=an.spawnSync(n.command,n.args,n.options);return o.error=o.error||gt.verifyENOENTSync(o.status,n),o}Y.exports=mn;Y.exports.spawn=mn;Y.exports.sync=Pi;Y.exports._parse=ht;Y.exports._enoent=gt});sr().install();var _r=U(xr(),1),{program:Ua,createCommand:Ga,createArgument:za,createOption:Ka,CommanderError:Ja,InvalidArgumentError:Qa,InvalidOptionArgumentError:Xa,Command:yr,Argument:Ya,Option:$,Help:Za}=_r.default;var B=U(un()),v=U(require("fs")),ro=U(require("os")),d=U(require("path"));var $i=/[\p{Lu}]/u,Ri=/[\p{Ll}]/u,ln=/^[\p{Lu}](?![\p{Lu}])/gu,pn=/([\p{Alpha}\p{N}_]|$)/u,vt=/[_.\- ]+/,Vi=new RegExp("^"+vt.source),fn=new RegExp(vt.source+pn.source,"gu"),cn=new RegExp("\\d+"+pn.source,"gu"),Fi=(r,e,t,n)=>{let o=!1,i=!1,s=!1,u=!1;for(let a=0;a<r.length;a++){let m=r[a];u=a>2?r[a-3]==="-":!0,o&&$i.test(m)?(r=r.slice(0,a)+"-"+r.slice(a),o=!1,s=i,i=!0,a++):i&&s&&Ri.test(m)&&(!u||n)?(r=r.slice(0,a-1)+"-"+r.slice(a-1),s=i,i=!1,o=!0):(o=e(m)===m&&t(m)!==m,s=i,i=t(m)===m&&e(m)!==m)}return r},Di=(r,e)=>(ln.lastIndex=0,r.replaceAll(ln,t=>e(t))),qi=(r,e)=>(fn.lastIndex=0,cn.lastIndex=0,r.replaceAll(cn,(t,n,o)=>["_","-"].includes(r.charAt(o+t.length))?t:e(t)).replaceAll(fn,(t,n)=>e(n)));function xt(r,e){if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(i=>i.trim()).filter(i=>i.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?i=>i.toLowerCase():i=>i.toLocaleLowerCase(e.locale),n=e.locale===!1?i=>i.toUpperCase():i=>i.toLocaleUpperCase(e.locale);return r.length===1?vt.test(r)?"":e.pascalCase?n(r):t(r):(r!==t(r)&&(r=Fi(r,t,n,e.preserveConsecutiveUppercase)),r=r.replace(Vi,""),r=e.preserveConsecutiveUppercase?Di(r,t):t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),qi(r,n))}var Hi=typeof global=="object"&&global&&global.Object===Object&&global,be=Hi;var Bi=typeof self=="object"&&self&&self.Object===Object&&self,Wi=be||Bi||Function("return this")(),we=Wi;var Ui=we.Symbol,Z=Ui;var dn=Object.prototype,Gi=dn.hasOwnProperty,zi=dn.toString,ue=Z?Z.toStringTag:void 0;function Ki(r){var e=Gi.call(r,ue),t=r[ue];try{r[ue]=void 0;var n=!0}catch{}var o=zi.call(r);return n&&(e?r[ue]=t:delete r[ue]),o}var hn=Ki;var Ji=Object.prototype,Qi=Ji.toString;function Xi(r){return Qi.call(r)}var gn=Xi;var Yi="[object Null]",Zi="[object Undefined]",vn=Z?Z.toStringTag:void 0;function es(r){return r==null?r===void 0?Zi:Yi:vn&&vn in Object(r)?hn(r):gn(r)}var ee=es;function ts(r){return r!=null&&typeof r=="object"}var te=ts;var rs=Array.isArray,xn=rs;function ns(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var _n=ns;function os(r){return r}var yn=os;var is="[object AsyncFunction]",ss="[object Function]",as="[object GeneratorFunction]",ms="[object Proxy]";function us(r){if(!_n(r))return!1;var e=ee(r);return e==ss||e==as||e==is||e==ms}var bn=us;var ls=9007199254740991,fs=/^(?:0|[1-9]\d*)$/;function cs(r,e){var t=typeof r;return e=e??ls,!!e&&(t=="number"||t!="symbol"&&fs.test(r))&&r>-1&&r%1==0&&r<e}var wn=cs;var ps=9007199254740991;function ds(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ps}var Se=ds;function hs(r){return r!=null&&Se(r.length)&&!bn(r)}var Sn=hs;var gs=Object.prototype;function vs(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||gs;return r===t}var An=vs;function xs(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Cn=xs;var _s="[object Arguments]";function ys(r){return te(r)&&ee(r)==_s}var _t=ys;var On=Object.prototype,bs=On.hasOwnProperty,ws=On.propertyIsEnumerable,Ss=_t(function(){return arguments}())?_t:function(r){return te(r)&&bs.call(r,"callee")&&!ws.call(r,"callee")},En=Ss;function As(){return!1}var kn=As;var Tn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Tn&&typeof module=="object"&&module&&!module.nodeType&&module,Cs=Mn&&Mn.exports===Tn,Ln=Cs?we.Buffer:void 0,Os=Ln?Ln.isBuffer:void 0,Es=Os||kn,jn=Es;var ks="[object Arguments]",Ms="[object Array]",Ls="[object Boolean]",Ts="[object Date]",js="[object Error]",Ns="[object Function]",Is="[object Map]",Ps="[object Number]",$s="[object Object]",Rs="[object RegExp]",Vs="[object Set]",Fs="[object String]",Ds="[object WeakMap]",qs="[object ArrayBuffer]",Hs="[object DataView]",Bs="[object Float32Array]",Ws="[object Float64Array]",Us="[object Int8Array]",Gs="[object Int16Array]",zs="[object Int32Array]",Ks="[object Uint8Array]",Js="[object Uint8ClampedArray]",Qs="[object Uint16Array]",Xs="[object Uint32Array]",b={};b[Bs]=b[Ws]=b[Us]=b[Gs]=b[zs]=b[Ks]=b[Js]=b[Qs]=b[Xs]=!0;b[ks]=b[Ms]=b[qs]=b[Ls]=b[Hs]=b[Ts]=b[js]=b[Ns]=b[Is]=b[Ps]=b[$s]=b[Rs]=b[Vs]=b[Fs]=b[Ds]=!1;function Ys(r){return te(r)&&Se(r.length)&&!!b[ee(r)]}var Nn=Ys;function Zs(r){return function(e){return r(e)}}var In=Zs;var Pn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,le=Pn&&typeof module=="object"&&module&&!module.nodeType&&module,ea=le&&le.exports===Pn,yt=ea&&be.process,ta=function(){try{var r=le&&le.require&&le.require("util").types;return r||yt&&yt.binding&&yt.binding("util")}catch{}}(),bt=ta;var $n=bt&&bt.isTypedArray,ra=$n?In($n):Nn,Rn=ra;var na=Object.prototype,oa=na.hasOwnProperty;function ia(r,e){var t=xn(r),n=!t&&En(r),o=!t&&!n&&jn(r),i=!t&&!n&&!o&&Rn(r),s=t||n||o||i,u=s?Cn(r.length,String):[],a=u.length;for(var m in r)(e||oa.call(r,m))&&!(s&&(m=="length"||o&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||wn(m,a)))&&u.push(m);return u}var Vn=ia;function sa(r,e){return function(t){return r(e(t))}}var Fn=sa;var aa=Fn(Object.keys,Object),Dn=aa;var ma=Object.prototype,ua=ma.hasOwnProperty;function la(r){if(!An(r))return Dn(r);var e=[];for(var t in Object(r))ua.call(r,t)&&t!="constructor"&&e.push(t);return e}var qn=la;function fa(r){return Sn(r)?Vn(r):qn(r)}var Hn=fa;function ca(r){return function(e,t,n){for(var o=-1,i=Object(e),s=n(e),u=s.length;u--;){var a=s[r?u:++o];if(t(i[a],a,i)===!1)break}return e}}var Bn=ca;var pa=Bn(),Wn=pa;function da(r,e){return r&&Wn(r,e,Hn)}var Un=da;function ha(r){return typeof r=="function"?r:yn}var Gn=ha;function ga(r,e){return r&&Un(r,Gn(e))}var wt=ga;var Ae="1.1.26";var Kn=()=>{fe(),console.log(`
27
27
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
28
28
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
29
29
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
@@ -47,7 +47,7 @@ Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,i=>{let
47
47
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
48
48
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m/\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
49
49
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
50
- \x1B[0m`),console.log(""),console.log("---------------------- Seeka Apps CLI ----------------------"),console.log(`-------------------------- v${Ae} -------------------------`),console.log(""),console.log("https://developers.seeka.co"),console.log("for help: npx @seeka-labs/cli-apps@latest --help"),console.log("for scaffolding help: npx @seeka-labs/cli-apps@latest init --help"),fe()},fe=()=>{console.log(""),console.log("------------------------------------------------------------"),console.log("")};var re=U(require("fs")),Jn=require("os"),Qn=r=>/^[a-zA-Z0-9-]+$/.test(r);function Xn(r){try{let e=re.opendirSync(r),t=e.readSync();return e.closeSync(),t===null}catch{return!1}}function Yn(r){let e={};return!r||r.length===0||r.forEach(t=>{let n=t.indexOf("=");if(n===-1){e[t]="";return}let o=t.substring(0,n),i=t.substring(n+1);e[o]=i}),e}var _a=r=>re.readFileSync(r,"utf-8").split(Jn.EOL);var xa=(r,e,t)=>{let n=_a(r),o=n.find(i=>i.split("=")[0]===e);if(o!==void 0){let i=n.indexOf(o);n.splice(i,1,`${e}="${t}"`)}else n.push(`${e}="${t}"`);re.writeFileSync(r,n.join(Jn.EOL))},St=(r,e)=>{e&&Object.keys(e).forEach(t=>{xa(r,t,e[t])})};var no=r=>{if(!Qn(r.appName)){console.error("App name must be alphanumeric and hyphens only");return}if(!r.appName.startsWith("seeka-app-")){console.error("App name must start with seeka-app-");return}let e=r.appName,t=_t(r.appName.replace("seeka-app-",""),{pascalCase:!0}),n=d.resolve(r.outputDirectory,r.skipSubDir?"":r.directoryName||e);console.log(`Creating new ${r.template.replace(/-/g," ")} Seeka app in ${n}`),console.log("");let o=d.resolve(n,".git"),i=v.existsSync(o),s=d.resolve(ro.default.tmpdir(),".seeka-app-init-git-"+new Date().getTime());if(v.existsSync(s)||v.mkdirSync(s,{recursive:!0}),!r.skipSubDir&&v.existsSync(n)&&Xn(n)===!1)if(r.force)console.log("--force was used and destination directory is not empty. Clearing out the directory"),i&&(console.info(".git directory found in directory, I will preserve it and remove all other files and directories to prepare for the app creation"),v.cpSync(o,s,{recursive:!0})),v.rmSync(n,{recursive:!0,force:!0});else{console.error("Directory is not empty. Use --force to create app in non-empty directory");return}v.existsSync(n)||v.mkdirSync(n,{recursive:!0}),i&&(v.cpSync(s,o,{recursive:!0}),v.rmSync(s,{recursive:!0}),console.info("Restored .git directory"));let u=d.resolve(__dirname,"init-templates"),a=d.resolve(u,r.template);v.cpSync(a,n,{recursive:!0}),v.renameSync(d.join(n,".example.gitignore"),d.join(n,".gitignore"));let m=require(d.join(n,"package.json"));m.name=r.appName,m.version=Ae,m.description=`Seeka app ${r.appName}`,m.author=`${r.developerName} <${r.developerEmail}>`,m.scripts.deploy=m.scripts.deploy.replace(/seeka-app-example-name/i,r.appName),m.scripts.tunnel=m.scripts.tunnel.replace(/seeka-app-example-name/i,r.appName);let l=d.resolve(d.join(n,"README.md")),c=v.readFileSync(l,"utf8");c=c.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(l,c);let f=d.resolve(d.join(n,".gitlab-ci.yml")),h=v.readFileSync(f,"utf8");switch(h=h.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(f,h),r.template){case"aws-lambda":Aa(r,n,m,t);break;case"azure-function":wa(r,n,m,t);break;case"netlify-function":Sa(r,n,m,t);break}if(E(d.join(n,"src","lib","state","seeka","installations.ts"),{SampleApp:t+"App"}),ba(r,n,u,t),ya(r,m),v.writeFileSync(d.resolve(d.join(n,"package.json")),JSON.stringify(m,null,2)),console.info("Scaffolded package.json"),console.log(""),r.installDependencies)switch(console.info("Installing dependencies with "+r.packageManager),r.packageManager){case"npm":B.sync("npm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("npm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"pnpm":B.sync("pnpm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("pnpm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"yarn":B.sync("yarn",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("yarn",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;default:console.error("Invalid package manager");return}fe(),console.log(`Created ${e} in ${n}`),console.log("Boom! Your new Seeka app is ready!"),fe();let g=r.skipSubDir?n:d.relative(process.cwd(),n);console.log(`Run "cd ${g}" to change to your apps directory and start creating some magic!`),console.log(""),console.log("")},ya=(r,e)=>{let t;switch(r.packageManager){case"npm":t="npm run";break;case"pnpm":t="pnpm run";break;case"yarn":t="yarn";break;default:console.error("Invalid package manager");return}for(let n in e.scripts)e.scripts[n]=e.scripts[n].replace(/<packageManagerRunPrefix>/g,t);e.dependencies&&e.dependencies["@seeka-labs/sdk-apps-server"]&&(e.dependencies["@seeka-labs/sdk-apps-server"]="^"+e.version)};function Zn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var eo=(r,e,t,n)=>{let o;if(r.endsWith(".ts")||r.endsWith(".js"))o="//";else if(r.endsWith(".yml")||r.endsWith(".yaml"))o="#";else throw new Error("Unsupported file type "+r);if(!o)throw new Error("Unsupported file type for components application");wt(e.components,(i,s)=>{let u=Zn(`${o} START: component:${s}`),a=Zn(`${o} END: component:${s}`);i?E(r,{[u+"\r"]:"",[a+"\r"]:""}):E(r,{[`${u}[\\s\\S]*?${a}\r`]:""})})},ba=(r,e,t,n)=>{if(!r.components.browser){to(e);return}if(r.template!=="azure-function"){console.warn("Browser plugin is only supported for Azure function template, skipping browser plugin creation"),to(e);return}v.mkdirSync(d.resolve(d.join(e,"src","browser")),{recursive:!0}),v.cpSync(d.resolve(d.join(t,"browser")),d.resolve(d.join(e,"src","browser")),{recursive:!0});let o=d.resolve(d.join(e,"src","browser")),i=require(d.join(o,"package.json"));if(i.name=i.name.replace(/seeka-app-example-name/i,r.appName),i.description=i.description.replace(/seeka-app-example-name/i,r.appName),i.scripts.build=i.scripts.build.replace(/seeka-app-example-name/i,r.appName),i.scripts["build:dev"]=i.scripts["build:dev"].replace(/seeka-app-example-name/i,r.appName),i.scripts.watch=i.scripts.watch.replace(/seeka-app-example-name/i,r.appName),v.writeFileSync(d.join(o,"package.json"),JSON.stringify(i,null,2)),!r.npmUsername||!r.npmPassword)console.warn("npmUsername and npmPassword should be provided for browser plugin support.");else{let s=d.join(o,".npmrc");E(s,{"<<npm_registry_token>>":Buffer.from(`${r.npmUsername}:${r.npmPassword}`).toString("base64")})}E(d.join(e,"src","lib","browser","index.ts"),{"seeka-app-example-name":r.appName}),E(d.join(o,"README.md"),{"seeka-app-example-name":r.appName}),E(d.join(o,"src","plugin","index.ts"),{"seeka-app-example-name":r.appName,SampleApp:n+"App"}),E(d.join(o,"src","browser.ts"),{SampleApp:n+"App"}),E(d.join(o,"package.json"),{SampleApp:n+"App"}),console.info("Scaffolded browser plugin"),console.log("")},E=(r,e)=>{let t=v.readFileSync(d.resolve(r),"utf8");for(let n in e)t=t.replace(new RegExp(n,"g"),e[n]);v.writeFileSync(d.resolve(r),t)},to=r=>{v.rmSync(d.resolve(d.join(r,"src","lib","browser")),{recursive:!0})},wa=(r,e,t,n)=>{if(v.renameSync(d.join(e,"local.settings.example.json"),d.join(e,"local.settings.json")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0){let o=require(d.join(e,"local.settings.json"));o.Values={...o.Values,...r.environmentVariables},v.writeFileSync(d.join(e,"local.settings.json"),JSON.stringify(o,null,2))}r.components.browser&&(t.scripts.build="tsc && cd src/browser && yarn && yarn build && cd ../",t.scripts.watch="cd src/browser && yarn && yarn build && cd ../ && tsc -w"),E(d.join(e,"src","lib","browser","models","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","lib","browser","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","functions","seekaAppWebhook.ts"),{SampleApp:n+"App"}),eo(d.join(e,"src","functions","seekaAppWebhook.ts"),r,e,n),eo(d.join(e,".gitlab-ci.yml"),r,e,n),console.info("Scaffolded Azure function")},Sa=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","api","seeka-app-webhook","index.ts"),{SampleApp:n+"App"}),console.info("Scaffolded Netlify function")},Aa=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","routes","seekaAppWebhook.ts"),{SampleApp:n+"App"}),console.info("Scaffolded AWS lambda function")};var At=new yr;Kn();At.command("init").description("initialises a new Seeka app").argument("<name>",'name of your app. alphanumeric and hyphens only and must start with "seeka-app-"').addOption(new $("--template <template>","app template").choices(["azure-function","aws-lambda","netlify-function"]).makeOptionMandatory()).addOption(new $("--developer <developer>","app developer name or company").makeOptionMandatory()).addOption(new $("--email <email>","app developer email").makeOptionMandatory()).addOption(new $("--outName [outName]","directory name of the app. a new directory will be created with this name to contain the app.")).addOption(new $("--outDir [outDir]","output directory to create the app in. a new directory will be created here that contains the app.").default("","current working dir")).addOption(new $("--packageManager [packageManager]","package manager").choices(["yarn","npm","pnpm"]).default("yarn")).addOption(new $("--npmUsername [npmUsername]","Private NPM registry username for browser plugin dependencies.")).addOption(new $("--npmPassword [npmPassword]","Private NPM registry password for browser plugin dependencies.")).option("--noDependencies","skip installing dependencies").option("--skipSubDir","use sub directory for app files instead of root folder").option("--force","force creation of app in non-empty directory").option("--browser","adds support for browser plugin served from the app").option("--env [env...]","sets environment variables for the app. Use format of --env KEY1=VALUE1 KEY2=VALUE2").option("--appSettings [appSettings...]","sets app settings for the app. Use format of --appSettings myAppInstallSetting1=string myAppInstallSetting2=string[]").action((r,e)=>{let t={appName:r,components:{browser:e.browser&&e.template==="azure-function"},template:e.template,skipSubDir:e.skipSubDir,outputDirectory:e.outDir||process.cwd(),directoryName:e.outName||void 0,packageManager:e.packageManager,developerEmail:e.email,developerName:e.developer,installDependencies:!e.noDependencies,force:e.force,environmentVariables:Yn(e.env),appSettings:[],npmUsername:e.npmUsername,npmPassword:e.npmPassword};no(t)}).showHelpAfterError(!0);At.showHelpAfterError(!0);At.parse();
50
+ \x1B[0m`),console.log(""),console.log("---------------------- Seeka Apps CLI ----------------------"),console.log(`-------------------------- v${Ae} -------------------------`),console.log(""),console.log("https://developers.seeka.co"),console.log("for help: npx @seeka-labs/cli-apps@latest --help"),console.log("for scaffolding help: npx @seeka-labs/cli-apps@latest init --help"),fe()},fe=()=>{console.log(""),console.log("------------------------------------------------------------"),console.log("")};var re=U(require("fs")),Jn=require("os"),Qn=r=>/^[a-zA-Z0-9-]+$/.test(r);function Xn(r){try{let e=re.opendirSync(r),t=e.readSync();return e.closeSync(),t===null}catch{return!1}}function Yn(r){let e={};return!r||r.length===0||r.forEach(t=>{let n=t.indexOf("=");if(n===-1){e[t]="";return}let o=t.substring(0,n),i=t.substring(n+1);e[o]=i}),e}var xa=r=>re.readFileSync(r,"utf-8").split(Jn.EOL);var _a=(r,e,t)=>{let n=xa(r),o=n.find(i=>i.split("=")[0]===e);if(o!==void 0){let i=n.indexOf(o);n.splice(i,1,`${e}="${t}"`)}else n.push(`${e}="${t}"`);re.writeFileSync(r,n.join(Jn.EOL))},St=(r,e)=>{e&&Object.keys(e).forEach(t=>{_a(r,t,e[t])})};var no=r=>{if(!Qn(r.appName)){console.error("App name must be alphanumeric and hyphens only");return}if(!r.appName.startsWith("seeka-app-")){console.error("App name must start with seeka-app-");return}let e=r.appName,t=xt(r.appName.replace("seeka-app-",""),{pascalCase:!0}),n=d.resolve(r.outputDirectory,r.skipSubDir?"":r.directoryName||e);console.log(`Creating new ${r.template.replace(/-/g," ")} Seeka app in ${n}`),console.log("");let o=d.resolve(n,".git"),i=v.existsSync(o),s=d.resolve(ro.default.tmpdir(),".seeka-app-init-git-"+new Date().getTime());if(v.existsSync(s)||v.mkdirSync(s,{recursive:!0}),!r.skipSubDir&&v.existsSync(n)&&Xn(n)===!1)if(r.force)console.log("--force was used and destination directory is not empty. Clearing out the directory"),i&&(console.info(".git directory found in directory, I will preserve it and remove all other files and directories to prepare for the app creation"),v.cpSync(o,s,{recursive:!0})),v.rmSync(n,{recursive:!0,force:!0});else{console.error("Directory is not empty. Use --force to create app in non-empty directory");return}v.existsSync(n)||v.mkdirSync(n,{recursive:!0}),i&&(v.cpSync(s,o,{recursive:!0}),v.rmSync(s,{recursive:!0}),console.info("Restored .git directory"));let u=d.resolve(__dirname,"init-templates"),a=d.resolve(u,r.template);v.cpSync(a,n,{recursive:!0}),v.renameSync(d.join(n,".example.gitignore"),d.join(n,".gitignore"));let m=require(d.join(n,"package.json"));m.name=r.appName,m.version=Ae,m.description=`Seeka app ${r.appName}`,m.author=`${r.developerName} <${r.developerEmail}>`,m.scripts.deploy=m.scripts.deploy.replace(/seeka-app-example-name/i,r.appName),m.scripts.tunnel=m.scripts.tunnel.replace(/seeka-app-example-name/i,r.appName);let l=d.resolve(d.join(n,"README.md")),c=v.readFileSync(l,"utf8");c=c.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(l,c);let f=d.resolve(d.join(n,".gitlab-ci.yml")),h=v.readFileSync(f,"utf8");switch(h=h.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(f,h),r.template){case"aws-lambda":Aa(r,n,m,t);break;case"azure-function":wa(r,n,m,t);break;case"netlify-function":Sa(r,n,m,t);break}if(E(d.join(n,"src","lib","state","seeka","installations.ts"),{SampleApp:t+"App"}),ba(r,n,u,t),ya(r,m),v.writeFileSync(d.resolve(d.join(n,"package.json")),JSON.stringify(m,null,2)),console.info("Scaffolded package.json"),console.log(""),r.installDependencies)switch(console.info("Installing dependencies with "+r.packageManager),r.packageManager){case"npm":B.sync("npm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("npm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"pnpm":B.sync("pnpm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("pnpm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"yarn":B.sync("yarn",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("yarn",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;default:console.error("Invalid package manager");return}fe(),console.log(`Created ${e} in ${n}`),console.log("Boom! Your new Seeka app is ready!"),fe();let g=r.skipSubDir?n:d.relative(process.cwd(),n);console.log(`Run "cd ${g}" to change to your apps directory and start creating some magic!`),console.log(""),console.log("")},ya=(r,e)=>{let t;switch(r.packageManager){case"npm":t="npm run";break;case"pnpm":t="pnpm run";break;case"yarn":t="yarn";break;default:console.error("Invalid package manager");return}for(let n in e.scripts)e.scripts[n]=e.scripts[n].replace(/<packageManagerRunPrefix>/g,t);e.dependencies&&e.dependencies["@seeka-labs/sdk-apps-server"]&&(e.dependencies["@seeka-labs/sdk-apps-server"]="^"+e.version)};function Zn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var eo=(r,e,t,n)=>{let o;if(r.endsWith(".ts")||r.endsWith(".js"))o="//";else if(r.endsWith(".yml")||r.endsWith(".yaml"))o="#";else throw new Error("Unsupported file type "+r);if(!o)throw new Error("Unsupported file type for components application");wt(e.components,(i,s)=>{let u=Zn(`${o} START: component:${s}`),a=Zn(`${o} END: component:${s}`);i?E(r,{[u+"\r"]:"",[a+"\r"]:""}):E(r,{[`${u}[\\s\\S]*?${a}\r`]:""})})},ba=(r,e,t,n)=>{if(!r.components.browser){to(e);return}if(r.template!=="azure-function"){console.warn("Browser plugin is only supported for Azure function template, skipping browser plugin creation"),to(e);return}v.mkdirSync(d.resolve(d.join(e,"src","browser")),{recursive:!0}),v.cpSync(d.resolve(d.join(t,"browser")),d.resolve(d.join(e,"src","browser")),{recursive:!0});let o=d.resolve(d.join(e,"src","browser")),i=require(d.join(o,"package.json"));if(i.name=i.name.replace(/seeka-app-example-name/i,r.appName),i.description=i.description.replace(/seeka-app-example-name/i,r.appName),i.scripts.build=i.scripts.build.replace(/seeka-app-example-name/i,r.appName),i.scripts["build:dev"]=i.scripts["build:dev"].replace(/seeka-app-example-name/i,r.appName),i.scripts.watch=i.scripts.watch.replace(/seeka-app-example-name/i,r.appName),v.writeFileSync(d.join(o,"package.json"),JSON.stringify(i,null,2)),!r.npmUsername||!r.npmPassword)console.warn("npmUsername and npmPassword should be provided for browser plugin support.");else{let s=d.join(o,".npmrc");E(s,{"<<npm_registry_token>>":Buffer.from(`${r.npmUsername}:${r.npmPassword}`).toString("base64")})}E(d.join(e,"src","lib","browser","index.ts"),{"seeka-app-example-name":r.appName}),E(d.join(o,"README.md"),{"seeka-app-example-name":r.appName}),E(d.join(o,"src","plugin","index.ts"),{"seeka-app-example-name":r.appName,SampleApp:n+"App"}),E(d.join(o,"src","browser.ts"),{SampleApp:n+"App"}),E(d.join(o,"package.json"),{SampleApp:n+"App"}),console.info("Scaffolded browser plugin"),console.log("")},E=(r,e)=>{let t=v.readFileSync(d.resolve(r),"utf8");for(let n in e)t=t.replace(new RegExp(n,"g"),e[n]);v.writeFileSync(d.resolve(r),t)},to=r=>{v.rmSync(d.resolve(d.join(r,"src","lib","browser")),{recursive:!0})},wa=(r,e,t,n)=>{if(v.renameSync(d.join(e,"local.settings.example.json"),d.join(e,"local.settings.json")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0){let o=require(d.join(e,"local.settings.json"));o.Values={...o.Values,...r.environmentVariables},v.writeFileSync(d.join(e,"local.settings.json"),JSON.stringify(o,null,2))}r.components.browser&&(t.scripts.build="tsc && cd src/browser && yarn && yarn build && cd ../",t.scripts.watch="cd src/browser && yarn && yarn build && cd ../ && tsc -w"),E(d.join(e,"src","lib","browser","models","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","lib","browser","index.ts"),{SampleApp:n+"App"}),E(d.join(e,"src","functions","seekaAppWebhook.ts"),{SampleApp:n+"App"}),eo(d.join(e,"src","functions","seekaAppWebhook.ts"),r,e,n),eo(d.join(e,".gitlab-ci.yml"),r,e,n),console.info("Scaffolded Azure function")},Sa=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","api","seeka-app-webhook","index.ts"),{SampleApp:n+"App"}),console.info("Scaffolded Netlify function")},Aa=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),E(d.join(e,"src","routes","seekaAppWebhook.ts"),{SampleApp:n+"App"}),console.info("Scaffolded AWS lambda function")};var At=new yr;Kn();At.command("init").description("initialises a new Seeka app").argument("<name>",'name of your app. alphanumeric and hyphens only and must start with "seeka-app-"').addOption(new $("--template <template>","app template").choices(["azure-function","aws-lambda","netlify-function"]).makeOptionMandatory()).addOption(new $("--developer <developer>","app developer name or company").makeOptionMandatory()).addOption(new $("--email <email>","app developer email").makeOptionMandatory()).addOption(new $("--outName [outName]","directory name of the app. a new directory will be created with this name to contain the app.")).addOption(new $("--outDir [outDir]","output directory to create the app in. a new directory will be created here that contains the app.").default("","current working dir")).addOption(new $("--packageManager [packageManager]","package manager").choices(["yarn","npm","pnpm"]).default("yarn")).addOption(new $("--npmUsername [npmUsername]","Private NPM registry username for browser plugin dependencies.")).addOption(new $("--npmPassword [npmPassword]","Private NPM registry password for browser plugin dependencies.")).option("--noDependencies","skip installing dependencies").option("--skipSubDir","use sub directory for app files instead of root folder").option("--force","force creation of app in non-empty directory").option("--browser","adds support for browser plugin served from the app").option("--env [env...]","sets environment variables for the app. Use format of --env KEY1=VALUE1 KEY2=VALUE2").option("--appSettings [appSettings...]","sets app settings for the app. Use format of --appSettings myAppInstallSetting1=string myAppInstallSetting2=string[]").action((r,e)=>{let t={appName:r,components:{browser:e.browser&&e.template==="azure-function"},template:e.template,skipSubDir:e.skipSubDir,outputDirectory:e.outDir||process.cwd(),directoryName:e.outName||void 0,packageManager:e.packageManager,developerEmail:e.email,developerName:e.developer,installDependencies:!e.noDependencies,force:e.force,environmentVariables:Yn(e.env),appSettings:[],npmUsername:e.npmUsername,npmPassword:e.npmPassword};no(t)}).showHelpAfterError(!0);At.showHelpAfterError(!0);At.parse();
51
51
  /*! Bundled license information:
52
52
 
53
53
  lodash-es/lodash.js: