/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/react-native-mqq@3.5.1/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=NativeModules.QQAPI||NativeModules.RCTQQAPI,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/5b931b23c3929add05fd51183a4de73e6a73498416a26a956b2bb253ee2c4b68.map