scanbot-web-sdk 4.0.1-alpha.1 → 4.0.1-alpha.2

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.
@@ -1,8 +1,8 @@
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 r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));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=43)}([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 rt})),n.d(e,"useMemo",(function(){return ot})),n.d(e,"useCallback",(function(){return at})),n.d(e,"useContext",(function(){return st})),n.d(e,"useDebugValue",(function(){return ut})),n.d(e,"useErrorBoundary",(function(){return ct})),n.d(e,"createElement",(function(){return m})),n.d(e,"createContext",(function(){return U})),n.d(e,"createRef",(function(){return g})),n.d(e,"Fragment",(function(){return y})),n.d(e,"Component",(function(){return b})),n.d(e,"version",(function(){return Zt})),n.d(e,"Children",(function(){return St})),n.d(e,"render",(function(){return Bt})),n.d(e,"hydrate",(function(){return Ft})),n.d(e,"unmountComponentAtNode",(function(){return te})),n.d(e,"createPortal",(function(){return Lt})),n.d(e,"createFactory",(function(){return Kt})),n.d(e,"cloneElement",(function(){return Qt})),n.d(e,"isValidElement",(function(){return Jt})),n.d(e,"findDOMNode",(function(){return ee})),n.d(e,"PureComponent",(function(){return yt})),n.d(e,"memo",(function(){return bt})),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 re})),n.d(e,"Suspense",(function(){return kt})),n.d(e,"SuspenseList",(function(){return At})),n.d(e,"lazy",(function(){return Tt})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return qt}));var i,r,o,a,s,u,c,l={},d=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(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 r,o,a,s={};for(a in e)"key"==a?r=e[a]:"ref"==a?o=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return v(t,s,r,o,null)}function v(t,e,n,i,a){var s={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==a?++o:a};return null==a&&null!=r.vnode&&r.vnode(s),s}function g(){return{current:null}}function y(t){return t.children}function b(t,e){this.props=t,this.context=e}function _(t,e){if(null==e)return t.__?_(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?_(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)&&a.push(t)&&!x.__r++||u!==r.debounceRendering)&&((u=r.debounceRendering)||s)(x)}function x(){for(var t;x.__r=a.length;)t=a.sort((function(t,e){return t.__v.__b-e.__v.__b})),a=[],t.some((function(t){var e,n,i,r,o,a;t.__d&&(o=(r=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=h({},r)).__v=r.__v+1,D(a,r,i,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?_(r):o,r.__h),R(n,r),r.__e!=o&&w(r)))}))}function S(t,e,n,i,r,o,a,s,u,c){var f,h,p,m,g,b,w,C=i&&i.__k||d,x=C.length;for(n.__k=[],f=0;f<e.length;f++)if(null!=(m=n.__k[f]=null==(m=e[f])||"boolean"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?v(null,m,null,null,m):Array.isArray(m)?v(y,{children:m},null,null,null):m.__b>0?v(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(p=C[f])||p&&m.key==p.key&&m.type===p.type)C[f]=void 0;else for(h=0;h<x;h++){if((p=C[h])&&m.key==p.key&&m.type===p.type){C[h]=void 0;break}p=null}D(t,m,p=p||l,r,o,a,s,u,c),g=m.__e,(h=m.ref)&&p.ref!=h&&(w||(w=[]),p.ref&&w.push(p.ref,null,m),w.push(h,m.__c||g,m)),null!=g?(null==b&&(b=g),"function"==typeof m.type&&m.__k===p.__k?m.__d=u=E(m,u,t):u=k(t,m,p,C,g,u),"function"==typeof n.type&&(n.__d=u)):u&&p.__e==u&&u.parentNode!=t&&(u=_(p))}for(n.__e=b,f=x;f--;)null!=C[f]&&("function"==typeof n.type&&null!=C[f].__e&&C[f].__e==n.__d&&(n.__d=_(i,f+1)),j(C[f],C[f]));if(w)for(f=0;f<w.length;f++)I(w[f],w[++f],w[++f])}function E(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?E(i,e,n):k(n,i,i,r,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,r,o){var a,s,u;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,u=0;(s=s.nextSibling)&&u<i.length;u+=2)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function O(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||f.test(e)?n:n+"px"}function T(t,e,n,i,r){var o;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||O(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||O(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?M:A,o):t.removeEventListener(e,o?M:A,o);else if("dangerouslySetInnerHTML"!==e){if(r)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 A(t){this.l[t.type+!1](r.event?r.event(t):t)}function M(t){this.l[t.type+!0](r.event?r.event(t):t)}function D(t,e,n,i,o,a,s,u,c){var l,d,f,p,m,v,g,_,w,C,x,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(c=n.__h,u=e.__e=n.__e,e.__h=null,a=[u]),(l=r.__b)&&l(e);try{t:if("function"==typeof E){if(_=e.props,w=(l=E.contextType)&&i[l.__c],C=l?w?w.props.value:l.__:i,n.__c?g=(d=e.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?e.__c=d=new E(_,C):(e.__c=d=new b(_,C),d.constructor=E,d.render=z),w&&w.sub(d),d.props=_,d.state||(d.state={}),d.context=C,d.__n=i,f=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,E.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,f)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&_!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,C),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,C)||e.__v===n.__v){d.props=_,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&&s.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,C),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,m,v)}))}d.context=C,d.props=_,d.state=d.__s,(l=r.__r)&&l(e),d.__d=!1,d.__v=e,d.__P=t,l=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(i=h(h({},i),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(p,m)),x=null!=l&&l.type===y&&null==l.key?l.props.children:l,S(t,Array.isArray(x)?x:[x],e,n,i,o,a,s,u,c),d.base=e.__e,e.__h=null,d.__h.length&&s.push(d),g&&(d.__E=d.__=null),d.__e=!1}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=L(n.__e,e,n,i,o,a,s,c);(l=r.diffed)&&l(e)}catch(t){e.__v=null,(c||null!=a)&&(e.__e=u,e.__h=!!c,a[a.indexOf(u)]=null),r.__e(t,e,n)}}function R(t,e){r.__c&&r.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){r.__e(t,e.__v)}}))}function L(t,e,n,r,o,a,s,u){var c,d,f,h=n.props,m=e.props,v=e.type,g=0;if("svg"===v&&(o=!0),null!=a)for(;g<a.length;g++)if((c=a[g])&&"setAttribute"in c==!!v&&(v?c.localName===v:3===c.nodeType)){t=c,a[g]=null;break}if(null==t){if(null===v)return document.createTextNode(m);t=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,m.is&&m),a=null,u=!1}if(null===v)h===m||u&&t.data===m||(t.data=m);else{if(a=a&&i.call(t.childNodes),d=(h=n.props||l).dangerouslySetInnerHTML,f=m.dangerouslySetInnerHTML,!u){if(null!=a)for(h={},g=0;g<t.attributes.length;g++)h[t.attributes[g].name]=t.attributes[g].value;(f||d)&&(f&&(d&&f.__html==d.__html||f.__html===t.innerHTML)||(t.innerHTML=f&&f.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||T(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||T(t,o,e[o],n[o],i)}(t,m,h,o,u),f)e.__k=[];else if(g=e.props.children,S(t,Array.isArray(g)?g:[g],e,n,r,o&&"foreignObject"!==v,a,s,a?a[0]:n.__k&&_(n,0),u),null!=a)for(g=a.length;g--;)null!=a[g]&&p(a[g]);u||("value"in m&&void 0!==(g=m.value)&&(g!==h.value||g!==t.value||"progress"===v&&!g)&&T(t,"value",g,h.value,!1),"checked"in m&&void 0!==(g=m.checked)&&g!==t.checked&&T(t,"checked",g,h.checked,!1))}return t}function I(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){r.__e(t,n)}}function j(t,e,n){var i,o;if(r.unmount&&r.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||I(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){r.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&j(i[o],e,"function"!=typeof t.type);n||null==t.__e||p(t.__e),t.__e=t.__d=void 0}function z(t,e,n){return this.constructor(t,n)}function V(t,e,n){var o,a,s;r.__&&r.__(t,e),a=(o="function"==typeof n)?null:n&&n.__k||e.__k,s=[],D(e,t=(!o&&n||e).__k=m(y,null,[t]),a||l,l,void 0!==e.ownerSVGElement,!o&&n?[n]:a?null:e.firstChild?i.call(e.childNodes):null,s,!o&&n?n:a?a.__e:e.firstChild,o),R(s,t)}function B(t,e){V(t,e,B)}function F(t,e,n){var r,o,a,s=h({},t.props);for(a in e)"key"==a?r=e[a]:"ref"==a?o=e[a]:s[a]=e[a];return arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),v(t.type,s,r||t.key,o||t.ref,null)}function U(t,e){var n={__c:e="__cC"+c++,__: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,r={__e:function(t,e){for(var n,i,r;e=e.__;)if((n=e.__c)&&!n.__)try{if((i=n.constructor)&&null!=i.getDerivedStateFromError&&(n.setState(i.getDerivedStateFromError(t)),r=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),r=n.__d),r)return n.__E=n}catch(e){t=e}throw t}},o=0,b.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof t&&(t=t(h({},n),this.props)),t&&h(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),C(this))},b.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),C(this))},b.prototype.render=y,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x.__r=0,c=0;var N,H,W,$=0,X=[],Y=r.__b,G=r.__r,q=r.diffed,Z=r.__c,K=r.unmount;function J(t,e){r.__h&&r.__h(H,t,$||e),$=0;var n=H.__H||(H.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Q(t){return $=1,tt(mt,t)}function tt(t,e,n){var i=J(N++,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=H),i.__}function et(t,e){var n=J(N++,3);!r.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,H.__H.__h.push(n))}function nt(t,e){var n=J(N++,4);!r.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,H.__h.push(n))}function it(t){return $=5,ot((function(){return{current:t}}),[])}function rt(t,e,n){$=6,nt((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))}function ot(t,e){var n=J(N++,7);return pt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function at(t,e){return $=8,ot((function(){return t}),e)}function st(t){var e=H.context[t.__c],n=J(N++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(H)),e.props.value):t.__}function ut(t,e){r.useDebugValue&&r.useDebugValue(e?e(t):t)}function ct(t){var e=J(N++,10),n=Q();return e.__=t,H.componentDidCatch||(H.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}function lt(){for(var t;t=X.shift();)if(t.__P)try{t.__H.__h.forEach(ft),t.__H.__h.forEach(ht),t.__H.__h=[]}catch(e){t.__H.__h=[],r.__e(e,t.__v)}}r.__b=function(t){H=null,Y&&Y(t)},r.__r=function(t){G&&G(t),N=0;var e=(H=t.__c).__H;e&&(e.__h.forEach(ft),e.__h.forEach(ht),e.__h=[])},r.diffed=function(t){q&&q(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==X.push(e)&&W===r.requestAnimationFrame||((W=r.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),dt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);dt&&(e=requestAnimationFrame(n))})(lt)),H=null},r.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ft),t.__h=t.__h.filter((function(t){return!t.__||ht(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],r.__e(n,t.__v)}})),Z&&Z(t,e)},r.unmount=function(t){K&&K(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{ft(t)}catch(t){e=t}})),e&&r.__e(e,n.__v))};var dt="function"==typeof requestAnimationFrame;function ft(t){var e=H,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),H=e}function ht(t){var e=H;t.__c=t.__(),H=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 vt(t,e){for(var n in e)t[n]=e[n];return t}function gt(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 bt(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:gt(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 b).isPureReactComponent=!0,yt.prototype.shouldComponentUpdate=function(t,e){return gt(this.props,t)||gt(this.state,e)};var _t=r.__b;r.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),_t&&_t(t)};var wt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ct(t){function e(e,n){var i=vt({},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 xt=function(t,e){return null==t?null:P(P(t).map(e))},St={map:xt,forEach:xt,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=r.__e;r.__e=function(t,e,n){if(t.then)for(var i,r=e;r=r.__;)if((i=r.__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=r.unmount;function kt(){this.__u=0,this.t=null,this.__b=null}function Ot(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Tt(t){var e,n,i;function r(r){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,r)}return r.displayName="Lazy",r.__f=!0,r}function At(){this.u=null,this.o=null}r.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 b).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var r=Ot(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,r?r(s):s())};n.__R=a;var s=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()}},u=!0===e.__h;i.__u++||u||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(a,a)},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=vt({},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 r=e.__e&&m(y,null,t.fallback);return r&&(r.__h=null),[m(y,null,e.__e?null:t.children),r]};var Mt=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 Dt(t){return this.getChildContext=function(){return t.context},t.children}function Rt(t){var e=this,n=t.i;e.componentWillUnmount=function(){V(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)}}),V(m(Dt,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}function Lt(t,e){return m(Rt,{__v:t,i:e})}(At.prototype=new b).__e=function(t){var e=this,n=Ot(e.__v),i=e.o.get(t);return i[0]++,function(r){var o=function(){e.props.revealOrder?(i.push(r),Mt(e,t,i)):r()};n?n(o):o()}},At.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},At.prototype.componentDidUpdate=At.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Mt(t,n,e)}))};var It="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,jt=/^(?: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]/,zt="undefined"!=typeof document,Vt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};function Bt(t,e,n){return null==e.__k&&(e.textContent=""),V(t,e),"function"==typeof n&&n(),t?t.__c:null}function Ft(t,e,n){return B(t,e),"function"==typeof n&&n(),t?t.__c:null}b.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(b.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=r.event;function Nt(){}function Ht(){return this.cancelBubble}function Wt(){return this.defaultPrevented}r.event=function(t){return Ut&&(t=Ut(t)),t.persist=Nt,t.isPropagationStopped=Ht,t.isDefaultPrevented=Wt,t.nativeEvent=t};var $t,Xt={configurable:!0,get:function(){return this.class}},Yt=r.vnode;r.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var r=-1===e.indexOf("-");for(var o in i={},n){var a=n[o];zt&&"children"===o&&"noscript"===e||"value"===o&&"defaultValue"in n&&null==a||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===a?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+e)&&!Vt(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():r&&jt.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),i[o]=a)}"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&&(Xt.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Xt))}t.$$typeof=It,Yt&&Yt(t)};var Gt=r.__r;r.__r=function(t){Gt&&Gt(t),$t=t.__c};var qt={ReactCurrentDispatcher:{current:{readContext:function(t){return $t.__n[t.__c].props.value}}}},Zt="17.0.2";function Kt(t){return m.bind(null,t)}function Jt(t){return!!t&&t.$$typeof===It}function Qt(t){return Jt(t)?F.apply(null,arguments):t}function te(t){return!!t.__k&&(V(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)},re=y;e.default={useState:Q,useReducer:tt,useEffect:et,useLayoutEffect:nt,useRef:it,useImperativeHandle:rt,useMemo:ot,useCallback:at,useContext:st,useDebugValue:ut,version:"17.0.2",Children:St,render:Bt,hydrate:Ft,unmountComponentAtNode:te,createPortal:Lt,createElement:m,createContext:U,createFactory:Kt,cloneElement:Qt,createRef:g,Fragment:y,isValidElement:Jt,findDOMNode:ee,Component:b,PureComponent:yt,memo:bt,forwardRef:Ct,flushSync:ie,unstable_batchedUpdates:ne,StrictMode:y,Suspense:kt,SuspenseList:At,lazy:Tt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qt}},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,r){return new i(r*(t.x-e),r*(t.y-n))}static scaleListToHtmlElement(t,e,n){return t.map((t=>i.scaleToHtmlElement(t,e,n)))}static scaleToHtmlElement(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,r){if(!t||!e)return new i(0,0);const o=new i(t,e);return r=null!=r?r:1,1===(n=n?n%4:0)?i.withScale(o.y,-o.x,r):2===n?i.withScale(-o.x,-o.y,r):3===n?i.withScale(-o.y,o.x,r):i.withScale(o.x,o.y,r)}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)}static centerX(t){if(t)return(i.highestX(t)+i.lowestX(t))/2}static highestX(t){if(t)return Math.max(...t.map((t=>t.x)))}static lowestX(t){if(t)return Math.min(...t.map((t=>t.x)))}static lowestY(t){if(t)return Math.min(...t.map((t=>t.y)))}static highestY(t){if(t)return Math.max(...t.map((t=>t.y)))}static width(t){if(t)return i.highestX(t)-i.lowestX(t)}static left(t){if(t)return t.reduce(((t,e)=>t.x<e.x?t:e))}static right(t){if(t)return t.reduce(((t,e)=>t.x>e.x?t:e))}static toSvgString(t){if(void 0!==t)return t.map((t=>`${t.x.toFixed(2)},${t.y.toFixed(2)}`)).join(" ")}}e.Point=i},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Size=void 0;const i=n(1);class r{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 r(t.clientWidth,t.clientHeight):new r(0,0)}static fromJson(t){return new r(t.width,t.height)}static subtractFrom(t,e){return new r(t.width-e,t.height-e)}static empty(){return new r(0,0)}}e.Size=r},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageUtils=void 0;const r=n(6),o=n(11);class a{static toDataUrl(t){return new Promise(((e,n)=>{const i=new Blob([t],{type:"image/jpeg"}),r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(i)}))}static getObjectFitSize(t,e,n=!0){const i=e.width/e.height,o=t.width/t.height;let a=0,s=0;(n?i>o:i<o)?(a=t.width,s=a/i):(s=t.height,a=s*i);const u=(t.width-a)/2,c=(t.height-s)/2;return new r.Frame(u,c,a,s)}static loadFromUrl(t){return new Promise(((e,n)=>{const r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=r.width,t.height=r.height;const n=t.getContext("2d");n.drawImage(r,0,0);const i=n.getImageData(0,0,r.width,r.height);e(i)})),r.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,o.Utils.uuid()+n+".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 a.createImageDataCanvas(a.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}}e.ImageUtils=a},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)}static fromDOMRect(t){return new i(t.x,t.y,t.width,t.height)}}e.Frame=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewUtils=void 0;const i=n(61),r=n(4),o=n(1);class a{static convertLinesToViewportLines(t,e){if(!e||!t)return;const n=[],{x:r,y:o,containerScale:a}=this.calculateScale(t);return e.forEach((t=>{n.push(i.MagneticLine.scaleToLine(t,r,o,a))})),n}static convertToViewportPointsFromParentSize(t,e){return e?r.Size.isEmpty(t)?void 0:e.map((e=>o.Point.scaleUpTo(e,t))):r.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,r=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,r=(e.height-t.height/n)/2):(n=t.height/e.height,i=(e.width-t.width/n)/2),{x:i,y:r,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",a.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",a.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=a},function(t,e,n){"use strict";n.r(e),n.d(e,"createDomMotionComponent",(function(){return Ma})),n.d(e,"motion",(function(){return Aa})),n.d(e,"m",(function(){return Da})),n.d(e,"AnimatePresence",(function(){return Va})),n.d(e,"AnimateSharedLayout",(function(){return Ga})),n.d(e,"MotionConfig",(function(){return qa})),n.d(e,"LazyMotion",(function(){return Za})),n.d(e,"domAnimation",(function(){return Ja})),n.d(e,"domMax",(function(){return Qa})),n.d(e,"useMotionValue",(function(){return ts})),n.d(e,"useMotionTemplate",(function(){return is})),n.d(e,"MotionValue",(function(){return Qi})),n.d(e,"motionValue",(function(){return tr})),n.d(e,"resolveMotionValue",(function(){return Jt})),n.d(e,"useTransform",(function(){return as})),n.d(e,"useSpring",(function(){return us})),n.d(e,"useVelocity",(function(){return cs})),n.d(e,"useElementScroll",(function(){return ms})),n.d(e,"useViewportScroll",(function(){return bs})),n.d(e,"useReducedMotion",(function(){return _s})),n.d(e,"animationControls",(function(){return ws})),n.d(e,"useAnimation",(function(){return Cs})),n.d(e,"animate",(function(){return Ba})),n.d(e,"animateVisualElement",(function(){return fr})),n.d(e,"useCycle",(function(){return Ss})),n.d(e,"transform",(function(){return os})),n.d(e,"isValidMotionProp",(function(){return At})),n.d(e,"useIsPresent",(function(){return S})),n.d(e,"usePresence",(function(){return x})),n.d(e,"DragControls",(function(){return Es})),n.d(e,"useDragControls",(function(){return ks})),n.d(e,"useDomEvent",(function(){return se})),n.d(e,"createMotionComponent",(function(){return N})),n.d(e,"addScaleCorrection",(function(){return Y})),n.d(e,"snapshotViewportBox",(function(){return io})),n.d(e,"createCrossfader",(function(){return Fa})),n.d(e,"visualElement",(function(){return sa})),n.d(e,"batchLayout",(function(){return Co})),n.d(e,"flushLayout",(function(){return xo})),n.d(e,"MotionConfigContext",(function(){return y})),n.d(e,"PresenceContext",(function(){return w})),n.d(e,"LayoutGroupContext",(function(){return T})),n.d(e,"VisibilityAction",(function(){return Ao})),n.d(e,"FramerTreeLayoutContext",(function(){return qo})),n.d(e,"SharedLayoutContext",(function(){return Go})),n.d(e,"createBatcher",(function(){return Xo})),n.d(e,"FlatTree",(function(){return aa})),n.d(e,"useDeprecatedAnimatedState",(function(){return Ms})),n.d(e,"useDeprecatedInvertedScale",(function(){return Ls}));var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)};function a(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}Object.create;function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function u(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var c=n(0),l=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},d={measureLayout:l(["layout","layoutId","drag","_layoutResetTransform"]),animation:l(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:l(["exit"]),drag:l(["drag","dragControls"]),focus:l(["whileFocus"]),hover:l(["whileHover","onHoverStart","onHoverEnd"]),tap:l(["whileTap","onTap","onTapStart","onTapCancel"]),pan:l(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:l(["layout","layoutId"])};function f(t){for(var e in t){var n=t[e];null!==n&&(d[e].Component=n)}}var h=function(){},p=function(){};var m=Object(c.createContext)({strict:!1}),v=Object.keys(d),g=v.length;var y=Object(c.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),b=Object(c.createContext)({});function _(){return Object(c.useContext)(b).visualElement}var w=Object(c.createContext)(null);function C(t){var e=Object(c.useRef)(null);return null===e.current&&(e.current=t()),e.current}function x(){var t=Object(c.useContext)(w);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,i=t.register,r=O();Object(c.useEffect)((function(){return i(r)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(r)}]:[!0]}function S(){return E(Object(c.useContext)(w))}function E(t){return null===t||t.isPresent}var P=0,k=function(){return P++},O=function(){return C(k)},T=Object(c.createContext)(null),A="undefined"!=typeof window,M=A?c.useLayoutEffect:c.useEffect;function D(t,e,n,i){var r=Object(c.useContext)(y),a=Object(c.useContext)(m),s=_(),u=Object(c.useContext)(w),l=function(t){var e=t.layoutId,n=Object(c.useContext)(T);return n&&void 0!==e?n+"-"+e:e}(n),d=Object(c.useRef)(void 0);i||(i=a.renderer),!d.current&&i&&(d.current=i(t,{visualState:e,parent:s,props:o(o({},n),{layoutId:l}),presenceId:null==u?void 0:u.id,blockInitialAnimation:!1===(null==u?void 0:u.initial)}));var f=d.current;return M((function(){f&&(f.setProps(o(o(o({},r),n),{layoutId:l})),f.isPresent=E(u),f.isPresenceRoot=!s||s.presenceId!==(null==u?void 0:u.id),f.syncRender())})),Object(c.useEffect)((function(){var t;f&&(null===(t=f.animationState)||void 0===t||t.animateChanges())})),M((function(){return function(){return null==f?void 0:f.notifyUnmount()}}),[]),f}function R(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function L(t){return Array.isArray(t)}function I(t){return"string"==typeof t||L(t)}function j(t,e,n,i,r){var o;return void 0===i&&(i={}),void 0===r&&(r={}),"string"==typeof e&&(e=null===(o=t.variants)||void 0===o?void 0:o[e]),"function"==typeof e?e(null!=n?n:t.custom,i,r):e}function z(t,e,n){var i=t.getProps();return j(i,e,null!=n?n:i.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function V(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||I(t.initial)||I(t.animate)||I(t.whileHover)||I(t.whileDrag)||I(t.whileTap)||I(t.whileFocus)||I(t.exit)}function B(t){return Boolean(V(t)||t.variants)}function F(t,e){var n=function(t,e){if(V(t)){var n=t.initial,i=t.animate;return{initial:!1===n||I(n)?n:void 0,animate:I(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,Object(c.useContext)(b)),i=n.initial,r=n.animate;return Object(c.useMemo)((function(){return{initial:i,animate:r}}),e?[U(i),U(r)]:[])}function U(t){return Array.isArray(t)?t.join(" "):t}function N(t){var e=t.preloadedFeatures,n=t.createVisualElement,i=t.useRender,r=t.useVisualState,a=t.Component;return e&&f(e),Object(c.forwardRef)((function(t,e){var s=Object(c.useContext)(y).isStatic,u=null,l=F(t,s),f=r(t,s);return!s&&A&&(l.visualElement=D(a,f,t,n),u=function(t,e,n){var i=[];if(Object(c.useContext)(m),!e)return null;for(var r=0;r<g;r++){var a=v[r],s=d[a],u=s.isEnabled,l=s.Component;u(t)&&l&&i.push(c.createElement(l,o({key:a},t,{visualElement:e})))}return i}(t,l.visualElement)),c.createElement(c.Fragment,null,c.createElement(b.Provider,{value:l},i(a,t,function(t,e,n){return Object(c.useCallback)((function(i){var r;i&&(null===(r=t.mount)||void 0===r||r.call(t,i)),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):R(n)&&(n.current=i))}),[e])}(f,l.visualElement,e),f,s)),u)}))}function H(t){function e(e,n){return void 0===n&&(n={}),N(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,i){return n.has(i)||n.set(i,e(i)),n.get(i)}})}var W=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function $(t){return"string"==typeof t&&!t.includes("-")&&!!(W.indexOf(t)>-1||/[A-Z]/.test(t))}var X={};function Y(t){for(var e in t)X[e]=t[e]}var G=["","X","Y","Z"],q=["transformPerspective","x","y","z"];function Z(t,e){return q.indexOf(t)-q.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return G.forEach((function(e){return q.push(t+e)}))}));var K=new Set(q);function J(t){return K.has(t)}var Q=new Set(["originX","originY","originZ"]);function tt(t){return Q.has(t)}function et(t,e){var n=e.layout,i=e.layoutId;return J(t)||tt(t)||(n||void 0!==i)&&(!!X[t]||"opacity"===t)}var nt=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},it={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function rt(t){return t.startsWith("--")}var ot=function(t,e){return e&&"number"==typeof t?e.transform(t):t},at=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},st=function(t){return t%1?Number(t.toFixed(5)):t},ut=/(-)?([\d]*\.?[\d])+/g,ct=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,lt=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function dt(t){return"string"==typeof t}var ft=function(t){return{test:function(e){return dt(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},ht=ft("deg"),pt=ft("%"),mt=ft("px"),vt=ft("vh"),gt=ft("vw"),yt=o(o({},pt),{parse:function(t){return pt.parse(t)/100},transform:function(t){return pt.transform(100*t)}}),bt={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},_t=o(o({},bt),{transform:at(0,1)}),wt=o(o({},bt),{default:1}),Ct=o(o({},bt),{transform:Math.round}),xt={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,radius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,size:mt,top:mt,right:mt,bottom:mt,left:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,rotate:ht,rotateX:ht,rotateY:ht,rotateZ:ht,scale:wt,scaleX:wt,scaleY:wt,scaleZ:wt,skew:ht,skewX:ht,skewY:ht,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:_t,originX:yt,originY:yt,originZ:mt,zIndex:Ct,fillOpacity:_t,strokeOpacity:_t,numOctaves:Ct};function St(t,e,n,i,r,o,a,s){var u,c=t.style,l=t.vars,d=t.transform,f=t.transformKeys,h=t.transformOrigin;f.length=0;var p=!1,m=!1,v=!0;for(var g in e){var y=e[g];if(rt(g))l[g]=y;else{var b=xt[g],_=ot(y,b);if(J(g)){if(p=!0,d[g]=_,f.push(g),!v)continue;y!==(null!==(u=b.default)&&void 0!==u?u:0)&&(v=!1)}else if(tt(g))h[g]=_,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&X[g]){var w=X[g].process(y,i,n),C=X[g].applyTo;if(C)for(var x=C.length,S=0;S<x;S++)c[C[S]]=w;else c[g]=w}else c[g]=_}}i&&n&&a&&s?(c.transform=a(i.deltaFinal,i.treeScale,p?d:void 0),o&&(c.transform=o(d,c.transform)),c.transformOrigin=s(i)):(p&&(c.transform=function(t,e,n,i){var r=t.transform,o=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,u=e.allowTransformNone,c=void 0===u||u,l="";o.sort(Z);for(var d=!1,f=o.length,h=0;h<f;h++){var p=o[h];l+=(it[p]||p)+"("+r[p]+") ","z"===p&&(d=!0)}return!d&&s?l+="translateZ(0)":l=l.trim(),i?l=i(r,n?"":l):c&&n&&(l="none"),l}(t,r,v,o)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,i=t.originY,r=void 0===i?"50%":i,o=t.originZ;return n+" "+r+" "+(void 0===o?0:o)}(h)))}var Et=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Pt(t,e,n){for(var i in e)nt(e[i])||et(i,n)||(t[i]=e[i])}function kt(t,e,n){var i={};return Pt(i,t.style||{},t),Object.assign(i,function(t,e,n){var i=t.transformTemplate;return Object(c.useMemo)((function(){var t=Et();St(t,e,void 0,void 0,{enableHardwareAcceleration:!n},i);var r=t.vars,a=t.style;return o(o({},r),a)}),[e])}(t,e,n)),t.transformValues&&(i=t.transformValues(i)),i}function Ot(t,e,n){var i={},r=kt(t,e,n);return Boolean(t.drag)&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),i.style=r,i}var Tt=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function At(t){return Tt.has(t)}var Mt=function(t){return!At(t)};try{var Dt=n(17).default;Mt=function(t){return t.startsWith("on")?!At(t):Dt(t)}}catch(t){}function Rt(t,e,n){return"string"==typeof t?t:mt.transform(e+n*t)}var Lt=function(t,e){return mt.transform(t*e)},It={offset:"stroke-dashoffset",array:"stroke-dasharray"},jt={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,e,n,i,r,o,s,u){var c=e.attrX,l=e.attrY,d=e.originX,f=e.originY,h=e.pathLength,p=e.pathSpacing,m=void 0===p?1:p,v=e.pathOffset,g=void 0===v?0:v;St(t,a(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,r,o,s,u),t.attrs=t.style,t.style={};var y=t.attrs,b=t.style,_=t.dimensions,w=t.totalPathLength;y.transform&&(_&&(b.transform=y.transform),delete y.transform),_&&(void 0!==d||void 0!==f||b.transform)&&(b.transformOrigin=function(t,e,n){return Rt(e,t.x,t.width)+" "+Rt(n,t.y,t.height)}(_,void 0!==d?d:.5,void 0!==f?f:.5)),void 0!==c&&(y.x=c),void 0!==l&&(y.y=l),void 0!==w&&void 0!==h&&function(t,e,n,i,r,o){void 0===i&&(i=1),void 0===r&&(r=0),void 0===o&&(o=!0);var a=o?It:jt;t[a.offset]=Lt(-r,e);var s=Lt(n,e),u=Lt(i,e);t[a.array]=s+" "+u}(y,w,h,m,g,!1)}var Vt=function(){return o(o({},Et()),{attrs:{}})};function Bt(t,e){var n=Object(c.useMemo)((function(){var n=Vt();return zt(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),o(o({},n.attrs),{style:o({},n.style)})}),[e]);if(t.style){var i={};Pt(i,t.style,t),n.style=o(o({},i),n.style)}return n}function Ft(t){void 0===t&&(t=!1);return function(e,n,i,r,a){var s=r.latestValues,u=($(e)?Bt:Ot)(n,s,a),l=function(t,e,n){var i={};for(var r in t)(Mt(r)||!0===n&&At(r)||!e&&!At(r))&&(i[r]=t[r]);return i}(n,"string"==typeof e,t),d=o(o(o({},l),u),{ref:i});return Object(c.createElement)(e,d)}}var Ut=/([a-z])([A-Z])/g,Nt=function(t){return t.replace(Ut,"$1-$2").toLowerCase()};function Ht(t,e){var n=e.style,i=e.vars;for(var r in Object.assign(t.style,n),i)t.style.setProperty(r,i[r])}var Wt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function $t(t,e){for(var n in Ht(t,e),e.attrs)t.setAttribute(Wt.has(n)?n:Nt(n),e.attrs[n])}function Xt(t){var e=t.style,n={};for(var i in e)(nt(e[i])||et(i,t))&&(n[i]=e[i]);return n}function Yt(t){var e=Xt(t);for(var n in t){if(nt(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Gt(t){return"object"==typeof t&&"function"==typeof t.start}var qt=function(t){return Array.isArray(t)},Zt=function(t){return Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)},Kt=function(t){return qt(t)?t[t.length-1]||0:t};function Jt(t){var e=nt(t)?t.get():t;return Zt(e)?e.toValue():e}function Qt(t,e,n,i){var r=t.scrapeMotionValuesFromProps,o=t.createRenderState,a=t.onMount,s={latestValues:ee(e,n,i,r),renderState:o()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var te=function(t){return function(e,n){var i=Object(c.useContext)(b),r=Object(c.useContext)(w);return n?Qt(t,e,i,r):C((function(){return Qt(t,e,i,r)}))}};function ee(t,e,n,i){var r={},o=!1===(null==n?void 0:n.initial),s=i(t);for(var u in s)r[u]=Jt(s[u]);var c=t.initial,l=t.animate,d=V(t),f=B(t);e&&f&&!d&&!1!==t.inherit&&(null!=c||(c=e.initial),null!=l||(l=e.animate));var h=o||!1===c?l:c;h&&"boolean"!=typeof h&&!Gt(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=j(t,e);if(n){var i=n.transitionEnd;n.transition;var o=a(n,["transitionEnd","transition"]);for(var s in o)r[s]=o[s];for(var s in i)r[s]=i[s]}}));return r}var ne={useVisualState:te({scrapeMotionValuesFromProps:Yt,createRenderState:Vt,onMount:function(t,e,n){var i=n.renderState,r=n.latestValues;try{i.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){i.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(i.totalPathLength=e.getTotalLength()),zt(i,r,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),$t(e,i)}})};var ie,re={useVisualState:te({scrapeMotionValuesFromProps:Xt,createRenderState:Et})};function oe(t,e,n,i){var r=e.forwardMotionProps,a=void 0!==r&&r,s=$(t)?ne:re;return o(o({},s),{preloadedFeatures:n,useRender:Ft(a),createVisualElement:i,Component:t})}function ae(t,e,n,i){return t.addEventListener(e,n,i),function(){return t.removeEventListener(e,n,i)}}function se(t,e,n,i){Object(c.useEffect)((function(){var r=t.current;if(n&&r)return ae(r,e,n,i)}),[t,e,n,i])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ce(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(ie||(ie={}));var le={pageX:0,pageY:0};function de(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||le;return{x:n[e+"X"],y:n[e+"Y"]}}function fe(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function he(t,e){return void 0===e&&(e="page"),{point:ce(t)?de(t,e):fe(t,e)}}var pe=function(t,e){void 0===e&&(e=!1);var n,i=function(e){return t(e,he(e))};return e?(n=i,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):i},me=function(){return A&&null===window.onpointerdown},ve=function(){return A&&null===window.ontouchstart},ge=function(){return A&&null===window.onmousedown},ye={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},be={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function _e(t){return me()?t:ve()?be[t]:ge()?ye[t]:t}function we(t,e,n,i){return ae(t,_e(e),pe(n,"pointerdown"===e),i)}function Ce(t,e,n,i){return se(t,_e(e),n&&pe(n,"pointerdown"===e),i)}function xe(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var Se=xe("dragHorizontal"),Ee=xe("dragVertical");function Pe(t){var e=!1;if("y"===t)e=Ee();else if("x"===t)e=Se();else{var n=Se(),i=Ee();n&&i?e=function(){n(),i()}:(n&&n(),i&&i())}return e}function ke(){var t=Pe(!0);return!t||(t(),!1)}function Oe(t,e,n){return function(i,r){var o;ue(i)&&!ke()&&(null==n||n(i,r),null===(o=t.animationState)||void 0===o||o.setActive(ie.Hover,e))}}var Te=function(t,e){return!!e&&(t===e||Te(t,e.parentElement))};function Ae(t){return Object(c.useEffect)((function(){return function(){return t()}}),[])}var Me=function(t,e){return function(n){return e(t(n))}},De=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Me)};var Re=function(t){return function(e){return t(e),null}},Le={tap:Re((function(t){var e=t.onTap,n=t.onTapStart,i=t.onTapCancel,r=t.whileTap,o=t.visualElement,a=e||n||i||r,s=Object(c.useRef)(!1),u=Object(c.useRef)(null);function l(){var t;null===(t=u.current)||void 0===t||t.call(u),u.current=null}function d(){var t;return l(),s.current=!1,null===(t=o.animationState)||void 0===t||t.setActive(ie.Tap,!1),!ke()}function f(t,n){d()&&(Te(o.getInstance(),t.target)?null==e||e(t,n):null==i||i(t,n))}function h(t,e){d()&&(null==i||i(t,e))}Ce(o,"pointerdown",a?function(t,e){var i;l(),s.current||(s.current=!0,u.current=De(we(window,"pointerup",f),we(window,"pointercancel",h)),null==n||n(t,e),null===(i=o.animationState)||void 0===i||i.setActive(ie.Tap,!0))}:void 0),Ae(l)})),focus:Re((function(t){var e=t.whileFocus,n=t.visualElement;se(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(ie.Focus,!0)}:void 0),se(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(ie.Focus,!1)}:void 0)})),hover:Re((function(t){var e=t.onHoverStart,n=t.onHoverEnd,i=t.whileHover,r=t.visualElement;Ce(r,"pointerenter",e||i?Oe(r,!0,e):void 0),Ce(r,"pointerleave",n||i?Oe(r,!1,n):void 0)}))};function Ie(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}var je=function(t,e,n){return Math.min(Math.max(n,t),e)},ze=.001,Ve=.01,Be=10,Fe=.05,Ue=1;function Ne(t){var e,n,i=t.duration,r=void 0===i?800:i,o=t.bounce,a=void 0===o?.25:o,s=t.velocity,u=void 0===s?0:s,c=t.mass,l=void 0===c?1:c;h(r<=1e3*Be,"Spring duration must be 10 seconds or less");var d=1-a;d=je(Fe,Ue,d),r=je(Ve,Be,r/1e3),d<1?(e=function(t){var e=t*d,n=e*r,i=e-u,o=We(t,d),a=Math.exp(-n);return ze-i/o*a},n=function(t){var n=t*d*r,i=n*u+u,o=Math.pow(d,2)*Math.pow(t,2)*r,a=Math.exp(-n),s=We(Math.pow(t,2),d);return(-e(t)+ze>0?-1:1)*((i-o)*a)/s}):(e=function(t){return Math.exp(-t*r)*((t-u)*r+1)-ze},n=function(t){return Math.exp(-t*r)*(r*r*(u-t))});var f=function(t,e,n){for(var i=n,r=1;r<He;r++)i-=t(i)/e(i);return i}(e,n,5/r);if(r*=1e3,isNaN(f))return{stiffness:100,damping:10,duration:r};var p=Math.pow(f,2)*l;return{stiffness:p,damping:2*d*Math.sqrt(l*p),duration:r}}var He=12;function We(t,e){return t*Math.sqrt(1-e*e)}var $e=["duration","bounce"],Xe=["stiffness","damping","mass"];function Ye(t,e){return e.some((function(e){return void 0!==t[e]}))}function Ge(t){var e=t.from,n=void 0===e?0:e,i=t.to,r=void 0===i?1:i,s=t.restSpeed,u=void 0===s?2:s,c=t.restDelta,l=a(t,["from","to","restSpeed","restDelta"]),d={done:!1,value:n},f=function(t){var e=o({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Ye(t,Xe)&&Ye(t,$e)){var n=Ne(t);(e=o(o(o({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),h=f.stiffness,p=f.damping,m=f.mass,v=f.velocity,g=f.duration,y=f.isResolvedFromDuration,b=qe,_=qe;function w(){var t=v?-v/1e3:0,e=r-n,i=p/(2*Math.sqrt(h*m)),o=Math.sqrt(h/m)/1e3;if(null!=c||(c=Math.abs(r-n)<=1?.01:.4),i<1){var a=We(o,i);b=function(n){var s=Math.exp(-i*o*n);return r-s*((t+i*o*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},_=function(n){var r=Math.exp(-i*o*n);return i*o*r*(Math.sin(a*n)*(t+i*o*e)/a+e*Math.cos(a*n))-r*(Math.cos(a*n)*(t+i*o*e)-a*e*Math.sin(a*n))}}else if(1===i)b=function(n){return r-Math.exp(-o*n)*(e+(t+o*e)*n)};else{var s=o*Math.sqrt(i*i-1);b=function(n){var a=Math.exp(-i*o*n),u=Math.min(s*n,300);return r-a*((t+i*o*e)*Math.sinh(u)+s*e*Math.cosh(u))/s}}}return w(),{next:function(t){var e=b(t);if(y)d.done=t>=g;else{var n=1e3*_(t),i=Math.abs(n)<=u,o=Math.abs(r-e)<=c;d.done=i&&o}return d.value=d.done?r:e,d},flipTarget:function(){var t;v=-v,n=(t=[r,n])[0],r=t[1],w()}}}Ge.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var qe=function(t){return 0},Ze=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},Ke=function(t,e,n){return-n*t+n*e+t},Je=function(t,e){return function(n){return Boolean(dt(n)&&lt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Qe=function(t,e,n){return function(i){var r;if(!dt(i))return i;var o=i.match(ut),a=o[0],s=o[1],u=o[2],c=o[3];return(r={})[t]=parseFloat(a),r[e]=parseFloat(s),r[n]=parseFloat(u),r.alpha=void 0!==c?parseFloat(c):1,r}},tn=at(0,255),en=o(o({},bt),{transform:function(t){return Math.round(tn(t))}}),nn={test:Je("rgb","red"),parse:Qe("red","green","blue"),transform:function(t){var e=t.red,n=t.green,i=t.blue,r=t.alpha,o=void 0===r?1:r;return"rgba("+en.transform(e)+", "+en.transform(n)+", "+en.transform(i)+", "+st(_t.transform(o))+")"}};var rn={test:Je("#"),parse:function(t){var e="",n="",i="",r="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),r=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),r=t.substr(4,1),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:nn.transform},on={test:Je("hsl","hue"),parse:Qe("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,i=t.lightness,r=t.alpha,o=void 0===r?1:r;return"hsla("+Math.round(e)+", "+pt.transform(st(n))+", "+pt.transform(st(i))+", "+st(_t.transform(o))+")"}},an=function(t,e,n){var i=t*t,r=e*e;return Math.sqrt(Math.max(0,n*(r-i)+i))},sn=[rn,nn,on],un=function(t){return sn.find((function(e){return e.test(t)}))},cn=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},ln=function(t,e){var n=un(t),i=un(e);p(!!n,cn(t)),p(!!i,cn(e)),p(n.transform===i.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var r=n.parse(t),a=i.parse(e),s=o({},r),u=n===on?Ke:an;return function(t){for(var e in s)"alpha"!==e&&(s[e]=u(r[e],a[e],t));return s.alpha=Ke(r.alpha,a.alpha,t),n.transform(s)}},dn={test:function(t){return nn.test(t)||rn.test(t)||on.test(t)},parse:function(t){return nn.test(t)?nn.parse(t):on.test(t)?on.parse(t):rn.parse(t)},transform:function(t){return dt(t)?t:t.hasOwnProperty("red")?nn.transform(t):on.transform(t)}},fn="${c}",hn="${n}";function pn(t){var e=[],n=0,i=t.match(ct);i&&(n=i.length,t=t.replace(ct,fn),e.push.apply(e,i.map(dn.parse)));var r=t.match(ut);return r&&(t=t.replace(ut,hn),e.push.apply(e,r.map(bt.parse))),{values:e,numColors:n,tokenised:t}}function mn(t){return pn(t).values}function vn(t){var e=pn(t),n=e.values,i=e.numColors,r=e.tokenised,o=n.length;return function(t){for(var e=r,n=0;n<o;n++)e=e.replace(n<i?fn:hn,n<i?dn.transform(t[n]):st(t[n]));return e}}var gn=function(t){return"number"==typeof t?0:t};var yn={test:function(t){var e,n,i,r;return isNaN(t)&&dt(t)&&(null!==(n=null===(e=t.match(ut))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(r=null===(i=t.match(ct))||void 0===i?void 0:i.length)&&void 0!==r?r:0)>0},parse:mn,createTransformer:vn,getAnimatableNone:function(t){var e=mn(t);return vn(t)(e.map(gn))}},bn=function(t){return"number"==typeof t};function _n(t,e){return bn(t)?function(n){return Ke(t,e,n)}:dn.test(t)?ln(t,e):Sn(t,e)}var wn=function(t,e){var n=u([],t),i=n.length,r=t.map((function(t,n){return _n(t,e[n])}));return function(t){for(var e=0;e<i;e++)n[e]=r[e](t);return n}},Cn=function(t,e){var n=o(o({},t),e),i={};for(var r in n)void 0!==t[r]&&void 0!==e[r]&&(i[r]=_n(t[r],e[r]));return function(t){for(var e in i)n[e]=i[e](t);return n}};function xn(t){for(var e=yn.parse(t),n=e.length,i=0,r=0,o=0,a=0;a<n;a++)i||"number"==typeof e[a]?i++:void 0!==e[a].hue?o++:r++;return{parsed:e,numNumbers:i,numRGB:r,numHSL:o}}var Sn=function(t,e){var n=yn.createTransformer(e),i=xn(t),r=xn(e);return p(i.numHSL===r.numHSL&&i.numRGB===r.numRGB&&i.numNumbers>=r.numNumbers,"Complex values '"+t+"' and '"+e+"' too different to mix. Ensure all colors are of the same type."),De(wn(i.parsed,r.parsed),n)},En=function(t,e){return function(n){return Ke(t,e,n)}};function Pn(t,e,n){for(var i,r=[],o=n||("number"==typeof(i=t[0])?En:"string"==typeof i?dn.test(i)?ln:Sn:Array.isArray(i)?wn:"object"==typeof i?Cn:void 0),a=t.length-1,s=0;s<a;s++){var u=o(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;u=De(c,u)}r.push(u)}return r}function kn(t,e,n){var i=void 0===n?{}:n,r=i.clamp,o=void 0===r||r,a=i.ease,s=i.mixer,u=t.length;p(u===e.length,"Both input and output ranges must be the same length"),p(!a||!Array.isArray(a)||a.length===u-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[u-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=Pn(e,a,s),l=2===u?function(t,e){var n=t[0],i=t[1],r=e[0];return function(t){return r(Ze(n,i,t))}}(t,c):function(t,e){var n=t.length,i=n-1;return function(r){var o=0,a=!1;if(r<=t[0]?a=!0:r>=t[i]&&(o=i-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>r||s===i);s++);o=s-1}var u=Ze(t[o],t[o+1],r);return e[o](u)}}(t,c);return o?function(e){return l(je(t[0],t[u-1],e))}:l}var On,Tn=function(t){return function(e){return 1-t(1-e)}},An=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},Mn=function(t){return function(e){return e*e*((t+1)*e-t)}},Dn=function(t){return t},Rn=(On=2,function(t){return Math.pow(t,On)}),Ln=Tn(Rn),In=An(Rn),jn=function(t){return 1-Math.sin(Math.acos(t))},zn=Tn(jn),Vn=An(zn),Bn=Mn(1.525),Fn=Tn(Bn),Un=An(Bn),Nn=function(t){var e=Mn(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),Hn=function(t){if(1===t||0===t)return t;var e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Wn=Tn(Hn);function $n(t,e){return t.map((function(){return e||In})).splice(0,t.length-1)}function Xn(t){var e=t.from,n=void 0===e?0:e,i=t.to,r=void 0===i?1:i,o=t.ease,a=t.offset,s=t.duration,u=void 0===s?300:s,c={done:!1,value:n},l=Array.isArray(r)?r:[n,r],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===l.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(l),u);function f(){return kn(d,l,{ease:Array.isArray(o)?o:$n(l,o)})}var h=f();return{next:function(t){return c.value=h(t),c.done=t>=u,c},flipTarget:function(){l.reverse(),h=f()}}}var Yn={keyframes:Xn,spring:Ge,decay:function(t){var e=t.velocity,n=void 0===e?0:e,i=t.from,r=void 0===i?0:i,o=t.power,a=void 0===o?.8:o,s=t.timeConstant,u=void 0===s?350:s,c=t.restDelta,l=void 0===c?.5:c,d=t.modifyTarget,f={done:!1,value:r},h=a*n,p=r+h,m=void 0===d?p:d(p);return m!==p&&(h=m-r),{next:function(t){var e=-h*Math.exp(-t/u);return f.done=!(e>l||e<-l),f.value=f.done?m:m+e,f},flipTarget:function(){}}}};var Gn=1/60*1e3,qn="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Zn="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(qn())}),Gn)};var Kn=!0,Jn=!1,Qn=!1,ti={delta:0,timestamp:0},ei=["read","update","preRender","render","postRender"],ni=ei.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],i=0,r=!1,o=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var u=s&&r,c=u?e:n;return a&&o.add(t),-1===c.indexOf(t)&&(c.push(t),u&&r&&(i=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),o.delete(t)},process:function(s){var u;if(r=!0,e=(u=[n,e])[0],(n=u[1]).length=0,i=e.length)for(var c=0;c<i;c++){var l=e[c];l(s),o.has(l)&&(a.schedule(l),t())}r=!1}};return a}((function(){return Jn=!0})),t}),{}),ii=ei.reduce((function(t,e){var n=ni[e];return t[e]=function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),Jn||ui(),n.schedule(t,e,i)},t}),{}),ri=ei.reduce((function(t,e){return t[e]=ni[e].cancel,t}),{}),oi=ei.reduce((function(t,e){return t[e]=function(){return ni[e].process(ti)},t}),{}),ai=function(t){return ni[t].process(ti)},si=function(t){Jn=!1,ti.delta=Kn?Gn:Math.max(Math.min(t-ti.timestamp,40),1),ti.timestamp=t,Qn=!0,ei.forEach(ai),Qn=!1,Jn&&(Kn=!1,Zn(si))},ui=function(){Jn=!0,Kn=!0,Qn||Zn(si)},ci=function(){return ti},li=ii;function di(t,e,n){return void 0===n&&(n=0),t-e-n}var fi=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return li.update(e,!0)},stop:function(){return ri.update(e)}}};function hi(t){var e,n,i,r,s,u=t.from,c=t.autoplay,l=void 0===c||c,d=t.driver,f=void 0===d?fi:d,h=t.elapsed,p=void 0===h?0:h,m=t.repeat,v=void 0===m?0:m,g=t.repeatType,y=void 0===g?"loop":g,b=t.repeatDelay,_=void 0===b?0:b,w=t.onPlay,C=t.onStop,x=t.onComplete,S=t.onRepeat,E=t.onUpdate,P=a(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),k=P.to,O=0,T=P.duration,A=!1,M=!0,D=function(t){if(Array.isArray(t.to))return Xn;if(Yn[t.type])return Yn[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Xn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ge:Xn}(P);(null===(n=(e=D).needsInterpolation)||void 0===n?void 0:n.call(e,u,k))&&(s=kn([0,100],[u,k],{clamp:!1}),u=0,k=100);var R=D(o(o({},P),{from:u,to:k}));function L(){O++,"reverse"===y?p=function(t,e,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?di(e+-t,e,n):e-(t-e)+n}(p,T,_,M=O%2==0):(p=di(p,T,_),"mirror"===y&&R.flipTarget()),A=!1,S&&S()}function I(t){if(M||(t=-t),p+=t,!A){var e=R.next(Math.max(0,p));r=e.value,s&&(r=s(r)),A=M?e.done:p<=0}null==E||E(r),A&&(0===O&&(null!=T||(T=p)),O<v?function(t,e,n,i){return i?t>=e+n:t<=-n}(p,T,_,M)&&L():(i.stop(),x&&x()))}return l&&(null==w||w(),(i=f(I)).start()),{stop:function(){null==C||C(),i.stop()}}}function pi(t,e){return e?t*(1e3/e):0}var mi=function(t){return 1e3*t},vi=function(t,e){return 1-3*e+3*t},gi=function(t,e){return 3*e-6*t},yi=function(t){return 3*t},bi=function(t,e,n){return((vi(e,n)*t+gi(e,n))*t+yi(e))*t},_i=function(t,e,n){return 3*vi(e,n)*t*t+2*gi(e,n)*t+yi(e)},wi=1e-7,Ci=10;var xi=8;var Si=.1;function Ei(t,e,n,i){if(t===e&&n===i)return Dn;for(var r=new Float32Array(11),o=0;o<11;++o)r[o]=bi(o*Si,t,n);function a(e){for(var i=0,o=1;10!==o&&r[o]<=e;++o)i+=Si;--o;var a=i+(e-r[o])/(r[o+1]-r[o])*Si,s=_i(a,t,n);return s>=.001?function(t,e,n,i){for(var r=0;r<xi;++r){var o=_i(e,n,i);if(0===o)return e;e-=(bi(e,n,i)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,i,r){var o,a,s=0;do{(o=bi(a=e+(n-e)/2,i,r)-t)>0?n=a:e=a}while(Math.abs(o)>wi&&++s<Ci);return a}(e,i,i+Si,t,n)}return function(t){return 0===t||1===t?t:bi(a(t),e,i)}}var Pi={linear:Dn,easeIn:Rn,easeInOut:In,easeOut:Ln,circIn:jn,circInOut:Vn,circOut:zn,backIn:Bn,backInOut:Un,backOut:Fn,anticipate:Nn,bounceIn:Wn,bounceInOut:function(t){return t<.5?.5*(1-Hn(1-2*t)):.5*Hn(2*t-1)+.5},bounceOut:Hn},ki=function(t){if(Array.isArray(t)){p(4===t.length,"Cubic bezier arrays must contain four numerical values.");var e=s(t,4);return Ei(e[0],e[1],e[2],e[3])}return"string"==typeof t?(p(void 0!==Pi[t],"Invalid easing type '"+t+"'"),Pi[t]):t},Oi=function(t){return Array.isArray(t)&&"number"!=typeof t[0]},Ti=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!yn.test(e)||e.startsWith("url(")))},Ai=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Mi=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Di=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ri=function(t){return{type:"keyframes",duration:.8,values:t}},Li={x:Ai,y:Ai,z:Ai,rotate:Ai,rotateX:Ai,rotateY:Ai,rotateZ:Ai,scaleX:Mi,scaleY:Mi,scale:Mi,opacity:Di,backgroundColor:Di,color:Di,default:Mi},Ii=function(t,e){var n;return n=qt(e)?Ri:Li[t]||Li.default,o({to:e},n(e))},ji=new Set(["brightness","contrast","saturate","opacity"]);function zi(t){var e=t.slice(0,-1).split("("),n=e[0],i=e[1];if("drop-shadow"===n)return t;var r=(i.match(ut)||[])[0];if(!r)return t;var o=i.replace(r,""),a=ji.has(n)?1:0;return r!==i&&(a*=100),n+"("+a+o+")"}var Vi=/([a-z-]*)\(.*?\)/g,Bi=o(o({},yn),{getAnimatableNone:function(t){var e=t.match(Vi);return e?e.map(zi).join(" "):t}}),Fi=o(o({},xt),{color:dn,backgroundColor:dn,outlineColor:dn,fill:dn,stroke:dn,borderColor:dn,borderTopColor:dn,borderRightColor:dn,borderBottomColor:dn,borderLeftColor:dn,filter:Bi,WebkitFilter:Bi}),Ui=function(t){return Fi[t]};function Ni(t,e){var n,i=Ui(t);return i!==Bi&&(i=yn),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}var Hi=!1;function Wi(t,e,n){var i;return Array.isArray(e.to)&&(null!==(i=t.duration)&&void 0!==i||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=u([],s(t.to)),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=a(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=o(o({},t),Ii(n,e.to))),o(o({},e),function(t){var e=t.ease,n=t.times,i=t.yoyo,r=t.flip,s=t.loop,u=a(t,["ease","times","yoyo","flip","loop"]),c=o({},u);return n&&(c.offset=n),u.duration&&(c.duration=mi(u.duration)),u.repeatDelay&&(c.repeatDelay=mi(u.repeatDelay)),e&&(c.ease=Oi(e)?e.map(ki):ki(e)),"tween"===u.type&&(c.type="keyframes"),(i||s||r)&&(h(!Hi,"yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."),Hi=!0,i?c.repeatType="reverse":s?c.repeatType="loop":r&&(c.repeatType="mirror"),c.repeat=s||i||r||u.repeat),"spring"!==u.type&&(c.type="keyframes"),c}(t))}function $i(t,e,n,i,r){var a,s=Gi(i,t),u=null!==(a=s.from)&&void 0!==a?a:e.get(),c=Ti(t,n);"none"===u&&c&&"string"==typeof n?u=Ni(t,n):Xi(u)&&"string"==typeof n?u=Yi(n):!Array.isArray(n)&&Xi(n)&&"string"==typeof u&&(n=Yi(u));var l=Ti(t,u);return h(l===c,"You are trying to animate "+t+' from "'+u+'" to "'+n+'". '+u+" is not an animatable value - to enable this animation set "+u+" to a value animatable to "+n+" via the `style` property."),l&&c&&!1!==s.type?function(){var i={from:u,to:n,velocity:e.getVelocity(),onComplete:r,onUpdate:function(t){return e.set(t)}};return"inertia"===s.type||"decay"===s.type?function(t){var e,n=t.from,i=void 0===n?0:n,r=t.velocity,a=void 0===r?0:r,s=t.min,u=t.max,c=t.power,l=void 0===c?.8:c,d=t.timeConstant,f=void 0===d?750:d,h=t.bounceStiffness,p=void 0===h?500:h,m=t.bounceDamping,v=void 0===m?10:m,g=t.restDelta,y=void 0===g?1:g,b=t.modifyTarget,_=t.driver,w=t.onUpdate,C=t.onComplete;function x(t){return void 0!==s&&t<s||void 0!==u&&t>u}function S(t){return void 0===s?u:void 0===u||Math.abs(s-t)<Math.abs(u-t)?s:u}function E(t){null==e||e.stop(),e=hi(o(o({},t),{driver:_,onUpdate:function(e){var n;null==w||w(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:C}))}function P(t){E(o({type:"spring",stiffness:p,damping:v,restDelta:y},t))}if(x(i))P({from:i,velocity:a,to:S(i)});else{var k=l*a+i;"undefined"!=typeof b&&(k=b(k));var O,T,A=S(k),M=A===s?-1:1;E({type:"decay",from:i,velocity:a,timeConstant:f,power:l,restDelta:y,modifyTarget:b,onUpdate:x(k)?function(t){O=T,T=t,a=pi(t-O,ci().delta),(1===M&&t>A||-1===M&&t<A)&&P({from:t,to:A,velocity:a})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(o(o({},i),s)):hi(o(o({},Wi(s,i,t)),{onUpdate:function(t){var e;i.onUpdate(t),null===(e=s.onUpdate)||void 0===e||e.call(s,t)},onComplete:function(){var t;i.onComplete(),null===(t=s.onComplete)||void 0===t||t.call(s)}}))}:function(){var t;return e.set(n),r(),null===(t=null==s?void 0:s.onComplete)||void 0===t||t.call(s),{stop:function(){}}}}function Xi(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Yi(t){return"number"==typeof t?0:Ni("",t)}function Gi(t,e){return t[e]||t.default||t}function qi(t,e,n,i){return void 0===i&&(i={}),e.start((function(r){var o,a,s=$i(t,e,n,i,r),u=function(t,e){var n;return null!==(n=(Gi(t,e)||{}).delay)&&void 0!==n?n:0}(i,t),c=function(){return a=s()};return u?o=setTimeout(c,mi(u)):c(),function(){clearTimeout(o),null==a||a.stop()}}))}function Zi(t,e){-1===t.indexOf(e)&&t.push(e)}function Ki(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Ji=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return Zi(this.subscriptions,t),function(){return Ki(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(var r=0;r<i;r++){var o=this.subscriptions[r];o&&o(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Qi=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ji,this.velocityUpdateSubscribers=new Ji,this.renderSubscribers=new Ji,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var i=ci(),r=i.delta,o=i.timestamp;n.lastUpdated!==o&&(n.timeDelta=r,n.lastUpdated=o,li.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return li.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?pi(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function tr(t){return new Qi(t)}var er=function(t){return function(e){return e.test(t)}},nr=[bt,mt,pt,ht,gt,vt,{test:function(t){return"auto"===t},parse:function(t){return t}}],ir=function(t){return nr.find(er(t))},rr=u(u([],s(nr)),[dn,yn]),or=function(t){return rr.find(er(t))};function ar(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,tr(n))}function sr(t,e){var n=z(t,e),i=n?t.makeTargetAnimatable(n,!1):{},r=i.transitionEnd,s=void 0===r?{}:r;i.transition;var u=a(i,["transitionEnd","transition"]);for(var c in u=o(o({},u),s)){ar(t,c,Kt(u[c]))}}function ur(t,e){u([],s(e)).reverse().forEach((function(n){var i,r=t.getVariant(n);r&&sr(t,r),null===(i=t.variantChildren)||void 0===i||i.forEach((function(t){ur(t,e)}))}))}function cr(t,e,n){var i,r,o,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),u=s.length;if(u)for(var c=0;c<u;c++){var l=s[c],d=e[l],f=null;Array.isArray(d)&&(f=d[0]),null===f&&(f=null!==(r=null!==(i=n[l])&&void 0!==i?i:t.readValue(l))&&void 0!==r?r:e[l]),null!=f&&("string"==typeof f&&/^\-?\d*\.?\d+$/.test(f)?f=parseFloat(f):!or(f)&&yn.test(d)&&(f=Ni(l,d)),t.addValue(l,tr(f)),null!==(o=(a=n)[l])&&void 0!==o||(a[l]=f),t.setBaseTarget(l,f))}}function lr(t,e){if(e)return(e[t]||e.default||e).from}function dr(t,e,n){var i,r,o={};for(var a in t)o[a]=null!==(i=lr(a,e))&&void 0!==i?i:null===(r=n.getValue(a))||void 0===r?void 0:r.get();return o}function fr(t,e,n){var i;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var r=e.map((function(e){return hr(t,e,n)}));i=Promise.all(r)}else if("string"==typeof e)i=hr(t,e,n);else{var o="function"==typeof e?z(t,e,n.custom):e;i=pr(t,o,n)}return i.then((function(){return t.notifyAnimationComplete(e)}))}function hr(t,e,n){var i;void 0===n&&(n={});var r=z(t,e,n.custom),a=(r||{}).transition,u=void 0===a?t.getDefaultTransition()||{}:a;n.transitionOverride&&(u=n.transitionOverride);var c=r?function(){return pr(t,r,n)}:function(){return Promise.resolve()},l=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?function(i){void 0===i&&(i=0);var r=u.delayChildren,a=void 0===r?0:r,s=u.staggerChildren,c=u.staggerDirection;return function(t,e,n,i,r,a){void 0===n&&(n=0);void 0===i&&(i=0);void 0===r&&(r=1);var s=[],u=(t.variantChildren.size-1)*i,c=1===r?function(t){return void 0===t&&(t=0),t*i}:function(t){return void 0===t&&(t=0),u-t*i};return Array.from(t.variantChildren).sort(mr).forEach((function(t,i){s.push(hr(t,e,o(o({},a),{delay:n+c(i)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(s)}(t,e,a+i,s,c,n)}:function(){return Promise.resolve()},d=u.when;if(d){var f=s("beforeChildren"===d?[c,l]:[l,c],2),h=f[0],p=f[1];return h().then(p)}return Promise.all([c(),l(n.delay)])}function pr(t,e,n){var i,r=void 0===n?{}:n,s=r.delay,u=void 0===s?0:s,c=r.transitionOverride,l=r.type,d=t.makeTargetAnimatable(e),f=d.transition,h=void 0===f?t.getDefaultTransition():f,p=d.transitionEnd,m=a(d,["transition","transitionEnd"]);c&&(h=c);var v=[],g=l&&(null===(i=t.animationState)||void 0===i?void 0:i.getState()[l]);for(var y in m){var b=t.getValue(y),_=m[y];if(!(!b||void 0===_||g&&vr(g,y))){var w=qi(y,b,_,o({delay:u},h));v.push(w)}}return Promise.all(v).then((function(){p&&sr(t,p)}))}function mr(t,e){return t.sortNodePosition(e)}function vr(t,e){var n=t.protectedKeys,i=t.needsAnimating,r=n.hasOwnProperty(e)&&!0!==i[e];return i[e]=!1,r}var gr=[ie.Animate,ie.Hover,ie.Tap,ie.Drag,ie.Focus,ie.Exit],yr=u([],s(gr)).reverse(),br=gr.length;function _r(t){var e,n=function(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,i=e.options;return fr(t,n,i)})))}}(t),i=((e={})[ie.Animate]=wr(!0),e[ie.Hover]=wr(),e[ie.Tap]=wr(),e[ie.Drag]=wr(),e[ie.Focus]=wr(),e[ie.Exit]=wr(),e),r={},c=!0,l=function(e,n){var i=z(t,n);if(i){i.transition;var r=i.transitionEnd,s=a(i,["transition","transitionEnd"]);e=o(o(o({},e),s),r)}return e};function d(e,a){for(var d,f=t.getProps(),h=t.getVariantContext(!0)||{},p=[],m=new Set,v={},g=1/0,y=function(n){var r=yr[n],y=i[r],b=null!==(d=f[r])&&void 0!==d?d:h[r],_=I(b),w=r===a?y.isActive:null;!1===w&&(g=n);var C=b===h[r]&&b!==f[r]&&_;if(C&&c&&t.manuallyAnimateOnMount&&(C=!1),y.protectedKeys=o({},v),!y.isActive&&null===w||!b&&!y.prevProp||Gt(b)||"boolean"==typeof b)return"continue";var x=function(t,e){if("string"==typeof e)return e!==t;if(L(e))return!Ie(e,t);return!1}(y.prevProp,b)||r===a&&y.isActive&&!C&&_||n>g&&_,S=Array.isArray(b)?b:[b],E=S.reduce(l,{});!1===w&&(E={});var P=y.prevResolvedValues,k=void 0===P?{}:P,O=o(o({},k),E),T=function(t){x=!0,m.delete(t),y.needsAnimating[t]=!0};for(var A in O){var M=E[A],D=k[A];v.hasOwnProperty(A)||(M!==D?qt(M)&&qt(D)?Ie(M,D)?y.protectedKeys[A]=!0:T(A):void 0!==M?T(A):m.add(A):void 0!==M&&m.has(A)?T(A):y.protectedKeys[A]=!0)}y.prevProp=b,y.prevResolvedValues=E,y.isActive&&(v=o(o({},v),E)),c&&t.blockInitialAnimation&&(x=!1),x&&!C&&p.push.apply(p,u([],s(S.map((function(t){return{animation:t,options:o({type:r},e)}})))))},b=0;b<br;b++)y(b);if(r=o({},v),m.size){var _={};m.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(_[e]=n)})),p.push({animation:_})}var w=Boolean(p.length);return c&&!1===f.initial&&!t.manuallyAnimateOnMount&&(w=!1),c=!1,w?n(p):Promise.resolve()}return{isAnimated:function(t){return void 0!==r[t]},animateChanges:d,setActive:function(e,n,r){var o;return i[e].isActive===n?Promise.resolve():(null===(o=t.variantChildren)||void 0===o||o.forEach((function(t){var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,n)})),i[e].isActive=n,d(r,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return i}}}function wr(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Cr={animation:Re((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=_r(e)),Gt(n)&&Object(c.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:Re((function(t){var e=t.custom,n=t.visualElement,i=s(x(),2),r=i[0],o=i[1],a=Object(c.useContext)(w);Object(c.useEffect)((function(){var t,i,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(ie.Exit,!r,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:e});!r&&(null==s||s.then(o))}),[r])}))},xr=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},Sr=function(t){return xr(t)&&t.hasOwnProperty("z")},Er=function(t,e){return Math.abs(t-e)};function Pr(t,e){if(bn(t)&&bn(e))return Er(t,e);if(xr(t)&&xr(e)){var n=Er(t.x,e.x),i=Er(t.y,e.y),r=Sr(t)&&Sr(e)?Er(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(r,2))}}var kr=function(){function t(t,e,n){var i=this,r=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(i.lastMoveEvent&&i.lastMoveEventInfo){var t=Ar(i.lastMoveEventInfo,i.history),e=null!==i.startEvent,n=Pr(t.offset,{x:0,y:0})>=3;if(e||n){var r=t.point,a=ci().timestamp;i.history.push(o(o({},r),{timestamp:a}));var s=i.handlers,u=s.onStart,c=s.onMove;e||(u&&u(i.lastMoveEvent,t),i.startEvent=i.lastMoveEvent),c&&c(i.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){i.lastMoveEvent=t,i.lastMoveEventInfo=Or(e,i.transformPagePoint),ue(t)&&0===t.buttons?i.handlePointerUp(t,e):li.update(i.updatePoint,!0)},this.handlePointerUp=function(t,e){i.end();var n=i.handlers,r=n.onEnd,o=n.onSessionEnd,a=Ar(Or(e,i.transformPagePoint),i.history);i.startEvent&&r&&r(t,a),o&&o(t,a)},!(ce(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=r;var a=Or(he(t),this.transformPagePoint),s=a.point,u=ci().timestamp;this.history=[o(o({},s),{timestamp:u})];var c=e.onSessionStart;c&&c(t,Ar(a,this.history)),this.removeListeners=De(we(window,"pointermove",this.handlePointerMove),we(window,"pointerup",this.handlePointerUp),we(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),ri.update(this.updatePoint)},t}();function Or(t,e){return e?{point:e(t.point)}:t}function Tr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ar(t,e){var n=t.point;return{point:n,delta:Tr(n,Dr(e)),offset:Tr(n,Mr(e)),velocity:Rr(e,.1)}}function Mr(t){return t[0]}function Dr(t){return t[t.length-1]}function Rr(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,i=null,r=Dr(t);n>=0&&(i=t[n],!(r.timestamp-i.timestamp>mi(e)));)n--;if(!i)return{x:0,y:0};var o=(r.timestamp-i.timestamp)/1e3;if(0===o)return{x:0,y:0};var a={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Lr(t){return t}function Ir(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}function jr(){return{x:{min:0,max:1},y:{min:0,max:1}}}var zr={translate:0,scale:1,origin:0,originPoint:0};function Vr(){return{x:o({},zr),y:o({},zr)}}function Br(t){return[t("x"),t("y")]}function Fr(t,e,n){var i=e.min,r=e.max;return void 0!==i&&t<i?t=n?Ke(i,t,n.min):Math.max(t,i):void 0!==r&&t>r&&(t=n?Ke(r,t,n.max):Math.min(t,r)),t}function Ur(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Nr(t,e){var n,i=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&(i=(n=s([r,i],2))[0],r=n[1]),{min:t.min+i,max:t.min+r}}function Hr(t,e,n){return{min:Wr(t,e),max:Wr(t,n)}}function Wr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function $r(t,e){return Ir(function(t,e){var n=t.top,i=t.left,r=t.bottom,o=t.right;void 0===e&&(e=Lr);var a=e({x:i,y:n}),s=e({x:o,y:r});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function Xr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Pr(t,e)<n}function Yr(t){return t.max-t.min}function Gr(t,e){var n=.5,i=Yr(t),r=Yr(e);return r>i?n=Ze(e.min,e.max-i,t.min):i>r&&(n=Ze(t.min,t.max-r,e.min)),je(0,1,n)}function qr(t,e,n,i){void 0===i&&(i=.5),t.origin=i,t.originPoint=Ke(e.min,e.max,t.origin),t.scale=Yr(n)/Yr(e),Xr(t.scale,1,1e-4)&&(t.scale=1),t.translate=Ke(n.min,n.max,t.origin)-t.originPoint,Xr(t.translate)&&(t.translate=0)}function Zr(t,e,n,i){qr(t.x,e.x,n.x,Kr(i.originX)),qr(t.y,e.y,n.y,Kr(i.originY))}function Kr(t){return"number"==typeof t?t:.5}function Jr(t,e,n){t.min=n.min+e.min,t.max=t.min+Yr(e)}var Qr=function(t,e){return t.depth-e.depth};function to(t){return t.projection.isEnabled||t.shouldResetTransform()}function eo(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&eo(n,e),to(t)&&e.push(t),e}function no(t){if(!t.shouldResetTransform()){var e,n=t.getLayoutState();t.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=t.measureViewportBox(),n.layoutCorrected=(e=n.layout,{x:o({},e.x),y:o({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),li.update((function(){return t.rebaseProjectionTarget()}))}}function io(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}function ro(t,e){return{min:e.min-t.min,max:e.max-t.min}}function oo(t,e){return{x:ro(t.x,e.x),y:ro(t.y,e.y)}}function ao(t){var e=t.getProps(),n=e.drag,i=e._dragX;return n&&!i}function so(t,e){t.min=e.min,t.max=e.max}function uo(t,e,n){return n+e*(t-n)}function co(t,e,n,i,r){return void 0!==r&&(t=uo(t,r,i)),uo(t,n,i)+e}function lo(t,e,n,i,r){void 0===e&&(e=0),void 0===n&&(n=1),t.min=co(t.min,e,n,i,r),t.max=co(t.max,e,n,i,r)}function fo(t,e){var n=e.x,i=e.y;lo(t.x,n.translate,n.scale,n.originPoint),lo(t.y,i.translate,i.scale,i.originPoint)}function ho(t,e,n,i){var r=s(i,3),o=r[0],a=r[1],u=r[2];t.min=e.min,t.max=e.max;var c=void 0!==n[u]?n[u]:.5,l=Ke(e.min,e.max,c);lo(t,n[o],n[a],l,n.scale)}var po=["x","scaleX","originX"],mo=["y","scaleY","originY"];function vo(t,e,n){ho(t.x,e.x,n,po),ho(t.y,e.y,n,mo)}function go(t,e,n,i,r){return t=uo(t-=e,1/n,i),void 0!==r&&(t=uo(t,1/r,i)),t}function yo(t,e,n){var i=s(n,3),r=i[0],o=i[1],a=i[2];!function(t,e,n,i,r){void 0===e&&(e=0),void 0===n&&(n=1),void 0===i&&(i=.5);var o=Ke(t.min,t.max,i)-e;t.min=go(t.min,e,n,o,r),t.max=go(t.max,e,n,o,r)}(t,e[r],e[o],e[a],e.scale)}function bo(t,e){yo(t.x,e,po),yo(t.y,e,mo)}var _o=new Set;function wo(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function Co(t){return _o.add(t),function(){return _o.delete(t)}}function xo(){if(_o.size){var t=0,e=[[]],n=[],i=function(n){return wo(e,n,t)},r=function(e){wo(n,e,t),t++};_o.forEach((function(e){e(i,r),t=0})),_o.clear();for(var o=n.length,a=0;a<=o;a++)e[a]&&e[a].forEach(Eo),n[a]&&n[a].forEach(Eo)}}var So,Eo=function(t){return t()},Po=new WeakMap,ko=function(){function t(t){var e=t.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=e,this.visualElement.enableLayoutProjection(),Po.set(e,this)}return t.prototype.start=function(t,e){var n=this,i=void 0===e?{}:e,r=i.snapToCursor,o=void 0!==r&&r,a=i.cursorProgress,c=this.props.transformPagePoint;this.panSession=new kr(t,{onSessionStart:function(t){var e;n.stopMotion();var i=function(t){return he(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=Co((function(t,e){var r=eo(n.visualElement),c=function(t){var e=[],n=function(t){to(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Qr)}(n.visualElement),l=u(u([],s(r)),s(c)),d=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){no(n.visualElement),c.forEach(no)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),o&&(d=n.snapToCursor(i))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;Br((function(e){if(!d){var r=t.target[e],o=r.min,s=r.max;n.cursorProgress[e]=a?a[e]:Ze(o,s,i[e])}var u=n.getAxisMotionValue(e);u&&(n.originPoint[e]=u.get())}))})),e((function(){oi.update(),oi.preRender(),oi.render(),oi.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var i,r,o,a=n.props,s=a.drag,u=a.dragPropagation;(!s||u||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Pe(s),n.openGlobalLock))&&(xo(),n.isDragging=!0,n.currentDirection=null,null===(r=(i=n.props).onDragStart)||void 0===r||r.call(i,t,e),null===(o=n.visualElement.animationState)||void 0===o||o.setActive(ie.Drag,!0))},onMove:function(t,e){var i,r,o,a,s=n.props,u=s.dragPropagation,c=s.dragDirectionLock;if(u||n.openGlobalLock){var l=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(l),void(null!==n.currentDirection&&(null===(r=(i=n.props).onDirectionLock)||void 0===r||r.call(i,n.currentDirection)));n.updateAxis("x",e.point,l),n.updateAxis("y",e.point,l),null===(a=(o=n.props).onDrag)||void 0===a||a.call(o,t,e),So=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:c})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,i=e.dragElastic,r=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(R(n)?this.resolveRefConstraints(r,n):function(t,e){var n=e.top,i=e.left,r=e.bottom,o=e.right;return{x:Ur(t.x,i,o),y:Ur(t.y,n,r)}}(r,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:Hr(t,"left","right"),y:Hr(t,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&Br((function(e){t.getAxisMotionValue(e)&&(t.constraints[e]=function(t,e){var n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(r[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,i=n.onMeasureDragConstraints,r=n.transformPagePoint,o=e.current;p(null!==o,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."),this.constraintsBox=$r(o,r);var a=function(t,e){return{x:Nr(t.x,e.x),y:Nr(t.y,e.y)}}(t,this.constraintsBox);if(i){var s=i(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=Ir(s))}return a},t.prototype.cancelDrag=function(){var t,e;this.visualElement.unlockProjectionTarget(),null===(t=this.cancelLayout)||void 0===t||t.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(ie.Drag,!1)},t.prototype.stop=function(t,e){var n,i,r;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var o=this.isDragging;if(this.cancelDrag(),o){var a=e.velocity;this.animateDragEnd(a),null===(r=(i=this.props).onDragEnd)||void 0===r||r.call(i,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return Br((function(n){if(Oo(n,e.props.drag,e.currentDirection)){var i=e.getAxisMotionValue(n);if(!i)return e.cursorProgress[n]=.5,!0;var r=e.visualElement.getLayoutState().layout,o=r[n].max-r[n].min,a=r[n].min+o/2,s=t[n]-a;e.originPoint[n]=t[n],i.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Oo(t,this.props.drag,this.currentDirection))return this.getAxisMotionValue(t)?this.updateAxisMotionValue(t,n):this.updateVisualElementAxis(t,e)},t.prototype.updateAxisMotionValue=function(t,e){var n=this.getAxisMotionValue(t);if(e&&n){var i=this.originPoint[t]+e[t],r=this.constraints?Fr(i,this.constraints[t],this.elastic[t]):i;n.set(r)}},t.prototype.updateVisualElementAxis=function(t,e){var n,i=this.visualElement.getLayoutState().layout[t],r=i.max-i.min,o=this.cursorProgress[t],a=function(t,e,n,i,r){var o=t-e*n;return i?Fr(o,i,r):o}(e[t],r,o,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+r)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,i=t.dragDirectionLock,r=void 0!==i&&i,s=t.dragPropagation,u=void 0!==s&&s,c=t.dragConstraints,l=void 0!==c&&c,d=t.dragElastic,f=void 0===d?.35:d,h=t.dragMomentum,p=void 0===h||h,m=a(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=o({drag:n,dragDirectionLock:r,dragPropagation:u,dragConstraints:l,dragElastic:f,dragMomentum:p},m)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,i=e.layoutId,r="_drag"+t.toUpperCase();return this.props[r]?this.props[r]:n||void 0!==i?void 0:this.visualElement.getValue(t,0)},t.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},t.prototype.isExternalDrag=function(){var t=this.props,e=t._dragX,n=t._dragY;return e||n},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,i=n.drag,r=n.dragMomentum,a=n.dragElastic,s=n.dragTransition,u=function(t,e){void 0===e&&(e=!0);var n,i=t.getProjectionParent();return!!i&&(e?bo(n=oo(i.projection.target,t.projection.target),i.getLatestValues()):n=oo(i.getLayoutState().layout,t.getLayoutState().layout),Br((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),c=this.constraints||{};if(u&&Object.keys(c).length&&this.isLayoutDrag()){var l=this.visualElement.getProjectionParent();if(l){var d=oo(l.projection.targetFinal,c);Br((function(t){var e=d[t],n=e.min,i=e.max;c[t]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var f=Br((function(n){var l;if(Oo(n,i,e.currentDirection)){var d=null!==(l=null==c?void 0:c[n])&&void 0!==l?l:{},f=a?200:1e6,h=a?40:1e7,p=o(o({type:"inertia",velocity:r?t[n]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},s),d);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,p):e.visualElement.startLayoutAnimation(n,p,u)}}));return Promise.all(f).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;Br((function(e){var n=t.getAxisMotionValue(e);n?n.stop():t.visualElement.stopLayoutAnimation()}))},t.prototype.startAxisValueAnimation=function(t,e){var n=this.getAxisMotionValue(t);if(n){var i=n.get();return n.set(i),n.set(i),qi(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(R(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};Br((function(e){i[e]=Gr(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){Br((function(e){if(Oo(e,n,null)){var r=function(t,e,n){var i=t.max-t.min,r=Ke(e.min,e.max-i,n);return{min:r,max:r+i}}(t.visualElement.projection.target[e],t.constraintsBox[e],i[e]),o=r.min,a=r.max;t.visualElement.setProjectionTargetAxis(e,o,a)}}))})),setTimeout(xo,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=Co((function(n,i){var r=eo(e.visualElement);i((function(){return r.forEach((function(t){return t.resetTransform()}))})),n((function(){return no(e.visualElement)})),i((function(){return r.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&i(t)}))},t.prototype.mount=function(t){var e=this,n=we(t.getInstance(),"pointerdown",(function(t){var n=e.props,i=n.drag,r=n.dragListener;i&&(void 0===r||r)&&e.start(t)})),i=ae(window,"resize",(function(){e.scalePoint()})),r=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),o=t.prevDragCursor;return o&&this.start(So,{cursorProgress:o}),function(){null==n||n(),null==i||i(),null==r||r(),e.cancelDrag()}},t}();function Oo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var To,Ao,Mo={pan:Re((function(t){var e=t.onPan,n=t.onPanStart,i=t.onPanEnd,r=t.onPanSessionStart,o=t.visualElement,a=e||n||i||r,s=Object(c.useRef)(null),u=Object(c.useContext)(y).transformPagePoint,l={onSessionStart:r,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,i&&i(t,e)}};Object(c.useEffect)((function(){null!==s.current&&s.current.updateHandlers(l)})),Ce(o,"pointerdown",a&&function(t){s.current=new kr(t,l,{transformPagePoint:u})}),Ae((function(){return s.current&&s.current.end()}))})),drag:Re((function(t){var e=t.dragControls,n=t.visualElement,i=Object(c.useContext)(y).transformPagePoint,r=C((function(){return new ko({visualElement:n})}));r.setProps(o(o({},t),{transformPagePoint:i})),Object(c.useEffect)((function(){return e&&e.subscribe(r)}),[r]),Object(c.useEffect)((function(){return r.mount(n)}),[])}))};function Do(t){return"string"==typeof t&&t.startsWith("var(--")}!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(To||(To={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(Ao||(Ao={}));var Ro=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var Lo=4;function Io(t,e,n){void 0===n&&(n=1),p(n<=Lo,'Max CSS variable fallback depth detected in property "'+t+'". This may indicate a circular fallback dependency.');var i=s(function(t){var e=Ro.exec(t);if(!e)return[,];var n=s(e,3);return[n[1],n[2]]}(t),2),r=i[0],o=i[1];if(r){var a=window.getComputedStyle(e).getPropertyValue(r);return a?a.trim():Do(o)?Io(o,e,n+1):o}}function jo(t,e){return t/(e.max-e.min)*100}var zo="_$css";var Vo={process:function(t,e,n){var i=n.target;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return jo(t,i.x)+"% "+jo(t,i.y)+"%"}},Bo={borderRadius:o(o({},Vo),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Vo,borderTopRightRadius:Vo,borderBottomLeftRadius:Vo,borderBottomRightRadius:Vo,boxShadow:{process:function(t,e){var n=e.delta,i=e.treeScale,r=t,o=t.includes("var("),a=[];o&&(t=t.replace(Ro,(function(t){return a.push(t),zo})));var s=yn.parse(t);if(s.length>5)return r;var u=yn.createTransformer(t),c="number"!=typeof s[0]?1:0,l=n.x.scale*i.x,d=n.y.scale*i.y;s[0+c]/=l,s[1+c]/=d;var f=Ke(l,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=f),"number"==typeof s[3+c]&&(s[3+c]/=f);var h=u(s);if(o){var p=0;h=h.replace(zo,(function(){var t=a[p];return p++,t}))}return h}}},Fo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},e.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},e.isAnimating={x:!1,y:!1},e.stopAxisAnimation={x:void 0,y:void 0},e.isAnimatingTree=!1,e.animate=function(t,n,i){void 0===i&&(i={});var r=i.originBox,s=i.targetBox,u=i.visibilityAction,c=i.shouldStackAnimate,l=i.onComplete,d=i.prevParent,f=a(i,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),h=e.props,p=h.visualElement,m=h.layout;if(!1===c)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===c){c&&(e.isAnimatingTree=!0),n=r||n,t=s||t;var v,g,y,b,_=!1,w=p.getProjectionParent();if(w){var C=w.prevViewportBox,x=w.getLayoutState().layout;d&&(s&&(x=d.getLayoutState().layout),r&&(g=w,y=(v=d).getLayoutId(),b=g.getLayoutId(),y===b&&(void 0!==b||v===g))&&d.prevViewportBox&&(C=d.prevViewportBox)),C&&function(t,e,n){return t||!t&&!(e||n)}(d,r,s)&&(_=!0,n=oo(C,n),t=oo(x,t))}var S,E,P=(E=t,!(No(S=n)||No(E)||Ho(S.x,E.x)&&Ho(S.y,E.y))),k=Br((function(i){var r,a;if("position"===m){var s=t[i].max-t[i].min;n[i].max=n[i].min+s}if(!p.projection.isTargetLocked)return void 0===u?P?e.animateAxis(i,t[i],n[i],o(o({},f),{isRelative:_})):(null===(a=(r=e.stopAxisAnimation)[i])||void 0===a||a.call(r),p.setProjectionTargetAxis(i,t[i].min,t[i].max,_)):void p.setVisibility(u===Ao.Show)}));return p.syncRender(),Promise.all(k).then((function(){e.isAnimatingTree=!1,l&&l(),p.notifyLayoutAnimationComplete()}))}},e}return r(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=qi,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},Y(Bo)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),Br((function(e){var n,i;return null===(i=(n=t.stopAxisAnimation)[e])||void 0===i?void 0:i.call(n)}))},e.prototype.animateAxis=function(t,e,n,i){var r,o,a=this,s=void 0===i?{}:i,u=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!Ho(e,this.currentAnimationTarget[t])){null===(o=(r=this.stopAxisAnimation)[t])||void 0===o||o.call(r),this.isAnimating[t]=!0;var l=this.props.visualElement,d=this.frameTarget[t],f=l.getProjectionAnimationProgress()[t];f.clearListeners(),f.set(0),f.set(0);var h=function(){var i=f.get()/1e3;!function(t,e,n,i){t.min=Ke(e.min,n.min,i),t.max=Ke(e.max,n.max,i)}(d,n,e,i),l.setProjectionTargetAxis(t,d.min,d.max,c)};h();var p=f.onChange(h);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,f.stop(),p()},this.currentAnimationTarget[t]=e;var m=u||l.getDefaultTransition()||Wo;return qi("x"===t?"layoutX":"layoutY",f,1e3,m&&Gi(m,"layout")).then(this.stopAxisAnimation[t])}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(c.Component);var Uo={min:0,max:0};function No(t){return Ho(t.x,Uo)&&Ho(t.y,Uo)}function Ho(t,e){return t.min===e.min&&t.max===e.max}var Wo={duration:.45,ease:[.4,0,.1,1]};var $o={layoutReady:function(t){return t.notifyLayoutReady()}};function Xo(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?$o:e,i=n.layoutReady,r=n.parent;Co((function(e,n){var o=Array.from(t).sort(Qr),a=r?eo(r):[];n((function(){u(u([],s(a)),s(o)).forEach((function(t){return t.resetTransform()}))})),e((function(){o.forEach(no)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),o.forEach(i)})),e((function(){o.forEach((function(t){t.isPresent&&(t.presence=To.Present)}))})),n((function(){oi.preRender(),oi.render()})),e((function(){li.postRender((function(){return o.forEach(Yo)})),t.clear()}))})),xo()}}}function Yo(t){t.prevViewportBox=t.projection.target}var Go=Object(c.createContext)(Xo()),qo=Object(c.createContext)(Xo());function Zo(t){return!!t.forceUpdate}var Ko=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,i=t.visualElement;Zo(e)&&e.register(i),Zo(n)&&n.register(i),i.onUnmount((function(){Zo(e)&&e.remove(i),Zo(n)&&n.remove(i)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Zo(e)?e.syncUpdate():(io(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Zo(t)||t.flush()},e.prototype.render=function(){return null},e}(c.default.Component);var Jo={measureLayout:function(t){var e=Object(c.useContext)(Go),n=Object(c.useContext)(qo);return c.default.createElement(Ko,o({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=s(x(),2)[1];return c.createElement(Fo,o({},t,{safeToRemove:e}))}};function Qo(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Vr(),deltaFinal:Vr(),deltaTransform:""}}var ta=Qo();function ea(t,e,n){var i=t.x,r=t.y,o="translate3d("+i.translate/e.x+"px, "+r.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,u=n.rotateY;a&&(o+="rotate("+a+") "),s&&(o+="rotateX("+s+") "),u&&(o+="rotateY("+u+") ")}return o+="scale("+i.scale+", "+r.scale+")",n||o!==ia?o:""}function na(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var ia=ea(ta.delta,ta.treeScale,{x:1,y:1}),ra=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function oa(t,e,n,i){var r,o,a=t.delta,s=t.layout,u=t.layoutCorrected,c=t.treeScale,l=e.target;o=s,so((r=u).x,o.x),so(r.y,o.y),function(t,e,n){var i=n.length;if(i){var r,o;e.x=e.y=1;for(var a=0;a<i;a++)o=(r=n[a]).getLayoutState().delta,e.x*=o.x.scale,e.y*=o.y.scale,fo(t,o),ao(r)&&vo(t,t,r.getLatestValues())}}(u,c,n),Zr(a,u,l,i)}var aa=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){Zi(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){Ki(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Qr),this.isDirty=!1,this.children.forEach(t)},t}();var sa=function(t){var e=t.treeType,n=void 0===e?"":e,i=t.build,r=t.getBaseTarget,a=t.makeTargetAnimatable,c=t.measureViewportBox,l=t.render,d=t.readValueFromInstance,f=t.resetTransform,h=t.restoreTransform,p=t.removeValueFromRenderState,m=t.sortNodePosition,v=t.scrapeMotionValuesFromProps;return function(t,e){var g=t.parent,y=t.props,b=t.presenceId,_=t.blockInitialAnimation,w=t.visualState;void 0===e&&(e={});var C,x,S,E,P,k,O=w.latestValues,T=w.renderState,A=function(){var t=ra.map((function(){return new Ji})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return ra.forEach((function(i){var r;null===(r=e[i])||void 0===r||r.call(e);var o="on"+i,a=t[o];a&&(e[i]=n[o](a))}))}};return t.forEach((function(t,e){n["on"+ra[e]]=function(e){return t.add(e)},n["notify"+ra[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,u([],s(e)))}})),n}(),M={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},D=M,R=O,L=Qo(),j=!1,z=new Map,F=new Map,U={},N=o({},O);function H(){C&&(J.isProjectionReady()&&(vo(D.targetFinal,D.target,R),Zr(L.deltaFinal,L.layoutCorrected,D.targetFinal,O)),W(),l(C,T))}function W(){var t=O;if(E&&E.isActive()){var n=E.getCrossfadeState(J);n&&(t=n)}i(J,T,t,D,L,e,y)}function $(){A.notifyUpdate(O)}function X(){J.layoutTree.forEach(ca)}var Y=v(y);for(var G in Y){var q=Y[G];void 0!==O[G]&&nt(q)&&q.set(O[G],!1)}var Z=V(y),K=B(y),J=o(o({treeType:n,current:null,depth:g?g.depth+1:0,parent:g,children:new Set,path:g?u(u([],s(g.path)),[g]):[],layoutTree:g?g.layoutTree:new aa,presenceId:b,projection:M,variantChildren:K?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==g?void 0:g.isMounted()),blockInitialAnimation:_,isMounted:function(){return Boolean(C)},mount:function(t){C=J.current=t,J.pointTo(J),K&&g&&!Z&&(k=null==g?void 0:g.addVariantChild(J)),null==g||g.children.add(J)},unmount:function(){ri.update($),ri.render(H),ri.preRender(J.updateLayoutProjection),F.forEach((function(t){return t()})),J.stopLayoutAnimation(),J.layoutTree.remove(J),null==k||k(),null==g||g.children.delete(J),null==S||S(),A.clearAllListeners()},addVariantChild:function(t){var e,n=J.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return m&&n===t.treeType?m(J.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return K?J:null==g?void 0:g.getClosestVariantNode()},scheduleUpdateLayoutProjection:g?g.scheduleUpdateLayoutProjection:function(){return li.preRender(J.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return y.layoutId},getInstance:function(){return C},getStaticValue:function(t){return O[t]},setStaticValue:function(t,e){return O[t]=e},getLatestValues:function(){return O},setVisibility:function(t){J.isVisible!==t&&(J.isVisible=t,J.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),a(J,t,y,e)},addValue:function(t,e){J.hasValue(t)&&J.removeValue(t),z.set(t,e),O[t]=e.get(),function(t,e){var n=e.onChange((function(e){O[t]=e,y.onUpdate&&li.update($,!1,!0)})),i=e.onRenderRequest(J.scheduleRender);F.set(t,(function(){n(),i()}))}(t,e)},removeValue:function(t){var e;z.delete(t),null===(e=F.get(t))||void 0===e||e(),F.delete(t),delete O[t],p(t,T)},hasValue:function(t){return z.has(t)},getValue:function(t,e){var n=z.get(t);return void 0===n&&void 0!==e&&(n=tr(e),J.addValue(t,n)),n},forEachValue:function(t){return z.forEach(t)},readValue:function(t){var n;return null!==(n=O[t])&&void 0!==n?n:d(C,t,e)},setBaseTarget:function(t,e){N[t]=e},getBaseTarget:function(t){if(r){var e=r(y,t);if(void 0!==e&&!nt(e))return e}return N[t]}},A),{build:function(){return W(),T},scheduleRender:function(){li.render(H,!1,!0)},syncRender:H,setProps:function(t){y=t,A.updatePropListeners(t),U=function(t,e,n){var i;for(var r in e){var o=e[r],a=n[r];if(nt(o))t.addValue(r,o);else if(nt(a))t.addValue(r,tr(o));else if(a!==o)if(t.hasValue(r)){var s=t.getValue(r);!s.hasAnimated&&s.set(o)}else t.addValue(r,tr(null!==(i=t.getStaticValue(r))&&void 0!==i?i:o))}for(var r in n)void 0===e[r]&&t.removeValue(r);return e}(J,v(y),U)},getProps:function(){return y},getVariant:function(t){var e;return null===(e=y.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return y.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==g?void 0:g.getVariantContext();if(!Z){var e=(null==g?void 0:g.getVariantContext())||{};return void 0!==y.initial&&(e.initial=y.initial),e}for(var n={},i=0;i<fa;i++){var r=da[i],o=y[r];(I(o)||!1===o)&&(n[r]=o)}return n},enableLayoutProjection:function(){M.isEnabled=!0,J.layoutTree.add(J)},lockProjectionTarget:function(){M.isTargetLocked=!0},unlockProjectionTarget:function(){J.stopLayoutAnimation(),M.isTargetLocked=!1},getLayoutState:function(){return L},setCrossfader:function(t){E=t},isProjectionReady:function(){return M.isEnabled&&M.isHydrated&&L.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var i=J.getProjectionAnimationProgress()[t],r=n?M.relativeTarget[t]:M.target[t],o=r.min,a=r.max-o;return i.clearListeners(),i.set(o),i.set(o),i.onChange((function(e){J.setProjectionTargetAxis(t,e,e+a,n)})),J.animateMotionValue(t,i,0,e)},stopLayoutAnimation:function(){Br((function(t){return J.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=c(C,e);return t||bo(n,O),n},getProjectionAnimationProgress:function(){return P||(P={x:tr(0),y:tr(0)}),P},setProjectionTargetAxis:function(t,e,n,i){var r;void 0===i&&(i=!1),i?(M.relativeTarget||(M.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),r=M.relativeTarget[t]):(M.relativeTarget=void 0,r=M.target[t]),M.isHydrated=!0,r.min=e,r.max=n,j=!0,A.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=L.layout);var n=J.getProjectionAnimationProgress(),i=n.x,r=n.y,o=!(M.relativeTarget||M.isTargetLocked||i.isAnimating()||r.isAnimating());(t||o)&&Br((function(t){var n=e[t],i=n.min,r=n.max;J.setProjectionTargetAxis(t,i,r)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=oo(e.getLayoutState().layout,t.getLayoutState().layout);Br((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(J),J.notifyLayoutUpdate(L.layout,J.prevViewportBox||L.layout,t)},resetTransform:function(){return f(J,C,y)},restoreTransform:function(){return h(C,T)},updateLayoutProjection:function(){if(J.isProjectionReady()){var t=L.delta,e=L.treeScale,n=e.x,i=e.y,r=L.deltaTransform;oa(L,D,J.path,O),j&&J.notifyViewportBoxUpdate(D.target,t),j=!1;var o=ea(t,e);o===r&&n===e.x&&i===e.y||J.scheduleRender(),L.deltaTransform=o}},updateTreeLayoutProjection:function(){J.layoutTree.forEach(ua),li.preRender(X,!1,!0)},getProjectionParent:function(){if(void 0===x){for(var t=!1,e=J.path.length-1;e>=0;e--){var n=J.path[e];if(n.projection.isEnabled){t=n;break}}x=t}return x},resolveRelativeTargetBox:function(){var t=J.getProjectionParent();if(M.relativeTarget&&t&&(function(t,e){Jr(t.target.x,t.relativeTarget.x,e.target.x),Jr(t.target.y,t.relativeTarget.y,e.target.y)}(M,t.projection),ao(t))){var e=M.target;vo(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(y._layoutResetTransform)},pointTo:function(t){D=t.projection,R=t.getLatestValues(),null==S||S(),S=De(t.onSetAxisTarget(J.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;J.isPresent?J.presence=To.Present:null===(t=J.layoutSafeToRemove)||void 0===t||t.call(J)})))},isPresent:!0,presence:To.Entering});return J}};function ua(t){t.resolveRelativeTargetBox()}function ca(t){t.updateLayoutProjection()}var la,da=u(["initial"],s(gr)),fa=da.length,ha=new Set(["width","height","top","left","right","bottom","x","y"]),pa=function(t){return ha.has(t)},ma=function(t,e){t.set(e,!1),t.set(e)},va=function(t){return t===bt||t===mt};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(la||(la={}));var ga=function(t,e){return parseFloat(t.split(", ")[e])},ya=function(t,e){return function(n,i){var r=i.transform;if("none"===r||!r)return 0;var o=r.match(/^matrix3d\((.+)\)$/);if(o)return ga(o[1],e);var a=r.match(/^matrix\((.+)\)$/);return a?ga(a[1],t):0}},ba=new Set(["x","y","z"]),_a=q.filter((function(t){return!ba.has(t)}));var wa={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,i=e.top;return parseFloat(i)+(n.max-n.min)},right:function(t,e){var n=t.x,i=e.left;return parseFloat(i)+(n.max-n.min)},x:ya(4,13),y:ya(5,14)},Ca=function(t,e,n,i){void 0===n&&(n={}),void 0===i&&(i={}),e=o({},e),i=o({},i);var r=Object.keys(e).filter(pa),a=[],u=!1,c=[];if(r.forEach((function(r){var o=t.getValue(r);if(t.hasValue(r)){var s,l=n[r],d=e[r],f=ir(l);if(qt(d))for(var h=d.length,m=null===d[0]?1:0;m<h;m++)s?p(ir(d[m])===s,"All keyframes must be of the same type"):(s=ir(d[m]),p(s===f||va(f)&&va(s),"Keyframes must be of the same dimension as the current value"));else s=ir(d);if(f!==s)if(va(f)&&va(s)){var v=o.get();"string"==typeof v&&o.set(parseFloat(v)),"string"==typeof d?e[r]=parseFloat(d):Array.isArray(d)&&s===mt&&(e[r]=d.map(parseFloat))}else(null==f?void 0:f.transform)&&(null==s?void 0:s.transform)&&(0===l||0===d)?0===l?o.set(s.transform(l)):e[r]=f.transform(d):(u||(a=function(t){var e=[];return _a.forEach((function(n){var i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),u=!0),c.push(r),i[r]=void 0!==i[r]?i[r]:e[r],ma(o,d))}})),c.length){var l=function(t,e,n){var i=e.measureViewportBox(),r=e.getInstance(),o=getComputedStyle(r),a=o.display,s={top:o.top,left:o.left,bottom:o.bottom,right:o.right,transform:o.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var u=e.measureViewportBox();return n.forEach((function(n){var r=e.getValue(n);ma(r,wa[n](i,s)),t[n]=wa[n](u,o)})),t}(e,t,c);return a.length&&a.forEach((function(e){var n=s(e,2),i=n[0],r=n[1];t.getValue(i).set(r)})),t.syncRender(),{target:l,transitionEnd:i}}return{target:e,transitionEnd:i}};function xa(t,e,n,i){return function(t){return Object.keys(t).some(pa)}(e)?Ca(t,e,n,i):{target:e,transitionEnd:i}}var Sa=function(t,e,n,i){var r=function(t,e,n){var i,r=a(e,[]),s=t.getInstance();if(!(s instanceof HTMLElement))return{target:r,transitionEnd:n};for(var u in n&&(n=o({},n)),t.forEachValue((function(t){var e=t.get();if(Do(e)){var n=Io(e,s);n&&t.set(n)}})),r){var c=r[u];if(Do(c)){var l=Io(c,s);l&&(r[u]=l,n&&(null!==(i=n[u])&&void 0!==i||(n[u]=c)))}}return{target:r,transitionEnd:n}}(t,e,i);return xa(t,e=r.target,n,i=r.transitionEnd)};var Ea={treeType:"dom",readValueFromInstance:function(t,e){if(J(e)){var n=Ui(e);return n&&n.default||0}var i,r=(i=t,window.getComputedStyle(i));return(rt(e)?r.getPropertyValue(e):r[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return $r(t,e.transformPagePoint)},resetTransform:function(t,e,n){var i=n.transformTemplate;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,i=e.style;delete n[t],delete i[t]},makeTargetAnimatable:function(t,e,n,i){var r=n.transformValues;void 0===i&&(i=!0);var s=e.transition,u=e.transitionEnd,c=a(e,["transition","transitionEnd"]),l=dr(c,s||{},t);if(r&&(u&&(u=r(u)),c&&(c=r(c)),l&&(l=r(l))),i){cr(t,c,l);var d=Sa(t,c,l,u);u=d.transitionEnd,c=d.target}return o({transition:s,transitionEnd:u},c)},scrapeMotionValuesFromProps:Xt,build:function(t,e,n,i,r,o,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=i.isEnabled&&r.isHydrated;St(e,n,i,r,o,a.transformTemplate,s?ea:void 0,s?na:void 0)},render:Ht},Pa=sa(Ea),ka=sa(o(o({},Ea),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return J(e)?(null===(n=Ui(e))||void 0===n?void 0:n.default)||0:(e=Wt.has(e)?e:Nt(e),t.getAttribute(e))},scrapeMotionValuesFromProps:Yt,build:function(t,e,n,i,r,o,a){var s=i.isEnabled&&r.isHydrated;zt(e,n,i,r,o,a.transformTemplate,s?ea:void 0,s?na:void 0)},render:$t})),Oa=function(t,e){return $(t)?ka(e,{enableHardwareAcceleration:!1}):Pa(e,{enableHardwareAcceleration:!0})},Ta=o(o(o(o({},Cr),Le),Mo),Jo),Aa=H((function(t,e){return oe(t,e,Ta,Oa)}));function Ma(t){return N(oe(t,{forwardMotionProps:!1},Ta,Oa))}var Da=H(oe);var Ra=0;function La(){var t=Ra;return Ra++,t}var Ia=function(t){var e=t.children,n=t.initial,i=t.isPresent,r=t.onExitComplete,o=t.custom,a=t.presenceAffectsLayout,s=C(ja),u=C(La),l=Object(c.useMemo)((function(){return{id:u,initial:n,isPresent:i,custom:o,onExitComplete:function(t){s.set(t,!0);var e=!0;s.forEach((function(t){t||(e=!1)})),e&&(null==r||r())},register:function(t){return s.set(t,!1),function(){return s.delete(t)}}}}),a?void 0:[i]);return Object(c.useMemo)((function(){s.forEach((function(t,e){return s.set(e,!1)}))}),[i]),c.useEffect((function(){!i&&!s.size&&(null==r||r())}),[i]),c.createElement(w.Provider,{value:l},e)};function ja(){return new Map}function za(t){return t.key||""}var Va=function(t){var e=t.children,n=t.custom,i=t.initial,r=void 0===i||i,o=t.onExitComplete,a=t.exitBeforeEnter,l=t.presenceAffectsLayout,d=void 0===l||l,f=function(){var t=Object(c.useRef)(!1),e=s(Object(c.useState)(0),2),n=e[0],i=e[1];return Ae((function(){return t.current=!0})),Object(c.useCallback)((function(){!t.current&&i(n+1)}),[n])}(),h=Object(c.useContext)(Go);Zo(h)&&(f=h.forceUpdate);var p=Object(c.useRef)(!0),m=function(t){var e=[];return c.Children.forEach(t,(function(t){Object(c.isValidElement)(t)&&e.push(t)})),e}(e),v=Object(c.useRef)(m),g=Object(c.useRef)(new Map).current,y=Object(c.useRef)(new Set).current;if(function(t,e){t.forEach((function(t){var n=za(t);e.set(n,t)}))}(m,g),p.current)return p.current=!1,c.createElement(c.Fragment,null,m.map((function(t){return c.createElement(Ia,{key:za(t),isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:d},t)})));for(var b=u([],s(m)),_=v.current.map(za),w=m.map(za),C=_.length,x=0;x<C;x++){var S=_[x];-1===w.indexOf(S)?y.add(S):y.delete(S)}return a&&y.size&&(b=[]),y.forEach((function(t){if(-1===w.indexOf(t)){var e=g.get(t);if(e){var i=_.indexOf(t);b.splice(i,0,c.createElement(Ia,{key:za(e),isPresent:!1,onExitComplete:function(){g.delete(t),y.delete(t);var e=v.current.findIndex((function(e){return e.key===t}));v.current.splice(e,1),y.size||(v.current=m,f(),o&&o())},custom:n,presenceAffectsLayout:d},e))}}})),b=b.map((function(t){var e=t.key;return y.has(e)?t:c.createElement(Ia,{key:za(t),isPresent:!0,presenceAffectsLayout:d},t)})),v.current=b,c.createElement(c.Fragment,null,y.size?b:b.map((function(t){return Object(c.cloneElement)(t)})))};function Ba(t,e,n){void 0===n&&(n={});var i=nt(t)?t:tr(t);return qi("",i,e,n),{stop:function(){return i.stop()}}}function Fa(){var t=tr(1),e={lead:void 0,follow:void 0,crossfadeOpacity:!1,preserveFollowOpacity:!1},n=o({},e),i={},r={},a=!1,s=null,u=0;function c(n,i){var r=e.lead,u=e.follow;a=!0,s=null;var c=!1,l=function(){c=!0,r&&r.scheduleRender(),u&&u.scheduleRender()},d=function(){a=!1,s=ci().timestamp};return i=i&&Gi(i,"crossfade"),Ba(t,n,o(o({},i),{onUpdate:l,onComplete:function(){c?d():(t.set(n),li.read(d)),l()}}))}function l(){var n,o,a=ci().timestamp,s=e.lead,c=e.follow;if(a!==u&&s){u=a;var l=s.getLatestValues();Object.assign(i,l);var d=c?c.getLatestValues():e.prevValues;Object.assign(r,d);var f=t.get(),h=null!==(n=l.opacity)&&void 0!==n?n:1,p=null!==(o=null==d?void 0:d.opacity)&&void 0!==o?o:1;e.crossfadeOpacity&&c?(i.opacity=Ke(!1!==c.isVisible?0:p,h,Ua(f)),r.opacity=e.preserveFollowOpacity?p:Ke(p,0,Na(f))):c||(i.opacity=Ke(p,h,f)),function(t,e,n,i,r,o){for(var a=0;a<$a;a++){var s="border"+Wa[a]+"Radius",u=Xa(i,s),c=Xa(n,s);if((void 0!==u||void 0!==c)&&(u||(u=0),c||(c=0),"number"==typeof u&&"number"==typeof c)){var l=Math.max(Ke(u,c,o),0);t[s]=e[s]=l}}if(i.rotate||n.rotate){var d=Ke(i.rotate||0,n.rotate||0,o);t.rotate=e.rotate=d}!r&&n.backgroundColor&&i.backgroundColor&&(t.backgroundColor=e.backgroundColor=ln(i.backgroundColor,n.backgroundColor)(o))}(i,r,l,d||{},Boolean(c),f)}}return{isActive:function(){return i&&(a||ci().timestamp===s)},fromLead:function(t){return c(0,t)},toLead:function(i){var r=0;return e.prevValues||e.follow?n.lead===e.follow&&n.follow===e.lead&&(r=1-t.get()):r=1,t.set(r),c(1,i)},reset:function(){return t.set(1)},stop:function(){return t.stop()},getCrossfadeState:function(t){return l(),t===e.lead?i:t===e.follow?r:void 0},setOptions:function(t){n=e,e=t,i={},r={}},getLatestValues:function(){return i}}}var Ua=Ha(0,.5,zn),Na=Ha(.5,.95,Dn);function Ha(t,e,n){return function(i){return i<t?0:i>e?1:n(Ze(t,e,i))}}var Wa=["TopLeft","TopRight","BottomLeft","BottomRight"],$a=Wa.length;function Xa(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}function Ya(){var t,e,n,i=new Set,r={leadIsExiting:!1},a=o({},r),s=Fa(),u=!1;return{add:function(t){t.setCrossfader(s),i.add(t),n&&(t.prevDragCursor=n),r.lead||(r.lead=t)},remove:function(t){i.delete(t)},getLead:function(){return r.lead},updateSnapshot:function(){if(r.lead){t=s.isActive()?s.getLatestValues():r.lead.getLatestValues(),e=r.lead.prevViewportBox;var i=Po.get(r.lead);i&&i.isDragging&&(n=i.cursorProgress)}},clearSnapshot:function(){n=e=void 0},updateLeadAndFollow:function(){var e,n,c;a=o({},r);for(var l=Array.from(i),d=l.length;d--;d>=0){var f=l[d];if(n&&(null!=c||(c=f)),null!=n||(n=f),n&&c)break}r.lead=n,r.follow=c,r.leadIsExiting=(null===(e=r.lead)||void 0===e?void 0:e.presence)===To.Exiting,s.setOptions({lead:n,follow:c,prevValues:t,crossfadeOpacity:(null==c?void 0:c.isPresenceRoot)||(null==n?void 0:n.isPresenceRoot)}),r.lead===a.follow||a.lead===r.lead&&a.leadIsExiting===r.leadIsExiting||(u=!0)},animate:function(t,n){var i;if(void 0===n&&(n=!1),t===r.lead){n?t.pointTo(r.lead):t.setVisibility(!0);var o={},a=null===(i=r.follow)||void 0===i?void 0:i.getProjectionParent();if(a&&(o.prevParent=a),t.presence===To.Entering?o.originBox=r.follow?r.follow.prevViewportBox:e:t.presence===To.Exiting&&(o.targetBox=function(){var t;return null===(t=r.follow)||void 0===t?void 0:t.getLayoutState().layout}()),u){u=!1;var c=t.getDefaultTransition();t.presence===To.Entering?s.toLead(c):s.fromLead(c)}t.notifyLayoutReady(o)}else n?r.lead&&t.pointTo(r.lead):t.setVisibility(!1)}}}var Ga=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=new Set,e.stacks=new Map,e.hasMounted=!1,e.updateScheduled=!1,e.renderScheduled=!1,e.syncContext=o(o({},Xo()),{syncUpdate:function(t){return e.scheduleUpdate(t)},forceUpdate:function(){e.syncContext=o({},e.syncContext),e.scheduleUpdate(!0)},register:function(t){return e.addChild(t)},remove:function(t){return e.removeChild(t)}}),e}return r(e,t),e.prototype.componentDidMount=function(){this.hasMounted=!0},e.prototype.componentDidUpdate=function(){this.startLayoutAnimation()},e.prototype.shouldComponentUpdate=function(){return this.renderScheduled=!0,!0},e.prototype.startLayoutAnimation=function(){var t=this;this.renderScheduled=this.updateScheduled=!1;var e=this.props.type;this.children.forEach((function(t){t.isPresent?t.presence!==To.Entering&&(t.presence=t.presence===To.Exiting?To.Entering:To.Present):t.presence=To.Exiting})),this.updateStacks();var n={layoutReady:function(n){void 0!==n.getLayoutId()?t.getStack(n).animate(n,"crossfade"===e):n.notifyLayoutReady()},parent:this.context.visualElement};this.children.forEach((function(e){return t.syncContext.add(e)})),this.syncContext.flush(n),this.stacks.forEach((function(t){return t.clearSnapshot()}))},e.prototype.updateStacks=function(){this.stacks.forEach((function(t){return t.updateLeadAndFollow()}))},e.prototype.scheduleUpdate=function(t){void 0===t&&(t=!1),!t&&this.updateScheduled||(this.updateScheduled=!0,this.children.forEach((function(t){!function(t){for(var e=!1,n={},i=0;i<G.length;i++){var r="rotate"+G[i];t.hasValue(r)&&0!==t.getStaticValue(r)&&(e=!0,n[r]=t.getStaticValue(r),t.setStaticValue(r,0))}if(e){for(var r in t.syncRender(),n)t.setStaticValue(r,n[r]);t.scheduleRender()}}(t),t.shouldResetTransform()&&t.resetTransform()})),this.children.forEach(io),this.stacks.forEach((function(t){return t.updateSnapshot()})),!t&&this.renderScheduled||(this.renderScheduled=!0,this.forceUpdate()))},e.prototype.addChild=function(t){this.children.add(t),this.addToStack(t),t.presence=this.hasMounted?To.Entering:To.Present},e.prototype.removeChild=function(t){this.scheduleUpdate(),this.children.delete(t),this.removeFromStack(t)},e.prototype.addToStack=function(t){var e=this.getStack(t);null==e||e.add(t)},e.prototype.removeFromStack=function(t){var e=this.getStack(t);null==e||e.remove(t)},e.prototype.getStack=function(t){var e=t.getLayoutId();if(void 0!==e)return!this.stacks.has(e)&&this.stacks.set(e,Ya()),this.stacks.get(e)},e.prototype.render=function(){return c.createElement(Go.Provider,{value:this.syncContext},this.props.children)},e.contextType=b,e}(c.Component);function qa(t){var e=t.children,n=a(t,["children"]);(n=o(o({},Object(c.useContext)(y)),n)).isStatic=C((function(){return n.isStatic}));var i="object"==typeof n.transition?n.transition.toString():"",r=Object(c.useMemo)((function(){return n}),[i,n.transformPagePoint]);return c.createElement(y.Provider,{value:r},e)}function Za(t){var e=t.children,n=t.features,i=t.strict,r=void 0!==i&&i,o=s(Object(c.useState)(!Ka(n)),2)[1],u=Object(c.useRef)(void 0);if(!Ka(n)){var l=n.renderer,d=a(n,["renderer"]);u.current=l,f(d)}return Object(c.useEffect)((function(){Ka(n)&&n().then((function(t){var e=t.renderer;f(a(t,["renderer"])),u.current=e,o(!0)}))}),[]),c.createElement(m.Provider,{value:{renderer:u.current,strict:r}},e)}function Ka(t){return"function"==typeof t}var Ja=o(o({renderer:Oa},Cr),Le),Qa=o(o(o({},Ja),Mo),Jo);function ts(t){var e=C((function(){return tr(t)}));if(Object(c.useContext)(y).isStatic){var n=s(Object(c.useState)(t),2)[1];Object(c.useEffect)((function(){return e.onChange(n)}),[])}return e}function es(t,e){Object(c.useEffect)((function(){if(nt(t))return t.onChange(e)}),[e])}function ns(t,e){var n=ts(e()),i=function(){return n.set(e())};return i(),function(t,e){Object(c.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return li.update(i,!1,!0)})),n}function is(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=t.length;return ns(e,(function(){for(var n="",r=0;r<i;r++){n+=t[r],e[r]&&(n+=e[r].get())}return n}))}var rs=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function os(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),i=n?0:-1,r=t[0+i],a=t[1+i],s=t[2+i],u=t[3+i],c=kn(a,s,o({mixer:rs(s[0])},u));return n?c(r):c}function as(t,e,n,i){var r="function"==typeof e?e:os(e,n,i);return Array.isArray(t)?ss(t,r):ss([t],(function(t){var e=s(t,1)[0];return r(e)}))}function ss(t,e){var n=C((function(){return[]}));return ns(t,(function(){n.length=0;for(var i=t.length,r=0;r<i;r++)n[r]=t[r].get();return e(n)}))}function us(t,e){void 0===e&&(e={});var n=Object(c.useContext)(y).isStatic,i=Object(c.useRef)(null),r=ts(nt(t)?t.get():t);return Object(c.useMemo)((function(){return r.attach((function(t,a){return n?a(t):(i.current&&i.current.stop(),i.current=hi(o(o({from:r.get(),to:t,velocity:r.getVelocity()},e),{onUpdate:a})),r.get())}))}),Object.values(e)),es(t,(function(t){return r.set(parseFloat(t))})),r}function cs(t){var e=ts(t.getVelocity());return Object(c.useEffect)((function(){return t.velocityUpdateSubscribers.add((function(t){e.set(t)}))}),[t]),e}function ls(){return{scrollX:tr(0),scrollY:tr(0),scrollXProgress:tr(0),scrollYProgress:tr(0)}}function ds(t,e,n){n.set(t&&e?t/e:0)}function fs(t,e){var n=function(){var n=e(),i=n.xOffset,r=n.yOffset,o=n.xMaxOffset,a=n.yMaxOffset;t.scrollX.set(i),t.scrollY.set(r),ds(i,o,t.scrollXProgress),ds(r,a,t.scrollYProgress)};return n(),n}var hs,ps=function(t){return function(){return{xOffset:t.scrollLeft,yOffset:t.scrollTop,xMaxOffset:t.scrollWidth-t.offsetWidth,yMaxOffset:t.scrollHeight-t.offsetHeight}}};function ms(t){var e=C(ls);return M((function(){var n=t.current;if(p(!!n,"ref provided to useScroll must be passed into a HTML element."),n){var i=fs(e,ps(n)),r=ae(n,"scroll",i,{passive:!0}),o=ae(n,"resize",i);return function(){r&&r(),o&&o()}}}),[]),e}function vs(){return{xOffset:window.pageXOffset,yOffset:window.pageYOffset,xMaxOffset:document.body.clientWidth-window.innerWidth,yMaxOffset:document.body.clientHeight-window.innerHeight}}var gs,ys=!1;function bs(){return hs||(hs=ls()),M((function(){!ys&&function(){if(ys=!0,"undefined"!=typeof window){var t=fs(hs,vs);ae(window,"scroll",t,{passive:!0}),ae(window,"resize",t)}}()}),[]),hs}function _s(){!gs&&function(){if(gs=tr(null),"undefined"!=typeof window)if(window.matchMedia){var t=window.matchMedia("(prefers-reduced-motion)"),e=function(){return gs.set(t.matches)};t.addListener(e),e()}else gs.set(!1)}();var t=s(Object(c.useState)(gs.get()),2),e=t[0],n=t[1];return es(gs,n),e}function ws(){var t=!1,e=[],n=new Set,i={subscribe:function(t){return n.add(t),function(){n.delete(t)}},start:function(i,r){if(t){var o=[];return n.forEach((function(t){o.push(fr(t,i,{transitionOverride:r}))})),Promise.all(o)}return new Promise((function(t){e.push({animation:[i,r],resolve:t})}))},set:function(e){return p(t,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach((function(t){!function(t,e){Array.isArray(e)?ur(t,e):"string"==typeof e?ur(t,[e]):sr(t,e)}(t,e)}))},stop:function(){n.forEach((function(t){!function(t){t.forEachValue((function(t){return t.stop()}))}(t)}))},mount:function(){return t=!0,e.forEach((function(t){var e=t.animation,n=t.resolve;i.start.apply(i,u([],s(e))).then(n)})),function(){t=!1,i.stop()}}};return i}function Cs(){var t=C(ws);return Object(c.useEffect)(t.mount,[]),t}var xs=function(t,e,n){var i=e-t;return((n-t)%i+i)%i+t};function Ss(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object(c.useRef)(0),i=s(Object(c.useState)(t[n.current]),2),r=i[0],o=i[1];return[r,function(e){n.current="number"!=typeof e?xs(0,t.length,n.current+1):e,o(t[n.current])}]}var Es=function(){function t(){this.componentControls=new Set}return t.prototype.subscribe=function(t){var e=this;return this.componentControls.add(t),function(){return e.componentControls.delete(t)}},t.prototype.start=function(t,e){this.componentControls.forEach((function(n){n.start(t.nativeEvent||t,e)}))},t.prototype.updateConstraints=function(t){void 0===t&&(t=!0),this.componentControls.forEach((function(t){t.updateConstraints()})),t&&xo()},t}(),Ps=function(){return new Es};function ks(){return C(Ps)}var Os=function(){return{}},Ts=sa({build:function(){},measureViewportBox:jr,resetTransform:function(){},restoreTransform:function(){},removeValueFromRenderState:function(){},render:function(){},scrapeMotionValuesFromProps:Os,readValueFromInstance:function(t,e,n){return n.initialState[e]||0},makeTargetAnimatable:function(t,e){var n=e.transition,i=e.transitionEnd,r=a(e,["transition","transitionEnd"]);return cr(t,r,dr(r,n||{},t)),o({transition:n,transitionEnd:i},r)}}),As=te({scrapeMotionValuesFromProps:Os,createRenderState:Os});function Ms(t){var e=s(Object(c.useState)(t),2),n=e[0],i=e[1],r=As({},!1),a=C((function(){return Ts({props:{},visualState:r},{initialState:t})}));return Object(c.useEffect)((function(){return a.mount({}),a.unmount()}),[]),Object(c.useEffect)((function(){a.setProps({onUpdate:function(t){return i(o({},t))}})})),[n,C((function(){return function(t){return fr(a,t)}}))]}var Ds=function(t){return t>.001?1/t:1e5},Rs=!1;function Ls(t){var e=ts(1),n=ts(1),i=_();return p(!(!t&&!i),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),h(Rs,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),Rs=!0,t?(e=t.scaleX||e,n=t.scaleY||n):i&&(e=i.getValue("scaleX",1),n=i.getValue("scaleY",1)),{scaleX:as(e,Ds),scaleY:as(n,Ds)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScannerConfiguration=void 0;const i=n(31);class r 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=r,r.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},r.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},r.DEFAULT_ACCEPTED_ANGLE_SCORE=75,r.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=n(44),a=n(30),s=n(48),u=r(n(49)),c=r(n(50)),l=r(n(32)),d=n(5),f=n(29),h=n(18),p=r(n(52)),m=r(n(54)),v=r(n(55)),g=n(33),y=n(57),b=n(58),_=r(n(59)),w=r(n(34)),C=r(n(19));class x{static initialize(t){return i(this,void 0,void 0,(function*(){const e=new x,n=t.engine||x.defaultEnginePath,i=!!t.allowThreads;e.bridge=new o.WorkerBridge(n,{allowSimd:!0,allowThreads:i});const r=[t.licenseKey,n,window.location.hostname,f.Constants.CDN_PATH+f.Constants.DEFAULT_WASM_FOLDER,{captureConsole:!1,allowThreads:i,profileTfjsKernels:!1}];return e.initialized=yield e.bridge.postByCopyingArgs("initialize",r),e.initialized&&(x.instance=e),C.default.initialize(t.verboseLogging),e}))}createDocumentScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(60);return yield e.default.create(t)}))}createMrzScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(70),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(73);return yield e.default.create(t)}))}openCroppingView(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(96);return yield e.default.create(t)}))}createTextDataScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=[{languages:(t=g.TextDataScannerConfiguration.fromJson(t)).supportedLanguages,ocrResolutionLimit:t.ocrResolutionLimit,validatorPreset:t.validatorPreset}];return yield this.createGenericTextLineScanner(t,t.style,t.onTextDetected,e)}))}createVINScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=[{ocrResolutionLimit:(t=y.VINScannerConfiguration.fromJson(t)).ocrResolutionLimit,validatorPreset:"VehicleIdentificationNumber"}];return yield this.createGenericTextLineScanner(t,t.style,(e=>{""!==e.text&&t.onTextDetected(e)}),e)}))}toDataUrl(t){return i(this,void 0,void 0,(function*(){return w.default.throwIfMissingBuffer(t),yield d.ImageUtils.toDataUrl(t)}))}applyFilter(t,e){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),w.default.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("applyFilter",[t,e])}))}rotateImageCcw(t,e){return i(this,void 0,void 0,(function*(){return w.default.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("rotateImageCcw",[t,e])}))}cropAndRotateImageCcw(t,e,n){return i(this,void 0,void 0,(function*(){return w.default.throwIfMissingBuffer(t),w.default.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*(){yield this.licenseCheck(),w.default.throwIfMissingBuffer(t);const i=yield this.bridge.postByTransferringArgs("createDocumentDetector",[{useCombinedDetector:!1,acceptedAngleScore:e||a.DocumentScannerConfiguration.DEFAULT_ACCEPTED_ANGLE_SCORE,acceptedSizeScore:n||a.DocumentScannerConfiguration.DEFAULT_ACCEPTED_SIZE_SCORE}]);return yield this.bridge.postByCopyingArgs("documentDetectorDetect",[i,t])}))}detectBarcodes(t,e,n,r){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),w.default.throwIfMissingBuffer(t),new Promise((o=>{const a=document.createElement("canvas"),s=document.createElement("img");s.src=t,s.onload=()=>i(this,void 0,void 0,(function*(){a.width=s.width,a.height=s.height;const t=a.getContext("2d");t.drawImage(s,0,0);const i=t.getImageData(0,0,s.width,s.height),{result:u,originalImage:c}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[i,{engineMode:e,barcodeFormats:n,returnBarcodeImage:r}]);o(h.BarcodeResult.fromWorker(u,d.ImageUtils.convertImageDataWrapperToImageData(c)))}))}))}))}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]))}))}createDocumentQualityAnalyzer(t){return i(this,void 0,void 0,(function*(){const e=yield this.bridge.postByTransferringArgs("createDocumentQualityAnalyzer",[null!=t?t:{}]);return new _.default(this,e)}))}getLicenseInfo(){return i(this,void 0,void 0,(function*(){const t=yield this.bridge.postByTransferringArgs("getLicenseInfo",[]);return s.LicenseInfo.fromJson(t)}))}beginPdf(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new u.default(this,yield this.bridge.postByCopyingArgs("beginPdf",[t]))}))}beginTiff(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new c.default(this,yield this.bridge.postByCopyingArgs("beginTiff",[t]))}))}get version(){return f.Constants.VERSION}get utils(){return this._utils||(this._utils=new l.default),this._utils}release(t,e){return i(this,void 0,void 0,(function*(){t&&(console.log("Releasing object: "+e||!1),yield this.bridge.postByTransferringArgs("releaseObject",[t]))}))}licenseCheck(){return i(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new b.LicenseError(t)}))}createGenericTextLineScanner(t,e,r,o){return i(this,void 0,void 0,(function*(){const i=n(107),a=yield this.bridge.postByCopyingArgs("createGenericTextLineScanner",o),s=new v.default(this,a);return yield i.default.create(t,e,r,s)}))}}e.default=x,x.defaultEnginePath=""},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";for(let n=0;n<5;n++)t+=e.charAt(Math.floor(62*Math.random()));return t}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=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 o=r(n(0)),a=n(0),s=r(n(10)),u=n(35);e.ScanbotCameraProps=class{};e.ScanbotCameraState=class{constructor(){this.initialized=!1}};class c extends o.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 s.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,a.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(u.MediaError.unknownError(t))}))}else e(u.MediaError.unsupportedOperationError())}))}))}}e.ScannerView=c,c.DEFAULT_DETECTION_RESOLUTION=600,c.DETECTION_RESULTION_4K=3840},function(t,e,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var t=[],e=0;e<arguments.length;e++){var i=arguments[e];if(i){var o=typeof i;if("string"===o||"number"===o)t.push(i);else if(Array.isArray(i)){if(i.length){var a=r.apply(null,i);a&&t.push(a)}}else if("object"===o)if(i.toString===Object.prototype.toString)for(var s in i)n.call(i,s)&&i[s]&&t.push(s);else t.push(i.toString())}}return t.join(" ")}t.exports?(r.default=r,t.exports=r):void 0===(i=function(){return r}.apply(e,[]))||(t.exports=i)}()},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(0)),a=r(n(68)),s=n(4),u=n(6),c=n(5),l=r(n(19));class d extends o.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 s.Size(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}imageCapture(){if(this.capture)return this.capture;const t=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(t),this.capture}createImageData(t=0,e){var n;return i(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const i=this.getCanvasRenderingContext();if(!i)return;let{videoWidth:r,videoHeight:o}=this.video,{clientVideoWidth:a,clientVideoHeight:s}=this.calculateClientVideoConstraints(),d=a,f=s;if(this.props.windowConfiguration)if(this.props.windowConfiguration.aspectRatio){d*=this.props.windowConfiguration.widthProportion<0||this.props.windowConfiguration.widthProportion>=1?1:this.props.windowConfiguration.widthProportion,f=d/this.props.windowConfiguration.aspectRatio}else this.props.windowConfiguration.width&&this.props.windowConfiguration.height&&(d=parseFloat(this.props.windowConfiguration.width),f=parseFloat(this.props.windowConfiguration.height));const{width:h,height:p}=this.calculateFrameSize(t,d,f),m=null!==(n=this.cutout)&&void 0!==n?n:new u.Frame(0,0,h,p),v=h*this.zoom(),g=p*this.zoom(),y=-v/2+v/this.zoom()/2,b=-g/2+g/this.zoom()/2;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);l.default.debug("Bitmap size: "+e.width*e.height),i.canvas.width=e.width,i.canvas.height=e.height,i.drawImage(e,0,0,e.width,e.height);const n=this.windowSize(),r=e.height/(n.height+n.y),o=n.width*r,a=n.height*r,s=e.width/2-o/2,c=n.y*r,d=new u.Frame(s,c,o,a);l.default.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height);return i.getImageData(d.x,d.y,d.width,d.height)}if(this.video.readyState>1){i.drawImage(this.video,(r-d)/2,(o-f)/2,d,f,y,b,v,g);const t=i.getImageData(m.x,m.y,m.width,m.height);return i.clearRect(0,0,this.canvas.width,this.canvas.height),this.save&&(c.ImageUtils.saveImageData(t),this.save=!1),t}}))}windowSize(){var t;const e=this.props.configuration,n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return u.Frame.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),i=t,r=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&&(r=n.height/e)}return{clientVideoWidth:i,clientVideoHeight:r}}calculateFrameSize(t,e,n){let i=e,r=n;if(t>0&&0!=e&&0!=n){const o=e/n;e>n?(i=e>t?t:e,r=i/o):(r=n>t?t:n,i=r*o)}return new s.Size(i,r)}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 o.default.createElement(a.default,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},o.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 r="unknown";return"user"===i?r="front":"environment"===i&&(r="back"),{deviceId:n,label:e,facingMode:r}}));this.activeCamera=t[0]}}getActiveCameraInfo(){return this.activeCamera}}e.default=d},function(t,e,n){"use strict";var i,r=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var t={};return function(e){if("undefined"==typeof 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]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function u(t,e){for(var n={},i=[],r=0;r<t.length;r++){var o=t[r],u=e.base?o[0]+e.base:o[0],c=n[u]||0,l="".concat(u," ").concat(c);n[u]=c+1;var d=s(l),f={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(a[d].references++,a[d].updater(f)):a.push({identifier:l,updater:v(f,e),references:1}),i.push(l)}return i}function c(t){var e=document.createElement("style"),i=t.attributes||{};if("undefined"==typeof i.nonce){var r=n.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var l,d=(l=[],function(t,e){return l[t]=e,l.filter(Boolean).join("\n")});function f(t,e,n,i){var r=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=d(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function h(t,e,n){var i=n.css,r=n.media,o=n.sourceMap;if(r?t.setAttribute("media",r):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),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 v(t,e){var n,i,r;if(e.singleton){var o=m++;n=p||(p=c(e)),i=f.bind(null,n,o,!1),r=f.bind(null,n,o,!0)}else n=c(e),i=h.bind(null,n,e),r=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 r()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=r());var n=u(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 r=s(n[i]);a[r].references--}for(var o=u(t,e),c=0;c<n.length;c++){var l=s(n[c]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}n=o}}}},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 r={};if(i)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(r[a]=!0)}for(var s=0;s<t.length;s++){var u=[].concat(t[s]);i&&r[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},function(t,e,n){"use strict";n.r(e);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)-.*))$/,r=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.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeResult=void 0;const i=n(5),r=n(51);class o{constructor(t,e){this.barcodes=t,this.imageData=e}static fromWorker(t,e){const n=[];t&&t.forEach((t=>{n.push(r.Barcode.fromWorker(t))}));const a=i.ImageUtils.convertImageDataWrapperToImageData(e);return new o(n,a)}isEmpty(){return 0===this.barcodes.length}}e.BarcodeResult=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}}},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.DocumentLineQuad=void 0;const r=i(n(0));class o extends r.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return r.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(r.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.DocumentLineQuad=o,o.CLASSNAME="scanbot-document-outline"},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 r=i(n(0)),o=n(6),a=n(72),s=n(1);var u;!function(t){t[t.Right=0]="Right",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Up=3]="Up"}(u||(u={}));class c extends r.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=o.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(),r=o.Frame.fromRect(i),s=o.Frame.fromRect(null===(e=this.overlay)||void 0===e?void 0:e.getBoundingClientRect()),u=o.Frame.fromRect(null===(n=this.window)||void 0===n?void 0:n.getBoundingClientRect());u.x=r.x-s.x,u.y=r.y-s.y;const c=a.ClipPath.fromFrames(s,u);return this.calculateClipPath(c)}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=o.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 r.default.createElement("div",null,r.default.createElement("div",{ref:t=>this.overlay=t,style:this.backgroundStyle}),r.default.createElement("div",{ref:t=>this.container=t,style:this.containerStyle,id:"finder"},r.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}),r.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,u.Right)}\n ${this.roundClipPath(t.right,t.top,u.Down)}\n ${this.roundClipPath(t.right,t.bottom,u.Left)}\n ${this.roundClipPath(t.left,t.bottom,u.Up)}\n\n ${t.left} 100%, \n 100% 100%, \n 100% 0%\n )`}roundClipPath(t,e,n){let i="";let r=new s.Point(a.ClipPath.toNumber(t),a.ClipPath.toNumber(e));switch(n){case u.Right:r.y+=10;break;case u.Down:r.x-=10;break;case u.Left:r.y-=10;break;case u.Up:r.x+=10}let o=[];switch(n){case u.Right:o=[{x:1,y:-3},{x:3,y:-5},{x:5,y:-7},{x:7,y:-9},{x:10,y:-10}];break;case u.Down:o=[{x:3,y:1},{x:5,y:3},{x:7,y:5},{x:9,y:7},{x:10,y:10}];break;case u.Left:o=[{x:-1,y:3},{x:-3,y:5},{x:-5,y:7},{x:-7,y:9},{x:-10,y:10}];break;case u.Up:o=[{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(r,o),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=c},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 Bt})),n.d(e,"StyleSheetConsumer",(function(){return it})),n.d(e,"StyleSheetContext",(function(){return nt})),n.d(e,"StyleSheetManager",(function(){return ct})),n.d(e,"ThemeConsumer",(function(){return Mt})),n.d(e,"ThemeContext",(function(){return At})),n.d(e,"ThemeProvider",(function(){return Dt})),n.d(e,"__PRIVATE__",(function(){return Nt})),n.d(e,"createGlobalStyle",(function(){return zt})),n.d(e,"css",(function(){return bt})),n.d(e,"isStyledComponent",(function(){return b})),n.d(e,"keyframes",(function(){return Vt})),n.d(e,"useTheme",(function(){return Ut})),n.d(e,"version",(function(){return w})),n.d(e,"withTheme",(function(){return Ft}));var i=n(27),r=n(0),o=n(40),a=n.n(o),s=n(41),u=n(42),c=n(17),l=n(28),d=n.n(l);function f(){return(f=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 h=function(t,e){for(var n=[t[0]],i=0,r=e.length;i<r;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([]),v=Object.freeze({});function g(t){return"function"==typeof t}function y(t){return t.displayName||t.name||"Component"}function b(t){return t&&"string"==typeof t.styledComponentId}var _="undefined"!=typeof t&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",w="5.3.3",C="undefined"!=typeof window&&"HTMLElement"in window,x=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof 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:"undefined"!=typeof t&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),S={};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,r=i;t>=r;)(r<<=1)<0&&E(16,""+t);this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var o=i;o<r;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(t+1),s=0,u=e.length;s<u;s++)this.tag.insertRule(a,e[s])&&(this.groupSizes[t]++,a++)},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 r=n;r<i;r++)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),r=i+n,o=i;o<r;o++)e+=this.tag.getRule(o)+"/*!sc*/\n";return e},t}(),k=new Map,O=new Map,T=1,A=function(t){if(k.has(t))return k.get(t);for(;O.has(T);)T++;var e=T++;return k.set(t,e),O.set(e,t),e},M=function(t){return O.get(t)},D=function(t,e){e>=T&&(T=e+1),k.set(t,e),O.set(e,t)},R="style["+_+'][data-styled-version="5.3.3"]',L=new RegExp("^"+_+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),I=function(t,e,n){for(var i,r=n.split(","),o=0,a=r.length;o<a;o++)(i=r[o])&&t.registerName(e,i)},j=function(t,e){for(var n=(e.textContent||"").split("/*!sc*/\n"),i=[],r=0,o=n.length;r<o;r++){var a=n[r].trim();if(a){var s=a.match(L);if(s){var u=0|parseInt(s[1],10),c=s[2];0!==u&&(D(c,u),I(t,c,s[3]),t.getTag().insertRules(u,i)),i.length=0}else i.push(a)}}},z=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},V=function(t){var e=document.head,n=t||e,i=document.createElement("style"),r=function(t){for(var e=t.childNodes,n=e.length;n>=0;n--){var i=e[n];if(i&&1===i.nodeType&&i.hasAttribute(_))return i}}(n),o=void 0!==r?r.nextSibling:null;i.setAttribute(_,"active"),i.setAttribute("data-styled-version","5.3.3");var a=z();return a&&i.setAttribute("nonce",a),n.insertBefore(i,o),i},B=function(){function t(t){var e=this.element=V(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 r=e[n];if(r.ownerNode===t)return r}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}(),F=function(){function t(t){var e=this.element=V(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}(),N=C,H={isServer:!C,useCSSOMInjection:!x},W=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={}),this.options=f({},H,{},t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&C&&N&&(N=!1,function(t){for(var e=document.querySelectorAll(R),n=0,i=e.length;n<i;n++){var r=e[n];r&&"active"!==r.getAttribute(_)&&(j(t,r),r.parentNode&&r.parentNode.removeChild(r))}}(this))}t.registerId=function(t){return A(t)};var e=t.prototype;return e.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(f({},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,r=e.target,t=n?new U(r):i?new B(r):new F(r),new P(t)));var t,e,n,i,r},e.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},e.registerName=function(t,e){if(A(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(A(t),n)},e.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.clearRules=function(t){this.getTag().clearGroup(A(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="",r=0;r<n;r++){var o=M(r);if(void 0!==o){var a=t.names.get(o),s=e.getGroup(r);if(a&&s&&a.size){var u=_+".g"+r+'[id="'+o+'"]',c="";void 0!==a&&a.forEach((function(t){t.length>0&&(c+=t+",")})),i+=""+s+u+'{content:"'+c+'"}/*!sc*/\n'}}}return i}(this)},t}(),$=/(a)(d)/gi,X=function(t){return String.fromCharCode(t+(t>25?39:97))};function Y(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=X(e%52)+n;return(X(e%52)+n).replace($,"$1-$2")}var G=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},q=function(t){return G(5381,t)};function Z(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(g(n)&&!b(n))return!1}return!0}var K=q("5.3.3"),J=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Z(t),this.componentId=e,this.baseHash=G(K,e),this.baseStyle=n,W.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var i=this.componentId,r=[];if(this.baseStyle&&r.push(this.baseStyle.generateAndInjectStyles(t,e,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(i,this.staticRulesId))r.push(this.staticRulesId);else{var o=gt(this.rules,t,e,n).join(""),a=Y(G(this.baseHash,o)>>>0);if(!e.hasNameForId(i,a)){var s=n(o,"."+a,void 0,i);e.insertRules(i,a,s)}r.push(a),this.staticRulesId=a}else{for(var u=this.rules.length,c=G(this.baseHash,n.hash),l="",d=0;d<u;d++){var f=this.rules[d];if("string"==typeof f)l+=f;else if(f){var h=gt(f,t,e,n),p=Array.isArray(h)?h.join(""):h;c=G(c,p+d),l+=p}}if(l){var m=Y(c>>>0);if(!e.hasNameForId(i,m)){var v=n(l,"."+m,void 0,i);e.insertRules(i,m,v)}r.push(m)}}return r.join(" ")},t}(),Q=/^\s*\/\/.*$/gm,tt=[":","[",".","#"];function et(t){var e,n,i,r,o=void 0===t?v:t,a=o.options,u=void 0===a?v:a,c=o.plugins,l=void 0===c?m:c,d=new s.a(u),f=[],h=function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(n,i,r,o,a,s,u,c,l,d){switch(n){case 1:if(0===l&&64===i.charCodeAt(0))return t(i+";"),"";break;case 2:if(0===c)return i+"/*|*/";break;case 3:switch(c){case 102:case 112:return t(r[0]+i),"";default:return i+(0===d?"/*|*/":"")}case-2:i.split("/*|*/}").forEach(e)}}}((function(t){f.push(t)})),p=function(t,i,o){return 0===i&&-1!==tt.indexOf(o[n.length])||o.match(r)?t:"."+e};function g(t,o,a,s){void 0===s&&(s="&");var u=t.replace(Q,""),c=o&&a?a+" "+o+" { "+u+" }":u;return e=s,n=o,i=new RegExp("\\"+n+"\\b","g"),r=new RegExp("(\\"+n+"\\b){2,}"),d(a||!o?"":o,c)}return d.use([].concat(l,[function(t,e,r){2===t&&r.length&&r[0].lastIndexOf(n)>0&&(r[0]=r[0].replace(i,p))},h,function(t){if(-2===t){var e=f;return f=[],e}}])),g.hash=l.length?l.reduce((function(t,e){return e.name||E(15),G(t,e.name)}),5381).toString():"",g}var nt=r.default.createContext(),it=nt.Consumer,rt=r.default.createContext(),ot=(rt.Consumer,new W),at=et();function st(){return Object(r.useContext)(nt)||ot}function ut(){return Object(r.useContext)(rt)||at}function ct(t){var e=Object(r.useState)(t.stylisPlugins),n=e[0],i=e[1],o=st(),s=Object(r.useMemo)((function(){var e=o;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]),u=Object(r.useMemo)((function(){return et({options:{prefix:!t.disableVendorPrefixes},plugins:n})}),[t.disableVendorPrefixes,n]);return Object(r.useEffect)((function(){a()(n,t.stylisPlugins)||i(t.stylisPlugins)}),[t.stylisPlugins]),r.default.createElement(nt.Provider,{value:s},r.default.createElement(rt.Provider,{value:u},t.children))}var lt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=at);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=at),this.name+t.hash},t}(),dt=/([A-Z])/,ft=/([A-Z])/g,ht=/^ms-/,pt=function(t){return"-"+t.toLowerCase()};function mt(t){return dt.test(t)?t.replace(ft,pt).replace(ht,"-ms-"):t}var vt=function(t){return null==t||!1===t||""===t};function gt(t,e,n,i){if(Array.isArray(t)){for(var r,o=[],a=0,s=t.length;a<s;a+=1)""!==(r=gt(t[a],e,n,i))&&(Array.isArray(r)?o.push.apply(o,r):o.push(r));return o}return vt(t)?"":b(t)?"."+t.styledComponentId:g(t)?"function"!=typeof(c=t)||c.prototype&&c.prototype.isReactComponent||!e?t:gt(t(e),e,n,i):t instanceof lt?n?(t.inject(n,i),t.getName(i)):t:p(t)?function t(e,n){var i,r,o=[];for(var a in e)e.hasOwnProperty(a)&&!vt(e[a])&&(Array.isArray(e[a])&&e[a].isCss||g(e[a])?o.push(mt(a)+":",e[a],";"):p(e[a])?o.push.apply(o,t(e[a],a)):o.push(mt(a)+": "+(i=a,(null==(r=e[a])||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||i in u.a?String(r).trim():r+"px")+";")));return n?[n+" {"].concat(o,["}"]):o}(t):t.toString();var c}var yt=function(t){return Array.isArray(t)&&(t.isCss=!0),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];return g(t)||p(t)?yt(gt(h(m,[t].concat(n)))):0===n.length&&1===t.length&&"string"==typeof t[0]?t:yt(gt(h(t,n)))}new Set;var _t=function(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme},wt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ct=/(^-|-$)/g;function xt(t){return t.replace(wt,"-").replace(Ct,"")}var St=function(t){return Y(q(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 Ot(t,e,n){var i=t[n];Pt(e)&&Pt(i)?Tt(i,e):t[n]=e}function Tt(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 r=0,o=n;r<o.length;r++){var a=o[r];if(Pt(a))for(var s in a)kt(s)&&Ot(t,a[s],s)}return t}var At=r.default.createContext(),Mt=At.Consumer;function Dt(t){var e=Object(r.useContext)(At),n=Object(r.useMemo)((function(){return function(t,e){return t?g(t)?t(e):Array.isArray(t)||"object"!=typeof t?E(8):e?f({},e,{},t):t:E(14)}(t.theme,e)}),[t.theme,e]);return t.children?r.default.createElement(At.Provider,{value:n},t.children):null}var Rt={};function Lt(t,e,n){var i=b(t),o=!Et(t),a=e.attrs,s=void 0===a?m:a,u=e.componentId,l=void 0===u?function(t,e){var n="string"!=typeof t?"sc":xt(t);Rt[n]=(Rt[n]||0)+1;var i=n+"-"+St("5.3.3"+n+Rt[n]);return e?e+"-"+i:i}(e.displayName,e.parentComponentId):u,h=e.displayName,p=void 0===h?function(t){return Et(t)?"styled."+t:"Styled("+y(t)+")"}(t):h,_=e.displayName&&e.componentId?xt(e.displayName)+"-"+e.componentId:e.componentId||l,w=i&&t.attrs?Array.prototype.concat(t.attrs,s).filter(Boolean):s,C=e.shouldForwardProp;i&&t.shouldForwardProp&&(C=e.shouldForwardProp?function(n,i,r){return t.shouldForwardProp(n,i,r)&&e.shouldForwardProp(n,i,r)}:t.shouldForwardProp);var x,S=new J(n,_,i?t.componentStyle:void 0),E=S.isStatic&&0===s.length,P=function(t,e){return function(t,e,n,i){var o=t.attrs,a=t.componentStyle,s=t.defaultProps,u=t.foldedComponentIds,l=t.shouldForwardProp,d=t.styledComponentId,h=t.target,p=function(t,e,n){void 0===t&&(t=v);var i=f({},e,{theme:t}),r={};return n.forEach((function(t){var e,n,o,a=t;for(e in g(a)&&(a=a(i)),a)i[e]=r[e]="className"===e?(n=r[e],o=a[e],n&&o?n+" "+o:n||o):a[e]})),[i,r]}(_t(e,Object(r.useContext)(At),s)||v,e,o),m=p[0],y=p[1],b=function(t,e,n,i){var r=st(),o=ut();return e?t.generateAndInjectStyles(v,r,o):t.generateAndInjectStyles(n,r,o)}(a,i,m),_=n,w=y.$as||e.$as||y.as||e.as||h,C=Et(w),x=y!==e?f({},e,{},y):e,S={};for(var E in x)"$"!==E[0]&&"as"!==E&&("forwardedAs"===E?S.as=x[E]:(l?l(E,c.default,w):!C||Object(c.default)(E))&&(S[E]=x[E]));return e.style&&y.style!==e.style&&(S.style=f({},e.style,{},y.style)),S.className=Array.prototype.concat(u,d,b!==d?b:null,e.className,y.className).filter(Boolean).join(" "),S.ref=_,Object(r.createElement)(w,S)}(x,t,e,E)};return P.displayName=p,(x=r.default.forwardRef(P)).attrs=w,x.componentStyle=S,x.displayName=p,x.shouldForwardProp=C,x.foldedComponentIds=i?Array.prototype.concat(t.foldedComponentIds,t.styledComponentId):m,x.styledComponentId=_,x.target=i?t.target:t,x.withComponent=function(t){var i=e.componentId,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(e,["componentId"]),o=i&&i+"-"+(Et(t)?t:xt(y(t)));return Lt(t,f({},r,{attrs:w,componentId:o}),n)},Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?Tt({},t.defaultProps,e):e}}),x.toString=function(){return"."+x.styledComponentId},o&&d()(x,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),x}var It=function(t){return function t(e,n,r){if(void 0===r&&(r=v),!Object(i.isValidElementType)(n))return E(1,String(n));var o=function(){return e(n,r,bt.apply(void 0,arguments))};return o.withConfig=function(i){return t(e,n,f({},r,{},i))},o.attrs=function(i){return t(e,n,f({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},o}(Lt,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){It[t]=It(t)}));var jt=function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Z(t),W.registerId(this.componentId+1)}var e=t.prototype;return e.createStyles=function(t,e,n,i){var r=i(gt(this.rules,e,n,i).join(""),""),o=this.componentId+t;n.insertRules(o,o,r)},e.removeStyles=function(t,e){e.clearRules(this.componentId+t)},e.renderStyles=function(t,e,n,i){t>2&&W.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,i)},t}();function zt(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=bt.apply(void 0,[t].concat(n)),a="sc-global-"+St(JSON.stringify(o)),s=new jt(o,a);function u(t){var e=st(),n=ut(),i=Object(r.useContext)(At),o=Object(r.useRef)(e.allocateGSInstance(a)).current;return e.server&&c(o,t,e,i,n),Object(r.useLayoutEffect)((function(){if(!e.server)return c(o,t,e,i,n),function(){return s.removeStyles(o,e)}}),[o,t,e,i,n]),null}function c(t,e,n,i,r){if(s.isStatic)s.renderStyles(t,S,n,r);else{var o=f({},e,{theme:_t(e,i,u.defaultProps)});s.renderStyles(t,o,n,r)}}return r.default.memo(u)}function Vt(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=bt.apply(void 0,[t].concat(n)).join(""),o=St(r);return new lt(o,r)}var Bt=function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var n=z();return"<style "+[n&&'nonce="'+n+'"',_+'="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={})[_]="",e["data-styled-version"]="5.3.3",e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),i=z();return i&&(n.nonce=i),[r.default.createElement("style",f({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new W({isServer:!0}),this.sealed=!1}var e=t.prototype;return e.collectStyles=function(t){return this.sealed?E(2):r.default.createElement(ct,{sheet:this.instance},t)},e.interleaveWithNodeStream=function(t){return E(3)},t}(),Ft=function(t){var e=r.default.forwardRef((function(e,n){var i=Object(r.useContext)(At),o=t.defaultProps,a=_t(e,i,o);return r.default.createElement(t,f({},e,{theme:a,ref:n}))}));return d()(e,t),e.displayName="WithTheme("+y(t)+")",e},Ut=function(){return Object(r.useContext)(At)},Nt={StyleSheet:W,masterSheet:ot};e.default=It}.call(this,n(78))},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(16),r=n.n(i)()((function(t){return t[1]}));r.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=r},function(t,e,n){"use strict";var i=n(16),r=n.n(i)()((function(t){return t[1]}));r.push([t.i,".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=r},function(t,e,n){"use strict";t.exports=n(79)},function(t,e,n){"use strict";var i=n(80),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return i.isMemo(t)?a:s[t.$$typeof]||r}s[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[i.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,i){if("string"!=typeof n){if(p){var r=h(n);r&&r!==p&&t(e,r,i)}var a=l(n);d&&(a=a.concat(d(n)));for(var s=u(e),m=u(n),v=0;v<a.length;++v){var g=a[v];if(!(o[g]||i&&i[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{c(e,g,y)}catch(t){}}}}return e}},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(45));var r="4.0.1-alpha.1";class o{}e.Constants=o,o.VERSION=r,o.CDN_PATH=r&&`https://cdn.jsdelivr.net/npm/scanbot-web-sdk@${r}/bundle/`,o.DEFAULT_WASM_FOLDER="bin/complete/"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentScannerConfiguration=e.CaptureAnimationStyleConfiguration=e.OutlinePolygonStyleConfiguration=e.OutlineStyleConfiguration=e.TextConfiguration=void 0;const i=n(9),r={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 o{constructor(t){this.hint=t}}e.TextConfiguration=o;class a{constructor(){this.outline=new s,this.captureButton=new d}}class s{constructor(){this.polygon=new u,this.path=new c,this.label=new l}}e.OutlineStyleConfiguration=s;class u{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}e.OutlinePolygonStyleConfiguration=u;class c{constructor(){this.stroke="green",this.strokeWidth=4}}e.CaptureAnimationStyleConfiguration=c;class l{}class d{constructor(){this.color="#FFF"}}class f extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_4K),this.acceptedAngleScore=f.DEFAULT_ACCEPTED_ANGLE_SCORE,this.acceptedSizeScore=f.DEFAULT_ACCEPTED_SIZE_SCORE,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new o(r),this.style=new a,this.onDocumentDetected=function(t){}}static fromJson(t){const e=new f;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","path","label"]);const t=n.polygon;t&&this.mapValues(t,e.style.outline.polygon);const i=n.path;i&&this.mapValues(i,e.style.outline.path);const r=n.label;r&&this.mapValues(r,e.style.outline.label)}const i=t.style.captureButton;i&&this.mapValues(i,e.style.captureButton)}return this.mapVideoConstraints(t,e),e}}e.DocumentScannerConfiguration=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseConfiguration=void 0;class i{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])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((r=>{r in e&&n(t[r])&&n(e[r])?i.mapValuesDeep(t[r],e[r]):e[r]=t[r]}))}static _fromJson(t,e){let n=new t;return this.mapValuesDeep(e,n),n}}e.BaseConfiguration=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(11);e.default=class{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=r.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.TextDataScannerConfiguration=e.TextDataScannerViewFinderStyle=void 0;const i=n(9);class r{constructor(){this.aspectRatio=6,this.widthProportion=.8,this.borderColor="white",this.left="50%",this.top="50%",this.transform="translate(-50%, -50%)"}}class o{constructor(){this.color="white",this.size="0.9em",this.weight=300}}class a{constructor(){this.window=new r,this.text=new o,this.backgroundColor="rgba(0, 0, 0, 0.7)",this.hint="Please hold the device over the text to start scanning"}}e.TextDataScannerViewFinderStyle=a;class s extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onTextDetected=function(t){},this.style=new a}static fromJson(t){return this._fromJson(s,t)}}e.TextDataScannerConfiguration=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i{static throwIfMissingBuffer(t){i.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}e.default=i},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 r=i(n(0));n(62);const o=i(n(13));e.ShutterButtonProps=class{};class a{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 s extends r.default.Component{constructor(){super(...arguments),this.inner1=new a("scanbot-shutter-rotate"),this.inner2=new a("scanbot-shutter-rotate")}render(){return r.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,r.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},r.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},r.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},r.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},r.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 r.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n=void 0){return r.default.createElement("div",{className:(0,o.default)(t),ref:n},r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}e.ShutterButton=s},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 r=t[(i+2)%n].x-t[(i+1)%n].x,o=t[(i+2)%n].y-t[(i+1)%n].y,a=t[i].x-t[(i+1)%n].x,s=r*(t[i].y-t[(i+1)%n].y)-o*a;if(0==i)e=s>0;else if(e!=s>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 r=i(n(0));class o extends r.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=o},function(t,e){t.exports=function(t,e,n,i){var r=n?n.call(i,t,e):void 0;if(void 0!==r)return!!r;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!s(c))return!1;var l=t[c],d=e[c];if(!1===(r=n?n.call(i,l,d,c):void 0)||void 0===r&&l!==d)return!1}return!0}},function(t,e,n){"use strict";e.a=function(t){function e(t,i,u,c,f){for(var h,p,m,v,_,C=0,x=0,S=0,E=0,P=0,D=0,L=m=h=0,j=0,z=0,V=0,B=0,F=u.length,U=F-1,N="",H="",W="",$="";j<F;){if(p=u.charCodeAt(j),j===U&&0!==x+E+S+C&&(0!==x&&(p=47===x?10:47),E=S=C=0,F++,U++),0===x+E+S+C){if(j===U&&(0<z&&(N=N.replace(d,"")),0<N.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:N+=u.charAt(j)}p=59}switch(p){case 123:for(h=(N=N.trim()).charCodeAt(0),m=1,B=++j;j<F;){switch(p=u.charCodeAt(j)){case 123:m++;break;case 125:m--;break;case 47:switch(p=u.charCodeAt(j+1)){case 42:case 47:t:{for(L=j+1;L<U;++L)switch(u.charCodeAt(L)){case 47:if(42===p&&42===u.charCodeAt(L-1)&&j+2!==L){j=L+1;break t}break;case 10:if(47===p){j=L+1;break t}}j=L}}break;case 91:p++;case 40:p++;case 34:case 39:for(;j++<U&&u.charCodeAt(j)!==p;);}if(0===m)break;j++}if(m=u.substring(B,j),0===h&&(h=(N=N.replace(l,"").trim()).charCodeAt(0)),64===h){switch(0<z&&(N=N.replace(d,"")),p=N.charCodeAt(1)){case 100:case 109:case 115:case 45:z=i;break;default:z=M}if(B=(m=e(i,z,m,p,f+1)).length,0<R&&(_=s(3,m,z=n(M,N,V),i,O,k,B,p,f,c),N=z.join(""),void 0!==_&&0===(B=(m=_.trim()).length)&&(p=0,m="")),0<B)switch(p){case 115:N=N.replace(w,a);case 100:case 109:case 45:m=N+"{"+m+"}";break;case 107:m=(N=N.replace(g,"$1 $2"))+"{"+m+"}",m=1===A||2===A&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=N+m,112===c&&(H+=m,m="")}else m=""}else m=e(i,n(i,N,V),m,c,f+1);W+=m,m=V=z=L=h=0,N="",p=u.charCodeAt(++j);break;case 125:case 59:if(1<(B=(N=(0<z?N.replace(d,""):N).trim()).length))switch(0===L&&(h=N.charCodeAt(0),45===h||96<h&&123>h)&&(B=(N=N.replace(" ",":")).length),0<R&&void 0!==(_=s(1,N,i,t,O,k,H.length,c,f,c))&&0===(B=(N=_.trim()).length)&&(N="\0\0"),h=N.charCodeAt(0),p=N.charCodeAt(1),h){case 0:break;case 64:if(105===p||99===p){$+=N+u.charAt(j);break}default:58!==N.charCodeAt(B-1)&&(H+=r(N,h,p,N.charCodeAt(2)))}V=z=L=h=0,N="",p=u.charCodeAt(++j)}}switch(p){case 13:case 10:47===x?x=0:0===1+h&&107!==c&&0<N.length&&(z=1,N+="\0"),0<R*I&&s(0,N,i,t,O,k,H.length,c,f,c),k=1,O++;break;case 59:case 125:if(0===x+E+S+C){k++;break}default:switch(k++,v=u.charAt(j),p){case 9:case 32:if(0===E+C+x)switch(P){case 44:case 58:case 9:case 32:v="";break;default:32!==p&&(v=" ")}break;case 0:v="\\0";break;case 12:v="\\f";break;case 11:v="\\v";break;case 38:0===E+x+C&&(z=V=1,v="\f"+v);break;case 108:if(0===E+x+C+T&&0<L)switch(j-L){case 2:112===P&&58===u.charCodeAt(j-3)&&(T=P);case 8:111===D&&(T=D)}break;case 58:0===E+x+C&&(L=j);break;case 44:0===x+S+E+C&&(z=1,v+="\r");break;case 34:case 39:0===x&&(E=E===p?0:0===E?p:E);break;case 91:0===E+x+S&&C++;break;case 93:0===E+x+S&&C--;break;case 41:0===E+x+C&&S--;break;case 40:if(0===E+x+C){if(0===h)if(2*P+3*D==533);else h=1;S++}break;case 64:0===x+S+E+C+L+m&&(m=1);break;case 42:case 47:if(!(0<E+C+S))switch(x){case 0:switch(2*p+3*u.charCodeAt(j+1)){case 235:x=47;break;case 220:B=j,x=42}break;case 42:47===p&&42===P&&B+2!==j&&(33===u.charCodeAt(B+2)&&(H+=u.substring(B,j+1)),v="",x=0)}}0===x&&(N+=v)}D=P,P=p,j++}if(0<(B=H.length)){if(z=i,0<R&&(void 0!==(_=s(2,H,z,t,O,k,B,c,f,c))&&0===(H=_).length))return $+H+W;if(H=z.join(",")+"{"+H+"}",0!=A*T){switch(2!==A||o(H,2)||(T=0),T){case 111:H=H.replace(b,":-moz-$1")+H;break;case 112:H=H.replace(y,"::-webkit-input-$1")+H.replace(y,"::-moz-$1")+H.replace(y,":-ms-input-$1")+H}T=0}}return $+H+W}function n(t,e,n){var r=e.trim().split(m);e=r;var o=r.length,a=t.length;switch(a){case 0:case 1:var s=0;for(t=0===a?"":t[0]+" ";s<o;++s)e[s]=i(t,e[s],n).trim();break;default:var u=s=0;for(e=[];s<o;++s)for(var c=0;c<a;++c)e[u++]=i(t[c]+" ",r[s],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(v,"$1"+t.trim());case 58:return t.trim()+e.replace(v,"$1"+t.trim());default:if(0<1*n&&0<e.indexOf("\f"))return e.replace(v,(58===t.charCodeAt(0)?"":"$1")+t.trim())}return t+e}function r(t,e,n,i){var a=t+";",s=2*e+3*n+4*i;if(944===s){t=a.indexOf(":",9)+1;var u=a.substring(t,a.length-1).trim();return u=a.substring(0,t).trim()+u+";",1===A||2===A&&o(u,1)?"-webkit-"+u+u:u}if(0===A||2===A&&!o(a,1))return a;switch(s){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(P,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(u=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+u+a;case 1005:return h.test(a)?a.replace(f,":-webkit-")+a.replace(f,":-moz-")+a:a;case 1e3:switch(e=(u=a.substring(13).trim()).indexOf("-")+1,u.charCodeAt(0)+u.charCodeAt(e)){case 226:u=a.replace(_,"tb");break;case 232:u=a.replace(_,"tb-rl");break;case 220:u=a.replace(_,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+u+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(e=(a=t).length-10,s=(u=(33===a.charCodeAt(e)?a.substring(0,e):a).substring(t.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|u.charCodeAt(7))){case 203:if(111>u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102<s?"inline-":"")+"box")+";"+a.replace(u,"-webkit-"+u)+";"+a.replace(u,"-ms-"+u+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return u=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+u+"-ms-flex-"+u+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(x,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(x,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===E.test(t))return 115===(u=t.substring(t.indexOf(":")+1)).charCodeAt(0)?r(t.replace("stretch","fill-available"),e,n,i).replace(":fill-available",":stretch"):a.replace(u,"-webkit-"+u)+a.replace(u,"-moz-"+u.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===n+i&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+a}return a}function o(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),L(2!==e?i:i.replace(S,"$1"),n,e)}function a(t,e){var n=r(e,e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2));return n!==e+";"?n.replace(C," or ($1)").substring(4):"("+e+")"}function s(t,e,n,i,r,o,a,s,u,l){for(var d,f=0,h=e;f<R;++f)switch(d=D[f].call(c,t,h,n,i,r,o,a,s,u,l)){case void 0:case!1:case!0:case null:break;default:h=d}if(h!==e)return h}function u(t){return void 0!==(t=t.prefix)&&(L=null,t?"function"!=typeof t?A=1:(A=2,L=t):A=0),u}function c(t,n){var i=t;if(33>i.charCodeAt(0)&&(i=i.trim()),i=[i],0<R){var r=s(-1,n,i,i,O,k,0,0,0,0);void 0!==r&&"string"==typeof r&&(n=r)}var o=e(M,i,n,0,0);return 0<R&&(void 0!==(r=s(-2,o,i,i,O,k,o.length,0,0,0))&&(o=r)),"",T=0,k=O=1,o}var l=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,h=/zoo|gra/,p=/([,: ])(transform)/g,m=/,\r+?/g,v=/([\t\r\n ])*\f?&/g,g=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,b=/:(read-only)/g,_=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,x=/-self|flex-/g,S=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,k=1,O=1,T=0,A=1,M=[],D=[],R=0,L=null,I=0;return c.use=function t(e){switch(e){case void 0:case null:R=D.length=0;break;default:if("function"==typeof e)D[R++]=e;else if("object"==typeof e)for(var n=0,i=e.length;n<i;++n)t(e[n]);else I=0|!!e}return t},c.set=u,void 0!==t&&u(t),c}},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 r=i(n(10));e.ScanbotSDK=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;const i=n(29),r=n(46);class o{constructor(t,e){t||(t=i.Constants.CDN_PATH+i.Constants.DEFAULT_WASM_FOLDER),this.core=new r.WorkerBridge(t,e)}postByCopyingArgs(t,e){return this.core.postByCopyingArgs(t,e)}postByTransferringArgs(t,e){return this.core.postByTransferringArgs(t,e)}}e.WorkerBridge=o,o.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(47);e.WorkerBridge=class{constructor(t,e){const{allowSimd:n=!0}=e||{},r=n&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(t){return!1}}()?"-simd":"",o=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${r}.js`;if((0,i.isRemote)(o)){const t=new Blob([`importScripts("${o}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(o);this.continuations={},this.nextTicketId=1,this.instance.onmessage=t=>{const{log:e,logError:n}=t.data;if(e)return void console.log(...e);if(n)return void console.error(...n);const{ticket:i,result:r,error:o}=t.data,{resolve:a,reject:s}=this.continuations[i];delete this.continuations[i],o?s(o):a(r)}}post(t,e,n){return new Promise(((r,o)=>{const a=(0,i.gatherTransferables)(e,n),s=this.nextTicketId++;this.continuations[s]={resolve:r,reject:o},this.instance.postMessage({command:t,args:e,ticket:s},a)}))}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},e.isRemote=function(t){return t.startsWith("http:")||t.startsWith("https:")}},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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((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 r{constructor(t,e,n,i,r,o){this.format=t,this.text=e,this.parsedText=n,this.rawBytes=i,this.points=r,this.barcodeImage=o}id(){return this.text+this.format}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 r(t.format,t.text,e,t.rawBytes,n,t.barcodeImage)}}e.Barcode=r},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=n(53);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 r.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"),r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){n.width=r.width,n.height=r.height;const t=n.getContext("2d");t.drawImage(r,0,0);const i=t.getImageData(0,0,r.width,r.height),o=yield this.recognize(i);o&&e(o)}))}))}))}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 r{}e.MrzCheckDigits=r;class o{static fromWorker(t){let e=new o;const n=new r,a=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)),a?e.checkDigits=n:e=void 0,e}}e.MrzResult=o},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((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"),r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){n.width=r.width,n.height=r.height;const t=n.getContext("2d");t.drawImage(r,0,0);const i=t.getImageData(0,0,r.width,r.height),o=yield this.performOcr(i);e(o)}))}))}))}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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=n(56);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 r.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"),r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){n.width=r.width,n.height=r.height;const t=n.getContext("2d");t.drawImage(r,0,0);const i=t.getImageData(0,0,r.width,r.height),o=yield this.recognize(i);o&&e(o)}))}))}))}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.VINScannerConfiguration=void 0;const i=n(9),r=n(33);class o extends r.TextDataScannerViewFinderStyle{constructor(){super(...arguments),this.hint="Please hold the device over the vehicle identification number to start scanning"}}class a extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onTextDetected=function(t){},this.style=new o}static fromJson(t){return this._fromJson(a,t)}}e.VINScannerConfiguration=a},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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(34));e.default=class{constructor(t,e){this._sdk=t,this._token=e}analyze(t){return i(this,void 0,void 0,(function*(){o.default.throwIfMissingBuffer(t);return yield this._sdk.bridge.postByCopyingArgs("documentQualityAnalyzerAnalyze",[this._token,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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(0)),a=n(0),s=r(n(10)),u=n(30),c=n(7),l=n(4),d=n(1),f=n(12),h=n(36),p=n(63),m=r(n(14)),v=n(11),g=n(69),y=r(n(19));f.ScanbotCameraState;f.ScanbotCameraProps;class b extends f.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(!s.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=u.DocumentScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get autoCaptureDelay(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}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,a.render)(o.default.createElement(b,{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=yield this.camera.createImageData(b.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);if(!t)return;y.default.debug("Detect & Crop document of size: "+t.height*t.width);const e=new l.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(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return i(this,void 0,void 0,(function*(){t.componentDidMount.call(this),this.detect(),this.recognizer=yield this.bridge.postByTransferringArgs("createDocumentDetector",[{useCombinedDetector:!1,acceptedAngleScore:this.configuration.acceptedAngleScore,acceptedSizeScore:this.configuration.acceptedSizeScore}])}))}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return i(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield s.default.instance.release(this.recognizer,"Document Scanner")}))}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,v.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=yield this.camera.createImageData(f.ScannerView.DEFAULT_DETECTION_RESOLUTION);if(!t||!this.enabled)return;const e=[this.recognizer,t];return yield this.bridge.postByCopyingArgs("documentDetectorDetect",e)}))}handleAutoCapture(t,e=void 0){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 g.PolygonMovementPredicate(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);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)}))),this.autoCaptureDelay)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e;const{action:n}=this.state,{configuration:i}=this,r=null===(t=i.style)||void 0===t?void 0:t.captureButton;return o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},o.default.createElement(m.default,{configuration:this.configuration,videoConstraints:i.videoConstraints,mirrored:i.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),o.default.createElement(p.DocumentOutline,{ref:t=>{this.outline=t},style:null===(e=i.style)||void 0===e?void 0:e.outline,action:n,autoCaptureDelay:this.autoCaptureDelay}),o.default.createElement(h.ShutterButton,{color:(null==r?void 0:r.color)?r.color:"FFF",action:n,onClick:this.enabled?i.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=l.Size.fromHtmlElement(this.camera.video),i=c.ViewUtils.findScale(n,e);t=(t=c.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(f.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}e.default=b,b.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 r{constructor(t,e){this.p1=t,this.p2=e}static scaleToLine(t,e,n,o){const a=new i.Point(o*(t.p1.x-e),o*(t.p1.y-n)),s=new i.Point(o*(t.p2.x-e),o*(t.p2.y-n));return new r(a,s)}}e.MagneticLine=r},function(t,e,n){"use strict";n.r(e);var i=n(15),r=n.n(i),o=n(25),a={insert:"head",singleton:!1};r()(o.a,a);e.default=o.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 r=i(n(0)),o=i(n(13));n(64);const a=i(n(65));class s extends r.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="searching"===this.props.action||"capturing"===this.props.action,s="processing"!==this.props.action&&n,u=(0,o.default)({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:s,[`${this.hintLabelClassName}-hidden`]:!s});return r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},r.default.createElement(a.default,{ref:t=>{this.polygon=t},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:t,isVisible:s,autoCaptureDelay:this.props.autoCaptureDelay}),i&&r.default.createElement("label",{ref:t=>this.label=t,style:this.props.style.label,className:u,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){this.polygon.update(e,t,this.props.action),this.label&&(this.label.innerHTML=n)}}e.DocumentOutline=s},function(t,e,n){"use strict";n.r(e);var i=n(15),r=n.n(i),o=n(26),a={insert:"head",singleton:!1};r()(o.a,a);e.default=o.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.AnimatedDocumentPolygonProps=void 0;const r=i(n(0)),o=i(n(66)),a=n(8),s=i(n(67));e.AnimatedDocumentPolygonProps=class{};class u extends r.default.Component{render(){return r.default.createElement(a.motion.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},r.default.createElement(o.default,{ref:t=>this.polygon=t,style:this.props.polygonStyle}),r.default.createElement(s.default,{ref:t=>this.path=t,style:this.props.pathStyle,duration:this.props.autoCaptureDelay}))}update(t,e,n){var i;const r="processing"!==n&&!!t,o=null!==(i=this.previous)&&void 0!==i?i:t,a=this.previous?t:void 0;this.polygon.update(o,a,e,r),this.previous=t,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}e.default=u},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 r=n(8),o=i(n(0)),a=n(1),s=i(n(13)),u=n(20);class c extends o.default.Component{constructor(t){super(t),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(t,e,n,i){const r={points:t,animatedPoints:e,isOk:n,isVisible:i};this.setState(r)}pointStringOrLatestValidPoints(t){return t&&t.length>0?a.Point.toSvgString(t):a.Point.toSvgString(this.latestValidPoints)}render(){var t;this.state.points&&(this.latestValidPoints=this.state.points);const e=null!==(t=this.props.style)&&void 0!==t?t:{},n=(0,s.default)(u.DocumentLineQuad.CLASSNAME,{[`${u.DocumentLineQuad.CLASSNAME}-ok`]:this.state.isOk},{[`${u.DocumentLineQuad.CLASSNAME}-visible`]:this.state.isVisible},{[`${u.DocumentLineQuad.CLASSNAME}-hidden`]:!this.state.isVisible});return o.default.createElement(r.motion.polygon,{ref:t=>this.polygon=t,style:{strokeWidth:e.strokeWidth||2},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?e.strokeCapturing:e.strokeSearching,fill:this.state.isOk?e.fillCapturing:e.fillSearching},onClick:()=>{},fill:"transparent",className:n})}}e.default=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.AnimatedPathProps=void 0;const r=i(n(0)),o=n(8),a=n(1);e.AnimatedPathProps=class{constructor(){this.duration=1e3}};class s extends r.default.Component{constructor(t){super(t),this.state={path:void 0}}render(){var t,e;return this.state.path?r.default.createElement(o.motion.path,{initial:{pathLength:0},animate:{pathLength:1},transition:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:1/0,repeatType:"loop",repeatDelay:1},stroke:(null===(t=this.props.style)||void 0===t?void 0:t.stroke)||"white",strokeWidth:(null===(e=this.props.style)||void 0===e?void 0:e.strokeWidth)||2,strokeDasharray:"0 1",fill:"none",d:this.state.path}):null}animate(t){const e="M"+a.Point.toSvgString(t)+"z";this.setState({path:e})}clear(){this.setState({path:void 0})}}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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(0)),a=n(35);class s extends o.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})}catch(t){throw a.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,r,o,s;return i(this,void 0,void 0,(function*(){const i={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const n=a.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,r;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(r=(i=this.props).onReady)||void 0===r||r.call(i)}))}catch(t){const e=a.MediaError.unsupportedMediaDevices("UnsupportedError: navigator.mediaDevices.getUserMedia is undefined");return null===(r=(n=this.props).onError)||void 0===r||r.call(n,e),void console.error(e)}}catch(t){let e=a.MediaError.unknownError(t.message);return t instanceof DOMException&&("NotAllowedError"===t.name?e=a.MediaError.permissionError(t.message):"NotFoundError"===t.name&&(e=a.MediaError.notAvailable(t.message))),null===(s=(o=this.props).onError)||void 0===s||s.call(o,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){const t=this.getVideoTrack();if(t)return t.getCapabilities()}}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonMovementPredicate=void 0;const i=n(1),r=n(37);class o{constructor(t,e=o.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 r.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 r.MathUtils.distanceBetweenPoints(e,n)}}e.PolygonMovementPredicate=o,o.DEFAULT_SENSITIVITY=.5},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=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 o=r(n(0)),a=n(0),s=n(12),u=r(n(14)),c=n(71),l=n(21),d=n(4),f=n(7),h=n(22),p=n(6);class m extends s.ScanbotCameraProps{}e.MrzScannerProps=m;class v extends s.ScanbotCameraState{}e.MrzScannerState=v;class g extends s.ScannerView{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.state={isFinderVisible:!0}}get configuration(){return this._configuration||(this._configuration=c.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,r)=>{(0,a.render)(o.default.createElement(g,{container:n,configuration:t,onSuccess:i,onFailure:r,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return i(this,void 0,void 0,(function*(){h.Debugger.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){h.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(g.FRAME_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=d.Size.fromHtmlElement(this.camera.video),i=f.ViewUtils.findScale(n,e);let r=null===(t=this.finder)||void 0===t?void 0:t.frame();if(r){const t=p.Frame.withSize(r.width/i.scale,r.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=yield this.camera.createImageData(g.FRAME_RESOLUTION);if(!i)return;e&&this.forceUpdate();const r=yield this.props.mrzRecognizer.recognize(i);if(!this.enabled)return;if(null===r)return;r?(n=!0,this.configuration.onMrzDetected(r)):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 o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},o.default.createElement(u.default,{configuration:this.configuration,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&&o.default.createElement(l.ViewFinder,{ref:t=>this.finder=t,configuration:this.configuration.style}))}}e.default=g,g.FRAME_RESOLUTION=1200},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MrzScannerConfiguration=void 0;const i=n(9),r={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 o extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onMrzDetected=function(t){},this.style=r}static fromJson(t){const e=new o;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=o},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},s=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 u=s(n(0)),c=n(0),l=n(12),d=s(n(14)),f=n(74),h=n(18),p=n(21),m=n(4),v=n(7),g=n(22),y=n(6),b=s(n(32)),_=o(n(77)),w=s(n(84)),C=s(n(88)),x=s(n(91)),S=n(5),E=s(n(93)),P=s(n(94)),k=s(n(95));class O extends l.ScanbotCameraProps{}e.BarcodeScannerProps=O;class T extends l.ScanbotCameraState{constructor(){super(...arguments),this.action="manual"}}e.BarcodeScannerState=T;class A extends l.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=f.BarcodeScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return a(this,void 0,void 0,(function*(){const e=v.ViewUtils.findContainerOrThrow(t);return new Promise(((n,i)=>{(0,c.render)(u.default.createElement(A,{container:e,configuration:t,showFinder:t.showFinder,onSuccess:n,onFailure:i}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return a(this,void 0,void 0,(function*(){g.Debugger.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){g.Debugger.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return a(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 a(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate(),yield this.resume()}))}resume(){return a(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(l.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=m.Size.fromHtmlElement(this.camera.video),i=v.ViewUtils.findScale(n,e);let r=null===(t=this.finder)||void 0===t?void 0:t.frame();if(r){const t=y.Frame.withSize(r.width/i.scale,r.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,r;return a(this,void 0,void 0,(function*(){const o=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 a=!1;try{const t=yield this.recognizeBarcodes(!0,o,this.configuration.returnBarcodeImage);if(!t)return;const r=t.barcodeResult;r.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(null==r?void 0:r.imageData)):(a=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(r)),null===(n=this.overlay)||void 0===n||n.update(this.finderRect,this.camera,t.barcodeResult.imageData,null!==(i=this.configuration.container)&&void 0!==i?i:this.configuration.containerId,t.barcodeResult.barcodes)}catch(t){console.log(t)}finally{if(a){const t=(null===(r=this.configuration.overlay)||void 0===r?void 0:r.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,r;return a(this,void 0,void 0,(function*(){const o=t?l.ScannerView.DEFAULT_DETECTION_RESOLUTION:l.ScannerView.DETECTION_RESULTION_4K,a=null!==(i=this.desiredRecognitionResolution)&&void 0!==i?i:o,s=yield this.camera.createImageData(a);if(!s)return;e&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:S.ImageUtils.wrapperToBase64(s)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",l.ScannerView.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));const u=this.configuration.engineMode,c=this.configuration.barcodeFormats;let d;if(this.backendurl&&this.backendurl.length>0)d=yield k.default.recognizeBarcodes(this.backendurl,s);else{const{result:e,originalImage:i}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[s,{live:t,engineMode:u,barcodeFormats:c,returnBarcodeImage:n}]);if(!this.enabled)return;if(null===e)return;d=h.BarcodeResult.fromWorker(e,i)}return{imageData:s,originalImage:undefined,barcodeResult:d}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return a(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,r,o;const s=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return u.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"}},u.default.createElement(d.default,{configuration:this.configuration,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}}),u.default.createElement(P.default,{top:null===(n=this.configuration.scanAndCount)||void 0===n?void 0:n.style.topLabelTop,text:s}),u.default.createElement(x.default,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&u.default.createElement(p.ViewFinder,{ref:t=>{this.finder=t},onSizeChanged:t=>{this.finderRect=t},configuration:this.configuration.style}),u.default.createElement(P.default,{bottom:100,text:this.state.bottomHintText}),u.default.createElement(E.default,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&u.default.createElement(w.default,{ref:t=>{t&&(this.overlay=t)},configuration:this.configuration.overlay,onPolygonClick:t=>{const e=new h.BarcodeResult([t],void 0);this.configuration.onBarcodesDetected(e)},onBarcodeFound:(t,e,n)=>{var i;(null===(i=this.configuration.overlay)||void 0===i?void 0:i.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(t,e,n)}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&u.default.createElement(C.default,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(_.AnimationType.PushBottom,this.barcodes)},onShutterButtonClick:()=>a(this,void 0,void 0,(function*(){(new b.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()}}),u.default.createElement(_.default,{ref:t=>this.popup=t,style:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.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=A},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeScannerConfiguration=void 0;const i=n(9),r=n(75),o=n(76),a={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."};class s extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new r.SelectionOverlayConfiguration,this.showFinder=!0,this.scanAndCount=new o.BarcodeCountConfiguration,this.onBarcodesDetected=function(t){},this.style=a}static fromJson(t){const e=new s;return this.mapValues(t,e,["style","videoConstraints","overlay","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,["style"]),t.overlay.style&&this.mapValues(t.overlay.style,e.overlay.style)),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=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionOverlayConfiguration=e.SelectionOverlayStyleConfiguration=e.BarcodePolygonLabelStyle=e.BarcodePolygonStyle=void 0;e.BarcodePolygonStyle=class{};e.BarcodePolygonLabelStyle=class{};class i{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}e.SelectionOverlayStyleConfiguration=i;e.SelectionOverlayConfiguration=class{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.style=new i}}},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationType=void 0;const s=a(n(0)),u=o(n(23)),c=a(n(82)),l=a(n(24));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 f extends s.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),r=this.to(this.state.animation.type);this.previousDestination=r;const o=this.props.style;return s.default.createElement(i,{style:this.containerStyle(`${r}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},s.default.createElement("div",{style:{backgroundColor:"white",height:o.sheetHeight,width:"100%",marginTop:o.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},s.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:l.default.ScanbotPrimary}},s.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},s.default.createElement("div",{style:{backgroundColor:l.default.White,height:3,width:33,borderRadius:5}})),s.default.createElement("div",{style:{display:"flex",height:50}},s.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:l.default.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),s.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:l.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"),s.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:l.default.White,justifyContent:"right",alignItems:"center",paddingRight:10}},s.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),s.default.createElement(c.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=u.keyframes`from {transform: ${e};} to {transform: ${n};}`;return u.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=f},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!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:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return 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(){}r.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];c.push(new p(t,e)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){"use strict";var i=60103,r=60106,o=60107,a=60108,s=60114,u=60109,c=60110,l=60112,d=60113,f=60120,h=60115,p=60116,m=60121,v=60122,g=60117,y=60129,b=60131;if("function"==typeof Symbol&&Symbol.for){var _=Symbol.for;i=_("react.element"),r=_("react.portal"),o=_("react.fragment"),a=_("react.strict_mode"),s=_("react.profiler"),u=_("react.provider"),c=_("react.context"),l=_("react.forward_ref"),d=_("react.suspense"),f=_("react.suspense_list"),h=_("react.memo"),p=_("react.lazy"),m=_("react.block"),v=_("react.server.block"),g=_("react.fundamental"),y=_("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 o:case s:case a:case d:case f:return t;default:switch(t=t&&t.$$typeof){case c:case l:case p:case h:case u:return t;default:return e}}case r:return e}}}var C=u,x=i,S=l,E=o,P=p,k=h,O=r,T=s,A=a,M=d;e.ContextConsumer=c,e.ContextProvider=C,e.Element=x,e.ForwardRef=S,e.Fragment=E,e.Lazy=P,e.Memo=k,e.Portal=O,e.Profiler=T,e.StrictMode=A,e.Suspense=M,e.isAsyncMode=function(){return!1},e.isConcurrentMode=function(){return!1},e.isContextConsumer=function(t){return w(t)===c},e.isContextProvider=function(t){return w(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return w(t)===l},e.isFragment=function(t){return w(t)===o},e.isLazy=function(t){return w(t)===p},e.isMemo=function(t){return w(t)===h},e.isPortal=function(t){return w(t)===r},e.isProfiler=function(t){return w(t)===s},e.isStrictMode=function(t){return w(t)===a},e.isSuspense=function(t){return w(t)===d},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===s||t===y||t===a||t===d||t===f||t===b||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===h||t.$$typeof===u||t.$$typeof===c||t.$$typeof===l||t.$$typeof===g||t.$$typeof===m||t[0]===v)},e.typeOf=w},function(t,e,n){"use strict";t.exports=n(81)},function(t,e,n){"use strict";var i="function"==typeof Symbol&&Symbol.for,r=i?Symbol.for("react.element"):60103,o=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,s=i?Symbol.for("react.strict_mode"):60108,u=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,l=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.async_mode"):60111,f=i?Symbol.for("react.concurrent_mode"):60111,h=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,m=i?Symbol.for("react.suspense_list"):60120,v=i?Symbol.for("react.memo"):60115,g=i?Symbol.for("react.lazy"):60116,y=i?Symbol.for("react.block"):60121,b=i?Symbol.for("react.fundamental"):60117,_=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 r:switch(t=t.type){case d:case f:case a:case u:case s:case p:return t;default:switch(t=t&&t.$$typeof){case l:case h:case g:case v:case c:return t;default:return e}}case o:return e}}}function x(t){return C(t)===f}e.AsyncMode=d,e.ConcurrentMode=f,e.ContextConsumer=l,e.ContextProvider=c,e.Element=r,e.ForwardRef=h,e.Fragment=a,e.Lazy=g,e.Memo=v,e.Portal=o,e.Profiler=u,e.StrictMode=s,e.Suspense=p,e.isAsyncMode=function(t){return x(t)||C(t)===d},e.isConcurrentMode=x,e.isContextConsumer=function(t){return C(t)===l},e.isContextProvider=function(t){return C(t)===c},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},e.isForwardRef=function(t){return C(t)===h},e.isFragment=function(t){return C(t)===a},e.isLazy=function(t){return C(t)===g},e.isMemo=function(t){return C(t)===v},e.isPortal=function(t){return C(t)===o},e.isProfiler=function(t){return C(t)===u},e.isStrictMode=function(t){return C(t)===s},e.isSuspense=function(t){return C(t)===p},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===f||t===u||t===s||t===p||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===v||t.$$typeof===c||t.$$typeof===l||t.$$typeof===h||t.$$typeof===b||t.$$typeof===_||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 r=i(n(0)),o=i(n(83));class a extends r.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 r.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>r.default.createElement(o.default,{key:e,barcode:t,onClick:this.props.onClick}))))}}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});const r=i(n(0));class o extends r.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return r.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},r.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},r.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},r.default.createElement("div",{style:{flex:1}},this.props.barcode.text),r.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),r.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}e.default=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.SelectionOverlayProps=e.BarcodePolygonElement=void 0;const r=i(n(0)),o=n(8),a=n(38),s=n(1),u=i(n(85)),c=i(n(86)),l=i(n(87));e.BarcodePolygonElement=class{};e.SelectionOverlayProps=class{};class d extends r.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,i,o){const d=[];o.forEach((r=>{const o=new a.BarcodeOverlay(r);o.points=void 0===t?s.Point.scaleListToHtmlElement(r.points,n,e.video):r.points.map((e=>{const r=new s.Point(e.x,e.y);r.x*=t.width/n.width,r.y*=t.height/n.height,r.y+=t.y,r.x+=t.x;const o=("string"==typeof i?document.getElementById(i):i).getBoundingClientRect();return r.x-=o.x,r.y-=o.y,r})),d.push(o)}));const f=[];this.state.polygonElements.forEach((t=>{const e=d.find((e=>e.code.equals(t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<u.default.now()&&(n=!0):(t.element=e,t.polygon=r.default.createElement(c.default,{key:t.element.code.id(),ref:e=>t.polygonRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.label=r.default.createElement(l.default,{key:t.element.code.id(),ref:e=>t.labelRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.updatedAt=u.default.now()),n||f.push(t)})),d.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>e.element.code.equals(t.code)))){let e,n;const i=r.default.createElement(c.default,{key:t.code.id(),ref:i=>{e=i,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),o=r.default.createElement(l.default,{key:t.code.id(),ref:i=>{n=i,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),a={element:t,polygon:i,label:o,polygonRef:e,labelRef:n,updatedAt:u.default.now()};f.push(a)}})),this.setState({polygonElements:f})}onPolygonClick(t){var e,n;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const i=e.labelRef;i&&e.label.props.element.code.equals(t.code)&&(i.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonClick)||void 0===n||n.call(e,t.code))}render(){var t,e;return r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},r.default.createElement(o.motion.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%",top:0}},null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((t=>t.polygon))),null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((t=>t.label)))}}e.default=d},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}),e.BarcodePolygonProps=void 0;const r=i(n(0)),o=n(8),a=n(1);e.BarcodePolygonProps=class{};class s extends r.default.Component{constructor(t){super(t),this.state={element:t.element}}update(t){this.setState({element:t})}style(t){this.customStyle=t,this.forceUpdate()}render(){var t,e,n,i;const s=this.state.element,u=this.props.configuration.style;!s.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(s);const c=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fill)&&void 0!==e?e:s.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,l=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.stroke)&&void 0!==i?i:s.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor;return r.default.createElement(o.motion.polygon,{points:a.Point.toSvgString(s.points),animate:{points:a.Point.toSvgString(this.props.animateToPoints)},onClick:()=>{this.props.onClick&&this.props.onClick(s)},fill:c,stroke:l,strokeWidth:s.highlighted?2:1})}}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}),e.BarcodePolygonLabelProps=void 0;const r=i(n(0)),o=n(8),a=n(1);e.BarcodePolygonLabelProps=class{};class s extends r.default.Component{constructor(t){super(t),this.state={element:t.element}}style(t){this.customStyle=t,this.forceUpdate()}update(t){this.setState({element:t})}formatText(t,e){if("None"!==e)return"Text"===e?t.text:t.format+" ("+t.text+")"}render(){var t,e,n,i,s;const u=this.state.element,c=this.props.configuration.style,l=this.formatText(u.code,this.props.configuration.textFormat),d=a.Point.width(null!==(t=this.props.animateToPoints)&&void 0!==t?t:u.points);if(!l)return null;if(!u.points)return null;const f=null!==(n=null===(e=this.customStyle)||void 0===e?void 0:e.backgroundColor)&&void 0!==n?n:u.highlighted?c.highlightedTextBackgroundColor:c.textBackgroundColor,h=null!==(s=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==s?s:u.highlighted?c.highlightedTextColor:c.textColor;return r.default.createElement(o.motion.div,{ref:t=>this.label=t,onClick:()=>{this.props.onClick&&this.props.onClick(u)},style:{x:a.Point.lowestX(u.points),y:a.Point.highestY(u.points)+3,backgroundColor:f,fontSize:12,width:d,overflow:"hidden",maxLines:2,color:h,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px"},animate:this.props.animateToPoints?{x:a.Point.lowestX(this.props.animateToPoints),y:a.Point.highestY(this.props.animateToPoints)+30}:{}},l)}}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 r=i(n(0)),o=n(36),a=i(n(24)),s=i(n(89)),u=i(n(90));class c extends r.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 r.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:a.default.ScanbotPrimary}},r.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},r.default.createElement(s.default,null),r.default.createElement("div",{style:{backgroundColor:a.default.Orange,color:a.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)),r.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},r.default.createElement(o.ShutterButton,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),r.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},r.default.createElement("div",{style:{fontSize:13,color:a.default.White,marginRight:10}},"Scan More"),r.default.createElement(u.default,null)))}}e.default=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 r=i(n(0));class o extends r.default.Component{render(){return r.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},r.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),r.default.createElement("g",{mask:"url(#mask0_919_23088)"},r.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=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});const r=i(n(0));class o extends r.default.Component{render(){return r.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},r.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),r.default.createElement("g",{mask:"url(#mask0_919_23102)"},r.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=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});const r=i(n(0)),o=n(38),a=i(n(92)),s=n(4),u=n(1);class c extends r.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:s.Size.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const i=new o.BarcodeOverlay(n);i.points=u.Point.scaleListToHtmlElement(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:r.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}},r.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),r.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>r.default.createElement(a.default,{key:e,points:t.points})))))}}e.default=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 r=i(n(0)),o=n(1);class a extends r.default.Component{render(){const t=o.Point.centerOf(this.props.points),e=o.Point.smallerSizeOfQuad(this.props.points)/40;return r.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})`}},r.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},r.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),r.default.createElement("g",{mask:"url(#mask0_910_20901)"},r.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),r.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=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});const r=i(n(0)),o=i(n(23));class a extends r.default.Component{render(){if(!this.props.visible)return null;const t=o.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 r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));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=43)}([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 rt})),n.d(e,"useMemo",(function(){return ot})),n.d(e,"useCallback",(function(){return at})),n.d(e,"useContext",(function(){return st})),n.d(e,"useDebugValue",(function(){return ut})),n.d(e,"useErrorBoundary",(function(){return ct})),n.d(e,"createElement",(function(){return m})),n.d(e,"createContext",(function(){return U})),n.d(e,"createRef",(function(){return g})),n.d(e,"Fragment",(function(){return y})),n.d(e,"Component",(function(){return b})),n.d(e,"version",(function(){return Zt})),n.d(e,"Children",(function(){return St})),n.d(e,"render",(function(){return Bt})),n.d(e,"hydrate",(function(){return Ft})),n.d(e,"unmountComponentAtNode",(function(){return te})),n.d(e,"createPortal",(function(){return Rt})),n.d(e,"createFactory",(function(){return Kt})),n.d(e,"cloneElement",(function(){return Qt})),n.d(e,"isValidElement",(function(){return Jt})),n.d(e,"findDOMNode",(function(){return ee})),n.d(e,"PureComponent",(function(){return yt})),n.d(e,"memo",(function(){return bt})),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 re})),n.d(e,"Suspense",(function(){return kt})),n.d(e,"SuspenseList",(function(){return At})),n.d(e,"lazy",(function(){return Tt})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return qt}));var i,r,o,a,s,u,c,l={},d=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(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 r,o,a,s={};for(a in e)"key"==a?r=e[a]:"ref"==a?o=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return v(t,s,r,o,null)}function v(t,e,n,i,a){var s={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==a?++o:a};return null==a&&null!=r.vnode&&r.vnode(s),s}function g(){return{current:null}}function y(t){return t.children}function b(t,e){this.props=t,this.context=e}function _(t,e){if(null==e)return t.__?_(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?_(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)&&a.push(t)&&!x.__r++||u!==r.debounceRendering)&&((u=r.debounceRendering)||s)(x)}function x(){for(var t;x.__r=a.length;)t=a.sort((function(t,e){return t.__v.__b-e.__v.__b})),a=[],t.some((function(t){var e,n,i,r,o,a;t.__d&&(o=(r=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=h({},r)).__v=r.__v+1,D(a,r,i,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?_(r):o,r.__h),L(n,r),r.__e!=o&&w(r)))}))}function S(t,e,n,i,r,o,a,s,u,c){var f,h,p,m,g,b,w,C=i&&i.__k||d,x=C.length;for(n.__k=[],f=0;f<e.length;f++)if(null!=(m=n.__k[f]=null==(m=e[f])||"boolean"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?v(null,m,null,null,m):Array.isArray(m)?v(y,{children:m},null,null,null):m.__b>0?v(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(p=C[f])||p&&m.key==p.key&&m.type===p.type)C[f]=void 0;else for(h=0;h<x;h++){if((p=C[h])&&m.key==p.key&&m.type===p.type){C[h]=void 0;break}p=null}D(t,m,p=p||l,r,o,a,s,u,c),g=m.__e,(h=m.ref)&&p.ref!=h&&(w||(w=[]),p.ref&&w.push(p.ref,null,m),w.push(h,m.__c||g,m)),null!=g?(null==b&&(b=g),"function"==typeof m.type&&m.__k===p.__k?m.__d=u=E(m,u,t):u=k(t,m,p,C,g,u),"function"==typeof n.type&&(n.__d=u)):u&&p.__e==u&&u.parentNode!=t&&(u=_(p))}for(n.__e=b,f=x;f--;)null!=C[f]&&("function"==typeof n.type&&null!=C[f].__e&&C[f].__e==n.__d&&(n.__d=_(i,f+1)),j(C[f],C[f]));if(w)for(f=0;f<w.length;f++)I(w[f],w[++f],w[++f])}function E(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?E(i,e,n):k(n,i,i,r,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,r,o){var a,s,u;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,u=0;(s=s.nextSibling)&&u<i.length;u+=2)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function O(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||f.test(e)?n:n+"px"}function T(t,e,n,i,r){var o;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||O(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||O(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?M:A,o):t.removeEventListener(e,o?M:A,o);else if("dangerouslySetInnerHTML"!==e){if(r)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 A(t){this.l[t.type+!1](r.event?r.event(t):t)}function M(t){this.l[t.type+!0](r.event?r.event(t):t)}function D(t,e,n,i,o,a,s,u,c){var l,d,f,p,m,v,g,_,w,C,x,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(c=n.__h,u=e.__e=n.__e,e.__h=null,a=[u]),(l=r.__b)&&l(e);try{t:if("function"==typeof E){if(_=e.props,w=(l=E.contextType)&&i[l.__c],C=l?w?w.props.value:l.__:i,n.__c?g=(d=e.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?e.__c=d=new E(_,C):(e.__c=d=new b(_,C),d.constructor=E,d.render=z),w&&w.sub(d),d.props=_,d.state||(d.state={}),d.context=C,d.__n=i,f=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,E.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,f)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&_!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,C),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,C)||e.__v===n.__v){d.props=_,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&&s.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,C),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,m,v)}))}d.context=C,d.props=_,d.state=d.__s,(l=r.__r)&&l(e),d.__d=!1,d.__v=e,d.__P=t,l=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(i=h(h({},i),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(p,m)),x=null!=l&&l.type===y&&null==l.key?l.props.children:l,S(t,Array.isArray(x)?x:[x],e,n,i,o,a,s,u,c),d.base=e.__e,e.__h=null,d.__h.length&&s.push(d),g&&(d.__E=d.__=null),d.__e=!1}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=R(n.__e,e,n,i,o,a,s,c);(l=r.diffed)&&l(e)}catch(t){e.__v=null,(c||null!=a)&&(e.__e=u,e.__h=!!c,a[a.indexOf(u)]=null),r.__e(t,e,n)}}function L(t,e){r.__c&&r.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){r.__e(t,e.__v)}}))}function R(t,e,n,r,o,a,s,u){var c,d,f,h=n.props,m=e.props,v=e.type,g=0;if("svg"===v&&(o=!0),null!=a)for(;g<a.length;g++)if((c=a[g])&&"setAttribute"in c==!!v&&(v?c.localName===v:3===c.nodeType)){t=c,a[g]=null;break}if(null==t){if(null===v)return document.createTextNode(m);t=o?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,m.is&&m),a=null,u=!1}if(null===v)h===m||u&&t.data===m||(t.data=m);else{if(a=a&&i.call(t.childNodes),d=(h=n.props||l).dangerouslySetInnerHTML,f=m.dangerouslySetInnerHTML,!u){if(null!=a)for(h={},g=0;g<t.attributes.length;g++)h[t.attributes[g].name]=t.attributes[g].value;(f||d)&&(f&&(d&&f.__html==d.__html||f.__html===t.innerHTML)||(t.innerHTML=f&&f.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||T(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||T(t,o,e[o],n[o],i)}(t,m,h,o,u),f)e.__k=[];else if(g=e.props.children,S(t,Array.isArray(g)?g:[g],e,n,r,o&&"foreignObject"!==v,a,s,a?a[0]:n.__k&&_(n,0),u),null!=a)for(g=a.length;g--;)null!=a[g]&&p(a[g]);u||("value"in m&&void 0!==(g=m.value)&&(g!==h.value||g!==t.value||"progress"===v&&!g)&&T(t,"value",g,h.value,!1),"checked"in m&&void 0!==(g=m.checked)&&g!==t.checked&&T(t,"checked",g,h.checked,!1))}return t}function I(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){r.__e(t,n)}}function j(t,e,n){var i,o;if(r.unmount&&r.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||I(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){r.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&j(i[o],e,"function"!=typeof t.type);n||null==t.__e||p(t.__e),t.__e=t.__d=void 0}function z(t,e,n){return this.constructor(t,n)}function V(t,e,n){var o,a,s;r.__&&r.__(t,e),a=(o="function"==typeof n)?null:n&&n.__k||e.__k,s=[],D(e,t=(!o&&n||e).__k=m(y,null,[t]),a||l,l,void 0!==e.ownerSVGElement,!o&&n?[n]:a?null:e.firstChild?i.call(e.childNodes):null,s,!o&&n?n:a?a.__e:e.firstChild,o),L(s,t)}function B(t,e){V(t,e,B)}function F(t,e,n){var r,o,a,s=h({},t.props);for(a in e)"key"==a?r=e[a]:"ref"==a?o=e[a]:s[a]=e[a];return arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),v(t.type,s,r||t.key,o||t.ref,null)}function U(t,e){var n={__c:e="__cC"+c++,__: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,r={__e:function(t,e){for(var n,i,r;e=e.__;)if((n=e.__c)&&!n.__)try{if((i=n.constructor)&&null!=i.getDerivedStateFromError&&(n.setState(i.getDerivedStateFromError(t)),r=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t),r=n.__d),r)return n.__E=n}catch(e){t=e}throw t}},o=0,b.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof t&&(t=t(h({},n),this.props)),t&&h(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),C(this))},b.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),C(this))},b.prototype.render=y,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,x.__r=0,c=0;var N,H,W,$=0,X=[],Y=r.__b,G=r.__r,q=r.diffed,Z=r.__c,K=r.unmount;function J(t,e){r.__h&&r.__h(H,t,$||e),$=0;var n=H.__H||(H.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Q(t){return $=1,tt(mt,t)}function tt(t,e,n){var i=J(N++,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=H),i.__}function et(t,e){var n=J(N++,3);!r.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,H.__H.__h.push(n))}function nt(t,e){var n=J(N++,4);!r.__s&&pt(n.__H,e)&&(n.__=t,n.__H=e,H.__h.push(n))}function it(t){return $=5,ot((function(){return{current:t}}),[])}function rt(t,e,n){$=6,nt((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==n?n:n.concat(t))}function ot(t,e){var n=J(N++,7);return pt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function at(t,e){return $=8,ot((function(){return t}),e)}function st(t){var e=H.context[t.__c],n=J(N++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(H)),e.props.value):t.__}function ut(t,e){r.useDebugValue&&r.useDebugValue(e?e(t):t)}function ct(t){var e=J(N++,10),n=Q();return e.__=t,H.componentDidCatch||(H.componentDidCatch=function(t){e.__&&e.__(t),n[1](t)}),[n[0],function(){n[1](void 0)}]}function lt(){for(var t;t=X.shift();)if(t.__P)try{t.__H.__h.forEach(ft),t.__H.__h.forEach(ht),t.__H.__h=[]}catch(e){t.__H.__h=[],r.__e(e,t.__v)}}r.__b=function(t){H=null,Y&&Y(t)},r.__r=function(t){G&&G(t),N=0;var e=(H=t.__c).__H;e&&(e.__h.forEach(ft),e.__h.forEach(ht),e.__h=[])},r.diffed=function(t){q&&q(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==X.push(e)&&W===r.requestAnimationFrame||((W=r.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),dt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);dt&&(e=requestAnimationFrame(n))})(lt)),H=null},r.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ft),t.__h=t.__h.filter((function(t){return!t.__||ht(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],r.__e(n,t.__v)}})),Z&&Z(t,e)},r.unmount=function(t){K&&K(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{ft(t)}catch(t){e=t}})),e&&r.__e(e,n.__v))};var dt="function"==typeof requestAnimationFrame;function ft(t){var e=H,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),H=e}function ht(t){var e=H;t.__c=t.__(),H=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 vt(t,e){for(var n in e)t[n]=e[n];return t}function gt(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 bt(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:gt(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 b).isPureReactComponent=!0,yt.prototype.shouldComponentUpdate=function(t,e){return gt(this.props,t)||gt(this.state,e)};var _t=r.__b;r.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),_t&&_t(t)};var wt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ct(t){function e(e,n){var i=vt({},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 xt=function(t,e){return null==t?null:P(P(t).map(e))},St={map:xt,forEach:xt,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=r.__e;r.__e=function(t,e,n){if(t.then)for(var i,r=e;r=r.__;)if((i=r.__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=r.unmount;function kt(){this.__u=0,this.t=null,this.__b=null}function Ot(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Tt(t){var e,n,i;function r(r){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,r)}return r.displayName="Lazy",r.__f=!0,r}function At(){this.u=null,this.o=null}r.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 b).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var r=Ot(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,r?r(s):s())};n.__R=a;var s=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()}},u=!0===e.__h;i.__u++||u||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(a,a)},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=vt({},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 r=e.__e&&m(y,null,t.fallback);return r&&(r.__h=null),[m(y,null,e.__e?null:t.children),r]};var Mt=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 Dt(t){return this.getChildContext=function(){return t.context},t.children}function Lt(t){var e=this,n=t.i;e.componentWillUnmount=function(){V(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)}}),V(m(Dt,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}function Rt(t,e){return m(Lt,{__v:t,i:e})}(At.prototype=new b).__e=function(t){var e=this,n=Ot(e.__v),i=e.o.get(t);return i[0]++,function(r){var o=function(){e.props.revealOrder?(i.push(r),Mt(e,t,i)):r()};n?n(o):o()}},At.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},At.prototype.componentDidUpdate=At.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Mt(t,n,e)}))};var It="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,jt=/^(?: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]/,zt="undefined"!=typeof document,Vt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};function Bt(t,e,n){return null==e.__k&&(e.textContent=""),V(t,e),"function"==typeof n&&n(),t?t.__c:null}function Ft(t,e,n){return B(t,e),"function"==typeof n&&n(),t?t.__c:null}b.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(b.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=r.event;function Nt(){}function Ht(){return this.cancelBubble}function Wt(){return this.defaultPrevented}r.event=function(t){return Ut&&(t=Ut(t)),t.persist=Nt,t.isPropagationStopped=Ht,t.isDefaultPrevented=Wt,t.nativeEvent=t};var $t,Xt={configurable:!0,get:function(){return this.class}},Yt=r.vnode;r.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var r=-1===e.indexOf("-");for(var o in i={},n){var a=n[o];zt&&"children"===o&&"noscript"===e||"value"===o&&"defaultValue"in n&&null==a||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===a?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+e)&&!Vt(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():r&&jt.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),i[o]=a)}"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&&(Xt.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Xt))}t.$$typeof=It,Yt&&Yt(t)};var Gt=r.__r;r.__r=function(t){Gt&&Gt(t),$t=t.__c};var qt={ReactCurrentDispatcher:{current:{readContext:function(t){return $t.__n[t.__c].props.value}}}},Zt="17.0.2";function Kt(t){return m.bind(null,t)}function Jt(t){return!!t&&t.$$typeof===It}function Qt(t){return Jt(t)?F.apply(null,arguments):t}function te(t){return!!t.__k&&(V(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)},re=y;e.default={useState:Q,useReducer:tt,useEffect:et,useLayoutEffect:nt,useRef:it,useImperativeHandle:rt,useMemo:ot,useCallback:at,useContext:st,useDebugValue:ut,version:"17.0.2",Children:St,render:Bt,hydrate:Ft,unmountComponentAtNode:te,createPortal:Rt,createElement:m,createContext:U,createFactory:Kt,cloneElement:Qt,createRef:g,Fragment:y,isValidElement:Jt,findDOMNode:ee,Component:b,PureComponent:yt,memo:bt,forwardRef:Ct,flushSync:ie,unstable_batchedUpdates:ne,StrictMode:y,Suspense:kt,SuspenseList:At,lazy:Tt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qt}},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,r){return new i(r*(t.x-e),r*(t.y-n))}static scaleListToHtmlElement(t,e,n){return t.map((t=>i.scaleToHtmlElement(t,e,n)))}static scaleToHtmlElement(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,r){if(!t||!e)return new i(0,0);const o=new i(t,e);return r=null!=r?r:1,1===(n=n?n%4:0)?i.withScale(o.y,-o.x,r):2===n?i.withScale(-o.x,-o.y,r):3===n?i.withScale(-o.y,o.x,r):i.withScale(o.x,o.y,r)}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)}static centerX(t){if(t)return(i.highestX(t)+i.lowestX(t))/2}static highestX(t){if(t)return Math.max(...t.map((t=>t.x)))}static lowestX(t){if(t)return Math.min(...t.map((t=>t.x)))}static lowestY(t){if(t)return Math.min(...t.map((t=>t.y)))}static highestY(t){if(t)return Math.max(...t.map((t=>t.y)))}static width(t){if(t)return i.highestX(t)-i.lowestX(t)}static left(t){if(t)return t.reduce(((t,e)=>t.x<e.x?t:e))}static right(t){if(t)return t.reduce(((t,e)=>t.x>e.x?t:e))}static toSvgString(t){if(void 0!==t)return t.map((t=>`${t.x.toFixed(2)},${t.y.toFixed(2)}`)).join(" ")}}e.Point=i},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Size=void 0;const i=n(1);class r{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 r(t.clientWidth,t.clientHeight):new r(0,0)}static fromJson(t){return new r(t.width,t.height)}static subtractFrom(t,e){return new r(t.width-e,t.height-e)}static empty(){return new r(0,0)}}e.Size=r},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageUtils=void 0;const r=n(6),o=n(11);class a{static toDataUrl(t){return new Promise(((e,n)=>{const i=new Blob([t],{type:"image/jpeg"}),r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(i)}))}static getObjectFitSize(t,e,n=!0){const i=e.width/e.height,o=t.width/t.height;let a=0,s=0;(n?i>o:i<o)?(a=t.width,s=a/i):(s=t.height,a=s*i);const u=(t.width-a)/2,c=(t.height-s)/2;return new r.Frame(u,c,a,s)}static loadFromUrl(t){return new Promise(((e,n)=>{const r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=r.width,t.height=r.height;const n=t.getContext("2d");n.drawImage(r,0,0);const i=n.getImageData(0,0,r.width,r.height);e(i)})),r.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,o.Utils.uuid()+n+".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 a.createImageDataCanvas(a.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}}e.ImageUtils=a},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)}static fromDOMRect(t){return new i(t.x,t.y,t.width,t.height)}}e.Frame=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewUtils=void 0;const i=n(61),r=n(4),o=n(1);class a{static convertLinesToViewportLines(t,e){if(!e||!t)return;const n=[],{x:r,y:o,containerScale:a}=this.calculateScale(t);return e.forEach((t=>{n.push(i.MagneticLine.scaleToLine(t,r,o,a))})),n}static convertToViewportPointsFromParentSize(t,e){return e?r.Size.isEmpty(t)?void 0:e.map((e=>o.Point.scaleUpTo(e,t))):r.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,r=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,r=(e.height-t.height/n)/2):(n=t.height/e.height,i=(e.width-t.width/n)/2),{x:i,y:r,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",a.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",a.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=a},function(t,e,n){"use strict";n.r(e),n.d(e,"createDomMotionComponent",(function(){return Ma})),n.d(e,"motion",(function(){return Aa})),n.d(e,"m",(function(){return Da})),n.d(e,"AnimatePresence",(function(){return Va})),n.d(e,"AnimateSharedLayout",(function(){return Ga})),n.d(e,"MotionConfig",(function(){return qa})),n.d(e,"LazyMotion",(function(){return Za})),n.d(e,"domAnimation",(function(){return Ja})),n.d(e,"domMax",(function(){return Qa})),n.d(e,"useMotionValue",(function(){return ts})),n.d(e,"useMotionTemplate",(function(){return is})),n.d(e,"MotionValue",(function(){return Qi})),n.d(e,"motionValue",(function(){return tr})),n.d(e,"resolveMotionValue",(function(){return Jt})),n.d(e,"useTransform",(function(){return as})),n.d(e,"useSpring",(function(){return us})),n.d(e,"useVelocity",(function(){return cs})),n.d(e,"useElementScroll",(function(){return ms})),n.d(e,"useViewportScroll",(function(){return bs})),n.d(e,"useReducedMotion",(function(){return _s})),n.d(e,"animationControls",(function(){return ws})),n.d(e,"useAnimation",(function(){return Cs})),n.d(e,"animate",(function(){return Ba})),n.d(e,"animateVisualElement",(function(){return fr})),n.d(e,"useCycle",(function(){return Ss})),n.d(e,"transform",(function(){return os})),n.d(e,"isValidMotionProp",(function(){return At})),n.d(e,"useIsPresent",(function(){return S})),n.d(e,"usePresence",(function(){return x})),n.d(e,"DragControls",(function(){return Es})),n.d(e,"useDragControls",(function(){return ks})),n.d(e,"useDomEvent",(function(){return se})),n.d(e,"createMotionComponent",(function(){return N})),n.d(e,"addScaleCorrection",(function(){return Y})),n.d(e,"snapshotViewportBox",(function(){return io})),n.d(e,"createCrossfader",(function(){return Fa})),n.d(e,"visualElement",(function(){return sa})),n.d(e,"batchLayout",(function(){return Co})),n.d(e,"flushLayout",(function(){return xo})),n.d(e,"MotionConfigContext",(function(){return y})),n.d(e,"PresenceContext",(function(){return w})),n.d(e,"LayoutGroupContext",(function(){return T})),n.d(e,"VisibilityAction",(function(){return Ao})),n.d(e,"FramerTreeLayoutContext",(function(){return qo})),n.d(e,"SharedLayoutContext",(function(){return Go})),n.d(e,"createBatcher",(function(){return Xo})),n.d(e,"FlatTree",(function(){return aa})),n.d(e,"useDeprecatedAnimatedState",(function(){return Ms})),n.d(e,"useDeprecatedInvertedScale",(function(){return Rs}));var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)};function a(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}Object.create;function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function u(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var c=n(0),l=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},d={measureLayout:l(["layout","layoutId","drag","_layoutResetTransform"]),animation:l(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:l(["exit"]),drag:l(["drag","dragControls"]),focus:l(["whileFocus"]),hover:l(["whileHover","onHoverStart","onHoverEnd"]),tap:l(["whileTap","onTap","onTapStart","onTapCancel"]),pan:l(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:l(["layout","layoutId"])};function f(t){for(var e in t){var n=t[e];null!==n&&(d[e].Component=n)}}var h=function(){},p=function(){};var m=Object(c.createContext)({strict:!1}),v=Object.keys(d),g=v.length;var y=Object(c.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),b=Object(c.createContext)({});function _(){return Object(c.useContext)(b).visualElement}var w=Object(c.createContext)(null);function C(t){var e=Object(c.useRef)(null);return null===e.current&&(e.current=t()),e.current}function x(){var t=Object(c.useContext)(w);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,i=t.register,r=O();Object(c.useEffect)((function(){return i(r)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(r)}]:[!0]}function S(){return E(Object(c.useContext)(w))}function E(t){return null===t||t.isPresent}var P=0,k=function(){return P++},O=function(){return C(k)},T=Object(c.createContext)(null),A="undefined"!=typeof window,M=A?c.useLayoutEffect:c.useEffect;function D(t,e,n,i){var r=Object(c.useContext)(y),a=Object(c.useContext)(m),s=_(),u=Object(c.useContext)(w),l=function(t){var e=t.layoutId,n=Object(c.useContext)(T);return n&&void 0!==e?n+"-"+e:e}(n),d=Object(c.useRef)(void 0);i||(i=a.renderer),!d.current&&i&&(d.current=i(t,{visualState:e,parent:s,props:o(o({},n),{layoutId:l}),presenceId:null==u?void 0:u.id,blockInitialAnimation:!1===(null==u?void 0:u.initial)}));var f=d.current;return M((function(){f&&(f.setProps(o(o(o({},r),n),{layoutId:l})),f.isPresent=E(u),f.isPresenceRoot=!s||s.presenceId!==(null==u?void 0:u.id),f.syncRender())})),Object(c.useEffect)((function(){var t;f&&(null===(t=f.animationState)||void 0===t||t.animateChanges())})),M((function(){return function(){return null==f?void 0:f.notifyUnmount()}}),[]),f}function L(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function R(t){return Array.isArray(t)}function I(t){return"string"==typeof t||R(t)}function j(t,e,n,i,r){var o;return void 0===i&&(i={}),void 0===r&&(r={}),"string"==typeof e&&(e=null===(o=t.variants)||void 0===o?void 0:o[e]),"function"==typeof e?e(null!=n?n:t.custom,i,r):e}function z(t,e,n){var i=t.getProps();return j(i,e,null!=n?n:i.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function V(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||I(t.initial)||I(t.animate)||I(t.whileHover)||I(t.whileDrag)||I(t.whileTap)||I(t.whileFocus)||I(t.exit)}function B(t){return Boolean(V(t)||t.variants)}function F(t,e){var n=function(t,e){if(V(t)){var n=t.initial,i=t.animate;return{initial:!1===n||I(n)?n:void 0,animate:I(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,Object(c.useContext)(b)),i=n.initial,r=n.animate;return Object(c.useMemo)((function(){return{initial:i,animate:r}}),e?[U(i),U(r)]:[])}function U(t){return Array.isArray(t)?t.join(" "):t}function N(t){var e=t.preloadedFeatures,n=t.createVisualElement,i=t.useRender,r=t.useVisualState,a=t.Component;return e&&f(e),Object(c.forwardRef)((function(t,e){var s=Object(c.useContext)(y).isStatic,u=null,l=F(t,s),f=r(t,s);return!s&&A&&(l.visualElement=D(a,f,t,n),u=function(t,e,n){var i=[];if(Object(c.useContext)(m),!e)return null;for(var r=0;r<g;r++){var a=v[r],s=d[a],u=s.isEnabled,l=s.Component;u(t)&&l&&i.push(c.createElement(l,o({key:a},t,{visualElement:e})))}return i}(t,l.visualElement)),c.createElement(c.Fragment,null,c.createElement(b.Provider,{value:l},i(a,t,function(t,e,n){return Object(c.useCallback)((function(i){var r;i&&(null===(r=t.mount)||void 0===r||r.call(t,i)),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):L(n)&&(n.current=i))}),[e])}(f,l.visualElement,e),f,s)),u)}))}function H(t){function e(e,n){return void 0===n&&(n={}),N(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,i){return n.has(i)||n.set(i,e(i)),n.get(i)}})}var W=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function $(t){return"string"==typeof t&&!t.includes("-")&&!!(W.indexOf(t)>-1||/[A-Z]/.test(t))}var X={};function Y(t){for(var e in t)X[e]=t[e]}var G=["","X","Y","Z"],q=["transformPerspective","x","y","z"];function Z(t,e){return q.indexOf(t)-q.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return G.forEach((function(e){return q.push(t+e)}))}));var K=new Set(q);function J(t){return K.has(t)}var Q=new Set(["originX","originY","originZ"]);function tt(t){return Q.has(t)}function et(t,e){var n=e.layout,i=e.layoutId;return J(t)||tt(t)||(n||void 0!==i)&&(!!X[t]||"opacity"===t)}var nt=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},it={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function rt(t){return t.startsWith("--")}var ot=function(t,e){return e&&"number"==typeof t?e.transform(t):t},at=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},st=function(t){return t%1?Number(t.toFixed(5)):t},ut=/(-)?([\d]*\.?[\d])+/g,ct=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,lt=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function dt(t){return"string"==typeof t}var ft=function(t){return{test:function(e){return dt(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},ht=ft("deg"),pt=ft("%"),mt=ft("px"),vt=ft("vh"),gt=ft("vw"),yt=o(o({},pt),{parse:function(t){return pt.parse(t)/100},transform:function(t){return pt.transform(100*t)}}),bt={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},_t=o(o({},bt),{transform:at(0,1)}),wt=o(o({},bt),{default:1}),Ct=o(o({},bt),{transform:Math.round}),xt={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,radius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,size:mt,top:mt,right:mt,bottom:mt,left:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,rotate:ht,rotateX:ht,rotateY:ht,rotateZ:ht,scale:wt,scaleX:wt,scaleY:wt,scaleZ:wt,skew:ht,skewX:ht,skewY:ht,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:_t,originX:yt,originY:yt,originZ:mt,zIndex:Ct,fillOpacity:_t,strokeOpacity:_t,numOctaves:Ct};function St(t,e,n,i,r,o,a,s){var u,c=t.style,l=t.vars,d=t.transform,f=t.transformKeys,h=t.transformOrigin;f.length=0;var p=!1,m=!1,v=!0;for(var g in e){var y=e[g];if(rt(g))l[g]=y;else{var b=xt[g],_=ot(y,b);if(J(g)){if(p=!0,d[g]=_,f.push(g),!v)continue;y!==(null!==(u=b.default)&&void 0!==u?u:0)&&(v=!1)}else if(tt(g))h[g]=_,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&X[g]){var w=X[g].process(y,i,n),C=X[g].applyTo;if(C)for(var x=C.length,S=0;S<x;S++)c[C[S]]=w;else c[g]=w}else c[g]=_}}i&&n&&a&&s?(c.transform=a(i.deltaFinal,i.treeScale,p?d:void 0),o&&(c.transform=o(d,c.transform)),c.transformOrigin=s(i)):(p&&(c.transform=function(t,e,n,i){var r=t.transform,o=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,u=e.allowTransformNone,c=void 0===u||u,l="";o.sort(Z);for(var d=!1,f=o.length,h=0;h<f;h++){var p=o[h];l+=(it[p]||p)+"("+r[p]+") ","z"===p&&(d=!0)}return!d&&s?l+="translateZ(0)":l=l.trim(),i?l=i(r,n?"":l):c&&n&&(l="none"),l}(t,r,v,o)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,i=t.originY,r=void 0===i?"50%":i,o=t.originZ;return n+" "+r+" "+(void 0===o?0:o)}(h)))}var Et=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Pt(t,e,n){for(var i in e)nt(e[i])||et(i,n)||(t[i]=e[i])}function kt(t,e,n){var i={};return Pt(i,t.style||{},t),Object.assign(i,function(t,e,n){var i=t.transformTemplate;return Object(c.useMemo)((function(){var t=Et();St(t,e,void 0,void 0,{enableHardwareAcceleration:!n},i);var r=t.vars,a=t.style;return o(o({},r),a)}),[e])}(t,e,n)),t.transformValues&&(i=t.transformValues(i)),i}function Ot(t,e,n){var i={},r=kt(t,e,n);return Boolean(t.drag)&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),i.style=r,i}var Tt=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function At(t){return Tt.has(t)}var Mt=function(t){return!At(t)};try{var Dt=n(18).default;Mt=function(t){return t.startsWith("on")?!At(t):Dt(t)}}catch(t){}function Lt(t,e,n){return"string"==typeof t?t:mt.transform(e+n*t)}var Rt=function(t,e){return mt.transform(t*e)},It={offset:"stroke-dashoffset",array:"stroke-dasharray"},jt={offset:"strokeDashoffset",array:"strokeDasharray"};function zt(t,e,n,i,r,o,s,u){var c=e.attrX,l=e.attrY,d=e.originX,f=e.originY,h=e.pathLength,p=e.pathSpacing,m=void 0===p?1:p,v=e.pathOffset,g=void 0===v?0:v;St(t,a(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,r,o,s,u),t.attrs=t.style,t.style={};var y=t.attrs,b=t.style,_=t.dimensions,w=t.totalPathLength;y.transform&&(_&&(b.transform=y.transform),delete y.transform),_&&(void 0!==d||void 0!==f||b.transform)&&(b.transformOrigin=function(t,e,n){return Lt(e,t.x,t.width)+" "+Lt(n,t.y,t.height)}(_,void 0!==d?d:.5,void 0!==f?f:.5)),void 0!==c&&(y.x=c),void 0!==l&&(y.y=l),void 0!==w&&void 0!==h&&function(t,e,n,i,r,o){void 0===i&&(i=1),void 0===r&&(r=0),void 0===o&&(o=!0);var a=o?It:jt;t[a.offset]=Rt(-r,e);var s=Rt(n,e),u=Rt(i,e);t[a.array]=s+" "+u}(y,w,h,m,g,!1)}var Vt=function(){return o(o({},Et()),{attrs:{}})};function Bt(t,e){var n=Object(c.useMemo)((function(){var n=Vt();return zt(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),o(o({},n.attrs),{style:o({},n.style)})}),[e]);if(t.style){var i={};Pt(i,t.style,t),n.style=o(o({},i),n.style)}return n}function Ft(t){void 0===t&&(t=!1);return function(e,n,i,r,a){var s=r.latestValues,u=($(e)?Bt:Ot)(n,s,a),l=function(t,e,n){var i={};for(var r in t)(Mt(r)||!0===n&&At(r)||!e&&!At(r))&&(i[r]=t[r]);return i}(n,"string"==typeof e,t),d=o(o(o({},l),u),{ref:i});return Object(c.createElement)(e,d)}}var Ut=/([a-z])([A-Z])/g,Nt=function(t){return t.replace(Ut,"$1-$2").toLowerCase()};function Ht(t,e){var n=e.style,i=e.vars;for(var r in Object.assign(t.style,n),i)t.style.setProperty(r,i[r])}var Wt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function $t(t,e){for(var n in Ht(t,e),e.attrs)t.setAttribute(Wt.has(n)?n:Nt(n),e.attrs[n])}function Xt(t){var e=t.style,n={};for(var i in e)(nt(e[i])||et(i,t))&&(n[i]=e[i]);return n}function Yt(t){var e=Xt(t);for(var n in t){if(nt(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Gt(t){return"object"==typeof t&&"function"==typeof t.start}var qt=function(t){return Array.isArray(t)},Zt=function(t){return Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)},Kt=function(t){return qt(t)?t[t.length-1]||0:t};function Jt(t){var e=nt(t)?t.get():t;return Zt(e)?e.toValue():e}function Qt(t,e,n,i){var r=t.scrapeMotionValuesFromProps,o=t.createRenderState,a=t.onMount,s={latestValues:ee(e,n,i,r),renderState:o()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var te=function(t){return function(e,n){var i=Object(c.useContext)(b),r=Object(c.useContext)(w);return n?Qt(t,e,i,r):C((function(){return Qt(t,e,i,r)}))}};function ee(t,e,n,i){var r={},o=!1===(null==n?void 0:n.initial),s=i(t);for(var u in s)r[u]=Jt(s[u]);var c=t.initial,l=t.animate,d=V(t),f=B(t);e&&f&&!d&&!1!==t.inherit&&(null!=c||(c=e.initial),null!=l||(l=e.animate));var h=o||!1===c?l:c;h&&"boolean"!=typeof h&&!Gt(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=j(t,e);if(n){var i=n.transitionEnd;n.transition;var o=a(n,["transitionEnd","transition"]);for(var s in o)r[s]=o[s];for(var s in i)r[s]=i[s]}}));return r}var ne={useVisualState:te({scrapeMotionValuesFromProps:Yt,createRenderState:Vt,onMount:function(t,e,n){var i=n.renderState,r=n.latestValues;try{i.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){i.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(i.totalPathLength=e.getTotalLength()),zt(i,r,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),$t(e,i)}})};var ie,re={useVisualState:te({scrapeMotionValuesFromProps:Xt,createRenderState:Et})};function oe(t,e,n,i){var r=e.forwardMotionProps,a=void 0!==r&&r,s=$(t)?ne:re;return o(o({},s),{preloadedFeatures:n,useRender:Ft(a),createVisualElement:i,Component:t})}function ae(t,e,n,i){return t.addEventListener(e,n,i),function(){return t.removeEventListener(e,n,i)}}function se(t,e,n,i){Object(c.useEffect)((function(){var r=t.current;if(n&&r)return ae(r,e,n,i)}),[t,e,n,i])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function ce(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(ie||(ie={}));var le={pageX:0,pageY:0};function de(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||le;return{x:n[e+"X"],y:n[e+"Y"]}}function fe(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function he(t,e){return void 0===e&&(e="page"),{point:ce(t)?de(t,e):fe(t,e)}}var pe=function(t,e){void 0===e&&(e=!1);var n,i=function(e){return t(e,he(e))};return e?(n=i,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):i},me=function(){return A&&null===window.onpointerdown},ve=function(){return A&&null===window.ontouchstart},ge=function(){return A&&null===window.onmousedown},ye={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},be={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function _e(t){return me()?t:ve()?be[t]:ge()?ye[t]:t}function we(t,e,n,i){return ae(t,_e(e),pe(n,"pointerdown"===e),i)}function Ce(t,e,n,i){return se(t,_e(e),n&&pe(n,"pointerdown"===e),i)}function xe(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var Se=xe("dragHorizontal"),Ee=xe("dragVertical");function Pe(t){var e=!1;if("y"===t)e=Ee();else if("x"===t)e=Se();else{var n=Se(),i=Ee();n&&i?e=function(){n(),i()}:(n&&n(),i&&i())}return e}function ke(){var t=Pe(!0);return!t||(t(),!1)}function Oe(t,e,n){return function(i,r){var o;ue(i)&&!ke()&&(null==n||n(i,r),null===(o=t.animationState)||void 0===o||o.setActive(ie.Hover,e))}}var Te=function(t,e){return!!e&&(t===e||Te(t,e.parentElement))};function Ae(t){return Object(c.useEffect)((function(){return function(){return t()}}),[])}var Me=function(t,e){return function(n){return e(t(n))}},De=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Me)};var Le=function(t){return function(e){return t(e),null}},Re={tap:Le((function(t){var e=t.onTap,n=t.onTapStart,i=t.onTapCancel,r=t.whileTap,o=t.visualElement,a=e||n||i||r,s=Object(c.useRef)(!1),u=Object(c.useRef)(null);function l(){var t;null===(t=u.current)||void 0===t||t.call(u),u.current=null}function d(){var t;return l(),s.current=!1,null===(t=o.animationState)||void 0===t||t.setActive(ie.Tap,!1),!ke()}function f(t,n){d()&&(Te(o.getInstance(),t.target)?null==e||e(t,n):null==i||i(t,n))}function h(t,e){d()&&(null==i||i(t,e))}Ce(o,"pointerdown",a?function(t,e){var i;l(),s.current||(s.current=!0,u.current=De(we(window,"pointerup",f),we(window,"pointercancel",h)),null==n||n(t,e),null===(i=o.animationState)||void 0===i||i.setActive(ie.Tap,!0))}:void 0),Ae(l)})),focus:Le((function(t){var e=t.whileFocus,n=t.visualElement;se(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(ie.Focus,!0)}:void 0),se(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(ie.Focus,!1)}:void 0)})),hover:Le((function(t){var e=t.onHoverStart,n=t.onHoverEnd,i=t.whileHover,r=t.visualElement;Ce(r,"pointerenter",e||i?Oe(r,!0,e):void 0),Ce(r,"pointerleave",n||i?Oe(r,!1,n):void 0)}))};function Ie(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}var je=function(t,e,n){return Math.min(Math.max(n,t),e)},ze=.001,Ve=.01,Be=10,Fe=.05,Ue=1;function Ne(t){var e,n,i=t.duration,r=void 0===i?800:i,o=t.bounce,a=void 0===o?.25:o,s=t.velocity,u=void 0===s?0:s,c=t.mass,l=void 0===c?1:c;h(r<=1e3*Be,"Spring duration must be 10 seconds or less");var d=1-a;d=je(Fe,Ue,d),r=je(Ve,Be,r/1e3),d<1?(e=function(t){var e=t*d,n=e*r,i=e-u,o=We(t,d),a=Math.exp(-n);return ze-i/o*a},n=function(t){var n=t*d*r,i=n*u+u,o=Math.pow(d,2)*Math.pow(t,2)*r,a=Math.exp(-n),s=We(Math.pow(t,2),d);return(-e(t)+ze>0?-1:1)*((i-o)*a)/s}):(e=function(t){return Math.exp(-t*r)*((t-u)*r+1)-ze},n=function(t){return Math.exp(-t*r)*(r*r*(u-t))});var f=function(t,e,n){for(var i=n,r=1;r<He;r++)i-=t(i)/e(i);return i}(e,n,5/r);if(r*=1e3,isNaN(f))return{stiffness:100,damping:10,duration:r};var p=Math.pow(f,2)*l;return{stiffness:p,damping:2*d*Math.sqrt(l*p),duration:r}}var He=12;function We(t,e){return t*Math.sqrt(1-e*e)}var $e=["duration","bounce"],Xe=["stiffness","damping","mass"];function Ye(t,e){return e.some((function(e){return void 0!==t[e]}))}function Ge(t){var e=t.from,n=void 0===e?0:e,i=t.to,r=void 0===i?1:i,s=t.restSpeed,u=void 0===s?2:s,c=t.restDelta,l=a(t,["from","to","restSpeed","restDelta"]),d={done:!1,value:n},f=function(t){var e=o({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Ye(t,Xe)&&Ye(t,$e)){var n=Ne(t);(e=o(o(o({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),h=f.stiffness,p=f.damping,m=f.mass,v=f.velocity,g=f.duration,y=f.isResolvedFromDuration,b=qe,_=qe;function w(){var t=v?-v/1e3:0,e=r-n,i=p/(2*Math.sqrt(h*m)),o=Math.sqrt(h/m)/1e3;if(null!=c||(c=Math.abs(r-n)<=1?.01:.4),i<1){var a=We(o,i);b=function(n){var s=Math.exp(-i*o*n);return r-s*((t+i*o*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},_=function(n){var r=Math.exp(-i*o*n);return i*o*r*(Math.sin(a*n)*(t+i*o*e)/a+e*Math.cos(a*n))-r*(Math.cos(a*n)*(t+i*o*e)-a*e*Math.sin(a*n))}}else if(1===i)b=function(n){return r-Math.exp(-o*n)*(e+(t+o*e)*n)};else{var s=o*Math.sqrt(i*i-1);b=function(n){var a=Math.exp(-i*o*n),u=Math.min(s*n,300);return r-a*((t+i*o*e)*Math.sinh(u)+s*e*Math.cosh(u))/s}}}return w(),{next:function(t){var e=b(t);if(y)d.done=t>=g;else{var n=1e3*_(t),i=Math.abs(n)<=u,o=Math.abs(r-e)<=c;d.done=i&&o}return d.value=d.done?r:e,d},flipTarget:function(){var t;v=-v,n=(t=[r,n])[0],r=t[1],w()}}}Ge.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var qe=function(t){return 0},Ze=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},Ke=function(t,e,n){return-n*t+n*e+t},Je=function(t,e){return function(n){return Boolean(dt(n)&&lt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Qe=function(t,e,n){return function(i){var r;if(!dt(i))return i;var o=i.match(ut),a=o[0],s=o[1],u=o[2],c=o[3];return(r={})[t]=parseFloat(a),r[e]=parseFloat(s),r[n]=parseFloat(u),r.alpha=void 0!==c?parseFloat(c):1,r}},tn=at(0,255),en=o(o({},bt),{transform:function(t){return Math.round(tn(t))}}),nn={test:Je("rgb","red"),parse:Qe("red","green","blue"),transform:function(t){var e=t.red,n=t.green,i=t.blue,r=t.alpha,o=void 0===r?1:r;return"rgba("+en.transform(e)+", "+en.transform(n)+", "+en.transform(i)+", "+st(_t.transform(o))+")"}};var rn={test:Je("#"),parse:function(t){var e="",n="",i="",r="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),i=t.substr(5,2),r=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),i=t.substr(3,1),r=t.substr(4,1),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:nn.transform},on={test:Je("hsl","hue"),parse:Qe("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,i=t.lightness,r=t.alpha,o=void 0===r?1:r;return"hsla("+Math.round(e)+", "+pt.transform(st(n))+", "+pt.transform(st(i))+", "+st(_t.transform(o))+")"}},an=function(t,e,n){var i=t*t,r=e*e;return Math.sqrt(Math.max(0,n*(r-i)+i))},sn=[rn,nn,on],un=function(t){return sn.find((function(e){return e.test(t)}))},cn=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},ln=function(t,e){var n=un(t),i=un(e);p(!!n,cn(t)),p(!!i,cn(e)),p(n.transform===i.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var r=n.parse(t),a=i.parse(e),s=o({},r),u=n===on?Ke:an;return function(t){for(var e in s)"alpha"!==e&&(s[e]=u(r[e],a[e],t));return s.alpha=Ke(r.alpha,a.alpha,t),n.transform(s)}},dn={test:function(t){return nn.test(t)||rn.test(t)||on.test(t)},parse:function(t){return nn.test(t)?nn.parse(t):on.test(t)?on.parse(t):rn.parse(t)},transform:function(t){return dt(t)?t:t.hasOwnProperty("red")?nn.transform(t):on.transform(t)}},fn="${c}",hn="${n}";function pn(t){var e=[],n=0,i=t.match(ct);i&&(n=i.length,t=t.replace(ct,fn),e.push.apply(e,i.map(dn.parse)));var r=t.match(ut);return r&&(t=t.replace(ut,hn),e.push.apply(e,r.map(bt.parse))),{values:e,numColors:n,tokenised:t}}function mn(t){return pn(t).values}function vn(t){var e=pn(t),n=e.values,i=e.numColors,r=e.tokenised,o=n.length;return function(t){for(var e=r,n=0;n<o;n++)e=e.replace(n<i?fn:hn,n<i?dn.transform(t[n]):st(t[n]));return e}}var gn=function(t){return"number"==typeof t?0:t};var yn={test:function(t){var e,n,i,r;return isNaN(t)&&dt(t)&&(null!==(n=null===(e=t.match(ut))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(r=null===(i=t.match(ct))||void 0===i?void 0:i.length)&&void 0!==r?r:0)>0},parse:mn,createTransformer:vn,getAnimatableNone:function(t){var e=mn(t);return vn(t)(e.map(gn))}},bn=function(t){return"number"==typeof t};function _n(t,e){return bn(t)?function(n){return Ke(t,e,n)}:dn.test(t)?ln(t,e):Sn(t,e)}var wn=function(t,e){var n=u([],t),i=n.length,r=t.map((function(t,n){return _n(t,e[n])}));return function(t){for(var e=0;e<i;e++)n[e]=r[e](t);return n}},Cn=function(t,e){var n=o(o({},t),e),i={};for(var r in n)void 0!==t[r]&&void 0!==e[r]&&(i[r]=_n(t[r],e[r]));return function(t){for(var e in i)n[e]=i[e](t);return n}};function xn(t){for(var e=yn.parse(t),n=e.length,i=0,r=0,o=0,a=0;a<n;a++)i||"number"==typeof e[a]?i++:void 0!==e[a].hue?o++:r++;return{parsed:e,numNumbers:i,numRGB:r,numHSL:o}}var Sn=function(t,e){var n=yn.createTransformer(e),i=xn(t),r=xn(e);return p(i.numHSL===r.numHSL&&i.numRGB===r.numRGB&&i.numNumbers>=r.numNumbers,"Complex values '"+t+"' and '"+e+"' too different to mix. Ensure all colors are of the same type."),De(wn(i.parsed,r.parsed),n)},En=function(t,e){return function(n){return Ke(t,e,n)}};function Pn(t,e,n){for(var i,r=[],o=n||("number"==typeof(i=t[0])?En:"string"==typeof i?dn.test(i)?ln:Sn:Array.isArray(i)?wn:"object"==typeof i?Cn:void 0),a=t.length-1,s=0;s<a;s++){var u=o(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;u=De(c,u)}r.push(u)}return r}function kn(t,e,n){var i=void 0===n?{}:n,r=i.clamp,o=void 0===r||r,a=i.ease,s=i.mixer,u=t.length;p(u===e.length,"Both input and output ranges must be the same length"),p(!a||!Array.isArray(a)||a.length===u-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[u-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=Pn(e,a,s),l=2===u?function(t,e){var n=t[0],i=t[1],r=e[0];return function(t){return r(Ze(n,i,t))}}(t,c):function(t,e){var n=t.length,i=n-1;return function(r){var o=0,a=!1;if(r<=t[0]?a=!0:r>=t[i]&&(o=i-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>r||s===i);s++);o=s-1}var u=Ze(t[o],t[o+1],r);return e[o](u)}}(t,c);return o?function(e){return l(je(t[0],t[u-1],e))}:l}var On,Tn=function(t){return function(e){return 1-t(1-e)}},An=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},Mn=function(t){return function(e){return e*e*((t+1)*e-t)}},Dn=function(t){return t},Ln=(On=2,function(t){return Math.pow(t,On)}),Rn=Tn(Ln),In=An(Ln),jn=function(t){return 1-Math.sin(Math.acos(t))},zn=Tn(jn),Vn=An(zn),Bn=Mn(1.525),Fn=Tn(Bn),Un=An(Bn),Nn=function(t){var e=Mn(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),Hn=function(t){if(1===t||0===t)return t;var e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Wn=Tn(Hn);function $n(t,e){return t.map((function(){return e||In})).splice(0,t.length-1)}function Xn(t){var e=t.from,n=void 0===e?0:e,i=t.to,r=void 0===i?1:i,o=t.ease,a=t.offset,s=t.duration,u=void 0===s?300:s,c={done:!1,value:n},l=Array.isArray(r)?r:[n,r],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===l.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(l),u);function f(){return kn(d,l,{ease:Array.isArray(o)?o:$n(l,o)})}var h=f();return{next:function(t){return c.value=h(t),c.done=t>=u,c},flipTarget:function(){l.reverse(),h=f()}}}var Yn={keyframes:Xn,spring:Ge,decay:function(t){var e=t.velocity,n=void 0===e?0:e,i=t.from,r=void 0===i?0:i,o=t.power,a=void 0===o?.8:o,s=t.timeConstant,u=void 0===s?350:s,c=t.restDelta,l=void 0===c?.5:c,d=t.modifyTarget,f={done:!1,value:r},h=a*n,p=r+h,m=void 0===d?p:d(p);return m!==p&&(h=m-r),{next:function(t){var e=-h*Math.exp(-t/u);return f.done=!(e>l||e<-l),f.value=f.done?m:m+e,f},flipTarget:function(){}}}};var Gn=1/60*1e3,qn="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Zn="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(qn())}),Gn)};var Kn=!0,Jn=!1,Qn=!1,ti={delta:0,timestamp:0},ei=["read","update","preRender","render","postRender"],ni=ei.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],i=0,r=!1,o=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var u=s&&r,c=u?e:n;return a&&o.add(t),-1===c.indexOf(t)&&(c.push(t),u&&r&&(i=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),o.delete(t)},process:function(s){var u;if(r=!0,e=(u=[n,e])[0],(n=u[1]).length=0,i=e.length)for(var c=0;c<i;c++){var l=e[c];l(s),o.has(l)&&(a.schedule(l),t())}r=!1}};return a}((function(){return Jn=!0})),t}),{}),ii=ei.reduce((function(t,e){var n=ni[e];return t[e]=function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),Jn||ui(),n.schedule(t,e,i)},t}),{}),ri=ei.reduce((function(t,e){return t[e]=ni[e].cancel,t}),{}),oi=ei.reduce((function(t,e){return t[e]=function(){return ni[e].process(ti)},t}),{}),ai=function(t){return ni[t].process(ti)},si=function(t){Jn=!1,ti.delta=Kn?Gn:Math.max(Math.min(t-ti.timestamp,40),1),ti.timestamp=t,Qn=!0,ei.forEach(ai),Qn=!1,Jn&&(Kn=!1,Zn(si))},ui=function(){Jn=!0,Kn=!0,Qn||Zn(si)},ci=function(){return ti},li=ii;function di(t,e,n){return void 0===n&&(n=0),t-e-n}var fi=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return li.update(e,!0)},stop:function(){return ri.update(e)}}};function hi(t){var e,n,i,r,s,u=t.from,c=t.autoplay,l=void 0===c||c,d=t.driver,f=void 0===d?fi:d,h=t.elapsed,p=void 0===h?0:h,m=t.repeat,v=void 0===m?0:m,g=t.repeatType,y=void 0===g?"loop":g,b=t.repeatDelay,_=void 0===b?0:b,w=t.onPlay,C=t.onStop,x=t.onComplete,S=t.onRepeat,E=t.onUpdate,P=a(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),k=P.to,O=0,T=P.duration,A=!1,M=!0,D=function(t){if(Array.isArray(t.to))return Xn;if(Yn[t.type])return Yn[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Xn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ge:Xn}(P);(null===(n=(e=D).needsInterpolation)||void 0===n?void 0:n.call(e,u,k))&&(s=kn([0,100],[u,k],{clamp:!1}),u=0,k=100);var L=D(o(o({},P),{from:u,to:k}));function R(){O++,"reverse"===y?p=function(t,e,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?di(e+-t,e,n):e-(t-e)+n}(p,T,_,M=O%2==0):(p=di(p,T,_),"mirror"===y&&L.flipTarget()),A=!1,S&&S()}function I(t){if(M||(t=-t),p+=t,!A){var e=L.next(Math.max(0,p));r=e.value,s&&(r=s(r)),A=M?e.done:p<=0}null==E||E(r),A&&(0===O&&(null!=T||(T=p)),O<v?function(t,e,n,i){return i?t>=e+n:t<=-n}(p,T,_,M)&&R():(i.stop(),x&&x()))}return l&&(null==w||w(),(i=f(I)).start()),{stop:function(){null==C||C(),i.stop()}}}function pi(t,e){return e?t*(1e3/e):0}var mi=function(t){return 1e3*t},vi=function(t,e){return 1-3*e+3*t},gi=function(t,e){return 3*e-6*t},yi=function(t){return 3*t},bi=function(t,e,n){return((vi(e,n)*t+gi(e,n))*t+yi(e))*t},_i=function(t,e,n){return 3*vi(e,n)*t*t+2*gi(e,n)*t+yi(e)},wi=1e-7,Ci=10;var xi=8;var Si=.1;function Ei(t,e,n,i){if(t===e&&n===i)return Dn;for(var r=new Float32Array(11),o=0;o<11;++o)r[o]=bi(o*Si,t,n);function a(e){for(var i=0,o=1;10!==o&&r[o]<=e;++o)i+=Si;--o;var a=i+(e-r[o])/(r[o+1]-r[o])*Si,s=_i(a,t,n);return s>=.001?function(t,e,n,i){for(var r=0;r<xi;++r){var o=_i(e,n,i);if(0===o)return e;e-=(bi(e,n,i)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,i,r){var o,a,s=0;do{(o=bi(a=e+(n-e)/2,i,r)-t)>0?n=a:e=a}while(Math.abs(o)>wi&&++s<Ci);return a}(e,i,i+Si,t,n)}return function(t){return 0===t||1===t?t:bi(a(t),e,i)}}var Pi={linear:Dn,easeIn:Ln,easeInOut:In,easeOut:Rn,circIn:jn,circInOut:Vn,circOut:zn,backIn:Bn,backInOut:Un,backOut:Fn,anticipate:Nn,bounceIn:Wn,bounceInOut:function(t){return t<.5?.5*(1-Hn(1-2*t)):.5*Hn(2*t-1)+.5},bounceOut:Hn},ki=function(t){if(Array.isArray(t)){p(4===t.length,"Cubic bezier arrays must contain four numerical values.");var e=s(t,4);return Ei(e[0],e[1],e[2],e[3])}return"string"==typeof t?(p(void 0!==Pi[t],"Invalid easing type '"+t+"'"),Pi[t]):t},Oi=function(t){return Array.isArray(t)&&"number"!=typeof t[0]},Ti=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!yn.test(e)||e.startsWith("url(")))},Ai=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Mi=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Di=function(){return{type:"keyframes",ease:"linear",duration:.3}},Li=function(t){return{type:"keyframes",duration:.8,values:t}},Ri={x:Ai,y:Ai,z:Ai,rotate:Ai,rotateX:Ai,rotateY:Ai,rotateZ:Ai,scaleX:Mi,scaleY:Mi,scale:Mi,opacity:Di,backgroundColor:Di,color:Di,default:Mi},Ii=function(t,e){var n;return n=qt(e)?Li:Ri[t]||Ri.default,o({to:e},n(e))},ji=new Set(["brightness","contrast","saturate","opacity"]);function zi(t){var e=t.slice(0,-1).split("("),n=e[0],i=e[1];if("drop-shadow"===n)return t;var r=(i.match(ut)||[])[0];if(!r)return t;var o=i.replace(r,""),a=ji.has(n)?1:0;return r!==i&&(a*=100),n+"("+a+o+")"}var Vi=/([a-z-]*)\(.*?\)/g,Bi=o(o({},yn),{getAnimatableNone:function(t){var e=t.match(Vi);return e?e.map(zi).join(" "):t}}),Fi=o(o({},xt),{color:dn,backgroundColor:dn,outlineColor:dn,fill:dn,stroke:dn,borderColor:dn,borderTopColor:dn,borderRightColor:dn,borderBottomColor:dn,borderLeftColor:dn,filter:Bi,WebkitFilter:Bi}),Ui=function(t){return Fi[t]};function Ni(t,e){var n,i=Ui(t);return i!==Bi&&(i=yn),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}var Hi=!1;function Wi(t,e,n){var i;return Array.isArray(e.to)&&(null!==(i=t.duration)&&void 0!==i||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=u([],s(t.to)),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=a(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=o(o({},t),Ii(n,e.to))),o(o({},e),function(t){var e=t.ease,n=t.times,i=t.yoyo,r=t.flip,s=t.loop,u=a(t,["ease","times","yoyo","flip","loop"]),c=o({},u);return n&&(c.offset=n),u.duration&&(c.duration=mi(u.duration)),u.repeatDelay&&(c.repeatDelay=mi(u.repeatDelay)),e&&(c.ease=Oi(e)?e.map(ki):ki(e)),"tween"===u.type&&(c.type="keyframes"),(i||s||r)&&(h(!Hi,"yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."),Hi=!0,i?c.repeatType="reverse":s?c.repeatType="loop":r&&(c.repeatType="mirror"),c.repeat=s||i||r||u.repeat),"spring"!==u.type&&(c.type="keyframes"),c}(t))}function $i(t,e,n,i,r){var a,s=Gi(i,t),u=null!==(a=s.from)&&void 0!==a?a:e.get(),c=Ti(t,n);"none"===u&&c&&"string"==typeof n?u=Ni(t,n):Xi(u)&&"string"==typeof n?u=Yi(n):!Array.isArray(n)&&Xi(n)&&"string"==typeof u&&(n=Yi(u));var l=Ti(t,u);return h(l===c,"You are trying to animate "+t+' from "'+u+'" to "'+n+'". '+u+" is not an animatable value - to enable this animation set "+u+" to a value animatable to "+n+" via the `style` property."),l&&c&&!1!==s.type?function(){var i={from:u,to:n,velocity:e.getVelocity(),onComplete:r,onUpdate:function(t){return e.set(t)}};return"inertia"===s.type||"decay"===s.type?function(t){var e,n=t.from,i=void 0===n?0:n,r=t.velocity,a=void 0===r?0:r,s=t.min,u=t.max,c=t.power,l=void 0===c?.8:c,d=t.timeConstant,f=void 0===d?750:d,h=t.bounceStiffness,p=void 0===h?500:h,m=t.bounceDamping,v=void 0===m?10:m,g=t.restDelta,y=void 0===g?1:g,b=t.modifyTarget,_=t.driver,w=t.onUpdate,C=t.onComplete;function x(t){return void 0!==s&&t<s||void 0!==u&&t>u}function S(t){return void 0===s?u:void 0===u||Math.abs(s-t)<Math.abs(u-t)?s:u}function E(t){null==e||e.stop(),e=hi(o(o({},t),{driver:_,onUpdate:function(e){var n;null==w||w(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:C}))}function P(t){E(o({type:"spring",stiffness:p,damping:v,restDelta:y},t))}if(x(i))P({from:i,velocity:a,to:S(i)});else{var k=l*a+i;"undefined"!=typeof b&&(k=b(k));var O,T,A=S(k),M=A===s?-1:1;E({type:"decay",from:i,velocity:a,timeConstant:f,power:l,restDelta:y,modifyTarget:b,onUpdate:x(k)?function(t){O=T,T=t,a=pi(t-O,ci().delta),(1===M&&t>A||-1===M&&t<A)&&P({from:t,to:A,velocity:a})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(o(o({},i),s)):hi(o(o({},Wi(s,i,t)),{onUpdate:function(t){var e;i.onUpdate(t),null===(e=s.onUpdate)||void 0===e||e.call(s,t)},onComplete:function(){var t;i.onComplete(),null===(t=s.onComplete)||void 0===t||t.call(s)}}))}:function(){var t;return e.set(n),r(),null===(t=null==s?void 0:s.onComplete)||void 0===t||t.call(s),{stop:function(){}}}}function Xi(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Yi(t){return"number"==typeof t?0:Ni("",t)}function Gi(t,e){return t[e]||t.default||t}function qi(t,e,n,i){return void 0===i&&(i={}),e.start((function(r){var o,a,s=$i(t,e,n,i,r),u=function(t,e){var n;return null!==(n=(Gi(t,e)||{}).delay)&&void 0!==n?n:0}(i,t),c=function(){return a=s()};return u?o=setTimeout(c,mi(u)):c(),function(){clearTimeout(o),null==a||a.stop()}}))}function Zi(t,e){-1===t.indexOf(e)&&t.push(e)}function Ki(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Ji=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return Zi(this.subscriptions,t),function(){return Ki(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(var r=0;r<i;r++){var o=this.subscriptions[r];o&&o(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Qi=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ji,this.velocityUpdateSubscribers=new Ji,this.renderSubscribers=new Ji,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var i=ci(),r=i.delta,o=i.timestamp;n.lastUpdated!==o&&(n.timeDelta=r,n.lastUpdated=o,li.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return li.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?pi(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function tr(t){return new Qi(t)}var er=function(t){return function(e){return e.test(t)}},nr=[bt,mt,pt,ht,gt,vt,{test:function(t){return"auto"===t},parse:function(t){return t}}],ir=function(t){return nr.find(er(t))},rr=u(u([],s(nr)),[dn,yn]),or=function(t){return rr.find(er(t))};function ar(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,tr(n))}function sr(t,e){var n=z(t,e),i=n?t.makeTargetAnimatable(n,!1):{},r=i.transitionEnd,s=void 0===r?{}:r;i.transition;var u=a(i,["transitionEnd","transition"]);for(var c in u=o(o({},u),s)){ar(t,c,Kt(u[c]))}}function ur(t,e){u([],s(e)).reverse().forEach((function(n){var i,r=t.getVariant(n);r&&sr(t,r),null===(i=t.variantChildren)||void 0===i||i.forEach((function(t){ur(t,e)}))}))}function cr(t,e,n){var i,r,o,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),u=s.length;if(u)for(var c=0;c<u;c++){var l=s[c],d=e[l],f=null;Array.isArray(d)&&(f=d[0]),null===f&&(f=null!==(r=null!==(i=n[l])&&void 0!==i?i:t.readValue(l))&&void 0!==r?r:e[l]),null!=f&&("string"==typeof f&&/^\-?\d*\.?\d+$/.test(f)?f=parseFloat(f):!or(f)&&yn.test(d)&&(f=Ni(l,d)),t.addValue(l,tr(f)),null!==(o=(a=n)[l])&&void 0!==o||(a[l]=f),t.setBaseTarget(l,f))}}function lr(t,e){if(e)return(e[t]||e.default||e).from}function dr(t,e,n){var i,r,o={};for(var a in t)o[a]=null!==(i=lr(a,e))&&void 0!==i?i:null===(r=n.getValue(a))||void 0===r?void 0:r.get();return o}function fr(t,e,n){var i;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var r=e.map((function(e){return hr(t,e,n)}));i=Promise.all(r)}else if("string"==typeof e)i=hr(t,e,n);else{var o="function"==typeof e?z(t,e,n.custom):e;i=pr(t,o,n)}return i.then((function(){return t.notifyAnimationComplete(e)}))}function hr(t,e,n){var i;void 0===n&&(n={});var r=z(t,e,n.custom),a=(r||{}).transition,u=void 0===a?t.getDefaultTransition()||{}:a;n.transitionOverride&&(u=n.transitionOverride);var c=r?function(){return pr(t,r,n)}:function(){return Promise.resolve()},l=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?function(i){void 0===i&&(i=0);var r=u.delayChildren,a=void 0===r?0:r,s=u.staggerChildren,c=u.staggerDirection;return function(t,e,n,i,r,a){void 0===n&&(n=0);void 0===i&&(i=0);void 0===r&&(r=1);var s=[],u=(t.variantChildren.size-1)*i,c=1===r?function(t){return void 0===t&&(t=0),t*i}:function(t){return void 0===t&&(t=0),u-t*i};return Array.from(t.variantChildren).sort(mr).forEach((function(t,i){s.push(hr(t,e,o(o({},a),{delay:n+c(i)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(s)}(t,e,a+i,s,c,n)}:function(){return Promise.resolve()},d=u.when;if(d){var f=s("beforeChildren"===d?[c,l]:[l,c],2),h=f[0],p=f[1];return h().then(p)}return Promise.all([c(),l(n.delay)])}function pr(t,e,n){var i,r=void 0===n?{}:n,s=r.delay,u=void 0===s?0:s,c=r.transitionOverride,l=r.type,d=t.makeTargetAnimatable(e),f=d.transition,h=void 0===f?t.getDefaultTransition():f,p=d.transitionEnd,m=a(d,["transition","transitionEnd"]);c&&(h=c);var v=[],g=l&&(null===(i=t.animationState)||void 0===i?void 0:i.getState()[l]);for(var y in m){var b=t.getValue(y),_=m[y];if(!(!b||void 0===_||g&&vr(g,y))){var w=qi(y,b,_,o({delay:u},h));v.push(w)}}return Promise.all(v).then((function(){p&&sr(t,p)}))}function mr(t,e){return t.sortNodePosition(e)}function vr(t,e){var n=t.protectedKeys,i=t.needsAnimating,r=n.hasOwnProperty(e)&&!0!==i[e];return i[e]=!1,r}var gr=[ie.Animate,ie.Hover,ie.Tap,ie.Drag,ie.Focus,ie.Exit],yr=u([],s(gr)).reverse(),br=gr.length;function _r(t){var e,n=function(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,i=e.options;return fr(t,n,i)})))}}(t),i=((e={})[ie.Animate]=wr(!0),e[ie.Hover]=wr(),e[ie.Tap]=wr(),e[ie.Drag]=wr(),e[ie.Focus]=wr(),e[ie.Exit]=wr(),e),r={},c=!0,l=function(e,n){var i=z(t,n);if(i){i.transition;var r=i.transitionEnd,s=a(i,["transition","transitionEnd"]);e=o(o(o({},e),s),r)}return e};function d(e,a){for(var d,f=t.getProps(),h=t.getVariantContext(!0)||{},p=[],m=new Set,v={},g=1/0,y=function(n){var r=yr[n],y=i[r],b=null!==(d=f[r])&&void 0!==d?d:h[r],_=I(b),w=r===a?y.isActive:null;!1===w&&(g=n);var C=b===h[r]&&b!==f[r]&&_;if(C&&c&&t.manuallyAnimateOnMount&&(C=!1),y.protectedKeys=o({},v),!y.isActive&&null===w||!b&&!y.prevProp||Gt(b)||"boolean"==typeof b)return"continue";var x=function(t,e){if("string"==typeof e)return e!==t;if(R(e))return!Ie(e,t);return!1}(y.prevProp,b)||r===a&&y.isActive&&!C&&_||n>g&&_,S=Array.isArray(b)?b:[b],E=S.reduce(l,{});!1===w&&(E={});var P=y.prevResolvedValues,k=void 0===P?{}:P,O=o(o({},k),E),T=function(t){x=!0,m.delete(t),y.needsAnimating[t]=!0};for(var A in O){var M=E[A],D=k[A];v.hasOwnProperty(A)||(M!==D?qt(M)&&qt(D)?Ie(M,D)?y.protectedKeys[A]=!0:T(A):void 0!==M?T(A):m.add(A):void 0!==M&&m.has(A)?T(A):y.protectedKeys[A]=!0)}y.prevProp=b,y.prevResolvedValues=E,y.isActive&&(v=o(o({},v),E)),c&&t.blockInitialAnimation&&(x=!1),x&&!C&&p.push.apply(p,u([],s(S.map((function(t){return{animation:t,options:o({type:r},e)}})))))},b=0;b<br;b++)y(b);if(r=o({},v),m.size){var _={};m.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(_[e]=n)})),p.push({animation:_})}var w=Boolean(p.length);return c&&!1===f.initial&&!t.manuallyAnimateOnMount&&(w=!1),c=!1,w?n(p):Promise.resolve()}return{isAnimated:function(t){return void 0!==r[t]},animateChanges:d,setActive:function(e,n,r){var o;return i[e].isActive===n?Promise.resolve():(null===(o=t.variantChildren)||void 0===o||o.forEach((function(t){var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,n)})),i[e].isActive=n,d(r,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return i}}}function wr(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Cr={animation:Le((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=_r(e)),Gt(n)&&Object(c.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:Le((function(t){var e=t.custom,n=t.visualElement,i=s(x(),2),r=i[0],o=i[1],a=Object(c.useContext)(w);Object(c.useEffect)((function(){var t,i,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(ie.Exit,!r,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:e});!r&&(null==s||s.then(o))}),[r])}))},xr=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},Sr=function(t){return xr(t)&&t.hasOwnProperty("z")},Er=function(t,e){return Math.abs(t-e)};function Pr(t,e){if(bn(t)&&bn(e))return Er(t,e);if(xr(t)&&xr(e)){var n=Er(t.x,e.x),i=Er(t.y,e.y),r=Sr(t)&&Sr(e)?Er(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(r,2))}}var kr=function(){function t(t,e,n){var i=this,r=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(i.lastMoveEvent&&i.lastMoveEventInfo){var t=Ar(i.lastMoveEventInfo,i.history),e=null!==i.startEvent,n=Pr(t.offset,{x:0,y:0})>=3;if(e||n){var r=t.point,a=ci().timestamp;i.history.push(o(o({},r),{timestamp:a}));var s=i.handlers,u=s.onStart,c=s.onMove;e||(u&&u(i.lastMoveEvent,t),i.startEvent=i.lastMoveEvent),c&&c(i.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){i.lastMoveEvent=t,i.lastMoveEventInfo=Or(e,i.transformPagePoint),ue(t)&&0===t.buttons?i.handlePointerUp(t,e):li.update(i.updatePoint,!0)},this.handlePointerUp=function(t,e){i.end();var n=i.handlers,r=n.onEnd,o=n.onSessionEnd,a=Ar(Or(e,i.transformPagePoint),i.history);i.startEvent&&r&&r(t,a),o&&o(t,a)},!(ce(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=r;var a=Or(he(t),this.transformPagePoint),s=a.point,u=ci().timestamp;this.history=[o(o({},s),{timestamp:u})];var c=e.onSessionStart;c&&c(t,Ar(a,this.history)),this.removeListeners=De(we(window,"pointermove",this.handlePointerMove),we(window,"pointerup",this.handlePointerUp),we(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),ri.update(this.updatePoint)},t}();function Or(t,e){return e?{point:e(t.point)}:t}function Tr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ar(t,e){var n=t.point;return{point:n,delta:Tr(n,Dr(e)),offset:Tr(n,Mr(e)),velocity:Lr(e,.1)}}function Mr(t){return t[0]}function Dr(t){return t[t.length-1]}function Lr(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,i=null,r=Dr(t);n>=0&&(i=t[n],!(r.timestamp-i.timestamp>mi(e)));)n--;if(!i)return{x:0,y:0};var o=(r.timestamp-i.timestamp)/1e3;if(0===o)return{x:0,y:0};var a={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Rr(t){return t}function Ir(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}function jr(){return{x:{min:0,max:1},y:{min:0,max:1}}}var zr={translate:0,scale:1,origin:0,originPoint:0};function Vr(){return{x:o({},zr),y:o({},zr)}}function Br(t){return[t("x"),t("y")]}function Fr(t,e,n){var i=e.min,r=e.max;return void 0!==i&&t<i?t=n?Ke(i,t,n.min):Math.max(t,i):void 0!==r&&t>r&&(t=n?Ke(r,t,n.max):Math.min(t,r)),t}function Ur(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Nr(t,e){var n,i=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&(i=(n=s([r,i],2))[0],r=n[1]),{min:t.min+i,max:t.min+r}}function Hr(t,e,n){return{min:Wr(t,e),max:Wr(t,n)}}function Wr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function $r(t,e){return Ir(function(t,e){var n=t.top,i=t.left,r=t.bottom,o=t.right;void 0===e&&(e=Rr);var a=e({x:i,y:n}),s=e({x:o,y:r});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function Xr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Pr(t,e)<n}function Yr(t){return t.max-t.min}function Gr(t,e){var n=.5,i=Yr(t),r=Yr(e);return r>i?n=Ze(e.min,e.max-i,t.min):i>r&&(n=Ze(t.min,t.max-r,e.min)),je(0,1,n)}function qr(t,e,n,i){void 0===i&&(i=.5),t.origin=i,t.originPoint=Ke(e.min,e.max,t.origin),t.scale=Yr(n)/Yr(e),Xr(t.scale,1,1e-4)&&(t.scale=1),t.translate=Ke(n.min,n.max,t.origin)-t.originPoint,Xr(t.translate)&&(t.translate=0)}function Zr(t,e,n,i){qr(t.x,e.x,n.x,Kr(i.originX)),qr(t.y,e.y,n.y,Kr(i.originY))}function Kr(t){return"number"==typeof t?t:.5}function Jr(t,e,n){t.min=n.min+e.min,t.max=t.min+Yr(e)}var Qr=function(t,e){return t.depth-e.depth};function to(t){return t.projection.isEnabled||t.shouldResetTransform()}function eo(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&eo(n,e),to(t)&&e.push(t),e}function no(t){if(!t.shouldResetTransform()){var e,n=t.getLayoutState();t.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=t.measureViewportBox(),n.layoutCorrected=(e=n.layout,{x:o({},e.x),y:o({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),li.update((function(){return t.rebaseProjectionTarget()}))}}function io(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}function ro(t,e){return{min:e.min-t.min,max:e.max-t.min}}function oo(t,e){return{x:ro(t.x,e.x),y:ro(t.y,e.y)}}function ao(t){var e=t.getProps(),n=e.drag,i=e._dragX;return n&&!i}function so(t,e){t.min=e.min,t.max=e.max}function uo(t,e,n){return n+e*(t-n)}function co(t,e,n,i,r){return void 0!==r&&(t=uo(t,r,i)),uo(t,n,i)+e}function lo(t,e,n,i,r){void 0===e&&(e=0),void 0===n&&(n=1),t.min=co(t.min,e,n,i,r),t.max=co(t.max,e,n,i,r)}function fo(t,e){var n=e.x,i=e.y;lo(t.x,n.translate,n.scale,n.originPoint),lo(t.y,i.translate,i.scale,i.originPoint)}function ho(t,e,n,i){var r=s(i,3),o=r[0],a=r[1],u=r[2];t.min=e.min,t.max=e.max;var c=void 0!==n[u]?n[u]:.5,l=Ke(e.min,e.max,c);lo(t,n[o],n[a],l,n.scale)}var po=["x","scaleX","originX"],mo=["y","scaleY","originY"];function vo(t,e,n){ho(t.x,e.x,n,po),ho(t.y,e.y,n,mo)}function go(t,e,n,i,r){return t=uo(t-=e,1/n,i),void 0!==r&&(t=uo(t,1/r,i)),t}function yo(t,e,n){var i=s(n,3),r=i[0],o=i[1],a=i[2];!function(t,e,n,i,r){void 0===e&&(e=0),void 0===n&&(n=1),void 0===i&&(i=.5);var o=Ke(t.min,t.max,i)-e;t.min=go(t.min,e,n,o,r),t.max=go(t.max,e,n,o,r)}(t,e[r],e[o],e[a],e.scale)}function bo(t,e){yo(t.x,e,po),yo(t.y,e,mo)}var _o=new Set;function wo(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function Co(t){return _o.add(t),function(){return _o.delete(t)}}function xo(){if(_o.size){var t=0,e=[[]],n=[],i=function(n){return wo(e,n,t)},r=function(e){wo(n,e,t),t++};_o.forEach((function(e){e(i,r),t=0})),_o.clear();for(var o=n.length,a=0;a<=o;a++)e[a]&&e[a].forEach(Eo),n[a]&&n[a].forEach(Eo)}}var So,Eo=function(t){return t()},Po=new WeakMap,ko=function(){function t(t){var e=t.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=e,this.visualElement.enableLayoutProjection(),Po.set(e,this)}return t.prototype.start=function(t,e){var n=this,i=void 0===e?{}:e,r=i.snapToCursor,o=void 0!==r&&r,a=i.cursorProgress,c=this.props.transformPagePoint;this.panSession=new kr(t,{onSessionStart:function(t){var e;n.stopMotion();var i=function(t){return he(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=Co((function(t,e){var r=eo(n.visualElement),c=function(t){var e=[],n=function(t){to(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Qr)}(n.visualElement),l=u(u([],s(r)),s(c)),d=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){no(n.visualElement),c.forEach(no)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),o&&(d=n.snapToCursor(i))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;Br((function(e){if(!d){var r=t.target[e],o=r.min,s=r.max;n.cursorProgress[e]=a?a[e]:Ze(o,s,i[e])}var u=n.getAxisMotionValue(e);u&&(n.originPoint[e]=u.get())}))})),e((function(){oi.update(),oi.preRender(),oi.render(),oi.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var i,r,o,a=n.props,s=a.drag,u=a.dragPropagation;(!s||u||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Pe(s),n.openGlobalLock))&&(xo(),n.isDragging=!0,n.currentDirection=null,null===(r=(i=n.props).onDragStart)||void 0===r||r.call(i,t,e),null===(o=n.visualElement.animationState)||void 0===o||o.setActive(ie.Drag,!0))},onMove:function(t,e){var i,r,o,a,s=n.props,u=s.dragPropagation,c=s.dragDirectionLock;if(u||n.openGlobalLock){var l=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(l),void(null!==n.currentDirection&&(null===(r=(i=n.props).onDirectionLock)||void 0===r||r.call(i,n.currentDirection)));n.updateAxis("x",e.point,l),n.updateAxis("y",e.point,l),null===(a=(o=n.props).onDrag)||void 0===a||a.call(o,t,e),So=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:c})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,i=e.dragElastic,r=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(L(n)?this.resolveRefConstraints(r,n):function(t,e){var n=e.top,i=e.left,r=e.bottom,o=e.right;return{x:Ur(t.x,i,o),y:Ur(t.y,n,r)}}(r,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:Hr(t,"left","right"),y:Hr(t,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&Br((function(e){t.getAxisMotionValue(e)&&(t.constraints[e]=function(t,e){var n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(r[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,i=n.onMeasureDragConstraints,r=n.transformPagePoint,o=e.current;p(null!==o,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."),this.constraintsBox=$r(o,r);var a=function(t,e){return{x:Nr(t.x,e.x),y:Nr(t.y,e.y)}}(t,this.constraintsBox);if(i){var s=i(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=Ir(s))}return a},t.prototype.cancelDrag=function(){var t,e;this.visualElement.unlockProjectionTarget(),null===(t=this.cancelLayout)||void 0===t||t.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(ie.Drag,!1)},t.prototype.stop=function(t,e){var n,i,r;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var o=this.isDragging;if(this.cancelDrag(),o){var a=e.velocity;this.animateDragEnd(a),null===(r=(i=this.props).onDragEnd)||void 0===r||r.call(i,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return Br((function(n){if(Oo(n,e.props.drag,e.currentDirection)){var i=e.getAxisMotionValue(n);if(!i)return e.cursorProgress[n]=.5,!0;var r=e.visualElement.getLayoutState().layout,o=r[n].max-r[n].min,a=r[n].min+o/2,s=t[n]-a;e.originPoint[n]=t[n],i.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Oo(t,this.props.drag,this.currentDirection))return this.getAxisMotionValue(t)?this.updateAxisMotionValue(t,n):this.updateVisualElementAxis(t,e)},t.prototype.updateAxisMotionValue=function(t,e){var n=this.getAxisMotionValue(t);if(e&&n){var i=this.originPoint[t]+e[t],r=this.constraints?Fr(i,this.constraints[t],this.elastic[t]):i;n.set(r)}},t.prototype.updateVisualElementAxis=function(t,e){var n,i=this.visualElement.getLayoutState().layout[t],r=i.max-i.min,o=this.cursorProgress[t],a=function(t,e,n,i,r){var o=t-e*n;return i?Fr(o,i,r):o}(e[t],r,o,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+r)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,i=t.dragDirectionLock,r=void 0!==i&&i,s=t.dragPropagation,u=void 0!==s&&s,c=t.dragConstraints,l=void 0!==c&&c,d=t.dragElastic,f=void 0===d?.35:d,h=t.dragMomentum,p=void 0===h||h,m=a(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=o({drag:n,dragDirectionLock:r,dragPropagation:u,dragConstraints:l,dragElastic:f,dragMomentum:p},m)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,i=e.layoutId,r="_drag"+t.toUpperCase();return this.props[r]?this.props[r]:n||void 0!==i?void 0:this.visualElement.getValue(t,0)},t.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},t.prototype.isExternalDrag=function(){var t=this.props,e=t._dragX,n=t._dragY;return e||n},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,i=n.drag,r=n.dragMomentum,a=n.dragElastic,s=n.dragTransition,u=function(t,e){void 0===e&&(e=!0);var n,i=t.getProjectionParent();return!!i&&(e?bo(n=oo(i.projection.target,t.projection.target),i.getLatestValues()):n=oo(i.getLayoutState().layout,t.getLayoutState().layout),Br((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),c=this.constraints||{};if(u&&Object.keys(c).length&&this.isLayoutDrag()){var l=this.visualElement.getProjectionParent();if(l){var d=oo(l.projection.targetFinal,c);Br((function(t){var e=d[t],n=e.min,i=e.max;c[t]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var f=Br((function(n){var l;if(Oo(n,i,e.currentDirection)){var d=null!==(l=null==c?void 0:c[n])&&void 0!==l?l:{},f=a?200:1e6,h=a?40:1e7,p=o(o({type:"inertia",velocity:r?t[n]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},s),d);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,p):e.visualElement.startLayoutAnimation(n,p,u)}}));return Promise.all(f).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;Br((function(e){var n=t.getAxisMotionValue(e);n?n.stop():t.visualElement.stopLayoutAnimation()}))},t.prototype.startAxisValueAnimation=function(t,e){var n=this.getAxisMotionValue(t);if(n){var i=n.get();return n.set(i),n.set(i),qi(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(L(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};Br((function(e){i[e]=Gr(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){Br((function(e){if(Oo(e,n,null)){var r=function(t,e,n){var i=t.max-t.min,r=Ke(e.min,e.max-i,n);return{min:r,max:r+i}}(t.visualElement.projection.target[e],t.constraintsBox[e],i[e]),o=r.min,a=r.max;t.visualElement.setProjectionTargetAxis(e,o,a)}}))})),setTimeout(xo,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=Co((function(n,i){var r=eo(e.visualElement);i((function(){return r.forEach((function(t){return t.resetTransform()}))})),n((function(){return no(e.visualElement)})),i((function(){return r.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&i(t)}))},t.prototype.mount=function(t){var e=this,n=we(t.getInstance(),"pointerdown",(function(t){var n=e.props,i=n.drag,r=n.dragListener;i&&(void 0===r||r)&&e.start(t)})),i=ae(window,"resize",(function(){e.scalePoint()})),r=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),o=t.prevDragCursor;return o&&this.start(So,{cursorProgress:o}),function(){null==n||n(),null==i||i(),null==r||r(),e.cancelDrag()}},t}();function Oo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var To,Ao,Mo={pan:Le((function(t){var e=t.onPan,n=t.onPanStart,i=t.onPanEnd,r=t.onPanSessionStart,o=t.visualElement,a=e||n||i||r,s=Object(c.useRef)(null),u=Object(c.useContext)(y).transformPagePoint,l={onSessionStart:r,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,i&&i(t,e)}};Object(c.useEffect)((function(){null!==s.current&&s.current.updateHandlers(l)})),Ce(o,"pointerdown",a&&function(t){s.current=new kr(t,l,{transformPagePoint:u})}),Ae((function(){return s.current&&s.current.end()}))})),drag:Le((function(t){var e=t.dragControls,n=t.visualElement,i=Object(c.useContext)(y).transformPagePoint,r=C((function(){return new ko({visualElement:n})}));r.setProps(o(o({},t),{transformPagePoint:i})),Object(c.useEffect)((function(){return e&&e.subscribe(r)}),[r]),Object(c.useEffect)((function(){return r.mount(n)}),[])}))};function Do(t){return"string"==typeof t&&t.startsWith("var(--")}!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(To||(To={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(Ao||(Ao={}));var Lo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var Ro=4;function Io(t,e,n){void 0===n&&(n=1),p(n<=Ro,'Max CSS variable fallback depth detected in property "'+t+'". This may indicate a circular fallback dependency.');var i=s(function(t){var e=Lo.exec(t);if(!e)return[,];var n=s(e,3);return[n[1],n[2]]}(t),2),r=i[0],o=i[1];if(r){var a=window.getComputedStyle(e).getPropertyValue(r);return a?a.trim():Do(o)?Io(o,e,n+1):o}}function jo(t,e){return t/(e.max-e.min)*100}var zo="_$css";var Vo={process:function(t,e,n){var i=n.target;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return jo(t,i.x)+"% "+jo(t,i.y)+"%"}},Bo={borderRadius:o(o({},Vo),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Vo,borderTopRightRadius:Vo,borderBottomLeftRadius:Vo,borderBottomRightRadius:Vo,boxShadow:{process:function(t,e){var n=e.delta,i=e.treeScale,r=t,o=t.includes("var("),a=[];o&&(t=t.replace(Lo,(function(t){return a.push(t),zo})));var s=yn.parse(t);if(s.length>5)return r;var u=yn.createTransformer(t),c="number"!=typeof s[0]?1:0,l=n.x.scale*i.x,d=n.y.scale*i.y;s[0+c]/=l,s[1+c]/=d;var f=Ke(l,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=f),"number"==typeof s[3+c]&&(s[3+c]/=f);var h=u(s);if(o){var p=0;h=h.replace(zo,(function(){var t=a[p];return p++,t}))}return h}}},Fo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},e.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},e.isAnimating={x:!1,y:!1},e.stopAxisAnimation={x:void 0,y:void 0},e.isAnimatingTree=!1,e.animate=function(t,n,i){void 0===i&&(i={});var r=i.originBox,s=i.targetBox,u=i.visibilityAction,c=i.shouldStackAnimate,l=i.onComplete,d=i.prevParent,f=a(i,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),h=e.props,p=h.visualElement,m=h.layout;if(!1===c)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===c){c&&(e.isAnimatingTree=!0),n=r||n,t=s||t;var v,g,y,b,_=!1,w=p.getProjectionParent();if(w){var C=w.prevViewportBox,x=w.getLayoutState().layout;d&&(s&&(x=d.getLayoutState().layout),r&&(g=w,y=(v=d).getLayoutId(),b=g.getLayoutId(),y===b&&(void 0!==b||v===g))&&d.prevViewportBox&&(C=d.prevViewportBox)),C&&function(t,e,n){return t||!t&&!(e||n)}(d,r,s)&&(_=!0,n=oo(C,n),t=oo(x,t))}var S,E,P=(E=t,!(No(S=n)||No(E)||Ho(S.x,E.x)&&Ho(S.y,E.y))),k=Br((function(i){var r,a;if("position"===m){var s=t[i].max-t[i].min;n[i].max=n[i].min+s}if(!p.projection.isTargetLocked)return void 0===u?P?e.animateAxis(i,t[i],n[i],o(o({},f),{isRelative:_})):(null===(a=(r=e.stopAxisAnimation)[i])||void 0===a||a.call(r),p.setProjectionTargetAxis(i,t[i].min,t[i].max,_)):void p.setVisibility(u===Ao.Show)}));return p.syncRender(),Promise.all(k).then((function(){e.isAnimatingTree=!1,l&&l(),p.notifyLayoutAnimationComplete()}))}},e}return r(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=qi,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},Y(Bo)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),Br((function(e){var n,i;return null===(i=(n=t.stopAxisAnimation)[e])||void 0===i?void 0:i.call(n)}))},e.prototype.animateAxis=function(t,e,n,i){var r,o,a=this,s=void 0===i?{}:i,u=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!Ho(e,this.currentAnimationTarget[t])){null===(o=(r=this.stopAxisAnimation)[t])||void 0===o||o.call(r),this.isAnimating[t]=!0;var l=this.props.visualElement,d=this.frameTarget[t],f=l.getProjectionAnimationProgress()[t];f.clearListeners(),f.set(0),f.set(0);var h=function(){var i=f.get()/1e3;!function(t,e,n,i){t.min=Ke(e.min,n.min,i),t.max=Ke(e.max,n.max,i)}(d,n,e,i),l.setProjectionTargetAxis(t,d.min,d.max,c)};h();var p=f.onChange(h);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,f.stop(),p()},this.currentAnimationTarget[t]=e;var m=u||l.getDefaultTransition()||Wo;return qi("x"===t?"layoutX":"layoutY",f,1e3,m&&Gi(m,"layout")).then(this.stopAxisAnimation[t])}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(c.Component);var Uo={min:0,max:0};function No(t){return Ho(t.x,Uo)&&Ho(t.y,Uo)}function Ho(t,e){return t.min===e.min&&t.max===e.max}var Wo={duration:.45,ease:[.4,0,.1,1]};var $o={layoutReady:function(t){return t.notifyLayoutReady()}};function Xo(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?$o:e,i=n.layoutReady,r=n.parent;Co((function(e,n){var o=Array.from(t).sort(Qr),a=r?eo(r):[];n((function(){u(u([],s(a)),s(o)).forEach((function(t){return t.resetTransform()}))})),e((function(){o.forEach(no)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),o.forEach(i)})),e((function(){o.forEach((function(t){t.isPresent&&(t.presence=To.Present)}))})),n((function(){oi.preRender(),oi.render()})),e((function(){li.postRender((function(){return o.forEach(Yo)})),t.clear()}))})),xo()}}}function Yo(t){t.prevViewportBox=t.projection.target}var Go=Object(c.createContext)(Xo()),qo=Object(c.createContext)(Xo());function Zo(t){return!!t.forceUpdate}var Ko=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,i=t.visualElement;Zo(e)&&e.register(i),Zo(n)&&n.register(i),i.onUnmount((function(){Zo(e)&&e.remove(i),Zo(n)&&n.remove(i)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Zo(e)?e.syncUpdate():(io(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Zo(t)||t.flush()},e.prototype.render=function(){return null},e}(c.default.Component);var Jo={measureLayout:function(t){var e=Object(c.useContext)(Go),n=Object(c.useContext)(qo);return c.default.createElement(Ko,o({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=s(x(),2)[1];return c.createElement(Fo,o({},t,{safeToRemove:e}))}};function Qo(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Vr(),deltaFinal:Vr(),deltaTransform:""}}var ta=Qo();function ea(t,e,n){var i=t.x,r=t.y,o="translate3d("+i.translate/e.x+"px, "+r.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,u=n.rotateY;a&&(o+="rotate("+a+") "),s&&(o+="rotateX("+s+") "),u&&(o+="rotateY("+u+") ")}return o+="scale("+i.scale+", "+r.scale+")",n||o!==ia?o:""}function na(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var ia=ea(ta.delta,ta.treeScale,{x:1,y:1}),ra=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function oa(t,e,n,i){var r,o,a=t.delta,s=t.layout,u=t.layoutCorrected,c=t.treeScale,l=e.target;o=s,so((r=u).x,o.x),so(r.y,o.y),function(t,e,n){var i=n.length;if(i){var r,o;e.x=e.y=1;for(var a=0;a<i;a++)o=(r=n[a]).getLayoutState().delta,e.x*=o.x.scale,e.y*=o.y.scale,fo(t,o),ao(r)&&vo(t,t,r.getLatestValues())}}(u,c,n),Zr(a,u,l,i)}var aa=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){Zi(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){Ki(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Qr),this.isDirty=!1,this.children.forEach(t)},t}();var sa=function(t){var e=t.treeType,n=void 0===e?"":e,i=t.build,r=t.getBaseTarget,a=t.makeTargetAnimatable,c=t.measureViewportBox,l=t.render,d=t.readValueFromInstance,f=t.resetTransform,h=t.restoreTransform,p=t.removeValueFromRenderState,m=t.sortNodePosition,v=t.scrapeMotionValuesFromProps;return function(t,e){var g=t.parent,y=t.props,b=t.presenceId,_=t.blockInitialAnimation,w=t.visualState;void 0===e&&(e={});var C,x,S,E,P,k,O=w.latestValues,T=w.renderState,A=function(){var t=ra.map((function(){return new Ji})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return ra.forEach((function(i){var r;null===(r=e[i])||void 0===r||r.call(e);var o="on"+i,a=t[o];a&&(e[i]=n[o](a))}))}};return t.forEach((function(t,e){n["on"+ra[e]]=function(e){return t.add(e)},n["notify"+ra[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,u([],s(e)))}})),n}(),M={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},D=M,L=O,R=Qo(),j=!1,z=new Map,F=new Map,U={},N=o({},O);function H(){C&&(J.isProjectionReady()&&(vo(D.targetFinal,D.target,L),Zr(R.deltaFinal,R.layoutCorrected,D.targetFinal,O)),W(),l(C,T))}function W(){var t=O;if(E&&E.isActive()){var n=E.getCrossfadeState(J);n&&(t=n)}i(J,T,t,D,R,e,y)}function $(){A.notifyUpdate(O)}function X(){J.layoutTree.forEach(ca)}var Y=v(y);for(var G in Y){var q=Y[G];void 0!==O[G]&&nt(q)&&q.set(O[G],!1)}var Z=V(y),K=B(y),J=o(o({treeType:n,current:null,depth:g?g.depth+1:0,parent:g,children:new Set,path:g?u(u([],s(g.path)),[g]):[],layoutTree:g?g.layoutTree:new aa,presenceId:b,projection:M,variantChildren:K?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==g?void 0:g.isMounted()),blockInitialAnimation:_,isMounted:function(){return Boolean(C)},mount:function(t){C=J.current=t,J.pointTo(J),K&&g&&!Z&&(k=null==g?void 0:g.addVariantChild(J)),null==g||g.children.add(J)},unmount:function(){ri.update($),ri.render(H),ri.preRender(J.updateLayoutProjection),F.forEach((function(t){return t()})),J.stopLayoutAnimation(),J.layoutTree.remove(J),null==k||k(),null==g||g.children.delete(J),null==S||S(),A.clearAllListeners()},addVariantChild:function(t){var e,n=J.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return m&&n===t.treeType?m(J.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return K?J:null==g?void 0:g.getClosestVariantNode()},scheduleUpdateLayoutProjection:g?g.scheduleUpdateLayoutProjection:function(){return li.preRender(J.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return y.layoutId},getInstance:function(){return C},getStaticValue:function(t){return O[t]},setStaticValue:function(t,e){return O[t]=e},getLatestValues:function(){return O},setVisibility:function(t){J.isVisible!==t&&(J.isVisible=t,J.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),a(J,t,y,e)},addValue:function(t,e){J.hasValue(t)&&J.removeValue(t),z.set(t,e),O[t]=e.get(),function(t,e){var n=e.onChange((function(e){O[t]=e,y.onUpdate&&li.update($,!1,!0)})),i=e.onRenderRequest(J.scheduleRender);F.set(t,(function(){n(),i()}))}(t,e)},removeValue:function(t){var e;z.delete(t),null===(e=F.get(t))||void 0===e||e(),F.delete(t),delete O[t],p(t,T)},hasValue:function(t){return z.has(t)},getValue:function(t,e){var n=z.get(t);return void 0===n&&void 0!==e&&(n=tr(e),J.addValue(t,n)),n},forEachValue:function(t){return z.forEach(t)},readValue:function(t){var n;return null!==(n=O[t])&&void 0!==n?n:d(C,t,e)},setBaseTarget:function(t,e){N[t]=e},getBaseTarget:function(t){if(r){var e=r(y,t);if(void 0!==e&&!nt(e))return e}return N[t]}},A),{build:function(){return W(),T},scheduleRender:function(){li.render(H,!1,!0)},syncRender:H,setProps:function(t){y=t,A.updatePropListeners(t),U=function(t,e,n){var i;for(var r in e){var o=e[r],a=n[r];if(nt(o))t.addValue(r,o);else if(nt(a))t.addValue(r,tr(o));else if(a!==o)if(t.hasValue(r)){var s=t.getValue(r);!s.hasAnimated&&s.set(o)}else t.addValue(r,tr(null!==(i=t.getStaticValue(r))&&void 0!==i?i:o))}for(var r in n)void 0===e[r]&&t.removeValue(r);return e}(J,v(y),U)},getProps:function(){return y},getVariant:function(t){var e;return null===(e=y.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return y.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==g?void 0:g.getVariantContext();if(!Z){var e=(null==g?void 0:g.getVariantContext())||{};return void 0!==y.initial&&(e.initial=y.initial),e}for(var n={},i=0;i<fa;i++){var r=da[i],o=y[r];(I(o)||!1===o)&&(n[r]=o)}return n},enableLayoutProjection:function(){M.isEnabled=!0,J.layoutTree.add(J)},lockProjectionTarget:function(){M.isTargetLocked=!0},unlockProjectionTarget:function(){J.stopLayoutAnimation(),M.isTargetLocked=!1},getLayoutState:function(){return R},setCrossfader:function(t){E=t},isProjectionReady:function(){return M.isEnabled&&M.isHydrated&&R.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var i=J.getProjectionAnimationProgress()[t],r=n?M.relativeTarget[t]:M.target[t],o=r.min,a=r.max-o;return i.clearListeners(),i.set(o),i.set(o),i.onChange((function(e){J.setProjectionTargetAxis(t,e,e+a,n)})),J.animateMotionValue(t,i,0,e)},stopLayoutAnimation:function(){Br((function(t){return J.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=c(C,e);return t||bo(n,O),n},getProjectionAnimationProgress:function(){return P||(P={x:tr(0),y:tr(0)}),P},setProjectionTargetAxis:function(t,e,n,i){var r;void 0===i&&(i=!1),i?(M.relativeTarget||(M.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),r=M.relativeTarget[t]):(M.relativeTarget=void 0,r=M.target[t]),M.isHydrated=!0,r.min=e,r.max=n,j=!0,A.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=R.layout);var n=J.getProjectionAnimationProgress(),i=n.x,r=n.y,o=!(M.relativeTarget||M.isTargetLocked||i.isAnimating()||r.isAnimating());(t||o)&&Br((function(t){var n=e[t],i=n.min,r=n.max;J.setProjectionTargetAxis(t,i,r)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=oo(e.getLayoutState().layout,t.getLayoutState().layout);Br((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(J),J.notifyLayoutUpdate(R.layout,J.prevViewportBox||R.layout,t)},resetTransform:function(){return f(J,C,y)},restoreTransform:function(){return h(C,T)},updateLayoutProjection:function(){if(J.isProjectionReady()){var t=R.delta,e=R.treeScale,n=e.x,i=e.y,r=R.deltaTransform;oa(R,D,J.path,O),j&&J.notifyViewportBoxUpdate(D.target,t),j=!1;var o=ea(t,e);o===r&&n===e.x&&i===e.y||J.scheduleRender(),R.deltaTransform=o}},updateTreeLayoutProjection:function(){J.layoutTree.forEach(ua),li.preRender(X,!1,!0)},getProjectionParent:function(){if(void 0===x){for(var t=!1,e=J.path.length-1;e>=0;e--){var n=J.path[e];if(n.projection.isEnabled){t=n;break}}x=t}return x},resolveRelativeTargetBox:function(){var t=J.getProjectionParent();if(M.relativeTarget&&t&&(function(t,e){Jr(t.target.x,t.relativeTarget.x,e.target.x),Jr(t.target.y,t.relativeTarget.y,e.target.y)}(M,t.projection),ao(t))){var e=M.target;vo(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(y._layoutResetTransform)},pointTo:function(t){D=t.projection,L=t.getLatestValues(),null==S||S(),S=De(t.onSetAxisTarget(J.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;J.isPresent?J.presence=To.Present:null===(t=J.layoutSafeToRemove)||void 0===t||t.call(J)})))},isPresent:!0,presence:To.Entering});return J}};function ua(t){t.resolveRelativeTargetBox()}function ca(t){t.updateLayoutProjection()}var la,da=u(["initial"],s(gr)),fa=da.length,ha=new Set(["width","height","top","left","right","bottom","x","y"]),pa=function(t){return ha.has(t)},ma=function(t,e){t.set(e,!1),t.set(e)},va=function(t){return t===bt||t===mt};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(la||(la={}));var ga=function(t,e){return parseFloat(t.split(", ")[e])},ya=function(t,e){return function(n,i){var r=i.transform;if("none"===r||!r)return 0;var o=r.match(/^matrix3d\((.+)\)$/);if(o)return ga(o[1],e);var a=r.match(/^matrix\((.+)\)$/);return a?ga(a[1],t):0}},ba=new Set(["x","y","z"]),_a=q.filter((function(t){return!ba.has(t)}));var wa={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,i=e.top;return parseFloat(i)+(n.max-n.min)},right:function(t,e){var n=t.x,i=e.left;return parseFloat(i)+(n.max-n.min)},x:ya(4,13),y:ya(5,14)},Ca=function(t,e,n,i){void 0===n&&(n={}),void 0===i&&(i={}),e=o({},e),i=o({},i);var r=Object.keys(e).filter(pa),a=[],u=!1,c=[];if(r.forEach((function(r){var o=t.getValue(r);if(t.hasValue(r)){var s,l=n[r],d=e[r],f=ir(l);if(qt(d))for(var h=d.length,m=null===d[0]?1:0;m<h;m++)s?p(ir(d[m])===s,"All keyframes must be of the same type"):(s=ir(d[m]),p(s===f||va(f)&&va(s),"Keyframes must be of the same dimension as the current value"));else s=ir(d);if(f!==s)if(va(f)&&va(s)){var v=o.get();"string"==typeof v&&o.set(parseFloat(v)),"string"==typeof d?e[r]=parseFloat(d):Array.isArray(d)&&s===mt&&(e[r]=d.map(parseFloat))}else(null==f?void 0:f.transform)&&(null==s?void 0:s.transform)&&(0===l||0===d)?0===l?o.set(s.transform(l)):e[r]=f.transform(d):(u||(a=function(t){var e=[];return _a.forEach((function(n){var i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),u=!0),c.push(r),i[r]=void 0!==i[r]?i[r]:e[r],ma(o,d))}})),c.length){var l=function(t,e,n){var i=e.measureViewportBox(),r=e.getInstance(),o=getComputedStyle(r),a=o.display,s={top:o.top,left:o.left,bottom:o.bottom,right:o.right,transform:o.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var u=e.measureViewportBox();return n.forEach((function(n){var r=e.getValue(n);ma(r,wa[n](i,s)),t[n]=wa[n](u,o)})),t}(e,t,c);return a.length&&a.forEach((function(e){var n=s(e,2),i=n[0],r=n[1];t.getValue(i).set(r)})),t.syncRender(),{target:l,transitionEnd:i}}return{target:e,transitionEnd:i}};function xa(t,e,n,i){return function(t){return Object.keys(t).some(pa)}(e)?Ca(t,e,n,i):{target:e,transitionEnd:i}}var Sa=function(t,e,n,i){var r=function(t,e,n){var i,r=a(e,[]),s=t.getInstance();if(!(s instanceof HTMLElement))return{target:r,transitionEnd:n};for(var u in n&&(n=o({},n)),t.forEachValue((function(t){var e=t.get();if(Do(e)){var n=Io(e,s);n&&t.set(n)}})),r){var c=r[u];if(Do(c)){var l=Io(c,s);l&&(r[u]=l,n&&(null!==(i=n[u])&&void 0!==i||(n[u]=c)))}}return{target:r,transitionEnd:n}}(t,e,i);return xa(t,e=r.target,n,i=r.transitionEnd)};var Ea={treeType:"dom",readValueFromInstance:function(t,e){if(J(e)){var n=Ui(e);return n&&n.default||0}var i,r=(i=t,window.getComputedStyle(i));return(rt(e)?r.getPropertyValue(e):r[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return $r(t,e.transformPagePoint)},resetTransform:function(t,e,n){var i=n.transformTemplate;e.style.transform=i?i({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,i=e.style;delete n[t],delete i[t]},makeTargetAnimatable:function(t,e,n,i){var r=n.transformValues;void 0===i&&(i=!0);var s=e.transition,u=e.transitionEnd,c=a(e,["transition","transitionEnd"]),l=dr(c,s||{},t);if(r&&(u&&(u=r(u)),c&&(c=r(c)),l&&(l=r(l))),i){cr(t,c,l);var d=Sa(t,c,l,u);u=d.transitionEnd,c=d.target}return o({transition:s,transitionEnd:u},c)},scrapeMotionValuesFromProps:Xt,build:function(t,e,n,i,r,o,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=i.isEnabled&&r.isHydrated;St(e,n,i,r,o,a.transformTemplate,s?ea:void 0,s?na:void 0)},render:Ht},Pa=sa(Ea),ka=sa(o(o({},Ea),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return J(e)?(null===(n=Ui(e))||void 0===n?void 0:n.default)||0:(e=Wt.has(e)?e:Nt(e),t.getAttribute(e))},scrapeMotionValuesFromProps:Yt,build:function(t,e,n,i,r,o,a){var s=i.isEnabled&&r.isHydrated;zt(e,n,i,r,o,a.transformTemplate,s?ea:void 0,s?na:void 0)},render:$t})),Oa=function(t,e){return $(t)?ka(e,{enableHardwareAcceleration:!1}):Pa(e,{enableHardwareAcceleration:!0})},Ta=o(o(o(o({},Cr),Re),Mo),Jo),Aa=H((function(t,e){return oe(t,e,Ta,Oa)}));function Ma(t){return N(oe(t,{forwardMotionProps:!1},Ta,Oa))}var Da=H(oe);var La=0;function Ra(){var t=La;return La++,t}var Ia=function(t){var e=t.children,n=t.initial,i=t.isPresent,r=t.onExitComplete,o=t.custom,a=t.presenceAffectsLayout,s=C(ja),u=C(Ra),l=Object(c.useMemo)((function(){return{id:u,initial:n,isPresent:i,custom:o,onExitComplete:function(t){s.set(t,!0);var e=!0;s.forEach((function(t){t||(e=!1)})),e&&(null==r||r())},register:function(t){return s.set(t,!1),function(){return s.delete(t)}}}}),a?void 0:[i]);return Object(c.useMemo)((function(){s.forEach((function(t,e){return s.set(e,!1)}))}),[i]),c.useEffect((function(){!i&&!s.size&&(null==r||r())}),[i]),c.createElement(w.Provider,{value:l},e)};function ja(){return new Map}function za(t){return t.key||""}var Va=function(t){var e=t.children,n=t.custom,i=t.initial,r=void 0===i||i,o=t.onExitComplete,a=t.exitBeforeEnter,l=t.presenceAffectsLayout,d=void 0===l||l,f=function(){var t=Object(c.useRef)(!1),e=s(Object(c.useState)(0),2),n=e[0],i=e[1];return Ae((function(){return t.current=!0})),Object(c.useCallback)((function(){!t.current&&i(n+1)}),[n])}(),h=Object(c.useContext)(Go);Zo(h)&&(f=h.forceUpdate);var p=Object(c.useRef)(!0),m=function(t){var e=[];return c.Children.forEach(t,(function(t){Object(c.isValidElement)(t)&&e.push(t)})),e}(e),v=Object(c.useRef)(m),g=Object(c.useRef)(new Map).current,y=Object(c.useRef)(new Set).current;if(function(t,e){t.forEach((function(t){var n=za(t);e.set(n,t)}))}(m,g),p.current)return p.current=!1,c.createElement(c.Fragment,null,m.map((function(t){return c.createElement(Ia,{key:za(t),isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:d},t)})));for(var b=u([],s(m)),_=v.current.map(za),w=m.map(za),C=_.length,x=0;x<C;x++){var S=_[x];-1===w.indexOf(S)?y.add(S):y.delete(S)}return a&&y.size&&(b=[]),y.forEach((function(t){if(-1===w.indexOf(t)){var e=g.get(t);if(e){var i=_.indexOf(t);b.splice(i,0,c.createElement(Ia,{key:za(e),isPresent:!1,onExitComplete:function(){g.delete(t),y.delete(t);var e=v.current.findIndex((function(e){return e.key===t}));v.current.splice(e,1),y.size||(v.current=m,f(),o&&o())},custom:n,presenceAffectsLayout:d},e))}}})),b=b.map((function(t){var e=t.key;return y.has(e)?t:c.createElement(Ia,{key:za(t),isPresent:!0,presenceAffectsLayout:d},t)})),v.current=b,c.createElement(c.Fragment,null,y.size?b:b.map((function(t){return Object(c.cloneElement)(t)})))};function Ba(t,e,n){void 0===n&&(n={});var i=nt(t)?t:tr(t);return qi("",i,e,n),{stop:function(){return i.stop()}}}function Fa(){var t=tr(1),e={lead:void 0,follow:void 0,crossfadeOpacity:!1,preserveFollowOpacity:!1},n=o({},e),i={},r={},a=!1,s=null,u=0;function c(n,i){var r=e.lead,u=e.follow;a=!0,s=null;var c=!1,l=function(){c=!0,r&&r.scheduleRender(),u&&u.scheduleRender()},d=function(){a=!1,s=ci().timestamp};return i=i&&Gi(i,"crossfade"),Ba(t,n,o(o({},i),{onUpdate:l,onComplete:function(){c?d():(t.set(n),li.read(d)),l()}}))}function l(){var n,o,a=ci().timestamp,s=e.lead,c=e.follow;if(a!==u&&s){u=a;var l=s.getLatestValues();Object.assign(i,l);var d=c?c.getLatestValues():e.prevValues;Object.assign(r,d);var f=t.get(),h=null!==(n=l.opacity)&&void 0!==n?n:1,p=null!==(o=null==d?void 0:d.opacity)&&void 0!==o?o:1;e.crossfadeOpacity&&c?(i.opacity=Ke(!1!==c.isVisible?0:p,h,Ua(f)),r.opacity=e.preserveFollowOpacity?p:Ke(p,0,Na(f))):c||(i.opacity=Ke(p,h,f)),function(t,e,n,i,r,o){for(var a=0;a<$a;a++){var s="border"+Wa[a]+"Radius",u=Xa(i,s),c=Xa(n,s);if((void 0!==u||void 0!==c)&&(u||(u=0),c||(c=0),"number"==typeof u&&"number"==typeof c)){var l=Math.max(Ke(u,c,o),0);t[s]=e[s]=l}}if(i.rotate||n.rotate){var d=Ke(i.rotate||0,n.rotate||0,o);t.rotate=e.rotate=d}!r&&n.backgroundColor&&i.backgroundColor&&(t.backgroundColor=e.backgroundColor=ln(i.backgroundColor,n.backgroundColor)(o))}(i,r,l,d||{},Boolean(c),f)}}return{isActive:function(){return i&&(a||ci().timestamp===s)},fromLead:function(t){return c(0,t)},toLead:function(i){var r=0;return e.prevValues||e.follow?n.lead===e.follow&&n.follow===e.lead&&(r=1-t.get()):r=1,t.set(r),c(1,i)},reset:function(){return t.set(1)},stop:function(){return t.stop()},getCrossfadeState:function(t){return l(),t===e.lead?i:t===e.follow?r:void 0},setOptions:function(t){n=e,e=t,i={},r={}},getLatestValues:function(){return i}}}var Ua=Ha(0,.5,zn),Na=Ha(.5,.95,Dn);function Ha(t,e,n){return function(i){return i<t?0:i>e?1:n(Ze(t,e,i))}}var Wa=["TopLeft","TopRight","BottomLeft","BottomRight"],$a=Wa.length;function Xa(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:t.borderRadius}function Ya(){var t,e,n,i=new Set,r={leadIsExiting:!1},a=o({},r),s=Fa(),u=!1;return{add:function(t){t.setCrossfader(s),i.add(t),n&&(t.prevDragCursor=n),r.lead||(r.lead=t)},remove:function(t){i.delete(t)},getLead:function(){return r.lead},updateSnapshot:function(){if(r.lead){t=s.isActive()?s.getLatestValues():r.lead.getLatestValues(),e=r.lead.prevViewportBox;var i=Po.get(r.lead);i&&i.isDragging&&(n=i.cursorProgress)}},clearSnapshot:function(){n=e=void 0},updateLeadAndFollow:function(){var e,n,c;a=o({},r);for(var l=Array.from(i),d=l.length;d--;d>=0){var f=l[d];if(n&&(null!=c||(c=f)),null!=n||(n=f),n&&c)break}r.lead=n,r.follow=c,r.leadIsExiting=(null===(e=r.lead)||void 0===e?void 0:e.presence)===To.Exiting,s.setOptions({lead:n,follow:c,prevValues:t,crossfadeOpacity:(null==c?void 0:c.isPresenceRoot)||(null==n?void 0:n.isPresenceRoot)}),r.lead===a.follow||a.lead===r.lead&&a.leadIsExiting===r.leadIsExiting||(u=!0)},animate:function(t,n){var i;if(void 0===n&&(n=!1),t===r.lead){n?t.pointTo(r.lead):t.setVisibility(!0);var o={},a=null===(i=r.follow)||void 0===i?void 0:i.getProjectionParent();if(a&&(o.prevParent=a),t.presence===To.Entering?o.originBox=r.follow?r.follow.prevViewportBox:e:t.presence===To.Exiting&&(o.targetBox=function(){var t;return null===(t=r.follow)||void 0===t?void 0:t.getLayoutState().layout}()),u){u=!1;var c=t.getDefaultTransition();t.presence===To.Entering?s.toLead(c):s.fromLead(c)}t.notifyLayoutReady(o)}else n?r.lead&&t.pointTo(r.lead):t.setVisibility(!1)}}}var Ga=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=new Set,e.stacks=new Map,e.hasMounted=!1,e.updateScheduled=!1,e.renderScheduled=!1,e.syncContext=o(o({},Xo()),{syncUpdate:function(t){return e.scheduleUpdate(t)},forceUpdate:function(){e.syncContext=o({},e.syncContext),e.scheduleUpdate(!0)},register:function(t){return e.addChild(t)},remove:function(t){return e.removeChild(t)}}),e}return r(e,t),e.prototype.componentDidMount=function(){this.hasMounted=!0},e.prototype.componentDidUpdate=function(){this.startLayoutAnimation()},e.prototype.shouldComponentUpdate=function(){return this.renderScheduled=!0,!0},e.prototype.startLayoutAnimation=function(){var t=this;this.renderScheduled=this.updateScheduled=!1;var e=this.props.type;this.children.forEach((function(t){t.isPresent?t.presence!==To.Entering&&(t.presence=t.presence===To.Exiting?To.Entering:To.Present):t.presence=To.Exiting})),this.updateStacks();var n={layoutReady:function(n){void 0!==n.getLayoutId()?t.getStack(n).animate(n,"crossfade"===e):n.notifyLayoutReady()},parent:this.context.visualElement};this.children.forEach((function(e){return t.syncContext.add(e)})),this.syncContext.flush(n),this.stacks.forEach((function(t){return t.clearSnapshot()}))},e.prototype.updateStacks=function(){this.stacks.forEach((function(t){return t.updateLeadAndFollow()}))},e.prototype.scheduleUpdate=function(t){void 0===t&&(t=!1),!t&&this.updateScheduled||(this.updateScheduled=!0,this.children.forEach((function(t){!function(t){for(var e=!1,n={},i=0;i<G.length;i++){var r="rotate"+G[i];t.hasValue(r)&&0!==t.getStaticValue(r)&&(e=!0,n[r]=t.getStaticValue(r),t.setStaticValue(r,0))}if(e){for(var r in t.syncRender(),n)t.setStaticValue(r,n[r]);t.scheduleRender()}}(t),t.shouldResetTransform()&&t.resetTransform()})),this.children.forEach(io),this.stacks.forEach((function(t){return t.updateSnapshot()})),!t&&this.renderScheduled||(this.renderScheduled=!0,this.forceUpdate()))},e.prototype.addChild=function(t){this.children.add(t),this.addToStack(t),t.presence=this.hasMounted?To.Entering:To.Present},e.prototype.removeChild=function(t){this.scheduleUpdate(),this.children.delete(t),this.removeFromStack(t)},e.prototype.addToStack=function(t){var e=this.getStack(t);null==e||e.add(t)},e.prototype.removeFromStack=function(t){var e=this.getStack(t);null==e||e.remove(t)},e.prototype.getStack=function(t){var e=t.getLayoutId();if(void 0!==e)return!this.stacks.has(e)&&this.stacks.set(e,Ya()),this.stacks.get(e)},e.prototype.render=function(){return c.createElement(Go.Provider,{value:this.syncContext},this.props.children)},e.contextType=b,e}(c.Component);function qa(t){var e=t.children,n=a(t,["children"]);(n=o(o({},Object(c.useContext)(y)),n)).isStatic=C((function(){return n.isStatic}));var i="object"==typeof n.transition?n.transition.toString():"",r=Object(c.useMemo)((function(){return n}),[i,n.transformPagePoint]);return c.createElement(y.Provider,{value:r},e)}function Za(t){var e=t.children,n=t.features,i=t.strict,r=void 0!==i&&i,o=s(Object(c.useState)(!Ka(n)),2)[1],u=Object(c.useRef)(void 0);if(!Ka(n)){var l=n.renderer,d=a(n,["renderer"]);u.current=l,f(d)}return Object(c.useEffect)((function(){Ka(n)&&n().then((function(t){var e=t.renderer;f(a(t,["renderer"])),u.current=e,o(!0)}))}),[]),c.createElement(m.Provider,{value:{renderer:u.current,strict:r}},e)}function Ka(t){return"function"==typeof t}var Ja=o(o({renderer:Oa},Cr),Re),Qa=o(o(o({},Ja),Mo),Jo);function ts(t){var e=C((function(){return tr(t)}));if(Object(c.useContext)(y).isStatic){var n=s(Object(c.useState)(t),2)[1];Object(c.useEffect)((function(){return e.onChange(n)}),[])}return e}function es(t,e){Object(c.useEffect)((function(){if(nt(t))return t.onChange(e)}),[e])}function ns(t,e){var n=ts(e()),i=function(){return n.set(e())};return i(),function(t,e){Object(c.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return li.update(i,!1,!0)})),n}function is(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=t.length;return ns(e,(function(){for(var n="",r=0;r<i;r++){n+=t[r],e[r]&&(n+=e[r].get())}return n}))}var rs=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function os(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),i=n?0:-1,r=t[0+i],a=t[1+i],s=t[2+i],u=t[3+i],c=kn(a,s,o({mixer:rs(s[0])},u));return n?c(r):c}function as(t,e,n,i){var r="function"==typeof e?e:os(e,n,i);return Array.isArray(t)?ss(t,r):ss([t],(function(t){var e=s(t,1)[0];return r(e)}))}function ss(t,e){var n=C((function(){return[]}));return ns(t,(function(){n.length=0;for(var i=t.length,r=0;r<i;r++)n[r]=t[r].get();return e(n)}))}function us(t,e){void 0===e&&(e={});var n=Object(c.useContext)(y).isStatic,i=Object(c.useRef)(null),r=ts(nt(t)?t.get():t);return Object(c.useMemo)((function(){return r.attach((function(t,a){return n?a(t):(i.current&&i.current.stop(),i.current=hi(o(o({from:r.get(),to:t,velocity:r.getVelocity()},e),{onUpdate:a})),r.get())}))}),Object.values(e)),es(t,(function(t){return r.set(parseFloat(t))})),r}function cs(t){var e=ts(t.getVelocity());return Object(c.useEffect)((function(){return t.velocityUpdateSubscribers.add((function(t){e.set(t)}))}),[t]),e}function ls(){return{scrollX:tr(0),scrollY:tr(0),scrollXProgress:tr(0),scrollYProgress:tr(0)}}function ds(t,e,n){n.set(t&&e?t/e:0)}function fs(t,e){var n=function(){var n=e(),i=n.xOffset,r=n.yOffset,o=n.xMaxOffset,a=n.yMaxOffset;t.scrollX.set(i),t.scrollY.set(r),ds(i,o,t.scrollXProgress),ds(r,a,t.scrollYProgress)};return n(),n}var hs,ps=function(t){return function(){return{xOffset:t.scrollLeft,yOffset:t.scrollTop,xMaxOffset:t.scrollWidth-t.offsetWidth,yMaxOffset:t.scrollHeight-t.offsetHeight}}};function ms(t){var e=C(ls);return M((function(){var n=t.current;if(p(!!n,"ref provided to useScroll must be passed into a HTML element."),n){var i=fs(e,ps(n)),r=ae(n,"scroll",i,{passive:!0}),o=ae(n,"resize",i);return function(){r&&r(),o&&o()}}}),[]),e}function vs(){return{xOffset:window.pageXOffset,yOffset:window.pageYOffset,xMaxOffset:document.body.clientWidth-window.innerWidth,yMaxOffset:document.body.clientHeight-window.innerHeight}}var gs,ys=!1;function bs(){return hs||(hs=ls()),M((function(){!ys&&function(){if(ys=!0,"undefined"!=typeof window){var t=fs(hs,vs);ae(window,"scroll",t,{passive:!0}),ae(window,"resize",t)}}()}),[]),hs}function _s(){!gs&&function(){if(gs=tr(null),"undefined"!=typeof window)if(window.matchMedia){var t=window.matchMedia("(prefers-reduced-motion)"),e=function(){return gs.set(t.matches)};t.addListener(e),e()}else gs.set(!1)}();var t=s(Object(c.useState)(gs.get()),2),e=t[0],n=t[1];return es(gs,n),e}function ws(){var t=!1,e=[],n=new Set,i={subscribe:function(t){return n.add(t),function(){n.delete(t)}},start:function(i,r){if(t){var o=[];return n.forEach((function(t){o.push(fr(t,i,{transitionOverride:r}))})),Promise.all(o)}return new Promise((function(t){e.push({animation:[i,r],resolve:t})}))},set:function(e){return p(t,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach((function(t){!function(t,e){Array.isArray(e)?ur(t,e):"string"==typeof e?ur(t,[e]):sr(t,e)}(t,e)}))},stop:function(){n.forEach((function(t){!function(t){t.forEachValue((function(t){return t.stop()}))}(t)}))},mount:function(){return t=!0,e.forEach((function(t){var e=t.animation,n=t.resolve;i.start.apply(i,u([],s(e))).then(n)})),function(){t=!1,i.stop()}}};return i}function Cs(){var t=C(ws);return Object(c.useEffect)(t.mount,[]),t}var xs=function(t,e,n){var i=e-t;return((n-t)%i+i)%i+t};function Ss(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object(c.useRef)(0),i=s(Object(c.useState)(t[n.current]),2),r=i[0],o=i[1];return[r,function(e){n.current="number"!=typeof e?xs(0,t.length,n.current+1):e,o(t[n.current])}]}var Es=function(){function t(){this.componentControls=new Set}return t.prototype.subscribe=function(t){var e=this;return this.componentControls.add(t),function(){return e.componentControls.delete(t)}},t.prototype.start=function(t,e){this.componentControls.forEach((function(n){n.start(t.nativeEvent||t,e)}))},t.prototype.updateConstraints=function(t){void 0===t&&(t=!0),this.componentControls.forEach((function(t){t.updateConstraints()})),t&&xo()},t}(),Ps=function(){return new Es};function ks(){return C(Ps)}var Os=function(){return{}},Ts=sa({build:function(){},measureViewportBox:jr,resetTransform:function(){},restoreTransform:function(){},removeValueFromRenderState:function(){},render:function(){},scrapeMotionValuesFromProps:Os,readValueFromInstance:function(t,e,n){return n.initialState[e]||0},makeTargetAnimatable:function(t,e){var n=e.transition,i=e.transitionEnd,r=a(e,["transition","transitionEnd"]);return cr(t,r,dr(r,n||{},t)),o({transition:n,transitionEnd:i},r)}}),As=te({scrapeMotionValuesFromProps:Os,createRenderState:Os});function Ms(t){var e=s(Object(c.useState)(t),2),n=e[0],i=e[1],r=As({},!1),a=C((function(){return Ts({props:{},visualState:r},{initialState:t})}));return Object(c.useEffect)((function(){return a.mount({}),a.unmount()}),[]),Object(c.useEffect)((function(){a.setProps({onUpdate:function(t){return i(o({},t))}})})),[n,C((function(){return function(t){return fr(a,t)}}))]}var Ds=function(t){return t>.001?1/t:1e5},Ls=!1;function Rs(t){var e=ts(1),n=ts(1),i=_();return p(!(!t&&!i),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),h(Ls,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),Ls=!0,t?(e=t.scaleX||e,n=t.scaleY||n):i&&(e=i.getValue("scaleX",1),n=i.getValue("scaleY",1)),{scaleX:as(e,Ds),scaleY:as(n,Ds)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ScannerConfiguration=void 0;const i=n(31);class r 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=r,r.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},r.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},r.DEFAULT_ACCEPTED_ANGLE_SCORE=75,r.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=n(44),a=n(30),s=n(48),u=r(n(49)),c=r(n(50)),l=r(n(32)),d=n(5),f=n(29),h=n(19),p=r(n(52)),m=r(n(54)),v=r(n(55)),g=n(33),y=n(57),b=n(58),_=r(n(59)),w=r(n(34)),C=r(n(20));class x{static initialize(t){return i(this,void 0,void 0,(function*(){const e=new x,n=t.engine||x.defaultEnginePath,i=!!t.allowThreads;e.bridge=new o.WorkerBridge(n,{allowSimd:!0,allowThreads:i});const r=[t.licenseKey,n,window.location.hostname,f.Constants.CDN_PATH+f.Constants.DEFAULT_WASM_FOLDER,{captureConsole:!1,allowThreads:i,profileTfjsKernels:!1}];return e.initialized=yield e.bridge.postByCopyingArgs("initialize",r),e.initialized&&(x.instance=e),C.default.initialize(t.verboseLogging),e}))}createDocumentScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(60);return yield e.default.create(t)}))}createMrzScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(70),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(73);return yield e.default.create(t)}))}openCroppingView(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=n(96);return yield e.default.create(t)}))}createTextDataScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=[{languages:(t=g.TextDataScannerConfiguration.fromJson(t)).supportedLanguages,ocrResolutionLimit:t.ocrResolutionLimit,validatorPreset:t.validatorPreset}];return yield this.createGenericTextLineScanner(t,t.style,t.onTextDetected,e)}))}createVINScanner(t){return i(this,void 0,void 0,(function*(){yield this.licenseCheck();const e=[{ocrResolutionLimit:(t=y.VINScannerConfiguration.fromJson(t)).ocrResolutionLimit,validatorPreset:"VehicleIdentificationNumber"}];return yield this.createGenericTextLineScanner(t,t.style,(e=>{""!==e.text&&t.onTextDetected(e)}),e)}))}toDataUrl(t){return i(this,void 0,void 0,(function*(){return w.default.throwIfMissingBuffer(t),yield d.ImageUtils.toDataUrl(t)}))}applyFilter(t,e){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),w.default.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("applyFilter",[t,e])}))}rotateImageCcw(t,e){return i(this,void 0,void 0,(function*(){return w.default.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("rotateImageCcw",[t,e])}))}cropAndRotateImageCcw(t,e,n){return i(this,void 0,void 0,(function*(){return w.default.throwIfMissingBuffer(t),w.default.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*(){yield this.licenseCheck(),w.default.throwIfMissingBuffer(t);const i=yield this.bridge.postByTransferringArgs("createDocumentDetector",[{useCombinedDetector:!1,acceptedAngleScore:e||a.DocumentScannerConfiguration.DEFAULT_ACCEPTED_ANGLE_SCORE,acceptedSizeScore:n||a.DocumentScannerConfiguration.DEFAULT_ACCEPTED_SIZE_SCORE}]);return yield this.bridge.postByCopyingArgs("documentDetectorDetect",[i,t])}))}detectBarcodes(t,e,n,r){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),w.default.throwIfMissingBuffer(t),new Promise((o=>{const a=document.createElement("canvas"),s=document.createElement("img");s.src=t,s.onload=()=>i(this,void 0,void 0,(function*(){a.width=s.width,a.height=s.height;const t=a.getContext("2d");t.drawImage(s,0,0);const i=t.getImageData(0,0,s.width,s.height),{result:u,originalImage:c}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[i,{engineMode:e,barcodeFormats:n,returnBarcodeImage:r}]);o(h.BarcodeResult.fromWorker(u,d.ImageUtils.convertImageDataWrapperToImageData(c)))}))}))}))}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]))}))}createDocumentQualityAnalyzer(t){return i(this,void 0,void 0,(function*(){const e=yield this.bridge.postByTransferringArgs("createDocumentQualityAnalyzer",[null!=t?t:{}]);return new _.default(this,e)}))}getLicenseInfo(){return i(this,void 0,void 0,(function*(){const t=yield this.bridge.postByTransferringArgs("getLicenseInfo",[]);return s.LicenseInfo.fromJson(t)}))}beginPdf(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new u.default(this,yield this.bridge.postByCopyingArgs("beginPdf",[t]))}))}beginTiff(t={}){return i(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new c.default(this,yield this.bridge.postByCopyingArgs("beginTiff",[t]))}))}get version(){return f.Constants.VERSION}get utils(){return this._utils||(this._utils=new l.default),this._utils}release(t,e){return i(this,void 0,void 0,(function*(){t&&(console.log("Releasing object: "+e||!1),yield this.bridge.postByTransferringArgs("releaseObject",[t]))}))}licenseCheck(){return i(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new b.LicenseError(t)}))}createGenericTextLineScanner(t,e,r,o){return i(this,void 0,void 0,(function*(){const i=n(107),a=yield this.bridge.postByCopyingArgs("createGenericTextLineScanner",o),s=new v.default(this,a);return yield i.default.create(t,e,r,s)}))}}e.default=x,x.defaultEnginePath=""},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";for(let n=0;n<5;n++)t+=e.charAt(Math.floor(62*Math.random()));return t}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=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 o=r(n(0)),a=n(0),s=r(n(10)),u=n(35);e.ScanbotCameraProps=class{};e.ScanbotCameraState=class{constructor(){this.initialized=!1}};class c extends o.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 s.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,a.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(u.MediaError.unknownError(t))}))}else e(u.MediaError.unsupportedOperationError())}))}))}}e.ScannerView=c,c.DEFAULT_DETECTION_RESOLUTION=600,c.DETECTION_RESULTION_4K=3840},function(t,e,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var t=[],e=0;e<arguments.length;e++){var i=arguments[e];if(i){var o=typeof i;if("string"===o||"number"===o)t.push(i);else if(Array.isArray(i)){if(i.length){var a=r.apply(null,i);a&&t.push(a)}}else if("object"===o)if(i.toString===Object.prototype.toString)for(var s in i)n.call(i,s)&&i[s]&&t.push(s);else t.push(i.toString())}}return t.join(" ")}t.exports?(r.default=r,t.exports=r):void 0===(i=function(){return r}.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.DocumentLineQuad=void 0;const r=i(n(0));class o extends r.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return r.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(r.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.DocumentLineQuad=o,o.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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(0)),a=r(n(68)),s=n(4),u=n(6),c=n(5),l=r(n(20));class d extends o.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 s.Size(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}imageCapture(){if(this.capture)return this.capture;const t=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(t),this.capture}createImageData(t=0,e){var n;return i(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const i=this.getCanvasRenderingContext();if(!i)return;let{videoWidth:r,videoHeight:o}=this.video,{clientVideoWidth:a,clientVideoHeight:s}=this.calculateClientVideoConstraints(),d=a,f=s;if(this.props.windowConfiguration)if(this.props.windowConfiguration.aspectRatio){d*=this.props.windowConfiguration.widthProportion<0||this.props.windowConfiguration.widthProportion>=1?1:this.props.windowConfiguration.widthProportion,f=d/this.props.windowConfiguration.aspectRatio}else this.props.windowConfiguration.width&&this.props.windowConfiguration.height&&(d=parseFloat(this.props.windowConfiguration.width),f=parseFloat(this.props.windowConfiguration.height));const{width:h,height:p}=this.calculateFrameSize(t,d,f),m=null!==(n=this.cutout)&&void 0!==n?n:new u.Frame(0,0,h,p),v=h*this.zoom(),g=p*this.zoom(),y=-v/2+v/this.zoom()/2,b=-g/2+g/this.zoom()/2;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);l.default.debug("Bitmap size: "+e.width*e.height),i.canvas.width=e.width,i.canvas.height=e.height,i.drawImage(e,0,0,e.width,e.height);const n=this.windowSize(),r=e.height/(n.height+n.y),o=n.width*r,a=n.height*r,s=e.width/2-o/2,c=n.y*r,d=new u.Frame(s,c,o,a);l.default.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height);return i.getImageData(d.x,d.y,d.width,d.height)}if(this.video.readyState>1){i.drawImage(this.video,(r-d)/2,(o-f)/2,d,f,y,b,v,g);const t=i.getImageData(m.x,m.y,m.width,m.height);return i.clearRect(0,0,this.canvas.width,this.canvas.height),this.save&&(c.ImageUtils.saveImageData(t),this.save=!1),t}}))}windowSize(){var t;const e=this.props.configuration,n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return u.Frame.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),i=t,r=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&&(r=n.height/e)}return{clientVideoWidth:i,clientVideoHeight:r}}calculateFrameSize(t,e,n){let i=e,r=n;if(t>0&&0!=e&&0!=n){const o=e/n;e>n?(i=e>t?t:e,r=i/o):(r=n>t?t:n,i=r*o)}return new s.Size(i,r)}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 o.default.createElement(a.default,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},o.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 r="unknown";return"user"===i?r="front":"environment"===i&&(r="back"),{deviceId:n,label:e,facingMode:r}}));this.activeCamera=t[0]}}getActiveCameraInfo(){return this.activeCamera}}e.default=d},function(t,e,n){"use strict";var i,r=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var t={};return function(e){if("undefined"==typeof 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]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function u(t,e){for(var n={},i=[],r=0;r<t.length;r++){var o=t[r],u=e.base?o[0]+e.base:o[0],c=n[u]||0,l="".concat(u," ").concat(c);n[u]=c+1;var d=s(l),f={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(a[d].references++,a[d].updater(f)):a.push({identifier:l,updater:v(f,e),references:1}),i.push(l)}return i}function c(t){var e=document.createElement("style"),i=t.attributes||{};if("undefined"==typeof i.nonce){var r=n.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var l,d=(l=[],function(t,e){return l[t]=e,l.filter(Boolean).join("\n")});function f(t,e,n,i){var r=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=d(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function h(t,e,n){var i=n.css,r=n.media,o=n.sourceMap;if(r?t.setAttribute("media",r):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),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 v(t,e){var n,i,r;if(e.singleton){var o=m++;n=p||(p=c(e)),i=f.bind(null,n,o,!1),r=f.bind(null,n,o,!0)}else n=c(e),i=h.bind(null,n,e),r=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 r()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=r());var n=u(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 r=s(n[i]);a[r].references--}for(var o=u(t,e),c=0;c<n.length;c++){var l=s(n[c]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}n=o}}}},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 r={};if(i)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(r[a]=!0)}for(var s=0;s<t.length;s++){var u=[].concat(t[s]);i&&r[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},function(t,e,n){"use strict";n.r(e);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)-.*))$/,r=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.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeResult=void 0;const i=n(5),r=n(51);class o{constructor(t,e){this.barcodes=t,this.imageData=e}static fromWorker(t,e){const n=[];t&&t.forEach((t=>{n.push(r.Barcode.fromWorker(t))}));const a=i.ImageUtils.convertImageDataWrapperToImageData(e);return new o(n,a)}isEmpty(){return 0===this.barcodes.length}}e.BarcodeResult=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}}},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 r=i(n(0)),o=n(6),a=n(72),s=n(1);var u;!function(t){t[t.Right=0]="Right",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Up=3]="Up"}(u||(u={}));class c extends r.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=o.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(),r=o.Frame.fromRect(i),s=o.Frame.fromRect(null===(e=this.overlay)||void 0===e?void 0:e.getBoundingClientRect()),u=o.Frame.fromRect(null===(n=this.window)||void 0===n?void 0:n.getBoundingClientRect());u.x=r.x-s.x,u.y=r.y-s.y;const c=a.ClipPath.fromFrames(s,u);return this.calculateClipPath(c)}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=o.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 r.default.createElement("div",null,r.default.createElement("div",{ref:t=>this.overlay=t,style:this.backgroundStyle}),r.default.createElement("div",{ref:t=>this.container=t,style:this.containerStyle,id:"finder"},r.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}),r.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,u.Right)}\n ${this.roundClipPath(t.right,t.top,u.Down)}\n ${this.roundClipPath(t.right,t.bottom,u.Left)}\n ${this.roundClipPath(t.left,t.bottom,u.Up)}\n\n ${t.left} 100%, \n 100% 100%, \n 100% 0%\n )`}roundClipPath(t,e,n){let i="";let r=new s.Point(a.ClipPath.toNumber(t),a.ClipPath.toNumber(e));switch(n){case u.Right:r.y+=10;break;case u.Down:r.x-=10;break;case u.Left:r.y-=10;break;case u.Up:r.x+=10}let o=[];switch(n){case u.Right:o=[{x:1,y:-3},{x:3,y:-5},{x:5,y:-7},{x:7,y:-9},{x:10,y:-10}];break;case u.Down:o=[{x:3,y:1},{x:5,y:3},{x:7,y:5},{x:9,y:7},{x:10,y:10}];break;case u.Left:o=[{x:-1,y:3},{x:-3,y:5},{x:-5,y:7},{x:-7,y:9},{x:-10,y:10}];break;case u.Up:o=[{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(r,o),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=c},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 Bt})),n.d(e,"StyleSheetConsumer",(function(){return it})),n.d(e,"StyleSheetContext",(function(){return nt})),n.d(e,"StyleSheetManager",(function(){return ct})),n.d(e,"ThemeConsumer",(function(){return Mt})),n.d(e,"ThemeContext",(function(){return At})),n.d(e,"ThemeProvider",(function(){return Dt})),n.d(e,"__PRIVATE__",(function(){return Nt})),n.d(e,"createGlobalStyle",(function(){return zt})),n.d(e,"css",(function(){return bt})),n.d(e,"isStyledComponent",(function(){return b})),n.d(e,"keyframes",(function(){return Vt})),n.d(e,"useTheme",(function(){return Ut})),n.d(e,"version",(function(){return w})),n.d(e,"withTheme",(function(){return Ft}));var i=n(27),r=n(0),o=n(40),a=n.n(o),s=n(41),u=n(42),c=n(18),l=n(28),d=n.n(l);function f(){return(f=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 h=function(t,e){for(var n=[t[0]],i=0,r=e.length;i<r;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([]),v=Object.freeze({});function g(t){return"function"==typeof t}function y(t){return t.displayName||t.name||"Component"}function b(t){return t&&"string"==typeof t.styledComponentId}var _="undefined"!=typeof t&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",w="5.3.3",C="undefined"!=typeof window&&"HTMLElement"in window,x=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof 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:"undefined"!=typeof t&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),S={};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,r=i;t>=r;)(r<<=1)<0&&E(16,""+t);this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var o=i;o<r;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(t+1),s=0,u=e.length;s<u;s++)this.tag.insertRule(a,e[s])&&(this.groupSizes[t]++,a++)},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 r=n;r<i;r++)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),r=i+n,o=i;o<r;o++)e+=this.tag.getRule(o)+"/*!sc*/\n";return e},t}(),k=new Map,O=new Map,T=1,A=function(t){if(k.has(t))return k.get(t);for(;O.has(T);)T++;var e=T++;return k.set(t,e),O.set(e,t),e},M=function(t){return O.get(t)},D=function(t,e){e>=T&&(T=e+1),k.set(t,e),O.set(e,t)},L="style["+_+'][data-styled-version="5.3.3"]',R=new RegExp("^"+_+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),I=function(t,e,n){for(var i,r=n.split(","),o=0,a=r.length;o<a;o++)(i=r[o])&&t.registerName(e,i)},j=function(t,e){for(var n=(e.textContent||"").split("/*!sc*/\n"),i=[],r=0,o=n.length;r<o;r++){var a=n[r].trim();if(a){var s=a.match(R);if(s){var u=0|parseInt(s[1],10),c=s[2];0!==u&&(D(c,u),I(t,c,s[3]),t.getTag().insertRules(u,i)),i.length=0}else i.push(a)}}},z=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},V=function(t){var e=document.head,n=t||e,i=document.createElement("style"),r=function(t){for(var e=t.childNodes,n=e.length;n>=0;n--){var i=e[n];if(i&&1===i.nodeType&&i.hasAttribute(_))return i}}(n),o=void 0!==r?r.nextSibling:null;i.setAttribute(_,"active"),i.setAttribute("data-styled-version","5.3.3");var a=z();return a&&i.setAttribute("nonce",a),n.insertBefore(i,o),i},B=function(){function t(t){var e=this.element=V(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 r=e[n];if(r.ownerNode===t)return r}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}(),F=function(){function t(t){var e=this.element=V(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}(),N=C,H={isServer:!C,useCSSOMInjection:!x},W=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={}),this.options=f({},H,{},t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&C&&N&&(N=!1,function(t){for(var e=document.querySelectorAll(L),n=0,i=e.length;n<i;n++){var r=e[n];r&&"active"!==r.getAttribute(_)&&(j(t,r),r.parentNode&&r.parentNode.removeChild(r))}}(this))}t.registerId=function(t){return A(t)};var e=t.prototype;return e.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(f({},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,r=e.target,t=n?new U(r):i?new B(r):new F(r),new P(t)));var t,e,n,i,r},e.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},e.registerName=function(t,e){if(A(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(A(t),n)},e.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.clearRules=function(t){this.getTag().clearGroup(A(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="",r=0;r<n;r++){var o=M(r);if(void 0!==o){var a=t.names.get(o),s=e.getGroup(r);if(a&&s&&a.size){var u=_+".g"+r+'[id="'+o+'"]',c="";void 0!==a&&a.forEach((function(t){t.length>0&&(c+=t+",")})),i+=""+s+u+'{content:"'+c+'"}/*!sc*/\n'}}}return i}(this)},t}(),$=/(a)(d)/gi,X=function(t){return String.fromCharCode(t+(t>25?39:97))};function Y(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=X(e%52)+n;return(X(e%52)+n).replace($,"$1-$2")}var G=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},q=function(t){return G(5381,t)};function Z(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(g(n)&&!b(n))return!1}return!0}var K=q("5.3.3"),J=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Z(t),this.componentId=e,this.baseHash=G(K,e),this.baseStyle=n,W.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var i=this.componentId,r=[];if(this.baseStyle&&r.push(this.baseStyle.generateAndInjectStyles(t,e,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(i,this.staticRulesId))r.push(this.staticRulesId);else{var o=gt(this.rules,t,e,n).join(""),a=Y(G(this.baseHash,o)>>>0);if(!e.hasNameForId(i,a)){var s=n(o,"."+a,void 0,i);e.insertRules(i,a,s)}r.push(a),this.staticRulesId=a}else{for(var u=this.rules.length,c=G(this.baseHash,n.hash),l="",d=0;d<u;d++){var f=this.rules[d];if("string"==typeof f)l+=f;else if(f){var h=gt(f,t,e,n),p=Array.isArray(h)?h.join(""):h;c=G(c,p+d),l+=p}}if(l){var m=Y(c>>>0);if(!e.hasNameForId(i,m)){var v=n(l,"."+m,void 0,i);e.insertRules(i,m,v)}r.push(m)}}return r.join(" ")},t}(),Q=/^\s*\/\/.*$/gm,tt=[":","[",".","#"];function et(t){var e,n,i,r,o=void 0===t?v:t,a=o.options,u=void 0===a?v:a,c=o.plugins,l=void 0===c?m:c,d=new s.a(u),f=[],h=function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(n,i,r,o,a,s,u,c,l,d){switch(n){case 1:if(0===l&&64===i.charCodeAt(0))return t(i+";"),"";break;case 2:if(0===c)return i+"/*|*/";break;case 3:switch(c){case 102:case 112:return t(r[0]+i),"";default:return i+(0===d?"/*|*/":"")}case-2:i.split("/*|*/}").forEach(e)}}}((function(t){f.push(t)})),p=function(t,i,o){return 0===i&&-1!==tt.indexOf(o[n.length])||o.match(r)?t:"."+e};function g(t,o,a,s){void 0===s&&(s="&");var u=t.replace(Q,""),c=o&&a?a+" "+o+" { "+u+" }":u;return e=s,n=o,i=new RegExp("\\"+n+"\\b","g"),r=new RegExp("(\\"+n+"\\b){2,}"),d(a||!o?"":o,c)}return d.use([].concat(l,[function(t,e,r){2===t&&r.length&&r[0].lastIndexOf(n)>0&&(r[0]=r[0].replace(i,p))},h,function(t){if(-2===t){var e=f;return f=[],e}}])),g.hash=l.length?l.reduce((function(t,e){return e.name||E(15),G(t,e.name)}),5381).toString():"",g}var nt=r.default.createContext(),it=nt.Consumer,rt=r.default.createContext(),ot=(rt.Consumer,new W),at=et();function st(){return Object(r.useContext)(nt)||ot}function ut(){return Object(r.useContext)(rt)||at}function ct(t){var e=Object(r.useState)(t.stylisPlugins),n=e[0],i=e[1],o=st(),s=Object(r.useMemo)((function(){var e=o;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]),u=Object(r.useMemo)((function(){return et({options:{prefix:!t.disableVendorPrefixes},plugins:n})}),[t.disableVendorPrefixes,n]);return Object(r.useEffect)((function(){a()(n,t.stylisPlugins)||i(t.stylisPlugins)}),[t.stylisPlugins]),r.default.createElement(nt.Provider,{value:s},r.default.createElement(rt.Provider,{value:u},t.children))}var lt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=at);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=at),this.name+t.hash},t}(),dt=/([A-Z])/,ft=/([A-Z])/g,ht=/^ms-/,pt=function(t){return"-"+t.toLowerCase()};function mt(t){return dt.test(t)?t.replace(ft,pt).replace(ht,"-ms-"):t}var vt=function(t){return null==t||!1===t||""===t};function gt(t,e,n,i){if(Array.isArray(t)){for(var r,o=[],a=0,s=t.length;a<s;a+=1)""!==(r=gt(t[a],e,n,i))&&(Array.isArray(r)?o.push.apply(o,r):o.push(r));return o}return vt(t)?"":b(t)?"."+t.styledComponentId:g(t)?"function"!=typeof(c=t)||c.prototype&&c.prototype.isReactComponent||!e?t:gt(t(e),e,n,i):t instanceof lt?n?(t.inject(n,i),t.getName(i)):t:p(t)?function t(e,n){var i,r,o=[];for(var a in e)e.hasOwnProperty(a)&&!vt(e[a])&&(Array.isArray(e[a])&&e[a].isCss||g(e[a])?o.push(mt(a)+":",e[a],";"):p(e[a])?o.push.apply(o,t(e[a],a)):o.push(mt(a)+": "+(i=a,(null==(r=e[a])||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||i in u.a?String(r).trim():r+"px")+";")));return n?[n+" {"].concat(o,["}"]):o}(t):t.toString();var c}var yt=function(t){return Array.isArray(t)&&(t.isCss=!0),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];return g(t)||p(t)?yt(gt(h(m,[t].concat(n)))):0===n.length&&1===t.length&&"string"==typeof t[0]?t:yt(gt(h(t,n)))}new Set;var _t=function(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme},wt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ct=/(^-|-$)/g;function xt(t){return t.replace(wt,"-").replace(Ct,"")}var St=function(t){return Y(q(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 Ot(t,e,n){var i=t[n];Pt(e)&&Pt(i)?Tt(i,e):t[n]=e}function Tt(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 r=0,o=n;r<o.length;r++){var a=o[r];if(Pt(a))for(var s in a)kt(s)&&Ot(t,a[s],s)}return t}var At=r.default.createContext(),Mt=At.Consumer;function Dt(t){var e=Object(r.useContext)(At),n=Object(r.useMemo)((function(){return function(t,e){return t?g(t)?t(e):Array.isArray(t)||"object"!=typeof t?E(8):e?f({},e,{},t):t:E(14)}(t.theme,e)}),[t.theme,e]);return t.children?r.default.createElement(At.Provider,{value:n},t.children):null}var Lt={};function Rt(t,e,n){var i=b(t),o=!Et(t),a=e.attrs,s=void 0===a?m:a,u=e.componentId,l=void 0===u?function(t,e){var n="string"!=typeof t?"sc":xt(t);Lt[n]=(Lt[n]||0)+1;var i=n+"-"+St("5.3.3"+n+Lt[n]);return e?e+"-"+i:i}(e.displayName,e.parentComponentId):u,h=e.displayName,p=void 0===h?function(t){return Et(t)?"styled."+t:"Styled("+y(t)+")"}(t):h,_=e.displayName&&e.componentId?xt(e.displayName)+"-"+e.componentId:e.componentId||l,w=i&&t.attrs?Array.prototype.concat(t.attrs,s).filter(Boolean):s,C=e.shouldForwardProp;i&&t.shouldForwardProp&&(C=e.shouldForwardProp?function(n,i,r){return t.shouldForwardProp(n,i,r)&&e.shouldForwardProp(n,i,r)}:t.shouldForwardProp);var x,S=new J(n,_,i?t.componentStyle:void 0),E=S.isStatic&&0===s.length,P=function(t,e){return function(t,e,n,i){var o=t.attrs,a=t.componentStyle,s=t.defaultProps,u=t.foldedComponentIds,l=t.shouldForwardProp,d=t.styledComponentId,h=t.target,p=function(t,e,n){void 0===t&&(t=v);var i=f({},e,{theme:t}),r={};return n.forEach((function(t){var e,n,o,a=t;for(e in g(a)&&(a=a(i)),a)i[e]=r[e]="className"===e?(n=r[e],o=a[e],n&&o?n+" "+o:n||o):a[e]})),[i,r]}(_t(e,Object(r.useContext)(At),s)||v,e,o),m=p[0],y=p[1],b=function(t,e,n,i){var r=st(),o=ut();return e?t.generateAndInjectStyles(v,r,o):t.generateAndInjectStyles(n,r,o)}(a,i,m),_=n,w=y.$as||e.$as||y.as||e.as||h,C=Et(w),x=y!==e?f({},e,{},y):e,S={};for(var E in x)"$"!==E[0]&&"as"!==E&&("forwardedAs"===E?S.as=x[E]:(l?l(E,c.default,w):!C||Object(c.default)(E))&&(S[E]=x[E]));return e.style&&y.style!==e.style&&(S.style=f({},e.style,{},y.style)),S.className=Array.prototype.concat(u,d,b!==d?b:null,e.className,y.className).filter(Boolean).join(" "),S.ref=_,Object(r.createElement)(w,S)}(x,t,e,E)};return P.displayName=p,(x=r.default.forwardRef(P)).attrs=w,x.componentStyle=S,x.displayName=p,x.shouldForwardProp=C,x.foldedComponentIds=i?Array.prototype.concat(t.foldedComponentIds,t.styledComponentId):m,x.styledComponentId=_,x.target=i?t.target:t,x.withComponent=function(t){var i=e.componentId,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(e,["componentId"]),o=i&&i+"-"+(Et(t)?t:xt(y(t)));return Rt(t,f({},r,{attrs:w,componentId:o}),n)},Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?Tt({},t.defaultProps,e):e}}),x.toString=function(){return"."+x.styledComponentId},o&&d()(x,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),x}var It=function(t){return function t(e,n,r){if(void 0===r&&(r=v),!Object(i.isValidElementType)(n))return E(1,String(n));var o=function(){return e(n,r,bt.apply(void 0,arguments))};return o.withConfig=function(i){return t(e,n,f({},r,{},i))},o.attrs=function(i){return t(e,n,f({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},o}(Rt,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){It[t]=It(t)}));var jt=function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Z(t),W.registerId(this.componentId+1)}var e=t.prototype;return e.createStyles=function(t,e,n,i){var r=i(gt(this.rules,e,n,i).join(""),""),o=this.componentId+t;n.insertRules(o,o,r)},e.removeStyles=function(t,e){e.clearRules(this.componentId+t)},e.renderStyles=function(t,e,n,i){t>2&&W.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,i)},t}();function zt(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=bt.apply(void 0,[t].concat(n)),a="sc-global-"+St(JSON.stringify(o)),s=new jt(o,a);function u(t){var e=st(),n=ut(),i=Object(r.useContext)(At),o=Object(r.useRef)(e.allocateGSInstance(a)).current;return e.server&&c(o,t,e,i,n),Object(r.useLayoutEffect)((function(){if(!e.server)return c(o,t,e,i,n),function(){return s.removeStyles(o,e)}}),[o,t,e,i,n]),null}function c(t,e,n,i,r){if(s.isStatic)s.renderStyles(t,S,n,r);else{var o=f({},e,{theme:_t(e,i,u.defaultProps)});s.renderStyles(t,o,n,r)}}return r.default.memo(u)}function Vt(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=bt.apply(void 0,[t].concat(n)).join(""),o=St(r);return new lt(o,r)}var Bt=function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var n=z();return"<style "+[n&&'nonce="'+n+'"',_+'="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={})[_]="",e["data-styled-version"]="5.3.3",e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),i=z();return i&&(n.nonce=i),[r.default.createElement("style",f({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new W({isServer:!0}),this.sealed=!1}var e=t.prototype;return e.collectStyles=function(t){return this.sealed?E(2):r.default.createElement(ct,{sheet:this.instance},t)},e.interleaveWithNodeStream=function(t){return E(3)},t}(),Ft=function(t){var e=r.default.forwardRef((function(e,n){var i=Object(r.useContext)(At),o=t.defaultProps,a=_t(e,i,o);return r.default.createElement(t,f({},e,{theme:a,ref:n}))}));return d()(e,t),e.displayName="WithTheme("+y(t)+")",e},Ut=function(){return Object(r.useContext)(At)},Nt={StyleSheet:W,masterSheet:ot};e.default=It}.call(this,n(78))},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(17),r=n.n(i)()((function(t){return t[1]}));r.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=r},function(t,e,n){"use strict";var i=n(17),r=n.n(i)()((function(t){return t[1]}));r.push([t.i,".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=r},function(t,e,n){"use strict";t.exports=n(79)},function(t,e,n){"use strict";var i=n(80),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return i.isMemo(t)?a:s[t.$$typeof]||r}s[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[i.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,i){if("string"!=typeof n){if(p){var r=h(n);r&&r!==p&&t(e,r,i)}var a=l(n);d&&(a=a.concat(d(n)));for(var s=u(e),m=u(n),v=0;v<a.length;++v){var g=a[v];if(!(o[g]||i&&i[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{c(e,g,y)}catch(t){}}}}return e}},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(45));var r="4.0.1-alpha.2";class o{}e.Constants=o,o.VERSION=r,o.CDN_PATH=r&&`https://cdn.jsdelivr.net/npm/scanbot-web-sdk@${r}/bundle/`,o.DEFAULT_WASM_FOLDER="bin/complete/"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentScannerConfiguration=e.CaptureAnimationStyleConfiguration=e.OutlinePolygonStyleConfiguration=e.OutlineStyleConfiguration=e.TextConfiguration=void 0;const i=n(9),r={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 o{constructor(t){this.hint=t}}e.TextConfiguration=o;class a{constructor(){this.outline=new s,this.captureButton=new d}}class s{constructor(){this.polygon=new u,this.path=new c,this.label=new l}}e.OutlineStyleConfiguration=s;class u{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}e.OutlinePolygonStyleConfiguration=u;class c{constructor(){this.stroke="green",this.strokeWidth=4}}e.CaptureAnimationStyleConfiguration=c;class l{}class d{constructor(){this.color="#FFF"}}class f extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_4K),this.acceptedAngleScore=f.DEFAULT_ACCEPTED_ANGLE_SCORE,this.acceptedSizeScore=f.DEFAULT_ACCEPTED_SIZE_SCORE,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new o(r),this.style=new a,this.onDocumentDetected=function(t){}}static fromJson(t){const e=new f;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","path","label"]);const t=n.polygon;t&&this.mapValues(t,e.style.outline.polygon);const i=n.path;i&&this.mapValues(i,e.style.outline.path);const r=n.label;r&&this.mapValues(r,e.style.outline.label)}const i=t.style.captureButton;i&&this.mapValues(i,e.style.captureButton)}return this.mapVideoConstraints(t,e),e}}e.DocumentScannerConfiguration=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseConfiguration=void 0;class i{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])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((r=>{r in e&&n(t[r])&&n(e[r])?i.mapValuesDeep(t[r],e[r]):e[r]=t[r]}))}static _fromJson(t,e){let n=new t;return this.mapValuesDeep(e,n),n}}e.BaseConfiguration=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(11);e.default=class{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=r.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.TextDataScannerConfiguration=e.TextDataScannerViewFinderStyle=void 0;const i=n(9);class r{constructor(){this.aspectRatio=6,this.widthProportion=.8,this.borderColor="white",this.left="50%",this.top="50%",this.transform="translate(-50%, -50%)"}}class o{constructor(){this.color="white",this.size="0.9em",this.weight=300}}class a{constructor(){this.window=new r,this.text=new o,this.backgroundColor="rgba(0, 0, 0, 0.7)",this.hint="Please hold the device over the text to start scanning"}}e.TextDataScannerViewFinderStyle=a;class s extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onTextDetected=function(t){},this.style=new a}static fromJson(t){return this._fromJson(s,t)}}e.TextDataScannerConfiguration=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i{static throwIfMissingBuffer(t){i.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}e.default=i},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 r=i(n(0));n(62);const o=i(n(13));e.ShutterButtonProps=class{};class a{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 s extends r.default.Component{constructor(){super(...arguments),this.inner1=new a("scanbot-shutter-rotate"),this.inner2=new a("scanbot-shutter-rotate")}render(){return r.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,r.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},r.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},r.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},r.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},r.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 r.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n=void 0){return r.default.createElement("div",{className:(0,o.default)(t),ref:n},r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}e.ShutterButton=s},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 r=t[(i+2)%n].x-t[(i+1)%n].x,o=t[(i+2)%n].y-t[(i+1)%n].y,a=t[i].x-t[(i+1)%n].x,s=r*(t[i].y-t[(i+1)%n].y)-o*a;if(0==i)e=s>0;else if(e!=s>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 r=i(n(0));class o extends r.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=o},function(t,e){t.exports=function(t,e,n,i){var r=n?n.call(i,t,e):void 0;if(void 0!==r)return!!r;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!s(c))return!1;var l=t[c],d=e[c];if(!1===(r=n?n.call(i,l,d,c):void 0)||void 0===r&&l!==d)return!1}return!0}},function(t,e,n){"use strict";e.a=function(t){function e(t,i,u,c,f){for(var h,p,m,v,_,C=0,x=0,S=0,E=0,P=0,D=0,R=m=h=0,j=0,z=0,V=0,B=0,F=u.length,U=F-1,N="",H="",W="",$="";j<F;){if(p=u.charCodeAt(j),j===U&&0!==x+E+S+C&&(0!==x&&(p=47===x?10:47),E=S=C=0,F++,U++),0===x+E+S+C){if(j===U&&(0<z&&(N=N.replace(d,"")),0<N.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:N+=u.charAt(j)}p=59}switch(p){case 123:for(h=(N=N.trim()).charCodeAt(0),m=1,B=++j;j<F;){switch(p=u.charCodeAt(j)){case 123:m++;break;case 125:m--;break;case 47:switch(p=u.charCodeAt(j+1)){case 42:case 47:t:{for(R=j+1;R<U;++R)switch(u.charCodeAt(R)){case 47:if(42===p&&42===u.charCodeAt(R-1)&&j+2!==R){j=R+1;break t}break;case 10:if(47===p){j=R+1;break t}}j=R}}break;case 91:p++;case 40:p++;case 34:case 39:for(;j++<U&&u.charCodeAt(j)!==p;);}if(0===m)break;j++}if(m=u.substring(B,j),0===h&&(h=(N=N.replace(l,"").trim()).charCodeAt(0)),64===h){switch(0<z&&(N=N.replace(d,"")),p=N.charCodeAt(1)){case 100:case 109:case 115:case 45:z=i;break;default:z=M}if(B=(m=e(i,z,m,p,f+1)).length,0<L&&(_=s(3,m,z=n(M,N,V),i,O,k,B,p,f,c),N=z.join(""),void 0!==_&&0===(B=(m=_.trim()).length)&&(p=0,m="")),0<B)switch(p){case 115:N=N.replace(w,a);case 100:case 109:case 45:m=N+"{"+m+"}";break;case 107:m=(N=N.replace(g,"$1 $2"))+"{"+m+"}",m=1===A||2===A&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=N+m,112===c&&(H+=m,m="")}else m=""}else m=e(i,n(i,N,V),m,c,f+1);W+=m,m=V=z=R=h=0,N="",p=u.charCodeAt(++j);break;case 125:case 59:if(1<(B=(N=(0<z?N.replace(d,""):N).trim()).length))switch(0===R&&(h=N.charCodeAt(0),45===h||96<h&&123>h)&&(B=(N=N.replace(" ",":")).length),0<L&&void 0!==(_=s(1,N,i,t,O,k,H.length,c,f,c))&&0===(B=(N=_.trim()).length)&&(N="\0\0"),h=N.charCodeAt(0),p=N.charCodeAt(1),h){case 0:break;case 64:if(105===p||99===p){$+=N+u.charAt(j);break}default:58!==N.charCodeAt(B-1)&&(H+=r(N,h,p,N.charCodeAt(2)))}V=z=R=h=0,N="",p=u.charCodeAt(++j)}}switch(p){case 13:case 10:47===x?x=0:0===1+h&&107!==c&&0<N.length&&(z=1,N+="\0"),0<L*I&&s(0,N,i,t,O,k,H.length,c,f,c),k=1,O++;break;case 59:case 125:if(0===x+E+S+C){k++;break}default:switch(k++,v=u.charAt(j),p){case 9:case 32:if(0===E+C+x)switch(P){case 44:case 58:case 9:case 32:v="";break;default:32!==p&&(v=" ")}break;case 0:v="\\0";break;case 12:v="\\f";break;case 11:v="\\v";break;case 38:0===E+x+C&&(z=V=1,v="\f"+v);break;case 108:if(0===E+x+C+T&&0<R)switch(j-R){case 2:112===P&&58===u.charCodeAt(j-3)&&(T=P);case 8:111===D&&(T=D)}break;case 58:0===E+x+C&&(R=j);break;case 44:0===x+S+E+C&&(z=1,v+="\r");break;case 34:case 39:0===x&&(E=E===p?0:0===E?p:E);break;case 91:0===E+x+S&&C++;break;case 93:0===E+x+S&&C--;break;case 41:0===E+x+C&&S--;break;case 40:if(0===E+x+C){if(0===h)if(2*P+3*D==533);else h=1;S++}break;case 64:0===x+S+E+C+R+m&&(m=1);break;case 42:case 47:if(!(0<E+C+S))switch(x){case 0:switch(2*p+3*u.charCodeAt(j+1)){case 235:x=47;break;case 220:B=j,x=42}break;case 42:47===p&&42===P&&B+2!==j&&(33===u.charCodeAt(B+2)&&(H+=u.substring(B,j+1)),v="",x=0)}}0===x&&(N+=v)}D=P,P=p,j++}if(0<(B=H.length)){if(z=i,0<L&&(void 0!==(_=s(2,H,z,t,O,k,B,c,f,c))&&0===(H=_).length))return $+H+W;if(H=z.join(",")+"{"+H+"}",0!=A*T){switch(2!==A||o(H,2)||(T=0),T){case 111:H=H.replace(b,":-moz-$1")+H;break;case 112:H=H.replace(y,"::-webkit-input-$1")+H.replace(y,"::-moz-$1")+H.replace(y,":-ms-input-$1")+H}T=0}}return $+H+W}function n(t,e,n){var r=e.trim().split(m);e=r;var o=r.length,a=t.length;switch(a){case 0:case 1:var s=0;for(t=0===a?"":t[0]+" ";s<o;++s)e[s]=i(t,e[s],n).trim();break;default:var u=s=0;for(e=[];s<o;++s)for(var c=0;c<a;++c)e[u++]=i(t[c]+" ",r[s],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(v,"$1"+t.trim());case 58:return t.trim()+e.replace(v,"$1"+t.trim());default:if(0<1*n&&0<e.indexOf("\f"))return e.replace(v,(58===t.charCodeAt(0)?"":"$1")+t.trim())}return t+e}function r(t,e,n,i){var a=t+";",s=2*e+3*n+4*i;if(944===s){t=a.indexOf(":",9)+1;var u=a.substring(t,a.length-1).trim();return u=a.substring(0,t).trim()+u+";",1===A||2===A&&o(u,1)?"-webkit-"+u+u:u}if(0===A||2===A&&!o(a,1))return a;switch(s){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(P,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(u=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+u+a;case 1005:return h.test(a)?a.replace(f,":-webkit-")+a.replace(f,":-moz-")+a:a;case 1e3:switch(e=(u=a.substring(13).trim()).indexOf("-")+1,u.charCodeAt(0)+u.charCodeAt(e)){case 226:u=a.replace(_,"tb");break;case 232:u=a.replace(_,"tb-rl");break;case 220:u=a.replace(_,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+u+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(e=(a=t).length-10,s=(u=(33===a.charCodeAt(e)?a.substring(0,e):a).substring(t.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|u.charCodeAt(7))){case 203:if(111>u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102<s?"inline-":"")+"box")+";"+a.replace(u,"-webkit-"+u)+";"+a.replace(u,"-ms-"+u+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return u=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+u+"-ms-flex-"+u+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(x,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(x,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===E.test(t))return 115===(u=t.substring(t.indexOf(":")+1)).charCodeAt(0)?r(t.replace("stretch","fill-available"),e,n,i).replace(":fill-available",":stretch"):a.replace(u,"-webkit-"+u)+a.replace(u,"-moz-"+u.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===n+i&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+a}return a}function o(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),R(2!==e?i:i.replace(S,"$1"),n,e)}function a(t,e){var n=r(e,e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2));return n!==e+";"?n.replace(C," or ($1)").substring(4):"("+e+")"}function s(t,e,n,i,r,o,a,s,u,l){for(var d,f=0,h=e;f<L;++f)switch(d=D[f].call(c,t,h,n,i,r,o,a,s,u,l)){case void 0:case!1:case!0:case null:break;default:h=d}if(h!==e)return h}function u(t){return void 0!==(t=t.prefix)&&(R=null,t?"function"!=typeof t?A=1:(A=2,R=t):A=0),u}function c(t,n){var i=t;if(33>i.charCodeAt(0)&&(i=i.trim()),i=[i],0<L){var r=s(-1,n,i,i,O,k,0,0,0,0);void 0!==r&&"string"==typeof r&&(n=r)}var o=e(M,i,n,0,0);return 0<L&&(void 0!==(r=s(-2,o,i,i,O,k,o.length,0,0,0))&&(o=r)),"",T=0,k=O=1,o}var l=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,h=/zoo|gra/,p=/([,: ])(transform)/g,m=/,\r+?/g,v=/([\t\r\n ])*\f?&/g,g=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,b=/:(read-only)/g,_=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,x=/-self|flex-/g,S=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,k=1,O=1,T=0,A=1,M=[],D=[],L=0,R=null,I=0;return c.use=function t(e){switch(e){case void 0:case null:L=D.length=0;break;default:if("function"==typeof e)D[L++]=e;else if("object"==typeof e)for(var n=0,i=e.length;n<i;++n)t(e[n]);else I=0|!!e}return t},c.set=u,void 0!==t&&u(t),c}},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 r=i(n(10));e.ScanbotSDK=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;const i=n(29),r=n(46);class o{constructor(t,e){t||(t=i.Constants.CDN_PATH+i.Constants.DEFAULT_WASM_FOLDER),this.core=new r.WorkerBridge(t,e)}postByCopyingArgs(t,e){return this.core.postByCopyingArgs(t,e)}postByTransferringArgs(t,e){return this.core.postByTransferringArgs(t,e)}}e.WorkerBridge=o,o.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(47);e.WorkerBridge=class{constructor(t,e){const{allowSimd:n=!0}=e||{},r=n&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(t){return!1}}()?"-simd":"",o=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${r}.js`;if((0,i.isRemote)(o)){const t=new Blob([`importScripts("${o}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(o);this.continuations={},this.nextTicketId=1,this.instance.onmessage=t=>{const{log:e,logError:n}=t.data;if(e)return void console.log(...e);if(n)return void console.error(...n);const{ticket:i,result:r,error:o}=t.data,{resolve:a,reject:s}=this.continuations[i];delete this.continuations[i],o?s(o):a(r)}}post(t,e,n){return new Promise(((r,o)=>{const a=(0,i.gatherTransferables)(e,n),s=this.nextTicketId++;this.continuations[s]={resolve:r,reject:o},this.instance.postMessage({command:t,args:e,ticket:s},a)}))}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},e.isRemote=function(t){return t.startsWith("http:")||t.startsWith("https:")}},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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((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 r{constructor(t,e,n,i,r,o){this.format=t,this.text=e,this.parsedText=n,this.rawBytes=i,this.points=r,this.barcodeImage=o}id(){return this.text+this.format}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 r(t.format,t.text,e,t.rawBytes,n,t.barcodeImage)}}e.Barcode=r},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=n(53);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 r.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"),r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){n.width=r.width,n.height=r.height;const t=n.getContext("2d");t.drawImage(r,0,0);const i=t.getImageData(0,0,r.width,r.height),o=yield this.recognize(i);o&&e(o)}))}))}))}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 r{}e.MrzCheckDigits=r;class o{static fromWorker(t){let e=new o;const n=new r,a=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)),a?e.checkDigits=n:e=void 0,e}}e.MrzResult=o},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((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"),r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){n.width=r.width,n.height=r.height;const t=n.getContext("2d");t.drawImage(r,0,0);const i=t.getImageData(0,0,r.width,r.height),o=yield this.performOcr(i);e(o)}))}))}))}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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=n(56);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 r.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"),r=document.createElement("img");r.src=t,r.onload=()=>i(this,void 0,void 0,(function*(){n.width=r.width,n.height=r.height;const t=n.getContext("2d");t.drawImage(r,0,0);const i=t.getImageData(0,0,r.width,r.height),o=yield this.recognize(i);o&&e(o)}))}))}))}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.VINScannerConfiguration=void 0;const i=n(9),r=n(33);class o extends r.TextDataScannerViewFinderStyle{constructor(){super(...arguments),this.hint="Please hold the device over the vehicle identification number to start scanning"}}class a extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onTextDetected=function(t){},this.style=new o}static fromJson(t){return this._fromJson(a,t)}}e.VINScannerConfiguration=a},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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(34));e.default=class{constructor(t,e){this._sdk=t,this._token=e}analyze(t){return i(this,void 0,void 0,(function*(){o.default.throwIfMissingBuffer(t);return yield this._sdk.bridge.postByCopyingArgs("documentQualityAnalyzerAnalyze",[this._token,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(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(0)),a=n(0),s=r(n(10)),u=n(30),c=n(7),l=n(4),d=n(1),f=n(12),h=n(36),p=n(63),m=r(n(15)),v=n(11),g=n(69),y=r(n(20));f.ScanbotCameraState;f.ScanbotCameraProps;class b extends f.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(!s.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=u.DocumentScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get autoCaptureDelay(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}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,a.render)(o.default.createElement(b,{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=yield this.camera.createImageData(b.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);if(!t)return;y.default.debug("Detect & Crop document of size: "+t.height*t.width);const e=new l.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(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return i(this,void 0,void 0,(function*(){t.componentDidMount.call(this),this.detect(),this.recognizer=yield this.bridge.postByTransferringArgs("createDocumentDetector",[{useCombinedDetector:!1,acceptedAngleScore:this.configuration.acceptedAngleScore,acceptedSizeScore:this.configuration.acceptedSizeScore}])}))}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return i(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield s.default.instance.release(this.recognizer,"Document Scanner")}))}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,v.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=yield this.camera.createImageData(f.ScannerView.DEFAULT_DETECTION_RESOLUTION);if(!t||!this.enabled)return;const e=[this.recognizer,t];return yield this.bridge.postByCopyingArgs("documentDetectorDetect",e)}))}handleAutoCapture(t,e=void 0){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 g.PolygonMovementPredicate(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);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)}))),this.autoCaptureDelay)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e;const{action:n}=this.state,{configuration:i}=this,r=null===(t=i.style)||void 0===t?void 0:t.captureButton;return o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},o.default.createElement(m.default,{configuration:this.configuration,videoConstraints:i.videoConstraints,mirrored:i.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),o.default.createElement(p.DocumentOutline,{ref:t=>{this.outline=t},style:null===(e=i.style)||void 0===e?void 0:e.outline,action:n,autoCaptureDelay:this.autoCaptureDelay}),o.default.createElement(h.ShutterButton,{color:(null==r?void 0:r.color)?r.color:"FFF",action:n,onClick:this.enabled?i.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=l.Size.fromHtmlElement(this.camera.video),i=c.ViewUtils.findScale(n,e);t=(t=c.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(f.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}e.default=b,b.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 r{constructor(t,e){this.p1=t,this.p2=e}static scaleToLine(t,e,n,o){const a=new i.Point(o*(t.p1.x-e),o*(t.p1.y-n)),s=new i.Point(o*(t.p2.x-e),o*(t.p2.y-n));return new r(a,s)}}e.MagneticLine=r},function(t,e,n){"use strict";n.r(e);var i=n(16),r=n.n(i),o=n(25),a={insert:"head",singleton:!1};r()(o.a,a);e.default=o.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 r=i(n(0)),o=i(n(13));n(64);const a=i(n(65));class s extends r.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="searching"===this.props.action||"capturing"===this.props.action,s="processing"!==this.props.action&&n,u=(0,o.default)({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:s,[`${this.hintLabelClassName}-hidden`]:!s});return r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},r.default.createElement(a.default,{ref:t=>{this.polygon=t},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:t,isVisible:s,autoCaptureDelay:this.props.autoCaptureDelay}),i&&r.default.createElement("label",{ref:t=>this.label=t,style:this.props.style.label,className:u,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){this.polygon.update(e,t,this.props.action),this.label&&(this.label.innerHTML=n)}}e.DocumentOutline=s},function(t,e,n){"use strict";n.r(e);var i=n(16),r=n.n(i),o=n(26),a={insert:"head",singleton:!1};r()(o.a,a);e.default=o.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.AnimatedDocumentPolygonProps=void 0;const r=i(n(0)),o=i(n(66)),a=n(8),s=i(n(67));e.AnimatedDocumentPolygonProps=class{};class u extends r.default.Component{render(){return r.default.createElement(a.motion.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},r.default.createElement(o.default,{ref:t=>this.polygon=t,style:this.props.polygonStyle}),r.default.createElement(s.default,{ref:t=>this.path=t,style:this.props.pathStyle,duration:this.props.autoCaptureDelay}))}update(t,e,n){var i;const r="processing"!==n&&!!t,o=null!==(i=this.previous)&&void 0!==i?i:t,a=this.previous?t:void 0;this.polygon.update(o,a,e,r),this.previous=t,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}e.default=u},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 r=n(8),o=i(n(0)),a=n(1),s=i(n(13)),u=n(14);class c extends o.default.Component{constructor(t){super(t),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(t,e,n,i){const r={points:t,animatedPoints:e,isOk:n,isVisible:i};this.setState(r)}pointStringOrLatestValidPoints(t){return t&&t.length>0?a.Point.toSvgString(t):a.Point.toSvgString(this.latestValidPoints)}render(){var t;this.state.points&&(this.latestValidPoints=this.state.points);const e=null!==(t=this.props.style)&&void 0!==t?t:{},n=(0,s.default)(u.DocumentLineQuad.CLASSNAME,{[`${u.DocumentLineQuad.CLASSNAME}-ok`]:this.state.isOk},{[`${u.DocumentLineQuad.CLASSNAME}-visible`]:this.state.isVisible},{[`${u.DocumentLineQuad.CLASSNAME}-hidden`]:!this.state.isVisible});return o.default.createElement(r.motion.polygon,{ref:t=>this.polygon=t,style:{strokeWidth:e.strokeWidth||2},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?e.strokeCapturing:e.strokeSearching,fill:this.state.isOk?e.fillCapturing:e.fillSearching},onClick:()=>{},fill:"transparent",className:n})}}e.default=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.AnimatedPathProps=void 0;const r=i(n(0)),o=n(8),a=n(1),s=n(14);e.AnimatedPathProps=class{constructor(){this.duration=1e3}};class u extends r.default.Component{constructor(t){super(t),this.state={path:void 0}}render(){var t,e;return this.state.path?r.default.createElement(o.motion.path,{initial:{pathLength:0},animate:{pathLength:1},transition:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:1/0,repeatType:"loop",repeatDelay:1},stroke:(null===(t=this.props.style)||void 0===t?void 0:t.stroke)||"white",strokeWidth:(null===(e=this.props.style)||void 0===e?void 0:e.strokeWidth)||2,strokeDasharray:"0 1",fill:"none",d:this.state.path,className:`${s.DocumentLineQuad.CLASSNAME}-path`}):null}animate(t){const e="M"+a.Point.toSvgString(t)+"z";this.setState({path:e})}clear(){this.setState({path:void 0})}}e.default=u},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=r(n(0)),a=n(35);class s extends o.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})}catch(t){throw a.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,r,o,s;return i(this,void 0,void 0,(function*(){const i={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const n=a.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,r;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(r=(i=this.props).onReady)||void 0===r||r.call(i)}))}catch(t){const e=a.MediaError.unsupportedMediaDevices("UnsupportedError: navigator.mediaDevices.getUserMedia is undefined");return null===(r=(n=this.props).onError)||void 0===r||r.call(n,e),void console.error(e)}}catch(t){let e=a.MediaError.unknownError(t.message);return t instanceof DOMException&&("NotAllowedError"===t.name?e=a.MediaError.permissionError(t.message):"NotFoundError"===t.name&&(e=a.MediaError.notAvailable(t.message))),null===(s=(o=this.props).onError)||void 0===s||s.call(o,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){const t=this.getVideoTrack();if(t)return t.getCapabilities()}}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonMovementPredicate=void 0;const i=n(1),r=n(37);class o{constructor(t,e=o.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 r.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 r.MathUtils.distanceBetweenPoints(e,n)}}e.PolygonMovementPredicate=o,o.DEFAULT_SENSITIVITY=.5},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=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 o=r(n(0)),a=n(0),s=n(12),u=r(n(15)),c=n(71),l=n(21),d=n(4),f=n(7),h=n(22),p=n(6);class m extends s.ScanbotCameraProps{}e.MrzScannerProps=m;class v extends s.ScanbotCameraState{}e.MrzScannerState=v;class g extends s.ScannerView{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.state={isFinderVisible:!0}}get configuration(){return this._configuration||(this._configuration=c.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,r)=>{(0,a.render)(o.default.createElement(g,{container:n,configuration:t,onSuccess:i,onFailure:r,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return i(this,void 0,void 0,(function*(){h.Debugger.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){h.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(g.FRAME_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=d.Size.fromHtmlElement(this.camera.video),i=f.ViewUtils.findScale(n,e);let r=null===(t=this.finder)||void 0===t?void 0:t.frame();if(r){const t=p.Frame.withSize(r.width/i.scale,r.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=yield this.camera.createImageData(g.FRAME_RESOLUTION);if(!i)return;e&&this.forceUpdate();const r=yield this.props.mrzRecognizer.recognize(i);if(!this.enabled)return;if(null===r)return;r?(n=!0,this.configuration.onMrzDetected(r)):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 o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},o.default.createElement(u.default,{configuration:this.configuration,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&&o.default.createElement(l.ViewFinder,{ref:t=>this.finder=t,configuration:this.configuration.style}))}}e.default=g,g.FRAME_RESOLUTION=1200},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MrzScannerConfiguration=void 0;const i=n(9),r={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 o extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.onMrzDetected=function(t){},this.style=r}static fromJson(t){const e=new o;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=o},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},s=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 u=s(n(0)),c=n(0),l=n(12),d=s(n(15)),f=n(74),h=n(19),p=n(21),m=n(4),v=n(7),g=n(22),y=n(6),b=s(n(32)),_=o(n(77)),w=s(n(84)),C=s(n(88)),x=s(n(91)),S=n(5),E=s(n(93)),P=s(n(94)),k=s(n(95));class O extends l.ScanbotCameraProps{}e.BarcodeScannerProps=O;class T extends l.ScanbotCameraState{constructor(){super(...arguments),this.action="manual"}}e.BarcodeScannerState=T;class A extends l.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=f.BarcodeScannerConfiguration.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return a(this,void 0,void 0,(function*(){const e=v.ViewUtils.findContainerOrThrow(t);return new Promise(((n,i)=>{(0,c.render)(u.default.createElement(A,{container:e,configuration:t,showFinder:t.showFinder,onSuccess:n,onFailure:i}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return a(this,void 0,void 0,(function*(){g.Debugger.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){g.Debugger.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return a(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 a(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate(),yield this.resume()}))}resume(){return a(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(l.ScannerView.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=m.Size.fromHtmlElement(this.camera.video),i=v.ViewUtils.findScale(n,e);let r=null===(t=this.finder)||void 0===t?void 0:t.frame();if(r){const t=y.Frame.withSize(r.width/i.scale,r.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,r;return a(this,void 0,void 0,(function*(){const o=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 a=!1;try{const t=yield this.recognizeBarcodes(!0,o,this.configuration.returnBarcodeImage);if(!t)return;const r=t.barcodeResult;r.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(null==r?void 0:r.imageData)):(a=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(r)),null===(n=this.overlay)||void 0===n||n.update(this.finderRect,this.camera,t.barcodeResult.imageData,null!==(i=this.configuration.container)&&void 0!==i?i:this.configuration.containerId,t.barcodeResult.barcodes)}catch(t){console.log(t)}finally{if(a){const t=(null===(r=this.configuration.overlay)||void 0===r?void 0:r.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,r;return a(this,void 0,void 0,(function*(){const o=t?l.ScannerView.DEFAULT_DETECTION_RESOLUTION:l.ScannerView.DETECTION_RESULTION_4K,a=null!==(i=this.desiredRecognitionResolution)&&void 0!==i?i:o,s=yield this.camera.createImageData(a);if(!s)return;e&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:S.ImageUtils.wrapperToBase64(s)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",l.ScannerView.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));const u=this.configuration.engineMode,c=this.configuration.barcodeFormats;let d;if(this.backendurl&&this.backendurl.length>0)d=yield k.default.recognizeBarcodes(this.backendurl,s);else{const{result:e,originalImage:i}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[s,{live:t,engineMode:u,barcodeFormats:c,returnBarcodeImage:n}]);if(!this.enabled)return;if(null===e)return;d=h.BarcodeResult.fromWorker(e,i)}return{imageData:s,originalImage:undefined,barcodeResult:d}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return a(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,r,o;const s=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return u.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"}},u.default.createElement(d.default,{configuration:this.configuration,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}}),u.default.createElement(P.default,{top:null===(n=this.configuration.scanAndCount)||void 0===n?void 0:n.style.topLabelTop,text:s}),u.default.createElement(x.default,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&u.default.createElement(p.ViewFinder,{ref:t=>{this.finder=t},onSizeChanged:t=>{this.finderRect=t},configuration:this.configuration.style}),u.default.createElement(P.default,{bottom:100,text:this.state.bottomHintText}),u.default.createElement(E.default,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&u.default.createElement(w.default,{ref:t=>{t&&(this.overlay=t)},configuration:this.configuration.overlay,onPolygonClick:t=>{const e=new h.BarcodeResult([t],void 0);this.configuration.onBarcodesDetected(e)},onBarcodeFound:(t,e,n)=>{var i;(null===(i=this.configuration.overlay)||void 0===i?void 0:i.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(t,e,n)}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&u.default.createElement(C.default,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(_.AnimationType.PushBottom,this.barcodes)},onShutterButtonClick:()=>a(this,void 0,void 0,(function*(){(new b.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()}}),u.default.createElement(_.default,{ref:t=>this.popup=t,style:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.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=A},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BarcodeScannerConfiguration=void 0;const i=n(9),r=n(75),o=n(76),a={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."};class s extends i.ScannerConfiguration{constructor(){super(i.ScannerConfiguration.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new r.SelectionOverlayConfiguration,this.showFinder=!0,this.scanAndCount=new o.BarcodeCountConfiguration,this.onBarcodesDetected=function(t){},this.style=a}static fromJson(t){const e=new s;return this.mapValues(t,e,["style","videoConstraints","overlay","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,["style"]),t.overlay.style&&this.mapValues(t.overlay.style,e.overlay.style)),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=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionOverlayConfiguration=e.SelectionOverlayStyleConfiguration=e.BarcodePolygonLabelStyle=e.BarcodePolygonStyle=void 0;e.BarcodePolygonStyle=class{};e.BarcodePolygonLabelStyle=class{};class i{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}e.SelectionOverlayStyleConfiguration=i;e.SelectionOverlayConfiguration=class{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.style=new i}}},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationType=void 0;const s=a(n(0)),u=o(n(23)),c=a(n(82)),l=a(n(24));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 f extends s.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),r=this.to(this.state.animation.type);this.previousDestination=r;const o=this.props.style;return s.default.createElement(i,{style:this.containerStyle(`${r}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},s.default.createElement("div",{style:{backgroundColor:"white",height:o.sheetHeight,width:"100%",marginTop:o.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},s.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:l.default.ScanbotPrimary}},s.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},s.default.createElement("div",{style:{backgroundColor:l.default.White,height:3,width:33,borderRadius:5}})),s.default.createElement("div",{style:{display:"flex",height:50}},s.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:l.default.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),s.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:l.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"),s.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:l.default.White,justifyContent:"right",alignItems:"center",paddingRight:10}},s.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),s.default.createElement(c.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=u.keyframes`from {transform: ${e};} to {transform: ${n};}`;return u.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=f},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!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:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return 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(){}r.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];c.push(new p(t,e)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){"use strict";var i=60103,r=60106,o=60107,a=60108,s=60114,u=60109,c=60110,l=60112,d=60113,f=60120,h=60115,p=60116,m=60121,v=60122,g=60117,y=60129,b=60131;if("function"==typeof Symbol&&Symbol.for){var _=Symbol.for;i=_("react.element"),r=_("react.portal"),o=_("react.fragment"),a=_("react.strict_mode"),s=_("react.profiler"),u=_("react.provider"),c=_("react.context"),l=_("react.forward_ref"),d=_("react.suspense"),f=_("react.suspense_list"),h=_("react.memo"),p=_("react.lazy"),m=_("react.block"),v=_("react.server.block"),g=_("react.fundamental"),y=_("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 o:case s:case a:case d:case f:return t;default:switch(t=t&&t.$$typeof){case c:case l:case p:case h:case u:return t;default:return e}}case r:return e}}}var C=u,x=i,S=l,E=o,P=p,k=h,O=r,T=s,A=a,M=d;e.ContextConsumer=c,e.ContextProvider=C,e.Element=x,e.ForwardRef=S,e.Fragment=E,e.Lazy=P,e.Memo=k,e.Portal=O,e.Profiler=T,e.StrictMode=A,e.Suspense=M,e.isAsyncMode=function(){return!1},e.isConcurrentMode=function(){return!1},e.isContextConsumer=function(t){return w(t)===c},e.isContextProvider=function(t){return w(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return w(t)===l},e.isFragment=function(t){return w(t)===o},e.isLazy=function(t){return w(t)===p},e.isMemo=function(t){return w(t)===h},e.isPortal=function(t){return w(t)===r},e.isProfiler=function(t){return w(t)===s},e.isStrictMode=function(t){return w(t)===a},e.isSuspense=function(t){return w(t)===d},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===s||t===y||t===a||t===d||t===f||t===b||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===h||t.$$typeof===u||t.$$typeof===c||t.$$typeof===l||t.$$typeof===g||t.$$typeof===m||t[0]===v)},e.typeOf=w},function(t,e,n){"use strict";t.exports=n(81)},function(t,e,n){"use strict";var i="function"==typeof Symbol&&Symbol.for,r=i?Symbol.for("react.element"):60103,o=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,s=i?Symbol.for("react.strict_mode"):60108,u=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,l=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.async_mode"):60111,f=i?Symbol.for("react.concurrent_mode"):60111,h=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,m=i?Symbol.for("react.suspense_list"):60120,v=i?Symbol.for("react.memo"):60115,g=i?Symbol.for("react.lazy"):60116,y=i?Symbol.for("react.block"):60121,b=i?Symbol.for("react.fundamental"):60117,_=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 r:switch(t=t.type){case d:case f:case a:case u:case s:case p:return t;default:switch(t=t&&t.$$typeof){case l:case h:case g:case v:case c:return t;default:return e}}case o:return e}}}function x(t){return C(t)===f}e.AsyncMode=d,e.ConcurrentMode=f,e.ContextConsumer=l,e.ContextProvider=c,e.Element=r,e.ForwardRef=h,e.Fragment=a,e.Lazy=g,e.Memo=v,e.Portal=o,e.Profiler=u,e.StrictMode=s,e.Suspense=p,e.isAsyncMode=function(t){return x(t)||C(t)===d},e.isConcurrentMode=x,e.isContextConsumer=function(t){return C(t)===l},e.isContextProvider=function(t){return C(t)===c},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},e.isForwardRef=function(t){return C(t)===h},e.isFragment=function(t){return C(t)===a},e.isLazy=function(t){return C(t)===g},e.isMemo=function(t){return C(t)===v},e.isPortal=function(t){return C(t)===o},e.isProfiler=function(t){return C(t)===u},e.isStrictMode=function(t){return C(t)===s},e.isSuspense=function(t){return C(t)===p},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===f||t===u||t===s||t===p||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===v||t.$$typeof===c||t.$$typeof===l||t.$$typeof===h||t.$$typeof===b||t.$$typeof===_||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 r=i(n(0)),o=i(n(83));class a extends r.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 r.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>r.default.createElement(o.default,{key:e,barcode:t,onClick:this.props.onClick}))))}}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});const r=i(n(0));class o extends r.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return r.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},r.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},r.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},r.default.createElement("div",{style:{flex:1}},this.props.barcode.text),r.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),r.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}e.default=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.SelectionOverlayProps=e.BarcodePolygonElement=void 0;const r=i(n(0)),o=n(8),a=n(38),s=n(1),u=i(n(85)),c=i(n(86)),l=i(n(87));e.BarcodePolygonElement=class{};e.SelectionOverlayProps=class{};class d extends r.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,i,o){const d=[];o.forEach((r=>{const o=new a.BarcodeOverlay(r);o.points=void 0===t?s.Point.scaleListToHtmlElement(r.points,n,e.video):r.points.map((e=>{const r=new s.Point(e.x,e.y);r.x*=t.width/n.width,r.y*=t.height/n.height,r.y+=t.y,r.x+=t.x;const o=("string"==typeof i?document.getElementById(i):i).getBoundingClientRect();return r.x-=o.x,r.y-=o.y,r})),d.push(o)}));const f=[];this.state.polygonElements.forEach((t=>{const e=d.find((e=>e.code.equals(t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<u.default.now()&&(n=!0):(t.element=e,t.polygon=r.default.createElement(c.default,{key:t.element.code.id(),ref:e=>t.polygonRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.label=r.default.createElement(l.default,{key:t.element.code.id(),ref:e=>t.labelRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.updatedAt=u.default.now()),n||f.push(t)})),d.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>e.element.code.equals(t.code)))){let e,n;const i=r.default.createElement(c.default,{key:t.code.id(),ref:i=>{e=i,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),o=r.default.createElement(l.default,{key:t.code.id(),ref:i=>{n=i,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),a={element:t,polygon:i,label:o,polygonRef:e,labelRef:n,updatedAt:u.default.now()};f.push(a)}})),this.setState({polygonElements:f})}onPolygonClick(t){var e,n;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const i=e.labelRef;i&&e.label.props.element.code.equals(t.code)&&(i.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonClick)||void 0===n||n.call(e,t.code))}render(){var t,e;return r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},r.default.createElement(o.motion.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%",top:0}},null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((t=>t.polygon))),null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((t=>t.label)))}}e.default=d},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}),e.BarcodePolygonProps=void 0;const r=i(n(0)),o=n(8),a=n(1);e.BarcodePolygonProps=class{};class s extends r.default.Component{constructor(t){super(t),this.state={element:t.element}}update(t){this.setState({element:t})}style(t){this.customStyle=t,this.forceUpdate()}render(){var t,e,n,i;const s=this.state.element,u=this.props.configuration.style;!s.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(s);const c=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fill)&&void 0!==e?e:s.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,l=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.stroke)&&void 0!==i?i:s.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor;return r.default.createElement(o.motion.polygon,{points:a.Point.toSvgString(s.points),animate:{points:a.Point.toSvgString(this.props.animateToPoints)},onClick:()=>{this.props.onClick&&this.props.onClick(s)},fill:c,stroke:l,strokeWidth:s.highlighted?2:1})}}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}),e.BarcodePolygonLabelProps=void 0;const r=i(n(0)),o=n(8),a=n(1);e.BarcodePolygonLabelProps=class{};class s extends r.default.Component{constructor(t){super(t),this.state={element:t.element}}style(t){this.customStyle=t,this.forceUpdate()}update(t){this.setState({element:t})}formatText(t,e){if("None"!==e)return"Text"===e?t.text:t.format+" ("+t.text+")"}render(){var t,e,n,i,s;const u=this.state.element,c=this.props.configuration.style,l=this.formatText(u.code,this.props.configuration.textFormat),d=a.Point.width(null!==(t=this.props.animateToPoints)&&void 0!==t?t:u.points);if(!l)return null;if(!u.points)return null;const f=null!==(n=null===(e=this.customStyle)||void 0===e?void 0:e.backgroundColor)&&void 0!==n?n:u.highlighted?c.highlightedTextBackgroundColor:c.textBackgroundColor,h=null!==(s=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==s?s:u.highlighted?c.highlightedTextColor:c.textColor;return r.default.createElement(o.motion.div,{ref:t=>this.label=t,onClick:()=>{this.props.onClick&&this.props.onClick(u)},style:{x:a.Point.lowestX(u.points),y:a.Point.highestY(u.points)+3,backgroundColor:f,fontSize:12,width:d,overflow:"hidden",maxLines:2,color:h,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px"},animate:this.props.animateToPoints?{x:a.Point.lowestX(this.props.animateToPoints),y:a.Point.highestY(this.props.animateToPoints)+30}:{}},l)}}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 r=i(n(0)),o=n(36),a=i(n(24)),s=i(n(89)),u=i(n(90));class c extends r.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 r.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:a.default.ScanbotPrimary}},r.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},r.default.createElement(s.default,null),r.default.createElement("div",{style:{backgroundColor:a.default.Orange,color:a.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)),r.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},r.default.createElement(o.ShutterButton,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),r.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},r.default.createElement("div",{style:{fontSize:13,color:a.default.White,marginRight:10}},"Scan More"),r.default.createElement(u.default,null)))}}e.default=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 r=i(n(0));class o extends r.default.Component{render(){return r.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},r.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),r.default.createElement("g",{mask:"url(#mask0_919_23088)"},r.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=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});const r=i(n(0));class o extends r.default.Component{render(){return r.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},r.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),r.default.createElement("g",{mask:"url(#mask0_919_23102)"},r.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=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});const r=i(n(0)),o=n(38),a=i(n(92)),s=n(4),u=n(1);class c extends r.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:s.Size.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const i=new o.BarcodeOverlay(n);i.points=u.Point.scaleListToHtmlElement(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:r.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}},r.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),r.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>r.default.createElement(a.default,{key:e,points:t.points})))))}}e.default=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 r=i(n(0)),o=n(1);class a extends r.default.Component{render(){const t=o.Point.centerOf(this.props.points),e=o.Point.smallerSizeOfQuad(this.props.points)/40;return r.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})`}},r.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},r.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),r.default.createElement("g",{mask:"url(#mask0_910_20901)"},r.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),r.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=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});const r=i(n(0)),o=i(n(23));class a extends r.default.Component{render(){if(!this.props.visible)return null;const t=o.default.svg`
3
3
  animation: rotate 2s linear infinite;
4
4
  @keyframes rotate { 100% { transform: rotate(360deg); } }
5
- `;return r.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},r.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),r.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"}),r.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"}),r.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=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});const r=i(n(0)),o=i(n(24));class a extends r.default.Component{render(){return this.props.text?r.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},r.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:o.default.TransparentGray,color:o.default.White,fontWeight:500,fontSize:13}},this.props.text)):null}}e.default=a},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=n(18),o=n(5);class a{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=o.ImageUtils.convertImageDataWrapperToImageData(e),i=o.ImageUtils.createImageDataCanvas(n),r=yield new Promise((t=>i.toBlob((e=>t(e)))));return yield a.postBlob(t,r)}))}static recognizeBarcodes(t,e){return i(this,void 0,void 0,(function*(){const n=yield a.postImage(t,e);return r.BarcodeResult.fromWorker(n,e)}))}}e.default=a},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=s(n(0)),c=n(0),l=s(n(13)),d=s(n(10)),f=n(97),h=n(20),p=n(98),m=n(103),v=n(104),g=n(105),y=n(4),b=n(1),_=n(7),w=n(5),C=o(n(106));class x extends u.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:b.Point.empty()}}static create(t){return a(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,c.render)(u.default.createElement(x,{onReady:n,onError:i,container:e,configuration:f.CroppingViewConfiguration.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return a(this,void 0,void 0,(function*(){const i=null===(t=this.configuration)||void 0===t?void 0:t.image,r=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:r.polygon,magneticLines:{vertical:{original:r.verticalLines},horizontal:{original:r.horizontalLines}}}),this.props.onReady&&this.props.onReady(this)}))}onImageLoaded(t){return a(this,void 0,void 0,(function*(){y.Size.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.loadImageAndPolygon())}))}loadImageAndPolygon(t){var e,n,i;const r=new y.Size(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),o=new y.Size(this.container.width(),this.container.height()),a=w.ImageUtils.getObjectFitSize(o,r),s=new y.Size(a.width,a.height),u=y.Size.subtractFrom(s,2*this.configuration.style.padding),c=null!==(e=null==t?void 0:t.polygon)&&void 0!==e?e:this.state.polygon,l=_.ViewUtils.convertToViewportPointsFromParentSize(u,c),d=null!==(n=null==t?void 0:t.horizontalLines)&&void 0!==n?n:this.state.magneticLines.horizontal.original,f=null!==(i=null==t?void 0:t.verticalLines)&&void 0!==i?i:this.state.magneticLines.vertical.original,h=_.ViewUtils.convertLinesToViewportLines(s,d),p=_.ViewUtils.convertLinesToViewportLines(s,f);this.setState({calculatedSize:s,points:l,magneticLines:{horizontal:{original:d,scaled:h},vertical:{original:f,scaled:p}},animation:Object.assign(Object.assign({},this.state.animation),{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,s)}),imageMargin:this.calculateMargin(s)})}render(){var t,e,n,i,r,o;const a=h.DocumentLineQuad.CLASSNAME,s=(0,l.default)({[a]:!0,[`${a}-visible`]:!0}),c=this.configuration.style.polygon.width,d=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?c/this.state.animation.scale:c;return u.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&u.default.createElement(g.ScrollLock,null),u.default.createElement(C.default,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),u.default.createElement(v.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},u.default.createElement(m.CroppingImage,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),u.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:s,points:this.state.points,rotations:null===(r=this.state.animation)||void 0===r?void 0:r.rotations,scale:null===(o=this.state.animation)||void 0===o?void 0:o.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 a(this,void 0,void 0,(function*(){const e=y.Size.subtractFrom(this.state.calculatedSize,2*this.configuration.style.padding),n=b.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 a(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 a(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,c.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=f.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=x},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(31);class r{constructor(){this.disabled=!1,this.color="transparent"}}e.CroppingViewMagneticLineStyle=r;class o{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}e.CroppingViewPolygonHandleStyle=o;class a{constructor(){this.color="#1ec31e",this.width=4}}e.CroppingViewPolygonStyle=a;class s{constructor(){this.padding=10}}e.CroppingViewStyle=s;class u{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}e.CroppingViewMagnifierStyle=u;class c{constructor(){this.width=2,this.color="white"}}e.CroppingViewMagnifierBorderStyle=c;class l{constructor(){this.size=20,this.color="white"}}e.CroppingViewMagnifierCrosshairStyle=l;class d extends i.BaseConfiguration{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new s,this.style.magneticLines=new r,this.style.polygon=new a,this.style.polygon.handles=new o,this.style.magnifier=new u,this.style.magnifier.border=new c,this.style.magnifier.crosshair=new l}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 r=i(n(0)),o=n(20),a=n(99),s=n(100);class u extends r.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return r.default.createElement("div",null,r.default.createElement(s.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})}}),r.default.createElement(a.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()}}),r.default.createElement(o.DocumentLineQuad,{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=u},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 r=i(n(0));class o extends r.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return r.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},r.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,o,a;return r.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===(a=null===(o=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===o?void 0:o.scaled)||void 0===a?void 0:a.map((t=>this.fromPoint(t))))}isNearAny(){var t,e,n,i;const r=this.props.movingLine;let o=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;r.isHorizontal&&(o=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),null==o||o.forEach((t=>{this.isLineNearLine(t,r.points,r.isHorizontal)&&this.props.snapTo({magneticLine:t,polygonLine:r})}))}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=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.DraggableHandlesComponent=void 0;const r=i(n(0)),o=n(101),a=n(102);class s extends r.default.Component{constructor(t){super(t),this.state={slopes:[]}}render(){return r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},r.default.createElement(o.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()}}),r.default.createElement(a.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 r=this.props.coordinatePoints[t][i];r=Math.abs(e.p1[i]-r)<Math.abs(e.p2[i]-r)?e.p1[n]:e.p2[n],this.props.coordinatePoints[t][n]=r}}e.DraggableHandlesComponent=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}),e.DraggablePointsContainer=void 0;const r=i(n(0)),o=n(1),a=n(37),s=n(39);class u extends s.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=r.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=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],r=o.Point.fromHtmlElement(i);this.parentOffset=new o.Point(n.x-r.x,n.y-r.y),this.lastPointIndex=e,this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=n.x-this.parentOffset.x,r=n.y-this.parentOffset.y;if(this.isOutOfBounds(i,this.props.containerSize.width))return;if(this.isOutOfBounds(r,this.props.containerSize.height))return;const s=this.pointSize/2;this.props.points[e]=new o.Point(i+s,r+s),a.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 r.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=u},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 r=i(n(0)),o=n(1),a=n(39),s=n(11);class u extends a.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 o=r.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(o)}return t}lineTouchStart(t,e){const n=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],r=o.Point.fromHtmlElement(i),a=this.props.points[e],u=this.props.points[this.nextIndex(e)];this.point1Start=s.Utils.copy(a),this.point2Start=s.Utils.copy(u),this.point1Offset=new o.Point(a.x-r.x,a.y-r.y),this.point2Offset=new o.Point(u.x-r.x,u.y-r.y),this.parentOffset=new o.Point(n.x-r.x,n.y-r.y)}lineTouchMove(t,e){var n,i,r,a;if(!this.parentOffset)return;const s=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),u=this.props.points[e],c=this.props.points[this.nextIndex(e)],l=this.props.points[this.previousIndex(e)],d=this.props.points[this.nextIndex(e+1)];if(this.isHorizontal(e)){const t=s.y-this.parentOffset.y;if(this.isOutOfBounds(t,this.props.containerSize.height))return;const r=t+this.point1Offset.y,o=t+this.point2Offset.y;let a=u.x+(u.y-r)/-this.props.slopes[this.previousIndex(e)],f=c.x+(c.y-o)/-this.props.slopes[this.nextIndex(e)];if(a=this.validateCoordinate(a,u.x),f=this.validateCoordinate(f,c.x),u.x=this.accountForSlopeCalculationError(a,u.x),c.x=this.accountForSlopeCalculationError(f,c.x),u.y=this.limitMinMaxCoordinates(r,null===(n=this.props.containerSize)||void 0===n?void 0:n.height),c.y=this.limitMinMaxCoordinates(o,null===(i=this.props.containerSize)||void 0===i?void 0:i.height),this.isNearOpposingPoint(this.point1Start,u,l,"y"))return;if(this.isNearOpposingPoint(this.point1Start,c,d,"y"))return}else{const t=s.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 o=u.y+(u.x-n)/-this.props.slopes[this.previousIndex(e)],f=c.y+(c.x-i)/-this.props.slopes[this.nextIndex(e)];if(o=this.validateCoordinate(o,u.y),f=this.validateCoordinate(f,c.y),u.y=this.accountForSlopeCalculationError(o,u.y),c.y=this.accountForSlopeCalculationError(f,c.y),u.x=this.limitMinMaxCoordinates(n,null===(r=this.props.containerSize)||void 0===r?void 0:r.width),c.x=this.limitMinMaxCoordinates(i,null===(a=this.props.containerSize)||void 0===a?void 0:a.width),this.isNearOpposingPoint(this.point1Start,u,l,"x"))return;if(this.isNearOpposingPoint(this.point1Start,c,d,"x"))return}this.props.lineMoved({points:[{index:e,coordinates:u},{index:this.nextIndex(e),coordinates:c}],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 r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}e.DraggableLinesContainer=u},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 r=i(n(0));class o extends r.default.Component{render(){return r.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=o},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Animatable=void 0;const s=a(n(0)),u=o(n(23));class c extends s.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:r,duration:o}=this.props,a=90*(n-1),c=90*n;this.previousScale||(this.previousScale=1);const l=u.keyframes`
5
+ `;return r.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},r.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),r.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"}),r.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"}),r.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=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});const r=i(n(0)),o=i(n(24));class a extends r.default.Component{render(){return this.props.text?r.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},r.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:o.default.TransparentGray,color:o.default.White,fontWeight:500,fontSize:13}},this.props.text)):null}}e.default=a},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=n(19),o=n(5);class a{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=o.ImageUtils.convertImageDataWrapperToImageData(e),i=o.ImageUtils.createImageDataCanvas(n),r=yield new Promise((t=>i.toBlob((e=>t(e)))));return yield a.postBlob(t,r)}))}static recognizeBarcodes(t,e){return i(this,void 0,void 0,(function*(){const n=yield a.postImage(t,e);return r.BarcodeResult.fromWorker(n,e)}))}}e.default=a},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=s(n(0)),c=n(0),l=s(n(13)),d=s(n(10)),f=n(97),h=n(14),p=n(98),m=n(103),v=n(104),g=n(105),y=n(4),b=n(1),_=n(7),w=n(5),C=o(n(106));class x extends u.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:b.Point.empty()}}static create(t){return a(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,c.render)(u.default.createElement(x,{onReady:n,onError:i,container:e,configuration:f.CroppingViewConfiguration.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return a(this,void 0,void 0,(function*(){const i=null===(t=this.configuration)||void 0===t?void 0:t.image,r=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:r.polygon,magneticLines:{vertical:{original:r.verticalLines},horizontal:{original:r.horizontalLines}}}),this.props.onReady&&this.props.onReady(this)}))}onImageLoaded(t){return a(this,void 0,void 0,(function*(){y.Size.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.loadImageAndPolygon())}))}loadImageAndPolygon(t){var e,n,i;const r=new y.Size(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),o=new y.Size(this.container.width(),this.container.height()),a=w.ImageUtils.getObjectFitSize(o,r),s=new y.Size(a.width,a.height),u=y.Size.subtractFrom(s,2*this.configuration.style.padding),c=null!==(e=null==t?void 0:t.polygon)&&void 0!==e?e:this.state.polygon,l=_.ViewUtils.convertToViewportPointsFromParentSize(u,c),d=null!==(n=null==t?void 0:t.horizontalLines)&&void 0!==n?n:this.state.magneticLines.horizontal.original,f=null!==(i=null==t?void 0:t.verticalLines)&&void 0!==i?i:this.state.magneticLines.vertical.original,h=_.ViewUtils.convertLinesToViewportLines(s,d),p=_.ViewUtils.convertLinesToViewportLines(s,f);this.setState({calculatedSize:s,points:l,magneticLines:{horizontal:{original:d,scaled:h},vertical:{original:f,scaled:p}},animation:Object.assign(Object.assign({},this.state.animation),{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,s)}),imageMargin:this.calculateMargin(s)})}render(){var t,e,n,i,r,o;const a=h.DocumentLineQuad.CLASSNAME,s=(0,l.default)({[a]:!0,[`${a}-visible`]:!0}),c=this.configuration.style.polygon.width,d=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?c/this.state.animation.scale:c;return u.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&u.default.createElement(g.ScrollLock,null),u.default.createElement(C.default,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),u.default.createElement(v.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},u.default.createElement(m.CroppingImage,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),u.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:s,points:this.state.points,rotations:null===(r=this.state.animation)||void 0===r?void 0:r.rotations,scale:null===(o=this.state.animation)||void 0===o?void 0:o.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 a(this,void 0,void 0,(function*(){const e=y.Size.subtractFrom(this.state.calculatedSize,2*this.configuration.style.padding),n=b.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 a(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 a(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,c.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=f.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=x},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(31);class r{constructor(){this.disabled=!1,this.color="transparent"}}e.CroppingViewMagneticLineStyle=r;class o{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}e.CroppingViewPolygonHandleStyle=o;class a{constructor(){this.color="#1ec31e",this.width=4}}e.CroppingViewPolygonStyle=a;class s{constructor(){this.padding=10}}e.CroppingViewStyle=s;class u{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}e.CroppingViewMagnifierStyle=u;class c{constructor(){this.width=2,this.color="white"}}e.CroppingViewMagnifierBorderStyle=c;class l{constructor(){this.size=20,this.color="white"}}e.CroppingViewMagnifierCrosshairStyle=l;class d extends i.BaseConfiguration{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new s,this.style.magneticLines=new r,this.style.polygon=new a,this.style.polygon.handles=new o,this.style.magnifier=new u,this.style.magnifier.border=new c,this.style.magnifier.crosshair=new l}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 r=i(n(0)),o=n(14),a=n(99),s=n(100);class u extends r.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return r.default.createElement("div",null,r.default.createElement(s.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})}}),r.default.createElement(a.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()}}),r.default.createElement(o.DocumentLineQuad,{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=u},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 r=i(n(0));class o extends r.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return r.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},r.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,o,a;return r.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===(a=null===(o=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===o?void 0:o.scaled)||void 0===a?void 0:a.map((t=>this.fromPoint(t))))}isNearAny(){var t,e,n,i;const r=this.props.movingLine;let o=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;r.isHorizontal&&(o=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),null==o||o.forEach((t=>{this.isLineNearLine(t,r.points,r.isHorizontal)&&this.props.snapTo({magneticLine:t,polygonLine:r})}))}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=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.DraggableHandlesComponent=void 0;const r=i(n(0)),o=n(101),a=n(102);class s extends r.default.Component{constructor(t){super(t),this.state={slopes:[]}}render(){return r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},r.default.createElement(o.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()}}),r.default.createElement(a.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 r=this.props.coordinatePoints[t][i];r=Math.abs(e.p1[i]-r)<Math.abs(e.p2[i]-r)?e.p1[n]:e.p2[n],this.props.coordinatePoints[t][n]=r}}e.DraggableHandlesComponent=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}),e.DraggablePointsContainer=void 0;const r=i(n(0)),o=n(1),a=n(37),s=n(39);class u extends s.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=r.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=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],r=o.Point.fromHtmlElement(i);this.parentOffset=new o.Point(n.x-r.x,n.y-r.y),this.lastPointIndex=e,this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=n.x-this.parentOffset.x,r=n.y-this.parentOffset.y;if(this.isOutOfBounds(i,this.props.containerSize.width))return;if(this.isOutOfBounds(r,this.props.containerSize.height))return;const s=this.pointSize/2;this.props.points[e]=new o.Point(i+s,r+s),a.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 r.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=u},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 r=i(n(0)),o=n(1),a=n(39),s=n(11);class u extends a.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 o=r.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(o)}return t}lineTouchStart(t,e){const n=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),i=this.items[e],r=o.Point.fromHtmlElement(i),a=this.props.points[e],u=this.props.points[this.nextIndex(e)];this.point1Start=s.Utils.copy(a),this.point2Start=s.Utils.copy(u),this.point1Offset=new o.Point(a.x-r.x,a.y-r.y),this.point2Offset=new o.Point(u.x-r.x,u.y-r.y),this.parentOffset=new o.Point(n.x-r.x,n.y-r.y)}lineTouchMove(t,e){var n,i,r,a;if(!this.parentOffset)return;const s=o.Point.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),u=this.props.points[e],c=this.props.points[this.nextIndex(e)],l=this.props.points[this.previousIndex(e)],d=this.props.points[this.nextIndex(e+1)];if(this.isHorizontal(e)){const t=s.y-this.parentOffset.y;if(this.isOutOfBounds(t,this.props.containerSize.height))return;const r=t+this.point1Offset.y,o=t+this.point2Offset.y;let a=u.x+(u.y-r)/-this.props.slopes[this.previousIndex(e)],f=c.x+(c.y-o)/-this.props.slopes[this.nextIndex(e)];if(a=this.validateCoordinate(a,u.x),f=this.validateCoordinate(f,c.x),u.x=this.accountForSlopeCalculationError(a,u.x),c.x=this.accountForSlopeCalculationError(f,c.x),u.y=this.limitMinMaxCoordinates(r,null===(n=this.props.containerSize)||void 0===n?void 0:n.height),c.y=this.limitMinMaxCoordinates(o,null===(i=this.props.containerSize)||void 0===i?void 0:i.height),this.isNearOpposingPoint(this.point1Start,u,l,"y"))return;if(this.isNearOpposingPoint(this.point1Start,c,d,"y"))return}else{const t=s.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 o=u.y+(u.x-n)/-this.props.slopes[this.previousIndex(e)],f=c.y+(c.x-i)/-this.props.slopes[this.nextIndex(e)];if(o=this.validateCoordinate(o,u.y),f=this.validateCoordinate(f,c.y),u.y=this.accountForSlopeCalculationError(o,u.y),c.y=this.accountForSlopeCalculationError(f,c.y),u.x=this.limitMinMaxCoordinates(n,null===(r=this.props.containerSize)||void 0===r?void 0:r.width),c.x=this.limitMinMaxCoordinates(i,null===(a=this.props.containerSize)||void 0===a?void 0:a.width),this.isNearOpposingPoint(this.point1Start,u,l,"x"))return;if(this.isNearOpposingPoint(this.point1Start,c,d,"x"))return}this.props.lineMoved({points:[{index:e,coordinates:u},{index:this.nextIndex(e),coordinates:c}],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 r.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}e.DraggableLinesContainer=u},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 r=i(n(0));class o extends r.default.Component{render(){return r.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=o},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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=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 r(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Animatable=void 0;const s=a(n(0)),u=o(n(23));class c extends s.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:r,duration:o}=this.props,a=90*(n-1),c=90*n;this.previousScale||(this.previousScale=1);const l=u.keyframes`
6
6
  from {transform: rotate(${a}deg) scale(${this.previousScale}); }
7
7
  to {transform: rotate(${c}deg) scale(${i});
8
- }`,d=u.default.div`position: absolute; animation: ${l} ${o}s;`;return this.previousScale=i,s.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:t=>this.container=t},s.default.createElement(d,{style:{width:this.calculate(t,r,"width"),height:this.calculate(t,r,"height"),transform:`rotate(${c}deg) scale(${i})`,margin:r,marginTop:this.marginWithAspect(e,"y",t),marginLeft:this.marginWithAspect(e,"x",t)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(t,e,n){if(!t||!n)return this.props.margin;const i=n.width>n.height;return"y"===e&&i?t[e]+this.props.margin:"x"!==e||i?t[e]:t[e]+this.props.margin}calculate(t,e,n){return t?t[n]-2*e:"100%"}}e.Animatable=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.ScrollLock=void 0;const r=i(n(0)),o=n(7);class a extends r.default.Component{componentDidMount(){o.ViewUtils.disableScreenMovement()}componentWillUnmount(){o.ViewUtils.enableScreenMovement()}render(){return r.default.createElement("div",null)}}e.ScrollLock=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.MagnifierViewProps=e.MagnifierCrosshair=e.MagnifierOptions=e.MagnifierSourceImage=void 0;const r=i(n(0)),o=n(1),a=n(6),s=n(4);e.MagnifierSourceImage=class{constructor(t,e){this.element=t,this.size=e}};e.MagnifierOptions=class{};class u extends r.default.Component{render(){return r.default.createElement("div",{style:this.props.style},r.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const t=this.half();return r.default.createElement("line",{x1:t,y1:0,x2:t,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const t=this.half();return r.default.createElement("line",{x1:0,y1:t,x2:this.props.size,y2:t,stroke:this.props.color,strokeWidth:"2"})}}e.MagnifierCrosshair=u;e.MagnifierViewProps=class{};class c extends r.default.Component{constructor(t){super(t),this.MAX_ROTATIONS=4,this.state={frame:a.Frame.empty(),cropImageFitSize:s.Size.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}get crosshairSize(){var t,e;return null===(e=null===(t=this.props.style)||void 0===t?void 0:t.crosshair)||void 0===e?void 0:e.size}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?r.default.createElement("div",{style:this.style().container},r.default.createElement("img",{style:this.style().image,ref:t=>this.destination=t,src:this.props.src,alt:"."}),r.default.createElement(u,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(t){this.destination.src=t.source.element.src;const e=a.Frame.fromPoint(o.Point.scaleUpTo(t.origin,new s.Size(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=t.container.width-(this.props.style.margin+this.props.style.size),i=this.isPointTopLeft(t.origin,t.source.size,t.rotations);this.setState({frame:e,cropImageFitSize:s.Size.subtractFrom(t.source.size,2*t.padding),rotation:{count:t.rotations,scale:t.scale},margin:{left:i?n:this.props.style.margin},container:{width:t.container.width},scale:{width:t.source.size.width/t.container.width,height:t.source.size.height/t.container.height}})}isPointTopLeft(t,e,n){const i=t.x,r=t.y,o=this.normalizeRotations(n),a=this.state.container.width/4;return 0===o?i<a&&r<a:1===o?i<a&&r>e.height-a:2===o?i>e.width-a&&r>e.height-a:i>e.width-a&&r<a}setIsVisible(t,e){this.setState({visible:t},e)}normalizeRotations(t){return t%this.MAX_ROTATIONS}}e.default=c},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextDataScannerState=e.TextDataScannerProps=void 0;const o=r(n(0)),a=n(0),s=n(12),u=r(n(14)),c=n(21),l=n(4),d=n(7),f=n(22),h=n(6);class p extends s.ScanbotCameraProps{}e.TextDataScannerProps=p;class m extends s.ScanbotCameraState{}e.TextDataScannerState=m;class v extends s.ScannerView{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.state={isFinderVisible:!0}}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(t,e,n,r){return i(this,void 0,void 0,(function*(){const i=document.getElementById(t.containerId);if(!i)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((s,u)=>{(0,a.render)(o.default.createElement(v,{container:i,configuration:t,onTextDetected:n,style:e,onSuccess:s,onFailure:u,textDataScanner:r}),i)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return i(this,void 0,void 0,(function*(){f.Debugger.warn("TextData detection resumed"),yield this.resume()}))}pauseDetection(){f.Debugger.warn("TextData 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.textDataScanner.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.props.textDataScanner.cleanRecognitionQueue(),this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(v.FRAME_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=l.Size.fromHtmlElement(this.camera.video),i=d.ViewUtils.findScale(n,e);let r=null===(t=this.finder)||void 0===t?void 0:t.frame();if(r){const t=h.Frame.withSize(r.width/i.scale,r.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(){return i(this,void 0,void 0,(function*(){const t=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let e=!1;try{const n=yield this.camera.createImageData(v.FRAME_RESOLUTION);if(!n)return;t&&this.forceUpdate();const i=yield this.props.textDataScanner.recognize(n);if(!this.enabled)return;if(null===i)return;i&&(e=!0,this.props.onTextDetected(i))}catch(t){console.log(t)}finally{e?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){return o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},o.default.createElement(u.default,{configuration:this.configuration,windowConfiguration:this.state.isFinderVisible?this.props.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&&o.default.createElement(c.ViewFinder,{ref:t=>this.finder=t,configuration:this.props.style}))}}e.default=v,v.FRAME_RESOLUTION=1200}])}));
8
+ }`,d=u.default.div`position: absolute; animation: ${l} ${o}s;`;return this.previousScale=i,s.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:t=>this.container=t},s.default.createElement(d,{style:{width:this.calculate(t,r,"width"),height:this.calculate(t,r,"height"),transform:`rotate(${c}deg) scale(${i})`,margin:r,marginTop:this.marginWithAspect(e,"y",t),marginLeft:this.marginWithAspect(e,"x",t)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(t,e,n){if(!t||!n)return this.props.margin;const i=n.width>n.height;return"y"===e&&i?t[e]+this.props.margin:"x"!==e||i?t[e]:t[e]+this.props.margin}calculate(t,e,n){return t?t[n]-2*e:"100%"}}e.Animatable=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.ScrollLock=void 0;const r=i(n(0)),o=n(7);class a extends r.default.Component{componentDidMount(){o.ViewUtils.disableScreenMovement()}componentWillUnmount(){o.ViewUtils.enableScreenMovement()}render(){return r.default.createElement("div",null)}}e.ScrollLock=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.MagnifierViewProps=e.MagnifierCrosshair=e.MagnifierOptions=e.MagnifierSourceImage=void 0;const r=i(n(0)),o=n(1),a=n(6),s=n(4);e.MagnifierSourceImage=class{constructor(t,e){this.element=t,this.size=e}};e.MagnifierOptions=class{};class u extends r.default.Component{render(){return r.default.createElement("div",{style:this.props.style},r.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const t=this.half();return r.default.createElement("line",{x1:t,y1:0,x2:t,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const t=this.half();return r.default.createElement("line",{x1:0,y1:t,x2:this.props.size,y2:t,stroke:this.props.color,strokeWidth:"2"})}}e.MagnifierCrosshair=u;e.MagnifierViewProps=class{};class c extends r.default.Component{constructor(t){super(t),this.MAX_ROTATIONS=4,this.state={frame:a.Frame.empty(),cropImageFitSize:s.Size.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}get crosshairSize(){var t,e;return null===(e=null===(t=this.props.style)||void 0===t?void 0:t.crosshair)||void 0===e?void 0:e.size}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?r.default.createElement("div",{style:this.style().container},r.default.createElement("img",{style:this.style().image,ref:t=>this.destination=t,src:this.props.src,alt:"."}),r.default.createElement(u,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(t){this.destination.src=t.source.element.src;const e=a.Frame.fromPoint(o.Point.scaleUpTo(t.origin,new s.Size(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=t.container.width-(this.props.style.margin+this.props.style.size),i=this.isPointTopLeft(t.origin,t.source.size,t.rotations);this.setState({frame:e,cropImageFitSize:s.Size.subtractFrom(t.source.size,2*t.padding),rotation:{count:t.rotations,scale:t.scale},margin:{left:i?n:this.props.style.margin},container:{width:t.container.width},scale:{width:t.source.size.width/t.container.width,height:t.source.size.height/t.container.height}})}isPointTopLeft(t,e,n){const i=t.x,r=t.y,o=this.normalizeRotations(n),a=this.state.container.width/4;return 0===o?i<a&&r<a:1===o?i<a&&r>e.height-a:2===o?i>e.width-a&&r>e.height-a:i>e.width-a&&r<a}setIsVisible(t,e){this.setState({visible:t},e)}normalizeRotations(t){return t%this.MAX_ROTATIONS}}e.default=c},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextDataScannerState=e.TextDataScannerProps=void 0;const o=r(n(0)),a=n(0),s=n(12),u=r(n(15)),c=n(21),l=n(4),d=n(7),f=n(22),h=n(6);class p extends s.ScanbotCameraProps{}e.TextDataScannerProps=p;class m extends s.ScanbotCameraState{}e.TextDataScannerState=m;class v extends s.ScannerView{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.state={isFinderVisible:!0}}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(t,e,n,r){return i(this,void 0,void 0,(function*(){const i=document.getElementById(t.containerId);if(!i)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((s,u)=>{(0,a.render)(o.default.createElement(v,{container:i,configuration:t,onTextDetected:n,style:e,onSuccess:s,onFailure:u,textDataScanner:r}),i)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return i(this,void 0,void 0,(function*(){f.Debugger.warn("TextData detection resumed"),yield this.resume()}))}pauseDetection(){f.Debugger.warn("TextData 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.textDataScanner.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.props.textDataScanner.cleanRecognitionQueue(),this.paused=!0}computeSize(){var t;const e=this.camera.calculateFrameSize(v.FRAME_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height),n=l.Size.fromHtmlElement(this.camera.video),i=d.ViewUtils.findScale(n,e);let r=null===(t=this.finder)||void 0===t?void 0:t.frame();if(r){const t=h.Frame.withSize(r.width/i.scale,r.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(){return i(this,void 0,void 0,(function*(){const t=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let e=!1;try{const n=yield this.camera.createImageData(v.FRAME_RESOLUTION);if(!n)return;t&&this.forceUpdate();const i=yield this.props.textDataScanner.recognize(n);if(!this.enabled)return;if(null===i)return;i&&(e=!0,this.props.onTextDetected(i))}catch(t){console.log(t)}finally{e?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){return o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},o.default.createElement(u.default,{configuration:this.configuration,windowConfiguration:this.state.isFinderVisible?this.props.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&&o.default.createElement(c.ViewFinder,{ref:t=>this.finder=t,configuration:this.props.style}))}}e.default=v,v.FRAME_RESOLUTION=1200}])}));