1import{D as e,St as t,Yt as n,bt as r,et as i,mt as a,o,qt as s,v as c,wt as l,xt as u,y as d}from"./DTnvIjeT.js";import{S as f,w as p}from"./D82BTSck.js";function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?m(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function v(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||function(e,t){if(e){if(typeof e==`string`)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}}(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ee,te,b,x=(ee=function(e){(function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var a=typeof i;if(a===`string`||a===`number`)e.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&e.push(o)}}else if(a===`object`)if(i.toString===Object.prototype.toString)for(var s in i)t.call(i,s)&&i[s]&&e.push(s);else e.push(i.toString())}}return e.join(` `)}e.exports?(n.default=n,e.exports=n):window.classNames=n})()},ee(b={path:te,exports:{},require:function(e,t){return function(){throw Error(`Dynamic requires are not currently supported by @rollup/plugin-commonjs`)}(t==null&&b.path)}},b.exports),b.exports),S=function(e){return function(t,n){if(!t)return e;var r;typeof t==`string`?r=t:n=t;var i=e;return r&&(i+=`__`+r),i+(n?Object.keys(n).reduce((function(e,t){var r=n[t];return r&&(e+=` `+(typeof r==`boolean`?i+`--`+t:i+`--`+t+`_`+r)),e}),``):``)}};function ne(e,t,n){var r,i,a,o,s;function c(){var l=Date.now()-o;l<t&&l>=0?r=setTimeout(c,t-l):(r=null,n||(s=e.apply(a,i),a=i=null))}t??=100;var l=function(){a=this,i=arguments,o=Date.now();var l=n&&!r;return r||=setTimeout(c,t),l&&(s=e.apply(a,i),a=i=null),s};return l.clear=function(){r&&=(clearTimeout(r),null)},l.flush=function(){r&&=(s=e.apply(a,i),a=i=null,clearTimeout(r),null)},l}ne.debounce=ne;var C=ne,w=function(){return w=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},w.apply(this,arguments)};function re(e,t){var n,r;return e&&t?(n=``+e+t[0].toUpperCase()+t.slice(1),r=e+`-`+t):(n=e||t,r=e||t),{name:n,classname:r}}function ie(e){return/^blob:/.test(e)}function ae(e){return ie(e)||function(e){return/^data:/.test(e)}(e)}function T(e){return!!(e&&e.constructor&&e.call&&e.apply)}function E(e){return e===void 0}function D(e){return typeof e==`object`&&!!e}function O(e,t,n){var r={};return D(e)?(Object.keys(t).forEach((function(i){r[i]=E(e[i])?t[i]:D(t[i])?D(e[i])?O(e[i],t[i],n[i]):e[i]?t[i]:n[i]:!0===t[i]||!1===t[i]?!!e[i]:e[i]})),r):e?t:n}function k(e){var t=Number(e);return Number.isNaN(t)?e:t}function oe(e){return typeof(e==`number`||function(e){return typeof e==`object`&&!!e}(e)&&toString.call(e)==`[object Number]`)&&!se(e)}function se(e){return e!=e}function ce(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}var A=function(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.type=`manipulateImage`,this.move=e,this.scale=t},le=function(e,t){t===void 0&&(t={}),this.type=`resize`,this.directions=e,this.params=t},j=function(e){this.type=`move`,this.directions=e},ue=function(){function e(e,t,n,r,i){this.type=`drag`,this.nativeEvent=e,this.position=n,this.previousPosition=r,this.element=t,this.anchor=i}return e.prototype.shift=function(){var e=this,t=e.element,n=e.anchor,r=e.position;if(t){var i=t.getBoundingClientRect(),a=i.left,o=i.top;return{left:r.left-a-n.left,top:r.top-o-n.top}}return{left:0,top:0}},e}(),M={name:`DraggableElement`,props:{classname:{type:String}},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})},beforeUnmount: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 Error(`You should add ref "draggable" to your root element to use draggable mixin`);this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit(`enter`))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit(`leave`))},onTouchStart:function(e){e.cancelable&&!this.disabled&&e.touches.length===1&&(this.touches=v(e.touches),this.hovered||=(this.$emit(`enter`),!0),e.touches.length&&this.initAnchor(this.touches.reduce((function(t,n){return{clientX:t.clientX+n.clientX/e.touches.length,clientY:t.clientY+n.clientY/e.touches.length}}),{clientX:0,clientY:0})),e.preventDefault&&e.preventDefault(),e.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(e){this.touches.length&&(this.processMove(e,e.touches),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation())},onMouseDown:function(e){if(!this.disabled){var t={fake:!0,clientX:e.clientX,clientY:e.clientY};this.touches=[t],this.initAnchor(t),e.stopPropagation()}},onMouseMove:function(e){this.touches.length&&(this.processMove(e,[{fake:!0,clientX:e.clientX,clientY:e.clientY}]),e.preventDefault&&e.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(e){var t=this.$refs.draggable.getBoundingClientRect(),n=t.left,r=t.right,i=t.bottom,a=t.top;this.anchor={left:e.clientX-n,top:e.clientY-a,bottom:i-e.clientY,right:r-e.clientX}},processMove:function(e,t){var n=v(t);if(this.touches.length){if(this.touches.length===1&&n.length===1){var r=this.$refs.draggable;
2this.$emit(`drag`,new ue(e,r,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit(`drag-end`),this.hovered&&=(this.$emit(`leave`),!1),this.touches=[]}},emits:[`drag`,`drag-end`,`leave`,`enter`]};M.render=function(e,t,n,r,i,o){return a(),c(`div`,{ref:`draggable`,class:n.classname,onTouchstart:t[1]||=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)},onMousedown:t[2]||=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)},onMouseover:t[3]||=function(){return o.onMouseOver&&o.onMouseOver.apply(o,arguments)},onMouseleave:t[4]||=function(){return o.onMouseLeave&&o.onMouseLeave.apply(o,arguments)}},[u(e.$slots,`default`)],34)};var de=S(`vue-handler-wrapper`),fe={name:`HandlerWrapper`,components:{DraggableElement:M},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var e;if(this.horizontalPosition||this.verticalPosition){var t,n=re(this.horizontalPosition,this.verticalPosition);e=de((g(t={},n.classname,!0),g(t,`disabled`,this.disabled),t))}else e=de({disabled:this.disabled});return{root:e,draggable:de(`draggable`)}}},emits:[`leave`,`enter`,`drag`,`drag-end`]};fe.render=function(n,r,i,o,l,d){var f=t(`DraggableElement`);return a(),c(`div`,{class:d.classes.root},[e(f,{class:d.classes.draggable,onDrag:r[1]||=function(e){return n.$emit(`drag`,e)},onDragEnd:r[2]||=function(e){return n.$emit(`drag-end`)},onLeave:r[3]||=function(e){return n.$emit(`leave`)},onEnter:r[4]||=function(e){return n.$emit(`enter`)}},{default:s((function(){return[u(n.$slots,`default`)]})),_:3},8,[`class`])],2)};var pe=S(`vue-line-wrapper`),me={name:`LineWrapper`,components:{DraggableElement:M},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var e;return pe((g(e={},this.position,!0),g(e,`disabled`,this.disabled),e))}},emits:[`leave`,`enter`,`drag`,`drag-end`]};me.render=function(e,n,r,i,o,l){var d=t(`DraggableElement`);return a(),c(d,{class:l.classname,onDrag:n[1]||=function(t){return e.$emit(`drag`,t)},onDragEnd:n[2]||=function(t){return e.$emit(`drag-end`)},onLeave:n[3]||=function(t){return e.$emit(`leave`)},onEnter:n[4]||=function(t){return e.$emit(`enter`)}},{default:s((function(){return[u(e.$slots,`default`)]})),_:3},8,[`class`])};var N=[`left`,`right`,`top`,`bottom`],he=[`left`,`right`],ge=[`top`,`bottom`],_e=[`left`,`top`],ve=[`fill-area`,`fit-area`,`stencil`,`none`],ye={left:0,top:0,width:0,height:0};function be(e,t,n){return!(n||=[`width`,`height`,`left`,`top`]).some((function(n){return e[n]!==t[n]}))}function P(e){return{left:e.left,top:e.top,right:e.left+e.width,bottom:e.top+e.height}}function F(e,t){return{left:e.left-t.left,top:e.top-t.top}}function I(e){return{left:e.left+e.width/2,top:e.top+e.height/2}}function L(e,t){var n={left:0,top:0,right:0,bottom:0};return N.forEach((function(r){var i=t[r],a=P(e)[r];n[r]=i!==void 0&&a!==void 0?r===`left`||r===`top`?Math.max(0,i-a):Math.max(0,a-i):0})),n}function R(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width+t.left+t.right,height:e.height+t.top+t.bottom}}function z(e){return{left:-e.left,top:-e.top}}function B(e,t){return w(w({},e),{left:e.left+t.left,top:e.top+t.top})}function V(e,t,n,r){if(t!==1){if(n){var i=I(e);return{width:e.width*t,height:e.height*t,left:e.left+e.width*(1-t)/2+(n.left-i.left)*(r||1-t),top:e.top+e.height*(1-t)/2+(n.top-i.top)*(r||1-t)}}return{width:e.width*t,height:e.height*t,left:e.left+e.width*(1-t)/2,top:e.top+e.height*(1-t)/2}}return e}function H(e){return e.width/e.height}function U(e,t){return Math.min(t.right!==void 0&&t.left!==void 0?(t.right-t.left)/e.width:1/0,t.bottom!==void 0&&t.top!==void 0?(t.bottom-t.top)/e.height:1/0)}function W(e,t){var n={left:0,top:0},r=L(e,t);return r.left&&r.left>0?n.left=r.left:r.right&&r.right>0&&(n.left=-r.right),r.top&&r.top>0?n.top=r.top:r.bottom&&r.bottom>0&&(n.top=-r.bottom),n}function xe(e,t){var n;return t.minimum&&e<t.minimum?n=t.minimum:t.maximum&&e>t.maximum&&(n=t.maximum),n}function Se(e,t){var n=H(e),r=H(t);return t.width<1/0&&t.height<1/0?n>r?{width:t.width,height:t.width/n}:{width:t.height*n,height:t.height}:t.width<1/0?{width:t.width,height:t.width/n}:t.height<1/0?{width:t.height*n,height:t.height}:e}function Ce(e,t){var n=t*Math.PI/180;return{width:Math.abs(e.width*Math.cos(n))+Math.abs(e.height*Math.sin(n)),height:Math.abs(e.width*Math.sin(n))+Math.abs(e.height*Math.cos(n))}}function G(e,t){var n=t*Math.PI/180;return{left:e.left*Math.cos(n)-e.top*Math.sin(n),top:e.left*Math.sin(n)+e.top*Math.cos(n)}}function K(e,t){var n=L(q(e,t),t);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((e.width+n.left+n.right)/e.width,U(e,t)):Math.min((e.height+n.top+n.bottom)/e.height,U(e,t)):1}function q(e,t,n){n===void 0&&(n=!1);var r=W(e,t);return B(e,n?z(r):r)}function we(e){return{width:e.right!==void 0&&e.left!==void 0?e.right-e.left:1/0,height:e.bottom!==void 0&&e.top!==void 0?e.bottom-e.top:1/0}}function Te(e,t){return w(w({},e),{minWidth:Math.min(t.width,e.minWidth),minHeight:Math.min(t.height,e.minHeight),maxWidth:Math.min(t.width,e.maxWidth),maxHeight:Math.min(t.height,e.maxHeight)})}function Ee(e,t,n){n===void 0&&(n=!0);var r={};
2return N.forEach((function(i){var a=e[i],o=t[i];a!==void 0&&o!==void 0?r[i]=i===`left`||i===`top`?n?Math.max(a,o):Math.min(a,o):n?Math.min(a,o):Math.max(a,o):o===void 0?a!==void 0&&(r[i]=a):r[i]=o})),r}function J(e,t){return Ee(e,t,!0)}function De(e){var t=e.size,n=e.aspectRatio,r=e.ignoreMinimum,i=e.sizeRestrictions;return!!((t.correctRatio||H(t)>=n.minimum&&H(t)<=n.maximum)&&t.height<=i.maxHeight&&t.width<=i.maxWidth&&t.width&&t.height&&(r||t.height>=i.minHeight&&t.width>=i.minWidth))}function Oe(e,t){return(e.width-t.width)**2+(e.height-t.height)**2}function Y(e){var t=e.width,n=e.height,r=e.sizeRestrictions,i={minimum:e.aspectRatio&&e.aspectRatio.minimum||0,maximum:e.aspectRatio&&e.aspectRatio.maximum||1/0},a={width:Math.max(r.minWidth,Math.min(r.maxWidth,t)),height:Math.max(r.minHeight,Math.min(r.maxHeight,n))};function o(e,a){return a===void 0&&(a=!1),e.reduce((function(e,o){return De({size:o,aspectRatio:i,sizeRestrictions:r,ignoreMinimum:a})&&(!e||Oe(o,{width:t,height:n})<Oe(e,{width:t,height:n}))?o:e}),null)}var s=[];i&&[i.minimum,i.maximum].forEach((function(e){e&&s.push({width:a.width,height:a.width/e,correctRatio:!0},{width:a.height*e,height:a.height,correctRatio:!0})})),De({size:a,aspectRatio:i,sizeRestrictions:r})&&s.push(a);var c=o(s)||o(s,!0);return c&&{width:c.width,height:c.height}}function ke(e){var t=e.event,n=e.coordinates,r=e.positionRestrictions,i=r===void 0?{}:r,a=B(n,t.directions);return B(a,W(a,i))}function Ae(e){var t=e.coordinates,n=e.transform,r=e.imageSize,i=e.sizeRestrictions,a=e.positionRestrictions,o=e.aspectRatio,s=e.visibleArea,c=function(e,t){return ke({coordinates:e,positionRestrictions:a,event:new j({left:t.left-e.left,top:t.top-e.top})})},l=w({},t);return(Array.isArray(n)?n:[n]).forEach((function(e){var t={};E((t=typeof e==`function`?e({coordinates:l,imageSize:r,visibleArea:s}):e).width)&&E(t.height)||(l=function(e,t){return c(w(w(w({},e),Y({width:t.width,height:t.height,sizeRestrictions:i,aspectRatio:o})),{left:0,top:0}),{left:e.left,top:e.top})}(l,w(w({},l),t))),E(t.left)&&E(t.top)||(l=c(l,w(w({},l),t)))})),l}function je(e){e.event;var t=e.getAreaRestrictions,n=e.boundaries,r=e.coordinates,i=e.visibleArea;e.aspectRatio;var a=e.stencilSize,o=e.sizeRestrictions,s=e.positionRestrictions;e.stencilReference;var c,l,u,d=w({},r),f=w({},i),p=w({},a);c=H(p),l=H(d),u===void 0&&(u=.001),(c===0||l===0?Math.abs(l-c)<u:Math.abs(l/c)<1+u&&Math.abs(l/c)>1-u)||(d=w(w({},d),Y({sizeRestrictions:o,width:d.width,height:d.height,aspectRatio:{minimum:H(p),maximum:H(p)}})));var m=K(f=V(f,d.width*n.width/(f.width*p.width)),t({visibleArea:f,type:`resize`}));return m!==1&&(f=V(f,m),d=V(d,m)),f=q(f=B(f,F(I(d),I(f))),t({visibleArea:f,type:`move`})),{coordinates:d=q(d,J(P(f),s)),visibleArea:f}}function Me(e){var t=e.event,n=e.getAreaRestrictions,r=e.boundaries,i=e.coordinates,a=e.visibleArea;e.aspectRatio,e.stencilSize,e.sizeRestrictions;var o=e.positionRestrictions;e.stencilReference;var s=w({},i),c=w({},a);if(i&&a&&t.type!==`manipulateImage`){var l={width:0,height:0};c.width,r.width,H(r)>H(s)?(l.height=.8*r.height,l.width=l.height*H(s)):(l.width=.8*r.width,l.height=l.width*H(s));var u=K(c=V(c,s.width*r.width/(c.width*l.width)),n({visibleArea:c,type:`resize`}));c=V(c,u),u!==1&&(l.height/=u,l.width/=u),c=q(c=B(c,F(I(s),I(c))),n({visibleArea:c,type:`move`})),s=q(s,J(P(c),o))}return{coordinates:s,visibleArea:c}}function Ne(e){var t=e.event,n=e.coordinates,r=e.visibleArea,i=e.getAreaRestrictions,a=w({},r),o=w({},n);if(t.type===`setCoordinates`){var s=Math.max(0,o.width-a.width),c=Math.max(0,o.height-a.height);s>c?a=V(a,Math.min(o.width/a.width,U(a,i({visibleArea:a,type:`resize`})))):c>s&&(a=V(a,Math.min(o.height/a.height,U(a,i({visibleArea:a,type:`resize`}))))),a=q(a=B(a,z(W(o,P(a)))),i({visibleArea:a,type:`move`}))}return{visibleArea:a,coordinates:o}}function Pe(e){var t=e.imageSize,n=e.visibleArea,r=e.coordinates,i=n||t;return{left:(n?n.left:0)+i.width/2-r.width/2,top:(n?n.top:0)+i.height/2-r.height/2}}function Fe(e){var t=e.imageSize,n=e.visibleArea,r=e.aspectRatio,i=e.sizeRestrictions,a=n||t,o=Math.min(r.maximum||1/0,Math.max(r.minimum||0,H(a))),s=a.width<a.height?{width:.8*a.width,height:.8*a.width/o}:{height:.8*a.height,width:.8*a.height*o};return Y(w(w({},s),{aspectRatio:r,sizeRestrictions:i}))}function Ie(e){var t,n,r=e.imageSize,i=e.visibleArea,a=e.boundaries,o=e.aspectRatio,s=e.sizeRestrictions,c=e.stencilSize,l=i||r;return H(l)>H(a)?n=(t=c.height*l.height/a.height)*H(c):t=(n=c.width*l.width/a.width)/H(c),Y({width:n,height:t,aspectRatio:o,sizeRestrictions:s})}function Le(e){var t=e.getAreaRestrictions,n=e.coordinates,r=e.imageSize,i=H(e.boundaries);
vendor: 4,206 bytes, line 2
2if(n){var a={height:Math.max(n.height,r.height),width:Math.max(n.width,r.width)},o=Se({width:H(a)>i?a.width:a.height*i,height:H(a)>i?a.width/i:a.height},we(t())),s={left:n.left+n.width/2-o.width/2,top:n.top+n.height/2-o.height/2,width:o.width,height:o.height},c=L(n,P(w({left:0,top:0},r))),l={};return!c.left&&!c.right&&s.width<=r.width&&(l.left=0,l.right=r.width),!c.top&&!c.bottom&&s.height<=r.height&&(l.top=0,l.bottom=r.height),q(s,l)}var u=H(r);return o={height:u>i?r.height:r.width/i,width:u>i?r.height*i:r.width},{left:r.width/2-o.width/2,top:r.height/2-o.height/2,width:o.width,height:o.height}}function X(e,t){return Ee(e,P(t))}function Re(e){var t=e.event,n=e.coordinates,r=e.visibleArea,i=e.sizeRestrictions,a=e.getAreaRestrictions,o=e.positionRestrictions,s=e.adjustStencil,c=t.scale,l=t.move,u=w({},r),d=w({},n),f=1,p=1,m=c.factor&&Math.abs(c.factor-1)>.001;u=B(u,{left:l.left||0,top:l.top||0});var h={stencil:{minimum:Math.max(i.minWidth?i.minWidth/d.width:0,i.minHeight?i.minHeight/d.height:0),maximum:Math.min(i.maxWidth?i.maxWidth/d.width:1/0,i.maxHeight?i.maxHeight/d.height:1/0,U(d,o))},area:{maximum:U(u,a({visibleArea:u,type:`resize`}))}};c.factor&&m&&(c.factor<1?(p=Math.max(c.factor,h.stencil.minimum))>1&&(p=1):c.factor>1&&(p=Math.min(c.factor,Math.min(h.area.maximum,h.stencil.maximum)))<1&&(p=1)),p&&(u=V(u,p,c.center));var g=n.left-r.left,_=r.width+r.left-(n.width+n.left),v=n.top-r.top,y=r.height+r.top-(n.height+n.top);return u=q(u=B(u,W(u,{left:o.left===void 0?void 0:o.left-g*p,top:o.top===void 0?void 0:o.top-v*p,bottom:o.bottom===void 0?void 0:o.bottom+y*p,right:o.right===void 0?void 0:o.right+_*p})),a({visibleArea:u,type:`move`})),d.width*=p,d.height*=p,d.left=u.left+g*p,d.top=u.top+v*p,d=q(d,J(P(u),o)),c.factor&&m&&s&&(c.factor>1?f=Math.min(h.area.maximum,c.factor)/p:c.factor<1&&(f=Math.max(d.height/u.height,d.width/u.width,c.factor/p)),f!==1&&(u=B(u=q(u=V(u,f,c.factor>1?c.center:I(d)),a({visibleArea:u,type:`move`})),z(W(d,P(u)))))),{coordinates:d,visibleArea:u}}function ze(e){var t=e.aspectRatio,n=e.getAreaRestrictions,r=e.coordinates,i=e.visibleArea,a=e.sizeRestrictions,o=e.positionRestrictions,s=e.imageSize,c=e.previousImageSize,l=e.angle,u=w({},r),d=w({},i),f=G(I(w({left:0,top:0},c)),l);return(u=w(w({},Y({sizeRestrictions:a,aspectRatio:t,width:u.width,height:u.height})),G(I(u),l))).left-=f.left-s.width/2+u.width/2,u.top-=f.top-s.height/2+u.height/2,d=V(d,K(d,n({visibleArea:d,type:`resize`}))),{coordinates:u=q(u,o),visibleArea:d=q(d=B(d,F(I(u),I(r))),n({visibleArea:d,type:`move`}))}}function Be(e){var t=e.flip,n=e.previousFlip,r=e.rotate;e.aspectRatio;var i=e.getAreaRestrictions,a=e.coordinates,o=e.visibleArea,s=e.imageSize,c=w({},a),l=w({},o),u=n.horizontal!==t.horizontal,d=n.vertical!==t.vertical;if(u||d){var f=G({left:s.width/2,top:s.height/2},-r),p=G(I(c),-r),m=G({left:u?f.left-(p.left-f.left):p.left,top:d?f.top-(p.top-f.top):p.top},r);c=B(c,F(m,I(c))),p=G(I(l),-r),l=q(l=B(l,F(m=G({left:u?f.left-(p.left-f.left):p.left,top:d?f.top-(p.top-f.top):p.top},r),I(l))),i({visibleArea:l,type:`move`}))}return{coordinates:c,visibleArea:l}}function Ve(e){var t=e.directions,n=e.coordinates,r=e.positionRestrictions,i=r===void 0?{}:r,a=e.sizeRestrictions,o=e.preserveRatio,s=e.compensate,c=w({},t),l=R(n,c).width,u=R(n,c).height;l<0&&(c.left<0&&c.right<0?(c.left=-(n.width-a.minWidth)/(c.left/c.right),c.right=-(n.width-a.minWidth)/(c.right/c.left)):c.left<0?c.left=-(n.width-a.minWidth):c.right<0&&(c.right=-(n.width-a.minWidth))),u<0&&(c.top<0&&c.bottom<0?(c.top=-(n.height-a.minHeight)/(c.top/c.bottom),c.bottom=-(n.height-a.minHeight)/(c.bottom/c.top)):c.top<0?c.top=-(n.height-a.minHeight):c.bottom<0&&(c.bottom=-(n.height-a.minHeight)));var d=L(R(n,c),i);s&&(d.left&&d.left>0&&d.right===0?(c.right+=d.left,c.left-=d.left):d.right&&d.right>0&&d.left===0&&(c.left+=d.right,c.right-=d.right),d.top&&d.top>0&&d.bottom===0?(c.bottom+=d.top,c.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(c.top+=d.bottom,c.bottom-=d.bottom),d=L(R(n,c),i));var f={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(N.forEach((function(e){var t=d[e];t&&c[e]&&(f[e]=Math.max(0,1-t/c[e]))})),o){var p=Math.min.apply(null,N.map((function(e){return f[e]})));
2p!==1/0&&N.forEach((function(e){c[e]*=p}))}else N.forEach((function(e){f[e]!==1/0&&(c[e]*=f[e])}));if(l=R(n,c).width,u=R(n,c).height,c.right+c.left&&(l>a.maxWidth?f.width=(a.maxWidth-n.width)/(c.right+c.left):l<a.minWidth&&(f.width=(a.minWidth-n.width)/(c.right+c.left))),c.bottom+c.top&&(u>a.maxHeight?f.height=(a.maxHeight-n.height)/(c.bottom+c.top):u<a.minHeight&&(f.height=(a.minHeight-n.height)/(c.bottom+c.top))),o){var m=Math.min(f.width,f.height);m!==1/0&&N.forEach((function(e){c[e]*=m}))}else f.width!==1/0&&he.forEach((function(e){c[e]*=f.width})),f.height!==1/0&&ge.forEach((function(e){c[e]*=f.height}));return c}function Z(e,t,n){return t==0&&n==0?e/2:t==0?0:n==0?e:e*Math.abs(t/(t+n))}var He=S(`vue-simple-handler`),Ue=S(`vue-simple-handler-wrapper`),We={name:`SimpleHandler`,components:{HandlerWrapper:fe},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var e,t=(g(e={},this.horizontalPosition,!!this.horizontalPosition),g(e,this.verticalPosition,!!this.verticalPosition),g(e,`${this.horizontalPosition}-${this.verticalPosition}`,!!(this.verticalPosition&&this.horizontalPosition)),g(e,`hover`,this.hover),e);return{default:x(He(t),this.defaultClass,this.hover&&this.hoverClass),wrapper:x(Ue(t),this.wrapperClass)}}},methods:{onDrag:function(e){this.$emit(`drag`,e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit(`drag-end`)}},emits:[`drag`,`drag-end`]};We.render=function(n,r,i,o,l,u){var d=t(`HandlerWrapper`);return a(),c(d,{class:u.classes.wrapper,"vertical-position":i.verticalPosition,"horizontal-position":i.horizontalPosition,disabled:i.disabled,onDrag:u.onDrag,onDragEnd:u.onDragEnd,onEnter:u.onEnter,onLeave:u.onLeave},{default:s((function(){return[e(`div`,{class:u.classes.default},null,2)]})),_:1},8,[`class`,`vertical-position`,`horizontal-position`,`disabled`,`onDrag`,`onDragEnd`,`onEnter`,`onLeave`])};var Ge=S(`vue-simple-line`),Ke=S(`vue-simple-line-wrapper`),qe={name:`SimpleLine`,components:{LineWrapper:me},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:x(Ge(g({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:x(Ke(g({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(e){this.$emit(`drag`,e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit(`drag-end`)}},emits:[`drag`,`drag-end`]};qe.render=function(n,r,i,o,l,u){var d=t(`LineWrapper`);return a(),c(d,{class:u.classes.wrapper,position:i.position,disabled:i.disabled,onDrag:u.onDrag,onDragEnd:u.onDragEnd,onEnter:u.onEnter,onLeave:u.onLeave},{default:s((function(){return[e(`div`,{class:u.classes.root},null,2)]})),_:1},8,[`class`,`position`,`disabled`,`onDrag`,`onDragEnd`,`onEnter`,`onLeave`])};var Je=S(`vue-bounding-box`),Ye=[`east`,`west`,null],Xe=[`south`,`north`,null],Ze={name:`BoundingBox`,props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return We}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return qe}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var e=[];return Ye.forEach((function(t){Xe.forEach((function(n){if(t!==n){var r=re(t,n),i=r.name,a=r.classname;e.push({name:i,classname:a,verticalDirection:n,horizontalDirection:t})}}))})),{points:e}},computed:{style:function(){var e={};return this.width&&this.height&&(e.width=`${this.width}px`,e.height=`${this.height}px`,this.transitions&&this.transitions.enabled&&(e.transition=`${this.transitions.time}ms ${this.transitions.timingFunction}`)),e},classes:function(){var e=this.handlersClasses,t=this.handlersWrappersClasses,n=this.linesClasses,r=this.linesWrappersClasses;return{root:Je(),handlers:e,handlersWrappers:t,lines:n,linesWrappers:r}},lineNodes:function(){var e=this,t=[];
2return this.points.forEach((function(n){n.horizontalDirection&&n.verticalDirection||!e.lines[n.name]||t.push({name:n.name,component:e.linesComponent,class:x(e.classes.lines.default,e.classes.lines[n.name],!e.resizable&&e.classes.lines.disabled),wrapperClass:x(e.classes.linesWrappers.default,e.classes.linesWrappers[n.name],!e.resizable&&e.classes.linesWrappers.disabled),hoverClass:e.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!e.resizable})})),t},handlerNodes:function(){var e=this,t=[],n=this.width,r=this.height;return this.points.forEach((function(i){if(e.handlers[i.name]){var a={name:i.name,component:e.handlersComponent,class:x(e.classes.handlers.default,e.classes.handlers[i.name]),wrapperClass:x(e.classes.handlersWrappers.default,e.classes.handlersWrappers[i.name]),hoverClass:e.classes.handlers.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection,disabled:!e.resizable};if(n&&r){var o=i.horizontalDirection,s=i.verticalDirection,c=o===`east`?n:o===`west`?0:n/2,l=s===`south`?r:s===`north`?0:r/2;a.wrapperClass=Je(`handler`),a.wrapperStyle={transform:`translate(${c}px, ${l}px)`},e.transitions&&e.transitions.enabled&&(a.wrapperStyle.transition=`${e.transitions.time}ms ${e.transitions.timingFunction}`)}else a.wrapperClass=Je(`handler`,g({},i.classname,!0));t.push(a)}})),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})},beforeUnmount: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=[]},methods:{onEnd:function(){this.$emit(`resize-end`)},onHandlerDrag:function(e,t,n){var r,i=e.shift(),a=i.left,o=i.top,s={left:0,right:0,top:0,bottom:0};t===`west`?s.left-=a:t===`east`&&(s.right+=a),n===`north`?s.top-=o:n===`south`&&(s.bottom+=o),!n&&t?r=`width`:n&&!t&&(r=`height`),this.resizable&&this.$emit(`resize`,new le(s,{allowedDirections:{left:t===`west`||!t,right:t===`east`||!t,bottom:n===`south`||!n,top:n===`north`||!n},preserveAspectRatio:e.nativeEvent&&e.nativeEvent.shiftKey,respectDirection:r}))}},emits:[`resize`,`resize-end`]};Ze.render=function(t,n,i,s,d,f){return a(),c(`div`,{ref:`box`,class:f.classes.root,style:f.style},[u(t.$slots,`default`),e(`div`,null,[(a(!0),c(o,null,r(f.lineNodes,(function(e){return a(),c(l(e.component),{key:e.name,"default-class":e.class,"hover-class":e.hoverClass,"wrapper-class":e.wrapperClass,position:e.name,disabled:e.disabled,onDrag:function(t){return f.onHandlerDrag(t,e.horizontalDirection,e.verticalDirection)},onDragEnd:n[1]||=function(e){return f.onEnd()}},null,8,[`default-class`,`hover-class`,`wrapper-class`,`position`,`disabled`,`onDrag`])})),128))]),(a(!0),c(o,null,r(f.handlerNodes,(function(e){return a(),c(`div`,{key:e.name,style:e.wrapperStyle,class:e.wrapperClass},[(a(),c(l(e.component),{"default-class":e.class,"hover-class":e.hoverClass,"wrapper-class":e.wrapperClass,"horizontal-position":e.horizontalDirection,"vertical-position":e.verticalDirection,disabled:e.disabled,onDrag:function(t){return f.onHandlerDrag(t,e.horizontalDirection,e.verticalDirection)},onDragEnd:n[2]||=function(e){return f.onEnd()}},null,8,[`default-class`,`hover-class`,`wrapper-class`,`horizontal-position`,`vertical-position`,`disabled`,`onDrag`]))],6)})),128))],6)};var Qe=S(`vue-draggable-area`),$e={name:`DraggableArea`,props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:Qe()}}},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})},beforeUnmount: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.touchStarted=!1},methods:{onTouchStart:function(e){if(e.cancelable){var t=this.movable&&e.touches.length===1;t&&(this.touches=v(e.touches)),(this.touchStarted||t)&&(e.preventDefault(),e.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(e){this.touches.length>=1&&(this.touchStarted?(this.processMove(e,e.touches),e.preventDefault(),e.stopPropagation()):ce({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:e.touches[0].clientX,y:e.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(e){if(this.movable&&e.button===0){var t={fake:!0,clientX:e.clientX,clientY:e.clientY};this.touches=[t],this.initAnchor(t),e.stopPropagation()}},onMouseMove:function(e){this.touches.length&&(this.processMove(e,[{fake:!0,clientX:e.clientX,clientY:e.clientY}]),e.preventDefault&&e.cancelable&&e.preventDefault(),e.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(e){var t=this.$refs.container.getBoundingClientRect(),n=t.left,r=t.top;this.anchor={x:e.clientX-n,y:e.clientY-r}},processMove:function(e,t){var n=v(t);if(this.touches.length){var r=this.$refs.container.getBoundingClientRect(),i=r.left,a=r.top;this.touches.length===1&&n.length===1&&this.$emit(`move`,new j({left:n[0].clientX-(i+this.anchor.x),top:n[0].clientY-(a+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit(`move-end`),this.touches=[]}},emits:[`move`,`move-end`]};$e.render=function(e,t,n,r,i,o){return a(),c(`div`,{ref:`container`,onTouchstart:t[1]||=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)},onMousedown:t[2]||=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)}},[u(e.$slots,`default`)],544)};function et(e){return{rotate:e.rotate||0,flip:{horizontal:e?.flip?.horizontal||!1,vertical:e?.flip?.vertical||!1}}}function tt(e){return new Promise((function(t,n){try{if(e)if(/^data:/i.test(e))t
2(function(e){e=e.replace(/^data:([^;]+);base64,/gim,``);for(var t=atob(e),n=t.length,r=new ArrayBuffer(n),i=new Uint8Array(r),a=0;a<n;a++)i[a]=t.charCodeAt(a);return r}(e));else if(/^blob:/i.test(e)){var r=new FileReader;r.onload=function(e){t(e.target.result)},a=e,o=function(e){r.readAsArrayBuffer(e)},(s=new XMLHttpRequest).open(`GET`,a,!0),s.responseType=`blob`,s.onload=function(){this.status!=200&&this.status!==0||o(this.response)},s.send()}else{var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState===4&&(i.status===200||i.status===0?t(i.response):n(`Warning: could not load an image to parse its orientation`),i=null)},i.onprogress=function(){i.getResponseHeader(`content-type`)!==`image/jpeg`&&i.abort()},i.withCredentials=!1,i.open(`GET`,e,!0),i.responseType=`arraybuffer`,i.send(null)}else n(`Error: the image is empty`)}catch(e){n(e)}var a,o,s}))}function nt(e){var t=e.rotate,n=e.flip,r=e.scaleX,i=e.scaleY,a=``;return a+=` rotate(`+t+`deg) `,a+=` scaleX(`+r*(n.horizontal?-1:1)+`) `,a+=` scaleY(`+i*(n.vertical?-1:1)+`) `}function rt(e){try{var t,n=new DataView(e),r=void 0,i=void 0,a=void 0,o=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var s=n.byteLength,c=2;c+1<s;){if(n.getUint8(c)===255&&n.getUint8(c+1)===225){a=c;break}c++}if(a&&(r=a+10,function(e,t,n){var r,i=``;for(r=t,n+=t;r<n;r++)i+=String.fromCharCode(e.getUint8(r));return i}(n,a+4,4)===`Exif`)){var l=n.getUint16(r);if(((i=l===18761)||l===19789)&&n.getUint16(r+2,i)===42){var u=n.getUint32(r+4,i);u>=8&&(o=r+u)}}if(o){for(var d=n.getUint16(o,i),f=0;f<d;f++)if(c=o+12*f+2,n.getUint16(c,i)===274){c+=8,t=n.getUint16(c,i),n.setUint16(c,1,i);break}}return t}catch{return null}}function it(e,t){var n=t.getBoundingClientRect(),r=n.left,i=n.top,a={left:0,top:0},o=0;return e.forEach((function(t){a.left+=(t.clientX-r)/e.length,a.top+=(t.clientY-i)/e.length})),e.forEach((function(e){o+=ce({x:a.left,y:a.top},{x:e.clientX-r,y:e.clientY-i})})),{centerMass:a,spread:o,count:e.length}}var at={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},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})},beforeUnmount:function(){window.removeEventListener(`mouseup`,this.onMouseUp),window.removeEventListener(`mousemove`,this.onMouseMove),window.removeEventListener(`touchmove`,this.onTouchMove),window.removeEventListener(`touchend`,this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=C(this.processEnd),this.touches=[]},methods:{processMove:function(e,t){if(this.touches.length){if(this.touches.length===1&&t.length===1)this.$emit(`move`,new A({left:this.touches[0].clientX-t[0].clientX,top:this.touches[0].clientY-t[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=it(t,this.$refs.container),r=this.oldGeometricProperties;r.count===n.count&&r.count>1&&this.$emit(`resize`,new A({left:r.centerMass.left-n.centerMass.left,top:r.centerMass.top-n.centerMass.top},{factor:r.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=t}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit(`transform-end`))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(e){return this.eventsFilter?!1!==this.eventsFilter(e,this.transforming):(e.preventDefault(),e.stopPropagation(),!0)},onTouchStart:function(e){if(e.cancelable&&(this.touchMove||this.touchResize&&e.touches.length>1)&&this.processEvent(e)){var t=this.$refs.container,n=t.getBoundingClientRect(),r=n.left,i=n.top,a=n.bottom,o=n.right;this.touches=v(e.touches).filter((function(e){return e.clientX>r&&e.clientX<o&&e.clientY>i&&e.clientY<a})),this.oldGeometricProperties=it(this.touches,t)}},onTouchEnd:function(e){e.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(e){var t=this;if(this.touches.length){var n=v(e.touches).filter((function(e){return!e.identifier||t.touches.find((function(t){return t.identifier===e.identifier}))}));this.processEvent(e)&&(this.processMove(e,n),this.processStart())}},onMouseDown:function(e){if(this.mouseMove&&`buttons`in e&&e.buttons===1&&this.processEvent(e)){var t={fake:!0,clientX:e.clientX,clientY:e.clientY};this.touches=[t],this.processStart()}},onMouseMove:function(e){this.touches.length&&this.processEvent(e)&&this.processMove(e,[{clientX:e.clientX,clientY:e.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(e){if(this.wheelResize&&this.processEvent(e)){var t=this.$refs.container.getBoundingClientRect(),n=t.left,r=t.top,i=1+this.wheelResize.ratio*(o=e.deltaY||e.detail||e.
2wheelDelta,(s=+o)==0||se(s)?s:s>0?1:-1),a={left:e.clientX-n,top:e.clientY-r};this.$emit(`resize`,new A({},{factor:i,center:a})),this.touches.length||this.debouncedProcessEnd()}var o,s}},emits:[`resize`,`move`,`transform-end`]};at.render=function(e,t,n,r,i,o){return a(),c(`div`,{ref:`container`,onTouchstart:t[1]||=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)},onMousedown:t[2]||=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)},onWheel:t[3]||=function(){return o.onWheel&&o.onWheel.apply(o,arguments)}},[u(e.$slots,`default`)],544)};var ot={components:{TransformableImage:at},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:[`resize`,`move`]};ot.render=function(e,n,r,i,o,l){var d=t(`transformable-image`);return a(),c(d,{"touch-move":r.touchMove,"touch-resize":r.touchResize,"mouse-move":r.mouseMove,"wheel-resize":r.wheelResize,onMove:n[1]||=function(t){return e.$emit(`move`,t)},onResize:n[2]||=function(t){return e.$emit(`resize`,t)}},{default:s((function(){return[u(e.$slots,`default`)]})),_:3},8,[`touch-move`,`touch-resize`,`mouse-move`,`wheel-resize`])};var Q=S(`vue-preview`),st={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Q({fill:this.fill}),wrapper:Q(`wrapper`),imageWrapper:Q(`image-wrapper`),image:x(Q(`image`),this.imageClass)}},style:function(){if(this.fill)return{};var e={};return this.width&&(e.width=`${this.size.width}px`),this.height&&(e.height=`${this.size.height}px`),this.transitions&&this.transitions.enabled&&(e.transition=`${this.transitions.time}ms ${this.transitions.timingFunction}`),e},wrapperStyle:function(){var e={width:`${this.size.width}px`,height:`${this.size.height}px`,left:`calc(50% - ${this.size.width/2}px)`,top:`calc(50% - ${this.size.height/2}px)`};return this.transitions&&this.transitions.enabled&&(e.transition=`${this.transitions.time}ms ${this.transitions.timingFunction}`),e},imageStyle:function(){if(this.coordinates&&this.image){var e=this.coordinates.width/this.size.width,t=h(h({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/e,scaleY:1/e}),n=this.imageSize.width,r=this.imageSize.height,i=Ce({width:n,height:r},t.rotate),a={width:`${n}px`,height:`${r}px`,left:`0px`,top:`0px`},o={rotate:{left:(n-i.width)*t.scaleX/2,top:(r-i.height)*t.scaleY/2},scale:{left:(1-t.scaleX)*n/2,top:(1-t.scaleY)*r/2}};return a.transform=`translate( 3 ${-this.coordinates.left/e-o.rotate.left-o.scale.left}px,${-this.coordinates.top/e-o.rotate.top-o.scale.top}px) `+nt(t),this.transitions&&this.transitions.enabled&&(a.transition=`${this.transitions.time}ms ${this.transitions.timingFunction}`),a}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(e){(e.width||e.height)&&this.onChangeImage()}},mounted:function(){var e=this;this.onChangeImage(),this.$refs.image.addEventListener(`load`,(function(){e.refreshImage()})),window.addEventListener(`resize`,this.refresh),window.addEventListener(`orientationchange`,this.refresh)},unmounted:function(){window.removeEventListener(`resize`,this.refresh),window.removeEventListener(`orientationchange`,this.refresh)},methods:{refreshImage:function(){var e=this.$refs.image;this.calculatedImageSize.height=e.naturalHeight,this.calculatedImageSize.width=e.naturalWidth},refresh:function(){var e=this.$refs.root;this.width||(this.calculatedSize.width=e.clientWidth),this.height||(this.calculatedSize.height=e.clientHeight)},onChangeImage:function(){var e=this.$refs.image;e&&e.complete&&this.refreshImage(),this.refresh()}}};st.render=function(t,r,i,o,s,l){return a(),c(`div`,{ref:`root`,class:l.classes.root,style:l.style},[e(`div`,{ref:`wrapper`,class:l.classes.wrapper,style:l.wrapperStyle},[n(e(`img`,{ref:`image`,src:i.image&&i.image.src,class:l.classes.image,style:l.imageStyle},null,14,[`src`]),[[f,i.image&&i.image.src]])],6)],6)};var ct={components:{Preview:st},inheritAttrs:!1};ct.render=function(e,n,r,o,s,l){var u=t(`preview`);return a(),c(u,i(e.$attrs,{fill:!0}),null,16)};var lt=S(`vue-rectangle-stencil`),ut={name:`RectangleStencil`,components:{StencilPreview:ct,BoundingBox:Ze,DraggableArea:$e},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return We}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return qe}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object}
3,movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:x(lt({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:x(lt(`preview`),this.previewClass),boundingBox:x(lt(`bounding-box`),this.boundingBoxClass)}},style:function(){var e=this.stencilCoordinates,t=e.height,n=e.width,r=e.left,i=e.top,a={width:`${n}px`,height:`${t}px`,transform:`translate(${r}px, ${i}px)`};return this.transitions&&this.transitions.enabled&&(a.transition=`${this.transitions.time}ms ${this.transitions.timingFunction}`),a}},methods:{onMove:function(e){this.$emit(`move`,e),this.moving=!0},onMoveEnd:function(){this.$emit(`move-end`),this.moving=!1},onResize:function(e){this.$emit(`resize`,e),this.resizing=!0},onResizeEnd:function(){this.$emit(`resize-end`),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:[`resize`,`resize-end`,`move`,`move-end`]};ut.render=function(n,r,i,o,l,u){var d=t(`stencil-preview`),f=t(`draggable-area`),p=t(`bounding-box`);return a(),c(`div`,{class:u.classes.stencil,style:u.style},[e(p,{width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,transitions:i.transitions,class:u.classes.boundingBox,handlers:i.handlers,"handlers-component":i.handlersComponent,"handlers-classe
3s":i.handlersClasses,"handlers-wrappers-classes":i.handlersWrappersClasses,lines:i.lines,"lines-component":i.linesComponent,"lines-classes":i.linesClasses,"lines-wrappers-classes":i.linesWrappersClasses,resizable:i.resizable,onResize:u.onResize,onResizeEnd:u.onResizeEnd},{default:s((function(){return[e(f,{movable:i.movable,onMove:u.onMove,onMoveEnd:u.onMoveEnd},{default:s((function(){return[e(d,{image:i.image,coordinates:i.coordinates,width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,class:u.classes.preview,transitions:i.transitions},null,8,[`image`,`coordinates`,`width`,`height`,`class`,`transitions`])]})),_:1},8,[`movable`,`onMove`,`onMoveEnd`])]})),_:1},8,[`width`,`height`,`transitions`,`class`,`handlers`,`handlers-component`,`handlers-classes`,`handlers-wrappers-classes`,`lines`,`lines-component`,`lines-classes`,`lines-wrappers-classes`,`resizable`,`onResize`,`onResizeEnd`])],6)};var dt=[`transitions`],$=S(`vue-advanced-cropper`),ft={name:`Cropper`,components:{BackgroundWrapper:ot},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return ut}},backgroundWrapperComponent:{type:[Object,String],default:function(){return ot}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:`fit-area`,validator:function(e){return ve.indexOf(e)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(e){return typeof e!=`string`||e===`fill`||e===`fit`}},priority:{type:String,default:`coordinates`},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(e){var t=e.event,n=e.coordinates,r=e.aspectRatio,i=e.positionRestrictions,a=e.sizeRestrictions,o=w(w({},n),{right:n.left+n.width,bottom:n.top+n.height}),s=t.params||{},c=w({},t.directions),l=s.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};a.widthFrozen&&(c.left=0,c.right=0),a.heightFrozen&&(c.top=0,c.bottom=0),N.forEach((function(e){l[e]||(c[e]=0)}));var u=R(o,c=Ve({coordinates:o,directions:c,sizeRestrictions:a,positionRestrictions:i})).width,d=R(o,c).height,f=s.preserveRatio?H(o):xe(u/d,r);if(f){var p=s.respectDirection;if(p||=o.width>=o.height||f===1?`width`:`height`,p===`width`){var m=u/f-o.height;if(l.top&&l.bottom){var h=c.top,g=c.bottom;c.bottom=Z(m,g,h),c.top=Z(m,h,g)}else l.bottom?c.bottom=m:l.top?c.top=m:l.right?c.right=0:l.left&&(c.left=0)}else if(p===`height`){var _=o.width-d*f;if(l.left&&l.right){var v=c.left,y=c.right;c.left=-Z(_,v,y),c.right=-Z(_,y,v)}else l.left?c.left=-_:l.right?c.right=-_:l.top?c.top=0:l.bottom&&(c.bottom=0)}c=Ve({directions:c,coordinates:o,sizeRestrictions:a,positionRestrictions:i,preserveRatio:!0,compensate:s.compensate})}return u=R(o,c).width,d=R(o,c).height,(f=s.preserveRatio?H(o):xe(u/d,r))&&Math.abs(f-u/d)>.001&&N.forEach((function(e){l[e]||(c[e]=0)})),ke({event:new j({left:-c.left,top:-c.top}
3),coordinates:{width:n.width+c.right+c.left,height:n.height+c.top+c.bottom,left:n.left,top:n.top},positionRestrictions:i})}},moveAlgorithm:{type:Function,default:ke},initStretcher:{type:Function,default:function(e){var t=e.stretcher,n=e.imageSize,r=H(n);t.style.width=n.width+`px`,t.style.height=t.clientWidth/r+`px`,t.style.width=t.clientWidth+`px`}},fitCoordinates:{type:Function,default:function(e){var t=e.visibleArea,n=e.coordinates,r=e.aspectRatio,i=e.sizeRestrictions,a=e.positionRestrictions,o=w(w({},n),Y({width:n.width,height:n.height,aspectRatio:r,sizeRestrictions:{maxWidth:t.width,maxHeight:t.height,minHeight:Math.min(t.height,i.minHeight),minWidth:Math.min(t.width,i.minWidth)}}));return o=q(o=B(o,F(I(n),I(o))),J(P(t),a))}},fitVisibleArea:{type:Function,default:function(e){var t=e.visibleArea,n=e.boundaries,r=e.getAreaRestrictions,i=e.coordinates,a=w({},t);a.height=a.width/H(n),a.top+=(t.height-a.height)/2,(i.height-a.height>0||i.width-a.width>0)&&(a=V(a,Math.max(i.height/a.height,i.width/a.width)));var o=z(W(i,P(a=V(a,K(a,r({visibleArea:a,type:`resize`}))))));return a.width<i.width&&(o.left=0),a.height<i.height&&(o.top=0),a=q(a=B(a,o),r({visibleArea:a,type:`move`}))}},areaRestrictionsAlgorithm:{type:Function,default:function(e){var t=e.visibleArea,n=e.boundaries,r=e.imageSize,i=e.imageRestriction,a=e.type,o={};return i===`fill-area`?o={left:0,top:0,right:r.width,bottom:r.height}:i===`fit-area`&&(H(n)>H(r)?(o={top:0,bottom:r.height},t&&a===`move`&&(t.width>r.width?(o.left=-(t.width-r.width)/2,o.right=r.width-o.left):(o.left=0,o.right=r.width))):(o={left:0,right:r.width},t&&a===`move`&&(t.height>r.height?(o.top=-(t.height-r.height)/2,o.bottom=r.height-o.top):(o.top=0,o.bottom=r.height)))),o}},sizeRestrictionsAlgorithm:{type:Function,default:function(e){return{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(e){var t=e.imageSize,n={};return e.imageRestriction!==`none`&&(n={left:0,top:0,right:t.width,bottom:t.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:h({},ye)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var e=function(e){return e*Math.PI/180}(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(e))+Math.abs(this.imageAttributes.height*Math.sin(e)),height:Math.abs(this.imageAttributes.width*Math.sin(e))+Math.abs(this.imageAttributes.height*Math.cos(e))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var e=O(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:O(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:e}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:`ease-in-out`,time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var e=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:E(this.minWidth)?0:k(this.minWidth),minHeight:E(this.minHeight)?0:k(this.minHeight),maxWidth:E(this.maxWidth)?1/0:k(this.maxWidth),maxHeight:E(this.maxHeight)?1/0:k(this.maxHeight)});if(e=function(e){var t=e.areaRestrictions,n=e.sizeRestrictions;e.imageSize;var r=e.boundaries,i=e.positionRestrictions;e.imageRestriction;var a=w(w({},n),{minWidth:n.minWidth===void 0?0:n.minWidth,minHeight:n.minHeight===void 0?0:n.minHeight,maxWidth:n.maxWidth===void 0?1/0:n.maxWidth,maxHeight:n.maxHeight===void 0?1/0:n.maxHeight});i.left!==void 0&&i.right!==void 0&&(a.maxWidth=Math.min(a.maxWidth,i.right-i.left)),i.bottom!==void 0&&i.top!==void 0&&(a.maxHeight=Math.min(a.maxHeight,i.bottom-i.top));var o=we(t),s=Se(r,o);return o.width<1/0&&(!a.maxWidth||a.maxWidth>s.width)&&(a.maxWidth=Math.min(a.maxWidth,s.width)),o.height<1/0&&(!a.maxHeight||a.maxHeight>s.height)&&(a.maxHeight=Math.min(a.maxHeight,s.height)),a.minWidth>a.maxWidth&&(a.minWidth=a.maxWidth,a.widthFrozen=!0),a.minHeight>a.maxHeight&&(a.minHeight=a.maxHeight,a.heightFrozen=!0),a}({sizeRestrictions:e,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:`resize`}
vendor: 5,121 bytes, line 3
3),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var t=this.getStencilSize(),n=we(this.getAreaRestrictions({visibleArea:this.visibleArea,type:`resize`}));e.maxWidth=Math.min(e.maxWidth,n.width*t.width/this.boundaries.width),e.maxHeight=Math.min(e.maxHeight,n.height*t.height/this.boundaries.height),e.maxWidth<e.minWidth&&(e.minWidth=e.maxWidth),e.maxHeight<e.minHeight&&(e.minHeight=e.maxHeight)}return e}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:$(),image:x($(`image`),this.imageClass),stencil:$(`stencil`),boundaries:x($(`boundaries`),this.boundariesClass),stretcher:x($(`stretcher`)),background:x($(`background`),this.backgroundClass),foreground:x($(`foreground`),this.foregroundClass),imageWrapper:x($(`image-wrapper`)),cropperWrapper:x($(`cropper-wrapper`))}},stencilCoordinates:function(){if(this.initialized){var e=this.coordinates,t=e.width,n=e.height,r=e.left,i=e.top;return{width:t/this.coefficient,height:n/this.coefficient,left:(r-this.visibleArea.left)/this.coefficient,top:(i-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var e={width:this.boundaries.width?`${Math.round(this.boundaries.width)}px`:`auto`,height:this.boundaries.height?`${Math.round(this.boundaries.height)}px`:`auto`,transition:`opacity ${this.transitionTime}ms`,pointerEvents:this.imageLoaded?`all`:`none`};return this.imageLoaded||(e.opacity=`0`),e},imageStyle:function(){var e=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},t={left:(e.width-this.imageSize.width)/(2*this.coefficient),top:(e.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*e.width/2,top:(1-1/this.coefficient)*e.height/2},r=h(h({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/e.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/e.height)}),i={width:`${e.width}px`,height:`${e.height}px`,left:`0px`,top:`0px`,transform:`translate(${-t.left-n.left-this.imageTransforms.translateX}px, ${-t.top-n.top-this.imageTransforms.translateY}px)`+nt(r)};return this.transitionsOptions.enabled&&(i.transition=`${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`),i}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var e=this;this.$nextTick((function(){e.resetCoordinates(),e.runAutoZoom(`setCoordinates`),e.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(e,t){[`aspectRatio`,`minAspectRatio`,`maxAspectRatio`].find((function(n){return e[n]!==t[n]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=C(this.update,this.debounce),this.debouncedDisableTransitions=C(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener(`load`,this.onSuccessLoadImage),this.$refs.image.addEventListener(`error`,this.onFailLoadImage),this.onChangeImage(),window.addEventListener(`resize`,this.refresh),window.addEventListener(`orientationchange`,this.refresh)},unmounted:function(){window.removeEventListener(`resize`,this.refresh),window.removeEventListener(`orientationchange`,this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var e=this.initialized?this.prepareResult(h({},this.coordinates)):this.defaultCoordinates(),t={rotate:this.imageTransforms.rotate%360,flip:h({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:e,visibleArea:this.visibleArea?h({},this.visibleArea):null,imageTransforms:t,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:e,visibleArea:this.visibleArea?h({},this.visibleArea):null,canvas:void 0,imageTransforms:t}},zoom:function(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).transitions,r=n===void 0||n;this.onManipulateImage(new A({},{factor:1/e,center:t}),{normalize:!1,transitions:r})},move:function(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).transitions,r=n===void 0||n;this.onManipulateImage(new A({left:e||0,top:t||0}),{normalize:!1,transitions:r})}
3,setCoordinates:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.autoZoom,i=r===void 0||r,a=n.transitions,o=a===void 0||a;this.$nextTick((function(){t.imageLoaded?(t.transitionsActive||(o&&t.enableTransitions(),t.coordinates=t.applyTransform(e),i&&t.runAutoZoom(`setCoordinates`),o&&t.debouncedDisableTransitions()),t.onChange()):t.delayedTransforms=e}))},refresh:function(){var e=this,t=this.$refs.image;if(this.src&&t)return this.initialized?this.updateVisibleArea().then((function(){e.onChange()})):this.resetVisibleArea().then((function(){e.onChange()}))},reset:function(){var e=this;return this.resetVisibleArea().then((function(){e.onChange(!1)}))},awaitRender:function(e){var t=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){e(),t.awaiting=!1})))},prepareResult:function(e){return this.roundResult?function(e){var t=e.coordinates,n=e.sizeRestrictions,r=e.positionRestrictions,i={width:Math.round(t.width),height:Math.round(t.height),left:Math.round(t.left),top:Math.round(t.top)};return i.width>n.maxWidth?i.width=Math.floor(t.width):i.width<n.minWidth&&(i.width=Math.ceil(t.width)),i.height>n.maxHeight?i.height=Math.floor(t.height):i.height<n.minHeight&&(i.height=Math.ceil(t.height)),q(i,r)}(h(h({},this.getPublicProperties()),{},{positionRestrictions:X(this.positionRestrictions,this.visibleArea),coordinates:e})):e},processAutoZoom:function(e,t,n,r){var i=this.autoZoomAlgorithm;i||=this.stencilSize?je:this.autoZoom?Me:Ne;var a=i({event:{type:e,params:r},visibleArea:t,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return h(h({},a),{},{changed:!be(a.visibleArea,t)||!be(a.coordinates,n)})},runAutoZoom:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transitions,r=n!==void 0&&n,i=_(t,dt),a=this.processAutoZoom(e,this.visibleArea,this.coordinates,i),o=a.visibleArea,s=a.coordinates,c=a.changed;r&&c&&this.enableTransitions(),this.visibleArea=o,this.coordinates=s,r&&c&&this.debouncedDisableTransitions()},normalizeEvent:function(e){return function(e){var t=e.event,n=e.visibleArea,r=e.coefficient;if(t.type===`manipulateImage`)return w(w({},t),{move:{left:t.move&&t.move.left?r*t.move.left:0,top:t.move&&t.move.top?r*t.move.top:0},scale:{factor:t.scale&&t.scale.factor?t.scale.factor:1,center:t.scale&&t.scale.center?{left:t.scale.center.left*r+n.left,top:t.scale.center.top*r+n.top}:null}});if(t.type===`resize`){var i=w(w({},t),{directions:w({},t.directions)});return N.forEach((function(e){i.directions[e]*=r})),i}if(t.type===`move`){var a=w(w({},t),{directions:w({},t.directions)});return _e.forEach((function(e){a.directions[e]*=r})),a}return t}(h(h({},this.getPublicProperties()),{},{event:e}))},getCanvas:function(){if(this.$refs.canvas){var e=this.$refs.canvas,t=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(e,t,n){var r=n.rotate,i=n.flip,a={width:t.naturalWidth,height:t.naturalHeight},o=Ce(a,r),s=e.getContext(`2d`);e.height=o.height,e.width=o.width,s.save();var c=G(I(w({left:0,top:0},a)),r);return s.translate(-(c.left-o.width/2),-(c.top-o.height/2)),s.rotate(r*Math.PI/180),s.translate(i.horizontal?a.width:0,i.vertical?a.height:0),s.scale(i.horizontal?-1:1,i.vertical?-1:1),s.drawImage(t,0,0,a.width,a.height),s.restore(),e}(this.$refs.sourceCanvas,t,this.imageTransforms):t,r=h({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:`high`,fillColor:`transparent`},this.canvas),i=function(e){return e.find((function(e){return t=e,!Number.isNaN(parseFloat(t))&&isFinite(t);var t}))}
3,a=Y({sizeRestrictions:{minWidth:i([r.width,r.minWidth])||0,minHeight:i([r.height,r.minHeight])||0,maxWidth:i([r.width,r.maxWidth])||1/0,maxHeight:i([r.height,r.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(r.maxArea&&a.width*a.height>r.maxArea){var o=Math.sqrt(r.maxArea/(a.width*a.height));a={width:Math.round(o*a.width),height:Math.round(o*a.height)}}return function(e,t,n,r,i){e.width=r?r.width:n.width,e.height=r?r.height:n.height;var a=e.getContext(`2d`);a.clearRect(0,0,e.width,e.height),i&&(i.imageSmoothingEnabled&&(a.imageSmoothingEnabled=i.imageSmoothingEnabled),i.imageSmoothingQuality&&(a.imageSmoothingQuality=i.imageSmoothingQuality),i.fillColor&&(a.fillStyle=i.fillColor,a.fillRect(0,0,e.width,e.height),a.save()));var o=n.left<0?-n.left:0,s=n.top<0?-n.top:0;a.drawImage(t,n.left+o,n.top+s,n.width,n.height,o*(e.width/n.width),s*(e.height/n.height),e.width,e.height)}(e,n,this.coordinates,a,r),e}},update:function(){this.$emit(`change`,this.getResult())},applyTransform:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&t?Te(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,r=this.visibleArea&&t?X(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return Ae({transform:e,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:r,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var e=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var t=this.defaultSize;t||=this.stencilSize?Ie:Fe;var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var r=T(t)?t({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):t,i=this.defaultPosition||Pe,a=[r,function(t){var n=t.coordinates;return h({},T(i)?i({coordinates:n,imageSize:e.imageSize,visibleArea:e.visibleArea}):e.defaultPosition)}];this.delayedTransforms&&a.push.apply(a,v(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(a,!0),this.delayedTransforms=null}},clearImage:function(){var e=this;this.imageLoaded=!1,setTimeout((function(){var t=e.$refs.stretcher;t&&(t.style.height=`auto`,t.style.width=`auto`),e.coordinates=e.defaultCoordinates(),e.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var e=this,t=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:t,imageSize:this.imageSize}),this.$nextTick().then((function(){var t={cropper:n,imageSize:e.imageSize};if(e.boundaries=T(e.defaultBoundaries)?e.defaultBoundaries(t):e.defaultBoundaries===`fit`?function(e){var t=e.cropper,n=e.imageSize,r=t.clientHeight,i=t.clientWidth,a=r,o=n.width*r/n.height;return o>i&&(o=i,a=n.height*i/n.width),{width:o,height:a}}(t):function(e){var t=e.cropper;return{width:t.clientWidth,height:t.clientHeight}}(t),!e.boundaries.width||!e.boundaries.height)throw Error(`It's impossible to fit the cropper in the current container`)}))},resetVisibleArea:function(){var e=this;return this.appliedImageTransforms=h(h({},this.defaultImageTransforms),{},{flip:h({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){e.priority!==`visible-area`&&(e.visibleArea=null,e.resetCoordinates());var t,n,r,i,a,o,s=e.defaultVisibleArea||Le;e.visibleArea=T(s)?s({imageSize:e.imageSize,boundaries:e.boundaries,coordinates:e.priority===`visible-area`?null:e.coordinates,getAreaRestrictions:e.getAreaRestrictions,stencilSize:e.getStencilSize()}):e.defaultVisibleArea,e.visibleArea=(t={visibleArea:e.visibleArea,boundaries:e.boundaries,getAreaRestrictions:e.getAreaRestrictions}
vendor: 6,454 bytes, line 3
3,n=t.visibleArea,r=t.boundaries,i=t.getAreaRestrictions,a=w({},n),o=H(r),a.width/a.height!==o&&(a.height=a.width/o),q(a,i({visibleArea:a,type:`move`}))),e.priority===`visible-area`?e.resetCoordinates():e.coordinates=e.fitCoordinates({visibleArea:e.visibleArea,coordinates:e.coordinates,aspectRatio:e.getAspectRatio(),positionRestrictions:e.positionRestrictions,sizeRestrictions:e.sizeRestrictions}),e.runAutoZoom(`resetVisibleArea`)})).catch((function(){e.visibleArea=null}))},updateVisibleArea:function(){var e=this;return this.updateBoundaries().then((function(){e.visibleArea=e.fitVisibleArea({imageSize:e.imageSize,boundaries:e.boundaries,visibleArea:e.visibleArea,coordinates:e.coordinates,getAreaRestrictions:e.getAreaRestrictions}),e.coordinates=e.fitCoordinates({visibleArea:e.visibleArea,coordinates:e.coordinates,aspectRatio:e.getAspectRatio(),positionRestrictions:e.positionRestrictions,sizeRestrictions:e.sizeRestrictions}),e.runAutoZoom(`updateVisibleArea`)})).catch((function(){e.visibleArea=null}))},onChange:function(){(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0])&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var e,t=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(e){if(ae(e))return!1;var t=window.location,n=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e)||[],r={protocol:n[1]||``,host:n[2]||``,port:n[3]||``},i=function(e){return e.port||((e.protocol||t.protocol)===`http`?80:433)};return!(!r.protocol&&!r.host&&!r.port||r.protocol&&r.protocol==t.protocol&&r.host&&r.host==t.host&&r.host&&i(r)==i(t))}(this.src)){var n=E(this.crossOrigin)?this.canvas:this.crossOrigin;!0===n&&(n=`anonymous`),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var r=(e=this.src,new Promise((function(t){tt(e).then((function(n){var r=rt(n);t(n?{source:e,arrayBuffer:n,orientation:r}:{source:e,arrayBuffer:null,orientation:null})})).catch((function(n){console.warn(n),t({source:e,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){r.then(t.onParseImage)}),this.transitionTime)}else setTimeout((function(){t.onParseImage({source:t.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit(`error`))},onSuccessLoadImage:function(){var e=this,t=this.$refs.image;t&&!this.imageLoaded&&(this.imageAttributes.height=t.naturalHeight,this.imageAttributes.width=t.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then((function(){e.$emit(`ready`),e.onChange(!1)})))},onParseImage:function(e){var t=this,n=e.source,r=e.arrayBuffer,i=e.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,r&&i&&i>1?ie(n)||!ae(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([r])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(e){for(var t=[],n=new Uint8Array(e);n.length>0;){var r=n.subarray(0,8192);t.push(String.fromCharCode.apply(null,Array.from?Array.from(r):r.slice())),n=n.subarray(8192)}return`data:image/jpeg;base64,`+btoa(t.join(``))}(r):this.imageAttributes.src=n,this.appliedImageTransforms=T(this.defaultTransforms)?et(this.defaultTransforms()):D(this.defaultTransforms)?et(this.defaultTransforms):function(e){var t=et({});if(e)switch(e){case 2:t.flip.horizontal=!0;break;case 3:t.rotate=-180;break;case 4:t.flip.vertical=!0;break;case 5:t.rotate=90,t.flip.vertical=!0;break;case 6:t.rotate=90;break;case 7:t.rotate=90,t.flip.horizontal=!0;break;case 8:t.rotate=-90}return t}(i),this.defaultImageTransforms=h(h({},this.appliedImageTransforms),{},{flip:h({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var e=t.$refs.image;e&&e.complete&&(function(e){return!!e.naturalWidth}(e)?t.onSuccessLoadImage():t.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom(`resize`,{transitions:!0})},onMoveEnd:function(){this.runAutoZoom(`move`,{transitions:!0})},onMove:function(e){var t=this;this.transitionsOptions.enabled||this.awaitRender((function(){t.coordinates=t.moveAlgorithm(h(h({},t.getPublicProperties()),{},{positionRestrictions:X(t.positionRestrictions,t.visibleArea),coordinates:t.coordinates,event:t.normalizeEvent(e)})),t.onChange()}))},onResize:function(e){var t=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var n=t.sizeRestrictions,r=Math.min(t.coordinates.width,t.coordinates.height,20*t.coefficient);t.coordinates=t.resizeAlgorithm(h(h({},t.getPublicProperties()),{},{positionRestrictions:X(t.positionRestrictions,t.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,t.visibleArea.width),maxHeight:Math.min(n.maxHeight,t.visibleArea.height),minWidth:Math.max(n.minWidth,r),minHeight:Math.max(n.minHeight,r)},event:t.normalizeEvent(e)})),t.onChange(),t.ticking=!1}))},onManipulateImage:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=t.transitions,r=n!==void 0&&n,i=t.normalize,a=i===void 0||i;r&&this.enableTransitions();var o=Re(h(h({},this.getPublicProperties()),{},{event:a?this.normalizeEvent(e):e,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),s=o.visibleArea,c=o.coordinates;this.visibleArea=s,this.coordinates=c,this.runAutoZoom(`manipulateImage`),this.onChange(),r&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.visibleArea,n=e.type,r=n===void 0?`move`:n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:t,type:r})},getAspectRatio:function(e){var t,n,r=this.stencilProps,i=r.aspectRatio,a=r.minAspectRatio,o=r.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var s=this.$refs.stencil.aspectRatios();t=s.minimum,n=s.maximum}if(E(t)&&(t=E(i)?a:i),E(n)&&(n=E(i)?o:i),!e&&(E(t)||E(n))){var c=this.getStencilSize(),l=c?H(c):null;E(t)&&(t=oe(l)?l:void 0),E(n)&&(n=oe(l)?l:void 0)}return{minimum:t,maximum:n}},getStencilSize:function(){if(this.stencilSize)return e={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height}
vendor: 4,307 bytes, line 3
3,stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},t=e.boundaries,n=e.stencilSize,r=e.aspectRatio,xe(H(i=T(n)?n({boundaries:t,aspectRatio:r}):n),r)&&(i=Y({sizeRestrictions:{maxWidth:t.width,maxHeight:t.height,minWidth:0,minHeight:0},width:i.width,height:i.height,aspectRatio:{minimum:r.minimum,maximum:r.maximum}})),(i.width>t.width||i.height>t.height)&&(i=Y({sizeRestrictions:{maxWidth:t.width,maxHeight:t.height,minWidth:0,minHeight:0},width:i.width,height:i.height,aspectRatio:{minimum:H(i),maximum:H(i)}})),i;var e,t,n,r,i},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return h({},ye)},flip:function(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).transitions,r=n===void 0||n;if(!this.transitionsActive){r&&this.enableTransitions();var i=h({},this.imageTransforms.flip),a=Be({flip:{horizontal:e?!i.horizontal:i.horizontal,vertical:t?!i.vertical:i.vertical},previousFlip:i,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),o=a.visibleArea,s=a.coordinates;e&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),t&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=o,this.coordinates=s,this.onChange(),r&&this.debouncedDisableTransitions()}},rotate:function(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).transitions,n=t===void 0||t;if(!this.transitionsActive){n&&this.enableTransitions();var r=h({},this.imageSize);this.appliedImageTransforms.rotate+=e;var i=ze({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:r,imageSize:this.imageSize,angle:e,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=i.visibleArea,o=i.coordinates,s=this.processAutoZoom(`rotateImage`,a,o);a=s.visibleArea,o=s.coordinates,this.visibleArea=a,this.coordinates=o,this.onChange(),n&&this.debouncedDisableTransitions()}}},emits:[`change`,`error`,`ready`]},pt={key:0,ref:`canvas`,style:{display:`none`}},mt={key:1,ref:`sourceCanvas`,style:{display:`none`}};ft.render=function(t,r,o,u,m,h){return a(),c(`div`,{ref:`cropper`,class:h.classes.cropper},[e(`div`,{ref:`stretcher`,class:h.classes.stretcher},null,2),e(`div`,{class:h.classes.boundaries,style:h.boundariesStyle},[(a(),c(l(o.backgroundWrapperComponent),{class:h.classes.cropperWrapper,"wheel-resize":h.settings.resizeImage.wheel,"touch-resize":h.settings.resizeImage.touch,"touch-move":h.settings.moveImage.touch,"mouse-move":h.settings.moveImage.mouse,onMove:h.onManipulateImage,onResize:h.onManipulateImage},{default:s((function(){return[e(`div`,{class:h.classes.background,style:h.boundariesStyle},null,6),e(`div`,{class:h.classes.imageWrapper},[e(`img`,{ref:`image`,crossorigin:m.imageAttributes.crossOrigin,src:m.imageAttributes.src,class:h.classes.image,style:h.imageStyle,onMousedown:r[1]||=p((function(){}),[`prevent`])},null,46,[`crossorigin`,`src`])],2),e(`div`,{class:h.classes.foreground,style:h.boundariesStyle},null,6),n((a(),c(l(o.stencilComponent),i({ref:`stencil`,image:h.image,coordinates:m.coordinates,"stencil-coordinates":h.stencilCoordinates,transitions:h.transitionsOptions},o.stencilProps,{onResize:h.onResize,onResizeEnd:h.onResizeEnd,onMove:h.onMove,onMoveEnd:h.onMoveEnd}),null,16,[`image`,`coordinates`,`stencil-coordinates`,`transitions`,`onResize`,`onResizeEnd`,`onMove`,`onMoveEnd`])),[[f,m.imageLoaded]]),o.canvas?(a(),c(`canvas`,pt,null,512)):d(``,!0),o.canvas?(a(),c(`canvas`,mt,null,512)):d(``,!0)]})),_:1},8,[`class`,`wheel-resize`,`touch-resize`,`touch-move`,`mouse-move`,`onMove`,`onResize`]))],6)],2)};export{ft as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.