scanbot-web-sdk 5.1.3-dev.1 → 5.1.3-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/@types/scanbot-sdk.d.ts +8 -0
  2. package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +1 -0
  3. package/@types/worker/worker-bridge.d.ts +1 -0
  4. package/bundle/ScanbotSDK.min.js +3 -3
  5. package/bundle/ScanbotSDK.ui2.min.js +3 -3
  6. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  7. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  8. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  9. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  10. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  11. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  12. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  13. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  14. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  15. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  16. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  17. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  18. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  19. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  20. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  21. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  22. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  23. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  24. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  25. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  26. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  27. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see ScanbotSDK.min.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},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=20)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Component",(function(){return S})),n.d(e,"Fragment",(function(){return y})),n.d(e,"createContext",(function(){return G})),n.d(e,"createElement",(function(){return v})),n.d(e,"createRef",(function(){return b})),n.d(e,"useCallback",(function(){return ft})),n.d(e,"useContext",(function(){return mt})),n.d(e,"useDebugValue",(function(){return gt})),n.d(e,"useEffect",(function(){return ct})),n.d(e,"useErrorBoundary",(function(){return vt})),n.d(e,"useId",(function(){return At})),n.d(e,"useImperativeHandle",(function(){return ht})),n.d(e,"useLayoutEffect",(function(){return ut})),n.d(e,"useMemo",(function(){return pt})),n.d(e,"useReducer",(function(){return lt})),n.d(e,"useRef",(function(){return dt})),n.d(e,"useState",(function(){return st})),n.d(e,"Children",(function(){return Dt})),n.d(e,"PureComponent",(function(){return Ot})),n.d(e,"StrictMode",(function(){return ye})),n.d(e,"Suspense",(function(){return jt})),n.d(e,"SuspenseList",(function(){return Nt})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ue})),n.d(e,"cloneElement",(function(){return me})),n.d(e,"createFactory",(function(){return he})),n.d(e,"createPortal",(function(){return Yt})),n.d(e,"default",(function(){return Oe})),n.d(e,"findDOMNode",(function(){return ve})),n.d(e,"flushSync",(function(){return be})),n.d(e,"forwardRef",(function(){return Wt})),n.d(e,"hydrate",(function(){return te})),n.d(e,"isElement",(function(){return Ee})),n.d(e,"isFragment",(function(){return fe})),n.d(e,"isValidElement",(function(){return pe})),n.d(e,"lazy",(function(){return zt})),n.d(e,"memo",(function(){return kt})),n.d(e,"render",(function(){return Jt})),n.d(e,"startTransition",(function(){return Se})),n.d(e,"unmountComponentAtNode",(function(){return ge})),n.d(e,"unstable_batchedUpdates",(function(){return Ae})),n.d(e,"useDeferredValue",(function(){return Ce})),n.d(e,"useInsertionEffect",(function(){return xe})),n.d(e,"useSyncExternalStore",(function(){return Le})),n.d(e,"useTransition",(function(){return we})),n.d(e,"version",(function(){return de}));var o,i,r,a,s,l,c,u,d={},h=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function v(t,e,n){var i,r,a,s={};for(a in e)"key"==a?i=e[a]:"ref"==a?r=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?o.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 A(t,s,i,r,null)}function A(t,e,n,o,a){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(s),s}function b(){return{current:null}}function y(t){return t.children}function S(t,e){this.props=t,this.context=e}function C(t,e){if(null==e)return t.__?C(t.__,t.__i+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?C(t):null}function w(t,e,n){var o,r=t.__v,a=r.__e,s=t.__P;if(s)return(o=m({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),R(s,o,r,t.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,e,null==a?C(r):a,!!(32&r.__u),n),o.__v=r.__v,o.__.__k[o.__i]=o,o.__d=void 0,o.__e!=a&&x(o),o}function x(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 x(t)}}function E(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!L.__r++||s!==i.debounceRendering)&&((s=i.debounceRendering)||l)(L)}function L(){var t,e,n,o=[],r=[];for(a.sort(c);t=a.shift();)t.__d&&(n=a.length,e=w(t,o,r)||e,0===n||a.length>n?(M(o,e,r),r.length=o.length=0,e=void 0,a.sort(c)):e&&i.__c&&i.__c(e,h));e&&M(o,e,r),L.__r=0}function _(t,e,n,o,i,r,a,s,l,c,u){var p,f,m,g,v,A=o&&o.__k||h,b=e.length;for(n.__d=l,O(n,e,A),l=n.__d,p=0;p<b;p++)null!=(m=n.__k[p])&&"boolean"!=typeof m&&"function"!=typeof m&&(f=-1===m.__i?d:A[m.__i]||d,m.__i=p,R(t,m,f,i,r,a,s,l,c,u),g=m.__e,m.ref&&f.ref!=m.ref&&(f.ref&&j(f.ref,null,m),u.push(m.ref,m.__c||g,m)),null==v&&null!=g&&(v=g),65536&m.__u||f.__k===m.__k?l=k(m,l,t):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:g&&(l=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=v}function O(t,e,n){var o,i,r,a,s,l=e.length,c=n.length,u=c,d=0;for(t.__k=[],o=0;o<l;o++)null!=(i=t.__k[o]=null==(i=e[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?A(null,i,null,null,i):f(i)?A(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?A(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=P(i,n,a=o+d,u),i.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>l-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==o+d&&(i.__u|=65536))):(r=n[o])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=C(r)),V(r,r,!1),n[o]=null,u--);if(u)for(o=0;o<c;o++)null!=(r=n[o])&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=C(r)),V(r,r))}function k(t,e,n){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=k(o[i],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function T(t,e){return e=e||[],null==t||"boolean"==typeof t||(f(t)?t.some((function(t){T(t,e)})):e.push(t)),e}function P(t,e,n,o){var i=t.key,r=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&i==l.key&&r===l.type)return n;if(o>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<e.length){if((l=e[s])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function W(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||p.test(e)?n:n+"px"}function B(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||W(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||W(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=Date.now(),t.addEventListener(e,r?I:D,r)):t.removeEventListener(e,r?I:D,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function D(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(i.event?i.event(t):t)}}function I(t){if(this.l)return this.l[t.type+!0](i.event?i.event(t):t)}function R(t,e,n,o,r,a,s,l,c,u){var d,h,p,g,v,A,b,C,w,x,E,L,O,k,T,P=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=e.__e=n.__e]),(d=i.__b)&&d(e);t:if("function"==typeof P)try{if(C=e.props,w=(d=P.contextType)&&o[d.__c],x=d?w?w.props.value:d.__:o,n.__c?b=(h=e.__c=n.__c).__=h.__E:("prototype"in P&&P.prototype.render?e.__c=h=new P(C,x):(e.__c=h=new S(C,x),h.constructor=P,h.render=z),w&&w.sub(h),h.props=C,h.state||(h.state={}),h.context=x,h.__n=o,p=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=m({},h.__s)),m(h.__s,P.getDerivedStateFromProps(C,h.__s))),g=h.props,v=h.state,h.__v=e,p)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&C!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(C,x),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(C,h.__s,x)||e.__v===n.__v)){for(e.__v!==n.__v&&(h.props=C,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),E=0;E<h._sb.length;E++)h.__h.push(h._sb[E]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(C,h.__s,x),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,v,A)}))}if(h.context=x,h.props=C,h.__P=t,h.__e=!1,L=i.__r,O=0,"prototype"in P&&P.prototype.render){for(h.state=h.__s,h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[]}else do{h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++O<25);h.state=h.__s,null!=h.getChildContext&&(o=m(m({},o),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(A=h.getSnapshotBeforeUpdate(g,v)),_(t,f(T=null!=d&&d.type===y&&null==d.key?d.props.children:d)?T:[T],e,n,o,r,a,s,l,c,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),b&&(h.__E=h.__=null)}catch(t){e.__v=null,c||null!=a?(e.__e=l,e.__u|=c?160:32,a[a.indexOf(l)]=null):(e.__e=n.__e,e.__k=n.__k),i.__e(t,e,n)}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=F(n.__e,e,n,o,r,a,s,c,u);(d=i.diffed)&&d(e)}function M(t,e,n){for(var o=0;o<n.length;o++)j(n[o],n[++o],n[++o]);i.__c&&i.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){i.__e(t,e.__v)}}))}function F(t,e,n,i,r,a,s,l,c){var u,h,p,m,v,A,b,y=n.props,S=e.props,w=e.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){t=v,a[u]=null;break}if(null==t){if(null===w)return document.createTextNode(S);t=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,S.is&&S),a=null,l=!1}if(null===w)y===S||l&&t.data===S||(t.data=S);else{if(a=a&&o.call(t.childNodes),y=n.props||d,!l&&null!=a)for(y={},u=0;u<t.attributes.length;u++)y[(v=t.attributes[u]).name]=v.value;for(u in y)v=y[u],"children"==u||("dangerouslySetInnerHTML"==u?p=v:"key"===u||u in S||B(t,u,null,v,r));for(u in S)v=S[u],"children"==u?m=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?A=v:"checked"==u?b=v:"key"===u||l&&"function"!=typeof v||y[u]===v||B(t,u,v,y[u],r);if(h)l||p&&(h.__html===p.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(p&&(t.innerHTML=""),_(t,f(m)?m:[m],e,n,i,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&C(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);l||(u="value",void 0!==A&&(A!==t[u]||"progress"===w&&!A||"option"===w&&A!==y[u])&&B(t,u,A,y[u],!1),u="checked",void 0!==b&&b!==t[u]&&B(t,u,b,y[u],!1))}return t}function j(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){i.__e(t,n)}}function V(t,e,n){var o,r;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||j(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){i.__e(t,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&V(o[r],e,n||"function"!=typeof t.type);n||null==t.__e||g(t.__e),t.__=t.__e=t.__d=void 0}function z(t,e,n){return this.constructor(t,n)}function N(t,e,n){var r,a,s,l;i.__&&i.__(t,e),a=(r="function"==typeof n)?null:n&&n.__k||e.__k,s=[],l=[],R(e,t=(!r&&n||e).__k=v(y,null,[t]),a||d,d,void 0!==e.ownerSVGElement,!r&&n?[n]:a?null:e.firstChild?o.call(e.childNodes):null,s,!r&&n?n:a?a.__e:e.firstChild,r,l),t.__d=void 0,M(s,t,l)}function U(t,e){N(t,e,U)}function H(t,e,n){var i,r,a,s,l=m({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==a?i=e[a]:"ref"==a?r=e[a]:l[a]=void 0===e[a]&&void 0!==s?s[a]:e[a];return arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),A(t.type,l,i||t.key,r||t.ref,null)}function G(t,e){var n={__c:e="__cC"+u++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,o;return this.getChildContext||(n=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,E(t)}))},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}o=h.slice,i={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},r=0,S.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof t&&(t=t(m({},n),this.props)),t&&m(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),E(this))},S.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},S.prototype.render=y,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(t,e){return t.__v.__b-e.__v.__b},L.__r=0,u=0;var Y,X,Q,Z,$=0,q=[],K=[],J=i,tt=J.__b,et=J.__r,nt=J.diffed,ot=J.__c,it=J.unmount,rt=J.__;function at(t,e){J.__h&&J.__h(X,t,$||e),$=0;var n=X.__H||(X.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:K}),n.__[t]}function st(t){return $=1,lt(Et,t)}function lt(t,e,n){var o=at(Y++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Et(void 0,e),function(t){var e=o.__N?o.__N[0]:o.__[0],n=o.t(e,t);e!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=X,!X.u)){var i=function(t,e,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(t){return!!t.__c}));if(i.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var a=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&o.__c.props===t)&&(!r||r.call(this,t,e,n))};X.u=!0;var r=X.shouldComponentUpdate,a=X.componentWillUpdate;X.componentWillUpdate=function(t,e,n){if(this.__e){var o=r;r=void 0,i(t,e,n),r=o}a&&a.call(this,t,e,n)},X.shouldComponentUpdate=i}return o.__N||o.__}function ct(t,e){var n=at(Y++,3);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,X.__H.__h.push(n))}function ut(t,e){var n=at(Y++,4);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,X.__h.push(n))}function dt(t){return $=5,pt((function(){return{current:t}}),[])}function ht(t,e,n){$=6,ut((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))}function pt(t,e){var n=at(Y++,7);return xt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function ft(t,e){return $=8,pt((function(){return t}),e)}function mt(t){var e=X.context[t.__c],n=at(Y++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(X)),e.props.value):t.__}function gt(t,e){J.useDebugValue&&J.useDebugValue(e?e(t):t)}function vt(t){var e=at(Y++,10),n=st();return e.__=t,X.componentDidCatch||(X.componentDidCatch=function(t,o){e.__&&e.__(t,o),n[1](t)}),[n[0],function(){n[1](void 0)}]}function At(){var t=at(Y++,11);if(!t.__){for(var e=X.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function bt(){for(var t;t=q.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ct),t.__H.__h.forEach(wt),t.__H.__h=[]}catch(e){t.__H.__h=[],J.__e(e,t.__v)}}J.__b=function(t){X=null,tt&&tt(t)},J.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),rt&&rt(t,e)},J.__r=function(t){et&&et(t),Y=0;var e=(X=t.__c).__H;e&&(Q===X?(e.__h=[],X.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=K,t.__N=t.i=void 0}))):(e.__h.forEach(Ct),e.__h.forEach(wt),e.__h=[],Y=0)),Q=X},J.diffed=function(t){nt&&nt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==q.push(e)&&Z===J.requestAnimationFrame||((Z=J.requestAnimationFrame)||St)(bt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==K&&(t.__=t.__V),t.i=void 0,t.__V=K}))),Q=X=null},J.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Ct),t.__h=t.__h.filter((function(t){return!t.__||wt(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],J.__e(n,t.__v)}})),ot&&ot(t,e)},J.unmount=function(t){it&&it(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Ct(t)}catch(t){e=t}})),n.__H=void 0,e&&J.__e(e,n.__v))};var yt="function"==typeof requestAnimationFrame;function St(t){var e,n=function(){clearTimeout(o),yt&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);yt&&(e=requestAnimationFrame(n))}function Ct(t){var e=X,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),X=e}function wt(t){var e=X;t.__c=t.__(),X=e}function xt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function Et(t,e){return"function"==typeof e?e(t):e}function Lt(t,e){for(var n in e)t[n]=e[n];return t}function _t(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function Ot(t,e){this.props=t,this.context=e}function kt(t,e){function n(t){var n=this.props.ref,o=n==t.ref;return!o&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!o:_t(this.props,t)}function o(e){return this.shouldComponentUpdate=n,v(t,e)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ot.prototype=new S).isPureReactComponent=!0,Ot.prototype.shouldComponentUpdate=function(t,e){return _t(this.props,t)||_t(this.state,e)};var Tt=i.__b;i.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Tt&&Tt(t)};var Pt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Wt(t){function e(e){var n=Lt({},e);return delete n.ref,t(n,e.ref||null)}return e.$$typeof=Pt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Bt=function(t,e){return null==t?null:T(T(t).map(e))},Dt={map:Bt,forEach:Bt,count:function(t){return t?T(t).length:0},only:function(t){var e=T(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:T},It=i.__e;i.__e=function(t,e,n,o){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);It(t,e,n,o)};var Rt=i.unmount;function Mt(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=Lt({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Mt(t,e,n)}))),t}function Ft(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return Ft(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function jt(){this.__u=0,this.t=null,this.__b=null}function Vt(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function zt(t){var e,n,o;function i(i){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){o=t})),o)throw o;if(!n)throw e;return v(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Nt(){this.u=null,this.o=null}i.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Rt&&Rt(t)},(jt.prototype=new S).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=Vt(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=Ft(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},jt.prototype.componentWillUnmount=function(){this.t=[]},jt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Mt(this.__b,n,o.__O=o.__P)}this.__b=null}var i=e.__a&&v(y,null,t.fallback);return i&&(i.__u&=-33),[v(y,null,e.__a?null:t.children),i]};var Ut=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 Ht(t){return this.getChildContext=function(){return t.context},t.children}function Gt(t){var e=this,n=t.i;e.componentWillUnmount=function(){N(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),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)}}),N(v(Ht,{context:e.context},t.__v),e.l)}function Yt(t,e){var n=v(Gt,{__v:t,i:e});return n.containerInfo=e,n}(Nt.prototype=new S).__a=function(t){var e=this,n=Vt(e.__v),o=e.o.get(t);return o[0]++,function(i){var r=function(){e.props.revealOrder?(o.push(i),Ut(e,t,o)):i()};n?n(r):r()}},Nt.prototype.render=function(t){this.u=null,this.o=new Map;var e=T(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},Nt.prototype.componentDidUpdate=Nt.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Ut(t,n,e)}))};var Xt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Qt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Zt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,$t=/[A-Z0-9]/g,qt="undefined"!=typeof document,Kt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};function Jt(t,e,n){return null==e.__k&&(e.textContent=""),N(t,e),"function"==typeof n&&n(),t?t.__c:null}function te(t,e,n){return U(t,e),"function"==typeof n&&n(),t?t.__c:null}S.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(S.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var ee=i.event;function ne(){}function oe(){return this.cancelBubble}function ie(){return this.defaultPrevented}i.event=function(t){return ee&&(t=ee(t)),t.persist=ne,t.isPropagationStopped=oe,t.isDefaultPrevented=ie,t.nativeEvent=t};var re,ae={enumerable:!1,configurable:!0,get:function(){return this.class}},se=i.vnode;i.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var i in e){var r=e[i];if(!("value"===i&&"defaultValue"in e&&null==r||qt&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Kt(e.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":Zt.test(i)?i=a:-1===n.indexOf("-")&&Qt.test(i)?i=i.replace($t,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=T(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=T(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",ae)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=Xt,se&&se(t)};var le=i.__r;i.__r=function(t){le&&le(t),re=t.__c};var ce=i.diffed;i.diffed=function(t){ce&&ce(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value),re=null};var ue={ReactCurrentDispatcher:{current:{readContext:function(t){return re.__n[t.__c].props.value}}}},de="17.0.2";function he(t){return v.bind(null,t)}function pe(t){return!!t&&t.$$typeof===Xt}function fe(t){return pe(t)&&t.type===y}function me(t){return pe(t)?H.apply(null,arguments):t}function ge(t){return!!t.__k&&(N(null,t),!0)}function ve(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ae=function(t,e){return t(e)},be=function(t,e){return t(e)},ye=y;function Se(t){t()}function Ce(t){return t}function we(){return[!1,Se]}var xe=ut,Ee=pe;function Le(t,e){var n=e(),o=st({h:{__:n,v:e}}),i=o[0].h,r=o[1];return ut((function(){i.__=n,i.v=e,_e(i)&&r({h:i})}),[t,n,e]),ct((function(){return _e(i)&&r({h:i}),t((function(){_e(i)&&r({h:i})}))}),[t]),n}function _e(t){var e,n,o=t.v,i=t.__;try{var r=o();return!((e=i)===(n=r)&&(0!==e||1/e==1/n)||e!=e&&n!=n)}catch(t){return!0}}var Oe={useState:st,useId:At,useReducer:lt,useEffect:ct,useLayoutEffect:ut,useInsertionEffect:ut,useTransition:we,useDeferredValue:Ce,useSyncExternalStore:Le,startTransition:Se,useRef:dt,useImperativeHandle:ht,useMemo:pt,useCallback:ft,useContext:mt,useDebugValue:gt,version:"17.0.2",Children:Dt,render:Jt,hydrate:te,unmountComponentAtNode:ge,createPortal:Yt,createElement:v,createContext:G,createFactory:he,cloneElement:me,createRef:b,Fragment:y,isValidElement:pe,isElement:pe,isFragment:fe,findDOMNode:ve,Component:S,PureComponent:Ot,memo:kt,forwardRef:Wt,flushSync:be,unstable_batchedUpdates:Ae,StrictMode:y,Suspense:jt,SuspenseList:Nt,lazy:zt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ue}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return l}));var o=function(t,e){return o=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])},o(t,e)};function i(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function a(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}Object.create;function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}Object.create},function(t,e){t.exports=window["@mui"]},,,function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Yt})),n.d(e,"b",(function(){return Xt}));var o=n(1),i=(n(19),n(0)),r=n(17),a=n.n(r),s=n(7),l=n(18),c="undefined"!=typeof t&&void 0!==t.env&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",p="/*!sc*/\n",f="undefined"!=typeof window&&"HTMLElement"in window,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&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&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function A(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme}var b=new Set(["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","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","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","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,S=/(^-|-$)/g;function C(t){return t.replace(y,"-").replace(S,"")}var w=/(a)(d)/gi,x=function(t){return String.fromCharCode(t+(t>25?39:97))};function E(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(w,"$1-$2")}var L,_=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},O=function(t){return _(5381,t)};function k(t){return E(O(t)>>>0)}function T(t){return t.displayName||t.name||"Component"}function P(t){return"string"==typeof t&&!0}var W="function"==typeof Symbol&&Symbol.for,B=W?Symbol.for("react.memo"):60115,D=W?Symbol.for("react.forward_ref"):60112,I={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},R={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},M={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},F=((L={})[D]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},L[B]=M,L);function j(t){return("type"in(e=t)&&e.type.$$typeof)===B?M:"$$typeof"in t?F[t.$$typeof]:I;var e}var V=Object.defineProperty,z=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,H=Object.getPrototypeOf,G=Object.prototype;function Y(t,e,n){if("string"!=typeof e){if(G){var o=H(e);o&&o!==G&&Y(t,o,n)}var i=z(e);N&&(i=i.concat(N(e)));for(var r=j(t),a=j(e),s=0;s<i.length;++s){var l=i[s];if(!(l in R||n&&n[l]||a&&l in a||r&&l in r)){var c=U(e,l);try{V(t,l,c)}catch(t){}}}}return t}function X(t){return"function"==typeof t}function Q(t){return"object"==typeof t&&"styledComponentId"in t}function Z(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function $(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function q(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function K(t,e,n){if(void 0===n&&(n=!1),!n&&!q(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=K(t[o],e[o]);else if(q(e))for(var o in e)t[o]=K(t[o],e[o]);return t}function J(t,e){Object.defineProperty(t,"toString",{value:e})}function tt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var et=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw tt(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),s=(r=0,e.length);r<s;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(p);return e},t}(),nt=new Map,ot=new Map,it=1,rt=function(t){if(nt.has(t))return nt.get(t);for(;ot.has(it);)it++;var e=it++;return nt.set(t,e),ot.set(e,t),e},at=function(t,e){it=e+1,nt.set(t,e),ot.set(e,t)},st="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),lt=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ct=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ut=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(p),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(lt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(at(u,c),ct(t,u,l[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function dt(){return n.nc}var ht=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(c,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=dt();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},pt=function(){function t(t){this.element=ht(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw tt(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),ft=function(){function t(t){this.element=ht(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),mt=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),gt=f,vt={isServer:!f,useCSSOMInjection:!m},At=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={});var i=this;this.options=Object(o.a)(Object(o.a)({},vt),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&f&&gt&&(gt=!1,function(t){for(var e=document.querySelectorAll(st),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(c)!==u&&(ut(t,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),J(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return ot.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(t){t.length>0&&(l+="".concat(t,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(p)},r=0;r<n;r++)i(r);return o}(i)}))}return t.registerId=function(t){return rt(t)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(Object(o.a)(Object(o.a)({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new mt(n):e?new pt(n):new ft(n)}(this.options),new et(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(rt(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(rt(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(rt(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bt=/&/g,yt=/^\s*\/\/.*$/gm;function St(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=St(t.children,e)),t}))}function Ct(t){var e,n,o,i=void 0===t?v:t,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=c.slice();d.push((function(t){t.type===s.a&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(bt,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(t,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),e=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(yt,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=St(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(t){return h.push(t)}))))),h};return h.hash=c.length?c.reduce((function(t,e){return e.name||tt(15),_(t,e.name)}),5381).toString():"",h}var wt=new At,xt=Ct(),Et=i.default.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:xt}),Lt=(Et.Consumer,i.default.createContext(void 0));function _t(){return Object(i.useContext)(Et)}function Ot(t){var e=Object(i.useState)(t.stylisPlugins),n=e[0],o=e[1],r=_t().styleSheet,s=Object(i.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,r]),l=Object(i.useMemo)((function(){return Ct({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);Object(i.useEffect)((function(){a()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:s,stylis:l}}),[t.shouldForwardProp,s,l]);return i.default.createElement(Et.Provider,{value:c},i.default.createElement(Lt.Provider,{value:l},t.children))}var kt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=xt);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,J(this,(function(){throw tt(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=xt),this.name+t.hash},t}(),Tt=function(t){return t>="A"&&t<="Z"};function Pt(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;Tt(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Wt=function(t){return null==t||!1===t||""===t},Bt=function(t){var e,n,i=[];for(var r in t){var a=t[r];t.hasOwnProperty(r)&&!Wt(a)&&(Array.isArray(a)&&a.isCss||X(a)?i.push("".concat(Pt(r),":"),a,";"):q(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Bt(a),!1),["}"],!1)):i.push("".concat(Pt(r),": ").concat((e=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in l.a||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function Dt(t,e,n,o){return Wt(t)?[]:Q(t)?[".".concat(t.styledComponentId)]:X(t)?!X(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Dt(t(e),e,n,o):t instanceof kt?n?(t.inject(n,o),[t.getName(o)]):[t]:q(t)?Bt(t):Array.isArray(t)?Array.prototype.concat.apply(g,t.map((function(t){return Dt(t,e,n,o)}))):[t.toString()];var i}function It(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(X(n)&&!Q(n))return!1}return!0}var Rt=O(h),Mt=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&It(t),this.componentId=e,this.baseHash=_(Rt,e),this.baseStyle=n,At.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=Z(o,this.staticRulesId);else{var i=$(Dt(this.rules,t,e,n)),r=E(_(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=Z(o,r),this.staticRulesId=r}else{for(var s=_(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=$(Dt(u,t,e,n));s=_(s,d+c),l+=d}}if(l){var h=E(s>>>0);e.hasNameForId(this.componentId,h)||e.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=Z(o,h)}}return o},t}(),Ft=i.default.createContext(void 0);Ft.Consumer;var jt={};new Set;function Vt(t,e,n){var r=Q(t),a=t,s=!P(t),l=e.attrs,c=void 0===l?g:l,u=e.componentId,d=void 0===u?function(t,e){var n="string"!=typeof t?"sc":C(t);jt[n]=(jt[n]||0)+1;var o="".concat(n,"-").concat(k(h+n+jt[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):u,p=e.displayName,f=void 0===p?function(t){return P(t)?"styled.".concat(t):"Styled(".concat(T(t),")")}(t):p,m=e.displayName&&e.componentId?"".concat(C(e.displayName),"-").concat(e.componentId):e.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,S=e.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;S=function(t,e){return w(t,e)&&x(t,e)}}else S=w}var E=new Mt(n,m,r?a.componentStyle:void 0);function L(t,e){return function(t,e,n){var r=t.attrs,a=t.componentStyle,s=t.defaultProps,l=t.foldedComponentIds,c=t.styledComponentId,u=t.target,d=i.default.useContext(Ft),h=_t(),p=t.shouldForwardProp||h.shouldForwardProp,f=A(e,d,s)||v,m=function(t,e,n){for(var i,r=Object(o.a)(Object(o.a)({},e),{className:void 0,theme:n}),a=0;a<t.length;a+=1){var s=X(i=t[a])?i(r):i;for(var l in s)r[l]="className"===l?Z(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return e.className&&(r.className=Z(r.className,e.className)),r}(r,e,f),g=m.as||u,y={};for(var S in m)void 0===m[S]||"$"===S[0]||"as"===S||"theme"===S&&m.theme===f||("forwardedAs"===S?y.as=m.forwardedAs:p&&!p(S,g)||(y[S]=m[S]));var C=function(t,e){var n=_t();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(a,m),w=Z(l,c);return C&&(w+=" "+C),m.className&&(w+=" "+m.className),y[P(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(_,t,e)}L.displayName=f;var _=i.default.forwardRef(L);return _.attrs=y,_.componentStyle=E,_.displayName=f,_.shouldForwardProp=S,_.foldedComponentIds=r?Z(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=m,_.target=r?a.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)K(t,i[o],!0);return t}({},a.defaultProps,t):t}}),J(_,(function(){return".".concat(_.styledComponentId)})),s&&Y(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function zt(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}var Nt=function(t){return Object.assign(t,{isCss:!0})};function Ut(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(X(t)||q(t))return Nt(Dt(zt(g,Object(o.e)([t],e,!0))));var i=t;return 0===e.length&&1===i.length&&"string"==typeof i[0]?Dt(i):Nt(Dt(zt(i,e)))}function Ht(t,e,n){if(void 0===n&&(n=v),!e)throw tt(1,e);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return t(e,n,Ut.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),i))},i}var Gt=function(t){return Ht(Vt,t)},Yt=Gt;b.forEach((function(t){Yt[t]=Gt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=It(t),At.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o($(Dt(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&At.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}();function Xt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=$(Ut.apply(void 0,Object(o.e)([t],e,!1))),r=k(i);return new kt(r,i)}(function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=dt(),o=$([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw tt(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw tt(2);var n=((e={})[c]="",e[d]=h,e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=dt();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new At({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw tt(2);return i.default.createElement(Ot,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw tt(3)}})(),"__sc-".concat(c,"__")}).call(this,n(14))},function(t,e,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&t.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&t.push(s);else t.push(o.toString())}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return Y})),n.d(e,"c",(function(){return tt})),n.d(e,"d",(function(){return nt})),n.d(e,"e",(function(){return et})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return J}));var o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function p(t){return t.trim()}function f(t,e){return(t=e.exec(t))?t[0]:t}function m(t,e,n){return t.replace(e,n)}function g(t,e,n){return t.indexOf(e,n)}function v(t,e){return 0|t.charCodeAt(e)}function A(t,e,n){return t.slice(e,n)}function b(t){return t.length}function y(t){return t.length}function S(t,e){return e.push(t),t}function C(t,e){return t.map(e).join("")}function w(t,e){return t.filter((function(t){return!f(t,e)}))}var x=1,E=1,L=0,_=0,O=0,k="";function T(t,e,n,o,i,r,a,s){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:x,column:E,length:a,return:"",siblings:s}}function P(t,e){return h(T("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function W(t){for(;t.root;)t=P(t.root,{children:[t]});S(t,t.siblings)}function B(){return O=_<L?v(k,_++):0,E++,10===O&&(E=1,x++),O}function D(){return v(k,_)}function I(){return _}function R(t,e){return A(k,t,e)}function M(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function F(t){return x=E=1,L=b(k=t),_=0,[]}function j(t){return k="",t}function V(t){return p(R(_-1,U(91===t?t+2:40===t?t+1:t)))}function z(t){for(;(O=D())&&O<33;)B();return M(t)>2||M(O)>3?"":" "}function N(t,e){for(;--e&&B()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return R(t,I()+(e<6&&32==D()&&32==B()))}function U(t){for(;B();)switch(O){case t:return _;case 34:case 39:34!==t&&39!==t&&U(O);break;case 40:41===t&&U(t);break;case 92:B()}return _}function H(t,e){for(;B()&&t+O!==57&&(t+O!==84||47!==D()););return"/*"+R(e,_-1)+"*"+d(47===t?t:B())}function G(t){for(;!M(D());)B();return R(t,_)}function Y(t){return j(X("",null,null,null,[""],t=F(t),0,[0],t))}function X(t,e,n,o,i,r,a,s,l){for(var c=0,h=0,p=a,f=0,A=0,y=0,C=1,w=1,L=1,T=0,P="",W=i,R=r,M=o,F=P;w;)switch(y=T,T=B()){case 40:if(108!=y&&58==v(F,p-1)){-1!=g(F+=m(V(T),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(L=-1);break}case 34:case 39:case 91:F+=V(T);break;case 9:case 10:case 13:case 32:F+=z(y);break;case 92:F+=N(I()-1,7);continue;case 47:switch(D()){case 42:case 47:S(Z(H(B(),I()),e,n,l),l);break;default:F+="/"}break;case 123*C:s[c++]=b(F)*L;case 125*C:case 59:case 0:switch(T){case 0:case 125:w=0;case 59+h:-1==L&&(F=m(F,/\f/g,"")),A>0&&b(F)-p&&S(A>32?$(F+";",o,n,p-1,l):$(m(F," ","")+";",o,n,p-2,l),l);break;case 59:F+=";";default:if(S(M=Q(F,e,n,c,h,i,s,P,W=[],R=[],p,r),r),123===T)if(0===h)X(F,e,M,M,W,r,p,s,R);else switch(99===f&&110===v(F,3)?100:f){case 100:case 108:case 109:case 115:X(t,M,M,o&&S(Q(t,M,M,0,0,i,s,P,i,W=[],p,R),R),i,R,p,s,o?W:R);break;default:X(F,M,M,M,[""],R,0,s,R)}}c=h=A=0,C=L=1,P=F="",p=a;break;case 58:p=1+b(F),A=y;default:if(C<1)if(123==T)--C;else if(125==T&&0==C++&&125==(O=_>0?v(k,--_):0,E--,10===O&&(E=1,x--),O))continue;switch(F+=d(T),T*C){case 38:L=h>0?1:(F+="\f",-1);break;case 44:s[c++]=(b(F)-1)*L,L=1;break;case 64:45===D()&&(F+=V(B())),f=D(),h=p=b(P=F+=G(I())),T++;break;case 45:45===y&&2==b(F)&&(C=0)}}return r}function Q(t,e,n,o,i,r,a,l,c,d,h,f){for(var g=i-1,v=0===i?r:[""],b=y(v),S=0,C=0,w=0;S<o;++S)for(var x=0,E=A(t,g+1,g=u(C=a[S])),L=t;x<b;++x)(L=p(C>0?v[x]+" "+E:m(E,/&\f/g,v[x])))&&(c[w++]=L);return T(t,e,n,0===i?s:l,c,d,h,f)}function Z(t,e,n,o){return T(t,e,n,a,d(O),A(t,2,-2),0,o)}function $(t,e,n,o,i){return T(t,e,n,l,A(t,0,o),A(t,o+1,-1),o,i)}function q(t,e,n){switch(function(t,e){return 45^v(t,0)?(((e<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0}(t,e)){case 5103:return r+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+t+t;case 4789:return i+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return r+t+i+t+o+t+t;case 5936:switch(v(t,e+11)){case 114:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return r+t+o+t+t;case 6165:return r+t+o+"flex-"+t+t;case 5187:return r+t+m(t,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return r+t+o+"flex-item-"+m(t,/flex-|-self/g,"")+(f(t,/flex-|baseline/)?"":o+"grid-row-"+m(t,/flex-|-self/g,""))+t;case 4675:return r+t+o+"flex-line-pack"+m(t,/align-content|flex-|-self/g,"")+t;case 5548:return r+t+o+m(t,"shrink","negative")+t;case 5292:return r+t+o+m(t,"basis","preferred-size")+t;case 6060:return r+"box-"+m(t,"-grow","")+r+t+o+m(t,"grow","positive")+t;case 4554:return r+m(t,/([^-])(transform)/g,"$1"+r+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+t+t;case 4200:if(!f(t,/flex-|baseline/))return o+"grid-column-align"+A(t,e)+t;break;case 2592:case 3360:return o+m(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,f(t.props,/grid-\w+-end/)}))?~g(t+(n=n[e].value),"span",0)?t:o+m(t,"-start","")+t+o+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(t,/\d+/))+";":o+m(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return f(t.props,/grid-\w+-start/)}))?t:o+m(m(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,r+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(b(t)-1-e>6)switch(v(t,e+1)){case 109:if(45!==v(t,e+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+i+(108==v(t,e+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch",0)?q(m(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return m(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+t}));case 4949:if(121===v(t,e+6))return m(t,":",":"+r)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return m(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(t,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+o+"$2box$3")+t;case 100:return m(t,":",":"+o)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return m(t,"scroll-","scroll-snap-")+t}return t}function K(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function J(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case l:return t.return=t.return||t.value;case a:return"";case c:return t.return=t.value+"{"+K(t.children,o)+"}";case s:if(!b(t.value=t.props.join(",")))return""}return b(n=K(t.children,o))?t.return=t.value+"{"+n+"}":""}function tt(t){var e=y(t);return function(n,o,i,r){for(var a="",s=0;s<e;s++)a+=t[s](n,o,i,r)||"";return a}}function et(t){return function(e){e.root||(e=e.return)&&t(e)}}function nt(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case l:return void(t.return=q(t.value,t.length,n));case c:return K([P(t,{value:m(t.value,"@","@"+r)})],i);case s:if(t.length)return C(n=t.props,(function(e){switch(f(e,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":W(P(t,{props:[m(e,/:(read-\w+)/,":-moz-$1")]})),W(P(t,{props:[e]})),h(t,{props:w(n,i)});break;case"::placeholder":W(P(t,{props:[m(e,/:(plac\w+)/,":"+r+"input-$1")]})),W(P(t,{props:[m(e,/:(plac\w+)/,":-moz-$1")]})),W(P(t,{props:[m(e,/:(plac\w+)/,o+"input-$1")]})),W(P(t,{props:[e]})),h(t,{props:w(n,i)})}return""}))}}},,function(t,e,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=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 l(t,e){for(var n={},o=[],i=0;i<t.length;i++){var r=t[i],l=e.base?r[0]+e.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,e),references:1}),o.push(u)}return o}function c(t){var e=document.createElement("style"),o=t.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var a=r(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 u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=d(e,i);else{var r=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function p(t,e,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var f=null,m=0;function g(t,e){var n,o,i;if(e.singleton){var r=m++;n=f||(f=c(e)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(e),o=p.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(t,e),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,o){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";(function(t){function n(){if("undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.gatherTransferables=function(t,e){const n=[];return function t(o){if(!o)return;if(o.constructor===ImageData){const t={data:o.data.slice(),width:o.width,height:o.height};return n.push(t.data.buffer),t}if(o.constructor===ArrayBuffer){const t=e?o.slice(0):o;if(n.push(t),e)return o}else if(ArrayBuffer.isView(o)){let t;if(e){t=new(0,o.constructor)(o.buffer.slice(0))}else t=o;if(n.push(t.buffer),e)return o}else if(Array.isArray(o))for(let e=0;e<o.length;++e){const n=t(o[e]);n&&(o[e]=n)}else if(o.constructor===Object)for(const e in o)if(o.hasOwnProperty(e)){const n=t(o[e]);n&&(o[e]=n)}}(t),n},e.isRemote=function(t){return t.startsWith("http:")||t.startsWith("https:")},e.areThreadsAvailable=n,e.getBuildType=function(t){const{allowSimd:e=!0,allowThreads:o=!0}=t||{};let i="";if(e&&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}}()){i+="-simd";o&&n()&&(i+="-threads")}return i}}).call(this,n(14))},function(t,e,n){"use strict";var o=n(10),i=n.n(o)()((function(t){return t[1]}));i.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=i},function(t,e,n){"use strict";var o=n(10),i=n.n(o)()((function(t){return t[1]}));i.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=i},function(t,e){var n,o,i=t.exports={};function r(){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===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d<e;)l&&l[d].run();d=-1,e=c.length}l=null,u=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}i.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 f(t,e)),1!==c.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;var o=n(11);e.WorkerBridge=class{constructor(t,e){const{requestSuffix:n=""}=e||{},i=(0,o.getBuildType)(e),r=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${i}.js${n}`;if((0,o.isRemote)(r)){const t=new Blob([`importScripts("${r}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(r);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:o,result:i,error:r}=t.data,{resolve:a,reject:s}=this.continuations[o];delete this.continuations[o],r?s(r):a(i)}}post(t,e,n){return new Promise(((i,r)=>{const a=(0,o.gatherTransferables)(e,n),s=this.nextTicketId++;this.continuations[s]={resolve:i,reject:r},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){const{render:o,hydrate:i,unmountComponentAtNode:r}=n(0);function a(t){return{render(e){o(e,t)},unmount(){r(t)}}}e.createRoot=a,e.hydrateRoot=function(t,e){return i(e,t),a(t)}},function(t,e){t.exports=function(t,e,n,o){var i=n?n.call(o,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l<r.length;l++){var c=r[l];if(!s(c))return!1;var u=t[c],d=e[c];if(!1===(i=n?n.call(o,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},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";function o(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}));var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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=o((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}))},function(t,e,n){"use strict";n.r(e),n.d(e,"ScanbotSDK",(function(){return Ld}));var o={};n.r(o),n.d(o,"SingleScanningMode",(function(){return St})),n.d(o,"Resolution",(function(){return Ct})),n.d(o,"CameraConfiguration",(function(){return wt})),n.d(o,"TopBarConfiguration",(function(){return xt})),n.d(o,"ActionBarConfiguration",(function(){return Et})),n.d(o,"BarcodeUseCase",(function(){return X})),n.d(o,"Palette",(function(){return K})),n.d(o,"StyledText",(function(){return J})),n.d(o,"IconStyle",(function(){return tt})),n.d(o,"PolygonStyle",(function(){return et})),n.d(o,"BackgroundStyle",(function(){return nt})),n.d(o,"ForegroundStyle",(function(){return ot})),n.d(o,"AspectRatio",(function(){return it})),n.d(o,"RoundButton",(function(){return rt})),n.d(o,"BadgedButton",(function(){return at})),n.d(o,"ButtonConfiguration",(function(){return st})),n.d(o,"Sound",(function(){return lt})),n.d(o,"Vibration",(function(){return ct})),n.d(o,"Timeouts",(function(){return ut})),n.d(o,"ViewFinderConfiguration",(function(){return Pt})),n.d(o,"FinderStyle",(function(){return Q})),n.d(o,"FinderCorneredStyle",(function(){return Wt})),n.d(o,"FinderStrokedStyle",(function(){return Bt})),n.d(o,"UserGuidanceConfiguration",(function(){return Dt})),n.d(o,"BarcodeItemErrorState",(function(){return At})),n.d(o,"BarcodeMappedData",(function(){return bt})),n.d(o,"BarcodeInfoMapping",(function(){return yt})),n.d(o,"ExpectedBarcode",(function(){return It})),n.d(o,"BarcodeTextLocalization",(function(){return Rt})),n.d(o,"BarcodeRecognizerConfiguration",(function(){return Mt})),n.d(o,"ArOverlayPolygonConfiguration",(function(){return dt})),n.d(o,"BarcodeItemConfiguration",(function(){return ht})),n.d(o,"BadgeStyle",(function(){return pt})),n.d(o,"ArOverlayGeneralConfiguration",(function(){return ft})),n.d(o,"FindAndPickArOverlayPolygonConfiguration",(function(){return mt})),n.d(o,"FindAndPickBadgeConfiguration",(function(){return gt})),n.d(o,"ArOverlayFindAndPickConfiguration",(function(){return vt})),n.d(o,"BarcodeScannerConfiguration",(function(){return jt})),n.d(o,"BarcodeItem",(function(){return Vt})),n.d(o,"BarcodeScannerResult",(function(){return zt})),n.d(o,"Sheet",(function(){return Lt})),n.d(o,"SwipeToDelete",(function(){return _t})),n.d(o,"ManualCountEditDialog",(function(){return Ot})),n.d(o,"SheetContent",(function(){return kt})),n.d(o,"MultipleScanningMode",(function(){return Tt})),n.d(o,"ScanbotAlertDialog",(function(){return Nt})),n.d(o,"CameraPermissionScreen",(function(){return Ft}));var i={};n.r(i),n.d(i,"ParametricFilter",(function(){return Qt})),n.d(i,"ScanbotBinarizationFilter",(function(){return Kt})),n.d(i,"CustomBinarizationFilter",(function(){return Jt})),n.d(i,"ColorDocumentFilter",(function(){return te})),n.d(i,"BrightnessFilter",(function(){return ee})),n.d(i,"ContrastFilter",(function(){return ne})),n.d(i,"GrayscaleFilter",(function(){return oe})),n.d(i,"LegacyFilter",(function(){return ie})),n.d(i,"WhiteBlackPointFilter",(function(){return re}));var r="5.1.3-dev.1";class a{}a.VERSION=r,a.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@5.1.3-dev.1/bundle/",a.DEFAULT_WASM_FOLDER="bin/complete/",a.BUILD_WITH_UI=!1;var s=n(15),l=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class c{constructor(t,e,n){t||(t=a.CDN_PATH+a.DEFAULT_WASM_FOLDER),this.core=new s.WorkerBridge(t,e),this.coreInitializationSuccessful=this.core.postByCopyingArgs("initialize",n)}awaitInitialized(){return l(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}postByCopyingArgs(t,e){return l(this,void 0,void 0,(function*(){return(yield this.getCoreForCommand(t)).postByCopyingArgs(t,e)}))}postByTransferringArgs(t,e){return l(this,void 0,void 0,(function*(){return(yield this.getCoreForCommand(t)).postByTransferringArgs(t,e)}))}getCoreForCommand(t=""){return l(this,void 0,void 0,(function*(){const e=yield this.coreInitializationSuccessful;if("getLicenseInfo"===t||e)return this.core;throw new Error("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")}))}}c.ASM_JS="ScanbotSDK.Core.js";var u=n(11);class d{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((o=>{(null==n?void 0:n.includes(o))||(e[o]=t[o])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((o=>{o in e&&n(t[o])&&n(e[o])?d.mapValuesDeep(t[o],e[o]):e[o]=t[o]}))}static _fromJson(t,e){return this.mapValuesDeep(e,t),t}}class h extends d{constructor(t){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",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)}}h.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},h.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},h.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,h.DEFAULT_ACCEPTED_ANGLE_SCORE=75,h.DEFAULT_ACCEPTED_SIZE_SCORE=75;const p={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 f{constructor(t){this.hint=t}}class m{constructor(){this.outline=new g,this.captureButton=new y}}class g{constructor(){this.polygon=new v,this.path=new A,this.label=new b}}class v{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}class A{constructor(){this.stroke="green",this.strokeWidth=4}}class b{}class y{constructor(){this.color="#FFF"}}class S extends h{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_4K),this.acceptedBrightnessThreshold=S.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE,this.acceptedAngleScore=S.DEFAULT_ACCEPTED_ANGLE_SCORE,this.acceptedSizeScore=S.DEFAULT_ACCEPTED_SIZE_SCORE,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new f(p),this.style=new m,this.onDocumentDetected=function(t){}}static fromJson(t){const e=new S;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 o=n.path;o&&this.mapValues(o,e.style.outline.path);const i=n.label;i&&this.mapValues(i,e.style.outline.label)}const o=t.style.captureButton;o&&this.mapValues(o,e.style.captureButton)}return this.mapVideoConstraints(t,e),e}}class C{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new C;return e.status=t.licenseStatus,e.description=t.description,e}}var w=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class x{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t){return w(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByCopyingArgs("addPageToPdf",[this._pdfOperation,t])}))}complete(){return w(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completePdf",[this._pdfOperation])}))}}var E=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};const L=["ROTATION_NONE","ROTATION_90_CLOCKWISE","ROTATION_180","ROTATION_90_COUNTERCLOCKWISE"];class _{constructor(t,e){this._sdk=t,this._token=e}copy(){return E(this,void 0,void 0,(function*(){const t=yield this._sdk.bridge.postByCopyingArgs("imageProcessorCopy",[this._token]);return new _(this._sdk,t)}))}applyFilter(t){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("imageProcessorApplyFilter",[this._token,t])}))}crop(t){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("imageProcessorCrop",[this._token,t])}))}resize(t){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("imageProcessorResize",[this._token,t])}))}rotate(t){return E(this,void 0,void 0,(function*(){if(!L.includes(t))return Promise.reject("Invalid rotation value! It should be one of "+L.join(", "));yield this._sdk.bridge.postByTransferringArgs("imageProcessorRotate",[this._token,t])}))}processedImage(){return E(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("imageProcessorEncodedProcessedImage",[this._token,".jpg"])}))}release(){return E(this,void 0,void 0,(function*(){yield this._sdk.release(this._token,"ImageProcessor"),this._token=null,this._sdk=null}))}get __token(){return this._token}}var O=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class k{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t){return O(this,void 0,void 0,(function*(){let e;e=t instanceof _?t.__token:t,yield this._sdk.bridge.postByCopyingArgs("addPageToTiff",[this._tiffOperation,e])}))}complete(){return O(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completeTiff",[this._tiffOperation])}))}}class T{constructor(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}scaleDown(t){return new T(this.x/t,this.y/t,this.width/t,this.height/t)}bottom(){return this.y+this.height}static withSize(t,e){return new T(0,0,t,e)}static empty(){return new T(0,0,0,0)}static fromRect(t){return t?new T(t.x,t.y,t.width,t.height):T.empty()}static fromPoint(t,e){return new T(t.x-e/2,t.y-e/2,e,e)}static fromDOMRect(t){return new T(t.x,t.y,t.width,t.height)}}class P{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){let n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let o=0;o<5;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}}var W=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class B{static toDataUrl(t){return new Promise(((e,n)=>{const o=new Blob([t],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(t,e,n=!0){const o=e.width/e.height,i=t.width/t.height;let r=0,a=0;(n?o>i:o<i)?(r=t.width,a=r/o):(a=t.height,r=a*o);const s=(t.width-r)/2,l=(t.height-a)/2;return new T(s,l,r,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>W(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,P.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 o=URL.createObjectURL(t);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return B.createImageDataCanvas(B.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}static toBase64(t){return W(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(new Blob([t]))}));return e.slice(e.indexOf(",")+1)}))}}class D{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=P.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});B.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 I(t,e,n){return Math.min(Math.max(t,e),n)}class R{constructor(t,e){this.x=t,this.y=e}static toPolygon(t,e){return[R.scaleDownTo(t[0],e),R.scaleDownTo(t[1],e),R.scaleDownTo(t[2],e),R.scaleDownTo(t[3],e)]}static scaleToPoint(t,e,n,o){return new R(o*(t.x-e),o*(t.y-n))}static scaleListToHtmlElement(t,e,n){return t.map((t=>R.scaleToHtmlElement(t,e,n)))}static scaleToHtmlElement(t,e,n){return new R(t.x*(n.clientWidth/e.width),t.y*(n.clientHeight/e.height))}static scaleUpTo(t,e){return new R(t.x*e.width,t.y*e.height)}static scaleDownTo(t,e){return new R(t.x/e.width,t.y/e.height)}static fromHtmlElement(t){return new R(t.offsetLeft,t.offsetTop)}static withScale(t,e,n){return new R(t/n,e/n)}static fromCoordinates(t,e,n,o){if(!t||!e)return new R(0,0);const i=new R(t,e);return o=null!=o?o:1,1===(n=n?n%4:0)?R.withScale(i.y,-i.x,o):2===n?R.withScale(-i.x,-i.y,o):3===n?R.withScale(-i.y,i.x,o):R.withScale(i.x,i.y,o)}static centerOf(t){const e=t.reduce(((t,e)=>t+e.x),0)/t.length,n=t.reduce(((t,e)=>t+e.y),0)/t.length;return new R(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 R(0,0)}static centerX(t){if(t)return(R.highestX(t)+R.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 R.highestX(t)-R.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(" ")}static toSvgPathStringWithRoundedCorners(t,e=0){if(void 0===t)return;function n(t,e,n){const o=Math.atan2(t.y-e.y,t.x-e.x);return{x:t.x-n*Math.cos(o),y:t.y-n*Math.sin(o)}}let o="";const i=n(t[0],t[1],R.distance(t[0],t[1])/2);o+=`M ${i.x} ${i.y}`;for(let i=0;i<t.length;i++){const r=t[i],a=t[(i+1)%t.length],s=t[(i+2)%t.length],l=n(a,s,R.distance(a,s)/2),c=Math.abs(Math.atan2(a.y-r.y,a.x-r.x)-Math.atan2(a.y-s.y,a.x-s.x)),u=c>Math.PI?2*Math.PI-c:c,d=Math.min(Math.sqrt(Math.pow(a.x-r.x,2)+Math.pow(a.y-r.y,2)),Math.sqrt(Math.pow(a.x-s.x,2)+Math.pow(a.y-s.y,2))),h=Math.min(e,d*Math.tan(u/2)/2),p=Math.abs(h/Math.tan(u/2)),f=(a.x-r.x)*(a.y-s.y)-(a.x-s.x)*(a.y-r.y)<0?1:0,m=n(a,r,p),g=n(a,s,p);o+=` L${m.x} ${m.y}`,o+=` A${h} ${h} 0 0 ${f} ${g.x} ${g.y}`,o+=` L${l.x} ${l.y}`}return o+" Z"}static distance(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}static subtract(t,e){return new R(t.x-e.x,t.y-e.y)}static add(t,e){return new R(t.x+e.x,t.y+e.y)}static multiply(t,e){return new R(t.x*e,t.y*e)}static cross(t,e){return t.x*e.y-t.y*e.x}static clamp(t,e){return new R(I(t.x,0,e.width),I(t.y,0,e.height))}}class M{constructor(t,e,n,o,i,r){this.format=t,this.text=e,this.parsedDocument=n,this.rawBytes=o,this.points=i,this.barcodeImage=r}id(){return this.text+this.format}equals(t){return this.format===t.format&&this.text===t.text}static fromWorker(t){const e=t.quad.map((t=>new R(t[0],t[1])));return new M(t.format,t.text,t.parsedDocument,t.rawBytes,e,t.barcodeImage)}}class F{constructor(t,e){this.barcodes=t,this.imageData=e}static fromWorker(t,e){const n=[];t&&t.forEach((t=>{n.push(M.fromWorker(t))}));const o=B.convertImageDataWrapperToImageData(e);return new F(n,o)}isEmpty(){return 0===this.barcodes.length}}class j{constructor(t,e,n,o){this.value=e,this.confidence=n,this.validated=o,this.name=t}}class V{}class z{static fromWorker(t){let e=new z;e.verificationSuccessful=t.verificationSuccessful;const n=new V,o=t.recognitionSuccessful;return(t.fields||[]).forEach((t=>{switch(t.name){case"DocumentNumber":e.documentNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"IssuingAuthority":e.issuingAuthority=new j(t.name,t.text,t.confidence,t.validated);break;case"DepartmentOfIssuance":e.departmentOfIssuance=new j(t.name,t.text,t.confidence,t.validated);break;case"GivenNames":e.givenNames=new j(t.name,t.text,t.confidence,t.validated);break;case"Surname":e.surname=new j(t.name,t.text,t.confidence,t.validated);break;case"Nationality":e.nationality=new j(t.name,t.text,t.confidence,t.validated);break;case"BirthDate":e.birthDate=new j(t.name,t.text,t.confidence,t.validated);break;case"Gender":e.gender=new j(t.name,t.text,t.confidence,t.validated);break;case"ExpiryDate":e.expiryDate=new j(t.name,t.text,t.confidence,t.validated);break;case"PersonalNumber":e.personalNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"TravelDocType":e.travelDocType=new j(t.name,t.text,t.confidence,t.validated);break;case"TravelDocTypeVariant":e.travelDocTypeVariant=new j(t.name,t.text,t.confidence,t.validated);break;case"DiscreetIssuingStateOrOrganization":e.discreetIssuingStateOrOrganization=new j(t.name,t.text,t.confidence,t.validated);break;case"DocumentTypeCode":e.kindOfDocumentField=new j(t.name,t.text,t.confidence,t.validated);break;case"DocumentType":e.documentType=new j(t.name,t.text,t.confidence,t.validated);break;case"Format":e.format=new j(t.name,t.text,t.confidence,t.validated);break;case"PINCode":e.pinCode=new j(t.name,t.text,t.confidence,t.validated);break;case"LanguageCode":e.languageCode=new j(t.name,t.text,t.confidence,t.validated);break;case"VersionNumber":e.versionNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitGeneral":n.general=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitDocumentNumber":n.documentNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitBirthDate":n.birthDate=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitExpiryDate":n.expiryDate=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitPersonalNumber":n.personalNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"Optional1":e.optional1=new j(t.name,t.text,t.confidence,t.validated);break;case"Optional2":e.optional2=new j(t.name,t.text,t.confidence,t.validated)}})),e.documentType||(e.documentType=new j("DocumentType",t.documentType)),o?e.checkDigits=n:e=void 0,e}}var N=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class U{constructor(t,e,n){this._sdk=t,this._mrzRecognizerToken=e,this.enableFrameAccumulation=n}recognize(t){return N(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeMRZ",[yield this._mrzRecognizerToken,t]);if(null===e)return;const n=z.fromWorker(e);return!this.enableFrameAccumulation&&n&&delete n.verificationSuccessful,n}catch(t){return void console.warn(t)}}))}recognizeURL(t){return N(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>N(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);e(r||void 0)}))}))}))}release(){return N(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[yield this._mrzRecognizerToken])}))}}var H=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class G{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t){return H(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("performOcr",[this._OcrEngineToken,t])}))}recognizeURL(t){return H(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>H(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return H(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._OcrEngineToken])}))}}class Y{static fromWorker(t){if(!t)return;const e=new Y;return e.text=t.rawText,e.confidence=t.confidence,e.validated=t.validationSuccessful,e}}var X,Q,Z=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class ${constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t){return Z(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeTextLine",[yield this._textDataScannerToken,t]);if(null===e)return;return Y.fromWorker(e)}catch(t){return void console.warn(t)}}))}cleanRecognitionQueue(){return Z(this,void 0,void 0,(function*(){try{yield this._sdk.bridge.postByTransferringArgs("cleanTextLineRecognitionQueue",[yield this._textDataScannerToken])}catch(t){return void console.warn(t)}}))}recognizeURL(t){return Z(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>Z(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);r&&e(r)}))}))}))}release(){return Z(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[yield this._textDataScannerToken])}))}}class q{}class K extends q{constructor(t={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==t.sbColorPrimary&&(this.sbColorPrimary=t.sbColorPrimary),void 0!==t.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=t.sbColorPrimaryDisabled),void 0!==t.sbColorNegative&&(this.sbColorNegative=t.sbColorNegative),void 0!==t.sbColorPositive&&(this.sbColorPositive=t.sbColorPositive),void 0!==t.sbColorWarning&&(this.sbColorWarning=t.sbColorWarning),void 0!==t.sbColorSecondary&&(this.sbColorSecondary=t.sbColorSecondary),void 0!==t.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=t.sbColorSecondaryDisabled),void 0!==t.sbColorOnPrimary&&(this.sbColorOnPrimary=t.sbColorOnPrimary),void 0!==t.sbColorOnSecondary&&(this.sbColorOnSecondary=t.sbColorOnSecondary),void 0!==t.sbColorSurface&&(this.sbColorSurface=t.sbColorSurface),void 0!==t.sbColorOutline&&(this.sbColorOutline=t.sbColorOutline),void 0!==t.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=t.sbColorOnSurfaceVariant),void 0!==t.sbColorOnSurface&&(this.sbColorOnSurface=t.sbColorOnSurface),void 0!==t.sbColorSurfaceLow&&(this.sbColorSurfaceLow=t.sbColorSurfaceLow),void 0!==t.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=t.sbColorSurfaceHigh),void 0!==t.sbColorModalOverlay&&(this.sbColorModalOverlay=t.sbColorModalOverlay)}}class J extends q{constructor(t={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class tt extends q{constructor(t={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.color&&(this.color=t.color)}}class et extends q{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#30FFFFFF",this.strokeWidth=2,this.cornerRadius=0,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class nt extends q{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth)}}class ot extends q{constructor(t={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==t.iconVisible&&(this.iconVisible=t.iconVisible),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class it extends q{constructor(t={}){super(),this.width=1,this.height=1,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height)}}class rt extends q{constructor(t={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class at extends q{constructor(t={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.badgeBackgroundColor&&(this.badgeBackgroundColor=t.badgeBackgroundColor),void 0!==t.badgeForegroundColor&&(this.badgeForegroundColor=t.badgeForegroundColor),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class st extends q{constructor(t={}){super(),this.visible=!0,this.text="",this.background=new nt({}),this.foreground=new ot({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.background&&(this.background=new nt(t.background)),void 0!==t.foreground&&(this.foreground=new ot(t.foreground))}}class lt extends q{constructor(t={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==t.successBeepEnabled&&(this.successBeepEnabled=t.successBeepEnabled),void 0!==t.soundType&&(this.soundType=t.soundType)}}class ct extends q{constructor(t={}){super(),this.enabled=!1,void 0!==t.enabled&&(this.enabled=t.enabled)}}class ut extends q{constructor(t={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==t.autoCancelTimeout&&(this.autoCancelTimeout=t.autoCancelTimeout),void 0!==t.initialScanDelay&&(this.initialScanDelay=t.initialScanDelay)}}class dt extends q{constructor(t={}){super(),this.visible=!0,this.deselected=new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.deselected&&(this.deselected=new et(t.deselected)),void 0!==t.selected&&(this.selected=new et(t.selected))}}class ht extends q{constructor(t={}){super(),this.imageVisible=!0,this.titleSelected=new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==t.imageVisible&&(this.imageVisible=t.imageVisible),void 0!==t.titleSelected&&(this.titleSelected=new J(t.titleSelected)),void 0!==t.subtitleSelected&&(this.subtitleSelected=new J(t.subtitleSelected)),void 0!==t.titleDeselected&&(this.titleDeselected=new J(t.titleDeselected)),void 0!==t.subtitleDeselected&&(this.subtitleDeselected=new J(t.subtitleDeselected)),void 0!==t.backgroundSelected&&(this.backgroundSelected=new et(t.backgroundSelected)),void 0!==t.backgroundDeselected&&(this.backgroundDeselected=new et(t.backgroundDeselected))}}class pt extends q{constructor(t={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==t.visible&&(this.visible=t.visible),void 0===t.background)throw new Error("background must be present in constructor argument");this.background=new nt(t.background),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor)}}class ft extends q{constructor(t={}){super(),this.visible=!1,this.counterBadge=new pt({background:new nt({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new dt({visible:!0,deselected:new et({}),selected:new et({})}),this.barcodeItemConfiguration=new ht({imageVisible:!0,titleSelected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.counterBadge&&(this.counterBadge=new pt(t.counterBadge)),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=t.barcodeItemInfoPosition),void 0!==t.polygon&&(this.polygon=new dt(t.polygon)),void 0!==t.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new ht(t.barcodeItemConfiguration))}}class mt extends q{constructor(t={}){super(),this.visible=!0,this.partiallyScanned=new et({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.partiallyScanned&&(this.partiallyScanned=new et(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new et(t.rejected)),void 0!==t.completed&&(this.completed=new et(t.completed))}}class gt extends q{constructor(t={}){super(),this.partiallyScanned=new pt({visible:!0,background:new nt({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new pt({visible:!0,background:new nt({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new pt({visible:!0,background:new nt({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==t.partiallyScanned&&(this.partiallyScanned=new pt(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new pt(t.rejected)),void 0!==t.completed&&(this.completed=new pt(t.completed))}}class vt extends q{constructor(t={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new mt({}),this.badge=new gt({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.polygon&&(this.polygon=new mt(t.polygon)),void 0!==t.badge&&(this.badge=new gt(t.badge))}}class At extends q{constructor(t={}){super(),this.title=new J({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new J({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new st({}),this.cancelButton=new st({}),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.subtitle&&(this.subtitle=new J(t.subtitle)),void 0!==t.retryButton&&(this.retryButton=new st(t.retryButton)),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton))}}class bt extends q{constructor(t={}){if(super(),void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=t.title,void 0===t.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=t.subtitle,void 0===t.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=t.barcodeImage}}class yt extends q{constructor(t={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new J({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new At({}),void 0!==t.barcodeItemMapper&&(this.barcodeItemMapper=null!=t.barcodeItemMapper?t.barcodeItemMapper:null),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.loadingMessage&&(this.loadingMessage=new J(t.loadingMessage)),void 0!==t.errorState&&(this.errorState=new At(t.errorState))}}class St extends q{constructor(t={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new st({visible:!0,text:"?sheetSubmitButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new st({visible:!0,text:"?singleModeConfirmationCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new yt({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new J({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new At({title:new J({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new J({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new st({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new st({text:"?barcodeInfoMappingErrorStateCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new ft({visible:!1,counterBadge:new pt({visible:!0,background:new nt({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new dt({visible:!0,deselected:new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new ht({imageVisible:!0,titleSelected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new J({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.confirmationSheetEnabled&&(this.confirmationSheetEnabled=t.confirmationSheetEnabled),void 0!==t.barcodeImageVisible&&(this.barcodeImageVisible=t.barcodeImageVisible),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.barcodeTitle&&(this.barcodeTitle=new J(t.barcodeTitle)),void 0!==t.barcodeSubtitle&&(this.barcodeSubtitle=new J(t.barcodeSubtitle)),void 0!==t.submitButton&&(this.submitButton=new st(t.submitButton)),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new yt(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new ft(t.arOverlay))}}class Ct extends q{constructor(t={}){if(super(),void 0===t.width)throw new Error("width must be present in constructor argument");if(this.width=t.width,void 0===t.height)throw new Error("height must be present in constructor argument");this.height=t.height}}class wt extends q{constructor(t={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new Ct({width:1920,height:1080}),void 0!==t.cameraModule&&(this.cameraModule=t.cameraModule),void 0!==t.zoomSteps&&(this.zoomSteps=t.zoomSteps.map((t=>t))),void 0!==t.defaultZoomFactor&&(this.defaultZoomFactor=t.defaultZoomFactor),void 0!==t.flashEnabled&&(this.flashEnabled=t.flashEnabled),void 0!==t.idealPreviewResolution&&(this.idealPreviewResolution=new Ct(t.idealPreviewResolution))}}class xt extends q{constructor(t={}){super(),this.title=new J({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new st({text:"Cancel",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new ot({color:"?sbColorOnPrimary"})}),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton))}}class Et extends q{constructor(t={}){super(),this.flashButton=new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==t.flashButton&&(this.flashButton=new rt(t.flashButton)),void 0!==t.zoomButton&&(this.zoomButton=new rt(t.zoomButton)),void 0!==t.flipCameraButton&&(this.flipCameraButton=new rt(t.flipCameraButton))}}class Lt extends q{constructor(t={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new at({}),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.collapsedVisibleHeight&&(this.collapsedVisibleHeight=t.collapsedVisibleHeight),void 0!==t.listButton&&(this.listButton=new at(t.listButton))}}class _t extends q{constructor(t={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.iconColor&&(this.iconColor=t.iconColor)}}class Ot extends q{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new J({text:"Update count",color:"?sbColorOnSurface"}),this.info=new J({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new st({visible:!0,text:"Update",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new st({visible:!0,text:"Cancel",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new tt({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.info&&(this.info=new J(t.info)),void 0!==t.updateButton&&(this.updateButton=new st(t.updateButton)),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton)),void 0!==t.clearTextButton&&(this.clearTextButton=new tt(t.clearTextButton))}}class kt extends q{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new J({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new st({visible:!0,text:"Clear all",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new J({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new st({visible:!0,text:"Submit",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new st({visible:!0,text:"Start scanning",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new J({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new J({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new tt({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new _t({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.manualCountChangeEnabled&&(this.manualCountChangeEnabled=t.manualCountChangeEnabled),void 0!==t.manualCountOutlineColor&&(this.manualCountOutlineColor=t.manualCountOutlineColor),void 0!==t.manualCountChangeColor&&(this.manualCountChangeColor=t.manualCountChangeColor),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.clearAllButton&&(this.clearAllButton=new st(t.clearAllButton)),void 0!==t.barcodeItemTitle&&(this.barcodeItemTitle=new J(t.barcodeItemTitle)),void 0!==t.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new J(t.barcodeItemSubtitle)),void 0!==t.barcodeItemImageVisible&&(this.barcodeItemImageVisible=t.barcodeItemImageVisible),void 0!==t.submitButton&&(this.submitButton=new st(t.submitButton)),void 0!==t.startScanningButton&&(this.startScanningButton=new st(t.startScanningButton)),void 0!==t.placeholderTitle&&(this.placeholderTitle=new J(t.placeholderTitle)),void 0!==t.placeholderSubtitle&&(this.placeholderSubtitle=new J(t.placeholderSubtitle)),void 0!==t.placeholderIconBackground&&(this.placeholderIconBackground=t.placeholderIconBackground),void 0!==t.placeholderIcon&&(this.placeholderIcon=new tt(t.placeholderIcon)),void 0!==t.swipeToDelete&&(this.swipeToDelete=new _t(t.swipeToDelete))}}class Tt extends q{constructor(t={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new Lt({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new at({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new kt({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new J({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new st({visible:!0,text:"?sheetClearAllButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new J({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new J({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new st({visible:!0,text:"?sheetSubmitButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new st({visible:!0,text:"?sheetStartScanningButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new J({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new J({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new tt({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new _t({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new Ot({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new J({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new J({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new st({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new st({visible:!0,text:"?manualCountEditDialogCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new tt({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new yt({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new J({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new At({title:new J({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new J({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new st({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new st({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new ft({visible:!1,counterBadge:new pt({visible:!0,background:new nt({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new dt({visible:!0,deselected:new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new ht({imageVisible:!0,titleSelected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new J({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new J({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.sheet&&(this.sheet=new Lt(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new kt(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new Ot(t.manualCountEditDialog)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new yt(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new ft(t.arOverlay))}}(X||(X={})).From=function(t){const e=t._type;switch(e){case"SingleScanningMode":return new St(t);case"MultipleScanningMode":return new Tt(t);default:throw`Unknown child class name: ${e}`}};class Pt extends q{constructor(t={}){super(),this.visible=!0,this.style=new Wt({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new it({width:1,height:1}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.style&&(this.style=Q.From(t.style)),void 0!==t.overlayColor&&(this.overlayColor=t.overlayColor),void 0!==t.aspectRatio&&(this.aspectRatio=new it(t.aspectRatio))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"FinderCorneredStyle":return new Wt(t);case"FinderStrokedStyle":return new Bt(t);default:throw`Unknown child class name: ${e}`}}}(Q||(Q={}));class Wt extends q{constructor(t={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class Bt extends q{constructor(t={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class Dt extends q{constructor(t={}){super(),this.visible=!0,this.title=new J({color:"?sbColorOnPrimary"}),this.background=new nt({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.background&&(this.background=new nt(t.background))}}class It extends q{constructor(t={}){if(super(),this.count=1,void 0===t.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");if(this.barcodeValue=t.barcodeValue,void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=null!=t.title?t.title:null,void 0===t.image)throw new Error("image must be present in constructor argument");this.image=null!=t.image?t.image:null,void 0!==t.count&&(this.count=t.count)}}class Rt extends q{constructor(t={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",void 0!==t.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=t.cameraPermissionEnableCameraTitle),void 0!==t.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=t.cameraPermissionEnableCameraExplanation),void 0!==t.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=t.cameraPermissionCloseButton),void 0!==t.topBarCancelButton&&(this.topBarCancelButton=t.topBarCancelButton),void 0!==t.topBarTitle&&(this.topBarTitle=t.topBarTitle),void 0!==t.userGuidance&&(this.userGuidance=t.userGuidance),void 0!==t.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=t.barcodeInfoMappingLoadingMessage),void 0!==t.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=t.barcodeInfoMappingErrorStateTitle),void 0!==t.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=t.barcodeInfoMappingErrorStateSubtitle),void 0!==t.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=t.barcodeInfoMappingErrorStateRetryButton),void 0!==t.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=t.barcodeInfoMappingErrorStateCancelButton),void 0!==t.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=t.manualCountEditDialogTitle),void 0!==t.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=t.manualCountEditDialogInfo),void 0!==t.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=t.manualCountEditDialogUpdateButton),void 0!==t.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=t.manualCountEditDialogCancelButton),void 0!==t.sheetClearAllButton&&(this.sheetClearAllButton=t.sheetClearAllButton),void 0!==t.sheetSubmitButton&&(this.sheetSubmitButton=t.sheetSubmitButton),void 0!==t.sheetStartScanningButton&&(this.sheetStartScanningButton=t.sheetStartScanningButton),void 0!==t.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=t.sheetPlaceholderTitle),void 0!==t.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=t.sheetPlaceholderSubtitle),void 0!==t.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=t.singleModeConfirmationCancelButton),void 0!==t.multipleModeSheetTitle&&(this.multipleModeSheetTitle=t.multipleModeSheetTitle)}}class Mt extends q{constructor(t={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="ML_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==t.barcodesRegexFilter&&(this.barcodesRegexFilter=t.barcodesRegexFilter),void 0!==t.barcodeFormats&&(this.barcodeFormats=t.barcodeFormats.map((t=>t))),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.maximumRecognizerResolution&&(this.maximumRecognizerResolution=t.maximumRecognizerResolution)}}class Ft extends q{constructor(t={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new tt({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new st({text:"Close",background:new nt({}),foreground:new ot({})}),this.enableCameraTitle=new J({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new J({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==t.background&&(this.background=t.background),void 0!==t.iconBackground&&(this.iconBackground=t.iconBackground),void 0!==t.icon&&(this.icon=new tt(t.icon)),void 0!==t.closeButton&&(this.closeButton=new st(t.closeButton)),void 0!==t.enableCameraTitle&&(this.enableCameraTitle=new J(t.enableCameraTitle)),void 0!==t.enableCameraExplanation&&(this.enableCameraExplanation=new J(t.enableCameraExplanation))}}class jt extends q{constructor(t={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new K({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new Rt({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new xt({title:new J({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new st({visible:!0,text:"?topBarCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new Et({flashButton:new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new Pt({visible:!0,style:new Wt({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new it({width:1,height:1})}),this.userGuidance=new Dt({visible:!0,title:new J({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new nt({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new Ft({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new tt({visible:!0,color:"?sbColorOnSurface"}),closeButton:new st({visible:!0,text:"?cameraPermissionCloseButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new J({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new J({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new wt({}),this.recognizerConfiguration=new Mt({}),this.useCase=new St({}),this.sound=new lt({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new ct({enabled:!0}),this.timeouts=new ut({autoCancelTimeout:0,initialScanDelay:0}),void 0!==t.version&&(this.version=t.version),void 0!==t.screen&&(this.screen=t.screen),void 0!==t.palette&&(this.palette=new K(t.palette)),void 0!==t.localization&&(this.localization=new Rt(t.localization)),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.topBar&&(this.topBar=new xt(t.topBar)),void 0!==t.actionBar&&(this.actionBar=new Et(t.actionBar)),void 0!==t.viewFinder&&(this.viewFinder=new Pt(t.viewFinder)),void 0!==t.userGuidance&&(this.userGuidance=new Dt(t.userGuidance)),void 0!==t.cameraPermission&&(this.cameraPermission=new Ft(t.cameraPermission)),void 0!==t.cameraConfiguration&&(this.cameraConfiguration=new wt(t.cameraConfiguration)),void 0!==t.recognizerConfiguration&&(this.recognizerConfiguration=new Mt(t.recognizerConfiguration)),void 0!==t.useCase&&(this.useCase=X.From(t.useCase)),void 0!==t.sound&&(this.sound=new lt(t.sound)),void 0!==t.vibration&&(this.vibration=new ct(t.vibration)),void 0!==t.timeouts&&(this.timeouts=new ut(t.timeouts))}}class Vt extends q{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.count)throw new Error("count must be present in constructor argument");if(this.count=t.count,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=t.rawBytes,void 0===t.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=t.parsedDocument?t.parsedDocument:null}}class zt extends q{constructor(t={}){super(),this.items=[],void 0!==t.items&&(this.items=t.items.map((t=>new Vt(t))))}}class Nt extends q{constructor(t={}){if(super(),this.title=new J({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new J({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.subtitle&&(this.subtitle=new J(t.subtitle)),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0===t.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new st(t.okButton),void 0===t.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new st(t.cancelButton)}}class Ut extends h{constructor(t){super(t);const e=new jt;this.finder=e.viewFinder,this.userGuidance=e.userGuidance}static mapFinderConfiguration(t,e){var n,o;h.mapValuesDeep(null!==(n=e.finder)&&void 0!==n?n:{},t.finder),h.mapValuesDeep(null!==(o=e.userGuidance)&&void 0!==o?o:{},t.userGuidance)}}class Ht extends Ut{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_HD),this.matchSubstring=!1,this.onTextDetected=function(t){},this.finder.aspectRatio.width=6,this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(t){const e=new Ht;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class Gt extends Ut{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_HD),this.onTextDetected=function(t){},this.finder.aspectRatio.width=6,this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(t){const e=new Gt;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class Yt extends Error{constructor(t){super(t.description),this.name="LicenseError"}}class Xt{static throwIfMissingBuffer(t){Xt.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}var Qt,Zt=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class $t{constructor(t,e){this._sdk=t,this._token=e}analyze(t){return Zt(this,void 0,void 0,(function*(){Xt.throwIfMissingBuffer(t);return yield this._sdk.bridge.postByCopyingArgs("documentQualityAnalyzerAnalyze",[this._token,t])}))}release(){return Zt(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._token])}))}}class qt{_marker(){}}!function(t){t.From=function(t){const e=t._type;switch(e){case"ScanbotBinarizationFilter":return new Kt(t);case"CustomBinarizationFilter":return new Jt(t);case"ColorDocumentFilter":return new te(t);case"BrightnessFilter":return new ee(t);case"ContrastFilter":return new ne(t);case"GrayscaleFilter":return new oe(t);case"LegacyFilter":return new ie(t);case"WhiteBlackPointFilter":return new re(t);default:throw`Unknown child class name: ${e}`}}}(Qt||(Qt={}));class Kt extends qt{constructor(t={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class Jt extends qt{constructor(t={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class te extends qt{constructor(t={}){super(),this._type="ColorDocumentFilter"}}class ee extends qt{constructor(t={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==t.brightness&&(this.brightness=t.brightness)}}class ne extends qt{constructor(t={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class oe extends qt{constructor(t={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==t.borderWidthFraction&&(this.borderWidthFraction=t.borderWidthFraction),void 0!==t.blackOutliersFraction&&(this.blackOutliersFraction=t.blackOutliersFraction),void 0!==t.whiteOutliersFraction&&(this.whiteOutliersFraction=t.whiteOutliersFraction)}}class ie extends qt{constructor(t={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==t.filterType&&(this.filterType=t.filterType)}}class re extends qt{constructor(t={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==t.blackPoint&&(this.blackPoint=t.blackPoint),void 0!==t.whitePoint&&(this.whitePoint=t.whitePoint)}}class ae{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}static debugWarn(t){this.verbose&&console.warn("ScanbotSDK:",t)}}var se=n(0),le=n(16),ce=n(2),ue=n.n(ce);const de=Object(se.createContext)(null);function he(t){return{getColorValue:e=>{if(e){if(e.startsWith("?")){const n=e.slice(1);if(n in t)return t[n];ae.debugWarn(`Color ${n} not found in palette`)}return e}ae.debugWarn("Color is missing")}}}class pe{static setPalette(t){this.palette=t}static setBarcodeTextLocalization(t){this.barcodeTextLocalization=t}static getColorValue(t){return he(pe.palette).getColorValue(t)}static getLocalizedBarcodeText(t){if(t.startsWith("?")){const e=t.slice(1);if(e in pe.barcodeTextLocalization)return pe.barcodeTextLocalization[e];ae.debugWarn(`Barcode text localization key ${e} not found in localization`)}return t}}pe.palette=(new jt).palette,pe.barcodeTextLocalization=(new jt).localization;const fe="var(--1-sb-dvh, 1vh)";function me(){const t=Object(se.useMemo)((()=>{var t,e;return null===(e=null===(t=null===window||void 0===window?void 0:window.CSS)||void 0===t?void 0:t.supports)||void 0===e?void 0:e.call(t,"height: 100dvh")}),[]),e=()=>{var e=t?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",e)};return Object(se.useEffect)((()=>{if(e(),!t)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}})),null}function ge(t){return{color:pe.getColorValue(t.color),textShadow:t.useShadow?"1px 1px 2px":""}}function ve(t){return t.config.visible?se.default.createElement("span",{ref:t.innerRef,style:Object.assign(Object.assign({},t.style),ge(t.config))},pe.getLocalizedBarcodeText(t.config.text)):null}var Ae=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function be(t){const e=Object(se.useContext)(de).getColorValue,{styleConfig:n}=t,o=Ae(t,["styleConfig"]),i=Object.assign(Object.assign({},t.style),{backgroundColor:e(n.fillColor),borderColor:e(n.strokeColor),borderWidth:n.strokeWidth,borderRadius:n.cornerRadius,borderStyle:"solid"});return se.default.createElement(ce.Box,Object.assign({},o,{style:i}))}function ye(t){var e;return t.visible?se.default.createElement(ce.Button,{variant:"text",onClick:t.onClick,sx:Object.assign(Object.assign({flex:1},ge(t.foreground)),{textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},px:0}),disableRipple:!0},se.default.createElement(be,{styleConfig:Object.assign(Object.assign({},t.background),{cornerRadius:4}),sx:{borderStyle:"solid",px:"8px"}},null!==(e=t.icon)&&void 0!==e?e:null,pe.getLocalizedBarcodeText(t.text))):se.default.createElement("div",{style:{display:"flex",flex:1}})}const Se=se.default.createContext(null);function Ce(t){const e=t.mode,n="HIDDEN"===e?0:48;Object(se.useEffect)((()=>{if("HIDDEN"===e)return;const n=document.createElement("meta");return n.name="theme-color",n.content=pe.getColorValue(t.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[e]);const o="SOLID"===e?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===e?`calc(100 * ${fe} - ${n}px)`:`calc(100 * ${fe})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===e?{backgroundColor:pe.getColorValue(t.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${pe.getColorValue(t.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return se.default.createElement(se.default.Fragment,null,"HIDDEN"!==e&&se.default.createElement(ce.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},se.default.createElement(ce.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},se.default.createElement(ce.Box,{sx:{flex:1}},t.cancelButton.visible&&se.default.createElement(se.default.Fragment,null,se.default.createElement(ye,Object.assign({onClick:t.onBackPress,icon:t.cancelButton.foreground.iconVisible&&se.default.createElement(ue.a,{sx:{fontSize:12,mr:"5px"}})},t.cancelButton)))),se.default.createElement(ce.Box,null,se.default.createElement(ce.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},se.default.createElement(ve,{config:t.title}))),se.default.createElement(ce.Box,{sx:{flex:1}}))),se.default.createElement(Se.Provider,{value:i},t.children))}function we(t){return{textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`,overflow:"hidden",whiteSpace:t>1?"normal":"nowrap",display:t>1?"-webkit-box":"block"}}function xe(t){var e,n;const o=(null===(e=t.barcodeMappedData)||void 0===e?void 0:e.state)||"LOADING",i=(null===(n=t.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!t||"LOADED"!==o,a=t.imageSize,s=t.barcodeTitle.visible||t.barcodeSubtitle.visible||t.counterForm,l=t.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:pe.getColorValue(t.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return se.default.createElement(ce.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},t.barcodeImageVisible&&se.default.createElement(ce.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},r?se.default.createElement(ce.Skeleton,{variant:"rounded",width:a,height:a,style:{borderRadius:8}}):se.default.createElement("img",{src:i.barcodeImage,alt:i.title,style:{width:a,height:a,borderRadius:8}})),s&&se.default.createElement(ce.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},t.barcodeTitle.visible&&se.default.createElement(ce.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},se.default.createElement(ce.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},we(t.maxNumberOfTitleLines)),ge(t.barcodeTitle))},r?se.default.createElement(ce.Skeleton,{variant:"text"}):i.title),t.displayRightArrow&&!r&&se.default.createElement(ue.a,{sx:{fontSize:16,fontWeight:"bold",color:pe.getColorValue(t.barcodeTitle.color)}})),t.barcodeSubtitle.visible&&se.default.createElement(ce.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},we(t.maxNumberOfSubtitleLines)),ge(t.barcodeSubtitle))},r?se.default.createElement(ce.Skeleton,{variant:"text"}):i.subtitle),t.counterForm&&se.default.createElement(ce.ButtonGroup,{variant:"outlined"},se.default.createElement(ce.Button,{sx:l,onClick:()=>t.counterForm.setCounter(t.counterForm.counter-1),disableRipple:!0},se.default.createElement(ue.a,{sx:{color:pe.getColorValue(t.counterForm.manualCountChangeColor)}})),se.default.createElement(ce.Button,{sx:Object.assign(Object.assign({},l),{color:pe.getColorValue(t.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:t.counterForm.onNumberClick,disableRipple:!0},t.counterForm.counter),se.default.createElement(ce.Button,{sx:l,onClick:()=>t.counterForm.setCounter(t.counterForm.counter+1),disableRipple:!0},se.default.createElement(ue.a,{sx:{color:pe.getColorValue(t.counterForm.manualCountChangeColor)}})))))}function Ee(t){const e=Object(se.useContext)(de).getColorValue;return t.visible?se.default.createElement(ce.Button,{onClick:t.onClick,type:t.type,sx:Object.assign(Object.assign({},t.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:e(t.background.strokeColor),borderWidth:t.background.strokeWidth,backgroundColor:e(t.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},t.foreground.iconVisible&&t.icon&&se.default.createElement(t.icon,{sx:{color:e(t.foreground.color),pr:2}}),se.default.createElement(ve,{config:{visible:!0,text:t.text,color:t.foreground.color,useShadow:t.foreground.useShadow}})):null}var Le=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function _e(t){var e,{modalOverlayColor:n}=t,o=Le(t,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:pe.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(e=o.PaperProps)||void 0===e?void 0:e.sx),{maxWidth:400})});return se.default.createElement(ce.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function Oe(t){const e=Object(se.useContext)(de).getColorValue,n=!t.barcodeMappedData||"LOADED"!==t.barcodeMappedData.state,o={backgroundColor:e(n?t.sheetColorLoading:t.sheetColorLoaded)},[i,r]=se.default.useState(),a=Object(se.useRef)((()=>{}));Object(se.useEffect)((()=>{t.open&&r(!1)}),[t.open]);const s=()=>{a.current=t.handleCancel,r(!0)};return se.default.createElement(_e,{modalOverlayColor:t.modalOverlayColor,open:t.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},se.default.createElement(ce.DialogContent,{style:o},se.default.createElement(xe,Object.assign({},t,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),se.default.createElement(ce.DialogActions,{style:o},se.default.createElement(ue.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},se.default.createElement(ue.a,{item:!0,xs:12},se.default.createElement(ue.a,{color:e(t.dividerColor)})),n?se.default.createElement(ue.a,{item:!0,xs:12,sx:{textAlign:"center"}},se.default.createElement(ce.Box,null,se.default.createElement(ce.CircularProgress,{sx:{color:e(t.loadingMessage.color),verticalAlign:"middle",mr:2}}),se.default.createElement(ve,{config:t.loadingMessage}))):se.default.createElement(se.default.Fragment,null,se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({style:{width:"100%"},onClick:s},t.cancelButton))),se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({style:{width:"100%"},onClick:()=>{a.current=t.handleSubmit,r(!0)}},t.submitButton)))))))}function ke(t){const e=Object(se.useRef)(!0);Object(se.useEffect)((()=>(e.current=!0,()=>{e.current=!1})));const[,n]=Object(se.useReducer)((t=>t+1),0),o=Object(se.useRef)();return Object(se.useMemo)((()=>{o.current={loading:!0,value:void 0,error:null}}),[t]),function(t,e){Object(se.useMemo)((()=>{t&&t.then((t=>{e({loading:!1,error:null,value:t})})).catch((t=>{e({loading:!1,error:{reason:t},value:void 0})}))}),[t])}(t,(t=>{o.current=t,e.current&&n()})),t?o.current:null}var Te=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};const Pe=Object(se.createContext)(null);class We{constructor(t,e){this.barcodeItemMapper=t,this.onError=e,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=t=>t.id(),this.onEvictionListeners=new Set}mapBarcodeToBarcodeItem(t,e){return Te(this,void 0,void 0,(function*(){return{count:e,rawBytes:yield B.toBase64(t.rawBytes),type:t.format,text:t.text,parsedDocument:t.parsedDocument}}))}getBarcodeMappedData(t){const e=this.hash(t);if(!this.cache.has(e)){const n=(()=>Te(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const e=yield this.mapBarcodeToBarcodeItem(t,1);return this.barcodeItemMapper(e)}return{title:t.text,subtitle:t.format,barcodeImage:yield B.toDataUrl(t.barcodeImage)}})))();this.cache.set(e,n)}return this.cache.get(e)}useBarcodeMappedData(t){const e=Object(se.useRef)(!1),n=ke(t&&this.getBarcodeMappedData(t));if(Object(se.useEffect)((()=>{n&&n.error&&(e.current=!1,this.cacheEntryPendingRetries.push({barcode:t,retry:()=>{this.cache.delete(this.hash(t)),e.current=!0}}),this.onError((()=>{for(const t of this.cacheEntryPendingRetries)t.retry();this.cacheEntryPendingRetries.length=0}),(()=>{e.current=!0;for(const t of this.cacheEntryPendingRetries)for(const e of this.onEvictionListeners)this.hash(e.barcode)==this.hash(t.barcode)&&e.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let o;return o=n.value?"LOADED":n.error&&!e.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:o}}addOnEvictionListener(t){this.onEvictionListeners.add(t)}removeOnEvictionListener(t){this.onEvictionListeners.delete(t)}}function Be(t){if(!1===t.visible)return null;const e={backgroundColor:t.active?pe.getColorValue(t.activeBackgroundColor):pe.getColorValue(t.backgroundColor),color:t.active?pe.getColorValue(t.activeForegroundColor):pe.getColorValue(t.foregroundColor)};return se.default.createElement(ce.IconButton,{sx:Object.assign(Object.assign({},e),{"&:hover, &:focus":Object.assign({outline:"none"},e),width:48,height:48}),onClick:t.onClick},t.text&&se.default.createElement("span",{style:{fontSize:15}},pe.getLocalizedBarcodeText(t.text)),t.icon&&se.default.createElement(t.icon,{style:{padding:7}}))}var De=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ie{constructor(){this.audioFile=new Audio}initialize(t){return De(this,void 0,void 0,(function*(){t.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(t){t.successBeepEnabled&&this.play()}play(){return De(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(t){}}))}}Ie.INSTANCE=new Ie;var Re=Ie;class Me{constructor(){this.DURATION=200}vibrate(t){t.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}Me.INSTANCE=new Me;var Fe=Me,je=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ve extends Error{constructor(t,e,n){super(e),this.name="",this.name=t,this.message=e,this.webApiError=n}static mediaDevicesUndefined(){return new Ve(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new Ve(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(t){return new Ve(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",t)}static permissionDenied(t){return new Ve(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",t)}static unknown(t){return new Ve(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",t)}static tryCheckPermission(){return je(this,void 0,void 0,(function*(){if(!this.permissionState)try{const t=yield navigator.permissions.query({name:"camera"});this.permissionState=t.state}catch(t){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}}Ve.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},Ve.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"};var ze=n(5);const Ne=ze.a.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 o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},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=20)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Component",(function(){return S})),n.d(e,"Fragment",(function(){return y})),n.d(e,"createContext",(function(){return G})),n.d(e,"createElement",(function(){return v})),n.d(e,"createRef",(function(){return b})),n.d(e,"useCallback",(function(){return ft})),n.d(e,"useContext",(function(){return mt})),n.d(e,"useDebugValue",(function(){return gt})),n.d(e,"useEffect",(function(){return ct})),n.d(e,"useErrorBoundary",(function(){return vt})),n.d(e,"useId",(function(){return At})),n.d(e,"useImperativeHandle",(function(){return ht})),n.d(e,"useLayoutEffect",(function(){return ut})),n.d(e,"useMemo",(function(){return pt})),n.d(e,"useReducer",(function(){return lt})),n.d(e,"useRef",(function(){return dt})),n.d(e,"useState",(function(){return st})),n.d(e,"Children",(function(){return Dt})),n.d(e,"PureComponent",(function(){return Ot})),n.d(e,"StrictMode",(function(){return ye})),n.d(e,"Suspense",(function(){return jt})),n.d(e,"SuspenseList",(function(){return Nt})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ue})),n.d(e,"cloneElement",(function(){return me})),n.d(e,"createFactory",(function(){return he})),n.d(e,"createPortal",(function(){return Yt})),n.d(e,"default",(function(){return Oe})),n.d(e,"findDOMNode",(function(){return ve})),n.d(e,"flushSync",(function(){return be})),n.d(e,"forwardRef",(function(){return Wt})),n.d(e,"hydrate",(function(){return te})),n.d(e,"isElement",(function(){return Ee})),n.d(e,"isFragment",(function(){return fe})),n.d(e,"isValidElement",(function(){return pe})),n.d(e,"lazy",(function(){return zt})),n.d(e,"memo",(function(){return kt})),n.d(e,"render",(function(){return Jt})),n.d(e,"startTransition",(function(){return Se})),n.d(e,"unmountComponentAtNode",(function(){return ge})),n.d(e,"unstable_batchedUpdates",(function(){return Ae})),n.d(e,"useDeferredValue",(function(){return Ce})),n.d(e,"useInsertionEffect",(function(){return xe})),n.d(e,"useSyncExternalStore",(function(){return Le})),n.d(e,"useTransition",(function(){return we})),n.d(e,"version",(function(){return de}));var o,i,r,a,s,l,c,u,d={},h=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function v(t,e,n){var i,r,a,s={};for(a in e)"key"==a?i=e[a]:"ref"==a?r=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?o.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 A(t,s,i,r,null)}function A(t,e,n,o,a){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(s),s}function b(){return{current:null}}function y(t){return t.children}function S(t,e){this.props=t,this.context=e}function C(t,e){if(null==e)return t.__?C(t.__,t.__i+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?C(t):null}function w(t,e,n){var o,r=t.__v,a=r.__e,s=t.__P;if(s)return(o=m({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),R(s,o,r,t.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,e,null==a?C(r):a,!!(32&r.__u),n),o.__v=r.__v,o.__.__k[o.__i]=o,o.__d=void 0,o.__e!=a&&x(o),o}function x(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 x(t)}}function E(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!L.__r++||s!==i.debounceRendering)&&((s=i.debounceRendering)||l)(L)}function L(){var t,e,n,o=[],r=[];for(a.sort(c);t=a.shift();)t.__d&&(n=a.length,e=w(t,o,r)||e,0===n||a.length>n?(M(o,e,r),r.length=o.length=0,e=void 0,a.sort(c)):e&&i.__c&&i.__c(e,h));e&&M(o,e,r),L.__r=0}function _(t,e,n,o,i,r,a,s,l,c,u){var p,f,m,g,v,A=o&&o.__k||h,b=e.length;for(n.__d=l,O(n,e,A),l=n.__d,p=0;p<b;p++)null!=(m=n.__k[p])&&"boolean"!=typeof m&&"function"!=typeof m&&(f=-1===m.__i?d:A[m.__i]||d,m.__i=p,R(t,m,f,i,r,a,s,l,c,u),g=m.__e,m.ref&&f.ref!=m.ref&&(f.ref&&j(f.ref,null,m),u.push(m.ref,m.__c||g,m)),null==v&&null!=g&&(v=g),65536&m.__u||f.__k===m.__k?l=k(m,l,t):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:g&&(l=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=v}function O(t,e,n){var o,i,r,a,s,l=e.length,c=n.length,u=c,d=0;for(t.__k=[],o=0;o<l;o++)null!=(i=t.__k[o]=null==(i=e[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?A(null,i,null,null,i):f(i)?A(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?A(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=P(i,n,a=o+d,u),i.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>l-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==o+d&&(i.__u|=65536))):(r=n[o])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=C(r)),V(r,r,!1),n[o]=null,u--);if(u)for(o=0;o<c;o++)null!=(r=n[o])&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=C(r)),V(r,r))}function k(t,e,n){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=k(o[i],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function T(t,e){return e=e||[],null==t||"boolean"==typeof t||(f(t)?t.some((function(t){T(t,e)})):e.push(t)),e}function P(t,e,n,o){var i=t.key,r=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&i==l.key&&r===l.type)return n;if(o>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<e.length){if((l=e[s])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function W(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||p.test(e)?n:n+"px"}function B(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||W(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||W(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=Date.now(),t.addEventListener(e,r?I:D,r)):t.removeEventListener(e,r?I:D,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function D(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(i.event?i.event(t):t)}}function I(t){if(this.l)return this.l[t.type+!0](i.event?i.event(t):t)}function R(t,e,n,o,r,a,s,l,c,u){var d,h,p,g,v,A,b,C,w,x,E,L,O,k,T,P=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=e.__e=n.__e]),(d=i.__b)&&d(e);t:if("function"==typeof P)try{if(C=e.props,w=(d=P.contextType)&&o[d.__c],x=d?w?w.props.value:d.__:o,n.__c?b=(h=e.__c=n.__c).__=h.__E:("prototype"in P&&P.prototype.render?e.__c=h=new P(C,x):(e.__c=h=new S(C,x),h.constructor=P,h.render=z),w&&w.sub(h),h.props=C,h.state||(h.state={}),h.context=x,h.__n=o,p=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=m({},h.__s)),m(h.__s,P.getDerivedStateFromProps(C,h.__s))),g=h.props,v=h.state,h.__v=e,p)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&C!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(C,x),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(C,h.__s,x)||e.__v===n.__v)){for(e.__v!==n.__v&&(h.props=C,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),E=0;E<h._sb.length;E++)h.__h.push(h._sb[E]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(C,h.__s,x),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,v,A)}))}if(h.context=x,h.props=C,h.__P=t,h.__e=!1,L=i.__r,O=0,"prototype"in P&&P.prototype.render){for(h.state=h.__s,h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[]}else do{h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++O<25);h.state=h.__s,null!=h.getChildContext&&(o=m(m({},o),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(A=h.getSnapshotBeforeUpdate(g,v)),_(t,f(T=null!=d&&d.type===y&&null==d.key?d.props.children:d)?T:[T],e,n,o,r,a,s,l,c,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),b&&(h.__E=h.__=null)}catch(t){e.__v=null,c||null!=a?(e.__e=l,e.__u|=c?160:32,a[a.indexOf(l)]=null):(e.__e=n.__e,e.__k=n.__k),i.__e(t,e,n)}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=F(n.__e,e,n,o,r,a,s,c,u);(d=i.diffed)&&d(e)}function M(t,e,n){for(var o=0;o<n.length;o++)j(n[o],n[++o],n[++o]);i.__c&&i.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){i.__e(t,e.__v)}}))}function F(t,e,n,i,r,a,s,l,c){var u,h,p,m,v,A,b,y=n.props,S=e.props,w=e.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){t=v,a[u]=null;break}if(null==t){if(null===w)return document.createTextNode(S);t=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,S.is&&S),a=null,l=!1}if(null===w)y===S||l&&t.data===S||(t.data=S);else{if(a=a&&o.call(t.childNodes),y=n.props||d,!l&&null!=a)for(y={},u=0;u<t.attributes.length;u++)y[(v=t.attributes[u]).name]=v.value;for(u in y)v=y[u],"children"==u||("dangerouslySetInnerHTML"==u?p=v:"key"===u||u in S||B(t,u,null,v,r));for(u in S)v=S[u],"children"==u?m=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?A=v:"checked"==u?b=v:"key"===u||l&&"function"!=typeof v||y[u]===v||B(t,u,v,y[u],r);if(h)l||p&&(h.__html===p.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(p&&(t.innerHTML=""),_(t,f(m)?m:[m],e,n,i,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&C(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);l||(u="value",void 0!==A&&(A!==t[u]||"progress"===w&&!A||"option"===w&&A!==y[u])&&B(t,u,A,y[u],!1),u="checked",void 0!==b&&b!==t[u]&&B(t,u,b,y[u],!1))}return t}function j(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){i.__e(t,n)}}function V(t,e,n){var o,r;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||j(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){i.__e(t,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&V(o[r],e,n||"function"!=typeof t.type);n||null==t.__e||g(t.__e),t.__=t.__e=t.__d=void 0}function z(t,e,n){return this.constructor(t,n)}function N(t,e,n){var r,a,s,l;i.__&&i.__(t,e),a=(r="function"==typeof n)?null:n&&n.__k||e.__k,s=[],l=[],R(e,t=(!r&&n||e).__k=v(y,null,[t]),a||d,d,void 0!==e.ownerSVGElement,!r&&n?[n]:a?null:e.firstChild?o.call(e.childNodes):null,s,!r&&n?n:a?a.__e:e.firstChild,r,l),t.__d=void 0,M(s,t,l)}function U(t,e){N(t,e,U)}function H(t,e,n){var i,r,a,s,l=m({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==a?i=e[a]:"ref"==a?r=e[a]:l[a]=void 0===e[a]&&void 0!==s?s[a]:e[a];return arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),A(t.type,l,i||t.key,r||t.ref,null)}function G(t,e){var n={__c:e="__cC"+u++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,o;return this.getChildContext||(n=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,E(t)}))},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}o=h.slice,i={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},r=0,S.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof t&&(t=t(m({},n),this.props)),t&&m(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),E(this))},S.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},S.prototype.render=y,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(t,e){return t.__v.__b-e.__v.__b},L.__r=0,u=0;var Y,X,Q,Z,$=0,q=[],K=[],J=i,tt=J.__b,et=J.__r,nt=J.diffed,ot=J.__c,it=J.unmount,rt=J.__;function at(t,e){J.__h&&J.__h(X,t,$||e),$=0;var n=X.__H||(X.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:K}),n.__[t]}function st(t){return $=1,lt(Et,t)}function lt(t,e,n){var o=at(Y++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Et(void 0,e),function(t){var e=o.__N?o.__N[0]:o.__[0],n=o.t(e,t);e!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=X,!X.u)){var i=function(t,e,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(t){return!!t.__c}));if(i.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var a=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&o.__c.props===t)&&(!r||r.call(this,t,e,n))};X.u=!0;var r=X.shouldComponentUpdate,a=X.componentWillUpdate;X.componentWillUpdate=function(t,e,n){if(this.__e){var o=r;r=void 0,i(t,e,n),r=o}a&&a.call(this,t,e,n)},X.shouldComponentUpdate=i}return o.__N||o.__}function ct(t,e){var n=at(Y++,3);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,X.__H.__h.push(n))}function ut(t,e){var n=at(Y++,4);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,X.__h.push(n))}function dt(t){return $=5,pt((function(){return{current:t}}),[])}function ht(t,e,n){$=6,ut((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))}function pt(t,e){var n=at(Y++,7);return xt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function ft(t,e){return $=8,pt((function(){return t}),e)}function mt(t){var e=X.context[t.__c],n=at(Y++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(X)),e.props.value):t.__}function gt(t,e){J.useDebugValue&&J.useDebugValue(e?e(t):t)}function vt(t){var e=at(Y++,10),n=st();return e.__=t,X.componentDidCatch||(X.componentDidCatch=function(t,o){e.__&&e.__(t,o),n[1](t)}),[n[0],function(){n[1](void 0)}]}function At(){var t=at(Y++,11);if(!t.__){for(var e=X.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function bt(){for(var t;t=q.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ct),t.__H.__h.forEach(wt),t.__H.__h=[]}catch(e){t.__H.__h=[],J.__e(e,t.__v)}}J.__b=function(t){X=null,tt&&tt(t)},J.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),rt&&rt(t,e)},J.__r=function(t){et&&et(t),Y=0;var e=(X=t.__c).__H;e&&(Q===X?(e.__h=[],X.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=K,t.__N=t.i=void 0}))):(e.__h.forEach(Ct),e.__h.forEach(wt),e.__h=[],Y=0)),Q=X},J.diffed=function(t){nt&&nt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==q.push(e)&&Z===J.requestAnimationFrame||((Z=J.requestAnimationFrame)||St)(bt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==K&&(t.__=t.__V),t.i=void 0,t.__V=K}))),Q=X=null},J.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Ct),t.__h=t.__h.filter((function(t){return!t.__||wt(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],J.__e(n,t.__v)}})),ot&&ot(t,e)},J.unmount=function(t){it&&it(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Ct(t)}catch(t){e=t}})),n.__H=void 0,e&&J.__e(e,n.__v))};var yt="function"==typeof requestAnimationFrame;function St(t){var e,n=function(){clearTimeout(o),yt&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);yt&&(e=requestAnimationFrame(n))}function Ct(t){var e=X,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),X=e}function wt(t){var e=X;t.__c=t.__(),X=e}function xt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function Et(t,e){return"function"==typeof e?e(t):e}function Lt(t,e){for(var n in e)t[n]=e[n];return t}function _t(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function Ot(t,e){this.props=t,this.context=e}function kt(t,e){function n(t){var n=this.props.ref,o=n==t.ref;return!o&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!o:_t(this.props,t)}function o(e){return this.shouldComponentUpdate=n,v(t,e)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ot.prototype=new S).isPureReactComponent=!0,Ot.prototype.shouldComponentUpdate=function(t,e){return _t(this.props,t)||_t(this.state,e)};var Tt=i.__b;i.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Tt&&Tt(t)};var Pt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Wt(t){function e(e){var n=Lt({},e);return delete n.ref,t(n,e.ref||null)}return e.$$typeof=Pt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Bt=function(t,e){return null==t?null:T(T(t).map(e))},Dt={map:Bt,forEach:Bt,count:function(t){return t?T(t).length:0},only:function(t){var e=T(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:T},It=i.__e;i.__e=function(t,e,n,o){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);It(t,e,n,o)};var Rt=i.unmount;function Mt(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=Lt({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Mt(t,e,n)}))),t}function Ft(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return Ft(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function jt(){this.__u=0,this.t=null,this.__b=null}function Vt(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function zt(t){var e,n,o;function i(i){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){o=t})),o)throw o;if(!n)throw e;return v(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Nt(){this.u=null,this.o=null}i.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Rt&&Rt(t)},(jt.prototype=new S).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=Vt(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=Ft(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},jt.prototype.componentWillUnmount=function(){this.t=[]},jt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Mt(this.__b,n,o.__O=o.__P)}this.__b=null}var i=e.__a&&v(y,null,t.fallback);return i&&(i.__u&=-33),[v(y,null,e.__a?null:t.children),i]};var Ut=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 Ht(t){return this.getChildContext=function(){return t.context},t.children}function Gt(t){var e=this,n=t.i;e.componentWillUnmount=function(){N(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),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)}}),N(v(Ht,{context:e.context},t.__v),e.l)}function Yt(t,e){var n=v(Gt,{__v:t,i:e});return n.containerInfo=e,n}(Nt.prototype=new S).__a=function(t){var e=this,n=Vt(e.__v),o=e.o.get(t);return o[0]++,function(i){var r=function(){e.props.revealOrder?(o.push(i),Ut(e,t,o)):i()};n?n(r):r()}},Nt.prototype.render=function(t){this.u=null,this.o=new Map;var e=T(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},Nt.prototype.componentDidUpdate=Nt.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Ut(t,n,e)}))};var Xt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Qt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Zt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,$t=/[A-Z0-9]/g,qt="undefined"!=typeof document,Kt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};function Jt(t,e,n){return null==e.__k&&(e.textContent=""),N(t,e),"function"==typeof n&&n(),t?t.__c:null}function te(t,e,n){return U(t,e),"function"==typeof n&&n(),t?t.__c:null}S.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(S.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var ee=i.event;function ne(){}function oe(){return this.cancelBubble}function ie(){return this.defaultPrevented}i.event=function(t){return ee&&(t=ee(t)),t.persist=ne,t.isPropagationStopped=oe,t.isDefaultPrevented=ie,t.nativeEvent=t};var re,ae={enumerable:!1,configurable:!0,get:function(){return this.class}},se=i.vnode;i.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var i in e){var r=e[i];if(!("value"===i&&"defaultValue"in e&&null==r||qt&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Kt(e.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":Zt.test(i)?i=a:-1===n.indexOf("-")&&Qt.test(i)?i=i.replace($t,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=T(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=T(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",ae)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=Xt,se&&se(t)};var le=i.__r;i.__r=function(t){le&&le(t),re=t.__c};var ce=i.diffed;i.diffed=function(t){ce&&ce(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value),re=null};var ue={ReactCurrentDispatcher:{current:{readContext:function(t){return re.__n[t.__c].props.value}}}},de="17.0.2";function he(t){return v.bind(null,t)}function pe(t){return!!t&&t.$$typeof===Xt}function fe(t){return pe(t)&&t.type===y}function me(t){return pe(t)?H.apply(null,arguments):t}function ge(t){return!!t.__k&&(N(null,t),!0)}function ve(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ae=function(t,e){return t(e)},be=function(t,e){return t(e)},ye=y;function Se(t){t()}function Ce(t){return t}function we(){return[!1,Se]}var xe=ut,Ee=pe;function Le(t,e){var n=e(),o=st({h:{__:n,v:e}}),i=o[0].h,r=o[1];return ut((function(){i.__=n,i.v=e,_e(i)&&r({h:i})}),[t,n,e]),ct((function(){return _e(i)&&r({h:i}),t((function(){_e(i)&&r({h:i})}))}),[t]),n}function _e(t){var e,n,o=t.v,i=t.__;try{var r=o();return!((e=i)===(n=r)&&(0!==e||1/e==1/n)||e!=e&&n!=n)}catch(t){return!0}}var Oe={useState:st,useId:At,useReducer:lt,useEffect:ct,useLayoutEffect:ut,useInsertionEffect:ut,useTransition:we,useDeferredValue:Ce,useSyncExternalStore:Le,startTransition:Se,useRef:dt,useImperativeHandle:ht,useMemo:pt,useCallback:ft,useContext:mt,useDebugValue:gt,version:"17.0.2",Children:Dt,render:Jt,hydrate:te,unmountComponentAtNode:ge,createPortal:Yt,createElement:v,createContext:G,createFactory:he,cloneElement:me,createRef:b,Fragment:y,isValidElement:pe,isElement:pe,isFragment:fe,findDOMNode:ve,Component:S,PureComponent:Ot,memo:kt,forwardRef:Wt,flushSync:be,unstable_batchedUpdates:Ae,StrictMode:y,Suspense:jt,SuspenseList:Nt,lazy:zt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ue}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return l}));var o=function(t,e){return o=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])},o(t,e)};function i(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function a(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}Object.create;function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}Object.create},function(t,e){t.exports=window["@mui"]},,,function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Yt})),n.d(e,"b",(function(){return Xt}));var o=n(1),i=(n(19),n(0)),r=n(17),a=n.n(r),s=n(7),l=n(18),c="undefined"!=typeof t&&void 0!==t.env&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",p="/*!sc*/\n",f="undefined"!=typeof window&&"HTMLElement"in window,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&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&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function A(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme}var b=new Set(["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","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","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","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,S=/(^-|-$)/g;function C(t){return t.replace(y,"-").replace(S,"")}var w=/(a)(d)/gi,x=function(t){return String.fromCharCode(t+(t>25?39:97))};function E(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(w,"$1-$2")}var L,_=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},O=function(t){return _(5381,t)};function k(t){return E(O(t)>>>0)}function T(t){return t.displayName||t.name||"Component"}function P(t){return"string"==typeof t&&!0}var W="function"==typeof Symbol&&Symbol.for,B=W?Symbol.for("react.memo"):60115,D=W?Symbol.for("react.forward_ref"):60112,I={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},R={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},M={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},F=((L={})[D]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},L[B]=M,L);function j(t){return("type"in(e=t)&&e.type.$$typeof)===B?M:"$$typeof"in t?F[t.$$typeof]:I;var e}var V=Object.defineProperty,z=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,H=Object.getPrototypeOf,G=Object.prototype;function Y(t,e,n){if("string"!=typeof e){if(G){var o=H(e);o&&o!==G&&Y(t,o,n)}var i=z(e);N&&(i=i.concat(N(e)));for(var r=j(t),a=j(e),s=0;s<i.length;++s){var l=i[s];if(!(l in R||n&&n[l]||a&&l in a||r&&l in r)){var c=U(e,l);try{V(t,l,c)}catch(t){}}}}return t}function X(t){return"function"==typeof t}function Q(t){return"object"==typeof t&&"styledComponentId"in t}function Z(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function $(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function q(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function K(t,e,n){if(void 0===n&&(n=!1),!n&&!q(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=K(t[o],e[o]);else if(q(e))for(var o in e)t[o]=K(t[o],e[o]);return t}function J(t,e){Object.defineProperty(t,"toString",{value:e})}function tt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var et=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw tt(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),s=(r=0,e.length);r<s;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(p);return e},t}(),nt=new Map,ot=new Map,it=1,rt=function(t){if(nt.has(t))return nt.get(t);for(;ot.has(it);)it++;var e=it++;return nt.set(t,e),ot.set(e,t),e},at=function(t,e){it=e+1,nt.set(t,e),ot.set(e,t)},st="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),lt=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ct=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ut=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(p),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(lt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(at(u,c),ct(t,u,l[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function dt(){return n.nc}var ht=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(c,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=dt();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},pt=function(){function t(t){this.element=ht(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw tt(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),ft=function(){function t(t){this.element=ht(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),mt=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),gt=f,vt={isServer:!f,useCSSOMInjection:!m},At=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={});var i=this;this.options=Object(o.a)(Object(o.a)({},vt),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&f&&gt&&(gt=!1,function(t){for(var e=document.querySelectorAll(st),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(c)!==u&&(ut(t,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),J(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return ot.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(t){t.length>0&&(l+="".concat(t,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(p)},r=0;r<n;r++)i(r);return o}(i)}))}return t.registerId=function(t){return rt(t)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(Object(o.a)(Object(o.a)({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new mt(n):e?new pt(n):new ft(n)}(this.options),new et(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(rt(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(rt(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(rt(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bt=/&/g,yt=/^\s*\/\/.*$/gm;function St(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=St(t.children,e)),t}))}function Ct(t){var e,n,o,i=void 0===t?v:t,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=c.slice();d.push((function(t){t.type===s.a&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(bt,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(t,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),e=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(yt,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=St(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(t){return h.push(t)}))))),h};return h.hash=c.length?c.reduce((function(t,e){return e.name||tt(15),_(t,e.name)}),5381).toString():"",h}var wt=new At,xt=Ct(),Et=i.default.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:xt}),Lt=(Et.Consumer,i.default.createContext(void 0));function _t(){return Object(i.useContext)(Et)}function Ot(t){var e=Object(i.useState)(t.stylisPlugins),n=e[0],o=e[1],r=_t().styleSheet,s=Object(i.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,r]),l=Object(i.useMemo)((function(){return Ct({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);Object(i.useEffect)((function(){a()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:s,stylis:l}}),[t.shouldForwardProp,s,l]);return i.default.createElement(Et.Provider,{value:c},i.default.createElement(Lt.Provider,{value:l},t.children))}var kt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=xt);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,J(this,(function(){throw tt(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=xt),this.name+t.hash},t}(),Tt=function(t){return t>="A"&&t<="Z"};function Pt(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;Tt(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Wt=function(t){return null==t||!1===t||""===t},Bt=function(t){var e,n,i=[];for(var r in t){var a=t[r];t.hasOwnProperty(r)&&!Wt(a)&&(Array.isArray(a)&&a.isCss||X(a)?i.push("".concat(Pt(r),":"),a,";"):q(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Bt(a),!1),["}"],!1)):i.push("".concat(Pt(r),": ").concat((e=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in l.a||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function Dt(t,e,n,o){return Wt(t)?[]:Q(t)?[".".concat(t.styledComponentId)]:X(t)?!X(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Dt(t(e),e,n,o):t instanceof kt?n?(t.inject(n,o),[t.getName(o)]):[t]:q(t)?Bt(t):Array.isArray(t)?Array.prototype.concat.apply(g,t.map((function(t){return Dt(t,e,n,o)}))):[t.toString()];var i}function It(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(X(n)&&!Q(n))return!1}return!0}var Rt=O(h),Mt=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&It(t),this.componentId=e,this.baseHash=_(Rt,e),this.baseStyle=n,At.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=Z(o,this.staticRulesId);else{var i=$(Dt(this.rules,t,e,n)),r=E(_(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=Z(o,r),this.staticRulesId=r}else{for(var s=_(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=$(Dt(u,t,e,n));s=_(s,d+c),l+=d}}if(l){var h=E(s>>>0);e.hasNameForId(this.componentId,h)||e.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=Z(o,h)}}return o},t}(),Ft=i.default.createContext(void 0);Ft.Consumer;var jt={};new Set;function Vt(t,e,n){var r=Q(t),a=t,s=!P(t),l=e.attrs,c=void 0===l?g:l,u=e.componentId,d=void 0===u?function(t,e){var n="string"!=typeof t?"sc":C(t);jt[n]=(jt[n]||0)+1;var o="".concat(n,"-").concat(k(h+n+jt[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):u,p=e.displayName,f=void 0===p?function(t){return P(t)?"styled.".concat(t):"Styled(".concat(T(t),")")}(t):p,m=e.displayName&&e.componentId?"".concat(C(e.displayName),"-").concat(e.componentId):e.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,S=e.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;S=function(t,e){return w(t,e)&&x(t,e)}}else S=w}var E=new Mt(n,m,r?a.componentStyle:void 0);function L(t,e){return function(t,e,n){var r=t.attrs,a=t.componentStyle,s=t.defaultProps,l=t.foldedComponentIds,c=t.styledComponentId,u=t.target,d=i.default.useContext(Ft),h=_t(),p=t.shouldForwardProp||h.shouldForwardProp,f=A(e,d,s)||v,m=function(t,e,n){for(var i,r=Object(o.a)(Object(o.a)({},e),{className:void 0,theme:n}),a=0;a<t.length;a+=1){var s=X(i=t[a])?i(r):i;for(var l in s)r[l]="className"===l?Z(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return e.className&&(r.className=Z(r.className,e.className)),r}(r,e,f),g=m.as||u,y={};for(var S in m)void 0===m[S]||"$"===S[0]||"as"===S||"theme"===S&&m.theme===f||("forwardedAs"===S?y.as=m.forwardedAs:p&&!p(S,g)||(y[S]=m[S]));var C=function(t,e){var n=_t();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(a,m),w=Z(l,c);return C&&(w+=" "+C),m.className&&(w+=" "+m.className),y[P(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(_,t,e)}L.displayName=f;var _=i.default.forwardRef(L);return _.attrs=y,_.componentStyle=E,_.displayName=f,_.shouldForwardProp=S,_.foldedComponentIds=r?Z(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=m,_.target=r?a.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)K(t,i[o],!0);return t}({},a.defaultProps,t):t}}),J(_,(function(){return".".concat(_.styledComponentId)})),s&&Y(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function zt(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}var Nt=function(t){return Object.assign(t,{isCss:!0})};function Ut(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(X(t)||q(t))return Nt(Dt(zt(g,Object(o.e)([t],e,!0))));var i=t;return 0===e.length&&1===i.length&&"string"==typeof i[0]?Dt(i):Nt(Dt(zt(i,e)))}function Ht(t,e,n){if(void 0===n&&(n=v),!e)throw tt(1,e);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return t(e,n,Ut.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),i))},i}var Gt=function(t){return Ht(Vt,t)},Yt=Gt;b.forEach((function(t){Yt[t]=Gt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=It(t),At.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o($(Dt(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&At.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}();function Xt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=$(Ut.apply(void 0,Object(o.e)([t],e,!1))),r=k(i);return new kt(r,i)}(function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=dt(),o=$([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw tt(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw tt(2);var n=((e={})[c]="",e[d]=h,e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=dt();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new At({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw tt(2);return i.default.createElement(Ot,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw tt(3)}})(),"__sc-".concat(c,"__")}).call(this,n(14))},function(t,e,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&t.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&t.push(s);else t.push(o.toString())}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return Y})),n.d(e,"c",(function(){return tt})),n.d(e,"d",(function(){return nt})),n.d(e,"e",(function(){return et})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return J}));var o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function p(t){return t.trim()}function f(t,e){return(t=e.exec(t))?t[0]:t}function m(t,e,n){return t.replace(e,n)}function g(t,e,n){return t.indexOf(e,n)}function v(t,e){return 0|t.charCodeAt(e)}function A(t,e,n){return t.slice(e,n)}function b(t){return t.length}function y(t){return t.length}function S(t,e){return e.push(t),t}function C(t,e){return t.map(e).join("")}function w(t,e){return t.filter((function(t){return!f(t,e)}))}var x=1,E=1,L=0,_=0,O=0,k="";function T(t,e,n,o,i,r,a,s){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:x,column:E,length:a,return:"",siblings:s}}function P(t,e){return h(T("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function W(t){for(;t.root;)t=P(t.root,{children:[t]});S(t,t.siblings)}function B(){return O=_<L?v(k,_++):0,E++,10===O&&(E=1,x++),O}function D(){return v(k,_)}function I(){return _}function R(t,e){return A(k,t,e)}function M(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function F(t){return x=E=1,L=b(k=t),_=0,[]}function j(t){return k="",t}function V(t){return p(R(_-1,U(91===t?t+2:40===t?t+1:t)))}function z(t){for(;(O=D())&&O<33;)B();return M(t)>2||M(O)>3?"":" "}function N(t,e){for(;--e&&B()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return R(t,I()+(e<6&&32==D()&&32==B()))}function U(t){for(;B();)switch(O){case t:return _;case 34:case 39:34!==t&&39!==t&&U(O);break;case 40:41===t&&U(t);break;case 92:B()}return _}function H(t,e){for(;B()&&t+O!==57&&(t+O!==84||47!==D()););return"/*"+R(e,_-1)+"*"+d(47===t?t:B())}function G(t){for(;!M(D());)B();return R(t,_)}function Y(t){return j(X("",null,null,null,[""],t=F(t),0,[0],t))}function X(t,e,n,o,i,r,a,s,l){for(var c=0,h=0,p=a,f=0,A=0,y=0,C=1,w=1,L=1,T=0,P="",W=i,R=r,M=o,F=P;w;)switch(y=T,T=B()){case 40:if(108!=y&&58==v(F,p-1)){-1!=g(F+=m(V(T),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(L=-1);break}case 34:case 39:case 91:F+=V(T);break;case 9:case 10:case 13:case 32:F+=z(y);break;case 92:F+=N(I()-1,7);continue;case 47:switch(D()){case 42:case 47:S(Z(H(B(),I()),e,n,l),l);break;default:F+="/"}break;case 123*C:s[c++]=b(F)*L;case 125*C:case 59:case 0:switch(T){case 0:case 125:w=0;case 59+h:-1==L&&(F=m(F,/\f/g,"")),A>0&&b(F)-p&&S(A>32?$(F+";",o,n,p-1,l):$(m(F," ","")+";",o,n,p-2,l),l);break;case 59:F+=";";default:if(S(M=Q(F,e,n,c,h,i,s,P,W=[],R=[],p,r),r),123===T)if(0===h)X(F,e,M,M,W,r,p,s,R);else switch(99===f&&110===v(F,3)?100:f){case 100:case 108:case 109:case 115:X(t,M,M,o&&S(Q(t,M,M,0,0,i,s,P,i,W=[],p,R),R),i,R,p,s,o?W:R);break;default:X(F,M,M,M,[""],R,0,s,R)}}c=h=A=0,C=L=1,P=F="",p=a;break;case 58:p=1+b(F),A=y;default:if(C<1)if(123==T)--C;else if(125==T&&0==C++&&125==(O=_>0?v(k,--_):0,E--,10===O&&(E=1,x--),O))continue;switch(F+=d(T),T*C){case 38:L=h>0?1:(F+="\f",-1);break;case 44:s[c++]=(b(F)-1)*L,L=1;break;case 64:45===D()&&(F+=V(B())),f=D(),h=p=b(P=F+=G(I())),T++;break;case 45:45===y&&2==b(F)&&(C=0)}}return r}function Q(t,e,n,o,i,r,a,l,c,d,h,f){for(var g=i-1,v=0===i?r:[""],b=y(v),S=0,C=0,w=0;S<o;++S)for(var x=0,E=A(t,g+1,g=u(C=a[S])),L=t;x<b;++x)(L=p(C>0?v[x]+" "+E:m(E,/&\f/g,v[x])))&&(c[w++]=L);return T(t,e,n,0===i?s:l,c,d,h,f)}function Z(t,e,n,o){return T(t,e,n,a,d(O),A(t,2,-2),0,o)}function $(t,e,n,o,i){return T(t,e,n,l,A(t,0,o),A(t,o+1,-1),o,i)}function q(t,e,n){switch(function(t,e){return 45^v(t,0)?(((e<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0}(t,e)){case 5103:return r+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+t+t;case 4789:return i+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return r+t+i+t+o+t+t;case 5936:switch(v(t,e+11)){case 114:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return r+t+o+t+t;case 6165:return r+t+o+"flex-"+t+t;case 5187:return r+t+m(t,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return r+t+o+"flex-item-"+m(t,/flex-|-self/g,"")+(f(t,/flex-|baseline/)?"":o+"grid-row-"+m(t,/flex-|-self/g,""))+t;case 4675:return r+t+o+"flex-line-pack"+m(t,/align-content|flex-|-self/g,"")+t;case 5548:return r+t+o+m(t,"shrink","negative")+t;case 5292:return r+t+o+m(t,"basis","preferred-size")+t;case 6060:return r+"box-"+m(t,"-grow","")+r+t+o+m(t,"grow","positive")+t;case 4554:return r+m(t,/([^-])(transform)/g,"$1"+r+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+t+t;case 4200:if(!f(t,/flex-|baseline/))return o+"grid-column-align"+A(t,e)+t;break;case 2592:case 3360:return o+m(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,f(t.props,/grid-\w+-end/)}))?~g(t+(n=n[e].value),"span",0)?t:o+m(t,"-start","")+t+o+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(t,/\d+/))+";":o+m(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return f(t.props,/grid-\w+-start/)}))?t:o+m(m(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,r+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(b(t)-1-e>6)switch(v(t,e+1)){case 109:if(45!==v(t,e+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+i+(108==v(t,e+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch",0)?q(m(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return m(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+t}));case 4949:if(121===v(t,e+6))return m(t,":",":"+r)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return m(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(t,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+o+"$2box$3")+t;case 100:return m(t,":",":"+o)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return m(t,"scroll-","scroll-snap-")+t}return t}function K(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function J(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case l:return t.return=t.return||t.value;case a:return"";case c:return t.return=t.value+"{"+K(t.children,o)+"}";case s:if(!b(t.value=t.props.join(",")))return""}return b(n=K(t.children,o))?t.return=t.value+"{"+n+"}":""}function tt(t){var e=y(t);return function(n,o,i,r){for(var a="",s=0;s<e;s++)a+=t[s](n,o,i,r)||"";return a}}function et(t){return function(e){e.root||(e=e.return)&&t(e)}}function nt(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case l:return void(t.return=q(t.value,t.length,n));case c:return K([P(t,{value:m(t.value,"@","@"+r)})],i);case s:if(t.length)return C(n=t.props,(function(e){switch(f(e,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":W(P(t,{props:[m(e,/:(read-\w+)/,":-moz-$1")]})),W(P(t,{props:[e]})),h(t,{props:w(n,i)});break;case"::placeholder":W(P(t,{props:[m(e,/:(plac\w+)/,":"+r+"input-$1")]})),W(P(t,{props:[m(e,/:(plac\w+)/,":-moz-$1")]})),W(P(t,{props:[m(e,/:(plac\w+)/,o+"input-$1")]})),W(P(t,{props:[e]})),h(t,{props:w(n,i)})}return""}))}}},,function(t,e,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=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 l(t,e){for(var n={},o=[],i=0;i<t.length;i++){var r=t[i],l=e.base?r[0]+e.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,e),references:1}),o.push(u)}return o}function c(t){var e=document.createElement("style"),o=t.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var a=r(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 u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=d(e,i);else{var r=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function p(t,e,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var f=null,m=0;function g(t,e){var n,o,i;if(e.singleton){var r=m++;n=f||(f=c(e)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(e),o=p.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(t,e),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,o){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";(function(t){function n(){if("undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.gatherTransferables=function(t,e){const n=[];return function t(o){if(!o)return;if(o.constructor===ImageData){const t={data:o.data.slice(),width:o.width,height:o.height};return n.push(t.data.buffer),t}if(o.constructor===ArrayBuffer){const t=e?o.slice(0):o;if(n.push(t),e)return o}else if(ArrayBuffer.isView(o)){let t;if(e){t=new(0,o.constructor)(o.buffer.slice(0))}else t=o;if(n.push(t.buffer),e)return o}else if(Array.isArray(o))for(let e=0;e<o.length;++e){const n=t(o[e]);n&&(o[e]=n)}else if(o.constructor===Object)for(const e in o)if(o.hasOwnProperty(e)){const n=t(o[e]);n&&(o[e]=n)}}(t),n},e.isRemote=function(t){return t.startsWith("http:")||t.startsWith("https:")},e.areThreadsAvailable=n,e.getBuildType=function(t){const{allowSimd:e=!0,allowThreads:o=!0}=t||{};let i="";if(e&&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}}()){i+="-simd";o&&n()&&(i+="-threads")}return i}}).call(this,n(14))},function(t,e,n){"use strict";var o=n(10),i=n.n(o)()((function(t){return t[1]}));i.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=i},function(t,e,n){"use strict";var o=n(10),i=n.n(o)()((function(t){return t[1]}));i.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=i},function(t,e){var n,o,i=t.exports={};function r(){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===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d<e;)l&&l[d].run();d=-1,e=c.length}l=null,u=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}i.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 f(t,e)),1!==c.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerBridge=void 0;var o=n(11);e.WorkerBridge=class{constructor(t,e){const{requestSuffix:n=""}=e||{},i=(0,o.getBuildType)(e),r=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${i}.js${n}`;if((0,o.isRemote)(r)){const t=new Blob([`importScripts("${r}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(r);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:o,result:i,error:r}=t.data,{resolve:a,reject:s}=this.continuations[o];delete this.continuations[o],r?s(r):a(i)}}post(t,e,n){return new Promise(((i,r)=>{const a=(0,o.gatherTransferables)(e,n),s=this.nextTicketId++;this.continuations[s]={resolve:i,reject:r},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){const{render:o,hydrate:i,unmountComponentAtNode:r}=n(0);function a(t){return{render(e){o(e,t)},unmount(){r(t)}}}e.createRoot=a,e.hydrateRoot=function(t,e){return i(e,t),a(t)}},function(t,e){t.exports=function(t,e,n,o){var i=n?n.call(o,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l<r.length;l++){var c=r[l];if(!s(c))return!1;var u=t[c],d=e[c];if(!1===(i=n?n.call(o,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},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";function o(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}));var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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=o((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}))},function(t,e,n){"use strict";n.r(e),n.d(e,"ScanbotSDK",(function(){return Ld}));var o={};n.r(o),n.d(o,"SingleScanningMode",(function(){return St})),n.d(o,"Resolution",(function(){return Ct})),n.d(o,"CameraConfiguration",(function(){return wt})),n.d(o,"TopBarConfiguration",(function(){return xt})),n.d(o,"ActionBarConfiguration",(function(){return Et})),n.d(o,"BarcodeUseCase",(function(){return X})),n.d(o,"Palette",(function(){return K})),n.d(o,"StyledText",(function(){return J})),n.d(o,"IconStyle",(function(){return tt})),n.d(o,"PolygonStyle",(function(){return et})),n.d(o,"BackgroundStyle",(function(){return nt})),n.d(o,"ForegroundStyle",(function(){return ot})),n.d(o,"AspectRatio",(function(){return it})),n.d(o,"RoundButton",(function(){return rt})),n.d(o,"BadgedButton",(function(){return at})),n.d(o,"ButtonConfiguration",(function(){return st})),n.d(o,"Sound",(function(){return lt})),n.d(o,"Vibration",(function(){return ct})),n.d(o,"Timeouts",(function(){return ut})),n.d(o,"ViewFinderConfiguration",(function(){return Pt})),n.d(o,"FinderStyle",(function(){return Q})),n.d(o,"FinderCorneredStyle",(function(){return Wt})),n.d(o,"FinderStrokedStyle",(function(){return Bt})),n.d(o,"UserGuidanceConfiguration",(function(){return Dt})),n.d(o,"BarcodeItemErrorState",(function(){return At})),n.d(o,"BarcodeMappedData",(function(){return bt})),n.d(o,"BarcodeInfoMapping",(function(){return yt})),n.d(o,"ExpectedBarcode",(function(){return It})),n.d(o,"BarcodeTextLocalization",(function(){return Rt})),n.d(o,"BarcodeRecognizerConfiguration",(function(){return Mt})),n.d(o,"ArOverlayPolygonConfiguration",(function(){return dt})),n.d(o,"BarcodeItemConfiguration",(function(){return ht})),n.d(o,"BadgeStyle",(function(){return pt})),n.d(o,"ArOverlayGeneralConfiguration",(function(){return ft})),n.d(o,"FindAndPickArOverlayPolygonConfiguration",(function(){return mt})),n.d(o,"FindAndPickBadgeConfiguration",(function(){return gt})),n.d(o,"ArOverlayFindAndPickConfiguration",(function(){return vt})),n.d(o,"BarcodeScannerConfiguration",(function(){return jt})),n.d(o,"BarcodeItem",(function(){return Vt})),n.d(o,"BarcodeScannerResult",(function(){return zt})),n.d(o,"Sheet",(function(){return Lt})),n.d(o,"SwipeToDelete",(function(){return _t})),n.d(o,"ManualCountEditDialog",(function(){return Ot})),n.d(o,"SheetContent",(function(){return kt})),n.d(o,"MultipleScanningMode",(function(){return Tt})),n.d(o,"ScanbotAlertDialog",(function(){return Nt})),n.d(o,"CameraPermissionScreen",(function(){return Ft}));var i={};n.r(i),n.d(i,"ParametricFilter",(function(){return Qt})),n.d(i,"ScanbotBinarizationFilter",(function(){return Kt})),n.d(i,"CustomBinarizationFilter",(function(){return Jt})),n.d(i,"ColorDocumentFilter",(function(){return te})),n.d(i,"BrightnessFilter",(function(){return ee})),n.d(i,"ContrastFilter",(function(){return ne})),n.d(i,"GrayscaleFilter",(function(){return oe})),n.d(i,"LegacyFilter",(function(){return ie})),n.d(i,"WhiteBlackPointFilter",(function(){return re}));var r="5.1.3-dev.3";class a{}a.VERSION=r,a.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@5.1.3-dev.3/bundle/",a.DEFAULT_WASM_FOLDER="bin/complete/",a.BUILD_WITH_UI=!1;var s=n(15),l=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class c{constructor(t,e,n){t||(t=a.CDN_PATH+a.DEFAULT_WASM_FOLDER),this.core=new s.WorkerBridge(t,e),this.coreInitializationSuccessful=this.core.postByCopyingArgs("initialize",n)}awaitInitialized(){return l(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}postByCopyingArgs(t,e){return l(this,void 0,void 0,(function*(){return(yield this.getCoreForCommand(t)).postByCopyingArgs(t,e)}))}postByTransferringArgs(t,e){return l(this,void 0,void 0,(function*(){return(yield this.getCoreForCommand(t)).postByTransferringArgs(t,e)}))}getCoreForCommand(t=""){return l(this,void 0,void 0,(function*(){const e=yield this.coreInitializationSuccessful;if("getLicenseInfo"===t||e)return this.core;throw new Error("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")}))}destroy(){this.core.destroy(),this.core=void 0}}c.ASM_JS="ScanbotSDK.Core.js";var u=n(11);class d{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((o=>{(null==n?void 0:n.includes(o))||(e[o]=t[o])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((o=>{o in e&&n(t[o])&&n(e[o])?d.mapValuesDeep(t[o],e[o]):e[o]=t[o]}))}static _fromJson(t,e){return this.mapValuesDeep(e,t),t}}class h extends d{constructor(t){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",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)}}h.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},h.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},h.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,h.DEFAULT_ACCEPTED_ANGLE_SCORE=75,h.DEFAULT_ACCEPTED_SIZE_SCORE=75;const p={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 f{constructor(t){this.hint=t}}class m{constructor(){this.outline=new g,this.captureButton=new y}}class g{constructor(){this.polygon=new v,this.path=new A,this.label=new b}}class v{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}class A{constructor(){this.stroke="green",this.strokeWidth=4}}class b{}class y{constructor(){this.color="#FFF"}}class S extends h{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_4K),this.acceptedBrightnessThreshold=S.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE,this.acceptedAngleScore=S.DEFAULT_ACCEPTED_ANGLE_SCORE,this.acceptedSizeScore=S.DEFAULT_ACCEPTED_SIZE_SCORE,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new f(p),this.style=new m,this.onDocumentDetected=function(t){}}static fromJson(t){const e=new S;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 o=n.path;o&&this.mapValues(o,e.style.outline.path);const i=n.label;i&&this.mapValues(i,e.style.outline.label)}const o=t.style.captureButton;o&&this.mapValues(o,e.style.captureButton)}return this.mapVideoConstraints(t,e),e}}class C{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new C;return e.status=t.licenseStatus,e.description=t.description,e}}var w=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class x{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t){return w(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByCopyingArgs("addPageToPdf",[this._pdfOperation,t])}))}complete(){return w(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completePdf",[this._pdfOperation])}))}}var E=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};const L=["ROTATION_NONE","ROTATION_90_CLOCKWISE","ROTATION_180","ROTATION_90_COUNTERCLOCKWISE"];class _{constructor(t,e){this._sdk=t,this._token=e}copy(){return E(this,void 0,void 0,(function*(){const t=yield this._sdk.bridge.postByCopyingArgs("imageProcessorCopy",[this._token]);return new _(this._sdk,t)}))}applyFilter(t){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("imageProcessorApplyFilter",[this._token,t])}))}crop(t){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("imageProcessorCrop",[this._token,t])}))}resize(t){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("imageProcessorResize",[this._token,t])}))}rotate(t){return E(this,void 0,void 0,(function*(){if(!L.includes(t))return Promise.reject("Invalid rotation value! It should be one of "+L.join(", "));yield this._sdk.bridge.postByTransferringArgs("imageProcessorRotate",[this._token,t])}))}processedImage(){return E(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("imageProcessorEncodedProcessedImage",[this._token,".jpg"])}))}release(){return E(this,void 0,void 0,(function*(){yield this._sdk.release(this._token,"ImageProcessor"),this._token=null,this._sdk=null}))}get __token(){return this._token}}var O=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class k{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t){return O(this,void 0,void 0,(function*(){let e;e=t instanceof _?t.__token:t,yield this._sdk.bridge.postByCopyingArgs("addPageToTiff",[this._tiffOperation,e])}))}complete(){return O(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("completeTiff",[this._tiffOperation])}))}}class T{constructor(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}scaleDown(t){return new T(this.x/t,this.y/t,this.width/t,this.height/t)}bottom(){return this.y+this.height}static withSize(t,e){return new T(0,0,t,e)}static empty(){return new T(0,0,0,0)}static fromRect(t){return t?new T(t.x,t.y,t.width,t.height):T.empty()}static fromPoint(t,e){return new T(t.x-e/2,t.y-e/2,e,e)}static fromDOMRect(t){return new T(t.x,t.y,t.width,t.height)}}class P{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){let n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let o=0;o<5;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}}var W=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class B{static toDataUrl(t){return new Promise(((e,n)=>{const o=new Blob([t],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(t,e,n=!0){const o=e.width/e.height,i=t.width/t.height;let r=0,a=0;(n?o>i:o<i)?(r=t.width,a=r/o):(a=t.height,r=a*o);const s=(t.width-r)/2,l=(t.height-a)/2;return new T(s,l,r,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>W(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,P.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 o=URL.createObjectURL(t);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return B.createImageDataCanvas(B.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}static toBase64(t){return W(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(new Blob([t]))}));return e.slice(e.indexOf(",")+1)}))}}class D{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=P.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});B.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 I(t,e,n){return Math.min(Math.max(t,e),n)}class R{constructor(t,e){this.x=t,this.y=e}static toPolygon(t,e){return[R.scaleDownTo(t[0],e),R.scaleDownTo(t[1],e),R.scaleDownTo(t[2],e),R.scaleDownTo(t[3],e)]}static scaleToPoint(t,e,n,o){return new R(o*(t.x-e),o*(t.y-n))}static scaleListToHtmlElement(t,e,n){return t.map((t=>R.scaleToHtmlElement(t,e,n)))}static scaleToHtmlElement(t,e,n){return new R(t.x*(n.clientWidth/e.width),t.y*(n.clientHeight/e.height))}static scaleUpTo(t,e){return new R(t.x*e.width,t.y*e.height)}static scaleDownTo(t,e){return new R(t.x/e.width,t.y/e.height)}static fromHtmlElement(t){return new R(t.offsetLeft,t.offsetTop)}static withScale(t,e,n){return new R(t/n,e/n)}static fromCoordinates(t,e,n,o){if(!t||!e)return new R(0,0);const i=new R(t,e);return o=null!=o?o:1,1===(n=n?n%4:0)?R.withScale(i.y,-i.x,o):2===n?R.withScale(-i.x,-i.y,o):3===n?R.withScale(-i.y,i.x,o):R.withScale(i.x,i.y,o)}static centerOf(t){const e=t.reduce(((t,e)=>t+e.x),0)/t.length,n=t.reduce(((t,e)=>t+e.y),0)/t.length;return new R(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 R(0,0)}static centerX(t){if(t)return(R.highestX(t)+R.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 R.highestX(t)-R.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(" ")}static toSvgPathStringWithRoundedCorners(t,e=0){if(void 0===t)return;function n(t,e,n){const o=Math.atan2(t.y-e.y,t.x-e.x);return{x:t.x-n*Math.cos(o),y:t.y-n*Math.sin(o)}}let o="";const i=n(t[0],t[1],R.distance(t[0],t[1])/2);o+=`M ${i.x} ${i.y}`;for(let i=0;i<t.length;i++){const r=t[i],a=t[(i+1)%t.length],s=t[(i+2)%t.length],l=n(a,s,R.distance(a,s)/2),c=Math.abs(Math.atan2(a.y-r.y,a.x-r.x)-Math.atan2(a.y-s.y,a.x-s.x)),u=c>Math.PI?2*Math.PI-c:c,d=Math.min(Math.sqrt(Math.pow(a.x-r.x,2)+Math.pow(a.y-r.y,2)),Math.sqrt(Math.pow(a.x-s.x,2)+Math.pow(a.y-s.y,2))),h=Math.min(e,d*Math.tan(u/2)/2),p=Math.abs(h/Math.tan(u/2)),f=(a.x-r.x)*(a.y-s.y)-(a.x-s.x)*(a.y-r.y)<0?1:0,m=n(a,r,p),g=n(a,s,p);o+=` L${m.x} ${m.y}`,o+=` A${h} ${h} 0 0 ${f} ${g.x} ${g.y}`,o+=` L${l.x} ${l.y}`}return o+" Z"}static distance(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}static subtract(t,e){return new R(t.x-e.x,t.y-e.y)}static add(t,e){return new R(t.x+e.x,t.y+e.y)}static multiply(t,e){return new R(t.x*e,t.y*e)}static cross(t,e){return t.x*e.y-t.y*e.x}static clamp(t,e){return new R(I(t.x,0,e.width),I(t.y,0,e.height))}}class M{constructor(t,e,n,o,i,r){this.format=t,this.text=e,this.parsedDocument=n,this.rawBytes=o,this.points=i,this.barcodeImage=r}id(){return this.text+this.format}equals(t){return this.format===t.format&&this.text===t.text}static fromWorker(t){const e=t.quad.map((t=>new R(t[0],t[1])));return new M(t.format,t.text,t.parsedDocument,t.rawBytes,e,t.barcodeImage)}}class F{constructor(t,e){this.barcodes=t,this.imageData=e}static fromWorker(t,e){const n=[];t&&t.forEach((t=>{n.push(M.fromWorker(t))}));const o=B.convertImageDataWrapperToImageData(e);return new F(n,o)}isEmpty(){return 0===this.barcodes.length}}class j{constructor(t,e,n,o){this.value=e,this.confidence=n,this.validated=o,this.name=t}}class V{}class z{static fromWorker(t){let e=new z;e.verificationSuccessful=t.verificationSuccessful;const n=new V,o=t.recognitionSuccessful;return(t.fields||[]).forEach((t=>{switch(t.name){case"DocumentNumber":e.documentNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"IssuingAuthority":e.issuingAuthority=new j(t.name,t.text,t.confidence,t.validated);break;case"DepartmentOfIssuance":e.departmentOfIssuance=new j(t.name,t.text,t.confidence,t.validated);break;case"GivenNames":e.givenNames=new j(t.name,t.text,t.confidence,t.validated);break;case"Surname":e.surname=new j(t.name,t.text,t.confidence,t.validated);break;case"Nationality":e.nationality=new j(t.name,t.text,t.confidence,t.validated);break;case"BirthDate":e.birthDate=new j(t.name,t.text,t.confidence,t.validated);break;case"Gender":e.gender=new j(t.name,t.text,t.confidence,t.validated);break;case"ExpiryDate":e.expiryDate=new j(t.name,t.text,t.confidence,t.validated);break;case"PersonalNumber":e.personalNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"TravelDocType":e.travelDocType=new j(t.name,t.text,t.confidence,t.validated);break;case"TravelDocTypeVariant":e.travelDocTypeVariant=new j(t.name,t.text,t.confidence,t.validated);break;case"DiscreetIssuingStateOrOrganization":e.discreetIssuingStateOrOrganization=new j(t.name,t.text,t.confidence,t.validated);break;case"DocumentTypeCode":e.kindOfDocumentField=new j(t.name,t.text,t.confidence,t.validated);break;case"DocumentType":e.documentType=new j(t.name,t.text,t.confidence,t.validated);break;case"Format":e.format=new j(t.name,t.text,t.confidence,t.validated);break;case"PINCode":e.pinCode=new j(t.name,t.text,t.confidence,t.validated);break;case"LanguageCode":e.languageCode=new j(t.name,t.text,t.confidence,t.validated);break;case"VersionNumber":e.versionNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitGeneral":n.general=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitDocumentNumber":n.documentNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitBirthDate":n.birthDate=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitExpiryDate":n.expiryDate=new j(t.name,t.text,t.confidence,t.validated);break;case"CheckDigitPersonalNumber":n.personalNumber=new j(t.name,t.text,t.confidence,t.validated);break;case"Optional1":e.optional1=new j(t.name,t.text,t.confidence,t.validated);break;case"Optional2":e.optional2=new j(t.name,t.text,t.confidence,t.validated)}})),e.documentType||(e.documentType=new j("DocumentType",t.documentType)),o?e.checkDigits=n:e=void 0,e}}var N=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class U{constructor(t,e,n){this._sdk=t,this._mrzRecognizerToken=e,this.enableFrameAccumulation=n}recognize(t){return N(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeMRZ",[yield this._mrzRecognizerToken,t]);if(null===e)return;const n=z.fromWorker(e);return!this.enableFrameAccumulation&&n&&delete n.verificationSuccessful,n}catch(t){return void console.warn(t)}}))}recognizeURL(t){return N(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>N(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);e(r||void 0)}))}))}))}release(){return N(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[yield this._mrzRecognizerToken])}))}}var H=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class G{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t){return H(this,void 0,void 0,(function*(){return yield this._sdk.bridge.postByCopyingArgs("performOcr",[this._OcrEngineToken,t])}))}recognizeURL(t){return H(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>H(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return H(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._OcrEngineToken])}))}}class Y{static fromWorker(t){if(!t)return;const e=new Y;return e.text=t.rawText,e.confidence=t.confidence,e.validated=t.validationSuccessful,e}}var X,Q,Z=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class ${constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t){return Z(this,void 0,void 0,(function*(){try{let e=yield this._sdk.bridge.postByTransferringArgs("recognizeTextLine",[yield this._textDataScannerToken,t]);if(null===e)return;return Y.fromWorker(e)}catch(t){return void console.warn(t)}}))}cleanRecognitionQueue(){return Z(this,void 0,void 0,(function*(){try{yield this._sdk.bridge.postByTransferringArgs("cleanTextLineRecognitionQueue",[yield this._textDataScannerToken])}catch(t){return void console.warn(t)}}))}recognizeURL(t){return Z(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>Z(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);r&&e(r)}))}))}))}release(){return Z(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[yield this._textDataScannerToken])}))}}class q{}class K extends q{constructor(t={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==t.sbColorPrimary&&(this.sbColorPrimary=t.sbColorPrimary),void 0!==t.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=t.sbColorPrimaryDisabled),void 0!==t.sbColorNegative&&(this.sbColorNegative=t.sbColorNegative),void 0!==t.sbColorPositive&&(this.sbColorPositive=t.sbColorPositive),void 0!==t.sbColorWarning&&(this.sbColorWarning=t.sbColorWarning),void 0!==t.sbColorSecondary&&(this.sbColorSecondary=t.sbColorSecondary),void 0!==t.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=t.sbColorSecondaryDisabled),void 0!==t.sbColorOnPrimary&&(this.sbColorOnPrimary=t.sbColorOnPrimary),void 0!==t.sbColorOnSecondary&&(this.sbColorOnSecondary=t.sbColorOnSecondary),void 0!==t.sbColorSurface&&(this.sbColorSurface=t.sbColorSurface),void 0!==t.sbColorOutline&&(this.sbColorOutline=t.sbColorOutline),void 0!==t.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=t.sbColorOnSurfaceVariant),void 0!==t.sbColorOnSurface&&(this.sbColorOnSurface=t.sbColorOnSurface),void 0!==t.sbColorSurfaceLow&&(this.sbColorSurfaceLow=t.sbColorSurfaceLow),void 0!==t.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=t.sbColorSurfaceHigh),void 0!==t.sbColorModalOverlay&&(this.sbColorModalOverlay=t.sbColorModalOverlay)}}class J extends q{constructor(t={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class tt extends q{constructor(t={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.color&&(this.color=t.color)}}class et extends q{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#30FFFFFF",this.strokeWidth=2,this.cornerRadius=0,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class nt extends q{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth)}}class ot extends q{constructor(t={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==t.iconVisible&&(this.iconVisible=t.iconVisible),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class it extends q{constructor(t={}){super(),this.width=1,this.height=1,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height)}}class rt extends q{constructor(t={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class at extends q{constructor(t={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.badgeBackgroundColor&&(this.badgeBackgroundColor=t.badgeBackgroundColor),void 0!==t.badgeForegroundColor&&(this.badgeForegroundColor=t.badgeForegroundColor),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class st extends q{constructor(t={}){super(),this.visible=!0,this.text="",this.background=new nt({}),this.foreground=new ot({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.background&&(this.background=new nt(t.background)),void 0!==t.foreground&&(this.foreground=new ot(t.foreground))}}class lt extends q{constructor(t={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==t.successBeepEnabled&&(this.successBeepEnabled=t.successBeepEnabled),void 0!==t.soundType&&(this.soundType=t.soundType)}}class ct extends q{constructor(t={}){super(),this.enabled=!1,void 0!==t.enabled&&(this.enabled=t.enabled)}}class ut extends q{constructor(t={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==t.autoCancelTimeout&&(this.autoCancelTimeout=t.autoCancelTimeout),void 0!==t.initialScanDelay&&(this.initialScanDelay=t.initialScanDelay)}}class dt extends q{constructor(t={}){super(),this.visible=!0,this.deselected=new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.deselected&&(this.deselected=new et(t.deselected)),void 0!==t.selected&&(this.selected=new et(t.selected))}}class ht extends q{constructor(t={}){super(),this.imageVisible=!0,this.titleSelected=new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==t.imageVisible&&(this.imageVisible=t.imageVisible),void 0!==t.titleSelected&&(this.titleSelected=new J(t.titleSelected)),void 0!==t.subtitleSelected&&(this.subtitleSelected=new J(t.subtitleSelected)),void 0!==t.titleDeselected&&(this.titleDeselected=new J(t.titleDeselected)),void 0!==t.subtitleDeselected&&(this.subtitleDeselected=new J(t.subtitleDeselected)),void 0!==t.backgroundSelected&&(this.backgroundSelected=new et(t.backgroundSelected)),void 0!==t.backgroundDeselected&&(this.backgroundDeselected=new et(t.backgroundDeselected))}}class pt extends q{constructor(t={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==t.visible&&(this.visible=t.visible),void 0===t.background)throw new Error("background must be present in constructor argument");this.background=new nt(t.background),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor)}}class ft extends q{constructor(t={}){super(),this.visible=!1,this.counterBadge=new pt({background:new nt({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new dt({visible:!0,deselected:new et({}),selected:new et({})}),this.barcodeItemConfiguration=new ht({imageVisible:!0,titleSelected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.counterBadge&&(this.counterBadge=new pt(t.counterBadge)),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=t.barcodeItemInfoPosition),void 0!==t.polygon&&(this.polygon=new dt(t.polygon)),void 0!==t.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new ht(t.barcodeItemConfiguration))}}class mt extends q{constructor(t={}){super(),this.visible=!0,this.partiallyScanned=new et({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.partiallyScanned&&(this.partiallyScanned=new et(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new et(t.rejected)),void 0!==t.completed&&(this.completed=new et(t.completed))}}class gt extends q{constructor(t={}){super(),this.partiallyScanned=new pt({visible:!0,background:new nt({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new pt({visible:!0,background:new nt({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new pt({visible:!0,background:new nt({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==t.partiallyScanned&&(this.partiallyScanned=new pt(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new pt(t.rejected)),void 0!==t.completed&&(this.completed=new pt(t.completed))}}class vt extends q{constructor(t={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new mt({}),this.badge=new gt({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.polygon&&(this.polygon=new mt(t.polygon)),void 0!==t.badge&&(this.badge=new gt(t.badge))}}class At extends q{constructor(t={}){super(),this.title=new J({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new J({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new st({}),this.cancelButton=new st({}),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.subtitle&&(this.subtitle=new J(t.subtitle)),void 0!==t.retryButton&&(this.retryButton=new st(t.retryButton)),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton))}}class bt extends q{constructor(t={}){if(super(),void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=t.title,void 0===t.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=t.subtitle,void 0===t.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=t.barcodeImage}}class yt extends q{constructor(t={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new J({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new At({}),void 0!==t.barcodeItemMapper&&(this.barcodeItemMapper=null!=t.barcodeItemMapper?t.barcodeItemMapper:null),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.loadingMessage&&(this.loadingMessage=new J(t.loadingMessage)),void 0!==t.errorState&&(this.errorState=new At(t.errorState))}}class St extends q{constructor(t={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new st({visible:!0,text:"?sheetSubmitButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new st({visible:!0,text:"?singleModeConfirmationCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new yt({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new J({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new At({title:new J({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new J({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new st({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new st({text:"?barcodeInfoMappingErrorStateCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new ft({visible:!1,counterBadge:new pt({visible:!0,background:new nt({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new dt({visible:!0,deselected:new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new ht({imageVisible:!0,titleSelected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new J({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.confirmationSheetEnabled&&(this.confirmationSheetEnabled=t.confirmationSheetEnabled),void 0!==t.barcodeImageVisible&&(this.barcodeImageVisible=t.barcodeImageVisible),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.barcodeTitle&&(this.barcodeTitle=new J(t.barcodeTitle)),void 0!==t.barcodeSubtitle&&(this.barcodeSubtitle=new J(t.barcodeSubtitle)),void 0!==t.submitButton&&(this.submitButton=new st(t.submitButton)),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new yt(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new ft(t.arOverlay))}}class Ct extends q{constructor(t={}){if(super(),void 0===t.width)throw new Error("width must be present in constructor argument");if(this.width=t.width,void 0===t.height)throw new Error("height must be present in constructor argument");this.height=t.height}}class wt extends q{constructor(t={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new Ct({width:1920,height:1080}),void 0!==t.cameraModule&&(this.cameraModule=t.cameraModule),void 0!==t.zoomSteps&&(this.zoomSteps=t.zoomSteps.map((t=>t))),void 0!==t.defaultZoomFactor&&(this.defaultZoomFactor=t.defaultZoomFactor),void 0!==t.flashEnabled&&(this.flashEnabled=t.flashEnabled),void 0!==t.idealPreviewResolution&&(this.idealPreviewResolution=new Ct(t.idealPreviewResolution))}}class xt extends q{constructor(t={}){super(),this.title=new J({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new st({text:"Cancel",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new ot({color:"?sbColorOnPrimary"})}),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton))}}class Et extends q{constructor(t={}){super(),this.flashButton=new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==t.flashButton&&(this.flashButton=new rt(t.flashButton)),void 0!==t.zoomButton&&(this.zoomButton=new rt(t.zoomButton)),void 0!==t.flipCameraButton&&(this.flipCameraButton=new rt(t.flipCameraButton))}}class Lt extends q{constructor(t={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new at({}),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.collapsedVisibleHeight&&(this.collapsedVisibleHeight=t.collapsedVisibleHeight),void 0!==t.listButton&&(this.listButton=new at(t.listButton))}}class _t extends q{constructor(t={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.iconColor&&(this.iconColor=t.iconColor)}}class Ot extends q{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new J({text:"Update count",color:"?sbColorOnSurface"}),this.info=new J({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new st({visible:!0,text:"Update",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new st({visible:!0,text:"Cancel",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new tt({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.info&&(this.info=new J(t.info)),void 0!==t.updateButton&&(this.updateButton=new st(t.updateButton)),void 0!==t.cancelButton&&(this.cancelButton=new st(t.cancelButton)),void 0!==t.clearTextButton&&(this.clearTextButton=new tt(t.clearTextButton))}}class kt extends q{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new J({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new st({visible:!0,text:"Clear all",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new J({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new st({visible:!0,text:"Submit",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new st({visible:!0,text:"Start scanning",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new J({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new J({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new tt({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new _t({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.manualCountChangeEnabled&&(this.manualCountChangeEnabled=t.manualCountChangeEnabled),void 0!==t.manualCountOutlineColor&&(this.manualCountOutlineColor=t.manualCountOutlineColor),void 0!==t.manualCountChangeColor&&(this.manualCountChangeColor=t.manualCountChangeColor),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.clearAllButton&&(this.clearAllButton=new st(t.clearAllButton)),void 0!==t.barcodeItemTitle&&(this.barcodeItemTitle=new J(t.barcodeItemTitle)),void 0!==t.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new J(t.barcodeItemSubtitle)),void 0!==t.barcodeItemImageVisible&&(this.barcodeItemImageVisible=t.barcodeItemImageVisible),void 0!==t.submitButton&&(this.submitButton=new st(t.submitButton)),void 0!==t.startScanningButton&&(this.startScanningButton=new st(t.startScanningButton)),void 0!==t.placeholderTitle&&(this.placeholderTitle=new J(t.placeholderTitle)),void 0!==t.placeholderSubtitle&&(this.placeholderSubtitle=new J(t.placeholderSubtitle)),void 0!==t.placeholderIconBackground&&(this.placeholderIconBackground=t.placeholderIconBackground),void 0!==t.placeholderIcon&&(this.placeholderIcon=new tt(t.placeholderIcon)),void 0!==t.swipeToDelete&&(this.swipeToDelete=new _t(t.swipeToDelete))}}class Tt extends q{constructor(t={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new Lt({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new at({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new kt({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new J({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new st({visible:!0,text:"?sheetClearAllButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new J({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new J({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new st({visible:!0,text:"?sheetSubmitButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new st({visible:!0,text:"?sheetStartScanningButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new J({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new J({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new tt({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new _t({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new Ot({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new J({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new J({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new st({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new st({visible:!0,text:"?manualCountEditDialogCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new tt({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new yt({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new J({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new At({title:new J({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new J({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new st({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new nt({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new st({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new ft({visible:!1,counterBadge:new pt({visible:!0,background:new nt({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new dt({visible:!0,deselected:new et({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new et({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new ht({imageVisible:!0,titleSelected:new J({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new J({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new J({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new J({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new et({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new et({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.sheet&&(this.sheet=new Lt(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new kt(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new Ot(t.manualCountEditDialog)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new yt(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new ft(t.arOverlay))}}(X||(X={})).From=function(t){const e=t._type;switch(e){case"SingleScanningMode":return new St(t);case"MultipleScanningMode":return new Tt(t);default:throw`Unknown child class name: ${e}`}};class Pt extends q{constructor(t={}){super(),this.visible=!0,this.style=new Wt({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new it({width:1,height:1}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.style&&(this.style=Q.From(t.style)),void 0!==t.overlayColor&&(this.overlayColor=t.overlayColor),void 0!==t.aspectRatio&&(this.aspectRatio=new it(t.aspectRatio))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"FinderCorneredStyle":return new Wt(t);case"FinderStrokedStyle":return new Bt(t);default:throw`Unknown child class name: ${e}`}}}(Q||(Q={}));class Wt extends q{constructor(t={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class Bt extends q{constructor(t={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class Dt extends q{constructor(t={}){super(),this.visible=!0,this.title=new J({color:"?sbColorOnPrimary"}),this.background=new nt({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.background&&(this.background=new nt(t.background))}}class It extends q{constructor(t={}){if(super(),this.count=1,void 0===t.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");if(this.barcodeValue=t.barcodeValue,void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=null!=t.title?t.title:null,void 0===t.image)throw new Error("image must be present in constructor argument");this.image=null!=t.image?t.image:null,void 0!==t.count&&(this.count=t.count)}}class Rt extends q{constructor(t={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",void 0!==t.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=t.cameraPermissionEnableCameraTitle),void 0!==t.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=t.cameraPermissionEnableCameraExplanation),void 0!==t.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=t.cameraPermissionCloseButton),void 0!==t.topBarCancelButton&&(this.topBarCancelButton=t.topBarCancelButton),void 0!==t.topBarTitle&&(this.topBarTitle=t.topBarTitle),void 0!==t.userGuidance&&(this.userGuidance=t.userGuidance),void 0!==t.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=t.barcodeInfoMappingLoadingMessage),void 0!==t.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=t.barcodeInfoMappingErrorStateTitle),void 0!==t.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=t.barcodeInfoMappingErrorStateSubtitle),void 0!==t.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=t.barcodeInfoMappingErrorStateRetryButton),void 0!==t.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=t.barcodeInfoMappingErrorStateCancelButton),void 0!==t.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=t.manualCountEditDialogTitle),void 0!==t.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=t.manualCountEditDialogInfo),void 0!==t.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=t.manualCountEditDialogUpdateButton),void 0!==t.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=t.manualCountEditDialogCancelButton),void 0!==t.sheetClearAllButton&&(this.sheetClearAllButton=t.sheetClearAllButton),void 0!==t.sheetSubmitButton&&(this.sheetSubmitButton=t.sheetSubmitButton),void 0!==t.sheetStartScanningButton&&(this.sheetStartScanningButton=t.sheetStartScanningButton),void 0!==t.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=t.sheetPlaceholderTitle),void 0!==t.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=t.sheetPlaceholderSubtitle),void 0!==t.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=t.singleModeConfirmationCancelButton),void 0!==t.multipleModeSheetTitle&&(this.multipleModeSheetTitle=t.multipleModeSheetTitle)}}class Mt extends q{constructor(t={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="ML_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==t.barcodesRegexFilter&&(this.barcodesRegexFilter=t.barcodesRegexFilter),void 0!==t.barcodeFormats&&(this.barcodeFormats=t.barcodeFormats.map((t=>t))),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.maximumRecognizerResolution&&(this.maximumRecognizerResolution=t.maximumRecognizerResolution)}}class Ft extends q{constructor(t={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new tt({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new st({text:"Close",background:new nt({}),foreground:new ot({})}),this.enableCameraTitle=new J({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new J({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==t.background&&(this.background=t.background),void 0!==t.iconBackground&&(this.iconBackground=t.iconBackground),void 0!==t.icon&&(this.icon=new tt(t.icon)),void 0!==t.closeButton&&(this.closeButton=new st(t.closeButton)),void 0!==t.enableCameraTitle&&(this.enableCameraTitle=new J(t.enableCameraTitle)),void 0!==t.enableCameraExplanation&&(this.enableCameraExplanation=new J(t.enableCameraExplanation))}}class jt extends q{constructor(t={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new K({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new Rt({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new xt({title:new J({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new st({visible:!0,text:"?topBarCancelButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new ot({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new Et({flashButton:new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new rt({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new Pt({visible:!0,style:new Wt({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new it({width:1,height:1})}),this.userGuidance=new Dt({visible:!0,title:new J({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new nt({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new Ft({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new tt({visible:!0,color:"?sbColorOnSurface"}),closeButton:new st({visible:!0,text:"?cameraPermissionCloseButton",background:new nt({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new ot({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new J({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new J({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new wt({}),this.recognizerConfiguration=new Mt({}),this.useCase=new St({}),this.sound=new lt({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new ct({enabled:!0}),this.timeouts=new ut({autoCancelTimeout:0,initialScanDelay:0}),void 0!==t.version&&(this.version=t.version),void 0!==t.screen&&(this.screen=t.screen),void 0!==t.palette&&(this.palette=new K(t.palette)),void 0!==t.localization&&(this.localization=new Rt(t.localization)),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.topBar&&(this.topBar=new xt(t.topBar)),void 0!==t.actionBar&&(this.actionBar=new Et(t.actionBar)),void 0!==t.viewFinder&&(this.viewFinder=new Pt(t.viewFinder)),void 0!==t.userGuidance&&(this.userGuidance=new Dt(t.userGuidance)),void 0!==t.cameraPermission&&(this.cameraPermission=new Ft(t.cameraPermission)),void 0!==t.cameraConfiguration&&(this.cameraConfiguration=new wt(t.cameraConfiguration)),void 0!==t.recognizerConfiguration&&(this.recognizerConfiguration=new Mt(t.recognizerConfiguration)),void 0!==t.useCase&&(this.useCase=X.From(t.useCase)),void 0!==t.sound&&(this.sound=new lt(t.sound)),void 0!==t.vibration&&(this.vibration=new ct(t.vibration)),void 0!==t.timeouts&&(this.timeouts=new ut(t.timeouts))}}class Vt extends q{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.count)throw new Error("count must be present in constructor argument");if(this.count=t.count,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=t.rawBytes,void 0===t.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=t.parsedDocument?t.parsedDocument:null}}class zt extends q{constructor(t={}){super(),this.items=[],void 0!==t.items&&(this.items=t.items.map((t=>new Vt(t))))}}class Nt extends q{constructor(t={}){if(super(),this.title=new J({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new J({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==t.title&&(this.title=new J(t.title)),void 0!==t.subtitle&&(this.subtitle=new J(t.subtitle)),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0===t.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new st(t.okButton),void 0===t.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new st(t.cancelButton)}}class Ut extends h{constructor(t){super(t);const e=new jt;this.finder=e.viewFinder,this.userGuidance=e.userGuidance}static mapFinderConfiguration(t,e){var n,o;h.mapValuesDeep(null!==(n=e.finder)&&void 0!==n?n:{},t.finder),h.mapValuesDeep(null!==(o=e.userGuidance)&&void 0!==o?o:{},t.userGuidance)}}class Ht extends Ut{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_HD),this.matchSubstring=!1,this.onTextDetected=function(t){},this.finder.aspectRatio.width=6,this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(t){const e=new Ht;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class Gt extends Ut{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_HD),this.onTextDetected=function(t){},this.finder.aspectRatio.width=6,this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(t){const e=new Gt;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class Yt extends Error{constructor(t){super(t.description),this.name="LicenseError"}}class Xt{static throwIfMissingBuffer(t){Xt.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}var Qt,Zt=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class $t{constructor(t,e){this._sdk=t,this._token=e}analyze(t){return Zt(this,void 0,void 0,(function*(){Xt.throwIfMissingBuffer(t);return yield this._sdk.bridge.postByCopyingArgs("documentQualityAnalyzerAnalyze",[this._token,t])}))}release(){return Zt(this,void 0,void 0,(function*(){yield this._sdk.bridge.postByTransferringArgs("releaseObject",[this._token])}))}}class qt{_marker(){}}!function(t){t.From=function(t){const e=t._type;switch(e){case"ScanbotBinarizationFilter":return new Kt(t);case"CustomBinarizationFilter":return new Jt(t);case"ColorDocumentFilter":return new te(t);case"BrightnessFilter":return new ee(t);case"ContrastFilter":return new ne(t);case"GrayscaleFilter":return new oe(t);case"LegacyFilter":return new ie(t);case"WhiteBlackPointFilter":return new re(t);default:throw`Unknown child class name: ${e}`}}}(Qt||(Qt={}));class Kt extends qt{constructor(t={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class Jt extends qt{constructor(t={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class te extends qt{constructor(t={}){super(),this._type="ColorDocumentFilter"}}class ee extends qt{constructor(t={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==t.brightness&&(this.brightness=t.brightness)}}class ne extends qt{constructor(t={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class oe extends qt{constructor(t={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==t.borderWidthFraction&&(this.borderWidthFraction=t.borderWidthFraction),void 0!==t.blackOutliersFraction&&(this.blackOutliersFraction=t.blackOutliersFraction),void 0!==t.whiteOutliersFraction&&(this.whiteOutliersFraction=t.whiteOutliersFraction)}}class ie extends qt{constructor(t={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==t.filterType&&(this.filterType=t.filterType)}}class re extends qt{constructor(t={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==t.blackPoint&&(this.blackPoint=t.blackPoint),void 0!==t.whitePoint&&(this.whitePoint=t.whitePoint)}}class ae{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}static debugWarn(t){this.verbose&&console.warn("ScanbotSDK:",t)}}var se=n(0),le=n(16),ce=n(2),ue=n.n(ce);const de=Object(se.createContext)(null);function he(t){return{getColorValue:e=>{if(e){if(e.startsWith("?")){const n=e.slice(1);if(n in t)return t[n];ae.debugWarn(`Color ${n} not found in palette`)}return e}ae.debugWarn("Color is missing")}}}class pe{static setPalette(t){this.palette=t}static setBarcodeTextLocalization(t){this.barcodeTextLocalization=t}static getColorValue(t){return he(pe.palette).getColorValue(t)}static getLocalizedBarcodeText(t){if(t.startsWith("?")){const e=t.slice(1);if(e in pe.barcodeTextLocalization)return pe.barcodeTextLocalization[e];ae.debugWarn(`Barcode text localization key ${e} not found in localization`)}return t}}pe.palette=(new jt).palette,pe.barcodeTextLocalization=(new jt).localization;const fe="var(--1-sb-dvh, 1vh)";function me(){const t=Object(se.useMemo)((()=>{var t,e;return null===(e=null===(t=null===window||void 0===window?void 0:window.CSS)||void 0===t?void 0:t.supports)||void 0===e?void 0:e.call(t,"height: 100dvh")}),[]),e=()=>{var e=t?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",e)};return Object(se.useEffect)((()=>{if(e(),!t)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}})),null}function ge(t){return{color:pe.getColorValue(t.color),textShadow:t.useShadow?"1px 1px 2px":""}}function ve(t){return t.config.visible?se.default.createElement("span",{ref:t.innerRef,style:Object.assign(Object.assign({},t.style),ge(t.config))},pe.getLocalizedBarcodeText(t.config.text)):null}var Ae=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function be(t){const e=Object(se.useContext)(de).getColorValue,{styleConfig:n}=t,o=Ae(t,["styleConfig"]),i=Object.assign(Object.assign({},t.style),{backgroundColor:e(n.fillColor),borderColor:e(n.strokeColor),borderWidth:n.strokeWidth,borderRadius:n.cornerRadius,borderStyle:"solid"});return se.default.createElement(ce.Box,Object.assign({},o,{style:i}))}function ye(t){var e;return t.visible?se.default.createElement(ce.Button,{variant:"text",onClick:t.onClick,sx:Object.assign(Object.assign({flex:1},ge(t.foreground)),{textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},px:0}),disableRipple:!0},se.default.createElement(be,{styleConfig:Object.assign(Object.assign({},t.background),{cornerRadius:4}),sx:{borderStyle:"solid",px:"8px"}},null!==(e=t.icon)&&void 0!==e?e:null,pe.getLocalizedBarcodeText(t.text))):se.default.createElement("div",{style:{display:"flex",flex:1}})}const Se=se.default.createContext(null);function Ce(t){const e=t.mode,n="HIDDEN"===e?0:48;Object(se.useEffect)((()=>{if("HIDDEN"===e)return;const n=document.createElement("meta");return n.name="theme-color",n.content=pe.getColorValue(t.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[e]);const o="SOLID"===e?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===e?`calc(100 * ${fe} - ${n}px)`:`calc(100 * ${fe})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===e?{backgroundColor:pe.getColorValue(t.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${pe.getColorValue(t.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return se.default.createElement(se.default.Fragment,null,"HIDDEN"!==e&&se.default.createElement(ce.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},se.default.createElement(ce.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},se.default.createElement(ce.Box,{sx:{flex:1}},t.cancelButton.visible&&se.default.createElement(se.default.Fragment,null,se.default.createElement(ye,Object.assign({onClick:t.onBackPress,icon:t.cancelButton.foreground.iconVisible&&se.default.createElement(ue.a,{sx:{fontSize:12,mr:"5px"}})},t.cancelButton)))),se.default.createElement(ce.Box,null,se.default.createElement(ce.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},se.default.createElement(ve,{config:t.title}))),se.default.createElement(ce.Box,{sx:{flex:1}}))),se.default.createElement(Se.Provider,{value:i},t.children))}function we(t){return{textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`,overflow:"hidden",whiteSpace:t>1?"normal":"nowrap",display:t>1?"-webkit-box":"block"}}function xe(t){var e,n;const o=(null===(e=t.barcodeMappedData)||void 0===e?void 0:e.state)||"LOADING",i=(null===(n=t.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!t||"LOADED"!==o,a=t.imageSize,s=t.barcodeTitle.visible||t.barcodeSubtitle.visible||t.counterForm,l=t.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:pe.getColorValue(t.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return se.default.createElement(ce.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},t.barcodeImageVisible&&se.default.createElement(ce.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},r?se.default.createElement(ce.Skeleton,{variant:"rounded",width:a,height:a,style:{borderRadius:8}}):se.default.createElement("img",{src:i.barcodeImage,alt:i.title,style:{width:a,height:a,borderRadius:8}})),s&&se.default.createElement(ce.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},t.barcodeTitle.visible&&se.default.createElement(ce.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},se.default.createElement(ce.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},we(t.maxNumberOfTitleLines)),ge(t.barcodeTitle))},r?se.default.createElement(ce.Skeleton,{variant:"text"}):i.title),t.displayRightArrow&&!r&&se.default.createElement(ue.a,{sx:{fontSize:16,fontWeight:"bold",color:pe.getColorValue(t.barcodeTitle.color)}})),t.barcodeSubtitle.visible&&se.default.createElement(ce.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},we(t.maxNumberOfSubtitleLines)),ge(t.barcodeSubtitle))},r?se.default.createElement(ce.Skeleton,{variant:"text"}):i.subtitle),t.counterForm&&se.default.createElement(ce.ButtonGroup,{variant:"outlined"},se.default.createElement(ce.Button,{sx:l,onClick:()=>t.counterForm.setCounter(t.counterForm.counter-1),disableRipple:!0},se.default.createElement(ue.a,{sx:{color:pe.getColorValue(t.counterForm.manualCountChangeColor)}})),se.default.createElement(ce.Button,{sx:Object.assign(Object.assign({},l),{color:pe.getColorValue(t.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:t.counterForm.onNumberClick,disableRipple:!0},t.counterForm.counter),se.default.createElement(ce.Button,{sx:l,onClick:()=>t.counterForm.setCounter(t.counterForm.counter+1),disableRipple:!0},se.default.createElement(ue.a,{sx:{color:pe.getColorValue(t.counterForm.manualCountChangeColor)}})))))}function Ee(t){const e=Object(se.useContext)(de).getColorValue;return t.visible?se.default.createElement(ce.Button,{onClick:t.onClick,type:t.type,sx:Object.assign(Object.assign({},t.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:e(t.background.strokeColor),borderWidth:t.background.strokeWidth,backgroundColor:e(t.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},t.foreground.iconVisible&&t.icon&&se.default.createElement(t.icon,{sx:{color:e(t.foreground.color),pr:2}}),se.default.createElement(ve,{config:{visible:!0,text:t.text,color:t.foreground.color,useShadow:t.foreground.useShadow}})):null}var Le=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function _e(t){var e,{modalOverlayColor:n}=t,o=Le(t,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:pe.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(e=o.PaperProps)||void 0===e?void 0:e.sx),{maxWidth:400})});return se.default.createElement(ce.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function Oe(t){const e=Object(se.useContext)(de).getColorValue,n=!t.barcodeMappedData||"LOADED"!==t.barcodeMappedData.state,o={backgroundColor:e(n?t.sheetColorLoading:t.sheetColorLoaded)},[i,r]=se.default.useState(),a=Object(se.useRef)((()=>{}));Object(se.useEffect)((()=>{t.open&&r(!1)}),[t.open]);const s=()=>{a.current=t.handleCancel,r(!0)};return se.default.createElement(_e,{modalOverlayColor:t.modalOverlayColor,open:t.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},se.default.createElement(ce.DialogContent,{style:o},se.default.createElement(xe,Object.assign({},t,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),se.default.createElement(ce.DialogActions,{style:o},se.default.createElement(ue.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},se.default.createElement(ue.a,{item:!0,xs:12},se.default.createElement(ue.a,{color:e(t.dividerColor)})),n?se.default.createElement(ue.a,{item:!0,xs:12,sx:{textAlign:"center"}},se.default.createElement(ce.Box,null,se.default.createElement(ce.CircularProgress,{sx:{color:e(t.loadingMessage.color),verticalAlign:"middle",mr:2}}),se.default.createElement(ve,{config:t.loadingMessage}))):se.default.createElement(se.default.Fragment,null,se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({style:{width:"100%"},onClick:s},t.cancelButton))),se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({style:{width:"100%"},onClick:()=>{a.current=t.handleSubmit,r(!0)}},t.submitButton)))))))}function ke(t){const e=Object(se.useRef)(!0);Object(se.useEffect)((()=>(e.current=!0,()=>{e.current=!1})));const[,n]=Object(se.useReducer)((t=>t+1),0),o=Object(se.useRef)();return Object(se.useMemo)((()=>{o.current={loading:!0,value:void 0,error:null}}),[t]),function(t,e){Object(se.useMemo)((()=>{t&&t.then((t=>{e({loading:!1,error:null,value:t})})).catch((t=>{e({loading:!1,error:{reason:t},value:void 0})}))}),[t])}(t,(t=>{o.current=t,e.current&&n()})),t?o.current:null}var Te=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};const Pe=Object(se.createContext)(null);class We{constructor(t,e){this.barcodeItemMapper=t,this.onError=e,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=t=>t.id(),this.onEvictionListeners=new Set}mapBarcodeToBarcodeItem(t,e){return Te(this,void 0,void 0,(function*(){return{count:e,rawBytes:yield B.toBase64(t.rawBytes),type:t.format,text:t.text,parsedDocument:t.parsedDocument}}))}getBarcodeMappedData(t){const e=this.hash(t);if(!this.cache.has(e)){const n=(()=>Te(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const e=yield this.mapBarcodeToBarcodeItem(t,1);return this.barcodeItemMapper(e)}return{title:t.text,subtitle:t.format,barcodeImage:yield B.toDataUrl(t.barcodeImage)}})))();this.cache.set(e,n)}return this.cache.get(e)}useBarcodeMappedData(t){const e=Object(se.useRef)(!1),n=ke(t&&this.getBarcodeMappedData(t));if(Object(se.useEffect)((()=>{n&&n.error&&(e.current=!1,this.cacheEntryPendingRetries.push({barcode:t,retry:()=>{this.cache.delete(this.hash(t)),e.current=!0}}),this.onError((()=>{for(const t of this.cacheEntryPendingRetries)t.retry();this.cacheEntryPendingRetries.length=0}),(()=>{e.current=!0;for(const t of this.cacheEntryPendingRetries)for(const e of this.onEvictionListeners)this.hash(e.barcode)==this.hash(t.barcode)&&e.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let o;return o=n.value?"LOADED":n.error&&!e.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:o}}addOnEvictionListener(t){this.onEvictionListeners.add(t)}removeOnEvictionListener(t){this.onEvictionListeners.delete(t)}}function Be(t){if(!1===t.visible)return null;const e={backgroundColor:t.active?pe.getColorValue(t.activeBackgroundColor):pe.getColorValue(t.backgroundColor),color:t.active?pe.getColorValue(t.activeForegroundColor):pe.getColorValue(t.foregroundColor)};return se.default.createElement(ce.IconButton,{sx:Object.assign(Object.assign({},e),{"&:hover, &:focus":Object.assign({outline:"none"},e),width:48,height:48}),onClick:t.onClick},t.text&&se.default.createElement("span",{style:{fontSize:15}},pe.getLocalizedBarcodeText(t.text)),t.icon&&se.default.createElement(t.icon,{style:{padding:7}}))}var De=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ie{constructor(){this.audioFile=new Audio}initialize(t){return De(this,void 0,void 0,(function*(){t.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(t){t.successBeepEnabled&&this.play()}play(){return De(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(t){}}))}}Ie.INSTANCE=new Ie;var Re=Ie;class Me{constructor(){this.DURATION=200}vibrate(t){t.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}Me.INSTANCE=new Me;var Fe=Me,je=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ve extends Error{constructor(t,e,n){super(e),this.name="",this.name=t,this.message=e,this.webApiError=n}static mediaDevicesUndefined(){return new Ve(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new Ve(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(t){return new Ve(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",t)}static permissionDenied(t){return new Ve(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",t)}static unknown(t){return new Ve(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",t)}static tryCheckPermission(){return je(this,void 0,void 0,(function*(){if(!this.permissionState)try{const t=yield navigator.permissions.query({name:"camera"});this.permissionState=t.state}catch(t){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}}Ve.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},Ve.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"};var ze=n(5);const Ne=ze.a.svg`
3
3
  animation: rotate 2s linear infinite;
4
4
  width: 50px;
5
5
  height: 50px;
@@ -28,10 +28,10 @@
28
28
  stroke-dashoffset: -120;
29
29
  }
30
30
  }
31
- `;var Ue=t=>se.default.createElement(Ne,{viewBox:"0 0 50 50"},se.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:t.color||"black"})),He=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ge{constructor(){this.videoReady=!1,this.sdkReady=!1}}class Ye extends se.default.Component{constructor(t){super(t),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.videoReady){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}},this.state=new Ge,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}get bridge(){return Ed.instance.bridge}dispose(){const{container:t}=this.props;t&&Object(se.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 He(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return He(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(Ve.mediaDeviceNotFound())}))}else e(Ve.enumerateDevicesFailed())}))}))}renderSpinner(t){return this.state.videoReady&&this.state.sdkReady?null:se.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},se.default.createElement(Ue,{color:t}))}setTorchState(t){return this.camera.setTorchState(t)}}Ye.DEFAULT_DETECTION_RESOLUTION=600,Ye.DETECTION_RESULTION_4K=3840;var Xe=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Qe extends se.default.Component{constructor(t){super(t),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){return Xe(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 Ve.enumerateDevicesFailed()}return t}))}componentDidMount(){return Xe(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,i,r,a,s;return Xe(this,void 0,void 0,(function*(){if(Ve.hasCheckedPermission()||(yield Ve.tryCheckPermission()),Ve.hasDeniedPermission())return void(null===(e=(t=this.props).onError)||void 0===e||e.call(t,Ve.permissionDenied()));const l={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const t=Ve.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,t),void console.log(t)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(l);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(t){const e=Ve.mediaDeviceNotFound();return null===(r=(i=this.props).onError)||void 0===r||r.call(i,e),void console.error(e)}}catch(t){let e=Ve.unknown(t.message);return t instanceof DOMException&&("NotAllowedError"===t.name?e=Ve.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===t.name&&(e=Ve.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."))),null===(s=(a=this.props).onError)||void 0===s||s.call(a,e),void console.error(e)}}))}stopCurrentStreams(){return Xe(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.orientationchangeCallback),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}))}render(){return this.props.children}updateTorch(t){return Xe(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();return Qe.getMediaTrackCapabilities(t)}}static getMediaTrackCapabilities(t){if(t&&t.getCapabilities)return t.getCapabilities()}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}class Ze{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 R(0,0),new R(t.width,0),new R(t.width,t.height),new R(0,t.height)]}static fromHtmlElement(t){return t?new Ze(t.clientWidth,t.clientHeight):new Ze(0,0)}static fromJson(t){return new Ze(t.width,t.height)}static subtractFrom(t,e){return new Ze(t.width-e,t.height-e)}static empty(){return new Ze(0,0)}}var $e=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class qe extends se.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 Ze(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){return $e(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);ae.debug("Bitmap size: "+e.width*e.height),n.canvas.width=e.width,n.canvas.height=e.height,n.drawImage(e,0,0,e.width,e.height);const o=this.windowSize(),i=e.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=e.width/2-r/2,l=o.y*i,c=new T(s,l,r,a);ae.debug("Frame size: "+c.x+"-"+c.y+"-"+c.width+"-"+c.height);return n.getImageData(c.x,c.y,c.width,c.height)}let{videoWidth:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new T(0,0,r,a),c=this.zoom(),u=(o-r/c)/2,d=(i-a/c)/2,h=l.x/s+u,p=l.y/s+d,f=this.finderFrame?s:c,m=l.width/f,g=l.height/f,v=this.calculateFrameSize(t,m,g);n.canvas.width=Math.round(v.width),n.canvas.height=Math.round(v.height),n.drawImage(this.video,h,p,m,g,0,0,n.canvas.width,n.canvas.height);const A=n.getImageData(0,0,this.canvas.width,this.canvas.height);return n.clearRect(0,0,this.canvas.width,this.canvas.height),A}))}drawVideoOnCanvasAndExtractFrameFromIt(t){return $e(this,void 0,void 0,(function*(){this.getCanvasRenderingContext(),this.video}))}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 T.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),o=t,i=e,r=1;return n.width/n.height<=t/e?(r=n.height/e,r>0&&(o=n.width/r)):(r=n.width/t,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(t,e,n){let o=e,i=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(o=e>t?t:e,i=o/r):(i=n>t?t:n,o=i*r)}return new Ze(o,i)}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(){var t;const e={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(t=this.props.configuration)||void 0===t?void 0:t.backgroundColor};return this.state.mirrored&&(e.transform="scaleX(-1)"),e}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return se.default.createElement(Qe,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},se.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}setDirection(t){this.props.videoConstraints.facingMode={ideal:t},this.setState({facingModeBack:"environment"===t,mirrored:"user"===t},(()=>$e(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}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},(()=>$e(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return $e(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},(()=>$e(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=>{var e;const n=t.label,o=t.getSettings().deviceId,i=t.getSettings().facingMode;let r="unknown";"user"===i?r="front":"environment"===i&&(r="back");return{deviceId:o,label:n,facingMode:r,supportsTorchControl:(null===(e=Qe.getMediaTrackCapabilities(t))||void 0===e?void 0:e.torch)||!1}}));this.activeCamera=t[0]}}getActiveCameraInfo(){return this.activeCamera}setTorchState(t){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:t}]})}return Promise.reject("Torch is not supported for current camera.")}}class Ke extends se.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(t){super(t),this.holePosition=T.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=t=>{var e,n,o,i;(null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)===(null===(n=t.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=t.padding)||void 0===i?void 0:i.minBottomPadding)&&this.props.configuration===t.configuration&&this.props.guidanceConfiguration===t.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var t;return null!==(t=this.holeCanvas.getBoundingClientRect())&&void 0!==t?t:new DOMRect},this.scaleForRetinaDisplay=t=>{if(window.devicePixelRatio>1){var e=t.width,n=t.height;t.width=e*window.devicePixelRatio,t.height=n*window.devicePixelRatio,t.style.width=e+"px",t.style.height=n+"px",t.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var t,e,n,o,i;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)&&void 0!==n?n:0),p=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>p?(this.holePosition.height=p,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(p-this.holePosition.height)/1.9;const f=this.holeCanvas.getContext("2d");f.save(),this.drawBackground(f),f.globalCompositeOperation="destination-out",this.drawHole();const m=this.crosshairCanvas.getContext("2d");m.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),f.restore(),m.restore()},this.drawBackground=t=>{const{width:e,height:n}=this.getVideoSize();t.clearRect(0,0,e,n),t.beginPath(),t.rect(0,0,e,n),t.fillStyle=pe.getColorValue(this.props.configuration.overlayColor),t.fill()},this.drawHole=()=>{const t=this.holeCanvas.getContext("2d"),e=this.cornerRadius(),n=this.holePosition.x,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;t.beginPath(),t.fillStyle="black",t.moveTo(n+e,o),t.arcTo(n+i,o,n+i,o+r,e),t.arcTo(n+i,o+r,n,o+r,e),t.arcTo(n,o+r,n,o,e),t.arcTo(n,o,n+i,o,e),t.closePath(),t.fill()},this.drawCrosshair=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;t.beginPath(),t.moveTo(e-10,n),t.lineTo(e+10,n),t.moveTo(e,n-10),t.lineTo(e,n+10),t.strokeStyle="white",t.fillStyle="white",t.lineWidth=1,t.stroke()},this.drawHoleCorners=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,r=15,a=this.style.strokeWidth,s=this.cornerRadius();t.beginPath(),t.moveTo(e,n+r),t.arcTo(e,n,e+o,n,s),t.lineTo(e+r,n),t.moveTo(e+o-r,n),t.arcTo(e+o,n,e+o,n+i,s),t.lineTo(e+o,n+r),t.moveTo(e+o,n+i-r),t.arcTo(e+o,n+i,e,n+i,s),t.lineTo(e+o-r,n+i),t.moveTo(e,n+i-r),t.arcTo(e,n+i,e+o,n+i,s),t.lineTo(e+r,n+i),t.strokeStyle=pe.getColorValue(this.style.strokeColor),t.lineWidth=a,t.stroke()},this.drawHoleOutline=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,r=this.cornerRadius(),a=this.style.strokeWidth;t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.moveTo(e+o,n+r),t.arcTo(e+o,n+i,e,n+i,r),t.moveTo(e+o-r,n+i),t.arcTo(e,n+i,e,n,r),t.moveTo(e,n+i-r),t.arcTo(e,n,e+o,n,r),t.strokeStyle=pe.getColorValue(this.style.strokeColor),t.lineWidth=a,t.stroke()},this.guidanceTextTopPadding=20,this.render=()=>se.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"},onClick:t=>{const e=this.holePosition;t.clientX>this.holePosition.x&&t.clientX<e.x+e.width&&t.clientY>e.y&&t.clientY<e.y+e.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},se.default.createElement("canvas",{ref:t=>{this.holeCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),se.default.createElement("canvas",{ref:t=>{this.crosshairCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&se.default.createElement("div",{ref:t=>{this.guidanceText=t},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},se.default.createElement(ve,{style:{display:"inline-block",backgroundColor:pe.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:pe.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var t,e;return this.holeRect.bottom()+(null!==(e=null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}class Je extends se.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return se.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},se.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},se.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},se.default.createElement("div",{style:{flex:1}},this.props.barcode.text),se.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),se.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}class tn extends se.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 se.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>se.default.createElement(Je,{key:e,barcode:t,onClick:this.props.onClick}))))}}class en{}en.ScanbotPrimary="#c8193c",en.LightGray="#F5F5F5",en.Gray="#808080",en.DarkGray="#333333",en.Orange="#FF5533",en.White="#FFFFFF",en.TransparentGreen="rgba(0, 255, 0, 0.5)",en.TransparentGray="rgba(50, 50, 50, 0.5)",en.TransparentBlack="rgba(0, 0, 0, 0.3)",en.SBNegative="#FF3737";var nn,on=en;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(nn||(nn={}));class rn extends se.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:nn.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===nn.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return se.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},se.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},se.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:on.ScanbotPrimary}},se.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},se.default.createElement("div",{style:{backgroundColor:on.White,height:3,width:33,borderRadius:5}})),se.default.createElement("div",{style:{display:"flex",height:50}},se.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:on.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),se.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:on.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"),se.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:on.White,justifyContent:"right",alignItems:"center",paddingRight:10}},se.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),se.default.createElement(tn,{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(nn.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===nn.Pop&&this.updateAnimationType(nn.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 o=ze.b`from {transform: ${e};} to {transform: ${n};}`;return ze.a.div`animation: ${o} 0.5s;`}from(t){if(t===nn.PushRight)return this.translate("X",100);if(t===nn.PushBottom)return this.translate("Y",100);if(t===nn.Pop){const t=this.pushType===nn.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===nn.PushRight)return this.translate("X",0);if(t===nn.PushBottom)return this.translate("Y",0);if(t===nn.Pop){const t=this.pushType===nn.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}var an=n(1),sn=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},ln={measureLayout:sn(["layout","layoutId","drag","_layoutResetTransform"]),animation:sn(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:sn(["exit"]),drag:sn(["drag","dragControls"]),focus:sn(["whileFocus"]),hover:sn(["whileHover","onHoverStart","onHoverEnd"]),tap:sn(["whileTap","onTap","onTapStart","onTapCancel"]),pan:sn(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:sn(["layout","layoutId"])};var cn=Object(se.createContext)({strict:!1}),un=Object.keys(ln),dn=un.length;var hn=Object(se.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),pn=Object(se.createContext)({});var fn=Object(se.createContext)(null);function mn(t){var e=Object(se.useRef)(null);return null===e.current&&(e.current=t()),e.current}function gn(){var t=Object(se.useContext)(fn);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,o=t.register,i=yn();Object(se.useEffect)((function(){return o(i)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function vn(t){return null===t||t.isPresent}var An=0,bn=function(){return An++},yn=function(){return mn(bn)},Sn=Object(se.createContext)(null),Cn="undefined"!=typeof window,wn=Cn?se.useLayoutEffect:se.useEffect;function xn(t,e,n,o){var i=Object(se.useContext)(hn),r=Object(se.useContext)(cn),a=Object(se.useContext)(pn).visualElement,s=Object(se.useContext)(fn),l=function(t){var e=t.layoutId,n=Object(se.useContext)(Sn);return n&&void 0!==e?n+"-"+e:e}(n),c=Object(se.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(t,{visualState:e,parent:a,props:Object(an.a)(Object(an.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return wn((function(){u&&(u.setProps(Object(an.a)(Object(an.a)(Object(an.a)({},i),n),{layoutId:l})),u.isPresent=vn(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(se.useEffect)((function(){var t;u&&(null===(t=u.animationState)||void 0===t||t.animateChanges())})),wn((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function En(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ln(t){return Array.isArray(t)}function _n(t){return"string"==typeof t||Ln(t)}function On(t,e,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e?e(null!=n?n:t.custom,o,i):e}function kn(t,e,n){var o=t.getProps();return On(o,e,null!=n?n:o.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 Tn(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||_n(t.initial)||_n(t.animate)||_n(t.whileHover)||_n(t.whileDrag)||_n(t.whileTap)||_n(t.whileFocus)||_n(t.exit)}function Pn(t){return Boolean(Tn(t)||t.variants)}function Wn(t,e){var n=function(t,e){if(Tn(t)){var n=t.initial,o=t.animate;return{initial:!1===n||_n(n)?n:void 0,animate:_n(o)?o:void 0}}return!1!==t.inherit?e:{}}(t,Object(se.useContext)(pn)),o=n.initial,i=n.animate;return Object(se.useMemo)((function(){return{initial:o,animate:i}}),e?[Bn(o),Bn(i)]:[])}function Bn(t){return Array.isArray(t)?t.join(" "):t}function Dn(t){var e=t.preloadedFeatures,n=t.createVisualElement,o=t.useRender,i=t.useVisualState,r=t.Component;return e&&function(t){for(var e in t){var n=t[e];null!==n&&(ln[e].Component=n)}}(e),Object(se.forwardRef)((function(t,e){var a=Object(se.useContext)(hn).isStatic,s=null,l=Wn(t,a),c=i(t,a);return!a&&Cn&&(l.visualElement=xn(r,c,t,n),s=function(t,e,n){var o=[];if(Object(se.useContext)(cn),!e)return null;for(var i=0;i<dn;i++){var r=un[i],a=ln[r],s=a.isEnabled,l=a.Component;s(t)&&l&&o.push(se.createElement(l,Object(an.a)({key:r},t,{visualElement:e})))}return o}(t,l.visualElement)),se.createElement(se.Fragment,null,se.createElement(pn.Provider,{value:l},o(r,t,function(t,e,n){return Object(se.useCallback)((function(o){var i;o&&(null===(i=t.mount)||void 0===i||i.call(t,o)),e&&(o?e.mount(o):e.unmount()),n&&("function"==typeof n?n(o):En(n)&&(n.current=o))}),[e])}(c,l.visualElement,e),c,a)),s)}))}function In(t){function e(e,n){return void 0===n&&(n={}),Dn(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,o){return n.has(o)||n.set(o,e(o)),n.get(o)}})}var Rn=["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 Mn(t){return"string"==typeof t&&!t.includes("-")&&!!(Rn.indexOf(t)>-1||/[A-Z]/.test(t))}var Fn={};var jn=["","X","Y","Z"],Vn=["transformPerspective","x","y","z"];function zn(t,e){return Vn.indexOf(t)-Vn.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return jn.forEach((function(e){return Vn.push(t+e)}))}));var Nn=new Set(Vn);function Un(t){return Nn.has(t)}var Hn=new Set(["originX","originY","originZ"]);function Gn(t){return Hn.has(t)}function Yn(t,e){var n=e.layout,o=e.layoutId;return Un(t)||Gn(t)||(n||void 0!==o)&&(!!Fn[t]||"opacity"===t)}var Xn=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},Qn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Zn(t){return t.startsWith("--")}var $n=function(t,e){return e&&"number"==typeof t?e.transform(t):t},qn=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},Kn=function(t){return t%1?Number(t.toFixed(5)):t},Jn=/(-)?([\d]*\.?[\d])+/g,to=/(#[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,eo=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function no(t){return"string"==typeof t}var oo=function(t){return{test:function(e){return no(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},io=oo("deg"),ro=oo("%"),ao=oo("px"),so=oo("vh"),lo=oo("vw"),co=Object(an.a)(Object(an.a)({},ro),{parse:function(t){return ro.parse(t)/100},transform:function(t){return ro.transform(100*t)}}),uo={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},ho=Object(an.a)(Object(an.a)({},uo),{transform:qn(0,1)}),po=Object(an.a)(Object(an.a)({},uo),{default:1}),fo=Object(an.a)(Object(an.a)({},uo),{transform:Math.round}),mo={borderWidth:ao,borderTopWidth:ao,borderRightWidth:ao,borderBottomWidth:ao,borderLeftWidth:ao,borderRadius:ao,radius:ao,borderTopLeftRadius:ao,borderTopRightRadius:ao,borderBottomRightRadius:ao,borderBottomLeftRadius:ao,width:ao,maxWidth:ao,height:ao,maxHeight:ao,size:ao,top:ao,right:ao,bottom:ao,left:ao,padding:ao,paddingTop:ao,paddingRight:ao,paddingBottom:ao,paddingLeft:ao,margin:ao,marginTop:ao,marginRight:ao,marginBottom:ao,marginLeft:ao,rotate:io,rotateX:io,rotateY:io,rotateZ:io,scale:po,scaleX:po,scaleY:po,scaleZ:po,skew:io,skewX:io,skewY:io,distance:ao,translateX:ao,translateY:ao,translateZ:ao,x:ao,y:ao,z:ao,perspective:ao,transformPerspective:ao,opacity:ho,originX:co,originY:co,originZ:ao,zIndex:fo,fillOpacity:ho,strokeOpacity:ho,numOctaves:fo};function go(t,e,n,o,i,r,a,s){var l,c=t.style,u=t.vars,d=t.transform,h=t.transformKeys,p=t.transformOrigin;h.length=0;var f=!1,m=!1,g=!0;for(var v in e){var A=e[v];if(Zn(v))u[v]=A;else{var b=mo[v],y=$n(A,b);if(Un(v)){if(f=!0,d[v]=y,h.push(v),!g)continue;A!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(Gn(v))p[v]=y,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&Fn[v]){var S=Fn[v].process(A,o,n),C=Fn[v].applyTo;if(C)for(var w=C.length,x=0;x<w;x++)c[C[x]]=S;else c[v]=S}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,f?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(f&&(c.transform=function(t,e,n,o){var i=t.transform,r=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,l=e.allowTransformNone,c=void 0===l||l,u="";r.sort(zn);for(var d=!1,h=r.length,p=0;p<h;p++){var f=r[p];u+=(Qn[f]||f)+"("+i[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(t,i,g,r)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,o=t.originY,i=void 0===o?"50%":o,r=t.originZ;return n+" "+i+" "+(void 0===r?0:r)}(p)))}var vo=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Ao(t,e,n){for(var o in e)Xn(e[o])||Yn(o,n)||(t[o]=e[o])}function bo(t,e,n){var o={};return Ao(o,t.style||{},t),Object.assign(o,function(t,e,n){var o=t.transformTemplate;return Object(se.useMemo)((function(){var t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};go(t,e,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=t.vars,r=t.style;return Object(an.a)(Object(an.a)({},i),r)}),[e])}(t,e,n)),t.transformValues&&(o=t.transformValues(o)),o}function yo(t,e,n){var o={},i=bo(t,e,n);return Boolean(t.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}var So=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 Co(t){return So.has(t)}var wo=function(t){return!Co(t)};try{var xo=n(21).default;wo=function(t){return t.startsWith("on")?!Co(t):xo(t)}}catch(t){}function Eo(t,e,n){return"string"==typeof t?t:ao.transform(e+n*t)}var Lo=function(t,e){return ao.transform(t*e)},_o={offset:"stroke-dashoffset",array:"stroke-dasharray"},Oo={offset:"strokeDashoffset",array:"strokeDasharray"};function ko(t,e,n,o,i,r,a,s){var l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,p=e.pathSpacing,f=void 0===p?1:p,m=e.pathOffset,g=void 0===m?0:m;go(t,Object(an.d)(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),t.attrs=t.style,t.style={};var v=t.attrs,A=t.style,b=t.dimensions,y=t.totalPathLength;v.transform&&(b&&(A.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||A.transform)&&(A.transformOrigin=function(t,e,n){return Eo(e,t.x,t.width)+" "+Eo(n,t.y,t.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(t,e,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?_o:Oo;t[a.offset]=Lo(-i,e);var s=Lo(n,e),l=Lo(o,e);t[a.array]=s+" "+l}(v,y,h,f,g,!1)}var To=function(){return Object(an.a)(Object(an.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Po(t,e){var n=Object(se.useMemo)((function(){var n=To();return ko(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Object(an.a)(Object(an.a)({},n.attrs),{style:Object(an.a)({},n.style)})}),[e]);if(t.style){var o={};Ao(o,t.style,t),n.style=Object(an.a)(Object(an.a)({},o),n.style)}return n}function Wo(t){void 0===t&&(t=!1);return function(e,n,o,i,r){var a=i.latestValues,s=(Mn(e)?Po:yo)(n,a,r),l=function(t,e,n){var o={};for(var i in t)(wo(i)||!0===n&&Co(i)||!e&&!Co(i))&&(o[i]=t[i]);return o}(n,"string"==typeof e,t),c=Object(an.a)(Object(an.a)(Object(an.a)({},l),s),{ref:o});return Object(se.createElement)(e,c)}}var Bo=/([a-z])([A-Z])/g,Do=function(t){return t.replace(Bo,"$1-$2").toLowerCase()};function Io(t,e){var n=e.style,o=e.vars;for(var i in Object.assign(t.style,n),o)t.style.setProperty(i,o[i])}var Ro=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function Mo(t,e){for(var n in Io(t,e),e.attrs)t.setAttribute(Ro.has(n)?n:Do(n),e.attrs[n])}function Fo(t){var e=t.style,n={};for(var o in e)(Xn(e[o])||Yn(o,t))&&(n[o]=e[o]);return n}function jo(t){var e=Fo(t);for(var n in t){if(Xn(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Vo(t){return"object"==typeof t&&"function"==typeof t.start}var zo=function(t){return Array.isArray(t)};function No(t){var e,n=Xn(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n}function Uo(t,e,n,o){var i=t.scrapeMotionValuesFromProps,r=t.createRenderState,a=t.onMount,s={latestValues:Go(e,n,o,i),renderState:r()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var Ho=function(t){return function(e,n){var o=Object(se.useContext)(pn),i=Object(se.useContext)(fn);return n?Uo(t,e,o,i):mn((function(){return Uo(t,e,o,i)}))}};function Go(t,e,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(t);for(var s in a)i[s]=No(a[s]);var l=t.initial,c=t.animate,u=Tn(t),d=Pn(t);e&&d&&!u&&!1!==t.inherit&&(null!=l||(l=e.initial),null!=c||(c=e.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!Vo(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=On(t,e);if(n){var o=n.transitionEnd;n.transition;var r=Object(an.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var Yo={useVisualState:Ho({scrapeMotionValuesFromProps:jo,createRenderState:To,onMount:function(t,e,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){o.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(o.totalPathLength=e.getTotalLength()),ko(o,i,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Mo(e,o)}})};var Xo,Qo={useVisualState:Ho({scrapeMotionValuesFromProps:Fo,createRenderState:vo})};function Zo(t,e,n,o){var i=e.forwardMotionProps,r=void 0!==i&&i,a=Mn(t)?Yo:Qo;return Object(an.a)(Object(an.a)({},a),{preloadedFeatures:n,useRender:Wo(r),createVisualElement:o,Component:t})}function $o(t,e,n,o){return t.addEventListener(e,n,o),function(){return t.removeEventListener(e,n,o)}}function qo(t,e,n,o){Object(se.useEffect)((function(){var i=t.current;if(n&&i)return $o(i,e,n,o)}),[t,e,n,o])}function Ko(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function Jo(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(Xo||(Xo={}));var ti={pageX:0,pageY:0};function ei(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||ti;return{x:n[e+"X"],y:n[e+"Y"]}}function ni(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function oi(t,e){return void 0===e&&(e="page"),{point:Jo(t)?ei(t,e):ni(t,e)}}var ii=function(t,e){void 0===e&&(e=!1);var n,o=function(e){return t(e,oi(e))};return e?(n=o,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):o},ri={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ai={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function si(t){return Cn&&null===window.onpointerdown?t:Cn&&null===window.ontouchstart?ai[t]:Cn&&null===window.onmousedown?ri[t]:t}function li(t,e,n,o){return $o(t,si(e),ii(n,"pointerdown"===e),o)}function ci(t,e,n,o){return qo(t,si(e),n&&ii(n,"pointerdown"===e),o)}function ui(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var di=ui("dragHorizontal"),hi=ui("dragVertical");function pi(t){var e=!1;if("y"===t)e=hi();else if("x"===t)e=di();else{var n=di(),o=hi();n&&o?e=function(){n(),o()}:(n&&n(),o&&o())}return e}function fi(){var t=pi(!0);return!t||(t(),!1)}function mi(t,e,n){return function(o,i){var r;Ko(o)&&!fi()&&(null==n||n(o,i),null===(r=t.animationState)||void 0===r||r.setActive(Xo.Hover,e))}}var gi=function(t,e){return!!e&&(t===e||gi(t,e.parentElement))};function vi(t){return Object(se.useEffect)((function(){return function(){return t()}}),[])}var Ai=function(t,e){return function(n){return e(t(n))}},bi=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Ai)};var yi=function(t){return function(e){return t(e),null}},Si={tap:yi((function(t){var e=t.onTap,n=t.onTapStart,o=t.onTapCancel,i=t.whileTap,r=t.visualElement,a=e||n||o||i,s=Object(se.useRef)(!1),l=Object(se.useRef)(null);function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function u(){var t;return c(),s.current=!1,null===(t=r.animationState)||void 0===t||t.setActive(Xo.Tap,!1),!fi()}function d(t,n){u()&&(gi(r.getInstance(),t.target)?null==e||e(t,n):null==o||o(t,n))}function h(t,e){u()&&(null==o||o(t,e))}ci(r,"pointerdown",a?function(t,e){var o;c(),s.current||(s.current=!0,l.current=bi(li(window,"pointerup",d),li(window,"pointercancel",h)),null==n||n(t,e),null===(o=r.animationState)||void 0===o||o.setActive(Xo.Tap,!0))}:void 0),vi(c)})),focus:yi((function(t){var e=t.whileFocus,n=t.visualElement;qo(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(Xo.Focus,!0)}:void 0),qo(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(Xo.Focus,!1)}:void 0)})),hover:yi((function(t){var e=t.onHoverStart,n=t.onHoverEnd,o=t.whileHover,i=t.visualElement;ci(i,"pointerenter",e||o?mi(i,!0,e):void 0),ci(i,"pointerleave",n||o?mi(i,!1,n):void 0)}))};function Ci(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}var wi=function(t,e,n){return Math.min(Math.max(n,t),e)},xi=.001;function Ei(t){var e,n,o=t.duration,i=void 0===o?800:o,r=t.bounce,a=void 0===r?.25:r,s=t.velocity,l=void 0===s?0:s,c=t.mass,u=void 0===c?1:c,d=1-a;d=wi(.05,1,d),i=wi(.01,10,i/1e3),d<1?(e=function(t){var e=t*d,n=e*i,o=e-l,r=Li(t,d),a=Math.exp(-n);return xi-o/r*a},n=function(t){var n=t*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(t,2)*i,a=Math.exp(-n),s=Li(Math.pow(t,2),d);return(-e(t)+xi>0?-1:1)*((o-r)*a)/s}):(e=function(t){return Math.exp(-t*i)*((t-l)*i+1)-.001},n=function(t){return Math.exp(-t*i)*(i*i*(l-t))});var h=function(t,e,n){for(var o=n,i=1;i<12;i++)o-=t(o)/e(o);return o}(e,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var p=Math.pow(h,2)*u;return{stiffness:p,damping:2*d*Math.sqrt(u*p),duration:i}}function Li(t,e){return t*Math.sqrt(1-e*e)}var _i=["duration","bounce"],Oi=["stiffness","damping","mass"];function ki(t,e){return e.some((function(e){return void 0!==t[e]}))}function Ti(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.restSpeed,a=void 0===r?2:r,s=t.restDelta,l=Object(an.d)(t,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(t){var e=Object(an.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ki(t,Oi)&&ki(t,_i)){var n=Ei(t);(e=Object(an.a)(Object(an.a)(Object(an.a)({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),d=u.stiffness,h=u.damping,p=u.mass,f=u.velocity,m=u.duration,g=u.isResolvedFromDuration,v=Pi,A=Pi;function b(){var t=f?-f/1e3:0,e=i-n,o=h/(2*Math.sqrt(d*p)),r=Math.sqrt(d/p)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=Li(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((t+o*r*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},A=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(t+o*r*e)/a+e*Math.cos(a*n))-i*(Math.cos(a*n)*(t+o*r*e)-a*e*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(e+(t+r*e)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((t+o*r*e)*Math.sinh(s)+l*e*Math.cosh(s))/l}}}return b(),{next:function(t){var e=v(t);if(g)c.done=t>=m;else{var n=1e3*A(t),o=Math.abs(n)<=a,r=Math.abs(i-e)<=s;c.done=o&&r}return c.value=c.done?i:e,c},flipTarget:function(){var t;f=-f,n=(t=[i,n])[0],i=t[1],b()}}}Ti.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var Pi=function(t){return 0},Wi=function(t,e,n){var o=e-t;return 0===o?1:(n-t)/o},Bi=function(t,e,n){return-n*t+n*e+t},Di=function(t,e){return function(n){return Boolean(no(n)&&eo.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Ii=function(t,e,n){return function(o){var i;if(!no(o))return o;var r=o.match(Jn),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[t]=parseFloat(a),i[e]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},Ri=qn(0,255),Mi=Object(an.a)(Object(an.a)({},uo),{transform:function(t){return Math.round(Ri(t))}}),Fi={test:Di("rgb","red"),parse:Ii("red","green","blue"),transform:function(t){var e=t.red,n=t.green,o=t.blue,i=t.alpha,r=void 0===i?1:i;return"rgba("+Mi.transform(e)+", "+Mi.transform(n)+", "+Mi.transform(o)+", "+Kn(ho.transform(r))+")"}};var ji={test:Di("#"),parse:function(t){var e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:Fi.transform},Vi={test:Di("hsl","hue"),parse:Ii("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,o=t.lightness,i=t.alpha,r=void 0===i?1:i;return"hsla("+Math.round(e)+", "+ro.transform(Kn(n))+", "+ro.transform(Kn(o))+", "+Kn(ho.transform(r))+")"}},zi=function(t,e,n){var o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},Ni=[ji,Fi,Vi],Ui=function(t){return Ni.find((function(e){return e.test(t)}))},Hi=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},Gi=function(t,e){var n=Ui(t),o=Ui(e);Hi(t),Hi(e),n.transform,o.transform;var i=n.parse(t),r=o.parse(e),a=Object(an.a)({},i),s=n===Vi?Bi:zi;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(i[e],r[e],t));return a.alpha=Bi(i.alpha,r.alpha,t),n.transform(a)}},Yi={test:function(t){return Fi.test(t)||ji.test(t)||Vi.test(t)},parse:function(t){return Fi.test(t)?Fi.parse(t):Vi.test(t)?Vi.parse(t):ji.parse(t)},transform:function(t){return no(t)?t:t.hasOwnProperty("red")?Fi.transform(t):Vi.transform(t)}},Xi="${c}",Qi="${n}";function Zi(t){var e=[],n=0,o=t.match(to);o&&(n=o.length,t=t.replace(to,Xi),e.push.apply(e,o.map(Yi.parse)));var i=t.match(Jn);return i&&(t=t.replace(Jn,Qi),e.push.apply(e,i.map(uo.parse))),{values:e,numColors:n,tokenised:t}}function $i(t){return Zi(t).values}function qi(t){var e=Zi(t),n=e.values,o=e.numColors,i=e.tokenised,r=n.length;return function(t){for(var e=i,n=0;n<r;n++)e=e.replace(n<o?Xi:Qi,n<o?Yi.transform(t[n]):Kn(t[n]));return e}}var Ki=function(t){return"number"==typeof t?0:t};var Ji={test:function(t){var e,n,o,i;return isNaN(t)&&no(t)&&(null!==(n=null===(e=t.match(Jn))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(to))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:$i,createTransformer:qi,getAnimatableNone:function(t){var e=$i(t);return qi(t)(e.map(Ki))}},tr=function(t){return"number"==typeof t};function er(t,e){return tr(t)?function(n){return Bi(t,e,n)}:Yi.test(t)?Gi(t,e):rr(t,e)}var nr=function(t,e){var n=Object(an.e)([],t),o=n.length,i=t.map((function(t,n){return er(t,e[n])}));return function(t){for(var e=0;e<o;e++)n[e]=i[e](t);return n}},or=function(t,e){var n=Object(an.a)(Object(an.a)({},t),e),o={};for(var i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=er(t[i],e[i]));return function(t){for(var e in o)n[e]=o[e](t);return n}};function ir(t){for(var e=Ji.parse(t),n=e.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof e[a]?o++:void 0!==e[a].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}var rr=function(t,e){var n=Ji.createTransformer(e),o=ir(t),i=ir(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),bi(nr(o.parsed,i.parsed),n)},ar=function(t,e){return function(n){return Bi(t,e,n)}};function sr(t,e,n){for(var o,i=[],r=n||("number"==typeof(o=t[0])?ar:"string"==typeof o?Yi.test(o)?Gi:rr:Array.isArray(o)?nr:"object"==typeof o?or:void 0),a=t.length-1,s=0;s<a;s++){var l=r(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;l=bi(c,l)}i.push(l)}return i}function lr(t,e,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[l-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=sr(e,a,s),u=2===l?function(t,e){var n=t[0],o=t[1],i=e[0];return function(t){return i(Wi(n,o,t))}}(t,c):function(t,e){var n=t.length,o=n-1;return function(i){var r=0,a=!1;if(i<=t[0]?a=!0:i>=t[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>i||s===o);s++);r=s-1}var l=Wi(t[r],t[r+1],i);return e[r](l)}}(t,c);return r?function(e){return u(wi(t[0],t[l-1],e))}:u}var cr,ur=function(t){return function(e){return 1-t(1-e)}},dr=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},hr=function(t){return function(e){return e*e*((t+1)*e-t)}},pr=function(t){return t},fr=(cr=2,function(t){return Math.pow(t,cr)}),mr=ur(fr),gr=dr(fr),vr=function(t){return 1-Math.sin(Math.acos(t))},Ar=ur(vr),br=dr(Ar),yr=hr(1.525),Sr=ur(yr),Cr=dr(yr),wr=function(t){var e=hr(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),xr=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},Er=ur(xr);function Lr(t,e){return t.map((function(){return e||gr})).splice(0,t.length-1)}function _r(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.ease,a=t.offset,s=t.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===u.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(u),l);function h(){return lr(d,u,{ease:Array.isArray(r)?r:Lr(u,r)})}var p=h();return{next:function(t){return c.value=p(t),c.done=t>=l,c},flipTarget:function(){u.reverse(),p=h()}}}var Or={keyframes:_r,spring:Ti,decay:function(t){var e=t.velocity,n=void 0===e?0:e,o=t.from,i=void 0===o?0:o,r=t.power,a=void 0===r?.8:r,s=t.timeConstant,l=void 0===s?350:s,c=t.restDelta,u=void 0===c?.5:c,d=t.modifyTarget,h={done:!1,value:i},p=a*n,f=i+p,m=void 0===d?f:d(f);return m!==f&&(p=m-i),{next:function(t){var e=-p*Math.exp(-t/l);return h.done=!(e>u||e<-u),h.value=h.done?m:m+e,h},flipTarget:function(){}}}};var kr=1/60*1e3,Tr="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Pr="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(Tr())}),kr)};var Wr=!0,Br=!1,Dr=!1,Ir={delta:0,timestamp:0},Rr=["read","update","preRender","render","postRender"],Mr=Rr.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?e:n;return a&&r.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:function(s){var l;if(i=!0,e=(l=[n,e])[0],(n=l[1]).length=0,o=e.length)for(var c=0;c<o;c++){var u=e[c];u(s),r.has(u)&&(a.schedule(u),t())}i=!1}};return a}((function(){return Br=!0})),t}),{}),Fr=Rr.reduce((function(t,e){var n=Mr[e];return t[e]=function(t,e,o){return void 0===e&&(e=!1),void 0===o&&(o=!1),Br||Ur(),n.schedule(t,e,o)},t}),{}),jr=Rr.reduce((function(t,e){return t[e]=Mr[e].cancel,t}),{}),Vr=Rr.reduce((function(t,e){return t[e]=function(){return Mr[e].process(Ir)},t}),{}),zr=function(t){return Mr[t].process(Ir)},Nr=function(t){Br=!1,Ir.delta=Wr?kr:Math.max(Math.min(t-Ir.timestamp,40),1),Ir.timestamp=t,Dr=!0,Rr.forEach(zr),Dr=!1,Br&&(Wr=!1,Pr(Nr))},Ur=function(){Br=!0,Wr=!0,Dr||Pr(Nr)},Hr=function(){return Ir},Gr=Fr;function Yr(t,e,n){return void 0===n&&(n=0),t-e-n}var Xr=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return Gr.update(e,!0)},stop:function(){return jr.update(e)}}};function Qr(t){var e,n,o,i,r,a=t.from,s=t.autoplay,l=void 0===s||s,c=t.driver,u=void 0===c?Xr:c,d=t.elapsed,h=void 0===d?0:d,p=t.repeat,f=void 0===p?0:p,m=t.repeatType,g=void 0===m?"loop":m,v=t.repeatDelay,A=void 0===v?0:v,b=t.onPlay,y=t.onStop,S=t.onComplete,C=t.onRepeat,w=t.onUpdate,x=Object(an.d)(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),E=x.to,L=0,_=x.duration,O=!1,k=!0,T=function(t){if(Array.isArray(t.to))return _r;if(Or[t.type])return Or[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_r:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ti:_r}(x);(null===(n=(e=T).needsInterpolation)||void 0===n?void 0:n.call(e,a,E))&&(r=lr([0,100],[a,E],{clamp:!1}),a=0,E=100);var P=T(Object(an.a)(Object(an.a)({},x),{from:a,to:E}));function W(){L++,"reverse"===g?h=function(t,e,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?Yr(e+-t,e,n):e-(t-e)+n}(h,_,A,k=L%2==0):(h=Yr(h,_,A),"mirror"===g&&P.flipTarget()),O=!1,C&&C()}function B(t){if(k||(t=-t),h+=t,!O){var e=P.next(Math.max(0,h));i=e.value,r&&(i=r(i)),O=k?e.done:h<=0}null==w||w(i),O&&(0===L&&(null!=_||(_=h)),L<f?function(t,e,n,o){return o?t>=e+n:t<=-n}(h,_,A,k)&&W():(o.stop(),S&&S()))}return l&&(null==b||b(),(o=u(B)).start()),{stop:function(){null==y||y(),o.stop()}}}function Zr(t,e){return e?t*(1e3/e):0}var $r=function(t){return 1e3*t},qr=function(t,e){return 1-3*e+3*t},Kr=function(t,e){return 3*e-6*t},Jr=function(t){return 3*t},ta=function(t,e,n){return((qr(e,n)*t+Kr(e,n))*t+Jr(e))*t},ea=function(t,e,n){return 3*qr(e,n)*t*t+2*Kr(e,n)*t+Jr(e)};var na=.1;function oa(t,e,n,o){if(t===e&&n===o)return pr;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=ta(r*na,t,n);function a(e){for(var o=0,r=1;10!==r&&i[r]<=e;++r)o+=na;--r;var a=o+(e-i[r])/(i[r+1]-i[r])*na,s=ea(a,t,n);return s>=.001?function(t,e,n,o){for(var i=0;i<8;++i){var r=ea(e,n,o);if(0===r)return e;e-=(ta(e,n,o)-t)/r}return e}(e,a,t,n):0===s?a:function(t,e,n,o,i){var r,a,s=0;do{(r=ta(a=e+(n-e)/2,o,i)-t)>0?n=a:e=a}while(Math.abs(r)>1e-7&&++s<10);return a}(e,o,o+na,t,n)}return function(t){return 0===t||1===t?t:ta(a(t),e,o)}}var ia={linear:pr,easeIn:fr,easeInOut:gr,easeOut:mr,circIn:vr,circInOut:br,circOut:Ar,backIn:yr,backInOut:Cr,backOut:Sr,anticipate:wr,bounceIn:Er,bounceInOut:function(t){return t<.5?.5*(1-xr(1-2*t)):.5*xr(2*t-1)+.5},bounceOut:xr},ra=function(t){if(Array.isArray(t)){t.length;var e=Object(an.c)(t,4);return oa(e[0],e[1],e[2],e[3])}return"string"==typeof t?ia[t]:t},aa=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ji.test(e)||e.startsWith("url(")))},sa=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},la=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},ca=function(){return{type:"keyframes",ease:"linear",duration:.3}},ua=function(t){return{type:"keyframes",duration:.8,values:t}},da={x:sa,y:sa,z:sa,rotate:sa,rotateX:sa,rotateY:sa,rotateZ:sa,scaleX:la,scaleY:la,scale:la,opacity:ca,backgroundColor:ca,color:ca,default:la},ha=new Set(["brightness","contrast","saturate","opacity"]);function pa(t){var e=t.slice(0,-1).split("("),n=e[0],o=e[1];if("drop-shadow"===n)return t;var i=(o.match(Jn)||[])[0];if(!i)return t;var r=o.replace(i,""),a=ha.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var fa=/([a-z-]*)\(.*?\)/g,ma=Object(an.a)(Object(an.a)({},Ji),{getAnimatableNone:function(t){var e=t.match(fa);return e?e.map(pa).join(" "):t}}),ga=Object(an.a)(Object(an.a)({},mo),{color:Yi,backgroundColor:Yi,outlineColor:Yi,fill:Yi,stroke:Yi,borderColor:Yi,borderTopColor:Yi,borderRightColor:Yi,borderBottomColor:Yi,borderLeftColor:Yi,filter:ma,WebkitFilter:ma}),va=function(t){return ga[t]};function Aa(t,e){var n,o=va(t);return o!==ma&&(o=Ji),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}function ba(t){var e=t.ease,n=t.times,o=t.yoyo,i=t.flip,r=t.loop,a=Object(an.d)(t,["ease","times","yoyo","flip","loop"]),s=Object(an.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=$r(a.duration)),a.repeatDelay&&(s.repeatDelay=$r(a.repeatDelay)),e&&(s.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(ra):ra(e)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function ya(t,e,n){var o,i,r,a;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=Object(an.e)([],Object(an.c)(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=Object(an.d)(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object(an.a)(Object(an.a)({},t),(i=n,r=e.to,a=zo(r)?ua:da[i]||da.default,Object(an.a)({to:r},a(r))))),Object(an.a)(Object(an.a)({},e),ba(t))}function Sa(t,e,n,o,i){var r,a=xa(o,t),s=null!==(r=a.from)&&void 0!==r?r:e.get(),l=aa(t,n);"none"===s&&l&&"string"==typeof n?s=Aa(t,n):Ca(s)&&"string"==typeof n?s=wa(n):!Array.isArray(n)&&Ca(n)&&"string"==typeof s&&(n=wa(s));var c=aa(t,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:function(t){return e.set(t)}};return"inertia"===a.type||"decay"===a.type?function(t){var e,n=t.from,o=void 0===n?0:n,i=t.velocity,r=void 0===i?0:i,a=t.min,s=t.max,l=t.power,c=void 0===l?.8:l,u=t.timeConstant,d=void 0===u?750:u,h=t.bounceStiffness,p=void 0===h?500:h,f=t.bounceDamping,m=void 0===f?10:f,g=t.restDelta,v=void 0===g?1:g,A=t.modifyTarget,b=t.driver,y=t.onUpdate,S=t.onComplete;function C(t){return void 0!==a&&t<a||void 0!==s&&t>s}function w(t){return void 0===a?s:void 0===s||Math.abs(a-t)<Math.abs(s-t)?a:s}function x(t){null==e||e.stop(),e=Qr(Object(an.a)(Object(an.a)({},t),{driver:b,onUpdate:function(e){var n;null==y||y(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:S}))}function E(t){x(Object(an.a)({type:"spring",stiffness:p,damping:m,restDelta:v},t))}if(C(o))E({from:o,velocity:r,to:w(o)});else{var L=c*r+o;"undefined"!=typeof A&&(L=A(L));var _,O,k=w(L),T=k===a?-1:1;x({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:A,onUpdate:C(L)?function(t){_=O,O=t,r=Zr(t-_,Hr().delta),(1===T&&t>k||-1===T&&t<k)&&E({from:t,to:k,velocity:r})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(Object(an.a)(Object(an.a)({},o),a)):Qr(Object(an.a)(Object(an.a)({},ya(a,o,t)),{onUpdate:function(t){var e;o.onUpdate(t),null===(e=a.onUpdate)||void 0===e||e.call(a,t)},onComplete:function(){var t;o.onComplete(),null===(t=a.onComplete)||void 0===t||t.call(a)}}))}:function(){var t;return e.set(n),i(),null===(t=null==a?void 0:a.onComplete)||void 0===t||t.call(a),{stop:function(){}}}}function Ca(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function wa(t){return"number"==typeof t?0:Aa("",t)}function xa(t,e){return t[e]||t.default||t}function Ea(t,e,n,o){return void 0===o&&(o={}),e.start((function(i){var r,a,s=Sa(t,e,n,o,i),l=function(t,e){var n;return null!==(n=(xa(t,e)||{}).delay)&&void 0!==n?n:0}(o,t),c=function(){return a=s()};return l?r=setTimeout(c,$r(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function La(t,e){-1===t.indexOf(e)&&t.push(e)}function _a(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Oa=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return La(this.subscriptions,t),function(){return _a(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),ka=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Oa,this.velocityUpdateSubscribers=new Oa,this.renderSubscribers=new Oa,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var o=Hr(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,Gr.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 Gr.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?Zr(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 Ta(t){return new ka(t)}var Pa=function(t){return function(e){return e.test(t)}},Wa=[uo,ao,ro,io,lo,so,{test:function(t){return"auto"===t},parse:function(t){return t}}],Ba=function(t){return Wa.find(Pa(t))},Da=Object(an.e)(Object(an.e)([],Object(an.c)(Wa)),[Yi,Ji]),Ia=function(t){return Da.find(Pa(t))};function Ra(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ta(n))}function Ma(t,e){var n=kn(t,e),o=n?t.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(an.d)(o,["transitionEnd","transition"]);for(var l in s=Object(an.a)(Object(an.a)({},s),r)){Ra(t,l,(a=s[l],zo(a)?a[a.length-1]||0:a))}}function Fa(t,e){if(e)return(e[t]||e.default||e).from}function ja(t,e,n){var o;void 0===n&&(n={});var i=kn(t,e,n.custom),r=(i||{}).transition,a=void 0===r?t.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return Va(t,i,n)}:function(){return Promise.resolve()},l=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(t,e,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(t.variantChildren.size-1)*o,l=1===i?function(t){return void 0===t&&(t=0),t*o}:function(t){return void 0===t&&(t=0),s-t*o};return Array.from(t.variantChildren).sort(za).forEach((function(t,o){a.push(ja(t,e,Object(an.a)(Object(an.a)({},r),{delay:n+l(o)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(a)}(t,e,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(an.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function Va(t,e,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=t.makeTargetAnimatable(e),u=c.transition,d=void 0===u?t.getDefaultTransition():u,h=c.transitionEnd,p=Object(an.d)(c,["transition","transitionEnd"]);s&&(d=s);var f=[],m=l&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in p){var v=t.getValue(g),A=p[g];if(!(!v||void 0===A||m&&Na(m,g))){var b=Ea(g,v,A,Object(an.a)({delay:a},d));f.push(b)}}return Promise.all(f).then((function(){h&&Ma(t,h)}))}function za(t,e){return t.sortNodePosition(e)}function Na(t,e){var n=t.protectedKeys,o=t.needsAnimating,i=n.hasOwnProperty(e)&&!0!==o[e];return o[e]=!1,i}var Ua=[Xo.Animate,Xo.Hover,Xo.Tap,Xo.Drag,Xo.Focus,Xo.Exit],Ha=Object(an.e)([],Object(an.c)(Ua)).reverse(),Ga=Ua.length;function Ya(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,o=e.options;return function(t,e,n){var o;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var i=e.map((function(e){return ja(t,e,n)}));o=Promise.all(i)}else if("string"==typeof e)o=ja(t,e,n);else{var r="function"==typeof e?kn(t,e,n.custom):e;o=Va(t,r,n)}return o.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,o)})))}}function Xa(t){var e,n=Ya(t),o=((e={})[Xo.Animate]=Qa(!0),e[Xo.Hover]=Qa(),e[Xo.Tap]=Qa(),e[Xo.Drag]=Qa(),e[Xo.Focus]=Qa(),e[Xo.Exit]=Qa(),e),i={},r=!0,a=function(e,n){var o=kn(t,n);if(o){o.transition;var i=o.transitionEnd,r=Object(an.d)(o,["transition","transitionEnd"]);e=Object(an.a)(Object(an.a)(Object(an.a)({},e),r),i)}return e};function s(e,s){for(var l,c=t.getProps(),u=t.getVariantContext(!0)||{},d=[],h=new Set,p={},f=1/0,m=function(n){var i=Ha[n],m=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=_n(g),A=i===s?m.isActive:null;!1===A&&(f=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=Object(an.a)({},p),!m.isActive&&null===A||!g&&!m.prevProp||Vo(g)||"boolean"==typeof g)return"continue";var y=function(t,e){if("string"==typeof e)return e!==t;if(Ln(e))return!Ci(e,t);return!1}(m.prevProp,g)||i===s&&m.isActive&&!b&&v||n>f&&v,S=Array.isArray(g)?g:[g],C=S.reduce(a,{});!1===A&&(C={});var w=m.prevResolvedValues,x=void 0===w?{}:w,E=Object(an.a)(Object(an.a)({},x),C),L=function(t){y=!0,h.delete(t),m.needsAnimating[t]=!0};for(var _ in E){var O=C[_],k=x[_];p.hasOwnProperty(_)||(O!==k?zo(O)&&zo(k)?Ci(O,k)?m.protectedKeys[_]=!0:L(_):void 0!==O?L(_):h.add(_):void 0!==O&&h.has(_)?L(_):m.protectedKeys[_]=!0)}m.prevProp=g,m.prevResolvedValues=C,m.isActive&&(p=Object(an.a)(Object(an.a)({},p),C)),r&&t.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(an.e)([],Object(an.c)(S.map((function(t){return{animation:t,options:Object(an.a)({type:i},e)}})))))},g=0;g<Ga;g++)m(g);if(i=Object(an.a)({},p),h.size){var v={};h.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(v[e]=n)})),d.push({animation:v})}var A=Boolean(d.length);return r&&!1===c.initial&&!t.manuallyAnimateOnMount&&(A=!1),r=!1,A?n(d):Promise.resolve()}return{isAnimated:function(t){return void 0!==i[t]},animateChanges:s,setActive:function(e,n,i){var r;return o[e].isActive===n?Promise.resolve():(null===(r=t.variantChildren)||void 0===r||r.forEach((function(t){var o;return null===(o=t.animationState)||void 0===o?void 0:o.setActive(e,n)})),o[e].isActive=n,s(i,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return o}}}function Qa(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Za={animation:yi((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=Xa(e)),Vo(n)&&Object(se.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:yi((function(t){var e=t.custom,n=t.visualElement,o=Object(an.c)(gn(),2),i=o[0],r=o[1],a=Object(se.useContext)(fn);Object(se.useEffect)((function(){var t,o,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(Xo.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:e});!i&&(null==s||s.then(r))}),[i])}))},$a=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},qa=function(t){return $a(t)&&t.hasOwnProperty("z")},Ka=function(t,e){return Math.abs(t-e)};function Ja(t,e){if(tr(t)&&tr(e))return Ka(t,e);if($a(t)&&$a(e)){var n=Ka(t.x,e.x),o=Ka(t.y,e.y),i=qa(t)&&qa(e)?Ka(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var ts=function(){function t(t,e,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var t=os(o.lastMoveEventInfo,o.history),e=null!==o.startEvent,n=Ja(t.offset,{x:0,y:0})>=3;if(e||n){var i=t.point,r=Hr().timestamp;o.history.push(Object(an.a)(Object(an.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;e||(s&&s(o.lastMoveEvent,t),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){o.lastMoveEvent=t,o.lastMoveEventInfo=es(e,o.transformPagePoint),Ko(t)&&0===t.buttons?o.handlePointerUp(t,e):Gr.update(o.updatePoint,!0)},this.handlePointerUp=function(t,e){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=os(es(e,o.transformPagePoint),o.history);o.startEvent&&i&&i(t,a),r&&r(t,a)},!(Jo(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=i;var r=es(oi(t),this.transformPagePoint),a=r.point,s=Hr().timestamp;this.history=[Object(an.a)(Object(an.a)({},a),{timestamp:s})];var l=e.onSessionStart;l&&l(t,os(r,this.history)),this.removeListeners=bi(li(window,"pointermove",this.handlePointerMove),li(window,"pointerup",this.handlePointerUp),li(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),jr.update(this.updatePoint)},t}();function es(t,e){return e?{point:e(t.point)}:t}function ns(t,e){return{x:t.x-e.x,y:t.y-e.y}}function os(t,e){var n=t.point;return{point:n,delta:ns(n,rs(e)),offset:ns(n,is(e)),velocity:as(e,.1)}}function is(t){return t[0]}function rs(t){return t[t.length-1]}function as(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,o=null,i=rs(t);n>=0&&(o=t[n],!(i.timestamp-o.timestamp>$r(e)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ss(t){return t}function ls(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}var cs={translate:0,scale:1,origin:0,originPoint:0};function us(){return{x:Object(an.a)({},cs),y:Object(an.a)({},cs)}}function ds(t){return[t("x"),t("y")]}function hs(t,e,n){var o=e.min,i=e.max;return void 0!==o&&t<o?t=n?Bi(o,t,n.min):Math.max(t,o):void 0!==i&&t>i&&(t=n?Bi(i,t,n.max):Math.min(t,i)),t}function ps(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 fs(t,e){var n,o=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&(o=(n=Object(an.c)([i,o],2))[0],i=n[1]),{min:t.min+o,max:t.min+i}}function ms(t,e,n){return{min:gs(t,e),max:gs(t,n)}}function gs(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function vs(t,e){return ls(function(t,e){var n=t.top,o=t.left,i=t.bottom,r=t.right;void 0===e&&(e=ss);var a=e({x:o,y:n}),s=e({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function As(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Ja(t,e)<n}function bs(t){return t.max-t.min}function ys(t,e){var n=.5,o=bs(t),i=bs(e);return i>o?n=Wi(e.min,e.max-o,t.min):o>i&&(n=Wi(t.min,t.max-i,e.min)),wi(0,1,n)}function Ss(t,e,n,o){void 0===o&&(o=.5),t.origin=o,t.originPoint=Bi(e.min,e.max,t.origin),t.scale=bs(n)/bs(e),As(t.scale,1,1e-4)&&(t.scale=1),t.translate=Bi(n.min,n.max,t.origin)-t.originPoint,As(t.translate)&&(t.translate=0)}function Cs(t,e,n,o){Ss(t.x,e.x,n.x,ws(o.originX)),Ss(t.y,e.y,n.y,ws(o.originY))}function ws(t){return"number"==typeof t?t:.5}function xs(t,e,n){t.min=n.min+e.min,t.max=t.min+bs(e)}var Es=function(t,e){return t.depth-e.depth};function Ls(t){return t.projection.isEnabled||t.shouldResetTransform()}function _s(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&_s(n,e),Ls(t)&&e.push(t),e}function Os(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:Object(an.a)({},e.x),y:Object(an.a)({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),Gr.update((function(){return t.rebaseProjectionTarget()}))}}function ks(t,e){return{min:e.min-t.min,max:e.max-t.min}}function Ts(t,e){return{x:ks(t.x,e.x),y:ks(t.y,e.y)}}function Ps(t,e){var n=t.getLayoutId(),o=e.getLayoutId();return n!==o||void 0===o&&t!==e}function Ws(t){var e=t.getProps(),n=e.drag,o=e._dragX;return n&&!o}function Bs(t,e){t.min=e.min,t.max=e.max}function Ds(t,e,n){return n+e*(t-n)}function Is(t,e,n,o,i){return void 0!==i&&(t=Ds(t,i,o)),Ds(t,n,o)+e}function Rs(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),t.min=Is(t.min,e,n,o,i),t.max=Is(t.max,e,n,o,i)}function Ms(t,e){var n=e.x,o=e.y;Rs(t.x,n.translate,n.scale,n.originPoint),Rs(t.y,o.translate,o.scale,o.originPoint)}function Fs(t,e,n,o){var i=Object(an.c)(o,3),r=i[0],a=i[1],s=i[2];t.min=e.min,t.max=e.max;var l=void 0!==n[s]?n[s]:.5,c=Bi(e.min,e.max,l);Rs(t,n[r],n[a],c,n.scale)}var js=["x","scaleX","originX"],Vs=["y","scaleY","originY"];function zs(t,e,n){Fs(t.x,e.x,n,js),Fs(t.y,e.y,n,Vs)}function Ns(t,e,n,o,i){return t=Ds(t-=e,1/n,o),void 0!==i&&(t=Ds(t,1/i,o)),t}function Us(t,e,n){var o=Object(an.c)(n,3),i=o[0],r=o[1],a=o[2];!function(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=Bi(t.min,t.max,o)-e;t.min=Ns(t.min,e,n,r,i),t.max=Ns(t.max,e,n,r,i)}(t,e[i],e[r],e[a],e.scale)}function Hs(t,e){Us(t.x,e,js),Us(t.y,e,Vs)}var Gs=new Set;function Ys(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function Xs(t){return Gs.add(t),function(){return Gs.delete(t)}}function Qs(){if(Gs.size){var t=0,e=[[]],n=[],o=function(n){return Ys(e,n,t)},i=function(e){Ys(n,e,t),t++};Gs.forEach((function(e){e(o,i),t=0})),Gs.clear();for(var r=n.length,a=0;a<=r;a++)e[a]&&e[a].forEach($s),n[a]&&n[a].forEach($s)}}var Zs,$s=function(t){return t()},qs=new WeakMap,Ks=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(),qs.set(e,this)}return t.prototype.start=function(t,e){var n=this,o=void 0===e?{}:e,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new ts(t,{onSessionStart:function(t){var e;n.stopMotion();var o=function(t){return oi(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=Xs((function(t,e){var i=_s(n.visualElement),s=function(t){var e=[],n=function(t){Ls(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Es)}(n.visualElement),l=Object(an.e)(Object(an.e)([],Object(an.c)(i)),Object(an.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){Os(n.visualElement),s.forEach(Os)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),r&&(c=n.snapToCursor(o))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;ds((function(e){if(!c){var i=t.target[e],r=i.min,s=i.max;n.cursorProgress[e]=a?a[e]:Wi(r,s,o[e])}var l=n.getAxisMotionValue(e);l&&(n.originPoint[e]=l.get())}))})),e((function(){Vr.update(),Vr.preRender(),Vr.render(),Vr.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=pi(s),n.openGlobalLock))&&(Qs(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,t,e),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(Xo.Drag,!0))},onMove:function(t,e){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=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}(u),void(null!==n.currentDirection&&(null===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,n.currentDirection)));n.updateAxis("x",e.point,u),n.updateAxis("y",e.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,t,e),Zs=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,o=e.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(En(n)?this.resolveRefConstraints(i,n):function(t,e){var n=e.top,o=e.left,i=e.bottom,r=e.right;return{x:ps(t.x,o,r),y:ps(t.y,n,i)}}(i,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:ms(t,"left","right"),y:ms(t,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&ds((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}(i[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=e.current;this.constraintsBox=vs(r,i);var a=function(t,e){return{x:fs(t.x,e.x),y:fs(t.y,e.y)}}(t,this.constraintsBox);if(o){var s=o(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=ls(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(Xo.Drag,!1)},t.prototype.stop=function(t,e){var n,o,i;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=e.velocity;this.animateDragEnd(a),null===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return ds((function(n){if(Js(n,e.props.drag,e.currentDirection)){var o=e.getAxisMotionValue(n);if(!o)return e.cursorProgress[n]=.5,!0;var i=e.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=t[n]-a;e.originPoint[n]=t[n],o.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Js(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 o=this.originPoint[t]+e[t],i=this.constraints?hs(o,this.constraints[t],this.elastic[t]):o;n.set(i)}},t.prototype.updateVisualElementAxis=function(t,e){var n,o=this.visualElement.getLayoutState().layout[t],i=o.max-o.min,r=this.cursorProgress[t],a=function(t,e,n,o,i){var r=t-e*n;return o?hs(r,o,i):r}(e[t],i,r,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+i)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,o=t.dragDirectionLock,i=void 0!==o&&o,r=t.dragPropagation,a=void 0!==r&&r,s=t.dragConstraints,l=void 0!==s&&s,c=t.dragElastic,u=void 0===c?.35:c,d=t.dragMomentum,h=void 0===d||d,p=Object(an.d)(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(an.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},p)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,o=e.layoutId,i="_drag"+t.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?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,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(t,e){void 0===e&&(e=!0);var n,o=t.getProjectionParent();return!!o&&(e?Hs(n=Ts(o.projection.target,t.projection.target),o.getLatestValues()):n=Ts(o.getLayoutState().layout,t.getLayoutState().layout),ds((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=Ts(c.projection.targetFinal,l);ds((function(t){var e=u[t],n=e.min,o=e.max;l[t]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=ds((function(n){var c;if(Js(n,o,e.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,p=Object(an.a)(Object(an.a)({type:"inertia",velocity:i?t[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,p):e.visualElement.startLayoutAnimation(n,p,s)}}));return Promise.all(d).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;ds((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 o=n.get();return n.set(o),n.set(o),Ea(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(En(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};ds((function(e){o[e]=ys(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){ds((function(e){if(Js(e,n,null)){var i=function(t,e,n){var o=t.max-t.min,i=Bi(e.min,e.max-o,n);return{min:i,max:i+o}}(t.visualElement.projection.target[e],t.constraintsBox[e],o[e]),r=i.min,a=i.max;t.visualElement.setProjectionTargetAxis(e,r,a)}}))})),setTimeout(Qs,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=Xs((function(n,o){var i=_s(e.visualElement);o((function(){return i.forEach((function(t){return t.resetTransform()}))})),n((function(){return Os(e.visualElement)})),o((function(){return i.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&o(t)}))},t.prototype.mount=function(t){var e=this,n=li(t.getInstance(),"pointerdown",(function(t){var n=e.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&e.start(t)})),o=$o(window,"resize",(function(){e.scalePoint()})),i=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),r=t.prevDragCursor;return r&&this.start(Zs,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),e.cancelDrag()}},t}();function Js(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var tl,el,nl={pan:yi((function(t){var e=t.onPan,n=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,r=t.visualElement,a=e||n||o||i,s=Object(se.useRef)(null),l=Object(se.useContext)(hn).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,o&&o(t,e)}};Object(se.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),ci(r,"pointerdown",a&&function(t){s.current=new ts(t,c,{transformPagePoint:l})}),vi((function(){return s.current&&s.current.end()}))})),drag:yi((function(t){var e=t.dragControls,n=t.visualElement,o=Object(se.useContext)(hn).transformPagePoint,i=mn((function(){return new Ks({visualElement:n})}));i.setProps(Object(an.a)(Object(an.a)({},t),{transformPagePoint:o})),Object(se.useEffect)((function(){return e&&e.subscribe(i)}),[i]),Object(se.useEffect)((function(){return i.mount(n)}),[])}))};function ol(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"}(tl||(tl={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(el||(el={}));var il=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function rl(t,e,n){void 0===n&&(n=1);var o=Object(an.c)(function(t){var e=il.exec(t);if(!e)return[,];var n=Object(an.c)(e,3);return[n[1],n[2]]}(t),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(e).getPropertyValue(i);return a?a.trim():ol(r)?rl(r,e,n+1):r}}function al(t,e){return t/(e.max-e.min)*100}var sl="_$css";var ll={process:function(t,e,n){var o=n.target;if("string"==typeof t){if(!ao.test(t))return t;t=parseFloat(t)}return al(t,o.x)+"% "+al(t,o.y)+"%"}},cl={borderRadius:Object(an.a)(Object(an.a)({},ll),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:ll,borderTopRightRadius:ll,borderBottomLeftRadius:ll,borderBottomRightRadius:ll,boxShadow:{process:function(t,e){var n=e.delta,o=e.treeScale,i=t,r=t.includes("var("),a=[];r&&(t=t.replace(il,(function(t){return a.push(t),sl})));var s=Ji.parse(t);if(s.length>5)return i;var l=Ji.createTransformer(t),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=Bi(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var p=l(s);if(r){var f=0;p=p.replace(sl,(function(){var t=a[f];return f++,t}))}return p}}},ul=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,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(an.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=e.props,h=d.visualElement,p=d.layout;if(!1===s)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===s){s&&(e.isAnimatingTree=!0),n=i||n,t=r||t;var f=!1,m=h.getProjectionParent();if(m){var g=m.prevViewportBox,v=m.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!Ps(c,m)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&gl(c,i,r)&&(f=!0,n=Ts(g,n),t=Ts(v,t))}var A=dl(n,t),b=ds((function(o){var i,r;if("position"===p){var s=t[o].max-t[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?A?e.animateAxis(o,t[o],n[o],Object(an.a)(Object(an.a)({},u),{isRelative:f})):(null===(r=(i=e.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,t[o].min,t[o].max,f)):void h.setVisibility(a===el.Show)}));return h.syncRender(),Promise.all(b).then((function(){e.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},e}return Object(an.b)(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=Ea,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},function(t){for(var e in t)Fn[e]=t[e]}(cl)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),ds((function(e){var n,o;return null===(o=(n=t.stopAxisAnimation)[e])||void 0===o?void 0:o.call(n)}))},e.prototype.animateAxis=function(t,e,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!fl(e,this.currentAnimationTarget[t])){null===(r=(i=this.stopAxisAnimation)[t])||void 0===r||r.call(i),this.isAnimating[t]=!0;var u=this.props.visualElement,d=this.frameTarget[t],h=u.getProjectionAnimationProgress()[t];h.clearListeners(),h.set(0),h.set(0);var p=function(){var o=h.get()/1e3;!function(t,e,n,o){t.min=Bi(e.min,n.min,o),t.max=Bi(e.max,n.max,o)}(d,n,e,o),u.setProjectionTargetAxis(t,d.min,d.max,c)};p();var f=h.onChange(p);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,h.stop(),f()},this.currentAnimationTarget[t]=e;var m=l||u.getDefaultTransition()||ml;return Ea("x"===t?"layoutX":"layoutY",h,1e3,m&&xa(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}(se.Component);function dl(t,e){return!(pl(t)||pl(e)||fl(t.x,e.x)&&fl(t.y,e.y))}var hl={min:0,max:0};function pl(t){return fl(t.x,hl)&&fl(t.y,hl)}function fl(t,e){return t.min===e.min&&t.max===e.max}var ml={duration:.45,ease:[.4,0,.1,1]};function gl(t,e,n){return t||!t&&!(e||n)}var vl={layoutReady:function(t){return t.notifyLayoutReady()}};function Al(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?vl:e,o=n.layoutReady,i=n.parent;Xs((function(e,n){var r=Array.from(t).sort(Es),a=i?_s(i):[];n((function(){Object(an.e)(Object(an.e)([],Object(an.c)(a)),Object(an.c)(r)).forEach((function(t){return t.resetTransform()}))})),e((function(){r.forEach(Os)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),r.forEach(o)})),e((function(){r.forEach((function(t){t.isPresent&&(t.presence=tl.Present)}))})),n((function(){Vr.preRender(),Vr.render()})),e((function(){Gr.postRender((function(){return r.forEach(bl)})),t.clear()}))})),Qs()}}}function bl(t){t.prevViewportBox=t.projection.target}var yl=Object(se.createContext)(Al()),Sl=Object(se.createContext)(Al());function Cl(t){return!!t.forceUpdate}var wl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(an.b)(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,o=t.visualElement;Cl(e)&&e.register(o),Cl(n)&&n.register(o),o.onUnmount((function(){Cl(e)&&e.remove(o),Cl(n)&&n.remove(o)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Cl(e)?e.syncUpdate():(!function(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Cl(t)||t.flush()},e.prototype.render=function(){return null},e}(se.default.Component);var xl={measureLayout:function(t){var e=Object(se.useContext)(yl),n=Object(se.useContext)(Sl);return se.default.createElement(wl,Object(an.a)({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=Object(an.c)(gn(),2)[1];return se.createElement(ul,Object(an.a)({},t,{safeToRemove:e}))}};function El(){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:us(),deltaFinal:us(),deltaTransform:""}}var Ll=El();function _l(t,e,n){var o=t.x,i=t.y,r="translate3d("+o.translate/e.x+"px, "+i.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==kl?r:""}function Ol(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var kl=_l(Ll.delta,Ll.treeScale,{x:1,y:1}),Tl=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Pl(t,e,n,o){var i,r,a=t.delta,s=t.layout,l=t.layoutCorrected,c=t.treeScale,u=e.target;r=s,Bs((i=l).x,r.x),Bs(i.y,r.y),function(t,e,n){var o=n.length;if(o){var i,r;e.x=e.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,e.x*=r.x.scale,e.y*=r.y.scale,Ms(t,r),Ws(i)&&zs(t,t,i.getLatestValues())}}(l,c,n),Cs(a,l,u,o)}var Wl=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){La(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){_a(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Es),this.isDirty=!1,this.children.forEach(t)},t}();var Bl=function(t){var e=t.treeType,n=void 0===e?"":e,o=t.build,i=t.getBaseTarget,r=t.makeTargetAnimatable,a=t.measureViewportBox,s=t.render,l=t.readValueFromInstance,c=t.resetTransform,u=t.restoreTransform,d=t.removeValueFromRenderState,h=t.sortNodePosition,p=t.scrapeMotionValuesFromProps;return function(t,e){var f=t.parent,m=t.props,g=t.presenceId,v=t.blockInitialAnimation,A=t.visualState;void 0===e&&(e={});var b,y,S,C,w,x,E=A.latestValues,L=A.renderState,_=function(){var t=Tl.map((function(){return new Oa})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return Tl.forEach((function(o){var i;null===(i=e[o])||void 0===i||i.call(e);var r="on"+o,a=t[r];a&&(e[o]=n[r](a))}))}};return t.forEach((function(t,e){n["on"+Tl[e]]=function(e){return t.add(e)},n["notify"+Tl[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,Object(an.e)([],Object(an.c)(e)))}})),n}(),O={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}}},k=O,T=E,P=El(),W=!1,B=new Map,D=new Map,I={},R=Object(an.a)({},E);function M(){b&&(Y.isProjectionReady()&&(zs(k.targetFinal,k.target,T),Cs(P.deltaFinal,P.layoutCorrected,k.targetFinal,E)),F(),s(b,L))}function F(){var t=E;if(C&&C.isActive()){var n=C.getCrossfadeState(Y);n&&(t=n)}o(Y,L,t,k,P,e,m)}function j(){_.notifyUpdate(E)}function V(){Y.layoutTree.forEach(Il)}var z=p(m);for(var N in z){var U=z[N];void 0!==E[N]&&Xn(U)&&U.set(E[N],!1)}var H=Tn(m),G=Pn(m),Y=Object(an.a)(Object(an.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(an.e)(Object(an.e)([],Object(an.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new Wl,presenceId:g,projection:O,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(t){b=Y.current=t,Y.pointTo(Y),G&&f&&!H&&(x=null==f?void 0:f.addVariantChild(Y)),null==f||f.children.add(Y)},unmount:function(){jr.update(j),jr.render(M),jr.preRender(Y.updateLayoutProjection),D.forEach((function(t){return t()})),Y.stopLayoutAnimation(),Y.layoutTree.remove(Y),null==x||x(),null==f||f.children.delete(Y),null==S||S(),_.clearAllListeners()},addVariantChild:function(t){var e,n=Y.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return h&&n===t.treeType?h(Y.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return G?Y:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return Gr.preRender(Y.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return m.layoutId},getInstance:function(){return b},getStaticValue:function(t){return E[t]},setStaticValue:function(t,e){return E[t]=e},getLatestValues:function(){return E},setVisibility:function(t){Y.isVisible!==t&&(Y.isVisible=t,Y.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),r(Y,t,m,e)},addValue:function(t,e){Y.hasValue(t)&&Y.removeValue(t),B.set(t,e),E[t]=e.get(),function(t,e){var n=e.onChange((function(e){E[t]=e,m.onUpdate&&Gr.update(j,!1,!0)})),o=e.onRenderRequest(Y.scheduleRender);D.set(t,(function(){n(),o()}))}(t,e)},removeValue:function(t){var e;B.delete(t),null===(e=D.get(t))||void 0===e||e(),D.delete(t),delete E[t],d(t,L)},hasValue:function(t){return B.has(t)},getValue:function(t,e){var n=B.get(t);return void 0===n&&void 0!==e&&(n=Ta(e),Y.addValue(t,n)),n},forEachValue:function(t){return B.forEach(t)},readValue:function(t){var n;return null!==(n=E[t])&&void 0!==n?n:l(b,t,e)},setBaseTarget:function(t,e){R[t]=e},getBaseTarget:function(t){if(i){var e=i(m,t);if(void 0!==e&&!Xn(e))return e}return R[t]}},_),{build:function(){return F(),L},scheduleRender:function(){Gr.render(M,!1,!0)},syncRender:M,setProps:function(t){m=t,_.updatePropListeners(t),I=function(t,e,n){var o;for(var i in e){var r=e[i],a=n[i];if(Xn(r))t.addValue(i,r);else if(Xn(a))t.addValue(i,Ta(r));else if(a!==r)if(t.hasValue(i)){var s=t.getValue(i);!s.hasAnimated&&s.set(r)}else t.addValue(i,Ta(null!==(o=t.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===e[i]&&t.removeValue(i);return e}(Y,p(m),I)},getProps:function(){return m},getVariant:function(t){var e;return null===(e=m.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return m.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==f?void 0:f.getVariantContext();if(!H){var e=(null==f?void 0:f.getVariantContext())||{};return void 0!==m.initial&&(e.initial=m.initial),e}for(var n={},o=0;o<Fl;o++){var i=Ml[o],r=m[i];(_n(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){O.isEnabled=!0,Y.layoutTree.add(Y)},lockProjectionTarget:function(){O.isTargetLocked=!0},unlockProjectionTarget:function(){Y.stopLayoutAnimation(),O.isTargetLocked=!1},getLayoutState:function(){return P},setCrossfader:function(t){C=t},isProjectionReady:function(){return O.isEnabled&&O.isHydrated&&P.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var o=Y.getProjectionAnimationProgress()[t],i=n?O.relativeTarget[t]:O.target[t],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(e){Y.setProjectionTargetAxis(t,e,e+a,n)})),Y.animateMotionValue(t,o,0,e)},stopLayoutAnimation:function(){ds((function(t){return Y.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=a(b,e);return t||Hs(n,E),n},getProjectionAnimationProgress:function(){return w||(w={x:Ta(0),y:Ta(0)}),w},setProjectionTargetAxis:function(t,e,n,o){var i;void 0===o&&(o=!1),o?(O.relativeTarget||(O.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=O.relativeTarget[t]):(O.relativeTarget=void 0,i=O.target[t]),O.isHydrated=!0,i.min=e,i.max=n,W=!0,_.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=P.layout);var n=Y.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(O.relativeTarget||O.isTargetLocked||o.isAnimating()||i.isAnimating());(t||r)&&ds((function(t){var n=e[t],o=n.min,i=n.max;Y.setProjectionTargetAxis(t,o,i)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=Ts(e.getLayoutState().layout,t.getLayoutState().layout);ds((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(Y),Y.notifyLayoutUpdate(P.layout,Y.prevViewportBox||P.layout,t)},resetTransform:function(){return c(Y,b,m)},restoreTransform:function(){return u(b,L)},updateLayoutProjection:function(){if(Y.isProjectionReady()){var t=P.delta,e=P.treeScale,n=e.x,o=e.y,i=P.deltaTransform;Pl(P,k,Y.path,E),W&&Y.notifyViewportBoxUpdate(k.target,t),W=!1;var r=_l(t,e);r===i&&n===e.x&&o===e.y||Y.scheduleRender(),P.deltaTransform=r}},updateTreeLayoutProjection:function(){Y.layoutTree.forEach(Dl),Gr.preRender(V,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var t=!1,e=Y.path.length-1;e>=0;e--){var n=Y.path[e];if(n.projection.isEnabled){t=n;break}}y=t}return y},resolveRelativeTargetBox:function(){var t=Y.getProjectionParent();if(O.relativeTarget&&t&&(function(t,e){xs(t.target.x,t.relativeTarget.x,e.target.x),xs(t.target.y,t.relativeTarget.y,e.target.y)}(O,t.projection),Ws(t))){var e=O.target;zs(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(t){k=t.projection,T=t.getLatestValues(),null==S||S(),S=bi(t.onSetAxisTarget(Y.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;Y.isPresent?Y.presence=tl.Present:null===(t=Y.layoutSafeToRemove)||void 0===t||t.call(Y)})))},isPresent:!0,presence:tl.Entering});return Y}};function Dl(t){t.resolveRelativeTargetBox()}function Il(t){t.updateLayoutProjection()}var Rl,Ml=Object(an.e)(["initial"],Object(an.c)(Ua)),Fl=Ml.length,jl=new Set(["width","height","top","left","right","bottom","x","y"]),Vl=function(t){return jl.has(t)},zl=function(t,e){t.set(e,!1),t.set(e)},Nl=function(t){return t===uo||t===ao};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Rl||(Rl={}));var Ul=function(t,e){return parseFloat(t.split(", ")[e])},Hl=function(t,e){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return Ul(r[1],e);var a=i.match(/^matrix\((.+)\)$/);return a?Ul(a[1],t):0}},Gl=new Set(["x","y","z"]),Yl=Vn.filter((function(t){return!Gl.has(t)}));var Xl={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,o=e.top;return parseFloat(o)+(n.max-n.min)},right:function(t,e){var n=t.x,o=e.left;return parseFloat(o)+(n.max-n.min)},x:Hl(4,13),y:Hl(5,14)},Ql=function(t,e,n,o){void 0===n&&(n={}),void 0===o&&(o={}),e=Object(an.a)({},e),o=Object(an.a)({},o);var i=Object.keys(e).filter(Vl),r=[],a=!1,s=[];if(i.forEach((function(i){var l=t.getValue(i);if(t.hasValue(i)){var c,u=n[i],d=e[i],h=Ba(u);if(zo(d))for(var p=d.length,f=null===d[0]?1:0;f<p;f++)c?Ba(d[f]):(c=Ba(d[f]))===h||Nl(h)&&Nl(c);else c=Ba(d);if(h!==c)if(Nl(h)&&Nl(c)){var m=l.get();"string"==typeof m&&l.set(parseFloat(m)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&c===ao&&(e[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):e[i]=h.transform(d):(a||(r=function(t){var e=[];return Yl.forEach((function(n){var o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:e[i],zl(l,d))}})),s.length){var l=function(t,e,n){var o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var l=e.measureViewportBox();return n.forEach((function(n){var i=e.getValue(n);zl(i,Xl[n](o,s)),t[n]=Xl[n](l,r)})),t}(e,t,s);return r.length&&r.forEach((function(e){var n=Object(an.c)(e,2),o=n[0],i=n[1];t.getValue(o).set(i)})),t.syncRender(),{target:l,transitionEnd:o}}return{target:e,transitionEnd:o}};function Zl(t,e,n,o){return function(t){return Object.keys(t).some(Vl)}(e)?Ql(t,e,n,o):{target:e,transitionEnd:o}}var $l=function(t,e,n,o){var i=function(t,e,n){var o,i=Object(an.d)(e,[]),r=t.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(an.a)({},n)),t.forEachValue((function(t){var e=t.get();if(ol(e)){var n=rl(e,r);n&&t.set(n)}})),i){var s=i[a];if(ol(s)){var l=rl(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(t,e,o);return Zl(t,e=i.target,n,o=i.transitionEnd)};var ql={treeType:"dom",readValueFromInstance:function(t,e){if(Un(e)){var n=va(e);return n&&n.default||0}var o,i=(o=t,window.getComputedStyle(o));return(Zn(e)?i.getPropertyValue(e):i[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 vs(t,e.transformPagePoint)},resetTransform:function(t,e,n){var o=n.transformTemplate;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,o=e.style;delete n[t],delete o[t]},makeTargetAnimatable:function(t,e,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=e.transition,a=e.transitionEnd,s=Object(an.d)(e,["transition","transitionEnd"]),l=function(t,e,n){var o,i,r={};for(var a in t)r[a]=null!==(o=Fa(a,e))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},t);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(t,e,n){var o,i,r,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=e[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:t.readValue(u))&&void 0!==i?i:e[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!Ia(h)&&Ji.test(d)&&(h=Aa(u,d)),t.addValue(u,Ta(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),t.setBaseTarget(u,h))}}(t,s,l);var c=$l(t,s,l,a);a=c.transitionEnd,s=c.target}return Object(an.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:Fo,build:function(t,e,n,o,i,r,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;go(e,n,o,i,r,a.transformTemplate,s?_l:void 0,s?Ol:void 0)},render:Io},Kl=Bl(ql),Jl=Bl(Object(an.a)(Object(an.a)({},ql),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return Un(e)?(null===(n=va(e))||void 0===n?void 0:n.default)||0:(e=Ro.has(e)?e:Do(e),t.getAttribute(e))},scrapeMotionValuesFromProps:jo,build:function(t,e,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;ko(e,n,o,i,r,a.transformTemplate,s?_l:void 0,s?Ol:void 0)},render:Mo})),tc=function(t,e){return Mn(t)?Jl(e,{enableHardwareAcceleration:!1}):Kl(e,{enableHardwareAcceleration:!0})},ec=Object(an.a)(Object(an.a)(Object(an.a)(Object(an.a)({},Za),Si),nl),xl),nc=In((function(t,e){return Zo(t,e,ec,tc)}));class oc{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}class ic{static now(){return Date.now()}}function rc(t){var e=mn((function(){return Ta(t)}));if(Object(se.useContext)(hn).isStatic){var n=Object(an.c)(Object(se.useState)(t),2)[1];Object(se.useEffect)((function(){return e.onChange(n)}),[])}return e}var ac=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function sc(t,e){var n=rc(e()),o=function(){return n.set(e())};return o(),function(t,e){Object(se.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return Gr.update(o,!1,!0)})),n}function lc(t,e,n,o){var i="function"==typeof e?e:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),o=n?0:-1,i=t[0+o],r=t[1+o],a=t[2+o],s=t[3+o],l=lr(r,a,Object(an.a)({mixer:ac(a[0])},s));return n?l(i):l}(e,n,o);return Array.isArray(t)?cc(t,i):cc([t],(function(t){var e=Object(an.c)(t,1)[0];return i(e)}))}function cc(t,e){var n=mn((function(){return[]}));return sc(t,(function(){n.length=0;for(var o=t.length,i=0;i<o;i++)n[i]=t[i].get();return e(n)}))}function uc(t,e,n){void 0===n&&(n={});var o=Xn(t)?t:Ta(t);return Ea("",o,e,n),{stop:function(){return o.stop()}}}var dc=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class hc extends se.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,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fill)&&void 0!==e?e:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.stroke)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,p=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,m=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return se.default.createElement(pc,{points:m,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:p,cornerRadius:f})}}function pc(t){var{points:e,cornerRadius:n}=t,o=dc(t,["points","cornerRadius"]);const i=[e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y],r=i.map(rc),a=lc(r,(([t,e,o,i,r,a,s,l])=>{const c=[{x:t,y:e},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return R.toSvgPathStringWithRoundedCorners(c,n)}));return Object(se.useEffect)((()=>{const t=[];for(let e=0;e<i.length;e++)t.push(uc(r[e],i[e]));return()=>{t.forEach((t=>t.stop()))}}),[e]),se.default.createElement(nc.path,Object.assign({d:a},o))}class fc extends se.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,o,i){const r=[];i.forEach((o=>{const i=new oc(o);i.points=void 0===t?R.scaleListToHtmlElement(o.points,n,e.video):o.points.map((e=>{const o=new R(e.x,e.y);return o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x,o})),r.push(i)}));const a=[];this.state.polygonElements.forEach((t=>{const e=r.find((e=>e.code.equals(t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<ic.now()&&(n=!0):(t.element=e,t.polygon=se.default.createElement(hc,{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=se.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{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=ic.now()),n||a.push(t)})),r.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>e.element.code.equals(t.code)))){let e,n;const o=se.default.createElement(hc,{key:t.code.id(),ref:o=>{e=o,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),i=se.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:t.code.id(),ref:o=>{n=o,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)})),r={element:t,polygon:o,label:i,polygonRef:e,labelRef:n,updatedAt:ic.now()};a.push(r)}})),this.setState({polygonElements:a})}onPolygonClick(t){var e,n,o,i;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const o=e.labelRef;o&&e.label.props.element.code.equals(t.code)&&(o.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonSelected)||void 0===n||n.call(e,t.code)),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,t.code)}render(){var t,e;return se.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style)},se.default.createElement(nc.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},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)))}}var mc=n(9),gc=n.n(mc),vc=n(12),Ac={insert:"head",singleton:!1},bc=(gc()(vc.a,Ac),vc.a.locals,n(6)),yc=n.n(bc);class Sc{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 o=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class Cc extends se.default.Component{constructor(){super(...arguments),this.inner1=new Sc("scanbot-shutter-rotate"),this.inner2=new Sc("scanbot-shutter-rotate")}render(){return se.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,se.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},se.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},se.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},se.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},se.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 se.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return se.default.createElement("div",{className:yc()(t),ref:n},se.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}class wc extends se.default.Component{render(){return se.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},se.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),se.default.createElement("g",{mask:"url(#mask0_919_23088)"},se.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"})))}}class xc extends se.default.Component{render(){return se.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},se.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),se.default.createElement("g",{mask:"url(#mask0_919_23102)"},se.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"})))}}class Ec extends se.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 se.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:on.ScanbotPrimary}},se.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},se.default.createElement(wc,null),se.default.createElement("div",{style:{backgroundColor:on.Orange,color:on.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)),se.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},se.default.createElement(Cc,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),se.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},se.default.createElement("div",{style:{fontSize:13,color:on.White,marginRight:10}},"Scan More"),se.default.createElement(xc,null)))}}class Lc extends se.default.Component{render(){const t=R.centerOf(this.props.points),e=R.smallerSizeOfQuad(this.props.points)/40;return se.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})`}},se.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},se.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),se.default.createElement("g",{mask:"url(#mask0_910_20901)"},se.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),se.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"})))}}class _c extends se.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:Ze.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const o=new oc(n);o.points=R.scaleListToHtmlElement(n.points,t.imageData,this.image),e.push(o)})),this.setState({imageSize:Ze.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:se.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}},se.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),se.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>se.default.createElement(Lc,{key:e,points:t.points})))))}}class Oc extends se.default.Component{render(){if(!this.props.visible)return null;const t=ze.a.svg`
31
+ `;var Ue=t=>se.default.createElement(Ne,{viewBox:"0 0 50 50"},se.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:t.color||"black"})),He=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ge{constructor(){this.videoReady=!1,this.sdkReady=!1}}class Ye extends se.default.Component{constructor(t){super(t),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.videoReady){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}},this.state=new Ge,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}get bridge(){return Ed.instance.bridge}dispose(){const{container:t}=this.props;t&&Object(se.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 He(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return He(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(Ve.mediaDeviceNotFound())}))}else e(Ve.enumerateDevicesFailed())}))}))}renderSpinner(t){return this.state.videoReady&&this.state.sdkReady?null:se.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},se.default.createElement(Ue,{color:t}))}setTorchState(t){return this.camera.setTorchState(t)}}Ye.DEFAULT_DETECTION_RESOLUTION=600,Ye.DETECTION_RESULTION_4K=3840;var Xe=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Qe extends se.default.Component{constructor(t){super(t),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){return Xe(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 Ve.enumerateDevicesFailed()}return t}))}componentDidMount(){return Xe(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,i,r,a,s;return Xe(this,void 0,void 0,(function*(){if(Ve.hasCheckedPermission()||(yield Ve.tryCheckPermission()),Ve.hasDeniedPermission())return void(null===(e=(t=this.props).onError)||void 0===e||e.call(t,Ve.permissionDenied()));const l={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const t=Ve.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,t),void console.log(t)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(l);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(t){const e=Ve.mediaDeviceNotFound();return null===(r=(i=this.props).onError)||void 0===r||r.call(i,e),void console.error(e)}}catch(t){let e=Ve.unknown(t.message);return t instanceof DOMException&&("NotAllowedError"===t.name?e=Ve.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===t.name&&(e=Ve.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."))),null===(s=(a=this.props).onError)||void 0===s||s.call(a,e),void console.error(e)}}))}stopCurrentStreams(){return Xe(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.orientationchangeCallback),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}))}render(){return this.props.children}updateTorch(t){return Xe(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();return Qe.getMediaTrackCapabilities(t)}}static getMediaTrackCapabilities(t){if(t&&t.getCapabilities)return t.getCapabilities()}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}class Ze{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 R(0,0),new R(t.width,0),new R(t.width,t.height),new R(0,t.height)]}static fromHtmlElement(t){return t?new Ze(t.clientWidth,t.clientHeight):new Ze(0,0)}static fromJson(t){return new Ze(t.width,t.height)}static subtractFrom(t,e){return new Ze(t.width-e,t.height-e)}static empty(){return new Ze(0,0)}}var $e=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class qe extends se.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 Ze(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){return $e(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);ae.debug("Bitmap size: "+e.width*e.height),n.canvas.width=e.width,n.canvas.height=e.height,n.drawImage(e,0,0,e.width,e.height);const o=this.windowSize(),i=e.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=e.width/2-r/2,l=o.y*i,c=new T(s,l,r,a);ae.debug("Frame size: "+c.x+"-"+c.y+"-"+c.width+"-"+c.height);return n.getImageData(c.x,c.y,c.width,c.height)}let{videoWidth:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new T(0,0,r,a),c=this.zoom(),u=(o-r/c)/2,d=(i-a/c)/2,h=l.x/s+u,p=l.y/s+d,f=this.finderFrame?s:c,m=l.width/f,g=l.height/f,v=this.calculateFrameSize(t,m,g);n.canvas.width=Math.round(v.width),n.canvas.height=Math.round(v.height),n.drawImage(this.video,h,p,m,g,0,0,n.canvas.width,n.canvas.height);const A=n.getImageData(0,0,this.canvas.width,this.canvas.height);return n.clearRect(0,0,this.canvas.width,this.canvas.height),A}))}drawVideoOnCanvasAndExtractFrameFromIt(t){return $e(this,void 0,void 0,(function*(){this.getCanvasRenderingContext(),this.video}))}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 T.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),o=t,i=e,r=1;return n.width/n.height<=t/e?(r=n.height/e,r>0&&(o=n.width/r)):(r=n.width/t,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(t,e,n){let o=e,i=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(o=e>t?t:e,i=o/r):(i=n>t?t:n,o=i*r)}return new Ze(o,i)}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(){var t;const e={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(t=this.props.configuration)||void 0===t?void 0:t.backgroundColor};return this.state.mirrored&&(e.transform="scaleX(-1)"),e}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return se.default.createElement(Qe,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},se.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}setDirection(t){this.props.videoConstraints.facingMode={ideal:t},this.setState({facingModeBack:"environment"===t,mirrored:"user"===t},(()=>$e(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}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},(()=>$e(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return $e(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},(()=>$e(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=>{var e;const n=t.label,o=t.getSettings().deviceId,i=t.getSettings().facingMode;let r="unknown";"user"===i?r="front":"environment"===i&&(r="back");return{deviceId:o,label:n,facingMode:r,supportsTorchControl:(null===(e=Qe.getMediaTrackCapabilities(t))||void 0===e?void 0:e.torch)||!1}}));this.activeCamera=t[0]}}getActiveCameraInfo(){return this.activeCamera}setTorchState(t){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:t}]})}return Promise.reject("Torch is not supported for current camera.")}}class Ke extends se.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(t){super(t),this.holePosition=T.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=t=>{var e,n,o,i;(null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)===(null===(n=t.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=t.padding)||void 0===i?void 0:i.minBottomPadding)&&this.props.configuration===t.configuration&&this.props.guidanceConfiguration===t.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var t;return null!==(t=this.holeCanvas.getBoundingClientRect())&&void 0!==t?t:new DOMRect},this.scaleForRetinaDisplay=t=>{if(window.devicePixelRatio>1){var e=t.width,n=t.height;t.width=e*window.devicePixelRatio,t.height=n*window.devicePixelRatio,t.style.width=e+"px",t.style.height=n+"px",t.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var t,e,n,o,i;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)&&void 0!==n?n:0),p=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>p?(this.holePosition.height=p,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(p-this.holePosition.height)/1.9;const f=this.holeCanvas.getContext("2d");f.save(),this.drawBackground(f),f.globalCompositeOperation="destination-out",this.drawHole();const m=this.crosshairCanvas.getContext("2d");m.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),f.restore(),m.restore()},this.drawBackground=t=>{const{width:e,height:n}=this.getVideoSize();t.clearRect(0,0,e,n),t.beginPath(),t.rect(0,0,e,n),t.fillStyle=pe.getColorValue(this.props.configuration.overlayColor),t.fill()},this.drawHole=()=>{const t=this.holeCanvas.getContext("2d"),e=this.cornerRadius(),n=this.holePosition.x,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;t.beginPath(),t.fillStyle="black",t.moveTo(n+e,o),t.arcTo(n+i,o,n+i,o+r,e),t.arcTo(n+i,o+r,n,o+r,e),t.arcTo(n,o+r,n,o,e),t.arcTo(n,o,n+i,o,e),t.closePath(),t.fill()},this.drawCrosshair=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;t.beginPath(),t.moveTo(e-10,n),t.lineTo(e+10,n),t.moveTo(e,n-10),t.lineTo(e,n+10),t.strokeStyle="white",t.fillStyle="white",t.lineWidth=1,t.stroke()},this.drawHoleCorners=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,r=15,a=this.style.strokeWidth,s=this.cornerRadius();t.beginPath(),t.moveTo(e,n+r),t.arcTo(e,n,e+o,n,s),t.lineTo(e+r,n),t.moveTo(e+o-r,n),t.arcTo(e+o,n,e+o,n+i,s),t.lineTo(e+o,n+r),t.moveTo(e+o,n+i-r),t.arcTo(e+o,n+i,e,n+i,s),t.lineTo(e+o-r,n+i),t.moveTo(e,n+i-r),t.arcTo(e,n+i,e+o,n+i,s),t.lineTo(e+r,n+i),t.strokeStyle=pe.getColorValue(this.style.strokeColor),t.lineWidth=a,t.stroke()},this.drawHoleOutline=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,r=this.cornerRadius(),a=this.style.strokeWidth;t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+o,n,e+o,n+i,r),t.moveTo(e+o,n+r),t.arcTo(e+o,n+i,e,n+i,r),t.moveTo(e+o-r,n+i),t.arcTo(e,n+i,e,n,r),t.moveTo(e,n+i-r),t.arcTo(e,n,e+o,n,r),t.strokeStyle=pe.getColorValue(this.style.strokeColor),t.lineWidth=a,t.stroke()},this.guidanceTextTopPadding=20,this.render=()=>se.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"},onClick:t=>{const e=this.holePosition;t.clientX>this.holePosition.x&&t.clientX<e.x+e.width&&t.clientY>e.y&&t.clientY<e.y+e.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},se.default.createElement("canvas",{ref:t=>{this.holeCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),se.default.createElement("canvas",{ref:t=>{this.crosshairCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&se.default.createElement("div",{ref:t=>{this.guidanceText=t},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},se.default.createElement(ve,{style:{display:"inline-block",backgroundColor:pe.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:pe.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var t,e;return this.holeRect.bottom()+(null!==(e=null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}class Je extends se.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return se.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},se.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},se.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},se.default.createElement("div",{style:{flex:1}},this.props.barcode.text),se.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),se.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}class tn extends se.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 se.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>se.default.createElement(Je,{key:e,barcode:t,onClick:this.props.onClick}))))}}class en{}en.ScanbotPrimary="#c8193c",en.LightGray="#F5F5F5",en.Gray="#808080",en.DarkGray="#333333",en.Orange="#FF5533",en.White="#FFFFFF",en.TransparentGreen="rgba(0, 255, 0, 0.5)",en.TransparentGray="rgba(50, 50, 50, 0.5)",en.TransparentBlack="rgba(0, 0, 0, 0.3)",en.SBNegative="#FF3737";var nn,on=en;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(nn||(nn={}));class rn extends se.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:nn.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===nn.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return se.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},se.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},se.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:on.ScanbotPrimary}},se.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},se.default.createElement("div",{style:{backgroundColor:on.White,height:3,width:33,borderRadius:5}})),se.default.createElement("div",{style:{display:"flex",height:50}},se.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:on.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),se.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:on.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"),se.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:on.White,justifyContent:"right",alignItems:"center",paddingRight:10}},se.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),se.default.createElement(tn,{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(nn.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===nn.Pop&&this.updateAnimationType(nn.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 o=ze.b`from {transform: ${e};} to {transform: ${n};}`;return ze.a.div`animation: ${o} 0.5s;`}from(t){if(t===nn.PushRight)return this.translate("X",100);if(t===nn.PushBottom)return this.translate("Y",100);if(t===nn.Pop){const t=this.pushType===nn.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===nn.PushRight)return this.translate("X",0);if(t===nn.PushBottom)return this.translate("Y",0);if(t===nn.Pop){const t=this.pushType===nn.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}var an=n(1),sn=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},ln={measureLayout:sn(["layout","layoutId","drag","_layoutResetTransform"]),animation:sn(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:sn(["exit"]),drag:sn(["drag","dragControls"]),focus:sn(["whileFocus"]),hover:sn(["whileHover","onHoverStart","onHoverEnd"]),tap:sn(["whileTap","onTap","onTapStart","onTapCancel"]),pan:sn(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:sn(["layout","layoutId"])};var cn=Object(se.createContext)({strict:!1}),un=Object.keys(ln),dn=un.length;var hn=Object(se.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),pn=Object(se.createContext)({});var fn=Object(se.createContext)(null);function mn(t){var e=Object(se.useRef)(null);return null===e.current&&(e.current=t()),e.current}function gn(){var t=Object(se.useContext)(fn);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,o=t.register,i=yn();Object(se.useEffect)((function(){return o(i)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function vn(t){return null===t||t.isPresent}var An=0,bn=function(){return An++},yn=function(){return mn(bn)},Sn=Object(se.createContext)(null),Cn="undefined"!=typeof window,wn=Cn?se.useLayoutEffect:se.useEffect;function xn(t,e,n,o){var i=Object(se.useContext)(hn),r=Object(se.useContext)(cn),a=Object(se.useContext)(pn).visualElement,s=Object(se.useContext)(fn),l=function(t){var e=t.layoutId,n=Object(se.useContext)(Sn);return n&&void 0!==e?n+"-"+e:e}(n),c=Object(se.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(t,{visualState:e,parent:a,props:Object(an.a)(Object(an.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return wn((function(){u&&(u.setProps(Object(an.a)(Object(an.a)(Object(an.a)({},i),n),{layoutId:l})),u.isPresent=vn(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(se.useEffect)((function(){var t;u&&(null===(t=u.animationState)||void 0===t||t.animateChanges())})),wn((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function En(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ln(t){return Array.isArray(t)}function _n(t){return"string"==typeof t||Ln(t)}function On(t,e,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e?e(null!=n?n:t.custom,o,i):e}function kn(t,e,n){var o=t.getProps();return On(o,e,null!=n?n:o.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 Tn(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||_n(t.initial)||_n(t.animate)||_n(t.whileHover)||_n(t.whileDrag)||_n(t.whileTap)||_n(t.whileFocus)||_n(t.exit)}function Pn(t){return Boolean(Tn(t)||t.variants)}function Wn(t,e){var n=function(t,e){if(Tn(t)){var n=t.initial,o=t.animate;return{initial:!1===n||_n(n)?n:void 0,animate:_n(o)?o:void 0}}return!1!==t.inherit?e:{}}(t,Object(se.useContext)(pn)),o=n.initial,i=n.animate;return Object(se.useMemo)((function(){return{initial:o,animate:i}}),e?[Bn(o),Bn(i)]:[])}function Bn(t){return Array.isArray(t)?t.join(" "):t}function Dn(t){var e=t.preloadedFeatures,n=t.createVisualElement,o=t.useRender,i=t.useVisualState,r=t.Component;return e&&function(t){for(var e in t){var n=t[e];null!==n&&(ln[e].Component=n)}}(e),Object(se.forwardRef)((function(t,e){var a=Object(se.useContext)(hn).isStatic,s=null,l=Wn(t,a),c=i(t,a);return!a&&Cn&&(l.visualElement=xn(r,c,t,n),s=function(t,e,n){var o=[];if(Object(se.useContext)(cn),!e)return null;for(var i=0;i<dn;i++){var r=un[i],a=ln[r],s=a.isEnabled,l=a.Component;s(t)&&l&&o.push(se.createElement(l,Object(an.a)({key:r},t,{visualElement:e})))}return o}(t,l.visualElement)),se.createElement(se.Fragment,null,se.createElement(pn.Provider,{value:l},o(r,t,function(t,e,n){return Object(se.useCallback)((function(o){var i;o&&(null===(i=t.mount)||void 0===i||i.call(t,o)),e&&(o?e.mount(o):e.unmount()),n&&("function"==typeof n?n(o):En(n)&&(n.current=o))}),[e])}(c,l.visualElement,e),c,a)),s)}))}function In(t){function e(e,n){return void 0===n&&(n={}),Dn(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,o){return n.has(o)||n.set(o,e(o)),n.get(o)}})}var Rn=["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 Mn(t){return"string"==typeof t&&!t.includes("-")&&!!(Rn.indexOf(t)>-1||/[A-Z]/.test(t))}var Fn={};var jn=["","X","Y","Z"],Vn=["transformPerspective","x","y","z"];function zn(t,e){return Vn.indexOf(t)-Vn.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return jn.forEach((function(e){return Vn.push(t+e)}))}));var Nn=new Set(Vn);function Un(t){return Nn.has(t)}var Hn=new Set(["originX","originY","originZ"]);function Gn(t){return Hn.has(t)}function Yn(t,e){var n=e.layout,o=e.layoutId;return Un(t)||Gn(t)||(n||void 0!==o)&&(!!Fn[t]||"opacity"===t)}var Xn=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},Qn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Zn(t){return t.startsWith("--")}var $n=function(t,e){return e&&"number"==typeof t?e.transform(t):t},qn=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},Kn=function(t){return t%1?Number(t.toFixed(5)):t},Jn=/(-)?([\d]*\.?[\d])+/g,to=/(#[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,eo=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function no(t){return"string"==typeof t}var oo=function(t){return{test:function(e){return no(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},io=oo("deg"),ro=oo("%"),ao=oo("px"),so=oo("vh"),lo=oo("vw"),co=Object(an.a)(Object(an.a)({},ro),{parse:function(t){return ro.parse(t)/100},transform:function(t){return ro.transform(100*t)}}),uo={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},ho=Object(an.a)(Object(an.a)({},uo),{transform:qn(0,1)}),po=Object(an.a)(Object(an.a)({},uo),{default:1}),fo=Object(an.a)(Object(an.a)({},uo),{transform:Math.round}),mo={borderWidth:ao,borderTopWidth:ao,borderRightWidth:ao,borderBottomWidth:ao,borderLeftWidth:ao,borderRadius:ao,radius:ao,borderTopLeftRadius:ao,borderTopRightRadius:ao,borderBottomRightRadius:ao,borderBottomLeftRadius:ao,width:ao,maxWidth:ao,height:ao,maxHeight:ao,size:ao,top:ao,right:ao,bottom:ao,left:ao,padding:ao,paddingTop:ao,paddingRight:ao,paddingBottom:ao,paddingLeft:ao,margin:ao,marginTop:ao,marginRight:ao,marginBottom:ao,marginLeft:ao,rotate:io,rotateX:io,rotateY:io,rotateZ:io,scale:po,scaleX:po,scaleY:po,scaleZ:po,skew:io,skewX:io,skewY:io,distance:ao,translateX:ao,translateY:ao,translateZ:ao,x:ao,y:ao,z:ao,perspective:ao,transformPerspective:ao,opacity:ho,originX:co,originY:co,originZ:ao,zIndex:fo,fillOpacity:ho,strokeOpacity:ho,numOctaves:fo};function go(t,e,n,o,i,r,a,s){var l,c=t.style,u=t.vars,d=t.transform,h=t.transformKeys,p=t.transformOrigin;h.length=0;var f=!1,m=!1,g=!0;for(var v in e){var A=e[v];if(Zn(v))u[v]=A;else{var b=mo[v],y=$n(A,b);if(Un(v)){if(f=!0,d[v]=y,h.push(v),!g)continue;A!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(Gn(v))p[v]=y,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&Fn[v]){var S=Fn[v].process(A,o,n),C=Fn[v].applyTo;if(C)for(var w=C.length,x=0;x<w;x++)c[C[x]]=S;else c[v]=S}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,f?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(f&&(c.transform=function(t,e,n,o){var i=t.transform,r=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,l=e.allowTransformNone,c=void 0===l||l,u="";r.sort(zn);for(var d=!1,h=r.length,p=0;p<h;p++){var f=r[p];u+=(Qn[f]||f)+"("+i[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(t,i,g,r)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,o=t.originY,i=void 0===o?"50%":o,r=t.originZ;return n+" "+i+" "+(void 0===r?0:r)}(p)))}var vo=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Ao(t,e,n){for(var o in e)Xn(e[o])||Yn(o,n)||(t[o]=e[o])}function bo(t,e,n){var o={};return Ao(o,t.style||{},t),Object.assign(o,function(t,e,n){var o=t.transformTemplate;return Object(se.useMemo)((function(){var t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};go(t,e,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=t.vars,r=t.style;return Object(an.a)(Object(an.a)({},i),r)}),[e])}(t,e,n)),t.transformValues&&(o=t.transformValues(o)),o}function yo(t,e,n){var o={},i=bo(t,e,n);return Boolean(t.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}var So=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 Co(t){return So.has(t)}var wo=function(t){return!Co(t)};try{var xo=n(21).default;wo=function(t){return t.startsWith("on")?!Co(t):xo(t)}}catch(t){}function Eo(t,e,n){return"string"==typeof t?t:ao.transform(e+n*t)}var Lo=function(t,e){return ao.transform(t*e)},_o={offset:"stroke-dashoffset",array:"stroke-dasharray"},Oo={offset:"strokeDashoffset",array:"strokeDasharray"};function ko(t,e,n,o,i,r,a,s){var l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,p=e.pathSpacing,f=void 0===p?1:p,m=e.pathOffset,g=void 0===m?0:m;go(t,Object(an.d)(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),t.attrs=t.style,t.style={};var v=t.attrs,A=t.style,b=t.dimensions,y=t.totalPathLength;v.transform&&(b&&(A.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||A.transform)&&(A.transformOrigin=function(t,e,n){return Eo(e,t.x,t.width)+" "+Eo(n,t.y,t.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(t,e,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?_o:Oo;t[a.offset]=Lo(-i,e);var s=Lo(n,e),l=Lo(o,e);t[a.array]=s+" "+l}(v,y,h,f,g,!1)}var To=function(){return Object(an.a)(Object(an.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Po(t,e){var n=Object(se.useMemo)((function(){var n=To();return ko(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Object(an.a)(Object(an.a)({},n.attrs),{style:Object(an.a)({},n.style)})}),[e]);if(t.style){var o={};Ao(o,t.style,t),n.style=Object(an.a)(Object(an.a)({},o),n.style)}return n}function Wo(t){void 0===t&&(t=!1);return function(e,n,o,i,r){var a=i.latestValues,s=(Mn(e)?Po:yo)(n,a,r),l=function(t,e,n){var o={};for(var i in t)(wo(i)||!0===n&&Co(i)||!e&&!Co(i))&&(o[i]=t[i]);return o}(n,"string"==typeof e,t),c=Object(an.a)(Object(an.a)(Object(an.a)({},l),s),{ref:o});return Object(se.createElement)(e,c)}}var Bo=/([a-z])([A-Z])/g,Do=function(t){return t.replace(Bo,"$1-$2").toLowerCase()};function Io(t,e){var n=e.style,o=e.vars;for(var i in Object.assign(t.style,n),o)t.style.setProperty(i,o[i])}var Ro=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function Mo(t,e){for(var n in Io(t,e),e.attrs)t.setAttribute(Ro.has(n)?n:Do(n),e.attrs[n])}function Fo(t){var e=t.style,n={};for(var o in e)(Xn(e[o])||Yn(o,t))&&(n[o]=e[o]);return n}function jo(t){var e=Fo(t);for(var n in t){if(Xn(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Vo(t){return"object"==typeof t&&"function"==typeof t.start}var zo=function(t){return Array.isArray(t)};function No(t){var e,n=Xn(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n}function Uo(t,e,n,o){var i=t.scrapeMotionValuesFromProps,r=t.createRenderState,a=t.onMount,s={latestValues:Go(e,n,o,i),renderState:r()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var Ho=function(t){return function(e,n){var o=Object(se.useContext)(pn),i=Object(se.useContext)(fn);return n?Uo(t,e,o,i):mn((function(){return Uo(t,e,o,i)}))}};function Go(t,e,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(t);for(var s in a)i[s]=No(a[s]);var l=t.initial,c=t.animate,u=Tn(t),d=Pn(t);e&&d&&!u&&!1!==t.inherit&&(null!=l||(l=e.initial),null!=c||(c=e.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!Vo(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=On(t,e);if(n){var o=n.transitionEnd;n.transition;var r=Object(an.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var Yo={useVisualState:Ho({scrapeMotionValuesFromProps:jo,createRenderState:To,onMount:function(t,e,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){o.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(o.totalPathLength=e.getTotalLength()),ko(o,i,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Mo(e,o)}})};var Xo,Qo={useVisualState:Ho({scrapeMotionValuesFromProps:Fo,createRenderState:vo})};function Zo(t,e,n,o){var i=e.forwardMotionProps,r=void 0!==i&&i,a=Mn(t)?Yo:Qo;return Object(an.a)(Object(an.a)({},a),{preloadedFeatures:n,useRender:Wo(r),createVisualElement:o,Component:t})}function $o(t,e,n,o){return t.addEventListener(e,n,o),function(){return t.removeEventListener(e,n,o)}}function qo(t,e,n,o){Object(se.useEffect)((function(){var i=t.current;if(n&&i)return $o(i,e,n,o)}),[t,e,n,o])}function Ko(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function Jo(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(Xo||(Xo={}));var ti={pageX:0,pageY:0};function ei(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||ti;return{x:n[e+"X"],y:n[e+"Y"]}}function ni(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function oi(t,e){return void 0===e&&(e="page"),{point:Jo(t)?ei(t,e):ni(t,e)}}var ii=function(t,e){void 0===e&&(e=!1);var n,o=function(e){return t(e,oi(e))};return e?(n=o,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):o},ri={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ai={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function si(t){return Cn&&null===window.onpointerdown?t:Cn&&null===window.ontouchstart?ai[t]:Cn&&null===window.onmousedown?ri[t]:t}function li(t,e,n,o){return $o(t,si(e),ii(n,"pointerdown"===e),o)}function ci(t,e,n,o){return qo(t,si(e),n&&ii(n,"pointerdown"===e),o)}function ui(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var di=ui("dragHorizontal"),hi=ui("dragVertical");function pi(t){var e=!1;if("y"===t)e=hi();else if("x"===t)e=di();else{var n=di(),o=hi();n&&o?e=function(){n(),o()}:(n&&n(),o&&o())}return e}function fi(){var t=pi(!0);return!t||(t(),!1)}function mi(t,e,n){return function(o,i){var r;Ko(o)&&!fi()&&(null==n||n(o,i),null===(r=t.animationState)||void 0===r||r.setActive(Xo.Hover,e))}}var gi=function(t,e){return!!e&&(t===e||gi(t,e.parentElement))};function vi(t){return Object(se.useEffect)((function(){return function(){return t()}}),[])}var Ai=function(t,e){return function(n){return e(t(n))}},bi=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Ai)};var yi=function(t){return function(e){return t(e),null}},Si={tap:yi((function(t){var e=t.onTap,n=t.onTapStart,o=t.onTapCancel,i=t.whileTap,r=t.visualElement,a=e||n||o||i,s=Object(se.useRef)(!1),l=Object(se.useRef)(null);function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function u(){var t;return c(),s.current=!1,null===(t=r.animationState)||void 0===t||t.setActive(Xo.Tap,!1),!fi()}function d(t,n){u()&&(gi(r.getInstance(),t.target)?null==e||e(t,n):null==o||o(t,n))}function h(t,e){u()&&(null==o||o(t,e))}ci(r,"pointerdown",a?function(t,e){var o;c(),s.current||(s.current=!0,l.current=bi(li(window,"pointerup",d),li(window,"pointercancel",h)),null==n||n(t,e),null===(o=r.animationState)||void 0===o||o.setActive(Xo.Tap,!0))}:void 0),vi(c)})),focus:yi((function(t){var e=t.whileFocus,n=t.visualElement;qo(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(Xo.Focus,!0)}:void 0),qo(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(Xo.Focus,!1)}:void 0)})),hover:yi((function(t){var e=t.onHoverStart,n=t.onHoverEnd,o=t.whileHover,i=t.visualElement;ci(i,"pointerenter",e||o?mi(i,!0,e):void 0),ci(i,"pointerleave",n||o?mi(i,!1,n):void 0)}))};function Ci(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}var wi=function(t,e,n){return Math.min(Math.max(n,t),e)},xi=.001;function Ei(t){var e,n,o=t.duration,i=void 0===o?800:o,r=t.bounce,a=void 0===r?.25:r,s=t.velocity,l=void 0===s?0:s,c=t.mass,u=void 0===c?1:c,d=1-a;d=wi(.05,1,d),i=wi(.01,10,i/1e3),d<1?(e=function(t){var e=t*d,n=e*i,o=e-l,r=Li(t,d),a=Math.exp(-n);return xi-o/r*a},n=function(t){var n=t*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(t,2)*i,a=Math.exp(-n),s=Li(Math.pow(t,2),d);return(-e(t)+xi>0?-1:1)*((o-r)*a)/s}):(e=function(t){return Math.exp(-t*i)*((t-l)*i+1)-.001},n=function(t){return Math.exp(-t*i)*(i*i*(l-t))});var h=function(t,e,n){for(var o=n,i=1;i<12;i++)o-=t(o)/e(o);return o}(e,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var p=Math.pow(h,2)*u;return{stiffness:p,damping:2*d*Math.sqrt(u*p),duration:i}}function Li(t,e){return t*Math.sqrt(1-e*e)}var _i=["duration","bounce"],Oi=["stiffness","damping","mass"];function ki(t,e){return e.some((function(e){return void 0!==t[e]}))}function Ti(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.restSpeed,a=void 0===r?2:r,s=t.restDelta,l=Object(an.d)(t,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(t){var e=Object(an.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ki(t,Oi)&&ki(t,_i)){var n=Ei(t);(e=Object(an.a)(Object(an.a)(Object(an.a)({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),d=u.stiffness,h=u.damping,p=u.mass,f=u.velocity,m=u.duration,g=u.isResolvedFromDuration,v=Pi,A=Pi;function b(){var t=f?-f/1e3:0,e=i-n,o=h/(2*Math.sqrt(d*p)),r=Math.sqrt(d/p)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=Li(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((t+o*r*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},A=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(t+o*r*e)/a+e*Math.cos(a*n))-i*(Math.cos(a*n)*(t+o*r*e)-a*e*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(e+(t+r*e)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((t+o*r*e)*Math.sinh(s)+l*e*Math.cosh(s))/l}}}return b(),{next:function(t){var e=v(t);if(g)c.done=t>=m;else{var n=1e3*A(t),o=Math.abs(n)<=a,r=Math.abs(i-e)<=s;c.done=o&&r}return c.value=c.done?i:e,c},flipTarget:function(){var t;f=-f,n=(t=[i,n])[0],i=t[1],b()}}}Ti.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var Pi=function(t){return 0},Wi=function(t,e,n){var o=e-t;return 0===o?1:(n-t)/o},Bi=function(t,e,n){return-n*t+n*e+t},Di=function(t,e){return function(n){return Boolean(no(n)&&eo.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Ii=function(t,e,n){return function(o){var i;if(!no(o))return o;var r=o.match(Jn),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[t]=parseFloat(a),i[e]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},Ri=qn(0,255),Mi=Object(an.a)(Object(an.a)({},uo),{transform:function(t){return Math.round(Ri(t))}}),Fi={test:Di("rgb","red"),parse:Ii("red","green","blue"),transform:function(t){var e=t.red,n=t.green,o=t.blue,i=t.alpha,r=void 0===i?1:i;return"rgba("+Mi.transform(e)+", "+Mi.transform(n)+", "+Mi.transform(o)+", "+Kn(ho.transform(r))+")"}};var ji={test:Di("#"),parse:function(t){var e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:Fi.transform},Vi={test:Di("hsl","hue"),parse:Ii("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,o=t.lightness,i=t.alpha,r=void 0===i?1:i;return"hsla("+Math.round(e)+", "+ro.transform(Kn(n))+", "+ro.transform(Kn(o))+", "+Kn(ho.transform(r))+")"}},zi=function(t,e,n){var o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},Ni=[ji,Fi,Vi],Ui=function(t){return Ni.find((function(e){return e.test(t)}))},Hi=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},Gi=function(t,e){var n=Ui(t),o=Ui(e);Hi(t),Hi(e),n.transform,o.transform;var i=n.parse(t),r=o.parse(e),a=Object(an.a)({},i),s=n===Vi?Bi:zi;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(i[e],r[e],t));return a.alpha=Bi(i.alpha,r.alpha,t),n.transform(a)}},Yi={test:function(t){return Fi.test(t)||ji.test(t)||Vi.test(t)},parse:function(t){return Fi.test(t)?Fi.parse(t):Vi.test(t)?Vi.parse(t):ji.parse(t)},transform:function(t){return no(t)?t:t.hasOwnProperty("red")?Fi.transform(t):Vi.transform(t)}},Xi="${c}",Qi="${n}";function Zi(t){var e=[],n=0,o=t.match(to);o&&(n=o.length,t=t.replace(to,Xi),e.push.apply(e,o.map(Yi.parse)));var i=t.match(Jn);return i&&(t=t.replace(Jn,Qi),e.push.apply(e,i.map(uo.parse))),{values:e,numColors:n,tokenised:t}}function $i(t){return Zi(t).values}function qi(t){var e=Zi(t),n=e.values,o=e.numColors,i=e.tokenised,r=n.length;return function(t){for(var e=i,n=0;n<r;n++)e=e.replace(n<o?Xi:Qi,n<o?Yi.transform(t[n]):Kn(t[n]));return e}}var Ki=function(t){return"number"==typeof t?0:t};var Ji={test:function(t){var e,n,o,i;return isNaN(t)&&no(t)&&(null!==(n=null===(e=t.match(Jn))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(to))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:$i,createTransformer:qi,getAnimatableNone:function(t){var e=$i(t);return qi(t)(e.map(Ki))}},tr=function(t){return"number"==typeof t};function er(t,e){return tr(t)?function(n){return Bi(t,e,n)}:Yi.test(t)?Gi(t,e):rr(t,e)}var nr=function(t,e){var n=Object(an.e)([],t),o=n.length,i=t.map((function(t,n){return er(t,e[n])}));return function(t){for(var e=0;e<o;e++)n[e]=i[e](t);return n}},or=function(t,e){var n=Object(an.a)(Object(an.a)({},t),e),o={};for(var i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=er(t[i],e[i]));return function(t){for(var e in o)n[e]=o[e](t);return n}};function ir(t){for(var e=Ji.parse(t),n=e.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof e[a]?o++:void 0!==e[a].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}var rr=function(t,e){var n=Ji.createTransformer(e),o=ir(t),i=ir(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),bi(nr(o.parsed,i.parsed),n)},ar=function(t,e){return function(n){return Bi(t,e,n)}};function sr(t,e,n){for(var o,i=[],r=n||("number"==typeof(o=t[0])?ar:"string"==typeof o?Yi.test(o)?Gi:rr:Array.isArray(o)?nr:"object"==typeof o?or:void 0),a=t.length-1,s=0;s<a;s++){var l=r(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;l=bi(c,l)}i.push(l)}return i}function lr(t,e,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[l-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=sr(e,a,s),u=2===l?function(t,e){var n=t[0],o=t[1],i=e[0];return function(t){return i(Wi(n,o,t))}}(t,c):function(t,e){var n=t.length,o=n-1;return function(i){var r=0,a=!1;if(i<=t[0]?a=!0:i>=t[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>i||s===o);s++);r=s-1}var l=Wi(t[r],t[r+1],i);return e[r](l)}}(t,c);return r?function(e){return u(wi(t[0],t[l-1],e))}:u}var cr,ur=function(t){return function(e){return 1-t(1-e)}},dr=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},hr=function(t){return function(e){return e*e*((t+1)*e-t)}},pr=function(t){return t},fr=(cr=2,function(t){return Math.pow(t,cr)}),mr=ur(fr),gr=dr(fr),vr=function(t){return 1-Math.sin(Math.acos(t))},Ar=ur(vr),br=dr(Ar),yr=hr(1.525),Sr=ur(yr),Cr=dr(yr),wr=function(t){var e=hr(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),xr=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},Er=ur(xr);function Lr(t,e){return t.map((function(){return e||gr})).splice(0,t.length-1)}function _r(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.ease,a=t.offset,s=t.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===u.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(u),l);function h(){return lr(d,u,{ease:Array.isArray(r)?r:Lr(u,r)})}var p=h();return{next:function(t){return c.value=p(t),c.done=t>=l,c},flipTarget:function(){u.reverse(),p=h()}}}var Or={keyframes:_r,spring:Ti,decay:function(t){var e=t.velocity,n=void 0===e?0:e,o=t.from,i=void 0===o?0:o,r=t.power,a=void 0===r?.8:r,s=t.timeConstant,l=void 0===s?350:s,c=t.restDelta,u=void 0===c?.5:c,d=t.modifyTarget,h={done:!1,value:i},p=a*n,f=i+p,m=void 0===d?f:d(f);return m!==f&&(p=m-i),{next:function(t){var e=-p*Math.exp(-t/l);return h.done=!(e>u||e<-u),h.value=h.done?m:m+e,h},flipTarget:function(){}}}};var kr=1/60*1e3,Tr="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Pr="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(Tr())}),kr)};var Wr=!0,Br=!1,Dr=!1,Ir={delta:0,timestamp:0},Rr=["read","update","preRender","render","postRender"],Mr=Rr.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?e:n;return a&&r.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:function(s){var l;if(i=!0,e=(l=[n,e])[0],(n=l[1]).length=0,o=e.length)for(var c=0;c<o;c++){var u=e[c];u(s),r.has(u)&&(a.schedule(u),t())}i=!1}};return a}((function(){return Br=!0})),t}),{}),Fr=Rr.reduce((function(t,e){var n=Mr[e];return t[e]=function(t,e,o){return void 0===e&&(e=!1),void 0===o&&(o=!1),Br||Ur(),n.schedule(t,e,o)},t}),{}),jr=Rr.reduce((function(t,e){return t[e]=Mr[e].cancel,t}),{}),Vr=Rr.reduce((function(t,e){return t[e]=function(){return Mr[e].process(Ir)},t}),{}),zr=function(t){return Mr[t].process(Ir)},Nr=function(t){Br=!1,Ir.delta=Wr?kr:Math.max(Math.min(t-Ir.timestamp,40),1),Ir.timestamp=t,Dr=!0,Rr.forEach(zr),Dr=!1,Br&&(Wr=!1,Pr(Nr))},Ur=function(){Br=!0,Wr=!0,Dr||Pr(Nr)},Hr=function(){return Ir},Gr=Fr;function Yr(t,e,n){return void 0===n&&(n=0),t-e-n}var Xr=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return Gr.update(e,!0)},stop:function(){return jr.update(e)}}};function Qr(t){var e,n,o,i,r,a=t.from,s=t.autoplay,l=void 0===s||s,c=t.driver,u=void 0===c?Xr:c,d=t.elapsed,h=void 0===d?0:d,p=t.repeat,f=void 0===p?0:p,m=t.repeatType,g=void 0===m?"loop":m,v=t.repeatDelay,A=void 0===v?0:v,b=t.onPlay,y=t.onStop,S=t.onComplete,C=t.onRepeat,w=t.onUpdate,x=Object(an.d)(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),E=x.to,L=0,_=x.duration,O=!1,k=!0,T=function(t){if(Array.isArray(t.to))return _r;if(Or[t.type])return Or[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_r:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ti:_r}(x);(null===(n=(e=T).needsInterpolation)||void 0===n?void 0:n.call(e,a,E))&&(r=lr([0,100],[a,E],{clamp:!1}),a=0,E=100);var P=T(Object(an.a)(Object(an.a)({},x),{from:a,to:E}));function W(){L++,"reverse"===g?h=function(t,e,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?Yr(e+-t,e,n):e-(t-e)+n}(h,_,A,k=L%2==0):(h=Yr(h,_,A),"mirror"===g&&P.flipTarget()),O=!1,C&&C()}function B(t){if(k||(t=-t),h+=t,!O){var e=P.next(Math.max(0,h));i=e.value,r&&(i=r(i)),O=k?e.done:h<=0}null==w||w(i),O&&(0===L&&(null!=_||(_=h)),L<f?function(t,e,n,o){return o?t>=e+n:t<=-n}(h,_,A,k)&&W():(o.stop(),S&&S()))}return l&&(null==b||b(),(o=u(B)).start()),{stop:function(){null==y||y(),o.stop()}}}function Zr(t,e){return e?t*(1e3/e):0}var $r=function(t){return 1e3*t},qr=function(t,e){return 1-3*e+3*t},Kr=function(t,e){return 3*e-6*t},Jr=function(t){return 3*t},ta=function(t,e,n){return((qr(e,n)*t+Kr(e,n))*t+Jr(e))*t},ea=function(t,e,n){return 3*qr(e,n)*t*t+2*Kr(e,n)*t+Jr(e)};var na=.1;function oa(t,e,n,o){if(t===e&&n===o)return pr;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=ta(r*na,t,n);function a(e){for(var o=0,r=1;10!==r&&i[r]<=e;++r)o+=na;--r;var a=o+(e-i[r])/(i[r+1]-i[r])*na,s=ea(a,t,n);return s>=.001?function(t,e,n,o){for(var i=0;i<8;++i){var r=ea(e,n,o);if(0===r)return e;e-=(ta(e,n,o)-t)/r}return e}(e,a,t,n):0===s?a:function(t,e,n,o,i){var r,a,s=0;do{(r=ta(a=e+(n-e)/2,o,i)-t)>0?n=a:e=a}while(Math.abs(r)>1e-7&&++s<10);return a}(e,o,o+na,t,n)}return function(t){return 0===t||1===t?t:ta(a(t),e,o)}}var ia={linear:pr,easeIn:fr,easeInOut:gr,easeOut:mr,circIn:vr,circInOut:br,circOut:Ar,backIn:yr,backInOut:Cr,backOut:Sr,anticipate:wr,bounceIn:Er,bounceInOut:function(t){return t<.5?.5*(1-xr(1-2*t)):.5*xr(2*t-1)+.5},bounceOut:xr},ra=function(t){if(Array.isArray(t)){t.length;var e=Object(an.c)(t,4);return oa(e[0],e[1],e[2],e[3])}return"string"==typeof t?ia[t]:t},aa=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ji.test(e)||e.startsWith("url(")))},sa=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},la=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},ca=function(){return{type:"keyframes",ease:"linear",duration:.3}},ua=function(t){return{type:"keyframes",duration:.8,values:t}},da={x:sa,y:sa,z:sa,rotate:sa,rotateX:sa,rotateY:sa,rotateZ:sa,scaleX:la,scaleY:la,scale:la,opacity:ca,backgroundColor:ca,color:ca,default:la},ha=new Set(["brightness","contrast","saturate","opacity"]);function pa(t){var e=t.slice(0,-1).split("("),n=e[0],o=e[1];if("drop-shadow"===n)return t;var i=(o.match(Jn)||[])[0];if(!i)return t;var r=o.replace(i,""),a=ha.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var fa=/([a-z-]*)\(.*?\)/g,ma=Object(an.a)(Object(an.a)({},Ji),{getAnimatableNone:function(t){var e=t.match(fa);return e?e.map(pa).join(" "):t}}),ga=Object(an.a)(Object(an.a)({},mo),{color:Yi,backgroundColor:Yi,outlineColor:Yi,fill:Yi,stroke:Yi,borderColor:Yi,borderTopColor:Yi,borderRightColor:Yi,borderBottomColor:Yi,borderLeftColor:Yi,filter:ma,WebkitFilter:ma}),va=function(t){return ga[t]};function Aa(t,e){var n,o=va(t);return o!==ma&&(o=Ji),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}function ba(t){var e=t.ease,n=t.times,o=t.yoyo,i=t.flip,r=t.loop,a=Object(an.d)(t,["ease","times","yoyo","flip","loop"]),s=Object(an.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=$r(a.duration)),a.repeatDelay&&(s.repeatDelay=$r(a.repeatDelay)),e&&(s.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(ra):ra(e)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function ya(t,e,n){var o,i,r,a;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=Object(an.e)([],Object(an.c)(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=Object(an.d)(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object(an.a)(Object(an.a)({},t),(i=n,r=e.to,a=zo(r)?ua:da[i]||da.default,Object(an.a)({to:r},a(r))))),Object(an.a)(Object(an.a)({},e),ba(t))}function Sa(t,e,n,o,i){var r,a=xa(o,t),s=null!==(r=a.from)&&void 0!==r?r:e.get(),l=aa(t,n);"none"===s&&l&&"string"==typeof n?s=Aa(t,n):Ca(s)&&"string"==typeof n?s=wa(n):!Array.isArray(n)&&Ca(n)&&"string"==typeof s&&(n=wa(s));var c=aa(t,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:function(t){return e.set(t)}};return"inertia"===a.type||"decay"===a.type?function(t){var e,n=t.from,o=void 0===n?0:n,i=t.velocity,r=void 0===i?0:i,a=t.min,s=t.max,l=t.power,c=void 0===l?.8:l,u=t.timeConstant,d=void 0===u?750:u,h=t.bounceStiffness,p=void 0===h?500:h,f=t.bounceDamping,m=void 0===f?10:f,g=t.restDelta,v=void 0===g?1:g,A=t.modifyTarget,b=t.driver,y=t.onUpdate,S=t.onComplete;function C(t){return void 0!==a&&t<a||void 0!==s&&t>s}function w(t){return void 0===a?s:void 0===s||Math.abs(a-t)<Math.abs(s-t)?a:s}function x(t){null==e||e.stop(),e=Qr(Object(an.a)(Object(an.a)({},t),{driver:b,onUpdate:function(e){var n;null==y||y(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:S}))}function E(t){x(Object(an.a)({type:"spring",stiffness:p,damping:m,restDelta:v},t))}if(C(o))E({from:o,velocity:r,to:w(o)});else{var L=c*r+o;"undefined"!=typeof A&&(L=A(L));var _,O,k=w(L),T=k===a?-1:1;x({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:A,onUpdate:C(L)?function(t){_=O,O=t,r=Zr(t-_,Hr().delta),(1===T&&t>k||-1===T&&t<k)&&E({from:t,to:k,velocity:r})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(Object(an.a)(Object(an.a)({},o),a)):Qr(Object(an.a)(Object(an.a)({},ya(a,o,t)),{onUpdate:function(t){var e;o.onUpdate(t),null===(e=a.onUpdate)||void 0===e||e.call(a,t)},onComplete:function(){var t;o.onComplete(),null===(t=a.onComplete)||void 0===t||t.call(a)}}))}:function(){var t;return e.set(n),i(),null===(t=null==a?void 0:a.onComplete)||void 0===t||t.call(a),{stop:function(){}}}}function Ca(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function wa(t){return"number"==typeof t?0:Aa("",t)}function xa(t,e){return t[e]||t.default||t}function Ea(t,e,n,o){return void 0===o&&(o={}),e.start((function(i){var r,a,s=Sa(t,e,n,o,i),l=function(t,e){var n;return null!==(n=(xa(t,e)||{}).delay)&&void 0!==n?n:0}(o,t),c=function(){return a=s()};return l?r=setTimeout(c,$r(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function La(t,e){-1===t.indexOf(e)&&t.push(e)}function _a(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Oa=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return La(this.subscriptions,t),function(){return _a(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),ka=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Oa,this.velocityUpdateSubscribers=new Oa,this.renderSubscribers=new Oa,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var o=Hr(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,Gr.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 Gr.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?Zr(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 Ta(t){return new ka(t)}var Pa=function(t){return function(e){return e.test(t)}},Wa=[uo,ao,ro,io,lo,so,{test:function(t){return"auto"===t},parse:function(t){return t}}],Ba=function(t){return Wa.find(Pa(t))},Da=Object(an.e)(Object(an.e)([],Object(an.c)(Wa)),[Yi,Ji]),Ia=function(t){return Da.find(Pa(t))};function Ra(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ta(n))}function Ma(t,e){var n=kn(t,e),o=n?t.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(an.d)(o,["transitionEnd","transition"]);for(var l in s=Object(an.a)(Object(an.a)({},s),r)){Ra(t,l,(a=s[l],zo(a)?a[a.length-1]||0:a))}}function Fa(t,e){if(e)return(e[t]||e.default||e).from}function ja(t,e,n){var o;void 0===n&&(n={});var i=kn(t,e,n.custom),r=(i||{}).transition,a=void 0===r?t.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return Va(t,i,n)}:function(){return Promise.resolve()},l=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(t,e,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(t.variantChildren.size-1)*o,l=1===i?function(t){return void 0===t&&(t=0),t*o}:function(t){return void 0===t&&(t=0),s-t*o};return Array.from(t.variantChildren).sort(za).forEach((function(t,o){a.push(ja(t,e,Object(an.a)(Object(an.a)({},r),{delay:n+l(o)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(a)}(t,e,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(an.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function Va(t,e,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=t.makeTargetAnimatable(e),u=c.transition,d=void 0===u?t.getDefaultTransition():u,h=c.transitionEnd,p=Object(an.d)(c,["transition","transitionEnd"]);s&&(d=s);var f=[],m=l&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in p){var v=t.getValue(g),A=p[g];if(!(!v||void 0===A||m&&Na(m,g))){var b=Ea(g,v,A,Object(an.a)({delay:a},d));f.push(b)}}return Promise.all(f).then((function(){h&&Ma(t,h)}))}function za(t,e){return t.sortNodePosition(e)}function Na(t,e){var n=t.protectedKeys,o=t.needsAnimating,i=n.hasOwnProperty(e)&&!0!==o[e];return o[e]=!1,i}var Ua=[Xo.Animate,Xo.Hover,Xo.Tap,Xo.Drag,Xo.Focus,Xo.Exit],Ha=Object(an.e)([],Object(an.c)(Ua)).reverse(),Ga=Ua.length;function Ya(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,o=e.options;return function(t,e,n){var o;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var i=e.map((function(e){return ja(t,e,n)}));o=Promise.all(i)}else if("string"==typeof e)o=ja(t,e,n);else{var r="function"==typeof e?kn(t,e,n.custom):e;o=Va(t,r,n)}return o.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,o)})))}}function Xa(t){var e,n=Ya(t),o=((e={})[Xo.Animate]=Qa(!0),e[Xo.Hover]=Qa(),e[Xo.Tap]=Qa(),e[Xo.Drag]=Qa(),e[Xo.Focus]=Qa(),e[Xo.Exit]=Qa(),e),i={},r=!0,a=function(e,n){var o=kn(t,n);if(o){o.transition;var i=o.transitionEnd,r=Object(an.d)(o,["transition","transitionEnd"]);e=Object(an.a)(Object(an.a)(Object(an.a)({},e),r),i)}return e};function s(e,s){for(var l,c=t.getProps(),u=t.getVariantContext(!0)||{},d=[],h=new Set,p={},f=1/0,m=function(n){var i=Ha[n],m=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=_n(g),A=i===s?m.isActive:null;!1===A&&(f=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=Object(an.a)({},p),!m.isActive&&null===A||!g&&!m.prevProp||Vo(g)||"boolean"==typeof g)return"continue";var y=function(t,e){if("string"==typeof e)return e!==t;if(Ln(e))return!Ci(e,t);return!1}(m.prevProp,g)||i===s&&m.isActive&&!b&&v||n>f&&v,S=Array.isArray(g)?g:[g],C=S.reduce(a,{});!1===A&&(C={});var w=m.prevResolvedValues,x=void 0===w?{}:w,E=Object(an.a)(Object(an.a)({},x),C),L=function(t){y=!0,h.delete(t),m.needsAnimating[t]=!0};for(var _ in E){var O=C[_],k=x[_];p.hasOwnProperty(_)||(O!==k?zo(O)&&zo(k)?Ci(O,k)?m.protectedKeys[_]=!0:L(_):void 0!==O?L(_):h.add(_):void 0!==O&&h.has(_)?L(_):m.protectedKeys[_]=!0)}m.prevProp=g,m.prevResolvedValues=C,m.isActive&&(p=Object(an.a)(Object(an.a)({},p),C)),r&&t.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(an.e)([],Object(an.c)(S.map((function(t){return{animation:t,options:Object(an.a)({type:i},e)}})))))},g=0;g<Ga;g++)m(g);if(i=Object(an.a)({},p),h.size){var v={};h.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(v[e]=n)})),d.push({animation:v})}var A=Boolean(d.length);return r&&!1===c.initial&&!t.manuallyAnimateOnMount&&(A=!1),r=!1,A?n(d):Promise.resolve()}return{isAnimated:function(t){return void 0!==i[t]},animateChanges:s,setActive:function(e,n,i){var r;return o[e].isActive===n?Promise.resolve():(null===(r=t.variantChildren)||void 0===r||r.forEach((function(t){var o;return null===(o=t.animationState)||void 0===o?void 0:o.setActive(e,n)})),o[e].isActive=n,s(i,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return o}}}function Qa(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Za={animation:yi((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=Xa(e)),Vo(n)&&Object(se.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:yi((function(t){var e=t.custom,n=t.visualElement,o=Object(an.c)(gn(),2),i=o[0],r=o[1],a=Object(se.useContext)(fn);Object(se.useEffect)((function(){var t,o,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(Xo.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:e});!i&&(null==s||s.then(r))}),[i])}))},$a=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},qa=function(t){return $a(t)&&t.hasOwnProperty("z")},Ka=function(t,e){return Math.abs(t-e)};function Ja(t,e){if(tr(t)&&tr(e))return Ka(t,e);if($a(t)&&$a(e)){var n=Ka(t.x,e.x),o=Ka(t.y,e.y),i=qa(t)&&qa(e)?Ka(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var ts=function(){function t(t,e,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var t=os(o.lastMoveEventInfo,o.history),e=null!==o.startEvent,n=Ja(t.offset,{x:0,y:0})>=3;if(e||n){var i=t.point,r=Hr().timestamp;o.history.push(Object(an.a)(Object(an.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;e||(s&&s(o.lastMoveEvent,t),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){o.lastMoveEvent=t,o.lastMoveEventInfo=es(e,o.transformPagePoint),Ko(t)&&0===t.buttons?o.handlePointerUp(t,e):Gr.update(o.updatePoint,!0)},this.handlePointerUp=function(t,e){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=os(es(e,o.transformPagePoint),o.history);o.startEvent&&i&&i(t,a),r&&r(t,a)},!(Jo(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=i;var r=es(oi(t),this.transformPagePoint),a=r.point,s=Hr().timestamp;this.history=[Object(an.a)(Object(an.a)({},a),{timestamp:s})];var l=e.onSessionStart;l&&l(t,os(r,this.history)),this.removeListeners=bi(li(window,"pointermove",this.handlePointerMove),li(window,"pointerup",this.handlePointerUp),li(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),jr.update(this.updatePoint)},t}();function es(t,e){return e?{point:e(t.point)}:t}function ns(t,e){return{x:t.x-e.x,y:t.y-e.y}}function os(t,e){var n=t.point;return{point:n,delta:ns(n,rs(e)),offset:ns(n,is(e)),velocity:as(e,.1)}}function is(t){return t[0]}function rs(t){return t[t.length-1]}function as(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,o=null,i=rs(t);n>=0&&(o=t[n],!(i.timestamp-o.timestamp>$r(e)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ss(t){return t}function ls(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}var cs={translate:0,scale:1,origin:0,originPoint:0};function us(){return{x:Object(an.a)({},cs),y:Object(an.a)({},cs)}}function ds(t){return[t("x"),t("y")]}function hs(t,e,n){var o=e.min,i=e.max;return void 0!==o&&t<o?t=n?Bi(o,t,n.min):Math.max(t,o):void 0!==i&&t>i&&(t=n?Bi(i,t,n.max):Math.min(t,i)),t}function ps(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 fs(t,e){var n,o=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&(o=(n=Object(an.c)([i,o],2))[0],i=n[1]),{min:t.min+o,max:t.min+i}}function ms(t,e,n){return{min:gs(t,e),max:gs(t,n)}}function gs(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function vs(t,e){return ls(function(t,e){var n=t.top,o=t.left,i=t.bottom,r=t.right;void 0===e&&(e=ss);var a=e({x:o,y:n}),s=e({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function As(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Ja(t,e)<n}function bs(t){return t.max-t.min}function ys(t,e){var n=.5,o=bs(t),i=bs(e);return i>o?n=Wi(e.min,e.max-o,t.min):o>i&&(n=Wi(t.min,t.max-i,e.min)),wi(0,1,n)}function Ss(t,e,n,o){void 0===o&&(o=.5),t.origin=o,t.originPoint=Bi(e.min,e.max,t.origin),t.scale=bs(n)/bs(e),As(t.scale,1,1e-4)&&(t.scale=1),t.translate=Bi(n.min,n.max,t.origin)-t.originPoint,As(t.translate)&&(t.translate=0)}function Cs(t,e,n,o){Ss(t.x,e.x,n.x,ws(o.originX)),Ss(t.y,e.y,n.y,ws(o.originY))}function ws(t){return"number"==typeof t?t:.5}function xs(t,e,n){t.min=n.min+e.min,t.max=t.min+bs(e)}var Es=function(t,e){return t.depth-e.depth};function Ls(t){return t.projection.isEnabled||t.shouldResetTransform()}function _s(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&_s(n,e),Ls(t)&&e.push(t),e}function Os(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:Object(an.a)({},e.x),y:Object(an.a)({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),Gr.update((function(){return t.rebaseProjectionTarget()}))}}function ks(t,e){return{min:e.min-t.min,max:e.max-t.min}}function Ts(t,e){return{x:ks(t.x,e.x),y:ks(t.y,e.y)}}function Ps(t,e){var n=t.getLayoutId(),o=e.getLayoutId();return n!==o||void 0===o&&t!==e}function Ws(t){var e=t.getProps(),n=e.drag,o=e._dragX;return n&&!o}function Bs(t,e){t.min=e.min,t.max=e.max}function Ds(t,e,n){return n+e*(t-n)}function Is(t,e,n,o,i){return void 0!==i&&(t=Ds(t,i,o)),Ds(t,n,o)+e}function Rs(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),t.min=Is(t.min,e,n,o,i),t.max=Is(t.max,e,n,o,i)}function Ms(t,e){var n=e.x,o=e.y;Rs(t.x,n.translate,n.scale,n.originPoint),Rs(t.y,o.translate,o.scale,o.originPoint)}function Fs(t,e,n,o){var i=Object(an.c)(o,3),r=i[0],a=i[1],s=i[2];t.min=e.min,t.max=e.max;var l=void 0!==n[s]?n[s]:.5,c=Bi(e.min,e.max,l);Rs(t,n[r],n[a],c,n.scale)}var js=["x","scaleX","originX"],Vs=["y","scaleY","originY"];function zs(t,e,n){Fs(t.x,e.x,n,js),Fs(t.y,e.y,n,Vs)}function Ns(t,e,n,o,i){return t=Ds(t-=e,1/n,o),void 0!==i&&(t=Ds(t,1/i,o)),t}function Us(t,e,n){var o=Object(an.c)(n,3),i=o[0],r=o[1],a=o[2];!function(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=Bi(t.min,t.max,o)-e;t.min=Ns(t.min,e,n,r,i),t.max=Ns(t.max,e,n,r,i)}(t,e[i],e[r],e[a],e.scale)}function Hs(t,e){Us(t.x,e,js),Us(t.y,e,Vs)}var Gs=new Set;function Ys(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function Xs(t){return Gs.add(t),function(){return Gs.delete(t)}}function Qs(){if(Gs.size){var t=0,e=[[]],n=[],o=function(n){return Ys(e,n,t)},i=function(e){Ys(n,e,t),t++};Gs.forEach((function(e){e(o,i),t=0})),Gs.clear();for(var r=n.length,a=0;a<=r;a++)e[a]&&e[a].forEach($s),n[a]&&n[a].forEach($s)}}var Zs,$s=function(t){return t()},qs=new WeakMap,Ks=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(),qs.set(e,this)}return t.prototype.start=function(t,e){var n=this,o=void 0===e?{}:e,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new ts(t,{onSessionStart:function(t){var e;n.stopMotion();var o=function(t){return oi(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=Xs((function(t,e){var i=_s(n.visualElement),s=function(t){var e=[],n=function(t){Ls(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Es)}(n.visualElement),l=Object(an.e)(Object(an.e)([],Object(an.c)(i)),Object(an.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){Os(n.visualElement),s.forEach(Os)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),r&&(c=n.snapToCursor(o))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;ds((function(e){if(!c){var i=t.target[e],r=i.min,s=i.max;n.cursorProgress[e]=a?a[e]:Wi(r,s,o[e])}var l=n.getAxisMotionValue(e);l&&(n.originPoint[e]=l.get())}))})),e((function(){Vr.update(),Vr.preRender(),Vr.render(),Vr.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=pi(s),n.openGlobalLock))&&(Qs(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,t,e),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(Xo.Drag,!0))},onMove:function(t,e){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=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}(u),void(null!==n.currentDirection&&(null===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,n.currentDirection)));n.updateAxis("x",e.point,u),n.updateAxis("y",e.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,t,e),Zs=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,o=e.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(En(n)?this.resolveRefConstraints(i,n):function(t,e){var n=e.top,o=e.left,i=e.bottom,r=e.right;return{x:ps(t.x,o,r),y:ps(t.y,n,i)}}(i,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:ms(t,"left","right"),y:ms(t,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&ds((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}(i[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=e.current;this.constraintsBox=vs(r,i);var a=function(t,e){return{x:fs(t.x,e.x),y:fs(t.y,e.y)}}(t,this.constraintsBox);if(o){var s=o(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=ls(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(Xo.Drag,!1)},t.prototype.stop=function(t,e){var n,o,i;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=e.velocity;this.animateDragEnd(a),null===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return ds((function(n){if(Js(n,e.props.drag,e.currentDirection)){var o=e.getAxisMotionValue(n);if(!o)return e.cursorProgress[n]=.5,!0;var i=e.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=t[n]-a;e.originPoint[n]=t[n],o.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Js(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 o=this.originPoint[t]+e[t],i=this.constraints?hs(o,this.constraints[t],this.elastic[t]):o;n.set(i)}},t.prototype.updateVisualElementAxis=function(t,e){var n,o=this.visualElement.getLayoutState().layout[t],i=o.max-o.min,r=this.cursorProgress[t],a=function(t,e,n,o,i){var r=t-e*n;return o?hs(r,o,i):r}(e[t],i,r,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+i)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,o=t.dragDirectionLock,i=void 0!==o&&o,r=t.dragPropagation,a=void 0!==r&&r,s=t.dragConstraints,l=void 0!==s&&s,c=t.dragElastic,u=void 0===c?.35:c,d=t.dragMomentum,h=void 0===d||d,p=Object(an.d)(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(an.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},p)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,o=e.layoutId,i="_drag"+t.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?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,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(t,e){void 0===e&&(e=!0);var n,o=t.getProjectionParent();return!!o&&(e?Hs(n=Ts(o.projection.target,t.projection.target),o.getLatestValues()):n=Ts(o.getLayoutState().layout,t.getLayoutState().layout),ds((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=Ts(c.projection.targetFinal,l);ds((function(t){var e=u[t],n=e.min,o=e.max;l[t]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=ds((function(n){var c;if(Js(n,o,e.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,p=Object(an.a)(Object(an.a)({type:"inertia",velocity:i?t[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,p):e.visualElement.startLayoutAnimation(n,p,s)}}));return Promise.all(d).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;ds((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 o=n.get();return n.set(o),n.set(o),Ea(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(En(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};ds((function(e){o[e]=ys(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){ds((function(e){if(Js(e,n,null)){var i=function(t,e,n){var o=t.max-t.min,i=Bi(e.min,e.max-o,n);return{min:i,max:i+o}}(t.visualElement.projection.target[e],t.constraintsBox[e],o[e]),r=i.min,a=i.max;t.visualElement.setProjectionTargetAxis(e,r,a)}}))})),setTimeout(Qs,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=Xs((function(n,o){var i=_s(e.visualElement);o((function(){return i.forEach((function(t){return t.resetTransform()}))})),n((function(){return Os(e.visualElement)})),o((function(){return i.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&o(t)}))},t.prototype.mount=function(t){var e=this,n=li(t.getInstance(),"pointerdown",(function(t){var n=e.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&e.start(t)})),o=$o(window,"resize",(function(){e.scalePoint()})),i=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),r=t.prevDragCursor;return r&&this.start(Zs,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),e.cancelDrag()}},t}();function Js(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var tl,el,nl={pan:yi((function(t){var e=t.onPan,n=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,r=t.visualElement,a=e||n||o||i,s=Object(se.useRef)(null),l=Object(se.useContext)(hn).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,o&&o(t,e)}};Object(se.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),ci(r,"pointerdown",a&&function(t){s.current=new ts(t,c,{transformPagePoint:l})}),vi((function(){return s.current&&s.current.end()}))})),drag:yi((function(t){var e=t.dragControls,n=t.visualElement,o=Object(se.useContext)(hn).transformPagePoint,i=mn((function(){return new Ks({visualElement:n})}));i.setProps(Object(an.a)(Object(an.a)({},t),{transformPagePoint:o})),Object(se.useEffect)((function(){return e&&e.subscribe(i)}),[i]),Object(se.useEffect)((function(){return i.mount(n)}),[])}))};function ol(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"}(tl||(tl={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(el||(el={}));var il=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function rl(t,e,n){void 0===n&&(n=1);var o=Object(an.c)(function(t){var e=il.exec(t);if(!e)return[,];var n=Object(an.c)(e,3);return[n[1],n[2]]}(t),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(e).getPropertyValue(i);return a?a.trim():ol(r)?rl(r,e,n+1):r}}function al(t,e){return t/(e.max-e.min)*100}var sl="_$css";var ll={process:function(t,e,n){var o=n.target;if("string"==typeof t){if(!ao.test(t))return t;t=parseFloat(t)}return al(t,o.x)+"% "+al(t,o.y)+"%"}},cl={borderRadius:Object(an.a)(Object(an.a)({},ll),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:ll,borderTopRightRadius:ll,borderBottomLeftRadius:ll,borderBottomRightRadius:ll,boxShadow:{process:function(t,e){var n=e.delta,o=e.treeScale,i=t,r=t.includes("var("),a=[];r&&(t=t.replace(il,(function(t){return a.push(t),sl})));var s=Ji.parse(t);if(s.length>5)return i;var l=Ji.createTransformer(t),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=Bi(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var p=l(s);if(r){var f=0;p=p.replace(sl,(function(){var t=a[f];return f++,t}))}return p}}},ul=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,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(an.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=e.props,h=d.visualElement,p=d.layout;if(!1===s)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===s){s&&(e.isAnimatingTree=!0),n=i||n,t=r||t;var f=!1,m=h.getProjectionParent();if(m){var g=m.prevViewportBox,v=m.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!Ps(c,m)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&gl(c,i,r)&&(f=!0,n=Ts(g,n),t=Ts(v,t))}var A=dl(n,t),b=ds((function(o){var i,r;if("position"===p){var s=t[o].max-t[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?A?e.animateAxis(o,t[o],n[o],Object(an.a)(Object(an.a)({},u),{isRelative:f})):(null===(r=(i=e.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,t[o].min,t[o].max,f)):void h.setVisibility(a===el.Show)}));return h.syncRender(),Promise.all(b).then((function(){e.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},e}return Object(an.b)(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=Ea,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},function(t){for(var e in t)Fn[e]=t[e]}(cl)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),ds((function(e){var n,o;return null===(o=(n=t.stopAxisAnimation)[e])||void 0===o?void 0:o.call(n)}))},e.prototype.animateAxis=function(t,e,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!fl(e,this.currentAnimationTarget[t])){null===(r=(i=this.stopAxisAnimation)[t])||void 0===r||r.call(i),this.isAnimating[t]=!0;var u=this.props.visualElement,d=this.frameTarget[t],h=u.getProjectionAnimationProgress()[t];h.clearListeners(),h.set(0),h.set(0);var p=function(){var o=h.get()/1e3;!function(t,e,n,o){t.min=Bi(e.min,n.min,o),t.max=Bi(e.max,n.max,o)}(d,n,e,o),u.setProjectionTargetAxis(t,d.min,d.max,c)};p();var f=h.onChange(p);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,h.stop(),f()},this.currentAnimationTarget[t]=e;var m=l||u.getDefaultTransition()||ml;return Ea("x"===t?"layoutX":"layoutY",h,1e3,m&&xa(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}(se.Component);function dl(t,e){return!(pl(t)||pl(e)||fl(t.x,e.x)&&fl(t.y,e.y))}var hl={min:0,max:0};function pl(t){return fl(t.x,hl)&&fl(t.y,hl)}function fl(t,e){return t.min===e.min&&t.max===e.max}var ml={duration:.45,ease:[.4,0,.1,1]};function gl(t,e,n){return t||!t&&!(e||n)}var vl={layoutReady:function(t){return t.notifyLayoutReady()}};function Al(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?vl:e,o=n.layoutReady,i=n.parent;Xs((function(e,n){var r=Array.from(t).sort(Es),a=i?_s(i):[];n((function(){Object(an.e)(Object(an.e)([],Object(an.c)(a)),Object(an.c)(r)).forEach((function(t){return t.resetTransform()}))})),e((function(){r.forEach(Os)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),r.forEach(o)})),e((function(){r.forEach((function(t){t.isPresent&&(t.presence=tl.Present)}))})),n((function(){Vr.preRender(),Vr.render()})),e((function(){Gr.postRender((function(){return r.forEach(bl)})),t.clear()}))})),Qs()}}}function bl(t){t.prevViewportBox=t.projection.target}var yl=Object(se.createContext)(Al()),Sl=Object(se.createContext)(Al());function Cl(t){return!!t.forceUpdate}var wl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(an.b)(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,o=t.visualElement;Cl(e)&&e.register(o),Cl(n)&&n.register(o),o.onUnmount((function(){Cl(e)&&e.remove(o),Cl(n)&&n.remove(o)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Cl(e)?e.syncUpdate():(!function(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Cl(t)||t.flush()},e.prototype.render=function(){return null},e}(se.default.Component);var xl={measureLayout:function(t){var e=Object(se.useContext)(yl),n=Object(se.useContext)(Sl);return se.default.createElement(wl,Object(an.a)({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=Object(an.c)(gn(),2)[1];return se.createElement(ul,Object(an.a)({},t,{safeToRemove:e}))}};function El(){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:us(),deltaFinal:us(),deltaTransform:""}}var Ll=El();function _l(t,e,n){var o=t.x,i=t.y,r="translate3d("+o.translate/e.x+"px, "+i.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==kl?r:""}function Ol(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var kl=_l(Ll.delta,Ll.treeScale,{x:1,y:1}),Tl=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Pl(t,e,n,o){var i,r,a=t.delta,s=t.layout,l=t.layoutCorrected,c=t.treeScale,u=e.target;r=s,Bs((i=l).x,r.x),Bs(i.y,r.y),function(t,e,n){var o=n.length;if(o){var i,r;e.x=e.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,e.x*=r.x.scale,e.y*=r.y.scale,Ms(t,r),Ws(i)&&zs(t,t,i.getLatestValues())}}(l,c,n),Cs(a,l,u,o)}var Wl=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){La(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){_a(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Es),this.isDirty=!1,this.children.forEach(t)},t}();var Bl=function(t){var e=t.treeType,n=void 0===e?"":e,o=t.build,i=t.getBaseTarget,r=t.makeTargetAnimatable,a=t.measureViewportBox,s=t.render,l=t.readValueFromInstance,c=t.resetTransform,u=t.restoreTransform,d=t.removeValueFromRenderState,h=t.sortNodePosition,p=t.scrapeMotionValuesFromProps;return function(t,e){var f=t.parent,m=t.props,g=t.presenceId,v=t.blockInitialAnimation,A=t.visualState;void 0===e&&(e={});var b,y,S,C,w,x,E=A.latestValues,L=A.renderState,_=function(){var t=Tl.map((function(){return new Oa})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return Tl.forEach((function(o){var i;null===(i=e[o])||void 0===i||i.call(e);var r="on"+o,a=t[r];a&&(e[o]=n[r](a))}))}};return t.forEach((function(t,e){n["on"+Tl[e]]=function(e){return t.add(e)},n["notify"+Tl[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,Object(an.e)([],Object(an.c)(e)))}})),n}(),O={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}}},k=O,T=E,P=El(),W=!1,B=new Map,D=new Map,I={},R=Object(an.a)({},E);function M(){b&&(Y.isProjectionReady()&&(zs(k.targetFinal,k.target,T),Cs(P.deltaFinal,P.layoutCorrected,k.targetFinal,E)),F(),s(b,L))}function F(){var t=E;if(C&&C.isActive()){var n=C.getCrossfadeState(Y);n&&(t=n)}o(Y,L,t,k,P,e,m)}function j(){_.notifyUpdate(E)}function V(){Y.layoutTree.forEach(Il)}var z=p(m);for(var N in z){var U=z[N];void 0!==E[N]&&Xn(U)&&U.set(E[N],!1)}var H=Tn(m),G=Pn(m),Y=Object(an.a)(Object(an.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(an.e)(Object(an.e)([],Object(an.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new Wl,presenceId:g,projection:O,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(t){b=Y.current=t,Y.pointTo(Y),G&&f&&!H&&(x=null==f?void 0:f.addVariantChild(Y)),null==f||f.children.add(Y)},unmount:function(){jr.update(j),jr.render(M),jr.preRender(Y.updateLayoutProjection),D.forEach((function(t){return t()})),Y.stopLayoutAnimation(),Y.layoutTree.remove(Y),null==x||x(),null==f||f.children.delete(Y),null==S||S(),_.clearAllListeners()},addVariantChild:function(t){var e,n=Y.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return h&&n===t.treeType?h(Y.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return G?Y:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return Gr.preRender(Y.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return m.layoutId},getInstance:function(){return b},getStaticValue:function(t){return E[t]},setStaticValue:function(t,e){return E[t]=e},getLatestValues:function(){return E},setVisibility:function(t){Y.isVisible!==t&&(Y.isVisible=t,Y.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),r(Y,t,m,e)},addValue:function(t,e){Y.hasValue(t)&&Y.removeValue(t),B.set(t,e),E[t]=e.get(),function(t,e){var n=e.onChange((function(e){E[t]=e,m.onUpdate&&Gr.update(j,!1,!0)})),o=e.onRenderRequest(Y.scheduleRender);D.set(t,(function(){n(),o()}))}(t,e)},removeValue:function(t){var e;B.delete(t),null===(e=D.get(t))||void 0===e||e(),D.delete(t),delete E[t],d(t,L)},hasValue:function(t){return B.has(t)},getValue:function(t,e){var n=B.get(t);return void 0===n&&void 0!==e&&(n=Ta(e),Y.addValue(t,n)),n},forEachValue:function(t){return B.forEach(t)},readValue:function(t){var n;return null!==(n=E[t])&&void 0!==n?n:l(b,t,e)},setBaseTarget:function(t,e){R[t]=e},getBaseTarget:function(t){if(i){var e=i(m,t);if(void 0!==e&&!Xn(e))return e}return R[t]}},_),{build:function(){return F(),L},scheduleRender:function(){Gr.render(M,!1,!0)},syncRender:M,setProps:function(t){m=t,_.updatePropListeners(t),I=function(t,e,n){var o;for(var i in e){var r=e[i],a=n[i];if(Xn(r))t.addValue(i,r);else if(Xn(a))t.addValue(i,Ta(r));else if(a!==r)if(t.hasValue(i)){var s=t.getValue(i);!s.hasAnimated&&s.set(r)}else t.addValue(i,Ta(null!==(o=t.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===e[i]&&t.removeValue(i);return e}(Y,p(m),I)},getProps:function(){return m},getVariant:function(t){var e;return null===(e=m.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return m.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==f?void 0:f.getVariantContext();if(!H){var e=(null==f?void 0:f.getVariantContext())||{};return void 0!==m.initial&&(e.initial=m.initial),e}for(var n={},o=0;o<Fl;o++){var i=Ml[o],r=m[i];(_n(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){O.isEnabled=!0,Y.layoutTree.add(Y)},lockProjectionTarget:function(){O.isTargetLocked=!0},unlockProjectionTarget:function(){Y.stopLayoutAnimation(),O.isTargetLocked=!1},getLayoutState:function(){return P},setCrossfader:function(t){C=t},isProjectionReady:function(){return O.isEnabled&&O.isHydrated&&P.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var o=Y.getProjectionAnimationProgress()[t],i=n?O.relativeTarget[t]:O.target[t],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(e){Y.setProjectionTargetAxis(t,e,e+a,n)})),Y.animateMotionValue(t,o,0,e)},stopLayoutAnimation:function(){ds((function(t){return Y.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=a(b,e);return t||Hs(n,E),n},getProjectionAnimationProgress:function(){return w||(w={x:Ta(0),y:Ta(0)}),w},setProjectionTargetAxis:function(t,e,n,o){var i;void 0===o&&(o=!1),o?(O.relativeTarget||(O.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=O.relativeTarget[t]):(O.relativeTarget=void 0,i=O.target[t]),O.isHydrated=!0,i.min=e,i.max=n,W=!0,_.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=P.layout);var n=Y.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(O.relativeTarget||O.isTargetLocked||o.isAnimating()||i.isAnimating());(t||r)&&ds((function(t){var n=e[t],o=n.min,i=n.max;Y.setProjectionTargetAxis(t,o,i)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=Ts(e.getLayoutState().layout,t.getLayoutState().layout);ds((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(Y),Y.notifyLayoutUpdate(P.layout,Y.prevViewportBox||P.layout,t)},resetTransform:function(){return c(Y,b,m)},restoreTransform:function(){return u(b,L)},updateLayoutProjection:function(){if(Y.isProjectionReady()){var t=P.delta,e=P.treeScale,n=e.x,o=e.y,i=P.deltaTransform;Pl(P,k,Y.path,E),W&&Y.notifyViewportBoxUpdate(k.target,t),W=!1;var r=_l(t,e);r===i&&n===e.x&&o===e.y||Y.scheduleRender(),P.deltaTransform=r}},updateTreeLayoutProjection:function(){Y.layoutTree.forEach(Dl),Gr.preRender(V,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var t=!1,e=Y.path.length-1;e>=0;e--){var n=Y.path[e];if(n.projection.isEnabled){t=n;break}}y=t}return y},resolveRelativeTargetBox:function(){var t=Y.getProjectionParent();if(O.relativeTarget&&t&&(function(t,e){xs(t.target.x,t.relativeTarget.x,e.target.x),xs(t.target.y,t.relativeTarget.y,e.target.y)}(O,t.projection),Ws(t))){var e=O.target;zs(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(t){k=t.projection,T=t.getLatestValues(),null==S||S(),S=bi(t.onSetAxisTarget(Y.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;Y.isPresent?Y.presence=tl.Present:null===(t=Y.layoutSafeToRemove)||void 0===t||t.call(Y)})))},isPresent:!0,presence:tl.Entering});return Y}};function Dl(t){t.resolveRelativeTargetBox()}function Il(t){t.updateLayoutProjection()}var Rl,Ml=Object(an.e)(["initial"],Object(an.c)(Ua)),Fl=Ml.length,jl=new Set(["width","height","top","left","right","bottom","x","y"]),Vl=function(t){return jl.has(t)},zl=function(t,e){t.set(e,!1),t.set(e)},Nl=function(t){return t===uo||t===ao};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Rl||(Rl={}));var Ul=function(t,e){return parseFloat(t.split(", ")[e])},Hl=function(t,e){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return Ul(r[1],e);var a=i.match(/^matrix\((.+)\)$/);return a?Ul(a[1],t):0}},Gl=new Set(["x","y","z"]),Yl=Vn.filter((function(t){return!Gl.has(t)}));var Xl={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,o=e.top;return parseFloat(o)+(n.max-n.min)},right:function(t,e){var n=t.x,o=e.left;return parseFloat(o)+(n.max-n.min)},x:Hl(4,13),y:Hl(5,14)},Ql=function(t,e,n,o){void 0===n&&(n={}),void 0===o&&(o={}),e=Object(an.a)({},e),o=Object(an.a)({},o);var i=Object.keys(e).filter(Vl),r=[],a=!1,s=[];if(i.forEach((function(i){var l=t.getValue(i);if(t.hasValue(i)){var c,u=n[i],d=e[i],h=Ba(u);if(zo(d))for(var p=d.length,f=null===d[0]?1:0;f<p;f++)c?Ba(d[f]):(c=Ba(d[f]))===h||Nl(h)&&Nl(c);else c=Ba(d);if(h!==c)if(Nl(h)&&Nl(c)){var m=l.get();"string"==typeof m&&l.set(parseFloat(m)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&c===ao&&(e[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):e[i]=h.transform(d):(a||(r=function(t){var e=[];return Yl.forEach((function(n){var o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:e[i],zl(l,d))}})),s.length){var l=function(t,e,n){var o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var l=e.measureViewportBox();return n.forEach((function(n){var i=e.getValue(n);zl(i,Xl[n](o,s)),t[n]=Xl[n](l,r)})),t}(e,t,s);return r.length&&r.forEach((function(e){var n=Object(an.c)(e,2),o=n[0],i=n[1];t.getValue(o).set(i)})),t.syncRender(),{target:l,transitionEnd:o}}return{target:e,transitionEnd:o}};function Zl(t,e,n,o){return function(t){return Object.keys(t).some(Vl)}(e)?Ql(t,e,n,o):{target:e,transitionEnd:o}}var $l=function(t,e,n,o){var i=function(t,e,n){var o,i=Object(an.d)(e,[]),r=t.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(an.a)({},n)),t.forEachValue((function(t){var e=t.get();if(ol(e)){var n=rl(e,r);n&&t.set(n)}})),i){var s=i[a];if(ol(s)){var l=rl(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(t,e,o);return Zl(t,e=i.target,n,o=i.transitionEnd)};var ql={treeType:"dom",readValueFromInstance:function(t,e){if(Un(e)){var n=va(e);return n&&n.default||0}var o,i=(o=t,window.getComputedStyle(o));return(Zn(e)?i.getPropertyValue(e):i[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 vs(t,e.transformPagePoint)},resetTransform:function(t,e,n){var o=n.transformTemplate;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,o=e.style;delete n[t],delete o[t]},makeTargetAnimatable:function(t,e,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=e.transition,a=e.transitionEnd,s=Object(an.d)(e,["transition","transitionEnd"]),l=function(t,e,n){var o,i,r={};for(var a in t)r[a]=null!==(o=Fa(a,e))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},t);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(t,e,n){var o,i,r,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=e[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:t.readValue(u))&&void 0!==i?i:e[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!Ia(h)&&Ji.test(d)&&(h=Aa(u,d)),t.addValue(u,Ta(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),t.setBaseTarget(u,h))}}(t,s,l);var c=$l(t,s,l,a);a=c.transitionEnd,s=c.target}return Object(an.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:Fo,build:function(t,e,n,o,i,r,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;go(e,n,o,i,r,a.transformTemplate,s?_l:void 0,s?Ol:void 0)},render:Io},Kl=Bl(ql),Jl=Bl(Object(an.a)(Object(an.a)({},ql),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return Un(e)?(null===(n=va(e))||void 0===n?void 0:n.default)||0:(e=Ro.has(e)?e:Do(e),t.getAttribute(e))},scrapeMotionValuesFromProps:jo,build:function(t,e,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;ko(e,n,o,i,r,a.transformTemplate,s?_l:void 0,s?Ol:void 0)},render:Mo})),tc=function(t,e){return Mn(t)?Jl(e,{enableHardwareAcceleration:!1}):Kl(e,{enableHardwareAcceleration:!0})},ec=Object(an.a)(Object(an.a)(Object(an.a)(Object(an.a)({},Za),Si),nl),xl),nc=In((function(t,e){return Zo(t,e,ec,tc)}));class oc{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}class ic{static now(){return Date.now()}}function rc(t){var e=mn((function(){return Ta(t)}));if(Object(se.useContext)(hn).isStatic){var n=Object(an.c)(Object(se.useState)(t),2)[1];Object(se.useEffect)((function(){return e.onChange(n)}),[])}return e}var ac=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function sc(t,e){var n=rc(e()),o=function(){return n.set(e())};return o(),function(t,e){Object(se.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return Gr.update(o,!1,!0)})),n}function lc(t,e,n,o){var i="function"==typeof e?e:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),o=n?0:-1,i=t[0+o],r=t[1+o],a=t[2+o],s=t[3+o],l=lr(r,a,Object(an.a)({mixer:ac(a[0])},s));return n?l(i):l}(e,n,o);return Array.isArray(t)?cc(t,i):cc([t],(function(t){var e=Object(an.c)(t,1)[0];return i(e)}))}function cc(t,e){var n=mn((function(){return[]}));return sc(t,(function(){n.length=0;for(var o=t.length,i=0;i<o;i++)n[i]=t[i].get();return e(n)}))}function uc(t,e,n){void 0===n&&(n={});var o=Xn(t)?t:Ta(t);return Ea("",o,e,n),{stop:function(){return o.stop()}}}var dc=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class hc extends se.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,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fill)&&void 0!==e?e:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.stroke)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,p=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,m=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return se.default.createElement(pc,{points:m,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:p,cornerRadius:f})}}function pc(t){var{points:e,cornerRadius:n}=t,o=dc(t,["points","cornerRadius"]);const i=[e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y],r=i.map(rc),a=lc(r,(([t,e,o,i,r,a,s,l])=>{const c=[{x:t,y:e},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return R.toSvgPathStringWithRoundedCorners(c,n)}));return Object(se.useEffect)((()=>{const t=[];for(let e=0;e<i.length;e++)t.push(uc(r[e],i[e]));return()=>{t.forEach((t=>t.stop()))}}),[e]),se.default.createElement(nc.path,Object.assign({d:a},o))}class fc extends se.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,o,i){const r=[];i.forEach((o=>{const i=new oc(o);i.points=void 0===t?R.scaleListToHtmlElement(o.points,n,e.video):o.points.map((e=>{const o=new R(e.x,e.y);return o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x,o})),i.points.forEach((t=>{e.state.mirrored&&this.container&&(t.x=this.container.clientWidth-t.x)})),r.push(i)}));const a=[];this.state.polygonElements.forEach((t=>{const e=r.find((e=>e.code.equals(t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<ic.now()&&(n=!0):(t.element=e,t.polygon=se.default.createElement(hc,{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=se.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{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=ic.now()),n||a.push(t)})),r.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>e.element.code.equals(t.code)))){let e,n;const o=se.default.createElement(hc,{key:t.code.id(),ref:o=>{e=o,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),i=se.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:t.code.id(),ref:o=>{n=o,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)})),r={element:t,polygon:o,label:i,polygonRef:e,labelRef:n,updatedAt:ic.now()};a.push(r)}})),this.setState({polygonElements:a})}onPolygonClick(t){var e,n,o,i;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const o=e.labelRef;o&&e.label.props.element.code.equals(t.code)&&(o.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonSelected)||void 0===n||n.call(e,t.code)),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,t.code)}render(){var t,e;return se.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:t=>this.container=t},se.default.createElement(nc.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},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)))}}var mc=n(9),gc=n.n(mc),vc=n(12),Ac={insert:"head",singleton:!1},bc=(gc()(vc.a,Ac),vc.a.locals,n(6)),yc=n.n(bc);class Sc{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 o=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class Cc extends se.default.Component{constructor(){super(...arguments),this.inner1=new Sc("scanbot-shutter-rotate"),this.inner2=new Sc("scanbot-shutter-rotate")}render(){return se.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,se.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},se.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},se.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},se.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},se.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 se.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return se.default.createElement("div",{className:yc()(t),ref:n},se.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}class wc extends se.default.Component{render(){return se.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},se.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),se.default.createElement("g",{mask:"url(#mask0_919_23088)"},se.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"})))}}class xc extends se.default.Component{render(){return se.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},se.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),se.default.createElement("g",{mask:"url(#mask0_919_23102)"},se.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"})))}}class Ec extends se.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 se.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:on.ScanbotPrimary}},se.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},se.default.createElement(wc,null),se.default.createElement("div",{style:{backgroundColor:on.Orange,color:on.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)),se.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},se.default.createElement(Cc,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),se.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},se.default.createElement("div",{style:{fontSize:13,color:on.White,marginRight:10}},"Scan More"),se.default.createElement(xc,null)))}}class Lc extends se.default.Component{render(){const t=R.centerOf(this.props.points),e=R.smallerSizeOfQuad(this.props.points)/40;return se.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})`}},se.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},se.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),se.default.createElement("g",{mask:"url(#mask0_910_20901)"},se.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),se.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"})))}}class _c extends se.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:Ze.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const o=new oc(n);o.points=R.scaleListToHtmlElement(n.points,t.imageData,this.image),e.push(o)})),this.setState({imageSize:Ze.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:se.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}},se.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),se.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>se.default.createElement(Lc,{key:e,points:t.points})))))}}class Oc extends se.default.Component{render(){if(!this.props.visible)return null;const t=ze.a.svg`
32
32
  animation: rotate 2s linear infinite;
33
33
  @keyframes rotate { 100% { transform: rotate(360deg); } }
34
34
  `;return se.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},se.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),se.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"}),se.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"}),se.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"})))}}class kc extends se.default.Component{render(){return this.props.text?se.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},se.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:on.TransparentGray,color:on.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class Tc extends se.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,o,i;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),l=R.width(null!==(t=this.props.animateToPoints)&&void 0!==t?t:r.points);if(!s)return null;if(!r.points)return null;const c=null!==(n=null===(e=this.customStyle)||void 0===e?void 0:e.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(i=null===(o=this.customStyle)||void 0===o?void 0:o.textColor)&&void 0!==i?i:r.highlighted?a.highlightedTextColor:a.textColor;return se.default.createElement(nc.div,{ref:t=>this.label=t,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:R.lowestX(r.points),y:R.highestY(r.points)+3,backgroundColor:c,fontSize:12,width:l,overflow:"hidden",color:u,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:R.lowestX(this.props.animateToPoints),y:R.highestY(this.props.animateToPoints)+30}:{}},s)}}class Pc{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.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class Wc{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.style=new Pc}}class Bc{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class Dc{constructor(){this.enabled=!1,this.style=new Bc}}class Ic extends Ut{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Wc,this.scanAndCount=new Dc,this.gs1Handling="PARSE",this.onBarcodesDetected=function(t){}}static fromJson(t){const e=new Ic;return this.mapValues(t,e,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(e,t),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}}class Rc{static warn(t){console.warn("[ScanbotSDK]",t)}}class Mc{constructor(t,e){this.p1=t,this.p2=e}}class Fc{static convertLinesToViewportLines(t,e){if(e&&t)return e.map((e=>new Mc(new R(e.p1.x*t.width,e.p1.y*t.height),new R(e.p2.x*t.width,e.p2.y*t.height))))}static convertToViewportPointsFromParentSize(t,e){return e?Ze.isEmpty(t)?void 0:e.map((e=>R.scaleUpTo(e,t))):Ze.toPolygon(t)}static calculateScale(t){let e,n=0,o=0;return 1>t.width/t.height?(e=t.height/1,n=(1-t.width/e)/2):(e=t.width/1,o=(1-t.height/e)/2),{x:n,y:o,containerScale:e}}static findScale(t,e){let n,o=0,i=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,i=(e.height-t.height/n)/2):(n=t.height/e.height,o=(e.width-t.width/n)/2),{x:o,y:i,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",Fc.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",Fc.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}}var jc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Vc{static postBlob(t,e){return jc(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 jc(this,void 0,void 0,(function*(){const n=B.convertImageDataWrapperToImageData(e),o=B.createImageDataCanvas(n),i=yield new Promise((t=>o.toBlob((e=>t(e)))));return yield Vc.postBlob(t,i)}))}static recognizeBarcodes(t,e){return jc(this,void 0,void 0,(function*(){const n=yield Vc.postImage(t,e);return F.fromWorker(n,e)}))}}var zc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Nc extends Ye{constructor(t){var e;super(t),this.shouldComputeSize=!0,this.paused=!1,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(e=this.configuration.finder.visible)||void 0===e||e,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=Ic.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return zc(this,void 0,void 0,(function*(){const e=Fc.findContainerOrThrow(t);return new Promise(((n,o)=>{Object(se.render)(se.default.createElement(Nc,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return zc(this,void 0,void 0,(function*(){Rc.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){Rc.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return zc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return zc(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return zc(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n,o,i,r;return zc(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)return;if(this.detectionRunning)return;let a=!1;try{this.detectionRunning=!0;const t=yield this.recognizeBarcodes(!0,this.shouldComputeSize,this.configuration.returnBarcodeImage);if(this.shouldComputeSize=!1,!t)return;const s=t.barcodeResult;s.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(null==s?void 0:s.imageData)):(a=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(s)),null===(n=this.overlay)||void 0===n||n.update(null===(o=this.finder)||void 0===o?void 0:o.holeRect,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{this.detectionRunning=!1;const t=()=>requestAnimationFrame(this.detect.bind(this)),e=(null===(r=this.configuration.overlay)||void 0===r?void 0:r.visible)?0:this.configuration.captureDelay;a&&0!=e?setTimeout(t,e):t()}}))}setUseBackendService(t){console.log("Now using backend service for recognition: ",t),this.backendurl=t}recognizeBarcodes(t,e,n){var o,i,r,a,s,l;return zc(this,void 0,void 0,(function*(){window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(t=!1);const c=t?Ye.DEFAULT_DETECTION_RESOLUTION:Ye.DETECTION_RESULTION_4K,u=null!==(o=this.desiredRecognitionResolution)&&void 0!==o?o:c;this.camera.finderFrame=null===(i=this.finder)||void 0===i?void 0:i.holeRect;const d=yield null===(r=this.camera)||void 0===r?void 0:r.createImageData(u);if(!d)return;e&&this.forceUpdate(),(null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.enabled)&&(this.setState({image:B.wrapperToBase64(d)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",Ye.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));const h=this.configuration.engineMode,p=this.configuration.barcodeFormats;let f;if(this.backendurl&&this.backendurl.length>0)f=yield Vc.recognizeBarcodes(this.backendurl,d);else{const e=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[d,{live:t,engineMode:h,barcodeFormats:p,returnBarcodeImage:n,gs1Handling:this.configuration.gs1Handling}]);if(!this.enabled)return;if(null===e)return void(null===(l=(s=this.props).onLicenseError)||void 0===l||l.call(s));f=F.fromWorker(e.result,e.originalImage)}return this.configuration.barcodesRegexFilter&&(f.barcodes=f.barcodes.filter((t=>{var e;return null===(e=t.text)||void 0===e?void 0:e.match(this.configuration.barcodesRegexFilter)}))),{imageData:d,originalImage:undefined,barcodeResult:f}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return zc(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?t(Ze.fromJson(n)):this.camera.didLoadVideo=()=>{const e=this.camera.videoSize();t(Ze.fromJson(e))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}setZoom(t){this.setState({zoom:t})}setCameraDirection(t){this.camera.setDirection(t)}updateTorch(t){this.camera.videoStream.updateTorch(t)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var t,e,n,o,i,r,a;const s=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return se.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),se.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},se.default.createElement(qe,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),se.default.createElement(kc,{top:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.style.topLabelTop,text:s}),se.default.createElement(_c,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&se.default.createElement(Ke,{ref:t=>{this.finder=t},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),se.default.createElement(kc,{bottom:100,text:this.state.bottomHintText}),se.default.createElement(Oc,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&se.default.createElement(fc,{ref:t=>{t&&(this.overlay=t)},configuration:this.configuration.overlay,onPolygonSelected:t=>{const e=new F([t],void 0);this.configuration.onBarcodesDetected(e)},onBarcodeFound:(t,e,n)=>{var o;(null===(o=this.configuration.overlay)||void 0===o?void 0:o.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(t,e,n)},LabelComponent:Tc,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&se.default.createElement(Ec,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(nn.PushBottom,this.barcodes)},onShutterButtonClick:()=>zc(this,void 0,void 0,(function*(){(new D).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()}}),se.default.createElement(rn,{ref:t=>this.popup=t,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.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`}}function Uc(t,e){return t&&(t.hasFacingOptions&&e.flipCameraButton.visible||t.isTorchAvailable&&e.flashButton.visible)||e.zoomButton.visible}function Hc(t){const e=t.zoomSteps.findIndex((e=>e==t.defaultZoomFactor)),[n,o]=Object(se.useState)(t.torchEnabledInitially),[i,r]=Object(se.useState)(e),a=t.zoomSteps[i],[s,l]=Object(se.useState)("BACK"==t.initialCameraModule?"environment":"user"),c=function(t){var e,n;const o=null===(n=null===(e=null==t?void 0:t.camera)||void 0===e?void 0:e.video)||void 0===n?void 0:n.parentElement,i=()=>o?o.getBoundingClientRect():null,[r,a]=Object(se.useState)(i());return Object(se.useEffect)((()=>{if(o){const t=()=>a(i());t();const e=new ResizeObserver(t);return e.observe(o),()=>{e.disconnect()}}}),[o]),r}(t.scanner),u=!!c;if(Object(se.useEffect)((()=>{var e;(null===(e=t.capabilities)||void 0===e?void 0:e.isTorchAvailable)&&u&&t.scanner.setTorchState(n)}),[t.capabilities,u,n]),Object(se.useEffect)((()=>{var e;u&&(null===(e=t.scanner)||void 0===e||e.setZoom(a))}),[u,a]),!t.capabilities||!c)return null;if(!Uc(t.capabilities,t.config))return null;const d=c.height-t.bottomPadding-48;return se.default.createElement(ce.Box,{style:{position:"absolute",marginTop:d,marginLeft:c.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},se.default.createElement(Be,Object.assign({},t.config.flashButton,{visible:t.capabilities.isTorchAvailable&&t.config.flashButton.visible,icon:n?ce.FlashlightOn:ce.FlashlightOff,active:n,onClick:()=>o(!n)})),se.default.createElement("div",{style:{width:20}}),se.default.createElement(Be,Object.assign({},t.config.zoomButton,{text:`${a.toFixed(1)}x`,active:i!==e,onClick:()=>r((i+1)%t.zoomSteps.length)})),se.default.createElement("div",{style:{width:20}}),se.default.createElement(Be,Object.assign({},t.config.flipCameraButton,{visible:t.capabilities.hasFacingOptions&&t.config.flipCameraButton.visible,active:"user"===s,icon:ce.FlipCameraIos,onClick:()=>{var e;const n="environment"===s?"user":"environment";l(n),null===(e=t.scanner)||void 0===e||e.setCameraDirection(n)}})))}var Gc=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class Yc extends Tc{constructor(){super(...arguments),this.count=0,this.setCount=t=>{this.count=t,this.forceUpdate()}}render(){var t;const{barcodeItemConfiguration:e,barcodeItemInfoPosition:n,counterBadge:o}=this.props,i=this.state.element,r=null!==(t=this.props.animateToPoints)&&void 0!==t?t:i.points,a=i.code,s=i.highlighted,l=10,c=(R.lowestY(r)+R.highestY(r))/2,u=(R.lowestX(r)+R.highestX(r))/2,d=(()=>{const t={badgeY:c,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},t),{labelY:Math.max(R.highestY(r)+l,o?c-24-l:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},t),{labelY:Math.min(R.lowestY(r)-l,o.visible?c+24+l:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:c,badgeStyle:{transform:"translateX(-50%) translateY(calc(-100% - 5px))"},labelY:c,labelStyle:{transform:o.visible?"translateX(-50%) translateY(5px)":"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},t),{labelY:0,labelStyle:{display:"none"}}):void 0})(),h=!1===e.titleDeselected.visible&&!1===e.subtitleDeselected.visible,p={x:u,y:Math.round(d.labelY)},f={x:u,y:Math.round(d.badgeY)},m={duration:.25,easing:"linear"};return se.default.createElement(se.default.Fragment,null,se.default.createElement(nc.div,{ref:t=>this.label=t,style:Object.assign(Object.assign({},p),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?p:{},transition:m},se.default.createElement(be,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:h?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:s?e.backgroundSelected:e.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(i)}},se.default.createElement(Xc,{barcode:a,barcodeImageVisible:e.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:s?e.titleSelected:e.titleDeselected,barcodeSubtitle:s?e.subtitleSelected:e.subtitleDeselected}))),o.visible&&this.count>0&&se.default.createElement(nc.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},f),animate:this.props.animateToPoints?f:{},transition:m},se.default.createElement(be,{styleConfig:Object.assign(Object.assign({},o.background),{cornerRadius:24+o.background.strokeWidth}),style:Object.assign(Object.assign({},d.badgeStyle),{width:48,height:48,color:pe.getColorValue(o.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(i)}},se.default.createElement(ce.Typography,{fontSize:16,fontWeight:"500"},"x",this.count))))}}function Xc(t){var{barcode:e}=t,n=Gc(t,["barcode"]);const o=Object(se.useContext)(Pe).useBarcodeMappedData(e);return se.default.createElement(xe,Object.assign({barcodeMappedData:o},n))}function Qc(t){const e=Object(se.useRef)(),n=Object(se.useRef)(null),[o,i]=(Object(se.useContext)(Se),Object(se.useState)(void 0)),[r,a]=Object(se.useState)(!1);Object(se.useEffect)((()=>{var n,o;t.scanningPaused?null===(n=e.current)||void 0===n||n.pause():null===(o=e.current)||void 0===o||o.resume()}),[t.scanningPaused]);const s=function(t){const e=new Wc;return e.visible=t.visible,t.polygon.visible?(e.style.highlightedPolygonFillColor=pe.getColorValue(t.polygon.selected.fillColor),e.style.highlightedPolygonStrokeColor=pe.getColorValue(t.polygon.selected.strokeColor),e.style.highlightedPolygonStrokeWidth=t.polygon.selected.strokeWidth,e.style.highlightedPolygonCornerRadius=t.polygon.selected.cornerRadius,e.style.polygonFillColor=pe.getColorValue(t.polygon.deselected.fillColor),e.style.polygonStrokeColor=pe.getColorValue(t.polygon.deselected.strokeColor),e.style.polygonStrokeWidth=t.polygon.deselected.strokeWidth,e.style.polygonCornerRadius=t.polygon.deselected.cornerRadius):(e.style.highlightedPolygonFillColor="transparent",e.style.highlightedPolygonStrokeColor="transparent",e.style.polygonFillColor="transparent",e.style.polygonStrokeColor="transparent"),e.automaticSelectionEnabled=!1,e}(t.arOverlay),l=Object.assign(Object.assign({},t.barcodeScannerViewConfig),{onBarcodesDetected:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,o.imageData,t.containerId,o.barcodes),null===(c=(l=t.barcodeScannerViewConfig).onBarcodesDetected)||void 0===c||c.call(l,o)},_onDetectionFailed:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,o,t.containerId,[]),null===(c=(l=t.barcodeScannerViewConfig)._onDetectionFailed)||void 0===c||c.call(l,o)}});return Object(se.useEffect)((()=>{const e=Uc(o,t.actionBarConfig);t.setActionButtonsVisible(e),a(e)}),[o,t.actionBarConfig]),se.default.createElement(se.default.Fragment,null,t.arOverlay.visible&&se.default.createElement(fc,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:Yc,labelComponentConfig:t.arOverlay,onBarcodeFound:t.arOnBarcodeEnter,onPolygonClick:t.arOnBarcodeClick,configuration:s}),se.default.createElement(Hc,{config:t.actionBarConfig,scanner:e.current,capabilities:o,bottomPadding:t.actionBarBottomPadding,torchEnabledInitially:t.cameraConfiguration.flashEnabled,zoomSteps:t.cameraConfiguration.zoomSteps,defaultZoomFactor:t.cameraConfiguration.defaultZoomFactor,initialCameraModule:t.cameraConfiguration.cameraModule}),se.default.createElement(Nc,{ref:e,viewFinderPadding:t.viewFinderPadding,configuration:l,onSuccess:()=>class{static setFromScanner(t,e){var n;if(!t.current)return;const o=t.current.getCapabilities();e({hasFacingOptions:o.facingMode&&o.facingMode.length>0,isTorchAvailable:null!==(n=t.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(e,i),onFailure:t.onCameraPermissionDenied,onLicenseError:t.onLicenseError}))}function Zc(t){return Object(se.useMemo)((()=>{const e=(new Ic).videoConstraints;return e.facingMode="FRONT"===t.cameraConfiguration.cameraModule?"user":"environment",e.width={ideal:t.cameraConfiguration.idealPreviewResolution.width},e.height={ideal:t.cameraConfiguration.idealPreviewResolution.height},{videoConstraints:e,backgroundColor:pe.getColorValue(t.backgroundColor),userGuidance:t.userGuidance,finder:t.viewFinder,barcodesRegexFilter:new RegExp(t.recognizerConfiguration.barcodesRegexFilter),desiredRecognitionResolution:t.recognizerConfiguration.maximumRecognizerResolution,engineMode:t.recognizerConfiguration.engineMode,barcodeFormats:t.recognizerConfiguration.barcodeFormats,gs1Handling:t.recognizerConfiguration.gs1Handling}}),[t])}var $c=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function qc(t){const[e,n]=Object(se.useState)(null),[o,i]=Object(se.useState)(!0),r=Object(se.useMemo)((()=>"__sb_"+Math.random()),[]),a=Object(se.useContext)(Pe),s=t.configuration.useCase,l=Object.assign(Object.assign({},Zc(t.configuration)),{onBarcodesDetected:e=>{e.barcodes.length>0&&!s.arOverlay.visible&&t.scanningEnabled.current&&n(e.barcodes[0])},onError:t.onError,returnBarcodeImage:!s.barcodeInfoMapping.barcodeItemMapper,containerId:r,captureDelay:0}),c=n=>$c(this,void 0,void 0,(function*(){let o;o=null===e?[]:[yield a.mapBarcodeToBarcodeItem(n,1)];const i={items:o};t.onSubmit(i)}));Object(se.useEffect)((()=>{e&&(Re.INSTANCE.beep(t.configuration.sound),Fe.INSTANCE.vibrate(t.configuration.vibration))}),[e]),Object(se.useEffect)((()=>{null===e||s.confirmationSheetEnabled||c(e)}),[e,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(e);Object(se.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(se.useContext)(Se);return se.default.createElement(se.default.Fragment,null,se.default.createElement(Oe,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{c(e)},barcodeMappedData:u},{sheetColorLoaded:(h=s).sheetColor,sheetColorLoading:h.barcodeInfoMapping.sheetColor,barcodeImageVisible:h.barcodeImageVisible,barcodeTitle:h.barcodeTitle,barcodeSubtitle:h.barcodeSubtitle,cancelButton:h.cancelButton,submitButton:h.submitButton,dividerColor:h.dividerColor,loadingMessage:h.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),se.default.createElement(ce.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},se.default.createElement(Qc,{cameraConfiguration:t.configuration.cameraConfiguration,scanningPaused:null!==e,setActionButtonsVisible:i,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:o?80:0},barcodeScannerViewConfig:l,arOnBarcodeClick:t=>n(t),arOnBarcodeEnter:e=>{s.arOverlay.automaticSelectionEnabled&&t.scanningEnabled.current&&n(e)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:r,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:t.onCameraPermissionDenied,onLicenseError:t.onError})));var h}function Kc(t){const e=Object.assign(Object.assign({},t.title),{text:pe.getLocalizedBarcodeText(t.title.text).replace("%d",t.numBarcodes.toString())});return se.default.createElement(se.default.Fragment,null,se.default.createElement(ye,Object.assign({},t.leftButton)),se.default.createElement(ce.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},se.default.createElement(ve,{config:e})),se.default.createElement(ye,Object.assign({},t.rightButton)))}function Jc(){return se.default.createElement("div",{style:{width:30,height:6,backgroundColor:ce.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function tu(t){return se.default.createElement(ce.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:t.innerRef},t.dragProps),se.default.createElement(Jc,null),se.default.createElement(Kc,Object.assign({},t.drawerHeaderContentProps)))}function eu(t){return se.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},se.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:t.color}))}function nu(t){return 0!==t.numBarcodes?null:se.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},t.style.placeholderIcon.visible&&se.default.createElement(ce.Avatar,{style:{backgroundColor:pe.getColorValue(t.style.placeholderIconBackground),width:100,height:100}},se.default.createElement(eu,{color:pe.getColorValue(t.style.placeholderIcon.color)})),se.default.createElement(ce.Typography,{style:{marginTop:20},variant:"h6"},se.default.createElement(ve,{config:t.style.placeholderTitle})),se.default.createElement(ce.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},se.default.createElement(ve,{config:t.style.placeholderSubtitle})),t.onStartClick&&t.style.startScanningButton.visible&&se.default.createElement(Ee,Object.assign({style:{width:"60%",marginTop:20}},t.style.startScanningButton,{visible:!0,onClick:t.onStartClick})))}function ou(t,e,n){const o=Object(se.useRef)(),i=Object(se.useRef)(null),[r,a]=Object(se.useState)(),[s,l]=Object(se.useState)(!1),c=Object(se.useRef)([]),u=t=>{let n="none";if(c.current.length>0){const e=200,o=((t,e)=>{let n=t[0],o=Math.abs(n.time-e);for(let i=1;i<t.length;i++){const r=Math.abs(t[i].time-e);r<o&&(n=t[i],o=r)}return n})(c.current,t.timeStamp-e),i=o.y-t.clientY,r=100;i>r?n="up":i<-r&&(n="down")}c.current.splice(0,c.current.length),e(new R(t.clientX,t.clientY),n)},d={onPointerDown:t=>{t.target.setPointerCapture(t.pointerId),l(!0),i.current=new R(t.clientX,t.clientY),a(R.empty()),t.stopPropagation()},onPointerMove:e=>{if(!s)return;const n=new R(e.clientX,e.clientY);o.current=e,a(n),t(n),c.current.push({x:e.clientX,y:e.clientY,time:e.timeStamp})},onPointerUp:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),u(t)},onPointerCancel:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),n()}};return{startPoint:i,currentPoint:r,props:d,stop:()=>{o.current.stopPropagation()},dragOngoing:s}}function iu(t){const[e,n]=Object(se.useState)(0),[o,i]=Object(se.useState)(!1),r=Object(se.useRef)(null),a=Object(se.useContext)(Se).height,s=t=>{n(t),i(!0),setTimeout((()=>{i(!1)}),500)},l=e=>{const n=e-c.startPoint.current.y;return I((t.isOpen?100:0)-100*n/(window.innerHeight-a-t.closedSheetVisibleHeight),0,100)},c=ou((t=>{n(l(t.y))}),((e,n)=>{if(e.y===c.startPoint.current.y)return;let o;o=l(e.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(o="swipe-to-open"),"down"===n&&(o="swipe-to-close"),t.onSwipe(o)}),(()=>{}));return Object(se.useEffect)((()=>{o||c.dragOngoing||!r||(t.isOpen||0===e?t.isOpen&&100!==e&&s(100):s(0))}),[t.isOpen,e,c.dragOngoing]),se.createElement("div",null,se.createElement(ue.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${fe} - ${a}px - ${t.closedSheetVisibleHeight}px) * ${e} / 100 + ${t.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:o?"height 500ms":void 0,backgroundColor:pe.getColorValue(t.contentStyle.sheetColor)},elevation:24}},se.createElement(tu,{innerRef:t=>{r.current=t},drawerHeaderContentProps:t.drawerHeaderContentProps,dragProps:c.props}),t.children,se.createElement(nu,{numBarcodes:t.numBarcodes,style:t.contentStyle,onStartClick:()=>t.onSwipe("swipe-to-close")})))}var ru=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function au(t){var{inputRef:e}=t,n=ru(t,["inputRef"]);const o=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return se.default.createElement("input",Object.assign({},o,{ref:e}))}function su(t){const e=!!t.barcode,[n,o]=se.default.useState(""),i=se.default.useRef(null),r={backgroundColor:pe.getColorValue(t.dialogStyling.sheetColor)};return Object(se.useEffect)((()=>{e&&o(String(t.barcode.count))}),[e]),se.default.createElement(se.default.Fragment,null,se.default.createElement(_e,{open:e,modalOverlayColor:t.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.focus()}},onClose:t.onCancel,PaperProps:{component:"form",onSubmit:e=>{e.preventDefault(),t.setCounter({type:"setCount",barcodes:[t.barcode.barcode],computeNewCount:()=>parseInt(n)||0})}}},se.default.createElement(ce.DialogContent,{style:r},se.default.createElement(ce.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},se.default.createElement(ve,{config:t.dialogStyling.title})),se.default.createElement(ce.Typography,{fontSize:14,textAlign:"center"},se.default.createElement(ve,{config:t.dialogStyling.info})),se.default.createElement(ce.Box,{sx:{display:"flex",border:"2px solid",borderColor:pe.getColorValue(t.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},se.default.createElement(au,{inputRef:i,value:n,onChange:t=>{const e=parseInt(t.target.value.replaceAll(/[^0-9]/g,""));o(e>=0?e.toString():"")},type:"text",pattern:"[0-9]*"}),t.dialogStyling.clearTextButton.visible&&se.default.createElement(ue.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>o(""),htmlColor:pe.getColorValue(t.dialogStyling.clearTextButton.color)}))),se.default.createElement(ce.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},se.default.createElement(ue.a,{container:!0,spacing:2},se.default.createElement(ue.a,{item:!0,xs:12},se.default.createElement(ue.a,{color:pe.getColorValue(t.dialogStyling.dividerColor)})),se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({style:{width:"100%"},onClick:t.onCancel},t.dialogStyling.cancelButton))),se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({icon:ce.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},t.dialogStyling.updateButton)))))))}function lu(t){return se.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:pe.getColorValue(t.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},se.default.createElement(ue.a,{style:{height:"100%",color:pe.getColorValue(t.config.iconColor),paddingRight:t.visibleOffset/2,cursor:"pointer"}}))}const cu=0,uu=800,du=1200;function hu(t){switch(t){case"mobile":return Object(ce.useMediaQuery)("(min-width:"+cu+"px) and (max-width:"+(uu-1)+"px)");case"tablet":return Object(ce.useMediaQuery)("(min-width:"+uu+"px) and (max-width:"+(du-1)+"px)");case"desktop":return Object(ce.useMediaQuery)("(min-width:"+du+"px)")}}const pu=150;function fu(t){const[e,n]=Object(se.useState)(0),[o,i]=Object(se.useState)(!1);let r;const a=ou((t=>{let e=a.startPoint.current.x-t.x;e<0?a.stop():n(-e)}),(t=>{if(t.x===a.startPoint.current.x)return;const e=a.startPoint.current.x-t.x;c(e>75?pu:0)}),(()=>{c(0)})),s=Object(se.useContext)(Pe),l=s.useBarcodeMappedData(t.barcode);Object(se.useEffect)((()=>{const e={barcode:t.barcode,callback:()=>t.onDelete(t.barcode)};return s.addOnEvictionListener(e),()=>{s.removeOnEvictionListener(e)}}),[]);const c=e=>{const o=e>=pu,a=-r.getBoundingClientRect().width;n(o?a:0),i(!0),setTimeout((()=>{i(!1),o&&t.onDelete(t.barcode)}),200)},u=hu("desktop")&&t.swipeToDeleteConfig.enabled,d=!u&&t.swipeToDeleteConfig.enabled;return Object(se.useEffect)((()=>{d||c(0)}),[d]),se.default.createElement(ce.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:t=>r=t},se.default.createElement(lu,{config:t.swipeToDeleteConfig,visibleOffset:pu}),se.default.createElement(ce.Box,Object.assign({sx:{width:"100%",backgroundColor:pe.getColorValue(t.sheetColor),transform:`translateX(${e}px)`,transition:o?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),se.default.createElement(xe,Object.assign({barcodeMappedData:l},t)),null!==t.readonlyCount&&se.default.createElement(ce.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:pe.getColorValue("?sbColorOnSurfaceVariant")}},"x",t.readonlyCount),u&&se.default.createElement(ue.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:pe.getColorValue("?sbColorOnSurface")},onClick:()=>t.onDelete(t.barcode)}),se.default.createElement(ce.Box,{sx:{width:"0px"}})))}function mu(t){const e=pe.getColorValue(t.sheetContent.dividerColor),n=t.sheetContent.manualCountChangeEnabled&&"COUNTING"===t.mode;return se.default.createElement(se.default.Fragment,null,se.default.createElement(ce.Divider,{style:{borderColor:e}}),t.barcodes.length>0&&se.default.createElement(ue.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},se.default.createElement(ue.a,{sx:{p:0}},t.barcodes.map((({barcode:o,count:i})=>se.default.createElement(ue.a,{key:o.format+o.text,sx:{padding:0,borderBottom:`1px solid ${e}`}},se.default.createElement(fu,{barcode:o,onDelete:()=>t.onBarcodeChange({type:"remove",barcode:o}),counterForm:n&&{counter:i,manualCountChangeColor:t.sheetContent.manualCountChangeColor,manualCountOutlineColor:t.sheetContent.manualCountOutlineColor,setCounter:e=>{t.onBarcodeChange({type:"setCount",barcodes:[o],computeNewCount:()=>e})},onNumberClick:()=>t.onNumberClick({barcode:o,count:i})},readonlyCount:"COUNTING"!==t.mode||t.sheetContent.manualCountChangeEnabled?null:i,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:t.sheetContent.barcodeItemImageVisible,barcodeTitle:t.sheetContent.barcodeItemTitle,barcodeSubtitle:t.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:t.sheetContent.swipeToDelete,sheetColor:t.sheetContent.sheetColor})))))))}function gu(t){return se.default.createElement(ce.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:t.count,showZero:!0,color:"primary",overlap:"circular",slotProps:{badge:{style:{backgroundColor:t.backgroundColor,color:t.foregroundColor,fontWeight:"bold"}}}},t.children)}function vu(t){if(!t.buttonStyling.visible)return null;return se.default.createElement(ce.Box,{style:t.style},se.default.createElement(gu,{count:t.count,backgroundColor:pe.getColorValue(t.buttonStyling.badgeBackgroundColor),foregroundColor:pe.getColorValue(t.buttonStyling.badgeForegroundColor)},se.default.createElement(ce.IconButton,{sx:{backgroundColor:pe.getColorValue(t.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:pe.getColorValue(t.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:t.onClick,disableRipple:!0,disableFocusRipple:!0},se.default.createElement(ue.a,{sx:{color:pe.getColorValue(t.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:pe.getColorValue(t.buttonStyling.activeForegroundColor)}}}))))}const Au=(t,e)=>t.format===e.format&&t.text===e.text;function bu(t,e){switch(e.type){case"setCount":{let n=[...t];for(const t of e.barcodes){const o=n.findIndex((e=>Au(e.barcode,t)));if(-1===o)n.push({barcode:t,count:e.computeNewCount(0)});else{const t=n[o];n[o]=Object.assign(Object.assign({},t),{count:e.computeNewCount(t.count)})}}return n}case"remove":return t.map((t=>Object.assign(Object.assign({},t),{count:Au(t.barcode,e.barcode)?0:t.count})));case"clear":return t.map((t=>Object.assign(Object.assign({},t),{count:0})));case"setHtmlElements":let n=!1;const o=t.map((t=>Au(t.barcode,e.barcode)?(n=!0,Object.assign(Object.assign({},t),{polygonElement:e.polygonElement,labelElement:e.labelElement})):t));return n||o.push({barcode:e.barcode,count:0,labelElement:e.labelElement,polygonElement:e.polygonElement}),o}}var yu=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function Su(t){const e=Object(se.useRef)(),[n,o]=Object(se.useReducer)(bu,[]),[i,r]=Object(se.useState)(),a=Object(se.useRef)(new Date("2001-01-01")),[s,l]=se.default.useState(null),[c,u]=Object(se.useState)(!1),d=Object(se.useMemo)((()=>"__sb_"+Math.random()),[]),[h,p]=Object(se.useState)(!0),f=Object(se.useContext)(Pe),m=t.configuration.useCase,g=Object(se.useRef)(Object.assign(Object.assign({},Zc(t.configuration)),{onBarcodesDetected:e=>{if(!((new Date).getTime()-a.current.getTime()<m.countingRepeatDelay)&&t.scanningEnabled.current)if(!m.arOverlay.visible||m.arOverlay.automaticSelectionEnabled){let n=!1;o({type:"setCount",barcodes:e.barcodes,computeNewCount:e=>{let o="COUNTING"===m.mode?e+1:1;return o===e||n||(a.current=new Date,Re.INSTANCE.beep(t.configuration.sound),Fe.INSTANCE.vibrate(t.configuration.vibration)),o}})}else o({type:"setCount",barcodes:e.barcodes,computeNewCount:t=>t})},_onDetectionFailed(t){},onError:t.onError,returnBarcodeImage:!0,captureDelay:1e3/60}));Object(se.useEffect)((()=>{g.current.container=e.current}),[e]),Object(se.useEffect)((()=>{for(const t of n){if(t.polygonElement){const e=t.count>0?m.arOverlay.polygon.selected:m.arOverlay.polygon.deselected;t.polygonElement.style({fill:m.arOverlay.polygon.visible?pe.getColorValue(e.fillColor):"transparent",stroke:m.arOverlay.polygon.visible?pe.getColorValue(e.strokeColor):"transparent",strokeWidth:e.strokeWidth,cornerRadius:e.cornerRadius})}t.labelElement&&(t.labelElement.update(Object.assign(Object.assign({},t.labelElement.state.element),{highlighted:t.count>0})),t.labelElement.setCount(t.count))}}),[n]);const v=n.reduce(((t,e)=>t+e.count),0),A=se.default.createElement(mu,{barcodes:n.filter((t=>t.count>0)),onBarcodeChange:o,sheetContent:m.sheetContent,onNumberClick:t=>l(t),mode:m.mode}),b={numBarcodes:v,leftButton:Object.assign(Object.assign({},m.sheetContent.clearAllButton),{onClick:()=>o({type:"clear"})}),rightButton:Object.assign(Object.assign({},m.sheetContent.submitButton),{onClick:()=>yu(this,void 0,void 0,(function*(){const e=n.filter((t=>t.count>0)).map((t=>f.mapBarcodeToBarcodeItem(t.barcode,"COUNTING"===m.mode?t.count:1)));t.onSubmit({items:yield Promise.all(e)})}))}),title:m.sheetContent.title},y=hu("mobile"),S="BUTTON"!==m.sheet.mode&&y?"SMALL"===m.sheet.collapsedVisibleHeight?69:128:0,C=y&&"BUTTON"===m.sheet.mode,w=C?76:0,x=(h?80:0)+w,E=Object(se.useContext)(Se);return se.default.createElement(se.default.Fragment,null,se.default.createElement(ue.a,{container:!0,sx:{display:"flex",flexDirection:y?"column":"row",height:`calc(${E.remainingVisibleBodyHeight} - ${S}px)`},alignItems:"stretch"},se.default.createElement(ue.a,{id:d,item:!0,ref:e,component:"div",xs:y?12:7,zIndex:100},C&&se.default.createElement(vu,{style:{position:"absolute",marginTop:`calc(${E.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},count:v,onClick:()=>u(!c),buttonStyling:m.sheet.listButton}),se.default.createElement(Qc,{viewFinderPadding:{minTopPadding:E.minTopPaddingForContent,minBottomPadding:x},arOverlay:Object.assign(Object.assign({},m.arOverlay),{counterBadge:Object.assign(Object.assign({},m.arOverlay.counterBadge),{visible:m.arOverlay.counterBadge.visible&&"COUNTING"===m.mode})}),containerId:d,barcodeScannerViewConfig:g.current,onCameraPermissionDenied:t.onCameraPermissionDenied,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16+w,setActionButtonsVisible:p,arOnBarcodeClick:e=>{o({type:"setCount",barcodes:[e],computeNewCount:e=>{const n="UNIQUE"===m.mode?1-e:e+1;return n>0&&(Re.INSTANCE.beep(t.configuration.sound),Fe.INSTANCE.vibrate(t.configuration.vibration)),n}})},arOnBarcodeEnter:(t,e,n)=>{n&&e&&o({type:"setHtmlElements",barcode:t,labelElement:n,polygonElement:e})},scanningPaused:c&&y,cameraConfiguration:t.configuration.cameraConfiguration,onLicenseError:t.onError}),y&&se.default.createElement(iu,{closedSheetVisibleHeight:S,sheetStyle:m.sheet,contentStyle:m.sheetContent,manualCountEditDialog:m.manualCountEditDialog,numBarcodes:v,onBarcodeChange:t=>o(t),drawerHeaderContentProps:b,isOpen:c,onSwipe:t=>{u("swipe-to-open"===t)}},A)),function(t){switch(t){case"mobile":return Object(ce.useMediaQuery)("(min-width:"+cu+"px)");case"tablet":return Object(ce.useMediaQuery)("(min-width:"+uu+"px)");case"desktop":return Object(ce.useMediaQuery)("(min-width:"+du+"px)")}}("tablet")&&se.default.createElement(ue.a,{item:!0,xs:y?12:5,component:"div",style:{paddingTop:E.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:pe.getColorValue(m.sheetContent.sheetColor)},zIndex:1050},se.default.createElement(ue.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},se.default.createElement(Kc,Object.assign({},b))),A,se.default.createElement(nu,{numBarcodes:v,style:m.sheetContent}))),se.default.createElement(su,{barcode:s,dialogStyling:m.manualCountEditDialog,onCancel:()=>l(null),setCounter:t=>{o(t),l(null)}}))}const Cu=Object(se.createContext)(null),wu={didCatch:!1,error:null};class xu extends se.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=wu}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(null!==t){for(var e,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];null===(e=(n=this.props).onReset)||void 0===e||e.call(n,{args:i,reason:"imperative-api"}),this.setState(wu)}}componentDidCatch(t,e){var n,o;null===(n=(o=this.props).onError)||void 0===n||n.call(o,t,e)}componentDidUpdate(t,e){const{didCatch:n}=this.state,{resetKeys:o}=this.props;var i,r;n&&null!==e.error&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some(((t,n)=>!Object.is(t,e[n])))}(t.resetKeys,o)&&(null===(i=(r=this.props).onReset)||void 0===i||i.call(r,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(wu))}render(){const{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:i,error:r}=this.state;let a=t;if(i){const t={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)a=e(t);else if(n)a=Object(se.createElement)(n,t);else{if(null!==o&&!Object(se.isValidElement)(o))throw r;a=o}}return Object(se.createElement)(Cu.Provider,{value:{didCatch:i,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Eu(t){const e=Object(se.useContext)(de).getColorValue,n={backgroundColor:e(t.sheetColor)};return se.default.createElement(_e,{modalOverlayColor:t.modalOverlayColor,open:t.open},se.default.createElement(ce.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},se.default.createElement(ce.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},se.default.createElement(ve,{config:t.title})),se.default.createElement(ce.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},se.default.createElement(ve,{config:t.subtitle}))),se.default.createElement(ce.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},se.default.createElement(ue.a,{container:!0,spacing:2},se.default.createElement(ue.a,{item:!0,xs:12},se.default.createElement(ue.a,{color:e(t.dividerColor)})),se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({style:{width:"100%"},onClick:t.handleCancel},t.cancelButton))),se.default.createElement(ue.a,{item:!0,xs:6},se.default.createElement(Ee,Object.assign({icon:ce.Replay,style:{width:"100%"},onClick:t.handleRetry},t.retryButton))))))}function Lu(t){const e=Object(se.useContext)(Se);return se.default.createElement(ce.Box,{sx:{paddingTop:e.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:pe.getColorValue(t.config.background)}},se.default.createElement(ce.Box,{sx:{height:e.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},t.config.icon.visible&&se.default.createElement(ce.Box,null,se.default.createElement(ce.Avatar,{sx:{width:100,height:100,backgroundColor:pe.getColorValue(t.config.iconBackground),margin:"24px"}},se.default.createElement(ue.a,{sx:{fontSize:50,color:pe.getColorValue(t.config.icon.color)}}))),se.default.createElement(ce.Typography,{sx:{fontSize:20,textAlign:"center"}},se.default.createElement(ve,{config:t.config.enableCameraTitle})),se.default.createElement(ce.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},se.default.createElement(ve,{config:t.config.enableCameraExplanation})),se.default.createElement(ce.Box,{sx:{paddingTop:"16px"}},se.default.createElement(ye,Object.assign({},t.config.closeButton,{onClick:t.onAppClose})))))}function _u(t){const e=Object(se.useRef)(Object(ce.createTheme)({palette:{primary:{main:on.ScanbotPrimary},secondary:{main:on.DarkGray}}})),[n,o]=Object(se.useState)(!1),[i,r]=Object(se.useState)(!1),[a,s]=Object(se.useState)(t.configuration.timeouts.initialScanDelay<=0),l=Object(se.useRef)(!1),c=Object(se.useRef)(),u=Object(se.useRef)(),d=Object(se.useMemo)((()=>new We(t.configuration.useCase.barcodeInfoMapping.barcodeItemMapper,((t,e)=>{o(!0),c.current=()=>{o(!1),t()},u.current=()=>{o(!1),e()}}))),[]);let h;if(Object(se.useMemo)((()=>{pe.setPalette(t.configuration.palette),pe.setBarcodeTextLocalization(t.configuration.localization)}),[t.configuration]),Object(se.useEffect)((()=>{if(t.configuration.timeouts.autoCancelTimeout>0){const e=setTimeout((()=>{t.onClose()}),t.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(e)}}}),[]),Object(se.useEffect)((()=>{if(t.configuration.timeouts.initialScanDelay>0){const e=setTimeout((()=>{s(!0)}),t.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(e)}}}),[]),Object(se.useEffect)((()=>{l.current=!n&&a}),[n,a]),"SingleScanningMode"===t.configuration.useCase._type)h=se.default.createElement(qc,{configuration:t.configuration,onClose:t.onClose,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l});else{if("MultipleScanningMode"!==t.configuration.useCase._type)throw new Error("Unsupported use case type");h=se.default.createElement(Su,{configuration:t.configuration,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l})}return se.default.createElement(se.default.Fragment,null,se.default.createElement(me,null),se.default.createElement(xu,{onError:t.onError,fallback:se.default.createElement("div",null,"Error")},se.default.createElement(de.Provider,{value:he(t.configuration.palette)},se.default.createElement(Pe.Provider,{value:d},se.default.createElement(ce.ThemeProvider,{theme:e.current},se.default.createElement(Eu,Object.assign({open:n,handleCancel:u.current,handleRetry:c.current,modalOverlayColor:t.configuration.useCase.barcodeInfoMapping.modalOverlayColor,dividerColor:t.configuration.useCase.barcodeInfoMapping.dividerColor,sheetColor:t.configuration.useCase.barcodeInfoMapping.sheetColor},t.configuration.useCase.barcodeInfoMapping.errorState)),se.default.createElement(ue.a,{sx:{height:`100 * ${fe}`,width:"100vw",backgroundColor:pe.getColorValue(t.configuration.backgroundColor)}},se.default.createElement(Ce,Object.assign({onBackPress:t.onClose},t.configuration.topBar),!i&&h,i&&se.default.createElement(Lu,{onAppClose:t.onClose,config:t.configuration.cameraPermission}))))))))}var Ou=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class ku{static createBarcodeScanner(t){return new Promise(((e,n)=>{Re.INSTANCE.initialize(t.sound);const o=ku.createContainer("barcode-scanner-controller"),i=Object(le.createRoot)(o),r=()=>Ou(this,void 0,void 0,(function*(){return new Promise((t=>{window.setTimeout((()=>{i.unmount(),document.body.removeChild(o),t()}),0)}))})),a=t=>Ou(this,void 0,void 0,(function*(){yield r(),n(t)}));i.render(se.default.createElement(_u,{configuration:t,onClose:()=>Ou(this,void 0,void 0,(function*(){yield r(),e(null)})),onSubmit:t=>Ou(this,void 0,void 0,(function*(){yield r(),e(t)})),onError:a})),(()=>{Ou(this,void 0,void 0,(function*(){try{const t=yield Ed.instance.getLicenseInfo();t.isValid()||(yield a(new Yt(t)))}catch(t){yield a(t)}}))})()}))}static createContainer(t){const e=document.createElement("div");return e.id=t,e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.zIndex="1000",e.style.top="0",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(e),e}}ku.Config=o;var Tu=ku,Pu=n(13),Wu={insert:"head",singleton:!1};gc()(Pu.a,Wu),Pu.a.locals;class Bu extends se.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return se.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],o=this.props.points[(e+1)%this.LINE_COUNT];t.push(se.default.createElement("line",{key:e,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:o.x,y2:o.y}))}return t}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}Bu.CLASSNAME="scanbot-document-outline";class Du extends se.default.Component{constructor(t){super(t),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(t,e,n,o){const i={points:t,animatedPoints:e,isOk:n,isVisible:o};this.setState(i)}pointStringOrLatestValidPoints(t){return t&&t.length>0?R.toSvgString(t):R.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=yc()(Bu.CLASSNAME,{[`${Bu.CLASSNAME}-ok`]:this.state.isOk},{[`${Bu.CLASSNAME}-visible`]:this.state.isVisible},{[`${Bu.CLASSNAME}-hidden`]:!this.state.isVisible});return se.default.createElement(nc.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})}}var Iu=Du;class Ru extends se.default.Component{constructor(t){super(t),this.state={path:void 0}}render(){var t,e;return this.state.path?se.default.createElement(nc.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0},transition:{duration:this.props.duration/1e3,ease:"easeInOut",repeat: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,fill:"none",d:this.state.path,className:`${Bu.CLASSNAME}-path`}):null}animate(t){const e="M"+R.toSvgString(t)+"z";this.setState({path:e})}clear(){this.setState({path:void 0})}}class Mu extends se.default.Component{render(){return se.default.createElement(nc.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},se.default.createElement(Iu,{ref:t=>this.polygon=t,style:this.props.polygonStyle}),se.default.createElement(Ru,{ref:t=>this.path=t,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(t,e,n){var o;const i="processing"!==n&&!!t,r=null!==(o=this.previous)&&void 0!==o?o:t,a=this.previous?t:void 0;this.polygon.update(r,a,e,i),this.previous=t,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class Fu extends se.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,o="searching"===this.props.action||"capturing"===this.props.action,i="processing"!==this.props.action&&n,r=yc()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return se.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},se.default.createElement(Mu,{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:i,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),o&&se.default.createElement("label",{ref:t=>this.label=t,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){this.polygon.update(e,t,this.props.action),this.label&&(this.label.innerHTML=n)}}class ju{static isConvex(t){if(t.length<4)return!0;let e=!1,n=t.length;for(let o=0;o<n;o++){const i=t[(o+2)%n].x-t[(o+1)%n].x,r=t[(o+2)%n].y-t[(o+1)%n].y,a=t[o].x-t[(o+1)%n].x,s=i*(t[o].y-t[(o+1)%n].y)-r*a;if(0==o)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)}static intersection(t,e){const n=t[0],o=R.subtract(t[1],n),i=e[0],r=R.subtract(e[1],i);if(0===R.cross(o,r))return;const a=R.cross(R.subtract(i,n),o)/R.cross(o,r);return R.add(i,R.multiply(r,a))}}class Vu{constructor(t,e=Vu.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 ju.distanceBetweenPoints(t,e)/this.maxDistance>this.sensitivity}calculateMaxDistance(t){let e=new R(0,0),n=new R(t.width,t.height);return ju.distanceBetweenPoints(e,n)}}Vu.DEFAULT_SENSITIVITY=.5;var zu=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Nu extends Ye{constructor(t){if(super(t),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>zu(this,void 0,void 0,(function*(){const t=yield this.detectAndCrop();this.configuration.onDocumentDetected(t)})),Object.assign(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(!Ed.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=S.fromJson(this.props.configuration)),this._configuration}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(t){return zu(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,o)=>{Object(se.render)(se.default.createElement(Nu,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}detectAndCrop(){var t;return zu(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"});const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Nu.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);if(!e)return;ae.debug("Detect & Crop document of size: "+e.height*e.width);const n=new Ze(e.width,e.height),o=yield this.bridge.postByTransferringArgs("detectAndCropDocument",[e]);return o.videoSize=n,o}}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 zu(this,void 0,void 0,(function*(){t.componentDidMount.call(this),this.detect(),this.recognizer=yield this.bridge.postByTransferringArgs("createDocumentDetector",[{useCombinedDetector:!1,acceptedBrightnessThreshold:this.configuration.acceptedBrightnessThreshold,acceptedAngleScore:this.configuration.acceptedAngleScore,acceptedSizeScore:this.configuration.acceptedSizeScore}])}))}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return zu(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield Ed.instance.release(this.recognizer,"Document Scanner")}))}detect(){var t,e;return zu(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 o=this.scalePolygonPointsToPixels(t.polygon);this.outline.update(n,o,P.getProperty(this.configuration.text.hint,e)),yield this.handleAutoCapture(n,o)}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(){var t;return zu(this,void 0,void 0,(function*(){const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Ye.DEFAULT_DETECTION_RESOLUTION);if(!e||!this.enabled)return;const n=[this.recognizer,e];return yield this.bridge.postByCopyingArgs("documentDetectorDetect",n)}))}handleAutoCapture(t,e){return zu(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(t&&!this.autoCaptureToken&&e){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const t=this.getCameraFrameSize();this.polygonMovementPredicate=new Vu(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>zu(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.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e,n;const{action:o}=this.state,{configuration:i}=this,r=null===(t=i.style)||void 0===t?void 0:t.captureButton;return se.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),se.default.createElement(qe,{configuration:this.configuration,videoConstraints:i.videoConstraints,mirrored:i.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),se.default.createElement(Fu,{ref:t=>{this.outline=t},style:null===(n=i.style)||void 0===n?void 0:n.outline,action:o,autoCaptureSensitivity:this.autoCaptureSensitivity}),se.default.createElement(Cc,{color:(null==r?void 0:r.color)?r.color:"FFF",action:o,onClick:this.enabled?i.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=Ze.fromHtmlElement(this.camera.video),o=Fc.findScale(n,e);t=(t=Fc.convertToViewportPointsFromParentSize(e,t)).map((t=>R.scaleToPoint(t,o.x,o.y,o.scale)))}return t}runMovementPredicate(t){const e=this.polygonMovementPredicate.check(t);return this.polygonMovementPredicate.update(t),e}getCameraFrameSize(){return this.camera.calculateFrameSize(Ye.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}Nu.DETECT_AND_CROP_RESOLUTION=0;var Uu=Nu;class Hu extends Ut{constructor(){super(h.DEFAULT_VIDEO_RESOLUTION_HD),this.onMrzDetected=function(t){},this.finder.aspectRatio.width=4,this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(t){const e=new Hu;return this.mapValues(t,e,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(e,t),this.mapVideoConstraints(t,e),e}}var Gu=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Yu extends Ye{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=Hu.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t,e){return Gu(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(((o,i)=>{Object(se.render)(se.default.createElement(Yu,{container:n,configuration:t,onSuccess:o,onFailure:i,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Gu(this,void 0,void 0,(function*(){Rc.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){Rc.warn("Mrz detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Gu(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Gu(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Gu(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n;return Gu(this,void 0,void 0,(function*(){const o=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let i=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const r=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Yu.FRAME_RESOLUTION);if(!r)return;o&&this.forceUpdate();const a=yield this.props.mrzRecognizer.recognize(r);if(!this.enabled)return;if(null===a)return;a?(i=!0,this.configuration.onMrzDetected(a)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(r))}catch(t){console.log(t)}finally{i?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}render(){var t;return se.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),se.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},se.default.createElement(qe,{configuration:this.configuration,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&&se.default.createElement(Ke,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Yu.FRAME_RESOLUTION=1200;var Xu=Yu;class Qu{constructor(){this.disabled=!1,this.color="transparent"}}class Zu{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}class $u{constructor(){this.color="#1ec31e",this.width=4}}class qu{constructor(){this.padding=10}}class Ku{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Ju{constructor(){this.width=2,this.color="white"}}class td{constructor(){this.size=20,this.color="white"}}class ed extends d{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new qu,this.style.magneticLines=new Qu,this.style.polygon=new $u,this.style.polygon.handles=new Zu,this.style.magnifier=new Ku,this.style.magnifier.border=new Ju,this.style.magnifier.crosshair=new td}static fromJson(t){const e=new ed;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}}class nd extends se.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return se.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},se.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.snapToClosestIfAnyAreClose()}render(){var t,e,n,o,i,r;return se.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===(r=null===(i=null===(o=this.props.lines)||void 0===o?void 0:o.vertical)||void 0===i?void 0:i.scaled)||void 0===r?void 0:r.map((t=>this.fromPoint(t))))}snapToClosestIfAnyAreClose(){var t,e,n,o;const i=this.props.movingLine;let r=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;if(i.isHorizontal&&(r=null===(o=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===o?void 0:o.scaled),!r)return;const a=this.midPoint(i.points[0].coordinates,i.points[1].coordinates),s=r.map((t=>({distance:this.distanceToLine(t,a),mLine:t})));s.sort(((t,e)=>t.distance-e.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:i})}distanceToLine(t,e){const n=e.x-t.p1.x,o=e.y-t.p1.y,i=t.p2.x-t.p1.x,r=t.p2.y-t.p1.y,a=i*i+r*r;if(0===a)return 1/0;const s=(n*i+o*r)/a;let l;return l=s<=0?t.p1:s>=1?t.p2:new R(t.p1.x+s*i,t.p1.y+s*r),R.distance(e,l)}midPoint(t,e){return new R((t.x+e.x)/2,(t.y+e.y)/2)}}class od extends se.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}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class id extends od{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],o=se.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:t=>this.cornerTouchEnd(t),onPointerMove:t=>this.cornerTouchMove(t,e),"data-sb-cropping-corner":e},se.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));t.push(o)}return t}cornerTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=R.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=R.fromHtmlElement(o);this.parentOffset=new R(n.x-i.x,n.y-i.y),this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=R.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),{x:o,y:i}=(r={x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},a=this.pointSize,s=this.props.containerSize,new R(I(r.x,-a/2,s.width-a/2),I(r.y,-a/2,s.height-a/2)));var r,a,s;const l=this.pointSize/2,c=this.props.points[e];this.props.points[e]=new R(o+l,i+l),ju.isConvex(this.props.points)?this.props.cornerMoved({index:e,point:this.props.points[e]}):this.props.points[e]=c}cornerTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return se.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class rd extends od{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 o=this.props.points[this.nextIndex(e)];const i=se.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(o.x-n.x)/2-this.pointSize/2+"px",top:n.y+(o.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:t=>this.lineTouchEnd(t),"data-sb-cropping-side":e},se.default.createElement("div",{style:this.invisibleHandleStyle}));t.push(i)}return t}lineTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=R.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=R.fromHtmlElement(o),r=this.props.points[e],a=this.props.points[this.nextIndex(e)];this.point0Start=P.copy(this.props.points[this.previousIndex(e)]),this.point1Start=P.copy(r),this.point2Start=P.copy(a),this.point3Start=P.copy(this.props.points[this.nextIndex(this.nextIndex(e))]),this.point1Offset=new R(r.x-i.x,r.y-i.y),this.point2Offset=new R(a.x-i.x,a.y-i.y),this.parentOffset=new R(n.x-i.x,n.y-i.y)}lineTouchMove(t,e){if(!this.parentOffset)return;const n=R.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.props.points[this.previousIndex(e)];let i=new R(null,null),r=new R(null,null);const a=this.props.points[this.nextIndex(e+1)],s=n.x-this.parentOffset.x,l=n.y-this.parentOffset.y;if(this.isHorizontal(e)){const t=l+this.point1Offset.y,e=l+this.point2Offset.y,n=t-this.point1Start.y;i.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),i.y=t,r.y=e}else{const t=s+this.point1Offset.x,e=s+this.point2Offset.x,n=t-this.point1Start.x;i.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),i.x=t,r.x=e}i=R.clamp(i,this.props.containerSize),r=R.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,i,o,this.isHorizontal(e)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(e)?"y":"x")||this.areEdgesCrossing(o,i,r,a)||ju.isConvex([o,i,r,a])&&(this.props.points[e].x=i.x,this.props.points[e].y=i.y,this.props.points[this.nextIndex(e)].x=r.x,this.props.points[this.nextIndex(e)].y=r.y,this.props.lineMoved({points:[{index:e,coordinates:i},{index:this.nextIndex(e),coordinates:r}],previousPoint:o,nextPoint:a,isHorizontal:this.isHorizontal(e)}))}lineTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null}isNearOpposingPoint(t,e,n,o){if(t[o]>n[o]){if(e[o]-10<n[o])return!0}else if(e[o]>n[o]-10)return!0;return!1}areEdgesCrossing(t,e,n,o){const i=t.x,r=t.y,a=e.x,s=e.y,l=n.x,c=n.y,u=o.x,d=o.y;return((i-l)*(s-c)-(r-c)*(a-l))*((i-u)*(s-d)-(r-d)*(a-u))<0&&((l-i)*(d-r)-(c-r)*(u-i))*((l-a)*(d-s)-(c-s)*(u-a))<0}render(){return se.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class ad extends se.default.Component{render(){return se.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},se.default.createElement(id,{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:this.props.cornerMoveEnd}),se.default.createElement(rd,{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,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.previousPoint,t.polygonLine.points[0].coordinates],n=[t.polygonLine.points[1].coordinates,t.polygonLine.nextPoint],o=[t.magneticLine.p1,t.magneticLine.p2];this.props.coordinatePoints[t.polygonLine.points[0].index]=ju.intersection(e,o),this.props.coordinatePoints[t.polygonLine.points[1].index]=ju.intersection(n,o),this.props.cornerMoveEnd(),this.setFrame()}}class sd extends se.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return se.default.createElement("div",null,se.default.createElement(ad,{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})}}),se.default.createElement(nd,{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()}}),se.default.createElement(Bu,{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()}}class ld extends se.default.Component{render(){return se.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)}})}}class cd extends se.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:o,duration:i}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=ze.b`
35
35
  from {transform: rotate(${r}deg) scale(${this.previousScale}); }
36
36
  to {transform: rotate(${a}deg) scale(${o});
37
- }`,l=ze.a.div`position: absolute; animation: ${s} ${i}s;`;return this.previousScale=o,se.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:t=>this.container=t},se.default.createElement(l,{style:{width:this.calculate(t,"width"),height:this.calculate(t,"height"),transform:`rotate(${a}deg) scale(${o})`,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 0;n.width,n.height;return t[e]}calculate(t,e){return t?t[e]:"100%"}}class ud extends se.default.Component{componentDidMount(){Fc.disableScreenMovement()}componentWillUnmount(){Fc.enableScreenMovement()}render(){return se.default.createElement("div",null)}}class dd{constructor(t,e){this.element=t,this.size=e}}class hd{}class pd extends se.default.Component{render(){return se.default.createElement("div",{style:this.props.style},se.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const t=this.half();return se.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 se.default.createElement("line",{x1:0,y1:t,x2:this.props.size,y2:t,stroke:this.props.color,strokeWidth:"2"})}}class fd extends se.default.Component{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}constructor(t){super(t),this.MAX_ROTATIONS=4,this.state={frame:T.empty(),cropImageFitSize:Ze.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}}}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?se.default.createElement("div",{style:this.style().container},se.default.createElement("img",{style:this.style().image,ref:t=>this.destination=t,src:this.props.src,alt:"."}),se.default.createElement(pd,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(t){if(!this.state.visible)return;this.destination.src=t.source.element.src;const e=T.fromPoint(R.scaleUpTo(t.origin,new Ze(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=t.container.width-(this.props.style.margin+this.props.style.size),o=this.isPointTopLeft(t.origin,t.source.size,t.rotations);this.setState({frame:e,cropImageFitSize:t.source.size,rotation:{count:t.rotations,scale:t.scale},margin:{left:o?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 o=t.x,i=t.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?o<a&&i<a:1===r?o<a&&i>e.height-a:2===r?o>e.width-a&&i>e.height-a:o>e.width-a&&i<a}setIsVisible(t,e){this.setState({visible:t},e)}normalizeRotations(t){return t%this.MAX_ROTATIONS}}var md=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class gd extends se.default.Component{constructor(t){super(t),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.state={image:void 0,polygon:void 0,calculatedSize:Ze.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:R.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(t){return md(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,o)=>{Object(se.render)(se.default.createElement(gd,{onReady:n,onError:o,container:e,configuration:ed.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return md(this,void 0,void 0,(function*(){const o=null===(t=this.configuration)||void 0===t?void 0:t.image,i=yield this.detectContour(o);this.setState({image:yield B.toDataUrl(o),polygon:null!==(n=null===(e=this.configuration)||void 0===e?void 0:e.polygon)&&void 0!==n?n:i.polygon,magneticLines:{vertical:{original:i.verticalLines},horizontal:{original:i.horizontalLines}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return md(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(t){return md(this,void 0,void 0,(function*(){Ze.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.initializeSizes())}))}onResize(){const t=this.state.points.map((t=>new R(t.x/this.state.calculatedSize.width,t.y/this.state.calculatedSize.height)));this.initializeSizes(t)}initializeSizes(t,e,n){const o=new Ze(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),i=new Ze(this.container.width(),this.container.height()),r=B.getObjectFitSize(i,o),a=new Ze(r.width,r.height),s=null!=t?t:this.state.polygon,l=Fc.convertToViewportPointsFromParentSize(a,s),c=null!=e?e:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=Fc.convertLinesToViewportLines(a,c),h=Fc.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:l,magneticLines:{horizontal:{original:c,scaled:d},vertical:{original:u,scaled:h}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var t,e,n,o,i,r;const a=Bu.CLASSNAME,s=yc()({[a]:!0,[`${a}-visible`]:!0}),l=this.configuration.style.polygon.width,c=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?l/this.state.animation.scale:l,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return se.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},se.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&se.default.createElement(ud,null),se.default.createElement(fd,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),se.default.createElement(cd,{ref:t=>this.container=t,size:this.state.calculatedSize,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===(o=this.state.animation)||void 0===o?void 0:o.duration,imageMargin:this.state.imageMargin},se.default.createElement(ld,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),se.default.createElement(sd,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${c}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(i=this.state.animation)||void 0===i?void 0:i.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!0,(()=>{var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}))}updateMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}magnifierOptions(t){const e=new hd;return e.source=new dd(this.htmlImage,this.state.calculatedSize),e.container=new Ze(this.container.width(),this.container.height()),e.origin=t.point,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 md(this,void 0,void 0,(function*(){const e=R.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCcwRotations(this.rotations);return{image:yield Ed.instance.cropAndRotateImageCcw(null===(t=this.configuration)||void 0===t?void 0:t.image,e,n),polygon:e,rotations:this.rotations}}))}toCcwRotations(t){return this.MAX_ROTATIONS-t%this.MAX_ROTATIONS}rotate(t){return md(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.state.calculatedSize);this.setState({animation:{rotations:this.rotations+t,scale:e,duration:1}})}))}detect(){var t;return md(this,void 0,void 0,(function*(){const e=yield this.detectContour(null===(t=this.configuration)||void 0===t?void 0:t.image);this.initializeSizes(e.polygon,e.horizontalLines,e.verticalLines)}))}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(se.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=ed.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 Math.min(this.container.width()/t.height,this.container.height()/t.width)}calculateMargin(t){return t.width>t.height?{x:0,y:this.container.height()/2-t.height/2}:{x:this.container.width()/2-t.width/2,y:0}}detectContour(t){return Ed.instance.detectAndCropDocument(t)}}var vd=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ad extends Ye{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(t,e,n){return vd(this,void 0,void 0,(function*(){const o=document.getElementById(t.containerId);if(!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,r)=>{Object(se.render)(se.default.createElement(Ad,{container:o,configuration:t,onTextDetected:e,onSuccess:i,onFailure:r,textDataScanner:n}),o)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return vd(this,void 0,void 0,(function*(){Rc.warn("TextData detection resumed"),yield this.resume()}))}pauseDetection(){Rc.warn("TextData detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return vd(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.textDataScanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return vd(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return vd(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.textDataScanner.cleanRecognitionQueue(),this.paused=!0}detect(){var t,e;return vd(this,void 0,void 0,(function*(){const n=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let o=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const i=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Ad.FRAME_RESOLUTION);if(!i)return;n&&this.forceUpdate();const r=yield this.props.textDataScanner.recognize(i);if(!this.enabled)return;if(null===r)return;r&&(o=!0,this.props.onTextDetected(r))}catch(t){console.log(t)}finally{o?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var t;return se.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),se.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},se.default.createElement(qe,{configuration:this.configuration,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&&se.default.createElement(Ke,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Ad.FRAME_RESOLUTION=1200;var bd=Ad,yd=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))},Sd=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};const{ParametricFilter:Cd}=i,wd=Sd(i,["ParametricFilter"]);class xd{static get UI(){if(!a.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return xd._ui2}static initialize(t){var e;return yd(this,void 0,void 0,(function*(){const n=new xd,o=t.engine||xd.defaultEnginePath,i=!!t.allowThreads,r=null!==(e=t.requestSuffix)&&void 0!==e?e:`?${n.version}`,s=[t.licenseKey,o,window.location.hostname,a.CDN_PATH+a.DEFAULT_WASM_FOLDER,{captureConsole:!1,allowThreads:i,profileTfjsKernels:!1,requestSuffix:r}];return n.bridge=new c(o,{allowSimd:!0,allowThreads:i,requestSuffix:r},s),xd.instance=n,window.scanbotSdk=n,ae.initialize(t.verboseLogging),t.allowThreads&&!Object(u.areThreadsAvailable)()&&(ae.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&ae.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),n}))}createDocumentScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{return e=yield Uu.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createMrzScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{const n=new U(this,this.bridge.postByTransferringArgs("createMRZRecognizer",[null==t?void 0:t.accumulatedFrameVerificationConfiguration]),!0);return e=yield Xu.create(t,n),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createBarcodeScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{return e=yield Nc.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}openCroppingView(t){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield gd.create(t)}))}createTextDataScanner(t){return yd(this,void 0,void 0,(function*(){try{const e={languages:(t=Ht.fromJson(t)).supportedLanguages,ocrResolutionLimit:t.ocrResolutionLimit,validationPattern:t.validationPattern,matchSubstring:t.matchSubstring,allowedCharacters:t.allowedCharacters},n=yield this.createGenericTextLineScanner(t,t.onTextDetected,e,t.validatorPreset);return yield this.licenseCheck(),n}catch(t){throw t}}))}createVINScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{t=Gt.fromJson(t);const n="VehicleIdentificationNumber",o={ocrResolutionLimit:t.ocrResolutionLimit},i=e=>{""!==e.text&&t.onTextDetected(e)};return e=yield this.createGenericTextLineScanner(t,i,o,n),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}toDataUrl(t){return yd(this,void 0,void 0,(function*(){return Xt.throwIfMissingBuffer(t),yield B.toDataUrl(t)}))}applyFilter(t,e){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),Xt.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("applyFilter",[t,e])}))}rotateImageCcw(t,e){return yd(this,void 0,void 0,(function*(){return Xt.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("rotateImageCcw",[t,e])}))}cropAndRotateImageCcw(t,e,n){return yd(this,void 0,void 0,(function*(){return Xt.throwIfMissingBuffer(t),Xt.throwIfMissing(e,"Polygon may not be null"),yield this.bridge.postByCopyingArgs("cropAndRotateImageCcw",[t,e,n])}))}detectDocument(t,e,n,o){return yd(this,void 0,void 0,(function*(){yield this.licenseCheck(),Xt.throwIfMissingBuffer(t);const i=yield this.bridge.postByTransferringArgs("createDocumentDetector",[{useCombinedDetector:!1,acceptedBrightnessThreshold:o||S.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE,acceptedAngleScore:e||S.DEFAULT_ACCEPTED_ANGLE_SCORE,acceptedSizeScore:n||S.DEFAULT_ACCEPTED_SIZE_SCORE}]);return yield this.bridge.postByCopyingArgs("documentDetectorDetect",[i,t])}))}detectAndCropDocument(t){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),Xt.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("detectAndCropDocument",[t])}))}detectBarcodes(t,e,n,o,i){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),Xt.throwIfMissingBuffer(t),new Promise((r=>{const a=document.createElement("canvas"),s=document.createElement("img");s.src=t,s.onload=()=>yd(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 l=t.getImageData(0,0,s.width,s.height),{result:c,originalImage:u}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[l,{engineMode:e,barcodeFormats:n,returnBarcodeImage:o,gs1Handling:i}]);r(F.fromWorker(c,B.convertImageDataWrapperToImageData(u)))}))}))}))}createSimpleMRZRecognizer(){return yd(this,void 0,void 0,(function*(){return new U(this,yield this.bridge.postByTransferringArgs("createMRZRecognizer",[]),!1)}))}createOcrEngine(t){return yd(this,void 0,void 0,(function*(){return new G(this,yield this.bridge.postByCopyingArgs("createOcrEngine",[t]))}))}createDocumentQualityAnalyzer(t){return yd(this,void 0,void 0,(function*(){const e=yield this.bridge.postByTransferringArgs("createDocumentQualityAnalyzer",[null!=t?t:{}]);return new $t(this,e)}))}createImageProcessor(t){return yd(this,void 0,void 0,(function*(){Xt.throwIfMissingBuffer(t);const e=yield this.bridge.postByCopyingArgs("imageProcessorCreate",[t]);return new _(this,e)}))}getLicenseInfo(){return yd(this,void 0,void 0,(function*(){const t=yield this.bridge.postByTransferringArgs("getLicenseInfo",[]);return C.fromJson(t)}))}beginPdf(t={}){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new x(this,yield this.bridge.postByCopyingArgs("beginPdf",[t]))}))}beginTiff(t={}){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new k(this,yield this.bridge.postByCopyingArgs("beginTiff",[t]))}))}get version(){return a.VERSION}get utils(){return this._utils||(this._utils=new D),this._utils}release(t,e){return yd(this,void 0,void 0,(function*(){t&&(console.log("Releasing object: "+e||!1),yield this.bridge.postByTransferringArgs("releaseObject",[t]))}))}licenseCheck(){return yd(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new Yt(t)}))}createGenericTextLineScanner(t,e,n,o){return yd(this,void 0,void 0,(function*(){o&&(n.validatorPreset=o);const i=this.bridge.postByCopyingArgs("createGenericTextLineScanner",[n]),r=new $(this,i);return yield bd.create(t,e,r)}))}}xd.defaultEnginePath="",xd._ui2=a.BUILD_WITH_UI?Tu:void 0,xd.imageFilters=wd;var Ed=xd;const Ld=xd},function(t,e,n){"use strict";n.r(e);var o=/^((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)-.*))$/,i=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){return o.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.default=i}])}));
37
+ }`,l=ze.a.div`position: absolute; animation: ${s} ${i}s;`;return this.previousScale=o,se.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:t=>this.container=t},se.default.createElement(l,{style:{width:this.calculate(t,"width"),height:this.calculate(t,"height"),transform:`rotate(${a}deg) scale(${o})`,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 0;n.width,n.height;return t[e]}calculate(t,e){return t?t[e]:"100%"}}class ud extends se.default.Component{componentDidMount(){Fc.disableScreenMovement()}componentWillUnmount(){Fc.enableScreenMovement()}render(){return se.default.createElement("div",null)}}class dd{constructor(t,e){this.element=t,this.size=e}}class hd{}class pd extends se.default.Component{render(){return se.default.createElement("div",{style:this.props.style},se.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const t=this.half();return se.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 se.default.createElement("line",{x1:0,y1:t,x2:this.props.size,y2:t,stroke:this.props.color,strokeWidth:"2"})}}class fd extends se.default.Component{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}constructor(t){super(t),this.MAX_ROTATIONS=4,this.state={frame:T.empty(),cropImageFitSize:Ze.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}}}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?se.default.createElement("div",{style:this.style().container},se.default.createElement("img",{style:this.style().image,ref:t=>this.destination=t,src:this.props.src,alt:"."}),se.default.createElement(pd,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(t){if(!this.state.visible)return;this.destination.src=t.source.element.src;const e=T.fromPoint(R.scaleUpTo(t.origin,new Ze(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=t.container.width-(this.props.style.margin+this.props.style.size),o=this.isPointTopLeft(t.origin,t.source.size,t.rotations);this.setState({frame:e,cropImageFitSize:t.source.size,rotation:{count:t.rotations,scale:t.scale},margin:{left:o?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 o=t.x,i=t.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?o<a&&i<a:1===r?o<a&&i>e.height-a:2===r?o>e.width-a&&i>e.height-a:o>e.width-a&&i<a}setIsVisible(t,e){this.setState({visible:t},e)}normalizeRotations(t){return t%this.MAX_ROTATIONS}}var md=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class gd extends se.default.Component{constructor(t){super(t),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.state={image:void 0,polygon:void 0,calculatedSize:Ze.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:R.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(t){return md(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,o)=>{Object(se.render)(se.default.createElement(gd,{onReady:n,onError:o,container:e,configuration:ed.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return md(this,void 0,void 0,(function*(){const o=null===(t=this.configuration)||void 0===t?void 0:t.image,i=yield this.detectContour(o);this.setState({image:yield B.toDataUrl(o),polygon:null!==(n=null===(e=this.configuration)||void 0===e?void 0:e.polygon)&&void 0!==n?n:i.polygon,magneticLines:{vertical:{original:i.verticalLines},horizontal:{original:i.horizontalLines}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return md(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(t){return md(this,void 0,void 0,(function*(){Ze.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.initializeSizes())}))}onResize(){const t=this.state.points.map((t=>new R(t.x/this.state.calculatedSize.width,t.y/this.state.calculatedSize.height)));this.initializeSizes(t)}initializeSizes(t,e,n){const o=new Ze(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),i=new Ze(this.container.width(),this.container.height()),r=B.getObjectFitSize(i,o),a=new Ze(r.width,r.height),s=null!=t?t:this.state.polygon,l=Fc.convertToViewportPointsFromParentSize(a,s),c=null!=e?e:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=Fc.convertLinesToViewportLines(a,c),h=Fc.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:l,magneticLines:{horizontal:{original:c,scaled:d},vertical:{original:u,scaled:h}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var t,e,n,o,i,r;const a=Bu.CLASSNAME,s=yc()({[a]:!0,[`${a}-visible`]:!0}),l=this.configuration.style.polygon.width,c=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?l/this.state.animation.scale:l,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return se.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},se.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&se.default.createElement(ud,null),se.default.createElement(fd,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),se.default.createElement(cd,{ref:t=>this.container=t,size:this.state.calculatedSize,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===(o=this.state.animation)||void 0===o?void 0:o.duration,imageMargin:this.state.imageMargin},se.default.createElement(ld,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),se.default.createElement(sd,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${c}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(i=this.state.animation)||void 0===i?void 0:i.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!0,(()=>{var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}))}updateMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}magnifierOptions(t){const e=new hd;return e.source=new dd(this.htmlImage,this.state.calculatedSize),e.container=new Ze(this.container.width(),this.container.height()),e.origin=t.point,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 md(this,void 0,void 0,(function*(){const e=R.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCcwRotations(this.rotations);return{image:yield Ed.instance.cropAndRotateImageCcw(null===(t=this.configuration)||void 0===t?void 0:t.image,e,n),polygon:e,rotations:this.rotations}}))}toCcwRotations(t){return this.MAX_ROTATIONS-t%this.MAX_ROTATIONS}rotate(t){return md(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.state.calculatedSize);this.setState({animation:{rotations:this.rotations+t,scale:e,duration:1}})}))}detect(){var t;return md(this,void 0,void 0,(function*(){const e=yield this.detectContour(null===(t=this.configuration)||void 0===t?void 0:t.image);this.initializeSizes(e.polygon,e.horizontalLines,e.verticalLines)}))}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(se.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=ed.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 Math.min(this.container.width()/t.height,this.container.height()/t.width)}calculateMargin(t){return t.width>t.height?{x:0,y:this.container.height()/2-t.height/2}:{x:this.container.width()/2-t.width/2,y:0}}detectContour(t){return Ed.instance.detectAndCropDocument(t)}}var vd=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class Ad extends Ye{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(t,e,n){return vd(this,void 0,void 0,(function*(){const o=document.getElementById(t.containerId);if(!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,r)=>{Object(se.render)(se.default.createElement(Ad,{container:o,configuration:t,onTextDetected:e,onSuccess:i,onFailure:r,textDataScanner:n}),o)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return vd(this,void 0,void 0,(function*(){Rc.warn("TextData detection resumed"),yield this.resume()}))}pauseDetection(){Rc.warn("TextData detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return vd(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.textDataScanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return vd(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return vd(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.textDataScanner.cleanRecognitionQueue(),this.paused=!0}detect(){var t,e;return vd(this,void 0,void 0,(function*(){const n=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let o=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const i=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Ad.FRAME_RESOLUTION);if(!i)return;n&&this.forceUpdate();const r=yield this.props.textDataScanner.recognize(i);if(!this.enabled)return;if(null===r)return;r&&(o=!0,this.props.onTextDetected(r))}catch(t){console.log(t)}finally{o?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var t;return se.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),se.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},se.default.createElement(qe,{configuration:this.configuration,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&&se.default.createElement(Ke,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Ad.FRAME_RESOLUTION=1200;var bd=Ad,yd=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))},Sd=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};const{ParametricFilter:Cd}=i,wd=Sd(i,["ParametricFilter"]);class xd{static get UI(){if(!a.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return xd._ui2}static initialize(t){var e;return yd(this,void 0,void 0,(function*(){const n=new xd,o=t.engine||xd.defaultEnginePath,i=!!t.allowThreads,r=null!==(e=t.requestSuffix)&&void 0!==e?e:`?${n.version}`,s=[t.licenseKey,o,window.location.hostname,a.CDN_PATH+a.DEFAULT_WASM_FOLDER,{captureConsole:!1,allowThreads:i,profileTfjsKernels:!1,requestSuffix:r}];return n.bridge=new c(o,{allowSimd:!0,allowThreads:i,requestSuffix:r},s),xd.instance=n,window.scanbotSdk=n,ae.initialize(t.verboseLogging),t.allowThreads&&!Object(u.areThreadsAvailable)()&&(ae.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&ae.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),n}))}createDocumentScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{return e=yield Uu.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createMrzScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{const n=new U(this,this.bridge.postByTransferringArgs("createMRZRecognizer",[null==t?void 0:t.accumulatedFrameVerificationConfiguration]),!0);return e=yield Xu.create(t,n),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createBarcodeScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{return e=yield Nc.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}openCroppingView(t){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield gd.create(t)}))}createTextDataScanner(t){return yd(this,void 0,void 0,(function*(){try{const e={languages:(t=Ht.fromJson(t)).supportedLanguages,ocrResolutionLimit:t.ocrResolutionLimit,validationPattern:t.validationPattern,matchSubstring:t.matchSubstring,allowedCharacters:t.allowedCharacters},n=yield this.createGenericTextLineScanner(t,t.onTextDetected,e,t.validatorPreset);return yield this.licenseCheck(),n}catch(t){throw t}}))}createVINScanner(t){return yd(this,void 0,void 0,(function*(){let e;try{t=Gt.fromJson(t);const n="VehicleIdentificationNumber",o={ocrResolutionLimit:t.ocrResolutionLimit},i=e=>{""!==e.text&&t.onTextDetected(e)};return e=yield this.createGenericTextLineScanner(t,i,o,n),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}toDataUrl(t){return yd(this,void 0,void 0,(function*(){return Xt.throwIfMissingBuffer(t),yield B.toDataUrl(t)}))}applyFilter(t,e){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),Xt.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("applyFilter",[t,e])}))}rotateImageCcw(t,e){return yd(this,void 0,void 0,(function*(){return Xt.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("rotateImageCcw",[t,e])}))}cropAndRotateImageCcw(t,e,n){return yd(this,void 0,void 0,(function*(){return Xt.throwIfMissingBuffer(t),Xt.throwIfMissing(e,"Polygon may not be null"),yield this.bridge.postByCopyingArgs("cropAndRotateImageCcw",[t,e,n])}))}detectDocument(t,e,n,o){return yd(this,void 0,void 0,(function*(){yield this.licenseCheck(),Xt.throwIfMissingBuffer(t);const i=yield this.bridge.postByTransferringArgs("createDocumentDetector",[{useCombinedDetector:!1,acceptedBrightnessThreshold:o||S.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE,acceptedAngleScore:e||S.DEFAULT_ACCEPTED_ANGLE_SCORE,acceptedSizeScore:n||S.DEFAULT_ACCEPTED_SIZE_SCORE}]);return yield this.bridge.postByCopyingArgs("documentDetectorDetect",[i,t])}))}detectAndCropDocument(t){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),Xt.throwIfMissingBuffer(t),yield this.bridge.postByCopyingArgs("detectAndCropDocument",[t])}))}detectBarcodes(t,e,n,o,i){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),Xt.throwIfMissingBuffer(t),new Promise((r=>{const a=document.createElement("canvas"),s=document.createElement("img");s.src=t,s.onload=()=>yd(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 l=t.getImageData(0,0,s.width,s.height),{result:c,originalImage:u}=yield this.bridge.postByTransferringArgs("recognizeBarcodes",[l,{engineMode:e,barcodeFormats:n,returnBarcodeImage:o,gs1Handling:i}]);r(F.fromWorker(c,B.convertImageDataWrapperToImageData(u)))}))}))}))}createSimpleMRZRecognizer(){return yd(this,void 0,void 0,(function*(){return new U(this,yield this.bridge.postByTransferringArgs("createMRZRecognizer",[]),!1)}))}createOcrEngine(t){return yd(this,void 0,void 0,(function*(){return new G(this,yield this.bridge.postByCopyingArgs("createOcrEngine",[t]))}))}createDocumentQualityAnalyzer(t){return yd(this,void 0,void 0,(function*(){const e=yield this.bridge.postByTransferringArgs("createDocumentQualityAnalyzer",[null!=t?t:{}]);return new $t(this,e)}))}createImageProcessor(t){return yd(this,void 0,void 0,(function*(){Xt.throwIfMissingBuffer(t);const e=yield this.bridge.postByCopyingArgs("imageProcessorCreate",[t]);return new _(this,e)}))}getLicenseInfo(){return yd(this,void 0,void 0,(function*(){const t=yield this.bridge.postByTransferringArgs("getLicenseInfo",[]);return C.fromJson(t)}))}beginPdf(t={}){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new x(this,yield this.bridge.postByCopyingArgs("beginPdf",[t]))}))}beginTiff(t={}){return yd(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new k(this,yield this.bridge.postByCopyingArgs("beginTiff",[t]))}))}get version(){return a.VERSION}get utils(){return this._utils||(this._utils=new D),this._utils}release(t,e){return yd(this,void 0,void 0,(function*(){t&&(console.log("Releasing object: "+e||!1),yield this.bridge.postByTransferringArgs("releaseObject",[t]))}))}licenseCheck(){return yd(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new Yt(t)}))}createGenericTextLineScanner(t,e,n,o){return yd(this,void 0,void 0,(function*(){o&&(n.validatorPreset=o);const i=this.bridge.postByCopyingArgs("createGenericTextLineScanner",[n]),r=new $(this,i);return yield bd.create(t,e,r)}))}destroy(){this.bridge.destroy(),xd.instance=void 0}}xd.defaultEnginePath="",xd._ui2=a.BUILD_WITH_UI?Tu:void 0,xd.imageFilters=wd;var Ed=xd;const Ld=xd},function(t,e,n){"use strict";n.r(e);var o=/^((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)-.*))$/,i=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){return o.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.default=i}])}));