import{aqast,a3ase,aVaso,aWasr,aXasn,aYasi,Casa,a1asc,aZass,aMasu,arash,a_asd,oasp,basl,wasf,pasg,easv,nasy,lasm,a$asb}from"./index-f587024c.js";import{_asx}from"./_plugin-vue_export-helper.1b428a4d.js";varw=void0,C=["touchstarted","touchmoved","touchended"];functionS(t){for(vare=[],o=arguments.length-1;o-->0;)e[o]=arguments[o+1];C.forEach((function(o,r){void0!==e[r]&&(t[o]=e[r])}))}functionT(){returnw||(w=t()),w}varO={},W={id:{default:"cropper",get:function(){returnO.id},set:function(t){"string"!=typeoft&&console.error("id:"+t+" is invalid"),O.id=t}},width:{default:750,get:function(){returnO.width},set:function(t){"number"!=typeoft&&console.error("width:"+t+" is invalid"),O.width=t}},height:{default:750,get:function(){returnO.height},set:function(t){"number"!=typeoft&&console.error("height:"+t+" is invalid"),O.height=t}},pixelRatio:{default:T().pixelRatio,get:function(){returnO.pixelRatio},set:function(t){"number"!=typeoft&&console.error("pixelRatio:"+t+" is invalid"),O.pixelRatio=t}},scale:{default:2.5,get:function(){returnO.scale},set:function(t){"number"!=typeoft&&console.error("scale:"+t+" is invalid"),O.scale=t}},zoom:{default:5,get:function(){returnO.zoom},set:function(t){"number"!=typeoft?console.error("zoom:"+t+" is invalid"):(t<0||t>10)&&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:"+t+" is invalid"),O.src=t}},cut:{default:{},get:function(){returnO.cut},set:function(t){"object"!=typeoft&&console.error("cut:"+t+" is invalid"),O.cut=t}},boundStyle:{default:{},get:function(){returnO.boundStyle},set:function(t){"object"!=typeoft&&console.error("boundStyle:"+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=T().windowWidth;varM="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:{};function_(t,e){returnt(e={exports:{}},e.exports),e.exports}varj=_((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};varo=Object.prototype.toString;e.isPlainObject=function(t){return"[object Object]"===o.call(t)};varr=Object.prototype.hasOwnProperty;e.hasOwn=function(t,e){returnr.call(t,e)},e.noop=function(t,e,o){},e.isValidArrayIndex=function(t){vare=parseFloat(String(t));returne>=0&&Math.floor(e)===e&&isFinite(t)}})),A=j.isFunc,L=j.isPlainObject,R=["ready","beforeImageLoad","beforeDraw","imageLoad"];functionH(t){returnfunction(e){for(varo=[],r=arguments.length-1;r-->0;)o[r]=arguments[r+1];returnvoid0===e&&(e={}),newPromise((function(r,n){e.success=function(t){r(t)},e.fail=function(t){n(t)},t.apply(void0,[e].concat(o))}))}}functionP(t,e){returnvoid0===e&&(e=!1),newPromise((function(o){t.draw(e,o)}))}vark=H(r),B=H(n),E=_((function(t,e){
!function(o){varr=e,n=t&&t.exports==r&&t,i="object"==typeofM&&M;i.global!==i&&i.window!==i||(o=i);vara=function(t){this.message=t};(a.prototype=newError).name="InvalidCharacterError";varc=function(t){thrownewa(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&c("The string to be encoded contains characters outside of the Latin1 range.");for(vare,o,r,n,i=t.length%3,a="",u=-1,h=t.length-i;++u<h;)e=t.charCodeAt(u)<<16,o=t.charCodeAt(++u)<<8,r=t.charCodeAt(++u),a+=s.charAt((n=e+o+r)>>18&63)+s.charAt(n>>12&63)+s.charAt(n>>6&63)+s.charAt(63&n);return2==i?(e=t.charCodeAt(u)<<8,o=t.charCodeAt(++u),a+=s.charAt((n=e+o)>>10)+s.charAt(n>>4&63)+s.charAt(n<<2&63)+"="):1==i&&(n=t.charCodeAt(u),a+=s.charAt(n>>2)+s.charAt(n<<4&63)+"=="),a},decode:function(t){vare=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&c("Invalid character: the string to be decoded is not correctly encoded.");for(varo,r,n=0,i="",a=-1;++a<e;)r=s.indexOf(t.charAt(a)),o=n%4?64*o+r:r,n++%4&&(i+=String.fromCharCode(255&o>>(-2*n&6)));returni},version:"0.1.0"};if(r&&!r.nodeType)if(n)n.exports=h;elsefor(vardinh)h.hasOwnProperty(d)&&(r[d]=h[d]);elseo.base64=h}(M)}));functionF(t){vare="";if("string"==typeoft)e=t;elsefor(varo=0;o<t.length;o++)e+=String.fromCharCode(t[o]);returnE.encode(e)}functionX(t,e,o,r,n,a,c){void0===c&&(c=function(){}),void0===a&&(a="png"),a=function(t){return"image/"+(t=t.toLowerCase().replace(/jpg/i,"jpeg")).match(/png|jpeg|bmp|gif/)[0]}(a),/bmp/.test(a)?function(t,e,o,r,n,a){i({canvasId:t,x:e,y:o,width:r,height:n,success:function(t){a(t,null)},fail:function(t){a(null,t)}})}(t,e,o,r,n,(function(t,e){varo=function(t){vare=t.width,o=t.height,r=e*o*3,n=r+54,i=[66,77,255&n,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,255&e,e>>8&255,e>>16&255,e>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255,1,0,24,0,0,0,0,0,255&r,r>>8&255,r>>16&255,r>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=(4-3*e%4)%4,s=t.data,u="",h=e<<2,d=o,p=String.fromCharCode;do{for(varl=h*(d-1),f="",g=0;g<e;g++){varv=g<<2;f+=p(s[l+v+2])+p(s[l+v+1])+p(s[l+v])}for(vary=0;y<c;y++)f+=String.fromCharCode(0);u+=f}while(--d);returnF(i.concat(a))+F(u)}(t);A(c)&&c(function(t,e){return"data:"+e+";base64,"+t}(o,"image/"+a),e)})):console.error("暂不支持生成'"+a+"'类型的base64图片")}varY=function(t,e){returnvoid0===t&&(t={}),void0===e&&(e=function(){}),X(t.canvasId,t.x,t.y,t.width,t.height,"bmp",e)};varz={touchStart:function(t){vare=this,o=t.touches,r=o[0],n=o[1];e.src&&(S(e,!0,null,null),e.__oneTouchStart(r),t.touches.length>=2&&e.__twoTouchStart(r,n))},touchMove:function(t){vare=this,o=t.touches,r=o[0],n=o[1];e.src&&(S(e,null,!0),1===t.touches.length&&e.__oneTouchMove(r),t.touches.length>=2&&e.__twoTouchMove(r,n))},touchEnd:function(t){vare=this;e.src&&(S(e,!1,!1,!0),e.__xtouchEnd())}};varD=function(t){vare,o,r=this,n={};returne=r,o=W,Object.defineProperties(e,o),Object.keys(W).forEach((function(t){n[t]=W[t].default})),Object.assign(r,n,t),r.prepare(),r.attachPage(),r.createCtx(),r.observer(),r.cutt(),r.methods(),r.init(),r.update(),r};D.prototype.init=function(){vart=this,e=t.src;returnt.version="1.3.9","function"==typeoft.onReady&&t.onReady(t.ctx,t),e?t.pushOrign(e):t.updateCanvas(),S(t,!1,!1,!1),t.oldScale=1,t.newScale=1,t},Object.assign(D.prototype,z),D.prototype.prepare=function(){vart=this;t.attachPage=function(){varo=e(),r=o[o.length-1];Object.defineProperty(r,"wecropper",{get:function(){returnconsole.warn("Instance will not be automatically bound to the page after v1.4.0\n\nPlease use a custom instance name instead\n\nExample: \nthis.mycropper = new WeCropper(options)\n\n// ...\nthis.mycropper.getCropperImage()"),t},configurable:!0})},t.createCtx=function(){vare=t.id,r=t.targetId;e?(t.ctx=t.ctx||o(e),t.targetCtx=t.targetCtx||o(r)):console.error("constructor: create canvas context failed, 'id' must be valuable")},t.deviceRadio=I/750},D.prototype.observer=function(){var