PageSourceSearch

https://selfpub.ru/_next/static/chunks/1967-3122162cfd49648b.js

js selfpub.ru collected 2026-10-03 23:29:30 UTC 86,523 bytes, 2 lines download raw bytes

1try{let t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="c79c2c98-ca67-4fb9-9d51-f0b6f11b30d3",t._sentryDebugIdIdentifier="sentry-dbid-c79c2c98-ca67-4fb9-9d51-f0b6f11b30d3")}catch(t){}try{let t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="c79c2c98-ca67-4fb9-9d51-f0b6f11b30d3",t._sentryDebugIdIdentifier="sentry-dbid-c79c2c98-ca67-4fb9-9d51-f0b6f11b30d3")}catch(t){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1967],{62245:function(t,e,i){"use strict";var n,o,r,a;i.d(e,{U:function(){return o},i:function(){return n}}),(r=n||(n={})).fillArea="fillArea",r.fitArea="fitArea",r.stencil="stencil",r.none="none",(a=o||(o={})).coordinates="coordinates",a.visibleArea="visibleArea"},34526:function(){},96090:function(t,e,i){"use strict";i.d(e,{xqB:function(){return eb},U8w:function(){return eg}});var n,o,r,a=i(97582),s=i(67294);function c(t){return t.moveCoordinates||t.resizeCoordinates||t.transformImage.move||t.transformImage.rotate||t.transformImage.flip||t.transformImage.scale}function l(t,e){var i,n;return t&&e?(i=""+t+e[0].toUpperCase()+e.slice(1),n=t+"-"+e):(i=t||e,n=t||e),{camelCase:i,snakeCase:n}}function d(t){return/^blob:/.test(t)}function h(t){return d(t)||/^data:/.test(t)}function u(t){return"function"==typeof t}function m(t){return void 0===t}var p=function(t){return null!==t&&"object"==typeof t};function f(t,e,i){void 0===i&&(i={});var n={};return p(t)?(Object.keys(e).forEach(function(o){m(t[o])?n[o]=e[o]:p(e[o])?p(t[o])?n[o]=f(t[o],e[o],i[o]):n[o]=t[o]?e[o]:i[o]:!0===e[o]||!1===e[o]?n[o]=!!t[o]:n[o]=t[o]}),n):t?e:i}function v(t){var e=Number(t);return Number.isNaN(e)?t:e}function g(t){return!0===t||!1===t}function b(t){return"number"==typeof t}function w(t){return b(t)&&!(t!=t)||"string"==typeof t&&!Number.isNaN(parseFloat(t))&&isFinite(parseFloat(t))}function y(t,e){return Math.sqrt(Math.pow(t.left-e.left,2)+Math.pow(t.top-e.top,2))}function x(t,e,i){return void 0===i&&(i=.001),Math.abs(e-t)<i}function A(t,e,i){return!x(t,e,i)&&t>e}function C(t,e,i){return!x(t,e,i)&&t<e}function E(t){return new Promise(function(e){setTimeout(function(){e()},t)})}function M(t){if(!p(t))return t;var e={};return Array.isArray(t)?e=t.map(function(t){return M(t)}):Object.keys(t).forEach(function(i){return e[i]=M(t[i])}),e}function R(t,e,i){if(void 0===i&&(i=.001),b(t)&&b(e)&&x(t,e,i)||t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var n,o=void 0;if(Array.isArray(t)){if((n=t.length)!=e.length)return!1;for(o=n;0!=o--;)if(!R(t[o],e[o],i))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();var r=Object.keys(t);if((n=r.length)!==Object.keys(e).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(e,r[o]))return!1;for(o=n;0!=o--;){var a=r[o];if(!R(t[a],e[a],i))return!1}return!0}return t!=t&&e!=e}function S(){return{left:0,top:0,width:0,height:0}}function N(t,e){var i,n;function o(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];var s=Date.now()-i,c=u(e)?e():e||0;s<c&&s>=0?n=setTimeout(function(){return o.apply(void 0,r)},c-s):t.apply(void 0,r)}function r(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];i=Date.now(),n=setTimeout(function(){return o.apply(void 0,t)},u(e)?e():e||0)}return r.clear=function(){clearTimeout(n)},r}var z=["left","right","top","bottom"],P=["left","right"],W=["top","bottom"];function H(t,e){return{left:t.left-e.left,top:t.top-e.top}}function I(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function _(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function T(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function D(t){return{left:-t.left,top:-t.top}}function L(t,e){return(0,a.pi)((0,a.pi)({},t),{left:t.left+e.left,top:t.top+e.top})}function O(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function k(t,e,i,n){if(1===e)return t;if(!("left"in t)&&!("top"in t))return{width:t.width*e,height:t.height*e};
1if(!i)return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2};var o=I(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(i.left-o.left)*(n||1-e),top:t.top+t.height*(1-e)/2+(i.top-o.top)*(n||1-e)}}function U(t){return t.width/t.height}function X(t,e){return Math.min(e.maxWidth?e.maxWidth/t.width:1/0,e.maxHeight?e.maxHeight/t.height:1/0)}function Y(t,e){var i;return e.minimum&&C(t,e.minimum)?i=e.minimum:e.maximum&&A(t,e.maximum)&&(i=e.maximum),i}function B(t,e){var i=U(t),n=1;return e.minWidth>0&&e.minHeight>0?i>e.minWidth/e.minHeight?t.height<e.minHeight&&(n=e.minHeight/t.height):t.width<e.minWidth&&(n=e.minWidth/t.width):e.minWidth>0?t.width<e.minWidth&&(n=e.minWidth/t.width):e.minHeight>0&&t.height<e.minHeight&&(n=e.minHeight/t.height),e.maxWidth<1/0&&e.maxHeight<1/0?i>e.maxWidth/e.maxHeight?t.width>e.maxWidth&&(n=e.maxWidth/t.width):t.height>e.maxHeight&&(n=e.maxHeight/t.height):e.maxWidth<1/0?t.width>e.maxWidth&&(n=e.maxWidth/t.width):e.maxHeight<1/0&&t.height>e.maxHeight&&(n=e.maxHeight/t.height),n}function j(t,e){var i={left:0,top:0,right:0,bottom:0};return z.forEach(function(n){var o=e[n],r=O(t)[n];void 0!==o&&void 0!==r?"left"===n||"top"===n?i[n]=Math.max(0,o-r):i[n]=Math.max(0,r-o):i[n]=0}),i}function V(t,e){return k(t,B(t,e))}function F(t,e){var i=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(i))+Math.abs(t.height*Math.sin(i)),height:Math.abs(t.width*Math.sin(i))+Math.abs(t.height*Math.cos(i))}}function Z(t,e,i){var n=e*Math.PI/180;return i?{left:(t.left-i.left)*Math.cos(n)-(t.top-i.top)*Math.sin(n)+i.left,top:(t.left-i.left)*Math.sin(n)+(t.top-i.top)*Math.cos(n)+i.top}:{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function q(t){return{minWidth:0,minHeight:0,maxWidth:void 0!==t.right&&void 0!==t.left?t.right-t.left:1/0,maxHeight:void 0!==t.bottom&&void 0!==t.top?t.bottom-t.top:1/0}}function G(t,e){var i={};return z.forEach(function(n){var o=t[n],r=e[n];void 0!==o&&void 0!==r?"left"===n||"top"===n?i[n]=Math.max(o,r):i[n]=Math.min(o,r):void 0!==r?i[n]=r:void 0!==o&&(i[n]=o)}),i}function Q(t,e){var i={left:0,top:0},n=j(t,e);return n.left&&n.left>0?i.left=n.left:n.right&&n.right>0&&(i.left=-n.right),n.top&&n.top>0?i.top=n.top:n.bottom&&n.bottom>0&&(i.top=-n.bottom),i}function J(t,e){return L(t,Q(t,e))}function K(t){return(void 0===t&&(t={}),b(t))?{minimum:t,maximum:t}:{minimum:w(t.minimum)?t.minimum:0,maximum:w(t.maximum)?t.maximum:1/0}}function $(t,e){return(m(e.maxWidth)||!A(t.width,e.maxWidth))&&(m(e.maxHeight)||!A(t.height,e.maxHeight))&&(m(e.minHeight)||!C(t.height,e.minHeight))&&(m(e.minWidth)||!C(t.width,e.minWidth))}function tt(t,e){return(m(e.left)||!C(t.left,e.left))&&(m(e.top)||!C(t.top,e.top))&&(m(e.right)||!A(t.left+t.width,e.right))&&(m(e.bottom)||!A(t.top+t.height,e.bottom))}function te(t){var e=(0,a.pi)({},t);return e.minWidth>e.maxWidth&&(e.minWidth=e.maxWidth),e.minHeight>e.maxHeight&&(e.minHeight=e.maxHeight),e}function ti(t,e){var i=(0,a.pi)({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},e);return te({maxHeight:Math.min(t.maxHeight,i.maxHeight),minHeight:Math.max(t.minHeight,i.minHeight),maxWidth:Math.min(t.maxWidth,i.maxWidth),minWidth:Math.max(t.minWidth,i.minWidth)})}function tn(t){return!!(t&&t.visibleArea&&t.coordinates)}function to(t,e){var i;return(i=u(e.areaSizeRestrictions)?e.areaSizeRestrictions(t,e):e.areaSizeRestrictions).maxWidth<1/0&&i.maxHeight<1/0&&(U(t.boundary)>i.maxWidth/i.maxHeight?i.maxHeight=i.maxWidth/U(t.boundary):i.maxWidth=i.maxHeight*U(t.boundary)),te(i)}function tr(t,e){return u(e.areaPositionRestrictions)?e.areaPositionRestrictions(t,e):e.areaPositionRestrictions}function ta(t,e){var i,n,o;return i=u(e.sizeRestrictions)?e.sizeRestrictions(t,e):e.sizeRestrictions,n=ts(t,e),o={minWidth:w(i.minWidth)?v(i.minWidth):0,minHeight:w(i.minHeight)?v(i.minHeight):0,maxWidth:w(i.maxWidth)?v(i.maxWidth):1/0,maxHeight:w(i.maxHeight)?v(i.maxHeight):1/0},void 0!==n.left&&void 0!==n.right&&(o.maxWidth=Math.min(o.maxWidth,n.right-n.left)),void 0!==n.bottom&&void 0!==n.top&&(o.maxHeight=Math.min(o.maxHeight,n.bottom-n.top)),te(o)}function ts(t,e){return u(e.positionRestrictions)?e.positionRestrictions(t,e):e.positionRestrictions}function tc(t){return t.visibleArea?t.visibleArea.width/t.boundary.width:0}function tl(t){if(!tn(t))return S();
1var e=t.coordinates,i=e.width,n=e.height,o=e.left,r=e.top,a=tc(t);return{width:i/a,height:n/a,left:(o-t.visibleArea.left)/a,top:(r-t.visibleArea.top)/a}}function td(t,e){return K(u(e.aspectRatio)?e.aspectRatio(t,e):e.aspectRatio)}function th(t,e){return u(e.defaultCoordinates)?e.defaultCoordinates(t,e):e.defaultCoordinates}function tu(t,e){return u(e.defaultVisibleArea)?e.defaultVisibleArea(t,e):e.defaultVisibleArea}function tm(t){return t.imageSize&&t.imageSize.width&&t.imageSize.height?F(t.imageSize,t.transforms.rotate):{width:0,height:0}}function tp(t,e){return!tn(t)||!Y(U(t.coordinates),td(t,e))&&$(t.visibleArea,to(t,e))&&$(t.coordinates,ta(t,e))&&tt(t.visibleArea,tr(t,e))&&tt(t.coordinates,ts(t,e))}function tf(t){var e,i,n,o=t.width,r=t.height,a=t.sizeRestrictions||{minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},s=K(t.aspectRatio),c={width:Math.max(a.minWidth,Math.min(a.maxWidth,o)),height:Math.max(a.minHeight,Math.min(a.maxHeight,r))},l=[c];return s&&[s.minimum,s.maximum].forEach(function(t){t&&l.push({width:c.width,height:c.width/t},{width:c.height*t,height:c.height})}),e=l=l.map(function(t){return V(t,a)}),i={width:o,height:r},(n=function(t){return e.reduce(function(e,n){var o=u(a)?a(n):a,r=o.maxHeight,c=o.maxWidth,l=o.minWidth,d=o.minHeight,h=K(u(s)?s(n):s);return $(n,t?{maxWidth:c,maxHeight:r}:{maxWidth:c,maxHeight:r,minWidth:l,minHeight:d})&&!Y(U(n),h)&&n.width&&n.height&&(!e||C(_(n,i),_(e,i)))?n:e},null)})()||n(!0)}function tv(t,e){var i=M(t);if(t.visibleArea){var n=to(t,e);i.visibleArea=(0,a.pi)((0,a.pi)({},t.visibleArea),tf({width:t.visibleArea.width,height:t.visibleArea.height,aspectRatio:{minimum:U(i.boundary),maximum:U(i.boundary)},sizeRestrictions:n})),i.visibleArea=L(i.visibleArea,H(I(t.visibleArea),I(i.visibleArea))),i.visibleArea=J(i.visibleArea,tr(i,e))}return i}function tg(t,e,i){var n=L(t,e);return i?J(n,i):n}function tb(t,e,i,n){void 0===n&&(n=!0);var o=!1===n?r.unsafe:!0===n?r.zoom:n,s=td(t,e),c=ta(t,e);t.visibleArea&&o===r.limit&&(c=(0,a.pi)((0,a.pi)({},c),{minWidth:Math.min(t.visibleArea.width,c.minWidth),minHeight:Math.min(t.visibleArea.height,c.minHeight),maxWidth:Math.min(t.visibleArea.width,c.maxWidth),maxHeight:Math.min(t.visibleArea.height,c.maxHeight)}));var l=ts(t,e);t.visibleArea&&o===r.limit&&(l=G(l,O(t.visibleArea)));var d=function(t,e){return tg(t,{left:e.left-(t.left||0),top:e.top-(t.top||0)},l)},h=t.coordinates?(0,a.pi)({},t.coordinates):S();(Array.isArray(i)?i:[i]).forEach(function(i){var n,o,r;(n="function"==typeof i?i((0,a.pi)((0,a.pi)({},t),{coordinates:h}),e):i)&&(m(n.width)&&m(n.height)||(o=h,r=(0,a.pi)((0,a.pi)({},h),n),h=d((0,a.pi)((0,a.pi)((0,a.pi)({},o),tf({width:r.width,height:r.height,sizeRestrictions:c,aspectRatio:s})),{left:0,top:0}),{left:o.left||0,top:o.top||0})),m(n.left)&&m(n.top)||(h=d(h,(0,a.pi)((0,a.pi)({},h),n))))});var u=(0,a.pi)((0,a.pi)({},M(t)),{coordinates:h});if(!u.visibleArea||o!==r.zoom)return u;var p=Math.max(0,u.coordinates.width-u.visibleArea.width),f=Math.max(0,u.coordinates.height-u.visibleArea.height),v=to(t,e),g=p>f?u.coordinates.width/u.visibleArea.width:u.coordinates.height/u.visibleArea.height;return g>1&&(u.visibleArea=k(u.visibleArea,Math.min(g,X(u.visibleArea,v)))),u.visibleArea=L(u.visibleArea,D(Q(u.coordinates,O(u.visibleArea)))),tv(u,e)}function tw(t,e){if(t.coordinates){var i=M(t),n=td(t,e),o=ta(t,e);return i.coordinates=(0,a.pi)((0,a.pi)({},t.coordinates),tf({width:t.coordinates.width,height:t.coordinates.height,aspectRatio:n,sizeRestrictions:t.visibleArea?{maxWidth:Math.min(t.visibleArea.width,o.maxWidth),maxHeight:Math.min(t.visibleArea.height,o.maxHeight),minHeight:Math.min(t.visibleArea.height,o.minHeight),minWidth:Math.min(t.visibleArea.width,o.minWidth)}:o})),i.coordinates=L(i.coordinates,H(I(t.coordinates),I(i.coordinates))),i.coordinates=J(i.coordinates,t.visibleArea?G(O(t.visibleArea),ts(i,e)):ts(i,e)),i}return t}function ty(t,e,i,n){void 0===n&&(n=!0);var o=(0,a.pi)((0,a.pi)({},M(t)),{visibleArea:i});return o=tv(o,e),n&&(o=tw(o,e)),o}(n=r||(r={})).limit="limit",n.zoom="zoom",n.unsafe="unsafe";var tx=i(62245);function tA(t){var e=t.coordinates,i=t.directions,n=t.positionRestrictions,o=t.sizeRestrictions,r=t.preserveRatio,s=t.allowedDirections,c=t.compensate,l=(0,a.pi)({},i),d=T(e,l).width,h=T(e,l).height;d<0&&(l.left<0&&l.right<0?(l.left=-(e.width-o.minWidth)/(l.left/l.right),l.right=-(e.width-o.minWidth)/(l.right/l.left)):l.left<0?l.left=-(e.width-o.minWidth):l.right<0&&(l.right=-(e.width-o.minWidth))),h<0&&(l.top<0&&l.bottom<0?(l.top=-(e.height-o.minHeight)/(l.top/l.bottom),l.bottom=-(e.height-o.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(e.height-o.minHeight):l.bottom<0&&(l.bottom=-(e.height-o.minHeight)));
1var u=j(T(e,l),n),m=z.every(function(t){return!A(u[({left:"right",top:"bottom",right:"left",bottom:"top"})[t]],0)||s[t]});(void 0===c||c)&&m&&(u.left&&u.left>0&&0===u.right?(l.right+=u.left,l.left-=u.left):u.right&&u.right>0&&0===u.left&&(l.left+=u.right,l.right-=u.right),u.top&&u.top>0&&0===u.bottom?(l.bottom+=u.top,l.top-=u.top):u.bottom&&u.bottom>0&&0===u.top&&(l.top+=u.bottom,l.bottom-=u.bottom),u=j(T(e,l),n));var p={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(z.forEach(function(t){var e=u[t];e&&l[t]&&(p[t]=Math.max(0,1-e/l[t]))}),r){var f=Math.min.apply(Math,z.map(function(t){return p[t]}));f!==1/0&&z.forEach(function(t){l[t]*=f})}else z.forEach(function(t){p[t]!==1/0&&(l[t]*=p[t])});if(d=T(e,l).width,h=T(e,l).height,l.right+l.left&&(d>o.maxWidth?p.width=(o.maxWidth-e.width)/(l.right+l.left):d<o.minWidth&&(p.width=(o.minWidth-e.width)/(l.right+l.left))),l.bottom+l.top&&(h>o.maxHeight?p.height=(o.maxHeight-e.height)/(l.bottom+l.top):h<o.minHeight&&(p.height=(o.minHeight-e.height)/(l.bottom+l.top))),r){var v=Math.min(p.width,p.height);v!==1/0&&z.forEach(function(t){l[t]*=v})}else p.width!==1/0&&P.forEach(function(t){l[t]*=p.width}),p.height!==1/0&&W.forEach(function(t){l[t]*=p.height});return l}function tC(t,e,i){return x(e+i,0)?t/2:x(e,0)?0:x(i,0)?t:t*Math.abs(e/(e+i))}function tE(t,e){var i=e.toLowerCase();return{left:t.left+t.width*(-1!==i.indexOf("west")?1:-1!==i.indexOf("east")?0:.5),top:t.top+t.height*(-1!==i.indexOf("north")?1:-1!==i.indexOf("south")?0:.5)}}function tM(t){var e=t.toLowerCase();return{left:-1===e.indexOf("east"),top:-1===e.indexOf("south"),right:-1===e.indexOf("west"),bottom:-1===e.indexOf("north")}}function tR(t,e){var i=tc(t);return t.visibleArea?{left:e.left*i+t.visibleArea.left,top:e.top*i+t.visibleArea.top}:e}function tS(t,e){var i=tc(t);return{left:b(e.left)?e.left*i:0,top:b(e.top)?e.top*i:0}}function tN(t,e){if(t&&e){var i=e();i&&t(i)}}function tz(t,e){t.forEach(function(t){tN(t,e)})}function tP(t,e){var i,n=t.imageSize,o=t.visibleArea,r=ta(t,e),s=td(t,e);if(o)i=o;else{var c=q(ts(t,e));i={width:Math.max(c.minWidth,Math.min(c.maxWidth,n.width)),height:Math.max(c.minHeight,Math.min(c.maxHeight,n.height))}}var l=Math.min(s.maximum||1/0,Math.max(s.minimum||0,U(i))),d=i.width<i.height?{width:.8*i.width,height:.8*i.width/l}:{height:.8*i.height,width:.8*i.height*l};return tf((0,a.pi)((0,a.pi)({},d),{aspectRatio:s,sizeRestrictions:r}))}function tW(t,e){return{minWidth:w(e.minWidth)?v(e.minWidth):0,minHeight:w(e.minHeight)?v(e.minHeight):0,maxWidth:w(e.maxWidth)?v(e.maxWidth):1/0,maxHeight:w(e.maxHeight)?v(e.maxHeight):1/0}}function tH(t){var e=t.visibleArea,i=t.coordinates,n=e||tm(t);return{left:(e?e.left:0)+n.width/2-(i?i.width/2:0),top:(e?e.top:0)+n.height/2-(i?i.height/2:0)}}function tI(t){var e=t.src,i=t.arrayBuffer,n=void 0===i?null:i,o=t.orientation,r=void 0===o?null:o,a={src:e,arrayBuffer:n,revoke:!1,transforms:{flip:{horizontal:!1,vertical:!1},rotate:0}};return n&&r&&r>1?d(e)||!h(e)?(a.src=URL.createObjectURL(new Blob([n])),a.revoke=!0):a.src=function(t){for(var e=[],i=new Uint8Array(t);i.length>0;){var n=i.subarray(0,8192);e.push(String.fromCharCode.apply(null,Array.from?Array.from(n):n.slice())),i=i.subarray(8192)}return"data:image/jpeg;base64,"+btoa(e.join(""))}(n):a.src=e,r&&(a.transforms=function(t){var e={flip:{horizontal:!1,vertical:!1},rotate:0};if(t)switch(t){case 2:e.flip.horizontal=!0;break;case 3:e.rotate=-180;break;case 4:e.flip.vertical=!0;break;case 5:e.rotate=90,e.flip.vertical=!0;break;case 6:e.rotate=90;break;case 7:e.rotate=90,e.flip.horizontal=!0;break;case 8:e.rotate=-90}return e}(r)),a}function t_(t,e,i,n,o){void 0===o&&(o=null);var r,s,c,l,d,h=t.width>t.height?{width:Math.min(512,t.width),height:Math.min(512,t.width)/(t.width/t.height)}:{height:Math.min(512,t.height),width:Math.min(512,t.height)*(t.width/t.height)},u=tm(e),m={rotate:e.transforms.rotate,flip:{horizontal:e.transforms.flip.horizontal,vertical:e.transforms.flip.vertical},translateX:i.left/n,translateY:i.top/n,scale:1/n},p={rotate:{left:(h.width-u.width)/(2*n),top:(h.height-u.height)/(2*n)},scale:{left:(1-1/n)*h.width/2,top:(1-1/n)*h.height/2}},f=(0,a.pi)((0,a.pi)({},m),{scale:m.scale*(t.width/h.width)}),v={width:h.width+"px",height:h.height+"px",left:"0px",top:"0px",transition:"none",transform:"translate3d("+(-p.rotate.left-p.scale.left-m.translateX)+"px, "+(-p.rotate.top-p.scale.top-m.translateY)+"px, 0px)"+(r=f.rotate,c=void 0===(s=f.flip)?{horizontal:!1,vertical:!1}:s," rotate("+(void 0===r?0:r)+"deg) scaleX("+(d=void 0===(l=f.scale)?1:l)*(c.horizontal?-1:1)+") scaleY("+d*(c.vertical?-1:1)+")"),willChange:"none"};return o&&o.active&&(v.willChange="transform",v.transition=o.duration+"ms "+o.timingFunction),v}function tT(t,e,i){e.style.width="0px",e.style.height="0px",e.style.width=Math.max(t.clientWidth,i.width)+"px";var n=i.width/i.height;e.style.height=Math.max(t.clientHeight,e.clientWidth/n)+"px",e.style.width=e.clientHeight*n+"px"}function tD(t,e,i){e.style.width="0px",e.style.height="0px",e.style.width=Math.max(t.getBoundingClientRect().width,i.width)+"px";var n=i.width/i.height;e.style.height=Math.max(t.getBoundingClientRect().height,e.getBoundingClientRect().width/n)+"px",e.style.width=e.getBoundingClientRect().height*n+"px",e.clientWidth/e.clientHeight>t.clientWidth/t.clientHeight?e.clientWidth>t.clientWidth&&(e.style.width=t.clientWidth+"px",e.style.height=t.clientWidth/n+"px"):e.clientHeight>t.clientHeight&&(e.style.height=t.clientHeight+"px",e.style.width=t.clientHeight*n+"px")}function tL(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height}}var tO={linear:function(t){return t},"ease-in":function(t){return Math.pow(t,1.675)},"ease-out":function(t){return 1-Math.pow(1-t,1.675)},"ease-in-out":function(t){return .5*(Math.sin((t-.5)*Math.PI)+1)}},tk=function(){function t(){this.active=!1}return t.prototype.start=function(t){var e;this.onStart=t.onStart,this.onProgress=t.onProgress,this.onStop=t.onStop,this.active||null===(e=this.onStart)||void 0===e||e.call(this),this.id&&window.cancelAnimationFrame(this.id
1),this.startTime=performance.now(),this.timingFunction=t.timingFunction,this.endTime=this.startTime+t.duration,this.active=!0,this.animate()},t.prototype.animate=function(){var t=this;if(this.startTime&&this.endTime){var e=tO[this.timingFunction];e||(e=tO["ease-out"]);var i=1-(this.endTime-performance.now())/(this.endTime-this.startTime),n=Math.min(1,e(i));this.onProgress&&this.onProgress(n),i<1?this.id=window.requestAnimationFrame(function(){return t.animate()}):this.stop()}else this.stop()},t.prototype.stop=function(){this.active=!1,this.id&&window.cancelAnimationFrame(this.id),this.onStop&&this.onStop()},t}();function tU(t,e){var i=e.getBoundingClientRect(),n=i.left,o=i.top,r={left:0,top:0},a=0;return t.forEach(function(e){r.left+=(e.clientX-n)/t.length,r.top+=(e.clientY-o)/t.length}),t.forEach(function(t){a+=y({left:r.left,top:r.top},{left:t.clientX-n,top:t.clientY-o})}),{centerMass:r,spread:a,count:t.length}}function tX(t,e){return t.aspectRatio?{}:{aspectRatio:K(u(e.aspectRatio)?e.aspectRatio():e.aspectRatio)}}var tY=i(94184),tB=i.n(tY);function tj(t,e){var i=tX({},e);return{stencilSize:function(e,n){var o,r,s=u(t.stencilSize)?t.stencilSize(e,n):t.stencilSize;return tf((0,a.pi)((0,a.pi)({},s),{aspectRatio:(o=i.aspectRatio,(r=K(U(s)))?o?{minimum:Math.min(o.maximum,Math.max(o.minimum,r.minimum)),maximum:Math.max(o.minimum,Math.min(o.maximum,r.maximum))}:r:o)}))}}}function tV(t,e){var i=t.boundary,n=u(e.stencilSize)?e.stencilSize(t,e):e.stencilSize;return(n.width>i.width||n.height>i.height)&&(n=tf({sizeRestrictions:{maxWidth:i.width,maxHeight:i.height,minWidth:0,minHeight:0},width:n.width,height:n.height,aspectRatio:{minimum:U(n),maximum:U(n)}})),n}function tF(t,e){var i=tV(t,(0,a.pi)((0,a.pi)({},e),{stencilSize:e.stencilSize})),n=to(t,e);return{maxWidth:n.maxWidth*i.width/t.boundary.width,maxHeight:n.maxHeight*i.height/t.boundary.height,minWidth:0,minHeight:0}}function tZ(t,e){var i,n,o=t.imageSize,r=t.visibleArea,a=t.boundary,s=ta(t,e),c=td(t,e),l=u(e.stencilSize)?e.stencilSize(t,e):e.stencilSize,d=r||o;return U(d)>U(a)?n=(i=l.height*d.height/a.height)*U(l):i=(n=l.width*d.width/a.width)/U(l),tf({width:n,height:i,aspectRatio:c,sizeRestrictions:s})}function tq(t,e){var i=U(tV(t,e));return{minimum:i,maximum:i}}function tG(t,e,i){return i&&i.immediately?function(t,e){if(tn(t)){var i=M(t),n=tV(t,e);i.visibleArea=k(i.visibleArea,i.coordinates.width*i.boundary.width/(i.visibleArea.width*n.width));var o=B(i.visibleArea,to(i,e));return 1!==o&&(i.visibleArea=k(i.visibleArea,o),i.coordinates=k(i.coordinates,o)),i.visibleArea=L(i.visibleArea,H(I(i.coordinates),I(i.visibleArea))),i.visibleArea=J(i.visibleArea,tr(i,e)),i.coordinates=J(i.coordinates,G(O(i.visibleArea),tr(i,e))),i}return t}(t,e):t}function tQ(t,e,i){return i.immediately?function(t,e){if(tn(t)){var i=M(t),n={width:0,height:0};U(i.boundary)>U(i.coordinates)?(n.height=.8*i.boundary.height,n.width=n.height*U(i.coordinates)):(n.width=.8*i.boundary.width,n.height=n.width*U(i.coordinates)),i.visibleArea=k(i.visibleArea,i.coordinates.width*i.boundary.width/(i.visibleArea.width*n.width));var o=B(i.visibleArea,to(i,e));return i.visibleArea=k(i.visibleArea,o),1!==o&&(n.height/=o,n.width/=o),i.visibleArea=L(i.visibleArea,H(I(i.coordinates),I(i.visibleArea))),i.visibleArea=J(i.visibleArea,tr(i,e)),i.coordinates=J(i.coordinates,G(O(i.visibleArea),ts(i,e))),i}return t}(t,e):t}var tJ=function(t,e){var i,n=(i=(0,s.useRef)(!0)).current?(i.current=!1,!0):i.current;(0,s.useEffect)(function(){if(!n)return t()},e)};function tK(t){var e=(0,a.CR)((0,s.useState)(t),2),i=e[0],n=e[1],o=(0,a.CR)((0,s.useState)(null),2),r=o[0],c=o[1],l=(0,s.useRef)(t);return tJ(function(){r&&r(i,l.current)},[r]),[i,function(t,e){l.current=i,n(t),c(function(){return e})}]}var t$=function(t){function e(e,i){var n=t.call(this)||this;return n.props=e,n.notify=i,n.data={state:null,transitions:!1,interactions:{moveCoordinates:!1,resizeCoordinates:!1,transformImage:{rotate:!1,move:!1,scale:!1,flip:!1}}},n}return(0,a.ZT)(e,t),e.prototype.getProps=function(){return this.props()},e.prototype.setData=function(t){this.data=t,this.notify()},e.prototype.getData=function(){return this.data},e}(function(){var t=this;this.getTransitions=function(){var e=t.getData(),i=t.getProps().transitions;return(0,a.pi)((0,a.pi)({},f(i,{timingFunction:"ease-in-out",duration:350})),{active:e.transitions})},this.getInteractions=function(){return M(t.getData().interactions)},this.hasInteractions=function(){return c(t.getData().interactions)},this.startTransitions=function(){var e=t.getProps(),i=e.onTransitionsStart,n=e.onUpdate,o=e.getInstance,r=t.getData(),s=r.transitions,c=(0,a._T)(r,["transitions"]);t.setData((0,a.pi)((0,a.pi)({},c),{transitions:!0})),s||tz([i,n],o),t.endTransitions()},this.endTransitions=N(function(){var e=t.getProps(),i=e.onTransitionsEnd,n=e.onUpdate,o=e.getInstance;t.setData((0,a.pi)((0,a.pi)({},t.getData()),{transitions:!1})),tz([i,n],o)},function(){return t.getTransitions().duration}),this.applyPostProcess=function(e,i){var n=t.getProps(),o=n.settings,r=n.postProcess,a=e.name,s=e.interaction,c=e.transitions,l=e.immediately,d={name:a,interaction:void 0!==s&&s,transitions:void 0!==c&&c,immediately:void 0!==l&&l};return Array.isArray(r)?r.reduce(function(t,e){return e(t,o,d)},i):u(r)?r(i,o,d):i},this.updateState=function(e,i,n){void 0===i&&(i={}),void 0===n&&(n=[]);var o=i.transitions,r=void 0!==o&&o,s=t.getProps(),c=s.onTransitionsStart,l=s.getInstance,d=s.onChange,h=s.onUpdate,m=s.settings,p=t.getData(),f=u(e)?e(p.state,m):e,v=f?.001*tc(f):.001,g=!R(p.state,f,v),b=["co
1ordinates","boundary","visibleArea","imageSize","transforms"].some(function(t){var e;return!R(null===(e=p.state)||void 0===e?void 0:e[t],null==f?void 0:f[t],v)}),w=p;g&&(r&&b&&t.endTransitions(),w=(0,a.pi)((0,a.pi)({},w),{state:M(f),transitions:r&&b}),t.setData(w),tN(d,l)),w.transitions&&!p.transitions&&tN(c,l),tz((0,a.pr)(n,[h]),l)},this.setInteractions=function(e){var i=t.getProps(),n=i.onInteractionStart,o=i.onInteractionEnd,r=i.getInstance,s=t.getInteractions(),l=(0,a.pi)((0,a.pi)({},s),e);if(R(s,l)||t.setData((0,a.pi)((0,a.pi)({},t.getData()),{interactions:l})),c(s)!==c(l)){if(c(s)){var d=t.getData().state;t.updateState(function(){return d&&t.applyPostProcess({name:"interactionEnd",immediately:!0,transitions:!0},d)},{transitions:!0},[o])}else tN(n,r)}},this.resetState=function(e,i){t.updateState(t.createDefaultState(e,i))},this.clear=function(){t.updateState(null)},this.reconcileState=function(e){void 0===e&&(e={});var i=t.getProps(),n=i.reconcileStateAlgorithm,o=i.settings,r=t.getData().state,s=e.transitions,c=void 0!==s&&s;if(r&&!tp(r,o)){var l=(n||function(t,e){if(tn(t)){var i=M(t),n=td(t,e),o=ta(t,e),r=to(t,e),s=Y(U(t.coordinates),n),c=s?{height:t.coordinates.height,width:t.coordinates.height*s}:t.coordinates;i.coordinates=(0,a.pi)((0,a.pi)({},i.coordinates),tf({width:c.width,height:c.height,aspectRatio:n,sizeRestrictions:ti(r,o)})),i.coordinates=L(i.coordinates,H(I(t.coordinates),I(i.coordinates)));var l=Math.max(i.coordinates.width/i.visibleArea.width,i.coordinates.height/i.visibleArea.height,1);return i.visibleArea=(0,a.pi)((0,a.pi)({},t.visibleArea),tf({width:t.visibleArea.width*l,height:t.visibleArea.height*l,aspectRatio:{minimum:U(i.boundary),maximum:U(i.boundary)},sizeRestrictions:r})),i.visibleArea=L(i.visibleArea,H(I(t.visibleArea),I(i.visibleArea))),i.visibleArea=J(i.visibleArea,tr(i,e)),i.coordinates=J(i.coordinates,G(O(i.visibleArea),ts(i,e))),i}return t})(r,o);l=t.applyPostProcess({name:"reconcileState",immediately:!0,transitions:c},l),t.updateState(l,{transitions:c})}},this.transformImage=function(e,i){void 0===i&&(i={});var n,o=i.transitions,r=void 0===o||o,s=i.interaction,c=i.immediately,l=void 0!==c&&c,d=i.normalize,h=t.getProps(),u=h.transformImageAlgorithm,p=h.onTransformImage,f=h.onTransformImageEnd,v=h.settings,g=t.getData().state,w=[];if(g){(void 0===d||d)&&((n=e).scale&&(n.scale={factor:b(n.scale)?n.scale:n.scale.factor,center:!b(n.scale)&&n.scale.center?tR(g,n.scale.center):void 0}),n.rotate&&(n.rotate={angle:b(n.rotate)?n.rotate:n.rotate.angle,center:!b(n.rotate)&&n.rotate.center?tR(g,n.rotate.center):void 0}),n.move&&(n.move=tS(g,n.move)),e=n);var y=t.applyPostProcess({name:"transformImage",transitions:r,immediately:l},(u||function(t,e,i){return i.rotate&&(t=function(t,e,i){if(tn(t)){var n=M(t),o=b(i)?i:i.angle,r=Z(I((0,a.pi)({left:0,top:0},tm(t))),o);n.transforms.rotate+=o,n.coordinates=(0,a.pi)((0,a.pi)({},tf({sizeRestrictions:ta(n,e),aspectRatio:td(n,e),width:n.coordinates.width,height:n.coordinates.height})),Z(I(n.coordinates),o));var s=!b(i)&&i.center?i.center:I(t.coordinates),c=H(I(t.coordinates),Z(I(t.coordinates),o,s)),l=tm(n);return n.coordinates.left-=r.left-l.width/2+n.coordinates.width/2-c.left,n.coordinates.top-=r.top-l.height/2+n.coordinates.height/2-c.top,n.visibleArea=V(n.visibleArea,ti(to(n,e),{minWidth:n.coordinates.width,minHeight:n.coordinates.height})),n.coordinates=J(n.coordinates,ts(n,e)),n.visibleArea=L(n.visibleArea,H(I(n.coordinates),I(t.coordinates))),n.visibleArea=J(n.visibleArea,tr(n,e)),n}return t}(t,e,i.rotate)),i.flip&&(t=function(t,e,i,n){if(tn(t)){var o=M(t),r=t.transforms.rotate,a=tm(t),s={horizontal:i,vertical:n};if(s.horizontal||s.vertical){var c=Z({left:a.width/2,top:a.height/2},-r),l=Z(I(o.coordinates),-r),d=Z({left:s.horizontal?c.left-(l.left-c.left):l.left,top:s.vertical?c.top-(l.top-c.top):l.top},r);o.coordinates=L(o.coordinates,H(d,I(o.coordinates))),l=Z(I(o.visibleArea),-r),d=Z({left:s.horizontal?c.left-(l.left-c.left):l.left,top:s.vertical?c.top-(l.top-c.top):l.top},r),o.visibleArea=L(o.visibleArea,H(d,I(o.visibleArea))),o.visibleArea=J(o.visibleArea,tr(o,e))}
1return s.horizontal&&(o.transforms.flip.horizontal=!t.transforms.flip.horizontal),s.vertical&&(o.transforms.flip.vertical=!t.transforms.flip.vertical),o}return t}(t,e,i.flip.horizontal,i.flip.vertical)),(i.move||i.scale)&&(t=function(t,e,i){var n,o=i.scale,r=void 0===o?1:o,a=i.move,s=void 0===a?{}:a;if(tn(t)){var c,l=M(t),d=1/(b(r)?r:r.factor),h=b(r)?void 0:r.center,u=!x(d,1),m=1,p=1;l.visibleArea=L(l.visibleArea,{left:s.left||0,top:s.top||0});var f=ta(l,e),v=ts(l,e),g=to(l,e),w={stencil:{minimum:Math.max(f.minWidth?f.minWidth/l.coordinates.width:0,f.minHeight?f.minHeight/l.coordinates.height:0),maximum:Math.min(f.maxWidth?f.maxWidth/l.coordinates.width:1/0,f.maxHeight?f.maxHeight/l.coordinates.height:1/0,X(l.coordinates,q(v)))},area:{maximum:X(l.visibleArea,g),minimum:(c=l.visibleArea,Math.max(g.minWidth?g.minWidth/c.width:0,g.minHeight?g.minHeight/c.height:0))}};d&&u&&(d<1?(p=Math.max(d,Math.max(w.area.minimum,w.stencil.minimum)))>1&&(p=1):d>1&&(p=Math.min(d,Math.min(w.area.maximum,w.stencil.maximum)))<1&&(p=1)),p&&(l.visibleArea=k(l.visibleArea,p,h));var y={left:t.coordinates.left-t.visibleArea.left,right:t.visibleArea.width+t.visibleArea.left-(t.coordinates.width+t.coordinates.left),top:t.coordinates.top-t.visibleArea.top,bottom:t.visibleArea.height+t.visibleArea.top-(t.coordinates.height+t.coordinates.top)};return l.visibleArea=J(l.visibleArea,{left:void 0!==v.left?v.left-y.left*p:void 0,top:void 0!==v.top?v.top-y.top*p:void 0,bottom:void 0!==v.bottom?v.bottom+y.bottom*p:void 0,right:void 0!==v.right?v.right+y.right*p:void 0}),l.visibleArea=J(l.visibleArea,tr(l,e)),l.coordinates.width=l.coordinates.width*p,l.coordinates.height=l.co
1ordinates.height*p,l.coordinates.left=l.visibleArea.left+y.left*p,l.coordinates.top=l.visibleArea.top+y.top*p,l.coordinates=J(l.coordinates,G(O(l.visibleArea),v)),u&&d&&(null===(n=e.transformImage)||void 0===n?void 0:n.adjustStencil)&&(d>1?m=Math.min(w.area.maximum,d)/p:d<1&&(m=Math.max(l.coordinates.height/l.visibleArea.height,l.coordinates.width/l.visibleArea.width,d/p)),1!==m&&(l.visibleArea=k(l.visibleArea,m,d>1?h:I(l.coordinates)),l.visibleArea=J(l.visibleArea,tr(l,e)),l.visibleArea=L(l.visibleArea,D(Q(l.coordinates,O(l.visibleArea)))))),l}return t}(t,e,i)),t})(g,v,e));w.push(p),void 0===s||s?t.setInteractions({transformImage:{rotate:!m(e.rotate),flip:!m(e.flip),scale:!m(e.scale),move:!m(e.move)}}):(y=t.applyPostProcess({name:"transformImageEnd",transitions:r,immediately:!0},y),w.push(f)),t.updateState(y,{transitions:l&&r},w)}},this.transformImageEnd=function(e){void 0===e&&(e={});var i=e.immediately,n=void 0===i||i,o=e.transitions,r=void 0===o||o,a=t.getData().state,s=t.getProps().onTransformImageEnd;t.updateState(function(){return a&&t.applyPostProcess({name:"transformImageEnd",immediately:n,transitions:r},a)},{transitions:r},[s]),t.setInteractions({transformImage:{rotate:!1,flip:!1,scale:!1,move:!1}})},this.zoomImage=function(e,i){void 0===i&&(i={});var n=i.interaction,o=i.immediately,r=i.transitions,a=i.normalize;t.transformImage({scale:e},{interaction:void 0!==n&&n,immediately:void 0===o||o,transitions:void 0===r||r,normalize:void 0!==a&&a})},this.moveImage=function(e,i,n){void 0===n&&(n={});var o=n.interaction,r=n.immediately,a=n.transitions,s=n.normalize;t.transformImage({move:{left:e,top:i}},{interaction:void 0!==o&&o,immediately:void 0===r||r,transitions:void 0===a||a,normalize:void 0!==s&&s})},this.flipImage=function(e,i,n){void 0===n&&(n={});var o=n.interaction,r=n.immediately,a=n.transitions,s=n.normalize,c=t.getState(),l={horizontal:e,vertical:i};t.transformImage({flip:c&&(void 0===s||s)?function(t,e){if(t){var i=Math.abs(t.transforms.rotate%180);if(!(i<=45)&&!(i>=135))return{horizontal:e.vertical,vertical:e.horizontal}}return e}(c,l):l},{interaction:void 0!==o&&o,immediately:void 0===r||r,transitions:void 0===a||a})},this.rotateImage=function(e,i){void 0===i&&(i={});var n=i.interaction,o=i.immediately,r=i.transitions,a=i.normalize;t.transformImage({rotate:e},{interaction:void 0!==n&&n,immediately:void 0===o||o,transitions:void 0===r||r,normalize:void 0!==a&&a})},this.reset=function(e,i){t.resetState(e,i)},this.setState=function(e,i){void 0===i&&(i={});var n=t.getSettings(),o=t.getData().state,r=i.transitions,s=void 0===r||r,c=i.immediately,l=void 0!==c&&c,d=i.interaction,h=void 0!==d&&d,m=i.postprocess,p=void 0!==m&&m,f=e&&(u(e)?e(o,n):(0,a.pi)((0,a.pi)({},o),e));t.updateState(function(){return p?f&&t.applyPostProcess({name:"setState",immediately:l,transitions:s,interaction:h},f):f},{transitions:s})},this.setCoordinates=function(e,i){void 0===i&&(i={});var n=t.getData().state,o=t.getProps(),a=o.setCoordinatesAlgorithm,s=o.settings,c=i.transitions,l=void 0===c||c,d=i.immediately,h=void 0===d||d;t.updateState(function(){return n&&t.applyPostProcess({name:"setCoordinates",immediately:h,transitions:l},(a||tb)(n,s,e,r.zoom))},{transitions:l})},this.setVisibleArea=function(e,i){void 0===i&&(i={});var n=i.transitions,o=void 0===n||n,r=i.immediately,a=void 0===r||r,s=t.getData().state,c=t.getProps(),l=c.setVisibleAreaAlgorithm,d=c.settings;t.updateState(function(){return s&&t.applyPostProcess({name:"setVisibleArea",immediately:a,transitions:o},(l||ty)(s,d,e))},{transitions:o})},this.setBoundary=function(e,i){void 0===i&&(i={});var n=t.getData().state,o=t.getProps(),r=o.setBoundaryAlgorithm,s=o.settings,c=i.transitions,l=void 0!==c&&c,d=i.immediately,h=void 0===d||d;e?t.updateState(function(){return n&&t.applyPostProcess({name:"setBoundary",immediately:h,transitions:l},(r||function(t,e,i){var n=(0,a.pi)((0,a.pi)({},M(t)),{boundary:i});if(n.visibleArea&&n.coordinates&&t.visibleArea){n.visibleArea.height=n.visibleArea.width/U(i),n.visibleArea.top+=(t.visibleArea.height-n.visibleArea.height)/2;var o=ta(n,e);(Math.max(o.minHeight,n.coordinates.height)-n.visibleArea.height>0||Math.max(o.minWidth,n.coordinates.width)-n.visibleArea.width>0)&&(n.visibleArea=k(n.visibleArea,Math.max(Math.max(o.minHeight,n.coordinates.height)/n.visibleArea.height,Math.max(o.minWidth,n.coordinates.width)/n.visibleArea.width))),n.visibleArea=V(n.visibleArea,to(n,e));var r=D(Q(n.coordinates,O(n.visibleArea)));n.visibleArea.width<n.coordinates.width&&(r.left=0),n.visibleArea.height<n.coordinates.height&&(r.top=0),n.visibleArea=L(n.visibleArea,r),n.visibleArea=J(n.visibleArea,tr(n,e)),n=tw(n,e)}return n})(n,s,e))}):t.updateState(null)},this.moveCoordinates=function(e,i){void 0===i&&(i={});
1var n=t.getData(),o=t.getProps(),r=o.moveCoordinatesAlgorithm,a=o.onMove,s=o.onMoveEnd,c=o.settings,l=i.interaction,d=void 0===l||l,h=i.transitions,u=void 0!==h&&h,m=i.immediately,p=void 0!==m&&m,f=i.normalize,v=[];if(!n.transitions&&n.state){var g=void 0===f||f?tS(n.state,e):{left:b(e.left)?e.left:0,top:b(e.top)?e.top:0},w=t.applyPostProcess({name:"moveCoordinates",interaction:d,immediately:p,transitions:u},(r||function(t,e,i){if(tn(t)){var n=M(t);return n.coordinates=L(n.coordinates,i),n.coordinates=J(n.coordinates,G(O(n.visibleArea),ts(n,e))),n}return t})(n.state,c,g));v.push(a),d?t.setInteractions({moveCoordinates:!0}):(w=t.applyPostProcess({name:"moveCoordinatesEnd",interaction:d,immediately:p,transitions:u},w),v.push(s)),t.updateState(w,{transitions:p&&u},v)}},this.moveCoordinatesEnd=function(e){void 0===e&&(e={});var i=t.getData().state,n=t.getProps().onMoveEnd,o=e.transitions,r=void 0===o||o,a=e.immediately,s=void 0!==a&&a;t.updateState(function(){return i&&t.applyPostProcess({name:"moveCoordinatesEnd",transitions:r,immediately:s},i)},{transitions:r},[n]),t.setInteractions({moveCoordinates:!1})},this.resizeCoordinates=function(e,i,n,o){void 0===o&&(o={});var r=t.getData().state,s=t.getProps(),c=s.resizeCoordinatesAlgorithm,l=s.onResize,d=s.onResizeEnd,h=s.settings,u=o.interaction,m=void 0===u||u,f=o.transitions,v=void 0!==f&&f,g=o.immediately,w=void 0!==g&&g,y=o.normalize;if(!t.getTransitions().active&&r){var x,C=[],E=void 0===y||y?(x=tc(r),{left:b(i.left)?i.left*x:0,top:b(i.top)?i.top*x:0,right:b(i.right)?i.right*x:0,bottom:b(i.bottom)?i.bottom*x:0}):{left:b(i.left)?i.left:0,top:b(i.top)?i.top:0,right:b(i.right)?i.right:0,bottom:b(i.bottom)?i.bottom:0},R=t.applyPostProcess({name:"resizeCoordinates",interaction:m,immediately:w,transitions:v},(c||function(t,e,i,n,o){var r,s,c,l,d,h,u,m,p=t.coordinates?Math.min(t.coordinates.width,t.coordinates.height,20*tc(t)):1,f=ta(t,e);return tn(t)?(0,a.pi)((0,a.pi)({},M(t)),{coordinates:(r=t.coordinates,s={positionRestrictions:G(ts(t,e),O(t.visibleArea)),sizeRestrictions:{maxWidth:Math.min(f.maxWidth,t.visibleArea.width),maxHeight:Math.min(f.maxHeight,t.visibleArea.height),minWidth:Math.max(Math.min(f.minWidth,t.visibleArea.width),p),minHeight:Math.max(Math.min(f.minHeight,t.visibleArea.height),p)},aspectRatio:td(t,e)},c=o.reference,d={left:-1===(l=i.toLowerCase()).indexOf("west")?n.left:-n.left,top:-n.top,right:n.left,bottom:n.top},["north","south","center"].every(function(t){return -1===l.indexOf(t)})&&(d.top=0,d.bottom=0),["west","east","center"].every(function(t){return -1===l.indexOf(t)})&&(d.left=0,d.right=0),h=tM(i),z.forEach(function(t){h[t]||(d[t]=0)}),u=tM(i),m=function(t,e,i,n){var o=n.aspectRatio,r=n.positionRestrictions,s=n.sizeRestrictions,c=(0,a.pi)({},t);e=(0,a.pi)({},e);var l=i.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};t.width<s.minWidth&&(e.left=0,e.right=0),t.height<s.minHeight&&(e.top=0,e.bottom=0),z.forEach(function(t){l[t]||(e[t]=0)}),e=tA({coordinates:c,directions:e,sizeRestrictions:s,positionRestrictions:r,allowedDirections:l});var d=T(c,e).width,h=T(c,e).height,u=i.preserveAspectRatio?U(c):Y(d/h,o);if(u){var m=i.respectDirection;if("width"!==m&&"height"!==m&&(m=c.width>=c.height||1===u?"width":"height"),"width"===m){var p=d/u-c.height;if(l.top&&l.bottom){var f=e.top,v=e.bottom;e.bottom=tC(p,v,f),e.top=tC(p,f,v)}else l.bottom?e.bottom=p:l.top?e.top=p:l.right?e.right=0:l.left&&(e.left=0)}else if("height"===m){var g=c.width-h*u;if(l.left&&l.right){var b=e.left,w=e.right;e.left=-tC(g,b,w),e.right=-tC(g,w,b)}else l.left?e.left=-g:l.right?e.right=-g:l.top?e.top=0:l.bottom&&(e.bottom=0)}e=tA({directions:e,coordinates:c,sizeRestrictions:s,positionRestrictions:r,preserveRatio:!0,compensate:i.compensate,allowedDirections:l})}return d=T(c,e).width,h=T(c,e).height,(u=i.preserveAspectRatio?U(c):Y(d/h,o))&&A(Math.abs(u-d/h),0)&&z.forEach(function(t){e[t]=0}),tg({width:t.width+e.right+e.left,height:t.height+e.top+e.bottom,left:t.left,top:t.top},{left:-e.left,top:-e.top},r)}(r,d,(0,a.pi)((0,a.pi)({},o),{allowedDirections:u}),s),c&&(m=L(m,H(tE(c,i),tE(m,i)))),J(m,s.positionRestrictions))}):t})(r,h,e,E,p(n)?n:{}));C.push(l),m?t.setInteractions({resizeCoordinates:!0}):(R=t.applyPostProcess({name:"resizeCoordinatesEnd",interaction:m,immediately:w,transitions:v},R),C.push(d)),t.updateState(R,{transitions:w&&v},C)}},this.resizeCoordinatesEnd=function(e){void 0===e&&(e={});var i=t.getProps().onResizeEnd,n=t.getData().state,o=e.transitions,r=void 0===o||o,a=e.immediately,s=void 0!==a&&a;t.updateState(function(){return n&&t.applyPostProcess({name:"resizeCoordinatesEnd",transitions:r,immediately:s},n)},{transitions:r},[i]),t.setInteractions({resizeCoordinates:!1})}
1,this.getStencilCoordinates=function(){return tl(t.getData().state)},this.getCoordinates=function(e){void 0===e&&(e={});var i=t.getData().state,n=t.getProps().settings;if(!i||!i.coordinates)return null;var o=e.round;return void 0===o||o?function(t,e){if(!tn(t))return null;var i=ta(t,e),n=ts(t,e),o={width:Math.round(t.coordinates.width),height:Math.round(t.coordinates.height),left:Math.round(t.coordinates.left),top:Math.round(t.coordinates.top)};return o.width>i.maxWidth?o.width=Math.floor(t.coordinates.width):o.width<i.minWidth&&(o.width=Math.ceil(t.coordinates.width)),o.height>i.maxHeight?o.height=Math.floor(t.coordinates.height):o.height<i.minHeight&&(o.height=Math.ceil(t.coordinates.height)),J(o,n)}(i,n):(0,a.pi)({},i.coordinates)},this.getVisibleArea=function(){var e=t.getData().state;return(null==e?void 0:e.visibleArea)?(0,a.pi)({},e.visibleArea):null},this.getSettings=function(){var e=t.getProps().settings;return(0,a.pi)({},e)},this.getState=function(){return M(t.getData().state)},this.getTransforms=function(){var e=t.getData().state;return e?M(e.transforms):{rotate:0,flip:{horizontal:!1,vertical:!1}}},this.createDefaultState=function(e,i){var n=t.getProps(),o=n.createStateAlgorithm,s=n.settings;return t.applyPostProcess({name:"createState",immediately:!0,transitions:!1},(o||function(t,e){var i,n,o,s,c,l=t.boundary,d=t.image,h={boundary:{width:l.width,height:l.height},imageSize:{width:d.width,height:d.height},transforms:{rotate:(null===(i=d.transforms)||void 0===i?void 0:i.rotate)||0,flip:{horizontal:(null===(o=null===(n=d.transforms)||void 0===n?void 0:n.flip)||void 0===o?void 0:o.horizontal)||!1,vertical:(null===(c=null===(s=d.transforms)||void 0===s?void 0:s.flip)||void 0===c?void 0:c.vertical)||!1}},visibleArea:null,coordinates:null};return e.defaultTransforms&&(h.transforms=function(t,e){var i=(0,a.pi)((0,a.pi)({},t.transforms),{flip:(0,a.pi)({},t.transforms.flip)});if(e.defaultTransforms){var n=u(e.defaultTransforms)?e.defaultTransforms(t,e):e.defaultTransforms;b(n.rotate)&&(i.rotate=n.rotate),n.flip&&(g(n.flip.horizontal)&&(i.flip.horizontal=n.flip.horizontal),g(n.flip.vertical)&&(i.flip.vertical=n.flip.vertical))}return i}(h,e)),h=e.priority===tx.U.visibleArea?tb(h=ty(h,e,tu(h,e),!1),e,th(h,e),r.limit):ty(h=tb(h,e,th(h,e),r.unsafe),e,tu(h,e),!0)})({image:i,boundary:e},s))},this.isConsistent=function(){var e=t.getData().state,i=t.getProps().settings;return!e||tp(e,i)}});function t0(){var t=(0,a.CR)((0,s.useState)({}),2);t[0];var e=t[1];return function(){e({})}}var t1=function(t){var e=(0,s.useRef)(t),i=function(){e.current&&e.current()};(0,s.useEffect)(function(){e.current=t},[t]),(0,s.useEffect)(function(){return window.addEventListener("resize",i),window.addEventListener("orientationchange",i),function(){window.removeEventListener("resize",i),window.removeEventListener("orientationchange",i)}},[])},t2=(0,s.forwardRef)(function(t,e){var i=t.className,n=t.style,o=t.stretcherClassName,r=t.contentClassName,a=t.stretchAlgorithm,c=void 0===a?tT:a,l=t.sizeAlgorithm,d=void 0===l?tL:l,h=t.children,u=(0,s.useRef)(null),m=(0,s.useRef)(null);return(0,s.useImperativeHandle)(e,function(){return{reset:function(){var t=u.current;t&&(t.style.height="",t.style.width="")},stretchTo:function(t){var e=u.current,i=m.current;if(null==t||!t.width||null==t||!t.height||!e||!i)return e&&(e.style.height="",e.style.width=""),Promise.resolve(null);c(i,e,t);var n=d(i,t);return Promise.resolve(n.width&&n.height?n:null)}}}),s.createElement("div",{ref:m,style:n,className:tB()("advanced-cropper-boundary",i)},s.createElement("div",{ref:u,className:tB()(["advanced-cropper-boundary__stretcher",o])}),s.createElement("div",{className:tB()(["advanced-cropper-boundary__content",r])},h))});t2.displayName="StretchableBoundary";var t8=function(t){var e=t.visible,i=t.className,n=t.style,o=t.children;return s.createElement("div",{style:n,className:tB()(i,"advanced-cropper-fade",!!e&&"advanced-cropper-fade--visible")},o)},t9=function(t){var e=t.cropper,i=t.children,n=t.className,o=t.style,r=e?e.getState():null,a=!!e&&e.isLoaded();return s.createElement("div",{className:tB()(n,"advanced-cropper-wrapper"),style:o},s.createElement(t8,{visible:r&&a,className:"advanced-cropper-wrapper__fade"},i))};function t5(t){t.preventDefault()}var t6=(0,s.forwardRef)(function(t,e){var i,n=t.className,o=t.style,r=t.cropper,c=t.crossOrigin,l=void 0===c||c,d=r.getState(),h=r.getTransitions(),u=r.getImage(),m=u&&d&&(void 0===(i=h)&&(i=null),u&&d&&d.visibleArea)?t_(u,d,d.visibleArea,tc(d),i):{},p=u?u.src:void 0;return p?s.createElement("img",{key:p,ref:e,className:tB()("advanced-cropper-background-image",n),src:p,crossOrigin:!0===l?"anonymous":l||void 0,style:(0,a.pi)((0,a.pi)({},m),o),onMouseDown:t5}):null});
1t6.displayName="CropperBackgroundImage";var t3=(0,s.forwardRef)(function(t,e){var i=(0,s.useRef)(null),n=(0,s.useRef)(null);return(0,s.useImperativeHandle)(e,function(){return{draw:function(t,e,o){return(void 0===o&&(o={}),e&&i.current&&n.current)?function(t,e,i,n,o){if(!tn(t))return null;var r=t.transforms,s=t.coordinates,c=0!==r.rotate||r.flip.horizontal||r.flip.vertical?function(t,e,i){var n=i.rotate,o=i.flip,r={width:"naturalWidth"in e?e.naturalWidth:e.width,height:"naturalHeight"in e?e.naturalHeight:e.height},s=F(r,n),c=t.getContext("2d");if(t.height=s.height,t.width=s.width,c){c.save();var l=Z(I((0,a.pi)({left:0,top:0},r)),n);c.translate(-(l.left-s.width/2),-(l.top-s.height/2)),c.rotate(n*Math.PI/180),c.translate(o.horizontal?r.width:0,o.vertical?r.height:0),c.scale(o.horizontal?-1:1,o.vertical?-1:1),c.drawImage(e,0,0,r.width,r.height),c.restore()}return t}(n,e,r):e,l=(0,a.pi)({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:1/0,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},o),d=function(t){return t.find(function(t){return w(t)})},h=tf({sizeRestrictions:{minWidth:d([l.width,l.minWidth])||0,minHeight:d([l.height,l.minHeight])||0,maxWidth:d([l.width,l.maxWidth])||1/0,maxHeight:d([l.height,l.maxHeight])||1/0},width:s.width,height:s.height,aspectRatio:{minimum:s.width/s.height,maximum:s.width/s.height}});if(l.maxArea&&h.width*h.height>l.maxArea){var u=Math.sqrt(l.maxArea/(h.width*h.height));h={width:Math.round(u*h.width),height:Math.round(u*h.height)}}return function(t,e,i,n,o){t.width=n?n.width:i.width,t.height=n?n.height:i.height;var r=t.getContext("2d");if(r){r.clearRect(0,0,t.width,t.height),o&&(o.imageSmoothingEnabled&&(r.imageSmoothingEnabled=o.imageSmoothingEnabled),o.imageSmoothingQuality&&(r.imageSmoothingQuality=o.imageSmoothingQuality),o.fillColor&&(r.fillStyle=o.fillColor,r.fillRect(0,0,t.width,t.height),r.save()));var a=i.left<0?-i.left:0,s=i.top<0?-i.top:0;r.drawImage(e,i.left+a,i.top+s,i.width,i.height,t.width/i.width*a,t.height/i.height*s,t.width,t.height)}return t}(i,c,s,h,l)}(t,e,i.current,n.current,o):null}}}),s.createElement(s.Fragment,null,s.createElement("canvas",{className:"advanced-cropper-canvas",ref:i}),s.createElement("canvas",{className:"advanced-cropper-canvas",ref:n}))});t3.displayName="CropperCanvas";var t4=function(t){function e(e){var i=t.call(this,e)||this;return i.processMove=function(t,e){var n,o=i.container.current;if(o&&i.touches.length){var r=o.getBoundingClientRect(),s=r.left,c=r.top;if(1===i.touches.length&&1===e.length&&i.props.onMove){var l={left:Math.abs(e[0].clientX-i.anchor.left-s)<Math.abs(i.touches[0].clientX-i.anchor.left-s),top:Math.abs(e[0].clientY-i.anchor.top-c)<Math.abs(i.touches[0].clientY-i.anchor.top-c)},d={left:0,top:0};i.props.useAnchor&&l.left||(d.left=e[0].clientX-i.touches[0].clientX),i.props.useAnchor&&l.top||(d.top=e[0].clientY-i.touches[0].clientY),null===(n=i.props)||void 0===n||n.onMove(d,t),i.touches=(0,a.ev)([],(0,a.CR)(e),!1)}}},i.processEnd=function(){var t=i.props,e=t.onMoveEnd,n=t.onLeave;!i.props.disabled&&i.touches.length&&(null==e||e()),i.hovered&&(null==n||n(),i.hovered=!1),i.touches=[]},i.initAnchor=function(t){var e=i.container.current;if(e){var n=e.getBoundingClientRect(),o=n.left,r=n.top;i.anchor={left:t.clientX-o,top:t.clientY-r}}},i.onMouseOver=function(){var t=i.props,e=t.onEnter,n=t.disabled;i.hovered||n||(i.hovered=!0,null==e||e())},i.onMouseLeave=function(){var t=i.props.onLeave;i.hovered&&!i.touches.length&&(i.hovered=!1,null==t||t())},i.onTouchStart=function(t){var e=i.props,n=e.onEnter,o=e.onMoveStart,r=e.disabled;if(t.cancelable){i.touches=Array.from(t.touches);var a=!r&&1===t.touches.length;a&&(i.touches=Array.from(t.touches),null==o||o()),i.hovered||r||(i.hovered=!0,null==n||n()),(i.started||a)&&(t.preventDefault(),t.stopPropagation())}},i.onTouchEnd=function(){i.started=!1,i.processEnd()},i.onTouchMove=function(t){i.touches.length>=1&&(i.started?(i.processMove(t,Array.from(t.touches)),t.preventDefault(),t.stopPropagation()):y({left:i.touches[0].clientX,top:i.touches[0].clientY},{left:t.touches[0].clientX,top:t.touches[0].clientY})>(i.props.activationDistance||0)&&(i.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),i.started=!0))},i.onMouseDown=function(t){var e=i.props,n=e.onMoveStart;if(!e.disabled&&0===t.button){var o={clientX:t.clientX,clientY:t.clientY};i.touches=[o],i.initAnchor(o),t.stopPropagation(),null==n||n()}},i.onMouseMove=function(t){!i.props.disabled&&i.touches.length&&(i.processMove(t,[{clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},i.onMouseUp=function(){i.processEnd()},i.touches=[],i.hovered=!1,i.started=!1,i.anchor={left:0,top:0},i.container=(0,s.createRef)(),i}return(0,a.ZT)(e,t),e.prototype.componentWillUnmount=function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd);var t=this.container.current;t&&(t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("mousedown",this.onMouseDown))},e.prototype.componentDidMount=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});var t=this.container.current;t&&(t.addEventListener("touchstart",this.onTouchStart,{passive:!1}),t.addEventListener("mousedown",this.onMouseDown,{passive:!1}))},e.prototype.componentDidUpdate=function(t){this.props.disabled&&!t.disabled&&(this.touches=[])},e.prototype.render=function(){var t=this.props,e=t.children,i=t.className;return s.createElement("div",{className:tB()("advanced-cropper-draggable-element",i),ref:this.container,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},e)},e.defaultProps={disabled:!1,activationDistance:30,useAnchor:!0,rerender:!0},e}(s.Component),t7=function(t){var e=t.position,i=t.className,n=t.disabled,o=t.onDrag,r=t.onDragEnd,a=t.onLeave,c=t.onEnter,l=t.children;return s.createElement(t4,{className:tB()(["advanced-cropper-line-wrapper",e&&"advanced-cropper-line-wrapper--".concat(e),n&&"advanced-cropper-line-wrapper--disabled",i]),disabled:n,onMove:o,onMoveEnd:r,onLeave:a,onEnter:c,activationDistance:0},s.createElement("div",{className:tB()(["advanced-cropper-line-wrapper__content",e&&"advanced-cropper-line-wrapper__content--".concat(e)
1])},l))},et=function(t){var e,i,n=t.position,o=t.hoverClassName,r=t.wrapperClassName,c=t.defaultClassName,l=t.disabled,d=t.onMove,h=t.onMoveEnd,u=(0,a.CR)((0,s.useState)(!1),2),m=u[0],p=u[1];return s.createElement(t7,{className:tB()("advanced-cropper-simple-line-wrapper",r,((e={})["advanced-cropper-simple-line-wrapper--".concat(n)]=!!n,e)),position:n,disabled:l,onDrag:d,onDragEnd:h,onLeave:function(){p(!1)},onEnter:function(){p(!0)}},s.createElement("div",{className:tB()("advanced-cropper-simple-line",m&&"advanced-cropper-simple-line--hover",c,m&&o,((i={})["advanced-cropper-simple-line--".concat(n)]=!!n,i))}))},ee=function(t){var e=t.horizontalPosition,i=t.verticalPosition,n=t.className,o=t.disabled,r=t.onDrag,a=t.onDragEnd,c=t.onLeave,d=t.onEnter,h=t.children,u=t.style,m=e||i?l(e,i).snakeCase:null;return s.createElement("div",{style:u,className:tB()(n,"advanced-cropper-handler-wrapper",m&&"advanced-cropper-handler-wrapper--".concat(m),o&&"advanced-cropper-handler-wrapper--disabled")},s.createElement(t4,{className:"advanced-cropper-handler-wrapper__draggable",disabled:o,onMove:r,onMoveEnd:a,onLeave:c,onEnter:d,activationDistance:0},h))},ei=function(t){var e,i=t.verticalPosition,n=t.horizontalPosition,o=t.hoverClassName,r=t.wrapperClassName,c=t.defaultClassName,l=t.wrapperStyle,d=t.disabled,h=t.onMove,u=t.onMoveEnd,m=(0,a.CR)((0,s.useState)(!1),2),p=m[0],f=m[1];return s.createElement(ee,{style:l,className:tB()("advanced-cropper-simple-handler-wrapper",r,i&&"advanced-cropper-simple-handler-wrapper--".concat(i),n&&"advanced-cropper-simple-handler-wrapper--".concat(n),n&&i&&"advanced-cropper-simple-handler-wrapper--".concat(n,"-").concat(i),p&&"advanced-cropper-simple-handler-wrapper--hover"),verticalPosition:i,horizontalPosition:n,disabled:d,onDrag:h,onDragEnd:u,onLeave:function(){f(!1)},onEnter:function(){f(!0)}},s.createElement("div",{className:tB()("advanced-cropper-simple-handler",p&&"advanced-cropper-simple-handler--hover",c,p&&o,((e={})["advanced-cropper-simple-handler--".concat(i)]=!!i,e["advanced-cropper-simple-handler--".concat(n)]=!!n,e["advanced-cropper-simple-handler--".concat(n,"-").concat(i)]=n&&i,e))}))},en=["east","west",null],eo=["south","north",null],er=function(t){var e=t.style,i=t.className,n=t.children,o=t.onResize,r=t.onResizeEnd,c=t.handlerComponent,d=void 0===c?ei:c,h=t.handlers,u=void 0===h?{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}:h,m=t.handlerClassNames,f=void 0===m?{}:m,v=t.handlerWrapperClassNames,g=void 0===v?{}:v,b=t.lines,w=void 0===b?{west:!0,north:!0,east:!0,south:!0}:b,y=t.lineComponent,x=void 0===y?et:y,A=t.lineClassNames,C=void 0===A?{}:A,E=t.lineWrapperClassNames,M=void 0===E?{}:E,R=t.disabled,S=void 0!==R&&R,N=t.reference,z=void 0===N?null:N,P=(0,a.CR)((0,s.useState)(null),2),W=P[0],H=P[1],I=(0,s.useMemo)(function(){var t=[];return en.forEach(function(e){eo.forEach(function(i){if(e!==i){var n=l(e,i),o=n.snakeCase,r=n.camelCase;o&&r&&t.push({name:r,className:o,verticalPosition:i,horizontalPosition:e})}})}),t},[]),_=(0,s.useMemo)(function(){var t=[];return I.forEach(function(e){var i;("west"===(i=e.name)||"south"===i||"north"===i||"east"===i)&&(p(w)?w[e.name]:w)&&t.push({name:e.name,component:x,className:tB()(C.default,C[e.name],S&&C.disabled),wrapperClassName:tB()("advanced-cropper-bounding-box__line","advanced-cropper-bounding-box__line--".concat(e.name),M.default,M[e.name],S&&M.disabled),hoverClassName:C.hover,verticalPosition:e.verticalPosition,horizontalPosition:e.horizontalPosition,disabled:S})}),t},[I,w,x,C,M,S]),T=(0,s.useMemo)(function(){var t=[];return I.forEach(function(e){(p(u)?u[e.name]:u)&&t.push({name:e.name,component:d,className:tB()(f.default,f[e.name]),containerClassName:tB()("advanced-cropper-bounding-box__handler-wrapper","advanced-cropper-bounding-box__handler-wrapper--".concat(e.className)),wrapperClassName:tB()("advanced-cropper-bounding-box__handler","advanced-cropper-bounding-box__handler--".concat(e.className),g.default,g[e.name]),hoverClassName:f.hover,verticalPosition:e.verticalPosition,horizontalPosition:e.horizontalPosition,disabled:S})}),t},[I,u,d,f,g,S]),D=function(t,e){return function(i,n){var r,a=i.left,s=i.top;if(!e&&t?r="width":e&&!t&&(r="height"),!S){if(o){var c=l(t,e).camelCase;c&&o(c,{left:a,top:s},{reference:W||z,preserveAspectRatio:n&&n.shiftKey,respectDirection:r,compensate:!0})}W||H(z)}}},L=function(){null==r||r(),H(null)};return s.createElement("div",{className:tB()("advanced-cropper-bounding-box",i),style:e},n,s.createElement("div",null,_.map(function(t){return s.createElement(t.component,{key:t.name,defaultClassName:t.className,hoverClassName:t.hoverClassName,wrapperClassName:t.wrapperClassName,position:t.name,disabled:t.disabled,onMove:
1D(t.horizontalPosition,t.verticalPosition),onMoveEnd:L})})),s.createElement("div",null,T.map(function(t){var e=s.createElement(t.component,{defaultClassName:t.className,hoverClassName:t.hoverClassName,wrapperClassName:t.wrapperClassName,horizontalPosition:t.horizontalPosition,verticalPosition:t.verticalPosition,disabled:t.disabled,onMove:D(t.horizontalPosition,t.verticalPosition),onMoveEnd:L});return s.createElement("div",{key:t.name,className:t.containerClassName},e)})))},ea=function(t){var e=t.className,i=t.children;return s.createElement("div",{className:tB()("advanced-cropper-stencil-overlay",e)},i)},es=function(t){var e,i,n,o,r,c=t.className,l=t.transitions,d=t.children,h=(0,a._T)(t,["className","transitions","children"]),u=(0,s.useRef)(null),m=(0,s.useRef)(h),p=(0,a.CR)((0,s.useState)(h),2),f=p[0],v=p[1],g=(0,a.CR)((void 0===(e=l)&&(e=null),i=(0,s.useRef)(new tk),o=(n=(0,a.CR)((0,s.useState)(!1),2))[0],r=n[1],[function(t){e&&e.active?i.current.start((0,a.pi)((0,a.pi)({},e),{onStart:function(){r(!0)},onProgress:function(e){t(e)},onStop:function(){r(!1)}})):i.current.active||t(1)},o]),2),w=g[0],y=g[1];(0,s.useLayoutEffect)(function(){if(!R(f,h)){v(h);var t=y?(0,a.pi)({},m.current):f;w(function(e){["left","top","height","width"].forEach(function(i){var n=h[i],o=t[i];m.current[i]=b(o)&&b(n)?o+(n-o)*e:n}),u.current&&(u.current.style.width="".concat(m.current.width,"px"),u.current.style.height="".concat(m.current.height,"px"),u.current.style.transform="translate3d(".concat(m.current.left,"px, ").concat(m.current.top,"px, 0px)"))})}},[f,y,h.width,h.height,h.top,h.left]);var x=y?m.current:h,A={left:0,top:0,width:"".concat(x.width,"px"),height:"".concat(x.height,"px"),transform:"translate3d(".concat(x.left,"px, ").concat(x.top,"px, 0px)")};return s.createElement("div",{ref:u,className:tB()("advanced-cropper-artificial-transition",c),style:A},d)},ec=function(t){var e=t.className,i=t.transitions,n=t.width,o=t.height,r=t.left,a=t.top,c=t.children;return s.createElement(es,{className:tB()("advanced-cropper-stencil-wrapper",e),transitions:i,width:n,height:o,top:a,left:r},c)},el=function(t){var e=t.columns,i=void 0===e?3:e,n=t.rows,o=void 0===n?3:n,r=t.visible,c=void 0!==r&&r,l=t.className,d=[],h=(0,a.CR)((0,s.useState)(i),2),u=h[0],m=h[1],p=(0,a.CR)((0,s.useState)(o),2),f=p[0],v=p[1];tJ(function(){c&&(v(o),m(i))},[c,i,o]);for(var g=0;g<f;g++){for(var b=[],w=0;w<u;w++)b.push(s.createElement("div",{key:w,className:tB()("advanced-cropper-stencil-grid__cell",0===g&&"advanced-cropper-stencil-grid__cell--top",g===f-1&&"advanced-cropper-stencil-grid__cell--bottom",0===w&&"advanced-cropper-stencil-grid__cell--left",w===u-1&&"advanced-cropper-stencil-grid__cell--right")}));d.push(s.createElement("div",{key:g,className:"advanced-cropper-stencil-grid__row"},b))}return s.createElement("div",{className:tB()("advanced-cropper-stencil-grid",c&&"advanced-cropper-stencil-grid--visible",l)},d)},ed=(0,s.forwardRef)(function(t,e){var i=t.cropper,n=t.coordinates,o=t.aspectRatio,r=t.minAspectRatio,a=t.maxAspectRatio,c=t.handlerComponent,l=void 0===c?ei:c,d=t.handlers,h=t.handlerClassNames,m=t.handlerWrapperClassNames,p=t.lines,f=t.lineComponent,v=void 0===f?et:f,g=t.lineClassNames,b=t.lineWrapperClassNames,w=t.resizable,y=t.movable,x=t.grid,A=t.gridClassName,C=t.className,E=t.movingClassName,M=t.resizingClassName,R=t.previewClassName,S=t.boundingBoxClassName,N=t.overlayClassName,z=t.draggableAreaClassName,P=t.disabled,W=i.getState(),H=i.getTransitions(),I=i.getInteractions(),_=(void 0===w||w)&&!P,T=(void 0===y||y)&&!P;(0,s.useImperativeHandle)(e,function(){return{aspectRatio:K(o||{minimum:r,maximum:a})}});var D=n?u(n)?n(W):n:tl(W),L=D.width,O=D.height,k=D.left,U=D.top;return W&&s.createElement(ec,{className:tB()("advanced-cropper-rectangle-stencil",C,I.moveCoordinates&&E,I.resizeCoordinates&&M,{"advanced-cropper-rectangle-stencil--movable":T,"advanced-cropper-rectangle-stencil--moving":I.moveCoordinates,"advanced-cropper-rectangle-stencil--resizable":_,"advanced-cropper-rectangle-stencil--resizing":I.resizeCoordinates,"advanced-cropper-rectangle-stencil--disabled":P}),width:L,height:O,left:k,top:U,transitions:H},s.createElement(er,{reference:W.coordinates,className:tB()(S,"advanced-cropper-rectangle-stencil__bounding-box"),handlers:void 0===d?{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}:d,handlerComponent:l,handlerClassNames:void 0===h?{}:h,handlerWrapperClassNames:void 0===m?{}:m,lines:void 0===p?{west:!0,north:!0,east:!0,south:!0}:p,lineComponent:v,lineClassNames:void 0===g?{}:g,lineWrapperClassNames:void 0===b?{}:b,onResize:function(t,e,n){i&&_&&i.resizeCoordinates(t,e,n)},onResizeEnd:function(){i&&i.resizeCoordinatesEnd()},disabled:!_},s.createElement(t4,{disabled:!T,onMove:function(t){i&&T&&i.moveCoordinates(t)},onMoveEnd:function(){i&&i.moveCoordinatesEnd()},className:tB()("advanced-cropper-rectangle-stencil__draggable-area",z)},s.createElement(ea,{className:tB()("advanced-cropper-rectangle-stencil__overlay",N)},x&&s.createElement(el,{visible:i.hasInteractions(),columns:I.transformImage.rotate?9:3,rows:I.transformImage.rotate?9:3,className:tB()("advanced-cropper-rectangle-stencil__grid",A)}),s.createElement("div",{className:tB()("advanced-cropper-rectangle-stencil__preview",R)})))))});ed.displayName="RectangleStencil";var eh=function(){function t(t){var e=t.active;this.active=e,this.defaultPrevented=!1}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t}(),eu=function(t){function e(e){var i=t.call(this,e)||this;return i.processMove=function(t){var e=i.props,n=e.onTransform,o=e.touchScale,r=e.touchMove,a=e.touchRotate,s=i.container.current;
1s&&n&&(n(function(t,e,i,n){if(void 0===n&&(n={}),1===e.length&&1===t.length)n.move&&(o={left:e[0].clientX-t[0].clientX,top:e[0].clientY-t[0].clientY});else if(t.length>1){var o,r,a,s=tU(e,i),c=tU(t,i);if(n.rotate&&2===e.length&&2===t.length){var l={left:[t[0].clientX-t[1].clientX,e[0].clientX-e[1].clientX],top:[t[0].clientY-t[1].clientY,e[0].clientY-e[1].clientY]},d=l.left[0]*l.top[1]-l.left[1]*l.top[0],h=l.left[0]*l.left[1]+l.top[0]*l.top[1];if(!x(h,0)&&!x(d,0)){var u=-(180*Math.atan2(d,h))/Math.PI;a={center:c.centerMass,angle:u}}}n.move&&(o={left:s.centerMass.left-c.centerMass.left,top:s.centerMass.top-c.centerMass.top}),n.scale&&(r={factor:c.spread/s.spread,center:c.centerMass})}return{move:o,scale:r,rotate:a}}(t,i.touches,s,{scale:o,rotate:a,move:r})),i.touches=t)},i.processEnd=function(){var t=i.props.onTransformEnd;i.transforming&&(i.transforming=!1,t&&t())},i.processStart=function(){i.transforming=!0,i.debouncedProcessEnd.clear()},i.processEvent=function(t){var e=i.props,n=e.onEvent,o=e.disabled,r=e.preventDefault,a=new eh({active:i.transforming});return n?n(a,t):(void 0===r||r)&&(t.preventDefault(),t.stopPropagation()),!o&&!a.defaultPrevented},i.onWheel=function(t){var e,n,o,r,a,s,c,l=i.props,d=l.onTransform,h=l.wheelScale,u=i.container.current;h&&i.processEvent(t)&&(i.processStart(),d&&u&&d((e=t,n=u,void 0===(o=!0===h?.1:h.ratio)&&(o=.1),s=(a=n.getBoundingClientRect()).left,c=a.top,{scale:{factor:1-o*(0==(r=+(e.deltaY||e.detail||e.wheelDelta))||r!=r?r:r>0?1:-1),center:{left:e.clientX-s,top:e.clientY-c}}})),i.touches.length||i.debouncedProcessEnd())},i.onTouchStart=function(t){var e=i.props,n=e.touchMove,o=e.touchScale,r=e.touchRotate;if(t.cancelable&&(n||(o||r)&&t.touches.length>1)&&i.processEvent(t)){var a=i.container.current;if(a){var s=a.getBoundingClientRect(),c=s.left,l=s.top,d=s.bottom,h=s.right;i.touches=Array.from(t.touches).filter(function(t){return t.clientX>c&&t.clientX<h&&t.clientY>l&&t.clientY<d})}}},i.onTouchEnd=function(t){0===t.touches.length&&(i.touches=[],i.processEnd())},i.onTouchMove=function(t){if(i.touches.length){var e=(0,a.ev)([],(0,a.CR)(t.touches),!1).filter(function(t){return!t.identifier||i.touches.find(function(e){return e.identifier===t.identifier})});i.processEvent(t)&&(i.processMove(e),i.processStart())}},i.onMouseDown=function(t){if(i.props.mouseMove&&"buttons"in t&&1===t.buttons&&i.processEvent(t)){var e={clientX:t.clientX,clientY:t.clientY};i.touches=[e],i.processStart()}},i.onMouseMove=function(t){i.touches.length&&i.processEvent(t)&&i.processMove([{clientX:t.clientX,clientY:t.clientY}])},i.onMouseUp=function(){i.touches=[],i.processEnd()},i.transforming=!1,i.touches=[],i.anchor={left:0,top:0},i.container=(0,s.createRef)(),i.debouncedProcessEnd=N(i.processEnd,e.timeout),i}return(0,a.ZT)(e,t),e.prototype.shouldComponentUpdate=function(){return!0},e.prototype.componentWillUnmount=function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd);var t=this.container.current;t&&(t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("wheel",this.onWheel))},e.prototype.componentDidMount=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});var t=this.container.current;t&&(t.addEventListener("touchstart",this.onTouchStart,{passive:!1}),t.addEventListener("mousedown",this.onMouseDown,{passive:!1}),t.addEventListener("wheel",this.onWheel,{passive:!1}))},e.prototype.render=function(){var t=this.props,e=t.className,i=t.children,n=t.style;return s.createElement("div",{className:e,style:n,ref:this.container},i)},e.defaultProps={touchMove:!0,mouseMove:!0,touchScale:!0,touchRotate:!1,wheelScale:!0,timeout:500},e}(s.Component),em=function(t){var e,i,n,o=t.scaleImage,r=t.moveImage,a=t.rotateImage,c=t.children,l=t.className,d=t.style,h=t.cropper,u=t.timeout,m=t.disabled,p=h.getTransitions(),v=(e=void 0!==a&&a,(0,s.useMemo)(function(){return f(e,{touch:!0},{touch:!1})},[e])),g=(i=void 0===o||o,(0,s.useMemo)(function(){return f(i,{touch:!0,wheel:{ratio:.1}},{touch:!1,wheel:!1})},[i])),b=(n=void 0===r||r,(0,s.useMemo)(function(){return f(n,{touch:!0,mouse:!0},{touch:!1,mouse:!1})},[n]));return s.createElement(eu,{className:l,style:d,onTransform:h.transformImage,onTransformEnd:h.transformImageEnd,touchMove:b.touch,mouseMove:b.mouse,touchScale:g.touch,wheelScale:g.wheel,touchRotate:v.touch,disabled:p.active||m,preventDefault:!m,timeout:u},c)},ep=(o=function(t,e){var i=t.style,n=t.className,o=t.stencilComponent,r=void 0===o?ed:o,c=t.stencilConstraints,l=void 0===c?tX:c,d=t.stencilProps,p=void 0===d?{}:d,f=t.wrapperComponent,v=t.wrapperProps,g=t.backgroundComponent,b=void 0===g?t6:g,w=t.backgroundProps,y=t.backgroundClassName,x=t.backgroundWrapperComponent,A=t.backgroundWrapperProps,C=t.boundaryComponent,M=void 0===C?t2:C,R=t.boundaryProps,S=t.boundaryClassName,N=t.canvas,z=void 0===N||N,P=t.crossOrigin,W=void 0===P||P,H=t.disabled,I=t.settings,_=(0,a._T)(t,["style","className","stencilComponent","stencilConstraints","stencilProps","wrapperComponent","wrapperProps","backgroundComponent","backgroundProps","backgroundClassName","backgroundWrapperComponent","backgroundWrapperProps","boundaryComponent","boundaryProps","boundaryClassName","canvas","crossOrigin","disabled","settings"]),T=(0,s.useRef)(null),D=function(t){var e,i,n,o,r,c,l,d,p,f,v,g,b,w,y,x,A,C,M,R,S,N,z,P,W,H,I,_,T,D=this,L=t(),k=L.src,X=L.onReady,Y=L.onError,B=L.onUpdate,F=L.canvas,Z=L.unloadTime,q=L.crossOrigin,G=L.checkOrientation,Q=L.autoReconcileState,$=(0,s.useRef)(null),tt=(0,s.useRef)(null),te=(0,s.useRef)(null),ti=(0,s.useRef)(null),tn=(0,a.CR)(tK(null),2),tr=tn[0],ta=tn[1],ts=(e=function(){return(0,a.pi)((0,a.pi)({},t()),{getInstance:function(){return ti.current}})},i=t0(),n=function(){var t=e(),i=t.settings,n=(0,a._T)(t,["settings"]),o=(0,a.pi)({imageRestriction:tx.i.fitArea,transformImage:{adjustStencil:!0}},i),r=(0,a.pi)({transitions:!0},n);return(0,a.pi)({settings:(0,a.pi)((0,a.pi)({},o),(0,a.pi)((0,a.pi)({},o),{sizeRestrictions:function(t,e){return o.sizeRestrictions?u(o.sizeRestrictions)?o.sizeRestrictions(t,e):o.sizeRestrictions:tW(t,e)},areaPositionRestrictions:function(t,e){var i,n,r,a,s;return o.areaPositionRestrictions?u(o.areaPositionRestrictions)?o.areaPositionRestrictions(t,e):o.areaPositionRestrictions:(i=t.visibleArea,n=t.boundary,r=e.imageRestriction,a=tm(t),s={},r===tx.i.fillArea?s={left:0,top:0,right:a.width,bottom:a.height}:r===tx.i.fitArea&&(U(n)>U(a)?(s={top:0,bottom:a.height},i&&(i.width>a.width?(s.left=-(i.width-a.width)/2,s.right=a.width-s.left):(s.left=0,s.right=a.width))):(s={left:0,right:a.width},i&&(i.height>a.height?(s.top=-(i.height-a.height)/2,s.bottom=a.height-s.top):(s.top=0,s.bottom=a.height)))),s)},areaSizeRestrictions:function(t,e){var i,n,r,a;return o.areaSizeRestrictions?u(o.areaSizeRestrictions)?o.areaSizeRestrictions(t,e):o.areaSizeRestrictions:(i=t.boundary,n=e.imageRestriction,r=tm(t),a={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},n===tx.i.fillArea?(a.maxWidth=r.width,a.maxHeight=r.height):n===tx.i.fitArea&&(U(i)>U(r)?(a.maxHeight=r.height,a.maxWidth=r.height*U(i)):(a.maxWidth=r.width,a.maxHeight=r.width/U(i))
1),a)},positionRestrictions:function(t,e){var i,n;return o.positionRestrictions?u(o.positionRestrictions)?o.positionRestrictions(t,e):o.positionRestrictions:(i=tm(t),n={},e.imageRestriction&&"none"!==e.imageRestriction&&(n={left:0,top:0,right:i.width,bottom:i.height}),n)},defaultCoordinates:function(t,e){if(o.defaultCoordinates)return u(o.defaultCoordinates)?o.defaultCoordinates(t,e):o.defaultCoordinates;var i=o.defaultSize;i||(i=tP);var n=u(i)?i(t,e):i,r=o.defaultPosition||tH;return[n,function(t){return(0,a.pi)({},u(r)?r(t,e):r)}]},defaultVisibleArea:function(t,e){return o.defaultVisibleArea?u(o.defaultVisibleArea)?o.defaultVisibleArea(t,e):o.defaultVisibleArea:function(t,e){var i=t.coordinates,n=t.boundary,o=tm(t),r=U(n);if(i){var s={height:Math.max(i.height,o.height),width:Math.max(i.width,o.width)},c={left:0,top:0,width:U(s)>r?s.width:s.height*r,height:U(s)>r?s.width/r:s.height};(c=V(c,to(t,e))).left=i.left+i.width/2-c.width/2,c.top=i.top+i.height/2-c.height/2;var l=j(i,O((0,a.pi)({left:0,top:0},o))),d={};return l.left||l.right||!(c.width<=o.width)||(d.left=0,d.right=o.width),l.top||l.bottom||!(c.height<=o.height)||(d.top=0,d.bottom=o.height),J(c,d)}var h=U(o),u={height:h<r?o.height:o.width/r,width:h<r?o.height*r:o.width};return{left:o.width/2-u.width/2,top:o.height/2-u.height/2,width:u.width,height:u.height}}(t,e)},aspectRatio:function(t,e){return K(u(o.aspectRatio)?o.aspectRatio(t,e):o.aspectRatio)}}))},r)},(o=(0,s.useRef)(n)).current=n,r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.current.apply(o,(0,a.ev)([],(0,a.CR)(t),!1))},(0,s.useRef)(new t$(r,i)).current),tc=(l=(c={src:k,crossOrigin:void 0===q||q,checkOrientation:void 0===G||G,unloadTime:void 0===Z?500:Z,canvas:void 0===F||F,onError:function(){ti.current&&(null==Y||Y(ti.current))}}).src,d=c.onLoadingStart,p=c.onLoadingEnd,f=c.onError,v=c.onLoad,g=c.crossOrigin,b=c.checkOrientation,w=c.canvas,y=c.unloadTime,A=(x=(0,a.CR)((0,s.useState)(null),2))[0],C=x[1],R=(M=(0,a.CR)((0,s.useState)(!1),2))[0],S=M[1],z=(N=(0,a.CR)(tK(!1),2))[0],P=N[1],W=(0,s.useRef)(null),(0,s.useEffect)(function(){if(W.current!==l){if(W.current=l||null,P(!1),l){S(!0),null==d||d();var t,e,i,n,o=[(t={crossOrigin:m(g)?w:g,checkOrientation:b},(void 0===(e=(0,a.pi)((0,a.pi)({},t),{crossOrigin:function(t){if(h(t))return!1;var e=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[],n={protocol:i[1]||"",host:i[2]||"",port:i[3]||""},o=function(t){return t.port||("http"===(t.protocol||e.protocol)?80:433)};return!(!n.protocol&&!n.host&&!n.port||n.protocol&&n.protocol==e.protocol&&n.host&&n.host==e.host&&n.host&&o(n)==o(e))}(l)&&t.crossOrigin}))&&(e={}),i=e.checkOrientation,n=e.parse,new Promise(function(t){i||n?new Promise(function(t,e){try{if(l){if(/^data:/i.test(l))t(function(t){for(var e=atob(t=t.replace(/^data:([^;]+);base64,/gim,"")),i=e.length,n=new ArrayBuffer(i),o=new Uint8Array(n),r=0;r<i;r++)o[r]=e.charCodeAt(r);return n}(l));else if(/^blob:/i.test(l)){var i,n,o=new FileReader;o.onload=function(e){var i;t(null===(i=e.target)||void 0===i?void 0:i.result)},i=function(t){o.readAsArrayBuffer(t)},(n=new XMLHttpRequest).open("GET",l,!0),n.responseType="blob",n.onload=function(){(200==this.status||0===this.status)&&i(this.response)},n.send()}else{var r=new XMLHttpRequest;r.onreadystatechange=function(){4===r.readyState&&(200===r.status||0===r.status?t(r.response):e("Warning: could not load an image to parse its orientation"))},r.onprogress=function(){"image/jpeg"!==r.getResponseHeader("content-type")&&r.abort()},r.withCredentials=!1,r.open("GET",l,!0),r.responseType="arraybuffer",r.send(null)}}else e("Error: the image is empty")}catch(t){e(t)}}).then(function(e){var i=function(t){try{var e,i=new DataView(t),n=void 0,o=void 0,r=void 0,a=void 0,s=void 0;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var c=i.byteLength,l=2;l+1<c;){if(255===i.getUint8(l)&&225===i.getUint8(l+1)){a=l;break}l++}if(a&&(n=a+4,o=a+10,"Exif"===function(t,e,i){var n,o="";for(n=e,i+=e;n<i;n++)o+=String.fromCharCode(t.getUint8(n));return o}(i,n,4))){var d=i.getUint16(o);if(((r=18761===d)||19789===d)&&42===i.getUint16(o+2,r)){var h=i.getUint32(o+4,r);h>=8&&(s=o+h)}}if(s)for(var u=i.getUint16(s,r),m=0;m<u;m++){var l=s+12*m+2;if(274===i.getUint16(l,r)){l+=8,e=i.getUint16(l,r),i.setUint16(l,1,r);break}}return e}catch(t){return null}}(e);t(tI(e?{src:l,arrayBuffer:e,orientation:i}:{src:l,arrayBuffer:null,orientation:null}))}).catch(function(e){console.warn(e),t(tI({src:l}))}):t(tI({src:l}))})).then(function(e){return new Promise(function(i,n){var o,r;(o=e.src,void 0===(r=t)&&(r={}),new Promise(function(t,e){var i=document.createElement("img");r.crossOrigin&&(i.crossOrigin=!0!==r.crossOrigin?r.crossOrigin:"anonymous"),i.src=o,i.style.visibility="hidden",i.style.position="fixed",document.body.appendChild(i),i.complete?(t(i),document.body.removeChild(i)):(i.addEventListener("load",function(){t(i),document.body.removeChild(i)}),i.addEventListener("error",function(){e(null),document.body.removeChild(i)}))})).then(function(t){i((0,a.pi)((0,a.pi)({}
1,e),{width:t.naturalWidth,height:t.naturalHeight}))}).catch(function(){n(null)})})}))];z&&y&&o.push(E(y)),Promise.all(o).then(function(t){var e=(0,a.CR)(t,1)[0];W.current===l&&C(e)}).catch(function(){W.current===l&&(null==f||f())}).finally(function(){W.current===l&&(null==p||p(),S(!1))})}else y?E(y).then(function(){W.current===l&&C(null)}):C(null)}},[l,A]),(0,s.useEffect)(function(){A&&P(!0,function(){null==v||v(A)})},[A]),{isLoading:function(){return R},isLoaded:function(){return z},getImage:function(){return A},setImage:C}),tl=(void 0===(H=void 0===Q||Q)&&(H=!0),_=(I=(0,a.CR)((0,s.useState)(H),2))[0],T=I[1],(0,s.useLayoutEffect)(function(){_&&!ts.hasInteractions()&&ts.reconcileState()}),{pause:function(){T(!1)},resume:function(){T(!0)}}),td=function(){return(0,a.mG)(D,void 0,void 0,function(){var t,e,i;return(0,a.Jh)(this,function(n){switch(n.label){case 0:if(!tt.current)return[3,2];return tl.pause(),t=tc.getImage(),[4,null===(i=tt.current)||void 0===i?void 0:i.stretchTo(t)];case 1:e=n.sent(),ta(t,function(){e&&t?ts.reset(e,t):ts.clear()}),tl.resume(),n.label=2;case 2:return[2]}})})},th=function(){return(0,a.mG)(D,void 0,void 0,function(){var t,e,i,n;return(0,a.Jh)(this,function(o){switch(o.label){case 0:if(!tt.current)return[3,2];return tl.pause(),t=tc.getImage(),[4,null===(n=tt.current)||void 0===n?void 0:n.stretchTo(t)];case 1:(e=o.sent())&&t?(i=ts.getState())?(e.width!==i.boundary.width||e.height!==i.boundary.height)&&(ts.setBoundary(e),ts.reconcileState()):ts.reset(e,t):ts.clear(),tl.resume(),o.label=2;case 2:return[2]}})})},tu={reset:function(){return td()},refresh:function(){return th()},setImage:function(t){return ta(t)},reconcileState:ts.reconcileState,moveCoordinates:ts.moveCoordinates,moveCoordinatesEnd:ts.moveCoordinatesEnd,resizeCoordinates:ts.resizeCoordinates,clear:ts.clear,resizeCoordinatesEnd:ts.resizeCoordinatesEnd,moveImage:ts.moveImage,flipImage:ts.flipImage,zoomImage:ts.zoomImage,rotateImage:ts.rotateImage,transformImage:ts.transformImage,transformImageEnd:ts.transformImageEnd,setCoordinates:ts.setCoordinates,setVisibleArea:ts.setVisibleArea,startTransitions:ts.startTransitions,setState:ts.setState,hasInteractions:ts.hasInteractions,getStencilCoordinates:ts.getStencilCoordinates,getCoordinates:ts.getCoordinates,getVisibleArea:ts.getVisibleArea,getTransforms:ts.getTransforms,getTransitions:ts.getTransitions,getInteractions:ts.getInteractions,getSettings:ts.getSettings,getState:ts.getState,getDefaultState:function(){var t=ts.getState(),e=tc.getImage();return t&&e?ts.createDefaultState(t.boundary,e):null},getCanvas:function(t){var e=ts.getState();return $.current&&te.current&&e?te.current.draw(e,$.current,t):null},getImage:function(){return tr?(0,a.pi)({},tr):null},isLoading:tc.isLoading,isLoaded:tc.isLoaded};return t1(function(){th()}),tJ(function(){td()},[tc.getImage()]),tJ(function(){ti.current&&tr&&(null==X||X(ti.current))},[tr]),tJ(function(){ti.current&&(null==B||B(ti.current))},[tc.isLoaded(),tc.isLoading()]),(0,s.useImperativeHandle)(ti,function(){return tu}),{cropper:tu,refs:{image:$,boundary:tt,canvas:te},image:tr}}(function(){return(0,a.pi)((0,a.pi)({},_),{crossOrigin:W,stencilProps:p,canvas:z,settings:(0,a.pi)((0,a.pi)({},I),l(I,(0,a.pi)((0,a.pi)({},p),T.current)))})}),L=D.cropper,k=D.image,X=D.refs;(0,s.useImperativeHandle)(e,function(){return L});var Y={loading:L.isLoading(),loaded:L.isLoaded()};return s.createElement(void 0===f?t9:f,(0,a.pi)({},void 0===v?{}:v,{disabled:H,className:tB()("advanced-cropper",n),cropper:L,style:i},Y),s.createElement(M,(0,a.pi)({},R,{ref:X.boundary,className:tB()("advanced-cropper__boundary",S)}),s.createElement(void 0===x?em:x,(0,a.pi)({},void 0===A?{}:A,{disabled:H,cropper:L,className:"advanced-cropper__background-wrapper"}),L.getState()&&s.createElement(b,(0,a.pi)({},void 0===w?{}:w,{ref:X.image,crossOrigin:W,cropper:L,className:tB()("advanced-cropper__background",y)})),s.createElement(r,(0,a.pi)({},p,{disabled:H,ref:T,cropper:L,image:k}))),z&&s.createElement(t3,{ref:X.canvas})))},(0,s.forwardRef)(o)),ef=["transformImage","moveCoordinates","resizeCoordinates","defaultCoordinates","defaultVisibleArea","areaPositionRestrictions","areaSizeRestrictions","sizeRestrictions","positionRestrictions","aspectRatio","minWidth","minHeight","maxWidth","maxHeight","defaultSize","defaultPosition","defaultTransforms","imageRestriction","priority"];function ev(t,e){void 0===e&&(e=ef);var i={settings:{},props:{}};
1return Object.keys(t).forEach(function(n){e.some(function(t){return t===n})?i.settings[n]=t[n]:i.props[n]=t[n]}),i}var eg=(0,s.forwardRef)(function(t,e){var i=ev(t,(0,a.ev)((0,a.ev)([],(0,a.CR)(ef),!1),["stencilSize"],!1));return s.createElement(ep,(0,a.pi)({postProcess:tG,stencilConstraints:tj},i.props,{settings:(0,a.pi)((0,a.pi)({defaultSize:tZ,aspectRatio:tq,sizeRestrictions:function(t,e){var i=u(tF)?tF(t,e):tF;return ti(tW(t,e),i)}},i.settings),{transformImage:(0,a.pi)((0,a.pi)({},i.settings.transformImage),{adjustStencil:!1})}),ref:e}))});eg.displayName="FixedCropper",(0,s.forwardRef)(function(t,e){var i,n=ev(t),o=n.props,r=n.settings,c=r.stencilSize,l=r.autoZoom,d=(0,a._T)(r,["stencilSize","autoZoom"]),h=(i=(0,s.useRef)([]),function(t){-1===i.current.indexOf(t)&&i.current.push(t)});return(m(l)||(o.postProcess||c?h("prop 'autoZoom' is deprecated now and will be removed, use 'postProcess' prop to pass your auto zoom function."):(h("prop 'autoZoom' is deprecated now and will be removed, use 'postProcess' prop to pass your auto zoom function. The 'postProcess' automatically set to 'hybridAutoZoom'"),o.postProcess=tQ)),m(c))?s.createElement(ep,(0,a.pi)({},o,{ref:e,settings:d})):(h("prop 'stencilSize' is deprecated for <Cropper/> component now and will be removed, use <FixedCropper/> component instead."),s.createElement(eg,(0,a.pi)({ref:e,stencilSize:c},d,o)))}).displayName="CropperComponent";var eb=(0,s.forwardRef)(function(t,e){var i=t.cropper,n=t.coordinates,o=t.handlerComponent,r=void 0===o?ei:o,a=t.handlers,c=t.handlerClassNames,l=t.handlerWrapperClassNames,d=t.lines,h=t.lineComponent,m=void 0===h?et:h,p=t.lineClassNames,f=t.lineWrapperClassNames,v=t.resizable,g=t.movable,b=t.grid,w=t.gridClassName,y=t.className,x=t.movingClassName,A=t.resizingClassName,C=t.previewClassName,E=t.boundingBoxClassName,M=t.overlayClassName,R=t.draggableAreaClassName,S=t.disabled,N=i.getState(),z=i.getTransitions(),P=i.getInteractions(),W=(void 0===v||v)&&!S,H=(void 0===g||g)&&!S;(0,s.useImperativeHandle)(e,function(){return{aspectRatio:1,boundingBox:"circle"}});var I=n?u(n)?n(N):n:tl(N),_=I.width,T=I.height,D=I.left,L=I.top;return N&&s.createElement(ec,{className:tB()("advanced-cropper-circle-stencil",y,P.moveCoordinates&&x,P.resizeCoordinates&&A,{"advanced-cropper-circle-stencil--movable":H,"advanced-cropper-circle-stencil--moving":P.moveCoordinates,"advanced-cropper-circle-stencil--resizable":W,"advanced-cropper-circle-stencil--resizing":P.resizeCoordinates,"advanced-cropper-circle-stencil--disabled":S}),width:_,height:T,left:D,top:L,transitions:z},s.createElement(er,{reference:N.coordinates,className:tB()(E,"advanced-cropper-circle-stencil__bounding-box"),handlers:void 0===a?{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}:a,handlerComponent:r,handlerClassNames:void 0===c?{}:c,handlerWrapperClassNames:void 0===l?{}:l,lines:void 0===d?{west:!0,north:!0,east:!0,south:!0}:d,lineComponent:m,lineClassNames:void 0===p?{}:p,lineWrapperClassNames:void 0===f?{}:f,onResize:function(t,e,n){i&&W&&i.resizeCoordinates(t,e,n)},onResizeEnd:function(){i&&i.resizeCoordinatesEnd()},disabled:!W},s.createElement(t4,{disabled:!H,onMove:function(t){i&&H&&i.moveCoordinates(t)},onMoveEnd:function(){i&&i.moveCoordinatesEnd()},className:tB()("advanced-cropper-circle-stencil__draggable-area",R)},s.createElement(ea,{className:tB()("advanced-cropper-circle-stencil__overlay",M)},b&&s.createElement(el,{visible:i.hasInteractions(),columns:P.transformImage.rotate?9:3,rows:P.transformImage.rotate?9:3,className:tB()("advanced-cropper-circle-stencil__grid",w)}),s.createElement("div",{className:tB()("advanced-cropper-circle-stencil__preview",C)})))))});eb.displayName="CircleStencil",(0,s.forwardRef)(function(t,e){var i=t.src,n=t.crossOrigin,o=void 0===n||n,r=(0,a._T)(t,["src","crossOrigin"]);return i?s.createElement("img",(0,a.pi)({key:i,ref:e,src:i,className:tB()("advanced-cropper-source"),crossOrigin:!0===o?"anonymous":o||void 0},r)):null}).displayName="CropperSource";var ew=function(t){var e=t.children,i=t.cropper,n=t.className,o=t.style;return s.createElement("div",{className:tB()(n,"cropper-preview-wrapper"),style:o},s.createElement(t8,{visible:null==i?void 0:i.isLoaded(),className:"cropper-preview-wrapper__fade"},e))},ey=function(t){var e,i=t.className,n=t.cropper,o=t.crossOrigin,r=void 0===o||o,c=t.size,l=t.style,d=n.getState(),h=n.getTransitions(),u=n.getImage(),m=c&&u&&(null==d?void 0:d.coordinates)&&(void 0===(e=h)&&(e=null),u&&d&&d.visibleArea&&d.coordinates)?t_(u,d,d.coordinates,U(d.coordinates)>U(c)?d.coordinates.width/c.width:d.coordinates.height/c.height,e):{},p=u?u.src:void 0;return p?s.createElement("img",{key:p,className:tB()("advanced-cropper-background-image",i),src:p,crossOrigin:!0===r?"anonymous":r||void 0,style:(0,a.pi)((0,a.pi)({},m),l),onMouseDown:t5}):null};(0,s.forwardRef)(function(t,e){var i,n,o,r,c=t.className,l=t.contentClassName,d=t.state,h=void 0===d?null:d,u=t.image,m=void 0===u?null:u,p=t.transitions,f=void 0===p?null:p,v=t.backgroundComponent,g=t.backgroundProps,b=t.backgroundClassName,w=t.boundaryComponent,y=void 0===w?t2:w,x=t.boundaryProps,C=t.boundaryClassName,E=t.wrapperComponent,M=t.wrapperProps,R=t.loaded,S=void 0===R||R,N=t.loading,z=void 0!==N&&N,P=t.style,W=t.cropper,H=t0(),I=(0,s.useRef)(null),_=(0,s.useRef)(null),T=W||(_.current?_:{current:{getState:function(){return h},getTransitions:function(){return f},getImage:function(){return m},isLoaded:function(){return S},isLoading:function(){return z}}}
1),D=(0,a.CR)((0,s.useState)(null),2),L=D[0],O=D[1],k=null===(n=null===(i=T.current)||void 0===i?void 0:i.getState())||void 0===n?void 0:n.coordinates,X=null===(r=null===(o=T.current)||void 0===o?void 0:o.getImage())||void 0===r?void 0:r.src,Y=L?{width:"".concat(L.width,"px"),height:"".concat(L.height,"px")}:{},B=function(){var t,e,i=null===(e=null===(t=T.current)||void 0===t?void 0:t.getState())||void 0===e?void 0:e.coordinates;I.current&&i&&I.current.stretchTo(i).then(function(t){t&&i?A(U(i),U(t))?O({width:t.width,height:t.width/U(i)}):O({width:t.height*U(i),height:t.height}):O(null)}),H()};return t1(B),(0,s.useLayoutEffect)(B,[null==k?void 0:k.height,null==k?void 0:k.width]),(0,s.useImperativeHandle)(e,function(){return{refresh:B,update:function(t){t?_.current=t:_.current=null,B()}}}),s.createElement(void 0===E?ew:E,(0,a.pi)({},M,{className:tB()(c,"advanced-cropper-preview"),cropper:T.current,style:P}),s.createElement(y,(0,a.pi)({ref:I,stretchAlgorithm:tD},x,{className:tB()("advanced-cropper-preview__boundary",C)}),s.createElement("div",{className:tB()(l,"advanced-cropper-preview__content"),style:Y},T.current&&s.createElement(void 0===v?ey:v,(0,a.pi)({},g,{cropper:T.current,size:L,className:tB()(b,"advanced-cropper-preview__image",X&&"advanced-cropper-preview__image--visible")})))))})},94578:function(t,e,i){"use strict";i.d(e,{Z:function(){return o}});var n=i(89611);function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,(0,n.Z)(t,e)}},89611:function(t,e,i){"use strict";function n(t,e){return(n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}i.d(e,{Z:function(){return n}})}}]);
2//# sourceMappingURL=1967-3122162cfd49648b.js.map

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.