(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-c6362a22"],{"0d24":function(t,e,o){},"265f":function(t,e,o){"use strict";o.r(e);var i=o("5530"),r=o("c24f"),n=o("2f62"),a=(o("c7cd"),o("53ca")),s=(o("ac1f"),o("00b4"),o("d3b7"),o("3ca3"),o("ddb0"),o("2b3d"),o("9861"),o("88a7"),o("271a"),o("5494"),o("466d"),o("81b2"),o("0eb6"),o("b7ef"),o("8bd4"),o("ace4"),o("5cc6"),o("907a"),o("9a8c"),o("a975"),o("735e"),o("c1ac"),o("d139"),o("3a7b"),o("986a"),o("1d02"),o("d5d6"),o("82f8"),o("e91f"),o("60bd"),o("5f96"),o("3280"),o("3fcc"),o("ca91"),o("25a1"),o("cd26"),o("3c5d"),o("2954"),o("649e"),o("219c"),o("170b"),o("b39a9"),o("6ce5"),o("2834"),o("72f7"),o("4ea1"),o("99af"),o("7e79")),c=o("90e7"),h=(s={name:"CropperImage",components:{VueCropper:s.VueCropper},data:function(){return{name:"",resImg:"",previews:{},option:{img:"",outputSize:1,outputType:"png",info:!0,canScale:!0,autoCrop:!0,autoCropWidth:200,autoCropHeight:200,fixed:!0,fixedNumber:[1,1],full:!1,fixedBox:!1,canMove:!0,canMoveBox:!0,original:!1,centerBox:!0,height:!1,infoTrue:!1,maxImgSize:3e3,enlarge:1,mode:"300px 300px"}}},methods:{imgLoad:function(t){},changeScale:function(t){this.$refs.cropper.changeScale(t=t||1)},rotateLeft:function(){this.$refs.cropper.rotateLeft()},rotateRight:function(){this.$refs.cropper.rotateRight()},realTime:function(t){var e=this,o=this;o.previews=t,this.$refs.cropper.getCropBlob((function(t){e.blobToDataURI(t,(function(t){o.previewImg=t}))}))},blobToDataURI:function(t,e){var o=new FileReader;o.readAsDataURL(t),o.onload=function(t){e(t.target.result)}},selectImg:function(t){var e=this,o=t.target.files[0];if(!/\.(jpg|jpeg|png|JPG|PNG)$/.test(t.target.value))return this.$message({message:"图片类型要求:jpeg、jpg、png",type:"error"}),!1;t=new FileReader,t.onload=function(t){t="object"===Object(a.a)(t.target.result)?window.URL.createObjectURL(new Blob([t.target.result])):t.target.result,e.option.img=t},t.readAsDataURL(o)},base64ImgtoFile:function(t){for(var e=1{(t.exports=o(252)(!1)).push([t.id,'\n.vue-cropper[data-v-8ed66ddc] {\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n direction: ltr;\n touch-action: none;\n text-align: left;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC");\n}\n.cropper-box[data-v-8ed66ddc],\n.cropper-box-canvas[data-v-8ed66ddc],\n.cropper-drag-box[data-v-8ed66ddc],\n.cropper-crop-box[data-v-8ed66ddc],\n.cropper-face[data-v-8ed66ddc] {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n user-select: none;\n}\n.cropper-box-canvas img[data-v-8ed66ddc] {\n position: relative;\n text-align: left;\n user-select: none;\n transform: none;\n max-width: none;\n max-height: none;\n}\n.cropper-box[data-v-8ed66ddc] {\n overflow: hidden;\n}\n.cropper-move[data-v-8ed66ddc] {\n cursor: move;\n}\n.cropper-crop[data-v-8ed66ddc] {\n cursor: crosshair;\n}\n.cropper-modal[data-v-8ed66ddc] {\n background: rgba(0, 0, 0, 0.5);\n}\n.cropper-crop-box[data-v-8ed66ddc] {\n /*border: 2px solid #39f;*/\n}\n.cropper-view-box[data-v-8ed66ddc] {\n display: block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n user-select: none;\n}\n.cropper-view-box img[data-v-8ed66ddc] {\n user-select: none;\n text-align: left;\n max-width: none;\n max-height: none;\n}\n.cropper-face[data-v-8ed66ddc] {\n top: 0;\n left: 0;\n background-color: #fff;\n opacity: 0.1;\n}\n.crop-info[data-v-8ed66ddc] {\n position: absolute;\n left: 0px;\n min-width: 65px;\n text-align: center;\n color: white;\n line-height: 20px;\n background-color: rgba(0, 0, 0, 0.8);\n font-size: 12px;\n}\n.crop-line[data-v-8ed66ddc] {\n position: absolute;\n display: block;\n width: 100%;\n height: 100%;\n opacity: 0.1;\n}\n.line-w[data-v-8ed66ddc] {\n top: -3px;\n left: 0;\n height: 5px;\n cursor: n-resize;\n}\n.line-a[data-v-8ed66ddc] {\n top: 0;\n left: -3px;\n width: 5px;\n cursor: w-resize;\n}\n.line-s[data-v-8ed66ddc] {\n bottom: -3px;\n left: 0;\n height: 5px;\n cursor: s-resize;\n}\n.line-d[data-v-8ed66ddc] {\n top: 0;\n right: -3px;\n width: 5px;\n cursor: e-resize;\n}\n.crop-point[data-v-8ed66ddc] {\n position: absolute;\n width: 8px;\n height: 8px;\n opacity: 0.75;\n background-color: #39f;\n border-radius: 100%;\n}\n.point1[data-v-8ed66ddc] {\n top: -4px;\n left: -4px;\n cursor: nw-resize;\n}\n.point2[data-v-8ed66ddc] {\n top: -5px;\n left: 50%;\n margin-left: -3px;\n cursor: n-resize;\n}\n.point3[data-v-8ed66ddc] {\n top: -4px;\n right: -4px;\n cursor: ne-resize;\n}\n.point4[data-v-8ed66ddc] {\n top: 50%;\n left: -4px;\n margin-top: -3px;\n cursor: w-resize;\n}\n.point5[data-v-8ed66ddc] {\n top: 50%;\n right: -4px;\n margin-top: -3px;\n cursor: e-resize;\n}\n.point6[data-v-8ed66ddc] {\n bottom: -5px;\n left: -4px;\n cursor: sw-resize;\n}\n.point7[data-v-8ed66ddc] {\n bottom: -5px;\n left: 50%;\n margin-left: -3px;\n cursor: s-resize;\n}\n.point8[data-v-8ed66ddc] {\n bottom: -5px;\n right: -4px;\n cursor: se-resize;\n}\n@media screen and (max-width: 500px) {\n.crop-point[data-v-8ed66ddc] {\n position: absolute;\n width: 20px;\n height: 20px;\n opacity: 0.45;\n background-color: #39f;\n border-radius: 100%;\n}\n.point1[data-v-8ed66ddc] {\n top: -10px;\n left: -10px;\n}\n.point2[data-v-8ed66ddc],\n .point4[data-v-8ed66ddc],\n .point5[data-v-8ed66ddc],\n .point7[data-v-8ed66ddc] {\n display: none;\n}\n.point3[data-v-8ed66ddc] {\n top: -10px;\n right: -10px;\n}\n.point4[data-v-8ed66ddc] {\n top: 0;\n left: 0;\n}\n.point6[data-v-8ed66ddc] {\n bottom: -10px;\n left: -10px;\n}\n.point8[data-v-8ed66ddc] {\n bottom: -10px;\n right: -10px;\n}\n}\n',""])},252:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){i=e[1]||"";var o,i,r,n=(r=e[3])?(t&&"function"==typeof btoa?(o="/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */",n=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"})),[i].concat(n).concat([o])):[i]).join("\n"):i;return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,o){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r{var i=o(173);"string"==typeof i&&(i=[[t.id,i,""]]),o(723)(i,{hmr:!0,transform:void 0,insertInto:void 0}),i.locals&&(t.exports=i.locals)},723:(t,e,o)=>{var i,r,n,a={},s=(i=function(){return window&&document&&document.all&&!window.atob},n={},function(t,e){if("function"==typeof t)return t();if(void 0===n[t]){if(e=function(t,e){return(e||document).querySelector(t)}.call(this,t,e),window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(t){e=null}n[t]=e}return n[t]}),c=null,h=0,p=[],u=o(947);function l(t,e){for(var o=0;o{t.exports=function(t){var e,o,i="undefined"!=typeof window&&window.location;if(i)return t&&"string"==typeof t?(e=i.protocol+"//"+i.host,o=e+i.pathname.replace(/\/[^\/]*$/,"/"),t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,i){return i=i.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e})),/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(t=0===i.indexOf("//")?i:0===i.indexOf("/")?e+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(t)+")")}))):t;throw new Error("fixUrls requires window.location")}}},n={},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0,a={},(()=>{"use strict";function t(){var t=this,e=t._self._c;return e("div",{ref:"cropper",staticClass:"vue-cropper",on:{mouseover:t.scaleImg,mouseout:t.cancelScale}},[t.imgs?e("div",{staticClass:"cropper-box"},[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.loading,expression:"!loading"}],staticClass:"cropper-box-canvas",style:{width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+t.x/t.scale+"px,"+t.y/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"}},[e("img",{ref:"cropperImg",attrs:{src:t.imgs,alt:"cropper-img"}})])]):t._e(),t._v(" "),e("div",{staticClass:"cropper-drag-box",class:{"cropper-move":t.move&&!t.crop,"cropper-crop":t.crop,"cropper-modal":t.cropping},on:{mousedown:t.startMove,touchstart:t.startMove}}),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.cropping,expression:"cropping"}],staticClass:"cropper-crop-box",style:{width:t.cropW+"px",height:t.cropH+"px",transform:"translate3d("+t.cropOffsertX+"px,"+t.cropOffsertY+"px,0)"}},[e("span",{staticClass:"cropper-view-box"},[e("img",{style:{width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+(t.x-t.cropOffsertX)/t.scale+"px,"+(t.y-t.cropOffsertY)/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"},attrs:{src:t.imgs,alt:"cropper-img"}})]),t._v(" "),e("span",{staticClass:"cropper-face cropper-move",on:{mousedown:t.cropMove,touchstart:t.cropMove}}),t._v(" "),t.info?e("span",{staticClass:"crop-info",style:{top:t.cropInfo.top}},[t._v(t._s(t.cropInfo.width)+" × "+t._s(t.cropInfo.height))]):t._e(),t._v(" "),t.fixedBox?t._e():e("span",[e("span",{staticClass:"crop-line line-w",on:{mousedown:function(e){return t.changeCropSize(e,!1,!0,0,1)},touchstart:function(e){return t.changeCropSize(e,!1,!0,0,1)}}}),t._v(" "),e("span",{staticClass:"crop-line line-a",on:{mousedown:function(e){return t.changeCropSize(e,!0,!1,1,0)},touchstart:function(e){return t.changeCropSize(e,!0,!1,1,0)}}}),t._v(" "),e("span",{staticClass:"crop-line line-s",on:{mousedown:function(e){return t.changeCropSize(e,!1,!0,0,2)},touchstart:function(e){return t.changeCropSize(e,!1,!0,0,2)}}}),t._v(" "),e("span",{staticClass:"crop-line line-d",on:{mousedown:function(e){return t.changeCropSize(e,!0,!1,2,0)},touchstart:function(e){return t.changeCropSize(e,!0,!1,2,0)}}}),t._v(" "),e("span",{staticClass:"crop-point point1",on:{mousedown:function(e){return t.changeCropSize(e,!0,!0,1,1)},touchstart:function(e){return t.changeCropSize(e,!0,!0,1,1)}}}),t._v(" "),e("span",{staticClass:"crop-point point2",on:{mousedown:function(e){return t.changeCropSize(e,!1,!0,0,1)},touchstart:function(e){return t.changeCropSize(e,!1,!0,0,1)}}}),t._v(" "),e("span",{staticClass:"crop-point point3",on:{mousedown:function(e){return t.changeCropSize(e,!0,!0,2,1)},touchstart:function(e){return t.changeCropSize(e,!0,!0,2,1)}}}),t._v(" "),e("span",{staticClass:"crop-point point4",on:{mousedown:function(e){return t.changeCropSize(e,!0,!1,1,0)},touchstart:function(e){return t.changeCropSize(e,!0,!1,1,0)}}}),t._v(" "),e("span",{staticClass:"crop-point point5",on:{mousedown:function(e){return t.changeCropSize(e,!0,!1,2,0)},touchstart:function(e){return t.changeCropSize(e,!0,!1,2,0)}}}),t._v(" "),e("span",{staticClass:"crop-point point6",on:{mousedown:function(e){return t.changeCropSize(e,!0,!0,1,2)},touchstart:function(e){return t.changeCropSize(e,!0,!0,1,2)}}}),t._v(" "),e("span",{staticClass:"crop-point point7",on:{mousedown:function(e){return t.changeCropSize(e,!1,!0,0,2)},touchstart:function(e){return t.changeCropSize(e,!1,!0,0,2)}}}),t._v(" "),e("span",{staticClass:"crop-point point8",on:{mousedown:function(e){return t.changeCropSize(e,!0,!0,2,2)},touchstart:function(e){return t.changeCropSize(e,!0,!0,2,2)}}})])])])}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);ou,default:()=>d}),t._withStripped=!0;var r,n,s,c={getData:function(t){return new Promise((function(e,o){var i,r,n={};i=t,r=null,new Promise((function(t,e){var o,n,a,s;i.src?/^data\:/i.test(i.src)?(r=function(t){t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var e=atob(t),o=e.length,i=(t=new ArrayBuffer(o),new Uint8Array(t)),r=0;r1/this.trueHeight?1/this.trueHeight:1/this.trueWidth)?.1:r)*s;if(!this.touchNow){if(this.touchNow=!0,0Math.abs(c)&&(o-=Math.abs(c)),this.touches=t.touches,setTimeout((function(){e.touchNow=!1}),8),!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o}},cancelTouchScale:function(t){window.removeEventListener("touchmove",this.touchScale)},moveImg:function(t){var e=this;if(t.preventDefault(),t.touches&&2===t.touches.length)return this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;var o=("clientX"in t?t:t.touches[0]).clientX,i=(t=("clientY"in t?t:t.touches[0]).clientY,o-this.moveX),r=t-this.moveY;this.$nextTick((function(){if(e.centerBox){var t,o,n,a,s=e.getImgAxis(i,r,e.scale),c=e.getCropAxis(),h=e.trueHeight*e.scale,p=e.trueWidth*e.scale;switch(e.rotate){case 1:case-1:case 3:case-3:t=e.cropOffsertX-e.trueWidth*(1-e.scale)/2+(h-p)/2,o=e.cropOffsertY-e.trueHeight*(1-e.scale)/2+(p-h)/2,n=t-h+e.cropW,a=o-p+e.cropH;break;default:t=e.cropOffsertX-e.trueWidth*(1-e.scale)/2,o=e.cropOffsertY-e.trueHeight*(1-e.scale)/2,n=t-p+e.cropW,a=o-h+e.cropH}s.x1>=c.x1&&(i=t),s.y1>=c.y1&&(r=o),s.x2<=c.x2&&(i=n),s.y2<=c.y2&&(r=a)}e.x=i,e.y=r,e.$emit("imgMoving",{moving:!0,axis:e.getImgAxis()}),e.$emit("img-moving",{moving:!0,axis:e.getImgAxis()})}))},leaveImg:function(t){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg:function(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale:function(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize:function(t){var e=this,o=(t.preventDefault(),this.scale),i=(t=t.deltaY||t.wheelDelta,t=0i/this.trueHeight?i/this.trueHeight:i/this.trueWidth)*t,i<0?o+=Math.abs(i):o>Math.abs(i)&&(o-=Math.abs(i)),t=i<0?"add":"reduce";if(t!==this.coeStatus&&(this.coeStatus=t,this.coe=.2),this.scaling||(this.scalingSet=setTimeout((function(){e.scaling=!1,e.coe=e.coe+=.01}),50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o},changeScale:function(t){var e=this.scale;if(t=t||1,0<(t*=20/this.trueWidth>20/this.trueHeight?20/this.trueHeight:20/this.trueWidth)?e+=Math.abs(t):e>Math.abs(t)&&(e-=Math.abs(t)),!this.checkoutImgAxis(this.x,this.y,e))return!1;this.scale=e},createCrop:function(t){var e=this,o=(t.preventDefault(),"clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0),i="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;this.$nextTick((function(){var t,r=o-e.cropX,n=i-e.cropY;0e.w?e.w-e.cropChangeX:r,e.cropOffsertX=e.cropChangeX):(e.cropW=e.w-e.cropChangeX+Math.abs(r)>e.w?e.cropChangeX:Math.abs(r),e.cropOffsertX=0e.h?(e.cropH=e.h-e.cropOffsertY,e.cropW=e.cropH/e.fixedNumber[1]*e.fixedNumber[0],e.cropOffsertX=0e.h?e.h-e.cropChangeY:n,e.cropOffsertY=e.cropChangeY):(e.cropH=e.h-e.cropChangeY+Math.abs(n)>e.h?e.cropChangeY:Math.abs(n),e.cropOffsertY=0c?(r.cropH=c-r.cropOffsertY,r.cropW=r.cropH/r.fixedNumber[1]*r.fixedNumber[0],1===r.changeCropTypeX&&(r.cropOffsertX=r.cropChangeX+(r.cropOldW-r.cropW))):r.cropH=t),r.canChangeY&&r.fixed&&((e=r.cropH/r.fixedNumber[1]*r.fixedNumber[0])s?(r.cropW=s-r.cropOffsertX,r.cropH=r.cropW/r.fixedNumber[0]*r.fixedNumber[1]):r.cropW=e),r.$emit("cropSizing",{cropW:r.cropW,cropH:r.cropH}),r.$emit("crop-sizing",{cropW:r.cropW,cropH:r.cropH})}))},checkCropLimitSize:function(){this.cropW,this.cropH;var t=this.limitMinSize;new Array,t=Array.isArray(t)?t:[t,t];return[parseFloat(t[0]),parseFloat(t[1])]},changeCropEnd:function(t){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},calculateSize:function(t,e,o,i,r,n){t/=e,e=r;var a=n;return ethis.cropW&&(this.cropW=t,this.cropOffsertX+t>this.w)&&(this.cropOffsertX=this.w-t),e>this.cropH&&(this.cropH=e,this.cropOffsertY+e>this.h)&&(this.cropOffsertY=this.h-e),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop:function(){this.crop=!0},stopCrop:function(){this.crop=!1},clearCrop:function(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove:function(t){if(t.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(t),!1;if(t.touches&&2===t.touches.length)return this.crop=!1,this.startMove(t),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);var e=("clientX"in t?t:t.touches[0]).clientX;t=("clientY"in t?t:t.touches[0]).clientY,e-=this.cropOffsertX,t-=this.cropOffsertY;this.cropX=e,this.cropY=t,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop:function(t,e){var o=this,i=0,r=0;t&&(t.preventDefault(),i=("clientX"in t?t:t.touches[0]).clientX,r=("clientY"in t?t:t.touches[0]).clientY),this.$nextTick((function(){var t,n=i-o.cropX,a=r-o.cropY;e&&(n=o.cropOffsertX,a=o.cropOffsertY),n=n<=0?0:n+o.cropW>o.w?o.w-o.cropW:n,a=a<=0?0:a+o.cropH>o.h?o.h-o.cropH:a,o.centerBox&&((n=n<=(t=o.getImgAxis()).x1?t.x1:n)+o.cropW>t.x2&&(n=t.x2-o.cropW),(a=a<=t.y1?t.y1:a)+o.cropH>t.y2)&&(a=t.y2-o.cropH),o.cropOffsertX=n,o.cropOffsertY=a,o.$emit("cropMoving",{moving:!0,axis:o.getCropAxis()}),o.$emit("crop-moving",{moving:!0,axis:o.getCropAxis()})}))},getImgAxis:function(t,e,o){t=t||this.x,e=e||this.y,o=o||this.scale;var i={x1:0,x2:0,y1:0,y2:0},r=this.trueWidth*o,n=this.trueHeight*o;switch(this.rotate){case 0:i.x1=t+this.trueWidth*(1-o)/2,i.x2=i.x1+this.trueWidth*o,i.y1=e+this.trueHeight*(1-o)/2,i.y2=i.y1+this.trueHeight*o;break;case 1:case-1:case 3:case-3:i.x1=t+this.trueWidth*(1-o)/2+(r-n)/2,i.x2=i.x1+this.trueHeight*o,i.y1=e+this.trueHeight*(1-o)/2+(n-r)/2,i.y2=i.y1+this.trueWidth*o;break;default:i.x1=t+this.trueWidth*(1-o)/2,i.x2=i.x1+this.trueWidth*o,i.y1=e+this.trueHeight*(1-o)/2,i.y2=i.y1+this.trueHeight*o}return i},getCropAxis:function(){var t={x1:0,x2:0,y1:0,y2:0};return t.x1=this.cropOffsertX,t.x2=t.x1+this.cropW,t.y1=this.cropOffsertY,t.y2=t.y1+this.cropH,t},leaveCrop:function(t){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked:function(t){var e=this,o=document.createElement("canvas"),i=new Image,r=this.rotate,n=this.trueWidth,a=this.trueHeight,s=this.cropOffsertX,c=this.cropOffsertY;function h(t,e){o.width=Math.round(t),o.height=Math.round(e)}i.onload=function(){if(0!==e.cropW){var p=o.getContext("2d"),u=1,l=(e.high&!e.full&&(u=window.devicePixelRatio),1!==e.enlarge&!e.full&&(u=Math.abs(Number(e.enlarge))),e.cropW*u),d=e.cropH*u,f=n*e.scale*u,g=a*e.scale*u,m=(e.x-s+e.trueWidth*(1-e.scale)/2)*u,v=(e.y-c+e.trueHeight*(1-e.scale)/2)*u;switch(h(l,d),p.save(),r){case 0:e.full?(h(l/e.scale,d/e.scale),p.drawImage(i,m/e.scale,v/e.scale,f/e.scale,g/e.scale)):p.drawImage(i,m,v,f,g);break;case 1:case-3:e.full?(h(l/e.scale,d/e.scale),m=m/e.scale+(f/e.scale-g/e.scale)/2,v=v/e.scale+(g/e.scale-f/e.scale)/2,p.rotate(90*r*Math.PI/180),p.drawImage(i,v,-m-g/e.scale,f/e.scale,g/e.scale)):(m+=(f-g)/2,v+=(g-f)/2,p.rotate(90*r*Math.PI/180),p.drawImage(i,v,-m-g,f,g));break;case 2:case-2:e.full?(h(l/e.scale,d/e.scale),p.rotate(90*r*Math.PI/180),m/=e.scale,v/=e.scale,p.drawImage(i,-m-f/e.scale,-v-g/e.scale,f/e.scale,g/e.scale)):(p.rotate(90*r*Math.PI/180),p.drawImage(i,-m-f,-v-g,f,g));break;case 3:case-1:e.full?(h(l/e.scale,d/e.scale),m=m/e.scale+(f/e.scale-g/e.scale)/2,v=v/e.scale+(g/e.scale-f/e.scale)/2,p.rotate(90*r*Math.PI/180),p.drawImage(i,-v-f/e.scale,m,f/e.scale,g/e.scale)):(m+=(f-g)/2,v+=(g-f)/2,p.rotate(90*r*Math.PI/180),p.drawImage(i,-v-f,m,f,g));break;default:e.full?(h(l/e.scale,d/e.scale),p.drawImage(i,m/e.scale,v/e.scale,f/e.scale,g/e.scale)):p.drawImage(i,m,v,f,g)}p.restore()}else{var w=n*e.scale,x=a*e.scale,b=o.getContext("2d");switch(b.save(),r){case 0:h(w,x),b.drawImage(i,0,0,w,x);break;case 1:case-3:h(x,w),b.rotate(90*r*Math.PI/180),b.drawImage(i,0,-x,w,x);break;case 2:case-2:h(w,x),b.rotate(90*r*Math.PI/180),b.drawImage(i,-w,-x,w,x);break;case 3:case-1:h(x,w),b.rotate(90*r*Math.PI/180),b.drawImage(i,-w,0,w,x);break;default:h(w,x),b.drawImage(i,0,0,w,x)}b.restore()}t(o)},"data"!==this.img.substr(0,4)&&(i.crossOrigin="Anonymous"),i.src=this.imgs},getCropData:function(t){var e=this;this.getCropChecked((function(o){t(o.toDataURL("image/"+e.outputType,e.outputSize))}))},getCropBlob:function(t){var e=this;this.getCropChecked((function(o){o.toBlob((function(e){return t(e)}),"image/"+e.outputType,e.outputSize)}))},showPreview:function(){var t=this;if(!this.isCanShow)return!1;this.isCanShow=!1,setTimeout((function(){t.isCanShow=!0}),16);var e=this.cropW,o=this.cropH,i=this.scale,r={},n=(r.div={width:"".concat(e,"px"),height:"".concat(o,"px")},(this.x-this.cropOffsertX)/i),a=(this.y-this.cropOffsertY)/i;r.w=e,r.h=o,r.url=this.imgs,r.img={width:"".concat(this.trueWidth,"px"),height:"".concat(this.trueHeight,"px"),transform:"scale(".concat(i,")translate3d(").concat(n,"px, ").concat(a,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,"deg)")},r.html='\n
\n
\n \n
\n
'),this.$emit("realTime",r),this.$emit("real-time",r)},reload:function(){var t=this,e=new Image;e.onload=function(){t.w=parseFloat(window.getComputedStyle(t.$refs.cropper).width),t.h=parseFloat(window.getComputedStyle(t.$refs.cropper).height),t.trueWidth=e.width,t.trueHeight=e.height,t.original?t.scale=1:t.scale=t.checkedMode(),t.$nextTick((function(){t.x=-(t.trueWidth-t.trueWidth*t.scale)/2+(t.w-t.trueWidth*t.scale)/2,t.y=-(t.trueHeight-t.trueHeight*t.scale)/2+(t.h-t.trueHeight*t.scale)/2,t.loading=!1,t.autoCrop&&t.goAutoCrop(),t.$emit("img-load","success"),t.$emit("imgLoad","success"),setTimeout((function(){t.showPreview()}),20)}))},e.onerror=function(){t.$emit("imgLoad","error"),t.$emit("img-load","error")},e.src=this.imgs},checkedMode:function(){var t=1,e=(this.trueWidth,this.trueHeight),o=this.mode.split(" ");switch(o[0]){case"contain":this.trueWidth>this.w&&(t=this.w/this.trueWidth),this.trueHeight*t>this.h&&(t=this.h/this.trueHeight);break;case"cover":(e*=t=this.w/this.trueWidth)this.h&&(r=(n=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(r,n))},changeCrop:function(t,e){var o,i=this;this.centerBox&&(e=t>(o=this.getImgAxis()).x2-o.x1?(t=o.x2-o.x1)/this.fixedNumber[0]*this.fixedNumber[1]:e)>o.y2-o.y1&&(t=(e=o.y2-o.y1)/this.fixedNumber[1]*this.fixedNumber[0]),this.cropW=t,this.cropH=e,this.checkCropLimitSize(),this.$nextTick((function(){i.cropOffsertX=(i.w-i.cropW)/2,i.cropOffsertY=(i.h-i.cropH)/2,i.centerBox&&i.moveCrop(null,!0)}))},refresh:function(){var t=this;this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick((function(){t.checkedImg()}))},rotateLeft:function(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight:function(){this.rotate=3<=this.rotate?0:this.rotate+1},rotateClear:function(){this.rotate=0},checkoutImgAxis:function(t,e,o){t=t||this.x,e=e||this.y,o=o||this.scale;var i=!0;return!(this.centerBox&&(t=this.getImgAxis(t,e,o),e=this.getCropAxis(),t.x1>=e.x1&&(i=!1),t.x2<=e.x2&&(i=!1),t.y1>=e.y1&&(i=!1),t.y2<=e.y2))&&i}},mounted:function(){this.support="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";var t=this,e=navigator.userAgent;this.isIOS=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,o,i){for(var r=atob(this.toDataURL(o,i).split(",")[1]),n=r.length,a=new Uint8Array(n),s=0;s