-
Notifications
You must be signed in to change notification settings - Fork 2
/
srcissors.js
2 lines (2 loc) · 20.4 KB
/
srcissors.js
1
2
!function(i,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?exports.srcissors=t(require("jquery")):i.srcissors=t(i.jQuery)}(self,(i=>(()=>{"use strict";var t={490:(i,t,e)=>{function n(i){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(i){return typeof i}:function(i){return i&&"function"==typeof Symbol&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n(i)}function s(i,t){(null==t||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function h(i,t){for(var e=0;e<t.length;e++){var s=t[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,(void 0,h=function(i,t){if("object"!==n(i)||null===i)return i;var e=i[Symbol.toPrimitive];if(void 0!==e){var s=e.call(i,"string");if("object"!==n(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}(s.key),"symbol"===n(h)?h:String(h)),s)}var h}var o=e(47),r=e(289),a=e(21);i.exports=function(){function i(t){var e=t.arena,n=t.view,s=t.img,h=t.outline,a=t.url,u=t.fixedWidth,c=t.fixedHeight,l=t.minViewWidth,g=t.minViewHeight,v=t.minViewRatio,d=t.maxViewRatio,m=t.originalSize,p=t.crop,f=t.zoomStep,w=t.maxArea,y=t.actions,x=t.minResolution,b=t.surroundingImageOpacity,k=t.showSurroundingImage;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.onPreviewReady=this.onPreviewReady.bind(this),this.arena=e,this.view=n,this.img=s,this.outline=h,this.fixedWidth=u,this.fixedHeight=c,this.minViewWidth=l,this.minViewHeight=g,this.minViewRatio=v,this.maxViewRatio=d,this.originalSize=m,this.actions=y,this.minResolution=x,this.surroundingImageOpacity=b,this.loadingCssClass="crop-view--is-loading",this.panningCssClass="crop-view--is-panning",this.outlineCssClass="crop-outline--active",this.isPanning=!1,this.initialCrop=p,this.loadEvent=o.Callbacks(),this.changeEvent=o.Callbacks(),this.initializeReadyState(),this.zoomInStep=f,this.zoomOutStep=1/this.zoomInStep,this.arenaWidth=this.arena.width(),this.arenaHeight=this.arena.height(),w&&(this.maxArea=this.arenaWidth*this.arenaHeight*w),this.outline&&this.setSurroundingImageVisibility(k),this.preview=new r({onReady:this.onPreviewReady,img:this.img,outline:this.outline,opacity:this.surroundingImageOpacity}),this.setImage(a)}var t,e;return t=i,(e=[{key:"initializeReadyState",value:function(){this.isReady=!1,null!=this.readyEvent&&this.readyEvent.empty(),this.readyEvent=o.Callbacks("memory once")}},{key:"setImage",value:function(i){i!==this.preview.url&&(this.isInitialized&&this.preview.reset(),this.initializeReadyState(),this.view.addClass(this.loadingCssClass),this.preview.setImage({url:i}))}},{key:"setSurroundingImageVisibility",value:function(i){this.surroundingImageOpacity=parseFloat(this.surroundingImageOpacity||.2),"always"===i?this.outline.css("opacity",1):"panning"===i?this.outline.css("opacity",null):(this.outline.css("opacity",0),this.surroundingImageOpacity=0)}},{key:"reset",value:function(){this.isReady&&(this.resize({width:this.imageWidth,height:this.imageHeight}),this.zoomAllOut())}},{key:"onPreviewReady",value:function(i){this.checkRatio(i);var t,e=this.originalSize||i,n=e.width,s=e.height;this.preview.updateImageDimensions({width:n,height:s}),this.isInitialized||(this.events=new a({parent:this,view:this.view,actions:this.actions})),this.imageWidth=n,this.imageHeight=s,this.imageRatio=this.imageWidth/this.imageHeight;var h=this.imageWidth*this.imageHeight;if(this.minResolution&&this.minResolution>h&&delete this.minResolution,this.minResolution){var o=this.minResolution/(this.imageHeight*this.imageHeight);(!this.minViewRatio||this.minViewRatio<o)&&(this.minViewRatio=o);var r=this.imageWidth*this.imageWidth/this.minResolution;(!this.maxViewRatio||this.maxViewRatio>r)&&(this.maxViewRatio=r)}this.calcMaxMinDimensions(),this.fixedWidth&&(t="width"),this.fixedHeight&&(t="height"),this.setViewDimensions({width:this.imageWidth,height:this.imageHeight,keepDimension:t}),this.isReady=!0,this.view.removeClass(this.loadingCssClass),this.isInitialized||null==this.initialCrop?(this.zoomAllOut(),this.center()):this.setCrop(this.initialCrop),this.isInitialized=!0,this.readyEvent.fire(),this.loadEvent.fire()}},{key:"setCrop",value:function(i){var t=this,e=i.x,n=i.y,s=i.width,h=i.height;if(this.isReady){this.resize({width:s,height:h});var o=this.viewWidth/s,r=this.imageWidth*o;this.zoom({width:r}),this.pan({x:e*o,y:n*o})}else this.on("ready",(function(){return t.setCrop({x:e,y:n,width:s,height:h})}))}},{key:"getCrop",value:function(){var i=this.preview.width/this.imageWidth,t={x:this.preview.x/i,y:this.preview.y/i,width:this.viewWidth/i,height:this.viewHeight/i};return this.roundCrop(t),this.validateCrop(t),t}},{key:"roundCrop",value:function(i){for(var t in i){var e=i[t];i[t]=Math.round(e)}}},{key:"validateCrop",value:function(i){var t=i.x,e=i.y,n=i.width,s=i.height;return t<0&&(i.x=0),e<0&&(i.y=0),t+n>this.imageWidth&&(i.width=this.imageWidth-t),e+s>this.imageHeight&&(i.height=this.imageHeight-e),i}},{key:"setRatio",value:function(i,t){var e,n,s=this;if(this.isReady)return i=this.enforceValidRatio(i),"height"===t?n=(e=this.viewHeight)*i:e=(n=this.viewWidth)/i,this.resizeFocusPoint=this.getFocusPoint(),this.resize({width:n,height:e});this.on("ready",(function(){return s.setRatio(i,t)}))}},{key:"onPan",value:function(i){this.isPanning||(this.isPanning=!0,this.arena.addClass(this.panningCssClass),this.outline.addClass(this.outlineCssClass));var t=i.startX-i.dx,e=i.startY-i.dy;this.pan({x:t,y:e})}},{key:"onPanEnd",value:function(){return this.isPanning=!1,this.arena.removeClass(this.panningCssClass),this.outline.removeClass(this.outlineCssClass)}},{key:"onDoubleClick",value:function(i){var t=i.pageX,e=i.pageY,n=this.view[0].getBoundingClientRect(),s=t-n.left,h=e-n.top;this.zoomIn({viewX:s,viewY:h})}},{key:"onResize",value:function(i){var t=i.position,e=i.dx,n=i.dy;this.isResizing||(this.isResizing=!0,this.resizeFocusPoint=this.getFocusPoint()),["top","bottom"].includes(t)?(n*=2,this.resize({width:this.viewWidth,height:this.viewHeight+n,keepDimension:"height"})):["left","right"].includes(t)&&(e*=2,this.resize({width:this.viewWidth+e,height:this.viewHeight,keepDimension:"width"}))}},{key:"onResizeEnd",value:function(){this.isResizing=!1,this.resizeFocusPoint=void 0}},{key:"resize",value:function(i){var t=i.width,e=i.height,n=i.keepDimension;this.setViewDimensions({width:t,height:e,keepDimension:n}),this.resizeFocusPoint&&(this.resizeFocusPoint.viewX=this.viewWidth/2,this.resizeFocusPoint.viewY=this.viewHeight/2),this.zoom({width:this.preview.width,height:this.preview.height,focusPoint:this.resizeFocusPoint})}},{key:"setViewDimensions",value:function(i){var t=i.width,e=i.height,n=i.keepDimension;if(this.maxArea){var s=this.enforceMaxArea({width:t,height:e,keepDimension:n});t=s.width,e=s.height}var h=this.enforceViewDimensions({width:t,height:e,keepDimension:n});if(t=h.width,e=h.height,this.view.css({width:t,height:e}),this.viewWidth=t,this.viewHeight=e,this.viewRatio=t/e,this.minResolution){var o=Math.sqrt(this.minResolution*this.viewRatio),r=Math.sqrt(this.minResolution/this.viewRatio);this.maxImageWidth=this.viewWidth/o*this.imageWidth,this.maxImageHeight=this.viewHeight/r*this.imageHeight}this.fireChange()}},{key:"zoomAllOut",value:function(){this.isWidthRestricting()?this.zoom({width:this.viewWidth}):this.zoom({height:this.viewHeight})}},{key:"zoomIn",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomInStep:i.height=this.preview.height*this.zoomInStep,this.zoom(i)}},{key:"zoomOut",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomOutStep:i.height=this.preview.height*this.zoomOutStep,this.zoom(i)}},{key:"zoom",value:function(i){var t=i.width,e=i.height,n=i.viewX,s=i.viewY,h=i.focusPoint;null==h&&(h=this.getFocusPoint({viewX:n,viewY:s}));var o=this.enforceZoom({width:t,height:e});t=o.width,e=o.height,null!=t?(this.preview.setWidth(t),this.fireChange()):null!=e&&(this.preview.setHeight(e),this.fireChange()),this.focus(h)}},{key:"getFocusPoint",value:function(i){null==i&&(i={});var t=i,e=t.viewX,n=t.viewY;null==e&&(e=this.viewWidth/2),null==n&&(n=this.viewHeight/2);var s=this.preview.x+e,h=this.preview.y+n;return{percentX:s/this.preview.width,percentY:h/this.preview.height,viewX:e,viewY:n}}},{key:"focus",value:function(i){var t=i.percentX,e=i.percentY,n=i.viewX,s=i.viewY,h=this.preview.width*t,o=this.preview.height*e;h-=n,o-=s,this.pan({x:h,y:o})}},{key:"center",value:function(){var i=(this.preview.width-this.viewWidth)/2,t=(this.preview.height-this.viewHeight)/2;this.pan({x:i,y:t})}},{key:"pan",value:function(i){i=this.enforceXy(i),this.preview.pan(i.x,i.y),this.fireChange()}},{key:"enforceXy",value:function(i){var t=i.x,e=i.y;return t>this.preview.width-this.viewWidth&&(t=this.preview.width-this.viewWidth),t<0&&(t=0),e>this.preview.height-this.viewHeight&&(e=this.preview.height-this.viewHeight),e<0&&(e=0),{x:t,y:e}}},{key:"enforceZoom",value:function(i){var t=i.width,e=i.height;return null!=t&&this.maxImageWidth&&t>this.maxImageWidth?{width:this.maxImageWidth}:null!=t&&t<this.viewWidth?{width:this.viewWidth}:null!=e&&this.maxImageHeight&&e>this.maxImageHeight?{height:this.maxImageHeight}:null!=e&&e<this.viewHeight?{height:this.viewHeight}:{width:t,height:e}}},{key:"calcMaxMinDimensions",value:function(){this.maxWidth=this.min([this.arenaWidth,this.imageWidth]),this.maxHeight=this.min([this.arenaHeight,this.imageHeight]),this.minWidth=this.minViewWidth||0,this.minHeight=this.minViewHeight||0,this.fixedWidth&&(this.maxWidth=this.minWidth=this.fixedWidth),this.fixedHeight&&(this.maxHeight=this.minHeight=this.fixedHeight)}},{key:"areDimensionsValid",value:function(i){var t=i.width,e=i.height,n=(i.keepDimension,t/e);return!(t<this.minWidth||t>this.maxWidth||e<this.minHeight||e>this.maxHeight||n<this.minViewRatio||n>this.maxViewRatio)}},{key:"isValidRatio",value:function(i){return!(i<this.minViewRatio||i>this.maxViewRatio)}},{key:"enforceValidRatio",value:function(i){return i<this.minViewRatio?this.minViewRatio:i>this.maxViewRatio?this.maxViewRatio:i}},{key:"enforceViewDimensions",value:function(i){var t,e,n,s=i.width,h=i.height,o=i.keepDimension;if(s<this.minWidth&&(e=this.minWidth),s>this.maxWidth&&(e=this.maxWidth),h<this.minHeight&&(t=this.minHeight),h>this.maxHeight&&(t=this.maxHeight),o){if(e&&(s=e),t&&(h=t),n=s/h,!this.isValidRatio(n)){n=this.enforceValidRatio(n);var r=this.getRatioBox({ratio:n,width:s,height:h,keepDimension:o});if(s=r.width,h=r.height,s>this.arenaWidth||h>this.arenaHeight){var a=this.centerAlign(this.maxWidth,this.maxHeight,n);s=a.width,h=a.height}}}else if(e||t){n=this.enforceValidRatio(s/h);var u=this.centerAlign(this.maxWidth,this.maxHeight,n);s=u.width,h=u.height}return{width:s,height:h}}},{key:"enforceMaxArea",value:function(i){var t=i.width,e=i.height,n=i.keepDimension,s=t/e;return"width"===n?s=t/(e=this.maxArea/t):"height"===n?s=(t=this.maxArea/e)/e:e=(t=Math.sqrt(this.maxArea*s))/s,this.isValidRatio(s)||(s=this.enforceValidRatio(s),e=(t=Math.sqrt(this.maxArea*s))/s),{width:t,height:e}}},{key:"checkRatio",value:function(i){if(this.originalSize){var t=this.originalSize.width/this.originalSize.height,e=i.width/i.height,n=(e-t)/t*100;if(Math.abs(n)>1)throw new Error("srcissors: Displayed image has a different image ratio than the "+"one configured in 'originalRatio': ".concat(t," vs ").concat(e))}}},{key:"isWidthRestricting",value:function(){return this.viewRatio>=this.imageRatio}},{key:"getRatioBox",value:function(i){var t=i.ratio,e=i.width,n=i.height,s=i.keepDimension;return"width"===s||null==n?n=e/t:"height"===s||null==e?e=n*t:n=e/t,{width:e,height:n}}},{key:"centerAlign",value:function(i,t,e){var n,s,h,o;return i/t>e?h=(i-(s=t*e))/2:o=(t-(n=i/e))/2,{x:h||0,y:o||0,width:s||i,height:n||t}}},{key:"min",value:function(i){var t,e=i[0],n=function(i,t){var e="undefined"!=typeof Symbol&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=function(i,t){if(i){if("string"==typeof i)return s(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);return"Object"===e&&i.constructor&&(e=i.constructor.name),"Map"===e||"Set"===e?Array.from(i):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(i,t):void 0}}(i))||t&&i&&"number"==typeof i.length){e&&(i=e);var n=0,h=function(){};return{s:h,n:function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}},e:function(i){throw i},f:h}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,a=!1;return{s:function(){e=e.call(i)},n:function(){var i=e.next();return r=i.done,i},e:function(i){a=!0,o=i},f:function(){try{r||null==e.return||e.return()}finally{if(a)throw o}}}}(i);try{for(n.s();!(t=n.n()).done;){var h=t.value;h<e&&(e=h)}}catch(i){n.e(i)}finally{n.f()}return e}},{key:"on",value:function(i,t){return this["".concat(i,"Event")].add(t)}},{key:"off",value:function(i,t){return this["".concat(i,"Event")].remove(t)}},{key:"fireChange",value:function(){var i=this;null==this.changeDispatch&&(this.changeDispatch=setTimeout((function(){i.changeDispatch=void 0,i.changeEvent.fire(i.getCrop())}),0))}},{key:"debug",value:function(){var i=function(i){return Math.round(10*i)/10},t={arena:"".concat(i(this.arenaWidth),"x").concat(i(this.arenaHeight)),view:"".concat(i(this.viewWidth),"x").concat(i(this.viewHeight)),image:"".concat(i(this.imageWidth),"x").concat(i(this.imageHeight)),preview:"".concat(i(this.preview.width),"x").concat(i(this.preview.height)),previewXy:"".concat(i(this.preview.x),"x").concat(i(this.preview.y))};return console.log(t),t}}])&&h(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}()},21:(i,t,e)=>{function n(i){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(i){return typeof i}:function(i){return i&&"function"==typeof Symbol&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n(i)}function s(i,t){for(var e=0;e<t.length;e++){var s=t[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,(void 0,h=function(i,t){if("object"!==n(i)||null===i)return i;var e=i[Symbol.toPrimitive];if(void 0!==e){var s=e.call(i,"string");if("object"!==n(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}(s.key),"symbol"===n(h)?h:String(h)),s)}var h}var h=e(47),o=function(i){return i.type.includes("touch")?{pageX:i.originalEvent.changedTouches[0].pageX,pageY:i.originalEvent.changedTouches[0].pageY}:{pageX:i.pageX,pageY:i.pageY}};i.exports=function(){function i(t){var e=t.parent,n=t.view,s=(t.horizontal,t.vertical,t.actions);!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.parent=e,this.view=n,this.doubleClickThreshold=300,s.pan&&this.pan(),s.zoomOnDoubleClick&&this.doubleClick(),s.resize&&this.resizeView({horizontal:s.resizeHorizontal,vertical:s.resizeVertical}),this.preventBrowserDragDrop(),this.responsiveArena()}var t,e;return t=i,(e=[{key:"pan",value:function(){var i=this,t=h(document);this.view.on("mousedown.srcissors touchstart.srcissors",(function(e){var n={startX:i.parent.preview.x,startY:i.parent.preview.y};e.preventDefault(),t.on("mousemove.srcissors-pan touchmove.srcissors-pan",(function(t){var s=o(t),h=s.pageX,r=s.pageY,a=o(e),u=a.pageX,c=a.pageY;n.dx=h-u,n.dy=r-c,i.parent.onPan(n)})).on("mouseup.srcissors-pan touchend.srcissors-pan",(function(){t.off("mouseup.srcissors-pan touchend.srcissors-pan"),t.off("mousemove.srcissors-pan touchmove.srcissors-pan"),null!=n.dx&&i.parent.onPanEnd()}))}))}},{key:"doubleClick",value:function(){var i,t=this;this.view.on("mousedown.srcissors touchstart.srcissors",(function(e){var n=(new Date).getTime();i&&i>n-t.doubleClickThreshold&&t.parent.onDoubleClick(o(e)),i=n}))}},{key:"preventBrowserDragDrop",value:function(){this.view.on("dragstart.srcissors",(function(){return!1}))}},{key:"resizeView",value:function(i){var t=this,e=i.horizontal,n=i.vertical,s=h("<div>");s.addClass("resize-handler");var o=[];e&&(o=o.concat(["right","left"])),n&&(o=o.concat(["top","bottom"])),o.forEach((function(i){var e=s.clone();e.addClass("resize-handler-".concat(i)),e.on("mousedown.srcissors touchstart.srcissors",t.getResizeMouseDown(i)),t.view.append(e)}))}},{key:"getResizeMouseDown",value:function(i){var t=this,e=h(document);return function(n){var s=o(n),h=s.pageX,r=s.pageY;n.stopPropagation(),e.on("mousemove.srcissors-resize touchmove.srcissors-resize",(function(e){var n,s,a=o(e),u=a.pageX,c=a.pageY;switch(i){case"top":case"bottom":s=c-r,"top"===i&&(s=-s),r=c;break;case"left":case"right":n=u-h,"left"===i&&(n=-n),h=u}t.parent.onResize({position:i,dx:n,dy:s})})).on("mouseup.srcissors-resize touchend.srcissors-resize",(function(){e.off("mouseup.srcissors-resize touchmove.srcissors-resize"),e.off("mousemove.srcissors-resize touchend.srcissors-resize"),t.parent.onResizeEnd({position:i})}))}}},{key:"responsiveArena",value:function(){}}])&&s(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}()},289:(i,t,e)=>{function n(i){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(i){return typeof i}:function(i){return i&&"function"==typeof Symbol&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n(i)}function s(i,t){for(var e=0;e<t.length;e++){var s=t[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,(void 0,h=function(i,t){if("object"!==n(i)||null===i)return i;var e=i[Symbol.toPrimitive];if(void 0!==e){var s=e.call(i,"string");if("object"!==n(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}(s.key),"symbol"===n(h)?h:String(h)),s)}var h}var h=e(47);i.exports=function(){function i(t){var e=this,n=t.onReady,s=t.img,h=t.opacity,o=t.outline;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.onReady=n,this.img=s,this.opacity=h,this.outline=o,this.x=this.y=0,this.width=this.height=0,this.img.on("load",(function(){var i=e.img.width(),t=e.img.height();e.ratio=i/t,e.onReady({width:i,height:t}),e.img.show()}))}var t,e;return t=i,(e=[{key:"setImage",value:function(i){var t=i.url;this.url=t,this.img.attr("src",this.url),this.outline&&this.setBackgroundImage({url:this.url})}},{key:"setBackgroundImage",value:function(i){var t=i.url;if(this.opacity>0){var e=h("<img>").css({opacity:this.opacity}).attr("src",t);this.outline.append(e)}}},{key:"reset",value:function(){this.url=void 0,this.x=this.y=0,this.width=this.height=0,this.img.attr("src",""),this.img.css({width:"",height:"",transform:""}),this.outline&&this.outline.css({transform:""}).html("")}},{key:"setWidth",value:function(i){this.img.css({width:"".concat(i,"px"),height:"auto"});var t=i/this.ratio;this.updateImageDimensions({width:i,height:t})}},{key:"setHeight",value:function(i){this.img.css({width:"auto",height:"".concat(i,"px")});var t=i*this.ratio;this.updateImageDimensions({width:t,height:i})}},{key:"updateImageDimensions",value:function(i){var t=i.width,e=i.height;this.width=t,this.height=e,this.outline&&this.outline.css({width:"".concat(this.width,"px"),height:"".concat(this.height,"px")})}},{key:"pan",value:function(i,t){this.x=i,this.y=t;var e=Math.round(this.x),n=Math.round(this.y);this.img.css({transform:"translate(-".concat(e,"px, -").concat(n,"px)")}),this.outline&&this.outline.css({transform:"translate(-".concat(e,"px, -").concat(n,"px)")})}}])&&s(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}()},505:(i,t,e)=>{var n=e(47),s=e(490);i.exports={new:function(i){var t=i.arena,e=i.url,h=i.fixedWidth,o=i.fixedHeight,r=i.minWidth,a=i.minHeight,u=i.minRatio,c=i.maxRatio,l=i.maxArea,g=i.originalSize,v=i.zoomStep,d=i.crop,m=i.actions,p=i.minResolution,f=i.surroundingImageOpacity,w=i.showSurroundingImage,y=(t=n(t)).find(".crop-view"),x=y.find(".crop-preview"),b=n("<img>");x.append(b);var k=y.find(".crop-outline");k.length||(k=void 0);var R={pan:!0,zoomOnDoubleClick:!0,resize:!0,resizeHorizontal:!h,resizeVertical:!o};return n.extend(R,m),null==v&&(v=1.25),null==r&&(r=50),null==a&&(a=50),new s({url:e,crop:d,arena:t,view:y,img:b,outline:k,showSurroundingImage:w,surroundingImageOpacity:f,fixedWidth:h,fixedHeight:o,minViewWidth:r,minViewHeight:a,minViewRatio:u,maxViewRatio:c,maxArea:l,originalSize:g,zoomStep:v,actions:R,minResolution:p})}}},47:t=>{t.exports=i}},e={};return function i(n){var s=e[n];if(void 0!==s)return s.exports;var h=e[n]={exports:{}};return t[n](h,h.exports,i),h.exports}(505)})()));
//# sourceMappingURL=srcissors.js.map