{"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.CancellationDetails = void 0;\nconst Exports_js_1 = require(\"../common.speech/Exports.js\");\nconst CancellationDetailsBase_js_1 = require(\"./CancellationDetailsBase.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\n/**\n * Contains detailed information about why a result was canceled.\n * @class CancellationDetails\n */\nclass CancellationDetails extends CancellationDetailsBase_js_1.CancellationDetailsBase {\n constructor(reason, errorDetails, errorCode) {\n super(reason, errorDetails, errorCode);\n }\n /**\n * Creates an instance of CancellationDetails object for the canceled RecognitionResult.\n * @member CancellationDetails.fromResult\n * @function\n * @public\n * @param {RecognitionResult | SpeechSynthesisResult} result - The result that was canceled.\n * @returns {CancellationDetails} The cancellation details object being created.\n */\n static fromResult(result) {\n let reason = Exports_js_2.CancellationReason.Error;\n let errorCode = Exports_js_2.CancellationErrorCode.NoError;\n if (result instanceof Exports_js_2.RecognitionResult && !!result.json) {\n const simpleSpeech = Exports_js_1.SimpleSpeechPhrase.fromJSON(result.json);\n reason = Exports_js_1.EnumTranslation.implTranslateCancelResult(simpleSpeech.RecognitionStatus);\n }\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])];\n }\n return new CancellationDetails(reason, result.errorDetails || Exports_js_1.EnumTranslation.implTranslateErrorDetails(errorCode), errorCode);\n }\n}\nexports.CancellationDetails = CancellationDetails;","map":{"version":3,"names":["Object","defineProperty","exports","value","CancellationDetails","Exports_js_1","require","CancellationDetailsBase_js_1","Exports_js_2","CancellationDetailsBase","constructor","reason","errorDetails","errorCode","fromResult","result","CancellationReason","Error","CancellationErrorCode","NoError","RecognitionResult","json","simpleSpeech","SimpleSpeechPhrase","fromJSON","EnumTranslation","implTranslateCancelResult","RecognitionStatus","properties","getProperty","CancellationErrorCodePropertyName","implTranslateErrorDetails"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/CancellationDetails.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.CancellationDetails = void 0;\nconst Exports_js_1 = require(\"../common.speech/Exports.js\");\nconst CancellationDetailsBase_js_1 = require(\"./CancellationDetailsBase.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\n/**\n * Contains detailed information about why a result was canceled.\n * @class CancellationDetails\n */\nclass CancellationDetails extends CancellationDetailsBase_js_1.CancellationDetailsBase {\n constructor(reason, errorDetails, errorCode) {\n super(reason, errorDetails, errorCode);\n }\n /**\n * Creates an instance of CancellationDetails object for the canceled RecognitionResult.\n * @member CancellationDetails.fromResult\n * @function\n * @public\n * @param {RecognitionResult | SpeechSynthesisResult} result - The result that was canceled.\n * @returns {CancellationDetails} The cancellation details object being created.\n */\n static fromResult(result) {\n let reason = Exports_js_2.CancellationReason.Error;\n let errorCode = Exports_js_2.CancellationErrorCode.NoError;\n if (result instanceof Exports_js_2.RecognitionResult && !!result.json) {\n const simpleSpeech = Exports_js_1.SimpleSpeechPhrase.fromJSON(result.json);\n reason = Exports_js_1.EnumTranslation.implTranslateCancelResult(simpleSpeech.RecognitionStatus);\n }\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])];\n }\n return new CancellationDetails(reason, result.errorDetails || Exports_js_1.EnumTranslation.implTranslateErrorDetails(errorCode), errorCode);\n }\n}\nexports.CancellationDetails = CancellationDetails;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY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