!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=e():"function"==typeofdefine&&define.amd?define(e):t.WeCropper=e()}(this,function(){"use strict";vart=void0,e=["touchstarted","touchmoved","touchended"];functionr(n){for(varo=[],t=arguments.length-1;0<t--;)o[t]=arguments[t+1];e.forEach(function(t,e){void0!==o[e]&&(n[t]=o[e])})}functionn(){returnt||(t=wx.getSystemInfoSync()),t}varo={},a={id:{default:"cropper",get:function(){returno.id},set:function(t){"string"!=typeoft&&console.error("id\uff1a"+t+" is invalid"),o.id=t}},width:{default:750,get:function(){returno.width},set:function(t){"number"!=typeoft&&console.error("width\uff1a"+t+" is invalid"),o.width=t}},height:{default:750,get:function(){returno.height},set:function(t){"number"!=typeoft&&console.error("height\uff1a"+t+" is invalid"),o.height=t}},pixelRatio:{default:n().pixelRatio,get:function(){returno.pixelRatio},set:function(t){"number"!=typeoft&&console.error("pixelRatio\uff1a"+t+" is invalid"),o.pixelRatio=t}},scale:{default:2.5,get:function(){returno.scale},set:function(t){"number"!=typeoft&&console.error("scale\uff1a"+t+" is invalid"),o.scale=t}},zoom:{default:5,get:function(){returno.zoom},set:function(t){"number"!=typeoft?console.error("zoom\uff1a"+t+" is invalid"):(t<0||10<t)&&console.error("zoom should be ranged in 0 ~ 10"),o.zoom=t}},src:{default:"",get:function(){returno.src},set:function(t){"string"!=typeoft&&console.error("src\uff1a"+t+" is invalid"),o.src=t}},cut:{default:{},get:function(){returno.cut},set:function(t){"object"!=typeoft&&console.error("cut\uff1a"+t+" is invalid"),o.cut=t}},boundStyle:{default:{},get:function(){returno.boundStyle},set:function(t){"object"!=typeoft&&console.error("boundStyle\uff1a"+t+" is invalid"),o.boundStyle=t}},onReady:{default:null,get:function(){returno.ready},set:function(t){o.ready=t}},onBeforeImageLoad:{default:null,get:function(){returno.beforeImageLoad},set:function(t){o.beforeImageLoad=t}},onImageLoad:{default:null,get:function(){returno.imageLoad},set:function(t){o.imageLoad=t}},onBeforeDraw:{default:null,get:function(){returno.beforeDraw},set:function(t){o.beforeDraw=t}}},i=n().windowWidth;varf="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:{};functionc(t,e){returnt(e={exports:{}},e.exports),e.exports}varu=c(function(t,e){e.isStr=function(t){return"string"==typeoft},e.isNum=function(t){return"number"==typeoft},e.isArr=Array.isArray,e.isUndef=function(t){returnvoid0===t},e.isTrue=function(t){return!0===t},e.isFalse=function(t){return!1===t},e.isFunc=function(t){return"function"==typeoft},e.isObj=e.isObject=function(t){returnnull!==t&&"object"==typeoft};varn=Object.prototype.toString;e.isPlainObject=function(t){return"[object Object]"===n.call(t)};varo=Object.prototype.hasOwnProperty;e.hasOwn=function(t,e){returno.call(t,e)},e.noop=function(t,e,n){},e.isValidArrayIndex=function(t){vare=parseFloat(String(t));return0<=e&&Math.floor(e)===e&&isFinite(t)}}),l=u.isFunc,g=u.isPlainObject,s=["ready","beforeImageLoad","beforeDraw","imageLoad"];functiond(r){returnfunction(t){for(varo=[],e=arguments.length-1;0<e--;)o[e]=arguments[e+1];returnvoid0===t&&(t={}),newPromise(function(e,n){t.success=function(t){e(t)},t.fail=function(t){n(t)},r.apply(void0,[t].concat(o))})}}functionp(e,n){returnvoid0===n&&(n=!1),newPromise(function(t){e.draw(n,t)})}varv=d(wx.getImageInfo),y=d(wx.canvasToTempFilePath),h=c(function(u,h){!function(t){vare=h,n=u&&u.exports==e&&u,o="object"==typeoff&&f;o.global!==o&&o.window!==o||(t=o);varr=function(t){this.message=t};(r.prototype=newError).name="InvalidCharacterError";vars=function(t){thrownewr(t)},d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(vare,n,o,r,a=t.length%3,i="",c=-1,u=t.length-a;++c<u;)e=t.charCodeAt(c)<<16,n=t.charCodeAt(++c)<<8,o=t.charCodeAt(++c),i+=d.charAt((r=