/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/react-native-mqq@3.5.0/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{NativeModules,NativeEventEmitter,Platform}from"react-native";const{QQAPI:QQAPI}=NativeModules,QQAPIEmitter=new NativeEventEmitter(QQAPI);function translateError(e,t){return e?"object"==typeof e?e instanceof Error?this.reject(ret):this.reject(Object.assign(new Error(e.message),{errCode:e.errCode})):"string"==typeof e?this.reject(new Error(e)):void this.reject(Object.assign(new Error,{origin:e})):this.resolve(t)}export const isQQInstalled=QQAPI.isQQInstalled;export const isQQSupportApi=QQAPI.isQQSupportApi;let savedCallback;function waitForResponse(e){return new Promise(((t,r)=>{savedCallback&&savedCallback("User canceled."),savedCallback=o=>{if(o.type===e)if(savedCallback=void 0,0!==o.errCode){const e=new Error(o.errMsg);e.errCode=o.errCode,r(e)}else{const{type:e,...r}=o;t(r)}}}))}QQAPIEmitter.addListener("QQ_Resp",(e=>{const t=savedCallback;savedCallback=void 0,t&&t(e)}));export function login(e){return QQAPI.login(e).then((()=>waitForResponse("QQAuthorizeResponse")))}export function shareToQQ(e={}){return QQAPI.shareToQQ(e).then((()=>waitForResponse("QQShareResponse")))}export function shareToQzone(e={}){return QQAPI.shareToQzone(e).then((()=>waitForResponse("QQShareResponse")))}export function logout(){QQAPI.logout()}export function init(){QQAPI.initSDK()}
//# sourceMappingURL=/sm/3ada9f3d1833d2bfe2fc2416e252c176036481978c5f55e08fa75e21847a0aaf.map