"use strict";function AndroidBridgeCall(e,i,r){weex_1.requireModule("wxNbBridge").exec({action:e,data:i},function(e){r&&r(e)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.weexNbBridge=void 0;var weex_1=require("./weex"),useAlipayJSBridge={call:AndroidBridgeCall};"undefined"!=typeof AlipayJSBridge&&(useAlipayJSBridge=AlipayJSBridge),exports.weexNbBridge=function(e,i){return new Promise(function(r,n){var t=e,c=i.onSuccess,a=i.success,d=i.onFail,s=i.fail;delete i.onSuccess,delete i.success,delete i.onFail,delete i.fail;var o=t.split("."),l=o.pop()||"",u=o.join(".");useAlipayJSBridge.call("ddExec",{actionName:l,serviceName:u,args:i},function(e){if(!e||!e.success)return s?s():d&&d(),n();try{var i=e.content;return i?(i=JSON.parse(e.content),a?a(i):c&&c(i)):a?a():c&&c(),r(i)}catch(e){return s?s(e):d&&d(e),n(e)}})})};