{"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VoiceProfileCancellationDetails = exports.VoiceProfileResult = void 0;\n/* eslint-disable max-classes-per-file */\nconst Exports_js_1 = require(\"../common.speech/Exports.js\");\nconst Contracts_js_1 = require(\"./Contracts.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\n/**\n * Output format\n * @class VoiceProfileResult\n */\nclass VoiceProfileResult {\n constructor(reason, statusText) {\n this.privReason = reason;\n this.privProperties = new Exports_js_2.PropertyCollection();\n if (reason === Exports_js_2.ResultReason.Canceled) {\n Contracts_js_1.Contracts.throwIfNullOrUndefined(statusText, \"statusText\");\n this.privErrorDetails = statusText;\n this.privProperties.setProperty(Exports_js_1.CancellationErrorCodePropertyName, Exports_js_2.CancellationErrorCode[Exports_js_2.CancellationErrorCode.ServiceError]);\n }\n }\n get reason() {\n return this.privReason;\n }\n get properties() {\n return this.privProperties;\n }\n get errorDetails() {\n return this.privErrorDetails;\n }\n}\nexports.VoiceProfileResult = VoiceProfileResult;\n/**\n * @class VoiceProfileCancellationDetails\n */\nclass VoiceProfileCancellationDetails extends Exports_js_2.CancellationDetailsBase {\n constructor(reason, errorDetails, errorCode) {\n super(reason, errorDetails, errorCode);\n }\n /**\n * Creates an instance of VoiceProfileCancellationDetails object for the canceled VoiceProfileResult.\n * @member VoiceProfileCancellationDetails.fromResult\n * @function\n * @public\n * @param {VoiceProfileResult} result - The result that was canceled.\n * @returns {VoiceProfileCancellationDetails} The cancellation details object being created.\n */\n static fromResult(result) {\n const reason = Exports_js_2.CancellationReason.Error;\n let errorCode = Exports_js_2.CancellationErrorCode.NoError;\n if (!!result.properties) {\n errorCode = Exports_js_2.CancellationErrorCode[result.properties.getProperty(Exports_js_1.CancellationErrorCodePropertyName, Exports_js_2.CancellationErrorCode[Exports_js_2.CancellationErrorCode.NoError])]; //eslint-disable-line\n }\n return new VoiceProfileCancellationDetails(reason, result.errorDetails, errorCode);\n }\n}\nexports.VoiceProfileCancellationDetails = VoiceProfileCancellationDetails;","map":{"version":3,"names":["Object","defineProperty","exports","value","VoiceProfileCancellationDetails","VoiceProfileResult","Exports_js_1","require","Contracts_js_1","Exports_js_2","constructor","reason","statusText","privReason","privProperties","PropertyCollection","ResultReason","Canceled","Contracts","throwIfNullOrUndefined","privErrorDetails","setProperty","CancellationErrorCodePropertyName","CancellationErrorCode","ServiceError","properties","errorDetails","CancellationDetailsBase","errorCode","fromResult","result","CancellationReason","Error","NoError","getProperty"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/VoiceProfileResult.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VoiceProfileCancellationDetails = exports.VoiceProfileResult = void 0;\n/* eslint-disable max-classes-per-file */\nconst Exports_js_1 = require(\"../common.speech/Exports.js\");\nconst Contracts_js_1 = require(\"./Contracts.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\n/**\n * Output format\n * @class VoiceProfileResult\n */\nclass VoiceProfileResult {\n constructor(reason, statusText) {\n this.privReason = reason;\n this.privProperties = new Exports_js_2.PropertyCollection();\n if (reason === Exports_js_2.ResultReason.Canceled) {\n Contracts_js_1.Contracts.throwIfNullOrUndefined(statusText, \"statusText\");\n this.privErrorDetails = statusText;\n this.privProperties.setProperty(Exports_js_1.CancellationErrorCodePropertyName, Exports_js_2.CancellationErrorCode[Exports_js_2.CancellationErrorCode.ServiceError]);\n }\n }\n get reason() {\n return this.privReason;\n }\n get properties() {\n return this.privProperties;\n }\n get errorDetails() {\n return this.privErrorDetails;\n }\n}\nexports.VoiceProfileResult = VoiceProfileResult;\n/**\n * @class VoiceProfileCancellationDetails\n */\nclass VoiceProfileCancellationDetails extends Exports_js_2.CancellationDetailsBase {\n constructor(reason, errorDetails, errorCode) {\n super(reason, errorDetails, errorCode);\n }\n /**\n * Creates an instance of VoiceProfileCancellationDetails object for the canceled VoiceProfileResult.\n * @member VoiceProfileCancellationDetails.fromResult\n * @function\n * @public\n * @param {VoiceProfileResult} result - The result that was canceled.\n * @returns {VoiceProfileCancellationDetails} The cancellation details object being created.\n */\n static fromResult(result) {\n const reason = Exports_js_2.CancellationReason.Error;\n let errorCode = Exports_js_2.CancellationErrorCode.NoError;\n if (!!result.properties) {\n errorCode = Exports_js_2.CancellationErrorCode[result.properties.getProperty(Exports_js_1.CancellationErrorCodePropertyName, Exports_js_2.CancellationErrorCode[Exports_js_2.CancellationErrorCode.NoError])]; //eslint-disable-line\n }\n return new VoiceProfileCancellationDetails(reason, result.errorDetails, errorCode);\n }\n}\nexports.VoiceProfileCancellationDetails = VoiceProfileCancellationDetails;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,+BAA+B,GAAGF,OAAO,CAACG,kBAAkB,GAAG,KAAK,CAAC;AAC7E;AACA,MAAMC,YAAY,GAAGC,OAAO,CAAC,6BAA6B,CAAC;AAC3D,MAAMC,cAAc,GAAGD,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAME,YAAY,GAAGF,OAAO,CAAC,cAAc,CAAC;AAC5C;AACA;AACA;AACA;AACA,MAAMF,kBAAkB,CAAC;EACrBK,WAAWA,CAACC,MAAM,EAAEC,UAAU,EAAE;IAC5B,IAAI,CAACC,UAAU,GAAGF,MAAM;IACxB,IAAI,CAACG,cAAc,GAAG,IAAIL,YAAY,CAACM,kBAAkB,CAAC,CAAC;IAC3D,IAAIJ,MAAM,KAAKF,YAAY,CAACO,YAAY,CAACC,QAAQ,EAAE;MAC/CT,cAAc,CAACU,SAAS,CAACC,sBAAsB,CAACP,UAAU,EAAE,YAAY,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A+B,GAAGA,+BAA+B","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}