"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.default=getWaterMarkV2;var _generateWaterMarkV=_interopRequireDefault(require("./packages/h5-watermark/generateWaterMarkV2")),_getWaterMarkConfig=_interopRequireDefault(require("./utils/getWaterMarkConfig")),_getWaterMarkConfigV=_interopRequireDefault(require("./getWaterMarkConfigV2")),_watermark=require("./packages/h5-watermark/watermark"),_version=_interopRequireDefault(require("./version")),_compareVersion=_interopRequireDefault(require("./utils/compareVersion"));function getWaterMarkV2(e){return new Promise((function(r,t){(0,_version.default)().then((function(a){var n=a.version;-1!==(0,_compareVersion.default)(n,"2.8.0")?(0,_getWaterMarkConfigV.default)({pageInfo:e}).then((function(a){try{var n=(0,_generateWaterMarkV.default)(a,e);r(n)}catch(e){t(e)}})):(0,_getWaterMarkConfig.default)({pageInfo:e}).then((function(a){try{var n=(0,_watermark.generateWatermark)(a,e);r(n)}catch(e){t(e)}}))})).catch((function(){(0,_getWaterMarkConfig.default)({pageInfo:e}).then((function(a){try{var n=(0,_watermark.generateWatermark)(a,e);r(n)}catch(e){t(e)}}))}))}))}module.exports=exports.default,module.exports.default=exports.default;