"use strict";exports.__esModule=!0,exports.default=startTraceReport;var _invoker=_interopRequireWildcard(require("./invoker"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}function startTraceReportHandler(e,r){var t=r.resolve,n=r.reject,o=r.context,a=r.containerType,i=r.platformType,u=r.appType,s=_invoker.default.registerEvent(_invoker.CONTINUOUS_EVENT_LIST.UPDATE_TRACE,(function(r){var t=r.data;t.errorCode&&t.errorCode!==_invoker.BRIDGE_ERROR_CODE.SUCCESS?e.onFail&&e.onFail(t):e.onSuccess&&e.onSuccess(t.result||t)}));if(a){var c=function(r){_invoker.default.registerContinuesEvent(e.traceId,s),_invoker.default.handleBridgeResponse(r,t,n)},d=function(r){_invoker.default.registerContinuesEvent(e.traceId,s),_invoker.default.handleBridgeResponse(r,t,n)};u===_invoker.API_INVOKER_TYPE.MINI_APP?o&&o({m:"taurus.common.startTraceReport",args:e,onSuccess:c,onFail:d}):i===_invoker.PLATFORM_TYPE_ENUM.ANDROID?o&&o(c,d,"taurus.common","startTraceReport",e):i===_invoker.PLATFORM_TYPE_ENUM.IOS&&o.callHandler("taurus.common.startTraceReport",Object.assign({},e),(function(r){_invoker.default.registerContinuesEvent(e.traceId,s),_invoker.default.handleBridgeResponse(r,t,n)}))}else o&&o.call("startTraceReport",e,(function(r){_invoker.default.registerContinuesEvent(e.traceId,s),_invoker.default.handleBridgeResponse(r,t,n)}))}function startTraceReport(e){return _invoker.default.invoke("startTraceReport",e)}_invoker.default.registerAPI("startTraceReport",{mobile:startTraceReportHandler,mini:!0}),startTraceReport.version={android:"1.3.4",ios:"1.3.4"},module.exports=exports.default,module.exports.default=exports.default;