"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["76646"],{438491:function(e,n,o){o.r(n),o.d(n,{ImageCrop:()=>d,blobToBase64:()=>u.w,getCroppedImg:()=>u.m});var r=o(771197),t=o(397458),l=o(652983),a=o(917612),c=o(628098),s=o(31809),u=o(412034),i=o(150811),p=l.lazy(()=>(0,a.AD)({fn:()=>o.e("27461").then(o.bind(o,83143))})),d=e=>{var n,{visible:o,title:a="\u56FE\u7247\u88C1\u526A",image:d,loading:b,okText:m,cancelText:f,onCancel:h,onCropComplete:v,onComplete:C,cropShape:w}=e,x=(0,l.useRef)(),[g,k]=(0,l.useState)(null),[y,S]=(0,l.useState)(null),[_,j]=(0,l.useState)(null),[T,Z]=(0,l.useState)({x:0,y:0}),[z,N]=(0,l.useState)(1),B=(n=(0,r._)(function*(e,n){try{var o,r=yield(0,u.m)(d,n);r&&(k(r.base64),S(r.blob),j(r.fileType),null==v||v(r))}catch(e){null===(o=x.current)||void 0===o||o.error({reason:"error",error:e})}}),function(e,o){return n.apply(this,arguments)});return(0,l.useEffect)(()=>{d&&(x.current=(0,s.zQ)({eventName:"uploader_crop",meta:{}}))},[d]),(0,t.jsx)(c.Z,{visible:o,centered:!0,motion:!1,title:a,width:450,onCancel:()=>{var e;k(""),null==h||h(),null===(e=x.current)||void 0===e||e.error({reason:"cancel"})},confirmLoading:b,onOk:()=>{if(g&&_){var e;null==C||C({blob:y,base64:g,fileType:_}),null===(e=x.current)||void 0===e||e.success()}},okButtonProps:{disabled:!g||!_},className:i.Z.modal,okText:m,cancelText:f,children:(0,t.jsx)("div",{className:i.Z["crop-container"],children:(0,t.jsx)(p,{image:d,objectFit:"contain",crop:T,zoom:z,aspect:1,cropShape:w,onCropChange:Z,onZoomChange:N,onCropComplete:B})})})}}}]);
//# sourceMappingURL=uploader-croper.js.map