@tsed/schema 7.48.0 → 7.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jest.config.js +2 -2
- package/lib/browser/schema.umd.min.js +1 -1
- package/lib/browser/schema.umd.min.js.map +1 -1
- package/lib/cjs/components/async-api/channelsMapper.js +62 -0
- package/lib/cjs/components/async-api/channelsMapper.js.map +1 -0
- package/lib/cjs/components/async-api/generate.js +20 -0
- package/lib/cjs/components/async-api/generate.js.map +1 -0
- package/lib/cjs/components/async-api/messageMapper.js +44 -0
- package/lib/cjs/components/async-api/messageMapper.js.map +1 -0
- package/lib/cjs/components/async-api/payloadMapper.js +52 -0
- package/lib/cjs/components/async-api/payloadMapper.js.map +1 -0
- package/lib/cjs/components/async-api/responseMapper.js +58 -0
- package/lib/cjs/components/async-api/responseMapper.js.map +1 -0
- package/lib/cjs/components/{anyMapper.js → default/anyMapper.js} +9 -9
- package/lib/cjs/components/default/anyMapper.js.map +1 -0
- package/lib/cjs/components/{classMapper.js → default/classMapper.js} +11 -9
- package/lib/cjs/components/default/classMapper.js.map +1 -0
- package/lib/cjs/components/{genericsMapper.js → default/genericsMapper.js} +6 -6
- package/lib/cjs/components/default/genericsMapper.js.map +1 -0
- package/lib/cjs/components/{inheritedClassMapper.js → default/inheritedClassMapper.js} +3 -3
- package/lib/cjs/components/default/inheritedClassMapper.js.map +1 -0
- package/lib/cjs/components/{itemMapper.js → default/itemMapper.js} +2 -2
- package/lib/cjs/components/default/itemMapper.js.map +1 -0
- package/lib/cjs/components/{lazyRefMapper.js → default/lazyRefMapper.js} +4 -4
- package/lib/cjs/components/default/lazyRefMapper.js.map +1 -0
- package/lib/cjs/components/{mapMapper.js → default/mapMapper.js} +3 -3
- package/lib/cjs/components/default/mapMapper.js.map +1 -0
- package/lib/cjs/components/{objectMapper.js → default/objectMapper.js} +5 -5
- package/lib/cjs/components/default/objectMapper.js.map +1 -0
- package/lib/cjs/components/{ofMapper.js → default/ofMapper.js} +2 -2
- package/lib/cjs/components/default/ofMapper.js.map +1 -0
- package/lib/cjs/components/{propertiesMapper.js → default/propertiesMapper.js} +3 -3
- package/lib/cjs/components/default/propertiesMapper.js.map +1 -0
- package/lib/cjs/components/{schemaMapper.js → default/schemaMapper.js} +16 -16
- package/lib/cjs/components/default/schemaMapper.js.map +1 -0
- package/lib/cjs/components/index.js +26 -20
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/components/open-spec/generate.js +24 -0
- package/lib/cjs/components/open-spec/generate.js.map +1 -0
- package/lib/cjs/components/{operationInFilesMapper.js → open-spec/operationInFilesMapper.js} +1 -1
- package/lib/cjs/components/open-spec/operationInFilesMapper.js.map +1 -0
- package/lib/cjs/components/{operationInParameterMapper.js → open-spec/operationInParameterMapper.js} +7 -7
- package/lib/cjs/components/open-spec/operationInParameterMapper.js.map +1 -0
- package/lib/cjs/components/{operationInParametersMapper.js → open-spec/operationInParametersMapper.js} +2 -2
- package/lib/cjs/components/open-spec/operationInParametersMapper.js.map +1 -0
- package/lib/cjs/components/{operationInQueryMapper.js → open-spec/operationInQueryMapper.js} +4 -4
- package/lib/cjs/components/open-spec/operationInQueryMapper.js.map +1 -0
- package/lib/cjs/components/{operationMapper.js → open-spec/operationMapper.js} +6 -6
- package/lib/cjs/components/open-spec/operationMapper.js.map +1 -0
- package/lib/cjs/components/{operationMediaMapper.js → open-spec/operationMediaMapper.js} +2 -2
- package/lib/cjs/components/open-spec/operationMediaMapper.js.map +1 -0
- package/lib/cjs/components/{operationRequestBodyMapper.js → open-spec/operationRequestBodyMapper.js} +5 -5
- package/lib/cjs/components/open-spec/operationRequestBodyMapper.js.map +1 -0
- package/lib/cjs/components/{operationResponseMapper.js → open-spec/operationResponseMapper.js} +2 -2
- package/lib/cjs/components/open-spec/operationResponseMapper.js.map +1 -0
- package/lib/cjs/components/{pathsMapper.js → open-spec/pathsMapper.js} +38 -33
- package/lib/cjs/components/open-spec/pathsMapper.js.map +1 -0
- package/lib/cjs/constants/OperationVerbs.js +36 -0
- package/lib/cjs/constants/OperationVerbs.js.map +1 -0
- package/lib/cjs/decorators/operations/operation.js +45 -0
- package/lib/cjs/decorators/operations/operation.js.map +1 -0
- package/lib/cjs/decorators/operations/operationPath.js.map +1 -1
- package/lib/cjs/decorators/operations/publish.js +10 -0
- package/lib/cjs/decorators/operations/publish.js.map +1 -0
- package/lib/cjs/decorators/operations/route.js +14 -49
- package/lib/cjs/decorators/operations/route.js.map +1 -1
- package/lib/cjs/decorators/operations/subscribe.js +10 -0
- package/lib/cjs/decorators/operations/subscribe.js.map +1 -0
- package/lib/cjs/domain/JsonEntityStore.js +0 -4
- package/lib/cjs/domain/JsonEntityStore.js.map +1 -1
- package/lib/cjs/domain/JsonMap.js +1 -1
- package/lib/cjs/domain/JsonMap.js.map +1 -1
- package/lib/cjs/domain/JsonOperation.js +6 -0
- package/lib/cjs/domain/JsonOperation.js.map +1 -1
- package/lib/cjs/domain/JsonOperationPathsMap.js +4 -5
- package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -1
- package/lib/cjs/domain/JsonParameter.js +1 -1
- package/lib/cjs/domain/JsonParameter.js.map +1 -1
- package/lib/cjs/domain/JsonSchema.js +1 -1
- package/lib/cjs/domain/JsonSchema.js.map +1 -1
- package/lib/cjs/domain/SpecTypes.js +1 -0
- package/lib/cjs/domain/SpecTypes.js.map +1 -1
- package/lib/cjs/index.js +33 -22
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/registries/JsonSchemaMapperContainer.js +13 -11
- package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -1
- package/lib/cjs/utils/getJsonSchema.js +7 -4
- package/lib/cjs/utils/getJsonSchema.js.map +1 -1
- package/lib/cjs/utils/getOperationsRoutes.js +3 -3
- package/lib/cjs/utils/getOperationsRoutes.js.map +1 -1
- package/lib/cjs/utils/getSpec.js +4 -14
- package/lib/cjs/utils/getSpec.js.map +1 -1
- package/lib/cjs/utils/mapOperationOptions.js +31 -0
- package/lib/cjs/utils/mapOperationOptions.js.map +1 -0
- package/lib/cjs/utils/operationIdFormatter.js +5 -1
- package/lib/cjs/utils/operationIdFormatter.js.map +1 -1
- package/lib/cjs/utils/ref.js +2 -2
- package/lib/cjs/utils/ref.js.map +1 -1
- package/lib/cjs/utils/removeHiddenOperation.js +8 -0
- package/lib/cjs/utils/removeHiddenOperation.js.map +1 -0
- package/lib/cjs/utils/somethingOf.js +16 -0
- package/lib/cjs/utils/somethingOf.js.map +1 -0
- package/lib/esm/components/async-api/channelsMapper.js +58 -0
- package/lib/esm/components/async-api/channelsMapper.js.map +1 -0
- package/lib/esm/components/async-api/generate.js +18 -0
- package/lib/esm/components/async-api/generate.js.map +1 -0
- package/lib/esm/components/async-api/messageMapper.js +40 -0
- package/lib/esm/components/async-api/messageMapper.js.map +1 -0
- package/lib/esm/components/async-api/payloadMapper.js +48 -0
- package/lib/esm/components/async-api/payloadMapper.js.map +1 -0
- package/lib/esm/components/async-api/responseMapper.js +54 -0
- package/lib/esm/components/async-api/responseMapper.js.map +1 -0
- package/lib/esm/components/{anyMapper.js → default/anyMapper.js} +9 -9
- package/lib/esm/components/default/anyMapper.js.map +1 -0
- package/lib/esm/components/{classMapper.js → default/classMapper.js} +11 -9
- package/lib/esm/components/default/classMapper.js.map +1 -0
- package/lib/esm/components/{genericsMapper.js → default/genericsMapper.js} +6 -6
- package/lib/esm/components/default/genericsMapper.js.map +1 -0
- package/lib/esm/components/{inheritedClassMapper.js → default/inheritedClassMapper.js} +3 -3
- package/lib/esm/components/default/inheritedClassMapper.js.map +1 -0
- package/lib/esm/components/default/itemMapper.js +6 -0
- package/lib/esm/components/default/itemMapper.js.map +1 -0
- package/lib/esm/components/{lazyRefMapper.js → default/lazyRefMapper.js} +4 -4
- package/lib/esm/components/default/lazyRefMapper.js.map +1 -0
- package/lib/esm/components/{mapMapper.js → default/mapMapper.js} +3 -3
- package/lib/esm/components/default/mapMapper.js.map +1 -0
- package/lib/esm/components/{objectMapper.js → default/objectMapper.js} +5 -5
- package/lib/esm/components/default/objectMapper.js.map +1 -0
- package/lib/esm/components/{ofMapper.js → default/ofMapper.js} +2 -2
- package/lib/esm/components/default/ofMapper.js.map +1 -0
- package/lib/esm/components/{propertiesMapper.js → default/propertiesMapper.js} +3 -3
- package/lib/esm/components/default/propertiesMapper.js.map +1 -0
- package/lib/esm/components/{schemaMapper.js → default/schemaMapper.js} +17 -17
- package/lib/esm/components/default/schemaMapper.js.map +1 -0
- package/lib/esm/components/index.js +26 -20
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/components/open-spec/generate.js +22 -0
- package/lib/esm/components/open-spec/generate.js.map +1 -0
- package/lib/esm/components/{operationInFilesMapper.js → open-spec/operationInFilesMapper.js} +1 -1
- package/lib/esm/components/open-spec/operationInFilesMapper.js.map +1 -0
- package/lib/esm/components/{operationInParameterMapper.js → open-spec/operationInParameterMapper.js} +7 -7
- package/lib/esm/components/open-spec/operationInParameterMapper.js.map +1 -0
- package/lib/esm/components/{operationInParametersMapper.js → open-spec/operationInParametersMapper.js} +2 -2
- package/lib/esm/components/open-spec/operationInParametersMapper.js.map +1 -0
- package/lib/esm/components/{operationInQueryMapper.js → open-spec/operationInQueryMapper.js} +4 -4
- package/lib/esm/components/open-spec/operationInQueryMapper.js.map +1 -0
- package/lib/esm/components/{operationMapper.js → open-spec/operationMapper.js} +6 -6
- package/lib/esm/components/open-spec/operationMapper.js.map +1 -0
- package/lib/esm/components/open-spec/operationMediaMapper.js +7 -0
- package/lib/esm/components/open-spec/operationMediaMapper.js.map +1 -0
- package/lib/esm/components/{operationRequestBodyMapper.js → open-spec/operationRequestBodyMapper.js} +5 -5
- package/lib/esm/components/open-spec/operationRequestBodyMapper.js.map +1 -0
- package/lib/esm/components/{operationResponseMapper.js → open-spec/operationResponseMapper.js} +2 -2
- package/lib/esm/components/open-spec/operationResponseMapper.js.map +1 -0
- package/lib/esm/components/open-spec/pathsMapper.js +91 -0
- package/lib/esm/components/open-spec/pathsMapper.js.map +1 -0
- package/lib/esm/constants/OperationVerbs.js +33 -0
- package/lib/esm/constants/OperationVerbs.js.map +1 -0
- package/lib/esm/decorators/operations/operation.js +41 -0
- package/lib/esm/decorators/operations/operation.js.map +1 -0
- package/lib/esm/decorators/operations/operationPath.js.map +1 -1
- package/lib/esm/decorators/operations/publish.js +6 -0
- package/lib/esm/decorators/operations/publish.js.map +1 -0
- package/lib/esm/decorators/operations/route.js +14 -48
- package/lib/esm/decorators/operations/route.js.map +1 -1
- package/lib/esm/decorators/operations/subscribe.js +6 -0
- package/lib/esm/decorators/operations/subscribe.js.map +1 -0
- package/lib/esm/domain/JsonEntityStore.js +0 -4
- package/lib/esm/domain/JsonEntityStore.js.map +1 -1
- package/lib/esm/domain/JsonMap.js +1 -1
- package/lib/esm/domain/JsonMap.js.map +1 -1
- package/lib/esm/domain/JsonOperation.js +6 -0
- package/lib/esm/domain/JsonOperation.js.map +1 -1
- package/lib/esm/domain/JsonOperationPathsMap.js +4 -5
- package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -1
- package/lib/esm/domain/JsonParameter.js +1 -1
- package/lib/esm/domain/JsonParameter.js.map +1 -1
- package/lib/esm/domain/JsonSchema.js +1 -1
- package/lib/esm/domain/JsonSchema.js.map +1 -1
- package/lib/esm/domain/SpecTypes.js +1 -0
- package/lib/esm/domain/SpecTypes.js.map +1 -1
- package/lib/esm/index.js +33 -22
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/registries/JsonSchemaMapperContainer.js +13 -11
- package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -1
- package/lib/esm/utils/getJsonSchema.js +7 -4
- package/lib/esm/utils/getJsonSchema.js.map +1 -1
- package/lib/esm/utils/getOperationsRoutes.js +3 -3
- package/lib/esm/utils/getOperationsRoutes.js.map +1 -1
- package/lib/esm/utils/getSpec.js +5 -15
- package/lib/esm/utils/getSpec.js.map +1 -1
- package/lib/{cjs/utils/mapRouteOptions.js → esm/utils/mapOperationOptions.js} +9 -8
- package/lib/esm/utils/mapOperationOptions.js.map +1 -0
- package/lib/esm/utils/operationIdFormatter.js +3 -0
- package/lib/esm/utils/operationIdFormatter.js.map +1 -1
- package/lib/esm/utils/ref.js +3 -3
- package/lib/esm/utils/ref.js.map +1 -1
- package/lib/esm/utils/removeHiddenOperation.js +4 -0
- package/lib/esm/utils/removeHiddenOperation.js.map +1 -0
- package/lib/esm/utils/somethingOf.js +12 -0
- package/lib/esm/utils/somethingOf.js.map +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/components/async-api/channelsMapper.d.ts +2 -0
- package/lib/types/components/async-api/generate.d.ts +1 -0
- package/lib/types/components/async-api/messageMapper.d.ts +6 -0
- package/lib/types/components/async-api/payloadMapper.d.ts +4 -0
- package/lib/types/components/async-api/responseMapper.d.ts +6 -0
- package/lib/types/components/{anyMapper.d.ts → default/anyMapper.d.ts} +1 -1
- package/lib/types/components/default/classMapper.d.ts +3 -0
- package/lib/types/components/{genericsMapper.d.ts → default/genericsMapper.d.ts} +1 -1
- package/lib/types/components/{inheritedClassMapper.d.ts → default/inheritedClassMapper.d.ts} +1 -1
- package/lib/types/components/{itemMapper.d.ts → default/itemMapper.d.ts} +1 -1
- package/lib/types/components/default/lazyRefMapper.d.ts +3 -0
- package/lib/types/components/{mapMapper.d.ts → default/mapMapper.d.ts} +1 -1
- package/lib/types/components/{objectMapper.d.ts → default/objectMapper.d.ts} +1 -1
- package/lib/types/components/default/ofMapper.d.ts +3 -0
- package/lib/types/components/default/propertiesMapper.d.ts +3 -0
- package/lib/types/components/default/schemaMapper.d.ts +3 -0
- package/lib/types/components/index.d.ts +26 -20
- package/lib/types/components/open-spec/generate.d.ts +1 -0
- package/lib/types/components/{operationInParameterMapper.d.ts → open-spec/operationInParameterMapper.d.ts} +2 -2
- package/lib/types/components/open-spec/operationInParametersMapper.d.ts +3 -0
- package/lib/types/components/open-spec/operationMapper.d.ts +3 -0
- package/lib/types/components/open-spec/operationMediaMapper.d.ts +3 -0
- package/lib/types/components/{operationRequestBodyMapper.d.ts → open-spec/operationRequestBodyMapper.d.ts} +2 -2
- package/lib/types/components/open-spec/operationResponseMapper.d.ts +3 -0
- package/lib/types/components/{pathsMapper.d.ts → open-spec/pathsMapper.d.ts} +1 -1
- package/lib/types/constants/OperationVerbs.d.ts +20 -0
- package/lib/types/decorators/operations/operation.d.ts +60 -0
- package/lib/types/decorators/operations/operationPath.d.ts +2 -2
- package/lib/types/decorators/operations/publish.d.ts +1 -0
- package/lib/types/decorators/operations/route.d.ts +11 -66
- package/lib/types/decorators/operations/subscribe.d.ts +1 -0
- package/lib/types/domain/JsonOperation.d.ts +1 -0
- package/lib/types/domain/SpecTypes.d.ts +2 -1
- package/lib/types/index.d.ts +33 -22
- package/lib/types/interfaces/JsonSchemaOptions.d.ts +3 -4
- package/lib/types/registries/JsonSchemaMapperContainer.d.ts +6 -5
- package/lib/types/utils/getOperationsRoutes.d.ts +2 -0
- package/lib/types/utils/getSpec.d.ts +5 -1
- package/lib/types/utils/{mapRouteOptions.d.ts → mapOperationOptions.d.ts} +1 -1
- package/lib/types/utils/operationIdFormatter.d.ts +2 -0
- package/lib/types/utils/removeHiddenOperation.d.ts +2 -0
- package/lib/types/utils/somethingOf.d.ts +1 -0
- package/package.json +6 -6
- package/lib/cjs/components/anyMapper.js.map +0 -1
- package/lib/cjs/components/classMapper.js.map +0 -1
- package/lib/cjs/components/genericsMapper.js.map +0 -1
- package/lib/cjs/components/inheritedClassMapper.js.map +0 -1
- package/lib/cjs/components/itemMapper.js.map +0 -1
- package/lib/cjs/components/lazyRefMapper.js.map +0 -1
- package/lib/cjs/components/mapMapper.js.map +0 -1
- package/lib/cjs/components/objectMapper.js.map +0 -1
- package/lib/cjs/components/ofMapper.js.map +0 -1
- package/lib/cjs/components/operationInFilesMapper.js.map +0 -1
- package/lib/cjs/components/operationInParameterMapper.js.map +0 -1
- package/lib/cjs/components/operationInParametersMapper.js.map +0 -1
- package/lib/cjs/components/operationInQueryMapper.js.map +0 -1
- package/lib/cjs/components/operationMapper.js.map +0 -1
- package/lib/cjs/components/operationMediaMapper.js.map +0 -1
- package/lib/cjs/components/operationRequestBodyMapper.js.map +0 -1
- package/lib/cjs/components/operationResponseMapper.js.map +0 -1
- package/lib/cjs/components/pathsMapper.js.map +0 -1
- package/lib/cjs/components/propertiesMapper.js.map +0 -1
- package/lib/cjs/components/schemaMapper.js.map +0 -1
- package/lib/cjs/constants/httpMethods.js +0 -46
- package/lib/cjs/constants/httpMethods.js.map +0 -1
- package/lib/cjs/utils/mapRouteOptions.js.map +0 -1
- package/lib/esm/components/anyMapper.js.map +0 -1
- package/lib/esm/components/classMapper.js.map +0 -1
- package/lib/esm/components/genericsMapper.js.map +0 -1
- package/lib/esm/components/inheritedClassMapper.js.map +0 -1
- package/lib/esm/components/itemMapper.js +0 -6
- package/lib/esm/components/itemMapper.js.map +0 -1
- package/lib/esm/components/lazyRefMapper.js.map +0 -1
- package/lib/esm/components/mapMapper.js.map +0 -1
- package/lib/esm/components/objectMapper.js.map +0 -1
- package/lib/esm/components/ofMapper.js.map +0 -1
- package/lib/esm/components/operationInFilesMapper.js.map +0 -1
- package/lib/esm/components/operationInParameterMapper.js.map +0 -1
- package/lib/esm/components/operationInParametersMapper.js.map +0 -1
- package/lib/esm/components/operationInQueryMapper.js.map +0 -1
- package/lib/esm/components/operationMapper.js.map +0 -1
- package/lib/esm/components/operationMediaMapper.js +0 -7
- package/lib/esm/components/operationMediaMapper.js.map +0 -1
- package/lib/esm/components/operationRequestBodyMapper.js.map +0 -1
- package/lib/esm/components/operationResponseMapper.js.map +0 -1
- package/lib/esm/components/pathsMapper.js +0 -86
- package/lib/esm/components/pathsMapper.js.map +0 -1
- package/lib/esm/components/propertiesMapper.js.map +0 -1
- package/lib/esm/components/schemaMapper.js.map +0 -1
- package/lib/esm/constants/httpMethods.js +0 -43
- package/lib/esm/constants/httpMethods.js.map +0 -1
- package/lib/esm/utils/mapRouteOptions.js +0 -22
- package/lib/esm/utils/mapRouteOptions.js.map +0 -1
- package/lib/types/components/classMapper.d.ts +0 -3
- package/lib/types/components/lazyRefMapper.d.ts +0 -3
- package/lib/types/components/ofMapper.d.ts +0 -3
- package/lib/types/components/operationInParametersMapper.d.ts +0 -3
- package/lib/types/components/operationMapper.d.ts +0 -3
- package/lib/types/components/operationMediaMapper.d.ts +0 -3
- package/lib/types/components/operationResponseMapper.d.ts +0 -3
- package/lib/types/components/propertiesMapper.d.ts +0 -3
- package/lib/types/components/schemaMapper.d.ts +0 -3
- package/lib/types/constants/httpMethods.d.ts +0 -12
- /package/lib/types/components/{operationInFilesMapper.d.ts → open-spec/operationInFilesMapper.d.ts} +0 -0
- /package/lib/types/components/{operationInQueryMapper.d.ts → open-spec/operationInQueryMapper.d.ts} +0 -0
package/jest.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see schema.umd.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@tsed/core"),require("change-case")):"function"==typeof define&&define.amd?define(["@tsed/core","change-case"],t):"object"==typeof exports?exports["@tsed/schema"]=t(require("@tsed/core"),require("change-case")):e["@tsed/schema"]=t(e["@tsed/core"],e["change-case"])}(self,((e,t)=>(()=>{"use strict";var r={133:(e,t,r)=>{e.exports=r(555)},379:e=>{const t="\\\\/",r=`[^${t}]`,s="\\.",n="\\/",i="[^/]",o=`(?:${n}|$)`,a=`(?:^|${n})`,c=`${s}{1,2}${o}`,p={DOT_LITERAL:s,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:n,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${s})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${s}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${n}]`,STAR:`${i}*?`,START_ANCHOR:a,SEP:"/"},u={...p,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${s}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${s})`,NO_DOTS:`(?!(?:^|[${t}])${s}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${s}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${s}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?u:p}},390:(e,t,r)=>{const s=r(379),n=r(290),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:p}=s,u=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>n.escapeRegex(e))).join("..")}return r},h=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,l=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=p[e]||e;const r={...t},l="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let m=e.length;if(m>l)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${l}`);const d={type:"bos",value:"",output:r.prepend||""},f=[d],y=r.capture?"":"?:",g=s.globChars(r.windows),O=s.extglobChars(g),{DOT_LITERAL:S,PLUS_LITERAL:b,SLASH_LITERAL:R,ONE_CHAR:T,DOTS_SLASH:A,NO_DOT:E,NO_DOT_SLASH:v,NO_DOTS_SLASH:x,QMARK:C,QMARK_NO_DOT:P,STAR:$,START_ANCHOR:w}=g,M=e=>`(${y}(?:(?!${w}${e.dot?A:S}).)*?)`,_=r.dot?"":E,N=r.dot?C:P;let D=!0===r.bash?M(r):$;r.capture&&(D=`(${D})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const L={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};e=n.removePrefix(e,L),m=e.length;const k=[],I=[],j=[];let H,q=d;const G=()=>L.index===m-1,U=L.peek=(t=1)=>e[L.index+t],B=L.advance=()=>e[++L.index],K=()=>e.slice(L.index+1),J=(e="",t=0)=>{L.consumed+=e,L.index+=t},F=e=>{L.output+=null!=e.output?e.output:e.value,J(e.value)},W=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)B(),L.start++,e++;return e%2!=0&&(L.negated=!0,L.start++,!0)},V=e=>{L[e]++,j.push(e)},X=e=>{L[e]--,j.pop()},z=e=>{if("globstar"===q.type){const t=L.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(L.output=L.output.slice(0,-q.output.length),q.type="star",q.value="*",q.output=D,L.output+=q.output)}if(k.length&&"paren"!==e.type&&!O[e.value]&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&F(e),q&&"text"===q.type&&"text"===e.type)return q.value+=e.value,void(q.output=(q.output||"")+e.value);e.prev=q,f.push(e),q=e},Q=(e,t)=>{const s={...O[t],conditions:1,inner:""};s.prev=q,s.parens=L.parens,s.output=L.output;const n=(r.capture?"(":"")+s.open;V("parens"),z({type:e,value:t,output:L.output?"":T}),z({type:"paren",extglob:!0,value:B(),output:n}),k.push(s)},Y=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let s=D;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=M(r)),(s!==D||G()||/^\)+$/.test(K()))&&(t=e.close=`)$))${s}`),"bos"===e.prev.type&&G()&&(L.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:H,output:t}),X("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,i=e.replace(c,((e,t,r,n,i,o)=>"\\"===n?(s=!0,e):"?"===n?t?t+n+(i?C.repeat(i.length):""):0===o?N+(i?C.repeat(i.length):""):C.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?t?t+n+(i?D:""):D:t?e:`\\${e}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?(L.output=e,L):(L.output=n.wrapOutput(i,L,t),L)}for(;!G();){if(H=B(),"\0"===H)continue;if("\\"===H){const e=U();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",z({type:"text",value:H});continue}const t=/^\\+/.exec(K());let s=0;if(t&&t[0].length>2&&(s=t[0].length,L.index+=s,s%2!=0&&(H+="\\")),!0===r.unescape?H=B()||"":H+=B()||"",0===L.brackets){z({type:"text",value:H});continue}}if(L.brackets>0&&("]"!==H||"["===q.value||"[^"===q.value)){if(!1!==r.posix&&":"===H){const e=q.value.slice(1);if(e.includes("[")&&(q.posix=!0,e.includes(":"))){const e=q.value.lastIndexOf("["),t=q.value.slice(0,e),r=q.value.slice(e+2),s=o[r];if(s){q.value=t+s,L.backtrack=!0,B(),d.output||1!==f.indexOf(q)||(d.output=T);continue}}}("["===H&&":"!==U()||"-"===H&&"]"===U())&&(H=`\\${H}`),"]"!==H||"["!==q.value&&"[^"!==q.value||(H=`\\${H}`),!0===r.posix&&"!"===H&&"["===q.value&&(H="^"),q.value+=H,F({value:H});continue}if(1===L.quotes&&'"'!==H){H=n.escapeRegex(H),q.value+=H,F({value:H});continue}if('"'===H){L.quotes=1===L.quotes?0:1,!0===r.keepQuotes&&z({type:"text",value:H});continue}if("("===H){V("parens"),z({type:"paren",value:H});continue}if(")"===H){if(0===L.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=k[k.length-1];if(e&&L.parens===e.parens+1){Y(k.pop());continue}z({type:"paren",value:H,output:L.parens?")":"\\)"}),X("parens");continue}if("["===H){if(!0!==r.nobracket&&K().includes("]"))V("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));H=`\\${H}`}z({type:"bracket",value:H});continue}if("]"===H){if(!0===r.nobracket||q&&"bracket"===q.type&&1===q.value.length){z({type:"text",value:H,output:`\\${H}`});continue}if(0===L.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));z({type:"text",value:H,output:`\\${H}`});continue}X("brackets");const e=q.value.slice(1);if(!0===q.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),q.value+=H,F({value:H}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(q.value);if(L.output=L.output.slice(0,-q.value.length),!0===r.literalBrackets){L.output+=t,q.value=t;continue}q.value=`(${y}${t}|${q.value})`,L.output+=q.value;continue}if("{"===H&&!0!==r.nobrace){V("braces");const e={type:"brace",value:H,output:"(",outputIndex:L.output.length,tokensIndex:L.tokens.length};I.push(e),z(e);continue}if("}"===H){const e=I[I.length-1];if(!0===r.nobrace||!e){z({type:"text",value:H,output:H});continue}let t=")";if(!0===e.dots){const e=f.slice(),s=[];for(let t=e.length-1;t>=0&&(f.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=u(s,r),L.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=L.output.slice(0,e.outputIndex),s=L.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",L.output=r;for(const e of s)L.output+=e.output||e.value}z({type:"brace",value:H,output:t}),X("braces"),I.pop();continue}if("|"===H){k.length>0&&k[k.length-1].conditions++,z({type:"text",value:H});continue}if(","===H){let e=H;const t=I[I.length-1];t&&"braces"===j[j.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===q.type&&L.index===L.start+1){L.start=L.index+1,L.consumed="",L.output="",f.pop(),q=d;continue}z({type:"slash",value:H,output:R});continue}if("."===H){if(L.braces>0&&"dot"===q.type){"."===q.value&&(q.output=S);const e=I[I.length-1];q.type="dots",q.output+=H,q.value+=H,e.dots=!0;continue}if(L.braces+L.parens===0&&"bos"!==q.type&&"slash"!==q.type){z({type:"text",value:H,output:S});continue}z({type:"dot",value:H,output:S});continue}if("?"===H){if((!q||"("!==q.value)&&!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("qmark",H);continue}if(q&&"paren"===q.type){const e=U();let t=H;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===q.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${H}`),z({type:"text",value:H,output:t});continue}if(!0!==r.dot&&("slash"===q.type||"bos"===q.type)){z({type:"qmark",value:H,output:P});continue}z({type:"qmark",value:H,output:C});continue}if("!"===H){if(!0!==r.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Q("negate",H);continue}if(!0!==r.nonegate&&0===L.index){W();continue}}if("+"===H){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("plus",H);continue}if(q&&"("===q.value||!1===r.regex){z({type:"plus",value:H,output:b});continue}if(q&&("bracket"===q.type||"paren"===q.type||"brace"===q.type)||L.parens>0){z({type:"plus",value:H});continue}z({type:"plus",value:b});continue}if("@"===H){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){z({type:"at",extglob:!0,value:H,output:""});continue}z({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=a.exec(K());e&&(H+=e[0],L.index+=e[0].length),z({type:"text",value:H});continue}if(q&&("globstar"===q.type||!0===q.star)){q.type="star",q.star=!0,q.value+=H,q.output=D,L.backtrack=!0,L.globstar=!0,J(H);continue}let t=K();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",H);continue}if("star"===q.type){if(!0===r.noglobstar){J(H);continue}const s=q.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){z({type:"star",value:H,output:""});continue}const a=L.braces>0&&("comma"===s.type||"brace"===s.type),c=k.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){z({type:"star",value:H,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[L.index+4];if(r&&"/"!==r)break;t=t.slice(3),J("/**",3)}if("bos"===s.type&&G()){q.type="globstar",q.value+=H,q.output=M(r),L.output=q.output,L.globstar=!0,J(H);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&G()){L.output=L.output.slice(0,-(s.output+q.output).length),s.output=`(?:${s.output}`,q.type="globstar",q.output=M(r)+(r.strictSlashes?")":"|$)"),q.value+=H,L.globstar=!0,L.output+=s.output+q.output,J(H);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";L.output=L.output.slice(0,-(s.output+q.output).length),s.output=`(?:${s.output}`,q.type="globstar",q.output=`${M(r)}${R}|${R}${e})`,q.value+=H,L.output+=s.output+q.output,L.globstar=!0,J(H+B()),z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){q.type="globstar",q.value+=H,q.output=`(?:^|${R}|${M(r)}${R})`,L.output=q.output,L.globstar=!0,J(H+B()),z({type:"slash",value:"/",output:""});continue}L.output=L.output.slice(0,-q.output.length),q.type="globstar",q.output=M(r),q.value+=H,L.output+=q.output,L.globstar=!0,J(H);continue}const s={type:"star",value:H,output:D};!0!==r.bash?!q||"bracket"!==q.type&&"paren"!==q.type||!0!==r.regex?(L.index!==L.start&&"slash"!==q.type&&"dot"!==q.type||("dot"===q.type?(L.output+=v,q.output+=v):!0===r.dot?(L.output+=x,q.output+=x):(L.output+=_,q.output+=_),"*"!==U()&&(L.output+=T,q.output+=T)),z(s)):(s.output=H,z(s)):(s.output=".*?","bos"!==q.type&&"slash"!==q.type||(s.output=_+s.output),z(s))}for(;L.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));L.output=n.escapeLast(L.output,"["),X("brackets")}for(;L.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));L.output=n.escapeLast(L.output,"("),X("parens")}for(;L.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));L.output=n.escapeLast(L.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==q.type&&"bracket"!==q.type||z({type:"maybe_slash",value:"",output:`${R}?`}),!0===L.backtrack){L.output="";for(const e of L.tokens)L.output+=null!=e.output?e.output:e.value,e.suffix&&(L.output+=e.suffix)}return L};l.fastpaths=(e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=p[e]||e;const{DOT_LITERAL:c,SLASH_LITERAL:u,ONE_CHAR:h,DOTS_SLASH:l,NO_DOT:m,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:y,START_ANCHOR:g}=s.globChars(r.windows),O=r.dot?d:m,S=r.dot?f:m,b=r.capture?"":"?:";let R=!0===r.bash?".*?":y;r.capture&&(R=`(${R})`);const T=e=>!0===e.noglobstar?R:`(${b}(?:(?!${g}${e.dot?l:c}).)*?)`,A=e=>{switch(e){case"*":return`${O}${h}${R}`;case".*":return`${c}${h}${R}`;case"*.*":return`${O}${R}${c}${h}${R}`;case"*/*":return`${O}${R}${u}${h}${S}${R}`;case"**":return O+T(r);case"**/*":return`(?:${O}${T(r)}${u})?${S}${h}${R}`;case"**/*.*":return`(?:${O}${T(r)}${u})?${S}${R}${c}${h}${R}`;case"**/.*":return`(?:${O}${T(r)}${u})?${c}${h}${R}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=A(t[1]);if(!r)return;return r+c+t[2]}}},E=n.removePrefix(e,{negated:!1,prefix:""});let v=A(E);return v&&!0!==r.strictSlashes&&(v+=`${u}?`),v},e.exports=l},555:(e,t,r)=>{const s=r(270),n=r(390),i=r(290),o=r(379),a=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>a(e,t,r))),n=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return n}const s=(n=e)&&"object"==typeof n&&!Array.isArray(n)&&e.tokens&&e.input;var n;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},o=i.windows,c=s?a.compileRe(e,t):a.makeRe(e,t,!1,!0),p=c.state;delete c.state;let u=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};u=a(i.ignore,e,r)}const h=(r,s=!1)=>{const{isMatch:n,match:h,output:l}=a.test(r,c,t,{glob:e,posix:o}),m={glob:e,state:p,regex:c,posix:o,input:r,output:l,match:h,isMatch:n};return"function"==typeof i.onResult&&i.onResult(m),!1===n?(m.isMatch=!1,!!s&&m):u(r)?("function"==typeof i.onIgnore&&i.onIgnore(m),m.isMatch=!1,!!s&&m):("function"==typeof i.onMatch&&i.onMatch(m),!s||m)};return r&&(h.state=p),h};a.test=(e,t,r,{glob:s,posix:n}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const o=r||{},c=o.format||(n?i.toPosixSlashes:null);let p=e===s,u=p&&c?c(e):e;return!1===p&&(u=c?c(e):e,p=u===s),!1!==p&&!0!==o.capture||(p=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,n):t.exec(u)),{isMatch:Boolean(p),match:p,output:u}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map((e=>a.parse(e,t))):n(e,{...t,fastpaths:!1}),a.scan=(e,t)=>s(e,t),a.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const n=t||{},i=n.contains?"":"^",o=n.contains?"":"$";let c=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const p=a.toRegex(c,t);return!0===s&&(p.state=e),p},a.makeRe=(e,t,r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let o,c={negated:!1,fastpaths:!0},p="";return e.startsWith("./")&&(e=e.slice(2),p=c.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(o=n.fastpaths(e,t)),void 0===o?(c=n(e,t),c.prefix=p+(c.prefix||"")):c.output=o,a.compileRe(c,t,r,s)},a.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,e.exports=a},270:(e,t,r)=>{const s=r(290),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:p,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:y,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:O}=r(379),S=e=>e===u||e===o,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},R=e.length-1,T=!0===r.parts||!0===r.scanToEnd,A=[],E=[],v=[];let x,C,P=e,$=-1,w=0,M=0,_=!1,N=!1,D=!1,L=!1,k=!1,I=!1,j=!1,H=!1,q=!1,G=0,U={value:"",depth:0,isGlob:!1};const B=()=>$>=R,K=()=>(x=C,P.charCodeAt(++$));for(;$<R;){let e;if(C=K(),C!==o){if(!0===I||C===h){for(G++;!0!==B()&&(C=K());)if(C!==o)if(C!==h){if(!0!==I&&C===c&&(C=K())===c){if(_=U.isBrace=!0,D=U.isGlob=!0,q=!0,!0===T)continue;break}if(!0!==I&&C===a){if(_=U.isBrace=!0,D=U.isGlob=!0,q=!0,!0===T)continue;break}if(C===y&&(G--,0===G)){I=!1,_=U.isBrace=!0,q=!0;break}}else G++;else j=U.backslashes=!0,K();if(!0===T)continue;break}if(C!==u){if(!0!==r.noext&&!0==(C===d||C===i||C===n||C===f||C===p)&&P.charCodeAt($+1)===l){if(D=U.isGlob=!0,L=U.isExtglob=!0,q=!0,!0===T){for(;!0!==B()&&(C=K());)if(C!==o){if(C===g){D=U.isGlob=!0,q=!0;break}}else j=U.backslashes=!0,C=K();continue}break}if(C===n){if(x===n&&(k=U.isGlobstar=!0),D=U.isGlob=!0,q=!0,!0===T)continue;break}if(C===f){if(D=U.isGlob=!0,q=!0,!0===T)continue;break}if(C===m)for(;!0!==B()&&(e=K());)if(e!==o){if(e===O){if(N=U.isBracket=!0,D=U.isGlob=!0,q=!0,!0===T)continue;break}}else j=U.backslashes=!0,K();if(!0===r.nonegate||C!==p||$!==w){if(!0!==r.noparen&&C===l){if(D=U.isGlob=!0,!0===T){for(;!0!==B()&&(C=K());)if(C!==l){if(C===g){q=!0;break}}else j=U.backslashes=!0,C=K();continue}break}if(!0===D){if(q=!0,!0===T)continue;break}}else H=U.negated=!0,w++}else{if(A.push($),E.push(U),U={value:"",depth:0,isGlob:!1},!0===q)continue;if(x===c&&$===w+1){w+=2;continue}M=$+1}}else j=U.backslashes=!0,C=K(),C===h&&(I=!0)}!0===r.noext&&(L=!1,D=!1);let J=P,F="",W="";w>0&&(F=P.slice(0,w),P=P.slice(w),M-=w),J&&!0===D&&M>0?(J=P.slice(0,M),W=P.slice(M)):!0===D?(J="",W=P):J=P,J&&""!==J&&"/"!==J&&J!==P&&S(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),!0===r.unescape&&(W&&(W=s.removeBackslashes(W)),J&&!0===j&&(J=s.removeBackslashes(J)));const V={prefix:F,input:e,start:w,base:J,glob:W,isBrace:_,isBracket:N,isGlob:D,isExtglob:L,isGlobstar:k,negated:H};if(!0===r.tokens&&(V.maxDepth=0,S(C)||E.push(U),V.tokens=E),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<A.length;s++){const n=t?t+1:w,i=A[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==w?(E[s].isPrefix=!0,E[s].value=F):E[s].value=o,b(E[s]),V.maxDepth+=E[s].depth),0===s&&""===o||v.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);v.push(s),r.tokens&&(E[E.length-1].value=s,b(E[E.length-1]),V.maxDepth+=E[E.length-1].depth)}V.slashes=A,V.parts=v}return V}},290:(e,t,r)=>{const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=r(379);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>i.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(o,"\\$1"),t.toPosixSlashes=e=>e.replace(s,"/"),t.removeBackslashes=e=>e.replace(n,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.escapeLast=(e,r,s)=>{const n=e.lastIndexOf(r,s);return-1===n?e:"\\"===e[n-1]?t.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s},t.basename=(e,{windows:t}={})=>t?e.replace(/[\\/]$/,"").replace(/.*[\\/]/,""):e.replace(/\/$/,"").replace(/.*\//,"")},203:(e,t,r)=>{var s=r(739);function n(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return n(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):n(t)}e.exports=i,i.message=s,i.code=function(e){var t={};return Object.keys(e).forEach((function(r){var s=e[r],n=Number(r);t[s.toLowerCase()]=n})),t}(s),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(s),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},803:t=>{t.exports=e},598:e=>{e.exports=t},739:e=>{e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{AcceptMime:()=>Nr,AdditionalProperties:()=>at,All:()=>rs,AllOf:()=>ct,Allow:()=>ut,Any:()=>ht,AnyOf:()=>lt,ArrayOf:()=>Qe,Children:()=>Ve,CollectionContains:()=>Ze,CollectionOf:()=>ze,Const:()=>mt,Consumes:()=>Dr,ContentType:()=>Ur,Converter:()=>Us,CustomKey:()=>dt,CustomKeys:()=>ft,DateFormat:()=>Nt,DateTime:()=>_t,DecoratorContext:()=>Lr,Default:()=>yt,DefaultMsg:()=>gt,Delete:()=>os,Deprecated:()=>Br,Description:()=>Ot,Discriminator:()=>b,DiscriminatorKey:()=>St,DiscriminatorValue:()=>Xe,Email:()=>Mt,EndpointMetadata:()=>B,Enum:()=>bt,ErrorMsg:()=>et,Example:()=>Rt,Examples:()=>Tt,ExclusiveMaximum:()=>vt,ExclusiveMinimum:()=>Pt,For:()=>rr,Format:()=>wt,ForwardGroups:()=>It,GenericOf:()=>wr,Generics:()=>Mr,Get:()=>ss,Groups:()=>Ut,HTTP_METHODS:()=>$e,HTTP_STATUS_MESSAGES:()=>Oe,Head:()=>as,Header:()=>Kr,Hidden:()=>Bt,Ignore:()=>Kt,In:()=>Jr,InFile:()=>Fr,Integer:()=>Jt,JSON_TYPES:()=>f,JsonClassStore:()=>v,JsonEntitiesContainer:()=>t,JsonEntityComponent:()=>E,JsonEntityFn:()=>We,JsonEntityStore:()=>r,JsonFormatTypes:()=>$t,JsonLazyRef:()=>J,JsonMap:()=>P,JsonMedia:()=>H,JsonMethodStore:()=>U,JsonOperation:()=>G,JsonOperationPathsMap:()=>Me,JsonOperationRoute:()=>ys,JsonParameter:()=>_,JsonParameterStore:()=>N,JsonParameterTypes:()=>$,JsonPropertyStore:()=>x,JsonRequestBody:()=>Ae,JsonResponse:()=>q,JsonSchema:()=>A,Location:()=>Wr,MapOf:()=>Ye,Max:()=>Et,MaxItems:()=>rt,MaxLength:()=>Ft,MaxProperties:()=>st,Maximum:()=>At,Min:()=>Ct,MinItems:()=>nt,MinLength:()=>Wt,MinProperties:()=>it,Minimum:()=>xt,MultipleOf:()=>Vt,Name:()=>Xt,Nullable:()=>zt,OneOf:()=>Qt,OperationId:()=>Vr,OperationMethods:()=>we,OperationPath:()=>Xr,Optional:()=>Yt,Options:()=>ps,ParamMetadata:()=>D,Partial:()=>zr,Patch:()=>cs,Path:()=>Qr,Pattern:()=>Zt,Post:()=>ns,Produces:()=>_r,Property:()=>pt,PropertyMetadata:()=>C,Put:()=>is,ReadOnly:()=>er,RecordOf:()=>sr,Redirect:()=>Yr,Required:()=>nr,RequiredGroups:()=>ir,Returns:()=>Gr,Route:()=>ts,Schema:()=>tr,Security:()=>us,SpecTypes:()=>X,Status:()=>hs,Summary:()=>ls,Tags:()=>ms,TimeFormat:()=>Dt,Title:()=>or,TypeError:()=>ar,UniqueItems:()=>ot,Uri:()=>Lt,Url:()=>kt,View:()=>ds,WriteOnly:()=>cr,allOf:()=>Cr,alterIgnore:()=>ce,alterOneOf:()=>Ue,alterRequiredGroups:()=>qe,any:()=>Er,anyMapper:()=>ee,anyOf:()=>vr,array:()=>br,boolean:()=>mr,buildPath:()=>xe,classMapper:()=>te,concatParameters:()=>Ce,concatPath:()=>fs,createRef:()=>Y,createRefName:()=>Q,date:()=>dr,datetime:()=>fr,defineStatusModel:()=>Ir,email:()=>gr,enums:()=>$r,enumsRegistry:()=>a,execMapper:()=>h,formatParameterType:()=>w,from:()=>pr,generateSpec:()=>Ks,genericsMapper:()=>re,getComputedType:()=>d,getGenericsMap:()=>F,getInheritedStores:()=>se,getJsonEntityStore:()=>K,getJsonPathParameters:()=>Pe,getJsonSchema:()=>Fs,getJsonSchemaMapper:()=>u,getJsonType:()=>y,getOperationsRoutes:()=>Ws,getOperationsStores:()=>_e,getProperties:()=>Xs,getPropertiesStores:()=>Vs,getRequiredProperties:()=>Ge,getSpec:()=>vs,getSpecType:()=>xs,getSpecTypeFromSpec:()=>Cs,getStatusConstant:()=>Se,getStatusMessage:()=>be,getStatusModel:()=>jr,hasMapper:()=>l,inheritedClassMapper:()=>ne,inlineEnums:()=>Be,integer:()=>hr,isParameterType:()=>M,isRedirectionStatus:()=>k,isSuccessStatus:()=>L,itemMapper:()=>ie,lazyRef:()=>Pr,lazyRefMapper:()=>oe,map:()=>Rr,mapAliasedProperties:()=>He,mapGenericsOptions:()=>W,mapHeaders:()=>I,mapMapper:()=>ae,mapNullableType:()=>pe,mapOpenSpec:()=>Ms,mapOpenSpec2:()=>$s,mapOpenSpec3:()=>ws,mapOpenSpecInfo:()=>Ps,mapRouteOptions:()=>Zr,matchGroups:()=>Gt,mergeSpec:()=>Ts,number:()=>ur,object:()=>Ar,objectMapper:()=>ue,ofMapper:()=>he,oneOf:()=>xr,oneOfMapper:()=>m,operationIdFormatter:()=>As,operationInFilesMapper:()=>le,operationInParameterMapper:()=>me,operationInParametersMapper:()=>de,operationInQueryMapper:()=>fe,operationMapper:()=>Re,operationMediaMapper:()=>Te,operationRequestBodyMapper:()=>Ee,operationResponseMapper:()=>ve,parameters:()=>Os,pathsMapper:()=>Ie,popGenerics:()=>V,propertiesMapper:()=>je,registerJsonSchemaMapper:()=>p,schemaMapper:()=>Fe,schemesReducer:()=>gs,security:()=>Ss,serializeEnum:()=>g,serializeEnumValues:()=>O,set:()=>Tr,string:()=>lr,tagsReducer:()=>bs,time:()=>yr,toJsonMapCollection:()=>j,toJsonRegex:()=>S,toRef:()=>Z,transformInformation:()=>Gs,transformSecurity:()=>qs,transformToOS2:()=>Bs,uri:()=>Or,url:()=>Sr,withErrorMsg:()=>tt});var e=n(803);const t=new Map;class r{propertyKey;propertyName;index;descriptor;decoratorType;collectionType;token;store;isStore=!0;parent;target;_type;_schema;constructor(e){const{target:t,propertyKey:r,descriptor:s,index:n,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=String(r),this.descriptor=s,this.index=n,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get targetName(){return(0,e.nameOf)(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return(0,e.isArrayOrArrayClass)(this.collectionType)}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.target).find((e=>r.from(e).schema.isDiscriminator));return t&&r.from(t)}get isPrimitive(){return(0,e.isPrimitiveOrPrimitiveClass)(this._type)}get isDate(){return(0,e.isDate)(this.computedType)}get isObject(){return(0,e.isObject)(this.computedType)}get isClass(){return(0,e.isClass)(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){return this.schema.isDiscriminator&&this.discriminatorAncestor?.schema.discriminator().base!==this.target}static from(...r){if(r[0].isStore)return r[0];const s=r[0];r.length>1&&(r[0]=(0,e.prototypeOf)(r[0]));const n=e.Store.from(...r);if(!n.has("JsonEntityStore")){const i=(0,e.decoratorTypeOf)(r),o=t.get(i);if(!o)throw Error("Unsupported json entity type");const a=new o({store:n,decoratorType:i,target:(0,e.classOf)(s),propertyKey:r[1],index:"number"==typeof r[2]?r[2]:void 0,descriptor:"object"==typeof r[2]?r[2]:void 0});a.build(),n.set("JsonEntityStore",a)}return n.get("JsonEntityStore")}static fromMethod(t,r){return this.from(t,r,(0,e.descriptorOf)(t,r))}static get(t,s,n){return r.from((0,e.prototypeOf)(t),s,n)}isGetterOnly(){return(0,e.isObject)(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,t){return this.store.get(e,t)}set(e,t){return this.store.set(e,t)}toString(){return[this.targetName,this.propertyName,this.index].filter((e=>void 0!==e)).join(":")}buildType(t){(0,e.isCollection)(t)?this.collectionType=t:(this._type=t,this._type&&(0,e.isPlainObject)(this._type)&&(this._type=String))}getBestType(){return this.itemSchema.hasDiscriminator?this.itemSchema.discriminator().base:(0,e.isClassObject)(this.type)?this.itemSchema.getTarget():(0,e.isArrowFn)(this.type)?this.type():this.type}}function s(e,t,r,s){var n,i=arguments.length,o=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(i<3?n(o):i>3?n(t,r,o):n(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function o(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create,Object.create;const a=new Map,c=new Map;function p(e,t){return c.set(e,t)}function u(e){if(!c.has(e))throw new Error(`JsonSchema ${e} mapper doesn't exists`);return c.get(e)}function h(e,t,r,s){return u(e)(t,r,s)}function l(e){return c.has(e)}function m(...e){return e.find((e=>c.has(e)))}function d(t){return(0,e.isPromise)(t)||t===Function?Object:(0,e.isClass)(t)||(0,e.isSymbol)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(0,e.isClassObject)(t)||(0,e.isDate)(t)||(0,e.isCollection)(t)?(0,e.classOf)(t):(0,e.isArrowFn)(t)?t():t}const f=["string","number","integer","boolean","object","array","null","any"];function y(t){return null===t?"null":(0,e.isPrimitiveOrPrimitiveClass)(t)?f.indexOf(t)>-1?t:"string"==typeof t?"file"===t?"file":"generic":(0,e.primitiveOf)(t):t===Array?"array":(0,e.isArray)(t)?t.map(y):t===Set?"array":(0,e.isDate)(t)||(0,e.isBuffer)(t)?"string":"object"}const g=t=>(0,e.isObject)(t)&&null!==t?Object.entries(t).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):t;function O(t){const r=t.reduce(((e,t)=>e.concat(g(t))),[]),s=r.reduce(((e,t)=>e.add((e=>null===e?"null":typeof e)(t))),new Set);return{values:(0,e.uniq)(r),types:s}}function S(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class b{propertyName;base;values=new Map;types=new Map;constructor({base:t,propertyName:r,types:s,values:n}={}){Object.assign(this,(0,e.cleanObject)({base:t,propertyName:r,types:s?new Map(s):void 0,values:n?new Map(n):void 0}))}add(e,t){return t.forEach((t=>{this.values.set(t,e)})),this.types.set(e,t),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const t=this.types.get(e);return t?t[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function R(e){return e instanceof A?e:Object.entries(e).reduce(((e,[t,r])=>(e[S(t)]=T(r),e)),{})}function T(t){return(0,e.isArray)(t)?t.map(T):t.isStore||t.$isJsonDocument||t.isLazyRef?t:(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?r.from(t).schema:(0,e.isObject)(t)?A.from(t):(0,e.isPrimitiveClass)(t)?A.from({type:t}):t}class A extends Map{$kind="schema";$isJsonDocument=!0;$hooks=new e.Hooks;$required=new Set;$allow=[];$selfRequired;$forwardGroups=!1;$ignore=!1;isDiscriminatorKey=!1;isDiscriminator=!1;#e=!1;#t=null;#r;#s=[];#n=new Map;#i;#o;#a=!1;#c=!1;#p=!1;constructor(e={}){super(),e&&this.assign(e)}get alias(){return this.#n}get nestedGenerics(){return this.#s}set nestedGenerics(e){this.#s=e}get genericLabels(){return this.#r}set genericLabels(e){this.#r=e}get isClass(){return(0,e.isClass)(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes(this.#o)}get isCollection(){return this.#c}get isGeneric(){return this.#a}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.#o).find((e=>r.from(e).schema.isDiscriminator));return t&&r.from(t).schema}get hasGenerics(){return!(!this.nestedGenerics||!this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return this.#p}get isNullable(){return this.#e||this.$allow.includes(null)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!this.#t}static from(e={}){return new A(e)}nullable(e){this.#e=e}itemSchema(e={}){return this.#i=this.#i||T(e),this.#i.assign(e),this.#i}getAliasOf(e){return this.#n.get(e)}addAlias(e,t){return this.#n.set(e,t),this.#n.set(t,e),this}removeAlias(e){const t=this.#n.get(e);return t&&this.#n.delete(t),this.#n.delete(e),this}$id(e){return super.set("$id",e),this}$ref(e){return super.set("$ref",e),this}$schema(e){return super.set("$schema",e),this}label(e){return this.#p=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){return"boolean"!=typeof e&&this.$hooks.on("ignore",e),this.$ignore=e,this}default(e){return super.set("default",e),this}const(e){return super.set("const",e),this}description(e){return super.set("description",e),this}discriminator(){return this.isDiscriminator=!0,this.#t=this.#t||new b({base:this.#o})}discriminatorKey(e){return this.discriminator().propertyName=e,this.isDiscriminator=!0,this}discriminatorValue(...e){const t=this.discriminatorAncestor.discriminator();t.add(this.#o,e),this.isDiscriminator=!0;const r=this.get("properties"),s=r[t.propertyName]||new A({type:"string"});return 1===e.length?(s.const(e[0]),s.examples([e[0]])):(s.enum(...e),s.examples(e)),r[t.propertyName]=s,this.set("properties",r),this}additionalItems(e){return super.set("additionalItems",T(e)),this}contains(e){return super.set("contains",T(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#i=T(e)),this}maxItems(e){return super.set("maxItems",e),this}minItems(e){return super.set("minItems",e),this}uniqueItems(e){return super.set("uniqueItems",e),this}maxProperties(e){return super.set("maxProperties",e),this}minProperties(e){return super.set("minProperties",e),this}allow(...e){return this.$allow.push(...e),this}required(t=!0){if(!(0,e.isArray)(t)){const e=this.clone();return e.$selfRequired=t,e}return this.$required.clear(),t.forEach((e=>this.$required.add(e))),this}addRequired(e){return this.$required.add(e),this}removeRequired(e){return this.$required.delete(e),this}isRequired(e){return this.$required.has(e)}properties(e){return super.set("properties",R(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",R(r)),this}patternProperties(e){return super.set("patternProperties",R(e)),this}additionalProperties(e){return super.set("additionalProperties",T(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",R(e)),this}propertyNames(e){return super.set("propertyNames",T(e)),this}enum(e,...t){if(a.has(e))return this.enum(a.get(e));if(e instanceof A)e.getName()?super.set("enum",e):super.set("enum",e.get("enum")).any(...e.getJsonType());else{const{values:r,types:s}=O([e,t].flat());super.set("enum",r).any(...s)}return this}definitions(e){return super.set("definitions",R(e)),this}allOf(e){return super.set("allOf",e.map(T)),this}anyOf(e){return super.set("anyOf",e.map(T)),this}oneOf(e){let t=e.map(T);if(1===t.length&&!(e[0]instanceof A)){if(!t[0].hasDiscriminator)return this.type(e[0]);const r=t[0].discriminator().children();if(!r.length)return this.type(e[0]);t=r.map(T)}super.set("oneOf",t);const r=t[0];if(r.isDiscriminator){const e=r.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t}),this.isDiscriminator=!0,this.#t=e}return this}not(e){return super.set("not",T(e)),this}multipleOf(e){return super.set("multipleOf",e),this}maximum(e){return super.set("maximum",e),this}exclusiveMaximum(e){return super.set("exclusiveMaximum",e),this}minimum(e){return super.set("minimum",e),this}exclusiveMinimum(e){return super.set("exclusiveMinimum",e),this}maxLength(e){return super.set("maxLength",e),this}minLength(e){return super.set("minLength",e),this}pattern(e){return super.set("pattern",S(e)),this}format(e){return super.set("format",e),this}type(t){switch(t){case Map:super.set("type",y(t)),this.#o=t,this.#c=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case Array:super.set("type",y(t)),this.#o=t,this.#c=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case Set:super.set("type",y(t)),this.#o=t,this.#c=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":super.set("type",y(t)),this.integer();break;case Object:case Date:case Boolean:case Number:case String:super.set("type",y(t)),this.#o=t,this.has("properties")||super.set("properties",{});break;default:if((0,e.isClass)(t)||(0,e.isFunction)(t))super.set("type",void 0),this.#o=t,this.has("properties")||super.set("properties",{});else{const e=y(t);"generic"===e?(this.#a=!0,super.set("$ref",t)):super.set("type",e)}}return this}any(...t){return t.filter((t=>(0,e.isClass)(t))).length>=2?this.oneOf(t.filter((e=>null!==e&&(this.nullable(!0),!0)))):(t.length?(t=(0,e.uniq)(t).map(y)).includes("null")&&(this.nullable(!0),t=t.filter((e=>"null"!==e))):(t=["integer","number","string","boolean","array","object"],this.nullable(!0)),this.type(1===t.length?t[0]:t)),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(e){return super.set("title",e),this}readOnly(e){return super.set("readOnly",e),this}writeOnly(e){return super.set("writeOnly",e),this}customKey(e,t){return super.set(`#${e}`,t),this}toObject(e){return this.toJSON(e)}toJSON(e){return h("schema",this,e)}assign(e={}){return(e instanceof A?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof A&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),e.$required.forEach((e=>{this.$required.add(e)})),this.#t=this.#t?new b(this.#t):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#p=e.#p,this.#n=new Map(this.#n.entries()),e.#r&&(this.#r=[...e.#r]),this.#s=e.#s.map((e=>[...e])),this.#o=e.#o,this.#a=e.#a,this.#c=e.#c,this.#p=e.#p,super.set("type",e.get("type"))),this}set(t,r){return t in this?(0,e.isFunction)(this[t])&&this[t](r):super.set(t,r),this}getComputedType(){return d(this.#o)}getComputedItemType(){return this.#i?this.#i.getComputedType():this.getComputedType()}getJsonType(){return this.get("type")||y(this.getComputedType())}getTarget(){return this.#o}getName(){return this.get("name")||((0,e.isClass)(this.#o)?(0,e.nameOf)((0,e.classOf)(this.getComputedType())):"")}clone(){return new A(this)}}function E(e){return r=>{t.set(e,r)}}let v=class extends r{children=new Map;get path(){return this.store.get("path","/")}set path(e){this.store.set("path",e)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=A.from({type:this.type})}};v=s([E(e.DecoratorTypes.CLASS)],v);let x=class extends r{parent=r.from(this.target);get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(e){e?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){this._type||this.buildType(e.Metadata.getType((0,e.prototypeOf)(this.target),this.propertyKey)),this._type=this._type||Object;let t=this.parent.schema.get("properties")[this.propertyName];t||(this.parent.children.set(this.propertyName,this),t=A.from({type:this.collectionType||this.type}),this.collectionType&&t.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}static get(t,s){return r.from((0,e.prototypeOf)(t),s)}};x=s([E(e.DecoratorTypes.PROP)],x);const C=x;class P extends Map{$kind="map";$isJsonDocument=!0;constructor(e={}){super(),this.assign(e)}assign(t={}){return Object.entries(t).forEach((([t,r])=>{(0,e.isFunction)(this[t])?this[t](r):this.set(t,r)})),this}toJSON(e){return h("map",this,e)}}var $;function w(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function M(e){return Object.values($).includes(w(e))}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}($||($={}));class _ extends P{$kind="operationInParameter";nestedGenerics=[];groups;groupsName;$schema;expression;getName(){const e=this.get("name");return"files"===this.get("in")?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,t=""){return this.set("in",w(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return this.$schema=e,this}toJSON(e){return h("operationInParameter",this,e)}}let N=class extends r{paramType;expression;dataPath;pipes;parameter=new _;parent=r.fromMethod(this.target,this.propertyKey);constructor(e){super(e),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(e){this.parameter.nestedGenerics=e}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.$allow}static getParams(t,s){const n=[],i=(0,e.ancestorsOf)(t).reverse().find((t=>(0,e.isMethodDescriptor)(t,s)&&r.fromMethod(t,s).children.size));return i?(r.fromMethod(i,s).children.forEach(((e,t)=>{n[+t]=e})),n):[]}static get(t,s,n){return r.from((0,e.prototypeOf)(t),s,n)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}getSchema(t){return(0,e.isCollection)(t)||!(0,e.isClass)(t)?A.from({type:t}):r.from(t).schema}build(){if(!this._type){const t=e.Metadata.getParamTypes((0,e.prototypeOf)(this.target),this.propertyKey)[this.index];this.buildType(t)}this._type=this._type||Object,this._schema||(this.parent.children.set(this.index,this),this._schema=this.getSchema(this.collectionType||this.type),this.parameter.schema(this._schema),this.collectionType&&this._schema.itemSchema(this.getSchema(this.type)),this.parent.operation.addParameter(this.index,this.parameter))}};N=s([E(e.DecoratorTypes.PARAM),o("design:paramtypes",[Object])],N);const D=N,L=e=>Number(e)&&200<=Number(e)&&Number(e)<300,k=e=>Number(e)&&300<=Number(e)&&Number(e)<400;function I(t){return Object.keys(t).reduce(((r,s)=>{const n=t[s];let i=typeof n,o={example:n};return"object"===i&&(o=n,o.example=void 0===o.value?o.example:o.value,delete o.value,i=typeof o.example),o.type=o.type||i,r[s]=(0,e.cleanObject)(o),r}),{})}function j(e,t=P){return Object.entries(e).reduce(((e,[r,s])=>(e.set(r,new t(s)),e)),new P)}class H extends P{$kind="operationMedia";groups=[];groupsName;allowedGroups;schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}}class q extends P{$kind="operationResponse";status;constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",I(e)),this}content(e){return this.set("content",j(e,H)),this}getContent(){return this.get("content")}getMedia(e,t=!0){return t&&this.addMedia(e),this.getContent()?.get(e)}addMedia(e){const t=this.get("content");return t.has(e)||t.set(e,new H),this}}class G extends P{$kind="operation";operationPaths=new Map;#u;#h=!1;constructor(e={}){super({parameters:[],responses:new P,...e})}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return this.#u}tags(e){return super.set("tags",e),this}addTags(t){return t=(0,e.uniqBy)([...this.get("tags")||[],...t],"name"),this.tags(t)}summary(e){return super.set("summary",e),this}operationId(e){return this.set("operationId",e),this}responses(e){return this.set("responses",e),this}defaultStatus(e){return this.#u=e,this}getStatus(){return this.#u||200}setRedirection(e=302){return this.#h=!0,this.#u=e,this}isRedirection(e){return this.#h&&e?k(e):this.#h}addResponse(t,r){if((L(t)||k(t))&&!this.#u){const e=this.getResponseOf(200);this.getResponses().set(t.toString(),e).delete("200"),this.defaultStatus(Number(t))}const s="default"===t?this.getStatus().toString():t.toString(),n=this.getResponses().get(s);return n?(r.forEach(((t,r)=>{["content"].includes(r)||n.set(r,(0,e.deepMerge)(n.get(r),t))})),n.status=Number(s)):(r.status=Number(s),this.getResponses().set(s,r)),this}getResponses(){return this.get("responses")}getResponseOf(e){return("default"===e?this.response:this.getResponses().get(String(e)))||new q}ensureResponseOf(e){return this.addResponse(e,this.getResponseOf(e)),this.getResponseOf(e)}getHeadersOf(e){return this.getResponseOf(e).get("headers")||{}}getContentTypeOf(e){return[...this.getResponseOf(e).get("content").keys()].slice(-1)[0]}security(e){return this.set("security",e),this}addSecurityScopes(t,r){const s=this.get("security")||{};return s[t]=(0,e.uniq)([...s[t]||[],...r]),this.security(s)}description(e){return super.set("description",e),this}deprecated(e){return super.set("deprecated",e),this}parameters(e){return super.set("parameters",e),this}addParameter(e,t){-1===e&&(e=this.get("parameters").length),this.get("parameters")[e]=t}consumes(e){return super.set("consumes",e),this}produces(e){return super.set("produces",e),this}addProduce(t){const r=(0,e.uniq)([].concat(this.get("produces"),t)).filter(Boolean);this.set("produces",r)}addOperationPath(e,t,r={}){return this.operationPaths.set(String(e)+String(t),{...r,method:e,path:t}),this}}let U=class extends r{parent=r.from(this.target);middlewares=[];beforeMiddlewares=[];afterMiddlewares=[];operation=new G;children=new Map;constructor(t){super({store:e.Store.fromMethod(t.target,t.propertyKey),descriptor:(0,e.descriptorOf)(t.target,t.propertyKey),...t});const{beforeMiddlewares:r=[],middlewares:s=[],afterMiddlewares:n=[]}=t;this.after(n),this.before(r),this.use(s)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(e){this.store.set("view",e)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(e){this.store.set("acceptMimes",e)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(t,s,n){return n=n||(0,e.descriptorOf)((0,e.prototypeOf)(t),s),r.from((0,e.prototypeOf)(t),s,n)}getResponseOptions(e,{contentType:t="application/json",includes:r}={}){const s=this.operation.getResponseOf(e).getMedia(t,!1);if(s&&s.has("schema")){const e=s.get("schema");let t=s.groups;return r&&s.allowedGroups?.size&&(t=[...t||[],...r.filter((e=>s.allowedGroups.has(e)))]),{type:e.getComputedItemType(),groups:t}}return{type:this.type}}before(t){return this.beforeMiddlewares=this.beforeMiddlewares.concat(t).filter(e.isFunction),this}after(t){return this.afterMiddlewares=this.afterMiddlewares.concat(t).filter(e.isFunction),this}use(t){return this.middlewares=this.middlewares.concat(t).filter(e.isFunction),this}get(t){const r=e.Store.from(this.target).get(t);return(0,e.deepMerge)(r,this.store.get(t))}getParamTypes(){return[...this.children.values()].reduce(((e,t)=>({...e,[t.paramType]:!0})),{})}build(){if(!this._type){let t=e.Metadata.getReturnType(this.target,this.propertyKey);t=(0,e.isPromise)(t)?void 0:t,this.buildType(t)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),(0,e.isCollection)(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=A.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}};U=s([E(e.DecoratorTypes.METHOD),o("design:paramtypes",[Object])],U);const B=U;function K(...e){return r.from(...e)}t.set(e.DecoratorTypes.CLASS,v),t.set(e.DecoratorTypes.PROP,x),t.set(e.DecoratorTypes.PARAM,N),t.set(e.DecoratorTypes.METHOD,U);class J{getType;isLazyRef=!0;constructor(e){this.getType=e}get target(){return this.getType()}get schema(){return K(this.getType()).schema}get name(){return(0,e.nameOf)(this.getType())}}function F(e,t){return e.reduce(((e,r,s)=>e.set(r,t[s])),new Map)}function W(e){if(e.genericLabels&&e.genericTypes){const{genericLabels:t,genericTypes:r,...s}=e;return{...s,generics:F(t,r)}}return e}function V(e){const[t,...r]=e.nestedGenerics;return{genericTypes:t,nestedGenerics:r}}var X,z=n(598);function Q(e,t){return t.groups&&t.groups.length?(0,z.pascalCase)(`${e} ${t.groupsName||t.groups.join(" ")}`):e}function Y(t,r,s){const n=function(e){const{host:t="#/"+("openapi3"===e.specType?"components/schemas":"definitions")}=e;return t}(s),i={$ref:`${n}/${t}`},o=r.isNullable,a=r.isReadOnly,c=r.isWriteOnly;if(o||a||c)switch(s.specType){case X.OPENAPI:return(0,e.cleanObject)({nullable:!!o||void 0,readOnly:!!a||void 0,writeOnly:!!c||void 0,oneOf:[i]});case X.JSON:return(0,e.cleanObject)({readOnly:a,writeOnly:c,oneOf:[i]})}return i}function Z(e,t,r){const s=Q(e.getName(),r);return r.schemas[s]=t,Y(s,e,r)}function ee(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof J)return h("lazyRef",e,t);if(e instanceof A&&e.get("enum")instanceof A){const r=e.get("enum");return Z(r,r.toJSON(t),t)}if(e.$kind&&e.$isJsonDocument){const r=h(m(e.$kind,"map"),e,W(t));return e.canRef?Z(e,r,t):r}return h("object",e,t)}function te(e,t){const s=r.from(e.class),n=Q(s.schema.getName()||e.getName(),t);if(e.hasGenerics){const{type:r,properties:n,additionalProperties:i,items:o,...a}=e.toJSON(t),c={...h("any",s.schema,{...t,...V(e),root:!1}),...a};if(c.title){const r=Q(c.title,t);return t.schemas[r]=c,delete c.title,Y(r,e,t)}return c}return t.schemas&&!t.schemas[n]&&(t.schemas[n]={},t.schemas[n]=h("any",s.schema,W({...t,root:!1}))),Y(n,e,t)}function re(t,s){const{generics:n}=s;if(n&&t.$ref&&n.has(t.$ref)){let i=n.get(t.$ref);if((0,e.isPrimitiveClass)(i))return{type:y(i)};if(i===Date)return{type:"string",format:"date-time"};if(i.toJSON)return i.toJSON({...s,generics:void 0});if(i===Object)return{type:"object"};if((0,e.isClass)(i)){const e={class:i};return 0===s.nestedGenerics.length?h("class",e,{...s,generics:void 0}):h("schema",r.from(e.class).schema,{...s,...V(s),root:!1})}}return t}function se(t){const r=t.isStore?t:K(t);return r.$inherited||(r.$inherited=(0,e.ancestorsOf)(r.target).reverse().reduce(((e,t)=>e.set(t,K(t))),new Map)),r.$inherited}function ne(t,{target:r,...s}){const n=Array.from(se(r).entries()).filter((([t])=>(0,e.classOf)(t)!==(0,e.classOf)(r)));if(n.length){const r=n.reduce(((t,[,r])=>(0,e.deepMerge)(t,h("schema",r.schema,s))),{});t=(0,e.deepMerge)(r,t)}return t}function ie(e,t){return e&&e.isClass?h("class",e,t):h("any",e,t)}function oe(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return Y(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const s=e.getType()&&h("schema",e.schema,W(t));return Z(e.schema,s,t)}function ae(e,{ignore:t=[],...r}={}){return r=W(r),Array.from(e.entries()).reduce(((e,[s,n])=>(t.includes(s)||(e[s]=h("item",n,r)),e)),{})}function ce(t,r){if((0,e.isBoolean)(t.$ignore)&&t.$ignore)return!0;let s=t?.$hooks?.alter("ignore",!1,[r]);return s||(!1!==r.groups?t?.$hooks?.alter("groups",!1,[r.groups]):s)}function pe(t,r,s){if(!r?.isNullable)return t;let n=[].concat(t.type).filter(Boolean);switch(s.specType){default:case X.JSON:t.discriminator||(t.oneOf?function(e){return e.oneOf.find((e=>"null"===e.type))}(t)||t.oneOf.unshift({type:"null"}):t.type=(0,e.uniq)(["null",...n]));break;case X.OPENAPI:t.nullable=!0,t.oneOf||(n.length>1?(t.oneOf=n.map((e=>({type:e}))),delete t.type):t.type=n[0])}return t}function ue(t,r){const{specType:s,operationIdFormatter:n,root:i,schemas:o,genericTypes:a,nestedGenerics:c,useAlias:p,genericLabels:u,...l}=r;return Object.entries(t).reduce(((e,[s,n])=>{if(!1!==r.withIgnoredProps&&!ce(n,l)){const i={...r,groups:t?.$forwardGroups||n?.$forwardGroups?r.groups:void 0};e[s]=h("item",n,i),e[s]=pe(e[s],n,i)}return e}),(0,e.isArray)(t)?[]:{})}function he(e,t,r){return e.map((e=>h("item",e,{...t,genericLabels:r.genericLabels})))}function le(t,{jsonSchema:r}){const s={type:"string",format:"binary",oneOf:void 0};return"array"===r.type?(r.items=(0,e.cleanObject)({...r.items,...s}),t.schema=r,t):(t.schema=(0,e.cleanObject)({...r,...s}),t)}function me(e,t){const r=function(e,t={}){return{...t,groups:e.groups,groupsName:e.groupsName}}(e,t),s={...r.schemas||{}},{type:n,schema:i,...o}=h("map",e,r),a=h("item",e.$schema,{...r,...V(e)});o.required=o.required||e.get("in")===$.PATH;const c={...r,jsonSchema:a,jsonParameter:e,oldSchemas:s},p=(0,z.camelCase)(`operationIn ${e.get("in")}`);return l(p)?h(p,o,c):(o.schema=a,o)}function de(e,t){return e.flatMap((e=>h("operationInParameter",e,t))).filter(Boolean)}function fe(t,{jsonSchema:r,jsonParameters:s,...n}){if(r.$ref){if(!t.name)return function(t,{jsonParameter:r,...s}){const n=Q(r.$schema.getName(),s),i=s.schemas?.[n];return i&&!s.oldSchemas?.[n]&&delete s.schemas[r.$schema.getName()],Object.entries(i?.properties||{}).reduce(((r,[s,{description:n,...o}])=>[...r,(0,e.cleanObject)({...t,name:s,required:(i?.required||[]).includes(s),description:n,schema:o,style:o.$ref?"deepObject":void 0})]),[])}(t,n);t.style="deepObject"}return t.schema=r,t}!function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3"}(X||(X={})),p("any",ee),p("class",te),p("generics",re),p("inheritedClass",ne),p("item",ie),p("lazyRef",oe),p("map",ae),p("object",ue),p("anyOf",he),p("allOf",he),p("oneOf",he),p("operationInFiles",le),p("operationInParameter",me),p("operationInParameters",de),p("operationInQuery",fe);var ye=n(203),ge=n.n(ye);const Oe=ge().codes.reduce(((e,t)=>{const r=String(ge()(t));return{...e,[String(t)]:{label:r,code:(0,z.constantCase)(r)}}}),{});function Se(e){return Oe[e]?.code}function be(e){return Oe[e]?.label}function Re(e,{tags:t=[],defaultTags:r=[],...s}={}){const{consumes:n,produces:i,...o}=h("map",e,{...s,ignore:["parameters"]});o.security&&(o.security=[].concat(o.security)),0===e.get("responses").size&&(o.responses={200:{description:be(200)}});const a={...s,consumes:e.get("consumes")?.length?e.get("consumes"):["application/json"]},[c,p]=function(e,t){return e.get("parameters").filter((e=>M(e.get("in")))).reduce(((e,t)=>{const[r,s]=e;return[$.BODY,$.FILES].includes(t.get("in"))?[r,[...s,t]]:[[...r,t],s]}),[[],[]])}(e);o.parameters=h("operationInParameters",c,s),p.length&&(o.requestBody=h("operationRequestBody",p,a));const u=o.tags?.length?o.tags:r;return u.length&&(o.tags=u.map((({name:e})=>e))),t.push(...u),o}function Te(e,t){return h("map",e,{...t,groups:[...e.groups||[]],groupsName:e.groupsName})}Oe[200].label="Success",Oe[200].code="SUCCESS",p("operation",Re),p("operationMedia",Te);class Ae extends P{$kind="operationRequestBody";constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",j(e)),this}addContent(e,t,r){const s=this.get("content"),n=new P;return n.set("schema",t),r&&n.set("examples",r),s.set(e,n),this}required(e){return this.set("required",e),this}}function Ee(e,{consumes:t,...r}){const{schema:s,examples:n,in:i,...o}=function(e,t){let r=new A;const s={},n=[];let i=0;return e.forEach((e=>{const o=e.getName();[...e.entries()].filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===s[e]&&(s[e]=t)}));const a=h("operationInParameter",e,t);o?(r.addProperty(o,a.schema||{type:a.type}),e.get("required")&&r.addRequired(o),i++):n.push(a)})),i||1!==n.length?(r.type("object"),{schema:r.toJSON(t),required:!1,...s}):n[0]}(e,r),a=new Ae(o);return t.forEach((e=>{a.addContent(e,s,n)})),h("map",a,r)}function ve(e,t={}){const r=h("map",e,t);return 204===e.status&&delete r.content,r.headers&&Object.entries(r.headers).forEach((([e,{type:t,...s}])=>{r.headers[e]={...s,schema:{type:t}}})),r}function xe(e){return e.split("/").filter(Boolean).join("/")}function Ce(e,t){return e.map((e=>t.parameters.find((t=>t.in===e.in&&t.name===e.name))||e)).concat(...t.parameters.filter((e=>"path"!==e.in)))}function Pe(e,t=""){t instanceof RegExp&&(t=t.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const r=[],s=[];let n=!1,i="";return function(e){let t=0;return e.split("").filter((e=>{"("===e&&t++;const r=0===t;return")"===e&&t--,r})).join("").split("/").filter((e=>!!e))}(`${e}${t}`).map((e=>{const t=e.replace(":","").replace("?","");if(e.includes(":")){const o=e.includes("?");o&&!n&&(n=!0,s.push({path:i,parameters:[].concat(r)}));const{prefix:a,name:c,postfix:p}=function(e){const[t,r]=e.split("="),s=(r||t).split(".");return{prefix:r&&t?`${t}=`:"",name:s.splice(0,1)[0],postfix:s.length?`.${s.join(".")}`:""}}(t);i+=`/${a}{${c}}${p}`,r.push({in:"path",name:c,type:"string",required:!0}),o&&n&&s.push({path:i,parameters:[].concat(r)})}else i+=`/${e}`})),s.length?s:[{path:i,parameters:[].concat(r)}]}p("operationRequestBody",Ee),p("operationResponse",ve);const $e=["all","checkout","connect","copy","delete","get","head","lock","merge","mkactivity","mkcol","move","m-search","notify","options","param","patch","post","propfind","propatch","purge","put","report","search","subscribe","trace","unlock","unsuscribe"];var we;!function(e){e.ALL="ALL",e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.HEAD="HEAD",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.CUSTOM="CUSTOM"}(we||(we={}));class Me extends Map{$kind="operationPaths";$isJsonDocument=!0;setOperationPath(e){if(e.method!==we.CUSTOM){const t=this.getKey(e.method,e.path);this.set(t,e)}}getKey=(e,t)=>`${e}-${t}`}function _e(e){const t=e.isStore?e:K(e);if(!t.$operations){const e=new Me;t.$operations=new Map,se(t).forEach((e=>{e.children.forEach((e=>{e instanceof U&&!t.$operations.has(e.propertyKey)&&t.$operations.set(e.propertyKey,e)}))})),t.$operations.forEach((t=>{t.operation.operationPaths.forEach((t=>{e.setOperationPath(t)}))})),e.clear()}return t.$operations}function Ne(e,{store:t,operationIdFormatter:r}){return r(t.parent.schema.get("name")||t.parent.targetName,t.propertyName,e)}function De(e,{path:t,method:r,operation:s}){return{...e,[t]:{...e[t],[r.toLowerCase()]:s}}}function Le(e){return!e.store.get("hidden")}function ke({operationStore:e,operation:t}){return[...e.operation.operationPaths.values()].map((r=>({...r,operationStore:e,operation:t}))).filter((({method:e})=>e))}function Ie(e,{paths:t,rootPath:r,...s}){const n=xe(r+K(e).path);return s={...s,ctrlRootPath:n},[..._e(e).values()].filter(Le).map(function(e){return t=>({operation:h("operation",t.operation,e),operationStore:t})}(s)).flatMap(ke).flatMap(function(e){return({path:t,method:r,operation:s,operationStore:n})=>Pe(e.ctrlRootPath,t).map((({path:t,parameters:i})=>(t=t||"/",i=Ce(i.map((({type:e,...t})=>({...t,schema:{type:e}}))),s),{operation:{...s,parameters:i,operationId:s.operationId||Ne(t,{...e,store:n})},method:r,path:t})))}(s)).reduce(De,t)}function je(e,t,r){return e.isClass?h("class",e,t):h("any",e,{...t,genericLabels:r.genericLabels})}function He(e,t){return Object.entries(e).reduce(((e,[r,s])=>(e[r=t.get(r)||r]=s,e)),{})}function qe(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function Ge(t,r,s){if(s.groups&&s.groups.includes("partial"))return t.discriminator?{...t,required:[t.discriminator.propertyName]}:t;let n=function(t,r,s){let n=t.required||[];return n=[...n,...r.$required],r.get("properties")&&(n=Object.entries(r.get("properties")).reduce(((e,[t,r])=>r&&void 0!==r.$selfRequired?r.$selfRequired?e.concat(t):e.filter((e=>e===t)):e),n)),qe((0,e.uniq)(n),r,s)}(t,r,s);return n=(0,e.uniq)(n).reduce(function(e,t,r={}){const{useAlias:s}=r,n=Object.keys(e.properties||{});return(r,i)=>{const o=s&&t.alias.get(i)||i;if(n.includes(o)){const s=t.get("properties")[i],n=e.properties[o];return e.properties[o]=function(e,t){if(!t?.$allow.includes("")&&[].concat(t?.get("type")).includes("string")){const t=e?.minLength;if(void 0===t)return{...e,minLength:1}}return e}(n,s),r.concat(o)}return r}}(t,r,s),[]),t.discriminator&&n.push(t.discriminator.propertyName),n.length?{...t,required:n}:t}function Ue(e,t,r){return e.oneOf&&!1!==r.groups&&(e={...e,oneOf:t.$hooks.alter("oneOf",e.oneOf,[r.groups])}),!(e.oneOf||e.allOf||e.anyOf)||e.items||e.properties||delete e.type,e}function Be(e,t,r){return r.inlineEnums&&e.enum?.$isJsonDocument&&(e.enum=e.enum.toJSON().enum),e.enum&&(e.type="object"===e.type||void 0===e.type?"string":e.type),e}p("paths",Ie),p("properties",je),p("items",je),p("additionalProperties",je),p("propertyNames",je),p("contains",je),p("dependencies",je),p("patternProperties",je),p("additionalItems",je),p("not",je),p("definitions",je);const Ke=["name","$required","$hooks","_nestedGenerics",X.OPENAPI,X.SWAGGER,X.JSON],Je=["const"];function Fe(t,r){const{options:s,addDef:n}=function(e){let t=!1;e||(t=!0,e={schemas:{},inlineEnums:!0});const{useAlias:r=!0,schemas:s={}}=e;return{addDef:t,options:e={...e,useAlias:r,schemas:s}}}(r),i=function(t,r){let s=function(t,r){const{useAlias:s}=r;return[...t.keys()].filter((e=>!function(e,{specType:t=X.JSON,customKeys:r=!1}){return Ke.includes(e)||e.startsWith("#")&&(!1===r||t!==X.JSON)||t!==X.JSON&&Je.includes(e)}(e,r))).reduce(((n,i)=>{let o=t.get(i);if("type"===(i=i.replace(/^#/,"")))return{...n,[i]:t.getJsonType()};if(function(t,r,s){return"examples"===t&&(0,e.isObject)(r)&&X.OPENAPI===s.specType}(i,o,r)&&(i="example",o=Object.values(o)[0]),o&&"object"==typeof o&&l(i)){if(o=h(i,o,r,t),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(i,o))return n;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(i,o,s)&&(o=He(o,t.alias))}return{...n,[i]:o}}),{})}(t,r);return t.isClass&&(s=h("inheritedClass",s,{...r,root:!1,target:t.getComputedType()})),s=h("generics",s,{...r,root:!1}),t.has(r.specType)&&(s={...s,...t.get(r.specType).toJSON(r)}),s=Ge(s,t,r),s=pe(s,t,r),s=Ue(s,t,r),s=Be(s,0,r),s}(t,s);return n&&s.schemas&&Object.keys(s.schemas).length&&(i.definitions=s.schemas),i}function We(e){return(...t)=>{const r=e(K(...t),t);"function"==typeof r&&r(...t)}}function Ve(...t){return We((r=>{r.store.set("childrenControllers",t),t.forEach((t=>{e.Store.from(t).set("parentController",r.token)}))}))}function Xe(e,...t){return We((r=>{e=e||(0,z.snakeCase)(r.targetName),r.discriminatorAncestor&&r.schema.discriminatorValue(e,...t)}))}function ze(e,t){if(!e)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const s={};let n=!1;const i=(...i)=>{const o=r.from(...i);t&&(o.collectionType=t,o.schema.type(t)),o.type=e,o.itemSchema.type(e),o.schema.assign(s),o.isArray&&n&&(o.schema.set("contains",o.schema.get("items")),o.schema.delete("items"))};return i.MinItems=e=>(s.minItems=e,i),i.MaxItems=e=>(s.maxItems=e,i),i.MinProperties=e=>(s.minProperties=e,i),i.MaxProperties=e=>(s.maxProperties=e,i),i.Contains=()=>(n=!0,i),i.UniqueItems=(e=!0)=>(s.uniqueItems=e,i),i}function Qe(e){return ze(e,Array)}function Ye(e){return ze(e,Map)}function Ze(e){return ze(e).Contains()}function et(e){return We((t=>{const r=t.parentSchema.get("#errorMessage")||{};t.parentSchema.customKey("errorMessage",{...r,...e})}))}function tt(t,r){const s={};return(...n)=>{const i=(0,e.useDecorators)(r(...n));return i.Error=r=>(s.message=r,(0,e.useDecorators)(i,s.message&&et({[t]:r}))),i}}p("schema",Fe);const rt=tt("maxItems",(e=>{if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return We((t=>{t.schema.maxItems(e)}))})),st=tt("maxProperties",(e=>{if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return We((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))})),nt=tt("minItems",(e=>{if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return We((t=>{t.schema.minItems(e)}))})),it=tt("minProperties",(e=>{if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return We((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))})),ot=tt("uniqueItems",((e=!0)=>We((t=>{t.schema.uniqueItems(e)}))));function at(e){return We(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function ct(...e){return We((t=>{t.itemSchema.allOf(e)}))}function pt(t){return We((r=>{t&&(((0,e.isClass)(t)||(0,e.isArrowFn)(t))&&(r.type=t),r.itemSchema.type(t))}))}function ut(...t){const r=t.find((t=>(0,e.isClass)(t)));return(0,e.useDecorators)(r&&pt(r),We(((r,s)=>{r.schema.allow(...t),r.decoratorType===e.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===e.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName)})))}function ht(...e){return We((t=>{t.itemSchema.any(...e)}))}function lt(...e){return We((t=>{t.itemSchema.anyOf(e)}))}function mt(e){return We((t=>{t.itemSchema.const(e)}))}function dt(e,t){return We((r=>{r.itemSchema.customKey(e,t)}))}function ft(e){return We((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function yt(e){return We((t=>{t.itemSchema.default(e)}))}function gt(t){return(0,e.useDecorators)(et({_:t}))}function Ot(t){return We(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.PROP:case e.DecoratorTypes.CLASS:r.schema.description(t);break;case e.DecoratorTypes.PARAM:r.parameter.description(t);break;case e.DecoratorTypes.METHOD:r.operation?.description(t)}}))}function St(){return(0,e.useDecorators)(pt(),We((e=>{e.discriminatorKey()})))}const bt=tt("enum",(function(e,...t){return We((r=>{r.itemSchema.enum(e,...t)}))}));function Rt(...e){return We((t=>{t.schema.examples(e)}))}function Tt(e){return We((t=>{t.parameter.examples(e)}))}const At=tt("maximum",((e,t=!1)=>We((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)})))),Et=At,vt=tt("exclusiveMaximum",((e,t=!0)=>At(e,t))),xt=tt("minimum",((e,t=!1)=>We((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)})))),Ct=xt,Pt=tt("exclusiveMinimum",((e,t=!0)=>xt(e,t)));var $t;!function(e){e.DATE_TIME="date-time",e.DATE="date",e.TIME="time",e.EMAIL="email",e.HOSTNAME="hostname",e.IPV4="ipv4",e.IPV6="ipv6",e.URI="uri",e.URL="url",e.URI_REF="uri-reference",e.URI_TEMPLATE="uri-template",e.JSON_POINTER="json-pointer",e.RELATIVE_JSON_POINTER="relative-json-pointer",e.UUID="uuid",e.REGEX="regex"}($t||($t={}));const wt=tt("format",(e=>We((t=>{t.itemSchema.format(e)})))),Mt=tt("format",(()=>wt($t.EMAIL))),_t=tt("format",(()=>wt($t.DATE_TIME))),Nt=tt("format",(()=>wt($t.DATE))),Dt=tt("format",(()=>wt($t.TIME))),Lt=tt("format",(()=>wt($t.URI))),kt=tt("format",(()=>wt($t.URL)));function It(e=!0){return We((t=>{t.schema.$forwardGroups=e}))}var jt=n(133),Ht=n.n(jt);function qt(e,t){t=[].concat(t),e=[].concat(e);let r=new Set,s=new Set,n=new Set,i=0,o=e=>{n.add(e.output)};for(let n=0;n<t.length;n++){let a=Ht()(String(t[n]),{onResult:o},!0),c=a.state.negated||a.state.negatedExtglob;c&&i++;for(let t of e){let e=a(t,!0);(c?!e.isMatch:e.isMatch)&&(c?r.add(e.output):(r.delete(e.output),s.add(e.output)))}}return!!(i===t.length?[...n]:[...s]).filter((e=>!r.has(e))).length}function Gt(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),s=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&qt(r,t))||!!s.length&&!qt(e.filter((e=>!e.startsWith("!"))),t)}function Ut(...t){return We((r=>{switch(r.decoratorType){case e.DecoratorTypes.CLASS:!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{Ut(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(t,r);break;case e.DecoratorTypes.PROP:r.schema.$hooks.on("groups",((e,r)=>!(e||!Gt(t,r))||e));break;case e.DecoratorTypes.PARAM:let s="";2==t.length&&(0,e.isArray)(t[1])&&(s=t[0],t=t[1]),r.parameter.groups=t,r.parameter.groupsName=s}}))}function Bt(){return(0,e.StoreSet)("hidden",!0)}function Kt(e=!0){return We((t=>{t.schema.ignore(e)}))}function Jt(){return We((e=>{e.itemSchema.type("integer")}))}const Ft=tt("maxLength",(e=>{if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return We((t=>{t.itemSchema.maxLength(e)}))})),Wt=tt("minLength",(e=>{if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return We((t=>{t.itemSchema.minLength(e)}))})),Vt=tt("multipleOf",(e=>{if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return We((t=>{t.itemSchema.multipleOf(e)}))}));function Xt(t){return We(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.CLASS:r.schema.name(t);break;case e.DecoratorTypes.PARAM:r.parameter.name(t);break;default:r.parent.schema.addAlias(s[1],t)}}))}function zt(t,...r){return r=[t,...r],(0,e.useDecorators)(1===r.length&&pt(r[0]),ht(null,...r))}function Qt(...e){return We((t=>{t.itemSchema.oneOf(e),t.type=Object}))}function Yt(){return We((t=>{switch(t.decoratorType){case e.DecoratorTypes.PARAM:t.required=!1;break;case e.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName)}}))}const Zt=tt("pattern",(e=>We((t=>{t.itemSchema.pattern(e)}))));function er(e=!0){return We((t=>{t.itemSchema.readOnly(e)}))}function tr(e){return We((t=>{Object.entries(e).forEach((([e,r])=>{t.schema.set(e,r)}))}))}function rr(e,t){return We((r=>{r.schema.set(e,t)}))}function sr(e,...t){return tr({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}const nr=tt("required",((e=!0,...t)=>e?ut(...t):Yt()));function ir(...e){return We((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,s)=>Gt(e,s)?r.filter((e=>e!==t.propertyKey)):r))}))}function or(e){return We((t=>{t.schema.title(e)}))}function ar(t){return We((()=>(0,e.useDecorators)(et({type:t}))))}function cr(e=!0){return We((t=>{t.itemSchema.writeOnly(e)}))}function pr(t=Object){if((0,e.isClass)(t)){const{schema:e}=K(t);return e.properties=function(e){return Object.entries(e).forEach((([e,r])=>{K(t.prototype,e).schema.assign(r)})),this},e}return A.from({type:t})}function ur(){return pr(Number)}function hr(){return pr(Number).integer()}function lr(){return pr(String)}function mr(){return pr(Boolean)}function dr(){return pr(Date).format($t.DATE)}function fr(){return pr(Date).format($t.DATE_TIME)}function yr(){return pr(Date).format($t.TIME)}function gr(){return pr(String).format($t.EMAIL)}function Or(){return pr(String).format($t.URI)}function Sr(){return pr(String).format($t.URL)}function br(){return pr(Array)}function Rr(){return pr(Map).unknown(!0)}function Tr(){return pr(Array).uniqueItems(!0)}function Ar(e={}){return pr(Object).properties(e)}function Er(...e){return pr().any(...e)}function vr(...e){return pr().anyOf(e)}function xr(...e){return pr().oneOf(e)}function Cr(...e){return pr().allOf(e)}function Pr(e){try{if(e())return r.from(e()).schema}catch(e){}return new J(e)}function $r(e){const t=lr().enum(e);return a.set(e,t),t}function wr(...t){const s=[t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?lr().enum(Object.values(t)):t))],n=(...e)=>{r.from(...e).nestedGenerics=s};return n.Nested=(...e)=>(s.push(e),n),n}function Mr(...e){return t=>{r.from(t).schema.genericLabels=e}}function _r(...t){return We(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.produces(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],_r(...t));break;default:throw new e.UnsupportedDecoratorType(_r,s)}}))}function Nr(...t){return(0,e.useDecorators)(_r(...t),(0,e.StoreSet)("acceptMimes",t))}function Dr(...t){return We(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.consumes(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],Dr(...t));break;default:throw new e.UnsupportedDecoratorType(Dr,s)}}))}class Lr extends Map{methods;decoratorType;entity;actions=[];constructor(e={}){super(),Object.entries(e).forEach((([e,t])=>{this.set(e,t)}))}addAction(e){return this.actions.push(e),this}build(){const e=(...t)=>this.bind(t,e),t=t=>{return r=(...e)=>{t in this?this[t](...e):this.set(t,e[0])},(...t)=>(r(...t),e);var r};return this.methods.forEach((r=>{e[(0,z.pascalCase)(r)]=t(r)})),e}toObject(){return[...this.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{})}getMergedKey(t,r){let s=this.get(t)||r;if(s)return this.decoratorType===e.DecoratorTypes.CLASS&&(s={...s,...r||{}}),{...r||{},...s}}bind(e,t){this.entity=r.from(...e),this.beforeInit(),this.onInit(e,t),this.afterInit()}onInit(e,t){this.forEach(((e,t)=>{this.onMapKey(t,e)}))}onMapKey(e,t){this.entity.set(e,t)}runActions(){return this.actions.forEach((e=>{e(this)})),this}beforeInit(){}afterInit(){}}const kr=new Map;function Ir(e,t){kr.set(e,t)}function jr(e){return kr.get(e)}function Hr(t){return t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?lr().enum(Object.values(t)):t))}class qr extends Lr{methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location"];constructor({status:e,model:t}){super(),this.model(t),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&be(e)&&!this.get("description")&&(this.set("description",be(e)),this.get("model")||this.model(jr(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...I(e)}),this}header(e,t){return this.headers({[e]:t})}location(e,t={}){return this.headers({Location:{...t,value:e}}),this}groups(...t){return 2===t.length&&(0,e.isArray)(t[1])?(this.set("groupsName",t[0]),this.set("groups",t[1])):this.set("groups",t),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const t=this.get("model");return this.checkPrimitive(t),this.checkCollection(t),this.addAction((t=>{this.get("schema").nestedGenerics.push(Hr(e))})),this}of(...t){const r=this.get("model");return this.checkPrimitive(r),this.addAction((()=>{const s=this.get("schema");(0,e.isCollection)(r)?s?.itemSchema({type:t[0]}):s?.nestedGenerics.push(Hr(t))})),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction((()=>{this.get("schema").assign(e)})),this}examples(t){return this.set("examples",(0,e.isString)(t)?[t]:t),this}title(e){return this.schema({title:e})}checkPrimitive(t){if((0,e.isPrimitiveOrPrimitiveClass)(t))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(t){if((0,e.isCollection)(t))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const t=this.get("model");let r=this.get("contentType");return!t||(0,e.isPlainObject)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(r=r||"application/json"),r}getStatus(){return this.get("status")||"default"}onInit(t,s){switch((0,e.decoratorTypeOf)(t)){case e.DecoratorTypes.METHOD:this.entity=r.from(...t),this.entity.operation&&this.map();break;case e.DecoratorTypes.CLASS:this.decoratorType=e.DecoratorTypes.CLASS,(0,e.decorateMethodsOf)(t[0],s)}}map(){const t=this.get("model"),{entity:r,decoratorType:s}=this,n=this.entity.operation,i=this.getStatus(),o=n.ensureResponseOf(i),a=this.getContentType();let{description:c=o.get("description")}=this.toObject();c&&(c=s===e.DecoratorTypes.CLASS&&o.get("description")||c,o.description(c));const p=this.getMergedKey("headers",o.get("headers"));return p&&o.headers(p),this.mapMedia(o),(L(this.get("status"))||"default"===i)&&t&&(r.type=t),a&&n.addProduce(a),this.runActions()}mapMedia(t){const r=this.getContentType(),s=this.get("model"),n=t.getMedia(r||"*/*"),i=n.get("schema")||new A({type:s}),o=this.get("groups"),a=this.get("groupsName"),c=this.get("allowedGroups"),p=this.entity.operation;if(s&&((0,e.isArray)(s)?i.oneOf(s.map((e=>({type:e})))):i.type(s)),this.set("schema",i),n.schema(i),n.groups=o,n.groupsName=a,c){n.allowedGroups=c;const e=new _;e.in("query").name("includes"),e.schema(A.from({type:"array",items:{type:"string",enum:[...c]}})),p.addParameter(-1,e)}const u=this.get("examples");return u&&n.examples(u),n}manyOf(t,r){const s=this.get("model");return this.addAction((()=>{const n=this.get("schema");(0,e.isCollection)(s)?(n.type(s||Object),n.itemSchema().set(t,r)):n.set(t,r)})),this}}function Gr(e,t){return new qr({status:e,model:t}).build()}function Ur(e){return Gr().ContentType(e)}function Br(t=!0){return We(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.METHOD:r.operation.deprecated(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],Br(t));break;case e.DecoratorTypes.PARAM:r.parameter.set("deprecated",t);break;case e.DecoratorTypes.PROP:r.schema.set("deprecated",t);break;default:throw new e.UnsupportedDecoratorType(Br,s)}}))}function Kr(e,t){return void 0!==t&&(e={[e]:t}),Gr().Headers(e)}function Jr(t){const s=new _,n={},i=(o,a,c)=>{const p=r.from(o,a,c);switch(p.decoratorType){case e.DecoratorTypes.PARAM:p.parameter.in(t);break;case e.DecoratorTypes.METHOD:s.in(t),p.operation.addParameter(-1,s),s.schema(A.from(n));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(o,i);break;default:throw new e.UnsupportedDecoratorType(Jr,[o,a,c])}};return i.Type=e=>(n.type=e,i),i.Name=e=>(s.name(e),i),i.Description=e=>(s.description(e),i),i.Required=(e=!0)=>(s.required(e),i),i.Pattern=e=>i.Schema({pattern:e.toString()}),i.Schema=e=>(Object.assign(n,e),i),i}function Fr(t){return(...r)=>{const[s,n,i]=r,o=e.Metadata.getParamTypes(s,n)[i]===Array,a=[t="object"==typeof t?void 0:t,!o&&"0"].filter(Boolean).join(".");(0,e.useDecorators)(Jr($.FILES),Xt(a),(0,e.useMethodDecorators)(Gr(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),Dr("multipart/form-data")))(...r)}}function Wr(e,t){return Gr().Location(e,t)}function Vr(t){return We(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Vr,s);r.operation.operationId(t)}))}function Xr(t,r="/"){return We(((s,n)=>{if(s.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Xr,n);s.operation.addOperationPath(t.toUpperCase(),r)}))}function zr(){return Ut("partial")}function Qr(t){return We(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.CLASS)throw new e.UnsupportedDecoratorType(Qr,s);r.path=t}))}function Yr(...t){const{status:r,url:s,meta:n}=t.reduce(((t,r)=>(0,e.isNumber)(r)?(t.status=r,t):(0,e.isString)(r)?(t.url=r,t):(t.meta=r,t)),{status:302,url:"",meta:{}});return(0,e.useDecorators)(Gr(r).Location(s,n),We((e=>{e.operation?.setRedirection(r)})))}function Zr(e){let t,r;const s=e.filter((e=>"string"==typeof e&&$e.includes(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:s}}class es extends Lr{methods=["name","description","summary","method","id","use","useAfter","useBefore"];beforeInit(){const e=this.get("path"),t=we[this.get("method")]||we.CUSTOM;e&&this.entity.operation.addOperationPath(t,e)}onMapKey(e,t){switch(e){case"name":case"id":return void this.entity.operation.operationId(t);case"summary":return void this.entity.operation.summary(t);case"description":return void this.entity.operation.description(t);case"use":return void this.entity.use(t);case"useAfter":return void this.entity.after(t);case"useBefore":return void this.entity.before(t)}return super.onMapKey(e,t)}}function ts(...e){const t=Zr(e);return new es(t).build()}function rs(e="/",...t){return ts(...[we.ALL,e].concat(t))}function ss(e="/",...t){return ts(...[we.GET,e].concat(t))}function ns(e="/",...t){return ts(...[we.POST,e].concat(t))}function is(e="/",...t){return ts(...[we.PUT,e].concat(t))}function os(e="/",...t){return ts(...[we.DELETE,e].concat(t))}function as(e="/",...t){return ts(...[we.HEAD,e].concat(t))}function cs(e="/",...t){return ts(...[we.PATCH,e].concat(t))}function ps(e="/",...t){return ts(...[we.OPTIONS,e].concat(t))}function us(t,...r){return We(((s,n)=>{switch(s.decoratorType){case e.DecoratorTypes.METHOD:s.operation.addSecurityScopes(t,r);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],us(t,...r));break;default:throw new e.UnsupportedDecoratorType(us,n)}}))}function hs(e,t){return Gr(e,t)}function ls(t){return We(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(ls,s);r.operation.summary(t)}))}function ms(...t){return We(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.addTags(function(e){return e.map((e=>"string"==typeof e?{name:e}:e))}(t));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],ms(...t));break;default:throw new e.UnsupportedDecoratorType(ms,s)}}))}function ds(t,r){return(0,e.StoreSet)("view",{path:t,options:r})}function fs(e,t){if(e instanceof RegExp||t instanceof RegExp){if(!e)return t;if(!t)return e;const r=e instanceof RegExp?e:new RegExp(e,"gi"),s=t instanceof RegExp?t:new RegExp(t,"gi");return new RegExp(r.source+s.source,(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":""))}e&&t&&e.endsWith("/")&&t.startsWith("/")&&(t=t.slice(1));const r=(e||"")+(t||"");return r.endsWith("/")&&r.length>1?r.slice(0,-1):r}class ys{token;endpoint;operationPath;basePath;paramsTypes;constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){return this.operationPath?.path}get fullPath(){return fs(this.basePath,this.path)}get method(){return this.operationPath?.method||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}const gs=(0,e.mergeReducerBuilder)(((e,t)=>e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),Os=(0,e.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),Ss=(0,e.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),bs=(0,e.mergeReducerBuilder)(((e,t)=>e.name===t.name)),Rs={security:Ss,parameters:Os,oneOf:gs,anyOf:gs,allOf:gs,tags:bs};function Ts(t,r){return(0,e.deepMerge)(t,r,{reducers:Rs,cleanUndefinedProps:!0})}function As(e=""){const t=new Map;return(r,s,n="")=>{const i=((t,r)=>{const s=(e||"%c.%m").replace(/%c/,t).replace(/%m/,r);return""===e?(0,z.camelCase)(s):s})(r,s),o=r+s;if(!t.has(o))return t.set(o,0),i;const a=n.match(/{(\w+)}/gi);if(a){const e=r+s+a[0];if(!t.has(e))return t.set(e,0),(0,z.camelCase)(`${i} By ${a}`)}const c=t.get(o)+1;return t.set(o,c),`${i}_${c}`}}const Es=new Map;function vs(t,r={}){if(r={specType:X.OPENAPI,...r,tags:[],paths:{},schemas:{},operationIdFormatter:r.operationIdFormatter||As(r.operationIdPattern),root:!1},(0,e.isArray)(t)){let e={};return r={...r,append(t){e=Ts(e,t)}},t.forEach((({token:e,...t})=>{const s=vs(e,{...r,...t});r.append(s)})),e}return function(e,t,r){Es.has(e)||Es.set(e,new Map);const s=Es.get(e),n=JSON.stringify(t);return s.has(n)||s.set(n,r()),s.get(n)}(t,r,(()=>function(t,r){const s=K(t),{rootPath:n="/"}=r,i=X.OPENAPI,o={paths:h("paths",t,r={...r,rootPath:n,defaultTags:[(0,e.cleanObject)({name:s.schema.getName(),description:s.schema.get("description")})],specType:i})};return o.tags=(0,e.uniqBy)(r.tags,"name"),Object.keys(r.schemas).length&&(o.components={schemas:r.schemas}),o}(t,r)))}function xs(e){return e.startsWith("3.")?X.OPENAPI:X.SWAGGER}function Cs(e){return"openapi"in e?X.OPENAPI:X.SWAGGER}function Ps(t){const{title:r,description:s,version:n,termsOfService:i,contact:o,license:a}=t;return(0,e.cleanObject)({version:n,title:r,description:s,termsOfService:i,contact:o,license:a})}function $s(t,{version:r,specVersion:s,acceptMimes:n=["application/json"]}){const{paths:i,security:o,tags:a,host:c,basePath:p,schemes:u,consumes:h=[],produces:l=["application/json"],definitions:m,parameters:d,responses:f,securityDefinitions:y,externalDocs:g}=t;return{swagger:s,consumes:(0,e.uniq)([...n,...h]),produces:(0,e.uniq)([...l]),info:Ps((0,e.getValue)(t,"info",{})),paths:i,host:c,basePath:p,schemes:u,definitions:m,parameters:d,responses:f,security:o,securityDefinitions:y,tags:a,externalDocs:g}}function ws(t,{specVersion:r}){const{servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}=t;return{openapi:r,info:Ps((0,e.getValue)(t,"info",{})),servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}}function Ms(t,{fileSpec:r,acceptMimes:s,specVersion:n,version:i}){const o={specVersion:n=n||(0,e.getValue)(t,"openapi",(0,e.getValue)(t,"swagger","2.0")),acceptMimes:s};switch(xs(n)){case X.OPENAPI:t=ws(t,o),r=r?ws(r,o):r;break;default:case X.SWAGGER:t=$s(t,o),r=r?$s(r,o):r}return t=Ts(t,r),(0,e.setValue)(t,"info.title",(0,e.getValue)(t,"info.title","Api documentation")),(0,e.setValue)(t,"info.version",(0,e.getValue)(t,"info.version",i)),t}const _s=["get","put","post","delete","options","head","patch","trace"],Ns=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],Ds=["type","items"],Ls=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,ks={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function Is(e){if(Array.isArray(e))e.forEach(Is);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):Is(e[t])}function js(e){return new RegExp(Ls,"i").test(e)}function Hs(e){const t=Object.keys(ks).map((e=>ks[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||js(e)))}function qs(e){function t(e){const{scheme:t,type:r,name:s,bearerFormat:n,flows:i,...o}=e;switch(r){case"http":if("basic"===t)return{...o,type:t};if("bearer"===t)return{...o,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const e=Object.keys(i)[0],s=i[e];let n=e;return"clientCredentials"===n?n="application":"authorizationCode"===n&&(n="accessCode"),{type:r,flow:n,authorizationUrl:s.authorizationUrl,tokenUrl:s.tokenUrl,scopes:s.scopes}}}return Object.entries(e).reduce(((e,[r,s])=>({...e,[r]:t(s)})),{})}function Gs(e){let t=e.url;const r=e.variables||{};for(const e in r){const s=r[e]||{};if(s.default){const r=RegExp(`{${e}}`,"g");t=t.replace(r,s.default)}}const s=new URL(t);return{host:s.host?s.host:void 0,basePath:s.pathname,schemes:null!==s.protocol?[s.protocol.substring(0,s.protocol.length-1)]:void 0}}class Us{spec;constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?Gs(e):{}}resolveReference(e,t,r){if(!t||!t.$ref)return t;const s=t.$ref;if(s.startsWith("#")){const t=s.split("/").map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~")));t.shift();let n=e;return t.forEach((e=>{n=n[e]})),r?JSON.parse(JSON.stringify(n)):n}}convert(){const t={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,Is(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],(0,e.cleanObject)({...t,...this.spec})}convertOperations(e,t){return Object.entries(e).reduce(((e,[r,s])=>{const n=e[r]=this.resolveReference({...t,paths:e},s,!0);return this.convertParameters(n),Object.keys(n).forEach((r=>{if(_s.indexOf(r)>=0){const s=n[r]=this.resolveReference({...t,paths:e},n[r],!0);this.convertOperationParameters(s),this.convertResponses(s)}})),e}),e)}convertOperationParameters(e){let t,r,s,n;if(e.parameters=e.parameters||[],e.requestBody){let i=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const t=Hs(e.requestBody.content)[0],r={content:{}},s=e.requestBody.content[t];s&&s.schema&&s.schema.$ref&&!s.schema.$ref.startsWith("#")&&(i=this.resolveReference(this.spec,s.schema,!0),r.content[`${t}`]={schema:i},i=r)}if(i.name="body",t=i.content,t&&Object.keys(t).length){if(s=Object.keys(t).filter((e=>e.indexOf("/")>0)),n=s.filter((e=>e.indexOf("*")<0)),r=Hs(t)[0],delete i.content,[ks.APPLICATION_X_WWW_URLENCODED,ks.MULTIPART_FORM_DATA].includes(r))if(e.consumes=n,i.in="formData",i.schema=t[r].schema,i.schema=this.resolveReference(this.spec,i.schema,!0),"object"===i.schema.type&&i.schema.properties){const t=i.schema.required||[];Object.keys(i.schema.properties).forEach((r=>{const s=i.schema.properties[r];if(!s.readOnly){const n={name:r,in:"formData",schema:s};t.indexOf(r)>=0&&(n.required=!0),e.parameters?.push(n)}}))}else e.parameters.push(i);else r?(e.consumes=n,i.in="body",i.schema=t[r].schema,e.parameters.push(i)):s&&(e.consumes=n||["application/octet-stream"],i.in="body",i.name=i.name||"file",delete i.type,i.schema=t[s[0]].schema||{type:"string",format:"binary"},e.parameters.push(i));i.schema&&this.convertSchema(i.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){void 0!==e.parameters&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach(((t,r)=>{if("body"!==(t=e.parameters[r]=this.resolveReference(this.spec,t,!1)).in){if(this.copySchemaProperties(t,Ns),this.copySchemaProperties(t,Ds),this.copySchemaXProperties(t),!t.description){const e=this.resolveReference(this.spec,t.schema,!1);e&&e.description&&(t.description=e.description)}void 0!==t.example&&(t["x-example"]=t.example),delete t.schema,delete t.allowReserved,delete t.example}if("array"===t.type)switch(t.style||("query"===t.in||"cookie"===t.in?"form":"simple")){case"matrix":t.collectionFormat=t.explode?void 0:"csv";break;case"label":t.collectionFormat=void 0;break;case"simple":t.collectionFormat="csv";break;case"spaceDelimited":t.collectionFormat="ssv";break;case"pipeDelimited":t.collectionFormat="pipes";break;case"deepOpbject":t.collectionFormat="multi";break;case"form":t.collectionFormat=!1===t.explode?"csv":"multi"}delete t.style,delete t.explode})))}copySchemaProperties(e,t){let r=this.resolveReference(this.spec,e.schema,!0);r&&t.forEach((t=>{const s=r[t];"additionalProperties"===t&&"boolean"==typeof s||void 0!==s&&(e[t]=s)}))}copySchemaXProperties(e){let t=this.resolveReference(this.spec,e.schema,!0);t&&Object.keys(t).forEach((r=>{Reflect.hasOwnProperty.call(t,r)&&!Reflect.hasOwnProperty.call(e,r)&&r.startsWith("x-")&&(e[r]=t[r])}))}convertResponses(e){Object.keys(e.responses||{}).forEach((t=>{const r=e.responses[t]=this.resolveReference(this.spec,e.responses[t],!0);if(r.content){let t=null,s=null;if(Object.keys(r.content).forEach((n=>{const i=n.indexOf("*")<0?n:"application/octet-stream";e.produces?e.produces.indexOf(i)<0&&e.produces.push(i):e.produces=[i];const o=r.content[n];t=t||o.schema,!s&&js(i)&&(s=o.schema),o.example&&(r.examples=r.examples||{},r.examples[i]=o.example)})),t){r.schema=s||t;const e=this.resolveReference(this.spec,r.schema,!0);e&&r.schema.$ref&&!r.schema.$ref.startsWith("#")&&(r.schema=e),this.convertSchema(r.schema,"response")}}Object.keys(r.headers||{}).forEach((e=>{const t=this.resolveReference(this.spec,r.headers[e],!0);t.schema&&(t.type=t.schema.type,t.format=t.schema.format,delete t.schema),r.headers[e]=t})),delete r.content}))}convertSchema(e,t){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const r in e.allOf)this.convertSchema(e.allOf[r],t);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach((r=>{!0===e.properties[r].writeOnly&&"response"===t?delete e.properties[r]:(this.convertSchema(e.properties[r],t),delete e.properties[r].writeOnly)}));break;case"array":e.items&&this.convertSchema(e.items,t)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),void 0!==e.deprecated&&(void 0===e["x-deprecated"]&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach((e=>{this.convertSchema(this.spec.definitions[e])})),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach((t=>{const r=e[t];if("string"!=typeof r)return void console.warn(`Ignoring ${r} for ${t} in discriminator.mapping.`);let s;if(/^[a-zA-Z0-9._-]+$/.test(r))try{s=this.resolveReference(this.spec,{$ref:`#/components/schemas/${r}`},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} as schema name in discriminator.mapping: ${e}`)}if(!s)try{s=this.resolveReference(this.spec,{$ref:r},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} in discriminator.mapping: ${e}`)}s?(s["x-discriminator-value"]=t,s["x-ms-discriminator-value"]=t):console.warn(`Unable to resolve ${r} for ${t} in discriminator.mapping.`)}))}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=qs(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function Bs(e){return new Us(e).convert()}async function Ks({tokens:t,...r}){const{version:s="1.0.0",acceptMimes:n,specPath:i,specVersion:o}=r,a=Ms((0,e.getValue)(r,"spec",{}),{fileSpec:{},version:s,specVersion:o,acceptMimes:n}),c=Cs(a),p=Ts(a,vs(t,r));return c===X.SWAGGER?Bs(p):p}const Js="$cache:schemes";function Fs(e,t={}){const r=K(e),s=t.specType||X.JSON;return t={endpoint:!0,groups:[],inlineEnums:s===X.JSON,...t,specType:s,schemas:{}},"parameter"===r.decoratorType&&(t={...t,genericTypes:r.nestedGenerics[0],nestedGenerics:r.nestedGenerics,groups:r.parameter?.groups}),function(e,t){const r=e.store.get(Js)||new Map,s=function(e){return JSON.stringify(e)}(t);if(!r.has(s)){const n=h("schema",e.schema,t);Object.keys(t.schemas).length&&(n.definitions=t.schemas),r.set(s,n)}return e.store.set(Js,r),r.get(s)}(r,t)}function Ws(e,t={}){const r=e.isStore?e:K(e),s=fs(t.basePath,r.path);let n=[];return t.withChildren&&(n=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(Ws(r,{...t,basePath:s}))),n)),[..._e(e).values()].reduce(((t,r)=>{const{operation:n}=r;return n&&n.operationPaths.forEach((n=>{t.push(new ys({basePath:s,token:e,endpoint:r,operationPath:n}))})),t}),n)}function Vs(e){const t=e.isStore?e:K(e);if(!t.$properties){const e=se(t);t.$properties=new Map,e.forEach((e=>{e.children.forEach((e=>{t.$properties.has(e.propertyKey)||t.$properties.set(e.propertyKey,e)}))}))}return t.$properties}function Xs(e,t={}){const r=Vs(e),s=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&ce(e.itemSchema,t)||s.set(r,e)})),s}})(),i})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("change-case"),require("@tsed/core")):"function"==typeof define&&define.amd?define(["change-case","@tsed/core"],t):"object"==typeof exports?exports["@tsed/schema"]=t(require("change-case"),require("@tsed/core")):e["@tsed/schema"]=t(e["change-case"],e["@tsed/core"])}(self,((e,t)=>(()=>{"use strict";var r={133:(e,t,r)=>{e.exports=r(555)},379:e=>{const t="\\\\/",r=`[^${t}]`,s="\\.",n="\\/",i="[^/]",o=`(?:${n}|$)`,a=`(?:^|${n})`,c=`${s}{1,2}${o}`,p={DOT_LITERAL:s,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:n,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${s})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${s}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${n}]`,STAR:`${i}*?`,START_ANCHOR:a,SEP:"/"},u={...p,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${s}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${s})`,NO_DOTS:`(?!(?:^|[${t}])${s}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${s}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${s}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?u:p}},390:(e,t,r)=>{const s=r(379),n=r(290),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:p}=s,u=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>n.escapeRegex(e))).join("..")}return r},h=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,l=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=p[e]||e;const r={...t},l="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let m=e.length;if(m>l)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${l}`);const d={type:"bos",value:"",output:r.prepend||""},f=[d],g=r.capture?"":"?:",y=s.globChars(r.windows),O=s.extglobChars(y),{DOT_LITERAL:S,PLUS_LITERAL:b,SLASH_LITERAL:R,ONE_CHAR:A,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:P,NO_DOTS_SLASH:v,QMARK:C,QMARK_NO_DOT:x,STAR:$,START_ANCHOR:w}=y,M=e=>`(${g}(?:(?!${w}${e.dot?T:S}).)*?)`,_=r.dot?"":E,N=r.dot?C:x;let D=!0===r.bash?M(r):$;r.capture&&(D=`(${D})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const I={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};e=n.removePrefix(e,I),m=e.length;const L=[],k=[],H=[];let j,q=d;const G=()=>I.index===m-1,U=I.peek=(t=1)=>e[I.index+t],B=I.advance=()=>e[++I.index],K=()=>e.slice(I.index+1),J=(e="",t=0)=>{I.consumed+=e,I.index+=t},F=e=>{I.output+=null!=e.output?e.output:e.value,J(e.value)},V=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)B(),I.start++,e++;return e%2!=0&&(I.negated=!0,I.start++,!0)},W=e=>{I[e]++,H.push(e)},X=e=>{I[e]--,H.pop()},z=e=>{if("globstar"===q.type){const t=I.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||L.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(I.output=I.output.slice(0,-q.output.length),q.type="star",q.value="*",q.output=D,I.output+=q.output)}if(L.length&&"paren"!==e.type&&!O[e.value]&&(L[L.length-1].inner+=e.value),(e.value||e.output)&&F(e),q&&"text"===q.type&&"text"===e.type)return q.value+=e.value,void(q.output=(q.output||"")+e.value);e.prev=q,f.push(e),q=e},Q=(e,t)=>{const s={...O[t],conditions:1,inner:""};s.prev=q,s.parens=I.parens,s.output=I.output;const n=(r.capture?"(":"")+s.open;W("parens"),z({type:e,value:t,output:I.output?"":A}),z({type:"paren",extglob:!0,value:B(),output:n}),L.push(s)},Y=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let s=D;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=M(r)),(s!==D||G()||/^\)+$/.test(K()))&&(t=e.close=`)$))${s}`),"bos"===e.prev.type&&G()&&(I.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:j,output:t}),X("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,i=e.replace(c,((e,t,r,n,i,o)=>"\\"===n?(s=!0,e):"?"===n?t?t+n+(i?C.repeat(i.length):""):0===o?N+(i?C.repeat(i.length):""):C.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?t?t+n+(i?D:""):D:t?e:`\\${e}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?(I.output=e,I):(I.output=n.wrapOutput(i,I,t),I)}for(;!G();){if(j=B(),"\0"===j)continue;if("\\"===j){const e=U();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){j+="\\",z({type:"text",value:j});continue}const t=/^\\+/.exec(K());let s=0;if(t&&t[0].length>2&&(s=t[0].length,I.index+=s,s%2!=0&&(j+="\\")),!0===r.unescape?j=B()||"":j+=B()||"",0===I.brackets){z({type:"text",value:j});continue}}if(I.brackets>0&&("]"!==j||"["===q.value||"[^"===q.value)){if(!1!==r.posix&&":"===j){const e=q.value.slice(1);if(e.includes("[")&&(q.posix=!0,e.includes(":"))){const e=q.value.lastIndexOf("["),t=q.value.slice(0,e),r=q.value.slice(e+2),s=o[r];if(s){q.value=t+s,I.backtrack=!0,B(),d.output||1!==f.indexOf(q)||(d.output=A);continue}}}("["===j&&":"!==U()||"-"===j&&"]"===U())&&(j=`\\${j}`),"]"!==j||"["!==q.value&&"[^"!==q.value||(j=`\\${j}`),!0===r.posix&&"!"===j&&"["===q.value&&(j="^"),q.value+=j,F({value:j});continue}if(1===I.quotes&&'"'!==j){j=n.escapeRegex(j),q.value+=j,F({value:j});continue}if('"'===j){I.quotes=1===I.quotes?0:1,!0===r.keepQuotes&&z({type:"text",value:j});continue}if("("===j){W("parens"),z({type:"paren",value:j});continue}if(")"===j){if(0===I.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=L[L.length-1];if(e&&I.parens===e.parens+1){Y(L.pop());continue}z({type:"paren",value:j,output:I.parens?")":"\\)"}),X("parens");continue}if("["===j){if(!0!==r.nobracket&&K().includes("]"))W("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));j=`\\${j}`}z({type:"bracket",value:j});continue}if("]"===j){if(!0===r.nobracket||q&&"bracket"===q.type&&1===q.value.length){z({type:"text",value:j,output:`\\${j}`});continue}if(0===I.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));z({type:"text",value:j,output:`\\${j}`});continue}X("brackets");const e=q.value.slice(1);if(!0===q.posix||"^"!==e[0]||e.includes("/")||(j=`/${j}`),q.value+=j,F({value:j}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(q.value);if(I.output=I.output.slice(0,-q.value.length),!0===r.literalBrackets){I.output+=t,q.value=t;continue}q.value=`(${g}${t}|${q.value})`,I.output+=q.value;continue}if("{"===j&&!0!==r.nobrace){W("braces");const e={type:"brace",value:j,output:"(",outputIndex:I.output.length,tokensIndex:I.tokens.length};k.push(e),z(e);continue}if("}"===j){const e=k[k.length-1];if(!0===r.nobrace||!e){z({type:"text",value:j,output:j});continue}let t=")";if(!0===e.dots){const e=f.slice(),s=[];for(let t=e.length-1;t>=0&&(f.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=u(s,r),I.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=I.output.slice(0,e.outputIndex),s=I.tokens.slice(e.tokensIndex);e.value=e.output="\\{",j=t="\\}",I.output=r;for(const e of s)I.output+=e.output||e.value}z({type:"brace",value:j,output:t}),X("braces"),k.pop();continue}if("|"===j){L.length>0&&L[L.length-1].conditions++,z({type:"text",value:j});continue}if(","===j){let e=j;const t=k[k.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:j,output:e});continue}if("/"===j){if("dot"===q.type&&I.index===I.start+1){I.start=I.index+1,I.consumed="",I.output="",f.pop(),q=d;continue}z({type:"slash",value:j,output:R});continue}if("."===j){if(I.braces>0&&"dot"===q.type){"."===q.value&&(q.output=S);const e=k[k.length-1];q.type="dots",q.output+=j,q.value+=j,e.dots=!0;continue}if(I.braces+I.parens===0&&"bos"!==q.type&&"slash"!==q.type){z({type:"text",value:j,output:S});continue}z({type:"dot",value:j,output:S});continue}if("?"===j){if((!q||"("!==q.value)&&!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("qmark",j);continue}if(q&&"paren"===q.type){const e=U();let t=j;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===q.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${j}`),z({type:"text",value:j,output:t});continue}if(!0!==r.dot&&("slash"===q.type||"bos"===q.type)){z({type:"qmark",value:j,output:x});continue}z({type:"qmark",value:j,output:C});continue}if("!"===j){if(!0!==r.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Q("negate",j);continue}if(!0!==r.nonegate&&0===I.index){V();continue}}if("+"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("plus",j);continue}if(q&&"("===q.value||!1===r.regex){z({type:"plus",value:j,output:b});continue}if(q&&("bracket"===q.type||"paren"===q.type||"brace"===q.type)||I.parens>0){z({type:"plus",value:j});continue}z({type:"plus",value:b});continue}if("@"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){z({type:"at",extglob:!0,value:j,output:""});continue}z({type:"text",value:j});continue}if("*"!==j){"$"!==j&&"^"!==j||(j=`\\${j}`);const e=a.exec(K());e&&(j+=e[0],I.index+=e[0].length),z({type:"text",value:j});continue}if(q&&("globstar"===q.type||!0===q.star)){q.type="star",q.star=!0,q.value+=j,q.output=D,I.backtrack=!0,I.globstar=!0,J(j);continue}let t=K();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",j);continue}if("star"===q.type){if(!0===r.noglobstar){J(j);continue}const s=q.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){z({type:"star",value:j,output:""});continue}const a=I.braces>0&&("comma"===s.type||"brace"===s.type),c=L.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){z({type:"star",value:j,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[I.index+4];if(r&&"/"!==r)break;t=t.slice(3),J("/**",3)}if("bos"===s.type&&G()){q.type="globstar",q.value+=j,q.output=M(r),I.output=q.output,I.globstar=!0,J(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&G()){I.output=I.output.slice(0,-(s.output+q.output).length),s.output=`(?:${s.output}`,q.type="globstar",q.output=M(r)+(r.strictSlashes?")":"|$)"),q.value+=j,I.globstar=!0,I.output+=s.output+q.output,J(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";I.output=I.output.slice(0,-(s.output+q.output).length),s.output=`(?:${s.output}`,q.type="globstar",q.output=`${M(r)}${R}|${R}${e})`,q.value+=j,I.output+=s.output+q.output,I.globstar=!0,J(j+B()),z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){q.type="globstar",q.value+=j,q.output=`(?:^|${R}|${M(r)}${R})`,I.output=q.output,I.globstar=!0,J(j+B()),z({type:"slash",value:"/",output:""});continue}I.output=I.output.slice(0,-q.output.length),q.type="globstar",q.output=M(r),q.value+=j,I.output+=q.output,I.globstar=!0,J(j);continue}const s={type:"star",value:j,output:D};!0!==r.bash?!q||"bracket"!==q.type&&"paren"!==q.type||!0!==r.regex?(I.index!==I.start&&"slash"!==q.type&&"dot"!==q.type||("dot"===q.type?(I.output+=P,q.output+=P):!0===r.dot?(I.output+=v,q.output+=v):(I.output+=_,q.output+=_),"*"!==U()&&(I.output+=A,q.output+=A)),z(s)):(s.output=j,z(s)):(s.output=".*?","bos"!==q.type&&"slash"!==q.type||(s.output=_+s.output),z(s))}for(;I.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));I.output=n.escapeLast(I.output,"["),X("brackets")}for(;I.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));I.output=n.escapeLast(I.output,"("),X("parens")}for(;I.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));I.output=n.escapeLast(I.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==q.type&&"bracket"!==q.type||z({type:"maybe_slash",value:"",output:`${R}?`}),!0===I.backtrack){I.output="";for(const e of I.tokens)I.output+=null!=e.output?e.output:e.value,e.suffix&&(I.output+=e.suffix)}return I};l.fastpaths=(e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=p[e]||e;const{DOT_LITERAL:c,SLASH_LITERAL:u,ONE_CHAR:h,DOTS_SLASH:l,NO_DOT:m,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:g,START_ANCHOR:y}=s.globChars(r.windows),O=r.dot?d:m,S=r.dot?f:m,b=r.capture?"":"?:";let R=!0===r.bash?".*?":g;r.capture&&(R=`(${R})`);const A=e=>!0===e.noglobstar?R:`(${b}(?:(?!${y}${e.dot?l:c}).)*?)`,T=e=>{switch(e){case"*":return`${O}${h}${R}`;case".*":return`${c}${h}${R}`;case"*.*":return`${O}${R}${c}${h}${R}`;case"*/*":return`${O}${R}${u}${h}${S}${R}`;case"**":return O+A(r);case"**/*":return`(?:${O}${A(r)}${u})?${S}${h}${R}`;case"**/*.*":return`(?:${O}${A(r)}${u})?${S}${R}${c}${h}${R}`;case"**/.*":return`(?:${O}${A(r)}${u})?${c}${h}${R}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=T(t[1]);if(!r)return;return r+c+t[2]}}},E=n.removePrefix(e,{negated:!1,prefix:""});let P=T(E);return P&&!0!==r.strictSlashes&&(P+=`${u}?`),P},e.exports=l},555:(e,t,r)=>{const s=r(270),n=r(390),i=r(290),o=r(379),a=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>a(e,t,r))),n=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return n}const s=(n=e)&&"object"==typeof n&&!Array.isArray(n)&&e.tokens&&e.input;var n;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},o=i.windows,c=s?a.compileRe(e,t):a.makeRe(e,t,!1,!0),p=c.state;delete c.state;let u=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};u=a(i.ignore,e,r)}const h=(r,s=!1)=>{const{isMatch:n,match:h,output:l}=a.test(r,c,t,{glob:e,posix:o}),m={glob:e,state:p,regex:c,posix:o,input:r,output:l,match:h,isMatch:n};return"function"==typeof i.onResult&&i.onResult(m),!1===n?(m.isMatch=!1,!!s&&m):u(r)?("function"==typeof i.onIgnore&&i.onIgnore(m),m.isMatch=!1,!!s&&m):("function"==typeof i.onMatch&&i.onMatch(m),!s||m)};return r&&(h.state=p),h};a.test=(e,t,r,{glob:s,posix:n}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const o=r||{},c=o.format||(n?i.toPosixSlashes:null);let p=e===s,u=p&&c?c(e):e;return!1===p&&(u=c?c(e):e,p=u===s),!1!==p&&!0!==o.capture||(p=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,n):t.exec(u)),{isMatch:Boolean(p),match:p,output:u}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map((e=>a.parse(e,t))):n(e,{...t,fastpaths:!1}),a.scan=(e,t)=>s(e,t),a.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const n=t||{},i=n.contains?"":"^",o=n.contains?"":"$";let c=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const p=a.toRegex(c,t);return!0===s&&(p.state=e),p},a.makeRe=(e,t,r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let o,c={negated:!1,fastpaths:!0},p="";return e.startsWith("./")&&(e=e.slice(2),p=c.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(o=n.fastpaths(e,t)),void 0===o?(c=n(e,t),c.prefix=p+(c.prefix||"")):c.output=o,a.compileRe(c,t,r,s)},a.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,e.exports=a},270:(e,t,r)=>{const s=r(290),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:p,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:O}=r(379),S=e=>e===u||e===o,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},R=e.length-1,A=!0===r.parts||!0===r.scanToEnd,T=[],E=[],P=[];let v,C,x=e,$=-1,w=0,M=0,_=!1,N=!1,D=!1,I=!1,L=!1,k=!1,H=!1,j=!1,q=!1,G=0,U={value:"",depth:0,isGlob:!1};const B=()=>$>=R,K=()=>(v=C,x.charCodeAt(++$));for(;$<R;){let e;if(C=K(),C!==o){if(!0===k||C===h){for(G++;!0!==B()&&(C=K());)if(C!==o)if(C!==h){if(!0!==k&&C===c&&(C=K())===c){if(_=U.isBrace=!0,D=U.isGlob=!0,q=!0,!0===A)continue;break}if(!0!==k&&C===a){if(_=U.isBrace=!0,D=U.isGlob=!0,q=!0,!0===A)continue;break}if(C===g&&(G--,0===G)){k=!1,_=U.isBrace=!0,q=!0;break}}else G++;else H=U.backslashes=!0,K();if(!0===A)continue;break}if(C!==u){if(!0!==r.noext&&!0==(C===d||C===i||C===n||C===f||C===p)&&x.charCodeAt($+1)===l){if(D=U.isGlob=!0,I=U.isExtglob=!0,q=!0,!0===A){for(;!0!==B()&&(C=K());)if(C!==o){if(C===y){D=U.isGlob=!0,q=!0;break}}else H=U.backslashes=!0,C=K();continue}break}if(C===n){if(v===n&&(L=U.isGlobstar=!0),D=U.isGlob=!0,q=!0,!0===A)continue;break}if(C===f){if(D=U.isGlob=!0,q=!0,!0===A)continue;break}if(C===m)for(;!0!==B()&&(e=K());)if(e!==o){if(e===O){if(N=U.isBracket=!0,D=U.isGlob=!0,q=!0,!0===A)continue;break}}else H=U.backslashes=!0,K();if(!0===r.nonegate||C!==p||$!==w){if(!0!==r.noparen&&C===l){if(D=U.isGlob=!0,!0===A){for(;!0!==B()&&(C=K());)if(C!==l){if(C===y){q=!0;break}}else H=U.backslashes=!0,C=K();continue}break}if(!0===D){if(q=!0,!0===A)continue;break}}else j=U.negated=!0,w++}else{if(T.push($),E.push(U),U={value:"",depth:0,isGlob:!1},!0===q)continue;if(v===c&&$===w+1){w+=2;continue}M=$+1}}else H=U.backslashes=!0,C=K(),C===h&&(k=!0)}!0===r.noext&&(I=!1,D=!1);let J=x,F="",V="";w>0&&(F=x.slice(0,w),x=x.slice(w),M-=w),J&&!0===D&&M>0?(J=x.slice(0,M),V=x.slice(M)):!0===D?(J="",V=x):J=x,J&&""!==J&&"/"!==J&&J!==x&&S(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),!0===r.unescape&&(V&&(V=s.removeBackslashes(V)),J&&!0===H&&(J=s.removeBackslashes(J)));const W={prefix:F,input:e,start:w,base:J,glob:V,isBrace:_,isBracket:N,isGlob:D,isExtglob:I,isGlobstar:L,negated:j};if(!0===r.tokens&&(W.maxDepth=0,S(C)||E.push(U),W.tokens=E),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<T.length;s++){const n=t?t+1:w,i=T[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==w?(E[s].isPrefix=!0,E[s].value=F):E[s].value=o,b(E[s]),W.maxDepth+=E[s].depth),0===s&&""===o||P.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);P.push(s),r.tokens&&(E[E.length-1].value=s,b(E[E.length-1]),W.maxDepth+=E[E.length-1].depth)}W.slashes=T,W.parts=P}return W}},290:(e,t,r)=>{const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=r(379);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>i.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(o,"\\$1"),t.toPosixSlashes=e=>e.replace(s,"/"),t.removeBackslashes=e=>e.replace(n,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.escapeLast=(e,r,s)=>{const n=e.lastIndexOf(r,s);return-1===n?e:"\\"===e[n-1]?t.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s},t.basename=(e,{windows:t}={})=>t?e.replace(/[\\/]$/,"").replace(/.*[\\/]/,""):e.replace(/\/$/,"").replace(/.*\//,"")},203:(e,t,r)=>{var s=r(739);function n(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return n(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):n(t)}e.exports=i,i.message=s,i.code=function(e){var t={};return Object.keys(e).forEach((function(r){var s=e[r],n=Number(r);t[s.toLowerCase()]=n})),t}(s),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(s),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},803:e=>{e.exports=t},598:t=>{t.exports=e},739:e=>{e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{AcceptMime:()=>Br,AdditionalProperties:()=>yt,All:()=>fs,AllOf:()=>Ot,Allow:()=>bt,Any:()=>Rt,AnyOf:()=>At,ArrayOf:()=>at,Children:()=>nt,CollectionContains:()=>pt,CollectionOf:()=>ot,Const:()=>Tt,Consumes:()=>Kr,ContentType:()=>Yr,Converter:()=>tn,CustomKey:()=>Et,CustomKeys:()=>Pt,DateFormat:()=>Bt,DateTime:()=>Ut,DecoratorContext:()=>Jr,Default:()=>vt,DefaultMsg:()=>Ct,Delete:()=>Ss,Deprecated:()=>Zr,Description:()=>xt,Discriminator:()=>v,DiscriminatorKey:()=>$t,DiscriminatorValue:()=>it,Email:()=>Gt,EndpointMetadata:()=>X,Enum:()=>wt,ErrorMsg:()=>ut,Example:()=>Mt,Examples:()=>_t,ExclusiveMaximum:()=>It,ExclusiveMinimum:()=>Ht,For:()=>lr,Format:()=>qt,ForwardGroups:()=>Vt,GenericOf:()=>qr,Generics:()=>Gr,Get:()=>gs,Groups:()=>Yt,HTTP_STATUS_MESSAGES:()=>Ue,Head:()=>bs,Header:()=>es,Hidden:()=>Zt,Ignore:()=>er,In:()=>ts,InFile:()=>rs,Integer:()=>tr,JSON_TYPES:()=>R,JsonClassStore:()=>M,JsonEntitiesContainer:()=>f,JsonEntityComponent:()=>w,JsonEntityFn:()=>st,JsonEntityStore:()=>g,JsonFormatTypes:()=>jt,JsonLazyRef:()=>he,JsonMap:()=>D,JsonMedia:()=>J,JsonMethodStore:()=>W,JsonOperation:()=>V,JsonOperationPathsMap:()=>Q,JsonOperationRoute:()=>ws,JsonParameter:()=>H,JsonParameterStore:()=>j,JsonParameterTypes:()=>I,JsonPropertyStore:()=>_,JsonRequestBody:()=>Ve,JsonResponse:()=>F,JsonSchema:()=>$,Location:()=>ss,MapOf:()=>ct,Max:()=>Dt,MaxItems:()=>lt,MaxLength:()=>rr,MaxProperties:()=>mt,Maximum:()=>Nt,Min:()=>kt,MinItems:()=>dt,MinLength:()=>sr,MinProperties:()=>ft,Minimum:()=>Lt,MultipleOf:()=>nr,Name:()=>ir,Nullable:()=>or,OPERATION_HTTP_VERBS:()=>r,OPERATION_WS_VERBS:()=>s,OneOf:()=>ar,Operation:()=>as,OperationId:()=>cs,OperationMethods:()=>o,OperationPath:()=>ps,OperationVerbs:()=>e,Optional:()=>cr,Options:()=>As,ParamMetadata:()=>q,Partial:()=>us,Patch:()=>Rs,Path:()=>hs,Pattern:()=>pr,Post:()=>ys,Produces:()=>Ur,Property:()=>St,PropertyMetadata:()=>N,Publish:()=>ls,Put:()=>Os,ReadOnly:()=>ur,RecordOf:()=>mr,Redirect:()=>ms,Required:()=>dr,RequiredGroups:()=>fr,Returns:()=>Qr,Route:()=>ds,Schema:()=>hr,Security:()=>Ts,SpecTypes:()=>se,Status:()=>Es,Subscribe:()=>Ps,Summary:()=>vs,Tags:()=>Cs,TimeFormat:()=>Kt,Title:()=>gr,TypeError:()=>yr,UniqueItems:()=>gt,Uri:()=>Jt,Url:()=>Ft,View:()=>xs,WriteOnly:()=>Or,allOf:()=>kr,alterIgnore:()=>Ae,alterOneOf:()=>xe,alterRequiredGroups:()=>$e,any:()=>Dr,anyMapper:()=>fe,anyOf:()=>Ir,array:()=>wr,boolean:()=>Tr,buildPath:()=>m,channelsMapper:()=>re,classMapper:()=>ge,concatParameters:()=>ze,concatPath:()=>$s,createRef:()=>me,createRefName:()=>le,date:()=>Er,datetime:()=>Pr,defineStatusModel:()=>Vr,email:()=>Cr,enums:()=>jr,enumsRegistry:()=>S,execMapper:()=>u,formatParameterType:()=>L,from:()=>Sr,generateSpec:()=>sn,genericsMapper:()=>ye,getComputedType:()=>b,getGenericsMap:()=>oe,getInheritedStores:()=>Y,getJsonEntityStore:()=>z,getJsonPathParameters:()=>Qe,getJsonSchema:()=>on,getJsonSchemaMapper:()=>p,getJsonType:()=>A,getOperationId:()=>Ze,getOperationsRoutes:()=>an,getOperationsStores:()=>Z,getProperties:()=>pn,getPropertiesStores:()=>cn,getRequiredProperties:()=>we,getSpec:()=>Hs,getSpecType:()=>js,getSpecTypeFromSpec:()=>qs,getStatusConstant:()=>Be,getStatusMessage:()=>Ke,getStatusModel:()=>Wr,hasMapper:()=>h,inheritedClassMapper:()=>Oe,inlineEnums:()=>Me,integer:()=>Rr,isParameterType:()=>k,isRedirectionStatus:()=>U,isSuccessStatus:()=>G,itemMapper:()=>Se,lazyRef:()=>Hr,lazyRefMapper:()=>be,makeOf:()=>ne,map:()=>Mr,mapAliasedProperties:()=>Ce,mapGenericsOptions:()=>ae,mapHeaders:()=>B,mapMapper:()=>Re,mapNullableType:()=>Te,mapOpenSpec:()=>Ks,mapOpenSpec2:()=>Us,mapOpenSpec3:()=>Bs,mapOpenSpecInfo:()=>Gs,mapOperationOptions:()=>is,matchGroups:()=>Qt,mergeSpec:()=>Ls,messageMapper:()=>ie,number:()=>br,object:()=>Nr,objectMapper:()=>Ee,ofMapper:()=>Pe,oneOf:()=>Lr,oneOfMapper:()=>l,operationIdFormatter:()=>Ye,operationInFilesMapper:()=>Le,operationInParameterMapper:()=>ke,operationInParametersMapper:()=>He,operationInQueryMapper:()=>je,operationMapper:()=>Je,operationMediaMapper:()=>Fe,operationRequestBodyMapper:()=>We,operationResponseMapper:()=>Xe,parameters:()=>_s,pathsMapper:()=>rt,payloadMapper:()=>pe,popGenerics:()=>ce,propertiesMapper:()=>ve,registerJsonSchemaMapper:()=>c,removeHiddenOperation:()=>ee,responsePayloadMapper:()=>ue,schemaMapper:()=>De,schemesReducer:()=>Ms,security:()=>Ns,serializeEnum:()=>T,serializeEnumValues:()=>E,set:()=>_r,string:()=>Ar,tagsReducer:()=>Ds,time:()=>vr,toJsonMapCollection:()=>K,toJsonRegex:()=>P,toRef:()=>de,transformInformation:()=>en,transformSecurity:()=>Zs,transformToOS2:()=>rn,uri:()=>xr,url:()=>$r,withErrorMsg:()=>ht});var e,t=n(598);!function(e){e.ALL="ALL",e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.HEAD="HEAD",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.TRACE="TRACE",e.PUBLISH="PUBLISH",e.SUBSCRIBE="SUBSCRIBE",e.CUSTOM="CUSTOM"}(e||(e={}));const r=[e.ALL,e.GET,e.POST,e.PUT,e.PATCH,e.HEAD,e.DELETE,e.OPTIONS,e.TRACE,e.CUSTOM],s=[e.PUBLISH,e.SUBSCRIBE],o=e,a=new Map;function c(e,t,r){return a.set(r?`${r}:${e}`:e,t)}function p(e,t){const r=a.get(`${t?.specType}:${e}`)||a.get(e);if(r)return r;throw new Error(`JsonSchema ${e} mapper doesn't exists`)}function u(e,t,r,s){return p(e,r)(...t,r,s)}function h(e){return a.has(e)}function l(e,t){return e.find((e=>a.has(`${t?.specType}:${e}`)))||e.find((e=>a.has(e)))}function m(e){return e.split("/").filter(Boolean).join("/")}var d=n(803);const f=new Map;class g{propertyKey;propertyName;index;descriptor;decoratorType;collectionType;token;store;isStore=!0;parent;target;_type;_schema;constructor(e){const{target:t,propertyKey:r,descriptor:s,index:n,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=String(r),this.descriptor=s,this.index=n,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get targetName(){return(0,d.nameOf)(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return(0,d.isArrayOrArrayClass)(this.collectionType)}get discriminatorAncestor(){const e=(0,d.ancestorsOf)(this.target).find((e=>g.from(e).schema.isDiscriminator));return e&&g.from(e)}get isPrimitive(){return(0,d.isPrimitiveOrPrimitiveClass)(this._type)}get isDate(){return(0,d.isDate)(this.computedType)}get isObject(){return(0,d.isObject)(this.computedType)}get isClass(){return(0,d.isClass)(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){return this.schema.isDiscriminator&&this.discriminatorAncestor?.schema.discriminator().base!==this.target}static from(...e){if(e[0].isStore)return e[0];const t=e[0];e.length>1&&(e[0]=(0,d.prototypeOf)(e[0]));const r=d.Store.from(...e);if(!r.has("JsonEntityStore")){const s=(0,d.decoratorTypeOf)(e),n=new(f.get(s))({store:r,decoratorType:s,target:(0,d.classOf)(t),propertyKey:e[1],index:"number"==typeof e[2]?e[2]:void 0,descriptor:"object"==typeof e[2]?e[2]:void 0});n.build(),r.set("JsonEntityStore",n)}return r.get("JsonEntityStore")}static fromMethod(e,t){return this.from(e,t,(0,d.descriptorOf)(e,t))}static get(e,t,r){return g.from((0,d.prototypeOf)(e),t,r)}isGetterOnly(){return(0,d.isObject)(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,t){return this.store.get(e,t)}set(e,t){return this.store.set(e,t)}toString(){return[this.targetName,this.propertyName,this.index].filter((e=>void 0!==e)).join(":")}buildType(e){(0,d.isCollection)(e)?this.collectionType=e:(this._type=e,this._type&&(0,d.isPlainObject)(this._type)&&(this._type=String))}getBestType(){return this.itemSchema.hasDiscriminator?this.itemSchema.discriminator().base:(0,d.isClassObject)(this.type)?this.itemSchema.getTarget():(0,d.isArrowFn)(this.type)?this.type():this.type}}function y(e,t,r,s){var n,i=arguments.length,o=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(i<3?n(o):i>3?n(t,r,o):n(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function O(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create,Object.create;const S=new Map;function b(e){return(0,d.isPromise)(e)||e===Function?Object:(0,d.isClass)(e)||(0,d.isSymbol)(e)||(0,d.isPrimitiveOrPrimitiveClass)(e)||(0,d.isClassObject)(e)||(0,d.isDate)(e)||(0,d.isCollection)(e)?(0,d.classOf)(e):(0,d.isArrowFn)(e)?e():e}const R=["string","number","integer","boolean","object","array","null","any"];function A(e){return null===e?"null":(0,d.isPrimitiveOrPrimitiveClass)(e)?R.indexOf(e)>-1?e:"string"==typeof e?"file"===e?"file":"generic":(0,d.primitiveOf)(e):e===Array?"array":(0,d.isArray)(e)?e.map(A):e===Set?"array":(0,d.isDate)(e)||(0,d.isBuffer)(e)?"string":"object"}const T=e=>(0,d.isObject)(e)&&null!==e?Object.entries(e).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):e;function E(e){const t=e.reduce(((e,t)=>e.concat(T(t))),[]),r=t.reduce(((e,t)=>e.add((e=>null===e?"null":typeof e)(t))),new Set);return{values:(0,d.uniq)(t),types:r}}function P(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class v{propertyName;base;values=new Map;types=new Map;constructor({base:e,propertyName:t,types:r,values:s}={}){Object.assign(this,(0,d.cleanObject)({base:e,propertyName:t,types:r?new Map(r):void 0,values:s?new Map(s):void 0}))}add(e,t){return t.forEach((t=>{this.values.set(t,e)})),this.types.set(e,t),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const t=this.types.get(e);return t?t[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function C(e){return e instanceof $?e:Object.entries(e).reduce(((e,[t,r])=>(e[P(t)]=x(r),e)),{})}function x(e){return(0,d.isArray)(e)?e.map(x):e.isStore||e.$isJsonDocument||e.isLazyRef?e:(0,d.classOf)(e)!==Object&&(0,d.isClass)(e)?g.from(e).schema:(0,d.isObject)(e)?$.from(e):(0,d.isPrimitiveClass)(e)?$.from({type:e}):e}class $ extends Map{$kind="schema";$isJsonDocument=!0;$hooks=new d.Hooks;$required=new Set;$allow=[];$selfRequired;$forwardGroups=!1;$ignore=!1;isDiscriminatorKey=!1;isDiscriminator=!1;#e=!1;#t=null;#r;#s=[];#n=new Map;#i;#o;#a=!1;#c=!1;#p=!1;constructor(e={}){super(),e&&this.assign(e)}get alias(){return this.#n}get nestedGenerics(){return this.#s}set nestedGenerics(e){this.#s=e}get genericLabels(){return this.#r}set genericLabels(e){this.#r=e}get isClass(){return(0,d.isClass)(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes(this.#o)}get isCollection(){return this.#c}get isGeneric(){return this.#a}get discriminatorAncestor(){const e=(0,d.ancestorsOf)(this.#o).find((e=>g.from(e).schema.isDiscriminator));return e&&g.from(e).schema}get hasGenerics(){return!(!this.nestedGenerics||!this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return this.#p}get isNullable(){return this.#e||this.$allow.includes(null)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!this.#t}static from(e={}){return new $(e)}nullable(e){this.#e=e}itemSchema(e={}){return this.#i=this.#i||x(e),this.#i.assign(e),this.#i}getAliasOf(e){return this.#n.get(e)}addAlias(e,t){return this.#n.set(e,t),this.#n.set(t,e),this}removeAlias(e){const t=this.#n.get(e);return t&&this.#n.delete(t),this.#n.delete(e),this}$id(e){return super.set("$id",e),this}$ref(e){return super.set("$ref",e),this}$schema(e){return super.set("$schema",e),this}label(e){return this.#p=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){return"boolean"!=typeof e&&this.$hooks.on("ignore",e),this.$ignore=e,this}default(e){return super.set("default",e),this}const(e){return super.set("const",e),this}description(e){return super.set("description",e),this}discriminator(){return this.isDiscriminator=!0,this.#t=this.#t||new v({base:this.#o})}discriminatorKey(e){return this.discriminator().propertyName=e,this.isDiscriminator=!0,this}discriminatorValue(...e){const t=this.discriminatorAncestor.discriminator();t.add(this.#o,e),this.isDiscriminator=!0;const r=this.get("properties"),s=r[t.propertyName]||new $({type:"string"});return 1===e.length?(s.const(e[0]),s.examples([e[0]])):(s.enum(...e),s.examples(e)),r[t.propertyName]=s,this.set("properties",r),this}additionalItems(e){return super.set("additionalItems",x(e)),this}contains(e){return super.set("contains",x(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#i=x(e)),this}maxItems(e){return super.set("maxItems",e),this}minItems(e){return super.set("minItems",e),this}uniqueItems(e){return super.set("uniqueItems",e),this}maxProperties(e){return super.set("maxProperties",e),this}minProperties(e){return super.set("minProperties",e),this}allow(...e){return this.$allow.push(...e),this}required(e=!0){if(!(0,d.isArray)(e)){const t=this.clone();return t.$selfRequired=e,t}return this.$required.clear(),e.forEach((e=>this.$required.add(e))),this}addRequired(e){return this.$required.add(e),this}removeRequired(e){return this.$required.delete(e),this}isRequired(e){return this.$required.has(e)}properties(e){return super.set("properties",C(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",C(r)),this}patternProperties(e){return super.set("patternProperties",C(e)),this}additionalProperties(e){return super.set("additionalProperties",x(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",C(e)),this}propertyNames(e){return super.set("propertyNames",x(e)),this}enum(e,...t){if(S.has(e))return this.enum(S.get(e));if(e instanceof $)e.getName()?super.set("enum",e):super.set("enum",e.get("enum")).any(...e.getJsonType());else{const{values:r,types:s}=E([e,t].flat());super.set("enum",r).any(...s)}return this}definitions(e){return super.set("definitions",C(e)),this}allOf(e){return super.set("allOf",e.map(x)),this}anyOf(e){return super.set("anyOf",e.map(x)),this}oneOf(e){let t=e.map(x);if(1===t.length&&!(e[0]instanceof $)){if(!t[0].hasDiscriminator)return this.type(e[0]);const r=t[0].discriminator().children();if(!r.length)return this.type(e[0]);t=r.map(x)}super.set("oneOf",t);const r=t[0];if(r.isDiscriminator){const e=r.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t}),this.isDiscriminator=!0,this.#t=e}return this}not(e){return super.set("not",x(e)),this}multipleOf(e){return super.set("multipleOf",e),this}maximum(e){return super.set("maximum",e),this}exclusiveMaximum(e){return super.set("exclusiveMaximum",e),this}minimum(e){return super.set("minimum",e),this}exclusiveMinimum(e){return super.set("exclusiveMinimum",e),this}maxLength(e){return super.set("maxLength",e),this}minLength(e){return super.set("minLength",e),this}pattern(e){return super.set("pattern",P(e)),this}format(e){return super.set("format",e),this}type(e){switch(e){case Map:super.set("type",A(e)),this.#o=e,this.#c=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case Array:super.set("type",A(e)),this.#o=e,this.#c=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case Set:super.set("type",A(e)),this.#o=e,this.#c=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":super.set("type",A(e)),this.integer();break;case Object:case Date:case Boolean:case Number:case String:super.set("type",A(e)),this.#o=e,this.has("properties")||super.set("properties",{});break;default:if((0,d.isClass)(e)||(0,d.isFunction)(e))super.set("type",void 0),this.#o=e,this.has("properties")||super.set("properties",{});else{const t=A(e);"generic"===t?(this.#a=!0,super.set("$ref",e)):super.set("type",t)}}return this}any(...e){return e.filter((e=>(0,d.isClass)(e))).length>=2?this.oneOf(e.filter((e=>null!==e&&(this.nullable(!0),!0)))):(e.length?(e=(0,d.uniq)(e).map(A)).includes("null")&&(this.nullable(!0),e=e.filter((e=>"null"!==e))):(e=["integer","number","string","boolean","array","object"],this.nullable(!0)),this.type(1===e.length?e[0]:e)),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(e){return super.set("title",e),this}readOnly(e){return super.set("readOnly",e),this}writeOnly(e){return super.set("writeOnly",e),this}customKey(e,t){return super.set(`#${e}`,t),this}toObject(e){return this.toJSON(e)}toJSON(e){return u("schema",[this],e)}assign(e={}){return(e instanceof $?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof $&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),e.$required.forEach((e=>{this.$required.add(e)})),this.#t=this.#t?new v(this.#t):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#p=e.#p,this.#n=new Map(this.#n.entries()),e.#r&&(this.#r=[...e.#r]),this.#s=e.#s.map((e=>[...e])),this.#o=e.#o,this.#a=e.#a,this.#c=e.#c,this.#p=e.#p,super.set("type",e.get("type"))),this}set(e,t){return e in this?(0,d.isFunction)(this[e])&&this[e](t):super.set(e,t),this}getComputedType(){return b(this.#o)}getComputedItemType(){return this.#i?this.#i.getComputedType():this.getComputedType()}getJsonType(){return this.get("type")||A(this.getComputedType())}getTarget(){return this.#o}getName(){return this.get("name")||((0,d.isClass)(this.#o)?(0,d.nameOf)((0,d.classOf)(this.getComputedType())):"")}clone(){return new $(this)}}function w(e){return t=>{f.set(e,t)}}let M=class extends g{children=new Map;get path(){return this.store.get("path","/")}set path(e){this.store.set("path",e)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=$.from({type:this.type})}};M=y([w(d.DecoratorTypes.CLASS)],M);let _=class extends g{parent=g.from(this.target);get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(e){e?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){this._type||this.buildType(d.Metadata.getType((0,d.prototypeOf)(this.target),this.propertyKey)),this._type=this._type||Object;let e=this.parent.schema.get("properties")[this.propertyName];e||(this.parent.children.set(this.propertyName,this),e=$.from({type:this.collectionType||this.type}),this.collectionType&&e.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,e),this._schema=e}static get(e,t){return g.from((0,d.prototypeOf)(e),t)}};_=y([w(d.DecoratorTypes.PROP)],_);const N=_;class D extends Map{$kind="map";$isJsonDocument=!0;constructor(e={}){super(),this.assign(e)}assign(e={}){return Object.entries(e).forEach((([e,t])=>{(0,d.isFunction)(this[e])?this[e](t):this.set(e,t)})),this}toJSON(e){return u("map",[this],e)}}var I;function L(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function k(e){return Object.values(I).includes(L(e))}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}(I||(I={}));class H extends D{$kind="operationInParameter";nestedGenerics=[];groups;groupsName;$schema;expression;getName(){const e=this.get("name");return"files"===this.get("in")?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,t=""){return this.set("in",L(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return this.$schema=e,this}toJSON(e){return u("operationInParameter",[this],e)}}let j=class extends g{paramType;expression;dataPath;pipes;parameter=new H;parent=g.fromMethod(this.target,this.propertyKey);constructor(e){super(e),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(e){this.parameter.nestedGenerics=e}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.$allow}static getParams(e,t){const r=[],s=(0,d.ancestorsOf)(e).reverse().find((e=>(0,d.isMethodDescriptor)(e,t)&&g.fromMethod(e,t).children.size));return s?(g.fromMethod(s,t).children.forEach(((e,t)=>{r[+t]=e})),r):[]}static get(e,t,r){return g.from((0,d.prototypeOf)(e),t,r)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}getSchema(e){return(0,d.isCollection)(e)||!(0,d.isClass)(e)?$.from({type:e}):g.from(e).schema}build(){if(!this._type){const e=d.Metadata.getParamTypes((0,d.prototypeOf)(this.target),this.propertyKey)[this.index];this.buildType(e)}this._type=this._type||Object,this._schema||(this.parent.children.set(this.index,this),this._schema=this.getSchema(this.collectionType||this.type),this.parameter.schema(this._schema),this.collectionType&&this._schema.itemSchema(this.getSchema(this.type)),this.parent.operation.addParameter(this.index,this.parameter))}};j=y([w(d.DecoratorTypes.PARAM),O("design:paramtypes",[Object])],j);const q=j,G=e=>Number(e)&&200<=Number(e)&&Number(e)<300,U=e=>Number(e)&&300<=Number(e)&&Number(e)<400;function B(e){return Object.keys(e).reduce(((t,r)=>{const s=e[r];let n=typeof s,i={example:s};return"object"===n&&(i=s,i.example=void 0===i.value?i.example:i.value,delete i.value,n=typeof i.example),i.type=i.type||n,t[r]=(0,d.cleanObject)(i),t}),{})}function K(e,t=D){return Object.entries(e).reduce(((e,[r,s])=>(e.set(r,new t(s)),e)),new D)}class J extends D{$kind="operationMedia";groups=[];groupsName;allowedGroups;schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}}class F extends D{$kind="operationResponse";status;constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",B(e)),this}content(e){return this.set("content",K(e,J)),this}getContent(){return this.get("content")}getMedia(e,t=!0){return t&&this.addMedia(e),this.getContent()?.get(e)}addMedia(e){const t=this.get("content");return t.has(e)||t.set(e,new J),this}}class V extends D{$kind="operation";operationPaths=new Map;#u;#h=!1;constructor(e={}){super({parameters:[],responses:new D,...e})}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return this.#u}tags(e){return super.set("tags",e),this}addTags(e){return e=(0,d.uniqBy)([...this.get("tags")||[],...e],"name"),this.tags(e)}summary(e){return super.set("summary",e),this}operationId(e){return this.set("operationId",e),this}responses(e){return this.set("responses",e),this}defaultStatus(e){return this.#u=e,this}getStatus(){return this.#u||200}setRedirection(e=302){return this.#h=!0,this.#u=e,this}isRedirection(e){return this.#h&&e?U(e):this.#h}addResponse(e,t){if((G(e)||U(e))&&!this.#u){const t=this.getResponseOf(200);this.getResponses().set(e.toString(),t).delete("200"),this.defaultStatus(Number(e))}const r="default"===e?this.getStatus().toString():e.toString(),s=this.getResponses().get(r);return s?(t.forEach(((e,t)=>{["content"].includes(t)||s.set(t,(0,d.deepMerge)(s.get(t),e))})),s.status=Number(r)):(t.status=Number(r),this.getResponses().set(r,t)),this}getResponses(){return this.get("responses")}getResponseOf(e){return("default"===e?this.response:this.getResponses().get(String(e)))||new F}ensureResponseOf(e){return this.addResponse(e,this.getResponseOf(e)),this.getResponseOf(e)}getHeadersOf(e){return this.getResponseOf(e).get("headers")||{}}getContentTypeOf(e){return[...this.getResponseOf(e).get("content").keys()].slice(-1)[0]}security(e){return this.set("security",e),this}addSecurityScopes(e,t){const r=this.get("security")||{};return r[e]=(0,d.uniq)([...r[e]||[],...t]),this.security(r)}description(e){return super.set("description",e),this}deprecated(e){return super.set("deprecated",e),this}parameters(e){return super.set("parameters",e),this}addParameter(e,t){-1===e&&(e=this.get("parameters").length),this.get("parameters")[e]=t}consumes(e){return super.set("consumes",e),this}produces(e){return super.set("produces",e),this}addProduce(e){const t=(0,d.uniq)([].concat(this.get("produces"),e)).filter(Boolean);this.set("produces",t)}addOperationPath(e,t,r={}){return this.operationPaths.set(String(e)+String(t),{...r,method:e,path:t}),this}getAllowedOperationPath(e){return e?[...this.operationPaths.values()].filter((({method:t})=>t&&e.includes(t.toUpperCase()))):[...this.operationPaths.values()]}}let W=class extends g{parent=g.from(this.target);middlewares=[];beforeMiddlewares=[];afterMiddlewares=[];operation=new V;children=new Map;constructor(e){super({store:d.Store.fromMethod(e.target,e.propertyKey),descriptor:(0,d.descriptorOf)(e.target,e.propertyKey),...e});const{beforeMiddlewares:t=[],middlewares:r=[],afterMiddlewares:s=[]}=e;this.after(s),this.before(t),this.use(r)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(e){this.store.set("view",e)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(e){this.store.set("acceptMimes",e)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(e,t,r){return r=r||(0,d.descriptorOf)((0,d.prototypeOf)(e),t),g.from((0,d.prototypeOf)(e),t,r)}getResponseOptions(e,{contentType:t="application/json",includes:r}={}){const s=this.operation.getResponseOf(e).getMedia(t,!1);if(s&&s.has("schema")){const e=s.get("schema");let t=s.groups;return r&&s.allowedGroups?.size&&(t=[...t||[],...r.filter((e=>s.allowedGroups.has(e)))]),{type:e.getComputedItemType(),groups:t}}return{type:this.type}}before(e){return this.beforeMiddlewares=this.beforeMiddlewares.concat(e).filter(d.isFunction),this}after(e){return this.afterMiddlewares=this.afterMiddlewares.concat(e).filter(d.isFunction),this}use(e){return this.middlewares=this.middlewares.concat(e).filter(d.isFunction),this}get(e){const t=d.Store.from(this.target).get(e);return(0,d.deepMerge)(t,this.store.get(e))}getParamTypes(){return[...this.children.values()].reduce(((e,t)=>({...e,[t.paramType]:!0})),{})}build(){if(!this._type){let e=d.Metadata.getReturnType(this.target,this.propertyKey);e=(0,d.isPromise)(e)?void 0:e,this.buildType(e)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),(0,d.isCollection)(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=$.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}};W=y([w(d.DecoratorTypes.METHOD),O("design:paramtypes",[Object])],W);const X=W;function z(...e){return g.from(...e)}f.set(d.DecoratorTypes.CLASS,M),f.set(d.DecoratorTypes.PROP,_),f.set(d.DecoratorTypes.PARAM,j),f.set(d.DecoratorTypes.METHOD,W);class Q extends Map{$kind="operationPaths";$isJsonDocument=!0;setOperationPath(e){const t=this.getKey(e.method,e.path);this.set(t,e)}getKey=(e,t)=>`${e}-${t}`}function Y(e){const t=e.isStore?e:z(e);return t.$inherited||(t.$inherited=(0,d.ancestorsOf)(t.target).reverse().reduce(((e,t)=>e.set(t,z(t))),new Map)),t.$inherited}function Z(e){const t=e.isStore?e:z(e);if(!t.$operations){const e=new Q;t.$operations=new Map,Y(t).forEach((e=>{e.children.forEach((e=>{e instanceof W&&!t.$operations.has(e.propertyKey)&&t.$operations.set(e.propertyKey,e)}))})),t.$operations.forEach((t=>{t.operation.operationPaths.forEach((t=>{e.setOperationPath(t)}))})),e.clear()}return t.$operations}function ee(e){return!e.store.get("hidden")}const te=[e.PUBLISH,e.SUBSCRIBE];function re(e,{channels:r,rootPath:s,...n}){const i=m(s+z(e).path);return n={...n,ctrlRootPath:i},[...Z(e).values()].filter(ee).flatMap((e=>{const t=e.operation.getAllowedOperationPath(te);return 0===t.length?[]:t.map((t=>({operationPath:t,operationStore:e})))})).reduce(function(e){return(r,{operationPath:s,operationStore:n})=>{const i=e.ctrlRootPath||"/",o=s.method.toLowerCase(),a=(0,t.camelCase)(`${o.toLowerCase()} ${n.parent.schema.getName()}`),c=u("message",[n,s],e);return{...r,[i]:{...r[i],[o]:{...r[i]?.[o],operationId:a,message:{oneOf:[...r[i]?.[o]?.message?.oneOf||[],c]}}}}}}(n),r)}var se;function ne(e,t){return t.length?1===t.length?t[0]:{[e]:t}:null}function ie(t,r,{tags:s=[],defaultTags:n=[],...i}={}){const{path:o,method:a}=r,c=String(o);let p=(0,d.getValue)(i.components,"messages."+o,(0,d.cleanObject)({description:t.operation.get("description"),summary:t.operation.get("summary")}));if(a.toUpperCase()===e.PUBLISH){const s=u("payload",[t,r],i);s&&(p.payload=s);const n=t.operation.getAllowedOperationPath([e.SUBSCRIBE]).map((e=>u("message",[t,e],i))).filter(Boolean),o=ne("oneOf",n);o&&(p["x-response"]=o)}else{const e=u("response",[t,r],i);e&&(p["x-response"]=e)}return i.components.messages=i.components.messages||{},i.components.messages[c]=p,{$ref:`#/components/messages/${c}`}}function oe(e,t){return e.reduce(((e,r,s)=>e.set(r,t[s])),new Map)}function ae(e){if(e.genericLabels&&e.genericTypes){const{genericLabels:t,genericTypes:r,...s}=e;return{...s,generics:oe(t,r)}}return e}function ce(e){const[t,...r]=e.nestedGenerics;return{genericTypes:t,nestedGenerics:r}}function pe(e,r,s){const n=e.operation.get("parameters").filter((e=>k(e.get("in")))),i=(0,t.pascalCase)([r.path,r.method,"Payload"].join(" "));(0,d.setValue)(s,`components.schemas.${i}`,{});const o=n.map((e=>{const t=function(e,t={}){return{...t,groups:e.groups,groupsName:e.groupsName}}(e,s),r=u("item",[e.$schema],{...t,...ce(e)});switch(e.get("in")){case I.BODY:return r;case I.QUERY:case I.PATH:case I.HEADER:return{type:"object",properties:{[e.get("name")]:r}}}return r}),{}).filter(Boolean);return ne("allOf",o)}function ue(e,r,s){const n=e.operation.getResponses(),i=[],o=[],a=[],c=[];[...n.entries()].forEach((([e,t])=>{const r=u("map",[t],s);if(i.push(+e),o.push(r.description),204!=+e){const{content:e}=r,t=e[Object.keys(e)[0]];a.push(t)}}));const p=(0,t.pascalCase)([r.path,r.method,"Response"].join(" ")),h={type:"object",properties:{status:{type:"number",enum:i},statusText:{type:"string",enum:o}},required:["status"]},l=ne("oneOf",a);l&&(0,d.setValue)(h,"properties.data",l);const m=ne("oneOf",c);return c.length&&(0,d.setValue)(h,"properties.error",m),(0,d.setValue)(s,`components.schemas.${p}`,h),{$ref:`#/components/schemas/${p}`}}c("channels",re),function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3",e.ASYNCAPI="asyncapi2"}(se||(se={})),c("generate",(function(e,t){const r={channels:u("channels",[e],t)};return r.tags=(0,d.uniqBy)(t.tags,"name"),t.components?.schemas&&Object.keys(t.components.schemas).length&&(r.components={...t.components,schemas:t.components.schemas}),r}),se.ASYNCAPI),c("message",ie,se.ASYNCAPI),c("payload",pe,se.ASYNCAPI),c("response",ue,se.ASYNCAPI);class he{getType;isLazyRef=!0;constructor(e){this.getType=e}get target(){return this.getType()}get schema(){return z(this.getType()).schema}get name(){return(0,d.nameOf)(this.getType())}}function le(e,r){return r.groups&&r.groups.length?(0,t.pascalCase)(`${e} ${r.groupsName||r.groups.join(" ")}`):e}function me(e,t,r){const s=function(e){const{host:t="#/"+([se.OPENAPI,se.ASYNCAPI].includes(e.specType)?"components/schemas":"definitions")}=e;return t}(r),n={$ref:`${s}/${e}`},i=t.isNullable,o=t.isReadOnly,a=t.isWriteOnly;if(i||o||a)switch(r.specType){case se.OPENAPI:return(0,d.cleanObject)({nullable:!!i||void 0,readOnly:!!o||void 0,writeOnly:!!a||void 0,oneOf:[n]});case se.JSON:return(0,d.cleanObject)({readOnly:o,writeOnly:a,oneOf:[n]})}return n}function de(e,t,r){const s=le(e.getName(),r);return(0,d.setValue)(r,`components.schemas.${s}`,t),me(s,e,r)}function fe(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof he)return u("lazyRef",[e],t);if(e instanceof $&&e.get("enum")instanceof $){const r=e.get("enum");return de(r,r.toJSON(t),t)}if(e.$kind&&e.$isJsonDocument){const r=u(l([e.$kind,"map"],t),[e],ae(t));return e.canRef?de(e,r,t):r}return u("object",[e],t)}function ge(e,t){const r=g.from(e.class),s=le(r.schema.getName()||e.getName(),t);if(e.hasGenerics){const{type:s,properties:n,additionalProperties:i,items:o,...a}=e.toJSON(t),c={...u("any",[r.schema],{...t,...ce(e),root:!1}),...a};if(c.title){const r=le(c.title,t);return(0,d.setValue)(t.components,`schemas.${r}`,c),delete c.title,me(r,e,t)}return c}return(0,d.getValue)(t,`components.schemas.${s}`)||((0,d.setValue)(t,`components.schemas.${s}`,{}),t.components.schemas[s]=u("any",[r.schema],ae({...t,root:!1}))),me(s,e,t)}function ye(e,t){const{generics:r}=t;if(r&&e.$ref&&r.has(e.$ref)){let s=r.get(e.$ref);if((0,d.isPrimitiveClass)(s))return{type:A(s)};if(s===Date)return{type:"string",format:"date-time"};if(s.toJSON)return s.toJSON({...t,generics:void 0});if(s===Object)return{type:"object"};if((0,d.isClass)(s)){const e={class:s};return 0===t.nestedGenerics.length?u("class",[e],{...t,generics:void 0}):u("schema",[g.from(e.class).schema],{...t,...ce(t),root:!1})}}return e}function Oe(e,{target:t,...r}){const s=Array.from(Y(t).entries()).filter((([e])=>(0,d.classOf)(e)!==(0,d.classOf)(t)));if(s.length){const t=s.reduce(((e,[,t])=>(0,d.deepMerge)(e,u("schema",[t.schema],r))),{});e=(0,d.deepMerge)(t,e)}return e}function Se(e,t){return e&&e.isClass?u("class",[e],t):u("any",[e],t)}function be(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return me(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const s=e.getType()&&u("schema",[e.schema],ae(t));return de(e.schema,s,t)}function Re(e,{ignore:t=[],...r}={}){return r=ae(r),Array.from(e.entries()).reduce(((e,[s,n])=>(t.includes(s)||(e[s]=u("item",[n],r)),e)),{})}function Ae(e,t){if((0,d.isBoolean)(e.$ignore)&&e.$ignore)return!0;let r=e?.$hooks?.alter("ignore",!1,[t]);return r||(!1!==t.groups?e?.$hooks?.alter("groups",!1,[t.groups]):r)}function Te(e,t,r){if(!t?.isNullable)return e;let s=[].concat(e.type).filter(Boolean);switch(r.specType){default:case se.JSON:e.discriminator||(e.oneOf?function(e){return e.oneOf.find((e=>"null"===e.type))}(e)||e.oneOf.unshift({type:"null"}):e.type=(0,d.uniq)(["null",...s]));break;case se.OPENAPI:e.nullable=!0,e.oneOf||(s.length>1?(e.oneOf=s.map((e=>({type:e}))),delete e.type):e.type=s[0])}return e}function Ee(e,t){const{specType:r,operationIdFormatter:s,root:n,components:i,genericTypes:o,nestedGenerics:a,useAlias:c,genericLabels:p,...h}=t;return Object.entries(e).reduce(((r,[s,n])=>{if(!1!==t.withIgnoredProps&&!Ae(n,h)){const i={...t,groups:e?.$forwardGroups||n?.$forwardGroups?t.groups:void 0};r[s]=u("item",[n],i),r[s]=Te(r[s],n,i)}return r}),(0,d.isArray)(e)?[]:{})}function Pe(e,t,r){return e.map((e=>u("item",[e],{...t,genericLabels:r.genericLabels})))}function ve(e,t,r){return e.isClass?u("class",[e],t):u("any",[e],{...t,genericLabels:r.genericLabels})}function Ce(e,t){return Object.entries(e).reduce(((e,[r,s])=>(e[r=t.get(r)||r]=s,e)),{})}function xe(e,t,r){return e.oneOf&&!1!==r.groups&&(e={...e,oneOf:t.$hooks.alter("oneOf",e.oneOf,[r.groups])}),!(e.oneOf||e.allOf||e.anyOf)||e.items||e.properties||delete e.type,e}function $e(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function we(e,t,r){if(r.groups&&r.groups.includes("partial"))return e.discriminator?{...e,required:[e.discriminator.propertyName]}:e;let s=function(e,t,r){let s=e.required||[];return s=[...s,...t.$required],t.get("properties")&&(s=Object.entries(t.get("properties")).reduce(((e,[t,r])=>r&&void 0!==r.$selfRequired?r.$selfRequired?e.concat(t):e.filter((e=>e===t)):e),s)),$e((0,d.uniq)(s),t,r)}(e,t,r);return s=(0,d.uniq)(s).reduce(function(e,t,r={}){const{useAlias:s}=r,n=Object.keys(e.properties||{});return(r,i)=>{const o=s&&t.alias.get(i)||i;if(n.includes(o)){const s=t.get("properties")[i],n=e.properties[o];return e.properties[o]=function(e,t){if(!t?.$allow.includes("")&&[].concat(t?.get("type")).includes("string")){const t=e?.minLength;if(void 0===t)return{...e,minLength:1}}return e}(n,s),r.concat(o)}return r}}(e,t,r),[]),e.discriminator&&s.push(e.discriminator.propertyName),s.length?{...e,required:s}:e}function Me(e,t,r){return r.inlineEnums&&e.enum?.$isJsonDocument&&(e.enum=e.enum.toJSON().enum),e.enum&&(e.type="object"===e.type||void 0===e.type?"string":e.type),e}c("any",fe),c("class",ge),c("generics",ye),c("inheritedClass",Oe),c("item",Se),c("lazyRef",be),c("map",Re),c("object",Ee),c("anyOf",Pe),c("allOf",Pe),c("oneOf",Pe),c("properties",ve),c("items",ve),c("additionalProperties",ve),c("propertyNames",ve),c("contains",ve),c("dependencies",ve),c("patternProperties",ve),c("additionalItems",ve),c("not",ve),c("definitions",ve);const _e=["name","$required","$hooks","_nestedGenerics",se.OPENAPI,se.SWAGGER,se.JSON],Ne=["const"];function De(e,t){const{options:r,addDef:s}=function(e){let t=!1;e||(t=!0,e={components:{schemas:{}},inlineEnums:!0});const{useAlias:r=!0,components:s={schemas:{}}}=e;return{addDef:t,options:e={...e,useAlias:r,components:s}}}(t),n=function(e,t){let r=function(e,t){const{useAlias:r}=t;return[...e.keys()].filter((e=>!function(e,{specType:t=se.JSON,customKeys:r=!1}){return _e.includes(e)||e.startsWith("#")&&(!1===r||t!==se.JSON)||t!==se.JSON&&Ne.includes(e)}(e,t))).reduce(((s,n)=>{let i=e.get(n);if("type"===(n=n.replace(/^#/,"")))return{...s,[n]:e.getJsonType()};if(function(e,t,r){return"examples"===e&&(0,d.isObject)(t)&&[se.OPENAPI,se.ASYNCAPI].includes(r.specType)}(n,i,t)&&(n="example",i=Object.values(i)[0]),i&&"object"==typeof i&&h(n)){if(i=u(n,[i],t,e),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(n,i))return s;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(n,i,r)&&(i=Ce(i,e.alias))}return{...s,[n]:i}}),{})}(e,t);return e.isClass&&(r=u("inheritedClass",[r],{...t,root:!1,target:e.getComputedType()})),r=u("generics",[r],{...t,root:!1}),e.has(t.specType)&&(r={...r,...e.get(t.specType).toJSON(t)}),r=we(r,e,t),r=Te(r,e,t),r=xe(r,e,t),r=Me(r,0,t),r}(e,r);return s&&Object.keys((0,d.getValue)(r,"components.schemas",{})).length&&(n.definitions=r.components.schemas),n}function Ie(e,t){const r={paths:u("paths",[e],t={...t,specType:se.OPENAPI})};return r.tags=(0,d.uniqBy)(t.tags,"name"),Object.keys((0,d.getValue)(t,"components.schemas",{})).length&&(r.components={schemas:t.components.schemas}),r}function Le(e,{jsonSchema:t}){const r={type:"string",format:"binary",oneOf:void 0};return"array"===t.type?(t.items=(0,d.cleanObject)({...t.items,...r}),e.schema=t,e):(e.schema=(0,d.cleanObject)({...t,...r}),e)}function ke(e,r){const s=function(e,t={}){return{...t,groups:e.groups,groupsName:e.groupsName}}(e,r),n={...s.components?.schemas||{}},{type:i,schema:o,...a}=u("map",[e],s),c=u("item",[e.$schema],{...s,...ce(e)});a.required=a.required||e.get("in")===I.PATH;const p={...s,jsonSchema:c,jsonParameter:e,oldSchemas:n},l=(0,t.camelCase)(`operationIn ${e.get("in")}`);return h(l)?u(l,[a],p):(a.schema=c,a)}function He(e,t){return e.flatMap((e=>u("operationInParameter",[e],t))).filter(Boolean)}function je(e,{jsonSchema:t,jsonParameters:r,...s}){if(t.$ref){if(!e.name)return function(e,{jsonParameter:t,...r}){const s=le(t.$schema.getName(),r),n=r.components?.schemas?.[s];return n&&!r.oldSchemas?.[s]&&delete r.components.schemas[t.$schema.getName()],Object.entries(n?.properties||{}).reduce(((t,[r,{description:s,...i}])=>[...t,(0,d.cleanObject)({...e,name:r,required:(n?.required||[]).includes(r),description:s,schema:i,style:i.$ref?"deepObject":void 0})]),[])}(e,s);e.style="deepObject"}return e.schema=t,e}c("schema",De),c("generate",Ie,se.OPENAPI),c("generate",Ie,se.SWAGGER),c("operationInFiles",Le),c("operationInParameter",ke),c("operationInParameters",He),c("operationInQuery",je);var qe=n(203),Ge=n.n(qe);const Ue=Ge().codes.reduce(((e,r)=>{const s=String(Ge()(r));return{...e,[String(r)]:{label:s,code:(0,t.constantCase)(s)}}}),{});function Be(e){return Ue[e]?.code}function Ke(e){return Ue[e]?.label}function Je(e,{tags:t=[],defaultTags:r=[],...s}={}){const{consumes:n,produces:i,...o}=u("map",[e],{...s,ignore:["parameters"]});o.security&&(o.security=[].concat(o.security)),0===e.get("responses").size&&(o.responses={200:{description:Ke(200)}});const a={...s,consumes:e.get("consumes")?.length?e.get("consumes"):["application/json"]},[c,p]=function(e,t){return e.get("parameters").filter((e=>k(e.get("in")))).reduce(((e,t)=>{const[r,s]=e;return[I.BODY,I.FILES].includes(t.get("in"))?[r,[...s,t]]:[[...r,t],s]}),[[],[]])}(e);o.parameters=u("operationInParameters",[c],s),p.length&&(o.requestBody=u("operationRequestBody",[p],a));const h=o.tags?.length?o.tags:r;return h.length&&(o.tags=h.map((({name:e})=>e))),t.push(...h),o}function Fe(e,t){return u("map",[e],{...t,groups:[...e.groups||[]],groupsName:e.groupsName})}Ue[200].label="Success",Ue[200].code="SUCCESS",c("operation",Je),c("operationMedia",Fe);class Ve extends D{$kind="operationRequestBody";constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",K(e)),this}addContent(e,t,r){const s=this.get("content"),n=new D;return n.set("schema",t),r&&n.set("examples",r),s.set(e,n),this}required(e){return this.set("required",e),this}}function We(e,{consumes:t,...r}){const{schema:s,examples:n,in:i,...o}=function(e,t){let r=new $;const s={},n=[];let i=0;return e.forEach((e=>{const o=e.getName();[...e.entries()].filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===s[e]&&(s[e]=t)}));const a=u("operationInParameter",[e],t);o?(r.addProperty(o,a.schema||{type:a.type}),e.get("required")&&r.addRequired(o),i++):n.push(a)})),i||1!==n.length?(r.type("object"),{schema:r.toJSON(t),required:!1,...s}):n[0]}(e,r),a=new Ve(o);return t.forEach((e=>{a.addContent(e,s,n)})),u("map",[a],r)}function Xe(e,t={}){const r=u("map",[e],t);return 204===e.status&&delete r.content,r.headers&&Object.entries(r.headers).forEach((([e,{type:t,...s}])=>{r.headers[e]={...s,schema:{type:t}}})),r}function ze(e,t){return e.map((e=>t.parameters.find((t=>t.in===e.in&&t.name===e.name))||e)).concat(...t.parameters.filter((e=>"path"!==e.in)))}function Qe(e,t=""){t instanceof RegExp&&(t=t.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const r=[],s=[];let n=!1,i="";return function(e){let t=0;return e.split("").filter((e=>{"("===e&&t++;const r=0===t;return")"===e&&t--,r})).join("").split("/").filter((e=>!!e))}(`${e}${t}`).map((e=>{const t=e.replace(":","").replace("?","");if(e.includes(":")){const o=e.includes("?");o&&!n&&(n=!0,s.push({path:i,parameters:[].concat(r)}));const{prefix:a,name:c,postfix:p}=function(e){const[t,r]=e.split("="),s=(r||t).split(".");return{prefix:r&&t?`${t}=`:"",name:s.splice(0,1)[0],postfix:s.length?`.${s.join(".")}`:""}}(t);i+=`/${a}{${c}}${p}`,r.push({in:"path",name:c,type:"string",required:!0}),o&&n&&s.push({path:i,parameters:[].concat(r)})}else i+=`/${e}`})),s.length?s:[{path:i,parameters:[].concat(r)}]}function Ye(e=""){const r=new Map;return(s,n,i="")=>{const o=((r,s)=>{const n=(e||"%c.%m").replace(/%c/,r).replace(/%m/,s);return""===e?(0,t.camelCase)(n):n})(s,n),a=s+n;if(!r.has(a))return r.set(a,0),o;const c=i.match(/{(\w+)}/gi);if(c){const e=s+n+c[0];if(!r.has(e))return r.set(e,0),(0,t.camelCase)(`${o} By ${c}`)}const p=r.get(a)+1;return r.set(a,p),`${o}_${p}`}}function Ze(e,{store:t,operationIdFormatter:r}){return r(t.parent.schema.get("name")||t.parent.targetName,t.propertyName,e)}c("operationRequestBody",We),c("operationResponse",Xe);const et=[e.ALL,e.GET,e.POST,e.PUT,e.PATCH,e.HEAD,e.OPTIONS,e.DELETE,e.TRACE];function tt(e,{path:t,method:r,operation:s}){return{...e,[t]:{...e[t],[r.toLowerCase()]:s}}}function rt(e,{paths:t,rootPath:r,...s}){const n=m(r+z(e).path);return s={...s,ctrlRootPath:n},[...Z(e).values()].filter(ee).filter((e=>e.operation.getAllowedOperationPath(et).length>0)).flatMap(function(e){return t=>{const r=t.operation.getAllowedOperationPath(et);if(0===r.length)return[];const s=u("operation",[t.operation],e);return r.map((e=>({operationPath:e,operation:s,operationStore:t})))}}(s)).flatMap(function(e){return({operationPath:t,operation:r,operationStore:s})=>{const{path:n,method:i}=t;return Qe(e.ctrlRootPath,n).map((({path:t,parameters:n})=>(t=t||"/",n=ze(n.map((({type:e,...t})=>({...t,schema:{type:e}}))),r),{operation:{...r,parameters:n,operationId:r.operationId||Ze(t,{...e,store:s})},method:i,path:t})))}}(s)).reduce(tt,t)}function st(e){return(...t)=>{const r=e(z(...t),t);"function"==typeof r&&r(...t)}}function nt(...e){return st((t=>{t.store.set("childrenControllers",e),e.forEach((e=>{d.Store.from(e).set("parentController",t.token)}))}))}function it(e,...r){return st((s=>{e=e||(0,t.snakeCase)(s.targetName),s.discriminatorAncestor&&s.schema.discriminatorValue(e,...r)}))}function ot(e,t){if(!e)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const r={};let s=!1;const n=(...n)=>{const i=g.from(...n);t&&(i.collectionType=t,i.schema.type(t)),i.type=e,i.itemSchema.type(e),i.schema.assign(r),i.isArray&&s&&(i.schema.set("contains",i.schema.get("items")),i.schema.delete("items"))};return n.MinItems=e=>(r.minItems=e,n),n.MaxItems=e=>(r.maxItems=e,n),n.MinProperties=e=>(r.minProperties=e,n),n.MaxProperties=e=>(r.maxProperties=e,n),n.Contains=()=>(s=!0,n),n.UniqueItems=(e=!0)=>(r.uniqueItems=e,n),n}function at(e){return ot(e,Array)}function ct(e){return ot(e,Map)}function pt(e){return ot(e).Contains()}function ut(e){return st((t=>{const r=t.parentSchema.get("#errorMessage")||{};t.parentSchema.customKey("errorMessage",{...r,...e})}))}function ht(e,t){const r={};return(...s)=>{const n=(0,d.useDecorators)(t(...s));return n.Error=t=>(r.message=t,(0,d.useDecorators)(n,r.message&&ut({[e]:t}))),n}}c("paths",rt);const lt=ht("maxItems",(e=>{if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return st((t=>{t.schema.maxItems(e)}))})),mt=ht("maxProperties",(e=>{if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return st((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))})),dt=ht("minItems",(e=>{if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return st((t=>{t.schema.minItems(e)}))})),ft=ht("minProperties",(e=>{if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return st((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))})),gt=ht("uniqueItems",((e=!0)=>st((t=>{t.schema.uniqueItems(e)}))));function yt(e){return st(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function Ot(...e){return st((t=>{t.itemSchema.allOf(e)}))}function St(e){return st((t=>{e&&(((0,d.isClass)(e)||(0,d.isArrowFn)(e))&&(t.type=e),t.itemSchema.type(e))}))}function bt(...e){const t=e.find((e=>(0,d.isClass)(e)));return(0,d.useDecorators)(t&&St(t),st(((t,r)=>{t.schema.allow(...e),t.decoratorType===d.DecoratorTypes.PARAM&&(t.required=!0),t.decoratorType===d.DecoratorTypes.PROP&&t.parentSchema.addRequired(t.propertyName)})))}function Rt(...e){return st((t=>{t.itemSchema.any(...e)}))}function At(...e){return st((t=>{t.itemSchema.anyOf(e)}))}function Tt(e){return st((t=>{t.itemSchema.const(e)}))}function Et(e,t){return st((r=>{r.itemSchema.customKey(e,t)}))}function Pt(e){return st((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function vt(e){return st((t=>{t.itemSchema.default(e)}))}function Ct(e){return(0,d.useDecorators)(ut({_:e}))}function xt(e){return st(((t,r)=>{switch((0,d.decoratorTypeOf)(r)){case d.DecoratorTypes.PROP:case d.DecoratorTypes.CLASS:t.schema.description(e);break;case d.DecoratorTypes.PARAM:t.parameter.description(e);break;case d.DecoratorTypes.METHOD:t.operation?.description(e)}}))}function $t(){return(0,d.useDecorators)(St(),st((e=>{e.discriminatorKey()})))}const wt=ht("enum",(function(e,...t){return st((r=>{r.itemSchema.enum(e,...t)}))}));function Mt(...e){return st((t=>{t.schema.examples(e)}))}function _t(e){return st((t=>{t.parameter.examples(e)}))}const Nt=ht("maximum",((e,t=!1)=>st((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)})))),Dt=Nt,It=ht("exclusiveMaximum",((e,t=!0)=>Nt(e,t))),Lt=ht("minimum",((e,t=!1)=>st((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)})))),kt=Lt,Ht=ht("exclusiveMinimum",((e,t=!0)=>Lt(e,t)));var jt;!function(e){e.DATE_TIME="date-time",e.DATE="date",e.TIME="time",e.EMAIL="email",e.HOSTNAME="hostname",e.IPV4="ipv4",e.IPV6="ipv6",e.URI="uri",e.URL="url",e.URI_REF="uri-reference",e.URI_TEMPLATE="uri-template",e.JSON_POINTER="json-pointer",e.RELATIVE_JSON_POINTER="relative-json-pointer",e.UUID="uuid",e.REGEX="regex"}(jt||(jt={}));const qt=ht("format",(e=>st((t=>{t.itemSchema.format(e)})))),Gt=ht("format",(()=>qt(jt.EMAIL))),Ut=ht("format",(()=>qt(jt.DATE_TIME))),Bt=ht("format",(()=>qt(jt.DATE))),Kt=ht("format",(()=>qt(jt.TIME))),Jt=ht("format",(()=>qt(jt.URI))),Ft=ht("format",(()=>qt(jt.URL)));function Vt(e=!0){return st((t=>{t.schema.$forwardGroups=e}))}var Wt=n(133),Xt=n.n(Wt);function zt(e,t){t=[].concat(t),e=[].concat(e);let r=new Set,s=new Set,n=new Set,i=0,o=e=>{n.add(e.output)};for(let n=0;n<t.length;n++){let a=Xt()(String(t[n]),{onResult:o},!0),c=a.state.negated||a.state.negatedExtglob;c&&i++;for(let t of e){let e=a(t,!0);(c?!e.isMatch:e.isMatch)&&(c?r.add(e.output):(r.delete(e.output),s.add(e.output)))}}return!!(i===t.length?[...n]:[...s]).filter((e=>!r.has(e))).length}function Qt(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),s=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&zt(r,t))||!!s.length&&!zt(e.filter((e=>!e.startsWith("!"))),t)}function Yt(...e){return st((t=>{switch(t.decoratorType){case d.DecoratorTypes.CLASS:!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{Yt(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(e,t);break;case d.DecoratorTypes.PROP:t.schema.$hooks.on("groups",((t,r)=>!(t||!Qt(e,r))||t));break;case d.DecoratorTypes.PARAM:let r="";2==e.length&&(0,d.isArray)(e[1])&&(r=e[0],e=e[1]),t.parameter.groups=e,t.parameter.groupsName=r}}))}function Zt(){return(0,d.StoreSet)("hidden",!0)}function er(e=!0){return st((t=>{t.schema.ignore(e)}))}function tr(){return st((e=>{e.itemSchema.type("integer")}))}const rr=ht("maxLength",(e=>{if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return st((t=>{t.itemSchema.maxLength(e)}))})),sr=ht("minLength",(e=>{if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return st((t=>{t.itemSchema.minLength(e)}))})),nr=ht("multipleOf",(e=>{if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return st((t=>{t.itemSchema.multipleOf(e)}))}));function ir(e){return st(((t,r)=>{switch((0,d.decoratorTypeOf)(r)){case d.DecoratorTypes.CLASS:t.schema.name(e);break;case d.DecoratorTypes.PARAM:t.parameter.name(e);break;default:t.parent.schema.addAlias(r[1],e)}}))}function or(e,...t){return t=[e,...t],(0,d.useDecorators)(1===t.length&&St(t[0]),Rt(null,...t))}function ar(...e){return st((t=>{t.itemSchema.oneOf(e),t.type=Object}))}function cr(){return st((e=>{switch(e.decoratorType){case d.DecoratorTypes.PARAM:e.required=!1;break;case d.DecoratorTypes.PROP:e.parentSchema.removeRequired(e.propertyName)}}))}const pr=ht("pattern",(e=>st((t=>{t.itemSchema.pattern(e)}))));function ur(e=!0){return st((t=>{t.itemSchema.readOnly(e)}))}function hr(e){return st((t=>{Object.entries(e).forEach((([e,r])=>{t.schema.set(e,r)}))}))}function lr(e,t){return st((r=>{r.schema.set(e,t)}))}function mr(e,...t){return hr({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}const dr=ht("required",((e=!0,...t)=>e?bt(...t):cr()));function fr(...e){return st((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,s)=>Qt(e,s)?r.filter((e=>e!==t.propertyKey)):r))}))}function gr(e){return st((t=>{t.schema.title(e)}))}function yr(e){return st((()=>(0,d.useDecorators)(ut({type:e}))))}function Or(e=!0){return st((t=>{t.itemSchema.writeOnly(e)}))}function Sr(e=Object){if((0,d.isClass)(e)){const{schema:t}=z(e);return t.properties=function(t){return Object.entries(t).forEach((([t,r])=>{z(e.prototype,t).schema.assign(r)})),this},t}return $.from({type:e})}function br(){return Sr(Number)}function Rr(){return Sr(Number).integer()}function Ar(){return Sr(String)}function Tr(){return Sr(Boolean)}function Er(){return Sr(Date).format(jt.DATE)}function Pr(){return Sr(Date).format(jt.DATE_TIME)}function vr(){return Sr(Date).format(jt.TIME)}function Cr(){return Sr(String).format(jt.EMAIL)}function xr(){return Sr(String).format(jt.URI)}function $r(){return Sr(String).format(jt.URL)}function wr(){return Sr(Array)}function Mr(){return Sr(Map).unknown(!0)}function _r(){return Sr(Array).uniqueItems(!0)}function Nr(e={}){return Sr(Object).properties(e)}function Dr(...e){return Sr().any(...e)}function Ir(...e){return Sr().anyOf(e)}function Lr(...e){return Sr().oneOf(e)}function kr(...e){return Sr().allOf(e)}function Hr(e){try{if(e())return g.from(e()).schema}catch(e){}return new he(e)}function jr(e){const t=Ar().enum(e);return S.set(e,t),t}function qr(...e){const t=[e.map((e=>function(e){return(0,d.isObject)(e)&&!("toJSON"in e)}(e)?Ar().enum(Object.values(e)):e))],r=(...e)=>{g.from(...e).nestedGenerics=t};return r.Nested=(...e)=>(t.push(e),r),r}function Gr(...e){return t=>{g.from(t).schema.genericLabels=e}}function Ur(...e){return st(((t,r)=>{switch(t.decoratorType){case d.DecoratorTypes.METHOD:t.operation.produces(e);break;case d.DecoratorTypes.CLASS:(0,d.decorateMethodsOf)(r[0],Ur(...e));break;default:throw new d.UnsupportedDecoratorType(Ur,r)}}))}function Br(...e){return(0,d.useDecorators)(Ur(...e),(0,d.StoreSet)("acceptMimes",e))}function Kr(...e){return st(((t,r)=>{switch(t.decoratorType){case d.DecoratorTypes.METHOD:t.operation.consumes(e);break;case d.DecoratorTypes.CLASS:(0,d.decorateMethodsOf)(r[0],Kr(...e));break;default:throw new d.UnsupportedDecoratorType(Kr,r)}}))}class Jr extends Map{methods;decoratorType;entity;actions=[];constructor(e={}){super(),Object.entries(e).forEach((([e,t])=>{this.set(e,t)}))}addAction(e){return this.actions.push(e),this}build(){const e=(...t)=>this.bind(t,e),r=t=>{return r=(...e)=>{t in this?this[t](...e):this.set(t,e[0])},(...t)=>(r(...t),e);var r};return this.methods.forEach((s=>{e[(0,t.pascalCase)(s)]=r(s)})),e}toObject(){return[...this.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{})}getMergedKey(e,t){let r=this.get(e)||t;if(r)return this.decoratorType===d.DecoratorTypes.CLASS&&(r={...r,...t||{}}),{...t||{},...r}}bind(e,t){this.entity=g.from(...e),this.beforeInit(),this.onInit(e,t),this.afterInit()}onInit(e,t){this.forEach(((e,t)=>{this.onMapKey(t,e)}))}onMapKey(e,t){this.entity.set(e,t)}runActions(){return this.actions.forEach((e=>{e(this)})),this}beforeInit(){}afterInit(){}}const Fr=new Map;function Vr(e,t){Fr.set(e,t)}function Wr(e){return Fr.get(e)}function Xr(e){return e.map((e=>function(e){return(0,d.isObject)(e)&&!("toJSON"in e)}(e)?Ar().enum(Object.values(e)):e))}class zr extends Jr{methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location"];constructor({status:e,model:t}){super(),this.model(t),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&Ke(e)&&!this.get("description")&&(this.set("description",Ke(e)),this.get("model")||this.model(Wr(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...B(e)}),this}header(e,t){return this.headers({[e]:t})}location(e,t={}){return this.headers({Location:{...t,value:e}}),this}groups(...e){return 2===e.length&&(0,d.isArray)(e[1])?(this.set("groupsName",e[0]),this.set("groups",e[1])):this.set("groups",e),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const t=this.get("model");return this.checkPrimitive(t),this.checkCollection(t),this.addAction((t=>{this.get("schema").nestedGenerics.push(Xr(e))})),this}of(...e){const t=this.get("model");return this.checkPrimitive(t),this.addAction((()=>{const r=this.get("schema");(0,d.isCollection)(t)?r?.itemSchema({type:e[0]}):r?.nestedGenerics.push(Xr(e))})),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction((()=>{this.get("schema").assign(e)})),this}examples(e){return this.set("examples",(0,d.isString)(e)?[e]:e),this}title(e){return this.schema({title:e})}checkPrimitive(e){if((0,d.isPrimitiveOrPrimitiveClass)(e))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(e){if((0,d.isCollection)(e))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const e=this.get("model");let t=this.get("contentType");return!e||(0,d.isPlainObject)(e)||(0,d.isPrimitiveOrPrimitiveClass)(e)||(t=t||"application/json"),t}getStatus(){return this.get("status")||"default"}onInit(e,t){switch((0,d.decoratorTypeOf)(e)){case d.DecoratorTypes.METHOD:this.entity=g.from(...e),this.entity.operation&&this.map();break;case d.DecoratorTypes.CLASS:this.decoratorType=d.DecoratorTypes.CLASS,(0,d.decorateMethodsOf)(e[0],t)}}map(){const e=this.get("model"),{entity:t,decoratorType:r}=this,s=this.entity.operation,n=this.getStatus(),i=s.ensureResponseOf(n),o=this.getContentType();let{description:a=i.get("description")}=this.toObject();a&&(a=r===d.DecoratorTypes.CLASS&&i.get("description")||a,i.description(a));const c=this.getMergedKey("headers",i.get("headers"));return c&&i.headers(c),this.mapMedia(i),(G(this.get("status"))||"default"===n)&&e&&(t.type=e),o&&s.addProduce(o),this.runActions()}mapMedia(e){const t=this.getContentType(),r=this.get("model"),s=e.getMedia(t||"*/*"),n=s.get("schema")||new $({type:r}),i=this.get("groups"),o=this.get("groupsName"),a=this.get("allowedGroups"),c=this.entity.operation;if(r&&((0,d.isArray)(r)?n.oneOf(r.map((e=>({type:e})))):n.type(r)),this.set("schema",n),s.schema(n),s.groups=i,s.groupsName=o,a){s.allowedGroups=a;const e=new H;e.in("query").name("includes"),e.schema($.from({type:"array",items:{type:"string",enum:[...a]}})),c.addParameter(-1,e)}const p=this.get("examples");return p&&s.examples(p),s}manyOf(e,t){const r=this.get("model");return this.addAction((()=>{const s=this.get("schema");(0,d.isCollection)(r)?(s.type(r||Object),s.itemSchema().set(e,t)):s.set(e,t)})),this}}function Qr(e,t){return new zr({status:e,model:t}).build()}function Yr(e){return Qr().ContentType(e)}function Zr(e=!0){return st(((t,r)=>{switch((0,d.decoratorTypeOf)(r)){case d.DecoratorTypes.METHOD:t.operation.deprecated(e);break;case d.DecoratorTypes.CLASS:(0,d.decorateMethodsOf)(r[0],Zr(e));break;case d.DecoratorTypes.PARAM:t.parameter.set("deprecated",e);break;case d.DecoratorTypes.PROP:t.schema.set("deprecated",e);break;default:throw new d.UnsupportedDecoratorType(Zr,r)}}))}function es(e,t){return void 0!==t&&(e={[e]:t}),Qr().Headers(e)}function ts(e){const t=new H,r={},s=(n,i,o)=>{const a=g.from(n,i,o);switch(a.decoratorType){case d.DecoratorTypes.PARAM:a.parameter.in(e);break;case d.DecoratorTypes.METHOD:t.in(e),a.operation.addParameter(-1,t),t.schema($.from(r));break;case d.DecoratorTypes.CLASS:(0,d.decorateMethodsOf)(n,s);break;default:throw new d.UnsupportedDecoratorType(ts,[n,i,o])}};return s.Type=e=>(r.type=e,s),s.Name=e=>(t.name(e),s),s.Description=e=>(t.description(e),s),s.Required=(e=!0)=>(t.required(e),s),s.Pattern=e=>s.Schema({pattern:e.toString()}),s.Schema=e=>(Object.assign(r,e),s),s}function rs(e){return(...t)=>{const[r,s,n]=t,i=d.Metadata.getParamTypes(r,s)[n]===Array,o=[e="object"==typeof e?void 0:e,!i&&"0"].filter(Boolean).join(".");(0,d.useDecorators)(ts(I.FILES),ir(o),(0,d.useMethodDecorators)(Qr(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),Kr("multipart/form-data")))(...t)}}function ss(e,t){return Qr().Location(e,t)}const ns=new Set([...Object.keys(e).filter((t=>t!==e.CUSTOM)).map((e=>e.toLowerCase()))]);function is(e){let t,r;const s=e.filter((e=>"string"==typeof e&&ns.has(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:s}}class os extends Jr{methods=["name","description","summary","method","id","use","useAfter","useBefore"];beforeInit(){const t=this.get("path"),r=e[this.get("method")]||e.CUSTOM;t&&this.entity.operation.addOperationPath(r,t)}onMapKey(e,t){switch(e){case"name":case"id":return void this.entity.operation.operationId(t);case"summary":return void this.entity.operation.summary(t);case"description":return void this.entity.operation.description(t);case"use":return void this.entity.use(t);case"useAfter":return void this.entity.after(t);case"useBefore":return void this.entity.before(t)}return super.onMapKey(e,t)}}function as(...e){const t=is(e);return new os(t).build()}function cs(e){return st(((t,r)=>{if(t.decoratorType!==d.DecoratorTypes.METHOD)throw new d.UnsupportedDecoratorType(cs,r);t.operation.operationId(e)}))}function ps(e,t="/"){return st(((r,s)=>{if(r.decoratorType!==d.DecoratorTypes.METHOD)throw new d.UnsupportedDecoratorType(ps,s);r.operation.addOperationPath(e.toUpperCase(),t)}))}function us(){return Yt("partial")}function hs(e){return st(((t,r)=>{if(t.decoratorType!==d.DecoratorTypes.CLASS)throw new d.UnsupportedDecoratorType(hs,r);t.path=e}))}function ls(t){return as(e.PUBLISH,t)}function ms(...e){const{status:t,url:r,meta:s}=e.reduce(((e,t)=>(0,d.isNumber)(t)?(e.status=t,e):(0,d.isString)(t)?(e.url=t,e):(e.meta=t,e)),{status:302,url:"",meta:{}});return(0,d.useDecorators)(Qr(t).Location(r,s),st((e=>{e.operation?.setRedirection(t)})))}const ds=as;function fs(t="/",...r){return as(...[e.ALL,t].concat(r))}function gs(t="/",...r){return as(...[e.GET,t].concat(r))}function ys(t="/",...r){return as(...[e.POST,t].concat(r))}function Os(t="/",...r){return as(...[e.PUT,t].concat(r))}function Ss(t="/",...r){return as(...[e.DELETE,t].concat(r))}function bs(t="/",...r){return as(...[e.HEAD,t].concat(r))}function Rs(t="/",...r){return as(...[e.PATCH,t].concat(r))}function As(t="/",...r){return as(...[e.OPTIONS,t].concat(r))}function Ts(e,...t){return st(((r,s)=>{switch(r.decoratorType){case d.DecoratorTypes.METHOD:r.operation.addSecurityScopes(e,t);break;case d.DecoratorTypes.CLASS:(0,d.decorateMethodsOf)(s[0],Ts(e,...t));break;default:throw new d.UnsupportedDecoratorType(Ts,s)}}))}function Es(e,t){return Qr(e,t)}function Ps(t){return as(e.SUBSCRIBE,t)}function vs(e){return st(((t,r)=>{if(t.decoratorType!==d.DecoratorTypes.METHOD)throw new d.UnsupportedDecoratorType(vs,r);t.operation.summary(e)}))}function Cs(...e){return st(((t,r)=>{switch(t.decoratorType){case d.DecoratorTypes.METHOD:t.operation.addTags(function(e){return e.map((e=>"string"==typeof e?{name:e}:e))}(e));break;case d.DecoratorTypes.CLASS:(0,d.decorateMethodsOf)(r[0],Cs(...e));break;default:throw new d.UnsupportedDecoratorType(Cs,r)}}))}function xs(e,t){return(0,d.StoreSet)("view",{path:e,options:t})}function $s(e,t){if(e instanceof RegExp||t instanceof RegExp){if(!e)return t;if(!t)return e;const r=e instanceof RegExp?e:new RegExp(e,"gi"),s=t instanceof RegExp?t:new RegExp(t,"gi");return new RegExp(r.source+s.source,(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":""))}e&&t&&e.endsWith("/")&&t.startsWith("/")&&(t=t.slice(1));const r=(e||"")+(t||"");return r.endsWith("/")&&r.length>1?r.slice(0,-1):r}class ws{token;endpoint;operationPath;basePath;paramsTypes;constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){return this.operationPath?.path}get fullPath(){return $s(this.basePath,this.path)}get method(){return this.operationPath?.method||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}const Ms=(0,d.mergeReducerBuilder)(((e,t)=>e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),_s=(0,d.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),Ns=(0,d.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),Ds=(0,d.mergeReducerBuilder)(((e,t)=>e.name===t.name)),Is={security:Ns,parameters:_s,oneOf:Ms,anyOf:Ms,allOf:Ms,tags:Ds};function Ls(e,t){return(0,d.deepMerge)(e,t,{reducers:Is,cleanUndefinedProps:!0})}const ks=new Map;function Hs(e,t={}){if(t={specType:se.OPENAPI,...t,tags:[],paths:{},channels:{},components:{},operationIdFormatter:t.operationIdFormatter||Ye(t.operationIdPattern),root:!1},(0,d.isArray)(e)){let r={};return t={...t,append(e){r=Ls(r,e)}},e.forEach((({token:e,...r})=>{const s=Hs(e,{...t,...r});t.append(s)})),r}return function(e,t,r){ks.has(e)||ks.set(e,new Map);const s=ks.get(e),n=JSON.stringify(t);return s.has(n)||s.set(n,r()),s.get(n)}(e,t,(()=>function(e,t){const r=z(e),{rootPath:s="/"}=t;return t={...t,rootPath:s,defaultTags:[(0,d.cleanObject)({name:r.schema.getName(),description:r.schema.get("description")})]},u("generate",[r],t)}(e,t)))}function js(e){return e.startsWith("3.")?se.OPENAPI:se.SWAGGER}function qs(e){return"openapi"in e?se.OPENAPI:se.SWAGGER}function Gs(e){const{title:t,description:r,version:s,termsOfService:n,contact:i,license:o}=e;return(0,d.cleanObject)({version:s,title:t,description:r,termsOfService:n,contact:i,license:o})}function Us(e,{version:t,specVersion:r,acceptMimes:s=["application/json"]}){const{paths:n,security:i,tags:o,host:a,basePath:c,schemes:p,consumes:u=[],produces:h=["application/json"],definitions:l,parameters:m,responses:f,securityDefinitions:g,externalDocs:y}=e;return{swagger:r,consumes:(0,d.uniq)([...s,...u]),produces:(0,d.uniq)([...h]),info:Gs((0,d.getValue)(e,"info",{})),paths:n,host:a,basePath:c,schemes:p,definitions:l,parameters:m,responses:f,security:i,securityDefinitions:g,tags:o,externalDocs:y}}function Bs(e,{specVersion:t}){const{servers:r,paths:s,components:n,security:i,tags:o,externalDocs:a}=e;return{openapi:t,info:Gs((0,d.getValue)(e,"info",{})),servers:r,paths:s,components:n,security:i,tags:o,externalDocs:a}}function Ks(e,{fileSpec:t,acceptMimes:r,specVersion:s,version:n}){const i={specVersion:s=s||(0,d.getValue)(e,"openapi",(0,d.getValue)(e,"swagger","2.0")),acceptMimes:r};switch(js(s)){case se.OPENAPI:e=Bs(e,i),t=t?Bs(t,i):t;break;default:case se.SWAGGER:e=Us(e,i),t=t?Us(t,i):t}return e=Ls(e,t),(0,d.setValue)(e,"info.title",(0,d.getValue)(e,"info.title","Api documentation")),(0,d.setValue)(e,"info.version",(0,d.getValue)(e,"info.version",n)),e}const Js=["get","put","post","delete","options","head","patch","trace"],Fs=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],Vs=["type","items"],Ws=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,Xs={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function zs(e){if(Array.isArray(e))e.forEach(zs);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):zs(e[t])}function Qs(e){return new RegExp(Ws,"i").test(e)}function Ys(e){const t=Object.keys(Xs).map((e=>Xs[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||Qs(e)))}function Zs(e){function t(e){const{scheme:t,type:r,name:s,bearerFormat:n,flows:i,...o}=e;switch(r){case"http":if("basic"===t)return{...o,type:t};if("bearer"===t)return{...o,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const e=Object.keys(i)[0],s=i[e];let n=e;return"clientCredentials"===n?n="application":"authorizationCode"===n&&(n="accessCode"),{type:r,flow:n,authorizationUrl:s.authorizationUrl,tokenUrl:s.tokenUrl,scopes:s.scopes}}}return Object.entries(e).reduce(((e,[r,s])=>({...e,[r]:t(s)})),{})}function en(e){let t=e.url;const r=e.variables||{};for(const e in r){const s=r[e]||{};if(s.default){const r=RegExp(`{${e}}`,"g");t=t.replace(r,s.default)}}const s=new URL(t);return{host:s.host?s.host:void 0,basePath:s.pathname,schemes:null!==s.protocol?[s.protocol.substring(0,s.protocol.length-1)]:void 0}}class tn{spec;constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?en(e):{}}resolveReference(e,t,r){if(!t||!t.$ref)return t;const s=t.$ref;if(s.startsWith("#")){const t=s.split("/").map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~")));t.shift();let n=e;return t.forEach((e=>{n=n[e]})),r?JSON.parse(JSON.stringify(n)):n}}convert(){const e={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,zs(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],(0,d.cleanObject)({...e,...this.spec})}convertOperations(e,t){return Object.entries(e).reduce(((e,[r,s])=>{const n=e[r]=this.resolveReference({...t,paths:e},s,!0);return this.convertParameters(n),Object.keys(n).forEach((r=>{if(Js.indexOf(r)>=0){const s=n[r]=this.resolveReference({...t,paths:e},n[r],!0);this.convertOperationParameters(s),this.convertResponses(s)}})),e}),e)}convertOperationParameters(e){let t,r,s,n;if(e.parameters=e.parameters||[],e.requestBody){let i=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const t=Ys(e.requestBody.content)[0],r={content:{}},s=e.requestBody.content[t];s&&s.schema&&s.schema.$ref&&!s.schema.$ref.startsWith("#")&&(i=this.resolveReference(this.spec,s.schema,!0),r.content[`${t}`]={schema:i},i=r)}if(i.name="body",t=i.content,t&&Object.keys(t).length){if(s=Object.keys(t).filter((e=>e.indexOf("/")>0)),n=s.filter((e=>e.indexOf("*")<0)),r=Ys(t)[0],delete i.content,[Xs.APPLICATION_X_WWW_URLENCODED,Xs.MULTIPART_FORM_DATA].includes(r))if(e.consumes=n,i.in="formData",i.schema=t[r].schema,i.schema=this.resolveReference(this.spec,i.schema,!0),"object"===i.schema.type&&i.schema.properties){const t=i.schema.required||[];Object.keys(i.schema.properties).forEach((r=>{const s=i.schema.properties[r];if(!s.readOnly){const n={name:r,in:"formData",schema:s};t.indexOf(r)>=0&&(n.required=!0),e.parameters?.push(n)}}))}else e.parameters.push(i);else r?(e.consumes=n,i.in="body",i.schema=t[r].schema,e.parameters.push(i)):s&&(e.consumes=n||["application/octet-stream"],i.in="body",i.name=i.name||"file",delete i.type,i.schema=t[s[0]].schema||{type:"string",format:"binary"},e.parameters.push(i));i.schema&&this.convertSchema(i.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){void 0!==e.parameters&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach(((t,r)=>{if("body"!==(t=e.parameters[r]=this.resolveReference(this.spec,t,!1)).in){if(this.copySchemaProperties(t,Fs),this.copySchemaProperties(t,Vs),this.copySchemaXProperties(t),!t.description){const e=this.resolveReference(this.spec,t.schema,!1);e&&e.description&&(t.description=e.description)}void 0!==t.example&&(t["x-example"]=t.example),delete t.schema,delete t.allowReserved,delete t.example}if("array"===t.type)switch(t.style||("query"===t.in||"cookie"===t.in?"form":"simple")){case"matrix":t.collectionFormat=t.explode?void 0:"csv";break;case"label":t.collectionFormat=void 0;break;case"simple":t.collectionFormat="csv";break;case"spaceDelimited":t.collectionFormat="ssv";break;case"pipeDelimited":t.collectionFormat="pipes";break;case"deepOpbject":t.collectionFormat="multi";break;case"form":t.collectionFormat=!1===t.explode?"csv":"multi"}delete t.style,delete t.explode})))}copySchemaProperties(e,t){let r=this.resolveReference(this.spec,e.schema,!0);r&&t.forEach((t=>{const s=r[t];"additionalProperties"===t&&"boolean"==typeof s||void 0!==s&&(e[t]=s)}))}copySchemaXProperties(e){let t=this.resolveReference(this.spec,e.schema,!0);t&&Object.keys(t).forEach((r=>{Reflect.hasOwnProperty.call(t,r)&&!Reflect.hasOwnProperty.call(e,r)&&r.startsWith("x-")&&(e[r]=t[r])}))}convertResponses(e){Object.keys(e.responses||{}).forEach((t=>{const r=e.responses[t]=this.resolveReference(this.spec,e.responses[t],!0);if(r.content){let t=null,s=null;if(Object.keys(r.content).forEach((n=>{const i=n.indexOf("*")<0?n:"application/octet-stream";e.produces?e.produces.indexOf(i)<0&&e.produces.push(i):e.produces=[i];const o=r.content[n];t=t||o.schema,!s&&Qs(i)&&(s=o.schema),o.example&&(r.examples=r.examples||{},r.examples[i]=o.example)})),t){r.schema=s||t;const e=this.resolveReference(this.spec,r.schema,!0);e&&r.schema.$ref&&!r.schema.$ref.startsWith("#")&&(r.schema=e),this.convertSchema(r.schema,"response")}}Object.keys(r.headers||{}).forEach((e=>{const t=this.resolveReference(this.spec,r.headers[e],!0);t.schema&&(t.type=t.schema.type,t.format=t.schema.format,delete t.schema),r.headers[e]=t})),delete r.content}))}convertSchema(e,t){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const r in e.allOf)this.convertSchema(e.allOf[r],t);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach((r=>{!0===e.properties[r].writeOnly&&"response"===t?delete e.properties[r]:(this.convertSchema(e.properties[r],t),delete e.properties[r].writeOnly)}));break;case"array":e.items&&this.convertSchema(e.items,t)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),void 0!==e.deprecated&&(void 0===e["x-deprecated"]&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach((e=>{this.convertSchema(this.spec.definitions[e])})),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach((t=>{const r=e[t];if("string"!=typeof r)return void console.warn(`Ignoring ${r} for ${t} in discriminator.mapping.`);let s;if(/^[a-zA-Z0-9._-]+$/.test(r))try{s=this.resolveReference(this.spec,{$ref:`#/components/schemas/${r}`},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} as schema name in discriminator.mapping: ${e}`)}if(!s)try{s=this.resolveReference(this.spec,{$ref:r},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} in discriminator.mapping: ${e}`)}s?(s["x-discriminator-value"]=t,s["x-ms-discriminator-value"]=t):console.warn(`Unable to resolve ${r} for ${t} in discriminator.mapping.`)}))}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=Zs(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function rn(e){return new tn(e).convert()}async function sn({tokens:e,...t}){const{version:r="1.0.0",acceptMimes:s,specPath:n,specVersion:i}=t,o=Ks((0,d.getValue)(t,"spec",{}),{fileSpec:{},version:r,specVersion:i,acceptMimes:s}),a=qs(o),c=Ls(o,Hs(e,t));return a===se.SWAGGER?rn(c):c}const nn="$cache:schemes";function on(e,t={}){const r=z(e),s=t.specType||se.JSON;return t={endpoint:!0,groups:[],inlineEnums:s===se.JSON,...t,specType:s,components:{schemas:{}}},"parameter"===r.decoratorType&&(t={...t,genericTypes:r.nestedGenerics[0],nestedGenerics:r.nestedGenerics,groups:r.parameter?.groups}),function(e,t){const r=e.store.get(nn)||new Map,s=function(e){return JSON.stringify(e)}(t);if(!r.has(s)){const n=u("schema",[e.schema],t);Object.keys((0,d.getValue)(t,"components.schemas",{})).length&&(n.definitions=t.components.schemas),r.set(s,n)}return e.store.set(nn,r),r.get(s)}(r,t)}function an(e,t={}){const r=e.isStore?e:z(e),s=$s(t.basePath,r.path);let n=[];return t.withChildren&&(n=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(an(r,{...t,basePath:s}))),n)),[...Z(e).values()].reduce(((r,n)=>{const{operation:i}=n;return i&&i.getAllowedOperationPath(t.allowedVerbs).forEach((t=>{r.push(new ws({basePath:s,token:e,endpoint:n,operationPath:t}))})),r}),n)}function cn(e){const t=e.isStore?e:z(e);if(!t.$properties){const e=Y(t);t.$properties=new Map,e.forEach((e=>{e.children.forEach((e=>{t.$properties.has(e.propertyKey)||t.$properties.set(e.propertyKey,e)}))}))}return t.$properties}function pn(e,t={}){const r=cn(e),s=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&Ae(e.itemSchema,t)||s.set(r,e)})),s}})(),i})()));
|
|
3
3
|
//# sourceMappingURL=schema.umd.min.js.map
|