vue-pure-admin/static/js/index-DOjNLtoH.js

11 lines
52 KiB
JavaScript

var Se=Object.defineProperty,Ae=Object.defineProperties;var Le=Object.getOwnPropertyDescriptors;var Ut=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var jt=(a,t,i)=>t in a?Se(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,ht=(a,t)=>{for(var i in t||(t={}))_e.call(t,i)&&jt(a,i,t[i]);if(Ut)for(var i of Ut(t))Be.call(t,i)&&jt(a,i,t[i]);return a},Gt=(a,t)=>Ae(a,Le(t));var qt=(a,t,i)=>new Promise((e,o)=>{var r=u=>{try{s(i.next(u))}catch(l){o(l)}},n=u=>{try{s(i.throw(u))}catch(l){o(l)}},s=u=>u.done?e(u.value):Promise.resolve(u.value).then(r,n);s((i=i.apply(a,t)).next())});import{k as W,e as V,g as z,aP as Ie,d as Ft,f as _,z as H,a as F,p as mt,m as ke,o as He,aQ as ze,u as Pe,W as Xe,aR as Ye,aS as We,aT as Ve,aU as $e,aV as Ue,aW as je,A,C as Ge,aX as qe,$ as Fe,V as Qe}from"./index-DI6gHrBb.js";/*!
* Cropper.js v1.6.2
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2024-04-21T07:43:05.335Z
*/function Qt(a,t){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),i.push.apply(i,e)}return i}function de(a){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Qt(Object(i),!0).forEach(function(e){ti(a,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)):Qt(Object(i)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(i,e))})}return a}function Ke(a,t){if(typeof a!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var e=i.call(a,t);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}function pe(a){var t=Ke(a,"string");return typeof t=="symbol"?t:t+""}function Tt(a){"@babel/helpers - typeof";return Tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tt(a)}function Ze(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function Kt(a,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,pe(e.key),e)}}function Je(a,t,i){return t&&Kt(a.prototype,t),i&&Kt(a,i),Object.defineProperty(a,"prototype",{writable:!1}),a}function ti(a,t,i){return t=pe(t),t in a?Object.defineProperty(a,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[t]=i,a}function fe(a){return ei(a)||ii(a)||ai(a)||ri()}function ei(a){if(Array.isArray(a))return Ot(a)}function ii(a){if(typeof Symbol!="undefined"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function ai(a,t){if(a){if(typeof a=="string")return Ot(a,t);var i=Object.prototype.toString.call(a).slice(8,-1);if(i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set")return Array.from(a);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ot(a,t)}}function Ot(a,t){(t==null||t>a.length)&&(t=a.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=a[i];return e}function ri(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var xt=typeof window!="undefined"&&typeof window.document!="undefined",q=xt?window:{},kt=xt&&q.document.documentElement?"ontouchstart"in q.document.documentElement:!1,Ht=xt?"PointerEvent"in q:!1,T="cropper",zt="all",ge="crop",ve="move",me="zoom",tt="e",et="w",at="s",Q="n",ct="ne",lt="nw",ut="se",dt="sw",Rt="".concat(T,"-crop"),Zt="".concat(T,"-disabled"),Y="".concat(T,"-hidden"),Jt="".concat(T,"-hide"),ni="".concat(T,"-invisible"),yt="".concat(T,"-modal"),Nt="".concat(T,"-move"),ft="".concat(T,"Action"),wt="".concat(T,"Preview"),Pt="crop",we="move",be="none",St="crop",At="cropend",Lt="cropmove",_t="cropstart",te="dblclick",oi=kt?"touchstart":"mousedown",si=kt?"touchmove":"mousemove",hi=kt?"touchend touchcancel":"mouseup",ee=Ht?"pointerdown":oi,ie=Ht?"pointermove":si,ae=Ht?"pointerup pointercancel":hi,re="ready",ne="resize",oe="wheel",Bt="zoom",se="image/jpeg",ci=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,li=/^data:/,ui=/^data:image\/jpeg;base64,/,di=/^img|canvas$/i,ye=200,xe=100,he={viewMode:0,dragMode:Pt,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:ye,minContainerHeight:xe,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},pi='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',fi=Number.isNaN||q.isNaN;function m(a){return typeof a=="number"&&!fi(a)}var ce=function(t){return t>0&&t<1/0};function Ct(a){return typeof a=="undefined"}function it(a){return Tt(a)==="object"&&a!==null}var gi=Object.prototype.hasOwnProperty;function rt(a){if(!it(a))return!1;try{var t=a.constructor,i=t.prototype;return t&&i&&gi.call(i,"isPrototypeOf")}catch(e){return!1}}function X(a){return typeof a=="function"}var vi=Array.prototype.slice;function De(a){return Array.from?Array.from(a):vi.call(a)}function L(a,t){return a&&X(t)&&(Array.isArray(a)||m(a.length)?De(a).forEach(function(i,e){t.call(a,i,e,a)}):it(a)&&Object.keys(a).forEach(function(i){t.call(a,a[i],i,a)})),a}var O=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),o=1;o<i;o++)e[o-1]=arguments[o];return it(t)&&e.length>0&&e.forEach(function(r){it(r)&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t},mi=/\.\d*(?:0|9){12}\d*$/;function ot(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return mi.test(a)?Math.round(a*t)/t:a}var wi=/^width|height|left|top|marginLeft|marginTop$/;function K(a,t){var i=a.style;L(t,function(e,o){wi.test(o)&&m(e)&&(e="".concat(e,"px")),i[o]=e})}function bi(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function B(a,t){if(t){if(m(a.length)){L(a,function(e){B(e,t)});return}if(a.classList){a.classList.add(t);return}var i=a.className.trim();i?i.indexOf(t)<0&&(a.className="".concat(i," ").concat(t)):a.className=t}}function G(a,t){if(t){if(m(a.length)){L(a,function(i){G(i,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function nt(a,t,i){if(t){if(m(a.length)){L(a,function(e){nt(e,t,i)});return}i?B(a,t):G(a,t)}}var yi=/([a-z\d])([A-Z])/g;function Xt(a){return a.replace(yi,"$1-$2").toLowerCase()}function It(a,t){return it(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat(Xt(t)))}function gt(a,t,i){it(i)?a[t]=i:a.dataset?a.dataset[t]=i:a.setAttribute("data-".concat(Xt(t)),i)}function xi(a,t){if(it(a[t]))try{delete a[t]}catch(i){a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch(i){a.dataset[t]=void 0}else a.removeAttribute("data-".concat(Xt(t)))}var Me=/\s\s*/,Ce=function(){var a=!1;if(xt){var t=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});q.addEventListener("test",i,e),q.removeEventListener("test",i,e)}return a}();function j(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(Me).forEach(function(r){if(!Ce){var n=a.listeners;n&&n[r]&&n[r][i]&&(o=n[r][i],delete n[r][i],Object.keys(n[r]).length===0&&delete n[r],Object.keys(n).length===0&&delete a.listeners)}a.removeEventListener(r,o,e)})}function U(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(Me).forEach(function(r){if(e.once&&!Ce){var n=a.listeners,s=n===void 0?{}:n;o=function(){delete s[r][i],a.removeEventListener(r,o,e);for(var l=arguments.length,h=new Array(l),c=0;c<l;c++)h[c]=arguments[c];i.apply(a,h)},s[r]||(s[r]={}),s[r][i]&&a.removeEventListener(r,s[r][i],e),s[r][i]=o,a.listeners=s}a.addEventListener(r,o,e)})}function st(a,t,i){var e;return X(Event)&&X(CustomEvent)?e=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(e=document.createEvent("CustomEvent"),e.initCustomEvent(t,!0,!0,i)),a.dispatchEvent(e)}function Ee(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Et=q.location,Di=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function le(a){var t=a.match(Di);return t!==null&&(t[1]!==Et.protocol||t[2]!==Et.hostname||t[3]!==Et.port)}function ue(a){var t="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+t}function pt(a){var t=a.rotate,i=a.scaleX,e=a.scaleY,o=a.translateX,r=a.translateY,n=[];m(o)&&o!==0&&n.push("translateX(".concat(o,"px)")),m(r)&&r!==0&&n.push("translateY(".concat(r,"px)")),m(t)&&t!==0&&n.push("rotate(".concat(t,"deg)")),m(i)&&i!==1&&n.push("scaleX(".concat(i,")")),m(e)&&e!==1&&n.push("scaleY(".concat(e,")"));var s=n.length?n.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Mi(a){var t=de({},a),i=0;return L(a,function(e,o){delete t[o],L(t,function(r){var n=Math.abs(e.startX-r.startX),s=Math.abs(e.startY-r.startY),u=Math.abs(e.endX-r.endX),l=Math.abs(e.endY-r.endY),h=Math.sqrt(n*n+s*s),c=Math.sqrt(u*u+l*l),d=(c-h)/h;Math.abs(d)>Math.abs(i)&&(i=d)})}),i}function bt(a,t){var i=a.pageX,e=a.pageY,o={endX:i,endY:e};return t?o:de({startX:i,startY:e},o)}function Ci(a){var t=0,i=0,e=0;return L(a,function(o){var r=o.startX,n=o.startY;t+=r,i+=n,e+=1}),t/=e,i/=e,{pageX:t,pageY:i}}function Z(a){var t=a.aspectRatio,i=a.height,e=a.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=ce(e),n=ce(i);if(r&&n){var s=i*t;o==="contain"&&s>e||o==="cover"&&s<e?i=e/t:e=i*t}else r?i=e/t:n&&(e=i*t);return{width:e,height:i}}function Ei(a){var t=a.width,i=a.height,e=a.degree;if(e=Math.abs(e)%180,e===90)return{width:i,height:t};var o=e%90*Math.PI/180,r=Math.sin(o),n=Math.cos(o),s=t*n+i*r,u=t*r+i*n;return e>90?{width:u,height:s}:{width:s,height:u}}function Ti(a,t,i,e){var o=t.aspectRatio,r=t.naturalWidth,n=t.naturalHeight,s=t.rotate,u=s===void 0?0:s,l=t.scaleX,h=l===void 0?1:l,c=t.scaleY,d=c===void 0?1:c,g=i.aspectRatio,v=i.naturalWidth,D=i.naturalHeight,f=e.fillColor,R=f===void 0?"transparent":f,N=e.imageSmoothingEnabled,E=N===void 0?!0:N,$=e.imageSmoothingQuality,k=$===void 0?"low":$,p=e.maxWidth,b=p===void 0?1/0:p,S=e.maxHeight,P=S===void 0?1/0:S,w=e.minWidth,y=w===void 0?0:w,x=e.minHeight,C=x===void 0?0:x,M=document.createElement("canvas"),I=M.getContext("2d"),J=Z({aspectRatio:g,width:b,height:P}),vt=Z({aspectRatio:g,width:y,height:C},"cover"),Dt=Math.min(J.width,Math.max(vt.width,v)),Mt=Math.min(J.height,Math.max(vt.height,D)),Yt=Z({aspectRatio:o,width:b,height:P}),Wt=Z({aspectRatio:o,width:y,height:C},"cover"),Vt=Math.min(Yt.width,Math.max(Wt.width,r)),$t=Math.min(Yt.height,Math.max(Wt.height,n)),Re=[-Vt/2,-$t/2,Vt,$t];return M.width=ot(Dt),M.height=ot(Mt),I.fillStyle=R,I.fillRect(0,0,Dt,Mt),I.save(),I.translate(Dt/2,Mt/2),I.rotate(u*Math.PI/180),I.scale(h,d),I.imageSmoothingEnabled=E,I.imageSmoothingQuality=k,I.drawImage.apply(I,[a].concat(fe(Re.map(function(Ne){return Math.floor(ot(Ne))})))),I.restore(),M}var Te=String.fromCharCode;function Oi(a,t,i){var e="";i+=t;for(var o=t;o<i;o+=1)e+=Te(a.getUint8(o));return e}var Ri=/^data:.*,/;function Ni(a){var t=a.replace(Ri,""),i=atob(t),e=new ArrayBuffer(i.length),o=new Uint8Array(e);return L(o,function(r,n){o[n]=i.charCodeAt(n)}),e}function Si(a,t){for(var i=[],e=8192,o=new Uint8Array(a);o.length>0;)i.push(Te.apply(null,De(o.subarray(0,e)))),o=o.subarray(e);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function Ai(a){var t=new DataView(a),i;try{var e,o,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var n=t.byteLength,s=2;s+1<n;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){o=s;break}s+=1}if(o){var u=o+4,l=o+10;if(Oi(t,u,4)==="Exif"){var h=t.getUint16(l);if(e=h===18761,(e||h===19789)&&t.getUint16(l+2,e)===42){var c=t.getUint32(l+4,e);c>=8&&(r=l+c)}}}if(r){var d=t.getUint16(r,e),g,v;for(v=0;v<d;v+=1)if(g=r+v*12+2,t.getUint16(g,e)===274){g+=8,i=t.getUint16(g,e),t.setUint16(g,1,e);break}}}catch(D){i=1}return i}function Li(a){var t=0,i=1,e=1;switch(a){case 2:i=-1;break;case 3:t=-180;break;case 4:e=-1;break;case 5:t=90,e=-1;break;case 6:t=90;break;case 7:t=90,i=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:i,scaleY:e}}var _i={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,i=this.options,e=this.container,o=this.cropper,r=Number(i.minContainerWidth),n=Number(i.minContainerHeight);B(o,Y),G(t,Y);var s={width:Math.max(e.offsetWidth,r>=0?r:ye),height:Math.max(e.offsetHeight,n>=0?n:xe)};this.containerData=s,K(o,{width:s.width,height:s.height}),B(t,Y),G(o,Y)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,o=Math.abs(i.rotate)%180===90,r=o?i.naturalHeight:i.naturalWidth,n=o?i.naturalWidth:i.naturalHeight,s=r/n,u=t.width,l=t.height;t.height*s>t.width?e===3?u=t.height*s:l=t.width/s:e===3?l=t.width/s:u=t.height*s;var h={aspectRatio:s,naturalWidth:r,naturalHeight:n,width:u,height:l};this.canvasData=h,this.limited=e===1||e===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=O({},h)},limitCanvas:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=e.viewMode,u=r.aspectRatio,l=this.cropped&&n;if(t){var h=Number(e.minCanvasWidth)||0,c=Number(e.minCanvasHeight)||0;s>1?(h=Math.max(h,o.width),c=Math.max(c,o.height),s===3&&(c*u>h?h=c*u:c=h/u)):s>0&&(h?h=Math.max(h,l?n.width:0):c?c=Math.max(c,l?n.height:0):l&&(h=n.width,c=n.height,c*u>h?h=c*u:c=h/u));var d=Z({aspectRatio:u,width:h,height:c});h=d.width,c=d.height,r.minWidth=h,r.minHeight=c,r.maxWidth=1/0,r.maxHeight=1/0}if(i)if(s>(l?0:1)){var g=o.width-r.width,v=o.height-r.height;r.minLeft=Math.min(0,g),r.minTop=Math.min(0,v),r.maxLeft=Math.max(0,g),r.maxTop=Math.max(0,v),l&&this.limited&&(r.minLeft=Math.min(n.left,n.left+(n.width-r.width)),r.minTop=Math.min(n.top,n.top+(n.height-r.height)),r.maxLeft=n.left,r.maxTop=n.top,s===2&&(r.width>=o.width&&(r.minLeft=Math.min(0,g),r.maxLeft=Math.max(0,g)),r.height>=o.height&&(r.minTop=Math.min(0,v),r.maxTop=Math.max(0,v))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=o.width,r.maxTop=o.height},renderCanvas:function(t,i){var e=this.canvasData,o=this.imageData;if(i){var r=Ei({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),n=r.width,s=r.height,u=e.width*(n/e.naturalWidth),l=e.height*(s/e.naturalHeight);e.left-=(u-e.width)/2,e.top-=(l-e.height)/2,e.width=u,e.height=l,e.aspectRatio=n/s,e.naturalWidth=n,e.naturalHeight=s,this.limitCanvas(!0,!1)}(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCanvas(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,K(this.canvas,O({width:e.width,height:e.height},pt({translateX:e.left,translateY:e.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var i=this.canvasData,e=this.imageData,o=e.naturalWidth*(i.width/i.naturalWidth),r=e.naturalHeight*(i.height/i.naturalHeight);O(e,{width:o,height:r,left:(i.width-o)/2,top:(i.height-r)/2}),K(this.image,O({width:e.width,height:e.height},pt(O({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio||t.initialAspectRatio,o=Number(t.autoCropArea)||.8,r={width:i.width,height:i.height};e&&(i.height*e>i.width?r.height=r.width/e:r.width=r.height*e),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*o),r.height=Math.max(r.minHeight,r.height*o),r.left=i.left+(i.width-r.width)/2,r.top=i.top+(i.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=O({},r)},limitCropBox:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=this.limited,u=e.aspectRatio;if(t){var l=Number(e.minCropBoxWidth)||0,h=Number(e.minCropBoxHeight)||0,c=s?Math.min(o.width,r.width,r.width+r.left,o.width-r.left):o.width,d=s?Math.min(o.height,r.height,r.height+r.top,o.height-r.top):o.height;l=Math.min(l,o.width),h=Math.min(h,o.height),u&&(l&&h?h*u>l?h=l/u:l=h*u:l?h=l/u:h&&(l=h*u),d*u>c?d=c/u:c=d*u),n.minWidth=Math.min(l,c),n.minHeight=Math.min(h,d),n.maxWidth=c,n.maxHeight=d}i&&(s?(n.minLeft=Math.max(0,r.left),n.minTop=Math.max(0,r.top),n.maxLeft=Math.min(o.width,r.left+r.width)-n.width,n.maxTop=Math.min(o.height,r.top+r.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=o.width-n.width,n.maxTop=o.height-n.height))},renderCropBox:function(){var t=this.options,i=this.containerData,e=this.cropBoxData;(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCropBox(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,t.movable&&t.cropBoxMovable&&gt(this.face,ft,e.width>=i.width&&e.height>=i.height?ve:zt),K(this.cropBox,O({width:e.width,height:e.height},pt({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),st(this.element,St,this.getData())}},Bi={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,o=i?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",n=document.createElement("img");if(i&&(n.crossOrigin=i),n.src=o,n.alt=r,this.viewBox.appendChild(n),this.viewBoxImage=n,!!e){var s=e;typeof e=="string"?s=t.ownerDocument.querySelectorAll(e):e.querySelector&&(s=[e]),this.previews=s,L(s,function(u){var l=document.createElement("img");gt(u,wt,{width:u.offsetWidth,height:u.offsetHeight,html:u.innerHTML}),i&&(l.crossOrigin=i),l.src=o,l.alt=r,l.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',u.innerHTML="",u.appendChild(l)})}},resetPreview:function(){L(this.previews,function(t){var i=It(t,wt);K(t,{width:i.width,height:i.height}),t.innerHTML=i.html,xi(t,wt)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,o=e.width,r=e.height,n=t.width,s=t.height,u=e.left-i.left-t.left,l=e.top-i.top-t.top;!this.cropped||this.disabled||(K(this.viewBoxImage,O({width:n,height:s},pt(O({translateX:-u,translateY:-l},t)))),L(this.previews,function(h){var c=It(h,wt),d=c.width,g=c.height,v=d,D=g,f=1;o&&(f=d/o,D=r*f),r&&D>g&&(f=g/r,v=o*f,D=g),K(h,{width:v,height:D}),K(h.getElementsByTagName("img")[0],O({width:n*f,height:s*f},pt(O({translateX:-u*f,translateY:-l*f},t))))}))}},Ii={bind:function(){var t=this.element,i=this.options,e=this.cropper;X(i.cropstart)&&U(t,_t,i.cropstart),X(i.cropmove)&&U(t,Lt,i.cropmove),X(i.cropend)&&U(t,At,i.cropend),X(i.crop)&&U(t,St,i.crop),X(i.zoom)&&U(t,Bt,i.zoom),U(e,ee,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&U(e,oe,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&U(e,te,this.onDblclick=this.dblclick.bind(this)),U(t.ownerDocument,ie,this.onCropMove=this.cropMove.bind(this)),U(t.ownerDocument,ae,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&U(window,ne,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;X(i.cropstart)&&j(t,_t,i.cropstart),X(i.cropmove)&&j(t,Lt,i.cropmove),X(i.cropend)&&j(t,At,i.cropend),X(i.crop)&&j(t,St,i.crop),X(i.zoom)&&j(t,Bt,i.zoom),j(e,ee,this.onCropStart),i.zoomable&&i.zoomOnWheel&&j(e,oe,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&j(e,te,this.onDblclick),j(t.ownerDocument,ie,this.onCropMove),j(t.ownerDocument,ae,this.onCropEnd),i.responsive&&j(window,ne,this.onResize)}},ki={resize:function(){if(!this.disabled){var t=this.options,i=this.container,e=this.containerData,o=i.offsetWidth/e.width,r=i.offsetHeight/e.height,n=Math.abs(o-1)>Math.abs(r-1)?o:r;if(n!==1){var s,u;t.restore&&(s=this.getCanvasData(),u=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(L(s,function(l,h){s[h]=l*n})),this.setCropBoxData(L(u,function(l,h){u[h]=l*n})))}}},dblclick:function(){this.disabled||this.options.dragMode===be||this.setDragMode(bi(this.dragBox,Rt)?we:Pt)},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?o=t.deltaY>0?1:-1:t.wheelDelta?o=-t.wheelDelta/120:t.detail&&(o=t.detail>0?1:-1),this.zoom(-o*e,t)))},cropStart:function(t){var i=t.buttons,e=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(m(i)&&i!==1||m(e)&&e!==0||t.ctrlKey))){var o=this.options,r=this.pointers,n;t.changedTouches?L(t.changedTouches,function(s){r[s.identifier]=bt(s)}):r[t.pointerId||0]=bt(t),Object.keys(r).length>1&&o.zoomable&&o.zoomOnTouch?n=me:n=It(t.target,ft),ci.test(n)&&st(this.element,_t,{originalEvent:t,action:n})!==!1&&(t.preventDefault(),this.action=n,this.cropping=!1,n===ge&&(this.cropping=!0,B(this.dragBox,yt)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var e=this.pointers;t.preventDefault(),st(this.element,Lt,{originalEvent:t,action:i})!==!1&&(t.changedTouches?L(t.changedTouches,function(o){O(e[o.identifier]||{},bt(o,!0))}):O(e[t.pointerId||0]||{},bt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?L(t.changedTouches,function(o){delete e[o.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,nt(this.dragBox,yt,this.cropped&&this.options.modal)),st(this.element,At,{originalEvent:t,action:i}))}}},Hi={change:function(t){var i=this.options,e=this.canvasData,o=this.containerData,r=this.cropBoxData,n=this.pointers,s=this.action,u=i.aspectRatio,l=r.left,h=r.top,c=r.width,d=r.height,g=l+c,v=h+d,D=0,f=0,R=o.width,N=o.height,E=!0,$;!u&&t.shiftKey&&(u=c&&d?c/d:1),this.limited&&(D=r.minLeft,f=r.minTop,R=D+Math.min(o.width,e.width,e.left+e.width),N=f+Math.min(o.height,e.height,e.top+e.height));var k=n[Object.keys(n)[0]],p={x:k.endX-k.startX,y:k.endY-k.startY},b=function(P){switch(P){case tt:g+p.x>R&&(p.x=R-g);break;case et:l+p.x<D&&(p.x=D-l);break;case Q:h+p.y<f&&(p.y=f-h);break;case at:v+p.y>N&&(p.y=N-v);break}};switch(s){case zt:l+=p.x,h+=p.y;break;case tt:if(p.x>=0&&(g>=R||u&&(h<=f||v>=N))){E=!1;break}b(tt),c+=p.x,c<0&&(s=et,c=-c,l-=c),u&&(d=c/u,h+=(r.height-d)/2);break;case Q:if(p.y<=0&&(h<=f||u&&(l<=D||g>=R))){E=!1;break}b(Q),d-=p.y,h+=p.y,d<0&&(s=at,d=-d,h-=d),u&&(c=d*u,l+=(r.width-c)/2);break;case et:if(p.x<=0&&(l<=D||u&&(h<=f||v>=N))){E=!1;break}b(et),c-=p.x,l+=p.x,c<0&&(s=tt,c=-c,l-=c),u&&(d=c/u,h+=(r.height-d)/2);break;case at:if(p.y>=0&&(v>=N||u&&(l<=D||g>=R))){E=!1;break}b(at),d+=p.y,d<0&&(s=Q,d=-d,h-=d),u&&(c=d*u,l+=(r.width-c)/2);break;case ct:if(u){if(p.y<=0&&(h<=f||g>=R)){E=!1;break}b(Q),d-=p.y,h+=p.y,c=d*u}else b(Q),b(tt),p.x>=0?g<R?c+=p.x:p.y<=0&&h<=f&&(E=!1):c+=p.x,p.y<=0?h>f&&(d-=p.y,h+=p.y):(d-=p.y,h+=p.y);c<0&&d<0?(s=dt,d=-d,c=-c,h-=d,l-=c):c<0?(s=lt,c=-c,l-=c):d<0&&(s=ut,d=-d,h-=d);break;case lt:if(u){if(p.y<=0&&(h<=f||l<=D)){E=!1;break}b(Q),d-=p.y,h+=p.y,c=d*u,l+=r.width-c}else b(Q),b(et),p.x<=0?l>D?(c-=p.x,l+=p.x):p.y<=0&&h<=f&&(E=!1):(c-=p.x,l+=p.x),p.y<=0?h>f&&(d-=p.y,h+=p.y):(d-=p.y,h+=p.y);c<0&&d<0?(s=ut,d=-d,c=-c,h-=d,l-=c):c<0?(s=ct,c=-c,l-=c):d<0&&(s=dt,d=-d,h-=d);break;case dt:if(u){if(p.x<=0&&(l<=D||v>=N)){E=!1;break}b(et),c-=p.x,l+=p.x,d=c/u}else b(at),b(et),p.x<=0?l>D?(c-=p.x,l+=p.x):p.y>=0&&v>=N&&(E=!1):(c-=p.x,l+=p.x),p.y>=0?v<N&&(d+=p.y):d+=p.y;c<0&&d<0?(s=ct,d=-d,c=-c,h-=d,l-=c):c<0?(s=ut,c=-c,l-=c):d<0&&(s=lt,d=-d,h-=d);break;case ut:if(u){if(p.x>=0&&(g>=R||v>=N)){E=!1;break}b(tt),c+=p.x,d=c/u}else b(at),b(tt),p.x>=0?g<R?c+=p.x:p.y>=0&&v>=N&&(E=!1):c+=p.x,p.y>=0?v<N&&(d+=p.y):d+=p.y;c<0&&d<0?(s=lt,d=-d,c=-c,h-=d,l-=c):c<0?(s=dt,c=-c,l-=c):d<0&&(s=ct,d=-d,h-=d);break;case ve:this.move(p.x,p.y),E=!1;break;case me:this.zoom(Mi(n),t),E=!1;break;case ge:if(!p.x||!p.y){E=!1;break}$=Ee(this.cropper),l=k.startX-$.left,h=k.startY-$.top,c=r.minWidth,d=r.minHeight,p.x>0?s=p.y>0?ut:ct:p.x<0&&(l-=c,s=p.y>0?dt:lt),p.y<0&&(h-=d),this.cropped||(G(this.cropBox,Y),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}E&&(r.width=c,r.height=d,r.left=l,r.top=h,this.action=s,this.renderCropBox()),L(n,function(S){S.startX=S.endX,S.startY=S.endY})}},zi={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&B(this.dragBox,yt),G(this.cropBox,Y),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=O({},this.initialImageData),this.canvasData=O({},this.initialCanvasData),this.cropBoxData=O({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(O(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),G(this.dragBox,yt),B(this.cropBox,Y)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,L(this.previews,function(e){e.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,G(this.cropper,Zt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,B(this.cropper,Zt)),this},destroy:function(){var t=this.element;return t[T]?(t[T]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=e.left,r=e.top;return this.moveTo(Ct(t)?t:o+Number(t),Ct(i)?i:r+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(m(t)&&(e.left=t,o=!0),m(i)&&(e.top=i,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(e.width*t/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var o=this.options,r=this.canvasData,n=r.width,s=r.height,u=r.naturalWidth,l=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&o.zoomable){var h=u*t,c=l*t;if(st(this.element,Bt,{ratio:t,oldRatio:n/u,originalEvent:e})===!1)return this;if(e){var d=this.pointers,g=Ee(this.cropper),v=d&&Object.keys(d).length?Ci(d):{pageX:e.pageX,pageY:e.pageY};r.left-=(h-n)*((v.pageX-g.left-r.left)/n),r.top-=(c-s)*((v.pageY-g.top-r.top)/s)}else rt(i)&&m(i.x)&&m(i.y)?(r.left-=(h-n)*((i.x-r.left)/n),r.top-=(c-s)*((i.y-r.top)/s)):(r.left-=(h-n)/2,r.top-=(c-s)/2);r.width=h,r.height=c,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),m(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,m(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(m(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.imageData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(m(t)&&(e.scaleX=t,o=!0),m(i)&&(e.scaleY=i,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,e=this.imageData,o=this.canvasData,r=this.cropBoxData,n;if(this.ready&&this.cropped){n={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};var s=e.width/e.naturalWidth;if(L(n,function(h,c){n[c]=h/s}),t){var u=Math.round(n.y+n.height),l=Math.round(n.x+n.width);n.x=Math.round(n.x),n.y=Math.round(n.y),n.width=l-n.x,n.height=u-n.y}}else n={x:0,y:0,width:0,height:0};return i.rotatable&&(n.rotate=e.rotate||0),i.scalable&&(n.scaleX=e.scaleX||1,n.scaleY=e.scaleY||1),n},setData:function(t){var i=this.options,e=this.imageData,o=this.canvasData,r={};if(this.ready&&!this.disabled&&rt(t)){var n=!1;i.rotatable&&m(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,n=!0),i.scalable&&(m(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,n=!0),m(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);var s=e.width/e.naturalWidth;m(t.x)&&(r.left=t.x*s+o.left),m(t.y)&&(r.top=t.y*s+o.top),m(t.width)&&(r.width=t.width*s),m(t.height)&&(r.height=t.height*s),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?O({},this.containerData):{}},getImageData:function(){return this.sized?O({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&L(["left","top","width","height","naturalWidth","naturalHeight"],function(e){i[e]=t[e]}),i},setCanvasData:function(t){var i=this.canvasData,e=i.aspectRatio;return this.ready&&!this.disabled&&rt(t)&&(m(t.left)&&(i.left=t.left),m(t.top)&&(i.top=t.top),m(t.width)?(i.width=t.width,i.height=t.width/e):m(t.height)&&(i.height=t.height,i.width=t.height*e),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,e=this.options.aspectRatio,o,r;return this.ready&&this.cropped&&!this.disabled&&rt(t)&&(m(t.left)&&(i.left=t.left),m(t.top)&&(i.top=t.top),m(t.width)&&t.width!==i.width&&(o=!0,i.width=t.width),m(t.height)&&t.height!==i.height&&(r=!0,i.height=t.height),e&&(o?i.height=i.width/e:r&&(i.width=i.height*e)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,e=Ti(this.image,this.imageData,i,t);if(!this.cropped)return e;var o=this.getData(t.rounded),r=o.x,n=o.y,s=o.width,u=o.height,l=e.width/Math.floor(i.naturalWidth);l!==1&&(r*=l,n*=l,s*=l,u*=l);var h=s/u,c=Z({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=Z({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),g=Z({aspectRatio:h,width:t.width||(l!==1?e.width:s),height:t.height||(l!==1?e.height:u)}),v=g.width,D=g.height;v=Math.min(c.width,Math.max(d.width,v)),D=Math.min(c.height,Math.max(d.height,D));var f=document.createElement("canvas"),R=f.getContext("2d");f.width=ot(v),f.height=ot(D),R.fillStyle=t.fillColor||"transparent",R.fillRect(0,0,v,D);var N=t.imageSmoothingEnabled,E=N===void 0?!0:N,$=t.imageSmoothingQuality;R.imageSmoothingEnabled=E,$&&(R.imageSmoothingQuality=$);var k=e.width,p=e.height,b=r,S=n,P,w,y,x,C,M;b<=-s||b>k?(b=0,P=0,y=0,C=0):b<=0?(y=-b,b=0,P=Math.min(k,s+b),C=P):b<=k&&(y=0,P=Math.min(s,k-b),C=P),P<=0||S<=-u||S>p?(S=0,w=0,x=0,M=0):S<=0?(x=-S,S=0,w=Math.min(p,u+S),M=w):S<=p&&(x=0,w=Math.min(u,p-S),M=w);var I=[b,S,P,w];if(C>0&&M>0){var J=v/s;I.push(y*J,x*J,C*J,M*J)}return R.drawImage.apply(R,[e].concat(fe(I.map(function(vt){return Math.floor(ot(vt))})))),f},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!Ct(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,e=this.dragBox,o=this.face;if(this.ready&&!this.disabled){var r=t===Pt,n=i.movable&&t===we;t=r||n?t:be,i.dragMode=t,gt(e,ft,t),nt(e,Rt,r),nt(e,Nt,n),i.cropBoxMovable||(gt(o,ft,t),nt(o,Rt,r),nt(o,Nt,n))}return this}},Pi=q.Cropper,Oe=function(){function a(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ze(this,a),!t||!di.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=O({},he,rt(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Je(a,[{key:"init",value:function(){var i=this.element,e=i.tagName.toLowerCase(),o;if(!i[T]){if(i[T]=this,e==="img"){if(this.isImg=!0,o=i.getAttribute("src")||"",this.originalUrl=o,!o)return;o=i.src}else e==="canvas"&&window.HTMLCanvasElement&&(o=i.toDataURL());this.load(o)}}},{key:"load",value:function(i){var e=this;if(i){this.url=i,this.imageData={};var o=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(li.test(i)){ui.test(i)?this.read(Ni(i)):this.clone();return}var n=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=n,n.onabort=s,n.onerror=s,n.ontimeout=s,n.onprogress=function(){n.getResponseHeader("content-type")!==se&&n.abort()},n.onload=function(){e.read(n.response)},n.onloadend=function(){e.reloading=!1,e.xhr=null},r.checkCrossOrigin&&le(i)&&o.crossOrigin&&(i=ue(i)),n.open("GET",i,!0),n.responseType="arraybuffer",n.withCredentials=o.crossOrigin==="use-credentials",n.send()}}},{key:"read",value:function(i){var e=this.options,o=this.imageData,r=Ai(i),n=0,s=1,u=1;if(r>1){this.url=Si(i,se);var l=Li(r);n=l.rotate,s=l.scaleX,u=l.scaleY}e.rotatable&&(o.rotate=n),e.scalable&&(o.scaleX=s,o.scaleY=u),this.clone()}},{key:"clone",value:function(){var i=this.element,e=this.url,o=i.crossOrigin,r=e;this.options.checkCrossOrigin&&le(e)&&(o||(o="anonymous"),r=ue(e)),this.crossOrigin=o,this.crossOriginUrl=r;var n=document.createElement("img");o&&(n.crossOrigin=o),n.src=r||e,n.alt=i.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),B(n,Jt),i.parentNode.insertBefore(n,i.nextSibling)}},{key:"start",value:function(){var i=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var o=q.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(q.navigator.userAgent),r=function(l,h){O(i.imageData,{naturalWidth:l,naturalHeight:h,aspectRatio:l/h}),i.initialImageData=O({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(e.naturalWidth&&!o){r(e.naturalWidth,e.naturalHeight);return}var n=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){r(n.width,n.height),o||s.removeChild(n)},n.src=e.src,o||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(n))}},{key:"stop",value:function(){var i=this.image;i.onload=null,i.onerror=null,i.parentNode.removeChild(i),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var i=this.element,e=this.options,o=this.image,r=i.parentNode,n=document.createElement("div");n.innerHTML=pi;var s=n.querySelector(".".concat(T,"-container")),u=s.querySelector(".".concat(T,"-canvas")),l=s.querySelector(".".concat(T,"-drag-box")),h=s.querySelector(".".concat(T,"-crop-box")),c=h.querySelector(".".concat(T,"-face"));this.container=r,this.cropper=s,this.canvas=u,this.dragBox=l,this.cropBox=h,this.viewBox=s.querySelector(".".concat(T,"-view-box")),this.face=c,u.appendChild(o),B(i,Y),r.insertBefore(s,i.nextSibling),G(o,Jt),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,B(h,Y),e.guides||B(h.getElementsByClassName("".concat(T,"-dashed")),Y),e.center||B(h.getElementsByClassName("".concat(T,"-center")),Y),e.background&&B(s,"".concat(T,"-bg")),e.highlight||B(c,ni),e.cropBoxMovable&&(B(c,Nt),gt(c,ft,zt)),e.cropBoxResizable||(B(h.getElementsByClassName("".concat(T,"-line")),Y),B(h.getElementsByClassName("".concat(T,"-point")),Y)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),X(e.ready)&&U(i,re,e.ready,{once:!0}),st(i,re)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),G(this.element,Y)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Pi,a}},{key:"setDefaults",value:function(i){O(he,rt(i)&&i)}}])}();O(Oe.prototype,_i,Bi,Ii,ki,Hi,zi);const Xi={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function Yi(a,t){return V(),W("svg",Xi,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 0 1 755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8m756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 0 1 512.1 856a342.24 342.24 0 0 1-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 0 0-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 0 0-8-8.2"},null,-1)]))}const Wi={render:Yi},Vi={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function $i(a,t){return V(),W("svg",Vi,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 0 0-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13M878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8"},null,-1)]))}const Ui={render:$i},ji={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",class:"icon",viewBox:"0 0 1024 1024"};function Gi(a,t){return V(),W("svg",ji,t[0]||(t[0]=[z("path",{d:"m296.992 216.992-272 272L3.008 512l21.984 23.008 272 272 46.016-46.016L126.016 544h772L680.992 760.992l46.016 46.016 272-272L1020.992 512l-21.984-23.008-272-272-46.048 46.048L898.016 480h-772l216.96-216.992z"},null,-1)]))}const qi={render:Gi},Fi={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",class:"icon",viewBox:"0 0 1024 1024"};function Qi(a,t){return V(),W("svg",Fi,t[0]||(t[0]=[z("path",{d:"m512 67.008-23.008 21.984-256 256 46.048 46.048L480 190.016v644L279.008 632.96l-46.048 46.08 256 256 23.008 21.984 23.008-21.984 256-256-46.016-46.016L544 834.016v-644l200.992 200.96 46.016-45.984-256-256z"},null,-1)]))}const Ki={render:Qi},Zi={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function Ji(a,t){return V(),W("svg",Zi,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M868 545.5 536.1 163a31.96 31.96 0 0 0-48.3 0L156 545.5a7.97 7.97 0 0 0 6 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2"},null,-1)]))}const ta={render:Ji},ea={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",class:"icon",viewBox:"0 0 1024 1024"};function ia(a,t){return V(),W("svg",ea,t[0]||(t[0]=[Ie('<path d="M956.8 988.8H585.6c-16 0-25.6-9.6-25.6-28.8V576c0-16 9.6-28.8 25.6-28.8h371.2c16 0 25.6 9.6 25.6 28.8v384c0 16-9.6 28.8-25.6 28.8M608 937.6h326.4V598.4H608zm-121.6 44.8C262.4 982.4 144 848 144 595.2c0-19.2 9.6-28.8 25.6-28.8s25.6 12.8 25.6 28.8c0 220.8 96 326.4 288 326.4 16 0 25.6 12.8 25.6 28.8s-6.4 32-22.4 32"></path><path d="M262.4 694.4c-6.4 0-9.6-3.2-16-6.4L160 601.6c-9.6-9.6-9.6-22.4 0-28.8s22.4-9.6 28.8 0l86.4 86.4c9.6 9.6 9.6 22.4 0 28.8-3.2 3.2-6.4 6.4-12.8 6.4"></path><path d="M86.4 694.4c-6.4 0-9.6-3.2-16-6.4-9.6-9.6-9.6-22.4 0-28.8l86.4-86.4c9.6-9.6 22.4-9.6 28.8 0 9.6 9.6 9.6 22.4 0 28.8L99.2 688c-3.2 3.2-6.4 6.4-12.8 6.4m790.4-249.6c-16 0-28.8-12.8-28.8-32 0-224-99.2-336-300.8-336-16 0-28.8-12.8-28.8-32s9.6-32 28.8-32c233.6 0 355.2 137.6 355.2 396.8 0 22.4-9.6 35.2-25.6 35.2"></path><path d="M876.8 448c-6.4 0-9.6-3.2-16-6.4l-86.4-86.4c-9.6-9.6-9.6-22.4 0-28.8s22.4-9.6 28.8 0l86.4 86.4c9.6 9.6 9.6 22.4 0 28.8 0 3.2-6.4 6.4-12.8 6.4"></path><path d="M876.8 448c-6.4 0-9.6-3.2-16-6.4-9.6-9.6-9.6-22.4 0-28.8l86.4-86.4c9.6-9.6 22.4-9.6 28.8 0s9.6 22.4 0 28.8l-86.4 86.4c-3.2 3.2-6.4 6.4-12.8 6.4M288 524.8C156.8 524.8 48 416 48 278.4S156.8 35.2 288 35.2 528 144 528 281.6 419.2 524.8 288 524.8m-3.2-432c-99.2 0-179.2 83.2-179.2 185.6S185.6 464 284.8 464 464 380.8 464 278.4 384 92.8 284.8 92.8"></path>',5)]))}const aa={render:ia},ra={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function na(a,t){return V(),W("svg",ra,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0 0 48.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2"},null,-1)]))}const oa={render:na},sa={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function ha(a,t){return V(),W("svg",sa,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 0 0 0 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8"},null,-1)]))}const ca={render:ha},la={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function ua(a,t){return V(),W("svg",la,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8"},null,-1)]))}const da={render:ua},pa={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function fa(a,t){return V(),W("svg",pa,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M869 487.8 491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 0 0 0-48.4"},null,-1)]))}const ga={render:fa},va={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function ma(a,t){return V(),W("svg",va,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32m-44 402H188V494h440z"},null,-1),z("path",{fill:"currentColor",d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8 11 40.7 14 82.7 8.9 124.8-.7 5.4-1.4 10.8-2.4 16.1h74.9c14.8-103.6-11.3-213-81-302.3"},null,-1)]))}const wa={render:ma},ba={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function ya(a,t){return V(),W("svg",ba,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8m284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11M696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430"},null,-1)]))}const xa={render:ya},Da={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function Ma(a,t){return V(),W("svg",Da,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2-69.6 89.2-95.7 198.6-81.1 302.4h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8"},null,-1),z("path",{fill:"currentColor",d:"M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32m-44 402H396V494h440z"},null,-1)]))}const Ca={render:Ma},Ea={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"};function Ta(a,t){return V(),W("svg",Ea,t[0]||(t[0]=[z("path",{fill:"currentColor",d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8m284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11M696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430"},null,-1)]))}const Oa={render:Ta},Ra={aspectRatio:1,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,autoCrop:!0,background:!0,highlight:!0,center:!0,responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,scalable:!0,modal:!0,guides:!0,movable:!0,rotatable:!0},Na={src:{type:String,required:!0},alt:{type:String},circled:{type:Boolean,default:!1},isClose:{type:Boolean,default:!0},realTimePreview:{type:Boolean,default:!0},height:{type:[String,Number],default:"360px"},crossorigin:{type:String,default:void 0},imageStyle:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},Sa=Ft({name:"ReCropper",props:Na,setup(a,{attrs:t,emit:i}){const e=F(),o=F(),r=F(),n=F(a.circled),s=F(a.isClose),u=F(a.src),l=F(!1),h=F();let c=1,d=1;const g=Xe(E,80),v=mt(()=>ht({height:a.height,maxWidth:"100%"},a.imageStyle)),D=mt(()=>[t.class,{"re-circled":n.value}]),f=mt(()=>["p-[6px]","h-[30px]","w-[30px]","outline-hidden","rounded-[4px]","cursor-pointer","hover:bg-[rgba(0,0,0,0.06)]"]),R=mt(()=>({height:`${a.height}`.replace(/px/,"")+"px"}));ke(N),He(()=>{var w;(w=r.value)==null||w.destroy(),l.value=!1,r.value=null,h.value="",c=1,d=1}),ze(e,()=>p("reset"));function N(){return qt(this,null,function*(){const w=Pe(o);w&&(r.value=new Oe(w,ht(Gt(ht({},Ra),{ready:()=>{l.value=!0,E(),Ye(400).then(()=>i("readied",r.value))},crop(){g()},zoom(){g()},cropmove(){g()}}),a.options)))})}function E(){a.realTimePreview&&$()}function $(){if(!r.value)return;(n.value?k():r.value.getCroppedCanvas()).toBlob(y=>{if(!y)return;const x=new FileReader;x.readAsDataURL(y),x.onloadend=C=>{var M;!((M=C.target)!=null&&M.result)||!y||(h.value=C.target.result,i("cropper",{base64:C.target.result,blob:y,info:ht({size:y.size},r.value.getData())}))},x.onerror=()=>{i("error")}})}function k(){const w=r.value.getCroppedCanvas(),y=document.createElement("canvas"),x=y.getContext("2d"),C=w.width,M=w.height;return y.width=C,y.height=M,x.imageSmoothingEnabled=!0,x.drawImage(w,0,0,C,M),x.globalCompositeOperation="destination-in",x.beginPath(),x.arc(C/2,M/2,Math.min(C,M)/2,0,2*Math.PI,!0),x.fill(),y}function p(w,y){var x,C,M,I;w==="scaleX"&&(c=y=c===-1?1:-1),w==="scaleY"&&(d=y=d===-1?1:-1),y&&qe(y)?(C=(x=r.value)==null?void 0:x[w])==null||C.call(x,...y):(I=(M=r.value)==null?void 0:M[w])==null||I.call(M,y)}function b(w){const y=new FileReader;return y.readAsDataURL(w),u.value="",y.onload=x=>{var C;u.value=(C=x.target)==null?void 0:C.result},y.onloadend=()=>{N()},!1}const S=Ft({directives:{tippy:Ue,longpress:$e},setup(){return()=>_("div",{class:"flex flex-wrap w-[60px] justify-between"},[_(je,{accept:"image/*","show-file-list":!1,"before-upload":b},{default:()=>[H(_(Ui,{class:f.value},null),[[A("tippy"),{content:"上传",placement:"left-start"}]])]}),H(_(da,{class:f.value,onClick:()=>Ge(h.value,"cropping.png")},null),[[A("tippy"),{content:"下载",placement:"right-start"}]]),H(_(aa,{class:f.value,onClick:()=>{n.value=!n.value,E()}},null),[[A("tippy"),{content:"圆形、矩形裁剪",placement:"left-start"}]]),H(_(Wi,{class:f.value,onClick:()=>p("reset")},null),[[A("tippy"),{content:"重置",placement:"right-start"}]]),H(_(ta,{class:f.value},null),[[A("tippy"),{content:"上移(可长按)",placement:"left-start"}],[A("longpress"),()=>p("move",[0,-10]),"0:100"]]),H(_(oa,{class:f.value},null),[[A("tippy"),{content:"下移(可长按)",placement:"right-start"}],[A("longpress"),()=>p("move",[0,10]),"0:100"]]),H(_(ca,{class:f.value},null),[[A("tippy"),{content:"左移(可长按)",placement:"left-start"}],[A("longpress"),()=>p("move",[-10,0]),"0:100"]]),H(_(ga,{class:f.value},null),[[A("tippy"),{content:"右移(可长按)",placement:"right-start"}],[A("longpress"),()=>p("move",[10,0]),"0:100"]]),H(_(qi,{class:f.value,onClick:()=>p("scaleX",-1)},null),[[A("tippy"),{content:"水平翻转",placement:"left-start"}]]),H(_(Ki,{class:f.value,onClick:()=>p("scaleY",-1)},null),[[A("tippy"),{content:"垂直翻转",placement:"right-start"}]]),H(_(wa,{class:f.value,onClick:()=>p("rotate",-45)},null),[[A("tippy"),{content:"逆时针旋转",placement:"left-start"}]]),H(_(Ca,{class:f.value,onClick:()=>p("rotate",45)},null),[[A("tippy"),{content:"顺时针旋转",placement:"right-start"}]]),H(_(xa,{class:f.value},null),[[A("tippy"),{content:"放大(可长按)",placement:"left-start"}],[A("longpress"),()=>p("zoom",.1),"0:100"]]),H(_(Oa,{class:f.value},null),[[A("tippy"),{content:"缩小(可长按)",placement:"right-start"}],[A("longpress"),()=>p("zoom",-.1),"0:100"]])])}});function P(w){w.preventDefault();const{show:y,setProps:x,destroy:C,state:M}=We(e,{content:S,arrow:!1,theme:"light",trigger:"manual",interactive:!0,appendTo:"parent",placement:"bottom-end"});if(x({getReferenceClientRect:()=>({width:0,height:0,top:w.clientY,bottom:w.clientY,left:w.clientX,right:w.clientX})}),y(),s.value){if(!M.value.isShown&&!M.value.isVisible)return;Ve(e,"click",C)}}return{inSrc:u,props:a,imgElRef:o,tippyElRef:e,getClass:D,getWrapperStyle:R,getImageStyle:v,isReady:l,croppered:$,onContextmenu:P}},render(){const{inSrc:a,isReady:t,getClass:i,getImageStyle:e,onContextmenu:o,getWrapperStyle:r}=this,{alt:n,crossorigin:s}=this.props;return a?_("div",{ref:"tippyElRef",class:i,style:r,onContextmenu:u=>o(u)},[H(_("img",{ref:"imgElRef",style:e,src:a,alt:n,crossorigin:s},null),[[Fe,t]])]):null}}),_a=Qe(Sa);export{_a as R};