vue-advanced-cropper
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -48,3 +48,3 @@ import Vue from"vue";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n,o=0;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t],o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var classnames=createCommonjsModule(function(e){/*! | ||
function defaultPosition(e,t,i,n,o,a){return{left:o/2-i/2,top:a/2-n/2}}// eslint-disable-next-line no-unused-vars | ||
function defaultSize(e,t,i){var o,a,n=Math.max,s=i.maxWidth,r=i.maxHeight,c=i.minWidth,l=i.minHeight;return r>s?(o=n(l,.8*r),a=n(c,.8*s)):(a=n(c,.8*s),o=n(l,.8*r)),{height:o,width:a}}function percentRestrictions(e,t,i,n,o,a){return{minWidth:e/100*o,minHeight:t/100*a,maxWidth:i?i/100*o:o,maxHeight:n?n/100*a:a}}var cn$9=easyBem("vue-advanced-cropper"),script$a={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:resize},moveAlgorithm:{type:Function,default:move},defaultSize:{type:Function,default:defaultSize},defaultPosition:{type:Function,default:defaultPosition},areaSize:{type:Function,default:areaSize},restrictions:{type:Function,default:percentRestrictions},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return RectangleStencil}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:classnames(cn$9(),this.classname),image:classnames(cn$9("image"),this.imageClassname),area:classnames(cn$9("area"),this.areaClassname),stretcher:classnames(cn$9("stretcher")),background:classnames(cn$9("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,o=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:o/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+getStyleTransforms(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),console.log(e,_objectSpread({},this.imageAttributes),this.coefficient,_objectSpread({},this.boundarySize),_objectSpread({},this.imageSize)),e},stencilRestrictions:function(){var e=this.restrictions(+this.minWidth,+this.minHeight,+this.maxWidth,+this.maxHeight,this.imageSize.width,this.imageSize.height);return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){var e=this;Vue.nextTick(function(){e.onChangeImage()})},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){this.debouncedUpdate=debounce_1(this.update,this.debounce),this.src&&this.onChangeImage(),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage)},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods | ||
function defaultSize(e,t,i){var o,a,n=Math.max,s=i.maxWidth,r=i.maxHeight,c=i.minWidth,l=i.minHeight;return r>s?(o=n(l,.8*r),a=n(c,.8*s)):(a=n(c,.8*s),o=n(l,.8*r)),{height:o,width:a}}function percentRestrictions(e,t,i,n,o,a){return{minWidth:e/100*o,minHeight:t/100*a,maxWidth:i?i/100*o:o,maxHeight:n?n/100*a:a}}var cn$9=easyBem("vue-advanced-cropper"),script$a={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:resize},moveAlgorithm:{type:Function,default:move},defaultSize:{type:Function,default:defaultSize},defaultPosition:{type:Function,default:defaultPosition},areaSize:{type:Function,default:areaSize},restrictions:{type:Function,default:percentRestrictions},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return RectangleStencil}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:classnames(cn$9(),this.classname),image:classnames(cn$9("image"),this.imageClassname),area:classnames(cn$9("area"),this.areaClassname),stretcher:classnames(cn$9("stretcher")),background:classnames(cn$9("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,o=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:o/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+getStyleTransforms(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),e},stencilRestrictions:function(){var e=this.restrictions(+this.minWidth,+this.minHeight,+this.maxWidth,+this.maxHeight,this.imageSize.width,this.imageSize.height);return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){var e=this;Vue.nextTick(function(){e.onChangeImage()})},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){this.debouncedUpdate=debounce_1(this.update,this.debounce),this.src&&this.onChangeImage(),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage)},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods | ||
getResult:function(){return this.canvas?(this.updateCanvas(this.coordinates),{coordinates:_objectSpread({},this.coordinates),canvas:this.$refs.canvas}):{coordinates:_objectSpread({},this.coordinates)}},// Internal methods | ||
@@ -55,3 +55,3 @@ getArea:function(){return this.$refs.area},getStencil:function(){return this.$refs.stencil},updateCanvas:function(e){// This function can be asynchronously called because it's debounced | ||
// Therefore there is a workaround to prevent processing after the component was unmounted | ||
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,o=n.minWidth,a=n.minHeight,s=n.maxWidth,r=n.maxHeight,c=n.widthFrozen,l=n.heightFrozen;this.frozenDirections.width=!!c,this.frozenDirections.height=!!l;var h=this.defaultSize(t,i,this.stencilRestrictions,this.$props);(h.width<o||h.height<a||h.width>s||h.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function"),this.setCoordinates([h,function(n){return _objectSpread({},e.defaultPosition(t,i,n.width,n.height,e.imageSize.width,e.imageSize.height,e.$props))}]),this.imageLoaded=!0}},refreshImage:function(){var e=this,t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var o=e.areaSize(i,n,e.imageSize.width,e.imageSize.height),a=o.height,s=o.width;a&&(e.boundarySize.height=a),s&&(e.boundarySize.width=s),console.log("\u041E\u0431\u043D\u043E\u0432\u0438\u043B \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435",e.imageLoaded),t()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}};/* script */const __vue_script__$a=script$a;/* template */var __vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];__vue_render__$a._withStripped=!0;/* style */const __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1;/* scoped */ /* component normalizer */function __vue_normalize__$a(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,o=n.minWidth,a=n.minHeight,s=n.maxWidth,r=n.maxHeight,c=n.widthFrozen,l=n.heightFrozen;this.frozenDirections.width=!!c,this.frozenDirections.height=!!l;var h=this.defaultSize(t,i,this.stencilRestrictions,this.$props);(h.width<o||h.height<a||h.width>s||h.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function"),this.setCoordinates([h,function(n){return _objectSpread({},e.defaultPosition(t,i,n.width,n.height,e.imageSize.width,e.imageSize.height,e.$props))}]),this.imageLoaded=!0}},refreshImage:function(){var e=this,t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var o=e.areaSize(i,n,e.imageSize.width,e.imageSize.height),a=o.height,s=o.width;a&&(e.boundarySize.height=a),s&&(e.boundarySize.width=s),t()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}};/* script */const __vue_script__$a=script$a;/* template */var __vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];__vue_render__$a._withStripped=!0;/* style */const __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1;/* scoped */ /* component normalizer */function __vue_normalize__$a(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\Cropper.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}/* style inject */ /* style inject SSR */var Cropper=__vue_normalize__$a({render:__vue_render__$a,staticRenderFns:__vue_staticRenderFns__$a},void 0,__vue_script__$a,__vue_scope_id__$a,__vue_is_functional_template__$a,__vue_module_identifier__$a,void 0,void 0),cn$a=easyBem("vue-preview-image"),script$b={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:classnames(cn$a(),this.classname),image:classnames(cn$a("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}};/* script */const __vue_script__$b=script$b;/* template */var __vue_render__$b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},__vue_staticRenderFns__$b=[];__vue_render__$b._withStripped=!0;/* style */const __vue_inject_styles__$b=void 0,__vue_scope_id__$b=void 0,__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1;/* scoped */ /* component normalizer */function __vue_normalize__$b(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
@@ -88,2 +88,2 @@ return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\helpers\\PreviewImage.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}/* style inject */ /* style inject SSR */var PreviewImage=__vue_normalize__$b({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},void 0,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,void 0,void 0);Vue.component("cropper",Cropper),Vue.component("rectangle-stencil",RectangleStencil),Vue.component("circle-stencil",CircleStencil),Vue.component("simple-handler",SimpleHandler),Vue.component("simple-line",SimpleLine);export{BoundingBox,CircleStencil,Cropper,DragEvent,DraggableArea,DraggableElement,HandlerWrapper,LineWrapper,MoveEvent,PreviewImage,PreviewResult,RectangleStencil,ResizeEvent,SimpleHandler,SimpleLine}; | ||
}; | ||
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */");//# sourceMappingURL=index.es.js.map | ||
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */");//# sourceMappingURL=index.es.js.map |
@@ -48,3 +48,3 @@ 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}var Vue=_interopDefault(require("vue"));function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n,o=0;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t],o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var classnames=createCommonjsModule(function(e){/*! | ||
function defaultPosition(e,t,i,n,o,a){return{left:o/2-i/2,top:a/2-n/2}}// eslint-disable-next-line no-unused-vars | ||
function defaultSize(e,t,i){var o,a,n=Math.max,s=i.maxWidth,r=i.maxHeight,c=i.minWidth,l=i.minHeight;return r>s?(o=n(l,.8*r),a=n(c,.8*s)):(a=n(c,.8*s),o=n(l,.8*r)),{height:o,width:a}}function percentRestrictions(e,t,i,n,o,a){return{minWidth:e/100*o,minHeight:t/100*a,maxWidth:i?i/100*o:o,maxHeight:n?n/100*a:a}}var cn$9=easyBem("vue-advanced-cropper"),script$a={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:resize},moveAlgorithm:{type:Function,default:move},defaultSize:{type:Function,default:defaultSize},defaultPosition:{type:Function,default:defaultPosition},areaSize:{type:Function,default:areaSize},restrictions:{type:Function,default:percentRestrictions},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return RectangleStencil}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:classnames(cn$9(),this.classname),image:classnames(cn$9("image"),this.imageClassname),area:classnames(cn$9("area"),this.areaClassname),stretcher:classnames(cn$9("stretcher")),background:classnames(cn$9("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,o=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:o/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+getStyleTransforms(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),console.log(e,_objectSpread({},this.imageAttributes),this.coefficient,_objectSpread({},this.boundarySize),_objectSpread({},this.imageSize)),e},stencilRestrictions:function(){var e=this.restrictions(+this.minWidth,+this.minHeight,+this.maxWidth,+this.maxHeight,this.imageSize.width,this.imageSize.height);return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){var e=this;Vue.nextTick(function(){e.onChangeImage()})},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){this.debouncedUpdate=debounce_1(this.update,this.debounce),this.src&&this.onChangeImage(),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage)},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods | ||
function defaultSize(e,t,i){var o,a,n=Math.max,s=i.maxWidth,r=i.maxHeight,c=i.minWidth,l=i.minHeight;return r>s?(o=n(l,.8*r),a=n(c,.8*s)):(a=n(c,.8*s),o=n(l,.8*r)),{height:o,width:a}}function percentRestrictions(e,t,i,n,o,a){return{minWidth:e/100*o,minHeight:t/100*a,maxWidth:i?i/100*o:o,maxHeight:n?n/100*a:a}}var cn$9=easyBem("vue-advanced-cropper"),script$a={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:resize},moveAlgorithm:{type:Function,default:move},defaultSize:{type:Function,default:defaultSize},defaultPosition:{type:Function,default:defaultPosition},areaSize:{type:Function,default:areaSize},restrictions:{type:Function,default:percentRestrictions},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return RectangleStencil}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:classnames(cn$9(),this.classname),image:classnames(cn$9("image"),this.imageClassname),area:classnames(cn$9("area"),this.areaClassname),stretcher:classnames(cn$9("stretcher")),background:classnames(cn$9("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,o=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:o/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+getStyleTransforms(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),e},stencilRestrictions:function(){var e=this.restrictions(+this.minWidth,+this.minHeight,+this.maxWidth,+this.maxHeight,this.imageSize.width,this.imageSize.height);return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){var e=this;Vue.nextTick(function(){e.onChangeImage()})},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){this.debouncedUpdate=debounce_1(this.update,this.debounce),this.src&&this.onChangeImage(),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage)},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods | ||
getResult:function(){return this.canvas?(this.updateCanvas(this.coordinates),{coordinates:_objectSpread({},this.coordinates),canvas:this.$refs.canvas}):{coordinates:_objectSpread({},this.coordinates)}},// Internal methods | ||
@@ -55,3 +55,3 @@ getArea:function(){return this.$refs.area},getStencil:function(){return this.$refs.stencil},updateCanvas:function(e){// This function can be asynchronously called because it's debounced | ||
// Therefore there is a workaround to prevent processing after the component was unmounted | ||
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,o=n.minWidth,a=n.minHeight,s=n.maxWidth,r=n.maxHeight,c=n.widthFrozen,l=n.heightFrozen;this.frozenDirections.width=!!c,this.frozenDirections.height=!!l;var h=this.defaultSize(t,i,this.stencilRestrictions,this.$props);(h.width<o||h.height<a||h.width>s||h.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function"),this.setCoordinates([h,function(n){return _objectSpread({},e.defaultPosition(t,i,n.width,n.height,e.imageSize.width,e.imageSize.height,e.$props))}]),this.imageLoaded=!0}},refreshImage:function(){var e=this,t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var o=e.areaSize(i,n,e.imageSize.width,e.imageSize.height),a=o.height,s=o.width;a&&(e.boundarySize.height=a),s&&(e.boundarySize.width=s),console.log("\u041E\u0431\u043D\u043E\u0432\u0438\u043B \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435",e.imageLoaded),t()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}};/* script */const __vue_script__$a=script$a;/* template */var __vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];__vue_render__$a._withStripped=!0;/* style */const __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1;/* scoped */ /* component normalizer */function __vue_normalize__$a(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,o=n.minWidth,a=n.minHeight,s=n.maxWidth,r=n.maxHeight,c=n.widthFrozen,l=n.heightFrozen;this.frozenDirections.width=!!c,this.frozenDirections.height=!!l;var h=this.defaultSize(t,i,this.stencilRestrictions,this.$props);(h.width<o||h.height<a||h.width>s||h.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function"),this.setCoordinates([h,function(n){return _objectSpread({},e.defaultPosition(t,i,n.width,n.height,e.imageSize.width,e.imageSize.height,e.$props))}]),this.imageLoaded=!0}},refreshImage:function(){var e=this,t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var o=e.areaSize(i,n,e.imageSize.width,e.imageSize.height),a=o.height,s=o.width;a&&(e.boundarySize.height=a),s&&(e.boundarySize.width=s),t()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}};/* script */const __vue_script__$a=script$a;/* template */var __vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];__vue_render__$a._withStripped=!0;/* style */const __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1;/* scoped */ /* component normalizer */function __vue_normalize__$a(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\Cropper.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}/* style inject */ /* style inject SSR */var Cropper=__vue_normalize__$a({render:__vue_render__$a,staticRenderFns:__vue_staticRenderFns__$a},void 0,__vue_script__$a,__vue_scope_id__$a,__vue_is_functional_template__$a,__vue_module_identifier__$a,void 0,void 0),cn$a=easyBem("vue-preview-image"),script$b={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:classnames(cn$a(),this.classname),image:classnames(cn$a("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}};/* script */const __vue_script__$b=script$b;/* template */var __vue_render__$b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},__vue_staticRenderFns__$b=[];__vue_render__$b._withStripped=!0;/* style */const __vue_inject_styles__$b=void 0,__vue_scope_id__$b=void 0,__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1;/* scoped */ /* component normalizer */function __vue_normalize__$b(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
@@ -88,2 +88,2 @@ return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\helpers\\PreviewImage.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}/* style inject */ /* style inject SSR */var PreviewImage=__vue_normalize__$b({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},void 0,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,void 0,void 0);Vue.component("cropper",Cropper),Vue.component("rectangle-stencil",RectangleStencil),Vue.component("circle-stencil",CircleStencil),Vue.component("simple-handler",SimpleHandler),Vue.component("simple-line",SimpleLine),exports.BoundingBox=BoundingBox,exports.CircleStencil=CircleStencil,exports.Cropper=Cropper,exports.DragEvent=DragEvent,exports.DraggableArea=DraggableArea,exports.DraggableElement=DraggableElement,exports.HandlerWrapper=HandlerWrapper,exports.LineWrapper=LineWrapper,exports.MoveEvent=MoveEvent,exports.PreviewImage=PreviewImage,exports.PreviewResult=PreviewResult,exports.RectangleStencil=RectangleStencil,exports.ResizeEvent=ResizeEvent,exports.SimpleHandler=SimpleHandler,exports.SimpleLine=SimpleLine; | ||
}; | ||
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */");//# sourceMappingURL=index.js.map | ||
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */");//# sourceMappingURL=index.js.map |
@@ -15,6 +15,6 @@ (function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):(e=e||self,t(e["vue-advanced-cropper"]={},e.Vue))})(this,function(e,t){'use strict';var R=Math.max,D=Math.min;function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n,o=0;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function o(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t],o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){a(e,t,n[t])})}return e}function r(e){return c(e)||l(e)||h()}function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function l(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance")}/** | ||
*/function d(e,t,i){function n(){var l=Date.now()-r;l<t&&0<=l?o=setTimeout(n,t-l):(o=null,!i&&(c=e.apply(s,a),s=a=null))}var o,a,s,r,c;null==t&&(t=100);var l=function(){s=this,a=arguments,r=Date.now();var l=i&&!o;return o||(o=setTimeout(n,t)),l&&(c=e.apply(s,a),s=a=null),c};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(c=e.apply(s,a),s=a=null,clearTimeout(o),o=null)},l}// Adds compatibility for ES modules | ||
function m(e,t){var i,n;return e&&t?(i="".concat(e).concat(t[0].toUpperCase()).concat(t.slice(1)),n="".concat(e,"-").concat(t)):(i=e||t,n=e||t),{name:i,classname:n}}function p(e){if(/^data:/.test(e)||/^blob:/.test(e))return!1;var t=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,n=i.exec(e)||[],o={protocol:n[1]||"",host:n[2]||"",port:n[3]||""},a=function(e){return{"http:":80,"https:":443}[e]},s=function(e){return e.port||a(e.protocol||t.protocol)};return(o.protocol||o.host||o.port)&&!!!(o.protocol&&o.protocol==t.protocol&&o.host&&o.host==t.host&&o.host&&s(o)==s(t))}function g(e){var t="timestamp=".concat(new Date().getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function u(e,t,i){var n=Math.PI,o=i.flipped,a=i.orientation,s=t.naturalWidth,r=t.naturalHeight,c=e.getContext("2d");return e.width=s,e.height=r,c.save(),o&&(e.width=r,e.height=s),2==a?(c.translate(s,0),c.scale(-1,1)):3==a?(c.translate(s,r),c.rotate(1*n)):4==a?(c.translate(0,r),c.scale(1,-1)):5==a?(c.rotate(90/180*n),c.scale(1,-1)):6==a?(c.rotate(90/180*n),c.translate(0,-r)):7==a?(c.rotate(270/180*n),c.translate(-s,r),c.scale(1,-1)):8==a&&(c.translate(0,s),c.rotate(270/180*n)),c.drawImage(t,0,0,s,r),c.restore(),e}function f(e){var t={orientation:e};return e&&(2===e?t.scaleX=-1:3===e?t.rotate=-180:4===e?t.scaleY=-1:5===e?(t.rotate=90,t.scaleY=-1):6===e?t.rotate=90:7===e?(t.rotate=90,t.scaleX=-1):8===e?t.rotate=-90:void 0),(90===t.rotate||-90===t.rotate)&&(t.flipped=!0),t}function v(e){var t=e.rotate,i=e.scaleX,n=e.scaleY,o="";return(t||i||n)&&(t&&(o+=" rotate(".concat(t,"deg) ")),i&&(o+=" scaleX(".concat(i,") ")),n&&(o+=" scaleY(".concat(n,") "))),o}function w(e){return new Promise(function(t){y(e).then(function(e){t(e?z(e):{arrayBuffer:null,orientation:null})}).catch(function(e){console.warn(e),t({arrayBuffer:null,orientation:null})})})}function y(e){return new Promise(function(t,i){try{if(!e)i("Error: the image is empty");else// Data URL | ||
if(/^data:/i.test(e))t(x(e));else if(/^blob:/i.test(e)){var n=new FileReader;n.onload=function(i){t(i.target.result)},C(e,function(e){n.readAsArrayBuffer(e)})}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){4!==this.readyState||(200===this.status||0===this.status?t(this.response):i("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){"image/jpeg"!==o.getResponseHeader("content-type")&&o.abort()},o.withCredentials=!1,o.open("GET",e,!0),o.responseType="arraybuffer",o.send(null)}}catch(t){i(t)}})}function C(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=function(){(200==this.status||0===this.status)&&t(this.response)},i.send()}function x(e){e=e.replace(/^data:([^;]+);base64,/gmi,"");for(var t=atob(e),n=t.length,o=new ArrayBuffer(n),a=new Uint8Array(o),s=0;s<n;s++)a[s]=t.charCodeAt(s);return o}function b(e,t,n){var o,a="";for(o=t,n+=t;o<n;o++)a+=String.fromCharCode(e.getUint8(o));return a}function z(e){var t,n,o,a,s,r,c,l,h,d=new DataView(e),m=d.byteLength;// Only handle JPEG image (start by 0xFFD8) | ||
if(255===d.getUint8(0)&&216===d.getUint8(1))for(h=2;h<m;){if(255===d.getUint8(h)&&225===d.getUint8(h+1)){c=h;break}h++}if(c&&(n=c+4,o=c+10,"Exif"===b(d,n,4)&&(r=d.getUint16(o),s=18761===r,(s||19789===r/* bigEndian */)&&42===d.getUint16(o+2,s)&&(a=d.getUint32(o+4,s),8<=a&&(l=o+a)))),l){m=d.getUint16(l,s);for(var p=0;p<m;p++)if(h=l+12*p+2,274===d.getUint16(h,s)/* Orientation */){h+=8,t=d.getUint16(h,s);break}}return t}function S(e,t,i){return e.width+i*(t.left+t.right)}function _(e,t,i){return e.height+i*(t.top+t.bottom)}function E(e,t,i,n,o,a){var r=Math.abs,c=Math.floor,l=Math.ceil,h=i.minHeight,d=i.minWidth,m=i.maxHeight,p=i.maxWidth,g=s({},e),u=S(t,g,n),f=_(t,g,n);0>u&&(0>g.left&&0>g.right?(g.left=-(t.width-d)/(g.left/g.right),g.right=-(t.width-d)/(g.right/g.left)):0>g.left?g.left=-(t.width-d)/n:0>g.right&&(g.right=-(t.width-d)/n)),0>f&&(0>g.top&&0>g.bottom?(g.top=-(t.height-h)/(g.top/g.bottom),g.bottom=-(t.height-h)/(g.bottom/g.top)):0>g.top?g.top=-(t.height-h):0>g.bottom&&(g.bottom=-(t.height-h)));var v={width:1/0,height:1/0};// If ratio is not broken, resize all directions independently | ||
if(g.right+g.left&&(l(t.left+t.width+n*g.right)>o.width&&(v.width=D(v.width,r(c(o.width-(t.left+t.width))/(n*g.right)))),0>t.left-n*g.left&&(v.width=D(v.width,r(t.left/(n*g.left)))),u<d&&(v.width=D(v.width,r((t.width-d)/((g.right+g.left)*n)))),u>p&&(v.width=D(v.width,r((p-t.width)/((g.right+g.left)*n))))),g.top+g.bottom&&(l(t.top+t.height+n*g.bottom)>o.height&&(v.height=D(v.height,r(c(o.height-(t.top+t.height))/(n*g.bottom)))),0>t.top-n*g.top&&(v.height=D(v.height,r(t.top/(n*g.top)))),f<h&&(v.height=D(v.height,r((t.height-h)/((g.top+g.bottom)*n)))),f>m&&(v.height=D(v.height,r((m-t.height)/((g.top+g.bottom)*n))))),!a)v.width!==1/0&&ee.forEach(function(e){g[e]*=v.width}),v.height!==1/0&&te.forEach(function(e){g[e]*=v.height});else{var w;v.height<v.width?w=v.height:g.right+g.left&&(w=v.width),(v.height!==1/0||v.width!==1/0)&&ie.forEach(function(e){g[e]*=w})}return g}t=t&&t.hasOwnProperty("default")?t["default"]:t;var H=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){/*! | ||
function p(e,t){var i,n;return e&&t?(i="".concat(e).concat(t[0].toUpperCase()).concat(t.slice(1)),n="".concat(e,"-").concat(t)):(i=e||t,n=e||t),{name:i,classname:n}}function m(e){if(/^data:/.test(e)||/^blob:/.test(e))return!1;var t=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,n=i.exec(e)||[],o={protocol:n[1]||"",host:n[2]||"",port:n[3]||""},a=function(e){return{"http:":80,"https:":443}[e]},s=function(e){return e.port||a(e.protocol||t.protocol)};return(o.protocol||o.host||o.port)&&!!!(o.protocol&&o.protocol==t.protocol&&o.host&&o.host==t.host&&o.host&&s(o)==s(t))}function g(e){var t="timestamp=".concat(new Date().getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function u(e,t,i){var n=Math.PI,o=i.flipped,a=i.orientation,s=t.naturalWidth,r=t.naturalHeight,c=e.getContext("2d");return e.width=s,e.height=r,c.save(),o&&(e.width=r,e.height=s),2==a?(c.translate(s,0),c.scale(-1,1)):3==a?(c.translate(s,r),c.rotate(1*n)):4==a?(c.translate(0,r),c.scale(1,-1)):5==a?(c.rotate(90/180*n),c.scale(1,-1)):6==a?(c.rotate(90/180*n),c.translate(0,-r)):7==a?(c.rotate(270/180*n),c.translate(-s,r),c.scale(1,-1)):8==a&&(c.translate(0,s),c.rotate(270/180*n)),c.drawImage(t,0,0,s,r),c.restore(),e}function f(e){var t={orientation:e};return e&&(2===e?t.scaleX=-1:3===e?t.rotate=-180:4===e?t.scaleY=-1:5===e?(t.rotate=90,t.scaleY=-1):6===e?t.rotate=90:7===e?(t.rotate=90,t.scaleX=-1):8===e?t.rotate=-90:void 0),(90===t.rotate||-90===t.rotate)&&(t.flipped=!0),t}function v(e){var t=e.rotate,i=e.scaleX,n=e.scaleY,o="";return(t||i||n)&&(t&&(o+=" rotate(".concat(t,"deg) ")),i&&(o+=" scaleX(".concat(i,") ")),n&&(o+=" scaleY(".concat(n,") "))),o}function w(e){return new Promise(function(t){y(e).then(function(e){t(e?z(e):{arrayBuffer:null,orientation:null})}).catch(function(e){console.warn(e),t({arrayBuffer:null,orientation:null})})})}function y(e){return new Promise(function(t,i){try{if(!e)i("Error: the image is empty");else// Data URL | ||
if(/^data:/i.test(e))t(x(e));else if(/^blob:/i.test(e)){var n=new FileReader;n.onload=function(i){t(i.target.result)},C(e,function(e){n.readAsArrayBuffer(e)})}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){4!==this.readyState||(200===this.status||0===this.status?t(this.response):i("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){"image/jpeg"!==o.getResponseHeader("content-type")&&o.abort()},o.withCredentials=!1,o.open("GET",e,!0),o.responseType="arraybuffer",o.send(null)}}catch(t){i(t)}})}function C(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=function(){(200==this.status||0===this.status)&&t(this.response)},i.send()}function x(e){e=e.replace(/^data:([^;]+);base64,/gmi,"");for(var t=atob(e),n=t.length,o=new ArrayBuffer(n),a=new Uint8Array(o),s=0;s<n;s++)a[s]=t.charCodeAt(s);return o}function b(e,t,n){var o,a="";for(o=t,n+=t;o<n;o++)a+=String.fromCharCode(e.getUint8(o));return a}function z(e){var t,n,o,a,s,r,c,l,h,d=new DataView(e),p=d.byteLength;// Only handle JPEG image (start by 0xFFD8) | ||
if(255===d.getUint8(0)&&216===d.getUint8(1))for(h=2;h<p;){if(255===d.getUint8(h)&&225===d.getUint8(h+1)){c=h;break}h++}if(c&&(n=c+4,o=c+10,"Exif"===b(d,n,4)&&(r=d.getUint16(o),s=18761===r,(s||19789===r/* bigEndian */)&&42===d.getUint16(o+2,s)&&(a=d.getUint32(o+4,s),8<=a&&(l=o+a)))),l){p=d.getUint16(l,s);for(var m=0;m<p;m++)if(h=l+12*m+2,274===d.getUint16(h,s)/* Orientation */){h+=8,t=d.getUint16(h,s);break}}return t}function S(e,t,i){return e.width+i*(t.left+t.right)}function _(e,t,i){return e.height+i*(t.top+t.bottom)}function E(e,t,i,n,o,a){var r=Math.abs,c=Math.floor,l=Math.ceil,h=i.minHeight,d=i.minWidth,p=i.maxHeight,m=i.maxWidth,g=s({},e),u=S(t,g,n),f=_(t,g,n);0>u&&(0>g.left&&0>g.right?(g.left=-(t.width-d)/(g.left/g.right),g.right=-(t.width-d)/(g.right/g.left)):0>g.left?g.left=-(t.width-d)/n:0>g.right&&(g.right=-(t.width-d)/n)),0>f&&(0>g.top&&0>g.bottom?(g.top=-(t.height-h)/(g.top/g.bottom),g.bottom=-(t.height-h)/(g.bottom/g.top)):0>g.top?g.top=-(t.height-h):0>g.bottom&&(g.bottom=-(t.height-h)));var v={width:1/0,height:1/0};// If ratio is not broken, resize all directions independently | ||
if(g.right+g.left&&(l(t.left+t.width+n*g.right)>o.width&&(v.width=D(v.width,r(c(o.width-(t.left+t.width))/(n*g.right)))),0>t.left-n*g.left&&(v.width=D(v.width,r(t.left/(n*g.left)))),u<d&&(v.width=D(v.width,r((t.width-d)/((g.right+g.left)*n)))),u>m&&(v.width=D(v.width,r((m-t.width)/((g.right+g.left)*n))))),g.top+g.bottom&&(l(t.top+t.height+n*g.bottom)>o.height&&(v.height=D(v.height,r(c(o.height-(t.top+t.height))/(n*g.bottom)))),0>t.top-n*g.top&&(v.height=D(v.height,r(t.top/(n*g.top)))),f<h&&(v.height=D(v.height,r((t.height-h)/((g.top+g.bottom)*n)))),f>p&&(v.height=D(v.height,r((p-t.height)/((g.top+g.bottom)*n))))),!a)v.width!==1/0&&ee.forEach(function(e){g[e]*=v.width}),v.height!==1/0&&te.forEach(function(e){g[e]*=v.height});else{var w;v.height<v.width?w=v.height:g.right+g.left&&(w=v.width),(v.height!==1/0||v.width!==1/0)&&ie.forEach(function(e){g[e]*=w})}return g}t=t&&t.hasOwnProperty("default")?t["default"]:t;var H=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){/*! | ||
Copyright (c) 2017 Jed Watson. | ||
@@ -36,22 +36,22 @@ Licensed under the MIT License (MIT), see | ||
*/d.debounce=d;var P=function e(t,n,o){i(this,e),this.nativeEvent=t,this.directions=n,this.params=o},L=function e(t,n){i(this,e),this.nativeEvent=t,this.directions=n},M=/*#__PURE__*/function(){function e(t,n,o,a,s){i(this,e),this.nativeEvent=t,this.position=o,this.previousPosition=a,this.element=n,this.anchor=s}return o(e,[{key:"shift",value:function(){var e=this.element,t=this.anchor,i=this.position,n=e.getBoundingClientRect(),o=n.left,a=n.top;return{left:i.left-o-t.left,top:i.top-a-t.top}}}]),e}(),W={name:"DraggableElement",mixins:[{beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error("You should add ref \"draggable\" to your root element to use draggable mixin");this.touches=[],this.draggingAnchor=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&(this.touches=r(t.touches),!this.hovered&&this.$emit("enter"),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.draggable,i=t.getBoundingClientRect(),n=i.left,o=i.right,a=i.bottom,s=i.top;this.anchor={left:e.clientX-n,top:e.clientY-s,bottom:a-e.clientY,right:o-e.clientX}},processMove:function(e,t){var i=r(t);if(this.touches.length){if(1===this.touches.length&&1===i.length){var n=this.$refs.draggable;this.$emit("drag",new M(e,n,{left:i[0].clientX,top:i[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=i}},processEnd:function(){this.touches=[],this.hovered&&(this.$emit("leave"),this.hovered=!1)}}}],props:{classname:{type:String}}};/* template */var A=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"draggable",class:e.classname,on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown,mouseover:e.onMouseOver,mouseleave:e.onMouseLeave}},[e._t("default")],2)};A._withStripped=!0;/* style inject */ /* style inject SSR */var I=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\DraggableElement.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:A,staticRenderFns:[]},void 0,W,void 0,!1,void 0,void 0,void 0),F=$("vue-handler-wrapper"),T={name:"HandlerWrapper",components:{DraggableElement:I},props:{horizontalPosition:{type:String},verticalPosition:{type:String},classname:{type:String}},computed:{classnames:function(){var e;if(this.horizontalPosition||this.verticalPosition){var t=m(this.horizontalPosition,this.verticalPosition);e=H(this.classname,F(a({},t.classname,!0)))}else e=H(this.classname,F());return{default:e,draggable:F("draggable")}}}};/* template */var Y=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("DraggableElement",{class:e.classnames.draggable,on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)],1)};Y._withStripped=!0;/* style inject */ /* style inject SSR */var X=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\DraggableElement.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:A,staticRenderFns:[]},void 0,W,void 0,!1,void 0,void 0,void 0),F=$("vue-handler-wrapper"),T={name:"HandlerWrapper",components:{DraggableElement:I},props:{horizontalPosition:{type:String},verticalPosition:{type:String},classname:{type:String}},computed:{classnames:function(){var e;if(this.horizontalPosition||this.verticalPosition){var t=p(this.horizontalPosition,this.verticalPosition);e=H(this.classname,F(a({},t.classname,!0)))}else e=H(this.classname,F());return{default:e,draggable:F("draggable")}}}};/* template */var Y=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("DraggableElement",{class:e.classnames.draggable,on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)],1)};Y._withStripped=!0;/* style inject */ /* style inject SSR */var X=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\HandlerWrapper.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:Y,staticRenderFns:[]},void 0,T,void 0,!1,void 0,void 0,void 0),k=$("vue-line-wrapper"),B={name:"LineWrapper",components:{DraggableElement:I},props:{position:{type:String,required:!0}},computed:{classname:function(){return k(a({},this.position,!0))}}};/* template */var U=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("DraggableElement",{class:e.classname,on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)};U._withStripped=!0;/* style inject */ /* style inject SSR */var O=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\LineWrapper.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:U,staticRenderFns:[]},void 0,B,void 0,!1,void 0,void 0,void 0),j=$("vue-bounding-box"),V=["east","west",null],q=["south","north",null],N={name:"BoundingBox",props:{classname:{type:String},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlerComponent:{type:[Object,String]},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},lineComponent:{type:[Object,String]},linesClassnames:{type:Object,default:function(){return{}}}},data:function(){var e=[];return V.forEach(function(t){q.forEach(function(i){if(t!==i){var n=m(t,i),o=n.name,a=n.classname;e.push({name:o,classname:a,verticalDirection:i,horizontalDirection:t})}})}),{points:e}},computed:{classnames:function(){var e=this.handlersClassnames,t=this.linesClassnames;return{default:H(j(),this.classname),handlers:e,lines:t}},lineNodes:function(){var e=this,t=[];return this.points.forEach(function(i){i.horizontalDirection&&i.verticalDirection||!e.lines[i.name]||t.push({name:i.name,component:e.lineComponent,classname:H(e.classnames.lines.default,e.classnames.lines[i.name]),hoverClassname:e.classnames.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t},handlerNodes:function(){var e=this,t=[];return this.points.forEach(function(i){e.handlers[i.name]&&t.push({name:i.name,component:e.handlerComponent,classname:H(e.classnames.handlers.default,e.classnames.handlers[i.name]),hoverClassname:e.classnames.handlers.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onHandlerDrag:function(e,t,i){var n=e.shift(),o=n.left,a=n.top,s={left:0,right:0,top:0,bottom:0};"west"===t?s.left-=o:"east"==t&&(s.right+=o),"north"===i?s.top-=a:"south"==i&&(s.bottom+=a);var r;!i&&t?r="width":i&&!t&&(r="height"),this.$emit("resize",new P(e.nativeEvent,s,{allowedDirections:{left:"west"===t||!t,right:"east"===t||!t,bottom:"south"===i||!i,top:"north"===i||!i},preserveAspectRatio:e.nativeEvent.shiftKey,respectDirection:r}))}}};/* template */var G=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"box",class:e.classnames.default},[e._t("default"),e._v(" "),i("div",e._l(e.lineNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,position:t.name},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1),e._v(" "),i("div",e._l(e.handlerNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,"horizontal-position":t.horizontalDirection,"vertical-position":t.verticalDirection},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1)],2)};G._withStripped=!0;/* style inject */ /* style inject SSR */var K=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\LineWrapper.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:U,staticRenderFns:[]},void 0,B,void 0,!1,void 0,void 0,void 0),j=$("vue-bounding-box"),V=["east","west",null],q=["south","north",null],N={name:"BoundingBox",props:{classname:{type:String},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlerComponent:{type:[Object,String]},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},lineComponent:{type:[Object,String]},linesClassnames:{type:Object,default:function(){return{}}}},data:function(){var e=[];return V.forEach(function(t){q.forEach(function(i){if(t!==i){var n=p(t,i),o=n.name,a=n.classname;e.push({name:o,classname:a,verticalDirection:i,horizontalDirection:t})}})}),{points:e}},computed:{classnames:function(){var e=this.handlersClassnames,t=this.linesClassnames;return{default:H(j(),this.classname),handlers:e,lines:t}},lineNodes:function(){var e=this,t=[];return this.points.forEach(function(i){i.horizontalDirection&&i.verticalDirection||!e.lines[i.name]||t.push({name:i.name,component:e.lineComponent,classname:H(e.classnames.lines.default,e.classnames.lines[i.name]),hoverClassname:e.classnames.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t},handlerNodes:function(){var e=this,t=[];return this.points.forEach(function(i){e.handlers[i.name]&&t.push({name:i.name,component:e.handlerComponent,classname:H(e.classnames.handlers.default,e.classnames.handlers[i.name]),hoverClassname:e.classnames.handlers.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onHandlerDrag:function(e,t,i){var n=e.shift(),o=n.left,a=n.top,s={left:0,right:0,top:0,bottom:0};"west"===t?s.left-=o:"east"==t&&(s.right+=o),"north"===i?s.top-=a:"south"==i&&(s.bottom+=a);var r;!i&&t?r="width":i&&!t&&(r="height"),this.$emit("resize",new P(e.nativeEvent,s,{allowedDirections:{left:"west"===t||!t,right:"east"===t||!t,bottom:"south"===i||!i,top:"north"===i||!i},preserveAspectRatio:e.nativeEvent.shiftKey,respectDirection:r}))}}};/* template */var G=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"box",class:e.classnames.default},[e._t("default"),e._v(" "),i("div",e._l(e.lineNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,position:t.name},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1),e._v(" "),i("div",e._l(e.handlerNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,"horizontal-position":t.horizontalDirection,"vertical-position":t.verticalDirection},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1)],2)};G._withStripped=!0;/* style inject */ /* style inject SSR */var K=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\BoundingBox.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:G,staticRenderFns:[]},void 0,N,void 0,!1,void 0,void 0,void 0),J=$("vue-draggable-area");/* template */var Z=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"container",on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown}},[e._t("default")],2)};Z._withStripped=!0;/* style inject */ /* style inject SSR */var Q=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\DraggableArea.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:Z,staticRenderFns:[]},void 0,{name:"DraggableArea",computed:{classnames:function(){return{default:H(J(),this.classname)}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onTouchStart:function(t){t.cancelable&&(this.touches=r(t.touches),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),n=i.left,o=i.top;this.anchor={x:e.clientX-n,y:e.clientY-o}},processMove:function(e,t){var i=this,n=r(t);if(this.touches.length){var o=this.$refs.container,a=o.getBoundingClientRect(),s=a.left,c=a.top;if(1===this.touches.length&&1===n.length)this.$emit("move",new L(e,{left:n[0].clientX-s-this.anchor.x,top:n[0].clientY-c-this.anchor.y}));else if(1<this.touches.length&&this.touches.length===n.length){var l=n.map(function(e,t){var n=Math.pow;return{x:e.clientX-i.touches[t].clientX,y:e.clientY-i.touches[t].clientY,position:{clientX:e.clientX,clientY:e.clientY},length:Math.sqrt(n(e.clientX-i.touches[t].clientX,2)+n(e.clientY-i.touches[t].clientY,2))}}),h=l.reduce(function(e,t){return e+t.length},0),d={left:l.reduce(function(e,t,i){return e+(1-t.length/h)*n[i].clientX},0),top:l.reduce(function(e,t,i){return e+(1-t.length/h)*n[i].clientY},0)},m={top:0,bottom:0,left:0,right:0};l.forEach(function(e,t){.25<e.length/h&&(n[t].clientY>d.top?m.bottom+=e.y:m.top-=e.y,n[t].clientX>d.left?m.right+=e.x:m.left-=e.x)}),this.$emit("resize",new P(e,m))}this.touches=n}},processEnd:function(){this.touches=[]}}},void 0,!1,void 0,void 0,void 0),ee=["left","right"],te=["top","bottom"],ie=["left","right","top","bottom"],ne=$("vue-preview-result"),oe={name:"PreviewResult",props:{img:{type:Object},classname:{type:String},imageClassname:{type:String},resultCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}}},computed:{classnames:function(){return{default:H(ne(),this.classname),image:H(ne("image"),this.imageClassname),wrapper:ne("wrapper")}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")}},imageStyle:function(){var e=this.img.transforms,t=this.img.size.width,i=this.img.size.height,n=this.stencilCoordinates.height/this.resultCoordinates.height,o=i*n,a=t*n,s=e.flipped,r={width:"".concat(a,"px"),height:"".concat(o,"px")};return s?(r.width="".concat(o,"px"),r.height="".concat(a,"px"),r.left="".concat(-this.stencilCoordinates.left-(o-a)/2,"px"),r.top="".concat(-this.stencilCoordinates.top-(a-o)/2,"px")):(r.width="".concat(a,"px"),r.height="".concat(o,"px"),r.left="".concat(-this.stencilCoordinates.left,"px"),r.top="".concat(-this.stencilCoordinates.top,"px")),r.transform=v(e),r}}};/* template */var ae=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("div",{ref:"wrapper",class:e.classnames.wrapper,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img.src}})])])};ae._withStripped=!0;/* style inject */ /* style inject SSR */var se=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\DraggableArea.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:Z,staticRenderFns:[]},void 0,{name:"DraggableArea",computed:{classnames:function(){return{default:H(J(),this.classname)}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onTouchStart:function(t){t.cancelable&&(this.touches=r(t.touches),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),n=i.left,o=i.top;this.anchor={x:e.clientX-n,y:e.clientY-o}},processMove:function(e,t){var i=this,n=r(t);if(this.touches.length){var o=this.$refs.container,a=o.getBoundingClientRect(),s=a.left,c=a.top;if(1===this.touches.length&&1===n.length)this.$emit("move",new L(e,{left:n[0].clientX-s-this.anchor.x,top:n[0].clientY-c-this.anchor.y}));else if(1<this.touches.length&&this.touches.length===n.length){var l=n.map(function(e,t){var n=Math.pow;return{x:e.clientX-i.touches[t].clientX,y:e.clientY-i.touches[t].clientY,position:{clientX:e.clientX,clientY:e.clientY},length:Math.sqrt(n(e.clientX-i.touches[t].clientX,2)+n(e.clientY-i.touches[t].clientY,2))}}),h=l.reduce(function(e,t){return e+t.length},0),d={left:l.reduce(function(e,t,i){return e+(1-t.length/h)*n[i].clientX},0),top:l.reduce(function(e,t,i){return e+(1-t.length/h)*n[i].clientY},0)},p={top:0,bottom:0,left:0,right:0};l.forEach(function(e,t){.25<e.length/h&&(n[t].clientY>d.top?p.bottom+=e.y:p.top-=e.y,n[t].clientX>d.left?p.right+=e.x:p.left-=e.x)}),this.$emit("resize",new P(e,p))}this.touches=n}},processEnd:function(){this.touches=[]}}},void 0,!1,void 0,void 0,void 0),ee=["left","right"],te=["top","bottom"],ie=["left","right","top","bottom"],ne=$("vue-preview-result"),oe={name:"PreviewResult",props:{img:{type:Object},classname:{type:String},imageClassname:{type:String},resultCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}}},computed:{classnames:function(){return{default:H(ne(),this.classname),image:H(ne("image"),this.imageClassname),wrapper:ne("wrapper")}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")}},imageStyle:function(){var e=this.img.transforms,t=this.img.size.width,i=this.img.size.height,n=this.stencilCoordinates.height/this.resultCoordinates.height,o=i*n,a=t*n,s=e.flipped,r={width:"".concat(a,"px"),height:"".concat(o,"px")};return s?(r.width="".concat(o,"px"),r.height="".concat(a,"px"),r.left="".concat(-this.stencilCoordinates.left-(o-a)/2,"px"),r.top="".concat(-this.stencilCoordinates.top-(a-o)/2,"px")):(r.width="".concat(a,"px"),r.height="".concat(o,"px"),r.left="".concat(-this.stencilCoordinates.left,"px"),r.top="".concat(-this.stencilCoordinates.top,"px")),r.transform=v(e),r}}};/* template */var ae=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("div",{ref:"wrapper",class:e.classnames.wrapper,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img.src}})])])};ae._withStripped=!0;/* style inject */ /* style inject SSR */var se=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\service\\PreviewResult.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:ae,staticRenderFns:[]},void 0,oe,void 0,!1,void 0,void 0,void 0),re=$("vue-square-handler"),ce={name:"SimpleHandler",components:{HandlerWrapper:X},props:{classname:{type:String},hoverClassname:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String}},computed:{classnames:function(){return{default:H(re(a({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}};/* template */var le=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("HandlerWrapper",{attrs:{"vertical-position":e.verticalPosition,"horizontal-position":e.horizontalPosition},on:{drag:e.onDrag}},[i("div",{class:e.classnames.default})])};le._withStripped=!0;/* style inject */ /* style inject SSR */var he=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\handlers\\SimpleHandler.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:le,staticRenderFns:[]},void 0,ce,void 0,!1,void 0,void 0,void 0),de=$("vue-simple-line"),me={name:"SimpleLine",components:{LineWrapper:O},props:{classname:{type:String},hoverClassname:{type:String},position:{type:String}},data:function(){return{hover:!1}},computed:{classnames:function(){return{default:H(de(a({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}};/* template */var pe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("LineWrapper",{attrs:{position:e.position},on:{enter:e.onEnter,leave:e.onLeave,drag:e.onDrag}},[i("div",{class:e.classnames.default})])};pe._withStripped=!0;/* style inject */ /* style inject SSR */var ge=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\lines\\SimpleLine.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:pe,staticRenderFns:[]},void 0,me,void 0,!1,void 0,void 0,void 0),ue=$("vue-rectangle-stencil"),fe={name:"RectangleStencil",components:{PreviewResult:se,BoundingBox:K,DraggableArea:Q},props:{img:{type:Object},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlerComponent:{type:[Object,String],default:function(){return he}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return ge}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]}},computed:{classes:function(){return{stencil:H(ue(),this.classname),preview:H(ue("preview"),this.previewClassname),boundingBox:H(ue("bounding-box"),this.boundingBoxClassname)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,n=e.left,o=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(n,"px"),top:"".concat(o,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}};/* template */var ve=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames},on:{resize:e.onResize}},[i("DraggableArea",{on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)};ve._withStripped=!0;/* style inject */ /* style inject SSR */var we=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\handlers\\SimpleHandler.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:le,staticRenderFns:[]},void 0,ce,void 0,!1,void 0,void 0,void 0),de=$("vue-simple-line"),pe={name:"SimpleLine",components:{LineWrapper:O},props:{classname:{type:String},hoverClassname:{type:String},position:{type:String}},data:function(){return{hover:!1}},computed:{classnames:function(){return{default:H(de(a({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}};/* template */var me=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("LineWrapper",{attrs:{position:e.position},on:{enter:e.onEnter,leave:e.onLeave,drag:e.onDrag}},[i("div",{class:e.classnames.default})])};me._withStripped=!0;/* style inject */ /* style inject SSR */var ge=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\lines\\SimpleLine.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:me,staticRenderFns:[]},void 0,pe,void 0,!1,void 0,void 0,void 0),ue=$("vue-rectangle-stencil"),fe={name:"RectangleStencil",components:{PreviewResult:se,BoundingBox:K,DraggableArea:Q},props:{img:{type:Object},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlerComponent:{type:[Object,String],default:function(){return he}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return ge}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]}},computed:{classes:function(){return{stencil:H(ue(),this.classname),preview:H(ue("preview"),this.previewClassname),boundingBox:H(ue("bounding-box"),this.boundingBoxClassname)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,n=e.left,o=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(n,"px"),top:"".concat(o,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}};/* template */var ve=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames},on:{resize:e.onResize}},[i("DraggableArea",{on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)};ve._withStripped=!0;/* style inject */ /* style inject SSR */var we=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\stencils\\RectangleStencil.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:ve,staticRenderFns:[]},void 0,fe,void 0,!1,void 0,void 0,void 0),ye=$("vue-circle-stencil"),Ce={name:"CircleStencil",components:{PreviewResult:se,BoundingBox:K,DraggableArea:Q},props:{img:{type:Object},stencilClass:{type:String},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}}},handlerComponent:{type:[Object,String],default:function(){return he}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return ge}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String}},computed:{classes:function(){return{stencil:H(ye(),this.classname),preview:H(ye("preview"),this.previewClassname),boundingBox:H(ye("bounding-box"),this.boundingBox)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,n=e.left,o=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(n,"px"),top:"".concat(o,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:1,maximum:1}}}};/* template */var xe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames},on:{resize:e.onResize}},[i("DraggableArea",{on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)};xe._withStripped=!0;/* style inject */ /* style inject SSR */var be=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\stencils\\CircleStencil.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:xe,staticRenderFns:[]},void 0,Ce,void 0,!1,void 0,void 0,void 0),ze=$("vue-advanced-cropper"),Se={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:function(e,t,i,n,o,a){var r=s({},e,{right:e.left+e.width,bottom:e.top+e.height}),c=a.params||{},l=s({},a.directions),h=c.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};Object.keys(h).forEach(function(e){h[e]||(l[e]=0)});var d=S(r,l,n),m=_(r,l,n);l=E(l,r,t,n,i),d=S(r,l,n),m=_(r,l,n);// Checks ratio: | ||
var p=null;if(c.preserveAspectRatio?p=r.width/r.height:o.minimum&&d/m<o.minimum?p=o.minimum:o.maximum&&d/m>o.maximum&&(p=o.maximum),p){var g=c.respectDirection;if(g||(r.width>r.height?g="width":g="height"),"width"===g){var u=r.height-d/p;h.top&&h.bottom?(l.bottom=-u/(2*n),l.top=-u/(2*n)):h.top?l.top=-u/n:h.bottom?l.bottom=-u/n:h.right?l.right=0:h.left&&(l.left=0)}else if("height"===g){var f=r.width-m*p;h.left&&h.right?(l.left=-f/(2*n),l.right=-f/(2*n)):h.left?l.left=-f/n:h.right?l.right=-f/n:h.top?l.top=0:h.bottom&&(l.bottom=0)}else ie.forEach(function(e){l[e]*=0})}// 3. Third step: check if desired box with correct aspect ratios break some limits and fit to this conditions | ||
return l=E(l,r,t,n,i,p),{width:e.width+n*(l.right+l.left),height:e.height+n*(l.top+l.bottom),left:e.left-n*l.left,top:e.top-n*l.top}}},moveAlgorithm:{type:Function,default:function(e,t,i,n){var o=s({},n.directions),a={left:e.left+i*o.left,top:e.top+i*o.top,width:e.width,height:e.height};return 0>a.left&&(a.left=0),a.left+a.width>t.width&&(a.left=R(0,t.width-a.width)),0>a.top&&(a.top=0),a.top+a.height>t.height&&(a.top=R(0,t.height-a.height)),a}},defaultSize:{type:Function,default:// eslint-disable-next-line no-unused-vars | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\stencils\\CircleStencil.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:xe,staticRenderFns:[]},void 0,Ce,void 0,!1,void 0,void 0,void 0),ze=$("vue-advanced-cropper"),Se={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:function(e,t,i,n,o,a){var r=s({},e,{right:e.left+e.width,bottom:e.top+e.height}),c=a.params||{},l=s({},a.directions),h=c.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};Object.keys(h).forEach(function(e){h[e]||(l[e]=0)});var d=S(r,l,n),p=_(r,l,n);l=E(l,r,t,n,i),d=S(r,l,n),p=_(r,l,n);// Checks ratio: | ||
var m=null;if(c.preserveAspectRatio?m=r.width/r.height:o.minimum&&d/p<o.minimum?m=o.minimum:o.maximum&&d/p>o.maximum&&(m=o.maximum),m){var g=c.respectDirection;if(g||(r.width>r.height?g="width":g="height"),"width"===g){var u=r.height-d/m;h.top&&h.bottom?(l.bottom=-u/(2*n),l.top=-u/(2*n)):h.top?l.top=-u/n:h.bottom?l.bottom=-u/n:h.right?l.right=0:h.left&&(l.left=0)}else if("height"===g){var f=r.width-p*m;h.left&&h.right?(l.left=-f/(2*n),l.right=-f/(2*n)):h.left?l.left=-f/n:h.right?l.right=-f/n:h.top?l.top=0:h.bottom&&(l.bottom=0)}else ie.forEach(function(e){l[e]*=0})}// 3. Third step: check if desired box with correct aspect ratios break some limits and fit to this conditions | ||
return l=E(l,r,t,n,i,m),{width:e.width+n*(l.right+l.left),height:e.height+n*(l.top+l.bottom),left:e.left-n*l.left,top:e.top-n*l.top}}},moveAlgorithm:{type:Function,default:function(e,t,i,n){var o=s({},n.directions),a={left:e.left+i*o.left,top:e.top+i*o.top,width:e.width,height:e.height};return 0>a.left&&(a.left=0),a.left+a.width>t.width&&(a.left=R(0,t.width-a.width)),0>a.top&&(a.top=0),a.top+a.height>t.height&&(a.top=R(0,t.height-a.height)),a}},defaultSize:{type:Function,default:// eslint-disable-next-line no-unused-vars | ||
function(e,t,i){var n,o,a=i.maxWidth,s=i.maxHeight,r=i.minWidth,c=i.minHeight;return s>a?(n=R(c,.8*s),o=R(r,.8*a)):(o=R(r,.8*a),n=R(c,.8*s)),{height:n,width:o}}},defaultPosition:{type:Function,default:// eslint-disable-next-line no-unused-vars | ||
function(e,t,i,n,o,a){return{left:o/2-i/2,top:a/2-n/2}}},areaSize:{type:Function,default:function(e,t,i,n){var o=e.clientHeight,a=e.clientWidth,s=o,r=i*o/n;return r>a&&(r=a,s=n*a/i),{width:r,height:s}}},restrictions:{type:Function,default:function(e,t,i,n,o,a){return{minWidth:e/100*o,minHeight:t/100*a,maxWidth:i?i/100*o:o,maxHeight:n?n/100*a:a}}},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return we}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:H(ze(),this.classname),image:H(ze("image"),this.imageClassname),area:H(ze("area"),this.areaClassname),stretcher:H(ze("stretcher")),background:H(ze("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,o=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:o/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+v(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),console.log(e,s({},this.imageAttributes),this.coefficient,s({},this.boundarySize),s({},this.imageSize)),e},stencilRestrictions:function(){var e=this.restrictions(+this.minWidth,+this.minHeight,+this.maxWidth,+this.maxHeight,this.imageSize.width,this.imageSize.height);return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){var e=this;t.nextTick(function(){e.onChangeImage()})},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){this.debouncedUpdate=d(this.update,this.debounce),this.src&&this.onChangeImage(),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage)},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods | ||
function(e,t,i,n,o,a){return{left:o/2-i/2,top:a/2-n/2}}},areaSize:{type:Function,default:function(e,t,i,n){var o=e.clientHeight,a=e.clientWidth,s=o,r=i*o/n;return r>a&&(r=a,s=n*a/i),{width:r,height:s}}},restrictions:{type:Function,default:function(e,t,i,n,o,a){return{minWidth:e/100*o,minHeight:t/100*a,maxWidth:i?i/100*o:o,maxHeight:n?n/100*a:a}}},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return we}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:H(ze(),this.classname),image:H(ze("image"),this.imageClassname),area:H(ze("area"),this.areaClassname),stretcher:H(ze("stretcher")),background:H(ze("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,o=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:o/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+v(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),e},stencilRestrictions:function(){var e=this.restrictions(+this.minWidth,+this.minHeight,+this.maxWidth,+this.maxHeight,this.imageSize.width,this.imageSize.height);return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){var e=this;t.nextTick(function(){e.onChangeImage()})},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){this.debouncedUpdate=d(this.update,this.debounce),this.src&&this.onChangeImage(),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage)},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods | ||
getResult:function(){return this.canvas?(this.updateCanvas(this.coordinates),{coordinates:s({},this.coordinates),canvas:this.$refs.canvas}):{coordinates:s({},this.coordinates)}},// Internal methods | ||
getArea:function(){return this.$refs.area},getStencil:function(){return this.$refs.stencil},updateCanvas:function(e){// This function can be asynchronously called because it's debounced | ||
// Therefore there is workaround to prevent processing after the component was unmounted | ||
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?u(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var o=n.getContext("2d");o.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this,t=p(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),this.imageLoaded=!1,setTimeout(function(){e.checkOrientation?w(t?g(e.src):e.src).then(e.onParseImage):e.onParseImage()},this.transitionTime)},onParseImage:function(e){var i=this;this.imageAttributes.src=this.src,this.imageTransforms=f(e),t.nextTick(function(){var e=i.$refs.image;e&&(e.complete?i.refreshImage().then(i.resetCoordinates):e.addEventListener("load",function(){i.$refs.image&&i.refreshImage().then(i.resetCoordinates)}))})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm(this.coordinates,this.stencilRestrictions,this.imageSize,this.coefficient,this.stencilAspectRatios(),e))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm(this.coordinates,this.imageSize,this.coefficient,e))},defaultCoordinates:function(){var e=this.stencilAspectRatios(),t=this.stencilRestrictions,i=t.minWidth,n=t.minHeight,o=t.maxWidth,a=t.maxHeight,s=this.imageSize,r={};if(!e.minimum&&!e.maximum)r.height=n,r.width=i;else{var c={width:{maximum:e.minimum?D(a,i/e.minimum):a,minimum:e.maximum?R(n,i/e.maximum):n},height:{maximum:e.maximum?D(o,n*e.maximum):o,minimum:e.mininum?R(i,n*e.mininum):i}};if(c.width.maximum>=c.width.minimum)r.width=i,r.height=c.width.minimum;else if(c.height.maximum>=c.height.minimum)r.height=n,r.width=c.height.minimum;else throw"Error: current aspect ratio can't is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return r.left=s.width/2-r.width/2,r.top=s.height/2-r.height/2,r},setCoordinates:function(e){var t=this,i=this.imageSize,n=this.coefficient,o=this.stencilAspectRatios(),a=function(e,o){return t.moveAlgorithm(e,i,n,new L(null,{left:(o.left-e.left)/n,top:(o.top-e.top)/n}))},r=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm(r,t.stencilRestrictions,i,n,o,new P(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})),a(r,{left:e.left,top:e.top})},c=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(s({},c),t.imageSize):e,(i.width||i.height)&&(c=r(c,s({},c,i))),(i.left||i.top)&&(c=a(c,s({},c,i)))}),this.onChangeCoordinates(c,!1),c},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise | ||
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?u(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var o=n.getContext("2d");o.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this,t=m(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),this.imageLoaded=!1,setTimeout(function(){e.checkOrientation?w(t?g(e.src):e.src).then(e.onParseImage):e.onParseImage()},this.transitionTime)},onParseImage:function(e){var i=this;this.imageAttributes.src=this.src,this.imageTransforms=f(e),t.nextTick(function(){var e=i.$refs.image;e&&(e.complete?i.refreshImage().then(i.resetCoordinates):e.addEventListener("load",function(){i.$refs.image&&i.refreshImage().then(i.resetCoordinates)}))})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm(this.coordinates,this.stencilRestrictions,this.imageSize,this.coefficient,this.stencilAspectRatios(),e))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm(this.coordinates,this.imageSize,this.coefficient,e))},defaultCoordinates:function(){var e=this.stencilAspectRatios(),t=this.stencilRestrictions,i=t.minWidth,n=t.minHeight,o=t.maxWidth,a=t.maxHeight,s=this.imageSize,r={};if(!e.minimum&&!e.maximum)r.height=n,r.width=i;else{var c={width:{maximum:e.minimum?D(a,i/e.minimum):a,minimum:e.maximum?R(n,i/e.maximum):n},height:{maximum:e.maximum?D(o,n*e.maximum):o,minimum:e.mininum?R(i,n*e.mininum):i}};if(c.width.maximum>=c.width.minimum)r.width=i,r.height=c.width.minimum;else if(c.height.maximum>=c.height.minimum)r.height=n,r.width=c.height.minimum;else throw"Error: current aspect ratio can't is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return r.left=s.width/2-r.width/2,r.top=s.height/2-r.height/2,r},setCoordinates:function(e){var t=this,i=this.imageSize,n=this.coefficient,o=this.stencilAspectRatios(),a=function(e,o){return t.moveAlgorithm(e,i,n,new L(null,{left:(o.left-e.left)/n,top:(o.top-e.top)/n}))},r=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm(r,t.stencilRestrictions,i,n,o,new P(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})),a(r,{left:e.left,top:e.top})},c=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(s({},c),t.imageSize):e,(i.width||i.height)&&(c=r(c,s({},c,i))),(i.left||i.top)&&(c=a(c,s({},c,i)))}),this.onChangeCoordinates(c,!1),c},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise | ||
// Therefore there is a workaround to prevent processing after the component was unmounted | ||
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,o=n.minWidth,a=n.minHeight,r=n.maxWidth,c=n.maxHeight,l=n.widthFrozen,h=n.heightFrozen;this.frozenDirections.width=!!l,this.frozenDirections.height=!!h;var d=this.defaultSize(t,i,this.stencilRestrictions,this.$props);(d.width<o||d.height<a||d.width>r||d.height>c)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function"),this.setCoordinates([d,function(n){return s({},e.defaultPosition(t,i,n.width,n.height,e.imageSize.width,e.imageSize.height,e.$props))}]),this.imageLoaded=!0}},refreshImage:function(){var e=this,i=this.$refs.image,n=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=i.naturalWidth,this.imageSize.width=i.naturalHeight):(this.imageSize.height=i.naturalHeight,this.imageSize.width=i.naturalWidth);var o=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(n.style.height="".concat(this.imageSize.height,"px"),n.style.width="".concat(n.clientHeight*o,"px"),n.clientWidth/n.clientHeight!=o&&(n.style.height="".concat(n.clientWidth/o,"px"))):(n.style.width="".concat(this.imageSize.width,"px"),n.style.height="".concat(n.clientWidth/o,"px"),n.clientHeight/n.clientWidth!=o&&(n.style.width="".concat(n.clientHeight*o,"px"))),new Promise(function(i){var n=e.$refs.cropper,o=e.$refs.image;t.nextTick(function(){var t=e.areaSize(n,o,e.imageSize.width,e.imageSize.height),a=t.height,s=t.width;a&&(e.boundarySize.height=a),s&&(e.boundarySize.width=s),console.log("\u041E\u0431\u043D\u043E\u0432\u0438\u043B \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435",e.imageLoaded),i()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}};/* template */var _e=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])};_e._withStripped=!0;/* style inject */ /* style inject SSR */var Ee=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,o=n.minWidth,a=n.minHeight,r=n.maxWidth,c=n.maxHeight,l=n.widthFrozen,h=n.heightFrozen;this.frozenDirections.width=!!l,this.frozenDirections.height=!!h;var d=this.defaultSize(t,i,this.stencilRestrictions,this.$props);(d.width<o||d.height<a||d.width>r||d.height>c)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function"),this.setCoordinates([d,function(n){return s({},e.defaultPosition(t,i,n.width,n.height,e.imageSize.width,e.imageSize.height,e.$props))}]),this.imageLoaded=!0}},refreshImage:function(){var e=this,i=this.$refs.image,n=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=i.naturalWidth,this.imageSize.width=i.naturalHeight):(this.imageSize.height=i.naturalHeight,this.imageSize.width=i.naturalWidth);var o=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(n.style.height="".concat(this.imageSize.height,"px"),n.style.width="".concat(n.clientHeight*o,"px"),n.clientWidth/n.clientHeight!=o&&(n.style.height="".concat(n.clientWidth/o,"px"))):(n.style.width="".concat(this.imageSize.width,"px"),n.style.height="".concat(n.clientWidth/o,"px"),n.clientHeight/n.clientWidth!=o&&(n.style.width="".concat(n.clientHeight*o,"px"))),new Promise(function(i){var n=e.$refs.cropper,o=e.$refs.image;t.nextTick(function(){var t=e.areaSize(n,o,e.imageSize.width,e.imageSize.height),a=t.height,s=t.width;a&&(e.boundarySize.height=a),s&&(e.boundarySize.width=s),i()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}};/* template */var _e=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])};_e._withStripped=!0;/* style inject */ /* style inject SSR */var Ee=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\Cropper.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:_e,staticRenderFns:[]},void 0,Se,void 0,!1,void 0,void 0,void 0),Re=$("vue-preview-image"),De={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:H(Re(),this.classname),image:H(Re("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}};/* template */var He=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])};He._withStripped=!0;/* style inject */ /* style inject SSR */var $e=/* component normalizer */function(e,t,i,n,o){const a=("function"==typeof i?i.options:i)||{};// For security concerns, we use only base name in production mode. | ||
@@ -88,2 +88,2 @@ return a.__file="C:\\Live\\Projects\\Hot\\Vue Cropper\\vue-advanced-cropper-rollup\\src\\components\\helpers\\PreviewImage.vue",a.render||(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0,o&&(a.functional=!0)),a._scopeId=n,a}({render:He,staticRenderFns:[]},void 0,De,void 0,!1,void 0,void 0,void 0);t.component("cropper",Ee),t.component("rectangle-stencil",we),t.component("circle-stencil",be),t.component("simple-handler",he),t.component("simple-line",ge),e.BoundingBox=K,e.CircleStencil=be,e.Cropper=Ee,e.DragEvent=M,e.DraggableArea=Q,e.DraggableElement=I,e.HandlerWrapper=X,e.LineWrapper=O,e.MoveEvent=L,e.PreviewImage=$e,e.PreviewResult=se,e.RectangleStencil=we,e.ResizeEvent=P,e.SimpleHandler=he,e.SimpleLine=ge,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
}; | ||
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */");//# sourceMappingURL=index.umd.js.map | ||
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */");//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "vue-advanced-cropper", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "The advanced library to create your own croppers suited for any website design", | ||
@@ -32,4 +32,4 @@ "author": "Norserium", | ||
"test": "cross-env NODE_ENV=test jest", | ||
"lint": "eslint src/**/*.{js,vue} example/docs/.vuepress/**/*.{js,vue}", | ||
"lint:fix": "eslint --fix src/**/*.{js,vue} example/docs/.vuepress/**/*.{js,vue} " | ||
"lint": "eslint src/**/*.{js,vue}", | ||
"lint:fix": "eslint --fix src/**/*.{js,vue}" | ||
}, | ||
@@ -92,3 +92,3 @@ "peerDependencies": { | ||
"lint-staged": { | ||
"*.{js, jsx}": [ | ||
"*.{js,vue}": [ | ||
"eslint" | ||
@@ -99,5 +99,5 @@ ] | ||
"hooks": { | ||
"pre-commit": "lint-staged src/**/*.{js,vue} example/docs/.vuepress/**/*.{js,vue}" | ||
"pre-commit": "lint-staged" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
708925
845