"use strict";exports.__esModule=!0,exports.default=toast;var _invoker=_interopRequireWildcard(require("./invoker"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r: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 r=_getRequireWildcardCache(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(o,a,i):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o}function toastHandler(e,t){var r=t.resolve,o=t.reject,n=t.context,a=t.containerType,i=t.platformType,u=t.appType,s={type:"error"===e.icon?"fail":"success"===e.icon?"success":"none",content:e.text,duration:1e3*e.duration,taurusToastStyle:e.taurusToastStyle};if(a){var l=function(){_invoker.default.handleBridgeResponse({errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{}},r,o)},d=function(e){_invoker.default.handleBridgeResponse(e,r,o)};u===_invoker.API_INVOKER_TYPE.MINI_APP?n&&n({m:"taurus.common.toast",args:s,onSuccess:l,onFail:d}):i===_invoker.PLATFORM_TYPE_ENUM.ANDROID?n&&n(l,d,"taurus.common","toast",s):i===_invoker.PLATFORM_TYPE_ENUM.IOS&&n.callHandler("taurus.common.toast",Object.assign({},s),(function(){_invoker.default.handleBridgeResponse({errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{}},r,o)}))}else n&&n.call("toast",s,(function(){_invoker.default.handleBridgeResponse({errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{}},r,o)}))}function toast(e){return _invoker.default.invoke("toast",e)}_invoker.default.registerAPI("toast",{mobile:toastHandler,mini:toastHandler,pc:function(e,t){var r=e.icon,o=e.text,n=e.duration,a=e.delay;window.dingtalk.platform.invokeAPI(t.msgId,"device.notification.toast",{type:r,text:o,duration:n,delay:a})}}),toast.version={android:"1.3.2",ios:"1.3.2"},module.exports=exports.default,module.exports.default=exports.default;