沙钢智慧能源系统前端代码
houzhongjian
2024-10-09 314507f8ddadd9c66e98d260c3b2a5dad1a04015
1
2
3
4
5
6
7
8
9
10
import{e as Me,d as ct,f as De,ad as it,bW as ki,j as ke,r as X,aO as Be,bX as bt,bO as Ot,a$ as Et,bc as Oe,bP as Bi,bN as Oi,k as B,bY as G,O as Ht,bZ as Ee,b_ as Ei,q as Ti,as as _,bM as zi,b as Si,b$ as Wi,a as v,o as U,c as lt,P as Li,ae as Ni,C as at,aB as Te,n as Q,ac as Yt,c0 as Ri,c1 as ze,B as R,I as Hi,D as Se,g as Tt,h as dt,bs as Yi,c2 as Ai,V as We,w as Xi,Q as _i,H as Le,aE as Ii}from"./index-CHTXMeh8.js";import{b as ji}from"./profile-RahJNlBN.js";import{E as Ne,a as Pi}from"./el-avatar-DfAMRPCL.js";import{_ as Ui}from"./Dialog.vue_vue_type_style_index_0_lang-DH0TiLYN.js";import{_ as $i}from"./XButton-C1WkVWZR.js";const Re=ct({name:"ElSpaceItem",props:Me({prefixCls:{type:String}}),setup(t,{slots:i}){const e=De("space"),n=it(()=>`${t.prefixCls||e.b()}__item`);return()=>ki("div",{class:n.value},ke(i,"default"))}}),He={small:8,default:12,large:16},qi=ct({name:"ElSpace",props:Me({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},class:{type:Et([String,Object,Array]),default:""},style:{type:Et([String,Array,Object]),default:""},alignment:{type:Et(String),default:"center"},prefixCls:{type:String},spacer:{type:Et([Object,String,Number,Array]),default:null,validator:t=>Oe(t)||Ot(t)||Bi(t)},wrap:Boolean,fill:Boolean,fillRatio:{type:Number,default:100},size:{type:[String,Array,Number],values:Oi,validator:t=>Ot(t)||bt(t)&&t.length===2&&t.every(Ot)}}),setup(t,{slots:i}){const{classes:e,containerStyle:n,itemStyle:a}=function(h){const s=De("space"),c=it(()=>[s.b(),s.m(h.direction),h.class]),o=X(0),d=X(0),p=it(()=>[h.wrap||h.fill?{flexWrap:"wrap"}:{},{alignItems:h.alignment},{rowGap:`${d.value}px`,columnGap:`${o.value}px`},h.style]),l=it(()=>h.fill?{flexGrow:1,minWidth:`${h.fillRatio}%`}:{});return Be(()=>{const{size:m="small",wrap:f,direction:g,fill:b}=h;if(bt(m)){const[w=0,y=0]=m;o.value=w,d.value=y}else{let w;w=Ot(m)?m:He[m||"small"]||He.small,(f||b)&&g==="horizontal"?o.value=d.value=w:g==="horizontal"?(o.value=w,d.value=0):(d.value=w,o.value=0)}}),{classes:c,containerStyle:p,itemStyle:l}}(t);function r(h,s="",c=[]){const{prefixCls:o}=t;return h.forEach((d,p)=>{Ee(d)?bt(d.children)&&d.children.forEach((l,m)=>{Ee(l)&&bt(l.children)?r(l.children,`${s+m}-`,c):c.push(B(Re,{style:a.value,prefixCls:o,key:`nested-${s+m}`},{default:()=>[l]},G.PROPS|G.STYLE,["style","prefixCls"]))}):Ei(d)&&c.push(B(Re,{style:a.value,prefixCls:o,key:`LoopKey${s+p}`},{default:()=>[d]},G.PROPS|G.STYLE,["style","prefixCls"]))}),c}return()=>{var h;const{spacer:s,direction:c}=t,o=ke(i,"default",{key:0},()=>[]);if(((h=o.children)!=null?h:[]).length===0)return null;if(bt(o.children)){let d=r(o.children);if(s){const p=d.length-1;d=d.reduce((l,m,f)=>{const g=[...l,m];return f!==p&&g.push(B("span",{style:[a.value,c==="vertical"?"width: 100%":null],key:f},[Oe(s)?s:Ht(s,G.TEXT)],G.STYLE)),g},[])}return B("div",{class:e.value,style:n.value},d,G.STYLE|G.CLASS)}return o.children}}}),Vi=Ti(qi);/*!
 * 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 Ye(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.push.apply(e,n)}return e}function Ae(t){for(var i=1;i<arguments.length;i++){var e=arguments[i]!=null?arguments[i]:{};i%2?Ye(Object(e),!0).forEach(function(n){Qi(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ye(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Xe(t){var i=function(e,n){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,n||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(t,"string");return typeof i=="symbol"?i:i+""}function At(t){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},At(t)}function _e(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xe(n.key),n)}}function Qi(t,i,e){return(i=Xe(i))in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function Ie(t){return function(i){if(Array.isArray(i))return Xt(i)}(t)||function(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}(t)||function(i,e){if(i){if(typeof i=="string")return Xt(i,e);var n=Object.prototype.toString.call(i).slice(8,-1);if(n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set")return Array.from(i);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xt(i,e)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Xt(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,n=new Array(i);e<i;e++)n[e]=t[e];return n}var zt=typeof window<"u"&&window.document!==void 0,$=zt?window:{},_t=!(!zt||!$.document.documentElement)&&"ontouchstart"in $.document.documentElement,It=!!zt&&"PointerEvent"in $,O="cropper",jt="all",je="crop",Pe="move",Ue="zoom",nt="e",rt="w",pt="s",K="n",wt="ne",yt="nw",xt="se",Ct="sw",Pt="".concat(O,"-crop"),$e="".concat(O,"-disabled"),H="".concat(O,"-hidden"),qe="".concat(O,"-hide"),Fi="".concat(O,"-invisible"),St="".concat(O,"-modal"),Ut="".concat(O,"-move"),Mt="".concat(O,"Action"),Wt="".concat(O,"Preview"),$t="crop",Ve="move",Qe="none",qt="crop",Vt="cropend",Qt="cropmove",Ft="cropstart",Fe="dblclick",Ge=It?"pointerdown":_t?"touchstart":"mousedown",Ke=It?"pointermove":_t?"touchmove":"mousemove",Ze=It?"pointerup pointercancel":_t?"touchend touchcancel":"mouseup",Je="ready",ti="resize",ei="wheel",Gt="zoom",ii="image/jpeg",Gi=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Ki=/^data:/,Zi=/^data:image\/jpeg;base64,/,Ji=/^img|canvas$/i,ai={viewMode:0,dragMode:$t,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:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},ta=Number.isNaN||$.isNaN;function M(t){return typeof t=="number"&&!ta(t)}var ni=function(t){return t>0&&t<1/0};function Kt(t){return t===void 0}function ot(t){return At(t)==="object"&&t!==null}var ea=Object.prototype.hasOwnProperty;function ut(t){if(!ot(t))return!1;try{var i=t.constructor,e=i.prototype;return i&&e&&ea.call(e,"isPrototypeOf")}catch{return!1}}function Y(t){return typeof t=="function"}var ia=Array.prototype.slice;function ri(t){return Array.from?Array.from(t):ia.call(t)}function z(t,i){return t&&Y(i)&&(Array.isArray(t)||M(t.length)?ri(t).forEach(function(e,n){i.call(t,e,n,t)}):ot(t)&&Object.keys(t).forEach(function(e){i.call(t,t[e],e,t)})),t}var E=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return ot(t)&&e.length>0&&e.forEach(function(a){ot(a)&&Object.keys(a).forEach(function(r){t[r]=a[r]})}),t},aa=/\.\d*(?:0|9){12}\d*$/;function mt(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return aa.test(t)?Math.round(t*i)/i:t}var na=/^width|height|left|top|marginLeft|marginTop$/;function Z(t,i){var e=t.style;z(i,function(n,a){na.test(a)&&M(n)&&(n="".concat(n,"px")),e[a]=n})}function S(t,i){if(i)if(M(t.length))z(t,function(n){S(n,i)});else if(t.classList)t.classList.add(i);else{var e=t.className.trim();e?e.indexOf(i)<0&&(t.className="".concat(e," ").concat(i)):t.className=i}}function q(t,i){i&&(M(t.length)?z(t,function(e){q(e,i)}):t.classList?t.classList.remove(i):t.className.indexOf(i)>=0&&(t.className=t.className.replace(i,"")))}function gt(t,i,e){i&&(M(t.length)?z(t,function(n){gt(n,i,e)}):e?S(t,i):q(t,i))}var ra=/([a-z\d])([A-Z])/g;function Zt(t){return t.replace(ra,"$1-$2").toLowerCase()}function Jt(t,i){return ot(t[i])?t[i]:t.dataset?t.dataset[i]:t.getAttribute("data-".concat(Zt(i)))}function Dt(t,i,e){ot(e)?t[i]=e:t.dataset?t.dataset[i]=e:t.setAttribute("data-".concat(Zt(i)),e)}var oi=/\s\s*/,si=function(){var t=!1;if(zt){var i=!1,e=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,i},set:function(a){i=a}});$.addEventListener("test",e,n),$.removeEventListener("test",e,n)}return t}();function P(t,i,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=e;i.trim().split(oi).forEach(function(r){if(!si){var h=t.listeners;h&&h[r]&&h[r][e]&&(a=h[r][e],delete h[r][e],Object.keys(h[r]).length===0&&delete h[r],Object.keys(h).length===0&&delete t.listeners)}t.removeEventListener(r,a,n)})}function I(t,i,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=e;i.trim().split(oi).forEach(function(r){if(n.once&&!si){var h=t.listeners,s=h===void 0?{}:h;a=function(){delete s[r][e],t.removeEventListener(r,a,n);for(var c=arguments.length,o=new Array(c),d=0;d<c;d++)o[d]=arguments[d];e.apply(t,o)},s[r]||(s[r]={}),s[r][e]&&t.removeEventListener(r,s[r][e],n),s[r][e]=a,t.listeners=s}t.addEventListener(r,a,n)})}function ft(t,i,e){var n;return Y(Event)&&Y(CustomEvent)?n=new CustomEvent(i,{detail:e,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(i,!0,!0,e),t.dispatchEvent(n)}function hi(t){var i=t.getBoundingClientRect();return{left:i.left+(window.pageXOffset-document.documentElement.clientLeft),top:i.top+(window.pageYOffset-document.documentElement.clientTop)}}var te=$.location,oa=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function ci(t){var i=t.match(oa);return i!==null&&(i[1]!==te.protocol||i[2]!==te.hostname||i[3]!==te.port)}function li(t){var i="timestamp=".concat(new Date().getTime());return t+(t.indexOf("?")===-1?"?":"&")+i}function kt(t){var i=t.rotate,e=t.scaleX,n=t.scaleY,a=t.translateX,r=t.translateY,h=[];M(a)&&a!==0&&h.push("translateX(".concat(a,"px)")),M(r)&&r!==0&&h.push("translateY(".concat(r,"px)")),M(i)&&i!==0&&h.push("rotate(".concat(i,"deg)")),M(e)&&e!==1&&h.push("scaleX(".concat(e,")")),M(n)&&n!==1&&h.push("scaleY(".concat(n,")"));var s=h.length?h.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Lt(t,i){var e=t.pageX,n=t.pageY,a={endX:e,endY:n};return i?a:Ae({startX:e,startY:n},a)}function J(t){var i=t.aspectRatio,e=t.height,n=t.width,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=ni(n),h=ni(e);if(r&&h){var s=e*i;a==="contain"&&s>n||a==="cover"&&s<n?e=n/i:n=e*i}else r?e=n/i:h&&(n=e*i);return{width:n,height:e}}var di=String.fromCharCode,sa=/^data:.*,/;function ha(t){var i,e=new DataView(t);try{var n,a,r;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var h=e.byteLength,s=2;s+1<h;){if(e.getUint8(s)===255&&e.getUint8(s+1)===225){a=s;break}s+=1}if(a){var c=a+10;if(function(f,g,b){var w="";b+=g;for(var y=g;y<b;y+=1)w+=di(f.getUint8(y));return w}(e,a+4,4)==="Exif"){var o=e.getUint16(c);if(((n=o===18761)||o===19789)&&e.getUint16(c+2,n)===42){var d=e.getUint32(c+4,n);d>=8&&(r=c+d)}}}if(r){var p,l,m=e.getUint16(r,n);for(l=0;l<m;l+=1)if(p=r+12*l+2,e.getUint16(p,n)===274){p+=8,i=e.getUint16(p,n),e.setUint16(p,1,n);break}}}catch{i=1}return i}var ca={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,n=this.cropper,a=Number(i.minContainerWidth),r=Number(i.minContainerHeight);S(n,H),q(t,H);var h={width:Math.max(e.offsetWidth,a>=0?a:200),height:Math.max(e.offsetHeight,r>=0?r:100)};this.containerData=h,Z(n,{width:h.width,height:h.height}),S(t,H),q(n,H)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,n=Math.abs(i.rotate)%180==90,a=n?i.naturalHeight:i.naturalWidth,r=n?i.naturalWidth:i.naturalHeight,h=a/r,s=t.width,c=t.height;t.height*h>t.width?e===3?s=t.height*h:c=t.width/h:e===3?c=t.width/h:s=t.height*h;var o={aspectRatio:h,naturalWidth:a,naturalHeight:r,width:s,height:c};this.canvasData=o,this.limited=e===1||e===2,this.limitCanvas(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.left=(t.width-o.width)/2,o.top=(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCanvasData=E({},o)},limitCanvas:function(t,i){var e=this.options,n=this.containerData,a=this.canvasData,r=this.cropBoxData,h=e.viewMode,s=a.aspectRatio,c=this.cropped&&r;if(t){var o=Number(e.minCanvasWidth)||0,d=Number(e.minCanvasHeight)||0;h>1?(o=Math.max(o,n.width),d=Math.max(d,n.height),h===3&&(d*s>o?o=d*s:d=o/s)):h>0&&(o?o=Math.max(o,c?r.width:0):d?d=Math.max(d,c?r.height:0):c&&(o=r.width,(d=r.height)*s>o?o=d*s:d=o/s));var p=J({aspectRatio:s,width:o,height:d});o=p.width,d=p.height,a.minWidth=o,a.minHeight=d,a.maxWidth=1/0,a.maxHeight=1/0}if(i)if(h>(c?0:1)){var l=n.width-a.width,m=n.height-a.height;a.minLeft=Math.min(0,l),a.minTop=Math.min(0,m),a.maxLeft=Math.max(0,l),a.maxTop=Math.max(0,m),c&&this.limited&&(a.minLeft=Math.min(r.left,r.left+(r.width-a.width)),a.minTop=Math.min(r.top,r.top+(r.height-a.height)),a.maxLeft=r.left,a.maxTop=r.top,h===2&&(a.width>=n.width&&(a.minLeft=Math.min(0,l),a.maxLeft=Math.max(0,l)),a.height>=n.height&&(a.minTop=Math.min(0,m),a.maxTop=Math.max(0,m))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=n.width,a.maxTop=n.height},renderCanvas:function(t,i){var e=this.canvasData,n=this.imageData;if(i){var a=function(o){var d=o.width,p=o.height,l=o.degree;if((l=Math.abs(l)%180)==90)return{width:p,height:d};var m=l%90*Math.PI/180,f=Math.sin(m),g=Math.cos(m),b=d*g+p*f,w=d*f+p*g;return l>90?{width:w,height:b}:{width:b,height:w}}({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),r=a.width,h=a.height,s=e.width*(r/e.naturalWidth),c=e.height*(h/e.naturalHeight);e.left-=(s-e.width)/2,e.top-=(c-e.height)/2,e.width=s,e.height=c,e.aspectRatio=r/h,e.naturalWidth=r,e.naturalHeight=h,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,Z(this.canvas,E({width:e.width,height:e.height},kt({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,n=e.naturalWidth*(i.width/i.naturalWidth),a=e.naturalHeight*(i.height/i.naturalHeight);E(e,{width:n,height:a,left:(i.width-n)/2,top:(i.height-a)/2}),Z(this.image,E({width:e.width,height:e.height},kt(E({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio||t.initialAspectRatio,n=Number(t.autoCropArea)||.8,a={width:i.width,height:i.height};e&&(i.height*e>i.width?a.height=a.width/e:a.width=a.height*e),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*n),a.height=Math.max(a.minHeight,a.height*n),a.left=i.left+(i.width-a.width)/2,a.top=i.top+(i.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=E({},a)},limitCropBox:function(t,i){var e=this.options,n=this.containerData,a=this.canvasData,r=this.cropBoxData,h=this.limited,s=e.aspectRatio;if(t){var c=Number(e.minCropBoxWidth)||0,o=Number(e.minCropBoxHeight)||0,d=h?Math.min(n.width,a.width,a.width+a.left,n.width-a.left):n.width,p=h?Math.min(n.height,a.height,a.height+a.top,n.height-a.top):n.height;c=Math.min(c,n.width),o=Math.min(o,n.height),s&&(c&&o?o*s>c?o=c/s:c=o*s:c?o=c/s:o&&(c=o*s),p*s>d?p=d/s:d=p*s),r.minWidth=Math.min(c,d),r.minHeight=Math.min(o,p),r.maxWidth=d,r.maxHeight=p}i&&(h?(r.minLeft=Math.max(0,a.left),r.minTop=Math.max(0,a.top),r.maxLeft=Math.min(n.width,a.left+a.width)-r.width,r.maxTop=Math.min(n.height,a.top+a.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=n.width-r.width,r.maxTop=n.height-r.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&&Dt(this.face,Mt,e.width>=i.width&&e.height>=i.height?Pe:jt),Z(this.cropBox,E({width:e.width,height:e.height},kt({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ft(this.element,qt,this.getData())}},la={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,n=i?this.crossOriginUrl:this.url,a=t.alt||"The image to preview",r=document.createElement("img");if(i&&(r.crossOrigin=i),r.src=n,r.alt=a,this.viewBox.appendChild(r),this.viewBoxImage=r,e){var h=e;typeof e=="string"?h=t.ownerDocument.querySelectorAll(e):e.querySelector&&(h=[e]),this.previews=h,z(h,function(s){var c=document.createElement("img");Dt(s,Wt,{width:s.offsetWidth,height:s.offsetHeight,html:s.innerHTML}),i&&(c.crossOrigin=i),c.src=n,c.alt=a,c.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;"',s.innerHTML="",s.appendChild(c)})}},resetPreview:function(){z(this.previews,function(t){var i=Jt(t,Wt);Z(t,{width:i.width,height:i.height}),t.innerHTML=i.html,function(e,n){if(ot(e[n]))try{delete e[n]}catch{e[n]=void 0}else if(e.dataset)try{delete e.dataset[n]}catch{e.dataset[n]=void 0}else e.removeAttribute("data-".concat(Zt(n)))}(t,Wt)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,n=e.width,a=e.height,r=t.width,h=t.height,s=e.left-i.left-t.left,c=e.top-i.top-t.top;this.cropped&&!this.disabled&&(Z(this.viewBoxImage,E({width:r,height:h},kt(E({translateX:-s,translateY:-c},t)))),z(this.previews,function(o){var d=Jt(o,Wt),p=d.width,l=d.height,m=p,f=l,g=1;n&&(f=a*(g=p/n)),a&&f>l&&(m=n*(g=l/a),f=l),Z(o,{width:m,height:f}),Z(o.getElementsByTagName("img")[0],E({width:r*g,height:h*g},kt(E({translateX:-s*g,translateY:-c*g},t))))}))}},da={bind:function(){var t=this.element,i=this.options,e=this.cropper;Y(i.cropstart)&&I(t,Ft,i.cropstart),Y(i.cropmove)&&I(t,Qt,i.cropmove),Y(i.cropend)&&I(t,Vt,i.cropend),Y(i.crop)&&I(t,qt,i.crop),Y(i.zoom)&&I(t,Gt,i.zoom),I(e,Ge,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&I(e,ei,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&I(e,Fe,this.onDblclick=this.dblclick.bind(this)),I(t.ownerDocument,Ke,this.onCropMove=this.cropMove.bind(this)),I(t.ownerDocument,Ze,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&I(window,ti,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;Y(i.cropstart)&&P(t,Ft,i.cropstart),Y(i.cropmove)&&P(t,Qt,i.cropmove),Y(i.cropend)&&P(t,Vt,i.cropend),Y(i.crop)&&P(t,qt,i.crop),Y(i.zoom)&&P(t,Gt,i.zoom),P(e,Ge,this.onCropStart),i.zoomable&&i.zoomOnWheel&&P(e,ei,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&P(e,Fe,this.onDblclick),P(t.ownerDocument,Ke,this.onCropMove),P(t.ownerDocument,Ze,this.onCropEnd),i.responsive&&P(window,ti,this.onResize)}},pa={resize:function(){if(!this.disabled){var t,i,e=this.options,n=this.container,a=this.containerData,r=n.offsetWidth/a.width,h=n.offsetHeight/a.height,s=Math.abs(r-1)>Math.abs(h-1)?r:h;s!==1&&(e.restore&&(t=this.getCanvasData(),i=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(z(t,function(c,o){t[o]=c*s})),this.setCropBoxData(z(i,function(c,o){i[o]=c*s}))))}},dblclick:function(){var t,i;this.disabled||this.options.dragMode===Qe||this.setDragMode((t=this.dragBox,i=Pt,(t.classList?t.classList.contains(i):t.className.indexOf(i)>-1)?Ve:$t))},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*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 n,a=this.options,r=this.pointers;t.changedTouches?z(t.changedTouches,function(h){r[h.identifier]=Lt(h)}):r[t.pointerId||0]=Lt(t),n=Object.keys(r).length>1&&a.zoomable&&a.zoomOnTouch?Ue:Jt(t.target,Mt),Gi.test(n)&&ft(this.element,Ft,{originalEvent:t,action:n})!==!1&&(t.preventDefault(),this.action=n,this.cropping=!1,n===je&&(this.cropping=!0,S(this.dragBox,St)))}},cropMove:function(t){var i=this.action;if(!this.disabled&&i){var e=this.pointers;t.preventDefault(),ft(this.element,Qt,{originalEvent:t,action:i})!==!1&&(t.changedTouches?z(t.changedTouches,function(n){E(e[n.identifier]||{},Lt(n,!0))}):E(e[t.pointerId||0]||{},Lt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?z(t.changedTouches,function(n){delete e[n.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,gt(this.dragBox,St,this.cropped&&this.options.modal)),ft(this.element,Vt,{originalEvent:t,action:i}))}}},ua={change:function(t){var i,e=this.options,n=this.canvasData,a=this.containerData,r=this.cropBoxData,h=this.pointers,s=this.action,c=e.aspectRatio,o=r.left,d=r.top,p=r.width,l=r.height,m=o+p,f=d+l,g=0,b=0,w=a.width,y=a.height,D=!0;!c&&t.shiftKey&&(c=p&&l?p/l:1),this.limited&&(g=r.minLeft,b=r.minTop,w=g+Math.min(a.width,n.width,n.left+n.width),y=b+Math.min(a.height,n.height,n.top+n.height));var C=h[Object.keys(h)[0]],u={x:C.endX-C.startX,y:C.endY-C.startY},x=function(k){switch(k){case nt:m+u.x>w&&(u.x=w-m);break;case rt:o+u.x<g&&(u.x=g-o);break;case K:d+u.y<b&&(u.y=b-d);break;case pt:f+u.y>y&&(u.y=y-f)}};switch(s){case jt:o+=u.x,d+=u.y;break;case nt:if(u.x>=0&&(m>=w||c&&(d<=b||f>=y))){D=!1;break}x(nt),(p+=u.x)<0&&(s=rt,o-=p=-p),c&&(l=p/c,d+=(r.height-l)/2);break;case K:if(u.y<=0&&(d<=b||c&&(o<=g||m>=w))){D=!1;break}x(K),l-=u.y,d+=u.y,l<0&&(s=pt,d-=l=-l),c&&(p=l*c,o+=(r.width-p)/2);break;case rt:if(u.x<=0&&(o<=g||c&&(d<=b||f>=y))){D=!1;break}x(rt),p-=u.x,o+=u.x,p<0&&(s=nt,o-=p=-p),c&&(l=p/c,d+=(r.height-l)/2);break;case pt:if(u.y>=0&&(f>=y||c&&(o<=g||m>=w))){D=!1;break}x(pt),(l+=u.y)<0&&(s=K,d-=l=-l),c&&(p=l*c,o+=(r.width-p)/2);break;case wt:if(c){if(u.y<=0&&(d<=b||m>=w)){D=!1;break}x(K),l-=u.y,d+=u.y,p=l*c}else x(K),x(nt),u.x>=0?m<w?p+=u.x:u.y<=0&&d<=b&&(D=!1):p+=u.x,u.y<=0?d>b&&(l-=u.y,d+=u.y):(l-=u.y,d+=u.y);p<0&&l<0?(s=Ct,d-=l=-l,o-=p=-p):p<0?(s=yt,o-=p=-p):l<0&&(s=xt,d-=l=-l);break;case yt:if(c){if(u.y<=0&&(d<=b||o<=g)){D=!1;break}x(K),l-=u.y,d+=u.y,p=l*c,o+=r.width-p}else x(K),x(rt),u.x<=0?o>g?(p-=u.x,o+=u.x):u.y<=0&&d<=b&&(D=!1):(p-=u.x,o+=u.x),u.y<=0?d>b&&(l-=u.y,d+=u.y):(l-=u.y,d+=u.y);p<0&&l<0?(s=xt,d-=l=-l,o-=p=-p):p<0?(s=wt,o-=p=-p):l<0&&(s=Ct,d-=l=-l);break;case Ct:if(c){if(u.x<=0&&(o<=g||f>=y)){D=!1;break}x(rt),p-=u.x,o+=u.x,l=p/c}else x(pt),x(rt),u.x<=0?o>g?(p-=u.x,o+=u.x):u.y>=0&&f>=y&&(D=!1):(p-=u.x,o+=u.x),u.y>=0?f<y&&(l+=u.y):l+=u.y;p<0&&l<0?(s=wt,d-=l=-l,o-=p=-p):p<0?(s=xt,o-=p=-p):l<0&&(s=yt,d-=l=-l);break;case xt:if(c){if(u.x>=0&&(m>=w||f>=y)){D=!1;break}x(nt),l=(p+=u.x)/c}else x(pt),x(nt),u.x>=0?m<w?p+=u.x:u.y>=0&&f>=y&&(D=!1):p+=u.x,u.y>=0?f<y&&(l+=u.y):l+=u.y;p<0&&l<0?(s=yt,d-=l=-l,o-=p=-p):p<0?(s=Ct,o-=p=-p):l<0&&(s=wt,d-=l=-l);break;case Pe:this.move(u.x,u.y),D=!1;break;case Ue:this.zoom(function(k){var A=Ae({},k),N=0;return z(k,function(W,F){delete A[F],z(A,function(L){var T=Math.abs(W.startX-L.startX),vt=Math.abs(W.startY-L.startY),tt=Math.abs(W.endX-L.endX),st=Math.abs(W.endY-L.endY),V=Math.sqrt(T*T+vt*vt),ht=(Math.sqrt(tt*tt+st*st)-V)/V;Math.abs(ht)>Math.abs(N)&&(N=ht)})}),N}(h),t),D=!1;break;case je:if(!u.x||!u.y){D=!1;break}i=hi(this.cropper),o=C.startX-i.left,d=C.startY-i.top,p=r.minWidth,l=r.minHeight,u.x>0?s=u.y>0?xt:wt:u.x<0&&(o-=p,s=u.y>0?Ct:yt),u.y<0&&(d-=l),this.cropped||(q(this.cropBox,H),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}D&&(r.width=p,r.height=l,r.left=o,r.top=d,this.action=s,this.renderCropBox()),z(h,function(k){k.startX=k.endX,k.startY=k.endY})}},ma={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&S(this.dragBox,St),q(this.cropBox,H),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=E({},this.initialImageData),this.canvasData=E({},this.initialCanvasData),this.cropBoxData=E({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(E(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),q(this.dragBox,St),S(this.cropBox,H)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0&&arguments[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,z(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,q(this.cropper,$e)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,S(this.cropper,$e)),this},destroy:function(){var t=this.element;return t[O]?(t[O]=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,n=e.left,a=e.top;return this.moveTo(Kt(t)?t:n+Number(t),Kt(i)?i:a+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(M(t)&&(e.left=t,n=!0),M(i)&&(e.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(e.width*t/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var n=this.options,a=this.canvasData,r=a.width,h=a.height,s=a.naturalWidth,c=a.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&n.zoomable){var o=s*t,d=c*t;if(ft(this.element,Gt,{ratio:t,oldRatio:r/s,originalEvent:e})===!1)return this;if(e){var p=this.pointers,l=hi(this.cropper),m=p&&Object.keys(p).length?function(f){var g=0,b=0,w=0;return z(f,function(y){var D=y.startX,C=y.startY;g+=D,b+=C,w+=1}),{pageX:g/=w,pageY:b/=w}}(p):{pageX:e.pageX,pageY:e.pageY};a.left-=(o-r)*((m.pageX-l.left-a.left)/r),a.top-=(d-h)*((m.pageY-l.top-a.top)/h)}else ut(i)&&M(i.x)&&M(i.y)?(a.left-=(o-r)*((i.x-a.left)/r),a.top-=(d-h)*((i.y-a.top)/h)):(a.left-=(o-r)/2,a.top-=(d-h)/2);a.width=o,a.height=d,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return M(t=Number(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,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(M(t)&&(e.scaleX=t,n=!0),M(i)&&(e.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t,i=arguments.length>0&&arguments[0]!==void 0&&arguments[0],e=this.options,n=this.imageData,a=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){t={x:r.left-a.left,y:r.top-a.top,width:r.width,height:r.height};var h=n.width/n.naturalWidth;if(z(t,function(o,d){t[d]=o/h}),i){var s=Math.round(t.y+t.height),c=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=c-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return e.rotatable&&(t.rotate=n.rotate||0),e.scalable&&(t.scaleX=n.scaleX||1,t.scaleY=n.scaleY||1),t},setData:function(t){var i=this.options,e=this.imageData,n=this.canvasData,a={};if(this.ready&&!this.disabled&&ut(t)){var r=!1;i.rotatable&&M(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,r=!0),i.scalable&&(M(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,r=!0),M(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,r=!0)),r&&this.renderCanvas(!0,!0);var h=e.width/e.naturalWidth;M(t.x)&&(a.left=t.x*h+n.left),M(t.y)&&(a.top=t.y*h+n.top),M(t.width)&&(a.width=t.width*h),M(t.height)&&(a.height=t.height*h),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?E({},this.containerData):{}},getImageData:function(){return this.sized?E({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&z(["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&&ut(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,i=this.cropBoxData;return this.ready&&this.cropped&&(t={left:i.left,top:i.top,width:i.width,height:i.height}),t||{}},setCropBoxData:function(t){var i,e,n=this.cropBoxData,a=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&ut(t)&&(M(t.left)&&(n.left=t.left),M(t.top)&&(n.top=t.top),M(t.width)&&t.width!==n.width&&(i=!0,n.width=t.width),M(t.height)&&t.height!==n.height&&(e=!0,n.height=t.height),a&&(i?n.height=n.width/a:e&&(n.width=n.height*a)),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=function(st,V,ht,et){var ee=V.aspectRatio,ui=V.naturalWidth,mi=V.naturalHeight,ie=V.rotate,gi=ie===void 0?0:ie,ae=V.scaleX,fi=ae===void 0?1:ae,ne=V.scaleY,vi=ne===void 0?1:ne,re=ht.aspectRatio,bi=ht.naturalWidth,wi=ht.naturalHeight,oe=et.fillColor,yi=oe===void 0?"transparent":oe,se=et.imageSmoothingEnabled,xi=se===void 0||se,he=et.imageSmoothingQuality,Ci=he===void 0?"low":he,ce=et.maxWidth,le=ce===void 0?1/0:ce,de=et.maxHeight,pe=de===void 0?1/0:de,ue=et.minWidth,me=ue===void 0?0:ue,ge=et.minHeight,fe=ge===void 0?0:ge,Bt=document.createElement("canvas"),j=Bt.getContext("2d"),ve=J({aspectRatio:re,width:le,height:pe}),be=J({aspectRatio:re,width:me,height:fe},"cover"),Nt=Math.min(ve.width,Math.max(be.width,bi)),Rt=Math.min(ve.height,Math.max(be.height,wi)),we=J({aspectRatio:ee,width:le,height:pe}),ye=J({aspectRatio:ee,width:me,height:fe},"cover"),xe=Math.min(we.width,Math.max(ye.width,ui)),Ce=Math.min(we.height,Math.max(ye.height,mi)),Mi=[-xe/2,-Ce/2,xe,Ce];return Bt.width=mt(Nt),Bt.height=mt(Rt),j.fillStyle=yi,j.fillRect(0,0,Nt,Rt),j.save(),j.translate(Nt/2,Rt/2),j.rotate(gi*Math.PI/180),j.scale(fi,vi),j.imageSmoothingEnabled=xi,j.imageSmoothingQuality=Ci,j.drawImage.apply(j,[st].concat(Ie(Mi.map(function(Di){return Math.floor(mt(Di))})))),j.restore(),Bt}(this.image,this.imageData,i,t);if(!this.cropped)return e;var n=this.getData(t.rounded),a=n.x,r=n.y,h=n.width,s=n.height,c=e.width/Math.floor(i.naturalWidth);c!==1&&(a*=c,r*=c,h*=c,s*=c);var o=h/s,d=J({aspectRatio:o,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),p=J({aspectRatio:o,width:t.minWidth||0,height:t.minHeight||0},"cover"),l=J({aspectRatio:o,width:t.width||(c!==1?e.width:h),height:t.height||(c!==1?e.height:s)}),m=l.width,f=l.height;m=Math.min(d.width,Math.max(p.width,m)),f=Math.min(d.height,Math.max(p.height,f));var g=document.createElement("canvas"),b=g.getContext("2d");g.width=mt(m),g.height=mt(f),b.fillStyle=t.fillColor||"transparent",b.fillRect(0,0,m,f);var w=t.imageSmoothingEnabled,y=w===void 0||w,D=t.imageSmoothingQuality;b.imageSmoothingEnabled=y,D&&(b.imageSmoothingQuality=D);var C,u,x,k,A,N,W=e.width,F=e.height,L=a,T=r;L<=-h||L>W?(L=0,C=0,x=0,A=0):L<=0?(x=-L,L=0,A=C=Math.min(W,h+L)):L<=W&&(x=0,A=C=Math.min(h,W-L)),C<=0||T<=-s||T>F?(T=0,u=0,k=0,N=0):T<=0?(k=-T,T=0,N=u=Math.min(F,s+T)):T<=F&&(k=0,N=u=Math.min(s,F-T));var vt=[L,T,C,u];if(A>0&&N>0){var tt=m/h;vt.push(x*tt,k*tt,A*tt,N*tt)}return b.drawImage.apply(b,[e].concat(Ie(vt.map(function(st){return Math.floor(mt(st))})))),g},setAspectRatio:function(t){var i=this.options;return this.disabled||Kt(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,n=this.face;if(this.ready&&!this.disabled){var a=t===$t,r=i.movable&&t===Ve;t=a||r?t:Qe,i.dragMode=t,Dt(e,Mt,t),gt(e,Pt,a),gt(e,Ut,r),i.cropBoxMovable||(Dt(n,Mt,t),gt(n,Pt,a),gt(n,Ut,r))}return this}},ga=$.Cropper,pi=function(){function t(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(function(h,s){if(!(h instanceof s))throw new TypeError("Cannot call a class as a function")}(this,t),!a||!Ji.test(a.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=a,this.options=E({},ai,ut(r)&&r),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 i=t,n=[{key:"noConflict",value:function(){return window.Cropper=ga,t}},{key:"setDefaults",value:function(a){E(ai,ut(a)&&a)}}],(e=[{key:"init",value:function(){var a,r=this.element,h=r.tagName.toLowerCase();if(!r[O]){if(r[O]=this,h==="img"){if(this.isImg=!0,a=r.getAttribute("src")||"",this.originalUrl=a,!a)return;a=r.src}else h==="canvas"&&window.HTMLCanvasElement&&(a=r.toDataURL());this.load(a)}}},{key:"load",value:function(a){var r=this;if(a){this.url=a,this.imageData={};var h=this.element,s=this.options;if(s.rotatable||s.scalable||(s.checkOrientation=!1),s.checkOrientation&&window.ArrayBuffer)if(Ki.test(a))Zi.test(a)?this.read((c=a.replace(sa,""),o=atob(c),d=new ArrayBuffer(o.length),z(p=new Uint8Array(d),function(f,g){p[g]=o.charCodeAt(g)}),d)):this.clone();else{var c,o,d,p,l=new XMLHttpRequest,m=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=m,l.onerror=m,l.ontimeout=m,l.onprogress=function(){l.getResponseHeader("content-type")!==ii&&l.abort()},l.onload=function(){r.read(l.response)},l.onloadend=function(){r.reloading=!1,r.xhr=null},s.checkCrossOrigin&&ci(a)&&h.crossOrigin&&(a=li(a)),l.open("GET",a,!0),l.responseType="arraybuffer",l.withCredentials=h.crossOrigin==="use-credentials",l.send()}else this.clone()}}},{key:"read",value:function(a){var r=this.options,h=this.imageData,s=ha(a),c=0,o=1,d=1;if(s>1){this.url=function(l,m){for(var f=[],g=new Uint8Array(l);g.length>0;)f.push(di.apply(null,ri(g.subarray(0,8192)))),g=g.subarray(8192);return"data:".concat(m,";base64,").concat(btoa(f.join("")))}(a,ii);var p=function(l){var m=0,f=1,g=1;switch(l){case 2:f=-1;break;case 3:m=-180;break;case 4:g=-1;break;case 5:m=90,g=-1;break;case 6:m=90;break;case 7:m=90,f=-1;break;case 8:m=-90}return{rotate:m,scaleX:f,scaleY:g}}(s);c=p.rotate,o=p.scaleX,d=p.scaleY}r.rotatable&&(h.rotate=c),r.scalable&&(h.scaleX=o,h.scaleY=d),this.clone()}},{key:"clone",value:function(){var a=this.element,r=this.url,h=a.crossOrigin,s=r;this.options.checkCrossOrigin&&ci(r)&&(h||(h="anonymous"),s=li(r)),this.crossOrigin=h,this.crossOriginUrl=s;var c=document.createElement("img");h&&(c.crossOrigin=h),c.src=s||r,c.alt=a.alt||"The image to crop",this.image=c,c.onload=this.start.bind(this),c.onerror=this.stop.bind(this),S(c,qe),a.parentNode.insertBefore(c,a.nextSibling)}},{key:"start",value:function(){var a=this,r=this.image;r.onload=null,r.onerror=null,this.sizing=!0;var h=$.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test($.navigator.userAgent),s=function(d,p){E(a.imageData,{naturalWidth:d,naturalHeight:p,aspectRatio:d/p}),a.initialImageData=E({},a.imageData),a.sizing=!1,a.sized=!0,a.build()};if(!r.naturalWidth||h){var c=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=c,c.onload=function(){s(c.width,c.height),h||o.removeChild(c)},c.src=r.src,h||(c.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;",o.appendChild(c))}else s(r.naturalWidth,r.naturalHeight)}},{key:"stop",value:function(){var a=this.image;a.onload=null,a.onerror=null,a.parentNode.removeChild(a),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var a=this.element,r=this.options,h=this.image,s=a.parentNode,c=document.createElement("div");c.innerHTML='<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>';var o=c.querySelector(".".concat(O,"-container")),d=o.querySelector(".".concat(O,"-canvas")),p=o.querySelector(".".concat(O,"-drag-box")),l=o.querySelector(".".concat(O,"-crop-box")),m=l.querySelector(".".concat(O,"-face"));this.container=s,this.cropper=o,this.canvas=d,this.dragBox=p,this.cropBox=l,this.viewBox=o.querySelector(".".concat(O,"-view-box")),this.face=m,d.appendChild(h),S(a,H),s.insertBefore(o,a.nextSibling),q(h,qe),this.initPreview(),this.bind(),r.initialAspectRatio=Math.max(0,r.initialAspectRatio)||NaN,r.aspectRatio=Math.max(0,r.aspectRatio)||NaN,r.viewMode=Math.max(0,Math.min(3,Math.round(r.viewMode)))||0,S(l,H),r.guides||S(l.getElementsByClassName("".concat(O,"-dashed")),H),r.center||S(l.getElementsByClassName("".concat(O,"-center")),H),r.background&&S(o,"".concat(O,"-bg")),r.highlight||S(m,Fi),r.cropBoxMovable&&(S(m,Ut),Dt(m,Mt,jt)),r.cropBoxResizable||(S(l.getElementsByClassName("".concat(O,"-line")),H),S(l.getElementsByClassName("".concat(O,"-point")),H)),this.render(),this.ready=!0,this.setDragMode(r.dragMode),r.autoCrop&&this.crop(),this.setData(r.data),Y(r.ready)&&I(a,Je,r.ready,{once:!0}),ft(a,Je)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var a=this.cropper.parentNode;a&&a.removeChild(this.cropper),q(this.element,H)}}},{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()}}])&&_e(i.prototype,e),n&&_e(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,e,n}();E(pi.prototype,ca,la,da,pa,ua,ma);const fa=["alt","crossorigin","src"],va=ct({name:"Cropper",__name:"Cropper",props:{src:_.string.def(""),alt:_.string.def(""),circled:_.bool.def(!1),realTimePreview:_.bool.def(!0),height:_.string.def("360px"),crossorigin:{type:String,default:void 0},imageStyle:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["cropend","ready","cropendError"],setup(t,{emit:i}){const e={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},n=t,a=i,r=zi(),h=X(),s=X(),c=X(!1),{getPrefixCls:o}=Yt(),d=o("cropper-image"),p=Ri(g,80),l=it(()=>({height:n.height,maxWidth:"100%",...n.imageStyle})),m=it(()=>[d,r.class,{[`${d}--circled`]:n.circled}]),f=it(()=>({height:`${n.height}`.replace(/px/,"")+"px"}));function g(){n.realTimePreview&&function(){if(!s.value)return;let b=s.value.getData();(n.circled?function(){const w=s.value.getCroppedCanvas(),y=document.createElement("canvas"),D=y.getContext("2d"),C=w.width,u=w.height;return y.width=C,y.height=u,D.imageSmoothingEnabled=!0,D.drawImage(w,0,0,C,u),D.globalCompositeOperation="destination-in",D.beginPath(),D.arc(C/2,u/2,Math.min(C,u)/2,0,2*Math.PI,!0),D.fill(),y}():s.value.getCroppedCanvas()).toBlob(w=>{if(!w)return;let y=new FileReader;y.readAsDataURL(w),y.onloadend=D=>{var C;a("cropend",{imgBase64:((C=D.target)==null?void 0:C.result)??"",imgInfo:b})},y.onerror=()=>{a("cropendError")}},"image/png")}()}return Si(async function(){const b=v(h);b&&(s.value=new pi(b,{...e,ready:()=>{c.value=!0,g(),a("ready",s.value)},crop(){p()},zoom(){p()},cropmove(){p()},...n.options}))}),Wi(()=>{var b;(b=s.value)==null||b.destroy()}),(b,w)=>(U(),lt("div",{class:Q(v(m)),style:Te(v(f))},[Li(at("img",{ref_key:"imgElRef",ref:h,alt:t.alt,crossorigin:t.crossorigin,src:t.src,style:Te(v(l))},null,12,fa),[[Ni,v(c)]])],6))}}),ba=["alt","src"],wa=ct({name:"CopperModal",__name:"CopperModal",props:{srcValue:_.string.def(""),circled:_.bool.def(!0)},emits:["uploadSuccess"],setup(t,{expose:i,emit:e}){const n=t,a=e,{t:r}=ze.useI18n(),{getPrefixCls:h}=Yt(),s=h("cropper-am"),c=X(n.srcValue),o=X(""),d=X(),p=X(!1);let l="",m=1,f=1;function g(C){const u=new FileReader;return u.readAsDataURL(C),c.value="",o.value="",u.onload=function(x){var k;c.value=((k=x.target)==null?void 0:k.result)??"",l=C.name},!1}function b({imgBase64:C}){o.value=C}function w(C){d.value=C}function y(C,u){var x,k;C==="scaleX"&&(m=u=m===-1?1:-1),C==="scaleY"&&(f=u=f===-1?1:-1),(k=(x=d==null?void 0:d.value)==null?void 0:x[C])==null||k.call(x,u)}async function D(){const C=(u=>{const x=u.split(","),k=x[0].match(/:(.*?);/)[1],A=window.atob(x[1]);let N=A.length;const W=new Uint8Array(N);for(;N--;)W[N]=A.charCodeAt(N);return new Blob([W],{type:k})})(o.value);a("uploadSuccess",{source:o.value,data:C,filename:l})}return i({openModal:function(){p.value=!0},closeModal:function(){p.value=!1}}),(C,u)=>{const x=$i,k=Yi,A=Ai,N=Vi,W=Ne,F=We,L=Ui;return U(),lt("div",null,[B(L,{modelValue:v(p),"onUpdate:modelValue":u[7]||(u[7]=T=>Hi(p)?p.value=T:null),canFullscreen:!1,title:v(r)("cropper.modalTitle"),maxHeight:"380px",width:"800px"},{footer:R(()=>[B(F,{type:"primary",onClick:D},{default:R(()=>[Ht(Se(v(r)("cropper.okText")),1)]),_:1})]),default:R(()=>[at("div",{class:Q(v(s))},[at("div",{class:Q(`${v(s)}-left`)},[at("div",{class:Q(`${v(s)}-cropper`)},[v(c)?(U(),Tt(v(va),{key:0,circled:t.circled,src:v(c),height:"300px",onCropend:b,onReady:w},null,8,["circled","src"])):dt("",!0)],2),at("div",{class:Q(`${v(s)}-toolbar`)},[B(A,{beforeUpload:g,fileList:[],accept:"image/*"},{default:R(()=>[B(k,{content:v(r)("cropper.selectImage"),placement:"bottom"},{default:R(()=>[B(x,{preIcon:"ant-design:upload-outlined",type:"primary"})]),_:1},8,["content"])]),_:1}),B(N,null,{default:R(()=>[B(k,{content:v(r)("cropper.btn_reset"),placement:"bottom"},{default:R(()=>[B(x,{disabled:!v(c),preIcon:"ant-design:reload-outlined",size:"small",type:"primary",onClick:u[0]||(u[0]=T=>y("reset"))},null,8,["disabled"])]),_:1},8,["content"]),B(k,{content:v(r)("cropper.btn_rotate_left"),placement:"bottom"},{default:R(()=>[B(x,{disabled:!v(c),preIcon:"ant-design:rotate-left-outlined",size:"small",type:"primary",onClick:u[1]||(u[1]=T=>y("rotate",-45))},null,8,["disabled"])]),_:1},8,["content"]),B(k,{content:v(r)("cropper.btn_rotate_right"),placement:"bottom"},{default:R(()=>[B(x,{disabled:!v(c),preIcon:"ant-design:rotate-right-outlined",size:"small",type:"primary",onClick:u[2]||(u[2]=T=>y("rotate",45))},null,8,["disabled"])]),_:1},8,["content"]),B(k,{content:v(r)("cropper.btn_scale_x"),placement:"bottom"},{default:R(()=>[B(x,{disabled:!v(c),preIcon:"vaadin:arrows-long-h",size:"small",type:"primary",onClick:u[3]||(u[3]=T=>y("scaleX"))},null,8,["disabled"])]),_:1},8,["content"]),B(k,{content:v(r)("cropper.btn_scale_y"),placement:"bottom"},{default:R(()=>[B(x,{disabled:!v(c),preIcon:"vaadin:arrows-long-v",size:"small",type:"primary",onClick:u[4]||(u[4]=T=>y("scaleY"))},null,8,["disabled"])]),_:1},8,["content"]),B(k,{content:v(r)("cropper.btn_zoom_in"),placement:"bottom"},{default:R(()=>[B(x,{disabled:!v(c),preIcon:"ant-design:zoom-in-outlined",size:"small",type:"primary",onClick:u[5]||(u[5]=T=>y("zoom",.1))},null,8,["disabled"])]),_:1},8,["content"]),B(k,{content:v(r)("cropper.btn_zoom_out"),placement:"bottom"},{default:R(()=>[B(x,{disabled:!v(c),preIcon:"ant-design:zoom-out-outlined",size:"small",type:"primary",onClick:u[6]||(u[6]=T=>y("zoom",-.1))},null,8,["disabled"])]),_:1},8,["content"])]),_:1})],2)],2),at("div",{class:Q(`${v(s)}-right`)},[at("div",{class:Q(`${v(s)}-preview`)},[v(o)?(U(),lt("img",{key:0,alt:v(r)("cropper.preview"),src:v(o)},null,8,ba)):dt("",!0)],2),v(o)?(U(),lt("div",{key:0,class:Q(`${v(s)}-group`)},[B(W,{src:v(o),size:"large"},null,8,["src"]),B(W,{size:48,src:v(o)},null,8,["src"]),B(W,{size:64,src:v(o)},null,8,["src"]),B(W,{size:80,src:v(o)},null,8,["src"])],2)):dt("",!0)],2)],2)]),_:1},8,["modelValue","title"])])}}}),ya=Le(ct({name:"CropperAvatar",__name:"CropperAvatar",props:{width:_.string.def("200px"),value:_.string.def(""),showBtn:_.bool.def(!0),btnText:_.string.def("")},emits:["update:value","change"],setup(t,{expose:i,emit:e}){const n=t,a=e,r=X(n.value),{getPrefixCls:h}=Yt(),s=h("cropper-avatar"),c=_i(),{t:o}=ze.useI18n(),d=X();function p({source:m,data:f,filename:g}){r.value=m,a("change",{source:m,data:f,filename:g}),c.success(o("cropper.uploadSuccess"))}function l(){d.value.openModal()}return Be(()=>{r.value=n.value}),Xi(()=>r.value,m=>{a("update:value",m)}),i({open:l,close:function(){d.value.closeModal()}}),(m,f)=>{const g=Ne,b=We;return U(),lt("div",{class:"user-info-head",onClick:f[1]||(f[1]=w=>l())},[v(r)?(U(),Tt(g,{key:0,src:v(r),alt:"avatar",class:"img-circle img-lg"},null,8,["src"])):dt("",!0),v(r)?dt("",!0):(U(),Tt(g,{key:1,src:v(Pi),alt:"avatar",class:"img-circle img-lg"},null,8,["src"])),t.showBtn?(U(),Tt(b,{key:2,class:Q(`${v(s)}-upload-btn`),onClick:f[0]||(f[0]=w=>l())},{default:R(()=>[Ht(Se(t.btnText?t.btnText:v(o)("cropper.selectImage")),1)]),_:1},8,["class"])):dt("",!0),B(wa,{ref_key:"cropperModelRef",ref:d,srcValue:v(r),onUploadSuccess:p},null,8,["srcValue"])])}}}),[["__scopeId","data-v-e5ea03b5"]]),xa={class:"change-avatar"},Ca=Le(ct({name:"UserAvatar",__name:"UserAvatar",props:{img:_.string.def("")},setup(t){const i=Ii(),e=X(),n=async({data:a})=>{const r=await ji({avatarFile:a});e.value.close(),i.setUserAvatarAction(r.data)};return(a,r)=>(U(),lt("div",xa,[B(v(ya),{ref_key:"cropperRef",ref:e,btnProps:{preIcon:"ant-design:cloud-upload-outlined"},showBtn:!1,value:t.img,width:"120px",onChange:n},null,8,["value"])]))}}),[["__scopeId","data-v-47d4903b"]]);export{Ca as default};