"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.default=setNavLeftText;var _invoker=_interopRequireWildcard(require("./invoker")),_getContainerType=_interopRequireDefault(require("./getContainerType"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_getRequireWildcardCache=function(e){return e?n:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_getRequireWildcardCache(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function setNavLeftTextHandler(e,t){var n=t.resolve,r=t.reject,i=t.context,a=t.containerType,o=t.appType,u=t.platformType,l=t.watch;if(a){var s=function(t){e.onSuccess&&e.onSuccess(),_invoker.default.handleBridgeResponse(t,n,r)},f=function(e){_invoker.default.handleBridgeResponse(e,n,r)};o===_invoker.API_INVOKER_TYPE.MINI_APP?i&&i({m:"biz.navigation.setLeft",args:e,onSuccess:s,onFail:f}):u===_invoker.PLATFORM_TYPE_ENUM.ANDROID?i&&i(s,f,"biz.navigation","setLeft",e):u===_invoker.PLATFORM_TYPE_ENUM.IOS&&i.callHandler("biz.navigation.setLeft",Object.assign({},e),(function(e){!l&&n(e)}))}else i&&i.call("setNavLeftText",e,(function(){n()}))}function setNavLeftText(e){var t=(0,_getContainerType.default)();return _invoker.default.invoke("setNavLeftText",t===_invoker.Container_Type_Enum.isDingTalk?Object.assign({watch:!0,show:!0,control:!1,showIcon:!0,text:""},e):e,{dingTalkAPIName:t===_invoker.Container_Type_Enum.isDingTalk?"biz.navigation.setLeft":null})}_invoker.default.registerAPI("setNavLeftText",{mini:setNavLeftTextHandler,mobile:setNavLeftTextHandler,pc:function(e,t){window.dingtalk.platform.invokeAPI(t.msgId,"biz.navigation.setLeft",e)}}),setNavLeftText.version={ios:"1.2.0",pc:"1.2.0"},module.exports=exports.default,module.exports.default=exports.default;