"use strict";var a=b(require("../utils/generator"));Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMixedContentMessage=g,exports.getOauthErrorMessage=e;function b(a){return a&&a.__esModule?a:{default:a}}function c(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function d(a){return function(){var b=this,d=arguments;return new Promise(function(e,f){function g(a){c(i,e,f,g,h,"next",a)}function h(a){c(i,e,f,g,h,"throw",a)}var i=a.apply(b,d);g(void 0)})}}function e(){return f.apply(this,arguments)}function f(){return f=d(regeneratorRuntime.mark(function b(c,d){var e,f,g,h;return regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return e={invalid_client:d("invalid_client"),unauthorized_client:d("invalid_client"),access_denied:d("access_denied"),invalid_scope:d("invalid_scope"),invalid_grant:d("invalid_grant"),generic_invoke_error:d("generic_invoke_error"),"404_not_found":d("404_not_found"),fetch_error:d("explorer_cors")},f=c,g=f.data&&f.data.error?f.data.error:f.text?f.text:f.status&&404===f.status?"404_not_found":f.message&&f.message.includes("Failed to fetch")?"fetch_error":"generic_invoke_error",b.next=5,a["default"].highlight(e[g],null);case 5:return h=b.sent,f.highlightedText={__html:h.value},b.abrupt("return",f);case 8:case"end":return b.stop();}},b)})),f.apply(this,arguments)}function g(){return h.apply(this,arguments)}function h(){return h=d(regeneratorRuntime.mark(function b(c){var d,e;return regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return d={},b.next=3,a["default"].highlight(c("mixedcontent_error",null));case 3:return e=b.sent,d.highlightedText={__html:e.value},b.abrupt("return",d);case 6:case"end":return b.stop();}},b)})),h.apply(this,arguments)}