New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-svg-pan-zoom

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-svg-pan-zoom - npm Package Compare versions

Comparing version 2.9.0 to 2.9.1

build-storybook/static/manager.442e2b2fc27bbfe44151.bundle.js

2

build-umd/react-svg-pan-zoom.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):"object"==typeof exports?exports.ReactSVGPanZoom=t(require("react"),require("prop-types")):e.ReactSVGPanZoom=t(e.React,e.PropTypes)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=17)}([function(t,n){t.exports=e},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return a}),n.d(t,"e",function(){return u}),n.d(t,"f",function(){return c}),n.d(t,"g",function(){return l}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return p}),n.d(t,"m",function(){return v});var r="idle",i="panning",o="zooming",a="auto",u="none",c="pan",l="zoom-in",s="zoom-out",f="none",h="top",d="right",p="bottom",v="left"},function(e,t,n){"use strict";function r(e,t,r,o){return i({},v({},n.i(p.a)(),{version:2,mode:d.a,focus:!1,pinchPointDistance:null,prePinchMode:null,viewerWidth:e,viewerHeight:t,SVGWidth:r,SVGHeight:o,startX:null,startY:null,endX:null,endY:null,miniatureOpen:!0}))}function i(e,t){return e=Object.assign({},e,t),Object.freeze(e)}function o(e,t,r){var i=n.i(p.b)(e),o=n.i(p.c)(i);return n.i(p.d)(o,{x:t,y:r})}function a(e){var t=n.i(p.b)(e);return{scaleFactor:t.a,translationX:t.e,translationY:t.f}}function u(e,t){return i(e,{focus:t})}function c(e,t,n){return i(e,{viewerWidth:t,viewerHeight:n})}function l(e,t,n){return i(e,{SVGWidth:t,SVGHeight:n})}function s(e,t,r,o){var a=e.viewerWidth,u=e.viewerHeight,c=n.i(p.e)(n.i(p.f)(a/2-t,u/2-r),n.i(p.f)(t,r),n.i(p.g)(o,o),n.i(p.f)(-t,-r));return i(e,v({mode:d.a},c))}function f(e){return i(e,v({mode:d.a},n.i(p.a)()))}function h(e){return i(e,{mode:d.a,startX:null,startY:null,endX:null,endY:null})}t.e=r,t.c=i,t.d=o,t.j=a,t.i=u,t.f=c,t.g=l,t.a=s,t.b=f,t.h=h;var d=n(1),p=n(4),v=("function"==typeof Symbol&&Symbol.iterator,Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e})},function(e,n){e.exports=t},function(e,t,n){"use strict";var r=n(33);n.d(t,"d",function(){return r.a}),n.d(t,"h",function(){return r.b});var i=n(34);n.d(t,"b",function(){return i.a});var o=(n(35),n(36));n.d(t,"a",function(){return o.a});var a=n(37);n.d(t,"c",function(){return a.a});var u=(n(38),n(39),n(40));n.d(t,"g",function(){return u.a});var c=(n(41),n(42));n.d(t,"i",function(){return c.a});var l=n(43);n.d(t,"e",function(){return l.a});var s=n(44);n.d(t,"f",function(){return s.a})},function(e,t,n){"use strict";function r(e,t,r,i){var o=n.i(s.e)(n.i(s.b)(e),n.i(s.f)(t,r),n.i(s.g)(i,i),n.i(s.f)(-t,-r));return n.i(h.c)(e,p({mode:f.a},o,{startX:null,startY:null,endX:null,endY:null}))}function i(e,t,r,i,o){var a=e.viewerWidth,u=e.viewerHeight,c=a/i,l=u/o,d=Math.min(c,l),v=n.i(s.e)(n.i(s.g)(d,d),n.i(s.f)(-t,-r));return n.i(h.c)(e,p({mode:f.a},v,{startX:null,startY:null,endX:null,endY:null}))}function o(e){return i(e,0,0,e.SVGWidth,e.SVGHeight)}function a(e,t){var i=e.viewerWidth,o=e.viewerHeight,a=n.i(h.d)(e,i/2,o/2);return r(e,a.x,a.y,t)}function u(e,t,r){return n.i(h.c)(e,{mode:f.c,startX:t,startY:r,endX:t,endY:r})}function c(e,t,r){if(e.mode!==f.c)throw new Error("update selection not allowed in this mode "+e.mode);return n.i(h.c)(e,{endX:t,endY:r})}function l(e,t,o,a){var u=e.startX,c=e.startY,l=e.endX,s=e.endY,f=n.i(h.d)(e,u,c),p=n.i(h.d)(e,l,s);if(Math.abs(u-l)>7&&Math.abs(c-s)>7){var v=n.i(d.a)(f,p);return i(e,v.x,v.y,v.width,v.height)}var g=n.i(h.d)(e,t,o);return r(e,g.x,g.y,a)}t.a=r,t.b=i,t.c=o,t.d=a,t.e=u,t.g=c,t.f=l;var s=n(4),f=n(1),h=n(2),d=n(11),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";function r(e){return n.i(o.c)(e,{miniatureOpen:!0})}function i(e){return n.i(o.c)(e,{miniatureOpen:!1})}t.a=r,t.b=i;var o=n(2)},function(e,t,n){"use strict";function r(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=n.i(s.e)(n.i(s.b)(e),n.i(s.f)(t,r));if(i){var a=n.i(s.h)(o,[{x:i,y:i},{x:e.SVGWidth-i,y:e.SVGHeight-i}]),u=h(a,2),d=u[0],p=d.x,v=d.y,g=u[1],m=g.x,b=g.y,y=0;e.viewerWidth-p<0?y=e.viewerWidth-p:m<0&&(y=-m);var w=0;e.viewerHeight-v<0?w=e.viewerHeight-v:b<0&&(w=-b),o=n.i(s.e)(n.i(s.f)(y,w),o)}return n.i(l.c)(e,f({mode:c.a},o))}function i(e,t,r){return n.i(l.c)(e,{mode:c.b,startX:t,startY:r,endX:t,endY:r})}function o(e,t,i,o){if(e.mode!==c.b)throw new Error("update pan not allowed in this mode "+e.mode);var a=e.endX,u=e.endY,s=n.i(l.d)(e,a,u),f=n.i(l.d)(e,t,i),h=f.x-s.x,d=f.y-s.y,p=r(e,h,d,o);return n.i(l.c)(p,{mode:c.b,endX:t,endY:i})}function a(e){return n.i(l.c)(e,{mode:c.a,startX:null,startY:null,endX:null,endY:null})}function u(e,t,n){var i=0,o=0;return n<=20&&(o=20),e.viewerWidth-t<=20&&(i=-20),e.viewerHeight-n<=20&&(o=-20),t<=20&&(i=20),i/=e.d,o/=e.d,0===i&&0===o?e:r(e,i,o)}t.a=r,t.b=i,t.d=o,t.c=a,t.e=u;var c=n(1),l=n(2),s=n(4),f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){"use strict";function r(e){var t=e.tool,r=e.value,i=e.onChangeValue,a=e.onChangeTool,u=e.position,g=function(e,t){a(t),e.stopPropagation(),e.preventDefault()},m=function(e){i(n.i(l.c)(r)),e.stopPropagation(),e.preventDefault()},b=[c.j,c.l].indexOf(u)>=0,y={position:"absolute",transform:[c.j,c.l].indexOf(u)>=0?"translate(-50%, 0px)":"none",top:[c.m,c.k,c.j].indexOf(u)>=0?"5px":"unset",left:[c.j,c.l].indexOf(u)>=0?"50%":c.m===u?"5px":"unset",right:[c.k].indexOf(u)>=0?"5px":"unset",bottom:[c.l].indexOf(u)>=0?"5px":"unset",backgroundColor:"rgba(19, 20, 22, 0.90)",borderRadius:"2px",display:"flex",flexDirection:b?"row":"column",padding:b?"1px 2px":"2px 1px"};return o.a.createElement("div",{style:y,role:"toolbar"},o.a.createElement(v.a,{toolbarPosition:u,active:t===c.e,name:"unselect-tools",title:"Selection",onClick:function(e){return g(e,c.e)}},o.a.createElement(s.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:t===c.f,name:"select-tool-pan",title:"Pan",onClick:function(e){return g(e,c.f)}},o.a.createElement(f.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:t===c.g,name:"select-tool-zoom-in",title:"Zoom in",onClick:function(e){return g(e,c.g)}},o.a.createElement(h.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:t===c.h,name:"select-tool-zoom-out",title:"Zoom out",onClick:function(e){return g(e,c.h)}},o.a.createElement(d.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:!1,name:"fit-to-viewer",title:"Fit to viewer",onClick:function(e){return m(e)}},o.a.createElement(p.a,null)))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(1),l=n(5),s=n(22),f=n(24),h=n(25),d=n(26),p=n(23),v=n(27);r.propTypes={position:u.a.oneOf([c.j,c.k,c.l,c.m]).isRequired,tool:u.a.string.isRequired,value:u.a.object.isRequired,onChangeValue:u.a.func.isRequired,onChangeTool:u.a.func.isRequired}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(2),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n,i){r(this,e),this.originalEvent=t,this.value=n,this.SVGViewer=i}return o(e,[{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"scaleFactor",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||n.i(i.j)(this.value),this._cacheDecomposedValue.scaleFactor}},{key:"translationX",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||n.i(i.j)(this.value),this._cacheDecomposedValue.translationX}},{key:"translationY",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||n.i(i.j)(this.value),this._cacheDecomposedValue.translationY}}]),e}();t.a=a},function(e,t,n){"use strict";function r(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var l=t.getBoundingClientRect(),p=l.left,v=l.top;u=e.clientX-Math.round(p),c=e.clientY-Math.round(v)}var g=i;switch(r){case s.h:var m=n.i(f.d)(i,u,c);g=n.i(d.a)(i,m.x,m.y,1/o.scaleFactor);break;case s.g:g=n.i(d.e)(i,u,c);break;case s.d:case s.f:g=n.i(h.b)(i,u,c);break;default:return i}return e.preventDefault(),g}function i(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var l=t.getBoundingClientRect(),f=l.left,p=l.top;u=e.clientX-Math.round(f),c=e.clientY-Math.round(p)}var v=0===e.buttons,g=i;switch(r){case s.g:i.mode===s.c&&(g=v?n.i(d.f)(i,u,c,o.scaleFactor):n.i(d.g)(i,u,c));break;case s.d:case s.f:i.mode===s.b&&(g=v?n.i(h.c)(i):n.i(h.d)(i,u,c,o.preventPanOutside?20:void 0));break;default:return i}return e.preventDefault(),g}function o(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var l=t.getBoundingClientRect(),f=l.left,p=l.top;u=e.clientX-Math.round(f),c=e.clientY-Math.round(p)}var v=i;switch(r){case s.h:i.mode===s.c&&(v=n.i(d.f)(i,u,c,1/o.scaleFactor));break;case s.g:i.mode===s.c&&(v=n.i(d.f)(i,u,c,o.scaleFactor));break;case s.d:case s.f:i.mode===s.b&&(v=n.i(h.c)(i,u,c));break;default:return i}return e.preventDefault(),v}function a(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var l=t.getBoundingClientRect(),h=l.left,p=l.top;u=e.clientX-Math.round(h),c=e.clientY-Math.round(p)}var v=i;switch(r){case s.d:var g=n.i(f.d)(i,u,c),m=function(t,n){return t||e.getModifierState(n)},b=o.modifierKeys.reduce(m,!1),y=b?1/o.scaleFactor:o.scaleFactor;v=n.i(d.a)(i,g.x,g.y,y);break;default:return i}return e.preventDefault(),v}function u(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var l=t.getBoundingClientRect(),s=l.left,h=l.top;u=e.clientX-Math.round(s),c=e.clientY-Math.round(h)}if(!o.detectWheel)return i;var v=Math.max(-1,Math.min(1,e.deltaY)),g=n.i(p.a)(v,-1,1,1.06,.96),m=n.i(f.d)(i,u,c),b=n.i(d.a)(i,m.x,m.y,g);return e.preventDefault(),b}function c(e,t,r,i,o){var a=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],n.i(f.i)(i,"mouseenter"===e.type));return e.preventDefault(),a}function l(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=a.x,c=a.y;return[s.e,s.d].indexOf(r)>=0&&o.detectAutoPan&&i.focus?n.i(h.e)(i,u,c):i}t.b=r,t.c=i,t.d=o,t.e=a,t.f=u,t.g=c,t.a=l;var s=n(1),f=n(2),h=n(7),d=n(5),p=n(32)},function(e,t,n){"use strict";function r(e,t){return e.x<=t.x&&e.y<=t.y?{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:e.x>=t.x&&e.y<=t.y?{x:t.x,y:e.y,width:e.x-t.x,height:t.y-e.y}:e.x>=t.x&&e.y>=t.y?{x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:e.x<=t.x&&e.y>=t.y?{x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:void 0}t.a=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),u=n.n(a),c=n(3),l=n.n(c),s=n(4),f=n(13),h=n(7),d=n(2),p=n(10),v=n(16),g=n(5),m=n(6),b=n(29),y=n(28),w=n(31),V=n(8),O=n(30),x=n(21),k=n(1),E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),M=function(e){function t(e,o){r(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o)),u=a.props,c=u.tool,l=u.value,s=u.width,f=u.height,h=u.children,p=h.props,v=p.width,g=p.height;return a.state={value:l||n.i(d.e)(s,f,v,g),tool:c||k.e},a.ViewerDOM=null,a}return o(t,e),P(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.getValue();if(t.viewerWidth!==e.width||t.viewerHeight!==e.height){var r=n.i(d.f)(t,e.width,e.height);this.setValue(r)}var i=e.children.props,o=i.width,a=i.height;if(t.SVGWidth!==o||t.SVGHeight!==a){var u=n.i(d.g)(t,o,a);this.setValue(u)}}},{key:"getValue",value:function(){return this.props.value?this.props.value:this.state.value}},{key:"getTool",value:function(){return this.props.tool?this.props.tool:this.state.tool}},{key:"getSvgStyle",value:function(e){var t={display:"block"};return e&&(t.cursor=e),(this.props.detectPinchGesture||-1!==[k.f,k.d].indexOf(this.getTool()))&&(t.touchAction="none"),t}},{key:"setValue",value:function(e){this.setState({value:e}),this.props.onChangeValue&&this.props.onChangeValue(e)}},{key:"pan",value:function(e,t){var r=n.i(h.a)(this.getValue(),e,t);this.setValue(r)}},{key:"zoom",value:function(e,t,r){var i=n.i(g.a)(this.getValue(),e,t,r);this.setValue(i)}},{key:"fitSelection",value:function(e,t,r,i){var o=n.i(g.b)(this.getValue(),e,t,r,i);this.setValue(o)}},{key:"fitToViewer",value:function(){var e=n.i(g.c)(this.getValue());this.setValue(e)}},{key:"zoomOnViewerCenter",value:function(e){var t=n.i(g.d)(this.getValue(),e);this.setValue(t)}},{key:"setPointOnViewerCenter",value:function(e,t,r){var i=n.i(d.a)(this.getValue(),e,t,r);this.setValue(i)}},{key:"reset",value:function(){var e=n.i(d.b)(this.getValue());this.setValue(e)}},{key:"changeTool",value:function(e){this.setState({tool:e}),this.props.onChangeTool&&this.props.onChangeTool(e)}},{key:"openMiniature",value:function(){var e=n.i(m.a)(this.getValue());this.setValue(e)}},{key:"closeMiniature",value:function(){var e=n.i(m.b)(this.getValue());this.setValue(e)}},{key:"handleViewerEvent",value:function(e){var t=this.props,r=this.state.value,i=this.ViewerDOM;if([k.e,k.d].indexOf(this.getTool())>=0&&e.target!==i){var o={click:t.onClick,dblclick:t.onDoubleClick,mousemove:t.onMouseMove,mouseup:t.onMouseUp,mousedown:t.onMouseDown,touchstart:t.onTouchStart,touchmove:t.onTouchMove,touchend:t.onTouchEnd,touchcancel:t.onTouchCancel},a=o[e.type];a&&a(n.i(f.a)(e,r,i))}}},{key:"componentDidMount",value:function(){var e=this,t=this.props,r=this.state;t.onChangeValue&&t.onChangeValue(r.value),this.autoPanTimer=setInterval(function(){var t={x:e.state.viewerX,y:e.state.viewerY},r=n.i(p.a)(null,e.ViewerDOM,e.getTool(),e.getValue(),e.props,t);e.getValue()!==r&&e.setValue(r)},200)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.autoPanTimer)}},{key:"render",value:function(){var e=this,t=this.props,r=this.state,i=r.viewerX,o=r.viewerY,a=this.getTool(),c=this.getValue(),l=t.customToolbar,f=t.customMiniature,h=a===k.d&&c.mode===k.b&&c.startX!==c.endX&&c.startY!==c.endY,d=void 0;a===k.f&&(d=n.i(b.a)(c.mode===k.b?"grabbing":"grab")),a===k.g&&(d=n.i(b.a)("zoom-in")),a===k.h&&(d=n.i(b.a)("zoom-out")),h&&(d=n.i(b.a)("grabbing"));var g=[k.f,k.g,k.h].indexOf(a)>=0;return g=g||h,u.a.createElement("div",{style:E({position:"relative",width:c.viewerWidth,height:c.viewerHeight},t.style),className:this.props.className},u.a.createElement("svg",{ref:function(t){return e.ViewerDOM=t},width:c.viewerWidth,height:c.viewerHeight,style:this.getSvgStyle(d),onMouseDown:function(t){var r=n.i(p.b)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onMouseMove:function(t){var r=e.ViewerDOM.getBoundingClientRect(),i=r.left,o=r.top,a=t.clientX-Math.round(i),u=t.clientY-Math.round(o),c=n.i(p.c)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props,{x:a,y:u});e.getValue()!==c&&e.setValue(c),e.setState({viewerX:a,viewerY:u}),e.handleViewerEvent(t)},onMouseUp:function(t){var r=n.i(p.d)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onClick:function(t){e.handleViewerEvent(t)},onDoubleClick:function(t){var r=n.i(p.e)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onWheel:function(t){var r=n.i(p.f)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r)},onMouseEnter:function(t){if(!n.i(O.a)()){var r=n.i(p.g)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r)}},onMouseLeave:function(t){var r=n.i(p.g)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r)},onTouchStart:function(t){var r=n.i(v.a)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onTouchMove:function(t){var r=n.i(v.b)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onTouchEnd:function(t){var r=n.i(v.c)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onTouchCancel:function(t){var r=n.i(v.d)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)}},u.a.createElement("rect",{fill:t.background,x:0,y:0,width:c.viewerWidth,height:c.viewerHeight,style:{pointerEvents:"none"}}),u.a.createElement("g",{transform:n.i(s.i)(c),style:g?{pointerEvents:"none"}:{}},u.a.createElement("rect",{fill:this.props.SVGBackground,x:0,y:0,width:c.SVGWidth,height:c.SVGHeight}),u.a.createElement("g",null,t.children.props.children)),[k.e,k.d].indexOf(a)>=0&&t.detectAutoPan&&c.focus?u.a.createElement("g",{style:{pointerEvents:"none"}},o<=20?u.a.createElement(y.a,{direction:k.j,width:c.viewerWidth,height:c.viewerHeight}):null,c.viewerWidth-i<=20?u.a.createElement(y.a,{direction:k.k,width:c.viewerWidth,height:c.viewerHeight}):null,c.viewerHeight-o<=20?u.a.createElement(y.a,{direction:k.l,width:c.viewerWidth,height:c.viewerHeight}):null,c.focus&&i<=20?u.a.createElement(y.a,{direction:k.m,width:c.viewerWidth,height:c.viewerHeight}):null):null,c.mode!==k.c?null:u.a.createElement(w.a,{startX:c.startX,startY:c.startY,endX:c.endX,endY:c.endY})),t.toolbarPosition===k.i?null:u.a.createElement(l,{position:t.toolbarPosition,value:c,onChangeValue:function(t){return e.setValue(t)},tool:a,onChangeTool:function(t){return e.changeTool(t)}}),t.miniaturePosition===k.i?null:u.a.createElement(f,{position:t.miniaturePosition,value:c,onChangeValue:function(t){return e.setValue(t)},SVGBackground:this.props.SVGBackground,background:this.props.miniatureBackground,width:this.props.miniatureWidth,height:this.props.miniatureHeight},t.children.props.children))}}]),t}(u.a.Component);t.a=M,M.propTypes={width:l.a.number.isRequired,height:l.a.number.isRequired,background:l.a.string,SVGBackground:l.a.string,value:l.a.shape({version:l.a.oneOf([2]).isRequired,mode:l.a.oneOf([k.a,k.b,k.c]).isRequired,focus:l.a.bool.isRequired,a:l.a.number.isRequired,b:l.a.number.isRequired,c:l.a.number.isRequired,d:l.a.number.isRequired,e:l.a.number.isRequired,f:l.a.number.isRequired,viewerWidth:l.a.number.isRequired,viewerHeight:l.a.number.isRequired,SVGWidth:l.a.number.isRequired,SVGHeight:l.a.number.isRequired,startX:l.a.number,startY:l.a.number,endX:l.a.number,endY:l.a.number,miniatureOpen:l.a.bool.isRequired}),style:l.a.object,className:l.a.string,detectWheel:l.a.bool,detectAutoPan:l.a.bool,detectPinchGesture:l.a.bool,toolbarPosition:l.a.oneOf([k.i,k.j,k.k,k.l,k.m]),onChangeValue:l.a.func,onChangeTool:l.a.func,onClick:l.a.func,onDoubleClick:l.a.func,onMouseUp:l.a.func,onMouseMove:l.a.func,onMouseDown:l.a.func,preventPanOutside:l.a.bool,scaleFactor:l.a.number,tool:l.a.oneOf([k.d,k.e,k.f,k.g,k.h]),modifierKeys:l.a.array,customToolbar:l.a.oneOfType([l.a.element,l.a.func]),miniaturePosition:l.a.oneOf([k.i,k.k,k.m]),miniatureBackground:l.a.string,miniatureWidth:l.a.number,miniatureHeight:l.a.number,customMiniature:l.a.oneOfType([l.a.element,l.a.func]),children:function(e,t,n){var r=e[t],i=["svg"];return 1!==u.a.Children.count(r)||-1===i.indexOf(r.type)?new Error("`"+n+"` should have a single child of the following types: `"+i.join("`, `")+"`."):r.props.hasOwnProperty("width")&&r.props.hasOwnProperty("height")?void 0:new Error("SVG should have props `width` and `height`")}},M.defaultProps={value:null,tool:null,style:{},background:"#616264",SVGBackground:"#fff",detectWheel:!0,detectAutoPan:!0,detectPinchGesture:!0,toolbarPosition:k.k,modifierKeys:["Alt","Shift","Control"],customToolbar:V.a,preventPanOutside:!0,scaleFactor:1.1,miniaturePosition:k.m,miniatureWidth:100,miniatureHeight:80,miniatureBackground:"#616264",customMiniature:x.a}},function(e,t,n){"use strict";var r=n(14),i=n(15);t.a=function(e,t,n){var o=e.type;switch(o){case"mousemove":case"mouseup":case"mousedown":case"click":case"dblclick":return new r.a(e,t,n);case"touchstart":case"touchmove":case"touchend":case"touchcancel":return new i.a(e,t,n);default:throw new Error(o+" not supported")}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),u=n(9),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),c(t,[{key:"point",get:function(){if(!this._cachePoint){var e=this.originalEvent,t=this.value,r=this.SVGViewer,i=r.getBoundingClientRect(),o=e.clientX-Math.round(i.left),u=e.clientY-Math.round(i.top);this._cachePoint=n.i(a.d)(t,o,u)}return this._cachePoint}},{key:"x",get:function(){return this.point.x}},{key:"y",get:function(){return this.point.y}}]),t}(u.a);t.a=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),u=n(9),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),l(t,[{key:"points",get:function(){return this._cachePoints||(this._cachePoints=t.touchesToPoints(this.originalEvent.touches,this.SVGViewer,this.value)),this._cachePoints}},{key:"changedPoints",get:function(){return this._cacheChangedPoints||(this._cacheChangedPoints=t.touchesToPoints(this.originalEvent.changedTouches,this.SVGViewer,this.value)),this._cacheChangedPoints}}],[{key:"touchesToPoints",value:function(e,t,r){for(var i=[],o=0;o<e.length;o++){var u=e[o],l=t.getBoundingClientRect(),s=u.clientX-Math.round(l.left),f=u.clientY-Math.round(l.top),h=n.i(a.d)(r,s,f);i.push(c({},h,{identifier:u.identifier}))}return i}}]),t}(u.a);t.a=s},function(e,t,n){"use strict";function r(e){return"number"==typeof e.pinchPointDistance}function i(e,t,i,o,a){var u=t.getBoundingClientRect(),c=u.left,l=u.top,s=e.touches[0].clientX-Math.round(c),f=e.touches[0].clientY-Math.round(l),h=e.touches[1].clientX-Math.round(c),g=e.touches[1].clientY-Math.round(l),b=Math.sqrt(Math.pow(h-s,2)+Math.pow(g-f,2)),y=r(o)?o.pinchPointDistance:b,w=n.i(v.d)(o,(s+h)/2,(f+g)/2),V=b/y;e.cancelable&&e.preventDefault();var O=n.i(d.e)(n.i(d.b)(o),n.i(d.f)(w.x,w.y),n.i(d.g)(V,V),n.i(d.f)(-w.x,-w.y));return n.i(v.c)(o,n.i(v.c)(m({mode:p.c},O,{startX:null,startY:null,endX:null,endY:null,prePinchMode:o.prePinchMode?o.prePinchMode:o.mode,pinchPointDistance:b})))}function o(e,t){return t.detectPinchGesture&&e.touches.length>1}function a(e,t,n){return n.detectPinchGesture&&r(t)&&e.touches.length<2}function u(e,t){var n=t.getBoundingClientRect(),r=n.left,i=n.top;return{x:e.clientX-Math.round(r),y:e.clientY-Math.round(i)}}function c(e,t,r,i,o,a){var c=0===e.touches.length?n.i(v.c)(i,{mode:i.prePinchMode?p.a:i.mode,prePinchMode:null}):i,l=e.touches.length>0?e.touches[0]:e.changedTouches[0],s=u(l,t);switch(r){case p.h:case p.g:case p.d:case p.f:return e.stopPropagation(),e.preventDefault(),a(e,t,r,c,o,s);default:return c}}function l(e,t,r,a,u){if(o(e,u))return i(e,t,r,a,u);if(1!==e.touches.length){if([p.b,p.c].indexOf(a.mode)>=0)return n.i(v.h)(a);if([p.a].indexOf(a.mode)>=0)return a}return c(e,t,r,a,u,g.b)}function s(e,t,n,r,a){return o(e,a)?i(e,t,n,r,a):[p.b,p.c].indexOf(r.mode)>=0?c(e,t,n,r,a,g.c):r}function f(e,t,r,i,o){if(!([p.b,p.c].indexOf(i.mode)>=0))return i;var u=a(e,i,o)?n.i(v.c)(i,{pinchPointDistance:null}):i;return e.touches.length>0?u:c(e,t,r,u,o,g.d)}function h(e,t,r,i,o){return e.stopPropagation(),e.preventDefault(),n.i(v.h)(i)}t.a=l,t.b=s,t.c=f,t.d=h;var d=n(4),p=n(1),v=n(2),g=n(10),m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"Viewer",function(){return s});var r=n(12);n.d(t,"ReactSVGPanZoom",function(){return r.a});var i=n(8);n.d(t,"Toolbar",function(){return i.a});var o=n(2);n.d(t,"setPointOnViewerCenter",function(){return o.a}),n.d(t,"reset",function(){return o.b});var a=n(7);n.d(t,"pan",function(){return a.a});var u=n(5);n.d(t,"zoom",function(){return u.a}),n.d(t,"fitSelection",function(){return u.b}),n.d(t,"fitToViewer",function(){return u.c}),n.d(t,"zoomOnViewerCenter",function(){return u.d});var c=n(6);n.d(t,"openMiniature",function(){return c.a}),n.d(t,"closeMiniature",function(){return c.b});var l=n(1);n.d(t,"MODE_IDLE",function(){return l.a}),n.d(t,"MODE_PANNING",function(){return l.b}),n.d(t,"MODE_ZOOMING",function(){return l.c}),n.d(t,"TOOL_AUTO",function(){return l.d}),n.d(t,"TOOL_NONE",function(){return l.e}),n.d(t,"TOOL_PAN",function(){return l.f}),n.d(t,"TOOL_ZOOM_IN",function(){return l.g}),n.d(t,"TOOL_ZOOM_OUT",function(){return l.h}),n.d(t,"POSITION_NONE",function(){return l.i}),n.d(t,"POSITION_TOP",function(){return l.j}),n.d(t,"POSITION_RIGHT",function(){return l.k}),n.d(t,"POSITION_BOTTOM",function(){return l.l}),n.d(t,"POSITION_LEFT",function(){return l.m});var s=function(){return console.error("HEY! You are trying to use an older version of ReactSVGPanZoom. Read here https://github.com/chrvadala/react-svg-pan-zoom/blob/master/docs/migrate-from-v1-to-v2.md"),null}},function(e,t,n){"use strict";function r(e){var t=e.open,n=e.position,r=0;switch(n){case c.m:r=t?"rotate(225, 12, 13)":"rotate(45, 12, 13)";break;case c.k:r=r=t?"rotate(135, 12, 13)":"rotate(-45, 12, 13)"}return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",{transform:r},o.a.createElement("path",{fill:"#000000",d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"})))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(1);r.propTypes={open:u.a.bool.isRequired,position:u.a.oneOf([c.k,c.m]).isRequired}},function(e,t,n){"use strict";function r(e){var t=e.SVGWidth,n=e.SVGHeight,r=e.x1,i=e.y1,a=e.x2,u=e.y2;e.zoomToFit;return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("mask",{id:"react-svg-pan-zoom-miniature-mask"},o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,fill:"#ffffff"}),o.a.createElement("rect",{x:r,y:i,width:a-r,height:u-i}))),o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,style:{stroke:"none",fill:"#000",mask:"url(#react-svg-pan-zoom-miniature-mask)",opacity:.4}}))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a);r.propTypes={SVGWidth:u.a.number.isRequired,SVGHeight:u.a.number.isRequired,x1:u.a.number.isRequired,y1:u.a.number.isRequired,x2:u.a.number.isRequired,y2:u.a.number.isRequired,zoomToFit:u.a.number.isRequired}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t,n=e.value,i=e.onChangeValue,o=e.position,u=(t={width:"24px",height:"24px",display:"block",position:"absolute",bottom:0},r(t,o===f.m?"left":"right","0px"),r(t,"background","rgba(19, 20, 22, 0.901961)"),r(t,"border",0),r(t,"padding",0),r(t,"outline",0),r(t,"color","#fff"),t),c=n.miniatureOpen?l.b:l.a;return a.a.createElement("button",{role:"button",style:u,onClick:function(e){return i(c(n))}},a.a.createElement(s.a,{open:n.miniatureOpen,position:o}))}t.a=i;var o=n(0),a=n.n(o),u=n(3),c=n.n(u),l=n(6),s=n(18),f=n(1);i.propTypes={value:c.a.object.isRequired,onChangeValue:c.a.func.isRequired,position:c.a.oneOf([f.k,f.m]).isRequired}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t,i=e.value,o=e.onChangeValue,u=e.position,c=e.children,p=e.background,v=e.SVGBackground,g=e.width,m=e.height,b=i.SVGWidth,y=i.SVGHeight,w=i.viewerWidth,V=i.viewerHeight,O=y/b,x=O>=1?m/y:g/b,k=n.i(s.h)(n.i(s.c)(i),[{x:0,y:0},{x:w,y:V}]),E=d(k,2),P=E[0],M=P.x,T=P.y,C=E[1],S=C.x,R=C.y,j=void 0,_=void 0;i.miniatureOpen?(j=g,_=m):(j=24,_=24);var q=(t={position:"absolute",overflow:"hidden",outline:"1px solid rgba(19, 20, 22, 0.90)",transition:"width 200ms ease, height 200ms ease, bottom 200ms ease",width:j+"px",height:_+"px",bottom:"6px"},r(t,u===l.m?"left":"right","6px"),r(t,"background",p),t),D=O>=1?"translate("+(g-b*x)/2+", 0)":"translate(0, "+(m-y*x)/2+")";return a.a.createElement("div",{role:"navigation",style:q},a.a.createElement("svg",{width:g,height:m,style:{pointerEvents:"none"}},a.a.createElement("g",{transform:D},a.a.createElement("g",{transform:"scale("+x+", "+x+")"},a.a.createElement("rect",{fill:v,x:0,y:0,width:i.SVGWidth,height:i.SVGHeight}),c,a.a.createElement(h.a,{SVGWidth:b,SVGHeight:y,x1:M,y1:T,x2:S,y2:R,zoomToFit:x})))),a.a.createElement(f.a,{value:i,onChangeValue:o,position:u}))}t.a=i;var o=n(0),a=n.n(o),u=n(3),c=n.n(u),l=n(1),s=n(4),f=n(20),h=n(19),d=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();Math.min,Math.max;i.propTypes={position:c.a.oneOf([l.k,l.m]).isRequired,value:c.a.object.isRequired,onChangeValue:c.a.func.isRequired,background:c.a.string.isRequired,SVGBackground:c.a.string.isRequired,width:c.a.number.isRequired}},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15 3l2.3 2.3-2.89 2.87 1.42 1.42L18.7 6.7 21 9V3zM3 9l2.3-2.3 2.87 2.89 1.42-1.42L6.7 5.3 9 3H3zm6 12l-2.3-2.3 2.89-2.87-1.42-1.42L5.3 17.3 3 15v6zm12-6l-2.3 2.3-2.87-2.89-1.42 1.42 2.89 2.87L15 21h6z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",null,o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o.a.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),u=n.n(a),c=n(3),l=n.n(c),s=n(1),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),h=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hover:!1},n}return o(t,e),f(t,[{key:"change",value:function(e){switch(e.preventDefault(),e.stopPropagation(),e.type){case"mouseenter":case"touchstart":this.setState({hover:!0});break;case"mouseleave":case"touchend":case"touchcancel":this.setState({hover:!1})}}},{key:"render",value:function(){var e=this,t={display:"block",width:"24px",height:"24px",margin:[s.j,s.l].indexOf(this.props.toolbarPosition)>=0?"2px 1px":"1px 2px",color:this.props.active||this.state.hover?"#1CA6FC":"#FFF",transition:"color 200ms ease",background:"none",padding:"0px",border:"0px",outline:"0px",cursor:"pointer"};return u.a.createElement("button",{onMouseEnter:function(t){return e.change(t)},onMouseLeave:function(t){return e.change(t)},onTouchStart:function(t){e.change(t),e.props.onClick(t)},onTouchEnd:function(t){return e.change(t)},onTouchCancel:function(t){return e.change(t)},onClick:this.props.onClick,style:t,title:this.props.title,name:this.props.name,role:"button"},this.props.children)}}]),t}(u.a.Component);t.a=h,h.propTypes={title:l.a.string.isRequired,name:l.a.string.isRequired,toolbarPosition:l.a.string.isRequired,onClick:l.a.func.isRequired,active:l.a.bool.isRequired}},function(e,t,n){"use strict";function r(e){var t=e.direction,n=e.width,r=e.height,i=void 0;switch(t){case c.j:i="translate("+n+", 0) rotate(90)";break;case c.k:i="translate("+n+", "+r+") rotate(180)";break;case c.l:i="translate(0, "+r+") rotate(270)";break;case c.m:i=" "}return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("linearGradient",{id:"react-svg-pan-zoom-gradient1",x1:"0%",y1:"0%",x2:"100%",y2:"0%",spreadMethod:"pad"},o.a.createElement("stop",{offset:"0%",stopColor:"#fff",stopOpacity:"0.8"}),o.a.createElement("stop",{offset:"100%",stopColor:"#000",stopOpacity:"0.5"})),o.a.createElement("mask",{id:"react-svg-pan-zoom-mask1",x:"0",y:"0",width:"20",height:Math.max(n,r)},o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"url(#react-svg-pan-zoom-gradient1)"}}))),o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"#000",mask:"url(#react-svg-pan-zoom-mask1)"},transform:i}))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(1);r.propTypes={direction:u.a.oneOf([c.j,c.k,c.l,c.m]).isRequired,width:u.a.number.isRequired,height:u.a.number.isRequired}},function(e,t,n){"use strict";var r=function(e){return["zoom-in","zoom-out","grab","grabbing"].indexOf(e)>-1},i=function(){return navigator.userAgent.toLowerCase()},o=function(){return i().indexOf("firefox")>-1},a=function(){return i().indexOf("webkit")>-1};t.a=function(e){return r(e)?o()?"-moz-"+e:a()?"-webkit-"+e:void 0:e}},function(e,t,n){"use strict";function r(){return"ontouchstart"in window||navigator.maxTouchPoints}t.a=r},function(e,t,n){"use strict";function r(e){var t=e.startX,r=e.startY,i=e.endX,a=e.endY;if(!(t&&r&&i&&a))return null;var u=n.i(c.a)({x:t,y:r},{x:i,y:a});return o.a.createElement("rect",{stroke:"#969FFF",strokeOpacity:.7,fill:"#F3F4FF",fillOpacity:.7,x:u.x,y:u.y,width:u.width,height:u.height,style:{pointerEvents:"none"}})}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(11);r.propTypes={startX:u.a.number.isRequired,startY:u.a.number.isRequired,endX:u.a.number.isRequired,endY:u.a.number.isRequired}},function(e,t,n){"use strict";function r(e,t,n,r,i){return r+(i-r)*(e-t)/(n-t)}t.a=r},function(e,t,n){"use strict";function r(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function i(e,t){return t.map(function(t){return r(e,t)})}t.a=r,t.b=i},function(e,t,n){"use strict";function r(e){return{a:parseFloat(e.a),b:parseFloat(e.b),c:parseFloat(e.c),d:parseFloat(e.d),e:parseFloat(e.e),f:parseFloat(e.f)}}t.a=r},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(){return{a:1,c:0,e:0,b:0,d:1,f:0}}t.a=r},function(e,t,n){"use strict";function r(e){var t=e.a,n=e.b,r=e.c,i=e.d,o=e.e,a=e.f,u=t*i-n*r;return{a:i/u,b:n/-u,c:r/-u,d:t/u,e:(i*o-r*a)/-u,f:(n*o-t*a)/u}}t.a=r},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator},function(e,t,n){"use strict";Math.cos,Math.sin,Math.PI},function(e,t,n){"use strict";function r(e,t){return{a:e,c:0,e:0,b:0,d:t,f:0}}t.a=r},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(e){return i(e)}function i(e){return"matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")"}t.a=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e){return Array.isArray(e)?e:Array.from(e)}function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t=Array.isArray(t[0])?t[0]:t;var a=function(e,t){return{a:e.a*t.a+e.c*t.b,c:e.a*t.c+e.c*t.d,e:e.a*t.e+e.c*t.f+e.e,b:e.b*t.a+e.d*t.b,d:e.b*t.c+e.d*t.d,f:e.b*t.e+e.d*t.f+e.f}};switch(t.length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return a(t[0],t[1]);default:var u=t,c=i(u),l=c[0],s=c[1],f=c.slice(2),h=a(l,s);return o.apply(void 0,[h].concat(r(f)))}}t.a=o},function(e,t,n){"use strict";function r(e,t){return{a:1,c:0,e:e,b:0,d:1,f:t}}t.a=r}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):"object"==typeof exports?exports.ReactSVGPanZoom=t(require("react"),require("prop-types")):e.ReactSVGPanZoom=t(e.React,e.PropTypes)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=17)}([function(t,n){t.exports=e},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return a}),n.d(t,"e",function(){return u}),n.d(t,"f",function(){return c}),n.d(t,"g",function(){return s}),n.d(t,"h",function(){return l}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return p}),n.d(t,"m",function(){return v});var r="idle",i="panning",o="zooming",a="auto",u="none",c="pan",s="zoom-in",l="zoom-out",f="none",h="top",d="right",p="bottom",v="left"},function(e,t,n){"use strict";function r(e,t,r,o){return i({},v({},n.i(p.identity)(),{version:2,mode:d.a,focus:!1,pinchPointDistance:null,prePinchMode:null,viewerWidth:e,viewerHeight:t,SVGWidth:r,SVGHeight:o,startX:null,startY:null,endX:null,endY:null,miniatureOpen:!0}))}function i(e,t){return e=Object.assign({},e,t),Object.freeze(e)}function o(e,t,r){var i=n.i(p.fromObject)(e),o=n.i(p.inverse)(i);return n.i(p.applyToPoint)(o,{x:t,y:r})}function a(e){var t=n.i(p.fromObject)(e);return{scaleFactor:t.a,translationX:t.e,translationY:t.f}}function u(e,t){return i(e,{focus:t})}function c(e,t,n){return i(e,{viewerWidth:t,viewerHeight:n})}function s(e,t,n){return i(e,{SVGWidth:t,SVGHeight:n})}function l(e,t,r,o){var a=e.viewerWidth,u=e.viewerHeight,c=n.i(p.transform)(n.i(p.translate)(a/2-t,u/2-r),n.i(p.translate)(t,r),n.i(p.scale)(o,o),n.i(p.translate)(-t,-r));return i(e,v({mode:d.a},c))}function f(e){return i(e,v({mode:d.a},n.i(p.identity)()))}function h(e){return i(e,{mode:d.a,startX:null,startY:null,endX:null,endY:null})}t.e=r,t.c=i,t.d=o,t.j=a,t.i=u,t.f=c,t.g=s,t.a=l,t.b=f,t.h=h;var d=n(1),p=n(4),v=(n.n(p),"function"==typeof Symbol&&Symbol.iterator,Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e})},function(e,n){e.exports=t},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=12)}([function(e,t,n){"use strict";function r(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function i(e,t){return t.map(function(t){return r(e,t)})}t.a=r,t.b=i},function(e,t,n){"use strict";function r(e){return{a:parseFloat(e.a),b:parseFloat(e.b),c:parseFloat(e.c),d:parseFloat(e.d),e:parseFloat(e.e),f:parseFloat(e.f)}}t.a=r},function(e,t,n){"use strict";function r(e){var t=e.match(i);if(null===t||t.length<7)throw new Error("'"+e+"' is not a matrix");return{a:parseFloat(t[1]),b:parseFloat(t[2]),c:parseFloat(t[3]),d:parseFloat(t[4]),e:parseFloat(t[5]),f:parseFloat(t[6])}}t.a=r;var i=/^matrix\( *([0-9]*\.?[0-9]+) *, *([0-9]*\.?[0-9]+) *, *([0-9]*\.?[0-9]+) *, *([0-9]*\.?[0-9]+) *, *([0-9]*\.?[0-9]+) *, *([0-9]*\.?[0-9]+) *\)$/i},function(e,t,n){"use strict";function r(){return{a:1,c:0,e:0,b:0,d:1,f:0}}t.a=r},function(e,t,n){"use strict";function r(e){var t=e.a,n=e.b,r=e.c,i=e.d,o=e.e,a=e.f,u=t*i-n*r;return{a:i/u,b:n/-u,c:r/-u,d:t/u,e:(i*o-r*a)/-u,f:(n*o-t*a)/u}}t.a=r},function(e,t,n){"use strict";function r(e){var t=function(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)};return"object"===(void 0===e?"undefined":i(e))&&e.hasOwnProperty("a")&&t(e.a)&&e.hasOwnProperty("b")&&t(e.b)&&e.hasOwnProperty("c")&&t(e.c)&&e.hasOwnProperty("d")&&t(e.d)&&e.hasOwnProperty("e")&&t(e.e)&&e.hasOwnProperty("f")&&t(e.f)}t.a=r;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}},function(e,t,n){"use strict";function r(e){var t=o(e),n=a(e);return{a:t,c:-n,e:0,b:n,d:t,f:0}}function i(e){return r(e*u/180)}t.a=r,t.b=i;var o=Math.cos,a=Math.sin,u=Math.PI},function(e,t,n){"use strict";function r(e,t){return{a:e,c:0,e:0,b:0,d:t,f:0}}t.a=r},function(e,t,n){"use strict";function r(e,t){return{a:1,c:e,e:0,b:t,d:1,f:0}}t.a=r},function(e,t,n){"use strict";function r(e){return o(e)}function i(e){return o(e)}function o(e){return"matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")"}t.a=r,t.b=i,t.c=o},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e){return Array.isArray(e)?e:Array.from(e)}function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t=Array.isArray(t[0])?t[0]:t;var a=function(e,t){return{a:e.a*t.a+e.c*t.b,c:e.a*t.c+e.c*t.d,e:e.a*t.e+e.c*t.f+e.e,b:e.b*t.a+e.d*t.b,d:e.b*t.c+e.d*t.d,f:e.b*t.e+e.d*t.f+e.f}};switch(t.length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return a(t[0],t[1]);default:var u=t,c=i(u),s=c[0],l=c[1],f=c.slice(2),h=a(s,l);return o.apply(void 0,[h].concat(r(f)))}}t.a=o},function(e,t,n){"use strict";function r(e,t){return{a:1,c:0,e:e,b:0,d:1,f:t}}t.a=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);n.d(t,"applyToPoint",function(){return r.a}),n.d(t,"applyToPoints",function(){return r.b});var i=n(1);n.d(t,"fromObject",function(){return i.a});var o=n(2);n.d(t,"fromString",function(){return o.a});var a=n(3);n.d(t,"identity",function(){return a.a});var u=n(4);n.d(t,"inverse",function(){return u.a});var c=n(5);n.d(t,"isAffineMatrix",function(){return c.a});var s=n(6);n.d(t,"rotate",function(){return s.a}),n.d(t,"rotateDEG",function(){return s.b});var l=n(7);n.d(t,"scale",function(){return l.a});var f=n(8);n.d(t,"shear",function(){return f.a});var h=n(9);n.d(t,"toCSS",function(){return h.a}),n.d(t,"toSVG",function(){return h.b}),n.d(t,"toString",function(){return h.c});var d=n(10);n.d(t,"transform",function(){return d.a});var p=n(11);n.d(t,"translate",function(){return p.a})}])})},function(e,t,n){"use strict";function r(e,t,r,i){var o=n.i(l.transform)(n.i(l.fromObject)(e),n.i(l.translate)(t,r),n.i(l.scale)(i,i),n.i(l.translate)(-t,-r));return n.i(h.c)(e,p({mode:f.a},o,{startX:null,startY:null,endX:null,endY:null}))}function i(e,t,r,i,o){var a=e.viewerWidth,u=e.viewerHeight,c=a/i,s=u/o,d=Math.min(c,s),v=n.i(l.transform)(n.i(l.scale)(d,d),n.i(l.translate)(-t,-r));return n.i(h.c)(e,p({mode:f.a},v,{startX:null,startY:null,endX:null,endY:null}))}function o(e){return i(e,0,0,e.SVGWidth,e.SVGHeight)}function a(e,t){var i=e.viewerWidth,o=e.viewerHeight,a=n.i(h.d)(e,i/2,o/2);return r(e,a.x,a.y,t)}function u(e,t,r){return n.i(h.c)(e,{mode:f.c,startX:t,startY:r,endX:t,endY:r})}function c(e,t,r){if(e.mode!==f.c)throw new Error("update selection not allowed in this mode "+e.mode);return n.i(h.c)(e,{endX:t,endY:r})}function s(e,t,o,a){var u=e.startX,c=e.startY,s=e.endX,l=e.endY,f=n.i(h.d)(e,u,c),p=n.i(h.d)(e,s,l);if(Math.abs(u-s)>7&&Math.abs(c-l)>7){var v=n.i(d.a)(f,p);return i(e,v.x,v.y,v.width,v.height)}var g=n.i(h.d)(e,t,o);return r(e,g.x,g.y,a)}t.a=r,t.b=i,t.c=o,t.d=a,t.e=u,t.g=c,t.f=s;var l=n(4),f=(n.n(l),n(1)),h=n(2),d=n(11),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";function r(e){return n.i(o.c)(e,{miniatureOpen:!0})}function i(e){return n.i(o.c)(e,{miniatureOpen:!1})}t.a=r,t.b=i;var o=n(2)},function(e,t,n){"use strict";function r(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=n.i(l.transform)(n.i(l.fromObject)(e),n.i(l.translate)(t,r));if(i){var a=n.i(l.applyToPoints)(o,[{x:i,y:i},{x:e.SVGWidth-i,y:e.SVGHeight-i}]),u=h(a,2),d=u[0],p=d.x,v=d.y,g=u[1],m=g.x,b=g.y,y=0;e.viewerWidth-p<0?y=e.viewerWidth-p:m<0&&(y=-m);var w=0;e.viewerHeight-v<0?w=e.viewerHeight-v:b<0&&(w=-b),o=n.i(l.transform)(n.i(l.translate)(y,w),o)}return n.i(s.c)(e,f({mode:c.a},o))}function i(e,t,r){return n.i(s.c)(e,{mode:c.b,startX:t,startY:r,endX:t,endY:r})}function o(e,t,i,o){if(e.mode!==c.b)throw new Error("update pan not allowed in this mode "+e.mode);var a=e.endX,u=e.endY,l=n.i(s.d)(e,a,u),f=n.i(s.d)(e,t,i),h=f.x-l.x,d=f.y-l.y,p=r(e,h,d,o);return n.i(s.c)(p,{mode:c.b,endX:t,endY:i})}function a(e){return n.i(s.c)(e,{mode:c.a,startX:null,startY:null,endX:null,endY:null})}function u(e,t,n){var i=0,o=0;return n<=20&&(o=20),e.viewerWidth-t<=20&&(i=-20),e.viewerHeight-n<=20&&(o=-20),t<=20&&(i=20),i/=e.d,o/=e.d,0===i&&0===o?e:r(e,i,o)}t.a=r,t.b=i,t.d=o,t.c=a,t.e=u;var c=n(1),s=n(2),l=n(4),f=(n.n(l),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),h=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){"use strict";function r(e){var t=e.tool,r=e.value,i=e.onChangeValue,a=e.onChangeTool,u=e.position,g=function(e,t){a(t),e.stopPropagation(),e.preventDefault()},m=function(e){i(n.i(s.c)(r)),e.stopPropagation(),e.preventDefault()},b=[c.j,c.l].indexOf(u)>=0,y={position:"absolute",transform:[c.j,c.l].indexOf(u)>=0?"translate(-50%, 0px)":"none",top:[c.m,c.k,c.j].indexOf(u)>=0?"5px":"unset",left:[c.j,c.l].indexOf(u)>=0?"50%":c.m===u?"5px":"unset",right:[c.k].indexOf(u)>=0?"5px":"unset",bottom:[c.l].indexOf(u)>=0?"5px":"unset",backgroundColor:"rgba(19, 20, 22, 0.90)",borderRadius:"2px",display:"flex",flexDirection:b?"row":"column",padding:b?"1px 2px":"2px 1px"};return o.a.createElement("div",{style:y,role:"toolbar"},o.a.createElement(v.a,{toolbarPosition:u,active:t===c.e,name:"unselect-tools",title:"Selection",onClick:function(e){return g(e,c.e)}},o.a.createElement(l.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:t===c.f,name:"select-tool-pan",title:"Pan",onClick:function(e){return g(e,c.f)}},o.a.createElement(f.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:t===c.g,name:"select-tool-zoom-in",title:"Zoom in",onClick:function(e){return g(e,c.g)}},o.a.createElement(h.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:t===c.h,name:"select-tool-zoom-out",title:"Zoom out",onClick:function(e){return g(e,c.h)}},o.a.createElement(d.a,null)),o.a.createElement(v.a,{toolbarPosition:u,active:!1,name:"fit-to-viewer",title:"Fit to viewer",onClick:function(e){return m(e)}},o.a.createElement(p.a,null)))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(1),s=n(5),l=n(22),f=n(24),h=n(25),d=n(26),p=n(23),v=n(27);r.propTypes={position:u.a.oneOf([c.j,c.k,c.l,c.m]).isRequired,tool:u.a.string.isRequired,value:u.a.object.isRequired,onChangeValue:u.a.func.isRequired,onChangeTool:u.a.func.isRequired}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(2),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n,i){r(this,e),this.originalEvent=t,this.value=n,this.SVGViewer=i}return o(e,[{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"scaleFactor",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||n.i(i.j)(this.value),this._cacheDecomposedValue.scaleFactor}},{key:"translationX",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||n.i(i.j)(this.value),this._cacheDecomposedValue.translationX}},{key:"translationY",get:function(){return this._cacheDecomposedValue=this._cacheDecomposedValue||n.i(i.j)(this.value),this._cacheDecomposedValue.translationY}}]),e}();t.a=a},function(e,t,n){"use strict";function r(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var s=t.getBoundingClientRect(),p=s.left,v=s.top;u=e.clientX-Math.round(p),c=e.clientY-Math.round(v)}var g=i;switch(r){case l.h:var m=n.i(f.d)(i,u,c);g=n.i(d.a)(i,m.x,m.y,1/o.scaleFactor);break;case l.g:g=n.i(d.e)(i,u,c);break;case l.d:case l.f:g=n.i(h.b)(i,u,c);break;default:return i}return e.preventDefault(),g}function i(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var s=t.getBoundingClientRect(),f=s.left,p=s.top;u=e.clientX-Math.round(f),c=e.clientY-Math.round(p)}var v=0===e.buttons,g=i;switch(r){case l.g:i.mode===l.c&&(g=v?n.i(d.f)(i,u,c,o.scaleFactor):n.i(d.g)(i,u,c));break;case l.d:case l.f:i.mode===l.b&&(g=v?n.i(h.c)(i):n.i(h.d)(i,u,c,o.preventPanOutside?20:void 0));break;default:return i}return e.preventDefault(),g}function o(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var s=t.getBoundingClientRect(),f=s.left,p=s.top;u=e.clientX-Math.round(f),c=e.clientY-Math.round(p)}var v=i;switch(r){case l.h:i.mode===l.c&&(v=n.i(d.f)(i,u,c,1/o.scaleFactor));break;case l.g:i.mode===l.c&&(v=n.i(d.f)(i,u,c,o.scaleFactor));break;case l.d:case l.f:i.mode===l.b&&(v=n.i(h.c)(i,u,c));break;default:return i}return e.preventDefault(),v}function a(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var s=t.getBoundingClientRect(),h=s.left,p=s.top;u=e.clientX-Math.round(h),c=e.clientY-Math.round(p)}var v=i;switch(r){case l.d:var g=n.i(f.d)(i,u,c),m=function(t,n){return t||e.getModifierState(n)},b=o.modifierKeys.reduce(m,!1),y=b?1/o.scaleFactor:o.scaleFactor;v=n.i(d.a)(i,g.x,g.y,y);break;default:return i}return e.preventDefault(),v}function u(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=void 0,c=void 0;if(a)u=a.x,c=a.y;else{var s=t.getBoundingClientRect(),l=s.left,h=s.top;u=e.clientX-Math.round(l),c=e.clientY-Math.round(h)}if(!o.detectWheel)return i;var v=Math.max(-1,Math.min(1,e.deltaY)),g=n.i(p.a)(v,-1,1,1.06,.96),m=n.i(f.d)(i,u,c),b=n.i(d.a)(i,m.x,m.y,g);return e.preventDefault(),b}function c(e,t,r,i,o){var a=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],n.i(f.i)(i,"mouseenter"===e.type));return e.preventDefault(),a}function s(e,t,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=a.x,c=a.y;return[l.e,l.d].indexOf(r)>=0&&o.detectAutoPan&&i.focus?n.i(h.e)(i,u,c):i}t.b=r,t.c=i,t.d=o,t.e=a,t.f=u,t.g=c,t.a=s;var l=n(1),f=n(2),h=n(7),d=n(5),p=n(32)},function(e,t,n){"use strict";function r(e,t){return e.x<=t.x&&e.y<=t.y?{x:e.x,y:e.y,width:t.x-e.x,height:t.y-e.y}:e.x>=t.x&&e.y<=t.y?{x:t.x,y:e.y,width:e.x-t.x,height:t.y-e.y}:e.x>=t.x&&e.y>=t.y?{x:t.x,y:t.y,width:e.x-t.x,height:e.y-t.y}:e.x<=t.x&&e.y>=t.y?{x:e.x,y:t.y,width:t.x-e.x,height:e.y-t.y}:void 0}t.a=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),u=n.n(a),c=n(3),s=n.n(c),l=n(4),f=(n.n(l),n(13)),h=n(7),d=n(2),p=n(10),v=n(16),g=n(5),m=n(6),b=n(29),y=n(28),w=n(31),O=n(8),V=n(30),x=n(21),k=n(1),P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),M=function(e){function t(e,o){r(this,t);var a=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o)),u=a.props,c=u.tool,s=u.value,l=u.width,f=u.height,h=u.children,p=h.props,v=p.width,g=p.height;return a.state={value:s||n.i(d.e)(l,f,v,g),tool:c||k.e},a.ViewerDOM=null,a}return o(t,e),E(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.getValue();if(t.viewerWidth!==e.width||t.viewerHeight!==e.height){var r=n.i(d.f)(t,e.width,e.height);this.setValue(r)}var i=e.children.props,o=i.width,a=i.height;if(t.SVGWidth!==o||t.SVGHeight!==a){var u=n.i(d.g)(t,o,a);this.setValue(u)}}},{key:"getValue",value:function(){return this.props.value?this.props.value:this.state.value}},{key:"getTool",value:function(){return this.props.tool?this.props.tool:this.state.tool}},{key:"getSvgStyle",value:function(e){var t={display:"block"};return e&&(t.cursor=e),(this.props.detectPinchGesture||-1!==[k.f,k.d].indexOf(this.getTool()))&&(t.touchAction="none"),t}},{key:"setValue",value:function(e){this.setState({value:e}),this.props.onChangeValue&&this.props.onChangeValue(e)}},{key:"pan",value:function(e,t){var r=n.i(h.a)(this.getValue(),e,t);this.setValue(r)}},{key:"zoom",value:function(e,t,r){var i=n.i(g.a)(this.getValue(),e,t,r);this.setValue(i)}},{key:"fitSelection",value:function(e,t,r,i){var o=n.i(g.b)(this.getValue(),e,t,r,i);this.setValue(o)}},{key:"fitToViewer",value:function(){var e=n.i(g.c)(this.getValue());this.setValue(e)}},{key:"zoomOnViewerCenter",value:function(e){var t=n.i(g.d)(this.getValue(),e);this.setValue(t)}},{key:"setPointOnViewerCenter",value:function(e,t,r){var i=n.i(d.a)(this.getValue(),e,t,r);this.setValue(i)}},{key:"reset",value:function(){var e=n.i(d.b)(this.getValue());this.setValue(e)}},{key:"changeTool",value:function(e){this.setState({tool:e}),this.props.onChangeTool&&this.props.onChangeTool(e)}},{key:"openMiniature",value:function(){var e=n.i(m.a)(this.getValue());this.setValue(e)}},{key:"closeMiniature",value:function(){var e=n.i(m.b)(this.getValue());this.setValue(e)}},{key:"handleViewerEvent",value:function(e){var t=this.props,r=this.state.value,i=this.ViewerDOM;if([k.e,k.d].indexOf(this.getTool())>=0&&e.target!==i){var o={click:t.onClick,dblclick:t.onDoubleClick,mousemove:t.onMouseMove,mouseup:t.onMouseUp,mousedown:t.onMouseDown,touchstart:t.onTouchStart,touchmove:t.onTouchMove,touchend:t.onTouchEnd,touchcancel:t.onTouchCancel},a=o[e.type];a&&a(n.i(f.a)(e,r,i))}}},{key:"componentDidMount",value:function(){var e=this,t=this.props,r=this.state;t.onChangeValue&&t.onChangeValue(r.value),this.autoPanTimer=setInterval(function(){var t={x:e.state.viewerX,y:e.state.viewerY},r=n.i(p.a)(null,e.ViewerDOM,e.getTool(),e.getValue(),e.props,t);e.getValue()!==r&&e.setValue(r)},200)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.autoPanTimer)}},{key:"render",value:function(){var e=this,t=this.props,r=this.state,i=r.viewerX,o=r.viewerY,a=this.getTool(),c=this.getValue(),s=t.customToolbar,f=t.customMiniature,h=a===k.d&&c.mode===k.b&&c.startX!==c.endX&&c.startY!==c.endY,d=void 0;a===k.f&&(d=n.i(b.a)(c.mode===k.b?"grabbing":"grab")),a===k.g&&(d=n.i(b.a)("zoom-in")),a===k.h&&(d=n.i(b.a)("zoom-out")),h&&(d=n.i(b.a)("grabbing"));var g=[k.f,k.g,k.h].indexOf(a)>=0;return g=g||h,u.a.createElement("div",{style:P({position:"relative",width:c.viewerWidth,height:c.viewerHeight},t.style),className:this.props.className},u.a.createElement("svg",{ref:function(t){return e.ViewerDOM=t},width:c.viewerWidth,height:c.viewerHeight,style:this.getSvgStyle(d),onMouseDown:function(t){var r=n.i(p.b)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onMouseMove:function(t){var r=e.ViewerDOM.getBoundingClientRect(),i=r.left,o=r.top,a=t.clientX-Math.round(i),u=t.clientY-Math.round(o),c=n.i(p.c)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props,{x:a,y:u});e.getValue()!==c&&e.setValue(c),e.setState({viewerX:a,viewerY:u}),e.handleViewerEvent(t)},onMouseUp:function(t){var r=n.i(p.d)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onClick:function(t){e.handleViewerEvent(t)},onDoubleClick:function(t){var r=n.i(p.e)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onWheel:function(t){var r=n.i(p.f)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r)},onMouseEnter:function(t){if(!n.i(V.a)()){var r=n.i(p.g)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r)}},onMouseLeave:function(t){var r=n.i(p.g)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r)},onTouchStart:function(t){var r=n.i(v.a)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onTouchMove:function(t){var r=n.i(v.b)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onTouchEnd:function(t){var r=n.i(v.c)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)},onTouchCancel:function(t){var r=n.i(v.d)(t,e.ViewerDOM,e.getTool(),e.getValue(),e.props);e.getValue()!==r&&e.setValue(r),e.handleViewerEvent(t)}},u.a.createElement("rect",{fill:t.background,x:0,y:0,width:c.viewerWidth,height:c.viewerHeight,style:{pointerEvents:"none"}}),u.a.createElement("g",{transform:n.i(l.toSVG)(c),style:g?{pointerEvents:"none"}:{}},u.a.createElement("rect",{fill:this.props.SVGBackground,x:0,y:0,width:c.SVGWidth,height:c.SVGHeight}),u.a.createElement("g",null,t.children.props.children)),[k.e,k.d].indexOf(a)>=0&&t.detectAutoPan&&c.focus?u.a.createElement("g",{style:{pointerEvents:"none"}},o<=20?u.a.createElement(y.a,{direction:k.j,width:c.viewerWidth,height:c.viewerHeight}):null,c.viewerWidth-i<=20?u.a.createElement(y.a,{direction:k.k,width:c.viewerWidth,height:c.viewerHeight}):null,c.viewerHeight-o<=20?u.a.createElement(y.a,{direction:k.l,width:c.viewerWidth,height:c.viewerHeight}):null,c.focus&&i<=20?u.a.createElement(y.a,{direction:k.m,width:c.viewerWidth,height:c.viewerHeight}):null):null,c.mode!==k.c?null:u.a.createElement(w.a,{startX:c.startX,startY:c.startY,endX:c.endX,endY:c.endY})),t.toolbarPosition===k.i?null:u.a.createElement(s,{position:t.toolbarPosition,value:c,onChangeValue:function(t){return e.setValue(t)},tool:a,onChangeTool:function(t){return e.changeTool(t)}}),t.miniaturePosition===k.i?null:u.a.createElement(f,{position:t.miniaturePosition,value:c,onChangeValue:function(t){return e.setValue(t)},SVGBackground:this.props.SVGBackground,background:this.props.miniatureBackground,width:this.props.miniatureWidth,height:this.props.miniatureHeight},t.children.props.children))}}]),t}(u.a.Component);t.a=M,M.propTypes={width:s.a.number.isRequired,height:s.a.number.isRequired,background:s.a.string,SVGBackground:s.a.string,value:s.a.shape({version:s.a.oneOf([2]).isRequired,mode:s.a.oneOf([k.a,k.b,k.c]).isRequired,focus:s.a.bool.isRequired,a:s.a.number.isRequired,b:s.a.number.isRequired,c:s.a.number.isRequired,d:s.a.number.isRequired,e:s.a.number.isRequired,f:s.a.number.isRequired,viewerWidth:s.a.number.isRequired,viewerHeight:s.a.number.isRequired,SVGWidth:s.a.number.isRequired,SVGHeight:s.a.number.isRequired,startX:s.a.number,startY:s.a.number,endX:s.a.number,endY:s.a.number,miniatureOpen:s.a.bool.isRequired}),style:s.a.object,className:s.a.string,detectWheel:s.a.bool,detectAutoPan:s.a.bool,detectPinchGesture:s.a.bool,toolbarPosition:s.a.oneOf([k.i,k.j,k.k,k.l,k.m]),onChangeValue:s.a.func,onChangeTool:s.a.func,onClick:s.a.func,onDoubleClick:s.a.func,onMouseUp:s.a.func,onMouseMove:s.a.func,onMouseDown:s.a.func,preventPanOutside:s.a.bool,scaleFactor:s.a.number,tool:s.a.oneOf([k.d,k.e,k.f,k.g,k.h]),modifierKeys:s.a.array,customToolbar:s.a.oneOfType([s.a.element,s.a.func]),miniaturePosition:s.a.oneOf([k.i,k.k,k.m]),miniatureBackground:s.a.string,miniatureWidth:s.a.number,miniatureHeight:s.a.number,customMiniature:s.a.oneOfType([s.a.element,s.a.func]),children:function(e,t,n){var r=e[t],i=["svg"];return 1!==u.a.Children.count(r)||-1===i.indexOf(r.type)?new Error("`"+n+"` should have a single child of the following types: `"+i.join("`, `")+"`."):r.props.hasOwnProperty("width")&&r.props.hasOwnProperty("height")?void 0:new Error("SVG should have props `width` and `height`")}},M.defaultProps={value:null,tool:null,style:{},background:"#616264",SVGBackground:"#fff",detectWheel:!0,detectAutoPan:!0,detectPinchGesture:!0,toolbarPosition:k.k,modifierKeys:["Alt","Shift","Control"],customToolbar:O.a,preventPanOutside:!0,scaleFactor:1.1,miniaturePosition:k.m,miniatureWidth:100,miniatureHeight:80,miniatureBackground:"#616264",customMiniature:x.a}},function(e,t,n){"use strict";var r=n(14),i=n(15);t.a=function(e,t,n){var o=e.type;switch(o){case"mousemove":case"mouseup":case"mousedown":case"click":case"dblclick":return new r.a(e,t,n);case"touchstart":case"touchmove":case"touchend":case"touchcancel":return new i.a(e,t,n);default:throw new Error(o+" not supported")}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),u=n(9),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),c(t,[{key:"point",get:function(){if(!this._cachePoint){var e=this.originalEvent,t=this.value,r=this.SVGViewer,i=r.getBoundingClientRect(),o=e.clientX-Math.round(i.left),u=e.clientY-Math.round(i.top);this._cachePoint=n.i(a.d)(t,o,u)}return this._cachePoint}},{key:"x",get:function(){return this.point.x}},{key:"y",get:function(){return this.point.y}}]),t}(u.a);t.a=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(2),u=n(9),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,[{key:"points",get:function(){return this._cachePoints||(this._cachePoints=t.touchesToPoints(this.originalEvent.touches,this.SVGViewer,this.value)),this._cachePoints}},{key:"changedPoints",get:function(){return this._cacheChangedPoints||(this._cacheChangedPoints=t.touchesToPoints(this.originalEvent.changedTouches,this.SVGViewer,this.value)),this._cacheChangedPoints}}],[{key:"touchesToPoints",value:function(e,t,r){for(var i=[],o=0;o<e.length;o++){var u=e[o],s=t.getBoundingClientRect(),l=u.clientX-Math.round(s.left),f=u.clientY-Math.round(s.top),h=n.i(a.d)(r,l,f);i.push(c({},h,{identifier:u.identifier}))}return i}}]),t}(u.a);t.a=l},function(e,t,n){"use strict";function r(e){return"number"==typeof e.pinchPointDistance}function i(e,t,i,o,a){var u=t.getBoundingClientRect(),c=u.left,s=u.top,l=e.touches[0].clientX-Math.round(c),f=e.touches[0].clientY-Math.round(s),h=e.touches[1].clientX-Math.round(c),g=e.touches[1].clientY-Math.round(s),b=Math.sqrt(Math.pow(h-l,2)+Math.pow(g-f,2)),y=r(o)?o.pinchPointDistance:b,w=n.i(v.d)(o,(l+h)/2,(f+g)/2),O=b/y;e.cancelable&&e.preventDefault();var V=n.i(d.transform)(n.i(d.fromObject)(o),n.i(d.translate)(w.x,w.y),n.i(d.scale)(O,O),n.i(d.translate)(-w.x,-w.y));return n.i(v.c)(o,n.i(v.c)(m({mode:p.c},V,{startX:null,startY:null,endX:null,endY:null,prePinchMode:o.prePinchMode?o.prePinchMode:o.mode,pinchPointDistance:b})))}function o(e,t){return t.detectPinchGesture&&e.touches.length>1}function a(e,t,n){return n.detectPinchGesture&&r(t)&&e.touches.length<2}function u(e,t){var n=t.getBoundingClientRect(),r=n.left,i=n.top;return{x:e.clientX-Math.round(r),y:e.clientY-Math.round(i)}}function c(e,t,r,i,o,a){var c=0===e.touches.length?n.i(v.c)(i,{mode:i.prePinchMode?p.a:i.mode,prePinchMode:null}):i,s=e.touches.length>0?e.touches[0]:e.changedTouches[0],l=u(s,t);switch(r){case p.h:case p.g:case p.d:case p.f:return e.stopPropagation(),e.preventDefault(),a(e,t,r,c,o,l);default:return c}}function s(e,t,r,a,u){if(o(e,u))return i(e,t,r,a,u);if(1!==e.touches.length){if([p.b,p.c].indexOf(a.mode)>=0)return n.i(v.h)(a);if([p.a].indexOf(a.mode)>=0)return a}return c(e,t,r,a,u,g.b)}function l(e,t,n,r,a){return o(e,a)?i(e,t,n,r,a):[p.b,p.c].indexOf(r.mode)>=0?c(e,t,n,r,a,g.c):r}function f(e,t,r,i,o){if(!([p.b,p.c].indexOf(i.mode)>=0))return i;var u=a(e,i,o)?n.i(v.c)(i,{pinchPointDistance:null}):i;return e.touches.length>0?u:c(e,t,r,u,o,g.d)}function h(e,t,r,i,o){return e.stopPropagation(),e.preventDefault(),n.i(v.h)(i)}t.a=s,t.b=l,t.c=f,t.d=h;var d=n(4),p=(n.n(d),n(1)),v=n(2),g=n(10),m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"Viewer",function(){return l});var r=n(12);n.d(t,"ReactSVGPanZoom",function(){return r.a});var i=n(8);n.d(t,"Toolbar",function(){return i.a});var o=n(2);n.d(t,"setPointOnViewerCenter",function(){return o.a}),n.d(t,"reset",function(){return o.b});var a=n(7);n.d(t,"pan",function(){return a.a});var u=n(5);n.d(t,"zoom",function(){return u.a}),n.d(t,"fitSelection",function(){return u.b}),n.d(t,"fitToViewer",function(){return u.c}),n.d(t,"zoomOnViewerCenter",function(){return u.d});var c=n(6);n.d(t,"openMiniature",function(){return c.a}),n.d(t,"closeMiniature",function(){return c.b});var s=n(1);n.d(t,"MODE_IDLE",function(){return s.a}),n.d(t,"MODE_PANNING",function(){return s.b}),n.d(t,"MODE_ZOOMING",function(){return s.c}),n.d(t,"TOOL_AUTO",function(){return s.d}),n.d(t,"TOOL_NONE",function(){return s.e}),n.d(t,"TOOL_PAN",function(){return s.f}),n.d(t,"TOOL_ZOOM_IN",function(){return s.g}),n.d(t,"TOOL_ZOOM_OUT",function(){return s.h}),n.d(t,"POSITION_NONE",function(){return s.i}),n.d(t,"POSITION_TOP",function(){return s.j}),n.d(t,"POSITION_RIGHT",function(){return s.k}),n.d(t,"POSITION_BOTTOM",function(){return s.l}),n.d(t,"POSITION_LEFT",function(){return s.m});var l=function(){return console.error("HEY! You are trying to use an older version of ReactSVGPanZoom. Read here https://github.com/chrvadala/react-svg-pan-zoom/blob/master/docs/migrate-from-v1-to-v2.md"),null}},function(e,t,n){"use strict";function r(e){var t=e.open,n=e.position,r=0;switch(n){case c.m:r=t?"rotate(225, 12, 13)":"rotate(45, 12, 13)";break;case c.k:r=r=t?"rotate(135, 12, 13)":"rotate(-45, 12, 13)"}return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",{transform:r},o.a.createElement("path",{fill:"#000000",d:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"})))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(1);r.propTypes={open:u.a.bool.isRequired,position:u.a.oneOf([c.k,c.m]).isRequired}},function(e,t,n){"use strict";function r(e){var t=e.SVGWidth,n=e.SVGHeight,r=e.x1,i=e.y1,a=e.x2,u=e.y2;e.zoomToFit;return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("mask",{id:"react-svg-pan-zoom-miniature-mask"},o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,fill:"#ffffff"}),o.a.createElement("rect",{x:r,y:i,width:a-r,height:u-i}))),o.a.createElement("rect",{x:"0",y:"0",width:t,height:n,style:{stroke:"none",fill:"#000",mask:"url(#react-svg-pan-zoom-miniature-mask)",opacity:.4}}))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a);r.propTypes={SVGWidth:u.a.number.isRequired,SVGHeight:u.a.number.isRequired,x1:u.a.number.isRequired,y1:u.a.number.isRequired,x2:u.a.number.isRequired,y2:u.a.number.isRequired,zoomToFit:u.a.number.isRequired}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t,n=e.value,i=e.onChangeValue,o=e.position,u=(t={width:"24px",height:"24px",display:"block",position:"absolute",bottom:0},r(t,o===f.m?"left":"right","0px"),r(t,"background","rgba(19, 20, 22, 0.901961)"),r(t,"border",0),r(t,"padding",0),r(t,"outline",0),r(t,"color","#fff"),t),c=n.miniatureOpen?s.b:s.a;return a.a.createElement("button",{role:"button",style:u,onClick:function(e){return i(c(n))}},a.a.createElement(l.a,{open:n.miniatureOpen,position:o}))}t.a=i;var o=n(0),a=n.n(o),u=n(3),c=n.n(u),s=n(6),l=n(18),f=n(1);i.propTypes={value:c.a.object.isRequired,onChangeValue:c.a.func.isRequired,position:c.a.oneOf([f.k,f.m]).isRequired}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t,i=e.value,o=e.onChangeValue,u=e.position,c=e.children,p=e.background,v=e.SVGBackground,g=e.width,m=e.height,b=i.SVGWidth,y=i.SVGHeight,w=i.viewerWidth,O=i.viewerHeight,V=y/b,x=V>=1?m/y:g/b,k=n.i(l.applyToPoints)(n.i(l.inverse)(i),[{x:0,y:0},{x:w,y:O}]),P=d(k,2),E=P[0],M=E.x,T=E.y,C=P[1],S=C.x,j=C.y,R=void 0,_=void 0;i.miniatureOpen?(R=g,_=m):(R=24,_=24);var D=(t={position:"absolute",overflow:"hidden",outline:"1px solid rgba(19, 20, 22, 0.90)",transition:"width 200ms ease, height 200ms ease, bottom 200ms ease",width:R+"px",height:_+"px",bottom:"6px"},r(t,u===s.m?"left":"right","6px"),r(t,"background",p),t),q=V>=1?"translate("+(g-b*x)/2+", 0)":"translate(0, "+(m-y*x)/2+")";return a.a.createElement("div",{role:"navigation",style:D},a.a.createElement("svg",{width:g,height:m,style:{pointerEvents:"none"}},a.a.createElement("g",{transform:q},a.a.createElement("g",{transform:"scale("+x+", "+x+")"},a.a.createElement("rect",{fill:v,x:0,y:0,width:i.SVGWidth,height:i.SVGHeight}),c,a.a.createElement(h.a,{SVGWidth:b,SVGHeight:y,x1:M,y1:T,x2:S,y2:j,zoomToFit:x})))),a.a.createElement(f.a,{value:i,onChangeValue:o,position:u}))}t.a=i;var o=n(0),a=n.n(o),u=n(3),c=n.n(u),s=n(1),l=n(4),f=(n.n(l),n(20)),h=n(19),d=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();Math.min,Math.max;i.propTypes={position:c.a.oneOf([s.k,s.m]).isRequired,value:c.a.object.isRequired,onChangeValue:c.a.func.isRequired,background:c.a.string.isRequired,SVGBackground:c.a.string.isRequired,width:c.a.number.isRequired}},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15 3l2.3 2.3-2.89 2.87 1.42 1.42L18.7 6.7 21 9V3zM3 9l2.3-2.3 2.87 2.89 1.42-1.42L6.7 5.3 9 3H3zm6 12l-2.3-2.3 2.89-2.87-1.42-1.42L5.3 17.3 3 15v6zm12-6l-2.3 2.3-2.87-2.89-1.42 1.42 2.89 2.87L15 21h6z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("g",null,o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o.a.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(){return o.a.createElement("svg",{width:24,height:24,stroke:"currentColor"},o.a.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"}))}t.a=r;var i=n(0),o=n.n(i)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(0),u=n.n(a),c=n(3),s=n.n(c),l=n(1),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),h=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hover:!1},n}return o(t,e),f(t,[{key:"change",value:function(e){switch(e.preventDefault(),e.stopPropagation(),e.type){case"mouseenter":case"touchstart":this.setState({hover:!0});break;case"mouseleave":case"touchend":case"touchcancel":this.setState({hover:!1})}}},{key:"render",value:function(){var e=this,t={display:"block",width:"24px",height:"24px",margin:[l.j,l.l].indexOf(this.props.toolbarPosition)>=0?"2px 1px":"1px 2px",color:this.props.active||this.state.hover?"#1CA6FC":"#FFF",transition:"color 200ms ease",background:"none",padding:"0px",border:"0px",outline:"0px",cursor:"pointer"};return u.a.createElement("button",{onMouseEnter:function(t){return e.change(t)},onMouseLeave:function(t){return e.change(t)},onTouchStart:function(t){e.change(t),e.props.onClick(t)},onTouchEnd:function(t){return e.change(t)},onTouchCancel:function(t){return e.change(t)},onClick:this.props.onClick,style:t,title:this.props.title,name:this.props.name,role:"button"},this.props.children)}}]),t}(u.a.Component);t.a=h,h.propTypes={title:s.a.string.isRequired,name:s.a.string.isRequired,toolbarPosition:s.a.string.isRequired,onClick:s.a.func.isRequired,active:s.a.bool.isRequired}},function(e,t,n){"use strict";function r(e){var t=e.direction,n=e.width,r=e.height,i=void 0;switch(t){case c.j:i="translate("+n+", 0) rotate(90)";break;case c.k:i="translate("+n+", "+r+") rotate(180)";break;case c.l:i="translate(0, "+r+") rotate(270)";break;case c.m:i=" "}return o.a.createElement("g",null,o.a.createElement("defs",null,o.a.createElement("linearGradient",{id:"react-svg-pan-zoom-gradient1",x1:"0%",y1:"0%",x2:"100%",y2:"0%",spreadMethod:"pad"},o.a.createElement("stop",{offset:"0%",stopColor:"#fff",stopOpacity:"0.8"}),o.a.createElement("stop",{offset:"100%",stopColor:"#000",stopOpacity:"0.5"})),o.a.createElement("mask",{id:"react-svg-pan-zoom-mask1",x:"0",y:"0",width:"20",height:Math.max(n,r)},o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"url(#react-svg-pan-zoom-gradient1)"}}))),o.a.createElement("rect",{x:"0",y:"0",width:"20",height:Math.max(n,r),style:{stroke:"none",fill:"#000",mask:"url(#react-svg-pan-zoom-mask1)"},transform:i}))}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(1);r.propTypes={direction:u.a.oneOf([c.j,c.k,c.l,c.m]).isRequired,width:u.a.number.isRequired,height:u.a.number.isRequired}},function(e,t,n){"use strict";var r=function(e){return["zoom-in","zoom-out","grab","grabbing"].indexOf(e)>-1},i=function(){return navigator.userAgent.toLowerCase()},o=function(){return i().indexOf("firefox")>-1},a=function(){return i().indexOf("webkit")>-1};t.a=function(e){return r(e)?o()?"-moz-"+e:a()?"-webkit-"+e:void 0:e}},function(e,t,n){"use strict";function r(){return"ontouchstart"in window||navigator.maxTouchPoints}t.a=r},function(e,t,n){"use strict";function r(e){var t=e.startX,r=e.startY,i=e.endX,a=e.endY;if(!(t&&r&&i&&a))return null;var u=n.i(c.a)({x:t,y:r},{x:i,y:a});return o.a.createElement("rect",{stroke:"#969FFF",strokeOpacity:.7,fill:"#F3F4FF",fillOpacity:.7,x:u.x,y:u.y,width:u.width,height:u.height,style:{pointerEvents:"none"}})}t.a=r;var i=n(0),o=n.n(i),a=n(3),u=n.n(a),c=n(11);r.propTypes={startX:u.a.number.isRequired,startY:u.a.number.isRequired,endX:u.a.number.isRequired,endY:u.a.number.isRequired}},function(e,t,n){"use strict";function r(e,t,n,r,i){return r+(i-r)*(e-t)/(n-t)}t.a=r}])});
{
"author": "chrvadala",
"name": "react-svg-pan-zoom",
"version": "2.9.0",
"version": "2.9.1",
"description": "A React component that adds pan and zoom features to SVG",

@@ -55,11 +55,11 @@ "main": "./build-commonjs/index.js",

"prop-types": "^15.5.0",
"transformation-matrix": "^1.2.0"
"transformation-matrix": "^1.3.0"
},
"devDependencies": {
"@storybook/addon-actions": "^3.0.0-alpha.0",
"@storybook/addon-knobs": "^3.0.0-alpha.0",
"@storybook/addon-options": "^3.0.0-alpha.0",
"@storybook/addons": "^3.0.0-alpha.0",
"@storybook/react": "^3.0.0-alpha.0",
"@storybook/ui": "^3.0.0-alpha.0",
"@storybook/addon-actions": "^3.0.0",
"@storybook/addon-knobs": "^3.0.0",
"@storybook/addon-options": "^3.0.0",
"@storybook/addons": "^3.0.0",
"@storybook/react": "^3.0.0",
"@storybook/ui": "^3.0.0",
"babel-cli": "^6.24.1",

@@ -72,3 +72,3 @@ "babel-core": "^6.24.1",

"babel-preset-react": "^6.24.1",
"chai": "^3.5.0",
"chai": "^4.0.0",
"cross-env": "^5.0.0",

@@ -84,3 +84,3 @@ "del-cli": "^1.0.0",

"remarkable": "^1.7.1",
"webpack": "^2.4.1",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"

@@ -87,0 +87,0 @@ },

@@ -31,5 +31,10 @@ # react-svg-pan-zoom

## Install
### NPM
```sh
npm install --save react-svg-pan-zoom
```
### UMD
```html
<script src="https://unpkg.com/react-svg-pan-zoom@2"></script>
```
<!-- END_NO_WEB:2 -->

@@ -41,2 +46,3 @@

- [**Redux**](./examples/3-redux/) - This advanced project show a scenario in which a redux store handle the state. Each component can dispatch a Redux action and edit the current view of the viewer.
- [**JSFiddle**](https://jsfiddle.net/chrvadala/f67qyfsd/) - This is a JSFiddle demo that uses UMD bundle.

@@ -43,0 +49,0 @@ ## Changelog

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc