(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesM/comps/canvas/poster"],{"0bc7":function(n,t,e){"use strict";e.r(t);var o=e("bd98"),i=e("51f3");for(var a in i)"default"!==a&&function(n){e.d(t,n,(function(){return i[n]}))}(a);var s,c=e("f0c5"),r=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],s);t["default"]=r.exports},"51f3":function(n,t,e){"use strict";e.r(t);var o=e("b84d"),i=e.n(o);for(var a in o)"default"!==a&&function(n){e.d(t,n,(function(){return o[n]}))}(a);t["default"]=i.a},b84d:function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(){e.e("pagesM/comps/canvas/index").then(function(){return resolve(e("c9f9"))}.bind(null,e)).catch(e.oe)},i={components:{WeCanvas:o},props:{config:{type:Object,default:{}},preload:{type:Boolean,default:!1}},data:function(){return{}},methods:{trigger:function(n,t){this.listener&&"function"===typeof this.listener[n]&&this.listener[n](t)},once:function(n,t){"undefined"===typeof this.listener&&(this.listener={}),this.listener[n]=t},downloadResource:function(n){var t=this;return new Promise((function(e,o){n&&(t.downloadStatus=null);var i=t.$refs.poster;t.downloadStatus&&"fail"!==t.downloadStatus?"success"===t.downloadStatus?e():(t.once("downloadSuccess",(function(){return e()})),t.once("downloadFail",(function(n){return o(n)}))):i.downloadResource(t.config.images).then((function(){t.downloadStatus="success",e()})).catch((function(n){return o(n)}))}))},onCreate:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.downloadResource("boolean"===typeof e&&e).then((function(){n.hideLoading();var e=t.$refs.poster;e.create(t.config)})).catch((function(e){n.hideLoading(),n.showToast({icon:"none",title:e.errMsg||"生成失败"}),console.error(e),t.$emit("fail",e)}))},onCreateSuccess:function(n){this.$emit("success",n)},onCreateFail:function(n){console.error(n),this.$emit("fail",n)}},onReady:function(){var n=this;if(this.preload){var t=this.$refs.poster;this.downloadStatus="doing",t.downloadResource(this.config.images).then((function(){n.downloadStatus="success",n.trigger("downloadSuccess")})).catch((function(t){n.downloadStatus="fail",n.trigger("downloadFail",t)}))}}};t.default=i}).call(this,e("543d")["default"])},bd98:function(n,t,e){"use strict";var o;e.d(t,"b",(function(){return i})),e.d(t,"c",(function(){return a})),e.d(t,"a",(function(){return o}));var i=function(){var n=this,t=n.$createElement;n._self._c},a=[]}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pagesM/comps/canvas/poster-create-component',
    {
        'pagesM/comps/canvas/poster-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('543d')['createComponent'](__webpack_require__("0bc7"))
        })
    },
    [['pagesM/comps/canvas/poster-create-component']]
]);
