'use strict';

var Z7BVBO5K_cjs = require('./Z7BVBO5K.cjs');
var VGCATKI5_cjs = require('./VGCATKI5.cjs');
var L34TQNQN_cjs = require('./L34TQNQN.cjs');
var _2ASNEWIN_cjs = require('./2ASNEWIN.cjs');
var W7QMZBXR_cjs = require('./W7QMZBXR.cjs');
var HHS2B7YE_cjs = require('./HHS2B7YE.cjs');
require('./OAYLBSRH.cjs');
require('./VVTDADG7.cjs');
require('./DPDVRYLI.cjs');
require('./BXO3RC75.cjs');
var NEQ3DTUV_cjs = require('./NEQ3DTUV.cjs');
var VO65XOWD_cjs = require('./VO65XOWD.cjs');

// ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.879.0/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js
VO65XOWD_cjs.init_cjs_shims();
var defaultSSOHttpAuthSchemeParametersProvider = /* @__PURE__ */ VO65XOWD_cjs.__name(async (config, context, input) => {
  return {
    operation: _2ASNEWIN_cjs.getSmithyContext(context).operation,
    region: await _2ASNEWIN_cjs.normalizeProvider(config.region)() || (() => {
      throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
    })()
  };
}, "defaultSSOHttpAuthSchemeParametersProvider");
function createAwsAuthSigv4HttpAuthOption(authParameters) {
  return {
    schemeId: "aws.auth#sigv4",
    signingProperties: {
      name: "awsssoportal",
      region: authParameters.region
    },
    propertiesExtractor: /* @__PURE__ */ VO65XOWD_cjs.__name((config, context) => ({
      signingProperties: {
        config,
        context
      }
    }), "propertiesExtractor")
  };
}
VO65XOWD_cjs.__name(createAwsAuthSigv4HttpAuthOption, "createAwsAuthSigv4HttpAuthOption");
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
  return {
    schemeId: "smithy.api#noAuth"
  };
}
VO65XOWD_cjs.__name(createSmithyApiNoAuthHttpAuthOption, "createSmithyApiNoAuthHttpAuthOption");
var defaultSSOHttpAuthSchemeProvider = /* @__PURE__ */ VO65XOWD_cjs.__name((authParameters) => {
  const options = [];
  switch (authParameters.operation) {
    case "GetRoleCredentials": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "ListAccountRoles": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "ListAccounts": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    case "Logout": {
      options.push(createSmithyApiNoAuthHttpAuthOption());
      break;
    }
    default: {
      options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
    }
  }
  return options;
}, "defaultSSOHttpAuthSchemeProvider");
var resolveHttpAuthSchemeConfig = /* @__PURE__ */ VO65XOWD_cjs.__name((config) => {
  const config_0 = _2ASNEWIN_cjs.resolveAwsSdkSigV4Config(config);
  return Object.assign(config_0, {
    authSchemePreference: _2ASNEWIN_cjs.normalizeProvider(config.authSchemePreference ?? [])
  });
}, "resolveHttpAuthSchemeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js
VO65XOWD_cjs.init_cjs_shims();
var resolveClientEndpointParameters = /* @__PURE__ */ VO65XOWD_cjs.__name((options) => {
  return Object.assign(options, {
    useDualstackEndpoint: options.useDualstackEndpoint ?? false,
    useFipsEndpoint: options.useFipsEndpoint ?? false,
    defaultSigningName: "awsssoportal"
  });
}, "resolveClientEndpointParameters");
var commonParams = {
  UseFIPS: {
    type: "builtInParams",
    name: "useFipsEndpoint"
  },
  Endpoint: {
    type: "builtInParams",
    name: "endpoint"
  },
  Region: {
    type: "builtInParams",
    name: "region"
  },
  UseDualStack: {
    type: "builtInParams",
    name: "useDualstackEndpoint"
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/package.json
var package_default = {
  version: "3.879.0"};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js
VO65XOWD_cjs.init_cjs_shims();
var u = "required";
var v = "fn";
var w = "argv";
var x = "ref";
var a = true;
var b = "isSet";
var c = "booleanEquals";
var d = "error";
var e = "endpoint";
var f = "tree";
var g = "PartitionResult";
var h = "getAttr";
var i = {
  [u]: false,
  "type": "String"
};
var j = {
  [u]: true,
  "default": false,
  "type": "Boolean"
};
var k = {
  [x]: "Endpoint"
};
var l = {
  [v]: c,
  [w]: [
    {
      [x]: "UseFIPS"
    },
    true
  ]
};
var m = {
  [v]: c,
  [w]: [
    {
      [x]: "UseDualStack"
    },
    true
  ]
};
var n = {};
var o = {
  [v]: h,
  [w]: [
    {
      [x]: g
    },
    "supportsFIPS"
  ]
};
var p = {
  [x]: g
};
var q = {
  [v]: c,
  [w]: [
    true,
    {
      [v]: h,
      [w]: [
        p,
        "supportsDualStack"
      ]
    }
  ]
};
var r = [
  l
];
var s = [
  m
];
var t = [
  {
    [x]: "Region"
  }
];
var _data = {
  version: "1.0",
  parameters: {
    Region: i,
    UseDualStack: j,
    UseFIPS: j,
    Endpoint: i
  },
  rules: [
    {
      conditions: [
        {
          [v]: b,
          [w]: [
            k
          ]
        }
      ],
      rules: [
        {
          conditions: r,
          error: "Invalid Configuration: FIPS and custom endpoint are not supported",
          type: d
        },
        {
          conditions: s,
          error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
          type: d
        },
        {
          endpoint: {
            url: k,
            properties: n,
            headers: n
          },
          type: e
        }
      ],
      type: f
    },
    {
      conditions: [
        {
          [v]: b,
          [w]: t
        }
      ],
      rules: [
        {
          conditions: [
            {
              [v]: "aws.partition",
              [w]: t,
              assign: g
            }
          ],
          rules: [
            {
              conditions: [
                l,
                m
              ],
              rules: [
                {
                  conditions: [
                    {
                      [v]: c,
                      [w]: [
                        a,
                        o
                      ]
                    },
                    q
                  ],
                  rules: [
                    {
                      endpoint: {
                        url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "FIPS and DualStack are enabled, but this partition does not support one or both",
                  type: d
                }
              ],
              type: f
            },
            {
              conditions: r,
              rules: [
                {
                  conditions: [
                    {
                      [v]: c,
                      [w]: [
                        o,
                        a
                      ]
                    }
                  ],
                  rules: [
                    {
                      conditions: [
                        {
                          [v]: "stringEquals",
                          [w]: [
                            {
                              [v]: h,
                              [w]: [
                                p,
                                "name"
                              ]
                            },
                            "aws-us-gov"
                          ]
                        }
                      ],
                      endpoint: {
                        url: "https://portal.sso.{Region}.amazonaws.com",
                        properties: n,
                        headers: n
                      },
                      type: e
                    },
                    {
                      endpoint: {
                        url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "FIPS is enabled but this partition does not support FIPS",
                  type: d
                }
              ],
              type: f
            },
            {
              conditions: s,
              rules: [
                {
                  conditions: [
                    q
                  ],
                  rules: [
                    {
                      endpoint: {
                        url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",
                        properties: n,
                        headers: n
                      },
                      type: e
                    }
                  ],
                  type: f
                },
                {
                  error: "DualStack is enabled but this partition does not support DualStack",
                  type: d
                }
              ],
              type: f
            },
            {
              endpoint: {
                url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",
                properties: n,
                headers: n
              },
              type: e
            }
          ],
          type: f
        }
      ],
      type: f
    },
    {
      error: "Invalid Configuration: Missing Region",
      type: d
    }
  ]
};
var ruleSet = _data;

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js
var cache = new _2ASNEWIN_cjs.EndpointCache({
  size: 50,
  params: [
    "Endpoint",
    "Region",
    "UseDualStack",
    "UseFIPS"
  ]
});
var defaultEndpointResolver = /* @__PURE__ */ VO65XOWD_cjs.__name((endpointParams, context = {}) => {
  return cache.get(endpointParams, () => _2ASNEWIN_cjs.resolveEndpoint(ruleSet, {
    endpointParams,
    logger: context.logger
  }));
}, "defaultEndpointResolver");
_2ASNEWIN_cjs.customEndpointFunctions.aws = _2ASNEWIN_cjs.awsEndpointFunctions;

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js
var getRuntimeConfig = /* @__PURE__ */ VO65XOWD_cjs.__name((config) => {
  return {
    apiVersion: "2019-06-10",
    base64Decoder: config?.base64Decoder ?? HHS2B7YE_cjs.fromBase64,
    base64Encoder: config?.base64Encoder ?? HHS2B7YE_cjs.toBase64,
    disableHostPrefix: config?.disableHostPrefix ?? false,
    endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
    extensions: config?.extensions ?? [],
    httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider,
    httpAuthSchemes: config?.httpAuthSchemes ?? [
      {
        schemeId: "aws.auth#sigv4",
        identityProvider: /* @__PURE__ */ VO65XOWD_cjs.__name((ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), "identityProvider"),
        signer: new _2ASNEWIN_cjs.AwsSdkSigV4Signer()
      },
      {
        schemeId: "smithy.api#noAuth",
        identityProvider: /* @__PURE__ */ VO65XOWD_cjs.__name((ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), "identityProvider"),
        signer: new VGCATKI5_cjs.NoAuthSigner()
      }
    ],
    logger: config?.logger ?? new HHS2B7YE_cjs.NoOpLogger(),
    serviceId: config?.serviceId ?? "SSO",
    urlParser: config?.urlParser ?? W7QMZBXR_cjs.parseUrl,
    utf8Decoder: config?.utf8Decoder ?? NEQ3DTUV_cjs.fromUtf8,
    utf8Encoder: config?.utf8Encoder ?? NEQ3DTUV_cjs.toUtf8
  };
}, "getRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js
var getRuntimeConfig2 = /* @__PURE__ */ VO65XOWD_cjs.__name((config) => {
  HHS2B7YE_cjs.emitWarningIfUnsupportedVersion(process.version);
  const defaultsMode = _2ASNEWIN_cjs.resolveDefaultsModeConfig(config);
  const defaultConfigProvider = /* @__PURE__ */ VO65XOWD_cjs.__name(() => defaultsMode().then(HHS2B7YE_cjs.loadConfigsForDefaultMode), "defaultConfigProvider");
  const clientSharedValues = getRuntimeConfig(config);
  _2ASNEWIN_cjs.emitWarningIfUnsupportedVersion(process.version);
  const loaderConfig = {
    profile: config?.profile,
    logger: clientSharedValues.logger
  };
  return {
    ...clientSharedValues,
    ...config,
    runtime: "node",
    defaultsMode,
    authSchemePreference: config?.authSchemePreference ?? W7QMZBXR_cjs.loadConfig(_2ASNEWIN_cjs.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
    bodyLengthChecker: config?.bodyLengthChecker ?? _2ASNEWIN_cjs.calculateBodyLength,
    defaultUserAgentProvider: config?.defaultUserAgentProvider ?? _2ASNEWIN_cjs.createDefaultUserAgentProvider({
      serviceId: clientSharedValues.serviceId,
      clientVersion: package_default.version
    }),
    maxAttempts: config?.maxAttempts ?? W7QMZBXR_cjs.loadConfig(_2ASNEWIN_cjs.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
    region: config?.region ?? W7QMZBXR_cjs.loadConfig(_2ASNEWIN_cjs.NODE_REGION_CONFIG_OPTIONS, {
      ..._2ASNEWIN_cjs.NODE_REGION_CONFIG_FILE_OPTIONS,
      ...loaderConfig
    }),
    requestHandler: HHS2B7YE_cjs.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
    retryMode: config?.retryMode ?? W7QMZBXR_cjs.loadConfig({
      ..._2ASNEWIN_cjs.NODE_RETRY_MODE_CONFIG_OPTIONS,
      default: /* @__PURE__ */ VO65XOWD_cjs.__name(async () => (await defaultConfigProvider()).retryMode || _2ASNEWIN_cjs.DEFAULT_RETRY_MODE, "default")
    }, config),
    sha256: config?.sha256 ?? _2ASNEWIN_cjs.Hash.bind(null, "sha256"),
    streamCollector: config?.streamCollector ?? HHS2B7YE_cjs.streamCollector,
    useDualstackEndpoint: config?.useDualstackEndpoint ?? W7QMZBXR_cjs.loadConfig(_2ASNEWIN_cjs.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
    useFipsEndpoint: config?.useFipsEndpoint ?? W7QMZBXR_cjs.loadConfig(_2ASNEWIN_cjs.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
    userAgentAppId: config?.userAgentAppId ?? W7QMZBXR_cjs.loadConfig(_2ASNEWIN_cjs.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig)
  };
}, "getRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js
VO65XOWD_cjs.init_cjs_shims();
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ VO65XOWD_cjs.__name((runtimeConfig) => {
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
  let _credentials = runtimeConfig.credentials;
  return {
    setHttpAuthScheme(httpAuthScheme) {
      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
      if (index === -1) {
        _httpAuthSchemes.push(httpAuthScheme);
      } else {
        _httpAuthSchemes.splice(index, 1, httpAuthScheme);
      }
    },
    httpAuthSchemes() {
      return _httpAuthSchemes;
    },
    setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
      _httpAuthSchemeProvider = httpAuthSchemeProvider;
    },
    httpAuthSchemeProvider() {
      return _httpAuthSchemeProvider;
    },
    setCredentials(credentials) {
      _credentials = credentials;
    },
    credentials() {
      return _credentials;
    }
  };
}, "getHttpAuthExtensionConfiguration");
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ VO65XOWD_cjs.__name((config) => {
  return {
    httpAuthSchemes: config.httpAuthSchemes(),
    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
    credentials: config.credentials()
  };
}, "resolveHttpAuthRuntimeConfig");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js
var resolveRuntimeExtensions = /* @__PURE__ */ VO65XOWD_cjs.__name((runtimeConfig, extensions) => {
  const extensionConfiguration = Object.assign(_2ASNEWIN_cjs.getAwsRegionExtensionConfiguration(runtimeConfig), HHS2B7YE_cjs.getDefaultExtensionConfiguration(runtimeConfig), HHS2B7YE_cjs.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
  return Object.assign(runtimeConfig, _2ASNEWIN_cjs.resolveAwsRegionExtensionConfiguration(extensionConfiguration), HHS2B7YE_cjs.resolveDefaultRuntimeConfig(extensionConfiguration), HHS2B7YE_cjs.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
}, "resolveRuntimeExtensions");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js
var SSOClient = class extends HHS2B7YE_cjs.Client {
  static {
    VO65XOWD_cjs.__name(this, "SSOClient");
  }
  config;
  constructor(...[configuration]) {
    const _config_0 = getRuntimeConfig2(configuration || {});
    super(_config_0);
    this.initConfig = _config_0;
    const _config_1 = resolveClientEndpointParameters(_config_0);
    const _config_2 = _2ASNEWIN_cjs.resolveUserAgentConfig(_config_1);
    const _config_3 = _2ASNEWIN_cjs.resolveRetryConfig(_config_2);
    const _config_4 = _2ASNEWIN_cjs.resolveRegionConfig(_config_3);
    const _config_5 = _2ASNEWIN_cjs.resolveHostHeaderConfig(_config_4);
    const _config_6 = _2ASNEWIN_cjs.resolveEndpointConfig(_config_5);
    const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
    const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
    this.config = _config_8;
    this.middlewareStack.use(_2ASNEWIN_cjs.getUserAgentPlugin(this.config));
    this.middlewareStack.use(_2ASNEWIN_cjs.getRetryPlugin(this.config));
    this.middlewareStack.use(_2ASNEWIN_cjs.getContentLengthPlugin(this.config));
    this.middlewareStack.use(_2ASNEWIN_cjs.getHostHeaderPlugin(this.config));
    this.middlewareStack.use(_2ASNEWIN_cjs.getLoggerPlugin(this.config));
    this.middlewareStack.use(_2ASNEWIN_cjs.getRecursionDetectionPlugin(this.config));
    this.middlewareStack.use(_2ASNEWIN_cjs.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
      httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider,
      identityProviderConfigProvider: /* @__PURE__ */ VO65XOWD_cjs.__name(async (config) => new _2ASNEWIN_cjs.DefaultIdentityProviderConfig({
        "aws.auth#sigv4": config.credentials
      }), "identityProviderConfigProvider")
    }));
    this.middlewareStack.use(_2ASNEWIN_cjs.getHttpSigningPlugin(this.config));
  }
  destroy() {
    super.destroy();
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js
VO65XOWD_cjs.init_cjs_shims();

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js
VO65XOWD_cjs.init_cjs_shims();
var SSOServiceException = class _SSOServiceException extends HHS2B7YE_cjs.ServiceException {
  static {
    VO65XOWD_cjs.__name(this, "SSOServiceException");
  }
  constructor(options) {
    super(options);
    Object.setPrototypeOf(this, _SSOServiceException.prototype);
  }
};

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js
var InvalidRequestException = class _InvalidRequestException extends SSOServiceException {
  static {
    VO65XOWD_cjs.__name(this, "InvalidRequestException");
  }
  name = "InvalidRequestException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "InvalidRequestException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _InvalidRequestException.prototype);
  }
};
var ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException {
  static {
    VO65XOWD_cjs.__name(this, "ResourceNotFoundException");
  }
  name = "ResourceNotFoundException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "ResourceNotFoundException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
  }
};
var TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException {
  static {
    VO65XOWD_cjs.__name(this, "TooManyRequestsException");
  }
  name = "TooManyRequestsException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "TooManyRequestsException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _TooManyRequestsException.prototype);
  }
};
var UnauthorizedException = class _UnauthorizedException extends SSOServiceException {
  static {
    VO65XOWD_cjs.__name(this, "UnauthorizedException");
  }
  name = "UnauthorizedException";
  $fault = "client";
  constructor(opts) {
    super({
      name: "UnauthorizedException",
      $fault: "client",
      ...opts
    });
    Object.setPrototypeOf(this, _UnauthorizedException.prototype);
  }
};
var GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ VO65XOWD_cjs.__name((obj) => ({
  ...obj,
  ...obj.accessToken && {
    accessToken: HHS2B7YE_cjs.SENSITIVE_STRING
  }
}), "GetRoleCredentialsRequestFilterSensitiveLog");
var RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ VO65XOWD_cjs.__name((obj) => ({
  ...obj,
  ...obj.secretAccessKey && {
    secretAccessKey: HHS2B7YE_cjs.SENSITIVE_STRING
  },
  ...obj.sessionToken && {
    sessionToken: HHS2B7YE_cjs.SENSITIVE_STRING
  }
}), "RoleCredentialsFilterSensitiveLog");
var GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ VO65XOWD_cjs.__name((obj) => ({
  ...obj,
  ...obj.roleCredentials && {
    roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials)
  }
}), "GetRoleCredentialsResponseFilterSensitiveLog");

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js
VO65XOWD_cjs.init_cjs_shims();
var se_GetRoleCredentialsCommand = /* @__PURE__ */ VO65XOWD_cjs.__name(async (input, context) => {
  const b2 = Z7BVBO5K_cjs.requestBuilder(input, context);
  const headers = HHS2B7YE_cjs.map({}, HHS2B7YE_cjs.isSerializableHeaderValue, {
    [_xasbt]: input[_aT]
  });
  b2.bp("/federation/credentials");
  const query = HHS2B7YE_cjs.map({
    [_rn]: [
      ,
      HHS2B7YE_cjs.expectNonNull(input[_rN], `roleName`)
    ],
    [_ai]: [
      ,
      HHS2B7YE_cjs.expectNonNull(input[_aI], `accountId`)
    ]
  });
  let body;
  b2.m("GET").h(headers).q(query).b(body);
  return b2.build();
}, "se_GetRoleCredentialsCommand");
var de_GetRoleCredentialsCommand = /* @__PURE__ */ VO65XOWD_cjs.__name(async (output, context) => {
  if (output.statusCode !== 200 && output.statusCode >= 300) {
    return de_CommandError(output, context);
  }
  const contents = HHS2B7YE_cjs.map({
    $metadata: deserializeMetadata(output)
  });
  const data = HHS2B7YE_cjs.expectNonNull(HHS2B7YE_cjs.expectObject(await L34TQNQN_cjs.parseJsonBody(output.body, context)), "body");
  const doc = HHS2B7YE_cjs.take(data, {
    roleCredentials: HHS2B7YE_cjs._json
  });
  Object.assign(contents, doc);
  return contents;
}, "de_GetRoleCredentialsCommand");
var de_CommandError = /* @__PURE__ */ VO65XOWD_cjs.__name(async (output, context) => {
  const parsedOutput = {
    ...output,
    body: await L34TQNQN_cjs.parseJsonErrorBody(output.body, context)
  };
  const errorCode = L34TQNQN_cjs.loadRestJsonErrorCode(output, parsedOutput.body);
  switch (errorCode) {
    case "InvalidRequestException":
    case "com.amazonaws.sso#InvalidRequestException":
      throw await de_InvalidRequestExceptionRes(parsedOutput, context);
    case "ResourceNotFoundException":
    case "com.amazonaws.sso#ResourceNotFoundException":
      throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
    case "TooManyRequestsException":
    case "com.amazonaws.sso#TooManyRequestsException":
      throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
    case "UnauthorizedException":
    case "com.amazonaws.sso#UnauthorizedException":
      throw await de_UnauthorizedExceptionRes(parsedOutput, context);
    default:
      const parsedBody = parsedOutput.body;
      return throwDefaultError({
        output,
        parsedBody,
        errorCode
      });
  }
}, "de_CommandError");
var throwDefaultError = HHS2B7YE_cjs.withBaseException(SSOServiceException);
var de_InvalidRequestExceptionRes = /* @__PURE__ */ VO65XOWD_cjs.__name(async (parsedOutput, context) => {
  const contents = HHS2B7YE_cjs.map({});
  const data = parsedOutput.body;
  const doc = HHS2B7YE_cjs.take(data, {
    message: HHS2B7YE_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new InvalidRequestException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return HHS2B7YE_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_InvalidRequestExceptionRes");
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ VO65XOWD_cjs.__name(async (parsedOutput, context) => {
  const contents = HHS2B7YE_cjs.map({});
  const data = parsedOutput.body;
  const doc = HHS2B7YE_cjs.take(data, {
    message: HHS2B7YE_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new ResourceNotFoundException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return HHS2B7YE_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_ResourceNotFoundExceptionRes");
var de_TooManyRequestsExceptionRes = /* @__PURE__ */ VO65XOWD_cjs.__name(async (parsedOutput, context) => {
  const contents = HHS2B7YE_cjs.map({});
  const data = parsedOutput.body;
  const doc = HHS2B7YE_cjs.take(data, {
    message: HHS2B7YE_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new TooManyRequestsException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return HHS2B7YE_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_TooManyRequestsExceptionRes");
var de_UnauthorizedExceptionRes = /* @__PURE__ */ VO65XOWD_cjs.__name(async (parsedOutput, context) => {
  const contents = HHS2B7YE_cjs.map({});
  const data = parsedOutput.body;
  const doc = HHS2B7YE_cjs.take(data, {
    message: HHS2B7YE_cjs.expectString
  });
  Object.assign(contents, doc);
  const exception = new UnauthorizedException({
    $metadata: deserializeMetadata(parsedOutput),
    ...contents
  });
  return HHS2B7YE_cjs.decorateServiceException(exception, parsedOutput.body);
}, "de_UnauthorizedExceptionRes");
var deserializeMetadata = /* @__PURE__ */ VO65XOWD_cjs.__name((output) => ({
  httpStatusCode: output.statusCode,
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
  extendedRequestId: output.headers["x-amz-id-2"],
  cfId: output.headers["x-amz-cf-id"]
}), "deserializeMetadata");
var _aI = "accountId";
var _aT = "accessToken";
var _ai = "account_id";
var _rN = "roleName";
var _rn = "role_name";
var _xasbt = "x-amz-sso_bearer_token";

// ../../node_modules/.pnpm/@aws-sdk+client-sso@3.879.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js
var GetRoleCredentialsCommand = class extends HHS2B7YE_cjs.Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) {
  return [
    _2ASNEWIN_cjs.getSerdePlugin(config, this.serialize, this.deserialize),
    _2ASNEWIN_cjs.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())
  ];
}).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() {
  static {
    VO65XOWD_cjs.__name(this, "GetRoleCredentialsCommand");
  }
};

exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand;
exports.SSOClient = SSOClient;
//# sourceMappingURL=DW3OZE6F.cjs.map
//# sourceMappingURL=DW3OZE6F.cjs.map