scanbot-web-sdk 2.13.1 → 2.13.2-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -67,7 +67,9 @@ export default class BarcodeScannerView extends ScannerView<BarcodeScannerProps,
|
|
|
67
67
|
setFinderVisible(isVisible: boolean): void;
|
|
68
68
|
setZoom(zoom: number): void;
|
|
69
69
|
updateTorch(enabled: boolean): void;
|
|
70
|
+
applyConstraints(constraints: MediaTrackConstraints): Promise<void>;
|
|
70
71
|
getCapabilities(): MediaTrackCapabilities | undefined;
|
|
72
|
+
getSettings(): MediaTrackSettings | undefined;
|
|
71
73
|
render(): JSX.Element;
|
|
72
74
|
resetCountImage(): void;
|
|
73
75
|
countLabelText(barcodes: Barcode[]): string;
|
|
@@ -6,9 +6,11 @@ export interface IBarcodeScannerHandle extends IScannerCommon {
|
|
|
6
6
|
pauseDetection(): void;
|
|
7
7
|
isDetectionPaused(): boolean;
|
|
8
8
|
getCapabilities(): MediaTrackCapabilities | undefined;
|
|
9
|
+
getSettings(): MediaTrackSettings | undefined;
|
|
9
10
|
setZoom(zoom: number): void;
|
|
10
11
|
setFinderVisible(isVisible: boolean): void;
|
|
11
12
|
updateTorch(enabled: boolean): void;
|
|
13
|
+
applyConstraints(constraints: MediaTrackConstraints): void;
|
|
12
14
|
getResolution(): Promise<Size>;
|
|
13
15
|
setRecognitionResolution(resolution: number): void;
|
|
14
16
|
}
|
|
@@ -20,5 +20,9 @@ export default class VideoStream extends React.Component<VideoStreamProps, Video
|
|
|
20
20
|
stopCurrentStreams(): Promise<void>;
|
|
21
21
|
componentWillUnmount(): void;
|
|
22
22
|
updateTorch(enabled: boolean): Promise<void>;
|
|
23
|
+
updateConstraints(constraints: MediaTrackConstraints): Promise<void>;
|
|
24
|
+
applyConstraints(constraints: MediaTrackConstraints): Promise<void>;
|
|
25
|
+
getVideoTrack(): MediaStreamTrack | undefined;
|
|
23
26
|
getCapabilities(): MediaTrackCapabilities | undefined;
|
|
27
|
+
getSettings(): MediaTrackSettings | undefined;
|
|
24
28
|
}
|
package/bundle/ScanbotSDK.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see ScanbotSDK.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=37)}([function(t,e,n){"use strict";n.r(e),n.d(e,"useState",(function(){return Q})),n.d(e,"useReducer",(function(){return tt})),n.d(e,"useEffect",(function(){return et})),n.d(e,"useLayoutEffect",(function(){return nt})),n.d(e,"useRef",(function(){return it})),n.d(e,"useImperativeHandle",(function(){return ot})),n.d(e,"useMemo",(function(){return rt})),n.d(e,"useCallback",(function(){return st})),n.d(e,"useContext",(function(){return at})),n.d(e,"useDebugValue",(function(){return ct})),n.d(e,"useErrorBoundary",(function(){return lt})),n.d(e,"createElement",(function(){return m})),n.d(e,"createContext",(function(){return U})),n.d(e,"createRef",(function(){return v})),n.d(e,"Fragment",(function(){return y})),n.d(e,"Component",(function(){return _})),n.d(e,"version",(function(){return Jt})),n.d(e,"Children",(function(){return xt})),n.d(e,"render",(function(){return Ft})),n.d(e,"hydrate",(function(){return Nt})),n.d(e,"unmountComponentAtNode",(function(){return te})),n.d(e,"createPortal",(function(){return zt})),n.d(e,"createFactory",(function(){return Xt})),n.d(e,"cloneElement",(function(){return Qt})),n.d(e,"isValidElement",(function(){return Kt})),n.d(e,"findDOMNode",(function(){return ee})),n.d(e,"PureComponent",(function(){return yt})),n.d(e,"memo",(function(){return _t})),n.d(e,"forwardRef",(function(){return Ct})),n.d(e,"flushSync",(function(){return ie})),n.d(e,"unstable_batchedUpdates",(function(){return ne})),n.d(e,"StrictMode",(function(){return oe})),n.d(e,"Suspense",(function(){return kt})),n.d(e,"SuspenseList",(function(){return Mt})),n.d(e,"lazy",(function(){return Ot})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return Yt}));var i,o,r,s,a,c,l,u={},d=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(t,e){for(var n in e)t[n]=e[n];return t}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function m(t,e,n){var o,r,s,a={};for(s in e)"key"==s?o=e[s]:"ref"==s?r=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return g(t,a,o,r,null)}function g(t,e,n,i,s){var a={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++r:s};return null==s&&null!=o.vnode&&o.vnode(a),a}function v(){return{current:null}}function y(t){return t.children}function _(t,e){this.props=t,this.context=e}function b(t,e){if(null==e)return t.__?b(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?b(t):null}function w(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return w(t)}}function C(t){(!t.__d&&(t.__d=!0)&&s.push(t)&&!S.__r++||c!==o.debounceRendering)&&((c=o.debounceRendering)||a)(S)}function S(){for(var t;S.__r=s.length;)t=s.sort((function(t,e){return t.__v.__b-e.__v.__b})),s=[],t.some((function(t){var e,n,i,o,r,s;t.__d&&(r=(o=(e=t).__v).__e,(s=e.__P)&&(n=[],(i=f({},o)).__v=o.__v+1,A(s,o,i,e.__n,void 0!==s.ownerSVGElement,null!=o.__h?[r]:null,n,null==r?b(o):r,o.__h),I(n,o),o.__e!=r&&w(o)))}))}function x(t,e,n,i,o,r,s,a,c,l){var h,f,p,m,v,_,w,C=i&&i.__k||d,S=C.length;for(n.__k=[],h=0;h<e.length;h++)if(null!=(m=n.__k[h]=null==(m=e[h])||"boolean"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?g(null,m,null,null,m):Array.isArray(m)?g(y,{children:m},null,null,null):m.__b>0?g(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(p=C[h])||p&&m.key==p.key&&m.type===p.type)C[h]=void 0;else for(f=0;f<S;f++){if((p=C[f])&&m.key==p.key&&m.type===p.type){C[f]=void 0;break}p=null}A(t,m,p=p||u,o,r,s,a,c,l),v=m.__e,(f=m.ref)&&p.ref!=f&&(w||(w=[]),p.ref&&w.push(p.ref,null,m),w.push(f,m.__c||v,m)),null!=v?(null==_&&(_=v),"function"==typeof m.type&&m.__k===p.__k?m.__d=c=E(m,c,t):c=k(t,m,p,C,v,c),"function"==typeof n.type&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=t&&(c=b(p))}for(n.__e=_,h=S;h--;)null!=C[h]&&("function"==typeof n.type&&null!=C[h].__e&&C[h].__e==n.__d&&(n.__d=b(i,h+1)),L(C[h],C[h]));if(w)for(h=0;h<w.length;h++)R(w[h],w[++h],w[++h])}function E(t,e,n){for(var i,o=t.__k,r=0;o&&r<o.length;r++)(i=o[r])&&(i.__=t,e="function"==typeof i.type?E(i,e,n):k(n,i,i,o,i.__e,e));return e}function P(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){P(t,e)})):e.push(t)),e}function k(t,e,n,i,o,r){var s,a,c;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==n||o!=r||null==o.parentNode)t:if(null==r||r.parentNode!==t)t.appendChild(o),s=null;else{for(a=r,c=0;(a=a.nextSibling)&&c<i.length;c+=2)if(a==o)break t;t.insertBefore(o,r),s=r}return void 0!==s?s:o.nextSibling}function D(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||h.test(e)?n:n+"px"}function O(t,e,n,i,o){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||D(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||D(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i||t.addEventListener(e,r?T:M,r):t.removeEventListener(e,r?T:M,r);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function M(t){this.l[t.type+!1](o.event?o.event(t):t)}function T(t){this.l[t.type+!0](o.event?o.event(t):t)}function A(t,e,n,i,r,s,a,c,l){var u,d,h,p,m,g,v,b,w,C,S,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,c=e.__e=n.__e,e.__h=null,s=[c]),(u=o.__b)&&u(e);try{t:if("function"==typeof E){if(b=e.props,w=(u=E.contextType)&&i[u.__c],C=u?w?w.props.value:u.__:i,n.__c?v=(d=e.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?e.__c=d=new E(b,C):(e.__c=d=new _(b,C),d.constructor=E,d.render=B),w&&w.sub(d),d.props=b,d.state||(d.state={}),d.context=C,d.__n=i,h=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=f({},d.__s)),f(d.__s,E.getDerivedStateFromProps(b,d.__s))),p=d.props,m=d.state,h)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&b!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(b,C),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(b,d.__s,C)||e.__v===n.__v){d.props=b,d.state=d.__s,e.__v!==n.__v&&(d.__d=!1),d.__v=e,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,C),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,m,g)}))}d.context=C,d.props=b,d.state=d.__s,(u=o.__r)&&u(e),d.__d=!1,d.__v=e,d.__P=t,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(i=f(f({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,m)),S=null!=u&&u.type===y&&null==u.key?u.props.children:u,x(t,Array.isArray(S)?S:[S],e,n,i,r,s,a,c,l),d.base=e.__e,e.__h=null,d.__h.length&&a.push(d),v&&(d.__E=d.__=null),d.__e=!1}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=z(n.__e,e,n,i,r,s,a,l);(u=o.diffed)&&u(e)}catch(t){e.__v=null,(l||null!=s)&&(e.__e=c,e.__h=!!l,s[s.indexOf(c)]=null),o.__e(t,e,n)}}function I(t,e){o.__c&&o.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){o.__e(t,e.__v)}}))}function z(t,e,n,o,r,s,a,c){var l,d,h,f=n.props,m=e.props,g=e.type,v=0;if("svg"===g&&(r=!0),null!=s)for(;v<s.length;v++)if((l=s[v])&&"setAttribute"in l==!!g&&(g?l.localName===g:3===l.nodeType)){t=l,s[v]=null;break}if(null==t){if(null===g)return document.createTextNode(m);t=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,m.is&&m),s=null,c=!1}if(null===g)f===m||c&&t.data===m||(t.data=m);else{if(s=s&&i.call(t.childNodes),d=(f=n.props||u).dangerouslySetInnerHTML,h=m.dangerouslySetInnerHTML,!c){if(null!=s)for(f={},v=0;v<t.attributes.length;v++)f[t.attributes[v].name]=t.attributes[v].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(function(t,e,n,i,o){var r;for(r in n)"children"===r||"key"===r||r in e||O(t,r,null,n[r],i);for(r in e)o&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===e[r]||O(t,r,e[r],n[r],i)}(t,m,f,r,c),h)e.__k=[];else if(v=e.props.children,x(t,Array.isArray(v)?v:[v],e,n,o,r&&"foreignObject"!==g,s,a,s?s[0]:n.__k&&b(n,0),c),null!=s)for(v=s.length;v--;)null!=s[v]&&p(s[v]);c||("value"in m&&void 0!==(v=m.value)&&(v!==f.value||v!==t.value||"progress"===g&&!v)&&O(t,"value",v,f.value,!1),"checked"in m&&void 0!==(v=m.checked)&&v!==t.checked&&O(t,"checked",v,f.checked,!1))}return t}function R(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){o.__e(t,n)}}function L(t,e,n){var i,r;if(o.unmount&&o.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||R(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){o.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&L(i[r],e,"function"!=typeof t.type);n||null==t.__e||p(t.__e),t.__e=t.__d=void 0}function B(t,e,n){return this.constructor(t,n)}function j(t,e,n){var r,s,a;o.__&&o.__(t,e),s=(r="function"==typeof n)?null:n&&n.__k||e.__k,a=[],A(e,t=(!r&&n||e).__k=m(y,null,[t]),s||u,u,void 0!==e.ownerSVGElement,!r&&n?[n]:s?null:e.firstChild?i.call(e.childNodes):null,a,!r&&n?n:s?s.__e:e.firstChild,r),I(a,t)}function F(t,e){j(t,e,F)}function N(t,e,n){var o,r,s,a=f({},t.props);for(s in e)"key"==s?o=e[s]:"ref"==s?r=e[s]:a[s]=e[s];return arguments.length>2&&(a.children=arguments.length>3?i.call(arguments,2):n),g(t.type,a,o||t.key,r||t.ref,null)}function U(t,e){var n={__c:e="__cC"+l++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(C)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}i=d.slice,o={__e:function(t,e){for(var n,i,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((i=n.constructor)&&null!=i.getDerivedStateFromError&&(n.setState(i.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},r=0,_.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof t&&(t=t(f({},n),this.props)),t&&f(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),C(this))},_.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),C(this))},_.prototype.render=y,s=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,S.__r=0,l=0;var V,W,$,H=0,G=[],q=o.__b,Z=o.__r,Y=o.diffed,J=o.__c,X=o.unmount;function K(t,e){o.__h&&o.__h(W,t,H||e),H=0;var n=W.__H||(W.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Q(t){return H=1,tt(mt,t)}function tt(t,e,n){var i=K(V++,2);return i.t=t,i.__c||(i.__=[n?n(e):mt(void 0,e),function(t){var e=i.t(i.__[0],t);i.__[0]!==e&&(i.__=[e,i.__[1]],i.__c.setState({}))}],i.__c=W),i.__}function et(t,e){var n=K(V++,3);!o.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,W.__H.__h.push(n))}function nt(t,e){var n=K(V++,4);!o.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,W.__h.push(n))}function it(t){return H=5,rt((function(){return{current:t}}),[])}function ot(t,e,n){H=6,nt((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))}function rt(t,e){var n=K(V++,7);return pt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function st(t,e){return H=8,rt((function(){return t}),e)}function at(t){var e=W.context[t.__c],n=K(V++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(W)),e.props.value):t.__}function ct(t,e){o.useDebugValue&&o.useDebugValue(e?e(t):t)}function lt(t){var e=K(V++,10),n=Q();return e.__=t,W.componentDidCatch||(W.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}function ut(){for(var t;t=G.shift();)if(t.__P)try{t.__H.__h.forEach(ht),t.__H.__h.forEach(ft),t.__H.__h=[]}catch(e){t.__H.__h=[],o.__e(e,t.__v)}}o.__b=function(t){W=null,q&&q(t)},o.__r=function(t){Z&&Z(t),V=0;var e=(W=t.__c).__H;e&&(e.__h.forEach(ht),e.__h.forEach(ft),e.__h=[])},o.diffed=function(t){Y&&Y(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==G.push(e)&&$===o.requestAnimationFrame||(($=o.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),dt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);dt&&(e=requestAnimationFrame(n))})(ut)),W=null},o.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ht),t.__h=t.__h.filter((function(t){return!t.__||ft(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],o.__e(n,t.__v)}})),J&&J(t,e)},o.unmount=function(t){X&&X(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{ht(t)}catch(t){e=t}})),e&&o.__e(e,n.__v))};var dt="function"==typeof requestAnimationFrame;function ht(t){var e=W,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),W=e}function ft(t){var e=W;t.__c=t.__(),W=e}function pt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function mt(t,e){return"function"==typeof e?e(t):e}function gt(t,e){for(var n in e)t[n]=e[n];return t}function vt(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function yt(t){this.props=t}function _t(t,e){function n(t){var n=this.props.ref,i=n==t.ref;return!i&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!i:vt(this.props,t)}function i(e){return this.shouldComponentUpdate=n,m(t,e)}return i.displayName="Memo("+(t.displayName||t.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(yt.prototype=new _).isPureReactComponent=!0,yt.prototype.shouldComponentUpdate=function(t,e){return vt(this.props,t)||vt(this.state,e)};var bt=o.__b;o.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),bt&&bt(t)};var wt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ct(t){function e(e,n){var i=gt({},e);return delete i.ref,t(i,(n=e.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return e.$$typeof=wt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var St=function(t,e){return null==t?null:P(P(t).map(e))},xt={map:St,forEach:St,count:function(t){return t?P(t).length:0},only:function(t){var e=P(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:P},Et=o.__e;o.__e=function(t,e,n){if(t.then)for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e);Et(t,e,n)};var Pt=o.unmount;function kt(){this.__u=0,this.t=null,this.__b=null}function Dt(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Ot(t){var e,n,i;function o(o){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){i=t})),i)throw i;if(!n)throw e;return m(n,o)}return o.displayName="Lazy",o.__f=!0,o}function Mt(){this.u=null,this.o=null}o.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),Pt&&Pt(t)},(kt.prototype=new _).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=Dt(i.__v),r=!1,s=function(){r||(r=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--i.__u){if(i.state.__e){var t=i.state.__e;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__e:i.__b=null});e=i.t.pop();)e.forceUpdate()}},c=!0===e.__h;i.__u++||c||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(s,s)},kt.prototype.componentWillUnmount=function(){this.t=[]},kt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=gt({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var o=e.__e&&m(y,null,t.fallback);return o&&(o.__h=null),[m(y,null,e.__e?null:t.children),o]};var Tt=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function At(t){return this.getChildContext=function(){return t.context},t.children}function It(t){var e=this,n=t.i;e.componentWillUnmount=function(){j(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),j(m(At,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}function zt(t,e){return m(It,{__v:t,i:e})}(Mt.prototype=new _).__e=function(t){var e=this,n=Dt(e.__v),i=e.o.get(t);return i[0]++,function(o){var r=function(){e.props.revealOrder?(i.push(o),Tt(e,t,i)):o()};n?n(r):r()}},Mt.prototype.render=function(t){this.u=null,this.o=new Map;var e=P(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Mt.prototype.componentDidUpdate=Mt.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Tt(t,n,e)}))};var Rt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Lt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Bt="undefined"!=typeof document,jt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};function Ft(t,e,n){return null==e.__k&&(e.textContent=""),j(t,e),"function"==typeof n&&n(),t?t.__c:null}function Nt(t,e,n){return F(t,e),"function"==typeof n&&n(),t?t.__c:null}_.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(_.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Ut=o.event;function Vt(){}function Wt(){return this.cancelBubble}function $t(){return this.defaultPrevented}o.event=function(t){return Ut&&(t=Ut(t)),t.persist=Vt,t.isPropagationStopped=Wt,t.isDefaultPrevented=$t,t.nativeEvent=t};var Ht,Gt={configurable:!0,get:function(){return this.class}},qt=o.vnode;o.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var o=-1===e.indexOf("-");for(var r in i={},n){var s=n[r];Bt&&"children"===r&&"noscript"===e||"value"===r&&"defaultValue"in n&&null==s||("defaultValue"===r&&"value"in n&&null==n.value?r="value":"download"===r&&!0===s?s="":/ondoubleclick/i.test(r)?r="ondblclick":/^onchange(textarea|input)/i.test(r+e)&&!jt(n.type)?r="oninput":/^onfocus$/i.test(r)?r="onfocusin":/^onblur$/i.test(r)?r="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(r)?r=r.toLowerCase():o&&Lt.test(r)?r=r.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),i[r]=s)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=P(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Gt.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Gt))}t.$$typeof=Rt,qt&&qt(t)};var Zt=o.__r;o.__r=function(t){Zt&&Zt(t),Ht=t.__c};var Yt={ReactCurrentDispatcher:{current:{readContext:function(t){return Ht.__n[t.__c].props.value}}}},Jt="17.0.2";function Xt(t){return m.bind(null,t)}function Kt(t){return!!t&&t.$$typeof===Rt}function Qt(t){return Kt(t)?N.apply(null,arguments):t}function te(t){return!!t.__k&&(j(null,t),!0)}function ee(t){return t&&(t.base||1===t.nodeType&&t)||null}var ne=function(t,e){return t(e)},ie=function(t,e){return t(e)},oe=y;e.default={useState:Q,useReducer:tt,useEffect:et,useLayoutEffect:nt,useRef:it,useImperativeHandle:ot,useMemo:rt,useCallback:st,useContext:at,useDebugValue:ct,version:"17.0.2",Children:xt,render:Ft,hydrate:Nt,unmountComponentAtNode:te,createPortal:zt,createElement:m,createContext:U,createFactory:Xt,cloneElement:Qt,createRef:v,Fragment:y,isValidElement:Kt,findDOMNode:ee,Component:_,PureComponent:yt,memo:_t,forwardRef:Ct,flushSync:ie,unstable_batchedUpdates:ne,StrictMode:y,Suspense:kt,SuspenseList:Mt,lazy:Ot,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Yt}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Point=void 0;class i{constructor(t,e){this.x=t,this.y=e}static toPolygon(t,e){return[i.scaleDownTo(t[0],e),i.scaleDownTo(t[1],e),i.scaleDownTo(t[2],e),i.scaleDownTo(t[3],e)]}static scaleToPoint(t,e,n,o){return new i(o*(t.x-e),o*(t.y-n))}static scaleListToImageElement(t,e,n){return t.map((t=>i.scaleToImageElement(t,e,n)))}static scaleToImageElement(t,e,n){return new i(t.x*(n.clientWidth/e.width),t.y*(n.clientHeight/e.height))}static scaleUpTo(t,e){return new i(t.x*e.width,t.y*e.height)}static scaleDownTo(t,e){return new i(t.x/e.width,t.y/e.height)}static fromHtmlElement(t){return new i(t.offsetLeft,t.offsetTop)}static withScale(t,e,n){return new i(t/n,e/n)}static fromCoordinates(t,e,n,o){if(!t||!e)return new i(0,0);const r=new i(t,e);return o=null!=o?o:1,1===(n=n?n%4:0)?i.withScale(r.y,-r.x,o):2===n?i.withScale(-r.x,-r.y,o):3===n?i.withScale(-r.y,r.x,o):i.withScale(r.x,r.y,o)}static centerOf(t){const e=t.reduce(((t,e)=>t+e.x),0)/t.length,n=t.reduce(((t,e)=>t+e.y),0)/t.length;return new i(e,n)}static smallerSizeOfQuad(t){const e=Math.max(...t.map((t=>t.x)))-Math.min(...t.map((t=>t.x))),n=Math.max(...t.map((t=>t.y)))-Math.min(...t.map((t=>t.y)));return Math.min(e,n)}static empty(){return new i(0,0)}}e.Point=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Size=void 0;const i=n(1);class o{constructor(t,e){this.width=t,this.height=e}isPortrait(){return this.height>this.width}ratio(t){return t?this.height/this.width:this.width/this.height}ratioDiff(t,e){return this.ratio(e)/t.ratio(e)}static isEmpty(t){return!t||(0===t.width||0===t.height)}static toPolygon(t){return[new i.Point(0,0),new i.Point(t.width,0),new i.Point(t.width,t.height),new i.Point(0,t.height)]}static fromHtmlElement(t){return t?new o(t.clientWidth,t.clientHeight):new o(0,0)}static fromJson(t){return new o(t.width,t.height)}static subtractFrom(t,e){return new o(t.width-e,t.height-e)}static empty(){return new o(0,0)}}e.Size=o},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageUtils=void 0;const o=n(4),r=n(8);class s{static toDataUrl(t){return new Promise(((e,n)=>{const i=new Blob([t],{type:"image/jpeg"}),o=new FileReader;o.onload=()=>e(o.result),o.onerror=()=>n(o.error),o.readAsDataURL(i)}))}static getObjectFitSize(t,e,n=!0){const i=e.width/e.height,r=t.width/t.height;let s=0,a=0;(n?i>r:i<r)?(s=t.width,a=s/i):(a=t.height,s=a*i);const c=(t.width-s)/2,l=(t.height-a)/2;return new o.Frame(c,l,s,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){this.createImageDataCanvas(t).toBlob((t=>this.saveBlob(t,r.Utils.uuid()+".png")))}static createImageDataCanvas(t){const e=document.createElement("canvas");return e.className="scanbot-sdk-canvas-element",e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e}static saveBlob(t,e){let n=document.createElement("a");n.setAttribute("download",e);let i=URL.createObjectURL(t);n.setAttribute("href",i),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return s.createImageDataCanvas(s.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}}e.ImageUtils=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=void 0;class i{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}scaleDown(t){return new i(this.x/t,this.y/t,this.width/t,this.height/t)}static withSize(t,e){return new i(0,0,t,e)}static empty(){return new i(0,0,0,0)}static fromRect(t){return t?new i(t.x,t.y,t.width,t.height):i.empty()}static fromPoint(t,e){return new i(t.x-e/2,t.y-e/2,e,e)}}e.Frame=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewUtils=void 0;const i=n(54),o=n(2),r=n(1);class s{static convertLinesToViewportLines(t,e){if(!e||!t)return;const n=[],{x:o,y:r,containerScale:s}=this.calculateScale(t);return e.forEach((t=>{n.push(i.MagneticLine.scaleToLine(t,o,r,s))})),n}static convertToViewportPointsFromParentSize(t,e){return e?o.Size.isEmpty(t)?void 0:e.map((e=>r.Point.scaleUpTo(e,t))):o.Size.toPolygon(t)}static calculateScale(t){let e,n=0,i=0;return 1>t.width/t.height?(e=t.height/1,n=(1-t.width/e)/2):(e=t.width/1,i=(1-t.height/e)/2),{x:n,y:i,containerScale:e}}static findScale(t,e){let n,i=0,o=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,o=(e.height-t.height/n)/2):(n=t.height/e.height,i=(e.width-t.width/n)/2),{x:i,y:o,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",s.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",s.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(t){var e;const n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}e.ViewUtils=s},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(38),s=n(26),a=n(42),c=o(n(43)),l=o(n(44)),u=o(n(28)),d=n(3),h=n(25),f=n(14),p=o(n(46)),m=o(n(48)),g=o(n(49)),v=o(n(50)),y=n(52);class _{static initialize(t){return i(this,void 0,void 0,(function*(){const e=new _,n=t.engine||_.defaultEnginePath;e.bridge=new r.WorkerBridge(n);const i=[t.licenseKey,n,window.location.hostname,h.Constants.CDN_PATH+h.Constants.DEFAULT_WASM_FOLDER];return e.initialized=yield e.bridge.postByCopyingArgs("initialize",i),e.initialized&&(_.instance=e),e}))}createDocumentScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(53);return yield e.default.create(t)}))}createMrzScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(61),i=new p.default(this,yield this.bridge.postByCopyingArgs("createMRZRecognizer",[]));return yield e.default.create(t,i)}))}createBarcodeScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(64);return yield e.default.create(t)}))}openCroppingView(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(86);return yield e.default.create(t)}))}createTextDataScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(97),i=t.supportedLanguages,o=t.ocrResolutionLimit,r=new v.default(this,yield this.bridge.postByCopyingArgs("createGenericTextLineScanner",[{languages:i,ocrResolutionLimit:o}]));return yield e.default.create(t,r)}))}toDataUrl(t){return i(this,void 0,void 0,(function*(){return this.throwIfMissingBuffer(t),yield d.ImageUtils.toDataUrl(t)}))}applyFilter(t,e){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),this.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("applyFilter",[t,e])}))}rotateImageCcw(t,e){return i(this,void 0,void 0,(function*(){return this.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("rotateImageCcw",[t,e])}))}cropAndRotateImageCcw(t,e,n){return i(this,void 0,void 0,(function*(){return this.throwIfMissingBuffer(t),this.throwIfMissing(e,"Polygon may not be null"),yield this.bridge.postByCopyingArgs("cropAndRotateImageCcw",[t,e,n])}))}detectDocument(t,e,n){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),this.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("detectDocumentOnImage",[t,e||s.DocumentScannerConfiguration.DEFAULT_ACCEPTED_ANGLE_SCORE,n||s.DocumentScannerConfiguration.DEFAULT_ACCEPTED_SIZE_SCORE])}))}detectBarcodes(t,e,n,o){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),this.throwIfMissingBuffer(t),new Promise((r=>{const s=document.createElement("canvas"),a=document.createElement("img");a.src=t,a.onload=()=>i(this,void 0,void 0,(function*(){s.width=a.width,s.height=a.height;const t=s.getContext("2d");t.drawImage(a,0,0);const i=t.getImageData(0,0,a.width,a.height),{result:c,originalImage:l}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[i,{engineMode:e,barcodeFormats:n,returnBarcodeImage:o}]);r(f.BarcodeResult.fromWorker(c,d.ImageUtils.convertImageDataWrapperToImageData(l)))}))}))}))}createSimpleMRZRecognizer(){return i(this,void 0,void 0,(function*(){return new p.default(this,yield this.bridge.postByTransferringArgs("createMRZRecognizer",[]))}))}createOcrEngine(t){return i(this,void 0,void 0,(function*(){return new m.default(this,yield this.bridge.postByCopyingArgs("createOcrEngine",[t]))}))}createBlurDetector(){return i(this,void 0,void 0,(function*(){return new g.default(this,yield this.bridge.postByTransferringArgs("createBlurDetector",[]))}))}getLicenseInfo(){return i(this,void 0,void 0,(function*(){const t=yield this.bridge.postByTransferringArgs("getLicenseInfo",[]);return a.LicenseInfo.fromJson(t)}))}beginPdf(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new c.default(this,yield this.bridge.postByCopyingArgs("beginPdf",[t]))}))}beginTiff(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new l.default(this,yield this.bridge.postByCopyingArgs("beginTiff",[t]))}))}get version(){return h.Constants.VERSION}get utils(){return this._utils||(this._utils=new u.default),this._utils}throwIfMissingBuffer(t){this.throwIfMissing(t,"ImageBuffer may not be null")}throwIfMissing(t,e){if(!t)throw new Error(e)}licenseCheck(){return i(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new y.LicenseError(t)}))}}e.default=_,_.defaultEnginePath=""},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScannerConfiguration=void 0;const i=n(27);class o extends i.BaseConfiguration{constructor(t){super(),this.mirrored=!1,this.videoConstraints={width:{ideal:t.width},height:{ideal:t.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(t,e){t.videoConstraints&&this.mapValues(t.videoConstraints,e.videoConstraints)}}e.ScannerConfiguration=o,o.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},o.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},o.DEFAULT_ACCEPTED_ANGLE_SCORE=75,o.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Utils=void 0;e.Utils=class{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){let n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let i=0;i<5;i++)t+=e.charAt(Math.floor(Math.random()*n));return t}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ScannerView=e.ScanbotCameraState=e.ScanbotCameraProps=void 0;const r=o(n(0)),s=n(0),a=o(n(6)),c=n(29);e.ScanbotCameraProps=class{};e.ScanbotCameraState=class{constructor(){this.initialized=!1}};class l extends r.default.Component{constructor(){super(...arguments),this.onVideoReady=()=>{this.setState({initialized:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.initialized){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}}}get bridge(){return a.default.instance.bridge}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with create...Scanner. Remove component from render tree to dispose.");(0,s.render)(null,t)}componentDidMount(){this.disposed=!1}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(t){this.camera.swapCameraFacing(t)}switchCamera(t,e){return i(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return i(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{var n;if(null===(n=navigator.mediaDevices)||void 0===n?void 0:n.enumerateDevices){let n=[];navigator.mediaDevices.enumerateDevices().then((e=>{e.forEach((t=>{"videoinput"===t.kind&&t.deviceId&&n.push({deviceId:t.deviceId,label:t.label})})),t(n)})).catch((t=>{e(c.MediaError.unknownError(t))}))}else e(c.MediaError.unsupportedOperationError())}))}))}}e.ScannerView=l,l.DEFAULT_DETECTION_RESOLUTION=600,l.DETECTION_RESULTION_4K=3840},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentPolygon=void 0;const o=i(n(0));class r extends o.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return o.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const t=[];for(let e=0;e<this.LINE_COUNT;e++){const n=this.props.points[e],i=this.props.points[(e+1)%this.LINE_COUNT];t.push(o.default.createElement("line",{key:e,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:i.x,y2:i.y}))}return t}setFrame(){this.forceUpdate()}}e.DocumentPolygon=r,r.CLASSNAME="scanbot-document-outline"},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=o(n(0)),s=o(n(59)),a=n(2),c=n(4),l=n(3);class u extends r.default.Component{constructor(t){super(t),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this.onStreamChanged=t=>{this.video.srcObject=t,this.updateCameraInfo(t),this.video.addEventListener("resize",(t=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(t=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:t,clientVideoHeight:e}=this.calculateClientVideoConstraints();return new a.Size(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}createImageData(t=0){var e;if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;let{videoWidth:i,videoHeight:o}=this.video,{clientVideoWidth:r,clientVideoHeight:s}=this.calculateClientVideoConstraints(),a=r,u=s;if(this.props.windowConfiguration)if(this.props.windowConfiguration.aspectRatio){a*=this.props.windowConfiguration.widthProportion<0||this.props.windowConfiguration.widthProportion>=1?1:this.props.windowConfiguration.widthProportion,u=a/this.props.windowConfiguration.aspectRatio}else this.props.windowConfiguration.width&&this.props.windowConfiguration.height&&(a=parseFloat(this.props.windowConfiguration.width),u=parseFloat(this.props.windowConfiguration.height));const{width:d,height:h}=this.calculateFrameSize(t,a,u),f=null!==(e=this.cutout)&&void 0!==e?e:new c.Frame(0,0,d,h),p=d*this.zoom(),m=h*this.zoom(),g=-p/2+p/this.zoom()/2,v=-m/2+m/this.zoom()/2;if(this.video.readyState>1){n.drawImage(this.video,(i-a)/2,(o-u)/2,a,u,g,v,p,m);const t=n.getImageData(f.x,f.y,f.width,f.height);return n.clearRect(0,0,this.canvas.width,this.canvas.height),this.save&&(console.log("frame",f),l.ImageUtils.saveImageData(t),this.save=!1),{data:t.data,width:t.width,height:t.height}}}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),i=t,o=e;if(n.width/n.height<=t/e){let t=n.height/e;t>0&&(i=n.width/t)}else{let e=n.width/t;e>0&&(o=n.height/e)}return{clientVideoWidth:i,clientVideoHeight:o}}calculateFrameSize(t,e,n){let i=e,o=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(i=e>t?t:e,o=i/r):(o=n>t?t:n,i=o*r)}return new a.Size(i,o)}getCanvasRenderingContext(){if(!this.video)return null;if(0===this.video.videoWidth)return null;this.canvas&&!this.reloadCanvas||(this.canvas&&this.canvas.remove(),this.canvas=document.createElement("canvas"),this.canvas.className="scanbot-sdk-canvas-element",this.canvas.width=this.videoSize().width,this.canvas.height=this.videoSize().height,this.reloadCanvas=!1);const t=this.canvas.getContext("2d",{willReadFrequently:!0});return t.imageSmoothingEnabled=!1,t}releaseCanvas(){if(this.canvas){this.canvas.width=1,this.canvas.height=1;const t=this.canvas.getContext("2d");t&&t.clearRect(0,0,1,1),this.canvas=null}}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){const t={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover"};return this.state.mirrored&&(t.transform="scaleX(-1)"),t}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return r.default.createElement(s.default,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},r.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}swapCameraFacing(t){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const e=!this.state.facingModeBack,n=e?"environment":"user";this.props.videoConstraints.facingMode=!0===t?{exact:n}:{ideal:n},this.setState({facingModeBack:e,mirrored:!e},(()=>i(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return i(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=e?e:this.state.mirrored,deviceId:t},(()=>i(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(t){const e=t.getTracks().filter((t=>"video"===t.kind));if(e){const t=e.map((t=>{const e=t.label,n=t.getSettings().deviceId,i=t.getSettings().facingMode;let o="unknown";return"user"===i?o="front":"environment"===i&&(o="back"),{deviceId:n,label:e,facingMode:o}}));this.activeCamera=t[0]}}getActiveCameraInfo(){return this.activeCamera}}e.default=u},function(t,e,n){"use strict";var i,o=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),s=[];function a(t){for(var e=-1,n=0;n<s.length;n++)if(s[n].identifier===t){e=n;break}return e}function c(t,e){for(var n={},i=[],o=0;o<t.length;o++){var r=t[o],c=e.base?r[0]+e.base:r[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var d=a(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(s[d].references++,s[d].updater(h)):s.push({identifier:u,updater:g(h,e),references:1}),i.push(u)}return i}function l(t){var e=document.createElement("style"),i=t.attributes||{};if(void 0===i.nonce){var o=n.nc;o&&(i.nonce=o)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var s=r(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,i){var o=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=d(e,o);else{var r=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}function f(t,e,n){var i=n.css,o=n.media,r=n.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var p=null,m=0;function g(t,e){var n,i,o;if(e.singleton){var r=m++;n=p||(p=l(e)),i=h.bind(null,n,r,!1),o=h.bind(null,n,r,!0)}else n=l(e),i=f.bind(null,n,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var n=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var i=0;i<n.length;i++){var o=a(n[i]);s[o].references--}for(var r=c(t,e),l=0;l<n.length;l++){var u=a(n[l]);0===s[u].references&&(s[u].updater(),s.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(i)for(var r=0;r<this.length;r++){var s=this[r][0];null!=s&&(o[s]=!0)}for(var a=0;a<t.length;a++){var c=[].concat(t[a]);i&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeResult=void 0;const i=n(3),o=n(45);class r{constructor(t,e){this.barcodes=t,this.imageData=e}static fromWorker(t,e){const n=[];t&&t.forEach((t=>{n.push(o.Barcode.fromWorker(t))}));const s=i.ImageUtils.convertImageDataWrapperToImageData(e);return new r(n,s)}isEmpty(){return 0===this.barcodes.length}}e.BarcodeResult=r},function(t,e,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var i=arguments[e];if(i){var r=typeof i;if("string"===r||"number"===r)t.push(i);else if(Array.isArray(i)){if(i.length){var s=o.apply(null,i);s&&t.push(s)}}else if("object"===r)if(i.toString===Object.prototype.toString)for(var a in i)n.call(i,a)&&i[a]&&t.push(a);else t.push(i.toString())}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(i=function(){return o}.apply(e,[]))||(t.exports=i)}()},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ViewFinder=void 0;const o=i(n(0)),r=n(4),s=n(63),a=n(1);var c;!function(t){t[t.Right=0]="Right",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Up=3]="Up"}(c||(c={}));class l extends o.default.Component{constructor(){super(...arguments),this.BORDER_SIZE=2,this.TEXT_MARGIN=10}componentDidMount(){this.forceUpdate()}frame(){var t;const e=null===(t=this.container)||void 0===t?void 0:t.getBoundingClientRect(),n=r.Frame.fromRect(e);return this.forceUpdate(),n}computeClipPath(){var t,e,n;const i=null===(t=this.container)||void 0===t?void 0:t.getBoundingClientRect(),o=r.Frame.fromRect(i),a=r.Frame.fromRect(null===(e=this.overlay)||void 0===e?void 0:e.getBoundingClientRect()),c=r.Frame.fromRect(null===(n=this.window)||void 0===n?void 0:n.getBoundingClientRect());c.x=o.x-a.x,c.y=o.y-a.y;const l=s.ClipPath.fromFrames(a,c);return this.calculateClipPath(l)}get backgroundStyle(){const t=this.computeClipPath();return{backgroundColor:this.props.configuration.backgroundColor,position:"absolute",width:"100%",height:"100%",top:0,bottom:0,clipPath:t,webkitClipPath:t}}get containerStyle(){const t=this.props.configuration.window;return{left:t.left,top:t.top,transform:t.transform,position:"absolute"}}get windowStyle(){var t;const e=this.props.configuration.window;if(this.finderWidth=parseFloat(e.width),this.finderHeight=parseFloat(e.height),this.props.configuration.window.aspectRatio){const e=r.Frame.fromRect(null===(t=this.overlay)||void 0===t?void 0:t.getBoundingClientRect()),n=this.props.configuration.window.widthProportion<0||this.props.configuration.window.widthProportion>=1?1:this.props.configuration.window.widthProportion;if(this.finderWidth=e.width*n,this.finderHeight=this.finderWidth/this.props.configuration.window.aspectRatio,this.finderHeight>e.height){const t=this.finderHeight;this.finderHeight=e.height,this.finderWidth=this.finderHeight/t*this.finderWidth}}return{width:this.finderWidth,height:this.finderHeight,borderRadius:"10px",border:this.BORDER_SIZE+"px solid "+e.borderColor}}get textStyle(){const t=this.props.configuration.text;return{color:t.color,fontSize:t.size,fontWeight:t.weight,textAlign:"center",marginTop:this.TEXT_MARGIN+"px",width:this.finderWidth,position:"absolute"}}render(){return o.default.createElement("div",null,o.default.createElement("div",{ref:t=>this.overlay=t,style:this.backgroundStyle}),o.default.createElement("div",{ref:t=>this.container=t,style:this.containerStyle,id:"finder"},o.default.createElement("div",{ref:t=>{var e;this.window=t,this.props.onSizeChanged&&this.props.onSizeChanged(null===(e=this.window)||void 0===e?void 0:e.getBoundingClientRect())},style:this.windowStyle}),o.default.createElement("div",{style:this.textStyle},this.props.configuration.hint)))}calculateClipPath(t){return`polygon(\n \n 0% 0%, \n 0% 100%, \n \n ${t.left} 100%, \n\n ${this.roundClipPath(t.left,t.top,c.Right)}\n ${this.roundClipPath(t.right,t.top,c.Down)}\n ${this.roundClipPath(t.right,t.bottom,c.Left)}\n ${this.roundClipPath(t.left,t.bottom,c.Up)}\n\n ${t.left} 100%, \n 100% 100%, \n 100% 0%\n )`}roundClipPath(t,e,n){let i="";let o=new a.Point(s.ClipPath.toNumber(t),s.ClipPath.toNumber(e));switch(n){case c.Right:o.y+=10;break;case c.Down:o.x-=10;break;case c.Left:o.y-=10;break;case c.Up:o.x+=10}let r=[];switch(n){case c.Right:r=[{x:1,y:-3},{x:3,y:-5},{x:5,y:-7},{x:7,y:-9},{x:10,y:-10}];break;case c.Down:r=[{x:3,y:1},{x:5,y:3},{x:7,y:5},{x:9,y:7},{x:10,y:10}];break;case c.Left:r=[{x:-1,y:3},{x:-3,y:5},{x:-5,y:7},{x:-7,y:9},{x:-10,y:10}];break;case c.Up:r=[{x:-3,y:-1},{x:-5,y:-3},{x:-7,y:-5},{x:-9,y:-7},{x:-10,y:-10}];break;default:throw"Invalid ClipDirection"}return i+=this.addIncrements(o,r),i}addIncrements(t,e){let n="";return n+=t.x+"px "+t.y+"px, ",e.forEach((e=>{n+=t.x+e.x+"px "+(t.y+e.y)+"px, "})),n}}e.ViewFinder=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Debugger=void 0;e.Debugger=class{static warn(t){console.warn("[ScanbotSDK]",t)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"ServerStyleSheet",(function(){return Ft})),n.d(e,"StyleSheetConsumer",(function(){return it})),n.d(e,"StyleSheetContext",(function(){return nt})),n.d(e,"StyleSheetManager",(function(){return lt})),n.d(e,"ThemeConsumer",(function(){return Tt})),n.d(e,"ThemeContext",(function(){return Mt})),n.d(e,"ThemeProvider",(function(){return At})),n.d(e,"__PRIVATE__",(function(){return Vt})),n.d(e,"createGlobalStyle",(function(){return Bt})),n.d(e,"css",(function(){return _t})),n.d(e,"isStyledComponent",(function(){return _})),n.d(e,"keyframes",(function(){return jt})),n.d(e,"useTheme",(function(){return Ut})),n.d(e,"version",(function(){return w})),n.d(e,"withTheme",(function(){return Nt}));var i=n(22),o=n(0),r=n(34),s=n.n(r),a=n(35),c=n(36),l=n(24),u=n(23),d=n.n(u);function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var f=function(t,e){for(var n=[t[0]],i=0,o=e.length;i<o;i+=1)n.push(e[i],t[i+1]);return n},p=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!Object(i.typeOf)(t)},m=Object.freeze([]),g=Object.freeze({});function v(t){return"function"==typeof t}function y(t){return t.displayName||t.name||"Component"}function _(t){return t&&"string"==typeof t.styledComponentId}var b=void 0!==t&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",w="5.3.3",C="undefined"!=typeof window&&"HTMLElement"in window,S=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:void 0!==t&&void 0!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==t.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&t.env.REACT_APP_SC_DISABLE_SPEEDY:void 0!==t&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),x={};function E(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error("An error occurred. See https://git.io/JUIaE#"+t+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var P=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}var e=t.prototype;return e.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},e.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,o=i;t>=o;)(o<<=1)<0&&E(16,""+t);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var r=i;r<o;r++)this.groupSizes[r]=0}for(var s=this.indexOfGroup(t+1),a=0,c=e.length;a<c;a++)this.tag.insertRule(s,e[a])&&(this.groupSizes[t]++,s++)},e.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),i=n+e;this.groupSizes[t]=0;for(var o=n;o<i;o++)this.tag.deleteRule(n)}},e.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],i=this.indexOfGroup(t),o=i+n,r=i;r<o;r++)e+=this.tag.getRule(r)+"/*!sc*/\n";return e},t}(),k=new Map,D=new Map,O=1,M=function(t){if(k.has(t))return k.get(t);for(;D.has(O);)O++;var e=O++;return k.set(t,e),D.set(e,t),e},T=function(t){return D.get(t)},A=function(t,e){e>=O&&(O=e+1),k.set(t,e),D.set(e,t)},I="style["+b+'][data-styled-version="5.3.3"]',z=new RegExp("^"+b+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),R=function(t,e,n){for(var i,o=n.split(","),r=0,s=o.length;r<s;r++)(i=o[r])&&t.registerName(e,i)},L=function(t,e){for(var n=(e.textContent||"").split("/*!sc*/\n"),i=[],o=0,r=n.length;o<r;o++){var s=n[o].trim();if(s){var a=s.match(z);if(a){var c=0|parseInt(a[1],10),l=a[2];0!==c&&(A(l,c),R(t,l,a[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}},B=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},j=function(t){var e=document.head,n=t||e,i=document.createElement("style"),o=function(t){for(var e=t.childNodes,n=e.length;n>=0;n--){var i=e[n];if(i&&1===i.nodeType&&i.hasAttribute(b))return i}}(n),r=void 0!==o?o.nextSibling:null;i.setAttribute(b,"active"),i.setAttribute("data-styled-version","5.3.3");var s=B();return s&&i.setAttribute("nonce",s),n.insertBefore(i,r),i},F=function(){function t(t){var e=this.element=j(t);e.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,i=e.length;n<i;n++){var o=e[n];if(o.ownerNode===t)return o}E(17)}(e),this.length=0}var e=t.prototype;return e.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},e.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.getRule=function(t){var e=this.sheet.cssRules[t];return void 0!==e&&"string"==typeof e.cssText?e.cssText:""},t}(),N=function(){function t(t){var e=this.element=j(t);this.nodes=e.childNodes,this.length=0}var e=t.prototype;return e.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e),i=this.nodes[t];return this.element.insertBefore(n,i||null),this.length++,!0}return!1},e.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),U=function(){function t(t){this.rules=[],this.length=0}var e=t.prototype;return e.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},e.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),V=C,W={isServer:!C,useCSSOMInjection:!S},$=function(){function t(t,e,n){void 0===t&&(t=g),void 0===e&&(e={}),this.options=h({},W,{},t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&C&&V&&(V=!1,function(t){for(var e=document.querySelectorAll(I),n=0,i=e.length;n<i;n++){var o=e[n];o&&"active"!==o.getAttribute(b)&&(L(t,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}t.registerId=function(t){return M(t)};var e=t.prototype;return e.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(h({},this.options,{},e),this.gs,n&&this.names||void 0)},e.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.getTag=function(){return this.tag||(this.tag=(n=(e=this.options).isServer,i=e.useCSSOMInjection,o=e.target,t=n?new U(o):i?new F(o):new N(o),new P(t)));var t,e,n,i,o},e.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},e.registerName=function(t,e){if(M(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},e.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(M(t),n)},e.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.clearRules=function(t){this.getTag().clearGroup(M(t)),this.clearNames(t)},e.clearTag=function(){this.tag=void 0},e.toString=function(){return function(t){for(var e=t.getTag(),n=e.length,i="",o=0;o<n;o++){var r=T(o);if(void 0!==r){var s=t.names.get(r),a=e.getGroup(o);if(s&&a&&s.size){var c=b+".g"+o+'[id="'+r+'"]',l="";void 0!==s&&s.forEach((function(t){t.length>0&&(l+=t+",")})),i+=""+a+c+'{content:"'+l+'"}/*!sc*/\n'}}}return i}(this)},t}(),H=/(a)(d)/gi,G=function(t){return String.fromCharCode(t+(t>25?39:97))};function q(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=G(e%52)+n;return(G(e%52)+n).replace(H,"$1-$2")}var Z=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},Y=function(t){return Z(5381,t)};function J(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(v(n)&&!_(n))return!1}return!0}var X=Y("5.3.3"),K=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&J(t),this.componentId=e,this.baseHash=Z(X,e),this.baseStyle=n,$.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var i=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(t,e,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(i,this.staticRulesId))o.push(this.staticRulesId);else{var r=vt(this.rules,t,e,n).join(""),s=q(Z(this.baseHash,r)>>>0);if(!e.hasNameForId(i,s)){var a=n(r,"."+s,void 0,i);e.insertRules(i,s,a)}o.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,l=Z(this.baseHash,n.hash),u="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)u+=h;else if(h){var f=vt(h,t,e,n),p=Array.isArray(f)?f.join(""):f;l=Z(l,p+d),u+=p}}if(u){var m=q(l>>>0);if(!e.hasNameForId(i,m)){var g=n(u,"."+m,void 0,i);e.insertRules(i,m,g)}o.push(m)}}return o.join(" ")},t}(),Q=/^\s*\/\/.*$/gm,tt=[":","[",".","#"];function et(t){var e,n,i,o,r=void 0===t?g:t,s=r.options,c=void 0===s?g:s,l=r.plugins,u=void 0===l?m:l,d=new a.a(c),h=[],f=function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(n,i,o,r,s,a,c,l,u,d){switch(n){case 1:if(0===u&&64===i.charCodeAt(0))return t(i+";"),"";break;case 2:if(0===l)return i+"/*|*/";break;case 3:switch(l){case 102:case 112:return t(o[0]+i),"";default:return i+(0===d?"/*|*/":"")}case-2:i.split("/*|*/}").forEach(e)}}}((function(t){h.push(t)})),p=function(t,i,r){return 0===i&&-1!==tt.indexOf(r[n.length])||r.match(o)?t:"."+e};function v(t,r,s,a){void 0===a&&(a="&");var c=t.replace(Q,""),l=r&&s?s+" "+r+" { "+c+" }":c;return e=a,n=r,i=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),d(s||!r?"":r,l)}return d.use([].concat(u,[function(t,e,o){2===t&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(i,p))},f,function(t){if(-2===t){var e=h;return h=[],e}}])),v.hash=u.length?u.reduce((function(t,e){return e.name||E(15),Z(t,e.name)}),5381).toString():"",v}var nt=o.default.createContext(),it=nt.Consumer,ot=o.default.createContext(),rt=(ot.Consumer,new $),st=et();function at(){return Object(o.useContext)(nt)||rt}function ct(){return Object(o.useContext)(ot)||st}function lt(t){var e=Object(o.useState)(t.stylisPlugins),n=e[0],i=e[1],r=at(),a=Object(o.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target]),c=Object(o.useMemo)((function(){return et({options:{prefix:!t.disableVendorPrefixes},plugins:n})}),[t.disableVendorPrefixes,n]);return Object(o.useEffect)((function(){s()(n,t.stylisPlugins)||i(t.stylisPlugins)}),[t.stylisPlugins]),o.default.createElement(nt.Provider,{value:a},o.default.createElement(ot.Provider,{value:c},t.children))}var ut=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=st);var i=n.name+e.hash;t.hasNameForId(n.id,i)||t.insertRules(n.id,i,e(n.rules,i,"@keyframes"))},this.toString=function(){return E(12,String(n.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=e}return t.prototype.getName=function(t){return void 0===t&&(t=st),this.name+t.hash},t}(),dt=/([A-Z])/,ht=/([A-Z])/g,ft=/^ms-/,pt=function(t){return"-"+t.toLowerCase()};function mt(t){return dt.test(t)?t.replace(ht,pt).replace(ft,"-ms-"):t}var gt=function(t){return null==t||!1===t||""===t};function vt(t,e,n,i){if(Array.isArray(t)){for(var o,r=[],s=0,a=t.length;s<a;s+=1)""!==(o=vt(t[s],e,n,i))&&(Array.isArray(o)?r.push.apply(r,o):r.push(o));return r}return gt(t)?"":_(t)?"."+t.styledComponentId:v(t)?"function"!=typeof(l=t)||l.prototype&&l.prototype.isReactComponent||!e?t:vt(t(e),e,n,i):t instanceof ut?n?(t.inject(n,i),t.getName(i)):t:p(t)?function t(e,n){var i,o,r=[];for(var s in e)e.hasOwnProperty(s)&&!gt(e[s])&&(Array.isArray(e[s])&&e[s].isCss||v(e[s])?r.push(mt(s)+":",e[s],";"):p(e[s])?r.push.apply(r,t(e[s],s)):r.push(mt(s)+": "+(i=s,(null==(o=e[s])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||i in c.a?String(o).trim():o+"px")+";")));return n?[n+" {"].concat(r,["}"]):r}(t):t.toString();var l}var yt=function(t){return Array.isArray(t)&&(t.isCss=!0),t};function _t(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return v(t)||p(t)?yt(vt(f(m,[t].concat(n)))):0===n.length&&1===t.length&&"string"==typeof t[0]?t:yt(vt(f(t,n)))}new Set;var bt=function(t,e,n){return void 0===n&&(n=g),t.theme!==n.theme&&t.theme||e||n.theme},wt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ct=/(^-|-$)/g;function St(t){return t.replace(wt,"-").replace(Ct,"")}var xt=function(t){return q(Y(t)>>>0)};function Et(t){return"string"==typeof t&&!0}var Pt=function(t){return"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)},kt=function(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t};function Dt(t,e,n){var i=t[n];Pt(e)&&Pt(i)?Ot(i,e):t[n]=e}function Ot(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];if(Pt(s))for(var a in s)kt(a)&&Dt(t,s[a],a)}return t}var Mt=o.default.createContext(),Tt=Mt.Consumer;function At(t){var e=Object(o.useContext)(Mt),n=Object(o.useMemo)((function(){return function(t,e){return t?v(t)?t(e):Array.isArray(t)||"object"!=typeof t?E(8):e?h({},e,{},t):t:E(14)}(t.theme,e)}),[t.theme,e]);return t.children?o.default.createElement(Mt.Provider,{value:n},t.children):null}var It={};function zt(t,e,n){var i=_(t),r=!Et(t),s=e.attrs,a=void 0===s?m:s,c=e.componentId,u=void 0===c?function(t,e){var n="string"!=typeof t?"sc":St(t);It[n]=(It[n]||0)+1;var i=n+"-"+xt("5.3.3"+n+It[n]);return e?e+"-"+i:i}(e.displayName,e.parentComponentId):c,f=e.displayName,p=void 0===f?function(t){return Et(t)?"styled."+t:"Styled("+y(t)+")"}(t):f,b=e.displayName&&e.componentId?St(e.displayName)+"-"+e.componentId:e.componentId||u,w=i&&t.attrs?Array.prototype.concat(t.attrs,a).filter(Boolean):a,C=e.shouldForwardProp;i&&t.shouldForwardProp&&(C=e.shouldForwardProp?function(n,i,o){return t.shouldForwardProp(n,i,o)&&e.shouldForwardProp(n,i,o)}:t.shouldForwardProp);var S,x=new K(n,b,i?t.componentStyle:void 0),E=x.isStatic&&0===a.length,P=function(t,e){return function(t,e,n,i){var r=t.attrs,s=t.componentStyle,a=t.defaultProps,c=t.foldedComponentIds,u=t.shouldForwardProp,d=t.styledComponentId,f=t.target,p=function(t,e,n){void 0===t&&(t=g);var i=h({},e,{theme:t}),o={};return n.forEach((function(t){var e,n,r,s=t;for(e in v(s)&&(s=s(i)),s)i[e]=o[e]="className"===e?(n=o[e],r=s[e],n&&r?n+" "+r:n||r):s[e]})),[i,o]}(bt(e,Object(o.useContext)(Mt),a)||g,e,r),m=p[0],y=p[1],_=function(t,e,n,i){var o=at(),r=ct();return e?t.generateAndInjectStyles(g,o,r):t.generateAndInjectStyles(n,o,r)}(s,i,m),b=n,w=y.$as||e.$as||y.as||e.as||f,C=Et(w),S=y!==e?h({},e,{},y):e,x={};for(var E in S)"$"!==E[0]&&"as"!==E&&("forwardedAs"===E?x.as=S[E]:(u?u(E,l.a,w):!C||Object(l.a)(E))&&(x[E]=S[E]));return e.style&&y.style!==e.style&&(x.style=h({},e.style,{},y.style)),x.className=Array.prototype.concat(c,d,_!==d?_:null,e.className,y.className).filter(Boolean).join(" "),x.ref=b,Object(o.createElement)(w,x)}(S,t,e,E)};return P.displayName=p,(S=o.default.forwardRef(P)).attrs=w,S.componentStyle=x,S.displayName=p,S.shouldForwardProp=C,S.foldedComponentIds=i?Array.prototype.concat(t.foldedComponentIds,t.styledComponentId):m,S.styledComponentId=b,S.target=i?t.target:t,S.withComponent=function(t){var i=e.componentId,o=function(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(o[n]=t[n]);return o}(e,["componentId"]),r=i&&i+"-"+(Et(t)?t:St(y(t)));return zt(t,h({},o,{attrs:w,componentId:r}),n)},Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?Ot({},t.defaultProps,e):e}}),S.toString=function(){return"."+S.styledComponentId},r&&d()(S,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),S}var Rt=function(t){return function t(e,n,o){if(void 0===o&&(o=g),!Object(i.isValidElementType)(n))return E(1,String(n));var r=function(){return e(n,o,_t.apply(void 0,arguments))};return r.withConfig=function(i){return t(e,n,h({},o,{},i))},r.attrs=function(i){return t(e,n,h({},o,{attrs:Array.prototype.concat(o.attrs,i).filter(Boolean)}))},r}(zt,t)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(t){Rt[t]=Rt(t)}));var Lt=function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=J(t),$.registerId(this.componentId+1)}var e=t.prototype;return e.createStyles=function(t,e,n,i){var o=i(vt(this.rules,e,n,i).join(""),""),r=this.componentId+t;n.insertRules(r,r,o)},e.removeStyles=function(t,e){e.clearRules(this.componentId+t)},e.renderStyles=function(t,e,n,i){t>2&&$.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,i)},t}();function Bt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=_t.apply(void 0,[t].concat(n)),s="sc-global-"+xt(JSON.stringify(r)),a=new Lt(r,s);function c(t){var e=at(),n=ct(),i=Object(o.useContext)(Mt),r=Object(o.useRef)(e.allocateGSInstance(s)).current;return e.server&&l(r,t,e,i,n),Object(o.useLayoutEffect)((function(){if(!e.server)return l(r,t,e,i,n),function(){return a.removeStyles(r,e)}}),[r,t,e,i,n]),null}function l(t,e,n,i,o){if(a.isStatic)a.renderStyles(t,x,n,o);else{var r=h({},e,{theme:bt(e,i,c.defaultProps)});a.renderStyles(t,r,n,o)}}return o.default.memo(c)}function jt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var o=_t.apply(void 0,[t].concat(n)).join(""),r=xt(o);return new ut(r,o)}var Ft=function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var n=B();return"<style "+[n&&'nonce="'+n+'"',b+'="true"','data-styled-version="5.3.3"'].filter(Boolean).join(" ")+">"+e+"</style>"},this.getStyleTags=function(){return t.sealed?E(2):t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)return E(2);var n=((e={})[b]="",e["data-styled-version"]="5.3.3",e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),i=B();return i&&(n.nonce=i),[o.default.createElement("style",h({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new $({isServer:!0}),this.sealed=!1}var e=t.prototype;return e.collectStyles=function(t){return this.sealed?E(2):o.default.createElement(lt,{sheet:this.instance},t)},e.interleaveWithNodeStream=function(t){return E(3)},t}(),Nt=function(t){var e=o.default.forwardRef((function(e,n){var i=Object(o.useContext)(Mt),r=t.defaultProps,s=bt(e,i,r);return o.default.createElement(t,h({},e,{theme:s,ref:n}))}));return d()(e,t),e.displayName="WithTheme("+y(t)+")",e},Ut=function(){return Object(o.useContext)(Mt)},Vt={StyleSheet:$,masterSheet:rt};e.default=Rt}.call(this,n(68))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i{}e.default=i,i.ScanbotPrimary="#c8193c",i.Orange="#FF5533",i.White="#FFFFFF",i.TransparentGreen="rgba(0, 255, 0, 0.5)",i.TransparentGray="rgba(50, 50, 50, 0.5)"},function(t,e,n){"use strict";var i=n(13),o=n.n(i)()((function(t){return t[1]}));o.push([t.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 12px;\n transform: translate(-50%, -100%);\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),e.a=o},function(t,e,n){"use strict";var i=n(13),o=n.n(i)()((function(t){return t[1]}));o.push([t.i,"\n.scanbot-document-outline {\n stroke: yellow;\n stroke-width: 2px;\n fill: none;\n}\n\n.scanbot-document-outline-ok {\n stroke: green;\n}\n\n.scanbot-document-outline-visible {\n opacity: 1;\n transition: opacity .3s ease-in-out;\n}\n\n.scanbot-document-outline-hidden {\n opacity: 0;\n transition: opacity .3s ease-in-out;\n}\n\n.scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),e.a=o},function(t,e,n){"use strict";t.exports=n(69)},function(t,e,n){"use strict";var i=n(70),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(t){return i.isMemo(t)?s:a[t.$$typeof]||o}a[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[i.Memo]=s;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,i){if("string"!=typeof n){if(p){var o=f(n);o&&o!==p&&t(e,o,i)}var s=u(n);d&&(s=s.concat(d(n)));for(var a=c(e),m=c(n),g=0;g<s.length;++g){var v=s[g];if(!(r[v]||i&&i[v]||m&&m[v]||a&&a[v])){var y=h(n,v);try{l(e,v,y)}catch(t){}}}}return e}},function(t,e,n){"use strict";var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.a=o},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0;i(n(39));var o="2.13.1";class r{}e.Constants=r,r.VERSION=o,r.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@2.13.1/bundle/",r.DEFAULT_WASM_FOLDER="bin/complete/"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentScannerConfiguration=e.TextConfiguration=void 0;const i=n(7),o={OK:"Capturing your document... Please do not move the camera.",OK_SmallSize:"The document is too small. Try moving closer.",OK_BadAngles:"This is a bad camera angle. Hold the device straight over the document.",OK_BadAspectRatio:"Rotate the device sideways, so that the document fits better into the screen.",OK_OffCenter:"Try holding the device at the center of the document.",Error_NothingDetected:"Please hold the device over a document to start scanning.",Error_Brightness:"It is too dark. Try turning on a light.",Error_Noise:"Please move the document to a clear surface."};class r{constructor(t){this.hint=t}}e.TextConfiguration=r;class s{constructor(){this.outline=new a,this.captureButton=new u}}class a{constructor(){this.polygon=new c,this.label=new l}}class c{}class l{}class u{constructor(){this.color="#FFF"}}class d extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_4K),this.acceptedAngleScore=d.DEFAULT_ACCEPTED_ANGLE_SCORE,this.acceptedSizeScore=d.DEFAULT_ACCEPTED_SIZE_SCORE,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.ignoreBadAspectRatio=!0,this.text=new r(o),this.style=new s,this.onDocumentDetected=function(t){}}static fromJson(t){const e=new d;if(this.mapValues(t,e,["text","style","videoConstraints"]),t.text&&t.text.hint&&this.mapValues(t.text.hint,e.text.hint),t.style){this.mapValues(t.style,e.style,["outline","captureButton"]);const n=t.style.outline;if(n){this.mapValues(n,e.style.outline,["polygon","label"]);const t=n.polygon;t&&this.mapValues(t,e.style.outline.polygon);const i=n.label;i&&this.mapValues(i,e.style.outline.label)}const i=t.style.captureButton;i&&this.mapValues(i,e.style.captureButton)}return this.mapVideoConstraints(t,e),e}}e.DocumentScannerConfiguration=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseConfiguration=void 0;e.BaseConfiguration=class{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((i=>{(null==n?void 0:n.includes(i))||(e[i]=t[i])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(3),o=n(8);e.default=class{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=o.Utils.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});i.ImageUtils.saveBlob(n,e)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let t=this.findFlashElement();t.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{t.style.opacity="1.0",t.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(t,e){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=t,e()}),150)}getOrCreateElement(t,e){let n=this.getElementByClassName(t);return n||(this.createElement(t,e),n=this.getElementByClassName(t)),n}createElement(t,e){let n=document.createElement("div");n.className=t,n.style.cssText=this.cssToString(e),document.body.append(n)}cssToString(t){let e="";return Object.keys(t).forEach((n=>{e+=n+":"+t[n]+";"})),e}getElementByClassName(t){const e=document.getElementsByClassName(t);if(0!==e.length)return e[0]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaError=void 0;class i extends Error{constructor(t,e){super(e),this.name="UnknownError",this.name=t}static notAvailable(t){return new i("MediaNotAvailableError",t)}static permissionError(t){return new i("MediaPermissionError",t)}static unsupportedMediaDevices(t){return new i("UnsupportedMediaDevicesError",t)}static unsupportedOperationError(t){return new i("UnsupportedOperationError",t)}static unknownError(t){return new i("UnknownError",t)}}e.MediaError=i},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ShutterButton=e.ShutterButtonProps=void 0;const o=i(n(0));n(55);const r=i(n(15));e.ShutterButtonProps=class{};class s{constructor(t){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=t}setDuration(t){const e=Date.now()/1e3,n=e-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const i=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${i}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class a extends o.default.Component{constructor(){super(...arguments),this.inner1=new s("scanbot-shutter-rotate"),this.inner2=new s("scanbot-shutter-rotate")}render(){return o.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(t){"searching"==t?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,o.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==t||"manual"==t,"scanbot-shutter-fade-out":"searching"==t||"capturing"==t,"scanbot-shutter-pulse-fast":"processing"==t},o.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},o.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},o.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(t=>{this.inner1.element=t}))}captureSearchingInner2(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},o.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(t=>{this.inner2.element=t}))}path(t){return o.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return o.default.createElement("div",{className:(0,r.default)(t),ref:n},o.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}e.ShutterButton=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=void 0;e.MathUtils=class{static isConvex(t){if(t.length<4)return!0;let e=!1,n=t.length;for(let i=0;i<n;i++){const o=t[(i+2)%n].x-t[(i+1)%n].x,r=t[(i+2)%n].y-t[(i+1)%n].y,s=t[i].x-t[(i+1)%n].x,a=o*(t[i].y-t[(i+1)%n].y)-r*s;if(0==i)e=a>0;else if(e!=a>0)return!1}return!0}static distanceBetweenPoints(t,e){return Math.pow(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),.5)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeOverlay=void 0;e.BarcodeOverlay=class{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DraggableBaseContainer=void 0;const o=i(n(0));class r extends o.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var t,e;return(null===(t=this.props.style)||void 0===t?void 0:t.size)?(null===(e=this.props)||void 0===e?void 0:e.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var t,e;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(t=this.props.style)||void 0===t?void 0:t.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(e=this.props.style)||void 0===e?void 0:e.color,position:"absolute",cursor:"pointer",zIndex:500}}nextIndex(t){return(t+1)%this.POINT_COUNT}previousIndex(t){return(t-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(t){return t%2==0}isOutOfBounds(t,e){return t<-this.DRAG_BUFFER||t>e+this.DRAG_BUFFER}}e.DraggableBaseContainer=r},function(t,e){t.exports=function(t,e,n,i){var o=n?n.call(i,t,e):void 0;if(void 0!==o)return!!o;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),c=0;c<r.length;c++){var l=r[c];if(!a(l))return!1;var u=t[l],d=e[l];if(!1===(o=n?n.call(i,u,d,l):void 0)||void 0===o&&u!==d)return!1}return!0}},function(t,e,n){"use strict";e.a=function(t){function e(t,i,c,l,h){for(var f,p,m,g,b,C=0,S=0,x=0,E=0,P=0,A=0,z=m=f=0,L=0,B=0,j=0,F=0,N=c.length,U=N-1,V="",W="",$="",H="";L<N;){if(p=c.charCodeAt(L),L===U&&0!==S+E+x+C&&(0!==S&&(p=47===S?10:47),E=x=C=0,N++,U++),0===S+E+x+C){if(L===U&&(0<B&&(V=V.replace(d,"")),0<V.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:V+=c.charAt(L)}p=59}switch(p){case 123:for(f=(V=V.trim()).charCodeAt(0),m=1,F=++L;L<N;){switch(p=c.charCodeAt(L)){case 123:m++;break;case 125:m--;break;case 47:switch(p=c.charCodeAt(L+1)){case 42:case 47:t:{for(z=L+1;z<U;++z)switch(c.charCodeAt(z)){case 47:if(42===p&&42===c.charCodeAt(z-1)&&L+2!==z){L=z+1;break t}break;case 10:if(47===p){L=z+1;break t}}L=z}}break;case 91:p++;case 40:p++;case 34:case 39:for(;L++<U&&c.charCodeAt(L)!==p;);}if(0===m)break;L++}if(m=c.substring(F,L),0===f&&(f=(V=V.replace(u,"").trim()).charCodeAt(0)),64===f){switch(0<B&&(V=V.replace(d,"")),p=V.charCodeAt(1)){case 100:case 109:case 115:case 45:B=i;break;default:B=T}if(F=(m=e(i,B,m,p,h+1)).length,0<I&&(b=a(3,m,B=n(T,V,j),i,D,k,F,p,h,l),V=B.join(""),void 0!==b&&0===(F=(m=b.trim()).length)&&(p=0,m="")),0<F)switch(p){case 115:V=V.replace(w,s);case 100:case 109:case 45:m=V+"{"+m+"}";break;case 107:m=(V=V.replace(v,"$1 $2"))+"{"+m+"}",m=1===M||2===M&&r("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=V+m,112===l&&(W+=m,m="")}else m=""}else m=e(i,n(i,V,j),m,l,h+1);$+=m,m=j=B=z=f=0,V="",p=c.charCodeAt(++L);break;case 125:case 59:if(1<(F=(V=(0<B?V.replace(d,""):V).trim()).length))switch(0===z&&(f=V.charCodeAt(0),45===f||96<f&&123>f)&&(F=(V=V.replace(" ",":")).length),0<I&&void 0!==(b=a(1,V,i,t,D,k,W.length,l,h,l))&&0===(F=(V=b.trim()).length)&&(V="\0\0"),f=V.charCodeAt(0),p=V.charCodeAt(1),f){case 0:break;case 64:if(105===p||99===p){H+=V+c.charAt(L);break}default:58!==V.charCodeAt(F-1)&&(W+=o(V,f,p,V.charCodeAt(2)))}j=B=z=f=0,V="",p=c.charCodeAt(++L)}}switch(p){case 13:case 10:47===S?S=0:0===1+f&&107!==l&&0<V.length&&(B=1,V+="\0"),0<I*R&&a(0,V,i,t,D,k,W.length,l,h,l),k=1,D++;break;case 59:case 125:if(0===S+E+x+C){k++;break}default:switch(k++,g=c.charAt(L),p){case 9:case 32:if(0===E+C+S)switch(P){case 44:case 58:case 9:case 32:g="";break;default:32!==p&&(g=" ")}break;case 0:g="\\0";break;case 12:g="\\f";break;case 11:g="\\v";break;case 38:0===E+S+C&&(B=j=1,g="\f"+g);break;case 108:if(0===E+S+C+O&&0<z)switch(L-z){case 2:112===P&&58===c.charCodeAt(L-3)&&(O=P);case 8:111===A&&(O=A)}break;case 58:0===E+S+C&&(z=L);break;case 44:0===S+x+E+C&&(B=1,g+="\r");break;case 34:case 39:0===S&&(E=E===p?0:0===E?p:E);break;case 91:0===E+S+x&&C++;break;case 93:0===E+S+x&&C--;break;case 41:0===E+S+C&&x--;break;case 40:if(0===E+S+C){if(0===f)if(2*P+3*A==533);else f=1;x++}break;case 64:0===S+x+E+C+z+m&&(m=1);break;case 42:case 47:if(!(0<E+C+x))switch(S){case 0:switch(2*p+3*c.charCodeAt(L+1)){case 235:S=47;break;case 220:F=L,S=42}break;case 42:47===p&&42===P&&F+2!==L&&(33===c.charCodeAt(F+2)&&(W+=c.substring(F,L+1)),g="",S=0)}}0===S&&(V+=g)}A=P,P=p,L++}if(0<(F=W.length)){if(B=i,0<I&&(void 0!==(b=a(2,W,B,t,D,k,F,l,h,l))&&0===(W=b).length))return H+W+$;if(W=B.join(",")+"{"+W+"}",0!=M*O){switch(2!==M||r(W,2)||(O=0),O){case 111:W=W.replace(_,":-moz-$1")+W;break;case 112:W=W.replace(y,"::-webkit-input-$1")+W.replace(y,"::-moz-$1")+W.replace(y,":-ms-input-$1")+W}O=0}}return H+W+$}function n(t,e,n){var o=e.trim().split(m);e=o;var r=o.length,s=t.length;switch(s){case 0:case 1:var a=0;for(t=0===s?"":t[0]+" ";a<r;++a)e[a]=i(t,e[a],n).trim();break;default:var c=a=0;for(e=[];a<r;++a)for(var l=0;l<s;++l)e[c++]=i(t[l]+" ",o[a],n).trim()}return e}function i(t,e,n){var i=e.charCodeAt(0);switch(33>i&&(i=(e=e.trim()).charCodeAt(0)),i){case 38:return e.replace(g,"$1"+t.trim());case 58:return t.trim()+e.replace(g,"$1"+t.trim());default:if(0<1*n&&0<e.indexOf("\f"))return e.replace(g,(58===t.charCodeAt(0)?"":"$1")+t.trim())}return t+e}function o(t,e,n,i){var s=t+";",a=2*e+3*n+4*i;if(944===a){t=s.indexOf(":",9)+1;var c=s.substring(t,s.length-1).trim();return c=s.substring(0,t).trim()+c+";",1===M||2===M&&r(c,1)?"-webkit-"+c+c:c}if(0===M||2===M&&!r(s,1))return s;switch(a){case 1015:return 97===s.charCodeAt(10)?"-webkit-"+s+s:s;case 951:return 116===s.charCodeAt(3)?"-webkit-"+s+s:s;case 963:return 110===s.charCodeAt(5)?"-webkit-"+s+s:s;case 1009:if(100!==s.charCodeAt(4))break;case 969:case 942:return"-webkit-"+s+s;case 978:return"-webkit-"+s+"-moz-"+s+s;case 1019:case 983:return"-webkit-"+s+"-moz-"+s+"-ms-"+s+s;case 883:if(45===s.charCodeAt(8))return"-webkit-"+s+s;if(0<s.indexOf("image-set(",11))return s.replace(P,"$1-webkit-$2")+s;break;case 932:if(45===s.charCodeAt(4))switch(s.charCodeAt(5)){case 103:return"-webkit-box-"+s.replace("-grow","")+"-webkit-"+s+"-ms-"+s.replace("grow","positive")+s;case 115:return"-webkit-"+s+"-ms-"+s.replace("shrink","negative")+s;case 98:return"-webkit-"+s+"-ms-"+s.replace("basis","preferred-size")+s}return"-webkit-"+s+"-ms-"+s+s;case 964:return"-webkit-"+s+"-ms-flex-"+s+s;case 1023:if(99!==s.charCodeAt(8))break;return"-webkit-box-pack"+(c=s.substring(s.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+s+"-ms-flex-pack"+c+s;case 1005:return f.test(s)?s.replace(h,":-webkit-")+s.replace(h,":-moz-")+s:s;case 1e3:switch(e=(c=s.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(e)){case 226:c=s.replace(b,"tb");break;case 232:c=s.replace(b,"tb-rl");break;case 220:c=s.replace(b,"lr");break;default:return s}return"-webkit-"+s+"-ms-"+c+s;case 1017:if(-1===s.indexOf("sticky",9))break;case 975:switch(e=(s=t).length-10,a=(c=(33===s.charCodeAt(e)?s.substring(0,e):s).substring(t.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:s=s.replace(c,"-webkit-"+c)+";"+s;break;case 207:case 102:s=s.replace(c,"-webkit-"+(102<a?"inline-":"")+"box")+";"+s.replace(c,"-webkit-"+c)+";"+s.replace(c,"-ms-"+c+"box")+";"+s}return s+";";case 938:if(45===s.charCodeAt(5))switch(s.charCodeAt(6)){case 105:return c=s.replace("-items",""),"-webkit-"+s+"-webkit-box-"+c+"-ms-flex-"+c+s;case 115:return"-webkit-"+s+"-ms-flex-item-"+s.replace(S,"")+s;default:return"-webkit-"+s+"-ms-flex-line-pack"+s.replace("align-content","").replace(S,"")+s}break;case 973:case 989:if(45!==s.charCodeAt(3)||122===s.charCodeAt(4))break;case 931:case 953:if(!0===E.test(t))return 115===(c=t.substring(t.indexOf(":")+1)).charCodeAt(0)?o(t.replace("stretch","fill-available"),e,n,i).replace(":fill-available",":stretch"):s.replace(c,"-webkit-"+c)+s.replace(c,"-moz-"+c.replace("fill-",""))+s;break;case 962:if(s="-webkit-"+s+(102===s.charCodeAt(5)?"-ms-"+s:"")+s,211===n+i&&105===s.charCodeAt(13)&&0<s.indexOf("transform",10))return s.substring(0,s.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+s}return s}function r(t,e){var n=t.indexOf(1===e?":":"{"),i=t.substring(0,3!==e?n:10);return n=t.substring(n+1,t.length-1),z(2!==e?i:i.replace(x,"$1"),n,e)}function s(t,e){var n=o(e,e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2));return n!==e+";"?n.replace(C," or ($1)").substring(4):"("+e+")"}function a(t,e,n,i,o,r,s,a,c,u){for(var d,h=0,f=e;h<I;++h)switch(d=A[h].call(l,t,f,n,i,o,r,s,a,c,u)){case void 0:case!1:case!0:case null:break;default:f=d}if(f!==e)return f}function c(t){return void 0!==(t=t.prefix)&&(z=null,t?"function"!=typeof t?M=1:(M=2,z=t):M=0),c}function l(t,n){var i=t;if(33>i.charCodeAt(0)&&(i=i.trim()),i=[i],0<I){var o=a(-1,n,i,i,D,k,0,0,0,0);void 0!==o&&"string"==typeof o&&(n=o)}var r=e(T,i,n,0,0);return 0<I&&(void 0!==(o=a(-2,r,i,i,D,k,r.length,0,0,0))&&(r=o)),"",O=0,k=D=1,r}var u=/^\0+/g,d=/[\0\r\f]/g,h=/: */g,f=/zoo|gra/,p=/([,: ])(transform)/g,m=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,_=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,S=/-self|flex-/g,x=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,k=1,D=1,O=0,M=1,T=[],A=[],I=0,z=null,R=0;return l.use=function t(e){switch(e){case void 0:case null:I=A.length=0;break;default:if("function"==typeof e)A[I++]=e;else if("object"==typeof e)for(var n=0,i=e.length;n<i;++n)t(e[n]);else R=0|!!e}return t},l.set=c,void 0!==t&&c(t),l}},function(t,e,n){"use strict";e.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ScanbotSDK=void 0;const o=i(n(6));e.ScanbotSDK=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;const i=n(25),o=n(40);class r{constructor(t){let e;if(t||(t=i.Constants.CDN_PATH+i.Constants.DEFAULT_WASM_FOLDER),function(t){return-1!==t.indexOf("http")}(t+=r.ASM_JS)){const n=new Blob([`importScripts("${t}")`]);e=new Worker(URL.createObjectURL(n))}else e=new Worker(t);this.core=new o.WorkerBridge(e)}postByCopyingArgs(t,e){return this.core.postByCopyingArgs(t,e)}postByTransferringArgs(t,e){return this.core.postByTransferringArgs(t,e)}}e.WorkerBridge=r,r.ASM_JS="ScanbotSDK.Core.js"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=""},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;var i=n(41);e.WorkerBridge=class{constructor(t){this.instance=t,this.continuations={},t.onmessage=t=>{const{ticket:e,result:n,error:i}=t.data,{resolve:o,reject:r}=this.continuations[e];delete this.continuations[e],i?r(i):o(n)}}post(t,e,n){return new Promise(((o,r)=>{const s=(0,i.gatherTransferables)(e,n),a=Math.random().toString(36);this.continuations[a]={resolve:o,reject:r},this.instance.postMessage({command:t,args:e,ticket:a},s)}))}postByCopyingArgs(t,e){return this.post(t,e,!0)}postByTransferringArgs(t,e){return this.post(t,e,!1)}destroy(){this.instance.terminate()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gatherTransferables=function(t,e){const n=[];return function t(i){if(!i)return;if(i.constructor===ImageData){const t={data:i.data.slice(),width:i.width,height:i.height};return n.push(t.data.buffer),t}if(i.constructor===ArrayBuffer){const t=e?i.slice(0):i;if(n.push(t),e)return i}else if(ArrayBuffer.isView(i)){let t;if(e){t=new(0,i.constructor)(i.buffer.slice(0))}else t=i;if(n.push(t.buffer),e)return i}else if(Array.isArray(i))for(let e=0;e<i.length;++e){const n=t(i[e]);n&&(i[e]=n)}else if(i.constructor===Object)for(const e in i)if(i.hasOwnProperty(e)){const n=t(i[e]);n&&(i[e]=n)}}(t),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LicenseInfo=void 0;class i{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new i;return e.status=t.licenseStatus,e.description=t.description,e}}e.LicenseInfo=i},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByCopyingArgs("addPageToPdf",[this._pdfOperation,t])}))}complete(){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completePdf",[this._pdfOperation])}))}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByCopyingArgs("addPageToTiff",[this._tiffOperation,t])}))}complete(){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completeTiff",[this._tiffOperation])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Barcode=void 0;const i=n(1);class o{constructor(t,e,n,i,o,r){this.format=t,this.text=e,this.parsedText=n,this.rawBytes=i,this.points=o,this.barcodeImage=r}equals(t){return this.format===t.format&&this.text===t.text}static fromWorker(t){let e;if(""!==t.parsedText)try{e=JSON.parse(t.parsedText)}catch(t){}const n=t.quad.map((t=>new i.Point(t[0],t[1])));return new o(t.format,t.text,e,t.rawBytes,n,t.barcodeImage)}}e.Barcode=o},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(47);e.default=class{constructor(t,e){this._sdk=t,this._mrzRecognizerToken=e}recognize(t){return i(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeMRZ",[this._mrzRecognizerToken,t]);if(null===e)return;return o.MrzResult.fromWorker(e)}catch(t){return void console.warn(t)}}))}recognizeURL(t){return i(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);r&&e(r)}))}))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._mrzRecognizerToken])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MrzResult=e.MrzCheckDigits=e.MrzField=void 0;class i{constructor(t,e,n,i){this.value=e,this.confidence=n,this.validated=i,this.name=t}}e.MrzField=i;class o{}e.MrzCheckDigits=o;class r{static fromWorker(t){let e=new r;const n=new o,s=t.recognitionSuccessful;return(t.fields||[]).forEach((t=>{switch(t.name){case"DocumentNumber":e.documentNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"IssuingAuthority":e.issuingAuthority=new i(t.name,t.text,t.confidence,t.validated);break;case"DepartmentOfIssuance":e.departmentOfIssuance=new i(t.name,t.text,t.confidence,t.validated);break;case"GivenNames":e.givenNames=new i(t.name,t.text,t.confidence,t.validated);break;case"Surname":e.surname=new i(t.name,t.text,t.confidence,t.validated);break;case"Nationality":e.nationality=new i(t.name,t.text,t.confidence,t.validated);break;case"BirthDate":e.birthDate=new i(t.name,t.text,t.confidence,t.validated);break;case"Gender":e.gender=new i(t.name,t.text,t.confidence,t.validated);break;case"ExpiryDate":e.expiryDate=new i(t.name,t.text,t.confidence,t.validated);break;case"PersonalNumber":e.personalNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"TravelDocType":e.travelDocType=new i(t.name,t.text,t.confidence,t.validated);break;case"TravelDocTypeVariant":e.travelDocTypeVariant=new i(t.name,t.text,t.confidence,t.validated);break;case"DiscreetIssuingStateOrOrganization":e.discreetIssuingStateOrOrganization=new i(t.name,t.text,t.confidence,t.validated);break;case"DocumentTypeCode":e.kindOfDocumentField=new i(t.name,t.text,t.confidence,t.validated);break;case"DocumentType":e.documentType=new i(t.name,t.text,t.confidence,t.validated);break;case"Format":e.format=new i(t.name,t.text,t.confidence,t.validated);break;case"PINCode":e.pinCode=new i(t.name,t.text,t.confidence,t.validated);break;case"LanguageCode":e.languageCode=new i(t.name,t.text,t.confidence,t.validated);break;case"VersionNumber":e.versionNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitGeneral":n.general=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitDocumentNumber":n.documentNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitBirthDate":n.birthDate=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitExpiryDate":n.expiryDate=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitPersonalNumber":n.personalNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"Optional1":e.optional1=new i(t.name,t.text,t.confidence,t.validated);break;case"Optional2":e.optional2=new i(t.name,t.text,t.confidence,t.validated)}})),e.documentType||(e.documentType=new i("DocumentType",t.documentType)),s?e.checkDigits=n:e=void 0,e}}e.MrzResult=r},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("performOcr",[this._OcrEngineToken,t])}))}recognizeURL(t){return i(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._OcrEngineToken])}))}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(3);e.default=class{constructor(t,e){this._sdk=t,this._token=e}estimateBlurriness(t){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("estimateBlurriness",[this._token,t])}))}estimateBlurrinessOnBuffer(t){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("estimateBlurrinessOnBuffer",[this._token,t.slice(0)])}))}estimateBlurrinessURL(t){return i(this,void 0,void 0,(function*(){return yield this.estimateBlurriness(yield o.ImageUtils.loadFromUrl(t))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._token])}))}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(51);e.default=class{constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t){return i(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeTextLine",[this._textDataScannerToken,t]);if(null===e)return;return o.TextDataScannerResult.fromWorker(e)}catch(t){return void console.warn(t)}}))}cleanRecognitionQueue(){return i(this,void 0,void 0,(function*(){try{yield this._sdk.bridge.postByTransferringArgs("cleanTextLineRecognitionQueue",[this._textDataScannerToken])}catch(t){return void console.warn(t)}}))}recognizeURL(t){return i(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);r&&e(r)}))}))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._textDataScannerToken])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDataScannerResult=void 0;class i{static fromWorker(t){if(!t)return;const e=new i;return e.text=t.rawText,e.confidence=t.confidence,e.validated=t.validationSuccessful,e}}e.TextDataScannerResult=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LicenseError=void 0;class i extends Error{constructor(t){super(t.description),this.name="LicenseError"}}e.LicenseError=i},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=o(n(0)),s=n(0),a=o(n(6)),c=n(26),l=n(5),u=n(2),d=n(1),h=n(9),f=n(30),p=n(56),m=o(n(11)),g=n(8),v=n(60);h.ScanbotCameraState;h.ScanbotCameraProps;class y extends h.ScannerView{constructor(t){if(super(t),this.defaultCaptureButtonClick=()=>i(this,void 0,void 0,(function*(){const t=yield this.detectAndCrop();this.configuration.onDocumentDetected(t)})),this.state={action:this.defaultAction},!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!a.default.instance)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return("searching"==this.state.action||"capturing"==this.state.action||"manual"==this.state.action)&&!this.disposed}get configuration(){return this._configuration||(this._configuration=c.DocumentScannerConfiguration.fromJson(this.props.configuration)),this._configuration}static create(t){return i(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,i)=>{(0,s.render)(r.default.createElement(y,{container:e,configuration:t,onSuccess:n,onFailure:i}),e)}))}))}detectAndCrop(){return i(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"});const t=this.camera.createImageData(y.DETECT_AND_CROP_RESOLUTION);if(!t)return;const e=new u.Size(t.width,t.height),n=yield this.bridge.postByTransferringArgs("detectAndCropDocument",[t]);return n.videoSize=e,n}}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(t){this._configuration?this._configuration.autoCaptureEnabled=t:this.props.configuration.autoCaptureEnabled=t,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){super.componentDidMount(),this.detect()}componentWillUnmount(){super.componentWillUnmount(),this.handleAutoCapture(!1)}detect(){var t,e;return i(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const t=yield this.detectInWebWorker();if(!t||!this.enabled)return;if(!this.outline)return;const e=this.getStatusString(t),n="OK"===e;let i=this.scalePolygonPointsToPixels(t.polygon);this.outline.update(n,i,g.Utils.getProperty(this.configuration.text.hint,e)),yield this.handleAutoCapture(n,i)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(t){return this.configuration.ignoreBadAspectRatio&&"OK_BadAspectRatio"===t.detectionStatus?"OK":t.detectionStatus}detectInWebWorker(){return i(this,void 0,void 0,(function*(){const t=this.camera.createImageData(h.ScannerView.DEFAULT_DETECTION_RESOLUTION);if(!t||!this.enabled)return;const e=[t,this.configuration.acceptedAngleScore,this.configuration.acceptedSizeScore];return yield this.bridge.postByTransferringArgs("detectDocument",e)}))}handleAutoCapture(t,e){return i(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled)if(t&&!this.autoCaptureToken&&e){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const t=this.getCameraFrameSize();this.polygonMovementPredicate=new v.PolygonMovementPredicate(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);const t=3e3*(1-this.configuration.autoCaptureSensitivity);this.autoCaptureToken=setTimeout((()=>i(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const t=yield this.detectAndCrop();if(t.polygon){const e=this.scalePolygonPointsToPixels(t.polygon);if(this.runMovementPredicate(e))return}t.success&&this.configuration.onDocumentDetected&&this.configuration.onDocumentDetected(t)}))),t)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e,n,i,o;const{action:s}=this.state,{configuration:a}=this,c=null===(t=a.style)||void 0===t?void 0:t.captureButton;return r.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},r.default.createElement(m.default,{videoConstraints:a.videoConstraints,mirrored:a.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),r.default.createElement(p.DocumentOutline,{style:{polygon:null===(n=null===(e=a.style)||void 0===e?void 0:e.outline)||void 0===n?void 0:n.polygon,label:null===(o=null===(i=a.style)||void 0===i?void 0:i.outline)||void 0===o?void 0:o.label},showLabel:"searching"==s||"capturing"==s,visible:"processing"!=s,ref:t=>{this.outline=t}}),r.default.createElement(f.ShutterButton,{color:(null==c?void 0:c.color)?c.color:"FFF",action:s,onClick:this.enabled?a.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=u.Size.fromHtmlElement(this.camera.video),i=l.ViewUtils.findScale(n,e);t=(t=l.ViewUtils.convertToViewportPointsFromParentSize(e,t)).map((t=>d.Point.scaleToPoint(t,i.x,i.y,i.scale)))}return t}runMovementPredicate(t){const e=this.polygonMovementPredicate.check(t);return this.polygonMovementPredicate.update(t),e}getCameraFrameSize(){return this.camera.calculateFrameSize(h.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}e.default=y,y.DETECT_AND_CROP_RESOLUTION=0},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MagneticLine=void 0;const i=n(1);class o{constructor(t,e){this.p1=t,this.p2=e}static scaleToLine(t,e,n,r){const s=new i.Point(r*(t.p1.x-e),r*(t.p1.y-n)),a=new i.Point(r*(t.p2.x-e),r*(t.p2.y-n));return new o(s,a)}}e.MagneticLine=o},function(t,e,n){"use strict";n.r(e);var i=n(12),o=n.n(i),r=n(20),s={insert:"head",singleton:!1};o()(r.a,s);e.default=r.a.locals||{}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentOutline=void 0;const o=i(n(0)),r=i(n(15));n(57);const s=n(10),a=n(58);class c extends o.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:t,text:e,validPoints:n}=this.state,i=this.props.visible&&n,c=(0,r.default)({[s.DocumentPolygon.CLASSNAME]:!0,[`${s.DocumentPolygon.CLASSNAME}-visible`]:i,[`${s.DocumentPolygon.CLASSNAME}-hidden`]:!i,[`${s.DocumentPolygon.CLASSNAME}-ok`]:t}),l=(0,r.default)({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},o.default.createElement(a.AnimatedDocumentPolygon,{style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,polygonClasses:c,ref:t=>{this.polygon=t}}),this.props.showLabel&&o.default.createElement("label",{style:this.props.style.label,className:l,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){e&&(this.polygon.overlayPolygonCurrent||(this.polygon.overlayPolygonCurrent=e),this.polygon.overlayPolygonTarget||requestAnimationFrame(this.polygon.animate.bind(this.polygon)),this.polygon.overlayPolygonTarget=e),this.setState({ok:t,text:n,validPoints:!!e})}}e.DocumentOutline=c},function(t,e,n){"use strict";n.r(e);var i=n(12),o=n.n(i),r=n(21),s={insert:"head",singleton:!1};o()(r.a,s);e.default=r.a.locals||{}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.AnimatedDocumentPolygon=void 0;const o=n(10),r=i(n(0)),s=n(2);class a extends r.default.Component{constructor(t){super(t),this.PULL_FORCE=4,this.MIN_SPEED=100,this.state={points:[]}}animate(t){if(!this.overlayPolygonTarget)return;let e=0;for(let n=0;n<4;++n){const i=this.overlayPolygonCurrent[n],o=this.overlayPolygonTarget[n],r=this.calculateOffset(t,i,o,"x"),s=this.calculateOffset(t,i,o,"y");i.x+=r,i.y+=s,e+=Math.abs(r),e+=Math.abs(s)}this.polygon&&this.setState({points:this.overlayPolygonCurrent}),e<1&&null!==this.animationLastTime?(this.overlayPolygonTarget=null,this.animationLastTime=null):(this.animationLastTime=t,requestAnimationFrame(this.animate.bind(this)))}calculateOffset(t,e,n,i){const o=(this.animationLastTime?t-this.animationLastTime:0)/1e3;return this.absMin(this.absMax(this.MIN_SPEED*Math.sign(n[i]-e[i])*o,(n[i]-e[i])*this.PULL_FORCE*o),n[i]-e[i])}absMin(t,e){return Math.abs(t)<Math.abs(e)?t:e}absMax(t,e){return Math.abs(t)>Math.abs(e)?t:e}render(){return r.default.createElement("div",{style:this.props.style,ref:t=>this.container=t},r.default.createElement(o.DocumentPolygon,{points:this.state.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:t=>this.polygon=t,size:s.Size.fromHtmlElement(this.container)}))}}e.AnimatedDocumentPolygon=a},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=o(n(0)),s=n(29);class a extends r.default.Component{constructor(t){super(t),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){return i(this,void 0,void 0,(function*(){const e=this.props.preferredCamera;if(e)try{const n=(yield navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===e||t.label===e));if(n)return Object.assign(Object.assign({},t),{deviceId:n.deviceId});console.error(`Device: ${e} is not found`)}catch(t){throw s.MediaError.unsupportedOperationError()}return t}))}componentDidMount(){return i(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationChanged.bind(this)),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,r,a;return i(this,void 0,void 0,(function*(){const i={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const n=s.MediaError.unsupportedMediaDevices("UnsupportedError: navigator.mediaDevices is undefined");return null===(e=(t=this.props).onError)||void 0===e||e.call(t,n),void console.log(n)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(i);this.setState({stream:t},(()=>{var e,n,i,o;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(o=(i=this.props).onReady)||void 0===o||o.call(i)}))}catch(t){const e=s.MediaError.unsupportedMediaDevices("UnsupportedError: navigator.mediaDevices.getUserMedia is undefined");return null===(o=(n=this.props).onError)||void 0===o||o.call(n,e),void console.error(e)}}catch(t){let e=s.MediaError.unknownError(t.message);return t instanceof DOMException&&("NotAllowedError"===t.name?e=s.MediaError.permissionError(t.message):"NotFoundError"===t.name&&(e=s.MediaError.notAvailable(t.message))),null===(a=(r=this.props).onError)||void 0===a||a.call(r,e),void console.error(e)}}))}stopCurrentStreams(){return i(this,void 0,void 0,(function*(){const t=this.state.stream,e=null==t?void 0:t.getTracks();e&&e.forEach((t=>{t.stop()}))}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationChanged.bind(this)),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((t=>t.stop())),this.state.stream.getAudioTracks().forEach((t=>t.stop()))),this.setState({stream:void 0}))}updateTorch(t){return i(this,void 0,void 0,(function*(){const e=[{torch:t}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:e})}))}getCapabilities(){if(this.state.stream.getVideoTracks){var t=this.state.stream.getVideoTracks();if(t.length>0)return t[0].getCapabilities()}}}e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonMovementPredicate=void 0;const i=n(1),o=n(31);class r{constructor(t,e=r.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(t),this.sensitivity=e}check(t){let e=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(t[n],this.lastPolygon[n])){e=!0;break}}else e=!0;return e}reset(){this.lastPolygon=void 0}update(t){this.lastPolygon=t}isPointMoved(t,e){return o.MathUtils.distanceBetweenPoints(t,e)/this.maxDistance>this.sensitivity}calculateMaxDistance(t){let e=new i.Point(0,0),n=new i.Point(t.width,t.height);return o.MathUtils.distanceBetweenPoints(e,n)}}e.PolygonMovementPredicate=r,r.DEFAULT_SENSITIVITY=.05},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MrzScannerState=e.MrzScannerProps=void 0;const r=o(n(0)),s=n(0),a=n(9),c=o(n(11)),l=n(62),u=n(16),d=n(2),h=n(5),f=n(17),p=n(4);class m extends a.ScanbotCameraProps{}e.MrzScannerProps=m;class g extends a.ScanbotCameraState{}e.MrzScannerState=g;class v extends a.ScannerView{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.state={isFinderVisible:!0}}get configuration(){return this._configuration||(this._configuration=l.MrzScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t,e){return i(this,void 0,void 0,(function*(){const n=document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{(0,s.render)(r.default.createElement(v,{container:n,configuration:t,onSuccess:i,onFailure:o,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return i(this,void 0,void 0,(function*(){f.Debugger.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){f.Debugger.warn("Mrz detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return i(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensions.bind(this)),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensions.bind(this))}updateDimensions(){return i(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate(),yield this.resume()}))}resume(){return i(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(v.FRAME_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=d.Size.fromHtmlElement(this.camera.video),i=h.ViewUtils.findScale(n,e);let o=null===(t=this.finder)||void 0===t?void 0:t.frame();if(o){const t=p.Frame.withSize(o.width/i.scale,o.height/i.scale);t.x=e.width/2-t.width/2,t.y=e.height/2-t.height/2,this.camera.cutout=t}else this.camera.cutout=void 0;return!(!(this.camera.cutout&&this.camera.cutout.width>0)&&this.camera.cutout)&&(this.shouldComputeSize=!1,!0)}detect(){var t;return i(this,void 0,void 0,(function*(){const e=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let n=!1;try{const i=this.camera.createImageData(v.FRAME_RESOLUTION);if(!i)return;e&&this.forceUpdate();const o=yield this.props.mrzRecognizer.recognize(i);if(!this.enabled)return;if(null===o)return;o?(n=!0,this.configuration.onMrzDetected(o)):this.configuration._onDetectionFailed&&(null===(t=this.configuration)||void 0===t||t._onDetectionFailed(i))}catch(t){console.log(t)}finally{n?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}render(){return r.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},r.default.createElement(c.default,{windowConfiguration:this.state.isFinderVisible?this.configuration.style.window:void 0,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),this.state.isFinderVisible&&r.default.createElement(u.ViewFinder,{ref:t=>this.finder=t,configuration:this.configuration.style}))}}e.default=v,v.FRAME_RESOLUTION=1200},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MrzScannerConfiguration=void 0;const i=n(7),o={window:{aspectRatio:4,widthProportion:.8,borderColor:"white",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},text:{color:"white",size:"0.9em",weight:300},backgroundColor:"rgba(0, 0, 0, 0.7)",hint:"Please hold the device over the MRZ code to start scanning"};class r extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onMrzDetected=function(t){},this.style=o}static fromJson(t){const e=new r;return this.mapValues(t,e,["style","videoConstraints"]),t.style&&(this.mapValues(t.style,e.style,["window","text"]),t.style.window&&this.mapValues(t.style.window,e.style.window),t.style.text&&this.mapValues(t.style.text,e.style.text)),this.mapVideoConstraints(t,e),e}}e.MrzScannerConfiguration=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ClipPath=void 0;class i{static toPx(t){return t+"px"}static toNumber(t){return parseFloat(t.replace("px",""))}static fromFrames(t,e){const n=new i;return n.left=this.toPx(e.x),n.top=this.toPx(e.y),n.right=this.toPx(e.x+e.width),n.bottom=this.toPx(e.y+e.height),n}static subtractHalf(t,e){return this.subtract(t,e/2)}static subtract(t,e){return this.toNumber(t)-e+"px"}static addHalf(t,e){return this.add(t,e/2)}static add(t,e){return this.toNumber(t)+e+"px"}}e.ClipPath=i},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeScannerState=e.BarcodeScannerProps=void 0;const c=a(n(0)),l=n(0),u=n(9),d=a(n(11)),h=n(65),f=n(14),p=n(16),m=n(2),g=n(5),v=n(17),y=n(4),_=a(n(28)),b=r(n(67)),w=a(n(74)),C=a(n(78)),S=a(n(81)),x=n(3),E=a(n(83)),P=a(n(84)),k=a(n(85));class D extends u.ScanbotCameraProps{}e.BarcodeScannerProps=D;class O extends u.ScanbotCameraState{constructor(){super(...arguments),this.action="manual"}}e.BarcodeScannerState=O;class M extends u.ScannerView{constructor(t){var e;super(t),this.shouldComputeSize=!0,this.paused=!1,this.barcodes=[],this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.state={isFinderVisible:null===(e=t.showFinder)||void 0===e||e,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0}}get configuration(){return this._configuration||(this._configuration=h.BarcodeScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return s(this,void 0,void 0,(function*(){const e=g.ViewUtils.findContainerOrThrow(t);return new Promise(((n,i)=>{(0,l.render)(c.default.createElement(M,{container:e,configuration:t,showFinder:t.showFinder,onSuccess:n,onFailure:i}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return s(this,void 0,void 0,(function*(){v.Debugger.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){v.Debugger.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return s(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensions.bind(this)),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensions.bind(this))}updateDimensions(){return s(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate(),yield this.resume()}))}resume(){return s(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(u.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=m.Size.fromHtmlElement(this.camera.video),i=g.ViewUtils.findScale(n,e);let o=null===(t=this.finder)||void 0===t?void 0:t.frame();if(o){const t=y.Frame.withSize(o.width/i.scale,o.height/i.scale);t.x=e.width/2-t.width/2,t.y=e.height/2-t.height/2,this.camera.cutout=t}else this.camera.cutout=void 0;return!(!(this.camera.cutout&&this.camera.cutout.width>0)&&this.camera.cutout)&&(this.shouldComputeSize=!1,!0)}detect(){var t,e,n,i,o;return s(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;if(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)return;let s=!1;try{const t=yield this.recognizeBarcodes(!0,r,this.configuration.returnBarcodeImage);if(!t)return;const a=t.barcodeResult;a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(null==a?void 0:a.imageData)):(s=!0,this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(this.finderRect,this.camera,t.imageData,null!==(i=this.configuration.container)&&void 0!==i?i:this.configuration.containerId,t.barcodeResult.barcodes)}catch(t){console.log(t)}finally{if(s){const t=(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)?0:this.configuration.captureDelay;0===t?requestAnimationFrame(this.detect.bind(this)):setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),t)}else requestAnimationFrame(this.detect.bind(this))}}))}setUseBackendService(t){console.log("Now using backend service for recognition: ",t),this.backendurl=t}recognizeBarcodes(t,e,n){var i,o;return s(this,void 0,void 0,(function*(){const r=t?u.ScannerView.DEFAULT_DETECTION_RESOLUTION:u.ScannerView.DETECTION_RESULTION_4K,s=null!==(i=this.desiredRecognitionResolution)&&void 0!==i?i:r,a=this.camera.createImageData(s);if(!a)return;e&&this.forceUpdate(),(null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.enabled)&&(this.setState({image:x.ImageUtils.wrapperToBase64(a)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution: ",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution: ",u.ScannerView.DETECTION_RESULTION_4K));const c=this.configuration.engineMode,l=this.configuration.barcodeFormats;let d;if(this.backendurl&&this.backendurl.length>0)d=yield k.default.recognizeBarcodes(this.backendurl,a);else{const{result:e,originalImage:i}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[a,{live:t,engineMode:c,barcodeFormats:l,returnBarcodeImage:n}]);if(!this.enabled)return;if(null===e)return;d=f.BarcodeResult.fromWorker(e,i)}return{imageData:a,originalImage:undefined,barcodeResult:d}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return s(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?t(m.Size.fromJson(n)):this.camera.didLoadVideo=()=>{const e=this.camera.videoSize();t(m.Size.fromJson(e))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}setZoom(t){this.setState({zoom:t})}updateTorch(t){this.camera.videoStream.updateTorch(t)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var t,e,n,i,o,r;const a=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return c.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"}},c.default.createElement(d.default,{windowConfiguration:this.state.isFinderVisible?this.configuration.style.window:void 0,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(e=this.state.zoom)&&void 0!==e?e:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),c.default.createElement(P.default,{top:null===(n=this.configuration.scanAndCount)||void 0===n?void 0:n.style.topLabelTop,text:a}),c.default.createElement(S.default,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&c.default.createElement(p.ViewFinder,{ref:t=>{this.finder=t},onSizeChanged:t=>{this.finderRect=t},configuration:this.configuration.style}),c.default.createElement(P.default,{bottom:100,text:this.state.bottomHintText}),c.default.createElement(E.default,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&c.default.createElement(w.default,{ref:t=>{t&&(this.overlay=t)}}),(null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.enabled)&&c.default.createElement(C.default,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(b.AnimationType.PushBottom,this.barcodes)},onShutterButtonClick:()=>s(this,void 0,void 0,(function*(){(new _.default).flash(),this.setState({action:"processing"});const t=(new Date).getTime(),e=yield this.recognizeBarcodes(!1,!1,!0);console.log("recognition took: ",((new Date).getTime()-t)/1e3),this.recognition=e;const n=this.countLabelText(e.barcodeResult.barcodes);this.setState({action:"manual",bottomHintText:n}),this.scannedImage.update(e.barcodeResult),this.barcodes.push(...e.barcodeResult.barcodes),this.bottomActionBar.update(this.barcodes),e.barcodeResult.barcodes.length>0&&this.configuration.onBarcodesDetected(e.barcodeResult)})),onScanMoreClick:()=>{this.resetCountImage()}}),c.default.createElement(b.default,{ref:t=>this.popup=t,style:null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(t){return 0==t.length?"No codes scanned. Try again?":1==t.length?"1 Code Scanned":`${t.length} Codes Scanned`}}e.default=M},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeScannerConfiguration=void 0;const i=n(7),o=n(66),r={window:{aspectRatio:1,widthProportion:.5,borderColor:"white",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},text:{color:"white",size:"0.9em",weight:300},backgroundColor:"rgba(0, 0, 0, 0.7)",hint:"Please align the barcode or QR code in the frame to scan it."},s={visible:!1};class a extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=s,this.showFinder=!0,this.scanAndCount=new o.BarcodeCountConfiguration,this.onBarcodesDetected=function(t){},this.style=r}static fromJson(t){const e=new a;return this.mapValues(t,e,["style","videoConstraints","scanAndCount"]),t.style&&(this.mapValues(t.style,e.style,["window","text"]),t.style.window&&this.mapValues(t.style.window,e.style.window),t.style.text&&this.mapValues(t.style.text,e.style.text)),t.overlay&&this.mapValues(t.overlay,e.overlay),t.scanAndCount&&(this.mapValues(t.scanAndCount,e.scanAndCount,["style"]),t.scanAndCount.style&&this.mapValues(t.scanAndCount.style,e.scanAndCount.style)),this.mapVideoConstraints(t,e),e}}e.BarcodeScannerConfiguration=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeCountConfiguration=e.BarcodeCountStyleConfiguration=void 0;class i{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}e.BarcodeCountStyleConfiguration=i;e.BarcodeCountConfiguration=class{constructor(){this.enabled=!1,this.style=new i}}},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationType=void 0;const a=s(n(0)),c=r(n(18)),l=s(n(72)),u=s(n(19));var d;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(d=e.AnimationType||(e.AnimationType={}));class h extends a.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:d.None},elements:[]}}containerStyle(t){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:t,overflow:"scroll"}}render(){var t,e,n;if(this.state.animation.type===d.None)return null;const i=this.animation(this.state.animation.type),o=this.to(this.state.animation.type);this.previousDestination=o;const r=this.props.style;return a.default.createElement(i,{style:this.containerStyle(`${o}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},a.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},a.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:u.default.ScanbotPrimary}},a.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},a.default.createElement("div",{style:{backgroundColor:u.default.White,height:3,width:33,borderRadius:5}})),a.default.createElement("div",{style:{display:"flex",height:50}},a.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:u.default.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),a.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:u.default.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(e=null===(t=this.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+" Codes"),a.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:u.default.White,justifyContent:"right",alignItems:"center",paddingRight:10}},a.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),a.default.createElement(l.default,{ref:t=>{null!==t&&(this.list=t)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(t,e){this._isVisible=!0,this.barcodes=e,this.updateAnimationType(t)}update(t){this.barcodes=t,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(d.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===d.Pop&&this.updateAnimationType(d.None)}updateAnimationType(t,e){this.setState({animation:{type:t}},e)}animation(t){let e=this.from(t),n=this.to(t);this.previousDestination===n&&(e=this.previousDestination,n=this.previousDestination);const i=c.keyframes`from {transform: ${e};} to {transform: ${n};}`;return c.default.div`animation: ${i} 0.5s;`}from(t){if(t===d.PushRight)return this.translate("X",100);if(t===d.PushBottom)return this.translate("Y",100);if(t===d.Pop){const t=this.pushType===d.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===d.PushRight)return this.translate("X",0);if(t===d.PushBottom)return this.translate("Y",0);if(t===d.Pop){const t=this.pushType===d.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}e.default=h},function(t,e){var n,i,o=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,l=[],u=!1,d=-1;function h(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&f())}function f(){if(!u){var t=a(h);u=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||u||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";var i=60103,o=60106,r=60107,s=60108,a=60114,c=60109,l=60110,u=60112,d=60113,h=60120,f=60115,p=60116,m=60121,g=60122,v=60117,y=60129,_=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;i=b("react.element"),o=b("react.portal"),r=b("react.fragment"),s=b("react.strict_mode"),a=b("react.profiler"),c=b("react.provider"),l=b("react.context"),u=b("react.forward_ref"),d=b("react.suspense"),h=b("react.suspense_list"),f=b("react.memo"),p=b("react.lazy"),m=b("react.block"),g=b("react.server.block"),v=b("react.fundamental"),y=b("react.debug_trace_mode"),_=b("react.legacy_hidden")}function w(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case r:case a:case s:case d:case h:return t;default:switch(t=t&&t.$$typeof){case l:case u:case p:case f:case c:return t;default:return e}}case o:return e}}}var C=c,S=i,x=u,E=r,P=p,k=f,D=o,O=a,M=s,T=d;e.ContextConsumer=l,e.ContextProvider=C,e.Element=S,e.ForwardRef=x,e.Fragment=E,e.Lazy=P,e.Memo=k,e.Portal=D,e.Profiler=O,e.StrictMode=M,e.Suspense=T,e.isAsyncMode=function(){return!1},e.isConcurrentMode=function(){return!1},e.isContextConsumer=function(t){return w(t)===l},e.isContextProvider=function(t){return w(t)===c},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return w(t)===u},e.isFragment=function(t){return w(t)===r},e.isLazy=function(t){return w(t)===p},e.isMemo=function(t){return w(t)===f},e.isPortal=function(t){return w(t)===o},e.isProfiler=function(t){return w(t)===a},e.isStrictMode=function(t){return w(t)===s},e.isSuspense=function(t){return w(t)===d},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===a||t===y||t===s||t===d||t===h||t===_||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===f||t.$$typeof===c||t.$$typeof===l||t.$$typeof===u||t.$$typeof===v||t.$$typeof===m||t[0]===g)},e.typeOf=w},function(t,e,n){"use strict";t.exports=n(71)},function(t,e,n){"use strict";var i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,r=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,a=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,u=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.async_mode"):60111,h=i?Symbol.for("react.concurrent_mode"):60111,f=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,m=i?Symbol.for("react.suspense_list"):60120,g=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,y=i?Symbol.for("react.block"):60121,_=i?Symbol.for("react.fundamental"):60117,b=i?Symbol.for("react.responder"):60118,w=i?Symbol.for("react.scope"):60119;function C(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case d:case h:case s:case c:case a:case p:return t;default:switch(t=t&&t.$$typeof){case u:case f:case v:case g:case l:return t;default:return e}}case r:return e}}}function S(t){return C(t)===h}e.AsyncMode=d,e.ConcurrentMode=h,e.ContextConsumer=u,e.ContextProvider=l,e.Element=o,e.ForwardRef=f,e.Fragment=s,e.Lazy=v,e.Memo=g,e.Portal=r,e.Profiler=c,e.StrictMode=a,e.Suspense=p,e.isAsyncMode=function(t){return S(t)||C(t)===d},e.isConcurrentMode=S,e.isContextConsumer=function(t){return C(t)===u},e.isContextProvider=function(t){return C(t)===l},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return C(t)===f},e.isFragment=function(t){return C(t)===s},e.isLazy=function(t){return C(t)===v},e.isMemo=function(t){return C(t)===g},e.isPortal=function(t){return C(t)===r},e.isProfiler=function(t){return C(t)===c},e.isStrictMode=function(t){return C(t)===a},e.isSuspense=function(t){return C(t)===p},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===s||t===h||t===c||t===a||t===p||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===v||t.$$typeof===g||t.$$typeof===l||t.$$typeof===u||t.$$typeof===f||t.$$typeof===_||t.$$typeof===b||t.$$typeof===w||t.$$typeof===y)},e.typeOf=C},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=i(n(73));class s extends o.default.Component{constructor(t){super(t),this.state={barcodes:this.toUniqueListWithDuplicateCounter(t.barcodes)}}toUniqueListWithDuplicateCounter(t){const e=[];return t.forEach((t=>{const n=e.findIndex((e=>e.equals(t)));-1===n?(t.count=1,e.push(t)):e[n].count++})),e}update(t){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(t)})}render(){return o.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>o.default.createElement(r.default,{key:e,barcode:t,onClick:this.props.onClick}))))}}e.default=s},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0));class r extends o.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return o.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},o.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},o.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},o.default.createElement("div",{style:{flex:1}},this.props.barcode.text),o.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),o.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}e.default=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=i(n(75)),s=n(1),a=n(2),c=n(32);class l extends o.default.Component{constructor(t){super(t),this.state={image:void 0,imageSize:a.Size.empty(),elements:[]}}update(t,e,n,i,o){const r=[];o.forEach((o=>{const l=new c.BarcodeOverlay(o);if(void 0===t){const t=a.Size.fromHtmlElement(e.video);l.points=o.points.map((e=>new s.Point(e.x*(t.width/n.width),e.y*(t.height/n.height))))}else l.points=o.points.map((e=>{const o=new s.Point(e.x,e.y);o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x;const r=("string"==typeof i?document.getElementById(i):i).getBoundingClientRect();return o.x-=r.x,o.y-=r.y,o}));r.push(l)})),this.overlay.update(r)}render(){return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},o.default.createElement(r.default,{ref:t=>{null!==t&&(this.overlay=t)},elements:this.state.elements,onClick:t=>{}}))}}e.default=l},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeSelectionOverlayProps=void 0;const o=i(n(0)),r=i(n(76)),s=i(n(77));e.BarcodeSelectionOverlayProps=class{};class a extends o.default.Component{constructor(t){super(t),this.interval=5e3,this.polygons=[],this.state={elements:t.elements}}update(t){this.setState({elements:t})}componentDidMount(){}componentWillUnmount(){}startTimer(){setTimeout(this.onTimerElapsed.bind(this),this.interval)}onTimerElapsed(){const t=[];this.polygons.forEach((e=>{e.updatedAt<s.default.now()-this.interval||t.push(e.props.element)})),this.startTimer(),requestAnimationFrame((()=>{this.setState({elements:t})}))}render(){return o.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"},onClick:t=>{t.stopPropagation(),this.props.onClick(void 0)}},this.state.elements.map(((t,e)=>o.default.createElement(r.default,{ref:t=>{t&&(this.polygons.push(t),t.updatedAt=s.default.now())},element:t,onClick:(t,e)=>{t.stopPropagation(),this.props.onClick(e)}}))))}}e.default=a},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodePolygonProps=void 0;const o=i(n(0));e.BarcodePolygonProps=class{};class r extends o.default.Component{render(){const t=this.props.element,e=t.points.map((t=>`${t.x},${t.y}`)).join(" ");return o.default.createElement("polygon",{points:e,style:{fill:t.highlighted?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)",stroke:t.highlighted?"rgba(0, 255, 0, 1)":"rgba(255, 0, 0, 1)",strokeWidth:t.highlighted?3:1},onClick:t=>{this.props.onClick&&this.props.onClick(t,this.props.element)}})}}e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{static now(){return Date.now()}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=n(30),s=i(n(19)),a=i(n(79)),c=i(n(80));class l extends o.default.Component{constructor(t){super(t),this.state={barcodes:void 0}}update(t){this.setState({barcodes:t})}didScan(){return void 0!==this.state.barcodes}render(){var t,e;return o.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:s.default.ScanbotPrimary}},o.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},o.default.createElement(a.default,null),o.default.createElement("div",{style:{backgroundColor:s.default.Orange,color:s.default.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(e=null===(t=this.state.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)),o.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},o.default.createElement(r.ShutterButton,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),o.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},o.default.createElement("div",{style:{fontSize:13,color:s.default.White,marginRight:10}},"Scan More"),o.default.createElement(c.default,null)))}}e.default=l},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0));class r extends o.default.Component{render(){return o.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},o.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),o.default.createElement("g",{mask:"url(#mask0_919_23088)"},o.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}e.default=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0));class r extends o.default.Component{render(){return o.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},o.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),o.default.createElement("g",{mask:"url(#mask0_919_23102)"},o.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}e.default=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=n(32),s=n(2),a=n(1),c=i(n(82));class l extends o.default.Component{constructor(t){super(t),this.polygons=[],this.state={elements:[],imageSize:s.Size.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const i=new r.BarcodeOverlay(n);i.points=a.Point.scaleListToImageElement(n.points,t.imageData,this.image),e.push(i)})),this.setState({imageSize:s.Size.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:o.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},o.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),o.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>o.default.createElement(c.default,{key:e,points:t.points})))))}}e.default=l},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=n(1);class s extends o.default.Component{render(){const t=r.Point.centerOf(this.props.points),e=r.Point.smallerSizeOfQuad(this.props.points)/40;return o.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:t.x-20,top:t.y-20,transform:`scale(${e})`}},o.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},o.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),o.default.createElement("g",{mask:"url(#mask0_910_20901)"},o.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),o.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}e.default=s},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=i(n(18));class s extends o.default.Component{render(){if(!this.props.visible)return null;const t=r.default.svg`
|
|
2
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=37)}([function(t,e,n){"use strict";n.r(e),n.d(e,"useState",(function(){return Q})),n.d(e,"useReducer",(function(){return tt})),n.d(e,"useEffect",(function(){return et})),n.d(e,"useLayoutEffect",(function(){return nt})),n.d(e,"useRef",(function(){return it})),n.d(e,"useImperativeHandle",(function(){return ot})),n.d(e,"useMemo",(function(){return rt})),n.d(e,"useCallback",(function(){return st})),n.d(e,"useContext",(function(){return at})),n.d(e,"useDebugValue",(function(){return ct})),n.d(e,"useErrorBoundary",(function(){return lt})),n.d(e,"createElement",(function(){return m})),n.d(e,"createContext",(function(){return U})),n.d(e,"createRef",(function(){return v})),n.d(e,"Fragment",(function(){return y})),n.d(e,"Component",(function(){return _})),n.d(e,"version",(function(){return Jt})),n.d(e,"Children",(function(){return xt})),n.d(e,"render",(function(){return Ft})),n.d(e,"hydrate",(function(){return Nt})),n.d(e,"unmountComponentAtNode",(function(){return te})),n.d(e,"createPortal",(function(){return zt})),n.d(e,"createFactory",(function(){return Kt})),n.d(e,"cloneElement",(function(){return Qt})),n.d(e,"isValidElement",(function(){return Xt})),n.d(e,"findDOMNode",(function(){return ee})),n.d(e,"PureComponent",(function(){return yt})),n.d(e,"memo",(function(){return _t})),n.d(e,"forwardRef",(function(){return Ct})),n.d(e,"flushSync",(function(){return ie})),n.d(e,"unstable_batchedUpdates",(function(){return ne})),n.d(e,"StrictMode",(function(){return oe})),n.d(e,"Suspense",(function(){return kt})),n.d(e,"SuspenseList",(function(){return Mt})),n.d(e,"lazy",(function(){return Ot})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return Yt}));var i,o,r,s,a,c,l,u={},d=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(t,e){for(var n in e)t[n]=e[n];return t}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function m(t,e,n){var o,r,s,a={};for(s in e)"key"==s?o=e[s]:"ref"==s?r=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return g(t,a,o,r,null)}function g(t,e,n,i,s){var a={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++r:s};return null==s&&null!=o.vnode&&o.vnode(a),a}function v(){return{current:null}}function y(t){return t.children}function _(t,e){this.props=t,this.context=e}function b(t,e){if(null==e)return t.__?b(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?b(t):null}function w(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return w(t)}}function C(t){(!t.__d&&(t.__d=!0)&&s.push(t)&&!S.__r++||c!==o.debounceRendering)&&((c=o.debounceRendering)||a)(S)}function S(){for(var t;S.__r=s.length;)t=s.sort((function(t,e){return t.__v.__b-e.__v.__b})),s=[],t.some((function(t){var e,n,i,o,r,s;t.__d&&(r=(o=(e=t).__v).__e,(s=e.__P)&&(n=[],(i=f({},o)).__v=o.__v+1,A(s,o,i,e.__n,void 0!==s.ownerSVGElement,null!=o.__h?[r]:null,n,null==r?b(o):r,o.__h),I(n,o),o.__e!=r&&w(o)))}))}function x(t,e,n,i,o,r,s,a,c,l){var h,f,p,m,v,_,w,C=i&&i.__k||d,S=C.length;for(n.__k=[],h=0;h<e.length;h++)if(null!=(m=n.__k[h]=null==(m=e[h])||"boolean"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?g(null,m,null,null,m):Array.isArray(m)?g(y,{children:m},null,null,null):m.__b>0?g(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(p=C[h])||p&&m.key==p.key&&m.type===p.type)C[h]=void 0;else for(f=0;f<S;f++){if((p=C[f])&&m.key==p.key&&m.type===p.type){C[f]=void 0;break}p=null}A(t,m,p=p||u,o,r,s,a,c,l),v=m.__e,(f=m.ref)&&p.ref!=f&&(w||(w=[]),p.ref&&w.push(p.ref,null,m),w.push(f,m.__c||v,m)),null!=v?(null==_&&(_=v),"function"==typeof m.type&&m.__k===p.__k?m.__d=c=E(m,c,t):c=k(t,m,p,C,v,c),"function"==typeof n.type&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=t&&(c=b(p))}for(n.__e=_,h=S;h--;)null!=C[h]&&("function"==typeof n.type&&null!=C[h].__e&&C[h].__e==n.__d&&(n.__d=b(i,h+1)),L(C[h],C[h]));if(w)for(h=0;h<w.length;h++)R(w[h],w[++h],w[++h])}function E(t,e,n){for(var i,o=t.__k,r=0;o&&r<o.length;r++)(i=o[r])&&(i.__=t,e="function"==typeof i.type?E(i,e,n):k(n,i,i,o,i.__e,e));return e}function P(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){P(t,e)})):e.push(t)),e}function k(t,e,n,i,o,r){var s,a,c;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==n||o!=r||null==o.parentNode)t:if(null==r||r.parentNode!==t)t.appendChild(o),s=null;else{for(a=r,c=0;(a=a.nextSibling)&&c<i.length;c+=2)if(a==o)break t;t.insertBefore(o,r),s=r}return void 0!==s?s:o.nextSibling}function D(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||h.test(e)?n:n+"px"}function O(t,e,n,i,o){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||D(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||D(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i||t.addEventListener(e,r?T:M,r):t.removeEventListener(e,r?T:M,r);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function M(t){this.l[t.type+!1](o.event?o.event(t):t)}function T(t){this.l[t.type+!0](o.event?o.event(t):t)}function A(t,e,n,i,r,s,a,c,l){var u,d,h,p,m,g,v,b,w,C,S,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,c=e.__e=n.__e,e.__h=null,s=[c]),(u=o.__b)&&u(e);try{t:if("function"==typeof E){if(b=e.props,w=(u=E.contextType)&&i[u.__c],C=u?w?w.props.value:u.__:i,n.__c?v=(d=e.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?e.__c=d=new E(b,C):(e.__c=d=new _(b,C),d.constructor=E,d.render=B),w&&w.sub(d),d.props=b,d.state||(d.state={}),d.context=C,d.__n=i,h=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=f({},d.__s)),f(d.__s,E.getDerivedStateFromProps(b,d.__s))),p=d.props,m=d.state,h)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&b!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(b,C),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(b,d.__s,C)||e.__v===n.__v){d.props=b,d.state=d.__s,e.__v!==n.__v&&(d.__d=!1),d.__v=e,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,C),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,m,g)}))}d.context=C,d.props=b,d.state=d.__s,(u=o.__r)&&u(e),d.__d=!1,d.__v=e,d.__P=t,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(i=f(f({},i),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,m)),S=null!=u&&u.type===y&&null==u.key?u.props.children:u,x(t,Array.isArray(S)?S:[S],e,n,i,r,s,a,c,l),d.base=e.__e,e.__h=null,d.__h.length&&a.push(d),v&&(d.__E=d.__=null),d.__e=!1}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=z(n.__e,e,n,i,r,s,a,l);(u=o.diffed)&&u(e)}catch(t){e.__v=null,(l||null!=s)&&(e.__e=c,e.__h=!!l,s[s.indexOf(c)]=null),o.__e(t,e,n)}}function I(t,e){o.__c&&o.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){o.__e(t,e.__v)}}))}function z(t,e,n,o,r,s,a,c){var l,d,h,f=n.props,m=e.props,g=e.type,v=0;if("svg"===g&&(r=!0),null!=s)for(;v<s.length;v++)if((l=s[v])&&"setAttribute"in l==!!g&&(g?l.localName===g:3===l.nodeType)){t=l,s[v]=null;break}if(null==t){if(null===g)return document.createTextNode(m);t=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,m.is&&m),s=null,c=!1}if(null===g)f===m||c&&t.data===m||(t.data=m);else{if(s=s&&i.call(t.childNodes),d=(f=n.props||u).dangerouslySetInnerHTML,h=m.dangerouslySetInnerHTML,!c){if(null!=s)for(f={},v=0;v<t.attributes.length;v++)f[t.attributes[v].name]=t.attributes[v].value;(h||d)&&(h&&(d&&h.__html==d.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(function(t,e,n,i,o){var r;for(r in n)"children"===r||"key"===r||r in e||O(t,r,null,n[r],i);for(r in e)o&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===e[r]||O(t,r,e[r],n[r],i)}(t,m,f,r,c),h)e.__k=[];else if(v=e.props.children,x(t,Array.isArray(v)?v:[v],e,n,o,r&&"foreignObject"!==g,s,a,s?s[0]:n.__k&&b(n,0),c),null!=s)for(v=s.length;v--;)null!=s[v]&&p(s[v]);c||("value"in m&&void 0!==(v=m.value)&&(v!==f.value||v!==t.value||"progress"===g&&!v)&&O(t,"value",v,f.value,!1),"checked"in m&&void 0!==(v=m.checked)&&v!==t.checked&&O(t,"checked",v,f.checked,!1))}return t}function R(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){o.__e(t,n)}}function L(t,e,n){var i,r;if(o.unmount&&o.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||R(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){o.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&L(i[r],e,"function"!=typeof t.type);n||null==t.__e||p(t.__e),t.__e=t.__d=void 0}function B(t,e,n){return this.constructor(t,n)}function j(t,e,n){var r,s,a;o.__&&o.__(t,e),s=(r="function"==typeof n)?null:n&&n.__k||e.__k,a=[],A(e,t=(!r&&n||e).__k=m(y,null,[t]),s||u,u,void 0!==e.ownerSVGElement,!r&&n?[n]:s?null:e.firstChild?i.call(e.childNodes):null,a,!r&&n?n:s?s.__e:e.firstChild,r),I(a,t)}function F(t,e){j(t,e,F)}function N(t,e,n){var o,r,s,a=f({},t.props);for(s in e)"key"==s?o=e[s]:"ref"==s?r=e[s]:a[s]=e[s];return arguments.length>2&&(a.children=arguments.length>3?i.call(arguments,2):n),g(t.type,a,o||t.key,r||t.ref,null)}function U(t,e){var n={__c:e="__cC"+l++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(C)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}i=d.slice,o={__e:function(t,e){for(var n,i,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((i=n.constructor)&&null!=i.getDerivedStateFromError&&(n.setState(i.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},r=0,_.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof t&&(t=t(f({},n),this.props)),t&&f(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),C(this))},_.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),C(this))},_.prototype.render=y,s=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,S.__r=0,l=0;var V,W,$,H=0,G=[],q=o.__b,Z=o.__r,Y=o.diffed,J=o.__c,K=o.unmount;function X(t,e){o.__h&&o.__h(W,t,H||e),H=0;var n=W.__H||(W.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Q(t){return H=1,tt(mt,t)}function tt(t,e,n){var i=X(V++,2);return i.t=t,i.__c||(i.__=[n?n(e):mt(void 0,e),function(t){var e=i.t(i.__[0],t);i.__[0]!==e&&(i.__=[e,i.__[1]],i.__c.setState({}))}],i.__c=W),i.__}function et(t,e){var n=X(V++,3);!o.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,W.__H.__h.push(n))}function nt(t,e){var n=X(V++,4);!o.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,W.__h.push(n))}function it(t){return H=5,rt((function(){return{current:t}}),[])}function ot(t,e,n){H=6,nt((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))}function rt(t,e){var n=X(V++,7);return pt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function st(t,e){return H=8,rt((function(){return t}),e)}function at(t){var e=W.context[t.__c],n=X(V++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(W)),e.props.value):t.__}function ct(t,e){o.useDebugValue&&o.useDebugValue(e?e(t):t)}function lt(t){var e=X(V++,10),n=Q();return e.__=t,W.componentDidCatch||(W.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}function ut(){for(var t;t=G.shift();)if(t.__P)try{t.__H.__h.forEach(ht),t.__H.__h.forEach(ft),t.__H.__h=[]}catch(e){t.__H.__h=[],o.__e(e,t.__v)}}o.__b=function(t){W=null,q&&q(t)},o.__r=function(t){Z&&Z(t),V=0;var e=(W=t.__c).__H;e&&(e.__h.forEach(ht),e.__h.forEach(ft),e.__h=[])},o.diffed=function(t){Y&&Y(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==G.push(e)&&$===o.requestAnimationFrame||(($=o.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),dt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);dt&&(e=requestAnimationFrame(n))})(ut)),W=null},o.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ht),t.__h=t.__h.filter((function(t){return!t.__||ft(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],o.__e(n,t.__v)}})),J&&J(t,e)},o.unmount=function(t){K&&K(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{ht(t)}catch(t){e=t}})),e&&o.__e(e,n.__v))};var dt="function"==typeof requestAnimationFrame;function ht(t){var e=W,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),W=e}function ft(t){var e=W;t.__c=t.__(),W=e}function pt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function mt(t,e){return"function"==typeof e?e(t):e}function gt(t,e){for(var n in e)t[n]=e[n];return t}function vt(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function yt(t){this.props=t}function _t(t,e){function n(t){var n=this.props.ref,i=n==t.ref;return!i&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!i:vt(this.props,t)}function i(e){return this.shouldComponentUpdate=n,m(t,e)}return i.displayName="Memo("+(t.displayName||t.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(yt.prototype=new _).isPureReactComponent=!0,yt.prototype.shouldComponentUpdate=function(t,e){return vt(this.props,t)||vt(this.state,e)};var bt=o.__b;o.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),bt&&bt(t)};var wt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ct(t){function e(e,n){var i=gt({},e);return delete i.ref,t(i,(n=e.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return e.$$typeof=wt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var St=function(t,e){return null==t?null:P(P(t).map(e))},xt={map:St,forEach:St,count:function(t){return t?P(t).length:0},only:function(t){var e=P(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:P},Et=o.__e;o.__e=function(t,e,n){if(t.then)for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e);Et(t,e,n)};var Pt=o.unmount;function kt(){this.__u=0,this.t=null,this.__b=null}function Dt(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Ot(t){var e,n,i;function o(o){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){i=t})),i)throw i;if(!n)throw e;return m(n,o)}return o.displayName="Lazy",o.__f=!0,o}function Mt(){this.u=null,this.o=null}o.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),Pt&&Pt(t)},(kt.prototype=new _).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=Dt(i.__v),r=!1,s=function(){r||(r=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--i.__u){if(i.state.__e){var t=i.state.__e;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__e:i.__b=null});e=i.t.pop();)e.forceUpdate()}},c=!0===e.__h;i.__u++||c||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(s,s)},kt.prototype.componentWillUnmount=function(){this.t=[]},kt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=gt({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var o=e.__e&&m(y,null,t.fallback);return o&&(o.__h=null),[m(y,null,e.__e?null:t.children),o]};var Tt=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function At(t){return this.getChildContext=function(){return t.context},t.children}function It(t){var e=this,n=t.i;e.componentWillUnmount=function(){j(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),j(m(At,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}function zt(t,e){return m(It,{__v:t,i:e})}(Mt.prototype=new _).__e=function(t){var e=this,n=Dt(e.__v),i=e.o.get(t);return i[0]++,function(o){var r=function(){e.props.revealOrder?(i.push(o),Tt(e,t,i)):o()};n?n(r):r()}},Mt.prototype.render=function(t){this.u=null,this.o=new Map;var e=P(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Mt.prototype.componentDidUpdate=Mt.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Tt(t,n,e)}))};var Rt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Lt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Bt="undefined"!=typeof document,jt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};function Ft(t,e,n){return null==e.__k&&(e.textContent=""),j(t,e),"function"==typeof n&&n(),t?t.__c:null}function Nt(t,e,n){return F(t,e),"function"==typeof n&&n(),t?t.__c:null}_.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(_.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Ut=o.event;function Vt(){}function Wt(){return this.cancelBubble}function $t(){return this.defaultPrevented}o.event=function(t){return Ut&&(t=Ut(t)),t.persist=Vt,t.isPropagationStopped=Wt,t.isDefaultPrevented=$t,t.nativeEvent=t};var Ht,Gt={configurable:!0,get:function(){return this.class}},qt=o.vnode;o.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var o=-1===e.indexOf("-");for(var r in i={},n){var s=n[r];Bt&&"children"===r&&"noscript"===e||"value"===r&&"defaultValue"in n&&null==s||("defaultValue"===r&&"value"in n&&null==n.value?r="value":"download"===r&&!0===s?s="":/ondoubleclick/i.test(r)?r="ondblclick":/^onchange(textarea|input)/i.test(r+e)&&!jt(n.type)?r="oninput":/^onfocus$/i.test(r)?r="onfocusin":/^onblur$/i.test(r)?r="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(r)?r=r.toLowerCase():o&&Lt.test(r)?r=r.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),i[r]=s)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=P(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Gt.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Gt))}t.$$typeof=Rt,qt&&qt(t)};var Zt=o.__r;o.__r=function(t){Zt&&Zt(t),Ht=t.__c};var Yt={ReactCurrentDispatcher:{current:{readContext:function(t){return Ht.__n[t.__c].props.value}}}},Jt="17.0.2";function Kt(t){return m.bind(null,t)}function Xt(t){return!!t&&t.$$typeof===Rt}function Qt(t){return Xt(t)?N.apply(null,arguments):t}function te(t){return!!t.__k&&(j(null,t),!0)}function ee(t){return t&&(t.base||1===t.nodeType&&t)||null}var ne=function(t,e){return t(e)},ie=function(t,e){return t(e)},oe=y;e.default={useState:Q,useReducer:tt,useEffect:et,useLayoutEffect:nt,useRef:it,useImperativeHandle:ot,useMemo:rt,useCallback:st,useContext:at,useDebugValue:ct,version:"17.0.2",Children:xt,render:Ft,hydrate:Nt,unmountComponentAtNode:te,createPortal:zt,createElement:m,createContext:U,createFactory:Kt,cloneElement:Qt,createRef:v,Fragment:y,isValidElement:Xt,findDOMNode:ee,Component:_,PureComponent:yt,memo:_t,forwardRef:Ct,flushSync:ie,unstable_batchedUpdates:ne,StrictMode:y,Suspense:kt,SuspenseList:Mt,lazy:Ot,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Yt}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Point=void 0;class i{constructor(t,e){this.x=t,this.y=e}static toPolygon(t,e){return[i.scaleDownTo(t[0],e),i.scaleDownTo(t[1],e),i.scaleDownTo(t[2],e),i.scaleDownTo(t[3],e)]}static scaleToPoint(t,e,n,o){return new i(o*(t.x-e),o*(t.y-n))}static scaleListToImageElement(t,e,n){return t.map((t=>i.scaleToImageElement(t,e,n)))}static scaleToImageElement(t,e,n){return new i(t.x*(n.clientWidth/e.width),t.y*(n.clientHeight/e.height))}static scaleUpTo(t,e){return new i(t.x*e.width,t.y*e.height)}static scaleDownTo(t,e){return new i(t.x/e.width,t.y/e.height)}static fromHtmlElement(t){return new i(t.offsetLeft,t.offsetTop)}static withScale(t,e,n){return new i(t/n,e/n)}static fromCoordinates(t,e,n,o){if(!t||!e)return new i(0,0);const r=new i(t,e);return o=null!=o?o:1,1===(n=n?n%4:0)?i.withScale(r.y,-r.x,o):2===n?i.withScale(-r.x,-r.y,o):3===n?i.withScale(-r.y,r.x,o):i.withScale(r.x,r.y,o)}static centerOf(t){const e=t.reduce(((t,e)=>t+e.x),0)/t.length,n=t.reduce(((t,e)=>t+e.y),0)/t.length;return new i(e,n)}static smallerSizeOfQuad(t){const e=Math.max(...t.map((t=>t.x)))-Math.min(...t.map((t=>t.x))),n=Math.max(...t.map((t=>t.y)))-Math.min(...t.map((t=>t.y)));return Math.min(e,n)}static empty(){return new i(0,0)}}e.Point=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Size=void 0;const i=n(1);class o{constructor(t,e){this.width=t,this.height=e}isPortrait(){return this.height>this.width}ratio(t){return t?this.height/this.width:this.width/this.height}ratioDiff(t,e){return this.ratio(e)/t.ratio(e)}static isEmpty(t){return!t||(0===t.width||0===t.height)}static toPolygon(t){return[new i.Point(0,0),new i.Point(t.width,0),new i.Point(t.width,t.height),new i.Point(0,t.height)]}static fromHtmlElement(t){return t?new o(t.clientWidth,t.clientHeight):new o(0,0)}static fromJson(t){return new o(t.width,t.height)}static subtractFrom(t,e){return new o(t.width-e,t.height-e)}static empty(){return new o(0,0)}}e.Size=o},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageUtils=void 0;const o=n(4),r=n(8);class s{static toDataUrl(t){return new Promise(((e,n)=>{const i=new Blob([t],{type:"image/jpeg"}),o=new FileReader;o.onload=()=>e(o.result),o.onerror=()=>n(o.error),o.readAsDataURL(i)}))}static getObjectFitSize(t,e,n=!0){const i=e.width/e.height,r=t.width/t.height;let s=0,a=0;(n?i>r:i<r)?(s=t.width,a=s/i):(a=t.height,s=a*i);const c=(t.width-s)/2,l=(t.height-a)/2;return new o.Frame(c,l,s,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){this.createImageDataCanvas(t).toBlob((t=>this.saveBlob(t,r.Utils.uuid()+".png")))}static createImageDataCanvas(t){const e=document.createElement("canvas");return e.className="scanbot-sdk-canvas-element",e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e}static saveBlob(t,e){let n=document.createElement("a");n.setAttribute("download",e);let i=URL.createObjectURL(t);n.setAttribute("href",i),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return s.createImageDataCanvas(s.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}}e.ImageUtils=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=void 0;class i{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}scaleDown(t){return new i(this.x/t,this.y/t,this.width/t,this.height/t)}static withSize(t,e){return new i(0,0,t,e)}static empty(){return new i(0,0,0,0)}static fromRect(t){return t?new i(t.x,t.y,t.width,t.height):i.empty()}static fromPoint(t,e){return new i(t.x-e/2,t.y-e/2,e,e)}}e.Frame=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewUtils=void 0;const i=n(54),o=n(2),r=n(1);class s{static convertLinesToViewportLines(t,e){if(!e||!t)return;const n=[],{x:o,y:r,containerScale:s}=this.calculateScale(t);return e.forEach((t=>{n.push(i.MagneticLine.scaleToLine(t,o,r,s))})),n}static convertToViewportPointsFromParentSize(t,e){return e?o.Size.isEmpty(t)?void 0:e.map((e=>r.Point.scaleUpTo(e,t))):o.Size.toPolygon(t)}static calculateScale(t){let e,n=0,i=0;return 1>t.width/t.height?(e=t.height/1,n=(1-t.width/e)/2):(e=t.width/1,i=(1-t.height/e)/2),{x:n,y:i,containerScale:e}}static findScale(t,e){let n,i=0,o=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,o=(e.height-t.height/n)/2):(n=t.height/e.height,i=(e.width-t.width/n)/2),{x:i,y:o,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",s.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",s.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(t){var e;const n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}e.ViewUtils=s},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(38),s=n(26),a=n(42),c=o(n(43)),l=o(n(44)),u=o(n(28)),d=n(3),h=n(25),f=n(14),p=o(n(46)),m=o(n(48)),g=o(n(49)),v=o(n(50)),y=n(52);class _{static initialize(t){return i(this,void 0,void 0,(function*(){const e=new _,n=t.engine||_.defaultEnginePath;e.bridge=new r.WorkerBridge(n);const i=[t.licenseKey,n,window.location.hostname,h.Constants.CDN_PATH+h.Constants.DEFAULT_WASM_FOLDER];return e.initialized=yield e.bridge.postByCopyingArgs("initialize",i),e.initialized&&(_.instance=e),e}))}createDocumentScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(53);return yield e.default.create(t)}))}createMrzScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(61),i=new p.default(this,yield this.bridge.postByCopyingArgs("createMRZRecognizer",[]));return yield e.default.create(t,i)}))}createBarcodeScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(64);return yield e.default.create(t)}))}openCroppingView(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(86);return yield e.default.create(t)}))}createTextDataScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(97),i=t.supportedLanguages,o=t.ocrResolutionLimit,r=new v.default(this,yield this.bridge.postByCopyingArgs("createGenericTextLineScanner",[{languages:i,ocrResolutionLimit:o}]));return yield e.default.create(t,r)}))}toDataUrl(t){return i(this,void 0,void 0,(function*(){return this.throwIfMissingBuffer(t),yield d.ImageUtils.toDataUrl(t)}))}applyFilter(t,e){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),this.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("applyFilter",[t,e])}))}rotateImageCcw(t,e){return i(this,void 0,void 0,(function*(){return this.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("rotateImageCcw",[t,e])}))}cropAndRotateImageCcw(t,e,n){return i(this,void 0,void 0,(function*(){return this.throwIfMissingBuffer(t),this.throwIfMissing(e,"Polygon may not be null"),yield this.bridge.postByCopyingArgs("cropAndRotateImageCcw",[t,e,n])}))}detectDocument(t,e,n){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),this.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("detectDocumentOnImage",[t,e||s.DocumentScannerConfiguration.DEFAULT_ACCEPTED_ANGLE_SCORE,n||s.DocumentScannerConfiguration.DEFAULT_ACCEPTED_SIZE_SCORE])}))}detectBarcodes(t,e,n,o){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),this.throwIfMissingBuffer(t),new Promise((r=>{const s=document.createElement("canvas"),a=document.createElement("img");a.src=t,a.onload=()=>i(this,void 0,void 0,(function*(){s.width=a.width,s.height=a.height;const t=s.getContext("2d");t.drawImage(a,0,0);const i=t.getImageData(0,0,a.width,a.height),{result:c,originalImage:l}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[i,{engineMode:e,barcodeFormats:n,returnBarcodeImage:o}]);r(f.BarcodeResult.fromWorker(c,d.ImageUtils.convertImageDataWrapperToImageData(l)))}))}))}))}createSimpleMRZRecognizer(){return i(this,void 0,void 0,(function*(){return new p.default(this,yield this.bridge.postByTransferringArgs("createMRZRecognizer",[]))}))}createOcrEngine(t){return i(this,void 0,void 0,(function*(){return new m.default(this,yield this.bridge.postByCopyingArgs("createOcrEngine",[t]))}))}createBlurDetector(){return i(this,void 0,void 0,(function*(){return new g.default(this,yield this.bridge.postByTransferringArgs("createBlurDetector",[]))}))}getLicenseInfo(){return i(this,void 0,void 0,(function*(){const t=yield this.bridge.postByTransferringArgs("getLicenseInfo",[]);return a.LicenseInfo.fromJson(t)}))}beginPdf(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new c.default(this,yield this.bridge.postByCopyingArgs("beginPdf",[t]))}))}beginTiff(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new l.default(this,yield this.bridge.postByCopyingArgs("beginTiff",[t]))}))}get version(){return h.Constants.VERSION}get utils(){return this._utils||(this._utils=new u.default),this._utils}throwIfMissingBuffer(t){this.throwIfMissing(t,"ImageBuffer may not be null")}throwIfMissing(t,e){if(!t)throw new Error(e)}licenseCheck(){return i(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new y.LicenseError(t)}))}}e.default=_,_.defaultEnginePath=""},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScannerConfiguration=void 0;const i=n(27);class o extends i.BaseConfiguration{constructor(t){super(),this.mirrored=!1,this.videoConstraints={width:{ideal:t.width},height:{ideal:t.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(t,e){t.videoConstraints&&this.mapValues(t.videoConstraints,e.videoConstraints)}}e.ScannerConfiguration=o,o.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},o.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},o.DEFAULT_ACCEPTED_ANGLE_SCORE=75,o.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Utils=void 0;e.Utils=class{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){let n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let i=0;i<5;i++)t+=e.charAt(Math.floor(Math.random()*n));return t}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ScannerView=e.ScanbotCameraState=e.ScanbotCameraProps=void 0;const r=o(n(0)),s=n(0),a=o(n(6)),c=n(29);e.ScanbotCameraProps=class{};e.ScanbotCameraState=class{constructor(){this.initialized=!1}};class l extends r.default.Component{constructor(){super(...arguments),this.onVideoReady=()=>{this.setState({initialized:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.initialized){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}}}get bridge(){return a.default.instance.bridge}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with create...Scanner. Remove component from render tree to dispose.");(0,s.render)(null,t)}componentDidMount(){this.disposed=!1}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(t){this.camera.swapCameraFacing(t)}switchCamera(t,e){return i(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return i(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{var n;if(null===(n=navigator.mediaDevices)||void 0===n?void 0:n.enumerateDevices){let n=[];navigator.mediaDevices.enumerateDevices().then((e=>{e.forEach((t=>{"videoinput"===t.kind&&t.deviceId&&n.push({deviceId:t.deviceId,label:t.label})})),t(n)})).catch((t=>{e(c.MediaError.unknownError(t))}))}else e(c.MediaError.unsupportedOperationError())}))}))}}e.ScannerView=l,l.DEFAULT_DETECTION_RESOLUTION=600,l.DETECTION_RESULTION_4K=3840},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentPolygon=void 0;const o=i(n(0));class r extends o.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return o.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const t=[];for(let e=0;e<this.LINE_COUNT;e++){const n=this.props.points[e],i=this.props.points[(e+1)%this.LINE_COUNT];t.push(o.default.createElement("line",{key:e,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:i.x,y2:i.y}))}return t}setFrame(){this.forceUpdate()}}e.DocumentPolygon=r,r.CLASSNAME="scanbot-document-outline"},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=o(n(0)),s=o(n(59)),a=n(2),c=n(4),l=n(3);class u extends r.default.Component{constructor(t){super(t),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this.onStreamChanged=t=>{this.video.srcObject=t,this.updateCameraInfo(t),this.video.addEventListener("resize",(t=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(t=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:t,clientVideoHeight:e}=this.calculateClientVideoConstraints();return new a.Size(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}createImageData(t=0){var e;if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;let{videoWidth:i,videoHeight:o}=this.video,{clientVideoWidth:r,clientVideoHeight:s}=this.calculateClientVideoConstraints(),a=r,u=s;if(this.props.windowConfiguration)if(this.props.windowConfiguration.aspectRatio){a*=this.props.windowConfiguration.widthProportion<0||this.props.windowConfiguration.widthProportion>=1?1:this.props.windowConfiguration.widthProportion,u=a/this.props.windowConfiguration.aspectRatio}else this.props.windowConfiguration.width&&this.props.windowConfiguration.height&&(a=parseFloat(this.props.windowConfiguration.width),u=parseFloat(this.props.windowConfiguration.height));const{width:d,height:h}=this.calculateFrameSize(t,a,u),f=null!==(e=this.cutout)&&void 0!==e?e:new c.Frame(0,0,d,h),p=d*this.zoom(),m=h*this.zoom(),g=-p/2+p/this.zoom()/2,v=-m/2+m/this.zoom()/2;if(this.video.readyState>1){n.drawImage(this.video,(i-a)/2,(o-u)/2,a,u,g,v,p,m);const t=n.getImageData(f.x,f.y,f.width,f.height);return n.clearRect(0,0,this.canvas.width,this.canvas.height),this.save&&(console.log("frame",f),l.ImageUtils.saveImageData(t),this.save=!1),{data:t.data,width:t.width,height:t.height}}}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),i=t,o=e;if(n.width/n.height<=t/e){let t=n.height/e;t>0&&(i=n.width/t)}else{let e=n.width/t;e>0&&(o=n.height/e)}return{clientVideoWidth:i,clientVideoHeight:o}}calculateFrameSize(t,e,n){let i=e,o=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(i=e>t?t:e,o=i/r):(o=n>t?t:n,i=o*r)}return new a.Size(i,o)}getCanvasRenderingContext(){if(!this.video)return null;if(0===this.video.videoWidth)return null;this.canvas&&!this.reloadCanvas||(this.canvas&&this.canvas.remove(),this.canvas=document.createElement("canvas"),this.canvas.className="scanbot-sdk-canvas-element",this.canvas.width=this.videoSize().width,this.canvas.height=this.videoSize().height,this.reloadCanvas=!1);const t=this.canvas.getContext("2d",{willReadFrequently:!0});return t.imageSmoothingEnabled=!1,t}releaseCanvas(){if(this.canvas){this.canvas.width=1,this.canvas.height=1;const t=this.canvas.getContext("2d");t&&t.clearRect(0,0,1,1),this.canvas=null}}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){const t={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover"};return this.state.mirrored&&(t.transform="scaleX(-1)"),t}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return r.default.createElement(s.default,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},r.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}swapCameraFacing(t){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const e=!this.state.facingModeBack,n=e?"environment":"user";this.props.videoConstraints.facingMode=!0===t?{exact:n}:{ideal:n},this.setState({facingModeBack:e,mirrored:!e},(()=>i(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return i(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=e?e:this.state.mirrored,deviceId:t},(()=>i(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(t){const e=t.getTracks().filter((t=>"video"===t.kind));if(e){const t=e.map((t=>{const e=t.label,n=t.getSettings().deviceId,i=t.getSettings().facingMode;let o="unknown";return"user"===i?o="front":"environment"===i&&(o="back"),{deviceId:n,label:e,facingMode:o}}));this.activeCamera=t[0]}}getActiveCameraInfo(){return this.activeCamera}}e.default=u},function(t,e,n){"use strict";var i,o=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),s=[];function a(t){for(var e=-1,n=0;n<s.length;n++)if(s[n].identifier===t){e=n;break}return e}function c(t,e){for(var n={},i=[],o=0;o<t.length;o++){var r=t[o],c=e.base?r[0]+e.base:r[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var d=a(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(s[d].references++,s[d].updater(h)):s.push({identifier:u,updater:g(h,e),references:1}),i.push(u)}return i}function l(t){var e=document.createElement("style"),i=t.attributes||{};if(void 0===i.nonce){var o=n.nc;o&&(i.nonce=o)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var s=r(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,i){var o=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=d(e,o);else{var r=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}function f(t,e,n){var i=n.css,o=n.media,r=n.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var p=null,m=0;function g(t,e){var n,i,o;if(e.singleton){var r=m++;n=p||(p=l(e)),i=h.bind(null,n,r,!1),o=h.bind(null,n,r,!0)}else n=l(e),i=f.bind(null,n,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var n=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var i=0;i<n.length;i++){var o=a(n[i]);s[o].references--}for(var r=c(t,e),l=0;l<n.length;l++){var u=a(n[l]);0===s[u].references&&(s[u].updater(),s.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(i)for(var r=0;r<this.length;r++){var s=this[r][0];null!=s&&(o[s]=!0)}for(var a=0;a<t.length;a++){var c=[].concat(t[a]);i&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeResult=void 0;const i=n(3),o=n(45);class r{constructor(t,e){this.barcodes=t,this.imageData=e}static fromWorker(t,e){const n=[];t&&t.forEach((t=>{n.push(o.Barcode.fromWorker(t))}));const s=i.ImageUtils.convertImageDataWrapperToImageData(e);return new r(n,s)}isEmpty(){return 0===this.barcodes.length}}e.BarcodeResult=r},function(t,e,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var i=arguments[e];if(i){var r=typeof i;if("string"===r||"number"===r)t.push(i);else if(Array.isArray(i)){if(i.length){var s=o.apply(null,i);s&&t.push(s)}}else if("object"===r)if(i.toString===Object.prototype.toString)for(var a in i)n.call(i,a)&&i[a]&&t.push(a);else t.push(i.toString())}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(i=function(){return o}.apply(e,[]))||(t.exports=i)}()},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ViewFinder=void 0;const o=i(n(0)),r=n(4),s=n(63),a=n(1);var c;!function(t){t[t.Right=0]="Right",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Up=3]="Up"}(c||(c={}));class l extends o.default.Component{constructor(){super(...arguments),this.BORDER_SIZE=2,this.TEXT_MARGIN=10}componentDidMount(){this.forceUpdate()}frame(){var t;const e=null===(t=this.container)||void 0===t?void 0:t.getBoundingClientRect(),n=r.Frame.fromRect(e);return this.forceUpdate(),n}computeClipPath(){var t,e,n;const i=null===(t=this.container)||void 0===t?void 0:t.getBoundingClientRect(),o=r.Frame.fromRect(i),a=r.Frame.fromRect(null===(e=this.overlay)||void 0===e?void 0:e.getBoundingClientRect()),c=r.Frame.fromRect(null===(n=this.window)||void 0===n?void 0:n.getBoundingClientRect());c.x=o.x-a.x,c.y=o.y-a.y;const l=s.ClipPath.fromFrames(a,c);return this.calculateClipPath(l)}get backgroundStyle(){const t=this.computeClipPath();return{backgroundColor:this.props.configuration.backgroundColor,position:"absolute",width:"100%",height:"100%",top:0,bottom:0,clipPath:t,webkitClipPath:t}}get containerStyle(){const t=this.props.configuration.window;return{left:t.left,top:t.top,transform:t.transform,position:"absolute"}}get windowStyle(){var t;const e=this.props.configuration.window;if(this.finderWidth=parseFloat(e.width),this.finderHeight=parseFloat(e.height),this.props.configuration.window.aspectRatio){const e=r.Frame.fromRect(null===(t=this.overlay)||void 0===t?void 0:t.getBoundingClientRect()),n=this.props.configuration.window.widthProportion<0||this.props.configuration.window.widthProportion>=1?1:this.props.configuration.window.widthProportion;if(this.finderWidth=e.width*n,this.finderHeight=this.finderWidth/this.props.configuration.window.aspectRatio,this.finderHeight>e.height){const t=this.finderHeight;this.finderHeight=e.height,this.finderWidth=this.finderHeight/t*this.finderWidth}}return{width:this.finderWidth,height:this.finderHeight,borderRadius:"10px",border:this.BORDER_SIZE+"px solid "+e.borderColor}}get textStyle(){const t=this.props.configuration.text;return{color:t.color,fontSize:t.size,fontWeight:t.weight,textAlign:"center",marginTop:this.TEXT_MARGIN+"px",width:this.finderWidth,position:"absolute"}}render(){return o.default.createElement("div",null,o.default.createElement("div",{ref:t=>this.overlay=t,style:this.backgroundStyle}),o.default.createElement("div",{ref:t=>this.container=t,style:this.containerStyle,id:"finder"},o.default.createElement("div",{ref:t=>{var e;this.window=t,this.props.onSizeChanged&&this.props.onSizeChanged(null===(e=this.window)||void 0===e?void 0:e.getBoundingClientRect())},style:this.windowStyle}),o.default.createElement("div",{style:this.textStyle},this.props.configuration.hint)))}calculateClipPath(t){return`polygon(\n \n 0% 0%, \n 0% 100%, \n \n ${t.left} 100%, \n\n ${this.roundClipPath(t.left,t.top,c.Right)}\n ${this.roundClipPath(t.right,t.top,c.Down)}\n ${this.roundClipPath(t.right,t.bottom,c.Left)}\n ${this.roundClipPath(t.left,t.bottom,c.Up)}\n\n ${t.left} 100%, \n 100% 100%, \n 100% 0%\n )`}roundClipPath(t,e,n){let i="";let o=new a.Point(s.ClipPath.toNumber(t),s.ClipPath.toNumber(e));switch(n){case c.Right:o.y+=10;break;case c.Down:o.x-=10;break;case c.Left:o.y-=10;break;case c.Up:o.x+=10}let r=[];switch(n){case c.Right:r=[{x:1,y:-3},{x:3,y:-5},{x:5,y:-7},{x:7,y:-9},{x:10,y:-10}];break;case c.Down:r=[{x:3,y:1},{x:5,y:3},{x:7,y:5},{x:9,y:7},{x:10,y:10}];break;case c.Left:r=[{x:-1,y:3},{x:-3,y:5},{x:-5,y:7},{x:-7,y:9},{x:-10,y:10}];break;case c.Up:r=[{x:-3,y:-1},{x:-5,y:-3},{x:-7,y:-5},{x:-9,y:-7},{x:-10,y:-10}];break;default:throw"Invalid ClipDirection"}return i+=this.addIncrements(o,r),i}addIncrements(t,e){let n="";return n+=t.x+"px "+t.y+"px, ",e.forEach((e=>{n+=t.x+e.x+"px "+(t.y+e.y)+"px, "})),n}}e.ViewFinder=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Debugger=void 0;e.Debugger=class{static warn(t){console.warn("[ScanbotSDK]",t)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"ServerStyleSheet",(function(){return Ft})),n.d(e,"StyleSheetConsumer",(function(){return it})),n.d(e,"StyleSheetContext",(function(){return nt})),n.d(e,"StyleSheetManager",(function(){return lt})),n.d(e,"ThemeConsumer",(function(){return Tt})),n.d(e,"ThemeContext",(function(){return Mt})),n.d(e,"ThemeProvider",(function(){return At})),n.d(e,"__PRIVATE__",(function(){return Vt})),n.d(e,"createGlobalStyle",(function(){return Bt})),n.d(e,"css",(function(){return _t})),n.d(e,"isStyledComponent",(function(){return _})),n.d(e,"keyframes",(function(){return jt})),n.d(e,"useTheme",(function(){return Ut})),n.d(e,"version",(function(){return w})),n.d(e,"withTheme",(function(){return Nt}));var i=n(22),o=n(0),r=n(34),s=n.n(r),a=n(35),c=n(36),l=n(24),u=n(23),d=n.n(u);function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var f=function(t,e){for(var n=[t[0]],i=0,o=e.length;i<o;i+=1)n.push(e[i],t[i+1]);return n},p=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!Object(i.typeOf)(t)},m=Object.freeze([]),g=Object.freeze({});function v(t){return"function"==typeof t}function y(t){return t.displayName||t.name||"Component"}function _(t){return t&&"string"==typeof t.styledComponentId}var b=void 0!==t&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",w="5.3.3",C="undefined"!=typeof window&&"HTMLElement"in window,S=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:void 0!==t&&void 0!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==t.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&t.env.REACT_APP_SC_DISABLE_SPEEDY:void 0!==t&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),x={};function E(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error("An error occurred. See https://git.io/JUIaE#"+t+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var P=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}var e=t.prototype;return e.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},e.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,o=i;t>=o;)(o<<=1)<0&&E(16,""+t);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var r=i;r<o;r++)this.groupSizes[r]=0}for(var s=this.indexOfGroup(t+1),a=0,c=e.length;a<c;a++)this.tag.insertRule(s,e[a])&&(this.groupSizes[t]++,s++)},e.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),i=n+e;this.groupSizes[t]=0;for(var o=n;o<i;o++)this.tag.deleteRule(n)}},e.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],i=this.indexOfGroup(t),o=i+n,r=i;r<o;r++)e+=this.tag.getRule(r)+"/*!sc*/\n";return e},t}(),k=new Map,D=new Map,O=1,M=function(t){if(k.has(t))return k.get(t);for(;D.has(O);)O++;var e=O++;return k.set(t,e),D.set(e,t),e},T=function(t){return D.get(t)},A=function(t,e){e>=O&&(O=e+1),k.set(t,e),D.set(e,t)},I="style["+b+'][data-styled-version="5.3.3"]',z=new RegExp("^"+b+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),R=function(t,e,n){for(var i,o=n.split(","),r=0,s=o.length;r<s;r++)(i=o[r])&&t.registerName(e,i)},L=function(t,e){for(var n=(e.textContent||"").split("/*!sc*/\n"),i=[],o=0,r=n.length;o<r;o++){var s=n[o].trim();if(s){var a=s.match(z);if(a){var c=0|parseInt(a[1],10),l=a[2];0!==c&&(A(l,c),R(t,l,a[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}},B=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},j=function(t){var e=document.head,n=t||e,i=document.createElement("style"),o=function(t){for(var e=t.childNodes,n=e.length;n>=0;n--){var i=e[n];if(i&&1===i.nodeType&&i.hasAttribute(b))return i}}(n),r=void 0!==o?o.nextSibling:null;i.setAttribute(b,"active"),i.setAttribute("data-styled-version","5.3.3");var s=B();return s&&i.setAttribute("nonce",s),n.insertBefore(i,r),i},F=function(){function t(t){var e=this.element=j(t);e.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,i=e.length;n<i;n++){var o=e[n];if(o.ownerNode===t)return o}E(17)}(e),this.length=0}var e=t.prototype;return e.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},e.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.getRule=function(t){var e=this.sheet.cssRules[t];return void 0!==e&&"string"==typeof e.cssText?e.cssText:""},t}(),N=function(){function t(t){var e=this.element=j(t);this.nodes=e.childNodes,this.length=0}var e=t.prototype;return e.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e),i=this.nodes[t];return this.element.insertBefore(n,i||null),this.length++,!0}return!1},e.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),U=function(){function t(t){this.rules=[],this.length=0}var e=t.prototype;return e.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},e.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),V=C,W={isServer:!C,useCSSOMInjection:!S},$=function(){function t(t,e,n){void 0===t&&(t=g),void 0===e&&(e={}),this.options=h({},W,{},t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&C&&V&&(V=!1,function(t){for(var e=document.querySelectorAll(I),n=0,i=e.length;n<i;n++){var o=e[n];o&&"active"!==o.getAttribute(b)&&(L(t,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}t.registerId=function(t){return M(t)};var e=t.prototype;return e.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(h({},this.options,{},e),this.gs,n&&this.names||void 0)},e.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.getTag=function(){return this.tag||(this.tag=(n=(e=this.options).isServer,i=e.useCSSOMInjection,o=e.target,t=n?new U(o):i?new F(o):new N(o),new P(t)));var t,e,n,i,o},e.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},e.registerName=function(t,e){if(M(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},e.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(M(t),n)},e.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.clearRules=function(t){this.getTag().clearGroup(M(t)),this.clearNames(t)},e.clearTag=function(){this.tag=void 0},e.toString=function(){return function(t){for(var e=t.getTag(),n=e.length,i="",o=0;o<n;o++){var r=T(o);if(void 0!==r){var s=t.names.get(r),a=e.getGroup(o);if(s&&a&&s.size){var c=b+".g"+o+'[id="'+r+'"]',l="";void 0!==s&&s.forEach((function(t){t.length>0&&(l+=t+",")})),i+=""+a+c+'{content:"'+l+'"}/*!sc*/\n'}}}return i}(this)},t}(),H=/(a)(d)/gi,G=function(t){return String.fromCharCode(t+(t>25?39:97))};function q(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=G(e%52)+n;return(G(e%52)+n).replace(H,"$1-$2")}var Z=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},Y=function(t){return Z(5381,t)};function J(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(v(n)&&!_(n))return!1}return!0}var K=Y("5.3.3"),X=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&J(t),this.componentId=e,this.baseHash=Z(K,e),this.baseStyle=n,$.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var i=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(t,e,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(i,this.staticRulesId))o.push(this.staticRulesId);else{var r=vt(this.rules,t,e,n).join(""),s=q(Z(this.baseHash,r)>>>0);if(!e.hasNameForId(i,s)){var a=n(r,"."+s,void 0,i);e.insertRules(i,s,a)}o.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,l=Z(this.baseHash,n.hash),u="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)u+=h;else if(h){var f=vt(h,t,e,n),p=Array.isArray(f)?f.join(""):f;l=Z(l,p+d),u+=p}}if(u){var m=q(l>>>0);if(!e.hasNameForId(i,m)){var g=n(u,"."+m,void 0,i);e.insertRules(i,m,g)}o.push(m)}}return o.join(" ")},t}(),Q=/^\s*\/\/.*$/gm,tt=[":","[",".","#"];function et(t){var e,n,i,o,r=void 0===t?g:t,s=r.options,c=void 0===s?g:s,l=r.plugins,u=void 0===l?m:l,d=new a.a(c),h=[],f=function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(n,i,o,r,s,a,c,l,u,d){switch(n){case 1:if(0===u&&64===i.charCodeAt(0))return t(i+";"),"";break;case 2:if(0===l)return i+"/*|*/";break;case 3:switch(l){case 102:case 112:return t(o[0]+i),"";default:return i+(0===d?"/*|*/":"")}case-2:i.split("/*|*/}").forEach(e)}}}((function(t){h.push(t)})),p=function(t,i,r){return 0===i&&-1!==tt.indexOf(r[n.length])||r.match(o)?t:"."+e};function v(t,r,s,a){void 0===a&&(a="&");var c=t.replace(Q,""),l=r&&s?s+" "+r+" { "+c+" }":c;return e=a,n=r,i=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),d(s||!r?"":r,l)}return d.use([].concat(u,[function(t,e,o){2===t&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(i,p))},f,function(t){if(-2===t){var e=h;return h=[],e}}])),v.hash=u.length?u.reduce((function(t,e){return e.name||E(15),Z(t,e.name)}),5381).toString():"",v}var nt=o.default.createContext(),it=nt.Consumer,ot=o.default.createContext(),rt=(ot.Consumer,new $),st=et();function at(){return Object(o.useContext)(nt)||rt}function ct(){return Object(o.useContext)(ot)||st}function lt(t){var e=Object(o.useState)(t.stylisPlugins),n=e[0],i=e[1],r=at(),a=Object(o.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target]),c=Object(o.useMemo)((function(){return et({options:{prefix:!t.disableVendorPrefixes},plugins:n})}),[t.disableVendorPrefixes,n]);return Object(o.useEffect)((function(){s()(n,t.stylisPlugins)||i(t.stylisPlugins)}),[t.stylisPlugins]),o.default.createElement(nt.Provider,{value:a},o.default.createElement(ot.Provider,{value:c},t.children))}var ut=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=st);var i=n.name+e.hash;t.hasNameForId(n.id,i)||t.insertRules(n.id,i,e(n.rules,i,"@keyframes"))},this.toString=function(){return E(12,String(n.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=e}return t.prototype.getName=function(t){return void 0===t&&(t=st),this.name+t.hash},t}(),dt=/([A-Z])/,ht=/([A-Z])/g,ft=/^ms-/,pt=function(t){return"-"+t.toLowerCase()};function mt(t){return dt.test(t)?t.replace(ht,pt).replace(ft,"-ms-"):t}var gt=function(t){return null==t||!1===t||""===t};function vt(t,e,n,i){if(Array.isArray(t)){for(var o,r=[],s=0,a=t.length;s<a;s+=1)""!==(o=vt(t[s],e,n,i))&&(Array.isArray(o)?r.push.apply(r,o):r.push(o));return r}return gt(t)?"":_(t)?"."+t.styledComponentId:v(t)?"function"!=typeof(l=t)||l.prototype&&l.prototype.isReactComponent||!e?t:vt(t(e),e,n,i):t instanceof ut?n?(t.inject(n,i),t.getName(i)):t:p(t)?function t(e,n){var i,o,r=[];for(var s in e)e.hasOwnProperty(s)&&!gt(e[s])&&(Array.isArray(e[s])&&e[s].isCss||v(e[s])?r.push(mt(s)+":",e[s],";"):p(e[s])?r.push.apply(r,t(e[s],s)):r.push(mt(s)+": "+(i=s,(null==(o=e[s])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||i in c.a?String(o).trim():o+"px")+";")));return n?[n+" {"].concat(r,["}"]):r}(t):t.toString();var l}var yt=function(t){return Array.isArray(t)&&(t.isCss=!0),t};function _t(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return v(t)||p(t)?yt(vt(f(m,[t].concat(n)))):0===n.length&&1===t.length&&"string"==typeof t[0]?t:yt(vt(f(t,n)))}new Set;var bt=function(t,e,n){return void 0===n&&(n=g),t.theme!==n.theme&&t.theme||e||n.theme},wt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ct=/(^-|-$)/g;function St(t){return t.replace(wt,"-").replace(Ct,"")}var xt=function(t){return q(Y(t)>>>0)};function Et(t){return"string"==typeof t&&!0}var Pt=function(t){return"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)},kt=function(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t};function Dt(t,e,n){var i=t[n];Pt(e)&&Pt(i)?Ot(i,e):t[n]=e}function Ot(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];if(Pt(s))for(var a in s)kt(a)&&Dt(t,s[a],a)}return t}var Mt=o.default.createContext(),Tt=Mt.Consumer;function At(t){var e=Object(o.useContext)(Mt),n=Object(o.useMemo)((function(){return function(t,e){return t?v(t)?t(e):Array.isArray(t)||"object"!=typeof t?E(8):e?h({},e,{},t):t:E(14)}(t.theme,e)}),[t.theme,e]);return t.children?o.default.createElement(Mt.Provider,{value:n},t.children):null}var It={};function zt(t,e,n){var i=_(t),r=!Et(t),s=e.attrs,a=void 0===s?m:s,c=e.componentId,u=void 0===c?function(t,e){var n="string"!=typeof t?"sc":St(t);It[n]=(It[n]||0)+1;var i=n+"-"+xt("5.3.3"+n+It[n]);return e?e+"-"+i:i}(e.displayName,e.parentComponentId):c,f=e.displayName,p=void 0===f?function(t){return Et(t)?"styled."+t:"Styled("+y(t)+")"}(t):f,b=e.displayName&&e.componentId?St(e.displayName)+"-"+e.componentId:e.componentId||u,w=i&&t.attrs?Array.prototype.concat(t.attrs,a).filter(Boolean):a,C=e.shouldForwardProp;i&&t.shouldForwardProp&&(C=e.shouldForwardProp?function(n,i,o){return t.shouldForwardProp(n,i,o)&&e.shouldForwardProp(n,i,o)}:t.shouldForwardProp);var S,x=new X(n,b,i?t.componentStyle:void 0),E=x.isStatic&&0===a.length,P=function(t,e){return function(t,e,n,i){var r=t.attrs,s=t.componentStyle,a=t.defaultProps,c=t.foldedComponentIds,u=t.shouldForwardProp,d=t.styledComponentId,f=t.target,p=function(t,e,n){void 0===t&&(t=g);var i=h({},e,{theme:t}),o={};return n.forEach((function(t){var e,n,r,s=t;for(e in v(s)&&(s=s(i)),s)i[e]=o[e]="className"===e?(n=o[e],r=s[e],n&&r?n+" "+r:n||r):s[e]})),[i,o]}(bt(e,Object(o.useContext)(Mt),a)||g,e,r),m=p[0],y=p[1],_=function(t,e,n,i){var o=at(),r=ct();return e?t.generateAndInjectStyles(g,o,r):t.generateAndInjectStyles(n,o,r)}(s,i,m),b=n,w=y.$as||e.$as||y.as||e.as||f,C=Et(w),S=y!==e?h({},e,{},y):e,x={};for(var E in S)"$"!==E[0]&&"as"!==E&&("forwardedAs"===E?x.as=S[E]:(u?u(E,l.a,w):!C||Object(l.a)(E))&&(x[E]=S[E]));return e.style&&y.style!==e.style&&(x.style=h({},e.style,{},y.style)),x.className=Array.prototype.concat(c,d,_!==d?_:null,e.className,y.className).filter(Boolean).join(" "),x.ref=b,Object(o.createElement)(w,x)}(S,t,e,E)};return P.displayName=p,(S=o.default.forwardRef(P)).attrs=w,S.componentStyle=x,S.displayName=p,S.shouldForwardProp=C,S.foldedComponentIds=i?Array.prototype.concat(t.foldedComponentIds,t.styledComponentId):m,S.styledComponentId=b,S.target=i?t.target:t,S.withComponent=function(t){var i=e.componentId,o=function(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(o[n]=t[n]);return o}(e,["componentId"]),r=i&&i+"-"+(Et(t)?t:St(y(t)));return zt(t,h({},o,{attrs:w,componentId:r}),n)},Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?Ot({},t.defaultProps,e):e}}),S.toString=function(){return"."+S.styledComponentId},r&&d()(S,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),S}var Rt=function(t){return function t(e,n,o){if(void 0===o&&(o=g),!Object(i.isValidElementType)(n))return E(1,String(n));var r=function(){return e(n,o,_t.apply(void 0,arguments))};return r.withConfig=function(i){return t(e,n,h({},o,{},i))},r.attrs=function(i){return t(e,n,h({},o,{attrs:Array.prototype.concat(o.attrs,i).filter(Boolean)}))},r}(zt,t)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(t){Rt[t]=Rt(t)}));var Lt=function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=J(t),$.registerId(this.componentId+1)}var e=t.prototype;return e.createStyles=function(t,e,n,i){var o=i(vt(this.rules,e,n,i).join(""),""),r=this.componentId+t;n.insertRules(r,r,o)},e.removeStyles=function(t,e){e.clearRules(this.componentId+t)},e.renderStyles=function(t,e,n,i){t>2&&$.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,i)},t}();function Bt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=_t.apply(void 0,[t].concat(n)),s="sc-global-"+xt(JSON.stringify(r)),a=new Lt(r,s);function c(t){var e=at(),n=ct(),i=Object(o.useContext)(Mt),r=Object(o.useRef)(e.allocateGSInstance(s)).current;return e.server&&l(r,t,e,i,n),Object(o.useLayoutEffect)((function(){if(!e.server)return l(r,t,e,i,n),function(){return a.removeStyles(r,e)}}),[r,t,e,i,n]),null}function l(t,e,n,i,o){if(a.isStatic)a.renderStyles(t,x,n,o);else{var r=h({},e,{theme:bt(e,i,c.defaultProps)});a.renderStyles(t,r,n,o)}}return o.default.memo(c)}function jt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var o=_t.apply(void 0,[t].concat(n)).join(""),r=xt(o);return new ut(r,o)}var Ft=function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var n=B();return"<style "+[n&&'nonce="'+n+'"',b+'="true"','data-styled-version="5.3.3"'].filter(Boolean).join(" ")+">"+e+"</style>"},this.getStyleTags=function(){return t.sealed?E(2):t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)return E(2);var n=((e={})[b]="",e["data-styled-version"]="5.3.3",e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),i=B();return i&&(n.nonce=i),[o.default.createElement("style",h({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new $({isServer:!0}),this.sealed=!1}var e=t.prototype;return e.collectStyles=function(t){return this.sealed?E(2):o.default.createElement(lt,{sheet:this.instance},t)},e.interleaveWithNodeStream=function(t){return E(3)},t}(),Nt=function(t){var e=o.default.forwardRef((function(e,n){var i=Object(o.useContext)(Mt),r=t.defaultProps,s=bt(e,i,r);return o.default.createElement(t,h({},e,{theme:s,ref:n}))}));return d()(e,t),e.displayName="WithTheme("+y(t)+")",e},Ut=function(){return Object(o.useContext)(Mt)},Vt={StyleSheet:$,masterSheet:rt};e.default=Rt}.call(this,n(68))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i{}e.default=i,i.ScanbotPrimary="#c8193c",i.Orange="#FF5533",i.White="#FFFFFF",i.TransparentGreen="rgba(0, 255, 0, 0.5)",i.TransparentGray="rgba(50, 50, 50, 0.5)"},function(t,e,n){"use strict";var i=n(13),o=n.n(i)()((function(t){return t[1]}));o.push([t.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 12px;\n transform: translate(-50%, -100%);\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),e.a=o},function(t,e,n){"use strict";var i=n(13),o=n.n(i)()((function(t){return t[1]}));o.push([t.i,"\n.scanbot-document-outline {\n stroke: yellow;\n stroke-width: 2px;\n fill: none;\n}\n\n.scanbot-document-outline-ok {\n stroke: green;\n}\n\n.scanbot-document-outline-visible {\n opacity: 1;\n transition: opacity .3s ease-in-out;\n}\n\n.scanbot-document-outline-hidden {\n opacity: 0;\n transition: opacity .3s ease-in-out;\n}\n\n.scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),e.a=o},function(t,e,n){"use strict";t.exports=n(69)},function(t,e,n){"use strict";var i=n(70),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(t){return i.isMemo(t)?s:a[t.$$typeof]||o}a[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[i.Memo]=s;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,i){if("string"!=typeof n){if(p){var o=f(n);o&&o!==p&&t(e,o,i)}var s=u(n);d&&(s=s.concat(d(n)));for(var a=c(e),m=c(n),g=0;g<s.length;++g){var v=s[g];if(!(r[v]||i&&i[v]||m&&m[v]||a&&a[v])){var y=h(n,v);try{l(e,v,y)}catch(t){}}}}return e}},function(t,e,n){"use strict";var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.a=o},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0;i(n(39));var o="2.13.2-alpha.3";class r{}e.Constants=r,r.VERSION=o,r.CDN_PATH=`https://cdn.jsdelivr.net/npm/scanbot-web-sdk@${o}/bundle/`,r.DEFAULT_WASM_FOLDER="bin/complete/"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentScannerConfiguration=e.TextConfiguration=void 0;const i=n(7),o={OK:"Capturing your document... Please do not move the camera.",OK_SmallSize:"The document is too small. Try moving closer.",OK_BadAngles:"This is a bad camera angle. Hold the device straight over the document.",OK_BadAspectRatio:"Rotate the device sideways, so that the document fits better into the screen.",OK_OffCenter:"Try holding the device at the center of the document.",Error_NothingDetected:"Please hold the device over a document to start scanning.",Error_Brightness:"It is too dark. Try turning on a light.",Error_Noise:"Please move the document to a clear surface."};class r{constructor(t){this.hint=t}}e.TextConfiguration=r;class s{constructor(){this.outline=new a,this.captureButton=new u}}class a{constructor(){this.polygon=new c,this.label=new l}}class c{}class l{}class u{constructor(){this.color="#FFF"}}class d extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_4K),this.acceptedAngleScore=d.DEFAULT_ACCEPTED_ANGLE_SCORE,this.acceptedSizeScore=d.DEFAULT_ACCEPTED_SIZE_SCORE,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.ignoreBadAspectRatio=!0,this.text=new r(o),this.style=new s,this.onDocumentDetected=function(t){}}static fromJson(t){const e=new d;if(this.mapValues(t,e,["text","style","videoConstraints"]),t.text&&t.text.hint&&this.mapValues(t.text.hint,e.text.hint),t.style){this.mapValues(t.style,e.style,["outline","captureButton"]);const n=t.style.outline;if(n){this.mapValues(n,e.style.outline,["polygon","label"]);const t=n.polygon;t&&this.mapValues(t,e.style.outline.polygon);const i=n.label;i&&this.mapValues(i,e.style.outline.label)}const i=t.style.captureButton;i&&this.mapValues(i,e.style.captureButton)}return this.mapVideoConstraints(t,e),e}}e.DocumentScannerConfiguration=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseConfiguration=void 0;e.BaseConfiguration=class{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((i=>{(null==n?void 0:n.includes(i))||(e[i]=t[i])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(3),o=n(8);e.default=class{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=o.Utils.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});i.ImageUtils.saveBlob(n,e)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let t=this.findFlashElement();t.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{t.style.opacity="1.0",t.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(t,e){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=t,e()}),150)}getOrCreateElement(t,e){let n=this.getElementByClassName(t);return n||(this.createElement(t,e),n=this.getElementByClassName(t)),n}createElement(t,e){let n=document.createElement("div");n.className=t,n.style.cssText=this.cssToString(e),document.body.append(n)}cssToString(t){let e="";return Object.keys(t).forEach((n=>{e+=n+":"+t[n]+";"})),e}getElementByClassName(t){const e=document.getElementsByClassName(t);if(0!==e.length)return e[0]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaError=void 0;class i extends Error{constructor(t,e){super(e),this.name="UnknownError",this.name=t}static notAvailable(t){return new i("MediaNotAvailableError",t)}static permissionError(t){return new i("MediaPermissionError",t)}static unsupportedMediaDevices(t){return new i("UnsupportedMediaDevicesError",t)}static unsupportedOperationError(t){return new i("UnsupportedOperationError",t)}static unknownError(t){return new i("UnknownError",t)}}e.MediaError=i},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ShutterButton=e.ShutterButtonProps=void 0;const o=i(n(0));n(55);const r=i(n(15));e.ShutterButtonProps=class{};class s{constructor(t){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=t}setDuration(t){const e=Date.now()/1e3,n=e-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const i=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${i}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class a extends o.default.Component{constructor(){super(...arguments),this.inner1=new s("scanbot-shutter-rotate"),this.inner2=new s("scanbot-shutter-rotate")}render(){return o.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(t){"searching"==t?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,o.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==t||"manual"==t,"scanbot-shutter-fade-out":"searching"==t||"capturing"==t,"scanbot-shutter-pulse-fast":"processing"==t},o.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},o.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},o.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(t=>{this.inner1.element=t}))}captureSearchingInner2(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},o.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(t=>{this.inner2.element=t}))}path(t){return o.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return o.default.createElement("div",{className:(0,r.default)(t),ref:n},o.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}e.ShutterButton=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=void 0;e.MathUtils=class{static isConvex(t){if(t.length<4)return!0;let e=!1,n=t.length;for(let i=0;i<n;i++){const o=t[(i+2)%n].x-t[(i+1)%n].x,r=t[(i+2)%n].y-t[(i+1)%n].y,s=t[i].x-t[(i+1)%n].x,a=o*(t[i].y-t[(i+1)%n].y)-r*s;if(0==i)e=a>0;else if(e!=a>0)return!1}return!0}static distanceBetweenPoints(t,e){return Math.pow(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),.5)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeOverlay=void 0;e.BarcodeOverlay=class{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DraggableBaseContainer=void 0;const o=i(n(0));class r extends o.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var t,e;return(null===(t=this.props.style)||void 0===t?void 0:t.size)?(null===(e=this.props)||void 0===e?void 0:e.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var t,e;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(t=this.props.style)||void 0===t?void 0:t.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(e=this.props.style)||void 0===e?void 0:e.color,position:"absolute",cursor:"pointer",zIndex:500}}nextIndex(t){return(t+1)%this.POINT_COUNT}previousIndex(t){return(t-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(t){return t%2==0}isOutOfBounds(t,e){return t<-this.DRAG_BUFFER||t>e+this.DRAG_BUFFER}}e.DraggableBaseContainer=r},function(t,e){t.exports=function(t,e,n,i){var o=n?n.call(i,t,e):void 0;if(void 0!==o)return!!o;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),c=0;c<r.length;c++){var l=r[c];if(!a(l))return!1;var u=t[l],d=e[l];if(!1===(o=n?n.call(i,u,d,l):void 0)||void 0===o&&u!==d)return!1}return!0}},function(t,e,n){"use strict";e.a=function(t){function e(t,i,c,l,h){for(var f,p,m,g,b,C=0,S=0,x=0,E=0,P=0,A=0,z=m=f=0,L=0,B=0,j=0,F=0,N=c.length,U=N-1,V="",W="",$="",H="";L<N;){if(p=c.charCodeAt(L),L===U&&0!==S+E+x+C&&(0!==S&&(p=47===S?10:47),E=x=C=0,N++,U++),0===S+E+x+C){if(L===U&&(0<B&&(V=V.replace(d,"")),0<V.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:V+=c.charAt(L)}p=59}switch(p){case 123:for(f=(V=V.trim()).charCodeAt(0),m=1,F=++L;L<N;){switch(p=c.charCodeAt(L)){case 123:m++;break;case 125:m--;break;case 47:switch(p=c.charCodeAt(L+1)){case 42:case 47:t:{for(z=L+1;z<U;++z)switch(c.charCodeAt(z)){case 47:if(42===p&&42===c.charCodeAt(z-1)&&L+2!==z){L=z+1;break t}break;case 10:if(47===p){L=z+1;break t}}L=z}}break;case 91:p++;case 40:p++;case 34:case 39:for(;L++<U&&c.charCodeAt(L)!==p;);}if(0===m)break;L++}if(m=c.substring(F,L),0===f&&(f=(V=V.replace(u,"").trim()).charCodeAt(0)),64===f){switch(0<B&&(V=V.replace(d,"")),p=V.charCodeAt(1)){case 100:case 109:case 115:case 45:B=i;break;default:B=T}if(F=(m=e(i,B,m,p,h+1)).length,0<I&&(b=a(3,m,B=n(T,V,j),i,D,k,F,p,h,l),V=B.join(""),void 0!==b&&0===(F=(m=b.trim()).length)&&(p=0,m="")),0<F)switch(p){case 115:V=V.replace(w,s);case 100:case 109:case 45:m=V+"{"+m+"}";break;case 107:m=(V=V.replace(v,"$1 $2"))+"{"+m+"}",m=1===M||2===M&&r("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=V+m,112===l&&(W+=m,m="")}else m=""}else m=e(i,n(i,V,j),m,l,h+1);$+=m,m=j=B=z=f=0,V="",p=c.charCodeAt(++L);break;case 125:case 59:if(1<(F=(V=(0<B?V.replace(d,""):V).trim()).length))switch(0===z&&(f=V.charCodeAt(0),45===f||96<f&&123>f)&&(F=(V=V.replace(" ",":")).length),0<I&&void 0!==(b=a(1,V,i,t,D,k,W.length,l,h,l))&&0===(F=(V=b.trim()).length)&&(V="\0\0"),f=V.charCodeAt(0),p=V.charCodeAt(1),f){case 0:break;case 64:if(105===p||99===p){H+=V+c.charAt(L);break}default:58!==V.charCodeAt(F-1)&&(W+=o(V,f,p,V.charCodeAt(2)))}j=B=z=f=0,V="",p=c.charCodeAt(++L)}}switch(p){case 13:case 10:47===S?S=0:0===1+f&&107!==l&&0<V.length&&(B=1,V+="\0"),0<I*R&&a(0,V,i,t,D,k,W.length,l,h,l),k=1,D++;break;case 59:case 125:if(0===S+E+x+C){k++;break}default:switch(k++,g=c.charAt(L),p){case 9:case 32:if(0===E+C+S)switch(P){case 44:case 58:case 9:case 32:g="";break;default:32!==p&&(g=" ")}break;case 0:g="\\0";break;case 12:g="\\f";break;case 11:g="\\v";break;case 38:0===E+S+C&&(B=j=1,g="\f"+g);break;case 108:if(0===E+S+C+O&&0<z)switch(L-z){case 2:112===P&&58===c.charCodeAt(L-3)&&(O=P);case 8:111===A&&(O=A)}break;case 58:0===E+S+C&&(z=L);break;case 44:0===S+x+E+C&&(B=1,g+="\r");break;case 34:case 39:0===S&&(E=E===p?0:0===E?p:E);break;case 91:0===E+S+x&&C++;break;case 93:0===E+S+x&&C--;break;case 41:0===E+S+C&&x--;break;case 40:if(0===E+S+C){if(0===f)if(2*P+3*A==533);else f=1;x++}break;case 64:0===S+x+E+C+z+m&&(m=1);break;case 42:case 47:if(!(0<E+C+x))switch(S){case 0:switch(2*p+3*c.charCodeAt(L+1)){case 235:S=47;break;case 220:F=L,S=42}break;case 42:47===p&&42===P&&F+2!==L&&(33===c.charCodeAt(F+2)&&(W+=c.substring(F,L+1)),g="",S=0)}}0===S&&(V+=g)}A=P,P=p,L++}if(0<(F=W.length)){if(B=i,0<I&&(void 0!==(b=a(2,W,B,t,D,k,F,l,h,l))&&0===(W=b).length))return H+W+$;if(W=B.join(",")+"{"+W+"}",0!=M*O){switch(2!==M||r(W,2)||(O=0),O){case 111:W=W.replace(_,":-moz-$1")+W;break;case 112:W=W.replace(y,"::-webkit-input-$1")+W.replace(y,"::-moz-$1")+W.replace(y,":-ms-input-$1")+W}O=0}}return H+W+$}function n(t,e,n){var o=e.trim().split(m);e=o;var r=o.length,s=t.length;switch(s){case 0:case 1:var a=0;for(t=0===s?"":t[0]+" ";a<r;++a)e[a]=i(t,e[a],n).trim();break;default:var c=a=0;for(e=[];a<r;++a)for(var l=0;l<s;++l)e[c++]=i(t[l]+" ",o[a],n).trim()}return e}function i(t,e,n){var i=e.charCodeAt(0);switch(33>i&&(i=(e=e.trim()).charCodeAt(0)),i){case 38:return e.replace(g,"$1"+t.trim());case 58:return t.trim()+e.replace(g,"$1"+t.trim());default:if(0<1*n&&0<e.indexOf("\f"))return e.replace(g,(58===t.charCodeAt(0)?"":"$1")+t.trim())}return t+e}function o(t,e,n,i){var s=t+";",a=2*e+3*n+4*i;if(944===a){t=s.indexOf(":",9)+1;var c=s.substring(t,s.length-1).trim();return c=s.substring(0,t).trim()+c+";",1===M||2===M&&r(c,1)?"-webkit-"+c+c:c}if(0===M||2===M&&!r(s,1))return s;switch(a){case 1015:return 97===s.charCodeAt(10)?"-webkit-"+s+s:s;case 951:return 116===s.charCodeAt(3)?"-webkit-"+s+s:s;case 963:return 110===s.charCodeAt(5)?"-webkit-"+s+s:s;case 1009:if(100!==s.charCodeAt(4))break;case 969:case 942:return"-webkit-"+s+s;case 978:return"-webkit-"+s+"-moz-"+s+s;case 1019:case 983:return"-webkit-"+s+"-moz-"+s+"-ms-"+s+s;case 883:if(45===s.charCodeAt(8))return"-webkit-"+s+s;if(0<s.indexOf("image-set(",11))return s.replace(P,"$1-webkit-$2")+s;break;case 932:if(45===s.charCodeAt(4))switch(s.charCodeAt(5)){case 103:return"-webkit-box-"+s.replace("-grow","")+"-webkit-"+s+"-ms-"+s.replace("grow","positive")+s;case 115:return"-webkit-"+s+"-ms-"+s.replace("shrink","negative")+s;case 98:return"-webkit-"+s+"-ms-"+s.replace("basis","preferred-size")+s}return"-webkit-"+s+"-ms-"+s+s;case 964:return"-webkit-"+s+"-ms-flex-"+s+s;case 1023:if(99!==s.charCodeAt(8))break;return"-webkit-box-pack"+(c=s.substring(s.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+s+"-ms-flex-pack"+c+s;case 1005:return f.test(s)?s.replace(h,":-webkit-")+s.replace(h,":-moz-")+s:s;case 1e3:switch(e=(c=s.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(e)){case 226:c=s.replace(b,"tb");break;case 232:c=s.replace(b,"tb-rl");break;case 220:c=s.replace(b,"lr");break;default:return s}return"-webkit-"+s+"-ms-"+c+s;case 1017:if(-1===s.indexOf("sticky",9))break;case 975:switch(e=(s=t).length-10,a=(c=(33===s.charCodeAt(e)?s.substring(0,e):s).substring(t.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:s=s.replace(c,"-webkit-"+c)+";"+s;break;case 207:case 102:s=s.replace(c,"-webkit-"+(102<a?"inline-":"")+"box")+";"+s.replace(c,"-webkit-"+c)+";"+s.replace(c,"-ms-"+c+"box")+";"+s}return s+";";case 938:if(45===s.charCodeAt(5))switch(s.charCodeAt(6)){case 105:return c=s.replace("-items",""),"-webkit-"+s+"-webkit-box-"+c+"-ms-flex-"+c+s;case 115:return"-webkit-"+s+"-ms-flex-item-"+s.replace(S,"")+s;default:return"-webkit-"+s+"-ms-flex-line-pack"+s.replace("align-content","").replace(S,"")+s}break;case 973:case 989:if(45!==s.charCodeAt(3)||122===s.charCodeAt(4))break;case 931:case 953:if(!0===E.test(t))return 115===(c=t.substring(t.indexOf(":")+1)).charCodeAt(0)?o(t.replace("stretch","fill-available"),e,n,i).replace(":fill-available",":stretch"):s.replace(c,"-webkit-"+c)+s.replace(c,"-moz-"+c.replace("fill-",""))+s;break;case 962:if(s="-webkit-"+s+(102===s.charCodeAt(5)?"-ms-"+s:"")+s,211===n+i&&105===s.charCodeAt(13)&&0<s.indexOf("transform",10))return s.substring(0,s.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+s}return s}function r(t,e){var n=t.indexOf(1===e?":":"{"),i=t.substring(0,3!==e?n:10);return n=t.substring(n+1,t.length-1),z(2!==e?i:i.replace(x,"$1"),n,e)}function s(t,e){var n=o(e,e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2));return n!==e+";"?n.replace(C," or ($1)").substring(4):"("+e+")"}function a(t,e,n,i,o,r,s,a,c,u){for(var d,h=0,f=e;h<I;++h)switch(d=A[h].call(l,t,f,n,i,o,r,s,a,c,u)){case void 0:case!1:case!0:case null:break;default:f=d}if(f!==e)return f}function c(t){return void 0!==(t=t.prefix)&&(z=null,t?"function"!=typeof t?M=1:(M=2,z=t):M=0),c}function l(t,n){var i=t;if(33>i.charCodeAt(0)&&(i=i.trim()),i=[i],0<I){var o=a(-1,n,i,i,D,k,0,0,0,0);void 0!==o&&"string"==typeof o&&(n=o)}var r=e(T,i,n,0,0);return 0<I&&(void 0!==(o=a(-2,r,i,i,D,k,r.length,0,0,0))&&(r=o)),"",O=0,k=D=1,r}var u=/^\0+/g,d=/[\0\r\f]/g,h=/: */g,f=/zoo|gra/,p=/([,: ])(transform)/g,m=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,_=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,S=/-self|flex-/g,x=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,k=1,D=1,O=0,M=1,T=[],A=[],I=0,z=null,R=0;return l.use=function t(e){switch(e){case void 0:case null:I=A.length=0;break;default:if("function"==typeof e)A[I++]=e;else if("object"==typeof e)for(var n=0,i=e.length;n<i;++n)t(e[n]);else R=0|!!e}return t},l.set=c,void 0!==t&&c(t),l}},function(t,e,n){"use strict";e.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ScanbotSDK=void 0;const o=i(n(6));e.ScanbotSDK=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;const i=n(25),o=n(40);class r{constructor(t){let e;if(t||(t=i.Constants.CDN_PATH+i.Constants.DEFAULT_WASM_FOLDER),function(t){return-1!==t.indexOf("http")}(t+=r.ASM_JS)){const n=new Blob([`importScripts("${t}")`]);e=new Worker(URL.createObjectURL(n))}else e=new Worker(t);this.core=new o.WorkerBridge(e)}postByCopyingArgs(t,e){return this.core.postByCopyingArgs(t,e)}postByTransferringArgs(t,e){return this.core.postByTransferringArgs(t,e)}}e.WorkerBridge=r,r.ASM_JS="ScanbotSDK.Core.js"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=""},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;var i=n(41);e.WorkerBridge=class{constructor(t){this.instance=t,this.continuations={},t.onmessage=t=>{const{ticket:e,result:n,error:i}=t.data,{resolve:o,reject:r}=this.continuations[e];delete this.continuations[e],i?r(i):o(n)}}post(t,e,n){return new Promise(((o,r)=>{const s=(0,i.gatherTransferables)(e,n),a=Math.random().toString(36);this.continuations[a]={resolve:o,reject:r},this.instance.postMessage({command:t,args:e,ticket:a},s)}))}postByCopyingArgs(t,e){return this.post(t,e,!0)}postByTransferringArgs(t,e){return this.post(t,e,!1)}destroy(){this.instance.terminate()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gatherTransferables=function(t,e){const n=[];return function t(i){if(!i)return;if(i.constructor===ImageData){const t={data:i.data.slice(),width:i.width,height:i.height};return n.push(t.data.buffer),t}if(i.constructor===ArrayBuffer){const t=e?i.slice(0):i;if(n.push(t),e)return i}else if(ArrayBuffer.isView(i)){let t;if(e){t=new(0,i.constructor)(i.buffer.slice(0))}else t=i;if(n.push(t.buffer),e)return i}else if(Array.isArray(i))for(let e=0;e<i.length;++e){const n=t(i[e]);n&&(i[e]=n)}else if(i.constructor===Object)for(const e in i)if(i.hasOwnProperty(e)){const n=t(i[e]);n&&(i[e]=n)}}(t),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LicenseInfo=void 0;class i{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new i;return e.status=t.licenseStatus,e.description=t.description,e}}e.LicenseInfo=i},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByCopyingArgs("addPageToPdf",[this._pdfOperation,t])}))}complete(){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completePdf",[this._pdfOperation])}))}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByCopyingArgs("addPageToTiff",[this._tiffOperation,t])}))}complete(){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completeTiff",[this._tiffOperation])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Barcode=void 0;const i=n(1);class o{constructor(t,e,n,i,o,r){this.format=t,this.text=e,this.parsedText=n,this.rawBytes=i,this.points=o,this.barcodeImage=r}equals(t){return this.format===t.format&&this.text===t.text}static fromWorker(t){let e;if(""!==t.parsedText)try{e=JSON.parse(t.parsedText)}catch(t){}const n=t.quad.map((t=>new i.Point(t[0],t[1])));return new o(t.format,t.text,e,t.rawBytes,n,t.barcodeImage)}}e.Barcode=o},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(47);e.default=class{constructor(t,e){this._sdk=t,this._mrzRecognizerToken=e}recognize(t){return i(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeMRZ",[this._mrzRecognizerToken,t]);if(null===e)return;return o.MrzResult.fromWorker(e)}catch(t){return void console.warn(t)}}))}recognizeURL(t){return i(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);r&&e(r)}))}))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._mrzRecognizerToken])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MrzResult=e.MrzCheckDigits=e.MrzField=void 0;class i{constructor(t,e,n,i){this.value=e,this.confidence=n,this.validated=i,this.name=t}}e.MrzField=i;class o{}e.MrzCheckDigits=o;class r{static fromWorker(t){let e=new r;const n=new o,s=t.recognitionSuccessful;return(t.fields||[]).forEach((t=>{switch(t.name){case"DocumentNumber":e.documentNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"IssuingAuthority":e.issuingAuthority=new i(t.name,t.text,t.confidence,t.validated);break;case"DepartmentOfIssuance":e.departmentOfIssuance=new i(t.name,t.text,t.confidence,t.validated);break;case"GivenNames":e.givenNames=new i(t.name,t.text,t.confidence,t.validated);break;case"Surname":e.surname=new i(t.name,t.text,t.confidence,t.validated);break;case"Nationality":e.nationality=new i(t.name,t.text,t.confidence,t.validated);break;case"BirthDate":e.birthDate=new i(t.name,t.text,t.confidence,t.validated);break;case"Gender":e.gender=new i(t.name,t.text,t.confidence,t.validated);break;case"ExpiryDate":e.expiryDate=new i(t.name,t.text,t.confidence,t.validated);break;case"PersonalNumber":e.personalNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"TravelDocType":e.travelDocType=new i(t.name,t.text,t.confidence,t.validated);break;case"TravelDocTypeVariant":e.travelDocTypeVariant=new i(t.name,t.text,t.confidence,t.validated);break;case"DiscreetIssuingStateOrOrganization":e.discreetIssuingStateOrOrganization=new i(t.name,t.text,t.confidence,t.validated);break;case"DocumentTypeCode":e.kindOfDocumentField=new i(t.name,t.text,t.confidence,t.validated);break;case"DocumentType":e.documentType=new i(t.name,t.text,t.confidence,t.validated);break;case"Format":e.format=new i(t.name,t.text,t.confidence,t.validated);break;case"PINCode":e.pinCode=new i(t.name,t.text,t.confidence,t.validated);break;case"LanguageCode":e.languageCode=new i(t.name,t.text,t.confidence,t.validated);break;case"VersionNumber":e.versionNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitGeneral":n.general=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitDocumentNumber":n.documentNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitBirthDate":n.birthDate=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitExpiryDate":n.expiryDate=new i(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitPersonalNumber":n.personalNumber=new i(t.name,t.text,t.confidence,t.validated);break;case"Optional1":e.optional1=new i(t.name,t.text,t.confidence,t.validated);break;case"Optional2":e.optional2=new i(t.name,t.text,t.confidence,t.validated)}})),e.documentType||(e.documentType=new i("DocumentType",t.documentType)),s?e.checkDigits=n:e=void 0,e}}e.MrzResult=r},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("performOcr",[this._OcrEngineToken,t])}))}recognizeURL(t){return i(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._OcrEngineToken])}))}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(3);e.default=class{constructor(t,e){this._sdk=t,this._token=e}estimateBlurriness(t){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("estimateBlurriness",[this._token,t])}))}estimateBlurrinessOnBuffer(t){return i(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("estimateBlurrinessOnBuffer",[this._token,t.slice(0)])}))}estimateBlurrinessURL(t){return i(this,void 0,void 0,(function*(){return yield this.estimateBlurriness(yield o.ImageUtils.loadFromUrl(t))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._token])}))}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(51);e.default=class{constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t){return i(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeTextLine",[this._textDataScannerToken,t]);if(null===e)return;return o.TextDataScannerResult.fromWorker(e)}catch(t){return void console.warn(t)}}))}cleanRecognitionQueue(){return i(this,void 0,void 0,(function*(){try{yield this._sdk.bridge.postByTransferringArgs("cleanTextLineRecognitionQueue",[this._textDataScannerToken])}catch(t){return void console.warn(t)}}))}recognizeURL(t){return i(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>i(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);r&&e(r)}))}))}))}release(){return i(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._textDataScannerToken])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDataScannerResult=void 0;class i{static fromWorker(t){if(!t)return;const e=new i;return e.text=t.rawText,e.confidence=t.confidence,e.validated=t.validationSuccessful,e}}e.TextDataScannerResult=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LicenseError=void 0;class i extends Error{constructor(t){super(t.description),this.name="LicenseError"}}e.LicenseError=i},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=o(n(0)),s=n(0),a=o(n(6)),c=n(26),l=n(5),u=n(2),d=n(1),h=n(9),f=n(30),p=n(56),m=o(n(11)),g=n(8),v=n(60);h.ScanbotCameraState;h.ScanbotCameraProps;class y extends h.ScannerView{constructor(t){if(super(t),this.defaultCaptureButtonClick=()=>i(this,void 0,void 0,(function*(){const t=yield this.detectAndCrop();this.configuration.onDocumentDetected(t)})),this.state={action:this.defaultAction},!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!a.default.instance)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return("searching"==this.state.action||"capturing"==this.state.action||"manual"==this.state.action)&&!this.disposed}get configuration(){return this._configuration||(this._configuration=c.DocumentScannerConfiguration.fromJson(this.props.configuration)),this._configuration}static create(t){return i(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,i)=>{(0,s.render)(r.default.createElement(y,{container:e,configuration:t,onSuccess:n,onFailure:i}),e)}))}))}detectAndCrop(){return i(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"});const t=this.camera.createImageData(y.DETECT_AND_CROP_RESOLUTION);if(!t)return;const e=new u.Size(t.width,t.height),n=yield this.bridge.postByTransferringArgs("detectAndCropDocument",[t]);return n.videoSize=e,n}}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(t){this._configuration?this._configuration.autoCaptureEnabled=t:this.props.configuration.autoCaptureEnabled=t,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){super.componentDidMount(),this.detect()}componentWillUnmount(){super.componentWillUnmount(),this.handleAutoCapture(!1)}detect(){var t,e;return i(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const t=yield this.detectInWebWorker();if(!t||!this.enabled)return;if(!this.outline)return;const e=this.getStatusString(t),n="OK"===e;let i=this.scalePolygonPointsToPixels(t.polygon);this.outline.update(n,i,g.Utils.getProperty(this.configuration.text.hint,e)),yield this.handleAutoCapture(n,i)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(t){return this.configuration.ignoreBadAspectRatio&&"OK_BadAspectRatio"===t.detectionStatus?"OK":t.detectionStatus}detectInWebWorker(){return i(this,void 0,void 0,(function*(){const t=this.camera.createImageData(h.ScannerView.DEFAULT_DETECTION_RESOLUTION);if(!t||!this.enabled)return;const e=[t,this.configuration.acceptedAngleScore,this.configuration.acceptedSizeScore];return yield this.bridge.postByTransferringArgs("detectDocument",e)}))}handleAutoCapture(t,e){return i(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled)if(t&&!this.autoCaptureToken&&e){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const t=this.getCameraFrameSize();this.polygonMovementPredicate=new v.PolygonMovementPredicate(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);const t=3e3*(1-this.configuration.autoCaptureSensitivity);this.autoCaptureToken=setTimeout((()=>i(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const t=yield this.detectAndCrop();if(t.polygon){const e=this.scalePolygonPointsToPixels(t.polygon);if(this.runMovementPredicate(e))return}t.success&&this.configuration.onDocumentDetected&&this.configuration.onDocumentDetected(t)}))),t)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e,n,i,o;const{action:s}=this.state,{configuration:a}=this,c=null===(t=a.style)||void 0===t?void 0:t.captureButton;return r.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},r.default.createElement(m.default,{videoConstraints:a.videoConstraints,mirrored:a.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),r.default.createElement(p.DocumentOutline,{style:{polygon:null===(n=null===(e=a.style)||void 0===e?void 0:e.outline)||void 0===n?void 0:n.polygon,label:null===(o=null===(i=a.style)||void 0===i?void 0:i.outline)||void 0===o?void 0:o.label},showLabel:"searching"==s||"capturing"==s,visible:"processing"!=s,ref:t=>{this.outline=t}}),r.default.createElement(f.ShutterButton,{color:(null==c?void 0:c.color)?c.color:"FFF",action:s,onClick:this.enabled?a.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=u.Size.fromHtmlElement(this.camera.video),i=l.ViewUtils.findScale(n,e);t=(t=l.ViewUtils.convertToViewportPointsFromParentSize(e,t)).map((t=>d.Point.scaleToPoint(t,i.x,i.y,i.scale)))}return t}runMovementPredicate(t){const e=this.polygonMovementPredicate.check(t);return this.polygonMovementPredicate.update(t),e}getCameraFrameSize(){return this.camera.calculateFrameSize(h.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}e.default=y,y.DETECT_AND_CROP_RESOLUTION=0},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MagneticLine=void 0;const i=n(1);class o{constructor(t,e){this.p1=t,this.p2=e}static scaleToLine(t,e,n,r){const s=new i.Point(r*(t.p1.x-e),r*(t.p1.y-n)),a=new i.Point(r*(t.p2.x-e),r*(t.p2.y-n));return new o(s,a)}}e.MagneticLine=o},function(t,e,n){"use strict";n.r(e);var i=n(12),o=n.n(i),r=n(20),s={insert:"head",singleton:!1};o()(r.a,s);e.default=r.a.locals||{}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentOutline=void 0;const o=i(n(0)),r=i(n(15));n(57);const s=n(10),a=n(58);class c extends o.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:t,text:e,validPoints:n}=this.state,i=this.props.visible&&n,c=(0,r.default)({[s.DocumentPolygon.CLASSNAME]:!0,[`${s.DocumentPolygon.CLASSNAME}-visible`]:i,[`${s.DocumentPolygon.CLASSNAME}-hidden`]:!i,[`${s.DocumentPolygon.CLASSNAME}-ok`]:t}),l=(0,r.default)({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},o.default.createElement(a.AnimatedDocumentPolygon,{style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,polygonClasses:c,ref:t=>{this.polygon=t}}),this.props.showLabel&&o.default.createElement("label",{style:this.props.style.label,className:l,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){e&&(this.polygon.overlayPolygonCurrent||(this.polygon.overlayPolygonCurrent=e),this.polygon.overlayPolygonTarget||requestAnimationFrame(this.polygon.animate.bind(this.polygon)),this.polygon.overlayPolygonTarget=e),this.setState({ok:t,text:n,validPoints:!!e})}}e.DocumentOutline=c},function(t,e,n){"use strict";n.r(e);var i=n(12),o=n.n(i),r=n(21),s={insert:"head",singleton:!1};o()(r.a,s);e.default=r.a.locals||{}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.AnimatedDocumentPolygon=void 0;const o=n(10),r=i(n(0)),s=n(2);class a extends r.default.Component{constructor(t){super(t),this.PULL_FORCE=4,this.MIN_SPEED=100,this.state={points:[]}}animate(t){if(!this.overlayPolygonTarget)return;let e=0;for(let n=0;n<4;++n){const i=this.overlayPolygonCurrent[n],o=this.overlayPolygonTarget[n],r=this.calculateOffset(t,i,o,"x"),s=this.calculateOffset(t,i,o,"y");i.x+=r,i.y+=s,e+=Math.abs(r),e+=Math.abs(s)}this.polygon&&this.setState({points:this.overlayPolygonCurrent}),e<1&&null!==this.animationLastTime?(this.overlayPolygonTarget=null,this.animationLastTime=null):(this.animationLastTime=t,requestAnimationFrame(this.animate.bind(this)))}calculateOffset(t,e,n,i){const o=(this.animationLastTime?t-this.animationLastTime:0)/1e3;return this.absMin(this.absMax(this.MIN_SPEED*Math.sign(n[i]-e[i])*o,(n[i]-e[i])*this.PULL_FORCE*o),n[i]-e[i])}absMin(t,e){return Math.abs(t)<Math.abs(e)?t:e}absMax(t,e){return Math.abs(t)>Math.abs(e)?t:e}render(){return r.default.createElement("div",{style:this.props.style,ref:t=>this.container=t},r.default.createElement(o.DocumentPolygon,{points:this.state.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:t=>this.polygon=t,size:s.Size.fromHtmlElement(this.container)}))}}e.AnimatedDocumentPolygon=a},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=o(n(0)),s=n(29);class a extends r.default.Component{constructor(t){super(t),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){return i(this,void 0,void 0,(function*(){const e=this.props.preferredCamera;if(e)try{const n=(yield navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===e||t.label===e));if(n)return Object.assign(Object.assign({},t),{deviceId:n.deviceId});console.error(`Device: ${e} is not found`)}catch(t){throw s.MediaError.unsupportedOperationError()}return t}))}componentDidMount(){return i(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationChanged.bind(this)),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,r,a;return i(this,void 0,void 0,(function*(){const i={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const n=s.MediaError.unsupportedMediaDevices("UnsupportedError: navigator.mediaDevices is undefined");return null===(e=(t=this.props).onError)||void 0===e||e.call(t,n),void console.log(n)}this.stopCurrentStreams();try{console.log("Getting user media with constraints",i);const t=yield navigator.mediaDevices.getUserMedia(i);this.setState({stream:t},(()=>{var e,n,i,o;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(o=(i=this.props).onReady)||void 0===o||o.call(i)}))}catch(t){const e=s.MediaError.unsupportedMediaDevices("UnsupportedError: navigator.mediaDevices.getUserMedia is undefined");return null===(o=(n=this.props).onError)||void 0===o||o.call(n,e),void console.error(e)}}catch(t){let e=s.MediaError.unknownError(t.message);return t instanceof DOMException&&("NotAllowedError"===t.name?e=s.MediaError.permissionError(t.message):"NotFoundError"===t.name&&(e=s.MediaError.notAvailable(t.message))),null===(a=(r=this.props).onError)||void 0===a||a.call(r,e),void console.error(e)}}))}stopCurrentStreams(){return i(this,void 0,void 0,(function*(){const t=this.state.stream,e=null==t?void 0:t.getTracks();e&&e.forEach((t=>{t.stop()}))}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationChanged.bind(this)),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((t=>t.stop())),this.state.stream.getAudioTracks().forEach((t=>t.stop()))),this.setState({stream:void 0}))}updateTorch(t){return i(this,void 0,void 0,(function*(){const e=[{torch:t}];yield this.applyConstraints({advanced:e})}))}updateConstraints(t){return i(this,void 0,void 0,(function*(){yield this.applyConstraints(t)}))}applyConstraints(t){return i(this,void 0,void 0,(function*(){console.log("ScanbotSDK","Applying constraints:",JSON.stringify(t)),yield this.getVideoTrack().applyConstraints(t)}))}getVideoTrack(){var t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}getCapabilities(){const t=this.getVideoTrack();if(t)return t.getCapabilities()}getSettings(){const t=this.getVideoTrack();if(t)return t.getSettings()}}e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonMovementPredicate=void 0;const i=n(1),o=n(31);class r{constructor(t,e=r.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(t),this.sensitivity=e}check(t){let e=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(t[n],this.lastPolygon[n])){e=!0;break}}else e=!0;return e}reset(){this.lastPolygon=void 0}update(t){this.lastPolygon=t}isPointMoved(t,e){return o.MathUtils.distanceBetweenPoints(t,e)/this.maxDistance>this.sensitivity}calculateMaxDistance(t){let e=new i.Point(0,0),n=new i.Point(t.width,t.height);return o.MathUtils.distanceBetweenPoints(e,n)}}e.PolygonMovementPredicate=r,r.DEFAULT_SENSITIVITY=.05},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MrzScannerState=e.MrzScannerProps=void 0;const r=o(n(0)),s=n(0),a=n(9),c=o(n(11)),l=n(62),u=n(16),d=n(2),h=n(5),f=n(17),p=n(4);class m extends a.ScanbotCameraProps{}e.MrzScannerProps=m;class g extends a.ScanbotCameraState{}e.MrzScannerState=g;class v extends a.ScannerView{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.state={isFinderVisible:!0}}get configuration(){return this._configuration||(this._configuration=l.MrzScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t,e){return i(this,void 0,void 0,(function*(){const n=document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{(0,s.render)(r.default.createElement(v,{container:n,configuration:t,onSuccess:i,onFailure:o,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return i(this,void 0,void 0,(function*(){f.Debugger.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){f.Debugger.warn("Mrz detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return i(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensions.bind(this)),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensions.bind(this))}updateDimensions(){return i(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate(),yield this.resume()}))}resume(){return i(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(v.FRAME_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=d.Size.fromHtmlElement(this.camera.video),i=h.ViewUtils.findScale(n,e);let o=null===(t=this.finder)||void 0===t?void 0:t.frame();if(o){const t=p.Frame.withSize(o.width/i.scale,o.height/i.scale);t.x=e.width/2-t.width/2,t.y=e.height/2-t.height/2,this.camera.cutout=t}else this.camera.cutout=void 0;return!(!(this.camera.cutout&&this.camera.cutout.width>0)&&this.camera.cutout)&&(this.shouldComputeSize=!1,!0)}detect(){var t;return i(this,void 0,void 0,(function*(){const e=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let n=!1;try{const i=this.camera.createImageData(v.FRAME_RESOLUTION);if(!i)return;e&&this.forceUpdate();const o=yield this.props.mrzRecognizer.recognize(i);if(!this.enabled)return;if(null===o)return;o?(n=!0,this.configuration.onMrzDetected(o)):this.configuration._onDetectionFailed&&(null===(t=this.configuration)||void 0===t||t._onDetectionFailed(i))}catch(t){console.log(t)}finally{n?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}render(){return r.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},r.default.createElement(c.default,{windowConfiguration:this.state.isFinderVisible?this.configuration.style.window:void 0,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),this.state.isFinderVisible&&r.default.createElement(u.ViewFinder,{ref:t=>this.finder=t,configuration:this.configuration.style}))}}e.default=v,v.FRAME_RESOLUTION=1200},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MrzScannerConfiguration=void 0;const i=n(7),o={window:{aspectRatio:4,widthProportion:.8,borderColor:"white",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},text:{color:"white",size:"0.9em",weight:300},backgroundColor:"rgba(0, 0, 0, 0.7)",hint:"Please hold the device over the MRZ code to start scanning"};class r extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onMrzDetected=function(t){},this.style=o}static fromJson(t){const e=new r;return this.mapValues(t,e,["style","videoConstraints"]),t.style&&(this.mapValues(t.style,e.style,["window","text"]),t.style.window&&this.mapValues(t.style.window,e.style.window),t.style.text&&this.mapValues(t.style.text,e.style.text)),this.mapVideoConstraints(t,e),e}}e.MrzScannerConfiguration=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ClipPath=void 0;class i{static toPx(t){return t+"px"}static toNumber(t){return parseFloat(t.replace("px",""))}static fromFrames(t,e){const n=new i;return n.left=this.toPx(e.x),n.top=this.toPx(e.y),n.right=this.toPx(e.x+e.width),n.bottom=this.toPx(e.y+e.height),n}static subtractHalf(t,e){return this.subtract(t,e/2)}static subtract(t,e){return this.toNumber(t)-e+"px"}static addHalf(t,e){return this.add(t,e/2)}static add(t,e){return this.toNumber(t)+e+"px"}}e.ClipPath=i},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeScannerState=e.BarcodeScannerProps=void 0;const c=a(n(0)),l=n(0),u=n(9),d=a(n(11)),h=n(65),f=n(14),p=n(16),m=n(2),g=n(5),v=n(17),y=n(4),_=a(n(28)),b=r(n(67)),w=a(n(74)),C=a(n(78)),S=a(n(81)),x=n(3),E=a(n(83)),P=a(n(84)),k=a(n(85));class D extends u.ScanbotCameraProps{}e.BarcodeScannerProps=D;class O extends u.ScanbotCameraState{constructor(){super(...arguments),this.action="manual"}}e.BarcodeScannerState=O;class M extends u.ScannerView{constructor(t){var e;super(t),this.shouldComputeSize=!0,this.paused=!1,this.barcodes=[],this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.state={isFinderVisible:null===(e=t.showFinder)||void 0===e||e,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0}}get configuration(){return this._configuration||(this._configuration=h.BarcodeScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return s(this,void 0,void 0,(function*(){const e=g.ViewUtils.findContainerOrThrow(t);return new Promise(((n,i)=>{(0,l.render)(c.default.createElement(M,{container:e,configuration:t,showFinder:t.showFinder,onSuccess:n,onFailure:i}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return s(this,void 0,void 0,(function*(){v.Debugger.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){v.Debugger.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return s(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensions.bind(this)),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensions.bind(this))}updateDimensions(){return s(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate(),yield this.resume()}))}resume(){return s(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(u.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=m.Size.fromHtmlElement(this.camera.video),i=g.ViewUtils.findScale(n,e);let o=null===(t=this.finder)||void 0===t?void 0:t.frame();if(o){const t=y.Frame.withSize(o.width/i.scale,o.height/i.scale);t.x=e.width/2-t.width/2,t.y=e.height/2-t.height/2,this.camera.cutout=t}else this.camera.cutout=void 0;return!(!(this.camera.cutout&&this.camera.cutout.width>0)&&this.camera.cutout)&&(this.shouldComputeSize=!1,!0)}detect(){var t,e,n,i,o;return s(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;if(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)return;let s=!1;try{const t=yield this.recognizeBarcodes(!0,r,this.configuration.returnBarcodeImage);if(!t)return;const a=t.barcodeResult;a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(null==a?void 0:a.imageData)):(s=!0,this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(this.finderRect,this.camera,t.imageData,null!==(i=this.configuration.container)&&void 0!==i?i:this.configuration.containerId,t.barcodeResult.barcodes)}catch(t){console.log(t)}finally{if(s){const t=(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)?0:this.configuration.captureDelay;0===t?requestAnimationFrame(this.detect.bind(this)):setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),t)}else requestAnimationFrame(this.detect.bind(this))}}))}setUseBackendService(t){console.log("Now using backend service for recognition: ",t),this.backendurl=t}recognizeBarcodes(t,e,n){var i,o;return s(this,void 0,void 0,(function*(){const r=t?u.ScannerView.DEFAULT_DETECTION_RESOLUTION:u.ScannerView.DETECTION_RESULTION_4K,s=null!==(i=this.desiredRecognitionResolution)&&void 0!==i?i:r,a=this.camera.createImageData(s);if(!a)return;e&&this.forceUpdate(),(null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.enabled)&&(this.setState({image:x.ImageUtils.wrapperToBase64(a)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution: ",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution: ",u.ScannerView.DETECTION_RESULTION_4K));const c=this.configuration.engineMode,l=this.configuration.barcodeFormats;let d;if(this.backendurl&&this.backendurl.length>0)d=yield k.default.recognizeBarcodes(this.backendurl,a);else{const{result:e,originalImage:i}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[a,{live:t,engineMode:c,barcodeFormats:l,returnBarcodeImage:n}]);if(!this.enabled)return;if(null===e)return;d=f.BarcodeResult.fromWorker(e,i)}return{imageData:a,originalImage:undefined,barcodeResult:d}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return s(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?t(m.Size.fromJson(n)):this.camera.didLoadVideo=()=>{const e=this.camera.videoSize();t(m.Size.fromJson(e))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}setZoom(t){this.setState({zoom:t})}updateTorch(t){this.camera.videoStream.updateTorch(t)}applyConstraints(t){return s(this,void 0,void 0,(function*(){yield this.camera.videoStream.applyConstraints(t)}))}getCapabilities(){return this.camera.videoStream.getCapabilities()}getSettings(){return this.camera.videoStream.getSettings()}render(){var t,e,n,i,o,r;const a=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return c.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"}},c.default.createElement(d.default,{windowConfiguration:this.state.isFinderVisible?this.configuration.style.window:void 0,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(e=this.state.zoom)&&void 0!==e?e:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),c.default.createElement(P.default,{top:null===(n=this.configuration.scanAndCount)||void 0===n?void 0:n.style.topLabelTop,text:a}),c.default.createElement(S.default,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&c.default.createElement(p.ViewFinder,{ref:t=>{this.finder=t},onSizeChanged:t=>{this.finderRect=t},configuration:this.configuration.style}),c.default.createElement(P.default,{bottom:100,text:this.state.bottomHintText}),c.default.createElement(E.default,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&c.default.createElement(w.default,{ref:t=>{t&&(this.overlay=t)}}),(null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.enabled)&&c.default.createElement(C.default,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(b.AnimationType.PushBottom,this.barcodes)},onShutterButtonClick:()=>s(this,void 0,void 0,(function*(){(new _.default).flash(),this.setState({action:"processing"});const t=(new Date).getTime(),e=yield this.recognizeBarcodes(!1,!1,!0);console.log("recognition took: ",((new Date).getTime()-t)/1e3),this.recognition=e;const n=this.countLabelText(e.barcodeResult.barcodes);this.setState({action:"manual",bottomHintText:n}),this.scannedImage.update(e.barcodeResult),this.barcodes.push(...e.barcodeResult.barcodes),this.bottomActionBar.update(this.barcodes),e.barcodeResult.barcodes.length>0&&this.configuration.onBarcodesDetected(e.barcodeResult)})),onScanMoreClick:()=>{this.resetCountImage()}}),c.default.createElement(b.default,{ref:t=>this.popup=t,style:null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(t){return 0==t.length?"No codes scanned. Try again?":1==t.length?"1 Code Scanned":`${t.length} Codes Scanned`}}e.default=M},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeScannerConfiguration=void 0;const i=n(7),o=n(66),r={window:{aspectRatio:1,widthProportion:.5,borderColor:"white",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},text:{color:"white",size:"0.9em",weight:300},backgroundColor:"rgba(0, 0, 0, 0.7)",hint:"Please align the barcode or QR code in the frame to scan it."},s={visible:!1};class a extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=s,this.showFinder=!0,this.scanAndCount=new o.BarcodeCountConfiguration,this.onBarcodesDetected=function(t){},this.style=r}static fromJson(t){const e=new a;return this.mapValues(t,e,["style","videoConstraints","scanAndCount"]),t.style&&(this.mapValues(t.style,e.style,["window","text"]),t.style.window&&this.mapValues(t.style.window,e.style.window),t.style.text&&this.mapValues(t.style.text,e.style.text)),t.overlay&&this.mapValues(t.overlay,e.overlay),t.scanAndCount&&(this.mapValues(t.scanAndCount,e.scanAndCount,["style"]),t.scanAndCount.style&&this.mapValues(t.scanAndCount.style,e.scanAndCount.style)),this.mapVideoConstraints(t,e),e}}e.BarcodeScannerConfiguration=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeCountConfiguration=e.BarcodeCountStyleConfiguration=void 0;class i{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}e.BarcodeCountStyleConfiguration=i;e.BarcodeCountConfiguration=class{constructor(){this.enabled=!1,this.style=new i}}},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationType=void 0;const a=s(n(0)),c=r(n(18)),l=s(n(72)),u=s(n(19));var d;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(d=e.AnimationType||(e.AnimationType={}));class h extends a.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:d.None},elements:[]}}containerStyle(t){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:t,overflow:"scroll"}}render(){var t,e,n;if(this.state.animation.type===d.None)return null;const i=this.animation(this.state.animation.type),o=this.to(this.state.animation.type);this.previousDestination=o;const r=this.props.style;return a.default.createElement(i,{style:this.containerStyle(`${o}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},a.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},a.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:u.default.ScanbotPrimary}},a.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},a.default.createElement("div",{style:{backgroundColor:u.default.White,height:3,width:33,borderRadius:5}})),a.default.createElement("div",{style:{display:"flex",height:50}},a.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:u.default.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),a.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:u.default.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(e=null===(t=this.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+" Codes"),a.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:u.default.White,justifyContent:"right",alignItems:"center",paddingRight:10}},a.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),a.default.createElement(l.default,{ref:t=>{null!==t&&(this.list=t)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(t,e){this._isVisible=!0,this.barcodes=e,this.updateAnimationType(t)}update(t){this.barcodes=t,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(d.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===d.Pop&&this.updateAnimationType(d.None)}updateAnimationType(t,e){this.setState({animation:{type:t}},e)}animation(t){let e=this.from(t),n=this.to(t);this.previousDestination===n&&(e=this.previousDestination,n=this.previousDestination);const i=c.keyframes`from {transform: ${e};} to {transform: ${n};}`;return c.default.div`animation: ${i} 0.5s;`}from(t){if(t===d.PushRight)return this.translate("X",100);if(t===d.PushBottom)return this.translate("Y",100);if(t===d.Pop){const t=this.pushType===d.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===d.PushRight)return this.translate("X",0);if(t===d.PushBottom)return this.translate("Y",0);if(t===d.Pop){const t=this.pushType===d.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}e.default=h},function(t,e){var n,i,o=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,l=[],u=!1,d=-1;function h(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&f())}function f(){if(!u){var t=a(h);u=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||u||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";var i=60103,o=60106,r=60107,s=60108,a=60114,c=60109,l=60110,u=60112,d=60113,h=60120,f=60115,p=60116,m=60121,g=60122,v=60117,y=60129,_=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;i=b("react.element"),o=b("react.portal"),r=b("react.fragment"),s=b("react.strict_mode"),a=b("react.profiler"),c=b("react.provider"),l=b("react.context"),u=b("react.forward_ref"),d=b("react.suspense"),h=b("react.suspense_list"),f=b("react.memo"),p=b("react.lazy"),m=b("react.block"),g=b("react.server.block"),v=b("react.fundamental"),y=b("react.debug_trace_mode"),_=b("react.legacy_hidden")}function w(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case r:case a:case s:case d:case h:return t;default:switch(t=t&&t.$$typeof){case l:case u:case p:case f:case c:return t;default:return e}}case o:return e}}}var C=c,S=i,x=u,E=r,P=p,k=f,D=o,O=a,M=s,T=d;e.ContextConsumer=l,e.ContextProvider=C,e.Element=S,e.ForwardRef=x,e.Fragment=E,e.Lazy=P,e.Memo=k,e.Portal=D,e.Profiler=O,e.StrictMode=M,e.Suspense=T,e.isAsyncMode=function(){return!1},e.isConcurrentMode=function(){return!1},e.isContextConsumer=function(t){return w(t)===l},e.isContextProvider=function(t){return w(t)===c},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return w(t)===u},e.isFragment=function(t){return w(t)===r},e.isLazy=function(t){return w(t)===p},e.isMemo=function(t){return w(t)===f},e.isPortal=function(t){return w(t)===o},e.isProfiler=function(t){return w(t)===a},e.isStrictMode=function(t){return w(t)===s},e.isSuspense=function(t){return w(t)===d},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===a||t===y||t===s||t===d||t===h||t===_||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===f||t.$$typeof===c||t.$$typeof===l||t.$$typeof===u||t.$$typeof===v||t.$$typeof===m||t[0]===g)},e.typeOf=w},function(t,e,n){"use strict";t.exports=n(71)},function(t,e,n){"use strict";var i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,r=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,a=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,u=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.async_mode"):60111,h=i?Symbol.for("react.concurrent_mode"):60111,f=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,m=i?Symbol.for("react.suspense_list"):60120,g=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,y=i?Symbol.for("react.block"):60121,_=i?Symbol.for("react.fundamental"):60117,b=i?Symbol.for("react.responder"):60118,w=i?Symbol.for("react.scope"):60119;function C(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case d:case h:case s:case c:case a:case p:return t;default:switch(t=t&&t.$$typeof){case u:case f:case v:case g:case l:return t;default:return e}}case r:return e}}}function S(t){return C(t)===h}e.AsyncMode=d,e.ConcurrentMode=h,e.ContextConsumer=u,e.ContextProvider=l,e.Element=o,e.ForwardRef=f,e.Fragment=s,e.Lazy=v,e.Memo=g,e.Portal=r,e.Profiler=c,e.StrictMode=a,e.Suspense=p,e.isAsyncMode=function(t){return S(t)||C(t)===d},e.isConcurrentMode=S,e.isContextConsumer=function(t){return C(t)===u},e.isContextProvider=function(t){return C(t)===l},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return C(t)===f},e.isFragment=function(t){return C(t)===s},e.isLazy=function(t){return C(t)===v},e.isMemo=function(t){return C(t)===g},e.isPortal=function(t){return C(t)===r},e.isProfiler=function(t){return C(t)===c},e.isStrictMode=function(t){return C(t)===a},e.isSuspense=function(t){return C(t)===p},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===s||t===h||t===c||t===a||t===p||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===v||t.$$typeof===g||t.$$typeof===l||t.$$typeof===u||t.$$typeof===f||t.$$typeof===_||t.$$typeof===b||t.$$typeof===w||t.$$typeof===y)},e.typeOf=C},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=i(n(73));class s extends o.default.Component{constructor(t){super(t),this.state={barcodes:this.toUniqueListWithDuplicateCounter(t.barcodes)}}toUniqueListWithDuplicateCounter(t){const e=[];return t.forEach((t=>{const n=e.findIndex((e=>e.equals(t)));-1===n?(t.count=1,e.push(t)):e[n].count++})),e}update(t){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(t)})}render(){return o.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>o.default.createElement(r.default,{key:e,barcode:t,onClick:this.props.onClick}))))}}e.default=s},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0));class r extends o.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return o.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},o.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},o.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},o.default.createElement("div",{style:{flex:1}},this.props.barcode.text),o.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),o.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}e.default=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=i(n(75)),s=n(1),a=n(2),c=n(32);class l extends o.default.Component{constructor(t){super(t),this.state={image:void 0,imageSize:a.Size.empty(),elements:[]}}update(t,e,n,i,o){const r=[];o.forEach((o=>{const l=new c.BarcodeOverlay(o);if(void 0===t){const t=a.Size.fromHtmlElement(e.video);l.points=o.points.map((e=>new s.Point(e.x*(t.width/n.width),e.y*(t.height/n.height))))}else l.points=o.points.map((e=>{const o=new s.Point(e.x,e.y);o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x;const r=("string"==typeof i?document.getElementById(i):i).getBoundingClientRect();return o.x-=r.x,o.y-=r.y,o}));r.push(l)})),this.overlay.update(r)}render(){return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},o.default.createElement(r.default,{ref:t=>{null!==t&&(this.overlay=t)},elements:this.state.elements,onClick:t=>{}}))}}e.default=l},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeSelectionOverlayProps=void 0;const o=i(n(0)),r=i(n(76)),s=i(n(77));e.BarcodeSelectionOverlayProps=class{};class a extends o.default.Component{constructor(t){super(t),this.interval=5e3,this.polygons=[],this.state={elements:t.elements}}update(t){this.setState({elements:t})}componentDidMount(){}componentWillUnmount(){}startTimer(){setTimeout(this.onTimerElapsed.bind(this),this.interval)}onTimerElapsed(){const t=[];this.polygons.forEach((e=>{e.updatedAt<s.default.now()-this.interval||t.push(e.props.element)})),this.startTimer(),requestAnimationFrame((()=>{this.setState({elements:t})}))}render(){return o.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"},onClick:t=>{t.stopPropagation(),this.props.onClick(void 0)}},this.state.elements.map(((t,e)=>o.default.createElement(r.default,{ref:t=>{t&&(this.polygons.push(t),t.updatedAt=s.default.now())},element:t,onClick:(t,e)=>{t.stopPropagation(),this.props.onClick(e)}}))))}}e.default=a},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodePolygonProps=void 0;const o=i(n(0));e.BarcodePolygonProps=class{};class r extends o.default.Component{render(){const t=this.props.element,e=t.points.map((t=>`${t.x},${t.y}`)).join(" ");return o.default.createElement("polygon",{points:e,style:{fill:t.highlighted?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)",stroke:t.highlighted?"rgba(0, 255, 0, 1)":"rgba(255, 0, 0, 1)",strokeWidth:t.highlighted?3:1},onClick:t=>{this.props.onClick&&this.props.onClick(t,this.props.element)}})}}e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{static now(){return Date.now()}}},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=n(30),s=i(n(19)),a=i(n(79)),c=i(n(80));class l extends o.default.Component{constructor(t){super(t),this.state={barcodes:void 0}}update(t){this.setState({barcodes:t})}didScan(){return void 0!==this.state.barcodes}render(){var t,e;return o.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:s.default.ScanbotPrimary}},o.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},o.default.createElement(a.default,null),o.default.createElement("div",{style:{backgroundColor:s.default.Orange,color:s.default.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(e=null===(t=this.state.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)),o.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},o.default.createElement(r.ShutterButton,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),o.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},o.default.createElement("div",{style:{fontSize:13,color:s.default.White,marginRight:10}},"Scan More"),o.default.createElement(c.default,null)))}}e.default=l},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0));class r extends o.default.Component{render(){return o.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},o.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),o.default.createElement("g",{mask:"url(#mask0_919_23088)"},o.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}e.default=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0));class r extends o.default.Component{render(){return o.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},o.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),o.default.createElement("g",{mask:"url(#mask0_919_23102)"},o.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}e.default=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=n(32),s=n(2),a=n(1),c=i(n(82));class l extends o.default.Component{constructor(t){super(t),this.polygons=[],this.state={elements:[],imageSize:s.Size.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const i=new r.BarcodeOverlay(n);i.points=a.Point.scaleListToImageElement(n.points,t.imageData,this.image),e.push(i)})),this.setState({imageSize:s.Size.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:o.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},o.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),o.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>o.default.createElement(c.default,{key:e,points:t.points})))))}}e.default=l},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=n(1);class s extends o.default.Component{render(){const t=r.Point.centerOf(this.props.points),e=r.Point.smallerSizeOfQuad(this.props.points)/40;return o.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:t.x-20,top:t.y-20,transform:`scale(${e})`}},o.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},o.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),o.default.createElement("g",{mask:"url(#mask0_910_20901)"},o.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),o.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}e.default=s},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=i(n(18));class s extends o.default.Component{render(){if(!this.props.visible)return null;const t=r.default.svg`
|
|
3
3
|
animation: rotate 2s linear infinite;
|
|
4
4
|
@keyframes rotate { 100% { transform: rotate(360deg); } }
|
|
5
5
|
`;return o.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},o.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),o.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),o.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),o.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}e.default=s},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(n(0)),r=i(n(19));class s extends o.default.Component{render(){return this.props.text?o.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},o.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:r.default.TransparentGray,color:r.default.White,fontWeight:500,fontSize:13}},this.props.text)):null}}e.default=s},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(14),r=n(3);class s{static postBlob(t,e){return i(this,void 0,void 0,(function*(){const n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:e});return yield n.json()}))}static postImage(t,e){return i(this,void 0,void 0,(function*(){const n=r.ImageUtils.convertImageDataWrapperToImageData(e),i=r.ImageUtils.createImageDataCanvas(n),o=yield new Promise((t=>i.toBlob((e=>t(e)))));return yield s.postBlob(t,o)}))}static recognizeBarcodes(t,e){return i(this,void 0,void 0,(function*(){const n=yield s.postImage(t,e);return o.BarcodeResult.fromWorker(n,e)}))}}e.default=s},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const c=a(n(0)),l=n(0),u=a(n(15)),d=a(n(6)),h=n(87),f=n(10),p=n(88),m=n(93),g=n(94),v=n(95),y=n(2),_=n(1),b=n(5),w=n(3),C=r(n(96));class S extends c.default.Component{constructor(t){super(t),this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.state={image:void 0,polygon:void 0,calculatedSize:y.Size.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:_.Point.empty()}}static create(t){return s(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize cropping component: Cannot find container element with the id provided.");return new Promise(((n,i)=>{(0,l.render)(c.default.createElement(S,{onReady:n,onError:i,container:e,configuration:h.CroppingViewConfiguration.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return s(this,void 0,void 0,(function*(){const i=null===(t=this.configuration)||void 0===t?void 0:t.image,o=yield d.default.instance.detectDocument(i);this.setState({image:yield w.ImageUtils.toDataUrl(i),polygon:null!==(n=null===(e=this.configuration)||void 0===e?void 0:e.polygon)&&void 0!==n?n:o.polygon,magneticLines:{vertical:{original:o.verticalLines},horizontal:{original:o.horizontalLines}}}),this.props.onReady&&this.props.onReady(this)}))}onImageLoaded(t){return s(this,void 0,void 0,(function*(){y.Size.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.loadImageAndPolygon())}))}loadImageAndPolygon(t){var e,n,i;const o=new y.Size(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),r=new y.Size(this.container.width(),this.container.height()),s=w.ImageUtils.getObjectFitSize(r,o),a=new y.Size(s.width,s.height),c=y.Size.subtractFrom(a,2*this.configuration.style.padding),l=null!==(e=null==t?void 0:t.polygon)&&void 0!==e?e:this.state.polygon,u=b.ViewUtils.convertToViewportPointsFromParentSize(c,l),d=null!==(n=null==t?void 0:t.horizontalLines)&&void 0!==n?n:this.state.magneticLines.horizontal.original,h=null!==(i=null==t?void 0:t.verticalLines)&&void 0!==i?i:this.state.magneticLines.vertical.original,f=b.ViewUtils.convertLinesToViewportLines(a,d),p=b.ViewUtils.convertLinesToViewportLines(a,h);this.setState({calculatedSize:a,points:u,magneticLines:{horizontal:{original:d,scaled:f},vertical:{original:h,scaled:p}},animation:Object.assign(Object.assign({},this.state.animation),{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)}),imageMargin:this.calculateMargin(a)})}render(){var t,e,n,i,o,r;const s=f.DocumentPolygon.CLASSNAME,a=(0,u.default)({[s]:!0,[`${s}-visible`]:!0}),l=this.configuration.style.polygon.width,d=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?l/this.state.animation.scale:l;return c.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&c.default.createElement(v.ScrollLock,null),c.default.createElement(C.default,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),c.default.createElement(g.Animatable,{ref:t=>this.container=t,size:this.state.calculatedSize,margin:this.configuration.style.padding,rotations:null===(e=this.state.animation)||void 0===e?void 0:e.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(i=this.state.animation)||void 0===i?void 0:i.duration,imageMargin:this.state.imageMargin},c.default.createElement(m.CroppingImage,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),c.default.createElement(p.DraggableDocumentPolygon,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${d}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:a,points:this.state.points,rotations:null===(o=this.state.animation)||void 0===o?void 0:o.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)})))}showMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!0,(()=>{var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}))}updateMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}magnifierOptions(t){const e=new C.MagnifierOptions;return e.source=new C.MagnifierSourceImage(this.htmlImage,this.state.calculatedSize),e.container=new y.Size(this.container.width(),this.container.height()),e.origin=t.point,e.padding=this.configuration.style.padding,e.rotations=this.state.animation.rotations,e.scale=this.state.animation.scale,e}hideMagnifier(){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!1)}apply(){var t;return s(this,void 0,void 0,(function*(){const e=y.Size.subtractFrom(this.state.calculatedSize,2*this.configuration.style.padding),n=_.Point.toPolygon(this.state.points,e),i=this.toCcwRotations(this.rotations);return{image:yield d.default.instance.cropAndRotateImageCcw(null===(t=this.configuration)||void 0===t?void 0:t.image,n,i),polygon:n,rotations:this.rotations}}))}toCcwRotations(t){return this.MAX_ROTATIONS-t%this.MAX_ROTATIONS}rotate(t){return s(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const e=this.calculateScale(this.rotations,t);this.setState({animation:{rotations:this.rotations+t,scale:e,duration:1}})}))}detect(){var t;return s(this,void 0,void 0,(function*(){const e=yield d.default.instance.detectDocument(null===(t=this.configuration)||void 0===t?void 0:t.image);this.loadImageAndPolygon(e)}))}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");(0,l.render)(null,t)}get rotations(){var t,e;const n=null===(t=this.state.animation)||void 0===t?void 0:t.rotations;return n&&0!==n?n:null!==(e=this.configuration.rotations)&&void 0!==e?e:0}get configuration(){return this._configuration||(this._configuration=h.CroppingViewConfiguration.fromJson(this.props.configuration)),this._configuration}calculateScale(t,e,n){return e?(t+e)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(t){return t||(t=this.state.calculatedSize),t.width>t.height?this.container.height()/this.container.width():this.container.width()/this.container.height()}calculateMargin(t){return t.width>t.height?{x:this.configuration.style.padding,y:this.container.height()/2-t.height/2}:{x:this.container.width()/2-t.width/2,y:this.configuration.style.padding}}}e.default=S},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CroppingViewConfiguration=e.CroppingViewMagnifierCrosshairStyle=e.CroppingViewMagnifierBorderStyle=e.CroppingViewMagnifierStyle=e.CroppingViewStyle=e.CroppingViewPolygonStyle=e.CroppingViewPolygonHandleStyle=e.CroppingViewMagneticLineStyle=void 0;const i=n(27);class o{constructor(){this.disabled=!1,this.color="transparent"}}e.CroppingViewMagneticLineStyle=o;class r{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}e.CroppingViewPolygonHandleStyle=r;class s{constructor(){this.color="#1ec31e",this.width=4}}e.CroppingViewPolygonStyle=s;class a{constructor(){this.padding=10}}e.CroppingViewStyle=a;class c{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}e.CroppingViewMagnifierStyle=c;class l{constructor(){this.width=2,this.color="white"}}e.CroppingViewMagnifierBorderStyle=l;class u{constructor(){this.size=20,this.color="white"}}e.CroppingViewMagnifierCrosshairStyle=u;class d extends i.BaseConfiguration{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new a,this.style.magneticLines=new o,this.style.polygon=new s,this.style.polygon.handles=new r,this.style.magnifier=new c,this.style.magnifier.border=new l,this.style.magnifier.crosshair=new u}static fromJson(t){const e=new d;return this.mapValues(t,e,["style"]),t.style&&(this.mapValues(t.style,e.style,["polygon","magneticLines","magnifier"]),t.style.polygon&&(this.mapValues(t.style.polygon,e.style.polygon,["handles"]),t.style.polygon.handles&&this.mapValues(t.style.polygon.handles,e.style.polygon.handles)),t.style.magneticLines&&this.mapValues(t.style.magneticLines,e.style.magneticLines,[]),t.style.magnifier&&(this.mapValues(t.style.magnifier,e.style.magnifier,["border","crosshair"]),t.style.magnifier.border&&this.mapValues(t.style.magnifier.border,e.style.magnifier.border,[]),t.style.magnifier.crosshair&&this.mapValues(t.style.magnifier.crosshair,e.style.magnifier.crosshair,[]))),e}}e.CroppingViewConfiguration=d},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DraggableDocumentPolygon=void 0;const o=i(n(0)),r=n(10),s=n(89),a=n(90);class c extends o.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return o.default.createElement("div",null,o.default.createElement(a.DraggableHandlesComponent,{ref:t=>this.handles=t,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:t=>{this.setFrame(),this.props.cornerMoved(t)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:t=>{this.setFrame(),this.setState({movingLine:t})}}),o.default.createElement(s.MagneticLinesComponent,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:t=>{var e,n;null===(e=this.handles)||void 0===e||e.snapTo(t),null===(n=this.polygon)||void 0===n||n.setFrame()}}),o.default.createElement(r.DocumentPolygon,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:t=>this.polygon=t}))}setFrame(){var t,e;null===(t=this.polygon)||void 0===t||t.setFrame(),null===(e=this.handles)||void 0===e||e.setFrame()}}e.DraggableDocumentPolygon=c},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MagneticLinesComponent=void 0;const o=i(n(0));class r extends o.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return o.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},o.default.createElement("line",{x1:t.p1.x.toString(),y1:t.p1.y.toString(),x2:t.p2.x.toString(),y2:t.p2.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(t,e,n){this.props.style.disabled||this.isNearAny()}render(){var t,e,n,i,r,s;return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.horizontal)||void 0===e?void 0:e.scaled)||void 0===n?void 0:n.map((t=>this.fromPoint(t))),null===(s=null===(r=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===r?void 0:r.scaled)||void 0===s?void 0:s.map((t=>this.fromPoint(t))))}isNearAny(){var t,e,n,i;const o=this.props.movingLine;let r=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;o.isHorizontal&&(r=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),null==r||r.forEach((t=>{this.isLineNearLine(t,o.points,o.isHorizontal)&&this.props.snapTo({magneticLine:t,polygonLine:o})}))}isLineNearLine(t,e,n){return this.isPointNearLine(t,e[0].coordinates,n)||this.isPointNearLine(t,e[1].coordinates,n)}isPointNearLine(t,e,n){return this.isPointNearPoint(t.p1,e,n)||this.isPointNearPoint(t.p2,e,n)}isPointNearPoint(t,e,n){return n?Math.abs(t.y-e.y)<this.BUFFER:Math.abs(t.x-e.x)<this.BUFFER}}e.MagneticLinesComponent=r},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DraggableHandlesComponent=void 0;const o=i(n(0)),r=n(91),s=n(92);class a extends o.default.Component{constructor(t){super(t),this.state={slopes:[]}}render(){return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},o.default.createElement(r.DraggablePointsContainer,{ref:t=>this.corners=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:t=>{this.setState({slopes:t.slopes}),this.props.cornerMoveEnd()}}),o.default.createElement(s.DraggableLinesContainer,{ref:t=>this.lines=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,slopes:this.state.slopes,lineMoved:this.props.lineMoved}))}setFrame(){for(let t=0;t<this.corners.POINT_COUNT;t++){const e=this.props.coordinatePoints[t];this.corners.items[t]&&(this.corners.items[t].style.left=e.x-this.corners.pointSize/2+"px",this.corners.items[t].style.top=e.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(t)];this.lines.items[t]&&(this.lines.items[t].style.left=e.x+(n.x-e.x)/2-this.corners.pointSize/2+"px",this.lines.items[t].style.top=e.y+(n.y-e.y)/2-this.corners.pointSize/2+"px")}}snapTo(t){const e=t.polygonLine.isHorizontal?"y":"x";this.snapToClosest(t.polygonLine.points[0].index,t.magneticLine,e),this.snapToClosest(t.polygonLine.points[1].index,t.magneticLine,e),this.corners.calculateSlopes(),this.setFrame()}snapToClosest(t,e,n){const i="x"===n?"y":"x";let o=this.props.coordinatePoints[t][i];o=Math.abs(e.p1[i]-o)<Math.abs(e.p2[i]-o)?e.p1[n]:e.p2[n],this.props.coordinatePoints[t][n]=o}}e.DraggableHandlesComponent=a},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DraggablePointsContainer=void 0;const o=i(n(0)),r=n(1),s=n(31),a=n(33);class c extends a.DraggableBaseContainer{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e],i=o.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.cornerTouchStart(t,e),onPointerUp:()=>this.cornerTouchEnd()});t.push(i)}return t}cornerTouchStart(t,e){const n=r.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],o=r.Point.fromHtmlElement(i);this.parentOffset=new r.Point(n.x-o.x,n.y-o.y),this.lastPointIndex=e,this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=r.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=n.x-this.parentOffset.x,o=n.y-this.parentOffset.y;if(this.isOutOfBounds(i,this.props.containerSize.width))return;if(this.isOutOfBounds(o,this.props.containerSize.height))return;const a=this.pointSize/2;this.props.points[e]=new r.Point(i+a,o+a),s.MathUtils.isConvex(this.props.points)&&this.props.cornerMoved({index:e,point:this.props.points[e]})}cornerTouchEnd(){this.parentOffset=null,this.calculateSlopes()}calculateSlopes(){const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e],i=this.props.points[this.nextIndex(e)];t.push(this.calculateSlope(n,i,!this.isHorizontal(e)))}this.props.cornerMoveEnd({slopes:t})}calculateSlope(t,e,n){return n?(e.y-t.y)/(e.x-t.x):(e.x-t.x)/(e.y-t.y)}render(){return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"},onPointerMove:t=>this.cornerTouchMove(t,this.lastPointIndex)},this.create())}}e.DraggablePointsContainer=c},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DraggableLinesContainer=void 0;const o=i(n(0)),r=n(1),s=n(33),a=n(8);class c extends s.DraggableBaseContainer{constructor(){super(...arguments),this.MAX_SLOPE_DIFF=1}create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e];let i=this.props.points[this.nextIndex(e)];const r=o.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(i.x-n.x)/2-this.pointSize/2+"px",top:n.y+(i.y-n.y)/2-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.lineTouchStart(t,e),onPointerMove:t=>this.lineTouchMove(t,e),onPointerUp:()=>this.lineTouchEnd()});t.push(r)}return t}lineTouchStart(t,e){const n=r.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],o=r.Point.fromHtmlElement(i),s=this.props.points[e],c=this.props.points[this.nextIndex(e)];this.point1Start=a.Utils.copy(s),this.point2Start=a.Utils.copy(c),this.point1Offset=new r.Point(s.x-o.x,s.y-o.y),this.point2Offset=new r.Point(c.x-o.x,c.y-o.y),this.parentOffset=new r.Point(n.x-o.x,n.y-o.y)}lineTouchMove(t,e){var n,i,o,s;if(!this.parentOffset)return;const a=r.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),c=this.props.points[e],l=this.props.points[this.nextIndex(e)],u=this.props.points[this.previousIndex(e)],d=this.props.points[this.nextIndex(e+1)];if(this.isHorizontal(e)){const t=a.y-this.parentOffset.y;if(this.isOutOfBounds(t,this.props.containerSize.height))return;const o=t+this.point1Offset.y,r=t+this.point2Offset.y;let s=c.x+(c.y-o)/-this.props.slopes[this.previousIndex(e)],h=l.x+(l.y-r)/-this.props.slopes[this.nextIndex(e)];if(s=this.validateCoordinate(s,c.x),h=this.validateCoordinate(h,l.x),c.x=this.accountForSlopeCalculationError(s,c.x),l.x=this.accountForSlopeCalculationError(h,l.x),c.y=this.limitMinMaxCoordinates(o,null===(n=this.props.containerSize)||void 0===n?void 0:n.height),l.y=this.limitMinMaxCoordinates(r,null===(i=this.props.containerSize)||void 0===i?void 0:i.height),this.isNearOpposingPoint(this.point1Start,c,u,"y"))return;if(this.isNearOpposingPoint(this.point1Start,l,d,"y"))return}else{const t=a.x-this.parentOffset.x;if(this.isOutOfBounds(t,this.props.containerSize.width))return;const n=t+this.point1Offset.x,i=t+this.point2Offset.x;let r=c.y+(c.x-n)/-this.props.slopes[this.previousIndex(e)],h=l.y+(l.x-i)/-this.props.slopes[this.nextIndex(e)];if(r=this.validateCoordinate(r,c.y),h=this.validateCoordinate(h,l.y),c.y=this.accountForSlopeCalculationError(r,c.y),l.y=this.accountForSlopeCalculationError(h,l.y),c.x=this.limitMinMaxCoordinates(n,null===(o=this.props.containerSize)||void 0===o?void 0:o.width),l.x=this.limitMinMaxCoordinates(i,null===(s=this.props.containerSize)||void 0===s?void 0:s.width),this.isNearOpposingPoint(this.point1Start,c,u,"x"))return;if(this.isNearOpposingPoint(this.point1Start,l,d,"x"))return}this.props.lineMoved({points:[{index:e,coordinates:c},{index:this.nextIndex(e),coordinates:l}],isHorizontal:this.isHorizontal(e)})}lineTouchEnd(){this.parentOffset=null}accountForSlopeCalculationError(t,e){return Math.abs(t-e)>this.MAX_SLOPE_DIFF?e:t}isNearOpposingPoint(t,e,n,i){if(t[i]>n[i]){if(e[i]-10<n[i])return!0}else if(e[i]>n[i]-10)return!0;return!1}validateCoordinate(t,e){return t===1/0||t===-1/0||isNaN(t)?e:t}limitMinMaxCoordinates(t,e){return t<0?0:t>e?e:t}render(){return o.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}e.DraggableLinesContainer=c},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CroppingImage=void 0;const o=i(n(0));class r extends o.default.Component{render(){return o.default.createElement("img",{ref:t=>this.image=t,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:t=>{t.target&&this.props.onImageLoaded(t.target)}})}}e.CroppingImage=r},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Animatable=void 0;const a=s(n(0)),c=r(n(18));class l extends a.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:t,imageMargin:e,rotations:n,scale:i,margin:o,duration:r}=this.props,s=90*(n-1),l=90*n;this.previousScale||(this.previousScale=1);const u=c.keyframes`
|