"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/libs/classNames")),_utils=require("./utils");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:String(t)}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}var _notification=null;(0,_baseComponent.default)({useFunc:!0,data:_utils.defaults,computed:{classes:["prefixCls",function(t){return{wrap:(0,_classNames.default)(t),content:"".concat(t,"__content"),hd:"".concat(t,"__hd"),image:"".concat(t,"__image"),bd:"".concat(t,"__bd"),title:"".concat(t,"__title"),text:"".concat(t,"__text"),ft:"".concat(t,"__ft")}}]},methods:{hide:function(){this.$$setData({in:!1}),"function"==typeof this.fns.onClose&&this.fns.onClose(this.data.data)},show:function(){function t(){_notification&&_notification.hide.call(n)}var n=this,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=new Promise(function(t){var e=n.$$mergeOptionsAndBindMethods(Object.assign({},_utils.defaults,o));n.$$setData(_objectSpread({in:!0},e)),_notification&&(clearTimeout(_notification.timeout),_notification=null),(_notification={hide:n.hide}).timeout=setTimeout(function(){return n.hide(),t(!0)},e.duration)});return t.then=function(t,e){return i.then(t,e)},t.promise=i,t},onClick:function(){"function"==typeof this.fns.onClick&&this.fns.onClick(this.data.data)}}});