(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-home-sign"],{"009a":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={lSignature:n("afa7").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"sign"},[n("v-uni-view",{staticStyle:{width:"100vw",height:"100vh"}},[n("l-signature",{ref:"signatureRef",attrs:{disableScroll:!0,backgroundColor:"#ddd",penColor:t.penColor,penSize:t.penSize,landscape:!0,openSmooth:t.openSmooth}})],1),n("v-uni-view",{staticClass:"btn"},[n("v-uni-button",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onClick("clear")}}},[t._v("清空")]),n("v-uni-button",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onClick("undo")}}},[t._v("撤消")]),n("v-uni-button",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onClick("save")}}},[t._v("保存")])],1)],1)},r=[]},"1dac":function(t,e,n){var i=n("2ede");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("3672c525",i,!0,{sourceMap:!1,shadowMode:!1})},"24db":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("a9e3");var i={styles:String,disableScroll:{type:Boolean,default:!0},type:{type:String,default:"2d"},penColor:{type:String,default:"black"},penSize:{type:Number,default:2},backgroundColor:String,openSmooth:Boolean,minLineWidth:{type:Number,default:2},maxLineWidth:{type:Number,default:6},minSpeed:{type:Number,default:1.5},maxWidthDiffRate:{type:Number,default:20},maxHistoryLength:{type:Number,default:20},beforeDelay:{type:Number,default:0},landscape:{type:Boolean},boundingBox:{type:Boolean}};e.default=i},"2c89":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.userRegister=e.updateUserInfo=e.smsSend=e.smsCheck=e.privacyPolicy=e.orderPay=e.orderDetail=e.logout=e.loginApi=e.getgoodsDetail=e.getWarehouseList=e.getUserProfitStatistic=e.getUserProfitList=e.getUserInfo=e.getUserFansStatistic=e.getUserFansOrderStatistic=e.getUserFansOrderList=e.getUserFansList=e.getUserCommissionStatistic=e.getUserCommissionList=e.getUserCommissionApi=e.getSellerOrderList=e.getGoodsList=e.getBuyerOrderList=e.getArea=e.getAddrList=e.getAddrDesc=e.forgetPsw=e.editAddr=e.deleteAddr=e.createOrder=e.couponList=e.changePassword=e.cancelOrder=e.addAddr=void 0;var i=uni.$u.http;e.smsSend=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/sms/send",t,e)};e.smsCheck=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/sms/check",t,e)};e.userRegister=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/user/register",t,e)};e.loginApi=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/user/login",t,e)};e.privacyPolicy=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/addons/shopro/data.richtext/index",t,e)};e.forgetPsw=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.post("/api/user/resetpwd",t,e)};e.getUserInfo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserinfo",t,e)};e.getAddrList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/index",t,e)};e.getArea=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/data.area/index",t,e)};e.addAddr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/add",t,e)};e.editAddr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/edit",t,e)};e.deleteAddr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/delete",t,e)};e.getAddrDesc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.address/detail",t,e)};e.changePassword=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.user/changePassword",t,e)};e.logout=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/logout",t,e)};e.updateUserInfo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/updateUserInfo",t,e)};e.couponList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/addons/shopro/user.coupon/index",t,e)};e.getUserCommissionStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserCommissionStatistic",t,e)};e.getUserCommissionApi=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserCommission",t,e)};e.getUserCommissionList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserCommissionList",t,e)};e.getUserFansStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansStatistic",t,e)};e.getUserFansList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansList",t,e)};e.getUserFansOrderStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansOrderStatistic",t,e)};e.getUserFansOrderList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserFansOrderList",t,e)};e.getUserProfitStatistic=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserProfitStatistic",t,e)};e.getUserProfitList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/user/getUserProfitList",t,e)};e.getWarehouseList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/getWarehouseList",t,e)};e.getGoodsList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/getGoodsList",t,e)};e.getgoodsDetail=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/goodsDetail",t,e)};e.getBuyerOrderList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/getBuyerOrderList",{params:t},e)};e.getSellerOrderList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/getSellerOrderList",{params:t},e)};e.createOrder=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/createOrder",t,e)};e.cancelOrder=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.post("/api/order/cancelOrder",t,e)};e.orderDetail=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/orderDetail",{params:t},e)};e.orderPay=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{custom:{auth:!0}};return i.get("/api/order/orderPay",{params:t},e)}},"2ede":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 主要颜色 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.lime-signature[data-v-65d7357f],\r\n.lime-signature__canvas[data-v-65d7357f]{width:100%;height:100%}.offscreen[data-v-65d7357f]{position:fixed;top:0;left:9999px}',""]),t.exports=e},3654:function(t,e,n){"use strict";n.r(e);var i=n("009a"),a=n("f8c4");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("c766");var o=n("f0c5"),s=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"5739059a",null,!1,i["a"],void 0);e["default"]=s.exports},"4c18":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.uniContext=e.toDataURL=e.createImage=void 0,e.useCurrentPage=function(){var t=getCurrentPages();return t[t.length-1]};var a=i(n("5530")),r=i(n("d4ec")),o=i(n("bee2"));n("99af"),n("d3b7");e.uniContext=function(t,e){var n=uni.createCanvasContext(t,e);return n.uniDrawImage||(n.uniDrawImage=n.drawImage,n.drawImage=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(i,r){var o=n.canavs,s=(0,a.default)((0,a.default)({},n),{},{canvasId:t,success:function(t){i(t.tempFilePath)},fail:function(t){r(t)}});o&&o.toTempFilePath?o.toTempFilePath(s):uni.canvasToTempFilePath(s,e)}))}},"6d74":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("ffb8")),r=a.default;e.default=r},"79f7":function(t,e,n){"use strict";n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("d3b7"),n("d401"),n("81b2"),n("0eb6"),n("b7ef"),n("8bd4"),n("fb6a"),n("14d9"),n("ace4"),n("5cc6"),n("907a"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("986a"),n("1d02"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("b39a"),n("72f7"),n("3ca3"),n("ddb0"),n("2b3d"),n("9861");n("a5ba");var i=n("2c89"),a={data:function(){return{title:"Hello",penColor:"#000000",penSize:5,picurl:"",landscape:!0,openSmooth:!1}},methods:{onClick:function(t){"openSmooth"!=t?"save"!=t?this.$refs.signatureRef&&this.$refs.signatureRef[t]():this.$refs.signatureRef.canvasToTempFilePath({success:function(t){console.log(t.isEmpty),console.log(t);t.tempFilePath.split(",")[1]}}):this.openSmooth=!this.openSmooth},saveSignPic:function(){(0,i.updateUserInfo)({sign_image:this.picurl}).then((function(t){console.log(t,"ooooo")}))},base64ToBlob:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.b64data,n=void 0===e?"":e,i=t.contentType,a=void 0===i?"":i,r=t.sliceSize,o=void 0===r?512:r;return new Promise((function(t,e){for(var i=atob(n),r=[],s=0;s1&&void 0!==arguments[1]?arguments[1]:{},n="boundingClientRect",i=e.context,a=e.type,r=void 0===a?n:a;return new Promise((function(e,a){var o=uni.createSelectorQuery().in(i).select(t),s=function(t){t?e(t):a()};r==n?o[r](s).exec():o[r]({node:!0,size:!0,rect:!0},s).exec()}))},e.requestAnimationFrame=void 0,e.sleep=function(t){return new Promise((function(e){return setTimeout(e,t)}))},e.wrapEvent=void 0;var a=i(n("3835"));function r(t,e){t=t.split("."),e=e.split(".");var n=Math.max(t.length,e.length);while(t.lengthr)return 1;if(ae;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){return s="function"==typeof Symbol&&"symbol"==(0,a.default)(Symbol.iterator)?function(t){return(0,a.default)(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":(0,a.default)(t)},s(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function h(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function v(t,e){return v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},v(t,e)}function p(t,e){if(e&&("object"==(0,a.default)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=f(t);if(e){var a=f(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return p(this,n)}}n("b64b"),n("a4d3"),n("4de4"),n("d3b7"),n("e439"),n("14d9"),n("159b"),n("dbb4"),n("1d1c"),n("7a82"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("d9e2"),n("d401"),n("131a"),n("3410"),n("f8c9"),n("4ae1"),n("a434"),n("acd8"),n("a9e3"),n("cb29"),n("fb6a");var m=function(t){var e=s(t);return null!==t&&"object"===e||"function"===e},y={}.toString,b=function(t,e){return y.call(t)==="[object "+e+"]"},w=function(t){return b(t,"String")},x=function(t){return b(t,"Number")},S=function(t){return b(t,"Function")},_=function(){function t(){u(this,t),this.__events=void 0,this.__events={}}return h(t,[{key:"on",value:function(t,e){if(t&&e){var n=this.__events[t]||[];n.push(e),this.__events[t]=n}}},{key:"emit",value:function(t,e){var n=this;if(m(t)&&(t=(e=t)&&e.type),t){var i=this.__events[t];i&&i.length&&i.forEach((function(t){t.call(n,e)}))}}},{key:"off",value:function(t,e){var n=this.__events,i=n[t];if(i&&i.length)if(e)for(var a=0,r=i.length;r>a;a++)i[a]===e&&(i.splice(a,1),a--);else delete n[t]}},{key:"getEvents",value:function(){return this.__events}}]),t}(),E=function(t){l(n,_);var e=g(n);function n(t,i){var a;return u(this,n),(a=e.call(this)).context=void 0,a.canvas=void 0,a.attrs=void 0,a.isCanvasElement=void 0,a.context=t,a.canvas=i.canvas||t.canvas||{width:i.width||0,height:i.height||0},a.attrs=i||{},a.isCanvasElement=!0,a}return h(n,[{key:"width",get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},{key:"height",get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}},{key:"getContext",value:function(){return this.context}},{key:"getBoundingClientRect",value:function(){var t=this.attrs||{},e=t.top,n=t.right,i=t.width,a=t.height,r=t.left,o=t.bottom;return{top:void 0===e?0:e,width:void 0===i?0:i,right:void 0===n?0:n,height:void 0===a?0:a,bottom:void 0===o?0:o,left:void 0===r?0:r}}},{key:"setAttribute",value:function(t,e){this.attrs[t]=e}},{key:"addEventListener",value:function(t,e){this.on(t,e)}},{key:"removeEventListener",value:function(t,e){this.off(t,e)}},{key:"dispatchEvent",value:function(t,e){this.emit(t,e)}}]),n}();function L(t,e){try{return t.currentStyle?t.currentStyle[e]:document.defaultView&&document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}catch(t){return{width:300,height:150}[e]}}function P(t,e){var n=e.get("el");if(!n)return t;var i=n.getBoundingClientRect(),a=i.top,r=void 0===a?0:a,o=i.left,s=void 0===o?0:o,u=parseFloat(L(n,"padding-left"))||0,c=parseFloat(L(n,"padding-top"))||0;return{x:t.x-s-u,y:t.y-r-c}}function k(t,e){var n=e.get("landscape");if(!n)return t;if(S(n))return n(t,e);var i=e.get("height");return{x:t.y,y:i-t.x}}var C=function(t,e){var n=t.touches;if(!n||!n.length)return[k(P({x:t.clientX,y:t.clientY},e),e)];n.length||(n=t.changedTouches||[]);for(var i=[],a=0,r=n.length;r>a;a++){var o,s=n[a],u=s.x,c=s.y,h=s.clientX,d=s.clientY;o=x(u)||x(c)?{x:u,y:c}:P({x:h,y:d},e),i.push(k(o,e))}return i},O=function(t,e){var n=e.x-t.x,i=e.y-t.y;return Math.abs(n)>Math.abs(i)?n>0?"right":"left":i>0?"down":"up"},M=function(t,e){var n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return Math.sqrt(n*n+i*i)},D=function(){function t(e){var n=this,i=e.canvas,a=e.el;u(this,t),this.processEvent=void 0,this.canvas=void 0,this.startTime=0,this.endTime=0,this.startPoints=null,this.startDistance=0,this.center=null,this.pressTimeout=void 0,this.eventType=null,this.direction=null,this.lastMoveTime=0,this.prevMovePoints=null,this.prevMoveTime=0,this.lastMovePoints=null,this.pinch=!1,this._click=function(t){var e=C(t,n.canvas);t.points=e,n.emitEvent("click",t)},this._start=function(t){var e,i,a=C(t,n.canvas);a&&(t.points=a,n.emitEvent("touchstart",t),n.reset(),n.startTime=Date.now(),n.startPoints=a,a.length>1?(n.startDistance=M(a[0],a[1]),n.center={x:(e=a[0]).x+((i=a[1]).x-e.x)/2,y:e.y+(i.y-e.y)/2}):n.pressTimeout=setTimeout((function(){var e="press",i="none";t.direction=i,n.emitStart(e,t),n.emitEvent(e,t),n.eventType=e,n.direction=i}),250))},this._move=function(t){var e=C(t,n.canvas);if(e){t.points=e,n.emitEvent("touchmove",t);var i=n.startPoints;if(i)if(e.length>1){var a=n.startDistance,r=M(e[0],e[1]);t.zoom=r/a,t.center=n.center,n.emitStart("pinch",t),n.emitEvent("pinch",t)}else{var o=e[0].x-i[0].x,s=e[0].y-i[0].y,u=n.direction||O(i[0],e[0]);n.direction=u;var c=n.getEventType(e);t.direction=u,t.deltaX=o,t.deltaY=s,n.emitStart(c,t),n.emitEvent(c,t);var h=n.lastMoveTime,d=Date.now();d-h>0&&(n.prevMoveTime=h,n.prevMovePoints=n.lastMovePoints,n.lastMoveTime=d,n.lastMovePoints=e)}}},this._end=function(t){var e=C(t,n.canvas);t.points=e,n.emitEnd(t),n.emitEvent("touchend",t);var i=n.lastMoveTime;if(100>Date.now()-i){var a=i-(n.prevMoveTime||n.startTime);if(a>0){var r=n.prevMovePoints||n.startPoints,o=n.lastMovePoints;if(!r||!o)return;var s=M(r[0],o[0])/a;s>.3&&(t.velocity=s,t.direction=O(r[0],o[0]),n.emitEvent("swipe",t))}}n.reset();var u=t.touches;u&&u.length>0&&n._start(t)},this._cancel=function(t){n.emitEvent("touchcancel",t),n.reset()},this.canvas=i,this.delegateEvent(a),this.processEvent={}}return h(t,[{key:"delegateEvent",value:function(t){t.addEventListener("click",this._click),t.addEventListener("touchstart",this._start),t.addEventListener("touchmove",this._move),t.addEventListener("touchend",this._end),t.addEventListener("touchcancel",this._cancel)}},{key:"emitEvent",value:function(t,e){this.canvas.emit(t,e)}},{key:"getEventType",value:function(t){var e,n=this.eventType,i=this.startTime,a=this.startPoints;if(n)return n;var r=this.canvas.__events.pan;if(r&&r.length){var o=Date.now();if(!a)return;e=o-i>250&&10>M(a[0],t[0])?"press":"pan"}else e="press";return this.eventType=e,e}},{key:"enable",value:function(t){this.processEvent[t]=!0}},{key:"isProcess",value:function(t){return this.processEvent[t]}},{key:"emitStart",value:function(t,e){this.isProcess(t)||(this.enable(t),this.emitEvent("".concat(t,"start"),e))}},{key:"emitEnd",value:function(t){}},{key:"clearPressTimeout",value:function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}},{key:"reset",value:function(){this.clearPressTimeout(),this.startTime=0,this.startPoints=null,this.startDistance=0,this.direction=null,this.eventType=null,this.pinch=!1,this.prevMoveTime=0,this.prevMovePoints=null,this.lastMoveTime=0,this.lastMovePoints=null}}]),t}(),T=function(t){l(n,_);var e=g(n);function n(t){var i;return u(this,n),(i=e.call(this))._attrs={},i._isWindow=void 0,i._attrs=Object.assign({},t),i._isWindow="undefined"!=typeof window,i._initPixelRatio(),i._initCanvas(),["createImage","toDataURL","requestAnimationFrame"].forEach((function(e){i._initAttrs(e,t.canvas||i.get("el"))})),i}return h(n,[{key:"get",value:function(t){return this._attrs[t]}},{key:"set",value:function(t,e){this._attrs[t]=e}},{key:"_initAttrs",value:function(t,e){var n=this;this.get(t)||this.set(t,(function(){return e[t]?e[t].apply(e,arguments):n._isWindow?window[t]?(i=window)[t].apply(i,arguments):"createImage"==t?new Image:null:void 0;var i}))}},{key:"_initCanvas",value:function(){var t,e,n=this.get("el"),i=this.get("context");if(!n&&!i)throw Error("请指定 id、el 或 context!");t=n?w(n)?(e=n)?document.getElementById(e):null:n:function(t,e){return t?function(t){if(!t)return!1;if(1!==t.nodeType||!t.nodeName||"canvas"!==t.nodeName.toLowerCase())return!1;var e=!1;try{t.addEventListener("eventTest",(function(){e=!0})),t.dispatchEvent(new Event("eventTest"))}catch(t){e=!1}return e}(t.canvas)?t.canvas:new E(t,e):null}(i,this._attrs),i&&t&&!t.getContext&&(t.getContext=function(){return i});var a=this.get("width")||function(t){var e=L(t,"width");return"auto"===e&&(e=t.offsetWidth),parseFloat(e)}(t)||t.width,r=this.get("height")||function(t){var e=L(t,"height");return"auto"===e&&(e=t.offsetHeight),parseFloat(e)}(t)||t.height;this.set("canvas",this),this.set("el",t),this.set("context",i||t.getContext("2d")),this.changeSize(a,r);var o=new D({canvas:this,el:t,parent:this.get("parent")});this.set("eventController",o)}},{key:"_initPixelRatio",value:function(){this.get("pixelRatio")||this.set("pixelRatio",window&&window.devicePixelRatio||1)}},{key:"changeSize",value:function(t,e){var n,i=this.get("pixelRatio"),a=this.get("el");a.style&&(a.style.width=t+"px",a.style.height=e+"px"),(n=a)&&"object"===s(n)&&(1===n.nodeType&&n.nodeName||n.isCanvasElement)&&(a.width=t*i,a.height=e*i,1!==i&&this.get("context").scale(i,i)),this.set("width",t),this.set("height",e)}},{key:"destroy",value:function(){if(!this.get("destroyed")){var t=this.get("el");t.width=0,t.height=0,this.clear(),this._attrs={},this.set("destroyed",!0)}}},{key:"clear",value:function(){}},{key:"isDestroyed",value:function(){return this.get("destroyed")}}]),n}(),W={penColor:"black",backgroundColor:"",openSmooth:!0,penSize:2,minLineWidth:2,maxLineWidth:6,minSpeed:1.5,maxWidthDiffRate:20,maxHistoryLength:20},R=null,I=function(){function t(e){var n=this;u(this,t),this.canAddHistory=!0,this.points=[],this.historyList=[],this.canvas=void 0,this._isEmpty=!0,this.active=!1,this.getLineWidth=function(t){var e=n.get("options"),i=e.minSpeed,a=e.minLineWidth,r=n.getMaxLineWidth();return Math.min(Math.max(r-(r-a)*t/Math.max(Math.min(i,10),1),a),r)},this.drawTrapezoid=function(t,e,i,a){var r=n.get("context");r.beginPath(),r.moveTo(Number(t.x.toFixed(1)),Number(t.y.toFixed(1))),r.lineTo(Number(e.x.toFixed(1)),Number(e.y.toFixed(1))),r.lineTo(Number(i.x.toFixed(1)),Number(i.y.toFixed(1))),r.lineTo(Number(a.x.toFixed(1)),Number(a.y.toFixed(1))),r.fillStyle=n.get("options").penColor,r.fill(),r.draw&&r.draw(!0)},this.drawNoSmoothLine=function(t,e){e.lastX=t.x+.5*(e.x-t.x),e.lastY=t.y+.5*(e.y-t.y),"number"==typeof t.lastX&&n.drawCurveLine(t.lastX,t.lastY,t.x,t.y,e.lastX,e.lastY,n.getMaxLineWidth())},this.drawCurveLine=function(t,e,i,a,r,o,s){s=Number(s.toFixed(1));var u=n.get("context");u.lineWidth=s,u.beginPath(),u.moveTo(Number(t.toFixed(1)),Number(e.toFixed(1))),u.quadraticCurveTo(Number(i.toFixed(1)),Number(a.toFixed(1)),Number(r.toFixed(1)),Number(o.toFixed(1))),u.stroke(),u.draw&&u.draw(!0)},this.getRadianData=function(t,e,n,i){var a=n-t,r=i-e;if(0===a)return{val:0,pos:-1};if(0===r)return{val:0,pos:1};var o=Math.abs(Math.atan(r/a));return n>t&&e>i||t>n&&i>e?{val:o,pos:1}:{val:o,pos:-1}},this.getRadianPoints=function(t,e,n,i){if(0===t.val)return 1===t.pos?[{x:e,y:n+i},{x:e,y:n-i}]:[{y:n,x:e+i},{y:n,x:e-i}];var a=Math.sin(t.val)*i,r=Math.cos(t.val)*i;return 1===t.pos?[{x:e+a,y:n+r},{x:e-a,y:n-r}]:[{x:e+a,y:n-r},{x:e-a,y:n+r}]},this.drawSmoothLine=function(t,e){var i=e.x-t.x,a=e.y-t.y;if(Math.abs(i)+Math.abs(a)>2?(e.lastX1=t.x+.3*i,e.lastY1=t.y+.3*a,e.lastX2=t.x+.7*i,e.lastY2=t.y+.7*a):(e.lastX1=e.lastX2=t.x+.5*i,e.lastY1=e.lastY2=t.y+.5*a),e.perLineWidth=(t.lineWidth+e.lineWidth)/2,"number"==typeof t.lastX1){if(n.drawCurveLine(t.lastX2,t.lastY2,t.x,t.y,e.lastX1,e.lastY1,e.perLineWidth),t.isFirstPoint)return;if(t.lastX1===t.lastX2&&t.lastY1===t.lastY2)return;var r=n.getRadianData(t.lastX1,t.lastY1,t.lastX2,t.lastY2),o=n.getRadianPoints(r,t.lastX1,t.lastY1,t.perLineWidth/2),s=n.getRadianPoints(r,t.lastX2,t.lastY2,e.perLineWidth/2);n.drawTrapezoid(o[0],s[0],s[1],o[1])}else e.isFirstPoint=!0},this.addHistory=function(){var t=n.get("options").maxHistoryLength;if(t&&n.canAddHistory)if(n.canAddHistory=!1,n.get("createImage")){var e=null;e=n.get("createImage")();var i=n.get("toDataURL")&&n.get("toDataURL")();w(i)?e.src=i:i.then((function(t){e.src=t})),e.onload=function(){var i=R;R=e,n.historyList.push(i),n.historyList=n.historyList.slice(-t)}}else n.historyList.length++},this.drawByImage=function(t){var e=n.get("context"),i=n.get("width"),a=n.get("height");e.clearRect(0,0,i,a);try{t&&e.drawImage(t,0,0,i,a),e.draw&&e.draw(!0)}catch(t){n.historyList.length=0}},this.isEmpty=function(){return n.get("options").maxHistoryLength>0?0===n.historyList.length:n._isEmpty},this.clear=function(){var t=n.get("context");t.clearRect(0,0,n.get("width"),n.get("height")),t.draw&&t.draw(),n._isEmpty=!0,R=null,n.historyList.length=0},this.undo=function(){if(0===n.get("options").maxHistoryLength&&n.clear(),n.get("createImage")&&n.historyList.length){var t=n.historyList.splice(-1)[0];n.drawByImage(t),0===n.historyList.length&&n.clear()}},this.canvas=e,this.canvas.set("pen",W),this.init()}return h(t,[{key:"getOption",value:function(){}},{key:"setOption",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=o({},t),n=e.maxLineWidth;if(n&&t.penSize&&n==W.maxLineWidth){var i=Math.max(n,t.penSize);e.maxLineWidth=i}this.canvas.set("pen",Object.assign({},W,e))}},{key:"get",value:function(t){return this.canvas.get("options"==t?"pen":t)}},{key:"init",value:function(){var t=this;this.get("context").lineCap="round",this.canvas.on("touchstart",(function(e){return t.onDrawStart(e)})),this.canvas.on("touchmove",(function(e){return t.onDrawMove(e)})),this.canvas.on("touchend",(function(e){return t.onDrawEnd(e)}))}},{key:"drawBackground",value:function(){var t=this.get("context"),e=this.get("width"),n=this.get("height"),i=this.get("options"),a=i.backgroundColor,r=i.backgroundImage;a&&(t.fillStyle=a,t.fillRect(0,0,e,n),t.draw&&t.draw(!0)),r&&this.drawByImage(r)}},{key:"getContentBoundingBox",value:function(t){var e=this.get("pixelRatio"),n=this.get("width"),i=this.get("height"),a=this.get("el"),r="CANVAS"===a.nodeName,o=r?n:a.width,s=r?i:a.height;e=r?1:e;var u=function(n){for(var i=o,a=s,r=0,u=0,c=0;n.length>c;c+=4)if(n[c+3]>0){var h=c/4%o,d=Math.floor(c/4/o);i=Math.min(i,h),a=Math.min(a,d),r=Math.max(r,h),u=Math.max(u,d)}var l={width:(r-i+1)/e,height:(u-a+1)/e,startX:i/e,startY:a/e};return t&&t(l),l};if("CANVAS"===a.nodeName){var c=document.createElement("canvas");c.width=n,c.height=i;var h=c.getContext("2d");h.drawImage(a,0,0,n,i);var d=h.getImageData(0,0,n,i).data;return u(d)}var l,f=this.get("context").getImageData(0,0,o,s);return m(l=f)&&S(l.then)&&S(l.catch)?(f.then((function(t){return u(t.data)})),null):u(f.data)}},{key:"remove",value:function(){var t=this;this.canvas.off("touchstart",(function(e){return t.onDrawStart(e)})),this.canvas.off("touchmove",(function(e){return t.onDrawMove(e)})),this.canvas.off("touchend",(function(e){return t.onDrawEnd(e)}))}},{key:"disableScroll",value:function(t){t.preventDefault&&this.get("options").disableScroll&&t.preventDefault()}},{key:"onDrawStart",value:function(t){this.disableScroll(t);var e=t.points;if(this.active){this.canAddHistory=!0,this.get("context").strokeStyle=this.get("options").penColor;var n=e[0];this.initPoint(n.x,n.y)}}},{key:"onDrawMove",value:function(t){if(this.disableScroll(t),this.active){var e=t.points[0];this.initPoint(e.x,e.y),this.onDraw()}}},{key:"onDrawEnd",value:function(t){this.active&&(this.addHistory(),this.canAddHistory=!0,this.points=[])}},{key:"onDraw",value:function(){var t=this,e=this.get("context");if(this.points.length>=2){e.lineWidth=this.get("options").penSize||2;var n=this.points.slice(-1)[0],i=this.points.slice(-2,-1)[0],a=function(){t._isEmpty=!1,t.get("options").openSmooth?t.drawSmoothLine(i,n):t.drawNoSmoothLine(i,n)},r=this.get("el").canvas;r&&r.requestAnimationFrame?r.requestAnimationFrame((function(){return a()})):"function"==typeof requestAnimationFrame?requestAnimationFrame((function(){return a()})):a()}}},{key:"getMaxLineWidth",value:function(){var t=this.get("options");return Math.min(t.penSize,t.maxLineWidth)}},{key:"initPoint",value:function(t,e){var n={x:t,y:e,t:Date.now()},i=this.points.slice(-1)[0];if(!i||i.t!==n.t&&(i.x!==t||i.y!==e)){if(this.get("options").openSmooth&&i){var a=this.points.slice(-2,-1)[0];if(n.distance=Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2)),n.speed=n.distance/(n.t-i.t||.1),n.lineWidth=this.getLineWidth(n.speed),a&&a.lineWidth&&i.lineWidth){var r=(n.lineWidth-i.lineWidth)/i.lineWidth,o=this.get("options").maxWidthDiffRate/100;o=o>1?1:.01>o?.01:o,Math.abs(r)>o&&(n.lineWidth=i.lineWidth*(1+(r>0?o:-o)))}}this.points.push(n),this.points=this.points.slice(-3)}}}]),t}(),F=function(){function t(e){u(this,t),this.canvas=void 0,this._ee=void 0,this.pen=void 0;var n=new T(e);n.set("parent",this),this.canvas=n,this._ee=new _,this.pen=new I(n),this.init()}return h(t,[{key:"init",value:function(){this.pen.active=!0}},{key:"destroy",value:function(){this.canvas.destroy()}},{key:"clear",value:function(){this.pen.clear()}},{key:"undo",value:function(){this.pen.undo()}},{key:"save",value:function(){}},{key:"getContentBoundingBox",value:function(t){return this.pen.getContentBoundingBox(t)}},{key:"isEmpty",value:function(){return this.pen.isEmpty()}},{key:"on",value:function(t,e){this._ee.on(t,e)}},{key:"emit",value:function(t,e){this._ee.emit(t,e)}},{key:"off",value:function(t,e){this._ee.off(t,e)}}]),t}();e.Signature=F;var U=F;e.default=U},f8c4:function(t,e,n){"use strict";n.r(e);var i=n("79f7"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},ffa9:function(t,e,n){"use strict";n.r(e);var i=n("6d74"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},ffb8:function(t,e){}}]);