12345678910 |
- System.register(["./index-legacy-37ac3c5c.js"],(function(t,e){"use strict";var i,n,o,r,a,s,c,h,l,p,d,u,f,m,g,w=document.createElement("style");return w.textContent='/*!\n * Cropper.js v1.5.13\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2022-11-20T05:30:43.444Z\n */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:calc(100% / 3);left:0;top:calc(100% / 3);width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:calc(100% / 3);top:0;width:calc(100% / 3)}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:before,.cropper-center:after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-.15625vw;top:0;width:.36458vw}.cropper-center:after{height:.36458vw;left:0;top:-.15625vw;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-.15625vw;top:0;width:.26042vw}.cropper-line.line-n{cursor:ns-resize;height:.26042vw;left:0;top:-.15625vw}.cropper-line.line-w{cursor:ew-resize;left:-.15625vw;top:0;width:.26042vw}.cropper-line.line-s{bottom:-.15625vw;cursor:ns-resize;height:.26042vw;left:0}.cropper-point{background-color:#39f;height:.26042vw;opacity:.75;width:.26042vw}.cropper-point.point-e{cursor:ew-resize;margin-top:-.15625vw;right:-.15625vw;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-.15625vw;top:-.15625vw}.cropper-point.point-w{cursor:ew-resize;left:-.15625vw;margin-top:-.15625vw;top:50%}.cropper-point.point-s{bottom:-.15625vw;cursor:s-resize;left:50%;margin-left:-.15625vw}.cropper-point.point-ne{cursor:nesw-resize;right:-.15625vw;top:-.15625vw}.cropper-point.point-nw{cursor:nwse-resize;left:-.15625vw;top:-.15625vw}.cropper-point.point-sw{bottom:-.15625vw;cursor:nesw-resize;left:-.15625vw}.cropper-point.point-se{bottom:-.15625vw;cursor:nwse-resize;height:1.04167vw;opacity:1;right:-.15625vw;width:1.04167vw}@media (min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width: 1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}\n',document.head.appendChild(w),{setters:[t=>{i=t.cn,n=t.d,o=t.e,r=t.r,a=t.f,s=t.cl,c=t.cm,h=t.U,l=t.j,p=t.k,d=t.aX,u=t.b,f=t.w,m=t.de,g=t.y}],execute:function(){const e=t("p",(t=>i.post("/edu-app/open/getUploadSign",{data:t})));
- /*!
- * Cropper.js v1.5.13
- * https://fengyuanchen.github.io/cropperjs
- *
- * Copyright 2015-present Chen Fengyuan
- * Released under the MIT license
- *
- * Date: 2022-11-20T05:30:46.114Z
- */function w(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function y(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?w(Object(i),!0).forEach((function(e){x(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):w(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function b(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function x(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function C(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return E(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?E(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var O="undefined"!=typeof window&&void 0!==window.document,A=O?window:{},S=!(!O||!A.document.documentElement)&&"ontouchstart"in A.document.documentElement,D=!!O&&"PointerEvent"in A,T="cropper",R="all",M="crop",k="move",B="zoom",N="e",L="w",j="s",P="n",z="ne",U="nw",H="se",F="sw",W="".concat(T,"-crop"),I="".concat(T,"-disabled"),_="".concat(T,"-hidden"),X="".concat(T,"-hide"),Y="".concat(T,"-invisible"),q="".concat(T,"-modal"),K="".concat(T,"-move"),J="".concat(T,"Action"),V="".concat(T,"Preview"),$="crop",G="move",Q="none",Z="crop",tt="cropend",et="cropmove",it="cropstart",nt="dblclick",ot=D?"pointerdown":S?"touchstart":"mousedown",rt=D?"pointermove":S?"touchmove":"mousemove",at=D?"pointerup pointercancel":S?"touchend touchcancel":"mouseup",st="ready",ct="resize",ht="wheel",lt="zoom",pt="image/jpeg",dt=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ut=/^data:/,ft=/^data:image\/jpeg;base64,/,mt=/^img|canvas$/i,gt={viewMode:0,dragMode:$,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},wt=Number.isNaN||A.isNaN;function yt(t){return"number"==typeof t&&!wt(t)}var vt=function(t){return t>0&&t<1/0};function bt(t){return void 0===t}function xt(t){return"object"===v(t)&&null!==t}var Ct=Object.prototype.hasOwnProperty;function Et(t){if(!xt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&Ct.call(i,"isPrototypeOf")}catch(n){return!1}}function Ot(t){return"function"==typeof t}var At=Array.prototype.slice;function St(t){return Array.from?Array.from(t):At.call(t)}function Dt(t,e){return t&&Ot(e)&&(Array.isArray(t)||yt(t.length)?St(t).forEach((function(i,n){e.call(t,i,n,t)})):xt(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}))),t}var Tt=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return xt(t)&&i.length>0&&i.forEach((function(e){xt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},Rt=/\.\d*(?:0|9){12}\d*$/;function Mt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Rt.test(t)?Math.round(t*e)/e:t}var kt=/^width|height|left|top|marginLeft|marginTop$/;function Bt(t,e){var i=t.style;Dt(e,(function(t,e){kt.test(e)&&yt(t)&&(t="".concat(t,"px")),i[e]=t}))}function Nt(t,e){if(e)if(yt(t.length))Dt(t,(function(t){Nt(t,e)}));else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function Lt(t,e){e&&(yt(t.length)?Dt(t,(function(t){Lt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function jt(t,e,i){e&&(yt(t.length)?Dt(t,(function(t){jt(t,e,i)})):i?Nt(t,e):Lt(t,e))}var Pt=/([a-z\d])([A-Z])/g;function zt(t){return t.replace(Pt,"$1-$2").toLowerCase()}function Ut(t,e){return xt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(zt(e)))}function Ht(t,e,i){xt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(zt(e)),i)}var Ft=/\s\s*/,Wt=function(){var t=!1;if(O){var e=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});A.addEventListener("test",i,n),A.removeEventListener("test",i,n)}return t}();function It(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(Ft).forEach((function(e){if(!Wt){var r=t.listeners;r&&r[e]&&r[e][i]&&(o=r[e][i],delete r[e][i],0===Object.keys(r[e]).length&&delete r[e],0===Object.keys(r).length&&delete t.listeners)}t.removeEventListener(e,o,n)}))}function _t(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(Ft).forEach((function(e){if(n.once&&!Wt){var r=t.listeners,a=void 0===r?{}:r;o=function(){delete a[e][i],t.removeEventListener(e,o,n);for(var r=arguments.length,s=new Array(r),c=0;c<r;c++)s[c]=arguments[c];i.apply(t,s)},a[e]||(a[e]={}),a[e][i]&&t.removeEventListener(e,a[e][i],n),a[e][i]=o,t.listeners=a}t.addEventListener(e,o,n)}))}function Xt(t,e,i){var n;return Ot(Event)&&Ot(CustomEvent)?n=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(n)}function Yt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var qt=A.location,Kt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Jt(t){var e=t.match(Kt);return null!==e&&(e[1]!==qt.protocol||e[2]!==qt.hostname||e[3]!==qt.port)}function Vt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function $t(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,r=t.translateY,a=[];yt(o)&&0!==o&&a.push("translateX(".concat(o,"px)")),yt(r)&&0!==r&&a.push("translateY(".concat(r,"px)")),yt(e)&&0!==e&&a.push("rotate(".concat(e,"deg)")),yt(i)&&1!==i&&a.push("scaleX(".concat(i,")")),yt(n)&&1!==n&&a.push("scaleY(".concat(n,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Gt(t,e){var i=t.pageX,n=t.pageY,o={endX:i,endY:n};return e?o:y({startX:i,startY:n},o)}function Qt(t){var e=t.aspectRatio,i=t.height,n=t.width,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",r=vt(n),a=vt(i);if(r&&a){var s=i*e;"contain"===o&&s>n||"cover"===o&&s<n?i=n/e:n=i*e}else r?i=n/e:a&&(n=i*e);return{width:n,height:i}}var Zt=String.fromCharCode,te=/^data:.*,/;function ee(t){var e,i=new DataView(t);try{var n,o,r;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var a=i.byteLength,s=2;s+1<a;){if(255===i.getUint8(s)&&225===i.getUint8(s+1)){o=s;break}s+=1}if(o){var c=o+10;if("Exif"===function(t,e,i){var n="";i+=e;for(var o=e;o<i;o+=1)n+=Zt(t.getUint8(o));return n}(i,o+4,4)){var h=i.getUint16(c);if(((n=18761===h)||19789===h)&&42===i.getUint16(c+2,n)){var l=i.getUint32(c+4,n);l>=8&&(r=c+l)}}}if(r){var p,d,u=i.getUint16(r,n);for(d=0;d<u;d+=1)if(p=r+12*d+2,274===i.getUint16(p,n)){p+=8,e=i.getUint16(p,n),i.setUint16(p,1,n);break}}}catch(f){e=1}return e}var ie={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,n=this.cropper,o=Number(e.minContainerWidth),r=Number(e.minContainerHeight);Nt(n,_),Lt(t,_);var a={width:Math.max(i.offsetWidth,o>=0?o:200),height:Math.max(i.offsetHeight,r>=0?r:100)};this.containerData=a,Bt(n,{width:a.width,height:a.height}),Nt(t,_),Lt(n,_)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,n=Math.abs(e.rotate)%180==90,o=n?e.naturalHeight:e.naturalWidth,r=n?e.naturalWidth:e.naturalHeight,a=o/r,s=t.width,c=t.height;t.height*a>t.width?3===i?s=t.height*a:c=t.width/a:3===i?c=t.width/a:s=t.height*a;var h={aspectRatio:a,naturalWidth:o,naturalHeight:r,width:s,height:c};this.canvasData=h,this.limited=1===i||2===i,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=Tt({},h)},limitCanvas:function(t,e){var i=this.options,n=this.containerData,o=this.canvasData,r=this.cropBoxData,a=i.viewMode,s=o.aspectRatio,c=this.cropped&&r;if(t){var h=Number(i.minCanvasWidth)||0,l=Number(i.minCanvasHeight)||0;a>1?(h=Math.max(h,n.width),l=Math.max(l,n.height),3===a&&(l*s>h?h=l*s:l=h/s)):a>0&&(h?h=Math.max(h,c?r.width:0):l?l=Math.max(l,c?r.height:0):c&&(h=r.width,(l=r.height)*s>h?h=l*s:l=h/s));var p=Qt({aspectRatio:s,width:h,height:l});h=p.width,l=p.height,o.minWidth=h,o.minHeight=l,o.maxWidth=1/0,o.maxHeight=1/0}if(e)if(a>(c?0:1)){var d=n.width-o.width,u=n.height-o.height;o.minLeft=Math.min(0,d),o.minTop=Math.min(0,u),o.maxLeft=Math.max(0,d),o.maxTop=Math.max(0,u),c&&this.limited&&(o.minLeft=Math.min(r.left,r.left+(r.width-o.width)),o.minTop=Math.min(r.top,r.top+(r.height-o.height)),o.maxLeft=r.left,o.maxTop=r.top,2===a&&(o.width>=n.width&&(o.minLeft=Math.min(0,d),o.maxLeft=Math.max(0,d)),o.height>=n.height&&(o.minTop=Math.min(0,u),o.maxTop=Math.max(0,u))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=n.width,o.maxTop=n.height},renderCanvas:function(t,e){var i=this.canvasData,n=this.imageData;if(e){var o=function(t){var e=t.width,i=t.height,n=t.degree;if(90==(n=Math.abs(n)%180))return{width:i,height:e};var o=n%90*Math.PI/180,r=Math.sin(o),a=Math.cos(o),s=e*a+i*r,c=e*r+i*a;return n>90?{width:c,height:s}:{width:s,height:c}}({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),r=o.width,a=o.height,s=i.width*(r/i.naturalWidth),c=i.height*(a/i.naturalHeight);i.left-=(s-i.width)/2,i.top-=(c-i.height)/2,i.width=s,i.height=c,i.aspectRatio=r/a,i.naturalWidth=r,i.naturalHeight=a,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,Bt(this.canvas,Tt({width:i.width,height:i.height},$t({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,n=i.naturalWidth*(e.width/e.naturalWidth),o=i.naturalHeight*(e.height/e.naturalHeight);Tt(i,{width:n,height:o,left:(e.width-n)/2,top:(e.height-o)/2}),Bt(this.image,Tt({width:i.width,height:i.height},$t(Tt({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,n=Number(t.autoCropArea)||.8,o={width:e.width,height:e.height};i&&(e.height*i>e.width?o.height=o.width/i:o.width=o.height*i),this.cropBoxData=o,this.limitCropBox(!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.width=Math.max(o.minWidth,o.width*n),o.height=Math.max(o.minHeight,o.height*n),o.left=e.left+(e.width-o.width)/2,o.top=e.top+(e.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=Tt({},o)},limitCropBox:function(t,e){var i=this.options,n=this.containerData,o=this.canvasData,r=this.cropBoxData,a=this.limited,s=i.aspectRatio;if(t){var c=Number(i.minCropBoxWidth)||0,h=Number(i.minCropBoxHeight)||0,l=a?Math.min(n.width,o.width,o.width+o.left,n.width-o.left):n.width,p=a?Math.min(n.height,o.height,o.height+o.top,n.height-o.top):n.height;c=Math.min(c,n.width),h=Math.min(h,n.height),s&&(c&&h?h*s>c?h=c/s:c=h*s:c?h=c/s:h&&(c=h*s),p*s>l?p=l/s:l=p*s),r.minWidth=Math.min(c,l),r.minHeight=Math.min(h,p),r.maxWidth=l,r.maxHeight=p}e&&(a?(r.minLeft=Math.max(0,o.left),r.minTop=Math.max(0,o.top),r.maxLeft=Math.min(n.width,o.left+o.width)-r.width,r.maxTop=Math.min(n.height,o.top+o.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,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Ht(this.face,J,i.width>=e.width&&i.height>=e.height?k:R),Bt(this.cropBox,Tt({width:i.width,height:i.height},$t({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Xt(this.element,Z,this.getData())}},ne={initPreview:function(){var t=this.element,e=this.crossOrigin,i=this.options.preview,n=e?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",r=document.createElement("img");if(e&&(r.crossOrigin=e),r.src=n,r.alt=o,this.viewBox.appendChild(r),this.viewBoxImage=r,i){var a=i;"string"==typeof i?a=t.ownerDocument.querySelectorAll(i):i.querySelector&&(a=[i]),this.previews=a,Dt(a,(function(t){var i=document.createElement("img");Ht(t,V,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(i.crossOrigin=e),i.src=n,i.alt=o,i.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;"',t.innerHTML="",t.appendChild(i)}))}},resetPreview:function(){Dt(this.previews,(function(t){var e=Ut(t,V);Bt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(xt(t[e]))try{delete t[e]}catch(i){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(i){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(zt(e)))}(t,V)}))},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,n=i.width,o=i.height,r=t.width,a=t.height,s=i.left-e.left-t.left,c=i.top-e.top-t.top;this.cropped&&!this.disabled&&(Bt(this.viewBoxImage,Tt({width:r,height:a},$t(Tt({translateX:-s,translateY:-c},t)))),Dt(this.previews,(function(e){var i=Ut(e,V),h=i.width,l=i.height,p=h,d=l,u=1;n&&(d=o*(u=h/n)),o&&d>l&&(p=n*(u=l/o),d=l),Bt(e,{width:p,height:d}),Bt(e.getElementsByTagName("img")[0],Tt({width:r*u,height:a*u},$t(Tt({translateX:-s*u,translateY:-c*u},t))))})))}},oe={bind:function(){var t=this.element,e=this.options,i=this.cropper;Ot(e.cropstart)&&_t(t,it,e.cropstart),Ot(e.cropmove)&&_t(t,et,e.cropmove),Ot(e.cropend)&&_t(t,tt,e.cropend),Ot(e.crop)&&_t(t,Z,e.crop),Ot(e.zoom)&&_t(t,lt,e.zoom),_t(i,ot,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&_t(i,ht,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&_t(i,nt,this.onDblclick=this.dblclick.bind(this)),_t(t.ownerDocument,rt,this.onCropMove=this.cropMove.bind(this)),_t(t.ownerDocument,at,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&_t(window,ct,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;Ot(e.cropstart)&&It(t,it,e.cropstart),Ot(e.cropmove)&&It(t,et,e.cropmove),Ot(e.cropend)&&It(t,tt,e.cropend),Ot(e.crop)&&It(t,Z,e.crop),Ot(e.zoom)&&It(t,lt,e.zoom),It(i,ot,this.onCropStart),e.zoomable&&e.zoomOnWheel&&It(i,ht,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&It(i,nt,this.onDblclick),It(t.ownerDocument,rt,this.onCropMove),It(t.ownerDocument,at,this.onCropEnd),e.responsive&&It(window,ct,this.onResize)}},re={resize:function(){if(!this.disabled){var t,e,i=this.options,n=this.container,o=this.containerData,r=n.offsetWidth/o.width,a=n.offsetHeight/o.height,s=Math.abs(r-1)>Math.abs(a-1)?r:a;1!==s&&(i.restore&&(t=this.getCanvasData(),e=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(Dt(t,(function(e,i){t[i]=e*s}))),this.setCropBoxData(Dt(e,(function(t,i){e[i]=t*s})))))}},dblclick:function(){var t,e;this.disabled||this.options.dragMode===Q||this.setDragMode((t=this.dragBox,e=W,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?G:$))},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.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*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(yt(e)&&1!==e||yt(i)&&0!==i||t.ctrlKey))){var n,o=this.options,r=this.pointers;t.changedTouches?Dt(t.changedTouches,(function(t){r[t.identifier]=Gt(t)})):r[t.pointerId||0]=Gt(t),n=Object.keys(r).length>1&&o.zoomable&&o.zoomOnTouch?B:Ut(t.target,J),dt.test(n)&&!1!==Xt(this.element,it,{originalEvent:t,action:n})&&(t.preventDefault(),this.action=n,this.cropping=!1,n===M&&(this.cropping=!0,Nt(this.dragBox,q)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==Xt(this.element,et,{originalEvent:t,action:e})&&(t.changedTouches?Dt(t.changedTouches,(function(t){Tt(i[t.identifier]||{},Gt(t,!0))})):Tt(i[t.pointerId||0]||{},Gt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?Dt(t.changedTouches,(function(t){delete i[t.identifier]})):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,jt(this.dragBox,q,this.cropped&&this.options.modal)),Xt(this.element,tt,{originalEvent:t,action:e}))}}},ae={change:function(t){var e,i=this.options,n=this.canvasData,o=this.containerData,r=this.cropBoxData,a=this.pointers,s=this.action,c=i.aspectRatio,h=r.left,l=r.top,p=r.width,d=r.height,u=h+p,f=l+d,m=0,g=0,w=o.width,v=o.height,b=!0;!c&&t.shiftKey&&(c=p&&d?p/d:1),this.limited&&(m=r.minLeft,g=r.minTop,w=m+Math.min(o.width,n.width,n.left+n.width),v=g+Math.min(o.height,n.height,n.top+n.height));var x=a[Object.keys(a)[0]],C={x:x.endX-x.startX,y:x.endY-x.startY},E=function(t){switch(t){case N:u+C.x>w&&(C.x=w-u);break;case L:h+C.x<m&&(C.x=m-h);break;case P:l+C.y<g&&(C.y=g-l);break;case j:f+C.y>v&&(C.y=v-f)}};switch(s){case R:h+=C.x,l+=C.y;break;case N:if(C.x>=0&&(u>=w||c&&(l<=g||f>=v))){b=!1;break}E(N),(p+=C.x)<0&&(s=L,h-=p=-p),c&&(d=p/c,l+=(r.height-d)/2);break;case P:if(C.y<=0&&(l<=g||c&&(h<=m||u>=w))){b=!1;break}E(P),d-=C.y,l+=C.y,d<0&&(s=j,l-=d=-d),c&&(p=d*c,h+=(r.width-p)/2);break;case L:if(C.x<=0&&(h<=m||c&&(l<=g||f>=v))){b=!1;break}E(L),p-=C.x,h+=C.x,p<0&&(s=N,h-=p=-p),c&&(d=p/c,l+=(r.height-d)/2);break;case j:if(C.y>=0&&(f>=v||c&&(h<=m||u>=w))){b=!1;break}E(j),(d+=C.y)<0&&(s=P,l-=d=-d),c&&(p=d*c,h+=(r.width-p)/2);break;case z:if(c){if(C.y<=0&&(l<=g||u>=w)){b=!1;break}E(P),d-=C.y,l+=C.y,p=d*c}else E(P),E(N),C.x>=0?u<w?p+=C.x:C.y<=0&&l<=g&&(b=!1):p+=C.x,C.y<=0?l>g&&(d-=C.y,l+=C.y):(d-=C.y,l+=C.y);p<0&&d<0?(s=F,l-=d=-d,h-=p=-p):p<0?(s=U,h-=p=-p):d<0&&(s=H,l-=d=-d);break;case U:if(c){if(C.y<=0&&(l<=g||h<=m)){b=!1;break}E(P),d-=C.y,l+=C.y,p=d*c,h+=r.width-p}else E(P),E(L),C.x<=0?h>m?(p-=C.x,h+=C.x):C.y<=0&&l<=g&&(b=!1):(p-=C.x,h+=C.x),C.y<=0?l>g&&(d-=C.y,l+=C.y):(d-=C.y,l+=C.y);p<0&&d<0?(s=H,l-=d=-d,h-=p=-p):p<0?(s=z,h-=p=-p):d<0&&(s=F,l-=d=-d);break;case F:if(c){if(C.x<=0&&(h<=m||f>=v)){b=!1;break}E(L),p-=C.x,h+=C.x,d=p/c}else E(j),E(L),C.x<=0?h>m?(p-=C.x,h+=C.x):C.y>=0&&f>=v&&(b=!1):(p-=C.x,h+=C.x),C.y>=0?f<v&&(d+=C.y):d+=C.y;p<0&&d<0?(s=z,l-=d=-d,h-=p=-p):p<0?(s=H,h-=p=-p):d<0&&(s=U,l-=d=-d);break;case H:if(c){if(C.x>=0&&(u>=w||f>=v)){b=!1;break}E(N),d=(p+=C.x)/c}else E(j),E(N),C.x>=0?u<w?p+=C.x:C.y>=0&&f>=v&&(b=!1):p+=C.x,C.y>=0?f<v&&(d+=C.y):d+=C.y;p<0&&d<0?(s=U,l-=d=-d,h-=p=-p):p<0?(s=F,h-=p=-p):d<0&&(s=z,l-=d=-d);break;case k:this.move(C.x,C.y),b=!1;break;case B:this.zoom(function(t){var e=y({},t),i=0;return Dt(t,(function(t,n){delete e[n],Dt(e,(function(e){var n=Math.abs(t.startX-e.startX),o=Math.abs(t.startY-e.startY),r=Math.abs(t.endX-e.endX),a=Math.abs(t.endY-e.endY),s=Math.sqrt(n*n+o*o),c=(Math.sqrt(r*r+a*a)-s)/s;Math.abs(c)>Math.abs(i)&&(i=c)}))})),i}(a),t),b=!1;break;case M:if(!C.x||!C.y){b=!1;break}e=Yt(this.cropper),h=x.startX-e.left,l=x.startY-e.top,p=r.minWidth,d=r.minHeight,C.x>0?s=C.y>0?H:z:C.x<0&&(h-=p,s=C.y>0?F:U),C.y<0&&(l-=d),this.cropped||(Lt(this.cropBox,_),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}b&&(r.width=p,r.height=d,r.left=h,r.top=l,this.action=s,this.renderCropBox()),Dt(a,(function(t){t.startX=t.endX,t.startY=t.endY}))}},se={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Nt(this.dragBox,q),Lt(this.cropBox,_),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Tt({},this.initialImageData),this.canvasData=Tt({},this.initialCanvasData),this.cropBoxData=Tt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Tt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Lt(this.dragBox,q),Nt(this.cropBox,_)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,Dt(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,Lt(this.cropper,I)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Nt(this.cropper,I)),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 e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,n=i.left,o=i.top;return this.moveTo(bt(t)?t:n+Number(t),bt(e)?e:o+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(yt(t)&&(i.left=t,n=!0),yt(e)&&(i.top=e,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(i.width*t/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var n=this.options,o=this.canvasData,r=o.width,a=o.height,s=o.naturalWidth,c=o.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&n.zoomable){var h=s*t,l=c*t;if(!1===Xt(this.element,lt,{ratio:t,oldRatio:r/s,originalEvent:i}))return this;if(i){var p=this.pointers,d=Yt(this.cropper),u=p&&Object.keys(p).length?function(t){var e=0,i=0,n=0;return Dt(t,(function(t){var o=t.startX,r=t.startY;e+=o,i+=r,n+=1})),{pageX:e/=n,pageY:i/=n}}(p):{pageX:i.pageX,pageY:i.pageY};o.left-=(h-r)*((u.pageX-d.left-o.left)/r),o.top-=(l-a)*((u.pageY-d.top-o.top)/a)}else Et(e)&&yt(e.x)&&yt(e.y)?(o.left-=(h-r)*((e.x-o.left)/r),o.top-=(l-a)*((e.y-o.top)/a)):(o.left-=(h-r)/2,o.top-=(l-a)/2);o.width=h,o.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return yt(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,yt(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(yt(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(yt(t)&&(i.scaleX=t,n=!0),yt(e)&&(i.scaleY=e,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,n=this.imageData,o=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){t={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};var a=n.width/n.naturalWidth;if(Dt(t,(function(e,i){t[i]=e/a})),e){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 i.rotatable&&(t.rotate=n.rotate||0),i.scalable&&(t.scaleX=n.scaleX||1,t.scaleY=n.scaleY||1),t},setData:function(t){var e=this.options,i=this.imageData,n=this.canvasData,o={};if(this.ready&&!this.disabled&&Et(t)){var r=!1;e.rotatable&&yt(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,r=!0),e.scalable&&(yt(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,r=!0),yt(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,r=!0)),r&&this.renderCanvas(!0,!0);var a=i.width/i.naturalWidth;yt(t.x)&&(o.left=t.x*a+n.left),yt(t.y)&&(o.top=t.y*a+n.top),yt(t.width)&&(o.width=t.width*a),yt(t.height)&&(o.height=t.height*a),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?Tt({},this.containerData):{}},getImageData:function(){return this.sized?Tt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&Dt(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){e[i]=t[i]})),e},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&Et(t)&&(yt(t.left)&&(e.left=t.left),yt(t.top)&&(e.top=t.top),yt(t.width)?(e.width=t.width,e.height=t.width/i):yt(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,i,n=this.cropBoxData,o=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&Et(t)&&(yt(t.left)&&(n.left=t.left),yt(t.top)&&(n.top=t.top),yt(t.width)&&t.width!==n.width&&(e=!0,n.width=t.width),yt(t.height)&&t.height!==n.height&&(i=!0,n.height=t.height),o&&(e?n.height=n.width/o:i&&(n.width=n.height*o)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,i=function(t,e,i,n){var o=e.aspectRatio,r=e.naturalWidth,a=e.naturalHeight,s=e.rotate,c=void 0===s?0:s,h=e.scaleX,l=void 0===h?1:h,p=e.scaleY,d=void 0===p?1:p,u=i.aspectRatio,f=i.naturalWidth,m=i.naturalHeight,g=n.fillColor,w=void 0===g?"transparent":g,y=n.imageSmoothingEnabled,v=void 0===y||y,b=n.imageSmoothingQuality,x=void 0===b?"low":b,E=n.maxWidth,O=void 0===E?1/0:E,A=n.maxHeight,S=void 0===A?1/0:A,D=n.minWidth,T=void 0===D?0:D,R=n.minHeight,M=void 0===R?0:R,k=document.createElement("canvas"),B=k.getContext("2d"),N=Qt({aspectRatio:u,width:O,height:S}),L=Qt({aspectRatio:u,width:T,height:M},"cover"),j=Math.min(N.width,Math.max(L.width,f)),P=Math.min(N.height,Math.max(L.height,m)),z=Qt({aspectRatio:o,width:O,height:S}),U=Qt({aspectRatio:o,width:T,height:M},"cover"),H=Math.min(z.width,Math.max(U.width,r)),F=Math.min(z.height,Math.max(U.height,a)),W=[-H/2,-F/2,H,F];return k.width=Mt(j),k.height=Mt(P),B.fillStyle=w,B.fillRect(0,0,j,P),B.save(),B.translate(j/2,P/2),B.rotate(c*Math.PI/180),B.scale(l,d),B.imageSmoothingEnabled=v,B.imageSmoothingQuality=x,B.drawImage.apply(B,[t].concat(C(W.map((function(t){return Math.floor(Mt(t))}))))),B.restore(),k}(this.image,this.imageData,e,t);if(!this.cropped)return i;var n=this.getData(),o=n.x,r=n.y,a=n.width,s=n.height,c=i.width/Math.floor(e.naturalWidth);1!==c&&(o*=c,r*=c,a*=c,s*=c);var h=a/s,l=Qt({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),p=Qt({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),d=Qt({aspectRatio:h,width:t.width||(1!==c?i.width:a),height:t.height||(1!==c?i.height:s)}),u=d.width,f=d.height;u=Math.min(l.width,Math.max(p.width,u)),f=Math.min(l.height,Math.max(p.height,f));var m=document.createElement("canvas"),g=m.getContext("2d");m.width=Mt(u),m.height=Mt(f),g.fillStyle=t.fillColor||"transparent",g.fillRect(0,0,u,f);var w=t.imageSmoothingEnabled,y=void 0===w||w,v=t.imageSmoothingQuality;g.imageSmoothingEnabled=y,v&&(g.imageSmoothingQuality=v);var b,x,E,O,A,S,D=i.width,T=i.height,R=o,M=r;R<=-a||R>D?(R=0,b=0,E=0,A=0):R<=0?(E=-R,R=0,A=b=Math.min(D,a+R)):R<=D&&(E=0,A=b=Math.min(a,D-R)),b<=0||M<=-s||M>T?(M=0,x=0,O=0,S=0):M<=0?(O=-M,M=0,S=x=Math.min(T,s+M)):M<=T&&(O=0,S=x=Math.min(s,T-M));var k=[R,M,b,x];if(A>0&&S>0){var B=u/a;k.push(E*B,O*B,A*B,S*B)}return g.drawImage.apply(g,[i].concat(C(k.map((function(t){return Math.floor(Mt(t))}))))),m},setAspectRatio:function(t){var e=this.options;return this.disabled||bt(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,i=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var o=t===$,r=e.movable&&t===G;t=o||r?t:Q,e.dragMode=t,Ht(i,J,t),jt(i,W,o),jt(i,K,r),e.cropBoxMovable||(Ht(n,J,t),jt(n,W,o),jt(n,K,r))}return this}},ce=A.Cropper,he=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e||!mt.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Tt({},gt,Et(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()}var e,i,n;return e=t,i=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[T]){if(e[T]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var i=this.element,n=this.options;if(n.rotatable||n.scalable||(n.checkOrientation=!1),n.checkOrientation&&window.ArrayBuffer)if(ut.test(t))ft.test(t)?this.read((o=t.replace(te,""),r=atob(o),a=new ArrayBuffer(r.length),Dt(s=new Uint8Array(a),(function(t,e){s[e]=r.charCodeAt(e)})),a)):this.clone();else{var o,r,a,s,c=new XMLHttpRequest,h=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=h,c.onerror=h,c.ontimeout=h,c.onprogress=function(){c.getResponseHeader("content-type")!==pt&&c.abort()},c.onload=function(){e.read(c.response)},c.onloadend=function(){e.reloading=!1,e.xhr=null},n.checkCrossOrigin&&Jt(t)&&i.crossOrigin&&(t=Vt(t)),c.open("GET",t,!0),c.responseType="arraybuffer",c.withCredentials="use-credentials"===i.crossOrigin,c.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,n=ee(t),o=0,r=1,a=1;if(n>1){this.url=function(t,e){for(var i=[],n=new Uint8Array(t);n.length>0;)i.push(Zt.apply(null,St(n.subarray(0,8192)))),n=n.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,pt);var s=function(t){var e=0,i=1,n=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:n=-1;break;case 5:e=90,n=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90}return{rotate:e,scaleX:i,scaleY:n}}(n);o=s.rotate,r=s.scaleX,a=s.scaleY}e.rotatable&&(i.rotate=o),e.scalable&&(i.scaleX=r,i.scaleY=a),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,n=e;this.options.checkCrossOrigin&&Jt(e)&&(i||(i="anonymous"),n=Vt(e)),this.crossOrigin=i,this.crossOriginUrl=n;var o=document.createElement("img");i&&(o.crossOrigin=i),o.src=n||e,o.alt=t.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),Nt(o,X),t.parentNode.insertBefore(o,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var i=A.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(A.navigator.userAgent),n=function(e,i){Tt(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.initialImageData=Tt({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var o=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){n(o.width,o.height),i||r.removeChild(o)},o.src=e.src,i||(o.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;",r.appendChild(o))}else n(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,i=this.image,n=t.parentNode,o=document.createElement("div");o.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 r=o.querySelector(".".concat(T,"-container")),a=r.querySelector(".".concat(T,"-canvas")),s=r.querySelector(".".concat(T,"-drag-box")),c=r.querySelector(".".concat(T,"-crop-box")),h=c.querySelector(".".concat(T,"-face"));this.container=n,this.cropper=r,this.canvas=a,this.dragBox=s,this.cropBox=c,this.viewBox=r.querySelector(".".concat(T,"-view-box")),this.face=h,a.appendChild(i),Nt(t,_),n.insertBefore(r,t.nextSibling),Lt(i,X),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,Nt(c,_),e.guides||Nt(c.getElementsByClassName("".concat(T,"-dashed")),_),e.center||Nt(c.getElementsByClassName("".concat(T,"-center")),_),e.background&&Nt(r,"".concat(T,"-bg")),e.highlight||Nt(h,Y),e.cropBoxMovable&&(Nt(h,K),Ht(h,J,R)),e.cropBoxResizable||(Nt(c.getElementsByClassName("".concat(T,"-line")),_),Nt(c.getElementsByClassName("".concat(T,"-point")),_)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),Ot(e.ready)&&_t(t,st,e.ready,{once:!0}),Xt(t,st)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),Lt(this.element,_)}}},{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()}}],n=[{key:"noConflict",value:function(){return window.Cropper=ce,t}},{key:"setDefaults",value:function(t){Tt(gt,Et(t)&&t)}}],i&&b(e.prototype,i),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();Tt(he.prototype,ie,ne,oe,re,ae,se);const le=t("C",n({name:"copper-image",emits:["close","cropperNo","cropperOk"],setup(t,{emit:e,expose:i}){const n=o({visible:!1,img:null,confirmLoading:!1,options:{img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"修改头像",name:null},previews:{},url:{upload:"/sys/common/saveToImgByStr"},myCropper:null}),u=r(),f=()=>{n.myCropper=new he(u.value,{viewMode:1,dragMode:"move",aspectRatio:n.options.autoCropWidth/n.options.autoCropHeight,initialAspectRatio:1,autoCropArea:1,cropBoxMovable:!0,cropBoxResizable:!1,background:!0,movable:!0,modal:!0,preview:".before"})},m=t=>{switch(t){case"left":n.myCropper.rotate(90);break;case"right":n.myCropper.rotate(-90);break;case"zoomIn":n.myCropper.zoom(.1);break;case"zoomOut":n.myCropper.zoom(-.1)}},g=()=>{n.confirmLoading=!0,n.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toBlob((t=>{console.log(t,"1212"),e("cropperOk",t),n.confirmLoading=!1}))};return i({edit:t=>{const{options:e}=n;n.visible=!0,n.options=Object.assign({},e,t),d((()=>{f()}))}}),()=>a("div",null,[a(s,{cols:2,xGap:24,style:{paddingTop:"12px"}},{default:()=>[a(c,null,{default:()=>[a("div",{style:"width: 100%; height: 300px"},[a("img",{ref:u,id:"myImages",src:n.options.img,alt:""},null)]),a(h,{justify:"center",style:{paddingTop:"12px"}},{default:()=>[a(l,{type:"primary",size:"small",onClick:()=>m("left")},{default:()=>[p("逆时针旋转")]}),a(l,{type:"primary",size:"small",onClick:()=>m("right")},{default:()=>[p("顺时针旋转")]}),a(l,{type:"primary",size:"small",onClick:()=>m("zoomIn")},{default:()=>[p("放大")]}),a(l,{type:"primary",size:"small",onClick:()=>m("zoomOut")},{default:()=>[p("缩小")]})]})]}),a(c,null,{default:()=>[a("span",{style:{fontSize:"15px",fontWeight:600,paddingBottom:"8px",display:"inline-block"}},[p("预览图片")]),a("div",{class:"before",style:{width:n.options.autoCropWidth+"px",height:n.options.autoCropHeight+"px",overflow:"hidden"}},null)]})]}),a(h,{justify:"end"},{default:()=>[a(l,{type:"default",onClick:()=>{n.confirmLoading=!1,e("close"),e("cropperNo")}},{default:()=>[p("取消")]}),a(l,{type:"primary",loading:n.confirmLoading,onClick:g},{default:()=>[p("确认")]})]})])}}));function pe(t,e){return function(){return t.apply(e,arguments)}}const{toString:de}=Object.prototype,{getPrototypeOf:ue}=Object,fe=(me=Object.create(null),t=>{const e=de.call(t);return me[e]||(me[e]=e.slice(8,-1).toLowerCase())});var me;const ge=t=>(t=t.toLowerCase(),e=>fe(e)===t),we=t=>e=>typeof e===t,{isArray:ye}=Array,ve=we("undefined"),be=ge("ArrayBuffer"),xe=we("string"),Ce=we("function"),Ee=we("number"),Oe=t=>null!==t&&"object"==typeof t,Ae=t=>{if("object"!==fe(t))return!1;const e=ue(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},Se=ge("Date"),De=ge("File"),Te=ge("Blob"),Re=ge("FileList"),Me=ge("URLSearchParams");function ke(t,e,{allOwnKeys:i=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),ye(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=i?Object.getOwnPropertyNames(t):Object.keys(t),r=o.length;let a;for(n=0;n<r;n++)a=o[n],e.call(null,t[a],a,t)}}function Be(t,e){e=e.toLowerCase();const i=Object.keys(t);let n,o=i.length;for(;o-- >0;)if(n=i[o],e===n.toLowerCase())return n;return null}const Ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Le=t=>!ve(t)&&t!==Ne,je=(Pe="undefined"!=typeof Uint8Array&&ue(Uint8Array),t=>Pe&&t instanceof Pe);var Pe;const ze=ge("HTMLFormElement"),Ue=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),He=ge("RegExp"),Fe=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),n={};ke(i,((i,o)=>{!1!==e(i,o,t)&&(n[o]=i)})),Object.defineProperties(t,n)},We="abcdefghijklmnopqrstuvwxyz",Ie="0123456789",_e={DIGIT:Ie,ALPHA:We,ALPHA_DIGIT:We+We.toUpperCase()+Ie},Xe=ge("AsyncFunction"),Ye={isArray:ye,isArrayBuffer:be,isBuffer:function(t){return null!==t&&!ve(t)&&null!==t.constructor&&!ve(t.constructor)&&Ce(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||Ce(t.append)&&("formdata"===(e=fe(t))||"object"===e&&Ce(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&be(t.buffer),e},isString:xe,isNumber:Ee,isBoolean:t=>!0===t||!1===t,isObject:Oe,isPlainObject:Ae,isUndefined:ve,isDate:Se,isFile:De,isBlob:Te,isRegExp:He,isFunction:Ce,isStream:t=>Oe(t)&&Ce(t.pipe),isURLSearchParams:Me,isTypedArray:je,isFileList:Re,forEach:ke,merge:function t(){const{caseless:e}=Le(this)&&this||{},i={},n=(n,o)=>{const r=e&&Be(i,o)||o;Ae(i[r])&&Ae(n)?i[r]=t(i[r],n):Ae(n)?i[r]=t({},n):ye(n)?i[r]=n.slice():i[r]=n};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&ke(arguments[o],n);return i},extend:(t,e,i,{allOwnKeys:n}={})=>(ke(e,((e,n)=>{i&&Ce(e)?t[n]=pe(e,i):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,i,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,e,i,n)=>{let o,r,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)a=o[r],n&&!n(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==i&&ue(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:fe,kindOfTest:ge,endsWith:(t,e,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;const n=t.indexOf(e,i);return-1!==n&&n===i},toArray:t=>{if(!t)return null;if(ye(t))return t;let e=t.length;if(!Ee(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},forEachEntry:(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=i.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll:(t,e)=>{let i;const n=[];for(;null!==(i=t.exec(e));)n.push(i);return n},isHTMLForm:ze,hasOwnProperty:Ue,hasOwnProp:Ue,reduceDescriptors:Fe,freezeMethods:t=>{Fe(t,((e,i)=>{if(Ce(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=t[i];Ce(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))}))},toObjectSet:(t,e)=>{const i={},n=t=>{t.forEach((t=>{i[t]=!0}))};return ye(t)?n(t):n(String(t).split(e)),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,i){return e.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:Be,global:Ne,isContextDefined:Le,ALPHABET:_e,generateString:(t=16,e=_e.ALPHA_DIGIT)=>{let i="";const{length:n}=e;for(;t--;)i+=e[Math.random()*n|0];return i},isSpecCompliantForm:function(t){return!!(t&&Ce(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),i=(t,n)=>{if(Oe(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=ye(t)?[]:{};return ke(t,((t,e)=>{const r=i(t,n+1);!ve(r)&&(o[e]=r)})),e[n]=void 0,o}}return t};return i(t,0)},isAsyncFn:Xe,isThenable:t=>t&&(Oe(t)||Ce(t))&&Ce(t.then)&&Ce(t.catch)};function qe(t,e,i,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),o&&(this.response=o)}Ye.inherits(qe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ye.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ke=qe.prototype,Je={};function Ve(t){return Ye.isPlainObject(t)||Ye.isArray(t)}function $e(t){return Ye.endsWith(t,"[]")?t.slice(0,-2):t}function Ge(t,e,i){return t?t.concat(e).map((function(t,e){return t=$e(t),!i&&e?"["+t+"]":t})).join(i?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{Je[t]={value:t}})),Object.defineProperties(qe,Je),Object.defineProperty(Ke,"isAxiosError",{value:!0}),qe.from=(t,e,i,n,o,r)=>{const a=Object.create(Ke);return Ye.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),qe.call(a,t.message,e,i,n,o),a.cause=t,a.name=t.name,r&&Object.assign(a,r),a};const Qe=Ye.toFlatObject(Ye,{},null,(function(t){return/^is[A-Z]/.test(t)}));function Ze(t,e,i){if(!Ye.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(i=Ye.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Ye.isUndefined(e[t])}))).metaTokens,o=i.visitor||h,r=i.dots,a=i.indexes,s=(i.Blob||"undefined"!=typeof Blob&&Blob)&&Ye.isSpecCompliantForm(e);if(!Ye.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(Ye.isDate(t))return t.toISOString();if(!s&&Ye.isBlob(t))throw new qe("Blob is not supported. Use a Buffer instead.");return Ye.isArrayBuffer(t)||Ye.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function h(t,i,o){let s=t;if(t&&!o&&"object"==typeof t)if(Ye.endsWith(i,"{}"))i=n?i:i.slice(0,-2),t=JSON.stringify(t);else if(Ye.isArray(t)&&function(t){return Ye.isArray(t)&&!t.some(Ve)}(t)||(Ye.isFileList(t)||Ye.endsWith(i,"[]"))&&(s=Ye.toArray(t)))return i=$e(i),s.forEach((function(t,n){!Ye.isUndefined(t)&&null!==t&&e.append(!0===a?Ge([i],n,r):null===a?i:i+"[]",c(t))})),!1;return!!Ve(t)||(e.append(Ge(o,i,r),c(t)),!1)}const l=[],p=Object.assign(Qe,{defaultVisitor:h,convertValue:c,isVisitable:Ve});if(!Ye.isObject(t))throw new TypeError("data must be an object");return function t(i,n){if(!Ye.isUndefined(i)){if(-1!==l.indexOf(i))throw Error("Circular reference detected in "+n.join("."));l.push(i),Ye.forEach(i,(function(i,r){!0===(!(Ye.isUndefined(i)||null===i)&&o.call(e,i,Ye.isString(r)?r.trim():r,n,p))&&t(i,n?n.concat(r):[r])})),l.pop()}}(t),e}function ti(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function ei(t,e){this._pairs=[],t&&Ze(t,this,e)}const ii=ei.prototype;function ni(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function oi(t,e,i){if(!e)return t;const n=i&&i.encode||ni,o=i&&i.serialize;let r;if(r=o?o(e,i):Ye.isURLSearchParams(e)?e.toString():new ei(e,i).toString(n),r){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}ii.append=function(t,e){this._pairs.push([t,e])},ii.toString=function(t){const e=t?function(e){return t.call(this,e,ti)}:ti;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const ri=class{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ye.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ai={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},si={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ei,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ci(t){function e(t,i,n,o){let r=t[o++];const a=Number.isFinite(+r),s=o>=t.length;return r=!r&&Ye.isArray(n)?n.length:r,s?(Ye.hasOwnProp(n,r)?n[r]=[n[r],i]:n[r]=i,!a):(n[r]&&Ye.isObject(n[r])||(n[r]=[]),e(t,i,n[r],o)&&Ye.isArray(n[r])&&(n[r]=function(t){const e={},i=Object.keys(t);let n;const o=i.length;let r;for(n=0;n<o;n++)r=i[n],e[r]=t[r];return e}(n[r])),!a)}if(Ye.isFormData(t)&&Ye.isFunction(t.entries)){const i={};return Ye.forEachEntry(t,((t,n)=>{e(function(t){return Ye.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,i,0)})),i}return null}const hi={"Content-Type":void 0},li={transitional:ai,adapter:["xhr","http"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,o=Ye.isObject(t);if(o&&Ye.isHTMLForm(t)&&(t=new FormData(t)),Ye.isFormData(t))return n&&n?JSON.stringify(ci(t)):t;if(Ye.isArrayBuffer(t)||Ye.isBuffer(t)||Ye.isStream(t)||Ye.isFile(t)||Ye.isBlob(t))return t;if(Ye.isArrayBufferView(t))return t.buffer;if(Ye.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Ze(t,new si.classes.URLSearchParams,Object.assign({visitor:function(t,e,i,n){return si.isNode&&Ye.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((r=Ye.isFileList(t))||i.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Ze(r?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,i){if(Ye.isString(t))try{return(e||JSON.parse)(t),Ye.trim(t)}catch(n){if("SyntaxError"!==n.name)throw n}return(i||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||li.transitional,i=e&&e.forcedJSONParsing,n="json"===this.responseType;if(t&&Ye.isString(t)&&(i&&!this.responseType||n)){const i=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(i){if("SyntaxError"===o.name)throw qe.from(o,qe.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:si.classes.FormData,Blob:si.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Ye.forEach(["delete","get","head"],(function(t){li.headers[t]={}})),Ye.forEach(["post","put","patch"],(function(t){li.headers[t]=Ye.merge(hi)}));const pi=li,di=Ye.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ui=Symbol("internals");function fi(t){return t&&String(t).trim().toLowerCase()}function mi(t){return!1===t||null==t?t:Ye.isArray(t)?t.map(mi):String(t)}function gi(t,e,i,n,o){return Ye.isFunction(n)?n.call(this,e,i):(o&&(e=i),Ye.isString(e)?Ye.isString(n)?-1!==e.indexOf(n):Ye.isRegExp(n)?n.test(e):void 0:void 0)}class wi{constructor(t){t&&this.set(t)}set(t,e,i){const n=this;function o(t,e,i){const o=fi(e);if(!o)throw new Error("header name must be a non-empty string");const r=Ye.findKey(n,o);(!r||void 0===n[r]||!0===i||void 0===i&&!1!==n[r])&&(n[r||e]=mi(t))}const r=(t,e)=>Ye.forEach(t,((t,i)=>o(t,i,e)));return Ye.isPlainObject(t)||t instanceof this.constructor?r(t,e):Ye.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?r((t=>{const e={};let i,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),i=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!i||e[i]&&di[i]||("set-cookie"===i?e[i]?e[i].push(n):e[i]=[n]:e[i]=e[i]?e[i]+", "+n:n)})),e})(t),e):null!=t&&o(e,t,i),this}get(t,e){if(t=fi(t)){const i=Ye.findKey(this,t);if(i){const t=this[i];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(t);)e[n[1]]=n[2];return e}(t);if(Ye.isFunction(e))return e.call(this,t,i);if(Ye.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=fi(t)){const i=Ye.findKey(this,t);return!(!i||void 0===this[i]||e&&!gi(0,this[i],i,e))}return!1}delete(t,e){const i=this;let n=!1;function o(t){if(t=fi(t)){const o=Ye.findKey(i,t);!o||e&&!gi(0,i[o],o,e)||(delete i[o],n=!0)}}return Ye.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const o=e[i];t&&!gi(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,i={};return Ye.forEach(this,((n,o)=>{const r=Ye.findKey(i,o);if(r)return e[r]=mi(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,i)=>e.toUpperCase()+i))}(o):String(o).trim();a!==o&&delete e[o],e[a]=mi(n),i[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Ye.forEach(this,((i,n)=>{null!=i&&!1!==i&&(e[n]=t&&Ye.isArray(i)?i.join(", "):i)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach((t=>i.set(t))),i}static accessor(t){const e=(this[ui]=this[ui]={accessors:{}}).accessors,i=this.prototype;function n(t){const n=fi(t);e[n]||(function(t,e){const i=Ye.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+i,{value:function(t,i,o){return this[n].call(this,e,t,i,o)},configurable:!0})}))}(i,t),e[n]=!0)}return Ye.isArray(t)?t.forEach(n):n(t),this}}wi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ye.freezeMethods(wi.prototype),Ye.freezeMethods(wi);const yi=wi;function vi(t,e){const i=this||pi,n=e||i,o=yi.from(n.headers);let r=n.data;return Ye.forEach(t,(function(t){r=t.call(i,r,o.normalize(),e?e.status:void 0)})),o.normalize(),r}function bi(t){return!(!t||!t.__CANCEL__)}function xi(t,e,i){qe.call(this,null==t?"canceled":t,qe.ERR_CANCELED,e,i),this.name="CanceledError"}Ye.inherits(xi,qe,{__CANCEL__:!0});const Ci=si.isStandardBrowserEnv?{write:function(t,e,i,n,o,r){const a=[];a.push(t+"="+encodeURIComponent(e)),Ye.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),Ye.isString(n)&&a.push("path="+n),Ye.isString(o)&&a.push("domain="+o),!0===r&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Ei(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Oi=si.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let i;function n(i){let n=i;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return i=n(window.location.href),function(t){const e=Ye.isString(t)?n(t):t;return e.protocol===i.protocol&&e.host===i.host}}():function(){return!0};function Ai(t,e){let i=0;const n=function(t,e){t=t||10;const i=new Array(t),n=new Array(t);let o,r=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),h=n[a];o||(o=c),i[r]=s,n[r]=c;let l=a,p=0;for(;l!==r;)p+=i[l++],l%=t;if(r=(r+1)%t,r===a&&(a=(a+1)%t),c-o<e)return;const d=h&&c-h;return d?Math.round(1e3*p/d):void 0}}(50,250);return o=>{const r=o.loaded,a=o.lengthComputable?o.total:void 0,s=r-i,c=n(s);i=r;const h={loaded:r,total:a,progress:a?r/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&r<=a?(a-r)/c:void 0,event:o};h[e?"download":"upload"]=!0,t(h)}}const Si="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,i){let n=t.data;const o=yi.from(t.headers).normalize(),r=t.responseType;let a;function s(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}Ye.isFormData(n)&&(si.isStandardBrowserEnv||si.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",i=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+i))}const h=Ei(t.baseURL,t.url);function l(){if(!c)return;const n=yi.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?e(new qe("Request failed with status code "+i.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}((function(t){e(t),s()}),(function(t){i(t),s()}),{data:r&&"text"!==r&&"json"!==r?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),oi(h,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(i(new qe("Request aborted",qe.ECONNABORTED,t,c)),c=null)},c.onerror=function(){i(new qe("Network Error",qe.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const n=t.transitional||ai;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(new qe(e,n.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,t,c)),c=null},si.isStandardBrowserEnv){const e=(t.withCredentials||Oi(h))&&t.xsrfCookieName&&Ci.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===n&&o.setContentType(null),"setRequestHeader"in c&&Ye.forEach(o.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),Ye.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),r&&"json"!==r&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",Ai(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Ai(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{c&&(i(!e||e.type?new xi(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(h);p&&-1===si.protocols.indexOf(p)?i(new qe("Unsupported protocol "+p+":",qe.ERR_BAD_REQUEST,t)):c.send(n||null)}))},Di={http:null,xhr:Si};Ye.forEach(Di,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(i){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ti=t=>{t=Ye.isArray(t)?t:[t];const{length:e}=t;let i,n;for(let o=0;o<e&&(i=t[o],!(n=Ye.isString(i)?Di[i.toLowerCase()]:i));o++);if(!n){if(!1===n)throw new qe(`Adapter ${i} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Ye.hasOwnProp(Di,i)?`Adapter '${i}' is not available in the build`:`Unknown adapter '${i}'`)}if(!Ye.isFunction(n))throw new TypeError("adapter is not a function");return n};function Ri(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new xi(null,t)}function Mi(t){return Ri(t),t.headers=yi.from(t.headers),t.data=vi.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ti(t.adapter||pi.adapter)(t).then((function(e){return Ri(t),e.data=vi.call(t,t.transformResponse,e),e.headers=yi.from(e.headers),e}),(function(e){return bi(e)||(Ri(t),e&&e.response&&(e.response.data=vi.call(t,t.transformResponse,e.response),e.response.headers=yi.from(e.response.headers))),Promise.reject(e)}))}const ki=t=>t instanceof yi?t.toJSON():t;function Bi(t,e){e=e||{};const i={};function n(t,e,i){return Ye.isPlainObject(t)&&Ye.isPlainObject(e)?Ye.merge.call({caseless:i},t,e):Ye.isPlainObject(e)?Ye.merge({},e):Ye.isArray(e)?e.slice():e}function o(t,e,i){return Ye.isUndefined(e)?Ye.isUndefined(t)?void 0:n(void 0,t,i):n(t,e,i)}function r(t,e){if(!Ye.isUndefined(e))return n(void 0,e)}function a(t,e){return Ye.isUndefined(e)?Ye.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function s(i,o,r){return r in e?n(i,o):r in t?n(void 0,i):void 0}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(ki(t),ki(e),!0)};return Ye.forEach(Object.keys(Object.assign({},t,e)),(function(n){const r=c[n]||o,a=r(t[n],e[n],n);Ye.isUndefined(a)&&r!==s||(i[n]=a)})),i}const Ni="1.4.0",Li={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Li[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));const ji={};Li.transitional=function(t,e,i){function n(t,e){return"[Axios v1.4.0] Transitional option '"+t+"'"+e+(i?". "+i:"")}return(i,o,r)=>{if(!1===t)throw new qe(n(o," has been removed"+(e?" in "+e:"")),qe.ERR_DEPRECATED);return e&&!ji[o]&&(ji[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,o,r)}};const Pi={assertOptions:function(t,e,i){if("object"!=typeof t)throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const r=n[o],a=e[r];if(a){const e=t[r],i=void 0===e||a(e,r,t);if(!0!==i)throw new qe("option "+r+" must be "+i,qe.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new qe("Unknown option "+r,qe.ERR_BAD_OPTION)}},validators:Li},zi=Pi.validators;class Ui{constructor(t){this.defaults=t,this.interceptors={request:new ri,response:new ri}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Bi(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:o}=e;let r;void 0!==i&&Pi.assertOptions(i,{silentJSONParsing:zi.transitional(zi.boolean),forcedJSONParsing:zi.transitional(zi.boolean),clarifyTimeoutError:zi.transitional(zi.boolean)},!1),null!=n&&(Ye.isFunction(n)?e.paramsSerializer={serialize:n}:Pi.assertOptions(n,{encode:zi.function,serialize:zi.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase(),r=o&&Ye.merge(o.common,o[e.method]),r&&Ye.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=yi.concat(r,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let h;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,p=0;if(!s){const t=[Mi.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,h=Promise.resolve(e);p<l;)h=h.then(t[p++],t[p++]);return h}l=a.length;let d=e;for(p=0;p<l;){const t=a[p++],e=a[p++];try{d=t(d)}catch(u){e.call(this,u);break}}try{h=Mi.call(this,d)}catch(u){return Promise.reject(u)}for(p=0,l=c.length;p<l;)h=h.then(c[p++],c[p++]);return h}getUri(t){return oi(Ei((t=Bi(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}Ye.forEach(["delete","get","head","options"],(function(t){Ui.prototype[t]=function(e,i){return this.request(Bi(i||{},{method:t,url:e,data:(i||{}).data}))}})),Ye.forEach(["post","put","patch"],(function(t){function e(e){return function(i,n,o){return this.request(Bi(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}Ui.prototype[t]=e(),Ui.prototype[t+"Form"]=e(!0)}));const Hi=Ui;class Fi{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const i=this;this.promise.then((t=>{if(!i._listeners)return;let e=i._listeners.length;for(;e-- >0;)i._listeners[e](t);i._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{i.subscribe(t),e=t})).then(t);return n.cancel=function(){i.unsubscribe(e)},n},t((function(t,n,o){i.reason||(i.reason=new xi(t,n,o),e(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Fi((function(e){t=e})),cancel:t}}}const Wi=Fi,Ii={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ii).forEach((([t,e])=>{Ii[e]=t}));const _i=Ii,Xi=function t(e){const i=new Hi(e),n=pe(Hi.prototype.request,i);return Ye.extend(n,Hi.prototype,i,{allOwnKeys:!0}),Ye.extend(n,i,null,{allOwnKeys:!0}),n.create=function(i){return t(Bi(e,i))},n}(pi);Xi.Axios=Hi,Xi.CanceledError=xi,Xi.CancelToken=Wi,Xi.isCancel=bi,Xi.VERSION=Ni,Xi.toFormData=Ze,Xi.AxiosError=qe,Xi.Cancel=Xi.CanceledError,Xi.all=function(t){return Promise.all(t)},Xi.spread=function(t){return function(e){return t.apply(null,e)}},Xi.isAxiosError=function(t){return Ye.isObject(t)&&!0===t.isAxiosError},Xi.mergeConfig=Bi,Xi.AxiosHeaders=yi,Xi.formToJSON=t=>ci(Ye.isHTMLForm(t)?new FormData(t):t),Xi.HttpStatusCode=_i,Xi.default=Xi;const Yi=t("a",Xi);t("U",n({name:"upload-file",props:{fileList:{type:String,default:""},imageList:{type:Array,default:()=>[]},accept:{type:String,default:".jpg,.png,.jpeg,.gif"},listType:{type:String,default:"image-card"},showType:{type:String,default:"default"},showFileList:{type:Boolean,default:!0},text:{type:String,default:"上传文件"},size:{type:Number,default:5},max:{type:Number,default:1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tips:{type:String,default:""},bucketName:{type:String,default:"gyt"},path:{type:String,default:""},fileName:{type:String,default:""},cropper:{type:Boolean,default:!1},options:{type:Object,default:()=>({viewMode:0,autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!1,previewsCircle:!0,title:"上传图片"})}},emits:["update:fileList","close","readFileInputEventAsArrayBuffer","remove"],setup(t,{emit:i,expose:n,slots:s}){const c=`https://${t.bucketName}.ks3-cn-beijing.ksyuncs.com/`,h=u(),p=r(!1),d=r(!1),w=r(),y=r(),v=o({policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""}),b=r([]),x=()=>{if(t.fileList){const e=t.fileList.split("/");b.value=[{id:(new Date).getTime().toString(),name:e[e.length-1],status:"finished",url:t.fileList}]}else if(Array.isArray(t.imageList)){const e=[];t.imageList.forEach((t=>{const i=t.split("/");e.push({id:Date.now().toString(),name:i[i.length-1],status:"finished",url:t})})),b.value=e}else b.value=[]};x(),f((()=>t.imageList),(()=>{x()})),f((()=>t.fileList),(()=>{console.log("list"),x()})),n({handleClearFile:()=>{y.value?.clear(),console.log("清空",y.value)}});const C=r(),E=async(t,e)=>{const i=new FileReader;i.addEventListener("load",(()=>e(i.result))),i.readAsDataURL(t)},O=async n=>{try{const o=`${t.path}${t.fileName||(new Date).getTime()+".png"}`,r={filename:o,bucketName:t.bucketName,postData:{filename:o,acl:"public-read",key:o,unknowValueField:[]}},{data:a}=await e(r);v.policy=a.policy,v.signature=a.signature,v.key=o,v.KSSAccessKeyId=a.kssAccessKeyId,v.name=o;const s=new FormData;for(const t in v)s.append(t,v[t]);s.append("file",n),await Yi.post(c,s).then((()=>{const t=c+v.key;console.log(t,"url");const e=t.split("/");b.value=[{id:(new Date).getTime().toString(),name:e[e.length-1],status:"finished",url:t}],i("update:fileList",t),p.value=!1}))}catch{return!1}};return()=>a("div",null,[a(m,{ref:y,action:c,data:v,fileList:b.value,"onUpdate:fileList":t=>b.value=t,listType:t.listType,accept:t.accept,multiple:t.multiple,max:t.max,disabled:t.disabled,showFileList:t.showFileList,showPreviewButton:!0,onBeforeUpload:i=>(async i=>{const n=i.file;let o=!0;if(t.size&&(o=n.file.size/1024/1024<t.size,!o))return h.error(`文件大小不能超过${t.size}M`),!1;if(!o)return o;if(t.cropper)return E(n.file,(e=>{const i=Object.assign({},t.options,{img:e,name:n.file.name});p.value=!0,setTimeout((()=>{C.value?.edit(i),console.log(C.value,"cropper")}),100)})),!1;try{d.value=!0,console.log(t.path,n.file);const i=n.file.name,o=i.slice(i.lastIndexOf(".")),r=`${t.path}${t.fileName||Date.now()+o}`,a={filename:r,bucketName:t.bucketName,postData:{filename:r,acl:"public-read",key:r,unknowValueField:[]}},{data:s}=await e(a);v.policy=s.policy,v.signature=s.signature,v.key=r,v.KSSAccessKeyId=s.kssAccessKeyId,v.name=r,w.value=n.file}catch{return d.value=!1,!1}return!0})(i),onFinish:t=>(t=>{const e=c+v.key;console.log(e,"url"),i("update:fileList",e),i("readFileInputEventAsArrayBuffer",w.value),t.file.url=e,p.value=!1,d.value=!1})(t),onRemove:t=>(async t=>{console.log("🚀 ~ options",t),i("update:fileList",""),i("remove"),d.value=!1})(t)},{default:()=>["default"===t.showType&&"image"===t.listType&&a(l,{loading:d.value,type:"primary"},{default:()=>[t.text]}),"custom"===t.showType&&s.custom&&s.custom()]}),t.tips&&a("p",{style:"font-size: 13px; color: #666; padding-top: 4px;"},[t.tips]),a(g,{show:p.value,"onUpdate:show":t=>p.value=t,preset:"dialog",showIcon:!1,class:["modalTitle background"],title:"上传图片",style:{width:"800px"}},{default:()=>[a(le,{ref:C,onClose:()=>p.value=!1,onCropperOk:O},null)]})])}}))}}}));
|