=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},76003:(e,t,n)=>{"use strict";const r=n(14277);e.exports=e=>"string"==typeof e?e.replace(r(),""):e},92130:(e,t,n)=>{"use strict";const r=n(22037),a=n(76224),i=n(86560),{env:s}=process;let o;function p(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function d(e,t){if(0===o)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!t&&void 0===o)return 0;const n=o||0;if("dumb"===s.TERM)return n;if("win32"===process.platform){const e=r.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in s))||"codeship"===s.CI_NAME?1:n;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:n}i("no-color")||i("no-colors")||i("color=false")||i("color=never")?o=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(o=1),"FORCE_COLOR"in s&&(o="true"===s.FORCE_COLOR?1:"false"===s.FORCE_COLOR?0:0===s.FORCE_COLOR.length?1:Math.min(parseInt(s.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return p(d(e,e&&e.isTTY))},stdout:p(d(!0,a.isatty(1))),stderr:p(d(!0,a.isatty(2)))}},26547:(e,t,n)=>{var r=n(12781);function a(e,t,n){e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var a=!1,i=!1,s=[],o=!1,p=new r;function d(){for(;s.length&&!p.paused;){var e=s.shift();if(null===e)return p.emit("end");p.emit("data",e)}}function u(){p.writable=!1,t.call(p),!p.readable&&p.autoDestroy&&p.destroy()}return p.readable=p.writable=!0,p.paused=!1,p.autoDestroy=!(n&&!1===n.autoDestroy),p.write=function(t){return e.call(this,t),!p.paused},p.queue=p.push=function(e){return o||(null===e&&(o=!0),s.push(e),d()),p},p.on("end",(function(){p.readable=!1,!p.writable&&p.autoDestroy&&process.nextTick((function(){p.destroy()}))})),p.end=function(e){if(!a)return a=!0,arguments.length&&p.write(e),u(),p},p.destroy=function(){if(!i)return i=!0,a=!0,s.length=0,p.writable=p.readable=!1,p.emit("close"),p},p.pause=function(){if(!p.paused)return p.paused=!0,p},p.resume=function(){return p.paused&&(p.paused=!1,p.emit("resume")),d(),p.paused||p.emit("drain"),p},p}e.exports=a,a.through=a},36276:(e,t,n)=>{const r=n(57147),a=n(71017),i=n(6113),s=n(55339),o=process.binding("constants"),p=s(),d="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",u=/XXXXXX/,c=(o.O_CREAT||o.fs.O_CREAT)|(o.O_EXCL||o.fs.O_EXCL)|(o.O_RDWR||o.fs.O_RDWR),l=o.EBADF||o.os.errno.EBADF,m=o.ENOENT||o.os.errno.ENOENT,h=[];var f=!1,v=!1;function _(e){var t=[],n=null;try{n=i.randomBytes(e)}catch(t){n=i.pseudoRandomBytes(e)}for(var r=0;r0?e():i(new Error("Could not get a unique tmp filename, max tries reached "+t));i(null,t)}))}()}function x(e){var t=b(e)[0],n=t.name?1:t.tries||3;if(isNaN(n)||n<0)throw new Error("Invalid tries");if(t.template&&!t.template.match(u))throw new Error("Invalid template provided");do{const e=y(t);try{r.statSync(e)}catch(t){return e}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function D(e){const t=[e];do{for(var n=t.pop(),i=!1,s=r.readdirSync(n),o=0,p=s.length;o=0&&h.splice(a,1),n=!0,e(t)}a&&a(null)}}function T(){if(!v||f)for(;h.length;)try{h[0].call(null)}catch(e){}}function k(e){return L(e,-m,"ENOENT")}function L(e,t,n){return e.code==t||e.code==n}const O=process.versions.node.split(".").map((function(e){return parseInt(e,10)}));0===O[0]&&(O[1]<9||9===O[1]&&O[2]<5)&&process.addListener("uncaughtException",(function(e){throw v=!0,T(),e})),process.addListener("exit",(function(e){e&&(v=!0),T()})),e.exports.tmpdir=p,e.exports.dir=function(e,t){var n=b(e,t),a=n[0],i=n[1];w(a,(function(e,t){if(e)return i(e);r.mkdir(t,a.mode||448,(function(e){if(e)return i(e);i(null,t,E(t,a))}))}))},e.exports.dirSync=function(e){var t=b(e)[0];const n=x(t);return r.mkdirSync(n,t.mode||448),{name:n,removeCallback:E(n,t)}},e.exports.file=function(e,t){var n=b(e,t),a=n[0],i=n[1];a.postfix=g(a.postfix)?".tmp":a.postfix,w(a,(function(e,t){if(e)return i(e);r.open(t,c,a.mode||384,(function(e,n){return e?i(e):a.discardDescriptor?r.close(n,(function(e){if(e){try{r.unlinkSync(t)}catch(t){k(t)||(e=t)}return i(e)}i(null,t,void 0,M(t,-1,a))})):a.detachDescriptor?i(null,t,n,M(t,-1,a)):void i(null,t,n,M(t,n,a))}))}))},e.exports.fileSync=function(e){var t=b(e)[0];t.postfix=t.postfix||".tmp";const n=t.discardDescriptor||t.detachDescriptor,a=x(t);var i=r.openSync(a,c,t.mode||384);return t.discardDescriptor&&(r.closeSync(i),i=void 0),{name:a,fd:i,removeCallback:M(a,n?-1:i,t)}},e.exports.tmpName=w,e.exports.tmpNameSync=x,e.exports.setGracefulCleanup=function(){f=!0}},54742:(e,t,n)=>{"use strict";var r=n(85477),a=n(72020),i={TRANSITIONAL:0,NONTRANSITIONAL:1};function s(e){return e.split("\0").map((function(e){return e.normalize("NFC")})).join("\0")}function o(e){for(var t=0,n=a.length-1;t<=n;){var r=Math.floor((t+n)/2),i=a[r];if(i[0][0]<=e&&i[0][1]>=e)return i;i[0][0]>e?n=r-1:t=r+1}return null}var p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function d(e){return e.replace(p,"_").length}var u=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;function c(e,t){"xn--"===e.substr(0,4)&&(e=r.toUnicode(e));var n=!1;(s(e)!==e||"-"===e[3]&&"-"===e[4]||"-"===e[0]||"-"===e[e.length-1]||-1!==e.indexOf(".")||0===e.search(u))&&(n=!0);for(var a=d(e),p=0;p253||0===o.length)&&(i.error=!0);for(var p=0;p63||0===s.length){i.error=!0;break}}return i.error?null:s.join(".")},e.exports.toUnicode=function(e,t){var n=l(e,t,i.NONTRANSITIONAL);return{domain:n.string,error:n.error}},e.exports.PROCESSING_OPTIONS=i},11400:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JwtGithubApi=t.JwtGithubApiFactory=t.JwtGithubApiFp=t.JwtGithubApiAxiosParamCreator=t.JwtEmailApi=t.JwtEmailApiFactory=t.JwtEmailApiFp=t.JwtEmailApiAxiosParamCreator=t.JwtApi=t.JwtApiFactory=t.JwtApiFp=t.JwtApiAxiosParamCreator=t.HealthApi=t.HealthApiFactory=t.HealthApiFp=t.HealthApiAxiosParamCreator=t.AuthSlsRestApiJwkCrvEnum=t.AuthSlsRestApiJwkKtyEnum=t.AuthSlsRestApiInstallationStateRemoved=t.AuthSlsRestApiInstallationStateAnyOf=t.AuthSlsRestApiGithubMembershipEventV1TypeEnum=t.AuthSlsRestApiGithubMembershipEventV1VersionEnum=t.AuthSlsRestApiGithubLoginTokenEventV1TypeEnum=t.AuthSlsRestApiGithubLoginTokenEventV1VersionEnum=t.AuthSlsRestApiGithubInstallationEventV1TypeEnum=t.AuthSlsRestApiGithubInstallationEventV1VersionEnum=t.AuthSlsRestApiGithubIdentityEventV1AllOfSourceEnum=t.AuthSlsRestApiGithubIdentityEventV1SourceEnum=t.AuthSlsRestApiGithubIdentityEventV1TypeEnum=t.AuthSlsRestApiGithubIdentityEventV1VersionEnum=t.AuthSlsRestApiBaseEventGithubMembershipEvent1TypeEnum=t.AuthSlsRestApiBaseEventGithubMembershipEvent1VersionEnum=t.AuthSlsRestApiBaseEventGithubLoginTokenEvent1TypeEnum=t.AuthSlsRestApiBaseEventGithubLoginTokenEvent1VersionEnum=t.AuthSlsRestApiBaseEventGithubInstallationEvent1TypeEnum=t.AuthSlsRestApiBaseEventGithubInstallationEvent1VersionEnum=t.AuthSlsRestApiBaseEventGithubIdentityEvent1TypeEnum=t.AuthSlsRestApiBaseEventGithubIdentityEvent1VersionEnum=void 0;const a=r(n(9669)),i=n(99849),s=n(49451);var o,p,d,u,c,l,m,h,f,v,_;(_=t.AuthSlsRestApiBaseEventGithubIdentityEvent1VersionEnum||(t.AuthSlsRestApiBaseEventGithubIdentityEvent1VersionEnum={}))[_.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiBaseEventGithubIdentityEvent1TypeEnum||(t.AuthSlsRestApiBaseEventGithubIdentityEvent1TypeEnum={})).GithubIdentityEvent="GithubIdentityEvent",(v=t.AuthSlsRestApiBaseEventGithubInstallationEvent1VersionEnum||(t.AuthSlsRestApiBaseEventGithubInstallationEvent1VersionEnum={}))[v.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiBaseEventGithubInstallationEvent1TypeEnum||(t.AuthSlsRestApiBaseEventGithubInstallationEvent1TypeEnum={})).GithubInstallationEvent="GithubInstallationEvent",(f=t.AuthSlsRestApiBaseEventGithubLoginTokenEvent1VersionEnum||(t.AuthSlsRestApiBaseEventGithubLoginTokenEvent1VersionEnum={}))[f.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiBaseEventGithubLoginTokenEvent1TypeEnum||(t.AuthSlsRestApiBaseEventGithubLoginTokenEvent1TypeEnum={})).GithubLoginTokenEvent="GithubLoginTokenEvent",(h=t.AuthSlsRestApiBaseEventGithubMembershipEvent1VersionEnum||(t.AuthSlsRestApiBaseEventGithubMembershipEvent1VersionEnum={}))[h.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiBaseEventGithubMembershipEvent1TypeEnum||(t.AuthSlsRestApiBaseEventGithubMembershipEvent1TypeEnum={})).GithubMembershipEvent="GithubMembershipEvent",(m=t.AuthSlsRestApiGithubIdentityEventV1VersionEnum||(t.AuthSlsRestApiGithubIdentityEventV1VersionEnum={}))[m.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiGithubIdentityEventV1TypeEnum||(t.AuthSlsRestApiGithubIdentityEventV1TypeEnum={})).GithubIdentityEvent="GithubIdentityEvent",(l=t.AuthSlsRestApiGithubIdentityEventV1SourceEnum||(t.AuthSlsRestApiGithubIdentityEventV1SourceEnum={})).Login="LOGIN",l.Assume="ASSUME",l.Administer="ADMINISTER",l.Collaborate="COLLABORATE",(c=t.AuthSlsRestApiGithubIdentityEventV1AllOfSourceEnum||(t.AuthSlsRestApiGithubIdentityEventV1AllOfSourceEnum={})).Login="LOGIN",c.Assume="ASSUME",c.Administer="ADMINISTER",c.Collaborate="COLLABORATE",(u=t.AuthSlsRestApiGithubInstallationEventV1VersionEnum||(t.AuthSlsRestApiGithubInstallationEventV1VersionEnum={}))[u.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiGithubInstallationEventV1TypeEnum||(t.AuthSlsRestApiGithubInstallationEventV1TypeEnum={})).GithubInstallationEvent="GithubInstallationEvent",(d=t.AuthSlsRestApiGithubLoginTokenEventV1VersionEnum||(t.AuthSlsRestApiGithubLoginTokenEventV1VersionEnum={}))[d.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiGithubLoginTokenEventV1TypeEnum||(t.AuthSlsRestApiGithubLoginTokenEventV1TypeEnum={})).GithubLoginTokenEvent="GithubLoginTokenEvent",(p=t.AuthSlsRestApiGithubMembershipEventV1VersionEnum||(t.AuthSlsRestApiGithubMembershipEventV1VersionEnum={}))[p.NUMBER_1=1]="NUMBER_1",(t.AuthSlsRestApiGithubMembershipEventV1TypeEnum||(t.AuthSlsRestApiGithubMembershipEventV1TypeEnum={})).GithubMembershipEvent="GithubMembershipEvent",(t.AuthSlsRestApiInstallationStateAnyOf||(t.AuthSlsRestApiInstallationStateAnyOf={})).Installed="INSTALLED",(o=t.AuthSlsRestApiInstallationStateRemoved||(t.AuthSlsRestApiInstallationStateRemoved={})).Suspended="SUSPENDED",o.Deleted="DELETED",(t.AuthSlsRestApiJwkKtyEnum||(t.AuthSlsRestApiJwkKtyEnum={})).Ec="EC",(t.AuthSlsRestApiJwkCrvEnum||(t.AuthSlsRestApiJwkCrvEnum={})).P256="P-256",t.HealthApiAxiosParamCreator=function(e){return{get:async(t={})=>{const n=new URL("/api/health",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t};(0,i.setSearchParams)(n,{});let s=r&&r.headers?r.headers:{};return a.headers={...s,...t.headers},{url:(0,i.toPathString)(n),options:a}}}},t.HealthApiFp=function(e){const n=(0,t.HealthApiAxiosParamCreator)(e);return{async get(t){const r=await n.get(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)}}},t.HealthApiFactory=function(e,n,r){const a=(0,t.HealthApiFp)(e);return{get:e=>a.get(e).then((e=>e(r,n)))}};class g extends s.BaseAPI{get(e){return(0,t.HealthApiFp)(this.configuration).get(e).then((e=>e(this.axios,this.basePath)))}}t.HealthApi=g,t.JwtApiAxiosParamCreator=function(e){return{certs:async(t={})=>{const n=new URL("/api/v1/jwts",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t};(0,i.setSearchParams)(n,{});let s=r&&r.headers?r.headers:{};return a.headers={...s,...t.headers},{url:(0,i.toPathString)(n),options:a}},getPayload:async(t={})=>{const n=new URL("/api/v1/jwts/me",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t},s={};await(0,i.setBearerAuthToObject)(s,e),(0,i.setSearchParams)(n,{});let o=r&&r.headers?r.headers:{};return a.headers={...s,...o,...t.headers},{url:(0,i.toPathString)(n),options:a}},refresh:async(t,n={})=>{(0,i.assertParamExists)("refresh","authSlsRestApiTokenRequest",t);const r=new URL("/api/v1/jwts/refresh",i.DUMMY_BASE_URL);let a;e&&(a=e.baseOptions);const s={method:"POST",...a,...n},o={"Content-Type":"application/json"};(0,i.setSearchParams)(r,{});let p=a&&a.headers?a.headers:{};return s.headers={...o,...p,...n.headers},s.data=(0,i.serializeDataIfNeeded)(t,s,e),{url:(0,i.toPathString)(r),options:s}},verify:async(t,n={})=>{(0,i.assertParamExists)("verify","authSlsRestApiTokenRequest",t);const r=new URL("/api/v1/jwts",i.DUMMY_BASE_URL);let a;e&&(a=e.baseOptions);const s={method:"POST",...a,...n},o={"Content-Type":"application/json"};(0,i.setSearchParams)(r,{});let p=a&&a.headers?a.headers:{};return s.headers={...o,...p,...n.headers},s.data=(0,i.serializeDataIfNeeded)(t,s,e),{url:(0,i.toPathString)(r),options:s}}}},t.JwtApiFp=function(e){const n=(0,t.JwtApiAxiosParamCreator)(e);return{async certs(t){const r=await n.certs(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)},async getPayload(t){const r=await n.getPayload(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)},async refresh(t,r){const o=await n.refresh(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)},async verify(t,r){const o=await n.verify(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)}}},t.JwtApiFactory=function(e,n,r){const a=(0,t.JwtApiFp)(e);return{certs:e=>a.certs(e).then((e=>e(r,n))),getPayload:e=>a.getPayload(e).then((e=>e(r,n))),refresh:(e,t)=>a.refresh(e,t).then((e=>e(r,n))),verify:(e,t)=>a.verify(e,t).then((e=>e(r,n)))}};class b extends s.BaseAPI{certs(e){return(0,t.JwtApiFp)(this.configuration).certs(e).then((e=>e(this.axios,this.basePath)))}getPayload(e){return(0,t.JwtApiFp)(this.configuration).getPayload(e).then((e=>e(this.axios,this.basePath)))}refresh(e,n){return(0,t.JwtApiFp)(this.configuration).refresh(e,n).then((e=>e(this.axios,this.basePath)))}verify(e,n){return(0,t.JwtApiFp)(this.configuration).verify(e,n).then((e=>e(this.axios,this.basePath)))}}t.JwtApi=b,t.JwtEmailApiAxiosParamCreator=function(e){return{loginWithEmail:async(t,n={})=>{(0,i.assertParamExists)("loginWithEmail","authSlsRestApiEmailLoginRequest",t);const r=new URL("/api/v1/jwts/email",i.DUMMY_BASE_URL);let a;e&&(a=e.baseOptions);const s={method:"POST",...a,...n},o={"Content-Type":"application/json"};(0,i.setSearchParams)(r,{});let p=a&&a.headers?a.headers:{};return s.headers={...o,...p,...n.headers},s.data=(0,i.serializeDataIfNeeded)(t,s,e),{url:(0,i.toPathString)(r),options:s}}}},t.JwtEmailApiFp=function(e){const n=(0,t.JwtEmailApiAxiosParamCreator)(e);return{async loginWithEmail(t,r){const o=await n.loginWithEmail(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)}}},t.JwtEmailApiFactory=function(e,n,r){const a=(0,t.JwtEmailApiFp)(e);return{loginWithEmail:(e,t)=>a.loginWithEmail(e,t).then((e=>e(r,n)))}};class y extends s.BaseAPI{loginWithEmail(e,n){return(0,t.JwtEmailApiFp)(this.configuration).loginWithEmail(e,n).then((e=>e(this.axios,this.basePath)))}}t.JwtEmailApi=y,t.JwtGithubApiAxiosParamCreator=function(e){return{createLogin:async(t,n={})=>{(0,i.assertParamExists)("createLogin","authSlsRestApiGithubLoginRequest",t);const r=new URL("/api/v1/jwts/github",i.DUMMY_BASE_URL);let a;e&&(a=e.baseOptions);const s={method:"PUT",...a,...n},o={"Content-Type":"application/json"};(0,i.setSearchParams)(r,{});let p=a&&a.headers?a.headers:{};return s.headers={...o,...p,...n.headers},s.data=(0,i.serializeDataIfNeeded)(t,s,e),{url:(0,i.toPathString)(r),options:s}},exchangeToken:async(t,n={})=>{(0,i.assertParamExists)("exchangeToken","authSlsRestApiGithubTokenExchangeRequest",t);const r=new URL("/api/v1/jwts/github/token",i.DUMMY_BASE_URL);let a;e&&(a=e.baseOptions);const s={method:"POST",...a,...n},o={"Content-Type":"application/json"};(0,i.setSearchParams)(r,{});let p=a&&a.headers?a.headers:{};return s.headers={...o,...p,...n.headers},s.data=(0,i.serializeDataIfNeeded)(t,s,e),{url:(0,i.toPathString)(r),options:s}},getAuthenticatedUser:async(t={})=>{const n=new URL("/api/v1/jwts/github/me",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t},s={};await(0,i.setBearerAuthToObject)(s,e),(0,i.setSearchParams)(n,{});let o=r&&r.headers?r.headers:{};return a.headers={...s,...o,...t.headers},{url:(0,i.toPathString)(n),options:a}},getOauthDetail:async(t,n={})=>{const r=new URL("/api/v1/jwts/github",i.DUMMY_BASE_URL);let a;e&&(a=e.baseOptions);const s={method:"GET",...a,...n},o={};void 0!==t&&(o.appId=t),(0,i.setSearchParams)(r,o);let p=a&&a.headers?a.headers:{};return s.headers={...p,...n.headers},{url:(0,i.toPathString)(r),options:s}},oauthCallback:async(t,n={})=>{(0,i.assertParamExists)("oauthCallback","authSlsRestApiGithubJwtRequest",t);const r=new URL("/api/v1/jwts/github",i.DUMMY_BASE_URL);let a;e&&(a=e.baseOptions);const s={method:"POST",...a,...n},o={"Content-Type":"application/json"};(0,i.setSearchParams)(r,{});let p=a&&a.headers?a.headers:{};return s.headers={...o,...p,...n.headers},s.data=(0,i.serializeDataIfNeeded)(t,s,e),{url:(0,i.toPathString)(r),options:s}}}},t.JwtGithubApiFp=function(e){const n=(0,t.JwtGithubApiAxiosParamCreator)(e);return{async createLogin(t,r){const o=await n.createLogin(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)},async exchangeToken(t,r){const o=await n.exchangeToken(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)},async getAuthenticatedUser(t){const r=await n.getAuthenticatedUser(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)},async getOauthDetail(t,r){const o=await n.getOauthDetail(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)},async oauthCallback(t,r){const o=await n.oauthCallback(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)}}},t.JwtGithubApiFactory=function(e,n,r){const a=(0,t.JwtGithubApiFp)(e);return{createLogin:(e,t)=>a.createLogin(e,t).then((e=>e(r,n))),exchangeToken:(e,t)=>a.exchangeToken(e,t).then((e=>e(r,n))),getAuthenticatedUser:e=>a.getAuthenticatedUser(e).then((e=>e(r,n))),getOauthDetail:(e,t)=>a.getOauthDetail(e,t).then((e=>e(r,n))),oauthCallback:(e,t)=>a.oauthCallback(e,t).then((e=>e(r,n)))}};class w extends s.BaseAPI{createLogin(e,n){return(0,t.JwtGithubApiFp)(this.configuration).createLogin(e,n).then((e=>e(this.axios,this.basePath)))}exchangeToken(e,n){return(0,t.JwtGithubApiFp)(this.configuration).exchangeToken(e,n).then((e=>e(this.axios,this.basePath)))}getAuthenticatedUser(e){return(0,t.JwtGithubApiFp)(this.configuration).getAuthenticatedUser(e).then((e=>e(this.axios,this.basePath)))}getOauthDetail(e,n){return(0,t.JwtGithubApiFp)(this.configuration).getOauthDetail(e,n).then((e=>e(this.axios,this.basePath)))}oauthCallback(e,n){return(0,t.JwtGithubApiFp)(this.configuration).oauthCallback(e,n).then((e=>e(this.axios,this.basePath)))}}t.JwtGithubApi=w},49451:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RequiredError=t.BaseAPI=t.COLLECTION_FORMATS=t.BASE_PATH=void 0;const a=r(n(9669));t.BASE_PATH="https://sso.saml.to/auth".replace(/\/+$/,""),t.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:"\t",pipes:"|"},t.BaseAPI=class{basePath;axios;configuration;constructor(e,n=t.BASE_PATH,r=a.default){this.basePath=n,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}};class i extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}}t.RequiredError=i},99849:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestFunction=t.toPathString=t.serializeDataIfNeeded=t.setSearchParams=t.setOAuthToObject=t.setBearerAuthToObject=t.setBasicAuthToObject=t.setApiKeyToObject=t.assertParamExists=t.DUMMY_BASE_URL=void 0;const r=n(49451);t.DUMMY_BASE_URL="https://example.com",t.assertParamExists=function(e,t,n){if(null==n)throw new r.RequiredError(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},t.setApiKeyToObject=async function(e,t,n){if(n&&n.apiKey){const r="function"==typeof n.apiKey?await n.apiKey(t):await n.apiKey;e[t]=r}},t.setBasicAuthToObject=function(e,t){t&&(t.username||t.password)&&(e.auth={username:t.username,password:t.password})},t.setBearerAuthToObject=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}},t.setOAuthToObject=async function(e,t,n,r){if(r&&r.accessToken){const a="function"==typeof r.accessToken?await r.accessToken(t,n):await r.accessToken;e.Authorization="Bearer "+a}},t.setSearchParams=function(e,...t){const n=new URLSearchParams(e.search);for(const e of t)for(const t in e)if(Array.isArray(e[t])){n.delete(t);for(const r of e[t])n.append(t,r)}else n.set(t,e[t]);e.search=n.toString()},t.serializeDataIfNeeded=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},t.toPathString=function(e){return e.pathname+e.search+e.hash},t.createRequestFunction=function(e,t,n,r){return(a=t,i=n)=>{const s={...e.options,url:(r?.basePath||i)+e.url};return a.request(s)}}},73457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=void 0,t.Configuration=class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}},6095:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(11400),t),a(n(73457),t)},26703:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TemplateApi=t.TemplateApiFactory=t.TemplateApiFp=t.TemplateApiAxiosParamCreator=t.IDPApi=t.IDPApiFactory=t.IDPApiFp=t.IDPApiAxiosParamCreator=t.HealthApi=t.HealthApiFactory=t.HealthApiFp=t.HealthApiAxiosParamCreator=t.ConfigApi=t.ConfigApiFactory=t.ConfigApiFp=t.ConfigApiAxiosParamCreator=t.GithubSlsRestApiSupportedVersions=t.GithubSlsRestApiSamlHttpRequestMethodEnum=t.GithubSlsRestApiNameIdFormatV1=t.GithubSlsRestApiIdpCertificateEventV1AllOfStateEnum=t.GithubSlsRestApiIdpCertificateEventV1StateEnum=t.GithubSlsRestApiIdpCertificateEventV1TypeEnum=t.GithubSlsRestApiIdpCertificateEventV1VersionEnum=t.GithubSlsRestApiConfigChangedEventV1AllOfStatesEnum=t.GithubSlsRestApiConfigChangedEventV1StatesEnum=t.GithubSlsRestApiConfigChangedEventV1TypeEnum=t.GithubSlsRestApiConfigChangedEventV1VersionEnum=t.GithubSlsRestApiCloudFormationHookEventV1TypeEnum=t.GithubSlsRestApiCloudFormationHookEventV1VersionEnum=t.GithubSlsRestApiCacheClearRequestEventV1TypeEnum=t.GithubSlsRestApiCacheClearRequestEventV1VersionEnum=t.GithubSlsRestApiBaseEventIdpCertificate1TypeEnum=t.GithubSlsRestApiBaseEventIdpCertificate1VersionEnum=t.GithubSlsRestApiBaseEventConfigChanged1TypeEnum=t.GithubSlsRestApiBaseEventConfigChanged1VersionEnum=t.GithubSlsRestApiBaseEventCacheClearRequest1TypeEnum=t.GithubSlsRestApiBaseEventCacheClearRequest1VersionEnum=t.GithubSlsRestApiAuthSlsRestApiGithubMembershipEventV1VersionEnum=t.GithubSlsRestApiAuthSlsRestApiGithubMembershipEventV1TypeEnum=t.GithubSlsRestApiAuthSlsRestApiGithubLoginTokenEventV1VersionEnum=t.GithubSlsRestApiAuthSlsRestApiGithubLoginTokenEventV1TypeEnum=t.GithubSlsRestApiAuthSlsRestApiGithubInstallationEventV1VersionEnum=t.GithubSlsRestApiAuthSlsRestApiGithubInstallationEventV1TypeEnum=void 0;const a=r(n(9669)),i=n(30476),s=n(43347);var o,p,d,u,c,l,m,h,f,v,_;(t.GithubSlsRestApiAuthSlsRestApiGithubInstallationEventV1TypeEnum||(t.GithubSlsRestApiAuthSlsRestApiGithubInstallationEventV1TypeEnum={})).GithubInstallationEvent="GithubInstallationEvent",(_=t.GithubSlsRestApiAuthSlsRestApiGithubInstallationEventV1VersionEnum||(t.GithubSlsRestApiAuthSlsRestApiGithubInstallationEventV1VersionEnum={}))[_.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiAuthSlsRestApiGithubLoginTokenEventV1TypeEnum||(t.GithubSlsRestApiAuthSlsRestApiGithubLoginTokenEventV1TypeEnum={})).GithubLoginTokenEvent="GithubLoginTokenEvent",(v=t.GithubSlsRestApiAuthSlsRestApiGithubLoginTokenEventV1VersionEnum||(t.GithubSlsRestApiAuthSlsRestApiGithubLoginTokenEventV1VersionEnum={}))[v.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiAuthSlsRestApiGithubMembershipEventV1TypeEnum||(t.GithubSlsRestApiAuthSlsRestApiGithubMembershipEventV1TypeEnum={})).GithubMembershipEvent="GithubMembershipEvent",(f=t.GithubSlsRestApiAuthSlsRestApiGithubMembershipEventV1VersionEnum||(t.GithubSlsRestApiAuthSlsRestApiGithubMembershipEventV1VersionEnum={}))[f.NUMBER_1=1]="NUMBER_1",(h=t.GithubSlsRestApiBaseEventCacheClearRequest1VersionEnum||(t.GithubSlsRestApiBaseEventCacheClearRequest1VersionEnum={}))[h.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiBaseEventCacheClearRequest1TypeEnum||(t.GithubSlsRestApiBaseEventCacheClearRequest1TypeEnum={})).CacheClearRequest="CacheClearRequest",(m=t.GithubSlsRestApiBaseEventConfigChanged1VersionEnum||(t.GithubSlsRestApiBaseEventConfigChanged1VersionEnum={}))[m.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiBaseEventConfigChanged1TypeEnum||(t.GithubSlsRestApiBaseEventConfigChanged1TypeEnum={})).ConfigChanged="ConfigChanged",(l=t.GithubSlsRestApiBaseEventIdpCertificate1VersionEnum||(t.GithubSlsRestApiBaseEventIdpCertificate1VersionEnum={}))[l.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiBaseEventIdpCertificate1TypeEnum||(t.GithubSlsRestApiBaseEventIdpCertificate1TypeEnum={})).IdpCertificate="IdpCertificate",(c=t.GithubSlsRestApiCacheClearRequestEventV1VersionEnum||(t.GithubSlsRestApiCacheClearRequestEventV1VersionEnum={}))[c.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiCacheClearRequestEventV1TypeEnum||(t.GithubSlsRestApiCacheClearRequestEventV1TypeEnum={})).CacheClearRequest="CacheClearRequest",(u=t.GithubSlsRestApiCloudFormationHookEventV1VersionEnum||(t.GithubSlsRestApiCloudFormationHookEventV1VersionEnum={}))[u.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiCloudFormationHookEventV1TypeEnum||(t.GithubSlsRestApiCloudFormationHookEventV1TypeEnum={})).CloudFormationHookEvent="CloudFormationHookEvent",(d=t.GithubSlsRestApiConfigChangedEventV1VersionEnum||(t.GithubSlsRestApiConfigChangedEventV1VersionEnum={}))[d.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiConfigChangedEventV1TypeEnum||(t.GithubSlsRestApiConfigChangedEventV1TypeEnum={})).ConfigChanged="ConfigChanged",(t.GithubSlsRestApiConfigChangedEventV1StatesEnum||(t.GithubSlsRestApiConfigChangedEventV1StatesEnum={})).ShaChanged="SHA_CHANGED",(t.GithubSlsRestApiConfigChangedEventV1AllOfStatesEnum||(t.GithubSlsRestApiConfigChangedEventV1AllOfStatesEnum={})).ShaChanged="SHA_CHANGED",(p=t.GithubSlsRestApiIdpCertificateEventV1VersionEnum||(t.GithubSlsRestApiIdpCertificateEventV1VersionEnum={}))[p.NUMBER_1=1]="NUMBER_1",(t.GithubSlsRestApiIdpCertificateEventV1TypeEnum||(t.GithubSlsRestApiIdpCertificateEventV1TypeEnum={})).IdpCertificate="IdpCertificate",(t.GithubSlsRestApiIdpCertificateEventV1StateEnum||(t.GithubSlsRestApiIdpCertificateEventV1StateEnum={})).Updated="UPDATED",(t.GithubSlsRestApiIdpCertificateEventV1AllOfStateEnum||(t.GithubSlsRestApiIdpCertificateEventV1AllOfStateEnum={})).Updated="UPDATED",(o=t.GithubSlsRestApiNameIdFormatV1||(t.GithubSlsRestApiNameIdFormatV1={})).Id="id",o.Login="login",o.Email="email",o.EmailV2="emailV2",(t.GithubSlsRestApiSamlHttpRequestMethodEnum||(t.GithubSlsRestApiSamlHttpRequestMethodEnum={})).Post="POST",(t.GithubSlsRestApiSupportedVersions||(t.GithubSlsRestApiSupportedVersions={}))._20220101="20220101",t.ConfigApiAxiosParamCreator=function(e){return{listOrgRepoConfigs:async(t={})=>{const n=new URL("/api/v1/config/orgs",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t},s={};await(0,i.setBearerAuthToObject)(s,e),(0,i.setSearchParams)(n,{});let o=r&&r.headers?r.headers:{};return a.headers={...s,...o,...t.headers},{url:(0,i.toPathString)(n),options:a}},saveConfig:async(t,n,r,a={})=>{(0,i.assertParamExists)("saveConfig","org",t),(0,i.assertParamExists)("saveConfig","githubSlsRestApiSaveConfigRequest",n);const s="/api/v1/config/orgs/{org}".replace("{org}",encodeURIComponent(String(t))),o=new URL(s,i.DUMMY_BASE_URL);let p;e&&(p=e.baseOptions);const d={method:"POST",...p,...a},u={},c={};await(0,i.setBearerAuthToObject)(u,e),void 0!==r&&(c.force=r),u["Content-Type"]="application/json",(0,i.setSearchParams)(o,c);let l=p&&p.headers?p.headers:{};return d.headers={...u,...l,...a.headers},d.data=(0,i.serializeDataIfNeeded)(n,d,e),{url:(0,i.toPathString)(o),options:d}}}},t.ConfigApiFp=function(e){const n=(0,t.ConfigApiAxiosParamCreator)(e);return{async listOrgRepoConfigs(t){const r=await n.listOrgRepoConfigs(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)},async saveConfig(t,r,o,p){const d=await n.saveConfig(t,r,o,p);return(0,i.createRequestFunction)(d,a.default,s.BASE_PATH,e)}}},t.ConfigApiFactory=function(e,n,r){const a=(0,t.ConfigApiFp)(e);return{listOrgRepoConfigs:e=>a.listOrgRepoConfigs(e).then((e=>e(r,n))),saveConfig:(e,t,i,s)=>a.saveConfig(e,t,i,s).then((e=>e(r,n)))}};class g extends s.BaseAPI{listOrgRepoConfigs(e){return(0,t.ConfigApiFp)(this.configuration).listOrgRepoConfigs(e).then((e=>e(this.axios,this.basePath)))}saveConfig(e,n,r,a){return(0,t.ConfigApiFp)(this.configuration).saveConfig(e,n,r,a).then((e=>e(this.axios,this.basePath)))}}t.ConfigApi=g,t.HealthApiAxiosParamCreator=function(e){return{get:async(t={})=>{const n=new URL("/api/health",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t};(0,i.setSearchParams)(n,{});let s=r&&r.headers?r.headers:{};return a.headers={...s,...t.headers},{url:(0,i.toPathString)(n),options:a}}}},t.HealthApiFp=function(e){const n=(0,t.HealthApiAxiosParamCreator)(e);return{async get(t){const r=await n.get(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)}}},t.HealthApiFactory=function(e,n,r){const a=(0,t.HealthApiFp)(e);return{get:e=>a.get(e).then((e=>e(r,n)))}};class b extends s.BaseAPI{get(e){return(0,t.HealthApiFp)(this.configuration).get(e).then((e=>e(this.axios,this.basePath)))}}t.HealthApi=b,t.IDPApiAxiosParamCreator=function(e){return{assumeRole:async(t,n,r,a={})=>{(0,i.assertParamExists)("assumeRole","role",t);const s="/api/v1/idp/roles/{role}/assume".replace("{role}",encodeURIComponent(String(t))),o=new URL(s,i.DUMMY_BASE_URL);let p;e&&(p=e.baseOptions);const d={method:"POST",...p,...a},u={},c={};await(0,i.setBearerAuthToObject)(u,e),void 0!==n&&(c.org=n),void 0!==r&&(c.provider=r),(0,i.setSearchParams)(o,c);let l=p&&p.headers?p.headers:{};return d.headers={...u,...l,...a.headers},{url:(0,i.toPathString)(o),options:d}},assumeRoleForBrowser:async(t,n,r,a={})=>{(0,i.assertParamExists)("assumeRoleForBrowser","role",t);const s="/api/v1/idp/roles/{role}/assume/browser".replace("{role}",encodeURIComponent(String(t))),o=new URL(s,i.DUMMY_BASE_URL);let p;e&&(p=e.baseOptions);const d={method:"GET",...p,...a},u={};void 0!==n&&(u.org=n),void 0!==r&&(u.provider=r),(0,i.setSearchParams)(o,u);let c=p&&p.headers?p.headers:{};return d.headers={...c,...a.headers},{url:(0,i.toPathString)(o),options:d}},assumeRoleForRepo:async(t,n,r,a,s,o,p,d={})=>{(0,i.assertParamExists)("assumeRoleForRepo","org",t),(0,i.assertParamExists)("assumeRoleForRepo","repo",n),(0,i.assertParamExists)("assumeRoleForRepo","role",r);const u="/api/v1/idp/orgs/{org}/repos/{repo}/roles/{role}/assume".replace("{org}",encodeURIComponent(String(t))).replace("{repo}",encodeURIComponent(String(n))).replace("{role}",encodeURIComponent(String(r))),c=new URL(u,i.DUMMY_BASE_URL);let l;e&&(l=e.baseOptions);const m={method:"POST",...l,...d},h={},f={};await(0,i.setBearerAuthToObject)(h,e),void 0!==a&&(f.provider=a),void 0!==s&&(f.commitSha=s),void 0!==o&&(f.configOwner=o),void 0!==p&&(f.configPath=p),(0,i.setSearchParams)(c,f);let v=l&&l.headers?l.headers:{};return m.headers={...h,...v,...d.headers},{url:(0,i.toPathString)(c),options:m}},encrypt:async(t,n,r={})=>{(0,i.assertParamExists)("encrypt","org",t),(0,i.assertParamExists)("encrypt","githubSlsRestApiEncryptRequest",n);const a="/api/v1/idp/orgs/{org}/encrypt".replace("{org}",encodeURIComponent(String(t))),s=new URL(a,i.DUMMY_BASE_URL);let o;e&&(o=e.baseOptions);const p={method:"POST",...o,...r},d={"Content-Type":"application/json"};(0,i.setSearchParams)(s,{});let u=o&&o.headers?o.headers:{};return p.headers={...d,...u,...r.headers},p.data=(0,i.serializeDataIfNeeded)(n,p,e),{url:(0,i.toPathString)(s),options:p}},getIdentity:async(t={})=>{const n=new URL("/api/v1/idp/me",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t},s={};await(0,i.setBearerAuthToObject)(s,e),(0,i.setSearchParams)(n,{});let o=r&&r.headers?r.headers:{};return a.headers={...s,...o,...t.headers},{url:(0,i.toPathString)(n),options:a}},getOrgConfig:async(t,n,r={})=>{(0,i.assertParamExists)("getOrgConfig","org",t);const a="/api/v1/idp/orgs/{org}/config".replace("{org}",encodeURIComponent(String(t))),s=new URL(a,i.DUMMY_BASE_URL);let o;e&&(o=e.baseOptions);const p={method:"GET",...o,...r},d={},u={};await(0,i.setBearerAuthToObject)(d,e),void 0!==n&&(u.raw=n),(0,i.setSearchParams)(s,u);let c=o&&o.headers?o.headers:{};return p.headers={...d,...c,...r.headers},{url:(0,i.toPathString)(s),options:p}},getOrgMetadata:async(t,n={})=>{(0,i.assertParamExists)("getOrgMetadata","org",t);const r="/api/v1/idp/orgs/{org}/metadata".replace("{org}",encodeURIComponent(String(t))),a=new URL(r,i.DUMMY_BASE_URL);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...n};(0,i.setSearchParams)(a,{});let p=s&&s.headers?s.headers:{};return o.headers={...p,...n.headers},{url:(0,i.toPathString)(a),options:o}},getOrgRepo:async(t,n={})=>{(0,i.assertParamExists)("getOrgRepo","org",t);const r="/api/v1/idp/orgs/{org}".replace("{org}",encodeURIComponent(String(t))),a=new URL(r,i.DUMMY_BASE_URL);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...n},p={};await(0,i.setBearerAuthToObject)(p,e),(0,i.setSearchParams)(a,{});let d=s&&s.headers?s.headers:{};return o.headers={...p,...d,...n.headers},{url:(0,i.toPathString)(a),options:o}},listLogins:async(t,n,r={})=>{const a=new URL("/api/v1/idp/logins",i.DUMMY_BASE_URL);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},p={},d={};await(0,i.setBearerAuthToObject)(p,e),void 0!==t&&(d.org=t),void 0!==n&&(d.refresh=n),(0,i.setSearchParams)(a,d);let u=s&&s.headers?s.headers:{};return o.headers={...p,...u,...r.headers},{url:(0,i.toPathString)(a),options:o}},listOrgRepos:async(t={})=>{const n=new URL("/api/v1/idp/orgs",i.DUMMY_BASE_URL);let r;e&&(r=e.baseOptions);const a={method:"GET",...r,...t},s={};await(0,i.setBearerAuthToObject)(s,e),(0,i.setSearchParams)(n,{});let o=r&&r.headers?r.headers:{};return a.headers={...s,...o,...t.headers},{url:(0,i.toPathString)(n),options:a}},listRoles:async(t,n,r,a={})=>{const s=new URL("/api/v1/idp/roles",i.DUMMY_BASE_URL);let o;e&&(o=e.baseOptions);const p={method:"GET",...o,...a},d={},u={};await(0,i.setBearerAuthToObject)(d,e),void 0!==t&&(u.org=t),void 0!==n&&(u.provider=n),void 0!==r&&(u.refresh=r),(0,i.setSearchParams)(s,u);let c=o&&o.headers?o.headers:{};return p.headers={...d,...c,...a.headers},{url:(0,i.toPathString)(s),options:p}},providerLogin:async(t,n,r={})=>{(0,i.assertParamExists)("providerLogin","provider",t);const a="/api/v1/idp/logins/{provider}/login".replace("{provider}",encodeURIComponent(String(t))),s=new URL(a,i.DUMMY_BASE_URL);let o;e&&(o=e.baseOptions);const p={method:"POST",...o,...r},d={},u={};await(0,i.setBearerAuthToObject)(d,e),void 0!==n&&(u.org=n),(0,i.setSearchParams)(s,u);let c=o&&o.headers?o.headers:{};return p.headers={...d,...c,...r.headers},{url:(0,i.toPathString)(s),options:p}},refreshOrgRepoConfig:async(t,n,r,a,s,o={})=>{(0,i.assertParamExists)("refreshOrgRepoConfig","org",t),(0,i.assertParamExists)("refreshOrgRepoConfig","repo",n);const p="/api/v1/idp/orgs/{org}/repos/{repo}/config".replace("{org}",encodeURIComponent(String(t))).replace("{repo}",encodeURIComponent(String(n))),d=new URL(p,i.DUMMY_BASE_URL);let u;e&&(u=e.baseOptions);const c={method:"POST",...u,...o},l={},m={};await(0,i.setBearerAuthToObject)(l,e),void 0!==r&&(m.dryrun=r),void 0!==a&&(m.commitSha=a),void 0!==s&&(m.commitRef=s),(0,i.setSearchParams)(d,m);let h=u&&u.headers?u.headers:{};return c.headers={...l,...h,...o.headers},{url:(0,i.toPathString)(d),options:c}},setOrgAndRepo:async(t,n,r,a,s={})=>{(0,i.assertParamExists)("setOrgAndRepo","org",t),(0,i.assertParamExists)("setOrgAndRepo","repo",n);const o="/api/v1/idp/orgs/{org}/repos/{repo}".replace("{org}",encodeURIComponent(String(t))).replace("{repo}",encodeURIComponent(String(n))),p=new URL(o,i.DUMMY_BASE_URL);let d;e&&(d=e.baseOptions);const u={method:"POST",...d,...s},c={},l={};await(0,i.setBearerAuthToObject)(c,e),void 0!==r&&(l.force=r),void 0!==a&&(l.create=a),(0,i.setSearchParams)(p,l);let m=d&&d.headers?d.headers:{};return u.headers={...c,...m,...s.headers},{url:(0,i.toPathString)(p),options:u}}}},t.IDPApiFp=function(e){const n=(0,t.IDPApiAxiosParamCreator)(e);return{async assumeRole(t,r,o,p){const d=await n.assumeRole(t,r,o,p);return(0,i.createRequestFunction)(d,a.default,s.BASE_PATH,e)},async assumeRoleForBrowser(t,r,o,p){const d=await n.assumeRoleForBrowser(t,r,o,p);return(0,i.createRequestFunction)(d,a.default,s.BASE_PATH,e)},async assumeRoleForRepo(t,r,o,p,d,u,c,l){const m=await n.assumeRoleForRepo(t,r,o,p,d,u,c,l);return(0,i.createRequestFunction)(m,a.default,s.BASE_PATH,e)},async encrypt(t,r,o){const p=await n.encrypt(t,r,o);return(0,i.createRequestFunction)(p,a.default,s.BASE_PATH,e)},async getIdentity(t){const r=await n.getIdentity(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)},async getOrgConfig(t,r,o){const p=await n.getOrgConfig(t,r,o);return(0,i.createRequestFunction)(p,a.default,s.BASE_PATH,e)},async getOrgMetadata(t,r){const o=await n.getOrgMetadata(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)},async getOrgRepo(t,r){const o=await n.getOrgRepo(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)},async listLogins(t,r,o){const p=await n.listLogins(t,r,o);return(0,i.createRequestFunction)(p,a.default,s.BASE_PATH,e)},async listOrgRepos(t){const r=await n.listOrgRepos(t);return(0,i.createRequestFunction)(r,a.default,s.BASE_PATH,e)},async listRoles(t,r,o,p){const d=await n.listRoles(t,r,o,p);return(0,i.createRequestFunction)(d,a.default,s.BASE_PATH,e)},async providerLogin(t,r,o){const p=await n.providerLogin(t,r,o);return(0,i.createRequestFunction)(p,a.default,s.BASE_PATH,e)},async refreshOrgRepoConfig(t,r,o,p,d,u){const c=await n.refreshOrgRepoConfig(t,r,o,p,d,u);return(0,i.createRequestFunction)(c,a.default,s.BASE_PATH,e)},async setOrgAndRepo(t,r,o,p,d){const u=await n.setOrgAndRepo(t,r,o,p,d);return(0,i.createRequestFunction)(u,a.default,s.BASE_PATH,e)}}},t.IDPApiFactory=function(e,n,r){const a=(0,t.IDPApiFp)(e);return{assumeRole:(e,t,i,s)=>a.assumeRole(e,t,i,s).then((e=>e(r,n))),assumeRoleForBrowser:(e,t,i,s)=>a.assumeRoleForBrowser(e,t,i,s).then((e=>e(r,n))),assumeRoleForRepo:(e,t,i,s,o,p,d,u)=>a.assumeRoleForRepo(e,t,i,s,o,p,d,u).then((e=>e(r,n))),encrypt:(e,t,i)=>a.encrypt(e,t,i).then((e=>e(r,n))),getIdentity:e=>a.getIdentity(e).then((e=>e(r,n))),getOrgConfig:(e,t,i)=>a.getOrgConfig(e,t,i).then((e=>e(r,n))),getOrgMetadata:(e,t)=>a.getOrgMetadata(e,t).then((e=>e(r,n))),getOrgRepo:(e,t)=>a.getOrgRepo(e,t).then((e=>e(r,n))),listLogins:(e,t,i)=>a.listLogins(e,t,i).then((e=>e(r,n))),listOrgRepos:e=>a.listOrgRepos(e).then((e=>e(r,n))),listRoles:(e,t,i,s)=>a.listRoles(e,t,i,s).then((e=>e(r,n))),providerLogin:(e,t,i)=>a.providerLogin(e,t,i).then((e=>e(r,n))),refreshOrgRepoConfig:(e,t,i,s,o,p)=>a.refreshOrgRepoConfig(e,t,i,s,o,p).then((e=>e(r,n))),setOrgAndRepo:(e,t,i,s,o)=>a.setOrgAndRepo(e,t,i,s,o).then((e=>e(r,n)))}};class y extends s.BaseAPI{assumeRole(e,n,r,a){return(0,t.IDPApiFp)(this.configuration).assumeRole(e,n,r,a).then((e=>e(this.axios,this.basePath)))}assumeRoleForBrowser(e,n,r,a){return(0,t.IDPApiFp)(this.configuration).assumeRoleForBrowser(e,n,r,a).then((e=>e(this.axios,this.basePath)))}assumeRoleForRepo(e,n,r,a,i,s,o,p){return(0,t.IDPApiFp)(this.configuration).assumeRoleForRepo(e,n,r,a,i,s,o,p).then((e=>e(this.axios,this.basePath)))}encrypt(e,n,r){return(0,t.IDPApiFp)(this.configuration).encrypt(e,n,r).then((e=>e(this.axios,this.basePath)))}getIdentity(e){return(0,t.IDPApiFp)(this.configuration).getIdentity(e).then((e=>e(this.axios,this.basePath)))}getOrgConfig(e,n,r){return(0,t.IDPApiFp)(this.configuration).getOrgConfig(e,n,r).then((e=>e(this.axios,this.basePath)))}getOrgMetadata(e,n){return(0,t.IDPApiFp)(this.configuration).getOrgMetadata(e,n).then((e=>e(this.axios,this.basePath)))}getOrgRepo(e,n){return(0,t.IDPApiFp)(this.configuration).getOrgRepo(e,n).then((e=>e(this.axios,this.basePath)))}listLogins(e,n,r){return(0,t.IDPApiFp)(this.configuration).listLogins(e,n,r).then((e=>e(this.axios,this.basePath)))}listOrgRepos(e){return(0,t.IDPApiFp)(this.configuration).listOrgRepos(e).then((e=>e(this.axios,this.basePath)))}listRoles(e,n,r,a){return(0,t.IDPApiFp)(this.configuration).listRoles(e,n,r,a).then((e=>e(this.axios,this.basePath)))}providerLogin(e,n,r){return(0,t.IDPApiFp)(this.configuration).providerLogin(e,n,r).then((e=>e(this.axios,this.basePath)))}refreshOrgRepoConfig(e,n,r,a,i,s){return(0,t.IDPApiFp)(this.configuration).refreshOrgRepoConfig(e,n,r,a,i,s).then((e=>e(this.axios,this.basePath)))}setOrgAndRepo(e,n,r,a,i){return(0,t.IDPApiFp)(this.configuration).setOrgAndRepo(e,n,r,a,i).then((e=>e(this.axios,this.basePath)))}}t.IDPApi=y,t.TemplateApiAxiosParamCreator=function(e){return{createCloudFormation:async(t,n,r={})=>{(0,i.assertParamExists)("createCloudFormation","org",t);const a="/api/v1/template/orgs/{org}/cloudformation".replace("{org}",encodeURIComponent(String(t))),s=new URL(a,i.DUMMY_BASE_URL);let o;e&&(o=e.baseOptions);const p={method:"POST",...o,...r},d={},u={};await(0,i.setBearerAuthToObject)(d,e),void 0!==n&&(u.managedPolicy=n),(0,i.setSearchParams)(s,u);let c=o&&o.headers?o.headers:{};return p.headers={...d,...c,...r.headers},{url:(0,i.toPathString)(s),options:p}},getCloudFormation:async(t,n,r={})=>{(0,i.assertParamExists)("getCloudFormation","org",t);const a="/api/v1/template/orgs/{org}/cloudformation".replace("{org}",encodeURIComponent(String(t))),s=new URL(a,i.DUMMY_BASE_URL);let o;e&&(o=e.baseOptions);const p={method:"GET",...o,...r},d={},u={};await(0,i.setBearerAuthToObject)(d,e),void 0!==n&&(u.templateId=n),(0,i.setSearchParams)(s,u);let c=o&&o.headers?o.headers:{};return p.headers={...d,...c,...r.headers},{url:(0,i.toPathString)(s),options:p}},getConfigVariables:async(t,n={})=>{(0,i.assertParamExists)("getConfigVariables","org",t);const r="/api/v1/template/orgs/{org}/configvariables".replace("{org}",encodeURIComponent(String(t))),a=new URL(r,i.DUMMY_BASE_URL);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...n},p={};await(0,i.setBearerAuthToObject)(p,e),(0,i.setSearchParams)(a,{});let d=s&&s.headers?s.headers:{};return o.headers={...p,...d,...n.headers},{url:(0,i.toPathString)(a),options:o}}}},t.TemplateApiFp=function(e){const n=(0,t.TemplateApiAxiosParamCreator)(e);return{async createCloudFormation(t,r,o){const p=await n.createCloudFormation(t,r,o);return(0,i.createRequestFunction)(p,a.default,s.BASE_PATH,e)},async getCloudFormation(t,r,o){const p=await n.getCloudFormation(t,r,o);return(0,i.createRequestFunction)(p,a.default,s.BASE_PATH,e)},async getConfigVariables(t,r){const o=await n.getConfigVariables(t,r);return(0,i.createRequestFunction)(o,a.default,s.BASE_PATH,e)}}},t.TemplateApiFactory=function(e,n,r){const a=(0,t.TemplateApiFp)(e);return{createCloudFormation:(e,t,i)=>a.createCloudFormation(e,t,i).then((e=>e(r,n))),getCloudFormation:(e,t,i)=>a.getCloudFormation(e,t,i).then((e=>e(r,n))),getConfigVariables:(e,t)=>a.getConfigVariables(e,t).then((e=>e(r,n)))}};class w extends s.BaseAPI{createCloudFormation(e,n,r){return(0,t.TemplateApiFp)(this.configuration).createCloudFormation(e,n,r).then((e=>e(this.axios,this.basePath)))}getCloudFormation(e,n,r){return(0,t.TemplateApiFp)(this.configuration).getCloudFormation(e,n,r).then((e=>e(this.axios,this.basePath)))}getConfigVariables(e,n){return(0,t.TemplateApiFp)(this.configuration).getConfigVariables(e,n).then((e=>e(this.axios,this.basePath)))}}t.TemplateApi=w},43347:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RequiredError=t.BaseAPI=t.COLLECTION_FORMATS=t.BASE_PATH=void 0;const a=r(n(9669));t.BASE_PATH="https://sso.saml.to/github".replace(/\/+$/,""),t.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:"\t",pipes:"|"},t.BaseAPI=class{basePath;axios;configuration;constructor(e,n=t.BASE_PATH,r=a.default){this.basePath=n,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}};class i extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}}t.RequiredError=i},30476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestFunction=t.toPathString=t.serializeDataIfNeeded=t.setSearchParams=t.setOAuthToObject=t.setBearerAuthToObject=t.setBasicAuthToObject=t.setApiKeyToObject=t.assertParamExists=t.DUMMY_BASE_URL=void 0;const r=n(43347);t.DUMMY_BASE_URL="https://example.com",t.assertParamExists=function(e,t,n){if(null==n)throw new r.RequiredError(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},t.setApiKeyToObject=async function(e,t,n){if(n&&n.apiKey){const r="function"==typeof n.apiKey?await n.apiKey(t):await n.apiKey;e[t]=r}},t.setBasicAuthToObject=function(e,t){t&&(t.username||t.password)&&(e.auth={username:t.username,password:t.password})},t.setBearerAuthToObject=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}},t.setOAuthToObject=async function(e,t,n,r){if(r&&r.accessToken){const a="function"==typeof r.accessToken?await r.accessToken(t,n):await r.accessToken;e.Authorization="Bearer "+a}},t.setSearchParams=function(e,...t){const n=new URLSearchParams(e.search);for(const e of t)for(const t in e)if(Array.isArray(e[t])){n.delete(t);for(const r of e[t])n.append(t,r)}else n.set(t,e[t]);e.search=n.toString()},t.serializeDataIfNeeded=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},t.toPathString=function(e){return e.pathname+e.search+e.hash},t.createRequestFunction=function(e,t,n,r){return(a=t,i=n)=>{const s={...e.options,url:(r?.basePath||i)+e.url};return a.request(s)}}},60339:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=void 0,t.Configuration=class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}},67918:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(26703),t),a(n(60339),t)},33354:(e,t,n)=>{"use strict";const r=n(56758),a=n(66504);(async()=>{const e=new a.Command(process.argv);try{await e.run(process.argv),process.exit(0)}catch(e){e instanceof r.ErrorWithReturnCode&&process.exit(e.returnCode),process.exit(-1)}})()},66504:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Command=t.prompt=t.ui=void 0;const a=n(96397),i=r(n(77259)),s=r(n(9669)),o=n(78071),p=n(25460),d=r(n(96062)),u=n(86983),c=n(48023),l=n(47301),m=n(70060),h=n(4147),f=n(95779),v=r(n(22234)),_=n(3740),g=n(56758);process.emitWarning=()=>{},process.argv.find((e=>"--headless"===e))?(t.ui={},t.ui.updateBottomBar=()=>t.ui):t.ui=new v.default({output:process.stderr}),process.addListener("SIGINT",(()=>{console.log("Exiting!"),process.exit(0)})),t.prompt=(e,t,n)=>{if(!process.stdin.isTTY)throw new Error(`TTY is disabled. Please provide \`${e}\` as a command line argument`);return d.default.prompt(t,n)},t.Command=class{apiHelper;messagesHelper;assume;login;show;constructor(e){this.apiHelper=new f.ApiHelper(e),this.messagesHelper=new m.MessagesHelper(e),this.assume=new o.AssumeCommand(this.apiHelper,this.messagesHelper),this.login=new l.LoginCommand(this.apiHelper,this.messagesHelper),this.show=new p.ShowCommand(this.apiHelper)}async run(e){const n=i.default.scriptName(this.messagesHelper.processName).command({command:"list-roles",describe:"Show roles that are available to assume",handler:({org:e,provider:t,refresh:n,withToken:r})=>this.loginWrapper("user:email",(()=>this.show.handle("roles",e,t,!1,n,!1,r))),builder:{org:{demand:!1,type:"string",description:"Specify an organization"},provider:{demand:!1,type:"string",description:"Specify a provider"},refresh:{demand:!1,type:"boolean",default:!1,description:"Refresh cached logins from source control"},withToken:{demand:!1,type:"string",description:"Use the provided token (defaults to using the token in ~/.saml-to/)"}}}).command({command:"login [provider]",describe:"Login to a provider",handler:({org:e,provider:t,withToken:n})=>this.loginWrapper("user:email",(()=>this.login.handle(t,e,n))),builder:{provider:{demand:!1,type:"string",description:"The provider for which to login"},org:{demand:!1,type:"string",description:"Specify an organization"},withToken:{demand:!1,type:"string",description:"Skip Device Authentication and save the provided token to ~/.saml-to/"}}}).command({command:"assume [role]",describe:"Assume a role",handler:({role:e,org:t,provider:n,headless:r,save:a,withToken:i})=>this.loginWrapper("user:email",(()=>this.assume.handle(e,r,t,n,a,i)),r),builder:{role:{demand:!1,type:"string",description:"The role to assume"},org:{demand:!1,type:"string",description:"Specify an organization"},headless:{demand:!1,type:"boolean",default:!1,description:"Output access credentials to the terminal"},save:{demand:!1,type:"string",description:"Similar to headless, but saves the CLI configuration for a provider to the config file"},provider:{demand:!1,type:"string",description:"Specify the provider"},withToken:{demand:!1,type:"string",description:"Use the provided token (defaults to using the token in ~/.saml-to/)"}}}).help().wrap(null).version(h.version).fail(((e,n)=>{s.default.isAxiosError(n)?n.response&&401===n.response.status?(t.ui.updateBottomBar(""),console.error((0,_.NOT_LOGGED_IN)(this.messagesHelper.processName,"github"))):(t.ui.updateBottomBar(""),console.error(`API Error: ${n.response&&n.response.data&&n.response.data.message||n.message}`)):console.error(`Error: ${n?n.message:e}`)}));0===(await n.parse((0,a.hideBin)(e)))._.length&&n.showHelp()}loginWrapper=async(e,t,n=!1)=>{try{await t()}catch(r){if(!(r instanceof u.NoTokenError))throw r;if(n)throw new g.ErrorWithReturnCode(g.RETURN_CODE_NOT_LOGGED_IN,(0,_.NOT_LOGGED_IN)(this.messagesHelper.processName,"github"));{const n=new c.GithubHelper(this.apiHelper,this.messagesHelper);await n.promptLogin(e),await t()}}}}},78071:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssumeCommand=void 0;const a=n(3740),i=n(86983),s=r(n(9669)),o=n(25460),p=n(66504),d=n(43479),u=n(89871),c=n(61394);t.AssumeCommand=class{apiHelper;messagesHelper;scms;show;awsHelper;constructor(e,t){this.apiHelper=e,this.messagesHelper=t,this.scms=new i.Scms,this.show=new o.ShowCommand(e),this.awsHelper=new d.AwsHelper(e,t)}async handle(e,t=!1,n,r,i,o){if((0,u.event)(this.scms,"assume",void 0,n),!e&&!t){const t=await this.promptRole(n,r);e=t.role,n=t.org,r=t.provider}if(t||p.ui.updateBottomBar(`Assuming ${e}`),!e)throw new Error("Please specify a role to assume");void 0===i||i||(i=e);try{if(t||i){const s=o||this.scms.getGithubToken();if(!s)throw new Error(a.NO_GITHUB_CLIENT);const p=this.apiHelper.idpApi(s),{data:d}=await p.assumeRole(e,n,r);return await this.assumeTerminal(d,i,t)}{o||this.scms.getGithubToken();const t=this.apiHelper.idpApi(),{data:a}=await t.assumeRoleForBrowser(e,n,r);return await this.assumeBrowser(a,o)}}catch(t){if(s.default.isAxiosError(t)&&t.response)throw 403===t.response.status?new Error((0,a.ERROR_ASSUMING_ROLE)(e,`Reason: ${t.response.data.message}`)):404===t.response.status?new Error((0,a.MULTIPLE_ROLES)(e,`Reason: ${t.response.data.message}`)):t;throw t}}async assumeBrowser(e,t){if(e.browserUri){const n=new URL(e.browserUri);try{const e=t||this.scms.getGithubToken();e&&n.searchParams.set("token",e)}catch(e){}await(0,c.openBrowser)(n.toString())}else new Error("Browser URI is not set.")}async assumeTerminal(e,t,n){if(e.recipient.endsWith(".amazon.com/saml"))return this.awsHelper.assumeAws(e,t,n);throw new Error((0,a.TERMINAL_NOT_SUPPORTED)(e.provider,e.recipient))}async promptRole(e,t){p.ui.updateBottomBar("Fetching roles...");const n=await this.show.fetchRoles(e,t);if(0===n.length)throw this.messagesHelper.getSetup("roles available to assume"),new Error("No roles are available to assume");p.ui.updateBottomBar("");const{roleIx:r}=await(0,p.prompt)("role",{type:"list",name:"roleIx",message:"Which role would you like to assume?",choices:n.map(((e,t)=>({name:`${e.role} [${e.provider}] (${e.org})`,value:t})))});return n[r]}}},4400:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InitCommand=t.CONFIG_FILE=void 0;const a=r(n(2043)),i=n(3740),s=n(48023),o=n(67918),p=n(86983),d=n(25460),u=n(66504),c=n(52878),l=n(93320),m=n(11295),h=n(89871);t.CONFIG_FILE="saml-to.yml";const f={version:o.GithubSlsRestApiSupportedVersions._20220101,providers:{},permissions:{}};t.InitCommand=class{apiHelper;messagesHelper;githubHelper;scms;show;constructor(e,t){this.apiHelper=e,this.messagesHelper=t,this.githubHelper=new s.GithubHelper(e,t),this.scms=new p.Scms,this.show=new d.ShowCommand(e)}async handle(e=!1){(0,h.event)(this.scms,"init"),this.messagesHelper.introduction(t.CONFIG_FILE),u.ui.updateBottomBar("");const{org:n}=await(0,u.prompt)("org",{type:"input",name:"org",message:"Which GitHub User or Organization would you like to use?\n"});u.ui.updateBottomBar(`Checking if ${n} exists...`),await this.assertOrg(n),(0,h.event)(this.scms,"init",void 0,n),u.ui.updateBottomBar("");const{createMode:r}=await(0,u.prompt)("createMode",{type:"list",name:"createMode",message:`Would you like to create a new repository for the \`${t.CONFIG_FILE}\` configuration file or use an existing repostiory?`,choices:[{name:"Create a new repository",value:"create"},{name:"Use an existing repository",value:"existing"}]});let a;"create"===r?(u.ui.updateBottomBar(""),a=(await(0,u.prompt)("repo",{type:"input",name:"repo",default:"saml-to",message:"What would you like the new repository named?"})).repo):(u.ui.updateBottomBar(""),a=(await(0,u.prompt)("repo",{type:"input",name:"repo",default:"saml-to",message:`What pre-existing repository would you like to yuse to store the \`${t.CONFIG_FILE}\` configuration file?`})).repo),u.ui.updateBottomBar(`Checking access to ${n}/${a}...`),await this.assertRepo(n,a,"repo"),u.ui.updateBottomBar(`Registering ${n}/${a}...`),await this.registerRepo(n,a,e),u.ui.updateBottomBar("Fetching metadata..."),await this.show.fetchMetadataXml(n),this.scms.saveGithubOrg(n),u.ui.updateBottomBar(""),console.log(`Repository \`${n}/${a}\` registered!`),this.messagesHelper.postInit(n,a,`https://github.com/${n}/${a}/blob/main/${t.CONFIG_FILE}`)}async assertOrg(e){const t=new m.Octokit;try{const{data:n}=await t.users.getByUsername({username:e});if("User"===n.type)return"User";if("Organization"===n.type)return"Organization";throw new Error(`Unknown user type for \`${e}\`: ${n.type}, must be 'User' or 'Organization'`)}catch(t){if(t instanceof c.RequestError&&404===t.status)throw new Error(`Unable to find user or organization: ${e}`);throw t}}async assertRepo(e,n,r){await this.githubHelper.assertScope(r,e);const{github:a}=await this.scms.loadClients();if(!a)return await this.githubHelper.promptLogin(r),this.assertRepo(e,n,r);const{data:s}=await a.users.getAuthenticated();if(s.login.toLowerCase()!==e.toLowerCase()){u.ui.updateBottomBar(`Checking membership on ${e}/${n}...`);try{await a.orgs.checkMembershipForUser({org:e,username:s.login})}catch(t){if(t instanceof Error)return u.ui.updateBottomBar(""),console.log((0,i.GITHUB_ACCESS_NEEDED)(e,r)),await this.githubHelper.promptLogin("repo",e),this.assertRepo(e,n,r)}}u.ui.updateBottomBar(`Checking access to ${e}/${n}...`);try{const{data:t}=await a.repos.get({owner:e,repo:n});if("public"===t.visibility){u.ui.updateBottomBar("");const{makePrivate:t}=await(0,u.prompt)("makePrivate",{type:"confirm",name:"makePrivate",message:`\`${e}/${n}\` appears to be a Public Repository. It's recommended to keep it private. Would you like to convert it to a private repository?`});t?await a.repos.update({owner:e,repo:n,visibility:"private"}):console.warn(`WARN: ${e}/${n} is publicly visible, but it does not need to be!`)}}catch(t){if(t instanceof Error){u.ui.updateBottomBar("");const{createRepo:t}=await(0,u.prompt)("createRepo",{type:"confirm",name:"createRepo",message:`It appears that \`${e}/${n}\` does not exist yet, do you want to create it?`});if(!t)throw new Error((0,i.REPO_DOES_NOT_EXIST)(e,n));return u.ui.updateBottomBar(`Creating repository ${e}/${n}...`),s.login.toLowerCase()!==e.toLowerCase()?await a.repos.createInOrg({name:n,org:e,visibility:"private"}):await a.repos.createForAuthenticatedUser({name:n,visibility:"private"}),this.assertRepo(e,n,r)}}u.ui.updateBottomBar("Checking for existing config...");try{await a.repos.getContent({owner:e,repo:n,path:t.CONFIG_FILE})}catch(r){if(r instanceof c.RequestError&&404===r.status){u.ui.updateBottomBar("");const{createConfig:r}=await(0,u.prompt)("createConfig",{type:"confirm",name:"createConfig",message:`It appears that \`${e}/${n}\` does not contain \`${t.CONFIG_FILE}\` yet. Would you like to create an empty config file?`});if(!r)return void console.warn(`Skipping creation of \`${t.CONFIG_FILE}\`, please be sure to create it!`);await a.repos.createOrUpdateFileContents({owner:e,repo:n,content:Buffer.from(`---\n${(0,l.dump)(f)}\n`,"utf8").toString("base64"),message:"initial saml.to configuration",path:t.CONFIG_FILE})}}}async registerRepo(e,t,n){const r=this.scms.getGithubToken(),i=this.apiHelper.idpApi(r),{data:s}=await i.setOrgAndRepo(e,t,n);a.default.debug("Initialized repo",s)}}},47301:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LoginCommand=void 0;const a=n(3740),i=n(86983),s=r(n(9669)),o=n(25460),p=n(43479),d=n(48023),u=n(66504),c=n(89871),l=n(61394);t.LoginCommand=class{apiHelper;messagesHelper;scms;show;awsHelper;githubHelper;constructor(e,t){this.apiHelper=e,this.messagesHelper=t,this.scms=new i.Scms,this.show=new o.ShowCommand(e),this.awsHelper=new p.AwsHelper(e,t),this.githubHelper=new d.GithubHelper(e,t)}async handle(e,t,n){if((0,c.event)(this.scms,"login",void 0,t),!e){const n=await this.promptLogin(t);e=n.provider,t=n.org}if("github"===e)return n?void this.scms.saveGithubToken(n):void await this.githubHelper.promptLogin("user:email",t);let r=`Logging into ${e}`;t&&(r=`${r} (org: ${t})`),u.ui.updateBottomBar(r);const i=this.scms.getGithubToken();if(!i)throw new Error(a.NO_GITHUB_CLIENT);const o=this.apiHelper.idpApi(i);try{const{data:n}=await o.providerLogin(e,t);await this.loginBrowser(n)}catch(t){if(s.default.isAxiosError(t)&&t.response)throw 403===t.response.status?new Error((0,a.ERROR_LOGGING_IN)(e,`Reason: ${t.response.data.message}`)):404===t.response.status?new Error((0,a.MULTIPLE_LOGINS)(e,`Reason: ${t.response.data.message}`)):t;throw t}}async loginBrowser(e){e.browserUri?await(0,l.openBrowser)(e.browserUri):new Error("Browser URI is not set.")}async promptLogin(e){let t;u.ui.updateBottomBar("Fetching logins...");try{t=await this.show.fetchLogins(e)}catch(t){if(s.default.isAxiosError(t)&&t.response&&401===t.response.status){u.ui.updateBottomBar("");const{newLogin:t}=await(0,u.prompt)("newLogin",{type:"confirm",name:"newLogin",message:"There's a problem fetching logins with the stored token. Would you like to (re-)log in to GitHub?"});if(t)throw await this.githubHelper.promptLogin("user:email",e),new Error("New identity has been stored. Please run your desired command again.")}if(t instanceof Error)throw new Error(`Error fetching logins: ${t.message}`);throw t}if(0===t.length)throw this.messagesHelper.getSetup("logins configured"),new Error("No logins are available");u.ui.updateBottomBar("");const{loginIx:n}=await(0,u.prompt)("provider",{type:"list",name:"loginIx",message:"For which provider would you like to log in?",choices:[...t.map(((e,t)=>({name:`${e.provider} (${e.org})`,value:t}))),{name:"[New GitHub Identity]",value:"**GH_IDENTITY**"}]});return"**GH_IDENTITY**"===n?(await this.githubHelper.promptLogin("user:email",e),this.promptLogin(e)):t[n]}}},25460:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ShowCommand=void 0;const a=n(3740),i=n(86983),s=r(n(57147)),o=r(n(71017)),p=n(66504),d=n(57873),u=n(17620),c=n(89871);t.ShowCommand=class{apiHelper;scms;configHelper;orgHelper;constructor(e){this.apiHelper=e,this.scms=new i.Scms,this.configHelper=new d.ConfigHelper(e),this.orgHelper=new u.OrgHelper(e)}async handle(e,t,n,r,i,s,o){switch(e){case"orgs":return(0,c.event)(this.scms,"show",e,t),this.showOrgs(r);case"roles":return(0,c.event)(this.scms,"show",e,t),this.showRoles(t,n,i,r,o);case"logins":return(0,c.event)(this.scms,"show",e,t),this.showLogins(t,i,r)}if(!t&&!(t=(await this.orgHelper.promptOrg("view")).org))throw new Error(a.NO_ORG);switch((0,c.event)(this.scms,"show",e,t),e){case"metadata":return this.showMetadata(t,r);case"certificate":return this.showCertificate(t,r);case"config":return this.showConfig(t,r,s);case"entityId":return this.showEntityId(t,r);case"loginUrl":return this.showLoginUrl(t,r);case"logoutUrl":return this.showLogoutUrl(t,r)}throw new Error(`Unknown subcommand: ${e}`)}async showConfig(e,t,n){const r=await this.configHelper.fetchConfigYaml(e,n);if(t){const t=o.default.join(i.CONFIG_DIR,`${e}-config.yaml`);s.default.writeFileSync(t,r),p.ui.updateBottomBar(""),console.log(`Config saved to ${t}`)}else p.ui.updateBottomBar(""),console.log(r)}async fetchEntityId(e){const t=this.scms.getGithubToken(),n=this.apiHelper.idpApi(t),{data:r}=await n.getOrgMetadata(e),{entityId:a}=r;return a}async fetchLoginUrl(e){const t=this.scms.getGithubToken(),n=this.apiHelper.idpApi(t),{data:r}=await n.getOrgMetadata(e),{loginUrl:a}=r;return a}async fetchLogoutUrl(e){const t=this.scms.getGithubToken(),n=this.apiHelper.idpApi(t),{data:r}=await n.getOrgMetadata(e),{logoutUrl:a}=r;return a}async fetchMetadataXml(e){const t=this.scms.getGithubToken(),n=this.apiHelper.idpApi(t),{data:r}=await n.getOrgMetadata(e),{metadataXml:a}=r;return a}async showMetadata(e,t){const n=await this.fetchMetadataXml(e);if(t){const t=o.default.join(i.CONFIG_DIR,`${e}-metadata.xml`);s.default.writeFileSync(t,n),p.ui.updateBottomBar(""),console.log(`Metadata saved to ${t}`)}else p.ui.updateBottomBar(""),console.log(n)}async showCertificate(e,t){const n=this.scms.getGithubToken(),r=this.apiHelper.idpApi(n),{data:a}=await r.getOrgMetadata(e),{certificate:d}=a;if(t){const t=o.default.join(i.CONFIG_DIR,`${e}-certificate.pem`);s.default.writeFileSync(t,d),p.ui.updateBottomBar(""),console.log(`Certificate saved to ${t}`)}else p.ui.updateBottomBar(""),console.log(d)}async showOrgs(e){const t=await this.orgHelper.fetchOrgs();if(e){const e=o.default.join(i.CONFIG_DIR,"orgs.json");s.default.writeFileSync(e,JSON.stringify({orgs:t})),p.ui.updateBottomBar(""),console.log(`Orgs saved to ${e}`)}else p.ui.updateBottomBar(""),t.length||console.log("No orgs"),console.table(t,["org"]),console.log("Current Org: ",this.scms.getOrg())}async fetchRoles(e,t,n,r){const a=r||this.scms.getGithubToken(),i=this.apiHelper.idpApi(a),{data:s}=await i.listRoles(e,t,n);return s.results}async showRoles(e,t,n,r,a){const d=await this.fetchRoles(e,t,n,a);if(r){const e=o.default.join(i.CONFIG_DIR,"roles.json");s.default.writeFileSync(e,JSON.stringify({roles:d})),p.ui.updateBottomBar(""),console.log(`Roles saved to ${e}`)}else{if(p.ui.updateBottomBar(""),!d.length)throw new Error("No roles are available to assume");console.table(d,["role","provider","org"])}}async fetchLogins(e,t){const n=this.scms.getGithubToken(),r=this.apiHelper.idpApi(n),{data:a}=await r.listLogins(e,t);return a.results}async showLogins(e,t,n){const r=await this.fetchLogins(e,t);if(n){const e=o.default.join(i.CONFIG_DIR,"logins.json");s.default.writeFileSync(e,JSON.stringify({logins:r})),p.ui.updateBottomBar(""),console.log(`Logins saved to ${e}`)}else{if(p.ui.updateBottomBar(""),!r.length)throw new Error("No providers are available to login");console.table(r,["provider","org"])}}async showEntityId(e,t){const n=await this.fetchEntityId(e);if(t){const t=o.default.join(i.CONFIG_DIR,`${e}-entityId.json`);s.default.writeFileSync(t,JSON.stringify({entityId:n})),p.ui.updateBottomBar(""),console.log(`Entity ID saved to ${t}`)}else p.ui.updateBottomBar(""),console.log(n)}async showLoginUrl(e,t){const n=await this.fetchLoginUrl(e);if(t){const t=o.default.join(i.CONFIG_DIR,`${e}-loginUrl.json`);s.default.writeFileSync(t,JSON.stringify({loginUrl:n})),p.ui.updateBottomBar(""),console.log(`Entity ID saved to ${t}`)}else p.ui.updateBottomBar(""),console.log(n)}async showLogoutUrl(e,t){const n=await this.fetchLogoutUrl(e);if(t){const t=o.default.join(i.CONFIG_DIR,`${e}-logoutUrl.json`);s.default.writeFileSync(t,JSON.stringify({logoutUrl:n})),p.ui.updateBottomBar(""),console.log(`Entity ID saved to ${t}`)}else p.ui.updateBottomBar(""),console.log(n)}}},56758:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorWithReturnCode=t.RETURN_CODE_NOT_LOGGED_IN=void 0,t.RETURN_CODE_NOT_LOGGED_IN=10;class n extends Error{returnCode;constructor(e,t){super(t),this.returnCode=e}}t.ErrorWithReturnCode=n},95779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiHelper=void 0;const r=n(6095),a=n(67918);t.ApiHelper=class{argv;dev=!1;constructor(e){this.argv=e,this.dev=this.argv.includes("--dev"),this.dev&&console.log("\n*******************\nIN DEVELOPMENT MODE\n*******************")}idpApi(e){const t=new a.Configuration({accessToken:e,baseOptions:{headers:{"User-Agent":"cli"}}});if(this.dev){t.basePath="https://sso-nonlive.saml.to/github";const e=this.argv.findIndex((e=>"--apiKey"===e));t.apiKey=-1!==e?this.argv[e+1]:void 0}return new a.IDPApi(t)}jwtGithubApi(){const e=new r.Configuration;if(this.dev){e.basePath="https://sso-nonlive.saml.to/auth";const t=this.argv.findIndex((e=>"--apiKey"===e));e.apiKey=-1!==t?this.argv[t+1]:void 0}return new r.JwtGithubApi(e)}}},43479:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AwsHelper=void 0;const a=n(66504),i=n(57873),s=n(1543),o=n(46531),p=n(99703),d=r(n(30381));t.AwsHelper=class{configHelper;genericHelper;constructor(e,t){this.configHelper=new i.ConfigHelper(e),this.genericHelper=new s.GenericHelper(e,t)}async promptProvider(e,t,n){if("20220101"===n.version)return this.promptProviderV20220101(e,t,n);throw new Error(`Unknown version ${n.version}`)}async promptProviderV20220101(e,t,n){if(n.providers&&n.providers.aws)throw new Error("An `aws` provider already exists, please manually edit the configuration to add another");if(n.variables&&n.variables.awsAccountId)throw new Error("An `awsAccountId` variable already exists, please manually edit the configuration to add this provider");a.ui.updateBottomBar("");const{accountId:r}=await(0,a.prompt)("accountId",{type:"input",name:"accountId",message:"What is your AWS Account ID?"}),i={aws:{entityId:"https://signin.aws.amazon.com/saml",acsUrl:"https://signin.aws.amazon.com/saml",loginUrl:"https://signin.aws.amazon.com/saml",attributes:{"https://aws.amazon.com/SAML/Attributes/RoleSessionName":"<#= user.github.login #>","https://aws.amazon.com/SAML/Attributes/SessionDuration":"3600","https://aws.amazon.com/SAML/Attributes/Role":`<#= user.selectedRole #>,arn:aws:iam::${r}:saml-provider/saml.to`}}};n.providers={...n.providers||{},...i};const{addPermissions:s}=await(0,a.prompt)("addPermissions",{type:"confirm",name:"addPermissions",message:"Would you like to grant any permissions to GitHub users now?"});return s?this.promptPermissionV20220101(e,t,n):this.configHelper.promptConfigUpdate(e,t,n,"aws: add provider")}async promptPermissionV20220101(e,t,n){let r;if(n.permissions=n.permissions||{},n.permissions.aws=n.permissions.aws||{},n.permissions.aws.roles=n.permissions.aws.roles||[],a.ui.updateBottomBar(""),r=(await(0,a.prompt)("role",{type:"list",name:"roleArn",message:"What is role you would like to allow for assumption?",choices:[...n.permissions.aws.roles.map((e=>({name:e.name}))),{name:"Add another role",value:""}]})).roleArn,!r){const{arnInput:e}=await(0,a.prompt)("arn",{type:"input",name:"arnInput",message:"What is ARN of the new role you would like to allow for assumption?\n",validate:e=>!!e||(console.error("Invalid ARN!"),!1)});r=e}const i=await this.genericHelper.promptUsers("aws",r),s=n.permissions.aws.roles.findIndex((e=>e.name&&e.name.toLowerCase()===r.toLowerCase()));return-1===s?n.permissions.aws.roles.push({name:r,users:{github:i}}):n.permissions.aws.roles[s].users?n.permissions.aws.roles[s].users={...n.permissions.aws.roles[s].users,github:[...(n.permissions.aws.roles[s].users||{}).github||[],...i]}:n.permissions.aws.roles[s].users={github:i},this.configHelper.promptConfigUpdate(e,t,n,`aws: grant permissions to role ${r}\n\n${i.map((e=>`- ${e}`))}`)}async assumeAws(e,t,n){const r=new o.STS({region:"us-east-1"}),i=e.sdkOptions;if(!i)throw new Error("Missing sdk options from saml response");t&&!n&&a.ui.updateBottomBar(`Updating AWS '${t}' Profile...`);const s=await r.assumeRoleWithSAML({...i,SAMLAssertion:e.samlResponse});if(!(s.Credentials&&s.Credentials.AccessKeyId&&s.Credentials.SecretAccessKey&&s.Credentials.SessionToken))throw new Error("Missing credentials");const u=process.env.AWS_DEFAULT_REGION||"us-east-1";if(t){const e=["aws","configure"];if("default"!==t&&e.push("--profile",t),e.push("set"),await(0,p.exec)([...e,"region",u]),await(0,p.exec)([...e,"aws_access_key_id",s.Credentials.AccessKeyId]),await(0,p.exec)([...e,"aws_secret_access_key",s.Credentials.SecretAccessKey]),await(0,p.exec)([...e,"aws_session_token",s.Credentials.SessionToken]),n)try{return void this.genericHelper.outputEnv({AWS_PROFILE:t})}catch(e){}else a.ui.updateBottomBar(""),console.log(`\n⚠️ Credentials will expire ${(0,d.default)(s.Credentials.Expiration).fromNow()}!`),console.log(`\nYou can now run \`aws\` commands such as:\n\naws sts get-caller-identity --profile ${t}\naws ec2 describe-instances --profile ${t}\n`)}else this.genericHelper.outputEnv({AWS_DEFAULT_REGION:u,AWS_ACCESS_KEY_ID:s.Credentials.AccessKeyId,AWS_SECRET_ACCESS_KEY:s.Credentials.SecretAccessKey,AWS_SESSION_TOKEN:s.Credentials.SessionToken})}}},61394:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.openBrowser=void 0;const a=r(n(78318)),i=n(77282),s=n(66504);t.openBrowser=e=>{const t=new URL(e);return t.searchParams.delete("token"),new Promise((n=>{s.ui.updateBottomBar(""),(0,a.default)(e,{wait:"darwin"!==i.platform}).then((r=>{"darwin"!==i.platform?0!==r.exitCode?(s.ui.updateBottomBar(""),console.log(`Unable to open browser. Please open in a browser window:\n\n${e}`),n()):(s.ui.updateBottomBar(""),console.log(`Browser opened to:\n\n${t.toString()}\n\nCtrl+C to exit.`),n()):n()})).catch((()=>{s.ui.updateBottomBar(""),console.log(`Unable to open browser. Please open in a browser window:\n\n${e}`)}))}))}},57873:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigHelper=void 0;const r=n(93320),a=n(3740),i=n(86983),s=n(66504),o=n(4400),p=n(89871);t.ConfigHelper=class{apiHelper;scms;constructor(e){this.apiHelper=e,this.scms=new i.Scms}async fetchConfigYaml(e,t=!1){s.ui.updateBottomBar("Fetching config...");const n=this.scms.getGithubToken(),a=this.apiHelper.idpApi(n),{data:i}=await a.getOrgConfig(e,t);return`---\n${(0,r.dump)(i,{lineWidth:1024})}`}dumpConfig(e,t,n,a=!0){s.ui.updateBottomBar("");const i=`\n---\n# Config Reference: \n# https://docs.saml.to/configuration/reference\n${(0,r.dump)(n,{lineWidth:1024})}`;return a&&console.log(`Here is the updated \`${o.CONFIG_FILE}\` for ${e}/${t}:\n\n${i}\n\n`),i}async promptConfigUpdate(e,t,n,r,a=!0){(0,p.event)(this.scms,"fn:promptConfigUpdate",void 0,e);const i=this.dumpConfig(e,t,n,a);s.ui.updateBottomBar("");const{type:o}=await(0,s.prompt)("type",{type:"list",name:"type",message:`Would you like to push this configuration change to \`${e}/${t}\`?`,default:"nothing",choices:[{name:"Do not change anything",value:"nothing"},{name:`Commit directly to \`${e}/${t}\``,value:"commit"}]});return"nothing"===o?(s.ui.updateBottomBar(""),console.log("All done. No changes were made."),!1):("commit"===o&&await this.commitConfig(e,t,i,r),!0)}async commitConfig(e,t,n,r){(0,p.event)(this.scms,"fn:commitConfig",void 0,e),s.ui.updateBottomBar(`Updating ${o.CONFIG_FILE} on ${e}/${t}`);const{github:i}=await this.scms.loadClients();if(!i)throw new Error(a.NO_GITHUB_CLIENT);let d;try{const n=await i.repos.getContent({owner:e,repo:t,path:o.CONFIG_FILE});n.data&&"content"in n.data&&(d=n.data.sha)}catch(e){}const{data:u}=await i.repos.createOrUpdateFileContents({owner:e,repo:t,path:o.CONFIG_FILE,message:r,content:Buffer.from(n,"utf8").toString("base64"),sha:d});s.ui.updateBottomBar(""),console.log(`Updated \`${o.CONFIG_FILE}\` on \`${e}/${t}\` (SHA: ${u.commit.sha})`)}}},89871:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.event=void 0;const a=r(n(9669)),i=r(n(6113));t.event=(e,t,n,r)=>{if(process.env.SAML_TO_DNT)return;let s,o;try{if(!(r=r||e.getOrg()))throw new Error;s=i.default.createHash("sha256").update(r).digest("hex")}catch(e){s=i.default.createHash("sha256").update("unknown").digest("hex")}try{const t=e.getGithubToken();if(!t)throw new Error;o=i.default.createHash("sha256").update(t).digest("hex")}catch(e){o=s}a.default.post("https://api.segment.io/v1/track",{anonymousId:o,event:t,properties:{anonymousId:o,anonymousOrg:s,subAction:n}},{auth:{username:"UcQlAMIhPSYCKCyixGgxKwslx0MqbAZf",password:""}}).then((()=>{})).catch((()=>{}))}},99703:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.exec=void 0;const a=r(n(32081)),i=r(n(22806));t.exec=e=>new Promise(((t,n)=>{const r={...process.env};let s;try{s=i.default.sync(e[0])}catch(t){return void n(new Error(`Unable to locate the '${e[0]}' command on this system`))}const o=a.default.spawn(s,e.slice(1),{shell:!0,env:r});o.on("error",(e=>{n(e)})),o.on("exit",(()=>{t()})),o.stdin.pipe(process.stdin),o.stdout.pipe(process.stdout),o.stderr.pipe(process.stderr)}))},1543:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericHelper=t.trainCase=void 0;const r=n(66504),a=n(57873),i=n(86983),s=n(25460),o=n(4400),p=n(89871);t.trainCase=e=>{if(!e)return"";const t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);return t?t.map((e=>e.toLowerCase())).join("-"):""},t.GenericHelper=class{messagesHelper;configHelper;scms;show;constructor(e,t){this.messagesHelper=t,this.configHelper=new a.ConfigHelper(e),this.scms=new i.Scms,this.show=new s.ShowCommand(e)}async promptUsers(e,t,n){if(!n){r.ui.updateBottomBar("");const{addSelf:a}=await(0,r.prompt)("addSelf",{type:"confirm",name:"addSelf",message:`Would you like to grant yourself access to ${t?`assume \`${t}\``:`login to ${e}`}?\n `});n=a?[await this.scms.getLogin()]:[]}r.ui.updateBottomBar("");const{user:a}=await(0,r.prompt)("user",{type:"input",name:"user",message:`What is another Github ID of the user that will be allowed to ${t?`assume \`${t}\``:`login to ${e}`}? (Leave blank if finished adding users)\n`});return a?(n.push(a),[...new Set(await this.promptUsers(e,t,n))]):n||[]}async promptProvider(e,n,a,i,s,o,d,u,c,l,m){if((0,p.event)(this.scms,"fn:promptProvider",a.version,e),r.ui.updateBottomBar(""),i||(i=(await(0,r.prompt)("name",{type:"input",name:"name",message:"What is the name of the provider (e.g. AWS, Slack, Google)?"})).name),!i)throw new Error("Name is required");if(this.messagesHelper.context.provider=i,"20220101"===a.version)return this.promptProviderV20220101((0,t.trainCase)(i),e,n,a,s,o,d,u,c,l,m);throw new Error(`Unknown version ${a.version}`)}async promptProviderV20220101(e,t,n,a,i,s,p,d,u,c,l){if(a.providers&&a.providers[e])throw new Error(`An provider named \`${e}\` already exists, please manually edit the configuration to add another`);let m,h=!1;if(i&&s&&(h=!0),r.ui.updateBottomBar(""),i||(i=(await(0,r.prompt)("entityId",{type:"input",name:"entityId",message:`What is the Entity ID for ${e}?`})).entityId),s||(s=(await(0,r.prompt)("acsUrl",{type:"input",name:"acsUrl",message:`What is the Assertion Consumer Service (ACS) URL for ${e}?`})).acsUrl),!p&&"NONE"!==p){const{initiation:t}=await(0,r.prompt)("initiation",{type:"list",name:"initiation",message:"How are SAML login requests initiated?",default:"sp",choices:[{name:'By the Service Provider ("SP-Initiated")',value:"sp"},{name:'By the Identity Provider ("IdP-Initiated")',value:"ip"},{name:"I don't know",value:"dunno"}]});"dunno"===t?this.messagesHelper.unknownInitiation(e,o.CONFIG_FILE):"sp"===t&&(p=(await(0,r.prompt)("loginUrl",{type:"input",name:"loginUrl",message:`What is the Login URL for ${e}?`})).loginUrl)}"NONE"===p&&(p=void 0),u||(u=(await(0,r.prompt)("nameIdFormat",{type:"list",name:"nameIdFormat",message:"(Optional) Does the provider need Name IDs in a particular format?\n ",choices:[{name:"Persistent (GitHub User ID)",value:"id"},{name:"Transient (Github Login/Username)",value:"login"},{name:"Email (GitHub User Email)",value:"email"},{name:"None",value:"none"}]})).nameIdFormat),u&&"none"!==u&&(m=u),l&&0!==Object.keys(l).length||(l=await this.promptAttributes(a.variables||{}));const f={[`${e}`]:{entityId:i,loginUrl:p,nameId:d,nameIdFormat:m,acsUrl:s,attributes:l}};a.providers={...a.providers||{},...f},this.configHelper.dumpConfig(t,n,a,!0);const{addPermissions:v}=await(0,r.prompt)("addPermissions",{type:"confirm",name:"addPermissions",message:"Would you like to grant any permissions to GitHub users now?"});if(!v)return this.configHelper.promptConfigUpdate(t,n,a,`${e}: add provider`,!1);if(!c&&!h){const r=await this.promptLoginType();if(this.messagesHelper.context.loginType=r,"role-user"===r)return this.promptRolePermissionV20220101(t,n,e,a,c)}return c?(this.messagesHelper.context.loginType="role-user",this.promptRolePermissionV20220101(t,n,e,a,c)):(this.messagesHelper.context.loginType="sso-user",this.promptPermissionV20220101(t,n,e,a))}async promptLoginType(){let e="sso-user";return e=(await(0,r.prompt)("type",{type:"list",name:"type",message:"Which type of permission would you like to add?",default:"sso-user",choices:[{name:"Role assumption",value:"role-user"},{name:"Sign-in Permission (a.k.a. SSO)",value:"sso-user"}]})).type,e}async promptPermissionV20220101(e,t,n,r){(0,p.event)(this.scms,"fn:promptPermissionV20220101",r.version),r.permissions=r.permissions||{},r.permissions[n]=r.permissions[n]||{},r.permissions[n].users=r.permissions[n].users||{},(r.permissions[n].users||{}).github=(r.permissions[n].users||{}).github||[];const a=await this.promptUsers(n),i=new Set([...(r.permissions[n].users||{}).github||[],...a]);return(r.permissions[n].users||{}).github=[...i],this.configHelper.promptConfigUpdate(e,t,r,`${n}: grant permissions to login\n\n${a.map((e=>`- ${e}`))}`,!0)}async promptRolePermissionV20220101(e,t,n,a,i){if((0,p.event)(this.scms,'fn"promptRolePermissionV20220101',a.version),a.permissions=a.permissions||{},a.permissions[n]=a.permissions[n]||{},a.permissions[n].roles=a.permissions[n].roles||[],r.ui.updateBottomBar(""),!i&&!(i=(await(0,r.prompt)("role",{type:"list",name:"roleName",message:"What is the name of the role you would like to allow for assumption?",choices:[...(a.permissions[n].roles||[]).map((e=>({name:e.name}))),{name:"Add a new role",value:""}]})).roleName)){const{input:e}=await(0,r.prompt)("roleName",{type:"input",name:"input",message:"What is name of the new role?\n "});i=e}if(!i)throw new Error("Missing role name");const s=(a.permissions[n].roles||[]).findIndex((e=>i&&e.name&&e.name.toLowerCase()===i.toLowerCase())),o=await this.promptUsers(n,i,((((a.permissions[n]||{}).roles||[])[s]||{}).users||{}).github);return-1===s?(a.permissions[n].roles||[]).push({name:i,users:{github:o}}):((((a.permissions[n]||{}).roles||[])[s]||{}).users||{}).github=o,this.configHelper.promptConfigUpdate(e,t,a,`${n}: grant permissions to assume ${i}\n\n${o.map((e=>`- ${e}`))}`,!0)}outputEnv(e,t=process.platform){"win32"===t?Object.entries(e).forEach((([e,t],n,r)=>{process.stdout.write("set "),process.stdout.write(e),process.stdout.write("="),process.stdout.write(t),n+1{process.stdout.write(e),process.stdout.write("="),process.stdout.write(t),n+1"},{name:"Github Login/Username",value:"<#= user.github.login #>"},{name:"Email Address",value:"<#= user.github.email #>"},{name:"Full Name",value:"<#= user.github.fullName #>"},{name:"First Name",value:"<#= user.github.firstName #>"},{name:"Last Name",value:"<#= user.github.lastName #>"},{name:"The selected role (for `assume` commands)",value:"<#= selectedRole #>"},{name:"Session ID (randomly generated for each login)",value:"<#= sessionId #>"},...Object.keys(e).map((e=>({name:`Variable: ${e}`,value:`<$= ${e} $>`}))),{name:"Other",value:"*_*_*_OTHER_*_*_*"}]});if("*_*_*_OTHER_*_*_*"===a){const{customValue:e}=await(0,r.prompt)("custonValue",{type:"input",name:"customValue",message:`What is the custom value of ${n}?\n`});a=e}return t[n]=a,this.promptAttributes(e,t)}}},48023:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GithubHelper=void 0;const a=r(n(9669)),i=r(n(30381)),s=n(86983),o=r(n(2043)),p=n(3740),d=n(66504),u=n(11295),c=n(89871);t.GithubHelper=class{apiHelper;messagesHelper;scms;constructor(e,t){this.apiHelper=e,this.messagesHelper=t,this.scms=new s.Scms}async promptLogin(e="user:email",t){(0,c.event)(this.scms,"fn:promptLogin",e,t);const n=this.apiHelper.jwtGithubApi(),{data:r}=await n.getOauthDetail(),{clientId:s}=r,o=await a.default.post("https://github.com/login/device/code",{client_id:s,scope:e},{headers:{Accept:"application/json"}}),{verification_uri:p,user_code:l}=o.data;this.messagesHelper.prelogin(e,t),this.messagesHelper.write(`Please open the browser to ${p} and enter the code:\n\n${l}\n\n`);const m=await this.getAccessToken(s,o.data,(0,i.default)().add(o.data.expires_in,"second")),h=new u.Octokit({auth:m.access_token}),{data:f}=await h.users.getAuthenticated();if(t&&f.login!==t&&!(await h.paginate(h.orgs.listForAuthenticatedUser)).find((e=>e.login===t)))return d.ui.updateBottomBar(""),console.warn(`It appears access to ${t} has not beeen granted, let's try again...`),this.promptLogin(e,t);const v=this.scms.saveGithubToken(m.access_token);console.log(`Saved GitHub credentials to ${v}`)}getAccessToken(e,t,n){return new Promise(((r,s)=>{(0,i.default)().isSameOrAfter(n)?s(new Error("Access token request has expired. Please re-run the `login` command")):a.default.post("https://github.com/login/oauth/access_token",{client_id:e,device_code:t.device_code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},{headers:{Accept:"application/json"}}).then((({data:a})=>{if(a.error)return"authorization_pending"===a.error?void setTimeout((()=>this.getAccessToken(e,t,n).then((e=>r(e))).catch((e=>s(e)))),1e3*t.interval):void s(new Error(a.error_description));r(a)})).catch((e=>s(e)))}))}async assertScope(e,t){let n;d.ui.updateBottomBar("Checking scopes...");try{n=(await this.scms.loadClients()).github}catch(n){if(n instanceof s.NoTokenError)return await this.promptLogin(e,t),this.assertScope(e,t);throw n}if(!n)throw new Error("Unable to load GitHub client");const{headers:r}=await n.users.getAuthenticated();try{this.assertScopes(r,e)}catch(n){if(n instanceof Error)return o.default.debug(n.message),d.ui.updateBottomBar(""),console.log((0,p.GITHUB_SCOPE_NEEDED)(e)),await this.promptLogin(e,t),this.assertScope(e,t);throw n}}assertScopes(e,t){const n=e["x-oauth-scopes"];o.default.debug("Current scopes:",n);const r=n.split(" ");if(!r.includes(t))throw new Error(`Missing scope. Expected:${t} Actual:${r}`)}}},70060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagesHelper=void 0;const r=n(66504);t.MessagesHelper=class{processName="saml-to";context={provider:void 0,loginType:void 0};_headless=!1;set headless(e){this._headless=e}get headless(){return this._headless}constructor(e){const t=e[1];t&&-1!==t.indexOf("_npx")&&(this.processName="npx saml-to")}status(e){e?r.ui.updateBottomBar(`${e}...`):r.ui.updateBottomBar("")}write(e){this.headless||(this.status(),process.stderr.write(e),process.stderr.write("\n"))}introduction(e){this.write(`\nWelcome to the SAML.to CLI!\n\nSAML.to enables administrators to grant access to Service Providers to GitHub users.\n\nAll configuration is managed by a config file in a repository of your choice named \`${e}\`.\n\nThis utility will assist you with the following:\n - Choosing a GitHub repository to store the \`${e}\` configuration file\n - Setting up one or more Service Providers\n - Granting permissions to GitHub users to login or assume roles at the Service Providers\n - Logging in or assuming roles at the Service Providers\n\nOnce configured, you (or users on your team or organization) will be able to login to services or assume roles using this utility, with commands such as:\n - \`${this.processName} list-logins\`\n - \`${this.processName} login\`\n - \`${this.processName} list-roles\`\n - \`${this.processName} assume\`\n\nFor more information, check out https://docs.saml.to\n`)}prelogin(e,t,n){"user:email"===e?this.write(`\nTo continue, we need you to log into GitHub, and we will need the \`${e}\` scope to access your GitHub Identity.\n`):t&&n?this.write(`\nTo continue, we need you to log into GitHub, and we will need the \`${e}\` scope to access \`${t}/${n}\`.\n`):t?this.write(`\nTo continue, we need you to log into GitHub, and we will need the \`${e}\` scope to access \`${t}\`.\n`):n&&this.write(`\nTo continue, we need you to log into GitHub, and we will need the \`${e}\` scope to access \`${n}\`.\n`)}postInit(e,t,n){this.write(`\nGitHub is now configured as an Identity Provider using \`${e}/${t}\`.\n\nThe confiruration file can be found here:\n ${n}\n\nService Providers will need your SAML Metadata, Certificicate, Entity ID or Login URL available with the following commands:\n- \`${this.processName} show metadata\` (aka 'IdP Metadata')\n- \`${this.processName} show certificate\` (aka 'IdP Certificate')\n- \`${this.processName} show entityId\` (aka 'IdP Issuer URL', 'IdP Entity ID')\n- \`${this.processName} show loginUrl\` (aka 'IdP Sign-In URL', 'SAML 2.0 Endpoint')\n\nThen to add a Service Provider, run the following command and follow the interactive prompts:\n - \`${this.processName} add provider\`\n`)}unknownInitiation(e,t){this.write(`\nSince it is not know at this time if it is a SP-initiated, or IdP-initiated flow, we're going to leave \`loginUrl\` for \`${e}\` unset for now.\n\nIf it's a SP-initiated flow, you would likely be informed of their "Login URL", and then you can set the \`loginUrl\` property for \`${e}\` in the \`${t}\` configuration file, which will set the Login Flow to be SP-Initiatied.\n\nFor more information, check out https://docs.saml.to/troubleshooting/administration/sp-initiated-or-idp-initiated-logins\n`)}getSetup(e){this.write(`\nYou have no ${e}!\n\nIf this is your first time using SAML.to, you can get started by running:\n\`${this.processName} init\`\n\nAlternatively, you may find out which organizations you're a member of with the \`${this.processName} show orgs\` command, then you should reach out to the administrators of those organizations to grant you log in privileges.\n\nFor more information on getting started, visit\n - https://saml.to\n - https://docs.saml.to\n`)}providerAdded(){if(!this.context.provider)throw new Error("Missing provider context");if(!this.context.loginType)throw new Error("Missing loginType context");this.write(`\nProvider \`${this.context.provider}\` has been added!\n\nIf you haven't already, update the Service Provider with your configuration:\n- \`${this.processName} show metadata\` (aka 'IdP Metadata')\n- \`${this.processName} show certificate\` (aka 'IdP Certificate')\n- \`${this.processName} show entityId\` (aka 'IdP Issuer URL', 'IdP Entity ID')\n- \`${this.processName} show loginUrl\` (aka 'IdP Sign-In URL', 'SAML Endpoint')\n\nIf you need to enable SCIM provisioning at the provider:\n- \`${this.processName} set provisioning ${this.context.provider}\`\n\nAdditional permissions may be added anytime with the following command:\n - \`${this.processName} add permission\`\n\nThe configuration file can also be displayed and validated wit this command:\n - \`${this.processName} show config\`\n\nFinally, you or users that were defined in the configuration can run the following command:\n - \`${this.processName} ${"role-user"===this.context.loginType?"assume":"login"} ${this.context.provider}\`\n`)}}},17620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrgHelper=void 0;const r=n(66504),a=n(86983),i=n(89871);t.OrgHelper=class{apiHelper;scms;constructor(e){this.apiHelper=e,this.scms=new a.Scms}async fetchOrgs(){const e=this.scms.getGithubToken(),t=this.apiHelper.idpApi(e),{data:n}=await t.listOrgRepos();return n.results}async promptOrg(e){(0,i.event)(this.scms,"fn:promptOrg",e);const t=await this.fetchOrgs();if(!t.length)throw new Error("Please run the `init` command first");if(1===t.length)return t[0];r.ui.updateBottomBar("");const{orgIx:n}=await(0,r.prompt)("org",{type:"list",name:"orgIx",message:`For which organization would you like to ${e}?`,choices:t.map(((e,t)=>({name:`${e.org} (${e.repo})`,value:t})))});return this.scms.getOrg()||this.scms.saveGithubOrg(t[n].org),t[n]}}},3740:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPO_DOES_NOT_EXIST=t.GITHUB_SCOPE_NEEDED=t.GITHUB_ACCESS_NEEDED=t.UNSUPPORTED_REPO_URL=t.TERMINAL_NOT_SUPPORTED=t.MULTIPLE_LOGINS=t.MULTIPLE_ROLES=t.ERROR_LOGGING_IN=t.ERROR_ASSUMING_ROLE=t.ERROR_LOADING_FILE=t.NOT_LOGGED_IN=t.NO_ORG=t.NO_GITHUB_CLIENT=void 0,t.NO_GITHUB_CLIENT="There was an unknown issue loading GitHub client libraries",t.NO_ORG="No organization is set, please use the `--org` flag and re-run the command",t.NOT_LOGGED_IN=(e,t)=>`Invalid or missing token. Please login using the \`${e} login ${t}\` command to save your identity to this system.`,t.ERROR_LOADING_FILE=(e,t)=>`Error loading file: ${e}: ${t.message}.`,t.ERROR_ASSUMING_ROLE=(e,t)=>`Unable to assume ${e}. ${t}.`,t.ERROR_LOGGING_IN=(e,t)=>`Unable to login to ${e}. ${t}.`,t.MULTIPLE_ROLES=(e,n)=>(0,t.ERROR_ASSUMING_ROLE)(e,`${n}\n\nTip: Use an exact role name, and/or the \`--provider\` and \`--org\` flags to narrow down to a specific role.\nTip: Use the \`show roles\` command to show avalable roles`),t.MULTIPLE_LOGINS=(e,n)=>(0,t.ERROR_ASSUMING_ROLE)(e,`${n}\n\nTip: Use an exact org name, using the \`--org\` flag to narrow down to a specific organization.\nTip: Use the \`show logins\` command to show avalable roles`),t.TERMINAL_NOT_SUPPORTED=(e,t)=>`Role assumption using ${e} (${t}) is not supported by this CLI yet. However, you may request it as a feature: https://github.com/saml-to/cli/issues`,t.UNSUPPORTED_REPO_URL="Only the following repo URLs are supported: https://github.com/{org}/{repo}",t.GITHUB_ACCESS_NEEDED=(e,t)=>`To continue, access to scope '${t}' in '${e}' is needed`,t.GITHUB_SCOPE_NEEDED=e=>`To continue, scope '${e}' is needed`,t.REPO_DOES_NOT_EXIST=(e,t)=>`${e}/${t} does not exist. Please create it or specify a different repository.`},86983:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Scms=t.NoTokenError=t.CONFIG_DIR=void 0;const a=n(11295),i=r(n(22037)),s=r(n(71017)),o=r(n(57147)),p=n(3740),d=n(66504);t.CONFIG_DIR=`${s.default.join(i.default.homedir(),".saml-to")}`;class u extends Error{constructor(){super("No token!")}}t.NoTokenError=u,t.Scms=class{githubFile;orgFile;constructor(e=t.CONFIG_DIR){this.githubFile=s.default.join(e,"github-token.json"),this.orgFile=s.default.join(e,"org.json"),o.default.existsSync(e)||o.default.mkdirSync(e)}async loadClients(){const e={};return e.github=this.getOctokit(),e}saveGithubOrg(e){return o.default.writeFileSync(this.orgFile,JSON.stringify({name:e,scm:"github"})),d.ui.updateBottomBar(""),console.log(`Default organization cached in: ${this.orgFile}`),this.orgFile}saveGithubToken(e){return o.default.writeFileSync(this.githubFile,JSON.stringify({token:e}),{mode:384}),d.ui.updateBottomBar(""),console.log(`Token cached in: ${this.githubFile}`),this.githubFile}getGithubToken(){if(!o.default.existsSync(this.githubFile))throw new u;try{const{token:e}=JSON.parse(o.default.readFileSync(this.githubFile).toString());return e}catch(e){if(e instanceof Error)return d.ui.updateBottomBar(""),void console.warn((0,p.ERROR_LOADING_FILE)(this.githubFile,e));throw e}}getOrg(){if(o.default.existsSync(this.orgFile))try{const{name:e}=JSON.parse(o.default.readFileSync(this.orgFile).toString());return e}catch(e){if(e instanceof Error)return d.ui.updateBottomBar(""),void console.warn((0,p.ERROR_LOADING_FILE)(this.githubFile,e));throw e}}getOctokit(){const e=this.getGithubToken();if(e)return new a.Octokit({auth:e})}async getLogin(){const e=this.getGithubToken();if(!e)throw new Error("Unable to get token");const t=new a.Octokit({auth:e});d.ui.updateBottomBar("Fetching GitHub identity...");const{data:n}=await t.users.getAuthenticated();return n.login}}},41159:(e,t,n)=>{e.exports=n(73837).deprecate},72653:e=>{e.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},71011:(e,t,n)=>{"use strict";var r=n(34575),a=n(72653),i={nul:0,control:0};function s(e,t){if("string"!=typeof e)return o(e,t);for(var n=0,r=0;r=127&&e<160?t.control:function(e){var t,n=0,r=a.length-1;if(ea[r][1])return!1;for(;r>=n;)if(t=Math.floor((n+r)/2),e>a[t][1])n=t+1;else{if(!(e=4352&&(e<=4447||9001==e||9002==e||e>=11904&&e<=42191&&12351!=e||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))}e.exports=function(e){return s(e,i)},e.exports.config=function(e){return e=r(e||{},i),function(t){return s(t,e)}}},10993:e=>{"use strict";var t={};function n(e){return e<0?-1:1}function r(e,t){t.unsigned||--e;const r=t.unsigned?0:-Math.pow(2,e),a=Math.pow(2,e)-1,i=t.moduloBitLength?Math.pow(2,t.moduloBitLength):Math.pow(2,e),s=t.moduloBitLength?Math.pow(2,t.moduloBitLength-1):Math.pow(2,e-1);return function(e,o){o||(o={});let p=+e;if(o.enforceRange){if(!Number.isFinite(p))throw new TypeError("Argument is not a finite number");if(p=n(p)*Math.floor(Math.abs(p)),pa)throw new TypeError("Argument is not in byte range");return p}if(!isNaN(p)&&o.clamp)return p=function(e){return e%1==.5&&0==(1&e)?Math.floor(e):Math.round(e)}(p),pa&&(p=a),p;if(!Number.isFinite(p)||0===p)return 0;if(p=n(p)*Math.floor(Math.abs(p)),p%=i,!t.unsigned&&p>=s)return p-i;if(t.unsigned)if(p<0)p+=i;else if(-0===p)return 0;return p}}e.exports=t,t.void=function(){},t.boolean=function(e){return!!e},t.byte=r(8,{unsigned:!1}),t.octet=r(8,{unsigned:!0}),t.short=r(16,{unsigned:!1}),t["unsigned short"]=r(16,{unsigned:!0}),t.long=r(32,{unsigned:!1}),t["unsigned long"]=r(32,{unsigned:!0}),t["long long"]=r(32,{unsigned:!1,moduloBitLength:64}),t["unsigned long long"]=r(32,{unsigned:!0,moduloBitLength:64}),t.double=function(e){const t=+e;if(!Number.isFinite(t))throw new TypeError("Argument is not a finite floating-point value");return t},t["unrestricted double"]=function(e){const t=+e;if(isNaN(t))throw new TypeError("Argument is NaN");return t},t.float=t.double,t["unrestricted float"]=t["unrestricted double"],t.DOMString=function(e,t){return t||(t={}),t.treatNullAsEmptyString&&null===e?"":String(e)},t.ByteString=function(e,t){const n=String(e);let r;for(let e=0;void 0!==(r=n.codePointAt(e));++e)if(r>255)throw new TypeError("Argument is not a valid bytestring");return n},t.USVString=function(e){const t=String(e),n=t.length,r=[];for(let e=0;e57343)r.push(String.fromCodePoint(a));else if(56320<=a&&a<=57343)r.push(String.fromCodePoint(65533));else if(e===n-1)r.push(String.fromCodePoint(65533));else{const n=t.charCodeAt(e+1);if(56320<=n&&n<=57343){const t=1023&a,i=1023&n;r.push(String.fromCodePoint(65536+1024*t+i)),++e}else r.push(String.fromCodePoint(65533))}}return r.join("")},t.Date=function(e,t){if(!(e instanceof Date))throw new TypeError("Argument is not a Date object");if(!isNaN(e))return e},t.RegExp=function(e,t){return e instanceof RegExp||(e=new RegExp(e)),e}},39718:(e,t,n)=>{"use strict";const r=n(65341);t.implementation=class{constructor(e){const t=e[0],n=e[1];let a=null;if(void 0!==n&&(a=r.basicURLParse(n),"failure"===a))throw new TypeError("Invalid base URL");const i=r.basicURLParse(t,{baseURL:a});if("failure"===i)throw new TypeError("Invalid URL");this._url=i}get href(){return r.serializeURL(this._url)}set href(e){const t=r.basicURLParse(e);if("failure"===t)throw new TypeError("Invalid URL");this._url=t}get origin(){return r.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(e){r.basicURLParse(e+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(e){r.cannotHaveAUsernamePasswordPort(this._url)||r.setTheUsername(this._url,e)}get password(){return this._url.password}set password(e){r.cannotHaveAUsernamePasswordPort(this._url)||r.setThePassword(this._url,e)}get host(){const e=this._url;return null===e.host?"":null===e.port?r.serializeHost(e.host):r.serializeHost(e.host)+":"+r.serializeInteger(e.port)}set host(e){this._url.cannotBeABaseURL||r.basicURLParse(e,{url:this._url,stateOverride:"host"})}get hostname(){return null===this._url.host?"":r.serializeHost(this._url.host)}set hostname(e){this._url.cannotBeABaseURL||r.basicURLParse(e,{url:this._url,stateOverride:"hostname"})}get port(){return null===this._url.port?"":r.serializeInteger(this._url.port)}set port(e){r.cannotHaveAUsernamePasswordPort(this._url)||(""===e?this._url.port=null:r.basicURLParse(e,{url:this._url,stateOverride:"port"}))}get pathname(){return this._url.cannotBeABaseURL?this._url.path[0]:0===this._url.path.length?"":"/"+this._url.path.join("/")}set pathname(e){this._url.cannotBeABaseURL||(this._url.path=[],r.basicURLParse(e,{url:this._url,stateOverride:"path start"}))}get search(){return null===this._url.query||""===this._url.query?"":"?"+this._url.query}set search(e){const t=this._url;if(""===e)return void(t.query=null);const n="?"===e[0]?e.substring(1):e;t.query="",r.basicURLParse(n,{url:t,stateOverride:"query"})}get hash(){return null===this._url.fragment||""===this._url.fragment?"":"#"+this._url.fragment}set hash(e){if(""===e)return void(this._url.fragment=null);const t="#"===e[0]?e.substring(1):e;this._url.fragment="",r.basicURLParse(t,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},64328:(e,t,n)=>{"use strict";const r=n(10993),a=n(9581),i=n(39718),s=a.implSymbol;function o(t){if(!this||this[s]||!(this instanceof o))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");if(arguments.length<1)throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.");const n=[];for(let e=0;e!!e&&e[s]instanceof i.implementation,create(e,t){let n=Object.create(o.prototype);return this.setup(n,e,t),n},setup(e,t,n){n||(n={}),n.wrapper=e,e[s]=new i.implementation(t,n),e[s][a.wrapperSymbol]=e},interface:o,expose:{Window:{URL:o},Worker:{URL:o}}}},87347:(e,t,n)=>{"use strict";t.URL=n(64328).interface,n(65341).serializeURL,n(65341).serializeURLOrigin,n(65341).basicURLParse,n(65341).setTheUsername,n(65341).setThePassword,n(65341).serializeHost,n(65341).serializeInteger,n(65341).parseURL},65341:(e,t,n)=>{"use strict";const r=n(85477),a=n(54742),i={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443},s=Symbol("failure");function o(e){return r.ucs2.decode(e).length}function p(e,t){const n=e[t];return isNaN(n)?void 0:String.fromCodePoint(n)}function d(e){return e>=48&&e<=57}function u(e){return e>=65&&e<=90||e>=97&&e<=122}function c(e){return d(e)||e>=65&&e<=70||e>=97&&e<=102}function l(e){return"."===e||"%2e"===e.toLowerCase()}function m(e){return 2===e.length&&u(e.codePointAt(0))&&(":"===e[1]||"|"===e[1])}function h(e){return void 0!==i[e]}function f(e){return h(e.scheme)}function v(e){let t=e.toString(16).toUpperCase();return 1===t.length&&(t="0"+t),"%"+t}function _(e){return e<=31||e>126}const g=new Set([32,34,35,60,62,63,96,123,125]);function b(e){return _(e)||g.has(e)}const y=new Set([47,58,59,61,64,91,92,93,94,124]);function w(e){return b(e)||y.has(e)}function x(e,t){const n=String.fromCodePoint(e);return t(e)?function(e){const t=new Buffer(e);let n="";for(let e=0;e=2&&"0"===e.charAt(0)&&"x"===e.charAt(1).toLowerCase()?(e=e.substring(2),t=16):e.length>=2&&"0"===e.charAt(0)&&(e=e.substring(1),t=8),""===e?0:(10===t?/[^0-9]/:16===t?/[^0-9A-Fa-f]/:/[^0-7]/).test(e)?s:parseInt(e,t)}function M(e,t){if("["===e[0])return"]"!==e[e.length-1]?s:function(e){const t=[0,0,0,0,0,0,0,0];let n=0,a=null,i=0;if(58===(e=r.ucs2.decode(e))[i]){if(58!==e[i+1])return s;i+=2,++n,a=n}for(;i6)return s;let r=0;for(;void 0!==e[i];){let a=null;if(r>0){if(!(46===e[i]&&r<4))return s;++i}if(!d(e[i]))return s;for(;d(e[i]);){const t=parseInt(p(e,i));if(null===a)a=t;else{if(0===a)return s;a=10*a+t}if(a>255)return s;++i}t[n]=256*t[n]+a,++r,2!==r&&4!==r||++n}if(4!==r)return s;break}if(58===e[i]){if(++i,void 0===e[i])return s}else if(void 0!==e[i])return s;t[n]=r,++n}if(null!==a){let e=n-a;for(n=7;0!==n&&e>0;){const r=t[a+e-1];t[a+e-1]=t[n],t[n]=r,--n,--e}}else if(null===a&&8!==n)return s;return t}(e.substring(1,e.length-1));if(!t)return function(e){if(-1!==e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/))return s;let t="";const n=r.ucs2.decode(e);for(let e=0;e1&&t.pop(),t.length>4)return e;const n=[];for(const r of t){if(""===r)return e;const t=D(r);if(t===s)return e;n.push(t)}for(let e=0;e255)return s;if(n[n.length-1]>=Math.pow(256,5-n.length))return s;let r=n.pop(),a=0;for(const e of n)r+=e*Math.pow(256,3-a),++a;return r}(i);return"number"==typeof o||o===s?o:i}function E(e){return"number"==typeof e?function(e){let t="",n=e;for(let e=1;e<=4;++e)t=String(n%256)+t,4!==e&&(t="."+t),n=Math.floor(n/256);return t}(e):e instanceof Array?"["+function(e){let t="";const n=function(e){let t=null,n=1,r=null,a=0;for(let i=0;in&&(t=r,n=a),r=null,a=0):(null===r&&(r=i),++a);return a>n&&(t=r,n=a),{idx:t,len:n}}(e).idx;let r=!1;for(let a=0;a<=7;++a)r&&0===e[a]||(r&&(r=!1),n!==a?(t+=e[a].toString(16),7!==a&&(t+=":")):(t+=0===a?"::":":",r=!0));return t}(e)+"]":e}function S(e){const t=e.path;var n;0!==t.length&&("file"===e.scheme&&1===t.length&&(n=t[0],/^[A-Za-z]:$/.test(n))||t.pop())}function T(e){return""!==e.username||""!==e.password}function k(e,t,n,a,i){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=n||"utf-8",this.stateOverride=i,this.url=a,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:!1};const e=function(e){return e.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}(this.input);e!==this.input&&(this.parseError=!0),this.input=e}const o=function(e){return e.replace(/\u0009|\u000A|\u000D/g,"")}(this.input);for(o!==this.input&&(this.parseError=!0),this.input=o,this.state=i||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=r.ucs2.decode(this.input);this.pointer<=this.input.length;++this.pointer){const e=this.input[this.pointer],t=isNaN(e)?void 0:String.fromCodePoint(e),n=this["parse "+this.state](e,t);if(!n)break;if(n===s){this.failure=!0;break}}}k.prototype["parse scheme start"]=function(e,t){if(u(e))this.buffer+=t.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,s;this.state="no scheme",--this.pointer}return!0},k.prototype["parse scheme"]=function(e,t){if(function(e){return u(e)||d(e)}(e)||43===e||45===e||46===e)this.buffer+=t.toLowerCase();else if(58===e){if(this.stateOverride){if(f(this.url)&&!h(this.buffer))return!1;if(!f(this.url)&&h(this.buffer))return!1;if((T(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&(""===this.url.host||null===this.url.host))return!1}if(this.url.scheme=this.buffer,this.buffer="",this.stateOverride)return!1;"file"===this.url.scheme?(47===this.input[this.pointer+1]&&47===this.input[this.pointer+2]||(this.parseError=!0),this.state="file"):f(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":f(this.url)?this.state="special authority slashes":47===this.input[this.pointer+1]?(this.state="path or authority",++this.pointer):(this.url.cannotBeABaseURL=!0,this.url.path.push(""),this.state="cannot-be-a-base-URL path")}else{if(this.stateOverride)return this.parseError=!0,s;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},k.prototype["parse no scheme"]=function(e){return null===this.base||this.base.cannotBeABaseURL&&35!==e?s:(this.base.cannotBeABaseURL&&35===e?(this.url.scheme=this.base.scheme,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.url.cannotBeABaseURL=!0,this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},k.prototype["parse special relative or authority"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},k.prototype["parse path or authority"]=function(e){return 47===e?this.state="authority":(this.state="path",--this.pointer),!0},k.prototype["parse relative"]=function(e){return this.url.scheme=this.base.scheme,isNaN(e)?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query):47===e?this.state="relative slash":63===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query="",this.state="query"):35===e?(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):f(this.url)&&92===e?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(0,this.base.path.length-1),this.state="path",--this.pointer),!0},k.prototype["parse relative slash"]=function(e){return!f(this.url)||47!==e&&92!==e?47===e?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(92===e&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},k.prototype["parse special authority slashes"]=function(e){return 47===e&&47===this.input[this.pointer+1]?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},k.prototype["parse special authority ignore slashes"]=function(e){return 47!==e&&92!==e?(this.state="authority",--this.pointer):this.parseError=!0,!0},k.prototype["parse authority"]=function(e,t){if(64===e){this.parseError=!0,this.atFlag&&(this.buffer="%40"+this.buffer),this.atFlag=!0;const e=o(this.buffer);for(let t=0;t