物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
41 KiB

  1. ;/*!node_modules/cropperjs/dist/cropper.js*/
  2. amis.define("863afbe",(function(t,e,i,a){
  3. /*!
  4. * Cropper.js v1.5.13
  5. * https://fengyuanchen.github.io/cropperjs
  6. *
  7. * Copyright 2015-present Chen Fengyuan
  8. * Released under the MIT license
  9. *
  10. * Date: 2022-11-20T05:30:46.114Z
  11. */
  12. var n,o;n=this,o=function(){"use strict";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function e(e){for(var i=1;i<arguments.length;i++){var a=null!=arguments[i]?arguments[i]:{};i%2?t(Object(a),!0).forEach((function(t){o(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(t){return i="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},i(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){return function(t){if(Array.isArray(t))return h(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 h(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)?h(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 h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}var s="undefined"!=typeof window&&void 0!==window.document,c=s?window:{},l=!(!s||!c.document.documentElement)&&"ontouchstart"in c.document.documentElement,d=!!s&&"PointerEvent"in c,p="cropper",m="all",u="crop",g="move",f="zoom",v="e",w="w",b="s",y="n",x="ne",M="nw",C="se",D="sw",B="".concat(p,"-crop"),k="".concat(p,"-disabled"),O="".concat(p,"-hidden"),T="".concat(p,"-hide"),E="".concat(p,"-invisible"),W="".concat(p,"-modal"),H="".concat(p,"-move"),N="".concat(p,"Action"),L="".concat(p,"Preview"),z="crop",Y="move",X="none",R="crop",S="cropend",A="cropmove",j="cropstart",P="dblclick",I=d?"pointerdown":l?"touchstart":"mousedown",U=d?"pointermove":l?"touchmove":"mousemove",q=d?"pointerup pointercancel":l?"touchend touchcancel":"mouseup",$="ready",Q="resize",K="wheel",Z="zoom",G="image/jpeg",V=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,F=/^data:/,J=/^data:image\/jpeg;base64,/,_=/^img|canvas$/i,tt={viewMode:0,dragMode:z,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},et=Number.isNaN||c.isNaN;function it(t){return"number"==typeof t&&!et(t)}var at=function(t){return t>0&&t<1/0};function nt(t){return void 0===t}function ot(t){return"object"===i(t)&&null!==t}var rt=Object.prototype.hasOwnProperty;function ht(t){if(!ot(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&rt.call(i,"isPrototypeOf")}catch(t){return!1}}function st(t){return"function"==typeof t}var ct=Array.prototype.slice;function lt(t){return Array.from?Array.from(t):ct.call(t)}function dt(t,e){return t&&st(e)&&(Array.isArray(t)||it(t.length)?lt(t).forEach((function(i,a){e.call(t,i,a,t)})):ot(t)&&Object.keys(t).
  13. ;/*!node_modules/react-cropper/dist/react-cropper.umd.js*/
  14. amis.define("4905a96",(function(e,r,o,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("9e5f0aa"),a=e("863afbe"),i=function(){return i=Object.assign||function(e){for(var r,o=1,t=arguments.length;o<t;o++)for(var n in r=arguments[o])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},i.apply(this,arguments)};function c(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o}var l,s,u={},f={};s={get exports(){return u},set exports(e){u=e}},s.exports=function(){if(l)return f;l=1;var e=n,r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(e,o,n){var c,l={},s=null,u=null;for(c in void 0!==n&&(s=""+n),void 0!==o.key&&(s=""+o.key),void 0!==o.ref&&(u=o.ref),o)t.call(o,c)&&!i.hasOwnProperty(c)&&(l[c]=o[c]);if(e&&e.defaultProps)for(c in o=e.defaultProps)void 0===l[c]&&(l[c]=o[c]);return{$$typeof:r,type:e,key:s,ref:u,props:l,_owner:a.current}}return f.Fragment=o,f.jsx=c,f.jsxs=c,f}();var p=["aspectRatio","autoCrop","autoCropArea","background","center","checkCrossOrigin","checkOrientation","cropBoxMovable","cropBoxResizable","data","dragMode","guides","highlight","initialAspectRatio","minCanvasHeight","minCanvasWidth","minContainerHeight","minContainerWidth","minCropBoxHeight","minCropBoxWidth","modal","movable","preview","responsive","restore","rotatable","scalable","toggleDragModeOnDblclick","viewMode","wheelZoomRatio","zoomOnTouch","zoomOnWheel","zoomable","cropstart","cropmove","cropend","crop","zoom","ready"],d={opacity:0,maxWidth:"100%"},v=n.forwardRef((function(e,r){var o=c(e,[]),t=o.dragMode,l=void 0===t?"crop":t,s=o.src,f=o.style,v=o.className,y=o.crossOrigin,m=o.scaleX,b=o.scaleY,g=o.enable,O=o.zoomTo,h=o.rotateTo,T=o.alt,_=void 0===T?"picture":T,x=o.ready,z=o.onInitialized,w=c(o,["dragMode","src","style","className","crossOrigin","scaleX","scaleY","enable","zoomTo","rotateTo","alt","ready","onInitialized"]),j={scaleY:b,scaleX:m,enable:g,zoomTo:O,rotateTo:h},C=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=n.useRef(null);return n.useEffect((function(){e.forEach((function(e){e&&("function"==typeof e?e(o.current):e.current=o.current)}))}),[e]),o}(r,n.useRef(null));n.useEffect((function(){var e;(null===(e=C.current)||void 0===e?void 0:e.cropper)&&"number"==typeof O&&C.current.cropper.zoomTo(O)}),[o.zoomTo]),n.useEffect((function(){var e;(null===(e=C.current)||void 0===e?void 0:e.cropper)&&void 0!==s&&C.current.cropper.reset().clear().replace(s)}),[s]),n.useEffect((function(){if(null!==C.current){var e=new a(C.current,i(i({dragMode:l},w),{ready:function(e){null!==e.currentTarget&&function(e,r){void 0===r&&(r={});var o=r.enable,t=void 0===o||o,n=r.scaleX,a=void 0===n?1:n,i=r.scaleY,c=void 0===i?1:i,l=r.zoomTo,s=void 0===l?0:l,u=r.rotateTo;t?e.enable():e.disable(),e.scaleX(a),e.scaleY(c),void 0!==u&&e.rotateTo(u),s>0&&e.zoomTo(s)}(e.currentTarget.cropper,j),x&&x(e)}}));z&&z(e)}return function(){var e,r;null===(r=null===(e=C.current)||void 0===e?void 0:e.cropper)||void 0===r||r.destroy()}}),[C]);var E=function(e){return p.reduce((function(e,r){var o=e,t=r;return o[t],c(o,["symbol"==typeof t?t:t+""])}),e)}(i(i({},w),{crossOrigin:y,src:s,alt:_}));return u.jsx("div",i({style:f,className:v},{children:u.jsx("img",i({},E,{style:d,ref:C}))}))}));r.Cropper=v,r.default=v}));